summaryrefslogtreecommitdiffstats
path: root/WebKitTools
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools')
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json158
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg203
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/default.css524
-rwxr-xr-x[-rw-r--r--]WebKitTools/BuildSlaveSupport/build.webkit.org-config/templates/root.html (renamed from WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html)3
-rw-r--r--WebKitTools/BuildSlaveSupport/built-product-archive36
-rw-r--r--WebKitTools/BuildSlaveSupport/gtk/README52
-rwxr-xr-xWebKitTools/BuildSlaveSupport/gtk/buildbot/log/run38
-rwxr-xr-xWebKitTools/BuildSlaveSupport/gtk/buildbot/run77
-rwxr-xr-xWebKitTools/BuildSlaveSupport/gtk/crashmon/crashmon73
-rwxr-xr-xWebKitTools/BuildSlaveSupport/gtk/crashmon/log/run38
-rwxr-xr-xWebKitTools/BuildSlaveSupport/gtk/crashmon/run74
-rw-r--r--WebKitTools/BuildSlaveSupport/gtk/daemontools-buildbot.conf87
-rwxr-xr-xWebKitTools/BuildSlaveSupport/gtk/pulseaudio/run24
-rwxr-xr-xWebKitTools/BuildSlaveSupport/gtk/xvfb/log/run37
-rwxr-xr-xWebKitTools/BuildSlaveSupport/gtk/xvfb/run41
-rw-r--r--WebKitTools/BuildSlaveSupport/test-result-archive42
-rwxr-xr-xWebKitTools/BuildSlaveSupport/win/kill-old-processes38
-rw-r--r--WebKitTools/CMakeListsEfl.txt59
-rw-r--r--WebKitTools/CSSTestSuiteHarness/harness/harness.css308
-rw-r--r--WebKitTools/CSSTestSuiteHarness/harness/harness.html262
-rw-r--r--WebKitTools/CSSTestSuiteHarness/harness/harness.js1902
-rw-r--r--WebKitTools/ChangeLog29658
-rw-r--r--WebKitTools/ChangeLog-2010-05-2435303
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityController.cpp14
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityController.h1
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityTextMarker.cpp134
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityTextMarker.h105
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp252
-rw-r--r--WebKitTools/DumpRenderTree/AccessibilityUIElement.h51
-rw-r--r--WebKitTools/DumpRenderTree/DumpRenderTree.gypi72
-rw-r--r--WebKitTools/DumpRenderTree/DumpRenderTree.h3
-rw-r--r--WebKitTools/DumpRenderTree/DumpRenderTree.sln11
-rw-r--r--WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj118
-rw-r--r--WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Atomics.h1
-rw-r--r--WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/CurrentTime.h1
-rw-r--r--WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/MainThread.h1
-rw-r--r--WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadSafeShared.h1
-rw-r--r--WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadingPrimitives.h1
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.cpp633
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.h92
-rw-r--r--WebKitTools/DumpRenderTree/PixelDumpSupport.cpp13
-rw-r--r--WebKitTools/DumpRenderTree/PixelDumpSupport.h1
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp (renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp)498
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h (renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h)36
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm102
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp140
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h221
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp (renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp)50
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.h (renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h)0
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp56
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp64
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp72
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp89
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp70
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp70
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp68
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp118
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp73
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp188
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp90
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowRegionIsSetToClipRect.cpp114
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/mac/Info.plist (renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/Info.plist)0
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp (renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp)415
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def (renamed from WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.def)0
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc (renamed from WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.rc)0
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj517
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePluginCommon.vsprops27
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin_debug.def (renamed from WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin_debug.def)0
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.cpp71
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.h50
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/resource.h (renamed from WebKitTools/DumpRenderTree/win/TestNetscapePlugin/resource.h)0
-rw-r--r--WebKitTools/DumpRenderTree/WorkQueueItem.h15
-rw-r--r--WebKitTools/DumpRenderTree/android/get_layout_tests_dir_contents.php110
-rw-r--r--WebKitTools/DumpRenderTree/android/view_source.php53
-rw-r--r--WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp190
-rw-r--r--WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.h8
-rw-r--r--WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.cpp229
-rw-r--r--WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.h41
-rw-r--r--WebKitTools/DumpRenderTree/chromium/AccessibilityController.cpp124
-rw-r--r--WebKitTools/DumpRenderTree/chromium/AccessibilityController.h84
-rw-r--r--WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.cpp585
-rw-r--r--WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.h142
-rw-r--r--WebKitTools/DumpRenderTree/chromium/CppBoundClass.cpp350
-rw-r--r--WebKitTools/DumpRenderTree/chromium/CppBoundClass.h241
-rw-r--r--WebKitTools/DumpRenderTree/chromium/CppVariant.cpp310
-rw-r--r--WebKitTools/DumpRenderTree/chromium/CppVariant.h133
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp161
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h105
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DRTDevToolsCallArgs.cpp36
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DRTDevToolsCallArgs.h65
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DRTDevToolsClient.cpp124
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DRTDevToolsClient.h90
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp214
-rw-r--r--WebKitTools/DumpRenderTree/chromium/EventSender.cpp1008
-rw-r--r--WebKitTools/DumpRenderTree/chromium/EventSender.h163
-rw-r--r--WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp408
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp1568
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestController.h547
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestHelper.mm118
-rw-r--r--WebKitTools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp84
-rw-r--r--WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp156
-rw-r--r--WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h83
-rw-r--r--WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp148
-rw-r--r--WebKitTools/DumpRenderTree/chromium/NotificationPresenter.h77
-rw-r--r--WebKitTools/DumpRenderTree/chromium/PlainTextController.cpp79
-rw-r--r--WebKitTools/DumpRenderTree/chromium/PlainTextController.h52
-rw-r--r--WebKitTools/DumpRenderTree/chromium/Task.cpp72
-rw-r--r--WebKitTools/DumpRenderTree/chromium/Task.h83
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp168
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestEventPrinter.h43
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp277
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestNavigationController.h211
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h9
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h8
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h1
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist60
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.cpp618
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.h220
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp211
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShellMac.mm145
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp244
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestWebWorker.h90
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TextInputController.cpp262
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TextInputController.h74
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp166
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebPreferences.h88
-rwxr-xr-xWebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.cpp523
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h203
-rwxr-xr-xWebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.cpp758
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h97
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp1500
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebViewHost.h321
-rw-r--r--WebKitTools/DumpRenderTree/chromium/config.h56
-rw-r--r--WebKitTools/DumpRenderTree/chromium/fonts.conf155
-rw-r--r--WebKitTools/DumpRenderTree/config.h12
-rw-r--r--WebKitTools/DumpRenderTree/fonts/ColorBits-A.pngbin0 -> 585 bytes
-rw-r--r--WebKitTools/DumpRenderTree/fonts/ColorBits.ttfbin0 -> 1028 bytes
-rw-r--r--WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp6
-rw-r--r--WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp106
-rw-r--r--WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp477
-rw-r--r--WebKitTools/DumpRenderTree/gtk/EventSender.cpp660
-rw-r--r--WebKitTools/DumpRenderTree/gtk/EventSender.h5
-rw-r--r--WebKitTools/DumpRenderTree/gtk/ImageDiff.cpp239
-rw-r--r--WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp393
-rw-r--r--WebKitTools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp59
-rw-r--r--WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp9
-rw-r--r--WebKitTools/DumpRenderTree/gtk/fonts.conf258
-rw-r--r--WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTFbin0 -> 12480 bytes
-rw-r--r--WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf390
-rw-r--r--WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm6
-rw-r--r--WebKitTools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm81
-rw-r--r--WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm606
-rw-r--r--WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig33
-rw-r--r--WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig4
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm289
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm37
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h22
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m2
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm2
-rw-r--r--WebKitTools/DumpRenderTree/mac/EventSendingController.mm143
-rw-r--r--WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm26
-rw-r--r--WebKitTools/DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h1
-rw-r--r--WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm374
-rw-r--r--WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.h47
-rw-r--r--WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.mm112
-rw-r--r--WebKitTools/DumpRenderTree/mac/ObjCController.m33
-rw-r--r--WebKitTools/DumpRenderTree/mac/PixelDumpSupportMac.mm55
-rw-r--r--WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm30
-rw-r--r--WebKitTools/DumpRenderTree/mac/TextInputController.m1
-rw-r--r--WebKitTools/DumpRenderTree/mac/UIDelegate.h4
-rw-r--r--WebKitTools/DumpRenderTree/mac/UIDelegate.mm88
-rw-r--r--WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm76
-rw-r--r--WebKitTools/DumpRenderTree/mac/WorkQueueItemMac.mm9
-rw-r--r--WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro16
-rw-r--r--WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp379
-rw-r--r--WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h58
-rw-r--r--WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp231
-rw-r--r--WebKitTools/DumpRenderTree/qt/EventSenderQt.h32
-rw-r--r--WebKitTools/DumpRenderTree/qt/GCControllerQt.cpp14
-rw-r--r--WebKitTools/DumpRenderTree/qt/GCControllerQt.h4
-rw-r--r--WebKitTools/DumpRenderTree/qt/ImageDiff.cpp12
-rw-r--r--WebKitTools/DumpRenderTree/qt/ImageDiff.pro3
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp441
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h111
-rw-r--r--WebKitTools/DumpRenderTree/qt/PlainTextControllerQt.cpp44
-rw-r--r--WebKitTools/DumpRenderTree/qt/PlainTextControllerQt.h47
-rw-r--r--WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro22
-rw-r--r--WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp29
-rw-r--r--WebKitTools/DumpRenderTree/qt/TextInputControllerQt.h9
-rw-r--r--WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.cpp12
-rw-r--r--WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.h16
-rw-r--r--WebKitTools/DumpRenderTree/qt/main.cpp25
-rw-r--r--WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp140
-rw-r--r--WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp9
-rw-r--r--WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp71
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp124
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj195
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTreeApple.vsprops15
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTreeCFLite.vsprops11
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTreeCairo.vsprops11
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTreeCommon.vsprops28
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h5
-rw-r--r--WebKitTools/DumpRenderTree/win/EditingDelegate.cpp69
-rw-r--r--WebKitTools/DumpRenderTree/win/EditingDelegate.h2
-rw-r--r--WebKitTools/DumpRenderTree/win/EventSender.cpp31
-rw-r--r--WebKitTools/DumpRenderTree/win/EventSender.h2
-rw-r--r--WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp32
-rw-r--r--WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h4
-rw-r--r--WebKitTools/DumpRenderTree/win/ImageDiff.vcproj156
-rw-r--r--WebKitTools/DumpRenderTree/win/ImageDiffCommon.vsprops25
-rw-r--r--WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp341
-rw-r--r--WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp4
-rw-r--r--WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp97
-rw-r--r--WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h20
-rw-r--r--WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj409
-rw-r--r--WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp242
-rwxr-xr-xWebKitTools/DumpRenderTree/win/UIDelegate.cpp30
-rwxr-xr-xWebKitTools/DumpRenderTree/win/UIDelegate.h10
-rw-r--r--WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp16
-rw-r--r--WebKitTools/DumpRenderTree/wscript5
-rw-r--r--WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp22
-rw-r--r--WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp162
-rw-r--r--WebKitTools/DumpRenderTree/wx/WorkQueueItemWx.cpp5
-rw-r--r--WebKitTools/EWSTools/boot.sh (renamed from WebKitTools/pywebsocket/test/testdata/handlers/blank_wsh.py)7
-rwxr-xr-xWebKitTools/EWSTools/create-webkit-git36
-rw-r--r--WebKitTools/EWSTools/screen-config4
-rwxr-xr-xWebKitTools/EWSTools/start-commit-queue.sh38
-rwxr-xr-xWebKitTools/EWSTools/start-queue.sh37
-rw-r--r--WebKitTools/EWSTools/ubuntu-ews-packages61
-rw-r--r--WebKitTools/EWebLauncher/main.c858
-rw-r--r--WebKitTools/FindSafari/FindSafari.vcproj5
-rw-r--r--WebKitTools/FindSafari/FindSafariCommon.vsprops13
-rw-r--r--WebKitTools/GNUmakefile.am77
-rw-r--r--WebKitTools/GtkLauncher/main.c155
-rw-r--r--WebKitTools/Makefile2
-rw-r--r--WebKitTools/MiniBrowser/Configurations/Base.xcconfig65
-rw-r--r--WebKitTools/MiniBrowser/Configurations/DebugRelease.xcconfig40
-rw-r--r--WebKitTools/MiniBrowser/Configurations/MiniBrowser.xcconfig26
-rw-r--r--WebKitTools/MiniBrowser/Configurations/MiniBrowserCFLite.vsprops15
-rw-r--r--WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops16
-rw-r--r--WebKitTools/MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops15
-rw-r--r--WebKitTools/MiniBrowser/Configurations/WebBundle.xcconfig26
-rw-r--r--WebKitTools/MiniBrowser/MBToolbarItem.h28
-rw-r--r--WebKitTools/MiniBrowser/MBToolbarItem.m35
-rw-r--r--WebKitTools/MiniBrowser/Makefile21
-rw-r--r--WebKitTools/MiniBrowser/MiniBrowser.qrc5
-rw-r--r--WebKitTools/MiniBrowser/MiniBrowser.vcproj583
-rw-r--r--WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj421
-rw-r--r--WebKitTools/MiniBrowser/mac/AppDelegate.h44
-rw-r--r--WebKitTools/MiniBrowser/mac/AppDelegate.m275
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserStatisticsWindow.xib974
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.h20
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m58
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindow.xib1558
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindowController.h67
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindowController.m697
-rw-r--r--WebKitTools/MiniBrowser/mac/Info.plist32
-rw-r--r--WebKitTools/MiniBrowser/mac/MainMenu.xib3623
-rw-r--r--WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch38
-rw-r--r--WebKitTools/MiniBrowser/mac/WebBundle/Info.plist22
-rw-r--r--WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m103
-rw-r--r--WebKitTools/MiniBrowser/mac/main.m31
-rwxr-xr-xWebKitTools/MiniBrowser/mac/make-launchable.sh27
-rw-r--r--WebKitTools/MiniBrowser/qt/BrowserView.cpp74
-rw-r--r--WebKitTools/MiniBrowser/qt/BrowserView.h54
-rw-r--r--WebKitTools/MiniBrowser/qt/BrowserWindow.cpp180
-rw-r--r--WebKitTools/MiniBrowser/qt/BrowserWindow.h66
-rw-r--r--WebKitTools/MiniBrowser/qt/MiniBrowser.pro60
-rw-r--r--WebKitTools/MiniBrowser/qt/main.cpp65
-rw-r--r--WebKitTools/MiniBrowser/win/BrowserView.cpp145
-rw-r--r--WebKitTools/MiniBrowser/win/BrowserView.h49
-rw-r--r--WebKitTools/MiniBrowser/win/BrowserWindow.cpp261
-rw-r--r--WebKitTools/MiniBrowser/win/BrowserWindow.h70
-rw-r--r--WebKitTools/MiniBrowser/win/MiniBrowser.cpp84
-rw-r--r--WebKitTools/MiniBrowser/win/MiniBrowser.h55
-rw-r--r--WebKitTools/MiniBrowser/win/MiniBrowser.rc79
-rw-r--r--WebKitTools/MiniBrowser/win/main.cpp62
-rw-r--r--WebKitTools/MiniBrowser/win/resource.h23
-rw-r--r--WebKitTools/MiniBrowser/win/stdafx.cpp33
-rw-r--r--WebKitTools/MiniBrowser/win/stdafx.h30
-rw-r--r--WebKitTools/QtLauncher/QtLauncher.pro36
-rw-r--r--WebKitTools/QtLauncher/main.cpp749
-rw-r--r--WebKitTools/QtLauncher/webview.cpp139
-rw-r--r--WebKitTools/QtTestBrowser/QtTestBrowser.pro61
-rw-r--r--WebKitTools/QtTestBrowser/QtTestBrowser.qrc5
-rw-r--r--WebKitTools/QtTestBrowser/fpstimer.cpp80
-rw-r--r--WebKitTools/QtTestBrowser/fpstimer.h54
-rw-r--r--WebKitTools/QtTestBrowser/launcherwindow.cpp861
-rw-r--r--WebKitTools/QtTestBrowser/launcherwindow.h206
-rw-r--r--WebKitTools/QtTestBrowser/locationedit.cpp (renamed from WebKitTools/QtLauncher/locationedit.cpp)0
-rw-r--r--WebKitTools/QtTestBrowser/locationedit.h (renamed from WebKitTools/QtLauncher/locationedit.h)0
-rw-r--r--WebKitTools/QtTestBrowser/main.cpp258
-rw-r--r--WebKitTools/QtTestBrowser/mainwindow.cpp (renamed from WebKitTools/QtLauncher/mainwindow.cpp)69
-rw-r--r--WebKitTools/QtTestBrowser/mainwindow.h (renamed from WebKitTools/QtLauncher/mainwindow.h)13
-rw-r--r--WebKitTools/QtTestBrowser/urlloader.cpp (renamed from WebKitTools/QtLauncher/urlloader.cpp)53
-rw-r--r--WebKitTools/QtTestBrowser/urlloader.h (renamed from WebKitTools/QtLauncher/urlloader.h)17
-rw-r--r--WebKitTools/QtTestBrowser/useragentlist.txt10
-rw-r--r--WebKitTools/QtTestBrowser/utils.cpp (renamed from WebKitTools/QtLauncher/utils.cpp)4
-rw-r--r--WebKitTools/QtTestBrowser/utils.h (renamed from WebKitTools/QtLauncher/utils.h)12
-rw-r--r--WebKitTools/QtTestBrowser/webinspector.h (renamed from WebKitTools/QtLauncher/webinspector.h)2
-rw-r--r--WebKitTools/QtTestBrowser/webpage.cpp (renamed from WebKitTools/QtLauncher/webpage.cpp)98
-rw-r--r--WebKitTools/QtTestBrowser/webpage.h (renamed from WebKitTools/QtLauncher/webpage.h)10
-rw-r--r--WebKitTools/QtTestBrowser/webview.cpp272
-rw-r--r--WebKitTools/QtTestBrowser/webview.h (renamed from WebKitTools/QtLauncher/webview.h)46
-rw-r--r--WebKitTools/QueueStatusServer/__init__.py29
-rw-r--r--WebKitTools/QueueStatusServer/app.yaml4
-rw-r--r--WebKitTools/QueueStatusServer/handlers/__init__.py2
-rw-r--r--WebKitTools/QueueStatusServer/handlers/dashboard.py29
-rw-r--r--WebKitTools/QueueStatusServer/handlers/nextpatch.py59
-rw-r--r--WebKitTools/QueueStatusServer/handlers/queuestatus.py (renamed from WebKitTools/Scripts/webkitpy/steps/completerollout.py)72
-rw-r--r--WebKitTools/QueueStatusServer/handlers/queuestatus_unittest.py62
-rw-r--r--WebKitTools/QueueStatusServer/handlers/recentstatus.py77
-rw-r--r--WebKitTools/QueueStatusServer/handlers/releasepatch.py62
-rw-r--r--WebKitTools/QueueStatusServer/handlers/statusbubble.py21
-rw-r--r--WebKitTools/QueueStatusServer/handlers/statusbubble_unittest.py (renamed from WebKitTools/Scripts/webkitpy/user_unittest.py)53
-rw-r--r--WebKitTools/QueueStatusServer/handlers/submittoews.py64
-rw-r--r--WebKitTools/QueueStatusServer/handlers/svnrevision.py (renamed from WebKitTools/pywebsocket/example/echo_wsh.py)31
-rw-r--r--WebKitTools/QueueStatusServer/handlers/updatebase.py41
-rw-r--r--WebKitTools/QueueStatusServer/handlers/updatestatus.py23
-rw-r--r--WebKitTools/QueueStatusServer/handlers/updatesvnrevision.py53
-rw-r--r--WebKitTools/QueueStatusServer/handlers/updateworkitems.py66
-rw-r--r--WebKitTools/QueueStatusServer/index.yaml11
-rw-r--r--WebKitTools/QueueStatusServer/main.py20
-rw-r--r--WebKitTools/QueueStatusServer/model/__init__.py2
-rw-r--r--WebKitTools/QueueStatusServer/model/activeworkitems.py89
-rw-r--r--WebKitTools/QueueStatusServer/model/activeworkitems_unitest.py52
-rw-r--r--WebKitTools/QueueStatusServer/model/attachment.py48
-rw-r--r--WebKitTools/QueueStatusServer/model/queuepropertymixin.py39
-rw-r--r--WebKitTools/QueueStatusServer/model/queuepropertymixin_unittest.py52
-rw-r--r--WebKitTools/QueueStatusServer/model/queues.py95
-rw-r--r--WebKitTools/QueueStatusServer/model/queues_unittest.py80
-rw-r--r--WebKitTools/QueueStatusServer/model/queuestatus.py8
-rw-r--r--WebKitTools/QueueStatusServer/model/svnrevision.py35
-rw-r--r--WebKitTools/QueueStatusServer/model/workitems.py69
-rw-r--r--WebKitTools/QueueStatusServer/model/workitems_unittest.py45
-rw-r--r--WebKitTools/QueueStatusServer/stylesheets/dashboard.css35
-rw-r--r--WebKitTools/QueueStatusServer/templates/dashboard.html50
-rw-r--r--WebKitTools/QueueStatusServer/templates/includes/singlequeuestatus.html9
-rw-r--r--WebKitTools/QueueStatusServer/templates/queuestatus.html62
-rw-r--r--WebKitTools/QueueStatusServer/templates/recentstatus.html60
-rw-r--r--WebKitTools/QueueStatusServer/templates/releasepatch.html3
-rw-r--r--WebKitTools/QueueStatusServer/templates/statusbubble.html45
-rw-r--r--WebKitTools/QueueStatusServer/templates/submittoews.html3
-rw-r--r--WebKitTools/QueueStatusServer/templates/updatestatus.html4
-rw-r--r--WebKitTools/QueueStatusServer/templates/updatesvnrevision.html8
-rw-r--r--WebKitTools/QueueStatusServer/templates/updateworkitems.html8
-rw-r--r--WebKitTools/Scripts/VCSUtils.pm997
-rwxr-xr-xWebKitTools/Scripts/build-api-tests70
-rwxr-xr-xWebKitTools/Scripts/build-dumprendertree5
-rwxr-xr-xWebKitTools/Scripts/build-webkit248
-rwxr-xr-xWebKitTools/Scripts/build-webkittestrunner73
-rwxr-xr-xWebKitTools/Scripts/check-Xcode-source-file-types168
-rwxr-xr-xWebKitTools/Scripts/check-for-global-initializers29
-rwxr-xr-xWebKitTools/Scripts/check-for-inappropriate-files-in-framework68
-rwxr-xr-xWebKitTools/Scripts/check-for-webkit-framework-include-consistency111
-rwxr-xr-xWebKitTools/Scripts/check-webkit-style101
-rwxr-xr-xWebKitTools/Scripts/commit-log-editor66
-rwxr-xr-xWebKitTools/Scripts/debug-minibrowser38
-rwxr-xr-xWebKitTools/Scripts/debug-test-runner35
-rwxr-xr-xWebKitTools/Scripts/deduplicate-tests84
-rwxr-xr-xWebKitTools/Scripts/do-file-rename6
-rwxr-xr-xWebKitTools/Scripts/do-webcore-rename98
-rwxr-xr-xWebKitTools/Scripts/ensure-valid-python152
-rwxr-xr-xWebKitTools/Scripts/extract-localizable-strings11
-rwxr-xr-xWebKitTools/Scripts/find-included-framework-headers30
-rwxr-xr-xWebKitTools/Scripts/generate-forwarding-headers.pl99
-rwxr-xr-xWebKitTools/Scripts/new-run-webkit-httpd97
-rwxr-xr-xWebKitTools/Scripts/new-run-webkit-tests41
-rw-r--r--WebKitTools/Scripts/new-run-webkit-websocketserver108
-rwxr-xr-xWebKitTools/Scripts/num-cpus9
-rwxr-xr-xWebKitTools/Scripts/old-run-webkit-tests2481
-rwxr-xr-xWebKitTools/Scripts/prepare-ChangeLog77
-rwxr-xr-xWebKitTools/Scripts/print-vse-failure-logs113
-rwxr-xr-xWebKitTools/Scripts/rebaseline-chromium-webkit-tests8
-rwxr-xr-xWebKitTools/Scripts/resolve-ChangeLogs84
-rwxr-xr-xWebKitTools/Scripts/run-api-tests246
-rwxr-xr-xWebKitTools/Scripts/run-bindings-tests137
-rwxr-xr-xWebKitTools/Scripts/run-chromium-webkit-unit-tests51
-rw-r--r--WebKitTools/Scripts/run-gtk-tests35
-rwxr-xr-xWebKitTools/Scripts/run-launcher6
-rwxr-xr-xWebKitTools/Scripts/run-minibrowser38
-rw-r--r--WebKitTools/Scripts/run-qtwebkit-tests358
-rwxr-xr-xWebKitTools/Scripts/run-test-runner35
-rwxr-xr-xWebKitTools/Scripts/run-test-webkit-api38
-rwxr-xr-xWebKitTools/Scripts/run-webkit-httpd4
-rwxr-xr-xWebKitTools/Scripts/run-webkit-tests2256
-rwxr-xr-xWebKitTools/Scripts/run-webkit-websocketserver41
-rwxr-xr-xWebKitTools/Scripts/sort-Xcode-project-file9
-rwxr-xr-xWebKitTools/Scripts/sunspider-compare-results2
-rwxr-xr-xWebKitTools/Scripts/svn-apply202
-rwxr-xr-xWebKitTools/Scripts/svn-create-patch49
-rwxr-xr-xWebKitTools/Scripts/svn-unapply98
-rwxr-xr-xWebKitTools/Scripts/test-webkitperl16
-rwxr-xr-xWebKitTools/Scripts/test-webkitpy266
-rwxr-xr-xWebKitTools/Scripts/update-iexploder-cssproperties89
-rwxr-xr-x[-rw-r--r--]WebKitTools/Scripts/update-webgl-conformance-tests (renamed from WebKitTools/Scripts/webkitpy/steps/commit.py)17
-rwxr-xr-xWebKitTools/Scripts/update-webkit10
-rwxr-xr-xWebKitTools/Scripts/update-webkit-auxiliary-libs21
-rwxr-xr-xWebKitTools/Scripts/update-webkit-chromium19
-rwxr-xr-xWebKitTools/Scripts/update-webkit-localizable-strings2
-rwxr-xr-xWebKitTools/Scripts/update-webkit-support-libs43
-rwxr-xr-xWebKitTools/Scripts/validate-committer-lists8
-rwxr-xr-xWebKitTools/Scripts/webkit-build-directory20
-rwxr-xr-xWebKitTools/Scripts/webkit-patch97
-rw-r--r--WebKitTools/Scripts/webkitdirs.pm547
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl361
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl117
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl336
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl1098
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl261
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl494
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl8
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl397
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl220
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl743
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl233
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/prepareParsedPatch.pl136
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl (renamed from WebKitTools/Scripts/webkitpy/style/unittests.py)43
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl13
-rw-r--r--WebKitTools/Scripts/webkitperl/VCSUtils_unittest/setChangeLogDateAndReviewer.pl128
-rw-r--r--WebKitTools/Scripts/webkitperl/features.pm1
-rw-r--r--WebKitTools/Scripts/webkitperl/httpd.pm52
-rw-r--r--WebKitTools/Scripts/webkitpy/BeautifulSoup.pycbin74102 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/__init__.py17
-rw-r--r--WebKitTools/Scripts/webkitpy/__init__.pycbin472 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/autoinstall.py335
-rw-r--r--WebKitTools/Scripts/webkitpy/autoinstall.pycbin9596 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/bugzilla.pycbin26413 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/buildbot.py133
-rw-r--r--WebKitTools/Scripts/webkitpy/buildbot.pycbin3525 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/buildbot_unittest.py155
-rw-r--r--WebKitTools/Scripts/webkitpy/changelogs.pycbin3908 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/__init__.pycbin171 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.pycbin1460 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/download.pycbin11970 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/early_warning_system.pycbin4828 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/early_warning_system_unittest.py62
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/queries.py116
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/queries.pycbin6110 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/queues.py295
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/queues.pycbin15126 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/queues_unittest.py102
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/queuestest.py99
-rw-r--r--WebKitTools/Scripts/webkitpy/commands/upload.pycbin17471 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/comments.pycbin775 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/committers.py270
-rw-r--r--WebKitTools/Scripts/webkitpy/committers.pycbin13099 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/common/__init__.py (renamed from WebKitTools/Scripts/webkitpy/commands/__init__.py)0
-rw-r--r--WebKitTools/Scripts/webkitpy/common/array_stream.py66
-rw-r--r--WebKitTools/Scripts/webkitpy/common/array_stream_unittest.py (renamed from WebKitTools/Scripts/webkitpy/steps/steps_unittest.py)80
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/__init__.py3
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/api.py160
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py196
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/changelog.py (renamed from WebKitTools/Scripts/webkitpy/changelogs.py)87
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/changelog_unittest.py (renamed from WebKitTools/Scripts/webkitpy/changelogs_unittest.py)80
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py93
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py61
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/diff_parser.py (renamed from WebKitTools/Scripts/webkitpy/diff_parser.py)27
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py (renamed from WebKitTools/Scripts/webkitpy/diff_parser_unittest.py)0
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/scm.py916
-rw-r--r--WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py1287
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/__init__.py (renamed from WebKitTools/Scripts/webkitpy/style/processors/__init__.py)0
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/build.py138
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/build_unittest.py64
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committers.py331
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committers_unittest.py (renamed from WebKitTools/Scripts/webkitpy/committers_unittest.py)11
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committervalidator.py120
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committervalidator_unittest.py43
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/irc.py (renamed from WebKitTools/pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py)16
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/ports.py (renamed from WebKitTools/Scripts/webkitpy/webkitport.py)95
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py (renamed from WebKitTools/Scripts/webkitpy/webkitport_unittest.py)21
-rw-r--r--WebKitTools/Scripts/webkitpy/common/memoized.py (renamed from WebKitTools/pywebsocket/test/test_util.py)54
-rw-r--r--WebKitTools/Scripts/webkitpy/common/memoized_unittest.py (renamed from WebKitTools/Scripts/webkitpy/patchcollection_unittest.py)50
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla/__init__.py8
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla/attachment.py114
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug.py105
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug_unittest.py (renamed from WebKitTools/Scripts/webkitpy/executive_unittest.py)17
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py (renamed from WebKitTools/Scripts/webkitpy/bugzilla.py)386
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py (renamed from WebKitTools/Scripts/webkitpy/bugzilla_unittest.py)117
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/buildbot.py452
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py410
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/credentials.py (renamed from WebKitTools/Scripts/webkitpy/credentials.py)82
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py (renamed from WebKitTools/Scripts/webkitpy/credentials_unittest.py)79
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/failuremap.py84
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/failuremap_unittest.py76
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/irc/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/irc/ircbot.py91
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy.py (renamed from WebKitTools/pywebsocket/setup.py)55
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py43
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/layouttestresults.py90
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/layouttestresults_unittest.py77
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/networktransaction.py (renamed from WebKitTools/Scripts/webkitpy/networktransaction.py)19
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py (renamed from WebKitTools/Scripts/webkitpy/networktransaction_unittest.py)27
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/regressionwindow.py51
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/statusserver.py160
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/statusserver_unittest.py (renamed from WebKitTools/pywebsocket/test/run_all.py)45
-rw-r--r--WebKitTools/Scripts/webkitpy/common/newstringio.py40
-rw-r--r--WebKitTools/Scripts/webkitpy/common/newstringio_unittest.py46
-rw-r--r--WebKitTools/Scripts/webkitpy/common/prettypatch.py66
-rw-r--r--WebKitTools/Scripts/webkitpy/common/prettypatch_unittest.py70
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/__init__.py1
-rwxr-xr-xWebKitTools/Scripts/webkitpy/common/system/autoinstall.py517
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/deprecated_logging.py (renamed from WebKitTools/Scripts/webkitpy/webkit_logging.py)12
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/deprecated_logging_unittest.py (renamed from WebKitTools/Scripts/webkitpy/webkit_logging_unittest.py)7
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/executive.py399
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/executive_mock.py55
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/executive_unittest.py151
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/file_lock.py83
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/file_lock_unittest.py61
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/filesystem.py117
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py75
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/filesystem_unittest.py157
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/fileutils.py33
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/logtesting.py258
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/logutils.py207
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/logutils_unittest.py142
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/ospath.py83
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/ospath_unittest.py62
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/outputcapture.py (renamed from WebKitTools/Scripts/webkitpy/outputcapture.py)34
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/path.py138
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/path_unittest.py105
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/user.py143
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/user_unittest.py109
-rw-r--r--WebKitTools/Scripts/webkitpy/common/thread/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/common/thread/messagepump.py59
-rw-r--r--WebKitTools/Scripts/webkitpy/common/thread/messagepump_unittest.py83
-rw-r--r--WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue.py (renamed from WebKitTools/pywebsocket/mod_pywebsocket/util.py)45
-rw-r--r--WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py53
-rw-r--r--WebKitTools/Scripts/webkitpy/credentials.pycbin4021 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/executive.py171
-rw-r--r--WebKitTools/Scripts/webkitpy/executive.pycbin4861 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/grammar.pycbin692 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py231
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py210
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py28
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py562
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread_unittest.py49
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py68
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py488
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py214
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream.py104
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream_unittest.py115
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py554
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py610
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py351
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py313
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py83
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py84
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_output.py56
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results.py61
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py52
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_uploader.py71
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py440
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py35
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py38
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/base.py674
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py315
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py449
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py154
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py75
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py141
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py114
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py40
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py185
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py121
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py74
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/config.py170
-rw-r--r--[-rwxr-xr-x]WebKitTools/Scripts/webkitpy/layout_tests/port/config_mock.py (renamed from WebKitTools/Scripts/run-chromium-webkit-tests)33
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/config_standalone.py70
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py183
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py133
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py113
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/factory_unittest.py188
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py122
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py103
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py83
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py132
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock_unittest.py111
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py79
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/lighttpd.conf3
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py405
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/mac_unittest.py81
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py89
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py119
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py225
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/test.py258
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/test_files.py (renamed from WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py)37
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py68
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py510
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py68
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py164
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/port/win.py75
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py610
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py157
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py1624
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py1691
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py633
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py187
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py129
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py47
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py81
-rwxr-xr-xWebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py160
-rw-r--r--WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py102
-rw-r--r--WebKitTools/Scripts/webkitpy/mock.pycbin9932 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/mock_bugzillatool.py368
-rw-r--r--WebKitTools/Scripts/webkitpy/multicommandtool.pycbin13466 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/networktransaction.pycbin2217 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/patchcollection.py65
-rw-r--r--WebKitTools/Scripts/webkitpy/patchcollection.pycbin2353 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/python24/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/python24/versioning.py133
-rw-r--r--WebKitTools/Scripts/webkitpy/python24/versioning_unittest.py134
-rw-r--r--WebKitTools/Scripts/webkitpy/queueengine.pycbin6052 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/scm.py513
-rw-r--r--WebKitTools/Scripts/webkitpy/scm.pycbin26388 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/scm_unittest.py595
-rw-r--r--WebKitTools/Scripts/webkitpy/statusserver.py96
-rw-r--r--WebKitTools/Scripts/webkitpy/statusserver.pycbin3562 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/__init__.py56
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/__init__.pycbin2333 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/abstractstep.pycbin2750 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/applypatch.pycbin1252 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.pycbin1336 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/build.pycbin1563 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/checkstyle.pycbin1520 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.pycbin1652 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.pycbin883 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/closebug.pycbin1575 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.pycbin1535 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/closepatch.pycbin925 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/commit.pycbin838 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/completerollout.pycbin1973 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/confirmdiff.pycbin1266 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/createbug.pycbin1192 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/editchangelog.pycbin866 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.pycbin1670 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.pycbin1336 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/metastep.pycbin1619 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/obsoletepatches.pycbin1486 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/options.pycbin3742 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/postdiff.pycbin1471 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/preparechangelog.pycbin1758 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.pycbin1292 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.pycbin1027 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/revertrevision.pycbin769 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/runtests.pycbin1871 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/update.pycbin1260 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.pycbin2494 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/stepsequence.pycbin2917 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checker.py1119
-rwxr-xr-xWebKitTools/Scripts/webkitpy/style/checker_unittest.py1022
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/common.py (renamed from WebKitTools/Scripts/webkitpy/style/processors/common.py)55
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/common_unittest.py124
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp.py (renamed from WebKitTools/Scripts/webkitpy/style/processors/cpp.py)335
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py (renamed from WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py)450
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/python.py56
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/python_unittest.py62
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/python_unittest_input.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py123
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py168
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/text.py (renamed from WebKitTools/Scripts/webkitpy/style/processors/text.py)19
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/text_unittest.py (renamed from WebKitTools/Scripts/webkitpy/style/processors/text_unittest.py)12
-rw-r--r--WebKitTools/Scripts/webkitpy/style/error_handlers.py137
-rw-r--r--WebKitTools/Scripts/webkitpy/style/error_handlers_unittest.py249
-rw-r--r--WebKitTools/Scripts/webkitpy/style/filereader.py162
-rw-r--r--WebKitTools/Scripts/webkitpy/style/filereader_unittest.py166
-rw-r--r--WebKitTools/Scripts/webkitpy/style/filter.py34
-rw-r--r--WebKitTools/Scripts/webkitpy/style/filter_unittest.py14
-rw-r--r--WebKitTools/Scripts/webkitpy/style/main.py130
-rw-r--r--WebKitTools/Scripts/webkitpy/style/main_unittest.py124
-rw-r--r--WebKitTools/Scripts/webkitpy/style/optparser.py457
-rw-r--r--WebKitTools/Scripts/webkitpy/style/optparser_unittest.py258
-rw-r--r--WebKitTools/Scripts/webkitpy/style/patchreader.py (renamed from WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py)57
-rw-r--r--WebKitTools/Scripts/webkitpy/style/patchreader_unittest.py92
-rw-r--r--WebKitTools/Scripts/webkitpy/style/processors/common_unittest.py82
-rw-r--r--WebKitTools/Scripts/webkitpy/style_references.py42
-rw-r--r--WebKitTools/Scripts/webkitpy/test/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/test/cat.py42
-rw-r--r--WebKitTools/Scripts/webkitpy/test/cat_unittest.py52
-rw-r--r--WebKitTools/Scripts/webkitpy/test/echo.py52
-rw-r--r--WebKitTools/Scripts/webkitpy/test/echo_unittest.py64
-rw-r--r--WebKitTools/Scripts/webkitpy/test/main.py140
-rw-r--r--WebKitTools/Scripts/webkitpy/test/skip.py52
-rw-r--r--WebKitTools/Scripts/webkitpy/test/skip_unittest.py77
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/BeautifulSoup.py (renamed from WebKitTools/Scripts/webkitpy/BeautifulSoup.py)0
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/__init__.py98
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/mock.py (renamed from WebKitTools/Scripts/webkitpy/mock.py)618
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/simplejson/LICENSE.txt (renamed from WebKitTools/simplejson/LICENSE.txt)0
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/simplejson/README.txt (renamed from WebKitTools/simplejson/README.txt)0
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/simplejson/__init__.py (renamed from WebKitTools/simplejson/__init__.py)0
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/simplejson/_speedups.c (renamed from WebKitTools/simplejson/_speedups.c)0
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py (renamed from WebKitTools/simplejson/decoder.py)2
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/simplejson/encoder.py (renamed from WebKitTools/simplejson/encoder.py)0
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/simplejson/jsonfilter.py (renamed from WebKitTools/simplejson/jsonfilter.py)0
-rw-r--r--WebKitTools/Scripts/webkitpy/thirdparty/simplejson/scanner.py (renamed from WebKitTools/simplejson/scanner.py)0
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/__init__.py1
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py196
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py204
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/feeders.py90
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/feeders_unittest.py70
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py109
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/irc_command_unittest.py38
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py (renamed from WebKitTools/Scripts/webkitpy/queueengine.py)61
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py (renamed from WebKitTools/Scripts/webkitpy/queueengine_unittest.py)91
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/sheriff.py91
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/sheriff_unittest.py90
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot.py83
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py95
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/__init__.py12
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py (renamed from WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.py)4
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/commandtest.py (renamed from WebKitTools/Scripts/webkitpy/commands/commandtest.py)18
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/index.html139
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/loupe.js144
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css213
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js399
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js57
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/download.py (renamed from WebKitTools/Scripts/webkitpy/commands/download.py)194
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py (renamed from WebKitTools/Scripts/webkitpy/commands/download_unittest.py)103
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py (renamed from WebKitTools/Scripts/webkitpy/commands/early_warning_system.py)116
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py132
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py (renamed from WebKitTools/Scripts/webkitpy/commands/openbugs.py)8
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/openbugs_unittest.py (renamed from WebKitTools/Scripts/webkitpy/commands/openbugs_unittest.py)4
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/prettydiff.py (renamed from WebKitTools/pywebsocket/test/testdata/handlers/sub/plain_wsh.py)20
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queries.py393
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py (renamed from WebKitTools/Scripts/webkitpy/commands/queries_unittest.py)37
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues.py417
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py378
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py95
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py114
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py38
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py200
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py106
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py57
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/stepsequence.py (renamed from WebKitTools/Scripts/webkitpy/stepsequence.py)18
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/upload.py (renamed from WebKitTools/Scripts/webkitpy/commands/upload.py)122
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py (renamed from WebKitTools/Scripts/webkitpy/commands/upload_unittest.py)78
-rwxr-xr-xWebKitTools/Scripts/webkitpy/tool/comments.py (renamed from WebKitTools/Scripts/webkitpy/comments.py)4
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/grammar.py (renamed from WebKitTools/Scripts/webkitpy/grammar.py)7
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/grammar_unittest.py (renamed from WebKitTools/Scripts/webkitpy/grammar_unittest.py)5
-rwxr-xr-xWebKitTools/Scripts/webkitpy/tool/main.py133
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/mocktool.py676
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/mocktool_unittest.py59
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/multicommandtool.py (renamed from WebKitTools/Scripts/webkitpy/multicommandtool.py)37
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/multicommandtool_unittest.py (renamed from WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py)32
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/__init__.py59
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py (renamed from WebKitTools/Scripts/webkitpy/steps/abstractstep.py)42
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py (renamed from WebKitTools/Scripts/webkitpy/steps/applypatch.py)11
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py (renamed from WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.py)10
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/build.py (renamed from WebKitTools/Scripts/webkitpy/steps/build.py)10
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/checkstyle.py (renamed from WebKitTools/Scripts/webkitpy/steps/checkstyle.py)22
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectory.py (renamed from WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.py)6
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectorywithlocalcommits.py (renamed from WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py)2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/closebug.py (renamed from WebKitTools/Scripts/webkitpy/steps/closebug.py)8
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff.py (renamed from WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.py)10
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py (renamed from WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff_unittest.py)9
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/closepatch.py (renamed from WebKitTools/Scripts/webkitpy/steps/closepatch.py)4
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/commit.py81
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/confirmdiff.py77
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/createbug.py (renamed from WebKitTools/Scripts/webkitpy/steps/createbug.py)15
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/editchangelog.py (renamed from WebKitTools/Scripts/webkitpy/steps/editchangelog.py)5
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py (renamed from WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.py)10
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py (renamed from WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.py)8
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/metastep.py (renamed from WebKitTools/Scripts/webkitpy/steps/metastep.py)2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/obsoletepatches.py (renamed from WebKitTools/Scripts/webkitpy/steps/obsoletepatches.py)10
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/options.py (renamed from WebKitTools/Scripts/webkitpy/steps/options.py)11
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py (renamed from WebKitTools/Scripts/webkitpy/steps/postdiff.py)13
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/postdiffforcommit.py (renamed from WebKitTools/Scripts/webkitpy/steps/postdiffforcommit.py)6
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/postdiffforrevert.py49
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py (renamed from WebKitTools/Scripts/webkitpy/steps/preparechangelog.py)36
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py54
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py (renamed from WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py)11
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/promptforbugortitle.py (renamed from WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.py)2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/reopenbugafterrollout.py (renamed from WebKitTools/Scripts/webkitpy/steps/confirmdiff.py)27
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py (renamed from WebKitTools/Scripts/webkitpy/steps/revertrevision.py)5
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/runtests.py (renamed from WebKitTools/Scripts/webkitpy/steps/runtests.py)41
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py92
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers.py51
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers_unittest.py45
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/update.py (renamed from WebKitTools/Scripts/webkitpy/steps/update.py)11
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py (renamed from WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py)14
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py (renamed from WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py)15
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py71
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer_unittest.py57
-rw-r--r--WebKitTools/Scripts/webkitpy/user.py63
-rw-r--r--WebKitTools/Scripts/webkitpy/user.pycbin1965 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/webkit_logging.pycbin3160 -> 0 bytes
-rw-r--r--WebKitTools/Scripts/webkitpy/webkitport.pycbin7007 -> 0 bytes
-rw-r--r--WebKitTools/TestResultServer/app.yaml19
-rw-r--r--WebKitTools/TestResultServer/handlers/__init__.py1
-rw-r--r--WebKitTools/TestResultServer/handlers/dashboardhandler.py123
-rw-r--r--WebKitTools/TestResultServer/handlers/menu.py63
-rw-r--r--WebKitTools/TestResultServer/handlers/testfilehandler.py229
-rw-r--r--WebKitTools/TestResultServer/index.yaml65
-rw-r--r--WebKitTools/TestResultServer/main.py58
-rw-r--r--WebKitTools/TestResultServer/model/__init__.py1
-rw-r--r--WebKitTools/TestResultServer/model/dashboardfile.py117
-rwxr-xr-xWebKitTools/TestResultServer/model/datastorefile.py150
-rwxr-xr-xWebKitTools/TestResultServer/model/jsonresults.py468
-rwxr-xr-xWebKitTools/TestResultServer/model/jsonresults_unittest.py322
-rw-r--r--WebKitTools/TestResultServer/model/testfile.py127
-rw-r--r--WebKitTools/TestResultServer/stylesheets/dashboardfile.css30
-rw-r--r--WebKitTools/TestResultServer/stylesheets/form.css26
-rw-r--r--WebKitTools/TestResultServer/stylesheets/menu.css28
-rw-r--r--WebKitTools/TestResultServer/stylesheets/testfile.css30
-rw-r--r--WebKitTools/TestResultServer/templates/dashboardfilelist.html38
-rw-r--r--WebKitTools/TestResultServer/templates/menu.html27
-rw-r--r--WebKitTools/TestResultServer/templates/showfilelist.html58
-rw-r--r--WebKitTools/TestResultServer/templates/uploadform.html33
-rw-r--r--WebKitTools/TestWebKitAPI/Configurations/Base.xcconfig71
-rw-r--r--WebKitTools/TestWebKitAPI/Configurations/DebugRelease.xcconfig42
-rw-r--r--WebKitTools/TestWebKitAPI/Configurations/InjectedBundle.xcconfig24
-rw-r--r--WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig26
-rw-r--r--WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICFLite.vsprops11
-rw-r--r--WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops25
-rw-r--r--WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICoreFoundation.vsprops11
-rw-r--r--WebKitTools/TestWebKitAPI/InjectedBundle-Info.plist22
-rw-r--r--WebKitTools/TestWebKitAPI/InjectedBundleController.cpp114
-rw-r--r--WebKitTools/TestWebKitAPI/InjectedBundleController.h64
-rw-r--r--WebKitTools/TestWebKitAPI/InjectedBundleMain.cpp37
-rw-r--r--WebKitTools/TestWebKitAPI/InjectedBundleTest.h70
-rw-r--r--WebKitTools/TestWebKitAPI/Makefile21
-rw-r--r--WebKitTools/TestWebKitAPI/PlatformUtilities.cpp56
-rw-r--r--WebKitTools/TestWebKitAPI/PlatformUtilities.h51
-rw-r--r--WebKitTools/TestWebKitAPI/PlatformWebView.h85
-rw-r--r--WebKitTools/TestWebKitAPI/Test.h86
-rw-r--r--WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj489
-rw-r--r--WebKitTools/TestWebKitAPI/TestWebKitAPIPrefix.h41
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp40
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp65
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp50
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp61
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp69
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/Find.cpp83
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp79
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp79
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp80
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp49
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp146
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp61
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp134
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp52
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp52
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/find.html5
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/icon.pngbin0 -> 36541 bytes
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/simple.html5
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/spacebar-scrolling.html26
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/win/AltKeyGeneratesWMSysCommand.cpp88
-rw-r--r--WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp59
-rw-r--r--WebKitTools/TestWebKitAPI/TestsController.cpp82
-rw-r--r--WebKitTools/TestWebKitAPI/TestsController.h61
-rw-r--r--WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm66
-rw-r--r--WebKitTools/TestWebKitAPI/mac/PlatformWebViewMac.mm97
-rw-r--r--WebKitTools/TestWebKitAPI/mac/main.mm45
-rw-r--r--WebKitTools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp85
-rw-r--r--WebKitTools/TestWebKitAPI/win/PlatformWebViewWin.cpp118
-rw-r--r--WebKitTools/TestWebKitAPI/win/TestWebKitAPI.sln54
-rw-r--r--WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj585
-rw-r--r--WebKitTools/TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj47
-rw-r--r--WebKitTools/TestWebKitAPI/win/WindowMessageObserver.h41
-rwxr-xr-xWebKitTools/TestWebKitAPI/win/copy-resources.cmd24
-rw-r--r--WebKitTools/TestWebKitAPI/win/main.cpp39
-rw-r--r--WebKitTools/WebKitAPITest/TestsController.cpp2
-rw-r--r--WebKitTools/WebKitAPITest/WebKitAPITest.vcproj67
-rw-r--r--WebKitTools/WebKitAPITest/WebKitAPITestCommon.vsprops2
-rw-r--r--WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj7
-rw-r--r--WebKitTools/WebKitLauncherWin/WebKitLauncherWin.vcproj65
-rw-r--r--WebKitTools/WebKitLauncherWin/WebKitLauncherWinCommon.vsprops12
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig71
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig42
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig24
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops12
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops20
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCoreFoundation.vsprops12
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig26
-rw-r--r--WebKitTools/WebKitTestRunner/DerivedSources.make51
-rw-r--r--WebKitTools/WebKitTestRunner/DerivedSources.pro57
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle-Info.plist22
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/ActivateFonts.h35
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm530
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl43
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl34
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h47
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp79
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h57
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl78
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp136
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.h63
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/GCController.cpp74
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/GCController.h54
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp177
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h100
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp37
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp901
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h130
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp269
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h149
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm75
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm59
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp83
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro69
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp74
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp107
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp61
-rw-r--r--WebKitTools/WebKitTestRunner/Makefile21
-rw-r--r--WebKitTools/WebKitTestRunner/PlatformWebView.h73
-rw-r--r--WebKitTools/WebKitTestRunner/StringFunctions.h97
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.cpp394
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.h115
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.cpp202
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.h57
-rw-r--r--WebKitTools/WebKitTestRunner/WebKitTestRunner.pro5
-rw-r--r--WebKitTools/WebKitTestRunner/WebKitTestRunner.sln91
-rw-r--r--WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj582
-rw-r--r--WebKitTools/WebKitTestRunner/WebKitTestRunnerPrefix.h37
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/AHEM____.TTFbin0 -> 12480 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/ColorBits-A.pngbin0 -> 585 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/ColorBits.ttfbin0 -> 1028 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests 2.ttfbin0 -> 28812 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests.ttfbin0 -> 28780 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher100.ttfbin0 -> 28512 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher200.ttfbin0 -> 28512 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher300.ttfbin0 -> 28492 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher400.ttfbin0 -> 28440 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher500.ttfbin0 -> 28424 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher600.ttfbin0 -> 28460 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher700.ttfbin0 -> 28384 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher800.ttfbin0 -> 28492 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher900.ttfbin0 -> 28492 bytes
-rw-r--r--WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm83
-rw-r--r--WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm63
-rw-r--r--WebKitTools/WebKitTestRunner/mac/main.mm37
-rw-r--r--WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp99
-rw-r--r--WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp133
-rw-r--r--WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro68
-rw-r--r--WebKitTools/WebKitTestRunner/qt/main.cpp69
-rw-r--r--WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj558
-rwxr-xr-xWebKitTools/WebKitTestRunner/win/InjectedBundleGenerated.vcproj53
-rw-r--r--WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp98
-rw-r--r--WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp155
-rw-r--r--WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj566
-rw-r--r--WebKitTools/WebKitTestRunner/win/build-generated-files.sh42
-rw-r--r--WebKitTools/WebKitTestRunner/win/main.cpp35
-rw-r--r--WebKitTools/WinLauncher/WinLauncher.cpp7
-rw-r--r--WebKitTools/WinLauncher/WinLauncher.h234
-rw-r--r--WebKitTools/WinLauncher/WinLauncher.vcproj159
-rw-r--r--WebKitTools/WinLauncher/WinLauncherCommon.vsprops24
-rw-r--r--WebKitTools/gdb/webcore.py32
-rw-r--r--WebKitTools/gdb/webkit.py304
-rw-r--r--WebKitTools/iExploder/htdocs/cssproperties.in23
-rw-r--r--WebKitTools/iExploder/htdocs/htmlattrs.in20
-rw-r--r--WebKitTools/iExploder/htdocs/htmltags.in13
-rw-r--r--WebKitTools/pywebsocket/COPYING28
-rw-r--r--WebKitTools/pywebsocket/MANIFEST.in6
-rw-r--r--WebKitTools/pywebsocket/README6
-rw-r--r--WebKitTools/pywebsocket/example/echo_client.py207
-rw-r--r--WebKitTools/pywebsocket/mod_pywebsocket/__init__.py105
-rw-r--r--WebKitTools/pywebsocket/mod_pywebsocket/dispatch.py231
-rw-r--r--WebKitTools/pywebsocket/mod_pywebsocket/handshake.py220
-rw-r--r--WebKitTools/pywebsocket/mod_pywebsocket/headerparserhandler.py99
-rw-r--r--WebKitTools/pywebsocket/mod_pywebsocket/memorizingfile.py81
-rw-r--r--WebKitTools/pywebsocket/mod_pywebsocket/msgutil.py250
-rw-r--r--WebKitTools/pywebsocket/mod_pywebsocket/standalone.py421
-rw-r--r--WebKitTools/pywebsocket/test/config.py45
-rw-r--r--WebKitTools/pywebsocket/test/mock.py205
-rw-r--r--WebKitTools/pywebsocket/test/test_dispatch.py244
-rw-r--r--WebKitTools/pywebsocket/test/test_handshake.py513
-rw-r--r--WebKitTools/pywebsocket/test/test_memorizingfile.py72
-rw-r--r--WebKitTools/pywebsocket/test/test_mock.py126
-rw-r--r--WebKitTools/pywebsocket/test/test_msgutil.py156
-rw-r--r--WebKitTools/pywebsocket/test/testdata/handlers/origin_check_wsh.py42
-rw-r--r--WebKitTools/pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py44
-rw-r--r--WebKitTools/pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py45
-rw-r--r--WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py45
-rw-r--r--WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py45
-rw-r--r--WebKitTools/record-memory-win/record-memory-win.vcproj76
-rw-r--r--WebKitTools/wx/browser/browser.cpp2
-rw-r--r--WebKitTools/wx/browser/wscript7
-rw-r--r--WebKitTools/wx/build/settings.py150
-rw-r--r--WebKitTools/wx/build/waf_extensions.py7
-rw-r--r--WebKitTools/wx/packaging/build-mac-installer.py7
-rw-r--r--WebKitTools/wx/packaging/build-win-installer.py5
986 files changed, 154480 insertions, 35090 deletions
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
index 69ff238..868ee0d 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -1,8 +1,6 @@
{
"slaves": [ { "name": "test-slave", "platform": "*" },
- { "name": "bdash-slave-2", "platform": "mac-tiger" },
-
{ "name": "apple-xserve-1", "platform": "mac-leopard" },
{ "name": "apple-xserve-2", "platform": "mac-leopard" },
{ "name": "apple-xserve-3", "platform": "mac-leopard" },
@@ -10,41 +8,58 @@
{ "name": "apple-xserve-4", "platform": "mac-snowleopard" },
{ "name": "apple-xserve-5", "platform": "mac-snowleopard" },
{ "name": "apple-xserve-6", "platform": "mac-snowleopard" },
+ { "name": "apple-xserve-7", "platform": "mac-snowleopard" },
{ "name": "apple-pixel-1", "platform": "mac-leopard" },
{ "name": "apple-macpro-1", "platform": "mac-snowleopard" },
{ "name": "apple-macpro-2", "platform": "mac-snowleopard" },
+ { "name": "apple-macpro-3", "platform": "mac-snowleopard" },
+ { "name": "apple-macpro-4", "platform": "mac-leopard" },
+ { "name": "apple-macpro-5", "platform": "mac-leopard" },
{ "name": "apple-windows-1", "platform": "win"},
{ "name": "apple-windows-2", "platform": "win"},
{ "name": "apple-windows-3", "platform": "win"},
{ "name": "apple-windows-4", "platform": "win"},
+ { "name": "apple-windows-5", "platform": "win"},
+ { "name": "apple-windows-6", "platform": "win"},
+ { "name": "apple-windows-7", "platform": "win"},
{ "name": "gtk-linux-slave-1", "platform": "gtk"},
{ "name": "gtk-linux-slave-2", "platform": "gtk"},
{ "name": "gtk-linux-slave-3", "platform": "gtk"},
+ { "name": "gtk-linux-slave-4", "platform": "gtk"},
{ "name": "szeged-linux-1", "platform": "qt"},
+ { "name": "szeged-linux-2", "platform": "qt"},
+ { "name": "szeged-linux-3", "platform": "qt"},
+ { "name": "szeged-linux-4", "platform": "qt"},
- { "name": "google-windows-1", "platform": "chromium" },
- { "name": "google-mac-1", "platform": "chromium" },
- { "name": "google-linux-1", "platform": "chromium" }
- ],
+ { "name": "szeged-windows-1", "platform": "qt"},
+ { "name": "szeged-windows-2", "platform": "qt"},
- "builders": [ { "name": "Tiger Intel Release", "type": "BuildAndTest", "builddir": "tiger-intel-release",
- "platform": "mac-tiger", "configuration": "release", "architectures": ["i386"],
- "slavenames": ["bdash-slave-2", "test-slave"]
- },
+ { "name": "google-windows-1", "platform": "chromium-win" },
+ { "name": "google-mac-1", "platform": "chromium-mac" },
+ { "name": "google-linux-1", "platform": "chromium-linux" },
+ { "name": "google-windows-2", "platform": "chromium-win" },
+ { "name": "google-mac-2", "platform": "chromium-mac" },
+ { "name": "google-linux-2", "platform": "chromium-linux" },
+ { "name": "google-new-tests", "platform": "mac-leopard" },
+
+ { "name": "wincairo-1", "platform": "wincairo" },
+
+ { "name": "efl-linux-slave-1", "platform": "efl" }
+ ],
- { "name": "Leopard Intel Release (Build)", "type": "Build", "builddir": "leopard-intel-release",
+ "builders": [ { "name": "Leopard Intel Release (Build)", "type": "Build", "builddir": "leopard-intel-release",
"platform": "mac-leopard", "configuration": "release", "architectures": ["i386"],
"triggers": ["leopard-intel-release-tests"],
"slavenames": ["apple-xserve-1", "apple-xserve-2", "test-slave"]
},
{ "name": "Leopard Intel Release (Tests)", "type": "Test", "builddir": "leopard-intel-release-tests",
"platform": "mac-leopard", "configuration": "release", "architectures": ["i386"],
- "slavenames": ["apple-pixel-1", "test-slave"]
+ "slavenames": ["apple-macpro-4", "apple-pixel-1", "test-slave"]
},
{ "name": "Leopard Intel Debug (Build)", "type": "Build", "builddir": "leopard-intel-debug",
@@ -54,11 +69,11 @@
},
{ "name": "Leopard Intel Debug (Tests)", "type": "Test", "builddir": "leopard-intel-debug-tests",
"platform": "mac-leopard", "configuration": "debug", "architectures": ["i386"],
- "slavenames": ["apple-xserve-3", "test-slave"]
+ "slavenames": ["apple-xserve-3", "test-slave", "apple-macpro-5"]
},
{ "name": "SnowLeopard Intel Release (Build)", "type": "Build", "builddir": "snowleopard-intel-release",
"platform": "mac-snowleopard", "configuration": "release", "architectures": ["x86_64"],
- "triggers": ["snowleopard-intel-release-tests"],
+ "triggers": ["snowleopard-intel-release-tests", "snowleopard-intel-release-tests-wk2"],
"slavenames": ["apple-xserve-4", "test-slave"]
},
{ "name": "SnowLeopard Intel Release (Tests)", "type": "Test", "builddir": "snowleopard-intel-release-tests",
@@ -67,18 +82,22 @@
},
{ "name": "SnowLeopard Intel Leaks", "type": "BuildAndTestLeaks", "builddir": "snowleopard-intel-leaks",
"platform": "mac-snowleopard", "configuration": "debug", "architectures": ["x86_64"],
- "slavenames": ["apple-macpro-1", "test-slave"]
+ "slavenames": ["apple-macpro-1", "apple-macpro-3", "test-slave"]
+ },
+ { "name": "SnowLeopard Intel Release (WebKit2 Tests)", "type": "TestWebKit2", "builddir": "snowleopard-intel-release-tests-wk2",
+ "platform": "mac-snowleopard", "configuration": "release", "architectures": ["x86_64"],
+ "slavenames": ["apple-xserve-7", "test-slave"]
},
{
"name": "Windows Release (Build)", "type": "Build", "builddir": "win-release",
"platform": "win", "configuration": "release", "architectures": ["i386"],
- "triggers": ["win-release-tests"],
+ "triggers": ["win-release-tests", "win-release-tests-wk2"],
"slavenames": ["apple-windows-2", "test-slave"]
},
{
- "name": "Windows Release (Tests)", "type": "Test", "builddir": "win-release-tests",
+ "name": "Windows 7 Release (Tests)", "type": "Test", "builddir": "win-release-tests",
"platform": "win", "configuration": "release", "architectures": ["i386"],
- "slavenames": ["apple-windows-4", "apple-windows-3", "test-slave"]
+ "slavenames": ["apple-windows-5", "apple-windows-6", "test-slave"]
},
{
"name": "Windows Debug (Build)", "type": "Build", "builddir": "win-debug",
@@ -87,12 +106,16 @@
"slavenames": ["apple-windows-1", "test-slave"]
},
{
- "name": "Windows Debug (Tests)", "type": "Test", "builddir": "win-debug-tests",
+ "name": "Windows XP Debug (Tests)", "type": "Test", "builddir": "win-debug-tests",
"platform": "win", "configuration": "debug", "architectures": ["i386"],
- "slavenames": ["apple-windows-4", "apple-windows-3", "test-slave"]
+ "slavenames": ["apple-windows-3", "apple-windows-4", "test-slave"]
+ },
+ { "name": "Windows 7 Release (WebKit2 Tests)", "type": "TestWebKit2", "builddir": "win-release-tests-wk2",
+ "platform": "win", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["apple-windows-7", "test-slave"]
},
{
- "name": "GTK Linux Release", "type": "BuildAndTest", "builddir": "gtk-linux-release",
+ "name": "GTK Linux 32-bit Release", "type": "BuildAndTest", "builddir": "gtk-linux-32-release",
"platform": "gtk", "configuration": "release", "architectures": ["i386"],
"slavenames": ["gtk-linux-slave-1"]
},
@@ -107,34 +130,99 @@
"slavenames": ["gtk-linux-slave-3"]
},
{
+ "name": "GTK Linux 64-bit Release", "type": "BuildAndTest", "builddir": "gtk-linux-64-release",
+ "platform": "gtk", "configuration": "release", "architectures": ["x86_64"],
+ "slavenames": ["gtk-linux-slave-4"]
+ },
+ {
"name": "Qt Linux Release", "type": "BuildAndTest", "builddir": "qt-linux-release",
"platform": "qt", "configuration": "release", "architectures": ["i386"],
"slavenames": ["szeged-linux-1"]
},
{
+ "name": "Qt Linux Release minimal", "type": "Build", "builddir": "qt-linux-release-minimal",
+ "platform": "qt", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["szeged-linux-2"]
+ },
+ {
+ "name": "Qt Linux ARMv5 Release", "type": "Build", "builddir": "qt-linux-armv5-release",
+ "platform": "qt", "configuration": "release", "architectures": ["armv5"],
+ "slavenames": ["szeged-linux-3"]
+ },
+ {
+ "name": "Qt Linux ARMv7 Release", "type": "Build", "builddir": "qt-linux-armv7-release",
+ "platform": "qt", "configuration": "release", "architectures": ["armv7"],
+ "slavenames": ["szeged-linux-4"]
+ },
+ {
+ "name": "Qt Windows 32-bit Release", "type": "Build", "builddir": "qt-windows-32bit-release",
+ "platform": "qt", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["szeged-windows-1"]
+ },
+ {
+ "name": "Qt Windows 32-bit Debug", "type": "Build", "builddir": "qt-windows-32bit-debug",
+ "platform": "qt", "configuration": "debug", "architectures": ["i386"],
+ "slavenames": ["szeged-windows-2"]
+ },
+ {
"name": "Chromium Win Release", "type": "Build", "builddir": "chromium-win-release",
- "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "platform": "chromium-win", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-windows-1"]
},
{
"name": "Chromium Mac Release", "type": "Build", "builddir": "chromium-mac-release",
- "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "platform": "chromium-mac", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-mac-1"]
},
{
"name": "Chromium Linux Release", "type": "Build", "builddir": "chromium-linux-release",
- "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "platform": "chromium-linux", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-linux-1"]
+ },
+ {
+ "name": "Chromium Win Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-win-release-tests",
+ "platform": "chromium-win", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["google-windows-2"]
+ },
+ {
+ "name": "Chromium Mac Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-mac-release-tests",
+ "platform": "chromium-mac", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["google-mac-2"]
+ },
+ {
+ "name": "Chromium Linux Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-linux-release-tests",
+ "platform": "chromium-linux", "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"]
+ },
+ {
+ "name": "WinCairo Debug (Build)", "type": "Build", "builddir": "win-cairo-debug",
+ "platform": "wincairo", "configuration": "debug", "architectures": ["i386"],
+ "slavenames": ["wincairo-1"]
+ },
+ {
+ "name": "EFL Linux Release (Build)", "type": "Build", "builddir": "efl-linux-release",
+ "platform": "efl", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["efl-linux-slave-1"]
}
],
- "schedulers": [ { "type": "AnyBranchScheduler", "name": "trunk", "branches": ["trunk"], "treeStableTimer": 45.0,
- "builderNames": ["Tiger Intel Release", "Leopard Intel Release (Build)", "Leopard Intel Debug (Build)",
+ "schedulers": [ { "type": "AnyBranchScheduler", "name": "trunk", "change_filter": "trunk_filter", "treeStableTimer": 45.0,
+ "builderNames": ["Leopard Intel Release (Build)", "Leopard Intel Debug (Build)",
"SnowLeopard Intel Release (Build)", "SnowLeopard Intel Leaks",
- "Windows Release (Build)", "Windows Debug (Build)",
- "GTK Linux Release", "GTK Linux 32-bit Debug", "GTK Linux 64-bit Debug",
- "Qt Linux Release",
- "Chromium Win Release", "Chromium Mac Release", "Chromium Linux Release"]
+ "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 (Tests)", "Chromium Mac Release (Tests)", "Chromium Linux Release (Tests)",
+ "WinCairo Debug (Build)", "EFL Linux Release (Build)"]
+ },
+ { "type": "PlatformSpecificScheduler", "platform": "win", "branch": "trunk", "treeStableTimer": 45.0,
+ "builderNames": ["Windows Release (Build)", "Windows Debug (Build)"]
},
{ "type": "Triggerable", "name": "leopard-intel-release-tests",
"builderNames": ["Leopard Intel Release (Tests)"]
@@ -145,11 +233,17 @@
{ "type": "Triggerable", "name": "snowleopard-intel-release-tests",
"builderNames": ["SnowLeopard Intel Release (Tests)"]
},
+ { "type": "Triggerable", "name": "snowleopard-intel-release-tests-wk2",
+ "builderNames": ["SnowLeopard Intel Release (WebKit2 Tests)"]
+ },
{ "type": "Triggerable", "name": "win-release-tests",
- "builderNames": ["Windows Release (Tests)"]
+ "builderNames": ["Windows 7 Release (Tests)"]
},
{ "type": "Triggerable", "name": "win-debug-tests",
- "builderNames": ["Windows Debug (Tests)"]
+ "builderNames": ["Windows XP Debug (Tests)"]
+ },
+ { "type": "Triggerable", "name": "win-release-tests-wk2",
+ "builderNames": ["Windows 7 Release (WebKit2 Tests)"]
}
]
}
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index cd81108..c28abb6 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -6,6 +6,7 @@ c = BuildmasterConfig = {}
from buildbot.buildslave import BuildSlave
from buildbot.changes.pb import PBChangeSource
from buildbot.scheduler import AnyBranchScheduler, Triggerable
+from buildbot.schedulers.filter import ChangeFilter
from buildbot.status import html
from buildbot.process import buildstep, factory, properties
from buildbot.steps import master, shell, source, transfer, trigger
@@ -16,6 +17,9 @@ from twisted.internet import defer
import re
import simplejson
+from webkitpy.common.config import build as wkbuild
+from webkitpy.common.net.buildbot import BuildBot as wkbuildbot
+
WithProperties = properties.WithProperties
class ConfigureBuild(buildstep.BuildStep):
@@ -53,17 +57,29 @@ class InstallWin32Dependencies(shell.Compile):
descriptionDone = ["installed dependencies"]
command = ["perl", "./WebKitTools/Scripts/update-webkit-auxiliary-libs"]
+class KillOldProcesses(shell.Compile):
+ name = "kill old processes"
+ description = ["killing old processes"]
+ descriptionDone = ["killed old processes"]
+ command = ["python", "./WebKitTools/BuildSlaveSupport/win/kill-old-processes"]
class InstallChromiumDependencies(shell.ShellCommand):
name = "gclient"
description = ["updating chromium dependencies"]
descriptionDone = ["updated chromium dependencies"]
- command = ["perl", "./WebKitTools/Scripts/update-webkit-chromium"]
+ command = ["perl", "./WebKitTools/Scripts/update-webkit-chromium", "--force"]
haltOnFailure = True
+class CleanupChromiumLinuxCrashLogs(shell.ShellCommand):
+ name = "cleanup crash logs"
+ description = ["removing crash logs"]
+ descriptionDone = ["removed crash logs"]
+ command = ["sh", "-c", "rm -rf /tmp/.org.chromium.*"]
+ haltOnFailure = False
+
def appendCustomBuildFlags(step, platform):
- if platform in ('gtk', 'wx', 'qt', 'chromium'):
+ if platform in ('gtk', 'wx', 'qt', 'chromium', 'wincairo', 'efl'):
step.setCommand(step.command + ['--' + platform])
@@ -116,6 +132,7 @@ class DownloadBuiltProduct(transfer.FileDownload):
slavedest = WithProperties("WebKitBuild/%(configuration)s.zip")
mastersrc = WithProperties("archives/%(fullPlatform)s-%(architecture)s-%(configuration)s/%(got_revision)s.zip")
haltOnFailure = True
+ flunkOnFailure = True
def __init__(self):
transfer.FileDownload.__init__(self, self.mastersrc, self.slavedest)
@@ -174,7 +191,7 @@ class RunWebKitTests(shell.Test):
descriptionDone = ["layout-tests"]
command = ["perl", "./WebKitTools/Scripts/run-webkit-tests", "--no-launch-safari", "--no-new-test-results",
"--no-sample-on-timeout", "--results-directory", "layout-test-results", "--use-remote-links-to-tests",
- WithProperties("--%(configuration)s"), "--exit-after-n-failures", "20"]
+ WithProperties("--%(configuration)s"), "--exit-after-n-crashes-or-timeouts", "20"]
def __init__(self, skipBuild=False, *args, **kwargs):
self.skipBuild = skipBuild
@@ -230,12 +247,131 @@ class RunWebKitTests(shell.Test):
return [self.name]
+class NewRunWebKitTests(RunWebKitTests):
+ command = ["python", "./WebKitTools/Scripts/new-run-webkit-tests", "--noshow-results",
+ "--verbose", "--results-directory", "layout-test-results",
+ "--builder-name", WithProperties("%(buildername)s"),
+ "--build-number", WithProperties("%(buildnumber)s"),
+ "--master-name", "webkit.org",
+ "--test-results-server", "test-results.appspot.com",
+ WithProperties("--%(configuration)s"), "--use-drt"]
+
+
+class RunPythonTests(shell.Test):
+ name = "webkitpy-test"
+ description = ["python-tests running"]
+ descriptionDone = ["python-tests"]
+ command = ["python", "./WebKitTools/Scripts/test-webkitpy"]
+
+
+class RunPerlTests(shell.Test):
+ name = "webkitperl-test"
+ description = ["perl-tests running"]
+ descriptionDone = ["perl-tests"]
+ command = ["perl", "./WebKitTools/Scripts/test-webkitperl"]
+
+
+class RunGtkAPITests(shell.Test):
+ name = "API tests"
+ description = ["API tests running"]
+ descriptionDone = ["API tests"]
+ command = ["perl", "./WebKitTools/Scripts/run-gtk-tests", WithProperties("--%(configuration)s")]
+
+ def commandComplete(self, cmd):
+ shell.Test.commandComplete(self, cmd)
+
+ logText = cmd.logs['stdio'].getText()
+ incorrectLines = []
+ for line in logText.splitlines():
+ if line.startswith('ERROR'):
+ incorrectLines.append(line)
+
+ self.incorrectLines = incorrectLines
+
+ def evaluateCommand(self, cmd):
+ if self.incorrectLines:
+ return FAILURE
+
+ if cmd.rc != 0:
+ return FAILURE
+
+ return SUCCESS
+
+ def getText(self, cmd, results):
+ return self.getText2(cmd, results)
+
+ def getText2(self, cmd, results):
+ if results != SUCCESS and self.incorrectLines:
+ return ["%d API tests failed" % len(self.incorrectLines)]
+
+ return [self.name]
+
+class RunQtAPITests(shell.Test):
+ name = "API tests"
+ description = ["API tests running"]
+ descriptionDone = ["API tests"]
+ command = ["python", "./WebKitTools/Scripts/run-qtwebkit-tests",
+ "--output-file=qt-unit-tests.html", "--do-not-open-results",
+ WithProperties("WebKitBuild/%(configuration_pretty)s/WebKit/qt/tests/")]
+
+ def start(self):
+ self.setProperty("configuration_pretty", self.getProperty("configuration").title())
+ return shell.Test.start(self)
+
+ def commandComplete(self, cmd):
+ shell.Test.commandComplete(self, cmd)
+
+ logText = cmd.logs['stdio'].getText()
+ foundItems = re.findall("TOTALS: (?P<passed>\d+) passed, (?P<failed>\d+) failed, (?P<skipped>\d+) skipped", logText)
+
+ self.incorrectTests = 0
+ self.statusLine = []
+
+ if foundItems:
+ self.incorrectTests = int(foundItems[0][1])
+ if self.incorrectTests > 0:
+ self.statusLine = [
+ "%s passed, %s failed, %s skipped" % (foundItems[0][0], foundItems[0][1], foundItems[0][2])
+ ]
+
+ def evaluateCommand(self, cmd):
+ if self.incorrectTests:
+ return WARNINGS
+
+ if cmd.rc != 0:
+ return FAILURE
+
+ return SUCCESS
+
+ def getText(self, cmd, results):
+ return self.getText2(cmd, results)
+
+ def getText2(self, cmd, results):
+ if results != SUCCESS and self.incorrectTests:
+ return self.statusLine
+
+ return [self.name]
+
class RunWebKitLeakTests(RunWebKitTests):
def start(self):
self.setCommand(self.command + ["--leaks"])
return RunWebKitTests.start(self)
+class RunWebKit2Tests(RunWebKitTests):
+ def start(self):
+ self.setCommand(self.command + ["--webkit-test-runner"])
+ return RunWebKitTests.start(self)
+
+
+class RunChromiumWebKitUnitTests(shell.Test):
+ name = "webkit-unit-tests"
+ description = ["webkit-unit-tests running"]
+ descriptionDone = ["webkit-unit-tests"]
+ command = ["perl", "./WebKitTools/Scripts/run-chromium-webkit-unit-tests",
+ WithProperties("--%(configuration)s")]
+
+
class ArchiveTestResults(shell.ShellCommand):
command = ["python", "./WebKitTools/BuildSlaveSupport/test-result-archive",
WithProperties("--platform=%(platform)s"), WithProperties("--%(configuration)s"), "archive"]
@@ -265,7 +401,7 @@ class ExtractTestResults(master.MasterShellCommand):
return master.MasterShellCommand.start(self)
def finished(self, result):
- url = self.build.getProperties().render(self.resultDirectory).replace("public_html/", "")
+ url = self.build.getProperties().render(self.resultDirectory).replace("public_html/", "/")
self.addURL("view results", url)
result = master.MasterShellCommand.finished(self, result)
self.step_status.setText(["uploaded results"])
@@ -278,8 +414,9 @@ class Factory(factory.BuildFactory):
self.addStep(ConfigureBuild, platform=platform, configuration=configuration, architecture=" ".join(architectures), buildOnly=buildOnly)
self.addStep(CheckOutSource)
if platform == "win":
+ self.addStep(KillOldProcesses)
self.addStep(InstallWin32Dependencies)
- if platform == "chromium":
+ if platform.startswith("chromium"):
self.addStep(InstallChromiumDependencies)
class BuildFactory(Factory):
@@ -292,12 +429,18 @@ class BuildFactory(Factory):
self.addStep(trigger.Trigger, schedulerNames=triggers)
class TestFactory(Factory):
+ TestClass = RunWebKitTests
def __init__(self, platform, configuration, architectures):
Factory.__init__(self, platform, configuration, architectures, False)
self.addStep(DownloadBuiltProduct)
self.addStep(ExtractBuiltProduct)
self.addStep(RunJavaScriptCoreTests, skipBuild=True)
- self.addStep(RunWebKitTests, skipBuild=(platform == 'win'))
+ self.addStep(self.TestClass, skipBuild=(platform == 'win'))
+ # 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.
+ if platform != "mac-tiger":
+ self.addStep(RunPythonTests)
+ self.addStep(RunPerlTests)
self.addStep(ArchiveTestResults)
self.addStep(UploadTestResults)
self.addStep(ExtractTestResults)
@@ -306,26 +449,61 @@ class BuildAndTestFactory(Factory):
TestClass = RunWebKitTests
def __init__(self, platform, configuration, architectures):
Factory.__init__(self, platform, configuration, architectures, False)
+ if platform == "chromium-linux":
+ self.addStep(CleanupChromiumLinuxCrashLogs)
self.addStep(CompileWebKit)
- self.addStep(RunJavaScriptCoreTests)
+ if not platform.startswith("chromium"):
+ self.addStep(RunJavaScriptCoreTests)
+ if platform.startswith("chromium"):
+ self.addStep(RunChromiumWebKitUnitTests)
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.
+ if platform != "mac-tiger":
+ self.addStep(RunPythonTests)
+ self.addStep(RunPerlTests)
self.addStep(ArchiveTestResults)
self.addStep(UploadTestResults)
self.addStep(ExtractTestResults)
+ if platform == "gtk":
+ self.addStep(RunGtkAPITests)
+ if platform == "qt":
+ self.addStep(RunQtAPITests)
class BuildAndTestLeaksFactory(BuildAndTestFactory):
TestClass = RunWebKitLeakTests
+class NewBuildAndTestFactory(BuildAndTestFactory):
+ TestClass = NewRunWebKitTests
+
+class TestWebKit2Factory(TestFactory):
+ TestClass = RunWebKit2Tests
+
+class PlatformSpecificScheduler(AnyBranchScheduler):
+ def __init__(self, platform, branch, **kwargs):
+ self.platform = platform
+ filter = ChangeFilter(branch=[branch, None], filter_fn=self.filter)
+ AnyBranchScheduler.__init__(self, name=platform, change_filter=filter, **kwargs)
+
+ def filter(self, change):
+ return wkbuild.should_build(self.platform, change.files)
+
+trunk_filter = ChangeFilter(branch=["trunk", None])
def loadBuilderConfig(c):
+ # FIXME: These file handles are leaked.
passwords = simplejson.load(open('passwords.json'))
-
config = simplejson.load(open('config.json'))
+ # use webkitpy's buildbot module to test for core builders
+ wkbb = wkbuildbot()
+
c['slaves'] = [BuildSlave(slave['name'], passwords[slave['name']], max_builds=1) for slave in config['slaves']]
c['schedulers'] = []
for scheduler in config['schedulers']:
+ if "change_filter" in scheduler:
+ scheduler["change_filter"] = globals()[scheduler["change_filter"]]
kls = globals()[scheduler.pop('type')]
c['schedulers'].append(kls(**scheduler))
@@ -350,6 +528,10 @@ def loadBuilderConfig(c):
builder["factory"] = factory(*factoryArgs)
+ builder["category"] = "noncore"
+ if wkbb._is_core_builder(builder['name']):
+ builder["category"] = "core"
+
c['builders'].append(builder)
loadBuilderConfig(c)
@@ -363,3 +545,8 @@ c['slavePortnum'] = 17000
c['projectName'] = "WebKit"
c['projectURL'] = "http://webkit.org"
c['buildbotURL'] = "http://build.webkit.org/"
+
+c['buildHorizon'] = 1000
+c['logHorizon'] = 500
+c['eventHorizon'] = 200
+c['buildCacheSize'] = 60
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/default.css b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/default.css
new file mode 100644
index 0000000..4223807
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/default.css
@@ -0,0 +1,524 @@
+div.header { display: none; }
+body > hr { display: none; }
+div.content h1 { display: none; }
+
+body.interface {
+ background: url(bg_gradient.jpg) repeat-x;
+ font-family: Verdana, Cursor;
+ font-size: 10px;
+ font-weight: bold;
+ background-color: #fff;
+ color: #333;
+}
+
+a:link,a:visited,a:active {
+ color: #444;
+}
+
+table {
+ border-spacing: 1px 1px;
+}
+
+table td {
+ padding: 3px 2px 3px 2px;
+}
+
+.Project {
+ min-width: 6em;
+}
+
+.LastBuild,.Activity {
+ padding: 0 0 0 4px;
+}
+
+/* Chromium Specific styles */
+div.BuildResultInfo {
+ color: #444;
+}
+
+div.Announcement {
+ margin-bottom: 1em;
+}
+
+div.Announcement>a:hover {
+ color: black;
+}
+
+div.Announcement>div.Notice {
+ background-color: #afdaff;
+ padding: 0.5em;
+ font-size: 16px;
+ text-align: center;
+}
+
+div.Announcement>div.Open {
+ border: 3px solid #8fdf5f;
+ padding: 0.5em;
+ font-size: 16px;
+ text-align: center;
+}
+
+div.Announcement>div.Closed {
+ border: 5px solid #e98080;
+ padding: 0.5em;
+ font-size: 24px;
+ font-weight: bold;
+ text-align: center;
+}
+
+td.Time {
+ color: #000;
+ border-bottom: 1px solid #aaa;
+ background-color: #eee;
+}
+
+td.Activity,td.Change,td.Builder {
+ color: #333333;
+ background-color: #CCCCCC;
+}
+
+td.Change {
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+}
+
+td.Event {
+ color: #777;
+ background-color: #ddd;
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+}
+
+td.Activity {
+ border-top-left-radius: 10px;
+ -webkit-border-top-left-radius: 10px;
+ -moz-border-radius-topleft: 10px;
+ min-height: 20px;
+ padding: 2px 0 2px 0;
+}
+
+td.idle,td.waiting,td.offline,td.building {
+ border-top-left-radius: 0px;
+ -webkit-border-top-left-radius: 0px;
+ -moz-border-radius-topleft: 0px;
+}
+
+.LastBuild {
+ border-top-left-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ border-top-right-radius: 5px;
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+}
+
+/* Console view styles */
+td.DevRev {
+ padding: 4px 8px 4px 8px;
+ color: #333333;
+ border-top-left-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ background-color: #eee;
+ width: 1%;
+}
+
+td.DevRevCollapse {
+ border-bottom-left-radius: 5px;
+ -webkit-border-bottom-left-radius: 5px;
+ -moz-border-radius-bottomleft: 5px;
+}
+
+td.DevName {
+ padding: 4px 8px 4px 8px;
+ color: #333333;
+ background-color: #eee;
+ width: 1%;
+ text-align: left;
+}
+
+td.DevStatus {
+ padding: 4px 4px 4px 4px;
+ color: #333333;
+ background-color: #eee;
+}
+
+td.DevSlave {
+ padding: 4px 4px 4px 4px;
+ color: #333333;
+ background-color: #eee;
+}
+
+td.first {
+ border-top-left-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+}
+
+td.last {
+ border-top-right-radius: 5px;
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+}
+
+td.DevStatusCategory {
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-width: 1px;
+ border-style: solid;
+}
+
+td.DevStatusCollapse {
+ border-bottom-right-radius: 5px;
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomright: 5px;
+}
+
+td.DevDetails {
+ font-weight: normal;
+ padding: 8px 8px 8px 8px;
+ color: #333333;
+ background-color: #eee;
+ text-align: left;
+}
+
+td.DevComment {
+ font-weight: normal;
+ padding: 8px 8px 8px 8px;
+ color: #333333;
+ border-bottom-right-radius: 5px;
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomright: 5px;
+ border-bottom-left-radius: 5px;
+ -webkit-border-bottom-left-radius: 5px;
+ -moz-border-radius-bottomleft: 5px;
+ background-color: #eee;
+ text-align: left;
+}
+
+td.Alt {
+ background-color: #ddd;
+}
+
+.legend {
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ width: 100px;
+ max-width: 100px;
+ text-align: center;
+ padding: 2px 2px 2px 2px;
+ height: 14px;
+ white-space: nowrap;
+}
+
+.DevStatusBox {
+ text-align: center;
+ height: 20px;
+ padding: 0 2px;
+ line-height: 0;
+ white-space: nowrap;
+}
+
+.DevStatusBox a {
+ opacity: 0.85;
+ border-width: 1px;
+ border-style: solid;
+ border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ display: block;
+ width: 90%;
+ height: 20px;
+ line-height: 20px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.DevSlaveBox {
+ text-align: center;
+ height: 10px;
+ padding: 0 2px;
+ line-height: 0;
+ white-space: nowrap;
+}
+
+.DevSlaveBox a {
+ opacity: 0.85;
+ border-width: 1px;
+ border-style: solid;
+ border-radius: 4px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ display: block;
+ width: 90%;
+ height: 10px;
+ line-height: 20px;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+a.noround {
+ border-radius: 0px;
+ -webkit-border-radius: 0px;
+ -moz-border-radius: 0px;
+ position: relative;
+ margin-top: -8px;
+ margin-bottom: -8px;
+ height: 36px;
+ border-top-width: 0;
+ border-bottom-width: 0;
+}
+
+a.begin {
+ border-top-width: 1px;
+ position: relative;
+ margin-top: 0px;
+ margin-bottom: -7px;
+ height: 27px;
+ border-top-left-radius: 4px;
+ -webkit-border-top-left-radius: 4px;
+ -moz-border-radius-topleft: 4px;
+ border-top-right-radius: 4px;
+ -webkit-border-top-right-radius: 4px;
+ -moz-border-radius-topright: 4px;
+}
+
+a.end {
+ border-bottom-width: 1px;
+ position: relative;
+ margin-top: -7px;
+ margin-bottom: 0px;
+ height: 27px;
+ border-bottom-left-radius: 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -moz-border-radius-bottomleft: 4px;
+ border-bottom-right-radius: 4px;
+ -webkit-border-bottom-right-radius: 4px;
+ -moz-border-radius-bottomright: 4px;
+}
+
+.center_align {
+ text-align: center;
+}
+
+.right_align {
+ text-align: right;
+}
+
+.left_align {
+ text-align: left;
+}
+
+div.BuildWaterfall {
+ border-radius: 7px;
+ -webkit-border-radius: 7px;
+ -moz-border-radius: 7px;
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ background-color: #FFFFFF;
+ padding: 4px 4px 4px 4px;
+ float: left;
+ display: none;
+ border-width: 1px;
+ border-style: solid;
+}
+
+/* LastBuild, BuildStep states */
+.success {
+ color: #FFFFFF;
+ background-color: #8FDF5F;
+ border-color: #4F8530;
+}
+
+.failure {
+ color: #FFFFFF;
+ background-color: #E98080;
+ border-color: #A77272;
+}
+
+.warnings {
+ color: #FFFFFF;
+ background-color: #FFC343;
+ border-color: #C29D46;
+}
+
+.exception {
+ color: #FFFFFF;
+ background-color: #E0B0FF;
+ border-color: #ACA0B3;
+}
+
+.start,.running,td.building {
+ color: #666666;
+ background-color: #FFFC6C;
+ border-color: #C5C56D;
+}
+
+.offline,td.offline {
+ color: #FFFFFF;
+ background-color: #E0B0FF;
+ border-color: #dddddd;
+}
+
+
+.start {
+ border-bottom-left-radius: 10px;
+ -webkit-border-bottom-left-radius: 10px;
+ -moz-border-radius-bottomleft: 10px;
+ border-bottom-right-radius: 10px;
+ -webkit-border-bottom-right-radius: 10px;
+ -moz-border-radius-bottomright: 10px;
+}
+
+.notstarted {
+ border-width: 1px;
+ border-style: solid;
+ border-color: #aaa;
+ background-color: #fff;
+}
+
+.closed {
+ background-color: #ff0000;
+}
+
+.closed .large {
+ font-size: 1.5em;
+ font-weight: bolder;
+}
+
+td.Project a:hover,td.start a:hover {
+ color: #000;
+}
+
+.mini-box {
+ text-align: center;
+ height: 20px;
+ padding: 0 2px;
+ line-height: 0;
+ white-space: nowrap;
+}
+
+.mini-box a {
+ border-radius: 0;
+ -webkit-border-radius: 0;
+ -moz-border-radius: 0;
+ display: block;
+ width: 100%;
+ height: 20px;
+ line-height: 20px;
+ margin-top: -30px;
+}
+
+.mini-closed {
+ -box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ border: 4px solid red;
+}
+
+/* grid styles */
+table.Grid {
+ border-collapse: collapse;
+}
+
+table.Grid tr td {
+ padding: 0.2em;
+ margin: 0px;
+ text-align: center;
+}
+
+table.Grid tr td.title {
+ font-size: 90%;
+ border-right: 1px gray solid;
+ border-bottom: 1px gray solid;
+}
+
+table.Grid tr td.sourcestamp {
+ font-size: 90%;
+}
+
+table.Grid tr td.builder {
+ text-align: right;
+ font-size: 90%;
+}
+
+table.Grid tr td.build {
+ border: 1px gray solid;
+}
+
+/* column container */
+div.column {
+ margin: 0 2em 2em 0;
+ float: left;
+}
+
+/* info tables */
+table.info {
+ border-spacing: 1px;
+}
+
+table.info td {
+ padding: 0.1em 1em 0.1em 1em;
+ text-align: center;
+}
+
+table.info th {
+ padding: 0.2em 1.5em 0.2em 1.5em;
+ text-align: center;
+}
+
+table.info td.left {
+ text-align: left
+}
+
+.alt {
+ background-color: #d6d6d6;
+}
+
+li {
+ padding: 0.1em 1em 0.1em 1em;
+}
+
+.result {
+ padding: 0.3em 1em 0.3em 1em;
+}
+
+/* log view */
+.log * {
+ vlink: #800080;
+ font-family: "Courier New", courier, monotype;
+}
+
+span.stdout {
+ color: black;
+}
+
+span.stderr {
+ color: red;
+}
+
+span.header {
+ color: blue;
+}
+
+/* revision & email */
+.revision .full {
+ display: none;
+}
+
+.user .email {
+ display: none;
+}
+
+/* change comments (use regular colors here) */
+pre.comments>a:link,pre.comments>a:visited {
+ color: blue;
+}
+
+pre.comments>a:active {
+ color: purple;
+}
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/templates/root.html
index b38adc9..c6d2343 100644..100755
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/public_html/index.html
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/templates/root.html
@@ -9,6 +9,8 @@
<h1>Welcome to the Buildbot!</h1>
<ul>
+ <li><a href="console?category=core">Core Console</a></li>
+ <li><a href="waterfall?category=core">Core Waterfall</a></li>
<li><a href="console">Console</a></li>
<li><a href="waterfall">Waterfall Display</a> will give you a time-oriented summary of recent buildbot activity.</li>
<li><a href="one_box_per_builder">Latest Build</a> for each builder is here.</li>
@@ -16,6 +18,7 @@
<li><a href="buildslaves">Buildslave</a> information</li>
<li><a href="http://webkit-commit-queue.appspot.com/">Commit Queue Status</a> information.</li>
<li><a href="changes">ChangeSource</a> information.</li>
+ <li><a href="results">Test Results</a></li>
</ul>
</body> </html>
diff --git a/WebKitTools/BuildSlaveSupport/built-product-archive b/WebKitTools/BuildSlaveSupport/built-product-archive
index ca43dad..b27cf77 100644
--- a/WebKitTools/BuildSlaveSupport/built-product-archive
+++ b/WebKitTools/BuildSlaveSupport/built-product-archive
@@ -48,7 +48,7 @@ def main():
def archiveBuiltProduct(configuration, platform):
- assert platform in ('mac', 'win')
+ assert platform in ('mac', 'win','qt')
archiveFile = os.path.join(buildDirectory, configuration + ".zip")
@@ -81,8 +81,30 @@ def archiveBuiltProduct(configuration, platform):
shutil.rmtree(thinDirectory)
+ elif platform == 'qt':
+ configurationBuildDirectory = os.path.join(buildDirectory, configuration.title())
+ thinDirectory = os.path.join(configurationBuildDirectory, "thin")
+
+ if os.path.isdir(thinDirectory):
+ shutil.rmtree(thinDirectory)
+ os.mkdir(thinDirectory)
+
+ for dirname in ["bin", "lib", "JavaScriptCore"]:
+ fromDir = os.path.join(configurationBuildDirectory, dirname)
+ toDir = os.path.join(thinDirectory, dirname)
+ if subprocess.call(["cp", "-R", fromDir, toDir]):
+ return 1
+
+ for root, dirs, files in os.walk(thinDirectory, topdown=False):
+ for name in files:
+ if name.endswith(".o"):
+ os.remove(os.path.join(root, name))
+
+ if subprocess.call(["zip", "-y", "-r", archiveFile, "."], cwd=thinDirectory):
+ return 1
+
def extractBuiltProduct(configuration, platform):
- assert platform in ('mac', 'win')
+ assert platform in ('mac', 'win','qt')
archiveFile = os.path.join(buildDirectory, configuration + ".zip")
@@ -112,7 +134,15 @@ def extractBuiltProduct(configuration, platform):
if subprocess.call(["unzip", "-o", archiveFile], cwd=buildDirectory):
return 1
-
+ elif platform == 'qt':
+ configurationBuildDirectory = os.path.join(buildDirectory, configuration.title())
+
+ if os.path.isdir(configurationBuildDirectory):
+ shutil.rmtree(configurationBuildDirectory)
+
+ if subprocess.call(["unzip", "-o", archiveFile, "-d", configurationBuildDirectory], cwd=buildDirectory):
+ return 1
+ os.unlink(archiveFile)
if __name__ == '__main__':
sys.exit(main())
diff --git a/WebKitTools/BuildSlaveSupport/gtk/README b/WebKitTools/BuildSlaveSupport/gtk/README
new file mode 100644
index 0000000..9e58ae2
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/README
@@ -0,0 +1,52 @@
+==============================================
+ Running a GTK+ build slave under daemontools
+==============================================
+
+This directory contains several scripts which can be used to run a WebKitGTK+
+build slave under daemontools [1]. This is convenient because daemontools
+will automatically restart services when they die, and that means less human
+intervention is needed.
+
+
+Dependencies
+============
+
+In order to use the provided service control files, you will need the
+following:
+
+* The GNU Bash shell (the scripts contain some bash-isms)
+
+* The daemontools package (or one of its drop-in replacements, like runit
+ or freedt; but only daemontools has been tested so far).
+
+* The crash dump monitor also uses "inotifywait" (part of inotify-tools [2])
+
+In short, in a Debian-based system you can ensure you have the needed bits
+with the following command:
+
+ apt-get install inotify-tools daemontools-run
+
+
+Setup
+=====
+
+1. Follow the instructions at http://trac.webkit.org/wiki/BuildBot
+
+2. Install the dependencies outlined above.
+
+3. Copy "daemontools-buildbot.conf" to "/etc/daemontools-buildbot.conf"
+
+4. Edit the configuration file to suit your needs, the comments should
+ be self-explanatory.
+
+5. Drop the "buildbot", "pulseaudio" and "xvfb" directories (plus
+ "crashmon", if desired) to the service control directory of
+ daemontools; for Debian-based setups that would be "/etc/service"
+
+
+References
+==========
+
+[1] http://cr.yp.to/daemontools.html
+[2] http://wiki.github.com/rvoicilas/inotify-tools/
+
diff --git a/WebKitTools/BuildSlaveSupport/gtk/buildbot/log/run b/WebKitTools/BuildSlaveSupport/gtk/buildbot/log/run
new file mode 100755
index 0000000..cc2c87e
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/buildbot/log/run
@@ -0,0 +1,38 @@
+#! /bin/bash
+#
+# Copyright (C) 2010 Igalia S.L. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf}
+
+# Read configuration file
+[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}"
+
+: ${buildbot_user:=${HOME}}
+: ${buildbot_log_path:=/var/log/buildbot}
+
+# Expand all "env_*" environment variables
+for varname in ${!env_*} ; do
+ eval "export ${varname#env_}=\${${varname}}"
+done
+
+mkdir -p "${buildbot_log_path}"
+chown "${buildbot_user}" "${buildbot_log_path}"
+
+exec /usr/bin/setuidgid "${buildbot_user}" \
+ /usr/bin/multilog t "${buildbot_log_path}"
+
diff --git a/WebKitTools/BuildSlaveSupport/gtk/buildbot/run b/WebKitTools/BuildSlaveSupport/gtk/buildbot/run
new file mode 100755
index 0000000..b26fe58
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/buildbot/run
@@ -0,0 +1,77 @@
+#! /bin/bash
+#
+# Copyright (C) 2010 Igalia S.L. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+exec 2>&1
+
+: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf}
+
+# Read configuration file
+[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}"
+
+# Expand all "env_*" environment variables
+for varname in ${!env_*} ; do
+ eval "export ${varname#env_}=\${${varname}}"
+done
+
+
+if ! [ "${buildbot_path}" ] ; then
+ echo "No \${buildbot_path} defined! (will sleep for 5 minutes)"
+ sleep 300
+ exit 111
+fi
+
+
+if ! [ "${WEBKIT_TESTFONTS}" ] ; then
+ echo "No \${WEBKIT_TESTFONTS} environment variable! (will sleep for 5 minutes)"
+ sleep 300
+ exit 111
+fi
+
+
+if [ "${coredump_output:=''}" ] ; then
+ # Ensure that the output directory exists.
+ if [[ ! -d ${crashmon_output} ]] ; then
+ mkdir -p "${crashmon_output}"
+ fi
+
+ ulimit -c "${crashmon_max_size:=unlimited}"
+fi
+
+
+if [ "${ccache_path}" ] ; then
+ export PATH="${ccache_path}:${PATH}"
+fi
+
+: ${buildbot_user:=${USER}}
+
+cd "${buildbot_path}"
+exec /usr/bin/env - \
+ TERM=dumb \
+ TZ=PST8PDT \
+ PATH="${PATH}" \
+ SHELL=/bin/bash \
+ LANG=en_US.UTF-8 \
+ USER="${buildbot_user}" \
+ LOGNAME="${buildbot_user}" \
+ HOME="/home/${buildbot_user}" \
+ DISPLAY="${xvfb_display:-':10'}" \
+ MAIL="/var/mail/${buildbot_user}" \
+ /usr/bin/setuidgid "${buildbot_user}" \
+ /usr/bin/twistd -noy buildbot.tac
+
diff --git a/WebKitTools/BuildSlaveSupport/gtk/crashmon/crashmon b/WebKitTools/BuildSlaveSupport/gtk/crashmon/crashmon
new file mode 100755
index 0000000..41705a2
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/crashmon/crashmon
@@ -0,0 +1,73 @@
+#! /bin/bash
+#
+# Copyright (C) 2010 Carlos Lopez <clopez@igalia.com>, Igalia S.L.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+set -e
+
+[ "${coredir}" ] || {
+ echo "Env var '\${coredir}' not defined!" >&2
+ exit 111
+}
+[ "${programpath}" ] || {
+ echo "Env var '\${programpath}' not defined" >&2
+ exit 111
+}
+[ "${arch}" ] || {
+ echo "Env var '\${arch}' not defined" >&2
+ exit 111
+}
+[ "${mailto}" ] || {
+ echo "Env var '\${mailto}' not defined" >&2
+ exit 111
+}
+
+
+inotifywait -q -m --format '%f' --exclude '.trace.html$' -e close_write "${coredir}" | \
+while read -r coredump
+do
+ if grep -qE '^core-when_[[:digit:]]{10\,12}-_-who_[[:print:]]+-_-why_' <<< "${coredump}"
+ then
+ # Get revision number from Subversion sources
+ rev=$(cd "${crashmon_src_path}" && svn info | sed -e '/^Revision:/s/Revision: //p' -e d)
+
+ # Get the who from the coredump name
+ programfile=$(echo "${coredump}" \
+ | awk -F'-_-who_' '{ print $2 }'\
+ | awk -F'-_-why_' '{ print $1 }')
+
+ # Sometimes programfile gets cut when it is a long name:
+ # Search using wildcards
+ fullprogrampath=$(find "${programpath}" -executable -name "${programfile}"\* | head -n1)
+
+ ( printf "<html><head><title>StackTrace for ${programfile} from svn"
+ printf " rev ${rev}</title></head>\n<body>Core dump file: "
+ printf "<a href=\"cores/${coredump}\">${coredump}</a><br/>\n"
+ printf "<pre>Executable crashed: ${fullprogrampath}</pre>\n"
+ printf "<br/><hr><b>Stack Trace:</b><hr><br/>\n<pre>"
+
+ gdb -ex "thread apply all bt" --batch "${fullprogrampath}" "${coredump}" 2>&1 \
+ | sed -e 's/\&/\&amp/g;s/</\&lt;/g;s/>/\&gt;/g;s/\"/\&quot;/g' -e "s/'/\&\#039;/g"
+
+ printf "</pre></body></html>\n"
+ ) > "/var/www/svn_${rev}.${coredump}.trace.html"
+
+ # Make sure the web server can read it
+ chmod 644 "${coredump}"
+ fi
+done
+
diff --git a/WebKitTools/BuildSlaveSupport/gtk/crashmon/log/run b/WebKitTools/BuildSlaveSupport/gtk/crashmon/log/run
new file mode 100755
index 0000000..4dcd71f
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/crashmon/log/run
@@ -0,0 +1,38 @@
+#! /bin/bash
+#
+# Copyright (C) 2010 Igalia S.L. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf}
+
+# Read configuration file
+[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}"
+
+: ${buildbot_user:=${HOME}}
+: ${crashmon_log_path:=/var/log/crashmon}
+
+# Expand all "env_*" environment variables
+for varname in ${!env_*} ; do
+ eval "export ${varname#env_}=\${${varname}}"
+done
+
+mkdir -p "${crashmon_log_path}"
+chown "${buildbot_user}" "${crashmon_log_path}"
+
+exec /usr/bin/setuidgid "${buildbot_user}" \
+ /usr/bin/multilog t "${crashmon_log_path}"
+
diff --git a/WebKitTools/BuildSlaveSupport/gtk/crashmon/run b/WebKitTools/BuildSlaveSupport/gtk/crashmon/run
new file mode 100755
index 0000000..38be3fe
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/crashmon/run
@@ -0,0 +1,74 @@
+#! /bin/bash
+#
+# Copyright (C) 2010 Igalia S.L. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+exec 2>&1
+
+: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf}
+
+# Read configuration file
+[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}"
+
+: ${buildbot_user:=${USER:-${LOGNAME}}}
+: ${crashmon_output:=''}
+
+# Expand all "env_*" environment variables
+for varname in ${!env_*} ; do
+ eval "export ${varname#env_}=\${${varname}}"
+done
+
+
+if [ ! -d "${crashmon_output}" ]
+then
+ if ! [ "${crashmon_output}" ]
+ then
+ echo "Dump directory '${crashmon_output}' does not exist (sleeping)"
+ fi
+ sleep $(( 60 * 60 * 4 ))
+ exit 111
+fi
+
+
+if ! [ "${buildbot_bits}" ]
+then
+ # Guess bits (32/64) from uname -m
+ machine=$(uname -m)
+ case ${machine} in
+ x86_64 | amd64 | ia64 | ppc64)
+ buildbot_bits="64" ;;
+ *)
+ buildbot_bits="32" ;;
+ esac
+fi
+
+: ${crashmon_bin_path:="${buildbot_path}/gtk-linux-${buildbot_bits}-debug/build/WebKitBuild/Debug/Programs"}
+
+
+cd "${crashmon_output}"
+exec /usr/bin/env - \
+ PATH="${PATH}" \
+ SHELL="/bin/bash" \
+ USER="${buildbot_user}" \
+ arch="${buildbot_bits}" \
+ LOGNAME="${buildbot_user}" \
+ coredir="${crashmon_output}" \
+ HOME="/home/${buildbot_user}" \
+ mailto="${crashmon_mailto:-''}" \
+ programpath="${crashmon_bin_path}" \
+ /usr/bin/setuidgid "${buildbot_user}" "$(pwd)/crashmon"
+
diff --git a/WebKitTools/BuildSlaveSupport/gtk/daemontools-buildbot.conf b/WebKitTools/BuildSlaveSupport/gtk/daemontools-buildbot.conf
new file mode 100644
index 0000000..59c1c0b
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/daemontools-buildbot.conf
@@ -0,0 +1,87 @@
+# Copyright (C) 2010 Igalia S.L. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+
+# Path to the Buildbot slave directory
+#
+buildbot_path="/home/slave/webkitgtk"
+
+# User account used to run Buildbot.
+#
+buildbot_user="slave"
+
+# Path to a directory where to log Buildbot output
+#
+buildbot_log_path="/var/log/buildbot"
+
+
+# Display number under which Xvfb will run
+#
+xvfb_display=":10"
+
+# Graphical mode which Xvfb will report to applications
+#
+xvfb_mode="1024x768x24"
+
+# Path to a directory where to log Xvfb error output
+#
+xvfb_log_path="/var/log/xvfb"
+
+
+# Output directory for core dumps. Set this to an empty string to
+# disable recording them.
+#
+crashmon_output="/var/www/webkitgtk-coredumps"
+
+# Maximum size of core dumps. With the default "unlimited" setting
+# it is recommended to have ~20GB for cores in 64-bit machines.
+# For 32-bit bots, less space is needed.
+#
+crashmon_max_size="unlimited"
+
+# Path to a directory where to log crashmon output
+#
+crashmon_log_path="/var/log/crashmon"
+
+# A list of e-mail addresses where to send notifications of core dumps.
+# Leave empty to disable mail notifications.
+#
+# WARNING: E-mail addresses will be flooded with messages!
+#
+crashmon_mailto=""
+
+# Base directory where to find sources and built binaries of which
+# crash dumps are to be catched. Usually you will not need to change this.
+#
+crashmon_src_path="${buildbot_path}/gtk-linux-${buildbot_bits}-debug/build"
+crashmon_bin_path="${crashmon_src_path}/WebKitBuild/Debug/Programs"
+
+
+# If you want to use ccache, set a path to where synlinks with tool
+# names pointing to ccache are installed. In Debian systems this
+# would be /usr/lib/ccache. Set to empty to disable.
+#
+ccache_path="/usr/lib/ccache"
+
+
+# Environment variables. Prefix them with "env_".
+#
+env_CFLAGS="-pipe"
+env_CXXFLAGS="-pipe"
+env_WebKitMakeArguments="-j3"
+env_WEBKIT_TESTFONTS="/home/${buildbot_user}/testfonts"
+
diff --git a/WebKitTools/BuildSlaveSupport/gtk/pulseaudio/run b/WebKitTools/BuildSlaveSupport/gtk/pulseaudio/run
new file mode 100755
index 0000000..37ba0de
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/pulseaudio/run
@@ -0,0 +1,24 @@
+#! /bin/bash
+#
+# Copyright (C) 2010 Igalia S.L. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+exec 2>&1
+exec /usr/bin/pulseaudio --system \
+ --disallow-exit --disallow-module-loading \
+ --log-target=syslog
+
diff --git a/WebKitTools/BuildSlaveSupport/gtk/xvfb/log/run b/WebKitTools/BuildSlaveSupport/gtk/xvfb/log/run
new file mode 100755
index 0000000..1c83922
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/xvfb/log/run
@@ -0,0 +1,37 @@
+#! /bin/bash
+#
+# Copyright (C) 2010 Igalia S.L. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf}
+
+# Read configuration file
+[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}"
+
+: ${buildbot_user:=${HOME}}
+: ${xvfb_log_path:=/var/log/xvfb}
+
+# Expand all "env_*" environment variables
+for varname in ${!env_*} ; do
+ eval "export ${varname#env_}=\${${varname}}"
+done
+
+mkdir -p "${xvfb_log_path}"
+chown "${buildbot_user}" "${xvfb_log_path}"
+
+exec /usr/bin/setuidgid "${buildbot_user}" \
+ /usr/bin/multilog t "${xvfb_log_path}"
diff --git a/WebKitTools/BuildSlaveSupport/gtk/xvfb/run b/WebKitTools/BuildSlaveSupport/gtk/xvfb/run
new file mode 100755
index 0000000..89cd301
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/gtk/xvfb/run
@@ -0,0 +1,41 @@
+#! /bin/bash
+#
+# Copyright (C) 2010 Igalia S.L. All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+exec 2>&1
+
+: ${BUILDBOT_CONFIG:=/etc/daemontools-buildbot.conf}
+
+# Read configuration file
+[ -r "${BUILDBOT_CONFIG}" ] && . "${BUILDBOT_CONFIG}"
+
+: ${xvfb_display:=':10'}
+: ${xvfb_mode:='1024x768x24'}
+
+# Expand all "env_*" environment variables
+for varname in ${!env_*} ; do
+ eval "export ${varname#env_}=\${${varname}}"
+done
+
+mkdir -p "xvfb${xvfb_display}"
+exec /usr/bin/Xvfb "${xvfb_display}" \
+ -fbdir "xvfb${xvfb_display}" \
+ -screen 0 "${xvfb_mode}" \
+ -nolisten inet6 \
+ -nolisten inet
+
diff --git a/WebKitTools/BuildSlaveSupport/test-result-archive b/WebKitTools/BuildSlaveSupport/test-result-archive
index 3b019c0..af66bf0 100644
--- a/WebKitTools/BuildSlaveSupport/test-result-archive
+++ b/WebKitTools/BuildSlaveSupport/test-result-archive
@@ -23,10 +23,9 @@
# (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 optparse, os, shutil, subprocess, sys
+import optparse, os, shutil, subprocess, sys, zipfile
sourceRootDirectory = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
-layoutTestResultsDir = os.path.abspath(os.path.join(sourceRootDirectory, "layout-test-results"))
archiveFile = os.path.join(sourceRootDirectory, "layout-test-results.zip")
def main():
@@ -43,10 +42,17 @@ def main():
if action not in ('archive'):
parser.error("Action is required")
- return archiveTestResults(options.configuration, options.platform)
+ layoutTestResultsDir = os.path.abspath(os.path.join(sourceRootDirectory, "layout-test-results"))
+ if options.platform == 'chromium':
+ # See results_directory() in webkitpy/layout_tests/port/chromium.py.
+ layoutTestResultsDir = os.path.abspath(os.path.join(sourceRootDirectory,
+ "WebKit", "chromium", "webkit", options.configuration.capitalize(),
+ "layout-test-results"))
-def archiveTestResults(configuration, platform):
- assert platform in ('mac', 'win', 'gtk', 'qt')
+ return archiveTestResults(options.configuration, options.platform, layoutTestResultsDir)
+
+def archiveTestResults(configuration, platform, layoutTestResultsDir):
+ assert platform in ('mac', 'win', 'gtk', 'qt', 'chromium')
try:
os.unlink(archiveFile)
@@ -69,6 +75,11 @@ def archiveTestResults(configuration, platform):
elif platform in ('win', 'gtk', 'qt'):
if subprocess.call(["zip", "-r", archiveFile, "."], cwd=layoutTestResultsDir):
return 1
+ elif platform == 'chromium':
+ cwd = os.getcwd()
+ os.chdir(layoutTestResultsDir)
+ zipFilesRecursively(archiveFile, ["."])
+ os.chdir(cwd)
try:
shutil.rmtree(layoutTestResultsDir)
@@ -82,5 +93,26 @@ def archiveTestResults(configuration, platform):
if e.errno != 90:
raise
+def zipFilesRecursively(archiveFile, files):
+ """Make a zip archive.
+
+ Args:
+ archiveFile: The resultant zip archive file name.
+ files: A list of files to be archived. If a list item is a directory,
+ files in the directory are archived recursively."""
+ zipper = zipfile.ZipFile(archiveFile, 'w', zipfile.ZIP_DEFLATED)
+ for file in files:
+ if os.path.isdir(file):
+ for dirPath, dirNames, fileNames in os.walk(file):
+ for fileName in fileNames:
+ relativePath = os.path.join(dirPath, fileName)
+ print "Adding", relativePath
+ zipper.write(relativePath)
+ else:
+ print "Adding", file
+ zipper.write(file)
+ zipper.close()
+ print "Created zip archive: ", archiveFile
+
if __name__ == '__main__':
sys.exit(main())
diff --git a/WebKitTools/BuildSlaveSupport/win/kill-old-processes b/WebKitTools/BuildSlaveSupport/win/kill-old-processes
new file mode 100755
index 0000000..6760e08
--- /dev/null
+++ b/WebKitTools/BuildSlaveSupport/win/kill-old-processes
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+
+# 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 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 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 os, sys
+
+def main():
+ tasksToKill = ["DumpRenderTree.exe", "DumpRenderTree_debug.exe", "testapi.exe", "testapi_debug.exe",
+ "svn.exe", "httpd.exe", "cl.exe", "link.exe", "midl.exe", "devenv.exe", "perl.exe",
+ "imagediff.exe", "imagediff_debug.exe", "jsc.exe", "jsc_debug.exe", "WebKit2WebProcess.exe",
+ "WebKit2WebProcess_debug.exe", "WebKitTestRunner.exe", "WebKitTestRunner_debug.exe"]
+
+ for task in tasksToKill:
+ os.system("taskkill /f /im " + task)
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/WebKitTools/CMakeListsEfl.txt b/WebKitTools/CMakeListsEfl.txt
new file mode 100644
index 0000000..732b4b3
--- /dev/null
+++ b/WebKitTools/CMakeListsEfl.txt
@@ -0,0 +1,59 @@
+SET(EWebLauncher_SOURCES
+ ${WEBKITTOOLS_DIR}/EWebLauncher/main.c
+)
+
+SET(EWebLauncher_LIBRARIES
+ ${JavaScriptCore_LIBRARY_NAME}
+ ${WebCore_LIBRARY_NAME}
+ ${WebKit_LIBRARY_NAME}
+ ${Cairo_LIBRARIES}
+ ${ECORE_X_LIBRARIES}
+ ${EDJE_LIBRARIES}
+ ${EFLDEPS_LIBRARIES}
+ ${EVAS_LIBRARIES}
+ ${LIBXML2_LIBRARIES}
+ ${LIBXSLT_LIBRARIES}
+ ${SQLITE_LIBRARIES}
+)
+
+SET(EWebLauncher_INCLUDE_DIRECTORIES
+ "${WEBKIT_DIR}/efl/ewk"
+ ${Cairo_INCLUDE_DIRS}
+ ${EDJE_INCLUDE_DIRS}
+ ${EFLDEPS_INCLUDE_DIRS}
+ ${EVAS_INCLUDE_DIRS}
+)
+
+SET(EWebLauncher_LINK_FLAGS
+ ${ECORE_X_LDFLAGS}
+ ${EDJE_LDFLAGS}
+ ${EFLDEPS_LDFLAGS}
+ ${EVAS_LDFLAGS}
+)
+
+IF (ENABLE_GLIB_SUPPORT)
+ LIST(APPEND EWebLauncher_LIBRARIES
+ ${Gdk_LIBRARIES}
+ ${Glib_LIBRARIES}
+ ${Gthread_LIBRARIES}
+ )
+ENDIF ()
+
+IF (WTF_USE_SOUP)
+ LIST(APPEND EWebLauncher_LIBRARIES ${LIBSOUP24_LIBRARIES})
+ LIST(APPEND EWebLauncher_LINK_FLAGS ${LIBSOUP24_LDFLAGS})
+ENDIF ()
+
+IF (WTF_USE_CURL)
+ LIST(APPEND EWebLauncher_LIBRARIES ${CURL_LIBRARIES})
+ LIST(APPEND EWebLauncher_LINK_FLAGS ${CURL_LDFLAGS})
+ENDIF ()
+
+# Override data directory. We always want to get a fresh theme.
+REMOVE_DEFINITIONS(-DDATA_DIR=\"${DATA_DIR}\")
+ADD_DEFINITIONS(-DDATA_DIR=\"${BUILD_DATA_DIR}\")
+
+INCLUDE_DIRECTORIES(${EWebLauncher_INCLUDE_DIRECTORIES})
+ADD_EXECUTABLE(Programs/EWebLauncher ${EWebLauncher_SOURCES})
+TARGET_LINK_LIBRARIES(Programs/EWebLauncher ${EWebLauncher_LIBRARIES})
+ADD_TARGET_PROPERTIES(Programs/EWebLauncher LINK_FLAGS "${EWebLauncher_LINK_FLAGS}")
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.css b/WebKitTools/CSSTestSuiteHarness/harness/harness.css
new file mode 100644
index 0000000..3f4c97d
--- /dev/null
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.css
@@ -0,0 +1,308 @@
+/*
+ * 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.
+ */
+
+body {
+ font-family: Helvetica, sans-serif;
+ background-color: #DDD;
+}
+
+.controls {
+ border: 1px solid black;
+ width: 300px;
+ height: 660px;
+ float: left;
+ font-size: smaller;
+ padding: 4px;
+}
+
+.controls div {
+ margin: 4px;
+}
+
+.controls select {
+ width: 100%;
+}
+
+.details > div {
+ margin: 4px 0;
+}
+
+.test-type {
+ float: left;
+}
+
+.name > button {
+ margin-top: 20px;
+ float: right;
+}
+
+.actions {
+ margin-left: 320px;
+ border: 1px solid black;
+ font-size: smaller;
+ height: 30px;
+ padding: 4px;
+ margin-bottom: 8px;
+}
+
+.actions button {
+ font-size: 13px;
+ width: 5em;
+}
+
+.note {
+ display: inline-block;
+ font-size: 10px;
+ margin-left: 5px;
+ color: gray;
+}
+.action-buttons {
+ float: right;
+}
+
+#test-content {
+ margin-left: 320px;
+ height: 612px;
+ border: 1px solid black;
+ padding: 4px;
+ background-color: white;
+}
+
+.info > div {
+ margin: 6px 0;
+}
+
+.info .title {
+ font-size: larger;
+ font-weight: bold;
+}
+
+.info .url {
+ font-family: monospace;
+}
+
+.info .assertion, .info .flags {
+ font-size: smaller;
+}
+
+#warning {
+ padding-left: 1em;
+ color: red;
+ display: none;
+}
+
+#print-button {
+ float: right;
+ display: none;
+}
+
+#test-content.print {
+}
+
+#test-content.print #print-button {
+ display: inline;
+}
+
+#test-content.warn #warning {
+ display: inline;
+}
+
+#test-content iframe {
+ border: 1px solid gray;
+ margin: 2px;
+}
+
+#test-content h2 {
+ font-size: 11pt;
+ margin: 2px 0 2px 0;
+ color: darkgray;
+}
+
+#test-list > option.untested {
+}
+
+#test-list > option.pass {
+ color: rgba(0, 128, 0, 0.6);
+}
+
+#test-list > option.fail {
+ color: rgba(255, 0, 0, 0.6);
+}
+
+#test-list > option.skipped {
+ color: rgba(255, 128, 0, 0.6);
+}
+
+#test-content.with-ref {
+}
+
+.frame-wrapper {
+
+}
+
+.frame-wrapper iframe {
+ width: 98%;
+ height: 460px;
+}
+
+.frame-wrapper {
+ height: 500px;
+ width: 99%;
+ display: inline-block;
+}
+
+.with-ref > .frame-wrapper {
+ width: 49%;
+}
+
+#ref-wrapper {
+ height: 500px;
+ width: 49%;
+ display: none;
+}
+
+.with-ref > #ref-wrapper {
+ display: inline-block;
+}
+
+.results {
+ border: 1px solid black;
+ padding: 4px;
+ margin-top: 6px;
+}
+
+#output {
+ border: 1px solid black;
+ font-size: smaller;
+ height: 220px;
+ margin: 4px;
+ padding: 4px;
+ overflow-y: auto;
+ background-color: white;
+}
+
+#output > p {
+ margin: 0;
+}
+#output .pass {
+ color: green;
+}
+
+#output .fail {
+ color: red;
+}
+
+#output .skipped {
+ color: orange;
+}
+
+#output .invalid {
+ background: red;
+}
+
+.output-options {
+ float: right;
+ border: 1px solid black;
+ width: 200px;
+ height: 220px;
+ margin: 4px;
+ padding: 4px;
+ font-size: smaller;
+}
+
+.output-options select {
+ width: 90%;
+}
+
+.summary {
+ font-size: smaller;
+ margin: 4px;
+}
+
+.summary .label {
+ display: inline-block;
+ min-width: 5em;
+ margin: 0;
+}
+
+.summary span {
+ display: inline-block;
+ min-width: 3em;
+ text-align: right;
+ margin: 0;
+}
+
+.summary td {
+ text-align: right;
+ padding: 4px;
+}
+
+.custom button {
+ display: block;
+ margin: 12px 0;
+}
+
+/* Overlay */
+
+#overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ background-color: rgba(0, 0, 0, 0.6);
+ display: none;
+}
+
+#overlay.visible {
+ display: block;
+}
+
+.overlay-contents {
+ position: relative;
+ background-color: white;
+ margin: 50px auto;
+ width: 1000px;
+ padding: 20px;
+}
+
+.overlay-contents textarea {
+ width: 90em;
+ height: 50em;
+}
+.overlay-contents .buttons {
+ text-align: right;
+}
+
+.overlay-contents .note {
+ float: left;
+}
+
+.overlay-contents .buttons button {
+ font-size: 13px;
+ width: 6em;
+ margin: 12px 8px;
+}
+
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.html b/WebKitTools/CSSTestSuiteHarness/harness/harness.html
new file mode 100644
index 0000000..3877f49
--- /dev/null
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.html
@@ -0,0 +1,262 @@
+<!--
+/*
+ * 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.
+ */
+-->
+
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+ <title>CSS 2.1 Test Harness</title>
+ <link rel="stylesheet" href="harness.css" type="text/css" media="screen" charset="utf-8">
+
+ <script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script>
+ <script src="harness.js" type="text/javascript" charset="utf-8"></script>
+
+ <script type="text/javascript" charset="utf-8">
+ var gTestSuite;
+ function setupTests()
+ {
+ gTestSuite = new TestSuite();
+ }
+
+ window.addEventListener('load', setupTests, false);
+
+ function skipTest()
+ {
+ gTestSuite.skipTest(document.getElementById('skip-reason').value);
+ }
+
+ function invalidTest()
+ {
+ gTestSuite.invalidTest();
+ }
+
+ function failTest()
+ {
+ gTestSuite.failTest();
+ }
+
+ function passTest()
+ {
+ gTestSuite.passTest();
+ }
+
+ function goToNextUntested()
+ {
+ gTestSuite.goToNextIncompleteTest();
+ }
+
+ function goToTest()
+ {
+ var testName = prompt('Go to test:', '');
+
+ // This accepts any of the following:
+ // at-charset-010
+ // at-charset-010.xht
+ // xhtml1/at-charset-010
+ // xhtml1/at-charset-010.xht
+ // and will choose the format if specified.
+ if (!gTestSuite.goToTestByName(testName))
+ alert('Failed to find test ' + testName);
+ }
+
+ function formatChanged()
+ {
+ var newFormat;
+ if (document.harness.format.html4.checked)
+ newFormat = 'html4';
+ else
+ newFormat = 'xhtml1';
+ gTestSuite.formatChanged(newFormat);
+ }
+
+ function testSelected()
+ {
+ var list = document.getElementById('test-list')
+ if (list.selectedIndex >= 0)
+ gTestSuite.goToTestIndex(list.selectedIndex);
+ else
+ gTestSuite.clearTest();
+ }
+
+ function resultsPopupChanged(popup)
+ {
+ gTestSuite.resultsPopupChanged(popup.selectedIndex);
+ }
+
+ function doExport()
+ {
+ gTestSuite.exportResults(document.getElementById('results-popup').selectedIndex);
+ }
+
+ function printTestIframe()
+ {
+ var testFrame = document.getElementById('test-frame');
+ testFrame.contentWindow.print();
+ }
+
+ var gOverlayConfirmCallback;
+ function showOverlay(overlayConfirmCallback)
+ {
+ document.getElementById('overlay-data').value = '';
+ gOverlayConfirmCallback = overlayConfirmCallback;
+ $('#overlay').addClass('visible');
+ }
+
+ function overlayCancel()
+ {
+ $('#overlay').removeClass('visible');
+ }
+
+ function overlayConfirm()
+ {
+ var data = document.getElementById('overlay-data').value;
+ gOverlayConfirmCallback(data);
+ $('#overlay').removeClass('visible');
+ }
+
+ function doImport()
+ {
+ document.getElementById('overlay-action').innerText = 'Enter results to import (in the same format as the exported results):';
+ showOverlay(function(data) {
+ gTestSuite.importResults(data);
+ });
+ }
+
+ function doClear()
+ {
+ document.getElementById('overlay-action').innerText = 'Enter list of tests for which to clear results (so they can be re-tested):';
+ showOverlay(function(data) {
+ gTestSuite.clearResults(data);
+ });
+ }
+ </script>
+
+</head>
+<body>
+
+ <div class="controls">
+ <form name="harness" onsubmit="return false;">
+ <select id="chapters">
+ <option>Test category</option>
+ </select>
+ <div class="progress">
+ <div><span id="test-index">1</span> of <span id="chapter-test-count">200</span> unique tests</div>
+ </div>
+ <div class="details">
+ <div class="name">
+ <div class="test-type">
+ <input type="radio" name="format" id="html4" onchange="formatChanged()" checked><label for="html4">HTML4</label><br>
+ <input type="radio" name="format" id="xhtml1" onchange="formatChanged()"><label for="xhtml1">XHTML1</label>
+ </div>
+ <button onclick="goToNextUntested()" accesskey="n"><strong>N</strong>ext Untested</button>
+ <button onclick="goToTest()" accesskey="g">Go to Test...</button>
+ </div>
+ </div>
+
+ <div>
+ <select id="test-list" size="40" onchange="testSelected()"></select>
+ </div>
+ </form>
+ </div>
+
+ <div class="actions">
+ <span>Skip reason:</span> <input type="text" id="skip-reason" size="50">
+ <button onclick="skipTest()" accesskey="s"><strong>S</strong>kip</button>
+ <div class="note">Use <i>Control-Option-letter</i> to<br> trigger buttons via the keyboard.</div>
+ <div class="action-buttons">
+ <button onclick="invalidTest()" accesskey="i">Invalid</button>
+ <button onclick="failTest()" accesskey="f"><strong>F</strong>ail</button>
+ <button onclick="passTest()" accesskey="p"><strong>P</strong>ass</button>
+ </div>
+ </div>
+ <div id="test-content">
+ <div class="info">
+ <div class="title">Title: <span id="test-title"></span></div>
+ <div class="url">URL: <span id="test-url"></span></div>
+ <div class="assertion">Assertion: <span id="test-assertion"></span></div>
+ <div class="flags">Flags: <span id="test-flags"></span>
+ <span id="warning">This test must be run over HTTP.</span>
+ <button id="print-button" onclick="printTestIframe()">Print Preview</button>
+ </div>
+ </div>
+
+ <div id="test-wrapper" class="frame-wrapper">
+ <h2>Test</h2>
+ <iframe id="test-frame"></iframe>
+ </div>
+ <div id="ref-wrapper" class="frame-wrapper">
+ <h2>Reference</h2>
+ <iframe id="ref-frame"></iframe>
+ </div>
+ </div>
+
+ <div class="results">
+
+ <div class="output-options">
+ <p>Show results for:</p>
+ <select id="results-popup" onchange="resultsPopupChanged(this)">
+ </select>
+ <div>
+ <button id="export-button" onclick="doExport()">Export...</button>
+ </div>
+
+ <div class="custom">
+ <button id="import-button" onclick="doImport()">Import...</button>
+ <button id="import-button" onclick="doClear()">Clear Results...</button>
+ </div>
+ </div>
+
+ <div id="output"></div>
+ <div class="summary">
+ <table>
+ <tr>
+ <th></th><th>Passed</th><th>Failed</th><th>Skipped</th><th>Invalid</th><th>Tested</th><th>Total</th><th>% done</th>
+ </tr>
+ <tr>
+ <td class="label">HTML4:</td><td id="h-passed"></td><td id="h-failed"></td><td id="h-skipped"></td><td id="h-invalid"></td><td id="h-tested"></td><td id="h-total"></td><td id="h-percent"></td>
+ </tr>
+ <tr>
+ <td class="label">XHTML1:</td><td id="x-passed"></td><td id="x-failed"></td><td id="x-skipped"></td><td id="x-invalid"></td><td id="x-tested"></td><td id="x-total"></td><td id="x-percent"></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+
+ <div id="overlay">
+
+ <div class="overlay-contents">
+ <p id="overlay-action"></p>
+ <textarea id="overlay-data"></textarea>
+ <p class="note">Pasting many lines of text here can be very slow in Safari 5. You can quit Safari and use a <a href="http://nightly.webkit.org/" title="WebKit Nightly Builds">WebKit nightly build</a> for importing or clearing.</p>
+ <div class="buttons">
+ <button onclick="overlayCancel()">Cancel</button><button onclick="overlayConfirm()">OK</button>
+ </div>
+ </div>
+
+ </div>
+</body>
+</html> \ No newline at end of file
diff --git a/WebKitTools/CSSTestSuiteHarness/harness/harness.js b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
new file mode 100644
index 0000000..ed7cb7d
--- /dev/null
+++ b/WebKitTools/CSSTestSuiteHarness/harness/harness.js
@@ -0,0 +1,1902 @@
+/*
+ * 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.
+ */
+
+// requires jQuery
+
+const kTestSuiteVersion = '20101001';
+const kTestSuiteHome = '../' + kTestSuiteVersion + '/';
+const kTestInfoDataFile = 'testinfo.data';
+
+const kChapterData = [
+ {
+ 'file' : 'about.html',
+ 'title' : 'About the CSS 2.1 Specification',
+ },
+ {
+ 'file' : 'intro.html',
+ 'title' : 'Introduction to CSS 2.1',
+ },
+ {
+ 'file' : 'conform.html',
+ 'title' : 'Conformance: Requirements and Recommendations',
+ },
+ {
+ 'file' : "syndata.html",
+ 'title' : 'Syntax and basic data types',
+ },
+ {
+ 'file' : 'selector.html' ,
+ 'title' : 'Selectors',
+ },
+ {
+ 'file' : 'cascade.html',
+ 'title' : 'Assigning property values, Cascading, and Inheritance',
+ },
+ {
+ 'file' : 'media.html',
+ 'title' : 'Media types',
+ },
+ {
+ 'file' : 'box.html' ,
+ 'title' : 'Box model',
+ },
+ {
+ 'file' : 'visuren.html',
+ 'title' : 'Visual formatting model',
+ },
+ {
+ 'file' :'visudet.html',
+ 'title' : 'Visual formatting model details',
+ },
+ {
+ 'file' : 'visufx.html',
+ 'title' : 'Visual effects',
+ },
+ {
+ 'file' : 'generate.html',
+ 'title' : 'Generated content, automatic numbering, and lists',
+ },
+ {
+ 'file' : 'page.html',
+ 'title' : 'Paged media',
+ },
+ {
+ 'file' : 'colors.html',
+ 'title' : 'Colors and Backgrounds',
+ },
+ {
+ 'file' : 'fonts.html',
+ 'title' : 'Fonts',
+ },
+ {
+ 'file' : 'text.html',
+ 'title' : 'Text',
+ },
+ {
+ 'file' : 'tables.html',
+ 'title' : 'Tables',
+ },
+ {
+ 'file' : 'ui.html',
+ 'title' : 'User interface',
+ },
+ {
+ 'file' : 'aural.html',
+ 'title' : 'Appendix A. Aural style sheets',
+ },
+ {
+ 'file' : 'refs.html',
+ 'title' : 'Appendix B. Bibliography',
+ },
+ {
+ 'file' : 'changes.html',
+ 'title' : 'Appendix C. Changes',
+ },
+ {
+ 'file' : 'sample.html',
+ 'title' : 'Appendix D. Default style sheet for HTML 4',
+ },
+ {
+ 'file' : 'zindex.html',
+ 'title' : 'Appendix E. Elaborate description of Stacking Contexts',
+ },
+ {
+ 'file' : 'propidx.html',
+ 'title' : 'Appendix F. Full property table',
+ },
+ {
+ 'file' : 'grammar.html',
+ 'title' : 'Appendix G. Grammar of CSS',
+ },
+ {
+ 'file' : 'other.html',
+ 'title' : 'Other',
+ },
+];
+
+
+const kHTML4Data = {
+ 'path' : 'html4',
+ 'suffix' : '.htm'
+};
+
+const kXHTML1Data = {
+ 'path' : 'xhtml1',
+ 'suffix' : '.xht'
+};
+
+// Results popup
+const kResultsSelector = [
+ {
+ 'name': 'All Tests',
+ 'handler' : function(self) { self.showResultsForAllTests(); },
+ 'exporter' : function(self) { self.exportResultsForAllTests(); }
+ },
+ {
+ 'name': 'Completed Tests',
+ 'handler' : function(self) { self.showResultsForCompletedTests(); },
+ 'exporter' : function(self) { self.exportResultsForCompletedTests(); }
+ },
+ {
+ 'name': 'Passing Tests',
+ 'handler' : function(self) { self.showResultsForTestsWithStatus('pass'); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithStatus('pass'); }
+ },
+ {
+ 'name': 'Failing Tests',
+ 'handler' : function(self) { self.showResultsForTestsWithStatus('fail'); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithStatus('fail'); }
+ },
+ {
+ 'name': 'Skipped Tests',
+ 'handler' : function(self) { self.showResultsForTestsWithStatus('skipped'); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithStatus('skipped'); }
+ },
+ {
+ 'name': 'Invalid Tests',
+ 'handler' : function(self) { self.showResultsForTestsWithStatus('invalid'); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithStatus('invalid'); }
+ },
+ {
+ 'name': 'Tests where HTML4 and XHTML1 results differ',
+ 'handler' : function(self) { self.showResultsForTestsWithMismatchedResults(); },
+ 'exporter' : function(self) { self.exportResultsForTestsWithMismatchedResults(); }
+ },
+ {
+ 'name': 'Tests Not Run',
+ 'handler' : function(self) { self.showResultsForTestsNotRun(); },
+ 'exporter' : function(self) { self.exportResultsForTestsNotRun(); }
+ }
+];
+
+function Test(testInfoLine)
+{
+ var fields = testInfoLine.split('\t');
+
+ this.id = fields[0];
+ this.reference = fields[1];
+ this.title = fields[2];
+ this.flags = fields[3];
+ this.links = fields[4];
+ this.assertion = fields[5];
+
+ this.paged = false;
+ this.testHTML = true;
+ this.testXHTML = true;
+
+ if (this.flags) {
+ this.paged = this.flags.indexOf('paged') != -1;
+
+ if (this.flags.indexOf('nonHTML') != -1)
+ this.testHTML = false;
+
+ if (this.flags.indexOf('HTMLonly') != -1)
+ this.testXHTML = false;
+ }
+
+ this.completedHTML = false; // true if this test has a result (pass, fail or skip)
+ this.completedXHTML = false; // true if this test has a result (pass, fail or skip)
+
+ this.statusHTML = '';
+ this.statusXHTML = '';
+
+ if (!this.links)
+ this.links = "other.html"
+}
+
+Test.prototype.runForFormat = function(format)
+{
+ if (format == 'html4')
+ return this.testHTML;
+
+ if (format == 'xhtml1')
+ return this.testXHTML;
+
+ return true;
+}
+
+Test.prototype.completedForFormat = function(format)
+{
+ if (format == 'html4')
+ return this.completedHTML;
+
+ if (format == 'xhtml1')
+ return this.completedXHTML;
+
+ return true;
+}
+
+Test.prototype.statusForFormat = function(format)
+{
+ if (format == 'html4')
+ return this.statusHTML;
+
+ if (format == 'xhtml1')
+ return this.statusXHTML;
+
+ return true;
+}
+
+function ChapterSection(link)
+{
+ var result= link.match(/^([.\w]+)(#.+)?$/);
+ if (result != null) {
+ this.file = result[1];
+ this.anchor = result[2];
+ }
+
+ this.testCountHTML = 0;
+ this.testCountXHTML = 0;
+
+ this.tests = [];
+}
+
+ChapterSection.prototype.countTests = function()
+{
+ this.testCountHTML = 0;
+ this.testCountXHTML = 0;
+
+ for (var i = 0; i < this.tests.length; ++i) {
+ var currTest = this.tests[i];
+
+ if (currTest.testHTML)
+ ++this.testCountHTML;
+
+ if (currTest.testXHTML)
+ ++this.testCountXHTML;
+ }
+}
+
+function Chapter(chapterInfo)
+{
+ this.file = chapterInfo.file;
+ this.title = chapterInfo.title;
+ this.testCountHTML = 0;
+ this.testCountXHTML = 0;
+ this.sections = []; // array of ChapterSection
+}
+
+Chapter.prototype.description = function(format)
+{
+
+
+ return this.title + ' (' + this.testCount(format) + ' tests, ' + this.untestedCount(format) + ' untested)';
+}
+
+Chapter.prototype.countTests = function()
+{
+ this.testCountHTML = 0;
+ this.testCountXHTML = 0;
+
+ for (var i = 0; i < this.sections.length; ++i) {
+ var currSection = this.sections[i];
+
+ currSection.countTests();
+
+ this.testCountHTML += currSection.testCountHTML;
+ this.testCountXHTML += currSection.testCountXHTML;
+ }
+}
+
+Chapter.prototype.testCount = function(format)
+{
+ if (format == 'html4')
+ return this.testCountHTML;
+
+ if (format == 'xhtml1')
+ return this.testCountXHTML;
+
+ return 0;
+}
+
+Chapter.prototype.untestedCount = function(format)
+{
+ var completedProperty = format == 'html4' ? 'completedHTML' : 'completedXHTML';
+
+ var count = 0;
+ for (var i = 0; i < this.sections.length; ++i) {
+ var currSection = this.sections[i];
+ for (var j = 0; j < currSection.tests.length; ++j) {
+ count += currSection.tests[j].completedForFormat(format) ? 0 : 1;
+ }
+ }
+ return count;
+
+}
+
+// Utils
+String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); }
+
+function TestSuite()
+{
+ this.chapterSections = {}; // map of links to ChapterSections
+ this.tests = {}; // map of test id to test info
+
+ this.chapters = {}; // map of file name to chapter
+ this.currentChapter = null;
+
+ this.currentChapterTests = []; // array of tests for the current chapter.
+ this.currChapterTestIndex = -1; // index of test in the current chapter
+
+ this.format = '';
+ this.formatChanged('html4');
+
+ this.testInfoLoaded = false;
+
+ this.populatingDatabase = false;
+
+ var testInfoPath = kTestSuiteHome + kTestInfoDataFile;
+ this.loadTestInfo(testInfoPath);
+}
+
+TestSuite.prototype.loadTestInfo = function(testInfoPath)
+{
+ var _self = this;
+ this.asyncLoad(testInfoPath, 'data', function(data, status) {
+ _self.testInfoDataLoaded(data, status);
+ });
+}
+
+TestSuite.prototype.testInfoDataLoaded = function(data, status)
+{
+ if (status != 'success') {
+ alert("Failed to load testinfo.data. Database of tests will not be initialized.");
+ return;
+ }
+
+ this.parseTests(data);
+ this.buildChapters();
+
+ this.testInfoLoaded = true;
+
+ this.fillChapterPopup();
+
+ this.initializeControls();
+
+ this.openDatabase();
+}
+
+TestSuite.prototype.parseTests = function(data)
+{
+ var lines = data.split('\n');
+
+ // First line is column labels
+ for (var i = 1; i < lines.length; ++i) {
+ var test = new Test(lines[i]);
+ if (test.id.length > 0)
+ this.tests[test.id] = test;
+ }
+}
+
+TestSuite.prototype.buildChapters = function()
+{
+ for (var testID in this.tests) {
+ var currTest = this.tests[testID];
+
+ // FIXME: tests with more than one link will be presented to the user
+ // twice. Be smarter about avoiding this.
+ var testLinks = currTest.links.split(',');
+ for (var i = 0; i < testLinks.length; ++i) {
+ var link = testLinks[i];
+ var section = this.chapterSections[link];
+ if (!section) {
+ section = new ChapterSection(link);
+ this.chapterSections[link] = section;
+ }
+
+ section.tests.push(currTest);
+ }
+ }
+
+ for (var i = 0; i < kChapterData.length; ++i) {
+ var chapter = new Chapter(kChapterData[i]);
+ chapter.index = i;
+ this.chapters[chapter.file] = chapter;
+ }
+
+ for (var sectionName in this.chapterSections) {
+ var section = this.chapterSections[sectionName];
+
+ var file = section.file;
+ var chapter = this.chapters[file];
+ if (!chapter)
+ window.console.log('failed to find chapter ' + file + ' in chapter data.');
+ chapter.sections.push(section);
+ }
+
+ for (var chapterName in this.chapters) {
+ var currChapter = this.chapters[chapterName];
+ currChapter.sections.sort();
+ currChapter.countTests();
+ }
+}
+
+TestSuite.prototype.indexOfChapter = function(chapter)
+{
+ for (var i = 0; i < kChapterData.length; ++i) {
+ if (kChapterData[i].file == chapter.file)
+ return i;
+ }
+
+ window.console.log('indexOfChapter for ' + chapter.file + ' failed');
+ return -1;
+}
+
+TestSuite.prototype.chapterAtIndex = function(index)
+{
+ if (index < 0 || index >= kChapterData.length)
+ return null;
+
+ return this.chapters[kChapterData[index].file];
+}
+
+TestSuite.prototype.fillChapterPopup = function()
+{
+ var select = document.getElementById('chapters')
+ select.innerHTML = ''; // Remove all children.
+
+ for (var i = 0; i < kChapterData.length; ++i) {
+ var chapterData = kChapterData[i];
+ var chapter = this.chapters[chapterData.file];
+
+ var option = document.createElement('option');
+ option.innerText = chapter.description(this.format);
+ option._chapter = chapter;
+
+ select.appendChild(option);
+ }
+}
+
+TestSuite.prototype.updateChapterPopup = function()
+{
+ var select = document.getElementById('chapters')
+ var currOption = select.firstChild;
+
+ for (var i = 0; i < kChapterData.length; ++i) {
+ var chapterData = kChapterData[i];
+ var chapter = this.chapters[chapterData.file];
+ if (!chapter)
+ continue;
+ currOption.innerText = chapter.description(this.format);
+ currOption = currOption.nextSibling;
+ }
+}
+
+TestSuite.prototype.buildTestListForChapter = function(chapter)
+{
+ this.currentChapterTests = this.testListForChapter(chapter);
+}
+
+TestSuite.prototype.testListForChapter = function(chapter)
+{
+ var testList = [];
+
+ for (var i in chapter.sections) {
+ var currSection = chapter.sections[i];
+
+ for (var j = 0; j < currSection.tests.length; ++j) {
+ var currTest = currSection.tests[j];
+ if (currTest.runForFormat(this.format))
+ testList.push(currTest);
+ }
+ }
+
+ // FIXME: test may occur more than once.
+ testList.sort(function(a, b) {
+ return a.id.localeCompare(b.id);
+ });
+
+ return testList;
+}
+
+TestSuite.prototype.initializeControls = function()
+{
+ var chaptersPopup = document.getElementById('chapters');
+
+ var _self = this;
+ chaptersPopup.addEventListener('change', function() {
+ _self.chapterPopupChanged();
+ }, false);
+
+ this.chapterPopupChanged();
+
+ // Results popup
+ var resultsPopup = document.getElementById('results-popup');
+ resultsPopup.innerHTML = '';
+
+ for (var i = 0; i < kResultsSelector.length; ++i) {
+ var option = document.createElement('option');
+ option.innerText = kResultsSelector[i].name;
+
+ resultsPopup.appendChild(option);
+ }
+}
+
+TestSuite.prototype.chapterPopupChanged = function()
+{
+ var chaptersPopup = document.getElementById('chapters');
+ var selectedChapter = chaptersPopup.options[chaptersPopup.selectedIndex]._chapter;
+
+ this.setSelectedChapter(selectedChapter);
+}
+
+TestSuite.prototype.fillTestList = function()
+{
+ var statusProperty = this.format == 'html4' ? 'statusHTML' : 'statusXHTML';
+
+ var testList = document.getElementById('test-list');
+ testList.innerHTML = '';
+
+ for (var i = 0; i < this.currentChapterTests.length; ++i) {
+ var currTest = this.currentChapterTests[i];
+
+ var option = document.createElement('option');
+ option.innerText = currTest.id;
+ option.className = currTest[statusProperty];
+ option._test = currTest;
+ testList.appendChild(option);
+ }
+}
+
+TestSuite.prototype.updateTestList = function()
+{
+ var statusProperty = this.format == 'html4' ? 'statusHTML' : 'statusXHTML';
+ var testList = document.getElementById('test-list');
+
+ var options = testList.getElementsByTagName('option');
+ for (var i = 0; i < options.length; ++i) {
+ var currOption = options[i];
+ currOption.className = currOption._test[statusProperty];
+ }
+}
+
+TestSuite.prototype.setSelectedChapter = function(chapter)
+{
+ this.currentChapter = chapter;
+ this.buildTestListForChapter(this.currentChapter);
+ this.currChapterTestIndex = -1;
+
+ this.fillTestList();
+ this.goToTestIndex(0);
+
+ var chaptersPopup = document.getElementById('chapters');
+ chaptersPopup.selectedIndex = this.indexOfChapter(chapter);
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.passTest = function()
+{
+ this.recordResult(this.currentTestName(), 'pass');
+ this.nextTest();
+}
+
+TestSuite.prototype.failTest = function()
+{
+ this.recordResult(this.currentTestName(), 'fail');
+ this.nextTest();
+}
+
+TestSuite.prototype.invalidTest = function()
+{
+ this.recordResult(this.currentTestName(), 'invalid');
+ this.nextTest();
+}
+
+TestSuite.prototype.skipTest = function(reason)
+{
+ this.recordResult(this.currentTestName(), 'skipped', reason);
+ this.nextTest();
+}
+
+TestSuite.prototype.nextTest = function()
+{
+ if (this.currChapterTestIndex < this.currentChapterTests.length - 1)
+ this.goToTestIndex(this.currChapterTestIndex + 1);
+ else {
+ var currChapterIndex = this.indexOfChapter(this.currentChapter);
+ this.goToChapterIndex(currChapterIndex + 1);
+ }
+}
+
+TestSuite.prototype.previousTest = function()
+{
+ if (this.currChapterTestIndex > 0)
+ this.goToTestIndex(this.currChapterTestIndex - 1);
+ else {
+ var currChapterIndex = this.indexOfChapter(this.currentChapter);
+ if (currChapterIndex > 0)
+ this.goToChapterIndex(currChapterIndex - 1);
+ }
+}
+
+TestSuite.prototype.goToNextIncompleteTest = function()
+{
+ var completedProperty = this.format == 'html4' ? 'completedHTML' : 'completedXHTML';
+
+ // Look to the end of this chapter.
+ for (var i = this.currChapterTestIndex + 1; i < this.currentChapterTests.length; ++i) {
+ if (!this.currentChapterTests[i][completedProperty]) {
+ this.goToTestIndex(i);
+ return;
+ }
+ }
+
+ // Start looking through later chapter
+ var currChapterIndex = this.indexOfChapter(this.currentChapter);
+ for (var c = currChapterIndex + 1; c < kChapterData.length; ++c) {
+ var chapterData = this.chapterAtIndex(c);
+
+ var testIndex = this.firstIncompleteTestIndex(chapterData);
+ if (testIndex != -1) {
+ this.goToChapterIndex(c);
+ this.goToTestIndex(testIndex);
+ break;
+ }
+ }
+}
+
+TestSuite.prototype.firstIncompleteTestIndex = function(chapter)
+{
+ var completedProperty = this.format == 'html4' ? 'completedHTML' : 'completedXHTML';
+
+ var chapterTests = this.testListForChapter(chapter);
+ for (var i = 0; i < chapterTests.length; ++i) {
+ if (!chapterTests[i][completedProperty])
+ return i;
+ }
+
+ return -1;
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.goToTestByName = function(testName)
+{
+ var match = testName.match(/^(?:(html4|xhtml1)\/)?([\w-_]+)(\.xht|\.htm)?/);
+ if (!match)
+ return false;
+
+ var prefix = match[1];
+ var testId = match[2];
+ var extension = match[3];
+
+ var format = this.format;
+ if (prefix)
+ format = prefix;
+ else if (extension) {
+ if (extension == kXHTML1Data.suffix)
+ format = kXHTML1Data.path;
+ else if (extension == kHTML4Data.suffix)
+ format = kHTML4Data.path;
+ }
+
+ this.switchToFormat(format);
+
+ var test = this.tests[testId];
+ if (!test)
+ return false;
+
+ // Find the first chapter.
+ var links = test.links.split(',');
+ if (links.length == 0) {
+ window.console.log('test ' + test.id + 'had no links.');
+ return false;
+ }
+
+ var firstLink = links[0];
+ var result = firstLink.match(/^([.\w]+)(#.+)?$/);
+ if (result)
+ firstLink = result[1];
+
+ // Find the chapter and index of the test.
+ for (var i = 0; i < kChapterData.length; ++i) {
+ var chapterData = kChapterData[i];
+ if (chapterData.file == firstLink) {
+
+ this.goToChapterIndex(i);
+
+ for (var j = 0; j < this.currentChapterTests.length; ++j) {
+ var currTest = this.currentChapterTests[j];
+ if (currTest.id == testId) {
+ this.goToTestIndex(j);
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+TestSuite.prototype.goToTestIndex = function(index)
+{
+ if (index >= 0 && index < this.currentChapterTests.length) {
+ this.currChapterTestIndex = index;
+ this.loadCurrentTest();
+ }
+}
+
+TestSuite.prototype.goToChapterIndex = function(chapterIndex)
+{
+ if (chapterIndex >= 0 && chapterIndex < kChapterData.length) {
+ var chapterFile = kChapterData[chapterIndex].file;
+ this.setSelectedChapter(this.chapters[chapterFile]);
+ }
+}
+
+TestSuite.prototype.currentTestName = function()
+{
+ if (this.currChapterTestIndex < 0 || this.currChapterTestIndex >= this.currentChapterTests.length)
+ return undefined;
+
+ return this.currentChapterTests[this.currChapterTestIndex].id;
+}
+
+TestSuite.prototype.loadCurrentTest = function()
+{
+ var theTest = this.currentChapterTests[this.currChapterTestIndex];
+ if (!theTest) {
+ this.configureForManualTest();
+ this.clearTest();
+ return;
+ }
+
+ if (theTest.reference) {
+ this.configureForRefTest();
+ this.loadRef(theTest);
+ } else {
+ this.configureForManualTest();
+ }
+
+ this.loadTest(theTest);
+
+ this.updateProgressLabel();
+
+ document.getElementById('test-list').selectedIndex = this.currChapterTestIndex;
+}
+
+TestSuite.prototype.updateProgressLabel = function()
+{
+ document.getElementById('test-index').innerText = this.currChapterTestIndex + 1;
+ document.getElementById('chapter-test-count').innerText = this.currentChapterTests.length;
+}
+
+TestSuite.prototype.configureForRefTest = function()
+{
+ $('#test-content').addClass('with-ref');
+}
+
+TestSuite.prototype.configureForManualTest = function()
+{
+ $('#test-content').removeClass('with-ref');
+}
+
+TestSuite.prototype.loadTest = function(test)
+{
+ var iframe = document.getElementById('test-frame');
+ iframe.src = 'about:blank';
+
+ var url = this.urlForTest(test.id);
+ window.setTimeout(function() {
+ iframe.src = url;
+ }, 0);
+
+ document.getElementById('test-title').innerText = test.title;
+ document.getElementById('test-url').innerText = this.pathForTest(test.id);
+ document.getElementById('test-assertion').innerText = test.assertion;
+ document.getElementById('test-flags').innerText = test.flags;
+
+ this.processFlags(test);
+}
+
+TestSuite.prototype.processFlags = function(test)
+{
+ if (test.paged)
+ $('#test-content').addClass('print');
+ else
+ $('#test-content').removeClass('print');
+
+ var showWarning = false;
+ var warning = '';
+ if (test.flags.indexOf('font') != -1)
+ warning = 'Requires a specific font to be installed.';
+
+ if (test.flags.indexOf('http') != -1) {
+ if (warning != '')
+ warning += ' ';
+ warning += 'Must be tested over HTTP, with custom HTTP headers.';
+ }
+
+ if (test.paged) {
+ if (warning != '')
+ warning += ' ';
+ warning += 'Test via the browser\'s Print Preview.';
+ }
+
+ document.getElementById('warning').innerText = warning;
+
+ if (warning.length > 0)
+ $('#test-content').addClass('warn');
+ else
+ $('#test-content').removeClass('warn');
+
+}
+
+TestSuite.prototype.clearTest = function()
+{
+ var iframe = document.getElementById('test-frame');
+ iframe.src = 'about:blank';
+
+ document.getElementById('test-title').innerText = '';
+ document.getElementById('test-url').innerText = '';
+ document.getElementById('test-assertion').innerText = '';
+ document.getElementById('test-flags').innerText = '';
+
+ $('#test-content').removeClass('print');
+ $('#test-content').removeClass('warn');
+ document.getElementById('warning').innerText = '';
+}
+
+TestSuite.prototype.loadRef = function(test)
+{
+ // Suites 20101001 and earlier used .xht refs, even for HTML tests, so strip off
+ // the extension and use the same format as the test.
+ var ref = test.reference.replace(/(\.xht)?$/, '');
+
+ var iframe = document.getElementById('ref-frame');
+ iframe.src = this.urlForTest(ref);
+}
+
+TestSuite.prototype.pathForTest = function(testName)
+{
+ var prefix = this.formatInfo.path;
+ var suffix = this.formatInfo.suffix;
+
+ return prefix + '/' + testName + suffix;
+}
+
+TestSuite.prototype.urlForTest = function(testName)
+{
+ return kTestSuiteHome + this.pathForTest(testName);
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.recordResult = function(testName, resolution, comment)
+{
+ if (!testName)
+ return;
+
+ this.beginAppendingOutput();
+ this.appendResultToOutput(this.formatInfo, testName, resolution, comment);
+ this.endAppendingOutput();
+
+ if (comment == undefined)
+ comment = '';
+
+ this.storeTestResult(testName, this.format, resolution, comment, navigator.userAgent);
+
+ var htmlStatus = null;
+ var xhtmlStatus = null;
+ if (this.format == 'html4')
+ htmlStatus = resolution;
+ if (this.format == 'xhtml1')
+ xhtmlStatus = resolution;
+
+ this.markTestCompleted(testName, htmlStatus, xhtmlStatus);
+ this.updateTestList();
+
+ this.updateSummaryData();
+ this.updateChapterPopup();
+}
+
+TestSuite.prototype.beginAppendingOutput = function()
+{
+}
+
+TestSuite.prototype.endAppendingOutput = function()
+{
+ var output = document.getElementById('output');
+ output.scrollTop = output.scrollHeight;
+}
+
+TestSuite.prototype.appendResultToOutput = function(formatData, testName, resolution, comment)
+{
+ var output = document.getElementById('output');
+
+ var result = formatData.path + '/' + testName + formatData.suffix + '\t' + resolution;
+ if (comment)
+ result += '\t(' + comment + ')';
+
+ var line = document.createElement('p');
+ line.className = resolution;
+ line.appendChild(document.createTextNode(result));
+ output.appendChild(line);
+}
+
+TestSuite.prototype.clearOutput = function()
+{
+ document.getElementById('output').innerHTML = '';
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.switchToFormat = function(formatString)
+{
+ if (formatString == 'html4')
+ document.harness.format.html4.checked = true;
+ else
+ document.harness.format.xhtml1.checked = true;
+
+ this.formatChanged(formatString);
+}
+
+TestSuite.prototype.formatChanged = function(formatString)
+{
+ if (this.format == formatString)
+ return;
+
+ this.format = formatString;
+
+ if (formatString == 'html4')
+ this.formatInfo = kHTML4Data;
+ else
+ this.formatInfo = kXHTML1Data;
+
+ // try to keep the current test selected
+ var selectedTestName;
+ if (this.currChapterTestIndex >= 0 && this.currChapterTestIndex < this.currentChapterTests.length)
+ selectedTestName = this.currentChapterTests[this.currChapterTestIndex].id;
+
+ if (this.currentChapter) {
+ this.buildTestListForChapter(this.currentChapter);
+ this.fillTestList();
+ this.goToTestByName(selectedTestName);
+ }
+
+ this.updateChapterPopup();
+ this.updateTestList();
+ this.updateProgressLabel();
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.asyncLoad = function(url, type, handler)
+{
+ $.get(url, handler, type);
+}
+
+/* ------------------------------------------------------- */
+
+TestSuite.prototype.exportResults = function(resultTypeIndex)
+{
+ var resultInfo = kResultsSelector[resultTypeIndex];
+ if (!resultInfo)
+ return;
+
+ resultInfo.exporter(this);
+}
+
+TestSuite.prototype.exportHeader = function()
+{
+ var result = '# Safari 5.0.2' + ' ' + navigator.platform + '\n';
+ result += '# ' + navigator.userAgent + '\n';
+ result += '# http://test.csswg.org/suites/css2.1/' + kTestSuiteVersion + '/\n';
+ result += 'testname\tresult\n';
+
+ return result;
+}
+
+TestSuite.prototype.createExportLine = function(formatData, testName, resolution, comment)
+{
+ var result = formatData.path + '/' + testName + '\t' + resolution;
+ if (comment)
+ result += '\t(' + comment + ')';
+ return result;
+}
+
+TestSuite.prototype.exportQueryComplete = function(data)
+{
+ window.open("data:text/plain," + escape(data))
+}
+
+TestSuite.prototype.resultsPopupChanged = function(index)
+{
+ var resultInfo = kResultsSelector[index];
+ if (!resultInfo)
+ return;
+
+ this.clearOutput();
+ resultInfo.handler(this);
+
+ var enableExport = resultInfo.exporter != undefined;
+ document.getElementById('export-button').disabled = !enableExport;
+}
+
+/* ------------------------- Import ------------------------------- */
+/*
+ Import format is the same as the export format, namely:
+
+ testname<tab>result
+
+ with optional trailing <tab>comment.
+
+html4/absolute-non-replaced-height-002<tab>pass
+xhtml1/absolute-non-replaced-height-002<tab>?
+
+ Lines starting with # are ignored.
+ The "testname<tab>result" line is ignored.
+*/
+TestSuite.prototype.importResults = function(data)
+{
+ var testsToImport = [];
+
+ var lines = data.split('\n');
+ for (var i = 0; i < lines.length; ++i) {
+ var currLine = lines[i];
+ if (currLine.length == 0 || currLine.charAt(0) == '#')
+ continue;
+
+ var match = currLine.match(/^(html4|xhtml1)\/([\w-_]+)\t([\w?]+)\t?(.+)?$/);
+ if (match) {
+ var test = { 'id' : match[2] };
+ test.format = match[1];
+ test.result = match[3];
+ test.comment = match[4];
+
+ if (test.result != '?')
+ testsToImport.push(test);
+ } else {
+ window.console.log('failed to match line \'' + currLine + '\'');
+ }
+ }
+
+ this.importTestResults(testsToImport);
+
+ this.resetTestStatus();
+ this.updateSummaryData();
+}
+
+
+
+/* --------------------- Clear Results --------------------------- */
+/*
+ Clear results format is either same as the export format, or
+ a list of bare test IDs (e.g. absolute-non-replaced-height-001)
+ in which case both HTML4 and XHTML1 results are cleared.
+*/
+TestSuite.prototype.clearResults = function(data)
+{
+ var testsToClear = [];
+
+ var lines = data.split('\n');
+ for (var i = 0; i < lines.length; ++i) {
+ var currLine = lines[i];
+ if (currLine.length == 0 || currLine.charAt(0) == '#')
+ continue;
+
+ // Look for format/test with possible extension
+ var result = currLine.match(/^((html4|xhtml1)?)\/?([\w-_]+)/);
+ if (result) {
+ var testId = result[3];
+ var format = result[1];
+
+ var clearHTML = format.length == 0 || format == 'html4';
+ var clearXHTML = format.length == 0 || format == 'xhtml1';
+
+ var result = { 'id' : testId };
+ result.clearHTML = clearHTML;
+ result.clearXHTML = clearXHTML;
+
+ testsToClear.push(result);
+ } else {
+ window.console.log('failed to match line ' + currLine);
+ }
+ }
+
+ this.clearTestResults(testsToClear);
+
+ this.resetTestStatus();
+ this.updateSummaryData();
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.exportResultsCompletion = function(exportTests)
+{
+ // Lame workaround for ORDER BY not working
+ exportTests.sort(function(a, b) {
+ return a.test.localeCompare(b.test);
+ });
+
+ var exportLines = [];
+ for (var i = 0; i < exportTests.length; ++i) {
+ var currTest = exportTests[i];
+ if (currTest.html4 != '')
+ exportLines.push(currTest.html4);
+ if (currTest.xhtml1 != '')
+ exportLines.push(currTest.xhtml1);
+ }
+
+ var exportString = this.exportHeader() + exportLines.join('\n');
+ this.exportQueryComplete(exportString);
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForCompletedTests = function()
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForCompletedTests(
+ function(item) {
+ if (item.hstatus)
+ _self.appendResultToOutput(kHTML4Data, item.test, item.hstatus, item.hcomment);
+
+ if (item.xstatus)
+ _self.appendResultToOutput(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ }
+ );
+}
+
+TestSuite.prototype.exportResultsForCompletedTests = function()
+{
+ var exportTests = []; // each test will have html and xhtml items on it
+
+ var _self = this;
+ this.queryDatabaseForCompletedTests(
+ function(item) {
+ var htmlLine = '';
+ if (item.hstatus)
+ htmlLine= _self.createExportLine(kHTML4Data, item.test, item.hstatus, item.hcomment);
+
+ var xhtmlLine = '';
+ if (item.xstatus)
+ xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForAllTests = function()
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForAllTests('test',
+ function(item) {
+ _self.appendResultToOutput(kHTML4Data, item.test, item.hstatus, item.hcomment);
+ _self.appendResultToOutput(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ });
+}
+
+TestSuite.prototype.exportResultsForAllTests = function()
+{
+ var exportTests = [];
+
+ var _self = this;
+ this.queryDatabaseForAllTests('test',
+ function(item) {
+ var htmlLine= _self.createExportLine(kHTML4Data, item.test, item.hstatus ? item.hstatus : '?', item.hcomment);
+ var xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, item.xstatus ? item.xstatus : '?', item.xcomment);
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForTestsNotRun = function()
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForTestsNotRun(
+ function(item) {
+ if (!item.hstatus)
+ _self.appendResultToOutput(kHTML4Data, item.test, '?', item.hcomment);
+ if (!item.xstatus)
+ _self.appendResultToOutput(kXHTML1Data, item.test, '?', item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ }
+ );
+}
+
+TestSuite.prototype.exportResultsForTestsNotRun = function()
+{
+ var exportTests = [];
+
+ var _self = this;
+ this.queryDatabaseForTestsNotRun(
+ function(item) {
+ var htmlLine = '';
+ if (!item.hstatus)
+ htmlLine= _self.createExportLine(kHTML4Data, item.test, '?', item.hcomment);
+
+ var xhtmlLine = '';
+ if (!item.xstatus)
+ xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, '?', item.xcomment);
+
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForTestsWithStatus = function(status)
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForTestsWithStatus(status,
+ function(item) {
+ if (item.hstatus == status)
+ _self.appendResultToOutput(kHTML4Data, item.test, item.hstatus, item.hcomment);
+ if (item.xstatus == status)
+ _self.appendResultToOutput(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ }
+ );
+}
+
+TestSuite.prototype.exportResultsForTestsWithStatus = function(status)
+{
+ var exportTests = [];
+
+ var _self = this;
+ this.queryDatabaseForTestsWithStatus(status,
+ function(item) {
+ var htmlLine = '';
+ if (item.hstatus == status)
+ htmlLine= _self.createExportLine(kHTML4Data, item.test, item.hstatus, item.hcomment);
+
+ var xhtmlLine = '';
+ if (item.xstatus == status)
+ xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.showResultsForTestsWithMismatchedResults = function()
+{
+ this.beginAppendingOutput();
+
+ var _self = this;
+ this.queryDatabaseForTestsWithMixedStatus(
+ function(item) {
+ _self.appendResultToOutput(kHTML4Data, item.test, item.hstatus, item.hcomment);
+ _self.appendResultToOutput(kXHTML1Data, item.test, item.xstatus, item.xcomment);
+ },
+ function() {
+ _self.endAppendingOutput();
+ }
+ );
+}
+
+TestSuite.prototype.exportResultsForTestsWithMismatchedResults = function()
+{
+ var exportTests = [];
+
+ var _self = this;
+ this.queryDatabaseForTestsWithMixedStatus(
+ function(item) {
+ var htmlLine= _self.createExportLine(kHTML4Data, item.test, item.hstatus ? item.hstatus : '?', item.hcomment);
+ var xhtmlLine = _self.createExportLine(kXHTML1Data, item.test, item.xstatus ? item.xstatus : '?', item.xcomment);
+ exportTests.push({
+ 'test' : item.test,
+ 'html4' : htmlLine,
+ 'xhtml1' : xhtmlLine });
+ },
+ function() {
+ _self.exportResultsCompletion(exportTests);
+ }
+ );
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.markTestCompleted = function(testID, htmlStatus, xhtmlStatus)
+{
+ var test = this.tests[testID];
+ if (!test) {
+ window.console.log('markTestCompleted failed to find test ' + testID);
+ return;
+ }
+
+ if (htmlStatus) {
+ test.completedHTML = true;
+ test.statusHTML = htmlStatus;
+ }
+ if (xhtmlStatus) {
+ test.completedXHTML = true;
+ test.statusXHTML = xhtmlStatus;
+ }
+}
+
+TestSuite.prototype.testCompletionStateChanged = function()
+{
+ this.updateTestList();
+ this.updateChapterPopup();
+}
+
+TestSuite.prototype.loadTestStatus = function()
+{
+ var _self = this;
+ this.queryDatabaseForCompletedTests(
+ function(item) {
+ _self.markTestCompleted(item.test, item.hstatus, item.xstatus);
+ },
+ function() {
+ _self.testCompletionStateChanged();
+ }
+ );
+
+ this.updateChapterPopup();
+}
+
+TestSuite.prototype.resetTestStatus = function()
+{
+ for (var testID in this.tests) {
+ var currTest = this.tests[testID];
+ currTest.completedHTML = false;
+ currTest.completedXHTML = false;
+ }
+ this.loadTestStatus();
+}
+
+/* -------------------------------------------------------- */
+
+TestSuite.prototype.updateSummaryData = function()
+{
+ this.queryDatabaseForSummary(
+ function(results) {
+
+ var hTotal, xTotal;
+ var hDone, xDone;
+
+ for (var i = 0; i < results.length; ++i) {
+ var result = results[i];
+
+ switch (result.name) {
+ case 'h-total': hTotal = result.count; break;
+ case 'x-total': xTotal = result.count; break;
+ case 'h-tested': hDone = result.count; break;
+ case 'x-tested': xDone = result.count; break;
+ }
+
+ document.getElementById(result.name).innerText = result.count;
+ }
+
+ // We should get these all together.
+ if (hTotal) {
+ document.getElementById('h-percent').innerText = Math.round(100.0 * hDone / hTotal);
+ document.getElementById('x-percent').innerText = Math.round(100.0 * xDone / xTotal);
+ }
+ }
+ );
+}
+
+/* ------------------------------------------------------- */
+// Database stuff
+
+function errorHandler(transaction, error)
+{
+ alert('Database error: ' + error.message);
+ window.console.log('Database error: ' + error.message);
+}
+
+TestSuite.prototype.openDatabase = function()
+{
+ if (!'openDatabase' in window) {
+ alert('Your browser does not support client-side SQL databases, so results will not be stored.');
+ return;
+ }
+
+ var _self = this;
+ this.db = window.openDatabase('css21testsuite', '', 'CSS 2.1 test suite results', 10 * 1024 * 1024);
+
+ // Migration handling. We assume migration will happen whenever the suite version changes,
+ // so that we can check for new or obsoleted tests.
+ function creation(tx) {
+ _self.databaseCreated(tx);
+ }
+
+ function migration1_0To1_1(tx) {
+ window.console.log('updating 1.0 to 1.1');
+ // We'll use the 'seen' column to cross-check with testinfo.data.
+ tx.executeSql('ALTER TABLE tests ADD COLUMN seen BOOLEAN DEFAULT \"FALSE\"', null, function() {
+ _self.syncDatabaseWithTestInfoData();
+ }, errorHandler);
+ }
+
+ if (this.db.version == '') {
+ _self.db.changeVersion('', '1.0', creation, null, function() {
+ _self.db.changeVersion('1.0', '1.1', migration1_0To1_1, null, function() {
+ _self.databaseReady();
+ }, errorHandler);
+ }, errorHandler);
+
+ return;
+ }
+
+ if (this.db.version == '1.0') {
+ _self.db.changeVersion('1.0', '1.1', migration1_0To1_1, null, function() {
+ window.console.log('ready')
+ _self.databaseReady();
+ }, errorHandler);
+ return;
+ }
+
+ this.databaseReady();
+}
+
+TestSuite.prototype.databaseCreated = function(tx)
+{
+ window.console.log('databaseCreated');
+ this.populatingDatabase = true;
+
+ // hstatus: HTML4 result
+ // xstatus: XHTML1 result
+ var _self = this;
+ tx.executeSql('CREATE TABLE tests (test PRIMARY KEY UNIQUE, ref, title, flags, links, assertion, hstatus, hcomment, xstatus, xcomment)', null,
+ function(tx, results) {
+ _self.populateDatabaseFromTestInfoData();
+ }, errorHandler);
+}
+
+TestSuite.prototype.databaseReady = function()
+{
+ this.updateSummaryData();
+ this.loadTestStatus();
+}
+
+TestSuite.prototype.storeTestResult = function(test, format, result, comment, useragent)
+{
+ if (!this.db)
+ return;
+
+ this.db.transaction(function (tx) {
+ if (format == 'html4')
+ tx.executeSql('UPDATE tests SET hstatus=?, hcomment=? WHERE test=?\n', [result, comment, test], null, errorHandler);
+ else if (format == 'xhtml1')
+ tx.executeSql('UPDATE tests SET xstatus=?, xcomment=? WHERE test=?\n', [result, comment, test], null, errorHandler);
+ });
+}
+
+TestSuite.prototype.importTestResults = function(results)
+{
+ if (!this.db)
+ return;
+
+ this.db.transaction(function (tx) {
+
+ for (var i = 0; i < results.length; ++i) {
+ var currResult = results[i];
+
+ var query;
+ if (currResult.format == 'html4')
+ query = 'UPDATE tests SET hstatus=?, hcomment=? WHERE test=?\n';
+ else if (currResult.format == 'xhtml1')
+ query = 'UPDATE tests SET xstatus=?, xcomment=? WHERE test=?\n';
+
+ tx.executeSql(query, [currResult.result, currResult.comment, currResult.id], null, errorHandler);
+ }
+ });
+}
+
+TestSuite.prototype.clearTestResults = function(results)
+{
+ if (!this.db)
+ return;
+
+ this.db.transaction(function (tx) {
+
+ for (var i = 0; i < results.length; ++i) {
+ var currResult = results[i];
+
+ if (currResult.clearHTML)
+ tx.executeSql('UPDATE tests SET hstatus=NULL, hcomment=NULL WHERE test=?\n', [currResult.id], null, errorHandler);
+
+ if (currResult.clearXHTML)
+ tx.executeSql('UPDATE tests SET xstatus=NULL, xcomment=NULL WHERE test=?\n', [currResult.id], null, errorHandler);
+
+ }
+ });
+}
+
+TestSuite.prototype.populateDatabaseFromTestInfoData = function()
+{
+ if (!this.testInfoLoaded) {
+ window.console.log('Tring to populate database before testinfo.data has been loaded');
+ return;
+ }
+
+ window.console.log('populateDatabaseFromTestInfoData')
+ var _self = this;
+ this.db.transaction(function (tx) {
+ for (var testID in _self.tests) {
+ var test = _self.tests[testID];
+ // Version 1.0, so no 'seen' column.
+ tx.executeSql('INSERT INTO tests (test, ref, title, flags, links, assertion) VALUES (?, ?, ?, ?, ?, ?)',
+ [test.id, test.reference, test.title, test.flags, test.links, test.assertion], null, errorHandler);
+ }
+ _self.populatingDatabase = false;
+ });
+
+}
+
+TestSuite.prototype.insertTest = function(tx, test)
+{
+ tx.executeSql('INSERT INTO tests (test, ref, title, flags, links, assertion, seen) VALUES (?, ?, ?, ?, ?, ?, ?)',
+ [test.id, test.reference, test.title, test.flags, test.links, test.assertion, 'TRUE'], null, errorHandler);
+}
+
+// Deal with removed/renamed tests in a new version of the suite.
+// self.tests is canonical; the database may contain stale entries.
+TestSuite.prototype.syncDatabaseWithTestInfoData = function()
+{
+ if (!this.testInfoLoaded) {
+ window.console.log('Trying to sync database before testinfo.data has been loaded');
+ return;
+ }
+
+ // Make an object with all tests that we'll use to track new tests.
+ var testsToInsert = {};
+ for (var testId in this.tests) {
+ var currTest = this.tests[testId];
+ testsToInsert[currTest.id] = currTest;
+ }
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ // Find tests that are not in the database yet.
+ // (Wasn't able to get INSERT ... IF NOT working.)
+ tx.executeSql('SELECT * FROM tests', [], function(tx, results) {
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i) {
+ var item = results.rows.item(i);
+ delete testsToInsert[item.test];
+ }
+ }, errorHandler);
+ });
+
+ this.db.transaction(function (tx) {
+ for (var testId in testsToInsert) {
+ var currTest = testsToInsert[testId];
+ window.console.log(currTest.id + ' is new; inserting');
+ _self.insertTest(tx, currTest);
+ }
+ });
+
+ this.db.transaction(function (tx) {
+ for (var testID in _self.tests)
+ tx.executeSql('UPDATE tests SET seen=\"TRUE\" WHERE test=?\n', [testID], null, errorHandler);
+
+ tx.executeSql('SELECT * FROM tests WHERE seen=\"FALSE\"', [], function(tx, results) {
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i) {
+ var item = results.rows.item(i);
+ window.console.log('Test ' + item.test + ' was in the database but is no longer in the suite; deleting.');
+ }
+ }, errorHandler);
+
+ // Delete rows for disappeared tests.
+ tx.executeSql('DELETE FROM tests WHERE seen=\"FALSE\"', [], function(tx, results) {
+ _self.populatingDatabase = false;
+ _self.databaseReady();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.queryDatabaseForAllTests = function(sortKey, perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+ var query;
+ var args = [];
+ if (sortKey != '') {
+ query = 'SELECT * FROM tests ORDER BY ? ASC'; // ORDER BY doesn't seem to work
+ args.push(sortKey);
+ }
+ else
+ query = 'SELECT * FROM tests';
+
+ tx.executeSql(query, args, function(tx, results) {
+
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.queryDatabaseForTestsWithStatus = function(status, perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+ tx.executeSql('SELECT * FROM tests WHERE hstatus=? OR xstatus=?', [status, status], function(tx, results) {
+
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.queryDatabaseForTestsWithMixedStatus = function(perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+ tx.executeSql('SELECT * FROM tests WHERE hstatus IS NOT NULL AND xstatus IS NOT NULL AND hstatus <> xstatus', [], function(tx, results) {
+
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.queryDatabaseForCompletedTests = function(perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+
+ if (_self.populatingDatabase)
+ return;
+
+ tx.executeSql('SELECT * FROM tests WHERE hstatus IS NOT NULL OR xstatus IS NOT NULL', [], function(tx, results) {
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+TestSuite.prototype.queryDatabaseForTestsNotRun = function(perRowHandler, completionHandler)
+{
+ if (this.populatingDatabase)
+ return;
+
+ var _self = this;
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+
+ tx.executeSql('SELECT * FROM tests WHERE hstatus IS NULL OR xstatus IS NULL', [], function(tx, results) {
+
+ var len = results.rows.length;
+ for (var i = 0; i < len; ++i)
+ perRowHandler(results.rows.item(i));
+
+ completionHandler();
+ }, errorHandler);
+ });
+}
+
+/*
+
+ completionHandler gets called an array of results,
+ which may be some or all of:
+
+ data = [
+ { 'name' : ,
+ 'count' :
+ },
+ ]
+
+ where name is one of:
+
+ 'h-total'
+ 'h-tested'
+ 'h-passed'
+ 'h-failed'
+ 'h-skipped'
+
+ 'x-total'
+ 'x-tested'
+ 'x-passed'
+ 'x-failed'
+ 'x-skipped'
+
+ */
+
+
+TestSuite.prototype.countTestsWithColumnValue = function(tx, completionHandler, column, value, label)
+{
+ var allRowsCount = 'COUNT(*)';
+
+ tx.executeSql('SELECT COUNT(*) FROM tests WHERE ' + column + '=?', [value], function(tx, results) {
+ var data = [];
+ if (results.rows.length > 0)
+ data.push({ 'name' : label, 'count' : results.rows.item(0)[allRowsCount] })
+ completionHandler(data);
+ }, errorHandler);
+}
+
+TestSuite.prototype.countTestsWithFlag = function(tx, completionHandler, flag)
+{
+ var allRowsCount = 'COUNT(*)';
+
+ tx.executeSql('SELECT COUNT(*) FROM tests WHERE flags LIKE \"%' + flag + '%\"', [], function(tx, results) {
+ var rowCount = 0;
+ if (results.rows.length > 0)
+ rowCount = results.rows.item(0)[allRowsCount];
+ completionHandler(rowCount);
+ }, errorHandler);
+}
+
+TestSuite.prototype.queryDatabaseForSummary = function(completionHandler)
+{
+ if (!this.db || this.populatingDatabase)
+ return;
+
+ var _self = this;
+
+ var htmlOnlyTestCount = 0;
+ var xHtmlOnlyTestCount = 0;
+
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+
+ var allRowsCount = 'COUNT(*)';
+
+ _self.countTestsWithFlag(tx, function(count) {
+ htmlOnlyTestCount = count;
+ }, 'htmlOnly');
+
+ _self.countTestsWithFlag(tx, function(count) {
+ xHtmlOnlyTestCount = count;
+ }, 'nonHTML');
+ });
+
+ this.db.transaction(function (tx) {
+ if (_self.populatingDatabase)
+ return;
+
+ var allRowsCount = 'COUNT(*)';
+ var html4RowsCount = 'COUNT(hstatus)';
+ var xhtml1RowsCount = 'COUNT(xstatus)';
+
+ tx.executeSql('SELECT COUNT(*), COUNT(hstatus), COUNT(xstatus) FROM tests', [], function(tx, results) {
+
+ var data = [];
+ if (results.rows.length > 0) {
+ var rowItem = results.rows.item(0);
+ data.push({ 'name' : 'h-total' , 'count' : rowItem[allRowsCount] - xHtmlOnlyTestCount })
+ data.push({ 'name' : 'x-total' , 'count' : rowItem[allRowsCount] - htmlOnlyTestCount })
+ data.push({ 'name' : 'h-tested', 'count' : rowItem[html4RowsCount] })
+ data.push({ 'name' : 'x-tested', 'count' : rowItem[xhtml1RowsCount] })
+ }
+ completionHandler(data);
+
+ }, errorHandler);
+
+
+ _self.countTestsWithColumnValue(tx, completionHandler, 'hstatus', 'pass', 'h-passed');
+ _self.countTestsWithColumnValue(tx, completionHandler, 'xstatus', 'pass', 'x-passed');
+
+ _self.countTestsWithColumnValue(tx, completionHandler, 'hstatus', 'fail', 'h-failed');
+ _self.countTestsWithColumnValue(tx, completionHandler, 'xstatus', 'fail', 'x-failed');
+
+ _self.countTestsWithColumnValue(tx, completionHandler, 'hstatus', 'skipped', 'h-skipped');
+ _self.countTestsWithColumnValue(tx, completionHandler, 'xstatus', 'skipped', 'x-skipped');
+
+ _self.countTestsWithColumnValue(tx, completionHandler, 'hstatus', 'invalid', 'h-invalid');
+ _self.countTestsWithColumnValue(tx, completionHandler, 'xstatus', 'invalid', 'x-invalid');
+ });
+}
+
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index ab4b32d..ae0aa79 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,19783 +1,22407 @@
-2010-02-12 Diego Gonzalez <diego.gonzalez@openbossa.org>
+2010-11-17 Adam Roben <aroben@apple.com>
- Reviewed by Kenneth Rohde Christiansen.
+ Don't trigger Windows builds when chromium-win test results change
- Qt DRT now dump the frame loader callbacks when LayoutTestController()
- method is called.
+ Reviewed by Mark Rowe.
- LayoutTests:
- http/tests/security/mixedContent/data-url-script-in-iframe.html
- http/tests/security/mixedContent/empty-url-plugin-in-frame.html
- http/tests/security/mixedContent/insecure-css-in-iframe.html
- http/tests/security/mixedContent/insecure-iframe-in-iframe.html
- http/tests/security/mixedContent/insecure-image-in-iframe.html
- http/tests/security/mixedContent/insecure-plugin-in-iframe.html
- http/tests/security/mixedContent/insecure-script-in-iframe.html
- http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe.html
- http/tests/security/mixedContent/redirect-https-to-http-script-in-iframe.html
+ * Scripts/webkitpy/common/config/build.py:
+ (_should_file_trigger_build): Changed the regular expression used to
+ search for directory names to only consider full directory names,
+ rather than matching directory names where the string we care about is
+ a suffix of the name.
- [Qt] Make possible Qt DRT dump frame load callbacks
- https://bugs.webkit.org/show_bug.cgi?id=34702
+ * Scripts/webkitpy/common/config/build_unittest.py:
+ (ShouldBuildTest): Added a test.
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::reset):
- (LayoutTestController::dumpFrameLoadCallbacks):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+2010-11-17 Hayato Ito <hayato@chromium.org>
-2010-02-12 Simon Hausmann <simon.hausmann@nokia.com>
+ Reviewed by Shinichiro Hamaji.
- Reviewed by Antti Koivisto.
+ Remove a uri member from TestInput class.
- Make QtLauncher somewhat useable on S60.
+ https://bugs.webkit.org/show_bug.cgi?id=49691
- Show the window fullscreen to make scrollbars appear, resize
- the toolbar buttons to 16x16 to give more screen space to
- web content and moved the location lineedit into a separate
- line.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * QtLauncher/main.cpp:
- (LauncherWindow::LauncherWindow):
- * QtLauncher/mainwindow.cpp:
- (MainWindow::buildUI):
+2010-11-17 Adam Roben <aroben@apple.com>
-2010-02-12 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+ Move FindSafari's settings into a vsprops file
- Reviewed by Kenneth Rohde Christiansen.
+ Fixes <http://webkit.org/b/49699> FindSafari should use a vsprops file
- Support frameset flattening
- https://bugs.webkit.org/show_bug.cgi?id=32717
+ Reviewed by Steve Falkenburg.
- Add FrameSet Flattening support to Mac DRT.
+ * FindSafari/FindSafari.vcproj:
+ * FindSafari/FindSafariCommon.vsprops: Added.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setFrameSetFlatteningEnabled):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setXSSAuditorEnabled):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::setFrameSetFlatteningEnabled):
- * DumpRenderTree/LayoutTestController.cpp:
- (setFrameSetFlatteningEnabledCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::setFrameSetFlatteningEnabled):
+2010-11-17 Adam Roben <aroben@apple.com>
-2010-02-12 Dirk Pranke <dpranke@chromium.org>
+ Use a minimum font size of 0 in DRT on Windows
- Reviewed by Eric Seidel.
+ This is the Windows equivalent of r72164.
- Fix typos in driver_test.py
+ Rubber-stamped by Dave Hyatt.
- https://bugs.webkit.org/show_bug.cgi?id=34810
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
- * Scripts/webkitpy/layout_tests/driver_test.py:
+2010-11-17 Dirk Pranke <dpranke@chromium.org>
-2010-02-12 Simon Hausmann <simon.hausmann@nokia.com>
+ Reviewed by Andreas Kling.
- Reviewed by Kenneth Rohde Christiansen.
+ webkit-patch pretty-diff shouldn't need to be run from a checkout root in git
+ https://bugs.webkit.org/show_bug.cgi?id=49639
- [Qt] Make it possible to toggle the use of QGraphicsView in QtLauncher at run-time
- https://bugs.webkit.org/show_bug.cgi?id=34844
+ * Scripts/webkitpy/common/checkout/scm.py:
- * QtLauncher/main.cpp:
- (LauncherWindow::LauncherWindow):
- (LauncherWindow::initializeView):
- (LauncherWindow::setupUI):
- * QtLauncher/webview.cpp:
- (WebViewGraphicsBased::WebViewGraphicsBased):
+2010-11-17 Mihai Parparita <mihaip@chromium.org>
-2010-02-11 Fumitoshi Ukai <ukai@chromium.org>
+ Reviewed by Tony Chang.
- Reviewed by Alexey Proskuryakov.
+ Rebaseline server: add loupe for image diffs
+ https://bugs.webkit.org/show_bug.cgi?id=49692
+
+ Add a loupe (magnifiying glass) for inspecting image diffs. Shows an
+ enlarged area of the expected, actual and diff images side by side.
- WebSocket ignores HttpOnly cookies, but should use in Handshake.
- https://bugs.webkit.org/show_bug.cgi?id=34289
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/index.html:
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/loupe.js: Added.
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js:
+ * Scripts/webkitpy/tool/commands/rebaselineserver.py:
- Update pywebsocket to 0.4.8, which supports cgi directories.
- run-webkit-tests and run-webkit-websocketserver will run
- pywebsocket, specifying /websocket/test/cookies as cgi directory.
+2010-11-17 Steve Falkenburg <sfalken@apple.com>
- * Scripts/run-webkit-tests:
- * Scripts/run-webkit-websocketserver:
- * pywebsocket/mod_pywebsocket/standalone.py:
- * pywebsocket/setup.py:
+ Reviewed by Adam Roben.
-2010-02-11 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+ WebKitLauncherWin should use vsprops for shared build settings
+ https://bugs.webkit.org/show_bug.cgi?id=49696
- Reviewed by Dan Bernstein.
+ * WebKitLauncherWin/WebKitLauncherWin.vcproj:
+ * WebKitLauncherWin/WebKitLauncherWinCommon.vsprops: Added.
- [Mac] Duplicated setXSSAuditorEnabled preference at Mac DRT
- https://bugs.webkit.org/show_bug.cgi?id=34798
+2010-11-17 Steve Falkenburg <sfalken@apple.com>
- Remove duplicated setXSSAuditorEnabled preference at Mac DRT
+ Reviewed by Adam Roben.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
+ WinLauncher should use vsprops for shared build settings
+ https://bugs.webkit.org/show_bug.cgi?id=49695
-2010-02-11 Eric Seidel <eric@webkit.org>
+ * WinLauncher/WinLauncher.cpp:
+ (_tWinMain):
+ (PrintView):
+ (WndProc):
+ (MyEditProc):
+ * WinLauncher/WinLauncher.vcproj:
+ * WinLauncher/WinLauncherCommon.vsprops: Added.
- No review, build fix only.
+2010-11-17 Steve Falkenburg <sfalken@apple.com>
- webkitdirs.pm has a crazy amount of duplicated feature detection code
- https://bugs.webkit.org/show_bug.cgi?id=34869
+ Delete unused file unintentionally added in last change.
- * Scripts/build-webkit: Fix typo which broke bots.
+ * DumpRenderTree/win/DumpRenderTreeCURL.vsprops: Removed.
-2010-02-11 Eric Seidel <eric@webkit.org>
+2010-11-17 Steve Falkenburg <sfalken@apple.com>
- Reviewed by Adam Barth.
+ Reviewed by Adam Roben.
- webkitdirs.pm has a crazy amount of duplicated feature detection code
- https://bugs.webkit.org/show_bug.cgi?id=34869
+ DumpRenderTree on Windows should use a vsprops file for shared project settings
+ https://bugs.webkit.org/show_bug.cgi?id=49690
- * Scripts/build-webkit: Use the new hotness.
- * Scripts/run-webkit-tests: ditto
- * Scripts/webkitdirs.pm: Remove a bunch of bad duplicate code.
- * Scripts/webkitperl/features.pm: Added.
- - Simplified the 10 methods in webkitdirs.pm into 2 exported methods in this new file.
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePluginCommon.vsprops: Added.
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/DumpRenderTreeApple.vsprops: Added.
+ * DumpRenderTree/win/DumpRenderTreeCFLite.vsprops: Added.
+ * DumpRenderTree/win/DumpRenderTreeCURL.vsprops: Added.
+ * DumpRenderTree/win/DumpRenderTreeCairo.vsprops: Added.
+ * DumpRenderTree/win/DumpRenderTreeCommon.vsprops: Added.
+ * DumpRenderTree/win/ImageDiff.vcproj:
+ * DumpRenderTree/win/ImageDiffCommon.vsprops: Added.
-2010-02-11 Daniel Bates <dbates@rim.com>
+2010-11-17 Hayato Ito <hayato@chromium.org>
- Reviewed by Adam Barth.
+ Refactor TestTypeBase.compare_output().
- https://bugs.webkit.org/show_bug.cgi?id=34830
+ Introduce a TestOutput class and update compare_output() of each test
+ types so that they can take both actual and expected TestOutput objects.
- Makes method User.prompt static and adds the parameter repeat
- to prompt the user up to repeat times.
+ https://bugs.webkit.org/show_bug.cgi?id=49431
- * Scripts/test-webkitpy:
- * Scripts/webkitpy/bugzilla.py: Substituted method User.prompt for method raw_input.
- * Scripts/webkitpy/commands/upload.py: Ditto
- * Scripts/webkitpy/credentials.py: Ditto
- * Scripts/mock_bugzillatool.py: Updated prototype of MockUser.prompt to match User.prompt.
- * Scripts/webkitpy/user.py: Made method prompt static and added parameter repeat.
- * Scripts/webkitpy/user_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_output.py: Added.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
-2010-02-10 Yuzo Fujishima <yuzo@google.com>
+2010-11-17 Adam Roben <aroben@apple.com>
- Reviewed by Darin Adler.
+ Make each Windows Test builder use the same OS for all its slaves
- Allow underscored identifiers in CSSParser.cpp
+ Currently each WebKit1 Windows Test builder has one Windows XP slave
+ and one Windows 7 slave. Having different OSes in a single builder
+ meant that the builders would alternate between red and green when
+ there were OS-specific failures.
- Flex (http://flex.sourceforge.net/) uses identifiers named as yy_*.
- WebCore/css/CSSParser.cpp needs to handle some such identifiers.
- We should relax the style rule for the file to allow underscored identifiers.
+ Fixes <http://webkit.org/b/49688> Windows Test builders alternate
+ between red and green because of multiple OS versions
- https://bugs.webkit.org/show_bug.cgi?id=34787
+ Reviewed by Mark Rowe.
- * Scripts/webkitpy/style/checker.py:
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Renamed
+ "Windows Release (Tests)" to "Windows 7 Release (Tests)", "Windows
+ Debug (Tests)" to "Windows XP Debug (Tests)", and "Windows Release
+ (WebKit2 Tests)" to "Windows 7 Release (WebKit2 Tests)". Updated the
+ builders for the two WebKit1 builders so that they would all use the
+ appropriate OS.
-2010-02-11 Eric Seidel <eric@webkit.org>
+2010-11-17 James Robinson <jamesr@chromium.org>
- Rubber-stamped by Adam Barth.
+ Reviewed by Dan Bernstein.
- Remove DrawTest, the application I used when bringing up SVG support on the Mac.
- The code hasn't been touched (or used) in years. No sense in keeping it in trunk.
+ [chromium] Set minimum font size to 0 for DRT
+ https://bugs.webkit.org/show_bug.cgi?id=49677
- * Scripts/build-drawtest: Removed.
- * Scripts/run-drawtest: Removed.
- * DrawTest: Removed.
+ Followup for http://trac.webkit.org/changeset/72141.
-2010-02-11 Eric Seidel <eric@webkit.org>
+ Test: http/tests/misc/acid3.html
- Reviewed by Adam Barth.
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
- Need a command to clear r+ on obsolete patches in the pending-commit queue.
- https://bugs.webkit.org/show_bug.cgi?id=34863
+2010-11-17 Andras Becsi <abecsi@webkit.org>
- Unfortunately our http://webkit.org/pending-commit bugzilla query is not
- smart enough to ignore obsolete patches, so bugs show up there which are
- still open, but do not have patches ready for landing on them.
- This new command "clean-pending-commit" will remove r+ from obsolete patches
- in the pending-commit list.
+ Unreviewed build fix.
- * Scripts/test-webkitpy: Add grammar_unittest
- * Scripts/webkitpy/commands/upload.py: Add clean-pending-commit and make assign-to-committer ignore cq+'d patches.
- * Scripts/webkitpy/grammar.py: Add join_with_separators
- * Scripts/webkitpy/grammar_unittest.py: Added.
+ [Qt] Add missing file I forgot in r72220.
-2010-02-11 Eric Seidel <eric@webkit.org>
+ * MiniBrowser/MiniBrowser.qrc: Added.
- Reviewed by Adam Barth.
+2010-11-17 Andras Becsi <abecsi@webkit.org>
- run-chromium-webkit-tests fails random pixel tests on Mac
- https://bugs.webkit.org/show_bug.cgi?id=34862
+ Reviewed by Andreas Kling.
- This is due to the fact that the Mac port has an
- invalid path to the image diff tool. Currently it points
- to image_diff even though ImageDiff would be correct. We
- can't change it to the right path yet without causing the
- script to hang. ImageDiff expects to be long-running and
- be passed image data over stdin. image_diff (chromium's fork)
- expects to be passed command line arguments.
- This fix works around the random failures by disabling pixel
- tests on mac and logging if the user was trying to run with pixel
- tests enabled.
+ [Qt][WK2] Make it possible to set custom user agent strings in MiniBrowser.
+ https://bugs.webkit.org/show_bug.cgi?id=49627
- * Scripts/webkitpy/layout_tests/port/mac.py:
+ Add a user agent dialog and a resource file for useragentlist.txt to MiniBrowser.
-2010-02-11 Nikolas Zimmermann <nzimmermann@rim.com>
+ * MiniBrowser/MiniBrowser.qrc: Added.
+ Add it here to prevent qmake from detecting it
+ since it needs to be copied to the build directory.
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserWindow::BrowserWindow):
+ (BrowserWindow::updateUserAgentList):
+ (BrowserWindow::showUserAgentDialog):
+ * MiniBrowser/qt/BrowserWindow.h:
+ * MiniBrowser/qt/MiniBrowser.pro:
- Reviewed by Adam Roben.
- Try to fix build breakage from r54665.
-
- * Scripts/check-for-global-initializers:
+2010-11-17 Adam Roben <aroben@apple.com>
-2010-02-11 Simon Hausmann <simon.hausmann@nokia.com>
+ Make changes to the Mac WebKit2 Skipped file trigger Windows builds
- Reviewed by Tor Arne Vestbø.
+ We use that file on Windows!
- Make it possible to toggle accelerated compositing from the menu
- at run-time.
+ Fixes <http://webkit.org/b/49643> Changes to
+ LayoutTests/platform/mac-wk2 should trigger a Windows build, but don't
- * QtLauncher/main.cpp:
- (LauncherWindow::toggleAcceleratedCompositing):
- (LauncherWindow::setupUI):
+ Reviewed by Steve Falkenburg.
-2010-02-08 Maciej Stachowiak <mjs@apple.com>
+ * Scripts/webkitpy/common/config/build.py:
+ (_should_file_trigger_build): Added the mac-wk2 directory and make it
+ trigger builds on SnowLeopard and Windows.
- Reviewed by Cameron Zwarich.
+ * Scripts/webkitpy/common/config/build_unittest.py:
+ (ShouldBuildTest.test_should_build): Added a test.
- Restore ENABLE_RUBY flag so vendors can ship with Ruby disabled if they choose.
- https://bugs.webkit.org/show_bug.cgi?id=34698
+2010-11-17 Satish Sampath <satish@chromium.org>
- * Scripts/build-webkit:
+ Reviewed by Jeremy Orlow.
-2010-02-10 Dirk Pranke <dpranke@chromium.org>
+ Clear the speech input mock explicitly before each test.
+ https://bugs.webkit.org/show_bug.cgi?id=49660
- Reviewed by Eric Seidel.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::speechInputController):
+ (WebViewHost::reset): Invoke speech input mock's clearResults method.
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost::speechInputControllerMock): Moved mock from LayoutTestController.
- Fix various minor bugs keeping run-chromium-webkit-tests from actually
- working on the linux and win ports of Chromium.
+2010-11-17 Alexander Pavlov <apavlov@chromium.org>
- https://bugs.webkit.org/show_bug.cgi?id=34739
+ Unreviewed, specify IRC nickname in committers.py.
- * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
- * Scripts/webkitpy/layout_tests/port/__init__.py:
- * Scripts/webkitpy/layout_tests/port/base.py:
- * Scripts/webkitpy/layout_tests/port/chromium.py:
- * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
- * Scripts/webkitpy/layout_tests/port/chromium_win.py:
- * Scripts/webkitpy/layout_tests/port/http_server.py:
- * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/common/config/committers.py:
-2010-02-10 Eric Seidel <eric@webkit.org>
+2010-11-17 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- Reviewed by David Levin.
+ Reviewed by Tony Chang.
- run-chromium-webkit-tests --platform=mac-leopard crashes when using a custom build directory
- https://bugs.webkit.org/show_bug.cgi?id=34817
+ [NRWT] Make http locking similar to perl implementation
+ https://bugs.webkit.org/show_bug.cgi?id=49187
- This doesn't fix the root cause of us not
- correctly failing when support binaries are missing.
- This only causes the DumpRenderTree binary not to be
- missing in the custom build directory case.
- Later patches will make us correctly fail fast when
- support binaries (like DumpRenderTree or ImageDiff) are missing.
+ * Scripts/webkitpy/common/system/file_lock.py: Added.
+ * Scripts/webkitpy/common/system/file_lock_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/port/http_lock.py:
- * Scripts/webkit-build-directory: Added.
- - Need a way to re-use the perl logic for finding build directories in non-perl scripts.
- * Scripts/webkitpy/layout_tests/port/base.py: Add a FIXME.
- * Scripts/webkitpy/layout_tests/port/mac.py:
- - Call webkit-build-directory to find the build directory instead of assuming "WebKitBuild"
- * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py: Add FIXMEs.
+2010-11-17 MORITA Hajime <morrita@google.com>
-2010-02-10 Kevin Watters <kevinwatters@gmail.com>
+ Reviewed by Kent Tamura.
- Reviewed by Kevin Ollivier.
+ [Chromium][DRT] EventSender.contextClick() should aware spellchecking
+ https://bugs.webkit.org/show_bug.cgi?id=49366
+
+ - EvenSender: Checked WebContextMenuData.misspelledWord and added extra context menu entries
+ according to the spellchecker suggestion
+ - MockSpellCheck: add fillSuggestionList to provide fake suggestions.
- [wx] Add Windows complex text support.
+ test_expectations.txt will be changed after this change is ported to test_shell.
- https://bugs.webkit.org/show_bug.cgi?id=34759
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (makeMenuItemStringsFor):
+ (EventSender::contextClick):
+ * DumpRenderTree/chromium/MockSpellCheck.cpp:
+ (MockSpellCheck::fillSuggestionList):
+ (MockSpellCheck::initializeIfNeeded):
+ * DumpRenderTree/chromium/MockSpellCheck.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::mockSpellCheck):
+ * DumpRenderTree/chromium/WebViewHost.h:
- * wx/build/settings.py:
+2010-11-16 Dave Hyatt <hyatt@apple.com>
-2010-02-10 Kevin Ollivier <kevino@theolliviers.com>
+ Reviewed by Sam Weinig.
- [wx] Build fix. Add stub for new LayoutTestController method.
+ Make sure the pref for minimum font size is just explicitly set to 0 every time,
+ since the bots have 1 stuck in their plist otherwise.
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::numberOfPages):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
-2010-02-10 Csaba Osztrogonác <ossy@webkit.org>
+2010-11-16 Mihai Parparita <mihaip@chromium.org>
- Unreviewed. Roll out r54626, because it broke GTK and Win build.
- https://bugs.webkit.org/show_bug.cgi?id=32717
+ Reviewed by Tony Chang.
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ Rebaseline server: compute diffs client-side
+ https://bugs.webkit.org/show_bug.cgi?id=49640
+
+ The image diff output from the DRT is pretty bad on some ports (at
+ least the Mac one), so it's better to compute diffs on the client by
+ using <canvas>.
-2010-02-10 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/index.html:
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css:
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js:
- Reviewed by Kenneth Rohde Christiansen.
+2010-11-16 Mihai Parparita <mihaip@chromium.org>
- Support frameset flattening
- https://bugs.webkit.org/show_bug.cgi?id=32717
+ Reviewed by Tony Chang.
- Add FrameSet Flattening support to Mac DRT.
+ Rebaseline server: display test results
+ https://bugs.webkit.org/show_bug.cgi?id=49626
+
+ Adds basic result display to the rebaseline server. On the Python side
+ this involves:
+ - Parsing the unexpected_results.json into a dictionary.
+ - Serving it as JSON under /results.json.
+ (the JSON -> dict -> JSON transform isn't strictly necessary right now,
+ but I'll need to have access to the parsed results on the Python side
+ for follow-up changes).
+
+ On the web UI side this adds:
+ - Markup for display image and text results (expected, actual, diff),
+ and JS for populating it.
+ - Markup for breaking down test results by failure type and directory,
+ and JS for populating it.
- * DumpRenderTree/LayoutTestController.cpp:
- (setFrameSetFlatteningEnabledCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::setFrameSetFlatteningEnabled):
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/index.html:
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css:
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js:
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js: Added.
+ * Scripts/webkitpy/tool/commands/rebaselineserver.py:
-2010-02-08 Jon Honeycutt <jhoneycutt@apple.com>
+2010-11-16 Dirk Pranke <dpranke@chromium.org>
- <rdar://problem/7436875> Crash in Flash when visiting
- http://www.cctv.com/default.shtml (WER ID 819298200) [watson 2502260]
+ Reviewed by Ojan Vafai.
- Reviewed by Darin Adler.
+ See Chromium issue http://codereview.chromium.org/5133001/ - we
+ are modifying the build bots to pass in the builder name with
+ the "GPU" string appended instead of appending it in the code.
- * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
- (executeScript):
- Moved to an earlier point in the file.
- (NPP_New):
- If the plug-in has an onDestroy attribute, store its value.
- (NPP_Destroy):
- If the plug-in has code to run on destruction, run it and free it.
+ https://bugs.webkit.org/show_bug.cgi?id=49636
-2010-02-10 Diego Gonzalez <diego.gonzalez@openbossa.org>
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
- Reviewed by Kenneth Rohde Christiansen.
+2010-11-16 Steve Falkenburg <sfalken@apple.com>
- Implement pageNumberForElementById() method in Qt DRT LayoutTestController,
- to make Qt DRT able to get page number.
+ Reviewed by Adam Roben.
- LayoutTests:
- printing/page-break-always.html
- printing/pageNumerForElementById.html
- printing/css2.1/page-break-before-000.html
- printing/css2.1/page-break-after-000.html
- printing/css2.1/page-break-after-004.html
- printing/css2.1/page-break-before-001.html
- printing/css2.1/page-break-after-001.html
- printing/css2.1/page-break-after-002.html
- printing/css2.1/page-break-before-002.html
- printing/css2.1/page-break-inside-000.html
+ Disable LTCG for Windows Release builds. Add new Release_LTCG configuration.
+ https://bugs.webkit.org/show_bug.cgi?id=49632
- [Qt] Make possible Qt DRT get a page number for element by ID
- https://bugs.webkit.org/show_bug.cgi?id=34777
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/ImageDiff.vcproj:
+ * MiniBrowser/MiniBrowser.vcproj:
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj:
+ * WebKitLauncherWin/WebKitLauncherWin.vcproj:
+ * WebKitTestRunner/win/InjectedBundle.vcproj:
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj:
+ * WinLauncher/WinLauncher.vcproj:
+ * record-memory-win/record-memory-win.vcproj:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::pageNumberForElementById):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+2010-11-16 Dirk Pranke <dpranke@chromium.org>
-2010-02-10 Andras Becsi <abecsi@webkit.org>
+ Reviewed by Ojan Vafai.
- Reviewed by Adam Barth.
+ new-run-webkit-tests: rename TestInfo to TestInput, move image hash to work thread
- Make run-iexploder-tests work on Linux.
- https://bugs.webkit.org/show_bug.cgi?id=34748
+ Rename the TestInfo class to TestInput to be clearer about its
+ function, and move the checksum-reading code into dump_render_tree_thread
+ to avoid cross-thread access.
- Extract the platform dependant Apache configuration checking code in httpd.pm to a separate function
- called getHTTPDConfigPathForTestDirectory and use run-launcher instead of run-safari if run on Linux.
+ https://bugs.webkit.org/show_bug.cgi?id=49573
- * Scripts/run-iexploder-tests:
- * Scripts/webkitperl/httpd.pm:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
-2010-02-09 Csaba Osztrogonác <ossy@webkit.org>
+2010-11-16 Dave Hyatt <hyatt@apple.com>
- [Qt] Unreviewed. Roll-out r54543, because layout tests crash in debug mode.
- https://bugs.webkit.org/show_bug.cgi?id=34713
+ Fix bustage. Remove the minimum font size pref setting in DumpRenderTree.
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::WebPage::WebPage):
- * DumpRenderTree/qt/main.cpp:
- (main):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
-2010-02-09 Alejandro G. Castro <alex@igalia.com>
+2010-11-16 Stephanie Lewis <slewis@apple.com>
- Unreviewed; added myself to committers
+ Reviewed by Geoff Garen.
- * Scripts/webkitpy/committers.py:
+ <rdar://problem/8624267> Leak creating offscreen webview running fast/dom tests
-2010-02-09 Yael Aharon <yael.aharon@nokia.com>
+ Use shared DeviceOrientationProviderMock. The old allocation method created a new WebDeviceOrientationProviderMock
+ for every WebView, and the WebKit API doesn't support that ownership model.
- Reviewed by Kenneth Rohde Christiansen.
+ I also fixed a leak in setMockDeviceOrientation by adding a missing release.
- [Qt] Webkit in Qt does not have window.showModalDialog
- https://bugs.webkit.org/show_bug.cgi?id=25585
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (createWebViewAndOffscreenWindow):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockDeviceOrientation):
- Set the modality flag when createWindow is called with window type WebWindowDialog.
+2010-11-16 Dirk Pranke <dpranke@chromium.org>
- * QtLauncher/main.cpp:
- (WebPage::createWindow):
+ Reviewed by Ojan Vafai.
-2010-02-09 Andras Becsi <abecsi@webkit.org>
+ new-run-webkit-tests: log the process id in --verbose mode
- Unreviewed trivial warning fix.
+ As part of the switch to multi-process mode, we should log the
+ process id when running w/ --verbose.
- * Scripts/build-webkit:
+ https://bugs.webkit.org/show_bug.cgi?id=49571
-2010-02-09 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
- Reviewed by Tor Arne Vestbø.
+2010-11-16 Adam Roben <aroben@apple.com>
- Add possibility of passing parameters to build-webkit by environment variable,
- because the buildbot slaves can't control the arguments.
+ Only trigger Windows builds when files that we actually use on Windows
+ are changed
- * Scripts/build-webkit:
+ A new Scheduler subclass, PlatformSpecificScheduler, has been added.
+ It uses the new webkitpy.common.config.build module to determine
+ whether a particular change should trigger a build on a particular
+ platform. The Windows builders have been switched to use a
+ PlatformSpecificScheduler.
-2010-02-09 Chang Shu <Chang.Shu@nokia.com>
+ The logic to determine whether or not a particular change should
+ trigger a build on a given platform has only been implemented/tested
+ for Windows. I tried to make it easy to add more platforms in the
+ future, but I don't have enough familiarity with all platforms to be
+ able to implement it for them.
- Reviewed by Laszlo Gombos.
+ Fixes <http://webkit.org/b/49407> Windows builders kick off builds for
+ lots irrelevant changes (e.g., rebaselining Chromium test results)
- [Qt] Enable appcache feature.
- https://bugs.webkit.org/show_bug.cgi?id=34713
+ Reviewed by Eric Seidel.
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Use a
+ PlatformSpecificScheduler for the Windows builders.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ (PlatformSpecificScheduler.__init__): Added. Stores our platform, sets
+ up a ChangeFilter that filters to our branch and will call through to
+ our filter method, and calls up to our base class.
+ (PlatformSpecificScheduler.filter): Calls through to
+ build.should_build to find out whether we should trigger a build for
+ this change.
+
+ * Scripts/webkitpy/common/net/build.py: Added.
+ (_should_file_trigger_build): Uses a set of directories and regexp
+ patterns to determine whether the given file should trigger a build on
+ the given platform. As mentioned earlier, this has only been
+ implemented for Windows, though I did try to make some guesses about
+ other platforms.
+ (should_build): Returns true if any of the files should trigger a
+ build on the given platform.
+
+ * Scripts/webkitpy/common/net/build_unittest.py: Added.
+ (ShouldBuildTest.test_should_build): Does some basic testing to make
+ sure we're triggering builds for the right files. It only tests
+ Windows for now, though I tried to make some guesses about other
+ platforms.
+
+2010-11-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Remove synchronous QWebPage::checkPermissions signal
+ https://bugs.webkit.org/show_bug.cgi?id=46810
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::WebPage::WebPage):
- * DumpRenderTree/qt/main.cpp:
- (main):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::grantDesktopNotificationPermission): When granting
+ permission, grant it directly on the QWebPage/Frame, that will remember it.
+ * QtTestBrowser/webpage.cpp:
+ (WebPage::WebPage):
+ * QtTestBrowser/webpage.h:
-2010-02-09 Shinichiro Hamaji <hamaji@chromium.org>
- Reviewed by Darin Adler.
+2010-11-16 Andras Becsi <abecsi@inf.u-szeged.hu>
- Provide a way to get total number of pages to be printed
- https://bugs.webkit.org/show_bug.cgi?id=34699
+ Reviewed by Csaba Osztrogonác.
- * DumpRenderTree/LayoutTestController.cpp:
- (parsePageParameters):
- (pageNumberForElementByIdCallback):
- (numberOfPagesCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::numberOfPages):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::numberOfPages):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::numberOfPages):
+ [Qt] Add isPrinting and setPrinting methods to DRT's LayoutTestController.
-2010-02-08 Alexey Proskuryakov <ap@apple.com>
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::isPrinting):
+ (LayoutTestController::setPrinting):
- Reviewed by Darin Adler.
+2010-11-16 Balazs Kelemen <kbalazs@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=34727
- Assertion crashes and freezes when plug-in property access results in an exception
+ Reviewed by Andreas Kling.
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
- (pluginGetProperty): Raise an exception when accessing a particular property.
- (pluginSetProperty): Ditto.
- (pluginInvoke): Added methods to get and set host object properties.
+ [Qt][WK2] Add a way to turn on tiled backing store in MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=49587
+
+ * MiniBrowser/qt/BrowserView.cpp:
+ (BrowserView::BrowserView): Added BackingStoreType
+ argument to ctor. Propagating it to the QGraphicsWKView.
+ * MiniBrowser/qt/BrowserView.h:
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserWindow::BrowserWindow):
+ (BrowserWindow::newWindow): Create the new BrowserWindow
+ with the same BackingStoreType that this instance has.
+ * MiniBrowser/qt/BrowserWindow.h: Added BackingStoreType member.
+ * MiniBrowser/qt/main.cpp:
+ (main): Use tiled backing store if got -tiled command line argument.
+ Avoid redundant copy of command line args.
-2010-02-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-11-16 John Knottenbelt <jknotten@chromium.org>
- Reviewed by Ariya Hidayat.
+ Reviewed by Jeremy Orlow.
- [Qt] Backport No'am Rosenthal's frame rate measurement
+ Move DeviceOrientationClientMock from LayoutTestController to WebViewHost.
+ https://bugs.webkit.org/show_bug.cgi?id=48506
- * QtLauncher/main.cpp:
- (LauncherWindow::LauncherWindow):
- (LauncherApplication::handleUserOptions):
- * QtLauncher/webview.cpp:
- (WebViewGraphicsBased::WebViewGraphicsBased):
- (WebViewGraphicsBased::enableFrameRateMeasurement):
- (WebViewGraphicsBased::updateFrameRate):
- (WebViewGraphicsBased::paintEvent):
- * QtLauncher/webview.h:
+ This ensures that there is one mock per page WebView / WebViewHost. This is a
+ design constraint of the DeviceOrientationClientMock because the m_controller
+ field can only store a pointer to a single instance of the corresponding
+ DeviceOrientationController.
-2010-02-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Test: fast/dom/DeviceOrientation/no-page-cache.html
- Reviewed by Tor Arne Vestbø.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ (LayoutTestController::deviceOrientationClientMock):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::deviceOrientationClientMock):
+ (WebViewHost::deviceOrientationClient):
+ (WebViewHost::reset):
+ * DumpRenderTree/chromium/WebViewHost.h:
- [Qt] Make overridePreference complain when it does not
- support the preference given.
+2010-11-15 Andras Becsi <abecsi@webkit.org>
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::overridePreference):
+ Reviewed by Andreas Kling.
-2010-02-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ [Qt][WK2] Avoid polling in WebKitTestRunner.
+ https://bugs.webkit.org/show_bug.cgi?id=49542
- Reviewed by Kenneth Rohde Christiansen.
+ Make the WK2 testing session about 10-15% faster and decrease random flakiness
+ resulting from timing skew by removing the millisecond polling from TestControllerQt.
- [Qt] Set stdout/stderr to binary mode for DRT on Windows
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::didFinishLoadForFrame):
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::notifyDone): Add method stub.
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ (WTR::TestControllerRunLoop::instance):
+ (WTR::TestControllerRunLoop::start):
+ (WTR::TestControllerRunLoop::stop):
+ (WTR::TestControllerRunLoop::TestControllerRunLoop):
+ (WTR::TestControllerRunLoop::timerEvent):
+ (WTR::TestController::notifyDone):
+ (WTR::TestController::platformRunUntil):
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::notifyDone): Add method stub.
- This makes sure we don't end up with lots of CRLFs in the
- DRT output, which breaks tons of results. Matches what
- the Windows DRT does.
+2010-11-15 Darin Adler <darin@apple.com>
- * DumpRenderTree/qt/main.cpp:
+ * Scripts/webkitpy/common/net/bugzilla: Added property svn:ignore.
-2010-02-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+2010-11-15 Benjamin Poulain <benjamin.poulain@nokia.com>
- Reviewed by Kenneth Rohde Christiansen.
+ Reviewed by Andreas Kling.
- Build fix for Qt on Windows.
+ [Qt] [WK2] Add Ctrl+L shortcut to Qt Minibrowser
+ https://bugs.webkit.org/show_bug.cgi?id=49544
- Don't use noreturn directly since it's a gcc attribute.
- Instead use the NO_RETURN macro from AlwaysInline.h
+ Add the shortcut to BrowserWindow.
- * QtLauncher/QtLauncher.pro:
- * QtLauncher/utils.h:
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserWindow::BrowserWindow):
+ (BrowserWindow::openLocation):
+ * MiniBrowser/qt/BrowserWindow.h:
-2010-02-05 Chris Jerdonek <cjerdonek@webkit.org>
+2010-11-14 David Levin <levin@chromium.org>
- Reviewed by Shinichiro Hamaji.
+ Reviewed by Daniel Bates.
- Suppressed check-webkit-style's underscore check in Qt's autotests.
- Also made the path-specific filter check case-insensitive.
+ check-webkit-style should detect PassRefPtr usage in functions.
+ https://bugs.webkit.org/show_bug.cgi?id=49513
- https://bugs.webkit.org/show_bug.cgi?id=34574
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ (check_for_function_lengths): Revert a comment change that I
+ accidentally made in r71986.
+ (check_pass_ptr_usage): Added the code to do the check.
+ (process_line): Added the call to check_pass_ptr_usage.
+ (CppChecker): Added the new error category.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+ (CppStyleTestBase::perform_pass_ptr_check): Runs the new check for
+ testing purposes.
+ (PassPtrTest::*): The class/functions to unit test the new
+ functionality.
+
+2010-11-14 David Levin <levin@chromium.org>
- * Scripts/webkitpy/style/checker.py:
- - Added a list element to _PATH_RULES_SPECIFIER for
- directories that should be excluded from the
- "readability/naming" category (the category that relates to
- underscores in identifiers, for example).
+ Reviewed by Shinichiro Hamaji.
- * Scripts/webkitpy/style/checker_unittest.py:
- - Added an "end-to-end" test for "WebKit/qt/tests/".
+ check-webkit-style function detection and the line count style checks should be separate.
+ https://bugs.webkit.org/show_bug.cgi?id=49512
- * Scripts/webkitpy/style/filter.py:
- - Altered FilterConfiguration's should_check() method to
- check for path substring matches case-insensitively.
+ * Scripts/webkitpy/style/checkers/cpp.py: Do the separation.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Adjust the test to
+ call the detection function and fix line counts in two places now that
+ the code really only counts the lines in the body of the function.
- * Scripts/webkitpy/style/filter_unittest.py:
- - Added a test to check case-insensitive path substring matching.
+2010-11-14 Andreas Kling <kling@webkit.org>
- * Scripts/webkitpy/style/processors/cpp.py:
- - Removed the hard-coded "WebKit/gtk/webkit/" path reference
- since this is now taken care of by the _PATH_RULES_SPECIFIER
- configuration variable.
+ Reviewed by Antonio Gomes.
- * Scripts/webkitpy/style/processors/cpp_unittest.py:
- - Removed the unit test for the GTK directory since this
- is now taken care of by the checker._PATH_RULES_SPECIFIER
- end-to-end tests.
+ http/tests/plugins tests print "Unhandled variable" to stderr under Qt
+ https://bugs.webkit.org/show_bug.cgi?id=33438
-2010-02-08 Leith Bade <leith@leithalweapon.geek.nz>
+ Stifle "Unhandled variable" warning to match what the other
+ TestNetscapePlugin does (NPP_GetValue in TestNetscapePlugIn/main.cpp
+ simply returns NPERR_GENERIC_ERROR for unhandled variables.)
- Reviewed by Darin Adler.
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_get_value):
- Fixes: https://bugs.webkit.org/show_bug.cgi?id=34637
- Corrects the newline inserted into WebKitOutputDir, and WebKitLibrariesDir Windows
- environemnt variables when there is a space in the user's /home path.
+2010-11-13 David Levin <levin@chromium.org>
- * Scripts/webkitdirs.pm:
- - Added missing quotes around $sourceDir in argument list of cygpath in determineWindowsSourceDir().
+ Reviewed by Eric Seidel.
-2010-02-05 Alexey Proskuryakov <ap@apple.com>
+ check-webkit-style function detection crashes on functions in templates.
+ https://bugs.webkit.org/show_bug.cgi?id=49504
- Reviewed by Oliver Hunt.
+ For example "template <bool shouldClose(const Element*)>".
- https://bugs.webkit.org/show_bug.cgi?id=34670
- TestNetscapePlugin should work with Firefox
+ * Scripts/webkitpy/style/checkers/cpp.py: If not function is detected, bail out.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Modified the complex
+ function detection test to expose this issue.
- * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp: (NPP_New): Default to Carbon if
- browser doesn't tell what it supports.
+2010-11-12 David Levin <levin@chromium.org>
-2010-02-05 Shinichiro Hamaji <hamaji@chromium.org>
+ Reviewed by Shinichiro Hamaji.
- Reviewed by Gustavo Noronha Silva.
+ check-webkit-style function detection doesn't detect indented functions declaractions.
+ https://bugs.webkit.org/show_bug.cgi?id=49446
- [Gtk] Implement layoutTestController.pageNumberForElementById
- https://bugs.webkit.org/show_bug.cgi?id=34572
+ Indented function declarations occur inside class definitions, so
+ they are a pretty common (and worth detecting).
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::pageNumberForElementById):
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ Changed regex to allow indentation.
+ Changed the function start detection to only happen when not in a
+ function.
+ Changed function end detection to work based on matching braces
+ instead of finding a close brace at the beginning of the line.
+ Fixed close_expression to do what it says when it doesn't find
+ the close.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Indented function test.
-2010-02-03 Dirk Pranke <dpranke@chromium.org>
+2010-11-12 Daniel Bates <dbates@rim.com>
- Reviewed by Eric Seidel.
+ Rubber-stamped by Nikolas Zimmermann.
- Add a simple test implementation and the WebKit Mac implementation
- for the layout_tests/port package. Also add a simple test driver of
- that interface.
+ Make do-file-rename rename files in the directory WebKit2.
- https://bugs.webkit.org/show_bug.cgi?id=34511
+ This also makes the list of searched directories in do-file-rename
+ consistent with the list of searched directories in the script do-webcore-rename.
- * Scripts/webkitpy/layout_tests/driver_test.py: Added.
- * Scripts/webkitpy/layout_tests/port/__init__.py:
- * Scripts/webkitpy/layout_tests/port/mac.py: Added.
- * Scripts/webkitpy/layout_tests/port/test.py: Added.
+ * Scripts/do-file-rename:
-2010-02-03 Dirk Pranke <dpranke@chromium.org>
+2010-11-12 Dirk Pranke <dpranke@chromium.org>
- Reviewed by Eric Siedel.
+ Reviewed by James Robinson.
- Refactor the port package into an object-oriented style and merge
- path_utils into it. We add a 'base' and a 'chromium' object to the
- port package; this will allow us to easily add new ports (like
- WebKit Mac).
+ Attempt yet again to land the fix for bug 49360 (respecting
+ set-webkit-configuration). We need to handle the cases where
+ trying to run webkit-build-directory to find out where the
+ default configuration might be fails (that shows up on some
+ Chromium bots that apparently don't have perl installed).
- https://bugs.webkit.org/show_bug.cgi?id=34511
+ https://bugs.webkit.org/show_bug.cgi?id=49360
- * Scripts/rebaseline-chromium-webkit-tests:
- * Scripts/run-chromium-webkit-tests:
- * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
- * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
- * Scripts/webkitpy/layout_tests/port/__init__.py:
- * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
- * Scripts/webkitpy/layout_tests/port/base.py: Added.
- * Scripts/webkitpy/layout_tests/port/chromium.py: Added.
- * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
- * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
- * Scripts/webkitpy/layout_tests/port/chromium_win.py:
- * Scripts/webkitpy/layout_tests/port/http_server.py:
- * Scripts/webkitpy/layout_tests/port/http_server_base.py:
- * Scripts/webkitpy/layout_tests/port/path_utils.py: Removed.
- * Scripts/webkitpy/layout_tests/port/websocket_server.py:
- * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
- * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
- * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
- * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
- * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ * Scripts/webkitpy/layout_tests/port/config.py:
+ * Scripts/webkitpy/layout_tests/port/config_standalone.py: Added.
+ * Scripts/webkitpy/layout_tests/port/config_unittest.py:
-2010-01-19 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-11-12 Mihai Parparita <mihaip@chromium.org>
- Reviewed by Dave Hyatt.
+ Reviewed by Adam Barth.
- Implement flattening of framesets
- https://bugs.webkit.org/show_bug.cgi?id=32717
+ webkit-patch land logs commit message twice
+ https://bugs.webkit.org/show_bug.cgi?id=49482
+
+ Don't log the comment that's used by bugzilla.close_bug_as_fixed, since
+ that's just the commit message, which we now output following the
+ actual commit.
- Add support for testing frame flattening with the Qt DRT
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setFrameSetFlatteningEnabled):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+2010-11-12 Tony Chang <tony@chromium.org>
-2010-02-03 Chris Jerdonek <cjerdonek@webkit.org>
+ Reviewed by Adam Barth.
- Reviewed by Shinichiro Hamaji.
+ run platform/chromium/plugins/script-object-invoke.html on all platforms
+ https://bugs.webkit.org/show_bug.cgi?id=49280
- Provided a way in check-webkit-style to specify filter rules
- on a per file or folder basis, via a configuration variable.
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (testScriptObjectInvoke):
+ (pluginInvoke):
- https://bugs.webkit.org/show_bug.cgi?id=33684
+2010-11-12 Mihai Parparita <mihaip@chromium.org>
- * Scripts/webkitpy/style/checker.py:
- - Added _PATH_RULES_SPECIFIER configuration variable.
- - In ProcessorOptions class--
- - Changed the CategoryFilter attribute to FilterConfiguration.
- - Added path parameter to is_reportable().
- - Renamed ArgumentDefaults filter_rules attribute to
- base_filter_rules.
- - Updated ArgumentPrinter class.
- - Added filter rule validation to ArgumentParser (instead of
- in CategoryFilter constructor).
+ Reviewed by Adam Barth.
- * Scripts/webkitpy/style/checker_unittest.py:
- - Updated unit tests as necessary.
- - Added unit tests for PATH_RULES_SPECIFIER.
+ webkit-patch land-cowboy (and other commands) should display the committed SVN revision after landing a patch
+ https://bugs.webkit.org/show_bug.cgi?id=49471
- * Scripts/webkitpy/style/error_handlers.py:
- - Updated DefaultStyleErrorHandler to use file path when
- calling is_reportable().
+ Right now there's no indication of a successful commit.
+
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/steps/commit.py:
- * Scripts/webkitpy/style/error_handlers_unittest.py:
- - Updated unit tests as necessary.
+2010-11-12 Kinuko Yasuda <kinuko@chromium.org>
- * Scripts/webkitpy/style/filter.py:
- - Marked CategoryFilter internal with an underscore.
- - Removed argument validation from CategoryFilter.
- - Added FilterConfiguration class.
+ Reviewed by Ojan Vafai.
- * Scripts/webkitpy/style/filter_unittest.py:
- - Updated CategoryFilterTest class.
- - Added FilterConfigurationTest unit tests.
+ Include detailed test modifiers in results.json and enable incremental uploading for non-layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=49354
- * Scripts/webkitpy/style/processors/cpp.py:
- - Removed _is_test_filename() code.
- - Removed hard-coded path checks from check_include_line().
+ Also moved/integrated the upload method from run_webkit_tests.py to json_results_generator.py.
- * Scripts/webkitpy/style/processors/cpp_unittest.py:
- - Removed three unit tests related to exempted files.
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
-2010-02-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-11-12 Tony Chang <tony@chromium.org>
- Reviewed by Ariya Hidayat.
+ Reviewed by Kent Tamura.
- [Qt] Apply the command line options as settings to the
- graphics system.
+ [chromium] Load a blank page when closing DRT WebViewHosts
+ https://bugs.webkit.org/show_bug.cgi?id=49417
- * QtLauncher/main.cpp:
- (LauncherWindow::LauncherWindow):
- (requiresGraphicsView):
- (LauncherApplication::handleUserOptions):
- * QtLauncher/webview.h:
- (WebViewGraphicsBased::setItemCacheMode):
+ In test_shell, when we close a window, we first load about:blank
+ and run GC to fire the destruction logic of the page. In test_shell,
+ this happens in ~TestShell. In DRT, we manage virtual windows as
+ WebViewHosts, so we need to replicate this logic in ~WebViewHost.
-2010-02-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ Managing focus is a bit trickier, since normally you would get window
+ events to reset the focus to the right window. We do it manually
+ instead.
- Reviewed by Simon Hausmann.
+ This fixes 2 plugin tests on DRT.
- Notify user that run-webkit-tests has to be run under Cygwin
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::~TestShell): Move window close logic to ~WebViewHost.
+ (TestShell::closeWindow): Move widget close() to WVH destructor and
+ manage focus manually.
+ (TestShell::closeRemainingWindows): Comment typo.
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::closeWidget):
+ (invokeCloseWidget):
+ (WebViewHost::closeWidgetSoon): Close the window asynchronously (matches
+ test_shell).
+ (WebViewHost::~WebViewHost):
+ * DumpRenderTree/chromium/WebViewHost.h:
- The script will bail out if run under Windows shell or Msys.
+2010-11-12 David Levin <levin@chromium.org>
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
+ Reviewed by Adam Barth.
-2010-02-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ cpp.py needs some tidying.
+ https://bugs.webkit.org/show_bug.cgi?id=49443
- Reviewed by Simon Hausmann.
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ Fix parameter ordering for iteratively_replace_matches_with_char
+ to mirror other similar functions (and improved comments, etc.)
+ Also, use a python-ism (for/else) to get rid of a variable that
+ was there to determine if something had been found in the loop.
- [Qt] Generate convenience headers (QWebView, etc) using qmake
+2010-11-12 Robert Kroeger <rjkroege@chromium.org>
- In Qt this is done using syncqt, but we use a pro-file instead
- that generates makefile-rules for each of the extra headers.
+ Reviewed by James Robinson.
- These extra headers are installed alongside the normal headers.
+ [Chromium/DRT] Make EventSendingController send complete touch events.
+ https://bugs.webkit.org/show_bug.cgi?id=49285
- * Scripts/webkitdirs.pm: Run qmake and make on new API-DerivedSources
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::addTouchPoint):
+ (EventSender::updateTouchPoint):
+ (EventSender::sendCurrentTouchEvent):
-2010-02-05 Andras Becsi <abecsi@webkit.org>
+2010-11-12 Mihai Parparita <mihaip@chromium.org>
- Unreviewed typo fix.
+ Unreviewed rollout of r71858.
- Fix wrong whitespace alignment introduced in r54342.
+ Rollout out r71858 since it breaks new-run-webkit-httpd as used by the
+ NaCl tests.
- * Scripts/run-webkit-tests:
+ * Scripts/webkitpy/layout_tests/port/config.py:
+ * Scripts/webkitpy/layout_tests/port/config_standalone.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/config_unittest.py:
-2010-02-04 Mark Rowe <mrowe@apple.com>
+2010-11-12 Benjamin Poulain <benjamin.poulain@nokia.com>
- Reviewed by Timothy Hatcher.
+ Reviewed by Kenneth Rohde Christiansen.
- Build fix. Remove a symbol corresponding to an inline function from the linker export
- file to prevent a weak external failure.
+ [Qt] TestController::runUntil doesn't honor the timeout parameter
+ https://bugs.webkit.org/show_bug.cgi?id=48941
- * Scripts/check-for-weak-vtables-and-externals: Renamed from WebKitTools/Scripts/check-for-weak-vtables.
- Teach the script how to detect weak external symbols so that these errors can be caught immediately
- in the future.
+ Implement the missing timeout of WebKitTestRunner for Qt.
-2010-02-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ A QElapsedTimer has been added to RunUntilConditionLoop in order
+ to measure how long the loop has been running. When the timer
+ is bigger or equal than the timeout, the loop ends even if the
+ condition is not met.
- Rubberstamped by Oliver Hunt.
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ (WTR::RunUntilConditionLoop::start):
+ (WTR::RunUntilConditionLoop::run):
+ (WTR::RunUntilConditionLoop::timerEvent):
+ (WTR::TestController::platformRunUntil):
- [Qt] Make it possible to choose whether the launcher should
- use the traditional QWidget based QWebView or the newer
- QGraphics based QGraphicsWebView on a QGraphicsView.
+2010-11-11 David Levin <levin@chromium.org>
- * QtLauncher/main.cpp:
- (LauncherWindow::LauncherWindow):
- (LauncherWindow::eventFilter):
- (LauncherWindow::loadStarted):
- (LauncherWindow::print):
- (LauncherWindow::screenshot):
- (LauncherWindow::setEditable):
- (LauncherWindow::setupUI):
- (main):
- * QtLauncher/webview.cpp:
- (WebViewGraphicsBased::WebViewGraphicsBased):
- (WebViewGraphicsBased::resizeEvent):
- (GraphicsWebView::mousePressEvent):
- (GraphicsWebView::contextMenuEvent):
- * QtLauncher/webview.h:
- (WebViewTraditional::WebViewTraditional):
- (GraphicsWebView::GraphicsWebView):
- (WebViewGraphicsBased::setPage):
+ Reviewed by Shinichiro Hamaji.
-2010-02-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ check-webkit-style function detection doesn't handle templates with spaces.
+ https://bugs.webkit.org/show_bug.cgi?id=49427
- Rubberstamped by Oliver Hunt.
+ * Scripts/webkitpy/style/checkers/cpp.py: Stripped out templates when
+ finding the function name.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Made the test have a
+ template with a space.
- [Qt] QtLauncher cleanup.
+2010-11-11 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
- Refactor option handling out in utility functions and make the
- arguments more Qt compatible.
+ Reviewed by Shinichiro Hamaji.
- * QtLauncher/main.cpp:
- (requiresGraphicsView):
- (LauncherApplication::handleUserOptions):
- * QtLauncher/utils.cpp:
- (takeOptionValue):
- (formatKeys):
- (enumToKeys):
- (appQuit):
- * QtLauncher/utils.h:
+ Enable check-webkit-style on Qt files
+ https://bugs.webkit.org/show_bug.cgi?id=48322
-2010-02-04 Andras Becsi <abecsi@inf.u-szeged.hu>
+ Adding exception for _q_... private slots and
+ ..._data() methods in tests
- Reviewed by Tor Arne Vestbø.
+ * Scripts/webkitpy/style/checker.py: enable Qt dirs, add exceptions
+ * Scripts/webkitpy/style/checker_unittest.py: improve unittests
- Implement a locking and scheduling mechanism for http testing sessions to be able
- to run multiple instances of run-webkit-tests parallel on the same machine.
- If a test session wants to run http tests and this feature is enabled, the pending
- sessions create lockfiles with sequential lock numbers. These locks are used to schedule
- the running test sessions in first come first served order. An exclusive lock ensures
- that the lock numbers are sequential to avoid deadlocks and starvation.
- Because the buildbot master specifies the flags used by slaves we need an environment
- variable too to be able to use the feature per-slave.
- Exporting WEBKIT_WAIT_FOR_HTTPD=1 before testing or using the --wait-for-httpd
- flag enables this feature, otherwise this patch has no effect on the testing whatsoever.
+2010-11-11 David Levin <levin@chromium.org>
- https://bugs.webkit.org/show_bug.cgi?id=33153
+ Reviewed by Shinichiro Hamaji.
- * Scripts/run-webkit-tests:
- * Scripts/webkitperl/httpd.pm:
+ check-webkit-style function detection doesn't work for templates and destructors.
+ https://bugs.webkit.org/show_bug.cgi?id=49425
-2010-01-22 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ * Scripts/webkitpy/style/checkers/cpp.py: Changed regex for templates and destructors.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Made the test hit this issue.
- Reviewed by Simon Hausmann.
+2010-11-11 Joone Hur <joone@kldp.org>
- Make run-webkit-tests work under Cygwin for the Qt port
+ Reviewed by Antonio Gomes.
- setPathForRunningWebKitApp() is implemented for the Qt port
- by using qmake to query for the location of the Qt libraries.
+ [GTK][DRT] Implement LayoutTestController::nodesFromRect
+ https://bugs.webkit.org/show_bug.cgi?id=46598
- This requires the original environment (%ENV) to be untouched,
- so launchWithCurrentEnv() was refactored to launchWithEnv(),
- and the code in openDumpTool() to not use %ENV but a %CLEAN_ENV
- instead. This has the added benefit of getting rid of the temp
- variables used for storing the current env.
+ Support nodesFromRect in DRT
- openDumpTool() is also refactored a bit into platform-spesific,
- port-spesific, and generic environment variables.
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::nodesFromRect):
- Checks for undef was added a few places to fix Perl concat
- warnings when run-webkit-tests is aborted.
+2010-11-11 MORITA Hajime <morrita@google.com>
- https://bugs.webkit.org/show_bug.cgi?id=33895
+ Reviewed by Kent Tamura.
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
+ editing/selection/context-menu-on-text.html fails on chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45898
-2010-02-04 Yuzo Fujishima <yuzo@google.com>
+ Enhance Chromium's EventSender::contextClick() to return
+ array of menu strings. The implementation incomplete because
+ Although actual context menu is implemented by the browser,
+ it reflects editability of underlying context thus makes
+ context-menu-on-text.html passed.
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (makeMenuItemStringsFor): Added.
+ (EventSender::contextClick): Now returns array of menu strings.
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::showContextMenu): Now storing given WebContextMenuData object.
+ (WebViewHost::clearContextMenuData): Added.
+ (WebViewHost::lastContextMenuData): Added.
+ * DumpRenderTree/chromium/WebViewHost.h:
- Unreviewed.
+2010-11-11 Dirk Pranke <dpranke@chromium.org>
- Add Yuzo to the committers list.
+ Unreviewed, build fix.
- * Scripts/webkitpy/committers.py:
+ fix build breakage caused by fix for bug 49380 (r71858).
-2010-02-03 Dirk Pranke <dpranke@chromium.org>
+ config_standalone needs to ensure that the packages it needs are
+ in sys.path.
- Rubber-stamped by Eric Seidel.
+ https://bugs.webkit.org/show_bug.cgi?id=49419
- Change "the Chromium name" to "the name of Google Inc." in the licenses
+ * Scripts/webkitpy/layout_tests/port/config_standalone.py:
- https://bugs.webkit.org/show_bug.cgi?id=34511
+2010-11-11 Dirk Pranke <dpranke@chromium.org>
- * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
- * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
- * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
- * Scripts/webkitpy/layout_tests/port/__init__.py:
- * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
- * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
- * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
- * Scripts/webkitpy/layout_tests/port/chromium_win.py:
- * Scripts/webkitpy/layout_tests/port/http_server.py:
- * Scripts/webkitpy/layout_tests/port/http_server_base.py:
- * Scripts/webkitpy/layout_tests/port/path_utils.py:
- * Scripts/webkitpy/layout_tests/port/websocket_server.py:
- * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
- * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
- * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
- * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
- * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ Reviewed by Adam Roben.
-2010-02-03 Dirk Pranke <dpranke@chromium.org>
+ Fix NRWT to respect set-webkit-configuration again :(
- Rubber-stamped by Eric Siedel.
+ This change fixes a typo in config.py that was causing the wrong
+ value to be read initially and us never actually looking into
+ the filesystem to get the default configuration.
+
+ * Scripts/webkitpy/layout_tests/port/config.py:
+ * Scripts/webkitpy/layout_tests/port/config_standalone.py:
+ * Scripts/webkitpy/layout_tests/port/config_unittest.py:
- Rename files as part of refactoring the layout_tests package. All
- the platform_utils* module, the path_utils.py module, and
- the http server and web socket server modules are moved into a new
- port/ package.
+2010-11-11 Eric Seidel <eric@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=34511
+ Reviewed by Adam Barth.
- * Scripts/webkitpy/layout_tests/layout_package/apache_http_server.py: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/http_server.py: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/http_server_base.py: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/httpd2.pem: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
- * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
- * Scripts/webkitpy/layout_tests/layout_package/lighttpd.conf: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/path_utils.py: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils.py: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils_linux.py: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils_mac.py: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils_win.py: Removed.
- * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
- * Scripts/webkitpy/layout_tests/layout_package/websocket_server.py: Removed.
- * Scripts/webkitpy/layout_tests/port: Added.
- * Scripts/webkitpy/layout_tests/port/__init__.py: Copied from Scripts/webkitpy/layout_tests/layout_package/platform_utils.py.
- * Scripts/webkitpy/layout_tests/port/apache_http_server.py: Copied from Scripts/webkitpy/layout_tests/layout_package/apache_http_server.py.
- * Scripts/webkitpy/layout_tests/port/chromium_linux.py: Copied from Scripts/webkitpy/layout_tests/layout_package/platform_utils_linux.py.
- * Scripts/webkitpy/layout_tests/port/chromium_mac.py: Copied from Scripts/webkitpy/layout_tests/layout_package/platform_utils_mac.py.
- * Scripts/webkitpy/layout_tests/port/chromium_win.py: Copied from Scripts/webkitpy/layout_tests/layout_package/platform_utils_win.py.
- * Scripts/webkitpy/layout_tests/port/http_server.py: Copied from Scripts/webkitpy/layout_tests/layout_package/http_server.py.
- * Scripts/webkitpy/layout_tests/port/http_server_base.py: Copied from Scripts/webkitpy/layout_tests/layout_package/http_server_base.py.
- * Scripts/webkitpy/layout_tests/port/httpd2.pem: Copied from Scripts/webkitpy/layout_tests/layout_package/httpd2.pem.
- * Scripts/webkitpy/layout_tests/port/lighttpd.conf: Copied from Scripts/webkitpy/layout_tests/layout_package/lighttpd.conf.
- * Scripts/webkitpy/layout_tests/port/path_utils.py: Copied from Scripts/webkitpy/layout_tests/layout_package/path_utils.py.
- * Scripts/webkitpy/layout_tests/port/websocket_server.py: Copied from Scripts/webkitpy/layout_tests/layout_package/websocket_server.py.
- * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
- * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
- * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
- * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
- * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ Split out Bug, Attachment and CommitterValidator from bugzilla.py
+ https://bugs.webkit.org/show_bug.cgi?id=49403
+ CommitterValidator really had nothing to do with bugzilla.py.
+ I've put it next to committers.py for now since its rather tied to that file.
-2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+ * Scripts/webkitpy/common/config/committervalidator.py: Added.
+ * Scripts/webkitpy/common/config/committervalidator_unittest.py: Added.
+ * Scripts/webkitpy/common/net/bugzilla/__init__.py:
+ * Scripts/webkitpy/common/net/bugzilla/attachment.py: Added.
+ * Scripts/webkitpy/common/net/bugzilla/bug.py: Added.
+ * Scripts/webkitpy/common/net/bugzilla/bug_unittest.py: Added.
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py:
+ * Scripts/webkitpy/tool/bot/feeders.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
- Rubber-stamped by Eric Seidel.
+2010-11-11 Dirk Pranke <dpranke@chromium.org>
- Roll back r53559 and r54084 again, because roll out didn't solve flakeyness on the Windows Test bots
- https://bugs.webkit.org/show_bug.cgi?id=34399
+ Reviewed by Eric Seidel.
- * Scripts/run-iexploder-tests:
- * Scripts/run-webkit-httpd:
- * Scripts/run-webkit-tests:
- * Scripts/webkitperl/httpd.pm: Added.
+ fix missing 'pid' argument for http lockfile checking on win32
+ https://bugs.webkit.org/show_bug.cgi?id=49363
-2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+ * Scripts/webkitpy/common/system/executive.py:
- Rubber-stamped by Eric Seidel.
+2010-11-11 Eric Seidel <eric@webkit.org>
- Roll out r53559 and r54084, because it might caused flakeyness on the Windows Test bots
+ Rubber-stamped by Adam Barth.
- * Scripts/run-iexploder-tests:
- * Scripts/run-webkit-httpd:
- * Scripts/run-webkit-tests:
- * Scripts/webkitperl/httpd.pm: Removed.
+ Move bugzilla.py into its own module in preparation for splitting one-file-per-class
+ https://bugs.webkit.org/show_bug.cgi?id=49402
-2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+ * Scripts/webkitpy/common/net/bugzilla/__init__.py: Added.
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla.py: Renamed from WebKitTools/Scripts/webkitpy/common/net/bugzilla.py.
+ * Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py: Renamed from WebKitTools/Scripts/webkitpy/common/net/bugzilla_unittest.py.
- Rubber-stamped by Ariya Hidayat.
+2010-11-10 Chris Guillory <chris.guillory@google.com>
- Roll back r53889 again, because roll out didn't solve flakeyness on the Windows Test bots
- https://bugs.webkit.org/show_bug.cgi?id=34399
+ Reviewed by Chris Fleizach.
- * DumpRenderTree/win/EventSender.cpp:
- (buildModifierFlags):
- (mouseDownCallback):
- (mouseUpCallback):
- (keyDownCallback):
+ Use IAccessibleComparable to compare accessibility objects.
+ https://bugs.webkit.org/show_bug.cgi?id=49118
-2010-02-03 Eric Seidel <eric@webkit.org>
-
- No review, just fixing copyrights.
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (AccessibilityUIElement::isEqual):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (comparableObject):
+ (AccessibilityUIElement::isEqual):
- Concerns were expressed about "The Chromium Authors" being
- a valid legal entity for copyright assignment in the WebKit repository,
- so this change removes all "The Chromium Authors".
+2010-11-10 Csaba Osztrogonác <ossy@webkit.org>
- I looked at the svn logs in src.chromium.org and failed to find any
- non-google contributions to these files, so they are all now
- marked as copyright "Google Inc" as all Google contributers assign
- copyright to "Google Inc" as part of their employment agreement.
+ Reviewed by David Hyatt.
- * Scripts/rebaseline-chromium-webkit-tests:
- * Scripts/run-chromium-webkit-tests:
- * Scripts/webkitpy/layout_tests/layout_package/apache_http_server.py:
- * Scripts/webkitpy/layout_tests/layout_package/http_server.py:
- * Scripts/webkitpy/layout_tests/layout_package/http_server_base.py:
- * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
- * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
- * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
- * Scripts/webkitpy/layout_tests/layout_package/path_utils.py:
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils.py:
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils_linux.py:
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils_mac.py:
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils_win.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
- * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
- * Scripts/webkitpy/layout_tests/layout_package/websocket_server.py:
- * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
- * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
- * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
- * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
- * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ HTML5 Ruby support should be mandatory feature
+ https://bugs.webkit.org/show_bug.cgi?id=49272
-2010-02-03 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Remove Ruby as optional feature.
- Reviewed by Ariya Hidayat.
+ * Scripts/build-webkit:
- [Qt] QtLauncher, refactor argument handling in preparation of merge
- with QGVLauncher
+2010-11-10 Adam Roben <aroben@apple.com>
- * QtLauncher/main.cpp:
- (LauncherApplication::urls):
- (LauncherApplication::isRobotized):
- (LauncherApplication::applyDefaultSettings):
- (LauncherApplication::LauncherApplication):
- (LauncherApplication::formatKeys):
- (LauncherApplication::enumToKeys):
- (fail):
- (LauncherApplication::handleUserOptions):
- (main):
+ Print VC++ Express build logs in the same order that the projects are
+ built
-2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+ Fixes <http://webkit.org/b/49326> print-vse-failure-logs prints logs
+ in an unhelpful order
- Rubber-stamped by Ariya Hidayat.
+ Reviewed by Eric Seidel.
- Rolling out r53889, because it might caused flakeyness on the Windows Test bots
- https://bugs.webkit.org/show_bug.cgi?id=34399
+ * Scripts/print-vse-failure-logs:
+ (PrintVisualStudioExpressLogs._build_order): Added. Uses
+ print-msvc-project-dependencies to figure out the order in which
+ projects are built.
+ (PrintVisualStudioExpressLogs._sort_buildlogs): Added. Sorts the logs
+ based on their build order and project name.
+ (PrintVisualStudioExpressLogs._obj_directory): Moved code to find the
+ scripts directory from here...
+ (PrintVisualStudioExpressLogs._scripts_directory): ...to here.
+ (PrintVisualStudioExpressLogs.main): Sort the logs before printing
+ them.
- * DumpRenderTree/win/EventSender.cpp:
- (mouseDownCallback):
- (mouseUpCallback):
- (keyDownCallback):
+2010-11-10 Adam Roben <aroben@apple.com>
-2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+ Only print the interesting text from VC++ Express build logs
- Reviewed by Ariya Hidayat.
+ Fixes <http://webkit.org/b/49325> It's hard to find the interesting
+ output from print-vse-failure-logs
- [Qt] Fix pixel tests support.
- https://bugs.webkit.org/show_bug.cgi?id=27813
+ Reviewed by Eric Seidel.
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::open):
- (WebCore::DumpRenderTree::processLine):
- - Hash processing mechanism moved from DumpRenderTree::open to DumpRenderTree::processLine.
- (WebCore::DumpRenderTree::dump): Fixed and renamed variables.
+ * Scripts/print-vse-failure-logs: Removed unnecessary os.path import,
+ added newly-required imports. Removed a comment that was essentially a
+ FIXME, and is now fixed.
+ (PrintVisualStudioExpressLogs._relevant_text): Added. Uses
+ BeautifulSoup to extract the relevant text from the build log.
+ (PrintVisualStudioExpressLogs.main): Only print the relevant text.
-2010-02-03 Kevin Watters <kevinwatters@gmail.com>
+2010-11-09 Mihai Parparita <mihaip@chromium.org>
- Reviewed by Kevin Ollivier.
+ Reviewed by Tony Chang.
- [wx] Enable JIT compilation for wx.
+ [Chromium] http/tests/security/XFrameOptions fail with Chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=49286
- https://bugs.webkit.org/show_bug.cgi?id=34536
+ The tests in http/tests/security/XFrameOptions started to fail after
+ r71297, since it changed the WebViewHost::assignIdentifierToRequest
+ logic to always assign identifiers to requests, even if we're not going
+ to be dumping resource load callbacks at that point. These tests
+ only call LayoutTestController.dumpResourceLoadCallbacks after the
+ request is started, thus their expectations have "<unknown>" as the
+ identifier. Change WebViewHost to the previous behavior, which also
+ match the other ports'.
- * wx/build/settings.py:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::assignIdentifierToRequest):
+ (WebViewHost::removeIdentifierForRequest):
-2010-02-02 Kevin Ollivier <kevino@theolliviers.com>
+2010-11-08 Tony Chang <tony@chromium.org>
- [wx] Build fix after introduction of pageNumberForElementById.
+ Reviewed by Adam Barth.
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::pageNumberForElementById):
+ run platform/chromium/plugins/return-npobject.html on all platforms
+ https://bugs.webkit.org/show_bug.cgi?id=49103
-2010-02-02 Shu Chang <Chang.Shu@nokia.com>
+ This tests that we can get an NPObject returned through a method on
+ an NPAPI Object.
- Unreviewed.
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (testCallbackReturn):
+ (pluginInvoke):
- Add myself to list of committers.
+2010-11-09 Sheriff Bot <webkit.review.bot@gmail.com>
- * Scripts/webkitpy/committers.py:
+ Unreviewed, rolling out r71672.
+ http://trac.webkit.org/changeset/71672
+ https://bugs.webkit.org/show_bug.cgi?id=49276
-2010-02-02 Chris Jerdonek <cjerdonek@webkit.org>
+ It doesn't work on Chromium Windows bot (Requested by Ossy on
+ #webkit).
- Reviewed by Shinichiro Hamaji.
+ * Scripts/webkitpy/common/system/file_lock.py: Removed.
+ * Scripts/webkitpy/common/system/file_lock_unittest.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/http_lock.py:
- Moved filter-related check-webkit-style code into a separate
- filter module.
+2010-11-09 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- https://bugs.webkit.org/show_bug.cgi?id=34408
+ Reviewed by Tony Chang.
- This is preparatory refactoring for Bug 33684, which will allow
- file and folder-specific filter rules.
+ [NRWT] Make http locking similar to perl implementation
+ https://bugs.webkit.org/show_bug.cgi?id=49187
- * Scripts/webkitpy/style/checker.py:
- - Removed CategoryFilter class (moved to filter.py).
+ * Scripts/webkitpy/common/system/file_lock.py: Added.
+ * Scripts/webkitpy/common/system/file_lock_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/port/http_lock.py:
- * Scripts/webkitpy/style/checker_unittest.py:
- - Removed CategoryFilter unit tests (moved to filter_unittest.py).
+2010-11-09 James Kozianski <koz@chromium.org>
- * Scripts/webkitpy/style/filter.py: Added.
- - Added CategoryFilter class (moved from checker.py).
+ Reviewed by Eric Seidel.
- * Scripts/webkitpy/style/filter_unittest.py: Added.
- - Added CategoryFilter unit tests (moved from checker_unittest.py).
+ Clean up imports for webkit-patch.
+ https://bugs.webkit.org/show_bug.cgi?id=49083
- * Scripts/webkitpy/style/unittests.py:
- - Added reference to filter_unittest.py.
+ Move some imports from commands into main.py where they are used.
+ Move command imports into the __init__ of the commands module.
-2010-02-01 Chris Jerdonek <cjerdonek@webkit.org>
+ * Scripts/webkitpy/tool/commands/__init__.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/main.py:
- Reviewed by Shinichiro Hamaji.
+2010-11-09 Yi Shen <yi.4.shen@nokia.com>
- Addressed FIXME in check-webkit-style so that the carriage-return
- check will work for patches.
+ Reviewed by Andreas Kling.
- https://bugs.webkit.org/show_bug.cgi?id=34260
+ [Qt][QtTestBrowser] Don't erase incorrect url in the Url Bar
+ https://bugs.webkit.org/show_bug.cgi?id=49047
- Also added support for limiting the number of errors reported
- per category, per file.
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::setAddressUrl):
- * Scripts/webkitpy/style/checker.py:
- - Added new "whitespace/carriage_return" category from common.py.
- - Added MAX_REPORTS_PER_CATEGORY dictionary.
- - Added max_reports_per_category attribute to ProcessorOptions class.
- - Refactored StyleChecker._process_file().
+2010-11-09 Andras Becsi <abecsi@webkit.org>
- * Scripts/webkitpy/style/checker_unittest.py:
- - Updated ProcessorOptionsTest tests.
- - Added test to check MAX_REPORTS_PER_CATEGORY.
+ Reviewed by Csaba Osztrogonác.
- * Scripts/webkitpy/style/error_handlers.py:
- - Added support for suppressing the display of errors after
- reaching a per-category maximum (from max_reports_per_category).
+ Improve old-run-webkit-tests --verbose to show DumpTool opening/closing
+ https://bugs.webkit.org/show_bug.cgi?id=49252
- * Scripts/webkitpy/style/error_handlers_unittest.py:
- - Added test for suppressing error display.
+ * Scripts/old-run-webkit-tests:
- * Scripts/webkitpy/style/processors/common.py: Added.
- - Moved carriage-return check to new file.
+2010-11-09 Csaba Osztrogonác <ossy@webkit.org>
- * Scripts/webkitpy/style/processors/common_unittest.py: Added.
- - Added unit tests for carriage-return check.
+ Reviewed by Tor Arne Vestbø.
- * Scripts/webkitpy/style/unittests.py:
- - Added reference to common_unittest.py.
+ Output of old-run-webkit-tests is buggy in verbose mode
+ https://bugs.webkit.org/show_bug.cgi?id=49249
-2010-02-01 Shinichiro Hamaji <hamaji@chromium.org>
+ * Scripts/old-run-webkit-tests: Redundant outputs removed.
- Reviewed by Eric Seidel.
+2010-11-08 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
- Provide a way to get page number with layoutTestController
- https://bugs.webkit.org/show_bug.cgi?id=33840
+ Reviewed by Martin Robinson.
- * DumpRenderTree/LayoutTestController.cpp:
- (pageNumberForElementByIdCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::pageNumberForElementById):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::pageNumberForElementById):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::pageNumberForElementById):
+ [GTK] Link with target name set does not work
+ https://bugs.webkit.org/show_bug.cgi?id=48865
-2010-02-01 Shinichiro Hamaji <hamaji@chromium.org>
+ When a new page is created with a name (target=myFrame), the new
+ mainFrame could not be found because they where not stored in the
+ same PageGroup. As PageGroup are not exposed externally so the
+ simpliest solution is to use a global page group name. This also fixes
+ issue with visited link coloration across pages. After this change the
+ private function webkit_web_view_set_group_name() was no longer used
+ so it was removed completly.
- Unreviewed fix for an invalid function call.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (createWebView):
- check-webkit-style: Remove filename parameter from all functions where no longer used
- https://bugs.webkit.org/show_bug.cgi?id=34249
+2010-11-08 John Knottenbelt <jknotten@chromium.org>
- * Scripts/webkitpy/style/checker.py:
+ Reviewed by Kent Tamura.
-2010-02-01 Diego Gonzalez <diego.gonzalez@openbossa.org>
+ WebViewHost::reset() uses placement new.
+ https://bugs.webkit.org/show_bug.cgi?id=49069
- Reviewed by Kenneth Rohde Christiansen.
+ WebViewHost is using placement destruction / new to simulate a fresh
+ WebViewHost object at the same address. This is because the WebView remains
+ open across tests and maintains a pointer to the WebViewHost.
+ This change resets member variables explictly instead of the placement new dance.
- [Qt] DRT Provide global flag ability
- https://bugs.webkit.org/show_bug.cgi?id=34418
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::WebViewHost):
+ (WebViewHost::reset):
- Add the globalFlag property to the Qt LayoutTestController to allow
- cross-domain indications.
+2010-11-08 Dirk Pranke <dpranke@chromium.org>
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::reset):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
- (LayoutTestController::globalFlag):
- (LayoutTestController::setGlobalFlag):
+ Reviewed by Eric Seidel.
-2010-02-01 Brady Eidson <beidson@apple.com>
+ Fix the webkit_base_dir logic in webkitpy/layout_tests/port/config.py.
+ It turns out that NRWT can't use the code in scm.find_checkout_root()
+ because the Chromium bots don't do full checkouts of the WebKit
+ tree; they only check out subdirectories like WebKitTools/Scripts.
+ Until we can figure out a better approach for this, I've
+ restored the base_dir-detecting code from NRWT, which works in
+ any directory tree, scm or no.
- Reviewed by Adele Peterson.
+ This also restores the files modified in r71475 and r71474.
- Crash in Safari opening new tabs to "same page"
- <rdar://problem/7593857> and https://bugs.webkit.org/show_bug.cgi?id=34444
+ https://bugs.webkit.org/show_bug.cgi?id=49151
- Add a mode (Mac-only for now) that exercises the WebView SPI _loadBackForwardListFromOtherView:
+ * WebKitTools/Scripts/webkitpy/layout_tests/port/config.py
+ * WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::LayoutTestController):
- (setNewWindowsCopyBackForwardListCallback):
- (LayoutTestController::staticFunctions):
+2010-11-08 Eric Seidel <eric@webkit.org>
- * DumpRenderTree/LayoutTestController.h:
- (LayoutTestController::newWindowsCopyBackForwardList):
- (LayoutTestController::setNewWindowsCopyBackForwardList):
+ Reviewed by Adam Barth.
- * DumpRenderTree/mac/UIDelegate.mm:
- (-[UIDelegate webView:createWebViewWithRequest:]):
+ webkit-patch failure-reason explodes if a build is missing
+ https://bugs.webkit.org/show_bug.cgi?id=49195
-2010-02-01 Carol Szabo <carol.szabo@nokia.com>
+ This is likely a recent regression. Adding a unit test for this case.
- Unreviewed.
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
- Add myself to list of committers.
+2010-11-08 Dan Bernstein <mitz@apple.com>
- * Scripts/webkitpy/committers.py:
+ Reviewed by Darin Adler.
-2010-02-01 Nate Chapin <japhet@chromium.org>
+ Ignore the system scrollbar setting.
- Rubber-stamped by David Levin.
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues): Set the scrollbar default.
+
+2010-11-05 Adam Roben <aroben@apple.com>
+
+ Make webkitpy.common.system.executive_unittest pass when running under
+ Win32 Python
+
+ Fixes <http://webkit.org/b/49033>.
+
+ Reviewed by Dave Levin and Eric Seidel.
+
+ * Scripts/webkitpy/common/system/executive.py:
+ (Executive._run_command_with_teed_output): Pass the arguments through
+ encode_argument_if_needed rather than using Cygwin-specific code here.
+ (Executive.run_and_throw_if_fail): Use child_process_encoding to decode
+ the output.
+ (Executive.run_command): Use encode_argument_if_needed to encode the
+ arguments and child_process_encoding to decode the output.
+ (Executive._child_process_encoding): Returns the encoding that should be
+ used when communicating with child processes. On Windows we use mbcs,
+ which maps to the current code page. On all other platforms we use
+ UTF-8.
+ (Executive._should_encode_child_process_arguments): Returns True if
+ arguments to child processes need to be encoded. This is currently
+ only needed on Cygwin and Win32 Python 2.x.
+ (Executive._encode_argument_if_needed): Encode the argument using
+ child_process_encoding if we need to encode arguments to child
+ processes on this platform.
+
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ (never_ending_command): Added. Returns arguments to run a command that
+ will not quit until we kill it. On Windows we use wmic, on other
+ platforms we use yes.
+ (ExecutiveTest.test_run_command_with_unicode): Changed to expect the
+ mbcs encoding to be used and for output from the child processes to
+ have been roundtripped through encode/decode on Win32 Python. When
+ UTF-8 is the encoding the roundtripping is undetectable, but with mbcs
+ it's possible that some characters will not be able to be converted
+ and will be replaced by question marks; the round-tripping allows us
+ to expect this result.
+
+ (ExecutiveTest.test_kill_process):
+ (ExecutiveTest.test_kill_all):
+ Use never_ending_command instead of invoking "yes" directly. Expect an
+ exit code of 1 when using Win32 Python, as that's what seems to happen.
+
+2010-11-08 Adam Roben <aroben@apple.com>
+
+ Roll out r71532
+
+ It broke the build for Cygwin 1.7 installs. Cygwin 1.7's default
+ .bashrc unsets %TEMP%, which broke copy-tools.cmd.
- Add myself to reviewer list.
+ * Scripts/webkitdirs.pm:
- * Scripts/webkitpy/committers.py:
+2010-11-08 Tony Chang <tony@chromium.org>
-2010-01-31 Chris Jerdonek <cjerdonek@webkit.org>
+ Reviewed by Adam Barth.
- Reviewed by Shinichiro Hamaji.
+ run platform/chromium/plugins/nested-plugin-objects.html on all platforms
+ https://bugs.webkit.org/show_bug.cgi?id=49094
- Moved style error handler code to their own classes, and
- related refactoring. Increased unit test code coverage of
- style error handling.
+ This tests that objects created by plugins are proplery cleaned up.
- https://bugs.webkit.org/show_bug.cgi?id=34379
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (testPassTestObject):
+ (pluginInvoke):
+ * DumpRenderTree/TestNetscapePlugIn/TestObject.cpp:
+ (testAllocate):
+ (testDeallocate):
+ (testGetProperty):
+ (testConstruct):
- * Scripts/check-webkit-style:
- - Minor change: added error_count variable.
+2010-11-08 Adam Roben <aroben@apple.com>
- * Scripts/webkitpy/style/checker.py:
- - Renamed ProcessorOptions.should_report_error() to is_reportable().
- - In the StyleChecker class--
- - Removed _default_style_error_handler().
- - Added _increment_error_count().
- - Refactored to use DefaultStyleErrorHandler and
- PatchStyleErrorHandler constructors.
+ Mark Windows builds triggered from Perl as being non-interactive
- * Scripts/webkitpy/style/checker_unittest.py:
- - In the StyleStyleCheckerTest class--
- - Removed write_sample_error().
- - Removed test_default_style_error_handler().
+ This affects whether some of our scripts will show alerts vs. printing
+ to the build log.
- * Scripts/webkitpy/style/error_handlers.py: Added.
- - Added DefaultStyleErrorHandler class.
- - Added PatchStyleErrorHandler class.
+ Fixes <http://webkit.org/b/49181> Windows build fail mysteriously when
+ .vsprops files are updated
- * Scripts/webkitpy/style/error_handlers_unittest.py: Added.
- - Added unit tests for DefaultStyleErrorHandler and
- PatchStyleErrorHandler.
+ Reviewed by Steve Falkenburg.
- * Scripts/webkitpy/style/unittests.py:
- - Added error_handlers unit tests.
+ * Scripts/webkitdirs.pm:
+ (buildVisualStudioProject): Set WEBKIT_NONINTERACTIVE_BUILD to 1.
-2010-01-29 Mark Rowe <mrowe@apple.com>
+2010-11-08 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- Rubber-stamped by Stephanie Lewis.
+ Reviewed by Ojan Vafai.
- Fix run-leaks with newer versions of the leaks tool.
+ Make http locking default in NRWT.
+ https://bugs.webkit.org/show_bug.cgi?id=48053
- * Scripts/run-leaks:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
-2010-01-29 Dirk Pranke <dpranke@chromium.org>
+2010-11-08 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- Reviewed by Eric Siedel.
+ Reviewed by Csaba Osztrogonác.
- Top-level test drivers for running the Chromium port of run-webkit-tests
- and being able to rebaseline test results from the test bots. The
- files in the Scripts directory are simply wrappers around the files
- in webkitpy/layout_tests for convenience.
-
- https://bugs.webkit.org/show_bug.cgi?id=31498
+ [NRWT] If the http lock fails we shouldn't do any locking
+ https://bugs.webkit.org/show_bug.cgi?id=49164
- * Scripts/rebaseline-chromium-webkit-tests: Added.
- * Scripts/run-chromium-webkit-tests: Added.
- * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py: Added.
- * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py: Added.
+ If something goes wrong with the locking, the test should keep going.
-2010-01-29 Dirk Pranke <dpranke@chromium.org>
+ * Scripts/webkitpy/layout_tests/port/http_lock.py:
- Reviewed by Eric Siedel.
+2010-11-08 Adam Roben <aroben@apple.com>
- Add in the second block of python code for the Chromium port
- of run-webkit-tests. These files execute different diffs to classify
- the various types of failures from a test.
+ Switch back to using kCGImageAlphaPremultipliedFirst when generating
+ pixel dumps on Windows
- * Scripts/webkitpy/layout_tests/test_types: Added.
- * Scripts/webkitpy/layout_tests/test_types/__init__.py: Added.
- * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py: Added.
- * Scripts/webkitpy/layout_tests/test_types/image_diff.py: Added.
- * Scripts/webkitpy/layout_tests/test_types/test_type_base.py: Added.
- * Scripts/webkitpy/layout_tests/test_types/text_diff.py: Added.
+ I changed this behavior in r71418 thinking that it was required for
+ getting plugins to show up in pixel dumps. But it doesn't seem to be
+ necessary, and was making it impossible to compare new Windows pixel
+ dumps with existing Windows or Mac pixel dumps (because ImageDiff won't
+ compare an image with alpha to an image without alpha).
-2010-01-29 Dirk Pranke <dpranke@chromium.org>
+ Fixes <http://webkit.org/b/49172> REGRESION (r71418): Can't compare
+ new Windows pixel results to existing Windows or Mac results
- Reviewed by Eric Siedel.
+ Reviewed by Antti Koivisto.
- Check in the first part of the Chromium Python port of the
- run-webkit-tests test driver. The files under
- layout_tests/layout_layout constitute most of the implementation;
- they can be roughly divided into code that parses the
- "test_expectations.txt" file that describes how we expect tests to
- pass or fail, platform-specific hooks for the different Chromium
- ports (in platform_utils*), code for parsing the output of the
- tests and generating results files and HTML and JSON for the
- dashboards, auxiliary scripts for starting and stopping HTTP and
- Web Socket servers, and then one of the actual driver files
- (test_shell_thread). Code for actually parsing test output for
- failures and the top-level driver scripts will follow shortly.
-
- https://bugs.webkit.org/show_bug.cgi?id=31498
-
- * Scripts/webkitpy/layout_tests: Added.
- * Scripts/webkitpy/layout_tests/layout_package: Added.
- * Scripts/webkitpy/layout_tests/layout_package/__init__.py: Added.
- * Scripts/webkitpy/layout_tests/layout_package/apache_http_server.py: Added.
- * Scripts/webkitpy/layout_tests/layout_package/http_server.py: Added.
- * Scripts/webkitpy/layout_tests/layout_package/http_server_base.py: Added.
- * Scripts/webkitpy/layout_tests/layout_package/httpd2.pem: Added.
- - scripts to start and stop apache. Note that the apache file
- generates a conf file dynamically, and we should switch to
- using the same static conf file that the regular run-webkit-tests
- uses, and we can also use the same httpd2.pem file.
-
- * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py: Added.
- * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py: Added.
- - scripts to generate the JSON layout test dashboard and the
- flakiness dashboard
- * Scripts/webkitpy/layout_tests/layout_package/lighttpd.conf: Added.
- - default configuration for LigHTTPd (used on Windows)
- * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py: Added.
- - utility class that implements progress bars on the console to
- be displayed while the tests are running
- * Scripts/webkitpy/layout_tests/layout_package/path_utils.py: Added.
- - various routines for manipulating paths and URIs
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils.py: Added.
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils_linux.py: Added.
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils_mac.py: Added.
- * Scripts/webkitpy/layout_tests/layout_package/platform_utils_win.py: Added.
- - platform-specific aspects of the drivers (binary names, paths,
- process control, etc.)
- * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py: Added.
- - code for parsing the 'test_expectations.txt' file to determine
- which tests are expected to fail (and how) on which platforms
- * Scripts/webkitpy/layout_tests/layout_package/test_failures.py: Added.
- - code for handling different kinds of failures (generating output
- in the results, etc.)
- * Scripts/webkitpy/layout_tests/layout_package/test_files.py: Added.
- - code to gather the lists of tests
- * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py: Added.
- - code to actually execute tests via TestShell and process
- the output
- * Scripts/webkitpy/layout_tests/layout_package/websocket_server.py: Added.
- - scripts to start and stop the pywebsocket server
-
-2010-01-29 Dirk Pranke <dpranke@chromium.org>
+ * DumpRenderTree/win/PixelDumpSupportWin.cpp:
+ (createBitmapContextFromWebView): Replaced kCGImageAlphaNoneSkipFirst
+ with kCGImageAlphaPremultipliedFirst.
- Reviewed by Eric Seidel.
+2010-11-08 Csaba Osztrogonac <ossy@webkit.org>
- Check in a copy of the simplejson library; it will be used by
- the Chromium port of run-webkit-tests.
-
- https://bugs.webkit.org/show_bug.cgi?id=31498
-
- * simplejson: Added.
- * simplejson/LICENSE.txt: Added.
- * simplejson/README.txt: Added.
- * simplejson/__init__.py: Added.
- * simplejson/_speedups.c: Added.
- (ascii_escape_char):
- (ascii_escape_unicode):
- (ascii_escape_str):
- (py_encode_basestring_ascii):
- (init_speedups):
- * simplejson/decoder.py: Added.
- * simplejson/encoder.py: Added.
- * simplejson/jsonfilter.py: Added.
- * simplejson/scanner.py: Added.
-
-2010-01-29 Dirk Pranke <dpranke@chromium.org>
+ Unreviewed, rolling out r71466.
+ http://trac.webkit.org/changeset/71466
+ https://bugs.webkit.org/show_bug.cgi?id=48865
- No review
+ It broke layout tests on GTK bots.
- Add myself to the committers list
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (createWebView):
- * Scripts/webkitpy/committers.py:
+2010-11-08 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
-2010-01-29 Jeremy Orlow <jorlow@chromium.org>
+ Reviewed by Csaba Osztrogonác.
- Reviewed by Dimitri Glazkov.
+ Enable running of Qt API tests on BuildBot
+ https://bugs.webkit.org/show_bug.cgi?id=49004
- A first step towards the Indexed Database API
- https://bugs.webkit.org/show_bug.cgi?id=34342
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
- Add indexed database API.
+2010-11-08 Eric Seidel <eric@webkit.org>
- * Scripts/build-webkit:
+ Reviewed by Adam Barth.
-2010-01-29 Andras Becsi <abecsi@webkit.org>
+ Add clean-review-queue command to remove closed bugs from the webkit.org/pending-review
+ https://bugs.webkit.org/show_bug.cgi?id=49160
- Reviewed by Alexey Proskuryakov.
+ Bugzilla doesn't automatically remove r? when a bug gets closed.
+ This script takes care of that for webkit.org.
- Correct openHTTPD() to print requests to stdout if run-webkit-httpd is used.
- This fixes a regression introduced in r53559.
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
- https://bugs.webkit.org/show_bug.cgi?id=34336
+2010-11-07 Fumitoshi Ukai <ukai@chromium.org>
- * Scripts/webkitperl/httpd.pm:
+ Unreviewed, rolling out r71474.
+ http://trac.webkit.org/changeset/71474
+ https://bugs.webkit.org/show_bug.cgi?id=48280
-2010-01-28 Jon Honeycutt <jhoneycutt@apple.com>
+ breaks chromium webkit tests
+ https://bugs.webkit.org/show_bug.cgi?id=49151
- MSAA: Crash when posting a notification for a detached object
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/config.py:
+ * Scripts/webkitpy/layout_tests/port/config_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-11-07 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed, rolling out r71475.
+ http://trac.webkit.org/changeset/71475
+
+ breaks chromium webkit tests
+ https://bugs.webkit.org/show_bug.cgi?id=49151
- https://bugs.webkit.org/show_bug.cgi?id=34309
- <rdar://problem/7409759>
+ * Scripts/webkitpy/common/newstringio.py: Removed.
+ * Scripts/webkitpy/common/newstringio_unittest.py: Removed.
+ * Scripts/webkitpy/common/system/executive_mock.py: Removed.
+ * Scripts/webkitpy/common/system/filesystem_mock.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/config_mock.py: Removed.
- Reviewed by Darin Adler.
+2010-11-06 Dirk Pranke <dpranke@chromium.org>
- * DumpRenderTree/AccessibilityController.h:
- Declare new functions. Add new members to store the event hook and the
- mapping of accessibility elements to their JS callbacks.
+ Unreviewed, build fix.
- * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
- (AccessibilityController::notificationReceived):
- Stubbed.
- (AccessibilityController::addNotificationListener):
- Stubbed.
+ Add files inexplicably not committed in r71474 as part of the
+ fix for bug 48280.
- * DumpRenderTree/mac/AccessibilityControllerMac.mm:
- (AccessibilityController::notificationReceived):
- Stubbed.
- (AccessibilityController::addNotificationListener):
- Stubbed.
+ * Scripts/webkitpy/common/newstringio.py: Added.
+ * Scripts/webkitpy/common/newstringio_unittest.py: Added.
+ * Scripts/webkitpy/common/system/executive_mock.py: Added.
+ * Scripts/webkitpy/common/system/filesystem_mock.py: Added.
+ * Scripts/webkitpy/layout_tests/port/config_mock.py: Added.
- * DumpRenderTree/win/AccessibilityControllerWin.cpp:
- (AccessibilityController::AccessibilityController):
- Initialize the event hook.
- (AccessibilityController::~AccessibilityController):
- Remove the event hook. Unprotect all of the JS functions that are stored
- in the map.
- (logEventProc):
- Clean-up a variable.
- (stringEvent):
- Return a string description of the MSAA event code.
- (notificationListenerProc):
- Get the accessible object from the event, and query it for IAccessible.
- Call the AccessibilityController's notificationReceived().
- (comparableObject):
- Use QueryService to obtain the IAccessibleComparable for the
- IServiceProvider.
- (AccessibilityController::notificationReceived):
- Iterate the map of objects that have registered for notification
- callbacks. Query each for IServiceProvider, then use comparableObject()
- to get an IAccessibleComparable. If we find an object matching the
- notified object, call its callback, passing the event that was received.
- (AccessibilityController::addNotificationListener):
- If we have not created the event hook, create it. Protect the JS
- callback function object, and add the object and its callback to our
- map.
+2010-11-06 Dirk Pranke <dpranke@chromium.org>
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::addNotificationListener):
- Call through to the AccessibilityController's addNotificationListener().
+ Reviewed by Eric Siedel.
- * DumpRenderTree/win/DumpRenderTreeWin.h:
- Add an extern declaration for the shared FrameLoadDelegate extern, so we
- can access it from AccessibilityController.
+ new-run-webkit-tests: update port/base and port/webkit to use the
+ new FileSystem and Config abstractions, pulling more logic out of
+ the base Port classes into separate, mockable objects.
- * DumpRenderTree/win/FrameLoadDelegate.h:
- (FrameLoadDelegate::accessibilityController):
- Return the AccessibilityController.
+ Also create a MockFileSystem object, a MockConfig object, move
+ MockExecutive into common/system to be next to executive, and
+ update the config object to use a FileSystem.
-2010-01-29 Shinichiro Hamaji <hamaji@chromium.org>
+ https://bugs.webkit.org/show_bug.cgi?id=48280
- Reviewed by Darin Adler.
+ * Scripts/webkitpy/common/newstringio.py: Added.
+ * Scripts/webkitpy/common/newstringio_unittest.py: Added.
+ * Scripts/webkitpy/common/system/executive_mock.py: Added.
+ * Scripts/webkitpy/common/system/filesystem_mock.py: Added.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/config.py:
+ * Scripts/webkitpy/layout_tests/port/config_mock.py:
+ * Scripts/webkitpy/layout_tests/port/config_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- prepare-ChangeLog outputs useless messages for a nonexistent bug ID
- https://bugs.webkit.org/show_bug.cgi?id=34313
+2010-11-06 Dirk Pranke <dpranke@chromium.org>
- * Scripts/prepare-ChangeLog:
+ Unreviewed, build breakage.
-2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Apparently I uploaded the wrong version of the file to fix 49122
+ and neither Eric or I noticed - it was missing a dirname() call.
+ Fixing ...
- Rubberstamped by Simon Hausmann.
+ https://bugs.webkit.org/show_bug.cgi?id=49122
- [Qt] Separate implementation from class definition.
+ * Scripts/webkitpy/common/checkout/scm.py:
- * QtLauncher/main.cpp:
- (LauncherWindow::webView):
- (LauncherWindow::LauncherWindow):
- (LauncherWindow::~LauncherWindow):
- (LauncherWindow::keyPressEvent):
- (LauncherWindow::grabZoomKeys):
- (LauncherWindow::sendTouchEvent):
- (LauncherWindow::eventFilter):
- (LauncherWindow::loadStarted):
- (LauncherWindow::loadFinished):
- (LauncherWindow::showLinkHover):
- (LauncherWindow::zoomIn):
- (LauncherWindow::zoomOut):
- (LauncherWindow::resetZoom):
- (LauncherWindow::toggleZoomTextOnly):
- (LauncherWindow::print):
- (LauncherWindow::screenshot):
- (LauncherWindow::setEditable):
- (LauncherWindow::dumpHtml):
- (LauncherWindow::selectElements):
- (LauncherWindow::setTouchMocking):
- (LauncherWindow::newWindow):
- (LauncherWindow::setupUI):
+2010-11-06 Dirk Pranke <dpranke@chromium.org>
-2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Reviewed by Eric Seidel.
- Reviewed by Ariya Hidayat.
+ webkitpy/tool/* unittests change cwd and don't clean up properly
- [Qt] On Maemo5, a click/touch in the location bar (when unfocused)
- should result in all text selected.
+ https://bugs.webkit.org/show_bug.cgi?id=49122
- * QtLauncher/locationedit.cpp:
- (LocationEdit::focusInEvent):
- * QtLauncher/locationedit.h:
+ * Scripts/webkitpy/common/checkout/scm.py:
-2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-11-05 Chris Marrin <cmarrin@apple.com>
- Reviewed by Ariya Hidayat.
+ Reviewed by Simon Fraser.
- [Qt] Show progress reaching 100% for loads.
+ suspendAnimations/resumeAnimations not present in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=49109
- * QtLauncher/locationedit.cpp:
- (LocationEdit::LocationEdit):
- (LocationEdit::setProgress):
- (LocationEdit::reset):
- (LocationEdit::paintEvent):
- * QtLauncher/locationedit.h:
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::suspendAnimations):
+ (WTR::LayoutTestController::resumeAnimations):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
-2010-01-29 Andreas Kling <andreas.kling@nokia.com>
+2010-11-05 Tony Chang <tony@chromium.org>
- Reviewed by Kenneth Rohde Christiansen.
+ Reviewed by David Levin.
- [Qt] Disable the QtLauncher statusbar on Maemo
+ cleanup style in TestNetscapePlugIn/PluginObject.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=49044
- https://bugs.webkit.org/show_bug.cgi?id=34330
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (getPluginClass):
+ (pluginGetProperty):
+ (pluginSetProperty):
+ (variantToIdentifier):
+ (testCallback):
+ (getURL):
+ (getURLNotify):
+ (testInvokeDefault):
+ (testGetProperty):
+ (testDocumentOpen):
+ (testWindowOpen):
+ (pluginInvoke):
+ (handleCallback):
+ (notifyStream):
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
- * QtLauncher/main.cpp:
- (LauncherWindow::showLinkHover):
- (LauncherWindow::selectElements):
+2010-11-05 Eric Seidel <eric@webkit.org>
-2010-01-29 Andreas Kling <andreas.kling@nokia.com>
+ Reviewed by David Levin.
- Reviewed by Kenneth Rohde Christiansen.
+ Add QueueStatusServer/__init__.py so others can run the QueueStatusServer tests
+ https://bugs.webkit.org/show_bug.cgi?id=49032
- [Qt] Display page loading progress inside the QtLauncher location bar
+ I wrote this file as part of bug 47847, but I forgot to commit it.
+ No one else noticed it missing because test-webkitpy knows how
+ to recover in the case where it can't import QueueStatusServer
+ (which generally occurs due to not having installed the AppEngine SDK).
- https://bugs.webkit.org/show_bug.cgi?id=34210
+ * QueueStatusServer/__init__.py: Added.
+ * QueueStatusServer/model/workitems_unittest.py:
+ - Remove a test which fails. This was probably landed (by me)
+ from my other machine, which since this __init__.py was missing
+ I never noticed the failure and landed this invalid test.
+ Sadly we can't really test remove_work_item as it depends
+ on .key() working. .key() will throw unless the object
+ has already been saved it seems.
+ This may be a mis-design in our remove_work_item implementation,
+ but for now, just removing the test.
- * QtLauncher/QtLauncher.pro:
- * QtLauncher/locationedit.cpp: Added.
- (LocationEdit::LocationEdit):
- (LocationEdit::setProgress):
- (LocationEdit::paintEvent):
- * QtLauncher/locationedit.h: Added.
- * QtLauncher/mainwindow.cpp:
- (MainWindow::buildUI):
- * QtLauncher/mainwindow.h:
+2010-11-04 Adam Roben <aroben@apple.com>
-2010-01-29 Andreas Kling <andreas.kling@nokia.com>
+ Teach check-webkit-style about TestNetscapePlugIn
- Reviewed by Kenneth Rohde Christiansen.
+ Fixes <http://webkit.org/b/49030> check-webkit-style is ignorant of
+ TestNetscapePlugIn's coding conventions
- [Qt] Add support for Maemo zoom keys in QtLauncher
+ Reviewed by John Sullivan.
- https://bugs.webkit.org/show_bug.cgi?id=34160
+ * Scripts/webkitpy/style/checker.py: Lump TestNetscapePlugIn in with
+ WebKitAPITest and TestWebKitAPI in having different include order and
+ naming conventions than WebCore. Added some comments about why the
+ exceptions exist.
- * QtLauncher/main.cpp:
- (LauncherWindow::LauncherWindow):
- (LauncherWindow::~LauncherWindow):
- (LauncherWindow::keyPressEvent):
- (LauncherWindow::grabZoomKeys):
+2010-11-04 Adam Roben <aroben@apple.com>
-2010-01-29 Benjamin Poulain <benjamin.poulain@nokia.com>
+ Add a test that shows that windowed plugins are able to paint
- Reviewed by Kenneth Rohde Christiansen.
+ Somehow we never had a test for this before.
- [Qt] Implement the display() method of the layout test controller
- https://bugs.webkit.org/show_bug.cgi?id=34258
+ Fixes <http://webkit.org/b/49029> Should add a test that shows
+ windowed plugins can paint
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::showPage):
- (WebCore::DumpRenderTree::hidePage):
- * DumpRenderTree/qt/DumpRenderTreeQt.h:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::reset):
- (LayoutTestController::display):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ Reviewed by Jon Honeycutt.
-2010-01-28 Kevin Ollivier <kevino@theolliviers.com>
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp: Added.
+ (DrawsGradient::DrawsGradient):
+ (DrawsGradient::wndProc): We handle the WM_PAINT and WM_PRINTCLIENT messages.
- [wx] Build fix for MSW, use ThreadingWin.cpp as the Windows pthreads implementation
- implements pthread_t in a way that makes it impossible to check its validity,
- which is needed by ThreadingPthreads.cpp.
+ (DrawsGradient::onPaint):
+ (DrawsGradient::onPrintClient):
+ These both just call through to paint.
- * DumpRenderTree/wscript:
- * wx/build/settings.py:
+ (DrawsGradient::paint): Fills our client area with some gradients.
-2010-01-28 Andras Becsi <abecsi@webkit.org>
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: Link
+ against Msimg32.lib for ::GradientFill and added DrawsGradient.
- Adding myself to the committer list. No review needed.
+ * DumpRenderTree/win/PixelDumpSupportWin.cpp:
+ (createBitmapContextFromWebView): Use WM_PRINT instead of
+ WM_PRINTCLIENT so that ::DefWindowProc will send
+ WM_PRINT/WM_PRINTCLIENT messages to the WebView's child windows.
+ Replaced kCGImageAlphaPremultipledFirst with kCGImageAlphaNoneSkipFirst
+ because GDI doesn't support alpha and kCGImageBitmapOrder32Little with
+ kCGImageBitmapOrder32Host because, who knows, maybe someday Windows
+ will run on a big-endian platform.
- * Scripts/webkitpy/committers.py:
+2010-11-04 Adam Roben <aroben@apple.com>
-2010-01-28 Hayato Ito <hayato@chromium.org>
+ Extract much of NPNInvalidateRectInvalidatesWindow's code into a
+ WindowedPluginTest base class
- Reviewed by David Levin.
+ The base class takes care of subclassing the plugin's window so that a
+ custom WNDPROC is called. This will make it easier to write tests that
+ need to handle window messages.
- Remove NULL char from input JS file because 'grep' fails if the file contains NULL char.
+ Fixes <http://webkit.org/b/49028> It's hard to write a PluginTest with
+ a custom WNDPROC
- https://bugs.webkit.org/show_bug.cgi?id=34252
+ Reviewed by Jon Honeycutt.
- * Scripts/make-script-test-wrappers:
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp:
+ (NPNInvalidateRectInvalidatesWindow::NPNInvalidateRectInvalidatesWindow):
+ (NPNInvalidateRectInvalidatesWindow::NPP_SetWindow):
+ (NPNInvalidateRectInvalidatesWindow::wndProc):
+ (NPNInvalidateRectInvalidatesWindow::testInvalidateRect):
+ Moved code from here to WindowedPluginTest. Changed to use window()
+ instead of m_window.
-2010-01-28 Kevin Ollivier <kevino@theolliviers.com>
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ Added WindowedPluginTest and added TestNetscapePlugIn/win to the
+ include path. Also reordered the include path to make a little more
+ sense and simplified the entry that added TestNetscapePlugIn itself to
+ the include path.
- [wx] Build fix after removal of the zlib image decoder.
+ * DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.cpp: Added.
+ (WindowedPluginTest::WindowedPluginTest):
+ (WindowedPluginTest::NPP_SetWindow):
+ (WindowedPluginTest::staticWndProc):
+ * DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.h: Added.
+ (WindowedPluginTest::window):
+ Code came from NPNInvalidateRectInvalidatesWindow.
- * wx/build/settings.py:
+2010-11-04 Adam Roben <aroben@apple.com>
-2010-01-28 Csaba Osztrogonác <ossy@webkit.org>
+ Add a plugin test to show that windowed plugins are clipped correctly
- [Qt] Unreviewed, roll out r54000.
+ Fixes <http://webkit.org/b/49024> <rdar://problem/8487847> Windowed
+ plugins aren't clipped in WebKit2 on Windows
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- * DumpRenderTree/qt/DumpRenderTreeQt.h:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::reset):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
- (LayoutTestController::display):
+ Reviewed by Jon Honeycutt.
-2010-01-28 Benjamin Poulain <benjamin.poulain@nokia.com>
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowRegionIsSetToClipRect.cpp: Added.
+ (WindowRegionIsSetToClipRect::WindowRegionIsSetToClipRect): Initialize members.
+ (WindowRegionIsSetToClipRect::NPP_SetWindow): Check that our window
+ region matches the clip rect we know we should have based on
+ window-region-is-set-to-clip-rect.html, and check that our window class
+ doesn't have the CS_PARENTDC style.
- Reviewed by Kenneth Rohde Christiansen.
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ Added WindowRegionIsSetToClipRect.
- [Qt] Implement the display() method of the layout test controller
- https://bugs.webkit.org/show_bug.cgi?id=34258
+2010-11-05 Alejandro G. Castro <alex@igalia.com>
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::showPage):
- (WebCore::DumpRenderTree::hidePage):
- * DumpRenderTree/qt/DumpRenderTreeQt.h:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::reset):
- (LayoutTestController::display):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ Reviewed by Martin Robinson.
-2010-01-28 Chris Jerdonek <cjerdonek@webkit.org>
+ [GTK] Avoid font hinting in the DRT
+ https://bugs.webkit.org/show_bug.cgi?id=48548
- Reviewed by Shinichiro Hamaji.
+ Change the settings to avoid font hinting, it was causing
+ different results depending on the distribution.
- Eliminated the filename parameter from functions in
- check-webkit-style's cpp.py where it is no longer used.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeGtkFontSettings):
+ * DumpRenderTree/gtk/fonts/fonts.conf:
- https://bugs.webkit.org/show_bug.cgi?id=34249
+2010-11-05 Eric Seidel <eric@webkit.org>
- * Scripts/webkitpy/style/processors/cpp.py:
- - Reduced number of occurrences of "filename" variable from
- approximately 200 to 120.
+ Reviewed by Adam Barth.
- * Scripts/webkitpy/style/processors/cpp_unittest.py:
- - Refactored unit tests as necessary to accommodate changes to cpp.py.
- - Fixed bug in CppStyleTestBase.perform_include_what_you_use()
- where the incorrect file extension was getting passed to
- cpp_style.check_language().
+ build-webkit spams system.log by repeatedly checking for PBXProductDirectory in com.apple.Xcode
+ https://bugs.webkit.org/show_bug.cgi?id=49051
-2010-01-28 Chris Jerdonek <cjerdonek@webkit.org>
+ This is a speculative fix. The unit tests cover these methods, however
+ I don't know if this will fully stop the system.log spam.
- Reviewed by Shinichiro Hamaji.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
- In check-webkit-style, eliminated the dependency of
- processors/cpp_unittest.py on checker.py.
+2010-11-05 Eric Seidel <eric@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=34205
+ Reviewed by Adam Barth.
- * Scripts/webkitpy/style/checker.py:
- - Addressed FIXME by removing STYLE_CATEGORIES data.
- - Added style_categories().
+ Add basic support for showing bot id on /queue-status/ pages
+ https://bugs.webkit.org/show_bug.cgi?id=49037
- * Scripts/webkitpy/style/checker_unittest.py:
- - Minor changes.
+ This support is really simple. Eventually we'll want to
+ show the bot id in the lock table too, but we don't have
+ that information stored in the server yet.
- * Scripts/webkitpy/style/processors/cpp.py:
- - Added categories attribute to CppProcessor class (data
- was originally checker.STYLE_CATEGORIES).
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/handlers/queuestatus_unittest.py: Added.
+ * QueueStatusServer/templates/includes/singlequeuestatus.html:
- * Scripts/webkitpy/style/processors/cpp_unittest.py:
- - Addressed FIXME by eliminating "import" from checker.py.
+2010-11-04 Dirk Pranke <dpranke@chromium.org>
-2010-01-28 Anton Muhin <antonm@chromium.org>
+ Reviewed by Adam Barth.
- Reviewed by Shinichiro Hamaji.
+ Create a filesystem wrapper that we can use to enforce
+ particular conventions and use for mocking and dependency
+ injection down the line.
- Improve treatment of conditions and rest of the line for if, else, switch and alikes
- https://bugs.webkit.org/show_bug.cgi?id=34173
+ https://bugs.webkit.org/show_bug.cgi?id=48144
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ * Scripts/webkitpy/common/system/filesystem.py: Added.
+ * Scripts/webkitpy/common/system/filesystem_unittest.py: Added.
-2010-01-28 Joe Mason <jmason@rim.com>
+2010-11-04 Mihai Parparita <mihaip@chromium.org>
- Reviewed by Adam Barth.
+ Reviewed by Tony Chang.
- Limit login retries to 5
- https://bugs.webkit.org/show_bug.cgi?id=34193
+ run_webkit_tests_unittest fails under Python 2.5
+ https://bugs.webkit.org/show_bug.cgi?id=49043
+
+ Switch from itertools.chain.from_iterable (which was added in 2.6)
+ to using itertools.chain directly.
- * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
-2010-01-27 Martin Robinson <mrobinson@webkit.org>
+2010-11-04 Mihai Parparita <mihaip@chromium.org>
- Adding myself to the committer list. No review necessary.
+ Unreviewed fix to webkit-patch rebaseline-server so that it runs under
+ Python 2.5 (it needs an import to use the with statement).
- * Scripts/webkitpy/committers.py:
+ * Scripts/webkitpy/tool/commands/rebaselineserver.py:
-2010-01-27 George Wright <gwright@rim.com>
+2010-11-04 Dirk Pranke <dpranke@chromium.org>
- Reviewed by Adam Treat.
+ Reviewed by Adam Barth.
- https://bugs.webkit.org/show_bug.cgi?id=34216
+ new-run-webkit-tests: split out webkit-specific configuration stuff into a new module
- Add missing include for wtf/Platform.h
+ The current NRWT code has webkit-specific configuration code (like
+ _script_path, default configuration, etc.) mixed in with
+ layout-test-specific stuff in port/base. The configuration code
+ should be split out into a separate module for easier mocking,
+ testing, and isolation.
- * DumpRenderTree/AccessibilityController.h:
+ https://bugs.webkit.org/show_bug.cgi?id=48264
-2010-01-27 Diego Gonzalez <diego.gonzalez@openbossa.org>
+ * Scripts/webkitpy/layout_tests/port/config.py: Added.
+ * Scripts/webkitpy/layout_tests/port/config_unittest.py: Added.
- Reviewed by Kenneth Rohde Christiansen.
+2010-11-04 Mihai Parparita <mihaip@chromium.org>
- [Qt] DRT Provide worker thread ability to track counters
- https://bugs.webkit.org/show_bug.cgi?id=34221
+ Reviewed by Tony Chang.
- Implement workerThreadCount() in LayoutTestController of Qt DRT
+ Rebaseline server: initial framework
+ https://bugs.webkit.org/show_bug.cgi?id=48892
+
+ Adds the basic framework for the rebaseline server (details at
+ http://webkit.org/b/47761). Includes the rebaseline-server webkit-patch
+ command, which starts an HTTP server that can serve static files or
+ invoke handler methods on a class.
- Tests:
- fast/workers/dedicated-worker-lifecycle.html
- fast/workers/shared-worker-frame-lifecycle.html
- fast/workers/shared-worker-lifecycle.html
- fast/workers/worker-lifecycle.html
+ * Scripts/webkitpy/tool/commands/__init__.py:
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/index.html: Added.
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css: Added.
+ * Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js: Added.
+ * Scripts/webkitpy/tool/commands/rebaselineserver.py: Added.
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::workerThreadCount):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+2010-11-04 Dirk Pranke <dpranke@chromium.org>
-2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Reviewed by James Robinson.
- Rubberstamped by Simon Hausmann.
+ new-run-webkit-tests wasn't using DRT by default for
+ --platform chromium-gpu
- [Qt] QtLauncher refactoring:
+ The default value was set to False instead of None, which meant
+ that the platform specific logic wasn't firing to change the
+ value to True (b/c we were afraid we'd be overriding the user
+ preference).
- Make the LauncherWindow depend less on the view, so that more
- code can be shared in near future.
+ https://bugs.webkit.org/show_bug.cgi?id=49038
- * QtLauncher/main.cpp:
- (LauncherWindow::sendTouchEvent):
- (LauncherWindow::loadFinished):
- (LauncherWindow::zoomIn):
- (LauncherWindow::zoomOut):
- (LauncherWindow::resetZoom):
- (LauncherWindow::toggleZoomTextOnly):
- (LauncherWindow::dumpHtml):
- (LauncherWindow::selectElements):
- (LauncherWindow::setupUI):
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
-2010-01-27 Kinuko Yasuda <kinuko@chromium.org>
+2010-11-04 Tony Chang <tony@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Adam Barth.
- Correctly handle the KeyLocation argument that has been introduced
- recently to test location-dependent key events in EventSender.keyDown.
- http://bugs.webkit.org/show_bug.cgi?id=28247
+ make platform/chromium/plugins/multiple-plugins.html pass on all platforms
+ https://bugs.webkit.org/show_bug.cgi?id=49026
- Test: fast/events/keydown-numpad-keys.html
+ Have the testObject.bar property return the string "bar". This lets
+ us run and pass platform/chromium/plugins/multiple-plugins.html on all
+ platforms.
- * DumpRenderTree/gtk/EventSender.cpp:
- (keyDownCallback):
+ * DumpRenderTree/TestNetscapePlugIn/TestObject.cpp:
+ (testGetProperty):
-2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-11-04 Mihai Parparita <mihaip@chromium.org>
- Rubberstamped by Simon Hausmann.
+ Reviewed by Tony Chang.
- [Qt] QtLauncher refactoring:
+ NRWT doesn't have good test coverage for --run-chunk, --batch-size, --run-part, etc.
+ https://bugs.webkit.org/show_bug.cgi?id=48878
+
+ Add get_tests_run so that it's easy to see which tests get run (and with
+ what batching) for a given flag combination. Flesh out the various
+ test cases that have FIXMEs.
+
+ Also fixes an off-by-one error (batch sizes were one larger than
+ expected) and makes --run-part also have wraparound behavior, like
+ --run-chunk.
- Move out code from the MainWindow (renamed to LauncherWindow)
- that is not depending on the view, and add it to a new class
- called MainWindow.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- * QtLauncher/QtLauncher.pro:
- * QtLauncher/main.cpp:
- (LauncherWindow::LauncherWindow):
- (LauncherWindow::eventFilter):
- (LauncherWindow::loadStarted):
- (LauncherWindow::loadFinished):
- (LauncherWindow::newWindow):
- (LauncherWindow::setupUI):
- (WebPage::createWindow):
- (main):
- * QtLauncher/mainwindow.cpp: Added.
- (MainWindow::MainWindow):
- (MainWindow::buildUI):
- (MainWindow::page):
- (MainWindow::setAddressUrl):
- (MainWindow::addCompleterEntry):
- (MainWindow::load):
- (MainWindow::changeLocation):
- (MainWindow::openFile):
- * QtLauncher/mainwindow.h: Added.
+2010-11-04 Erik Arvidsson <arv@chromium.org>
-2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Reviewed by Dimitri Glazkov.
- Rubberstamped by Simon Hausmann.
+ Support box-sizing without the vendor prefix
+ https://bugs.webkit.org/show_bug.cgi?id=36713
- [Qt] QtLauncher, coding style fixes.
+ Based on patch by Peter Beverloo <peter@lvp-media.com>
- * QtLauncher/main.cpp:
- (MainWindow::MainWindow):
- (MainWindow::sendTouchEvent):
- (MainWindow::eventFilter):
- (MainWindow::loadURL):
- (MainWindow::setupUI):
- (WebPage::createPlugin):
+ * iExploder/htdocs/cssproperties.in: Change -webkit-box-sizing to box-sizing.
-2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-11-04 Csaba Osztrogonác <ossy@webkit.org>
- Rubberstamped by Simon Hausmann.
+ Unreviewed rollout r71340, because it broke Chromium Windows bot.
- [Qt] QtLauncher refactoring, separating the webview and
- adding a QGraphicsWebView based version.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * QtLauncher/QtLauncher.pro:
- * QtLauncher/main.cpp:
- (MainWindow::MainWindow):
- * QtLauncher/webpage.h:
- * QtLauncher/webview.cpp: Added.
- (createContextMenu):
- (WebViewGraphicsBased::mousePressEvent):
- (WebViewTraditional::mousePressEvent):
- (WebViewGraphicsBased::contextMenuEvent):
- (WebViewTraditional::contextMenuEvent):
- * QtLauncher/webview.h: Added.
- (WebViewGraphicsBased::WebViewGraphicsBased):
- (WebViewTraditional::WebViewTraditional):
+2010-11-04 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
-2010-01-27 Alexander Pavlov <apavlov@chromium.org>
+ Reviewed by Ojan Vafai.
- Adding myself as committer. No review necessary.
+ Make http locking default in NRWT.
+ https://bugs.webkit.org/show_bug.cgi?id=48053
- * Scripts/webkitpy/committers.py:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
-2010-01-27 Eric Seidel <eric@webkit.org>
+2010-11-04 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- Reviewed by Darin Adler.
+ Reviewed by Eric Seidel.
- webkit-patch needs an open-bugs command
- https://bugs.webkit.org/show_bug.cgi?id=30793
+ [NRWT] Clear invalid http locks on Windows platform as well
+ https://bugs.webkit.org/show_bug.cgi?id=48515
- * Scripts/test-webkitpy: import OpenBugsTest
- * Scripts/webkit-patch: import OpenBugs
- * Scripts/webkitpy/commands/download_unittest.py: don't import unittest
- * Scripts/webkitpy/commands/early_warning_system_unittest.py: ditto
- * Scripts/webkitpy/commands/queries_unittest.py: ditto
- * Scripts/webkitpy/commands/queues_unittest.py: ditto
- * Scripts/webkitpy/commands/upload_unittest.py: ditto
- * Scripts/webkitpy/mock_bugzillatool.py: log when user.open_url is called.
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/http_lock.py:
-2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-11-02 Adam Roben <aroben@apple.com>
- Rubberstamped by Simon Hausmann
+ Reduce our dependence on coreutils when running Python tests
- [Qt] QtLauncher refactoring, separating utility methods.
+ This patch introduces versions of the standard echo and cat utilities
+ implemented in Python. They are probably missing features of their
+ coreutils equivalents, but they can do what's necessary for our Python
+ tests. This is useful on Windows, where these utilities typically
+ aren't available.
- * QtLauncher/QtLauncher.pro:
- * QtLauncher/main.cpp:
- * QtLauncher/utils.cpp: Added.
- (urlFromUserInput):
- * QtLauncher/utils.h: Added.
+ Fixes <http://webkit.org/b/48883> executive_unittest relies on echo
+ and cat utilities from coreutils, which are not present on Windows
-2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Reviewed by Eric Seidel.
- Rubberstamped by Simon Hausmann
+ * Scripts/webkitpy/common/system/executive_unittest.py: Changed to use
+ our Python-based echo and cat.
+
+ * Scripts/webkitpy/common/system/fileutils.py: Added.
+ (make_stdout_binary): On Windows, puts sys.stdout into binary mode so
+ that \n won't be translated into \r\n. I couldn't think of a good way
+ to test this directly without touching the filesystem, but it is tested
+ indirectly by echo_unittest.
+
+ * Scripts/webkitpy/test/cat.py: Added.
+ (command_arguments): Returns a list for invoking cat with the given arguments.
+ (main): Acts like a simplified version of the coreutils cat utility.
+
+ * Scripts/webkitpy/test/cat_unittest.py: Added.
+ (CatTest.assert_cat): Runs cat with the given input and ensures the
+ output matches the input.
+ (CatTest.test_basic): Performs a simple test of cat.
+ (CatTest.test_no_newline): Tests what happens when the input string
+ doesn't have a trailing newline.
+ (CatTest.test_unicode): Tests passing a unicode string to cat.
+ (CatTest.test_as_command): Tests running cat as a separate command.
+
+ * Scripts/webkitpy/test/echo.py: Added.
+ (command_arguments): Returns a list for invoking echo with the given arguments.
+ (main): Acts like a simplified version of the coreutils echo utility.
+
+ * Scripts/webkitpy/test/echo_unittest.py: Added.
+ (EchoTest.test_basic): Performs a simple test of echo.
+ (EchoTest.test_no_newline): Tests passing -n to echo to suppress the
+ trailing newline.
+ (EchoTest.test_unicode): Tests passing unicode and non-unicode strings
+ to echo.
+ (EchoTest.test_argument_order): Tests what happens when -n is not the
+ first argument.
+ (EchoTest.test_empty_arguments): Tests what happens when you pass [] to
+ echo.main.
+ (EchoTest.test_no_arguments): Tests what happens when you call
+ echo.main with no arguments.
+ (EchoTest.test_as_command): Tests running echo as a separate command.
+
+2010-11-04 Renata Hodovan <reni@inf.u-szeged.hu>
+
+ Unreviewed: Add myself to the list of Committers.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-11-04 Andreas Kling <kling@webkit.org>
- [Qt] Refactor the code in the QtLauncher dealing with HTTP proxy.
+ Reviewed by Kenneth Rohde Christiansen.
- * QtLauncher/main.cpp:
- (MainWindow::MainWindow):
- * QtLauncher/webpage.cpp:
- (WebPage::WebPage):
- (WebPage::applyProxy):
- * QtLauncher/webpage.h:
+ [Qt] Hook into QWebPage::scrollRequested for resizes-to-contents mode
-2010-01-26 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+ In RTC mode the QGraphicsWebView item is the size of the contents,
+ scrolling works a bit differently (we need to react to scrollRequested.)
- Reviewed by Tor Arne Vestbø.
+ Normally QGraphicsView will replay the last mouse event when scrolling,
+ so to prevent WebKit from getting confused by this we temporarily make
+ the QGraphicsView non-interactive.
- [Qt] Corrects debug build of DumpRenderTree on Windows.
+ * QtTestBrowser/webview.cpp:
+ (WebViewGraphicsBased::setPage):
+ (WebViewGraphicsBased::scrollRequested):
+ * QtTestBrowser/webview.h:
- * DumpRenderTree/qt/DumpRenderTree.pro:
+2010-11-04 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
-2010-01-26 Daniel Bates <dbates@webkit.org>
+ Reviewed by Andreas Kling.
- Reviewed by Adam Barth.
+ Use OS(MAC_OS_X) rather than PLATFORM(MAC) in TestControllerQt
- https://bugs.webkit.org/show_bug.cgi?id=34070
+ PLATFORM(MAC) is not defined for the Qt port, as it refers to
+ the Mac-port, not the Mac OS X operating system.
- Moves the try/catch for OSError exceptions in Executive.run_command
- to Credentials.read_credentials() so that the unit test
- webkitpy.scm_unittest.SCMClassTests.test_error_handlers can
- assert that Executive.run_command throws an OSError exception.
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ (WTR::isExistingLibrary):
- * Scripts/webkitpy/credentials.py:
- * Scripts/webkitpy/executive.py: Moved try/catch for OSError to
- method Credentials.read_credentials().
- * Scripts/webkitpy/executive_unittest.py: Removed tests that no longer
- apply: test_run_command_with_bad_command_check_return_code and
- test_run_command_with_bad_command_check_calls_error_handler. Added new
- test to assert that run_command throws OSError exceptions.
+2010-11-04 Leonid Ebril <leonid.ebril@nokia.com>
-2010-01-26 Diego Gonzalez <diego.gonzalez@openbossa.org>
+ Reviewed by Andreas Kling.
- Reviewed by Kenneth Rohde Christiansen.
+ [Qt] Adding iphone user agent string the user agent list for QtTestBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=48869
- [Qt] DRT WebHistory support
- https://bugs.webkit.org/show_bug.cgi?id=34167
+ * QtTestBrowser/useragentlist.txt:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::reset):
- (LayoutTestController::webHistoryItemCount):
- (LayoutTestController::keepWebHistory):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+2010-11-03 Adam Roben <aroben@apple.com>
-2010-01-26 Kent Tamura <tkent@chromium.org>
+ Always use uppercase drive names in strings returned by abspath_to_uri
- Reviewed by Eric Seidel.
+ Some versions of cygpath use lowercase drive letters while others use
+ uppercase, which makes it hard to test the output of code that uses
+ cygpath.
- [Win] Add modifiers parameter support to Windows DumpRenderTree
- https://bugs.webkit.org/show_bug.cgi?id=34068
+ Fixes <http://webkit.org/b/48914> webkitpy.common.system.path_unittest
+ fails with Cygwin 1.5
- Add support for functional name modifiers; "addSelectionKey" and
- "rangeSelectionKey", and modifiers parameter to eventSender.mouseDown()
- and eventSender.mouseUp().
- This change is similar to r53498 for Mac.
-
- * DumpRenderTree/win/EventSender.cpp:
- (buildModifierFlags): New function to set MK_CONTROL or MK_SHIFT to WPARAM.
- (mouseDownCallback): Call buidlModifiersFlags().
- (mouseUpCallback): ditto.
- (keyDownCallback): Add support for "addSelectionkey" and "rangeSelectionKey".
+ Reviewed by Eric Seidel.
-2010-01-26 Chris Jerdonek <cjerdonek@webkit.org>
+ * Scripts/webkitpy/common/system/path.py:
+ (cygpath): Updated the docstring to indicate that only absolute paths
+ should be passed for now (though relative paths will work fine).
+ (_Cygpath.convert): Upper-case the first letter of the converted Windows path.
- Reviewed by Eric Seidel.
+2010-11-03 George Guo <George.Guo@Nokia.com>
- The Python autoinstall cache directory now only gets created
- in the directory containing autoinstall.py.
+ Reviewed by Andreas Kling.
- https://bugs.webkit.org/show_bug.cgi?id=33365
+ [Qt] QtTestBrowser : set mmp rule pageddata in Symbian
+ https://bugs.webkit.org/show_bug.cgi?id=48767
+
+ Paging is needd on Symbian devices to support benchmarks tests like
+ dromaeo.com and Celtic Kane that need a lot of memory to run
- * Scripts/webkitpy/autoinstall.py:
- - Also added a README file to the cache directory saying
- where it came from.
+ * QtTestBrowser/QtTestBrowser.pro:
-2010-01-26 Chris Jerdonek <cjerdonek@webkit.org>
+2010-11-03 Jenn Braithwaite <jennb@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Dmitry Titov.
- Moved the check-webkit-style processors into a new
- webkitpy/style/processors directory.
+ Chromium: Update resource tracking when moving a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=48363
- https://bugs.webkit.org/show_bug.cgi?id=34060
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::assignIdentifierToRequest):
+ Always put resource id in map so we can make assumptions about its
+ presence.
+ (WebViewHost::removeIdentifierForRequest):
+ Added.
+ (WebViewHost::didFinishResourceLoad):
+ (WebViewHost::didFailResourceLoad):
+ Check existence of resource id before removing from map.
+ * DumpRenderTree/chromium/WebViewHost.h:
- * Scripts/webkitpy/style/checker.py:
- * Scripts/webkitpy/style/checker_unittest.py:
- * Scripts/webkitpy/style/cpp_style.py: Removed.
- * Scripts/webkitpy/style/cpp_style_unittest.py: Removed.
- * Scripts/webkitpy/style/processors: Added.
- * Scripts/webkitpy/style/processors/__init__.py: Added.
- * Scripts/webkitpy/style/processors/cpp.py: Copied from WebKitTools/Scripts/webkitpy/style/cpp_style.py.
- * Scripts/webkitpy/style/processors/cpp_unittest.py: Copied from WebKitTools/Scripts/webkitpy/style/cpp_style_unittest.py.
- * Scripts/webkitpy/style/processors/text.py: Copied from WebKitTools/Scripts/webkitpy/style/text_style.py.
- * Scripts/webkitpy/style/processors/text_unittest.py: Copied from WebKitTools/Scripts/webkitpy/style/text_style_unittest.py.
- * Scripts/webkitpy/style/text_style.py: Removed.
- * Scripts/webkitpy/style/text_style_unittest.py: Removed.
- * Scripts/webkitpy/style/unittests.py:
-
-2010-01-26 Kevin Ollivier <kevino@theolliviers.com>
-
- [wx] Build fix, make sure stub function returns a value.
+2010-11-03 Victor Wang <victorw@chromium.org>
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::counterValueForElementById):
+ Reviewed by Adam Barth.
-2010-01-26 Steve Falkenburg <sfalken@apple.com>
+ [Chromium] update buildbot names in chromium rebaseline tool.
- Reviewed by Oliver Hunt.
+ https://bugs.webkit.org/show_bug.cgi?id=48881
- Windows build references non-existent include paths
- https://bugs.webkit.org/show_bug.cgi?id=34175
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- * DumpRenderTree/win/DumpRenderTree.vcproj:
- * DumpRenderTree/win/ImageDiff.vcproj:
- * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+2010-11-03 Darin Adler <darin@apple.com>
+
+ Updated Xcode projects by opening them with Xcode 3.2.4.
+ Updated svn:ignore for Xcode projects.
+
+ * MiniBrowser/MiniBrowser.xcodeproj: Added property svn:ignore.
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj: Added property svn:ignore.
+ * WebKitLauncher/WebKitLauncher.xcodeproj: Modified property svn:ignore.
+ * WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj: Updated with Xcode 3.2.4.
+
+2010-11-03 Adam Roben <aroben@apple.com>
+
+ Stop waiting for messages from the web process after a timeout elapses
+
+ TestController::runUntil now takes a timeout parameter that specifies
+ how long to wait for the condition to become true. WebKitTestRunner
+ takes a --timeout flag that specifies how long the timeout should be.
+ run-webkit-tests passes this flag to WebKitTestRunner so its timeout
+ will be similar to run-webkit-tests.
+
+ Fixes <http://webkit.org/b/43047> <rdar://problem/8365833>
+ WebKitTestRunner waits forever if the web process crashes
+
+ Reviewed by Darin Adler and Anders Carlsson.
+
+ * Scripts/old-run-webkit-tests:
+ (top level): Moved the GuardMalloc timeout adjustment here from
+ readFromDumpToolWithTimer.
+ (openDumpTool): Make WTR use a timeout similar to but slightly shorter
+ than the one that was specified on the command line.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::TestController): Initialize our timeout values.
+ (WTR::TestController::initialize): Parse the --timeout flag and use it
+ to modify our timeout values.
+ (WTR::TestController::resetStateToConsistentValues): Changed to use a
+ short timeout while waiting for the web process to reset and to return
+ a boolean indicating whether we were able to reset the web process.
+ Uses a 5-second timeout while waiting for the process to be reset.
+ (WTR::TestController::runTest): Changed to return a boolean indicating
+ whether we were able to reset the web process (and thus run the test).
+ (WTR::TestController::runUntil): Call through to platformRunUntil.
+
+ (WTR::TestController::runTestingServerLoop):
+ (WTR::TestController::run):
+ Changed to bail if any test can't be run. This will cause the process
+ to exit. (Unfortunately this will make run-webkit-tests think we
+ crashed; see <http://webkit.org/b/48943>.)
+
+ * WebKitTestRunner/TestController.h: Added platformRunUntil,
+ m_longTimeout, and m_shortTimeout.
+
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::invoke): Use a short timeout when waiting for the
+ initial response and a long timeout when waiting for the test to
+ complete. Check whether runUntil timed out and print an error message
+ if so.
+
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::platformRunUntil): Renamed from runUntil. Pass
+ [NSDate distantPast] to -[NSRunLoop runMode:beforeDate:] so that we
+ won't block waiting for the run loop. Only loop until the timeout
+ elapses.
+
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ (WTR::TestController::platformRunUntil): Renamed from runUntil. Added a
+ FIXME about honoring the timeout.
+
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::platformRunUntil): Renamed from runUntil. Use
+ ::MsgWaitForMultipleObjectsEx to implement the timeout. Changed to use
+ ::PeekMessageW so that we don't block waiting for messages to become
+ available.
+
+2010-11-03 Adam Roben <aroben@apple.com>
+
+ Add a plugin test that evaluates JS after removing the plugin element
+ from the document
+
+ This test replaces platform/win/plugins/plugin-delayed-destroy.html.
+ That test was made to prevent a crash very similar to this one, but
+ unfortunately tested only the mechanism that prevented the crash and
+ not whether the crash itself was prevented. Since WebKit2 uses a
+ different mechanism to prevent the crash, the test was failing even
+ though WebKit2 was not vulnerable to the crash. This new test crashes
+ if there is no mechanism in place to prevent it and passes in both
+ WebKit1 and WebKit2.
+
+ Fixes <http://webkit.org/b/46711> <rdar://problem/8485903>
+ platform/win/plugins/plugin-delayed-destroy.html fails in WebKit2
-2010-01-26 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Reviewed by Anders Carlsson.
- Reviewed by Ariya Hidayat.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * GNUmakefile.am:
+ Added new file.
- [Qt] Separating out the UrlLoader from the QtLauncher in it's
- own implementation and header file.
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (pluginDeallocate): Make sure we delete the PluginTest object. This
+ prevents a leak and also allows us to test the crash.
- * QtLauncher/main.cpp:
- (main):
- * QtLauncher/urlloader.cpp: Added.
- (UrlLoader::UrlLoader):
- (UrlLoader::loadNext):
- (UrlLoader::init):
- (UrlLoader::getUrl):
- * QtLauncher/urlloader.h: Added.
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::executeScript): Made this into a non-static member
+ function.
-2010-01-25 Chris Jerdonek <cjerdonek@webkit.org>
+ (PluginTest::waitUntilDone):
+ (PluginTest::notifyDone):
+ Updated for changes to executeScript.
- Reviewed by Shinichiro Hamaji.
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added executeScript.
- Refactored check-webkit-style by removing the file path
- parameter from the style error handler functions.
+ * DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp: Added.
+ (EvaluateJSAfterRemovingPluginElement::EvaluateJSAfterRemovingPluginElement):
+ Initialize ourselves and tell the test harness to wait.
+ (EvaluateJSAfterRemovingPluginElement::NPP_DestroyStream): Remove our
+ plugin element from the document, then execute some JavaScript. If
+ WebKit does not have appropriate mechanisms in place, we'll be
+ destroyed inside the first call to executeScript and crash on the
+ second call.
- https://bugs.webkit.org/show_bug.cgi?id=34031
+2010-11-02 Stephen White <senorblanco@chromium.org>
- * Scripts/webkitpy/style/checker.py:
- - Added _default_style_error_handler() to StyleChecker class.
- - Moved handle_style_error() to inside _default_style_error_handler().
+ Reviewed by Tony Chang.
- * Scripts/webkitpy/style/checker_unittest.py:
- - Removed file path from calls to error handler.
+ [chromium] Fix LayoutTestController UMRs.
+ https://bugs.webkit.org/show_bug.cgi?id=48872
- * Scripts/webkitpy/style/cpp_style.py:
- - Removed file path from calls to error handler.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
- * Scripts/webkitpy/style/cpp_style_unittest.py:
- - Removed file path from calls to error handler.
+2010-11-03 Kent Tamura <tkent@chromium.org>
- * Scripts/webkitpy/style/text_style.py:
- - Removed file path from calls to error handler.
+ Reviewed by Dimitri Glazkov.
- * Scripts/webkitpy/style/text_style_unittest.py:
- - Removed file path from calls to error handler.
+ REGRESSION: rebaseline-chromium-webkit-tests uses non-zero tolerance for
+ image dup detection
+ https://bugs.webkit.org/show_bug.cgi?id=48744
-2010-01-25 Jeremy Orlow <jorlow@chromium.org>
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ - Make a function for option parsing for ease of test
+ - Set 0 to options.tolerance
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
+ - Add a test for this change
- Adding myself as reviewer. No review necessary.
+2010-11-02 Gyuyoung Kim <gyuyoung.kim@samsung.com>
- * Scripts/webkitpy/committers.py:
+ Unreviewed: Add myself to the list of Committers.
-2010-01-25 Chris Jerdonek <cjerdonek@webkit.org>
+ * Scripts/webkitpy/common/config/committers.py:
- Reviewed by Adam Barth.
+2010-11-02 Anders Carlsson <andersca@apple.com>
- Improved prepare-ChangeLog so that it preserves the relative
- indentation of a git commit message.
+ Fix build.
- https://bugs.webkit.org/show_bug.cgi?id=34058
+ * TestWebKitAPI/PlatformUtilities.cpp:
+ (TestWebKitAPI::Util::createContextForInjectedBundleTest):
- * Scripts/prepare-ChangeLog:
- - Also adjusted the script so that it does not add white
- space characters to empty lines.
+2010-11-02 Sam Weinig <sam@webkit.org>
-2010-01-24 Eric Seidel <eric@webkit.org>
+ Reviewed by Anders Carlsson.
- No review, rolling out r53763.
- http://trac.webkit.org/changeset/53763
- https://bugs.webkit.org/show_bug.cgi?id=33895
+ Add a way to send startup messages on the context which can be posted when a process launches
+ <rdar://problem/8617928>
+ https://bugs.webkit.org/show_bug.cgi?id=48838
- Broke 20+ tests on Windows.
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (WKBundleInitialize):
+ * TestWebKitAPI/InjectedBundleController.cpp:
+ (TestWebKitAPI::InjectedBundleController::initialize):
+ (TestWebKitAPI::InjectedBundleController::didReceiveMessage):
+ * TestWebKitAPI/InjectedBundleController.h:
+ * TestWebKitAPI/InjectedBundleMain.cpp:
+ (WKBundleInitialize):
+ * TestWebKitAPI/PlatformUtilities.cpp:
+ (TestWebKitAPI::Util::createContextForInjectedBundleTest):
+ * WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp:
+ (WKBundleInitialize):
+ Update implementations of WKBundleInitialize to take an initial userData
+ argument. Change TestWebKitAPI to use the new initial userData to initialize
+ each test's bundle.
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
+2010-11-02 Benjamin Kalman <kalman@google.com>
-2010-01-24 Adam Barth <abarth@webkit.org>
+ Reviewed by Ojan Vafai.
- Rubber stamped by Eric Seidel.
+ new-run-webkit-tests doesn't strip "LayoutTests/" from prefix, unlike old-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=48794
- More pep8 compliance.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py: Strip the "LayoutTests/" prefix from test argument paths.
- * Scripts/webkitpy/mock_bugzillatool.py:
+2010-11-02 Adam Roben <aroben@apple.com>
-2010-01-24 Adam Barth <abarth@webkit.org>
+ Skip webkitpy.layout_tests.run_webkit_tests_unittest.MainTest on Cygwin
+ Python 2.5.x
- Rubber stamped by Eric Seidel.
+ It is known to hang on that version of Python. See
+ <http://webkit.org/b/48614>.
- More pep8 compliance.
+ Reviewed by Adam Barth.
- * Scripts/webkitpy/executive.py:
- * Scripts/webkitpy/grammar.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py: Use
+ skip_if to skip MainTest on Cygwin Python 2.5.x.
+
+ * Scripts/webkitpy/test/skip.py: Added.
+ (skip_if): If the passed-in condition is false, find all the test_*
+ methods of the given class and replace them with a function that just
+ logs that we're skipping these tests. This is loosely based on the
+ unittest.skip_if decorator added in Python 3.1.
+ (_skipped_method): Returns a function that just logs that the tests are
+ being skipped. This is used in place of the actual test_* functions.
+
+ * Scripts/webkitpy/test/skip_unittest.py: Added.
+ (SkipTest.setUp): Create a logger for ourselves and give it a handler
+ that logs to a private stream.
+ (SkipTest.tearDown): Reset the logger.
+ (SkipTest.create_fixture_class): Returns a class that we use to test
+ skip_if. It has a single test_* method, test_foo, that just calls
+ through to a callback.
+ (SkipTest.foo_callback): Record that test_foo was called.
+ (SkipTest.test_skip_if_false): Pass skip_if a False condition and test
+ that test_foo does get called.
+ (SkipTest.test_skip_if_true): Pass skip_if a True condition and test
+ that test_foo does not get called and the appropriate message gets
+ logged.
+
+2010-11-02 Adam Barth <abarth@webkit.org>
-2010-01-24 Adam Barth <abarth@webkit.org>
+ Reviewed by Eric Seidel.
- Rubber stamped by Eric Seidel.
+ webkit-patch should tell check-webkit-style which files were changed so
+ check-webkit-style doesn't have to stat the whole working copy again
+ https://bugs.webkit.org/show_bug.cgi?id=48792
- More pep8 compliance.
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/checkstyle.py:
- * Scripts/webkitpy/comments.py:
- * Scripts/webkitpy/committers.py:
- * Scripts/webkitpy/credentials.py:
+2010-11-02 Robert Kroeger <rjkroege@chromium.org>
-2010-01-24 Adam Barth <abarth@webkit.org>
+ Reviewed by James Robinson.
- Rubber stamped by Eric Seidel.
+ [Chromium/DRT] Make EventSendingController honour leapForward for touch events.
+ https://bugs.webkit.org/show_bug.cgi?id=48777
- Make changelogs.py pass pep8.
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::sendCurrentTouchEvent):
- * Scripts/webkitpy/changelogs.py:
+2010-11-02 Adam Roben <aroben@apple.com>
-2010-01-23 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Only track resource identifiers in DRT when dumpResourceLoadCallbacks
+ is on
- [Qt] Unreviewed build fix
+ This reverts Windows to our pre-r71097 behavior. That patch made us
+ track all resource identifiers, including the main resource, so the
+ main resource's URL started appearing in test output instead of
+ "<unknown>". Arguably having the main resource's URL is better, but all
+ other platforms print "<unknown>" and we want to match.
- * QtLauncher/QtLauncher.pro:
- * QtLauncher/webinspector.h:
+ Fixes <http://webkit.org/b/48837> <rdar://problem/8620351> REGRESSION
+ (r71097): Many http tests failing on Windows
-2010-01-23 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Reviewed by Anders Carlsson.
- Rubberstamped by Simon Hausmann.
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::identifierForInitialRequest): Don't add the
+ identifier to the URL map if we're not supposed to dump resource load
+ callbacks.
+ (ResourceLoadDelegate::removeIdentifierForRequest): Always remove the
+ identifier from the URL map even if we're already "done". There's no
+ point in keeping out-of-date identifiers around.
- [Qt] Move the WebInspector class to it's own header file.
+2010-11-01 Jenn Braithwaite <jennb@chromium.org>
- * QtLauncher/main.cpp:
- * QtLauncher/webinspector.h: Added.
- (WebInspector::WebInspector):
- (WebInspector::showEvent):
- (WebInspector::hideEvent):
+ Reviewed by Adam Roben.
-2010-01-23 Robert Hogan <robert@roberthogan.net>
+ Windows: Update resource tracking when moving a frame between documents
+ https://bugs.webkit.org/show_bug.cgi?id=48364
- Reviewed by Kenneth Rohde Christiansen.
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (createWebViewAndOffscreenWindow):
+ (main):
+ Give each WebView its own ResourceLoadDelegate instance in order to
+ make assertions about resource ids on a particular WebView.
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::identifierForInitialRequest):
+ Always add id to the map.
+ (ResourceLoadDelegate::removeIdentifierForRequest):
+ Added.
+ (ResourceLoadDelegate::willSendRequest):
+ (ResourceLoadDelegate::didReceiveAuthenticationChallenge):
+ (ResourceLoadDelegate::didReceiveResponse):
+ (ResourceLoadDelegate::didFinishLoadingFromDataSource):
+ (ResourceLoadDelegate::didFailLoadingWithError):
+ (ResourceLoadDelegate::descriptionSuitableForTestResult):
+ Replace static descriptionSuitableForTestResult with static member function to access identifier map.
+ * DumpRenderTree/win/ResourceLoadDelegate.h:
+ (ResourceLoadDelegate::urlMap):
+ Moved within class so that each WebView has its own id map.
- Qt DRT: respect window.close() and window.closed()
-
- Qt DRT needs to maintain a correct count of open windows
- for windowCount(). It also needs to delete windows that
- have been closed by window.close().
-
- This fixes the following tests:
-
- plugins/destroy-during-npp-new.html
- fast/dom/Document/early-document-access.html
- fast/dom/Window/window-early-properties.html
- fast/events/open-window-from-another-frame.html
- fast/events/popup-blocking-click-in-iframe.html
-
- https://bugs.webkit.org/show_bug.cgi?id=32953
+2010-11-01 Ojan Vafai <ojan@chromium.org>
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::createWindow):
- (WebCore::DumpRenderTree::windowCloseRequested):
- * DumpRenderTree/qt/DumpRenderTreeQt.h:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::maybeDump):
+ Reviewed by Dimitri Glazkov.
-2010-01-23 Dan Bernstein <mitz@apple.com>
+ remove debug code from run_webkit_tests.py
+ https://bugs.webkit.org/show_bug.cgi?id=48800
- Reviewed by Mark Rowe.
+ Remove temporary debug code and make --master-name required
+ if --test-results-server is set now that all clients set
+ --master-name.
- Added a user default for specifying a fallback frameworks path in case
- the bundle does not contain frameworks for the current Mac OS X version.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * WebKitLauncher/main.m:
- (fallbackMacOSXVersion): Added. Looks up the fallback version in a dictionary
- keyed by the FallbackSystemVersions user default and returns it.
- (main): If a frameworks directory for the current system version is not found,
- try the fallback.
+2010-11-01 Tony Chang <tony@chromium.org>
-2010-01-22 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ Reviewed by Kent Tamura.
- Reviewed by Simon Hausmann.
+ add plugin event logging for linux
+ https://bugs.webkit.org/show_bug.cgi?id=48779
- Make run-webkit-tests work under Cygwin for the Qt port
+ This is taken from Chromium's fork of the layout test plugin:
+ http://git.chromium.org/gitweb/?p=chromium.git/.git;a=blob;f=webkit/tools/npapi_layout_test_plugin/main.cpp;h=3ebdada2f049b3624756438cff852364f86a2ede;hb=HEAD#l348
- setPathForRunningWebKitApp() is implemented for the Qt port
- by using qmake to query for the location of the Qt libraries.
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (handleEventX11):
+ (NPP_HandleEvent):
- This requires the original environment (%ENV) to be untouched,
- so launchWithCurrentEnv() was refactored to launchWithEnv(),
- and the code in openDumpTool() to not use %ENV but a %CLEAN_ENV
- instead. This has the added benefit of getting rid of the temp
- variables used for storing the current env.
+2010-11-01 Dirk Pranke <dpranke@chromium.org>
- openDumpTool() is also refactored a bit into platform-spesific,
- port-spesific, and generic environment variables.
+ Reviewed by James Robinson.
- Checks for undef was added a few places to fix Perl concat
- warnings when run-webkit-tests is aborted.
+ new-run-webkit-tests: use DRT, child-processes=1 for GPU tests by default
+ https://bugs.webkit.org/show_bug.cgi?id=48790
- https://bugs.webkit.org/show_bug.cgi?id=33895
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py:
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
+2010-11-01 Adam Barth <abarth@webkit.org>
-2010-01-22 Kevin Watters <kevinwatters@gmail.com>
+ Reviewed by Eric Seidel.
- Reviewed by Kevin Ollivier.
+ Teach check-webkit-style how to accept a list of files to diff on the
+ command line
+ https://bugs.webkit.org/show_bug.cgi?id=48784
- [wx] Remove the Bakefile build system, which is no longer being used.
-
- https://bugs.webkit.org/show_bug.cgi?id=34022
+ In a future patch, webkit-patch will use this option to improve
+ performance. I'm landing this in two pieces to avoid causing a version
+ skew problem for the style-bot.
- * DumpRenderTree/wx/DumpRenderTree.bkl: Removed.
- * wx/browser/browser.bkl: Removed.
- * wx/build-wxwebkit: Removed.
+ * Scripts/check-webkit-style:
+ * Scripts/webkitpy/style/optparser.py:
+ * Scripts/webkitpy/style/optparser_unittest.py:
+ * Scripts/webkitpy/style_references.py:
-2010-01-22 Gustavo Noronha Silva <gns@gnome.org>
+2010-11-01 Anders Carlsson <andersca@apple.com>
- Reviewed by Simon Fraser.
+ Reviewed by John Sullivan.
- Reset zoom level to 1.0 when resetting view state. This is causing
- many tests to fail after svg/custom/text-zoom.xhtml changes the
- zoom level.
+ Tear down the related WebProcessProxy when a WebContext is deallocated
+ https://bugs.webkit.org/show_bug.cgi?id=48769
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+ * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp:
+ (TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame):
+ We don't support empty URLs anymore, update test to expect a null URL instead.
-2010-01-22 Steve Falkenburg <sfalken@apple.com>
+2010-11-01 Søren Gjesse <sgjesse@chromium.org>
- Reviewed by Darin Adler.
+ Reviewed by Andreas Kling.
- https://bugs.webkit.org/show_bug.cgi?id=34025
- Enable client-based Geolocation abstraction for Mac, Windows AppleWebKit targets.
+ Fix warning when compiling the chromium port of DumpRenderShell
+ with clang.
+ https://bugs.webkit.org/show_bug.cgi?id=48414
- * Scripts/build-webkit:
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::javaScriptFlagsForLoad):
-2010-01-22 Adam Barth <abarth@webkit.org>
+2010-11-01 Adam Roben <aroben@apple.com>
- Unreviewed. Arg. Someone renamed limit to output_limit on me.
+ Fix typo from r71022
- * Scripts/webkitpy/commands/queues.py:
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
-2010-01-22 Adam Barth <abarth@webkit.org>
+2010-11-01 Adam Roben <aroben@apple.com>
- Rubber stamped by Eric Seidel.
+ Trigger the Windows Release WebKit2 tests when a Release build
+ finishes, not when a Debug build finishes
- Make __init__.py and buildbot.py pass pep8 style checker.
+ Fixes <http://webkit.org/b/48754> Windows Release WebKit2 tests are
+ triggered at the wrong time
- * Scripts/webkitpy/__init__.py:
- * Scripts/webkitpy/buildbot.py:
+ Reviewed by Sam Weinig.
-2010-01-21 Joe Mason <jmason@rim.com>
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Fixed
+ triggerable name and trigger.
- Reviewed by Adam Barth.
+2010-11-01 Mario Sanchez Prada <msanchez@igalia.com>
- webkit-patch should retry on invalid password
- https://bugs.webkit.org/show_bug.cgi?id=33955
+ Unreviewed. Adding my IRC nickname to the list of committers.
- Ask for bugs.webkit.org authentication in a loop.
+ * Scripts/webkitpy/common/config/committers.py:
- * Scripts/webkitpy/bugzilla.py:
+2010-10-31 Robert Hogan <robert@webkit.org>
-2010-01-22 Adam Barth <abarth@webkit.org>
+ Reviewed by Antonio Gomes.
- Unreviewed. Don't call seek on a NoneType.
+ [Qt] [Gtk] Plug-ins having upper case in mime type are failing to load
- * Scripts/webkitpy/statusserver.py:
+ Qt and Gtk are case-sensitive when storing the declared mime-type
+ of plugins. Since plugin mime-types are lowercased prior to searching
+ for them in the plugin database, ensure they are loaded with the
+ mime-type in lower case too.
-2010-01-22 Petri Latvala <petri.latvala@nomovok.com>
+ Change the test netscape plugin to declare its mimetype in sentence
+ case so that the correct behaviour is enforced.
- Reviewed by David Levin.
+ https://bugs.webkit.org/show_bug.cgi?id=36815
- check-webkit-style breaks on files with unknown types
- https://bugs.webkit.org/show_bug.cgi?id=34001
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (NP_GetMIMEDescription):
- For files with type FileType.NONE, dispatch_processor returns None.
+2010-10-31 Robert Hogan <robert@webkit.org>
- * Scripts/webkitpy/style/checker.py: Don't call process_file with a processor of value None.
+ Reviewed by Antonio Gomes.
-2010-01-22 Adam Barth <abarth@webkit.org>
+ [Qt] Support nodesFromRect in DRT
- Reviewed by Eric Seidel.
+ https://bugs.webkit.org/show_bug.cgi?id=48716
- Make bugzilla.py and webkitport.py conform to pep8
- https://bugs.webkit.org/show_bug.cgi?id=34015
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::nodesFromRect):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
- This patch makes webkitport.py and bugzilla.py mostly conform to PEP8
- style as enforced by pep8.py. I wasn't able to get rid of all the
- errors because I'm not sure how to wrap some lines properly. Also,
- there are a few deprication errors that I couldn't resolve easily.
- However, this is a massive improvement in compliance.
+2010-10-30 Andreas Kling <kling@webkit.org>
- * Scripts/webkitpy/bugzilla.py:
- * Scripts/webkitpy/webkitport.py:
+ Reviewed by Antonio Gomes.
-2010-01-22 Adam Barth <abarth@webkit.org>
+ [Qt] QtTestBrowser: Switching view type moves the embedded inspector
+ https://bugs.webkit.org/show_bug.cgi?id=48705
- Reviewed by Darin Adler.
+ Reinsert the embedded inspector into the splitter after changing
+ between QWebView/QGraphicsWebView.
- Limit length of EWS results to 5MB
- https://bugs.webkit.org/show_bug.cgi?id=34016
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::init):
+ (LauncherWindow::initializeView):
+ * QtTestBrowser/webinspector.h:
+ (WebInspector::WebInspector):
- Hopefully this will fix the bug where the results link doesn't appear.
- Our current theory is that the results blob is too big and the server
- is rejecting the request with a 500 error. That causes us to re-try
- the post, but when we re-try the StringIO buffer has its seek pointer
- at the end.
+2010-10-28 Antonio Gomes <agomes@rim.com>
- * Scripts/webkitpy/commands/queues.py:
- * Scripts/webkitpy/statusserver.py:
+ Reviewed by Ojan Vafai.
-2010-01-22 Chris Jerdonek <cjerdonek@webkit.org>
+ Needs a "LinuxEditingBehavior", perhaps with a better name
+ https://bugs.webkit.org/show_bug.cgi?id=36627
- Reviewed by Adam Barth.
+ Adding support to Mac's, GTK+'s, Windows' and Chromium's LayoutTestController class to test the newly introduced Unix editing behavior.
- Made check-webkit-style able to check patches when script not
- run from source root. Also consolidated external references
- to a single file.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setEditingBehavior):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setEditingBehavior):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setEditingBehavior):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setEditingBehavior):
- https://bugs.webkit.org/show_bug.cgi?id=33791
+2010-10-29 Andreas Kling <kling@webkit.org>
- * Scripts/check-webkit-style:
- - Changed to import style_references.py.
+ Reviewed by Kenneth Rohde Christiansen.
- * Scripts/webkitpy/style/__init__.py:
- - Removed __path__ hack that allowed searching Scripts/ directory.
+ [Qt] QtTestBrowser: Add keyboard shortcut to toggle full screen (F11)
+ https://bugs.webkit.org/show_bug.cgi?id=48695
- * Scripts/webkitpy/style/checker.py:
- - Changed to import style_references.py.
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::createChrome):
- * Scripts/webkitpy/style_references.py: Added.
+2010-10-29 Andreas Kling <kling@webkit.org>
-2010-01-22 Dmitry Titov <dimich@chromium.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by Maciej Stachowiak.
+ [Qt] QtTestBrowser: Fix uninitialized read in FpsTimer
+ https://bugs.webkit.org/show_bug.cgi?id=48675
- Fix the leak of ThreadIdentifiers in threadMap across threads.
- https://bugs.webkit.org/show_bug.cgi?id=32689
+ FpsTimer::m_timer was never initialized and passed to QObject::killTimer()
+ on startup with in -graphicsbased mode.
- Add a new test to verify the ThreadIdentifiers are not reused across threads.
- The test runs in the beginning of DumpRenderTree and spawns 2 non-WTF treads sequentially,
- waiting for the previous thread to terminate before starting the next.
- The treads use WTF::currentThread() in their thread function. Without a fix, this
- causes both threads to have the same ThreadIdentifier which triggers ASSERT in thread function.
- It also starts another thread using WTF. Without the fix, this finds pthread handle from previous
- threads in the WTF threadMap and asserts in WTF::establishIdentifierForPthreadHandle().
- The test practically does not affect the DRT run time because the threads end immediately.
+ * QtTestBrowser/fpstimer.cpp:
+ (FpsTimer::FpsTimer):
+ (FpsTimer::numFrames):
+ (FpsTimer::stop):
+ (FpsTimer::timerEvent):
+ * QtTestBrowser/fpstimer.h:
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (runThread): Test thread function.
- (testThreadIdentifierMap):
- (dumpRenderTree):
+2010-10-29 Dirk Pranke <dpranke@chromium.org>
-2010-01-22 Kent Tamura <tkent@chromium.org>
+ Reviewed by Tony Chang.
- Reviewed by Maciej Stachowiak.
+ new-run-webkit-tests: change TestResults to be serializable
- Fix a bug that mouseDown:withModifiers: is never called.
- https://bugs.webkit.org/show_bug.cgi?id=33989
+ In preparation for changing new-run-webkit-tests from
+ multithreaded to multiprocess, we need to make sure the data
+ going between the threads is easily serialized over a socket.
- * DumpRenderTree/mac/EventSendingController.mm:
- (+[EventSendingController isSelectorExcludedFromWebScript:]):
- (+[EventSendingController webScriptNameForSelector:]):
+ This change adds serialization/pickling for the TestResults and
+ TestFailure objects (using cPickle).
-2010-01-22 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ The TestFailure objects included a "has_wdiff" flag for Text
+ results, but the flag wasn't being used, so I've removed it,
+ simplifying the state to basically a set of enum objects with
+ associated methods.
- Rubberstamped by Antti Koivisto.
+ https://bugs.webkit.org/show_bug.cgi?id=48616
- [Qt] Separate out the WebPage class into it's own
- cpp/header files. Also, removed the assumption that
- the view is a QWebView, in preparation of a merger
- of the two Qt WebKit launchers.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_results.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py:Added.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
- * QtLauncher/QtLauncher.pro:
- * QtLauncher/main.cpp:
- (WebView::mousePressEvent):
- * QtLauncher/webpage.cpp: Added.
- (WebPage::supportsExtension):
- (WebPage::extension):
- (WebPage::acceptNavigationRequest):
- (WebPage::openUrlInDefaultBrowser):
- * QtLauncher/webpage.h: Added.
- (WebPage::WebPage):
+2010-10-29 Dirk Pranke <dpranke@chromium.org>
-2010-01-21 Chris Jerdonek <cjerdonek@webkit.org>
+ Reviewed by Ojan Vafai.
- Reviewed by Shinichiro Hamaji.
+ new-run-webkit-tests: need to provide separate dashboard results for GPU tests
+ https://bugs.webkit.org/show_bug.cgi?id=48687
- Refactored to move file name and file-reading related code
- from cpp_style.py and text_style.py to checker.py.
+ Modify the steps to upload the JSON files to the dashboards so
+ that the GPU tests don't conflict with the regular tests on a
+ port. We do this by modifying the --builder-name parameter to
+ append " - GPU", which should cause the app to treat the results
+ as a completely new builder. This is a little non-obvious, but
+ keeps us from having to restructure the app.
- https://bugs.webkit.org/show_bug.cgi?id=33775
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * Scripts/check-webkit-style:
- - Updates caused by changes to checker.py.
+2010-10-29 Ojan Vafai <ojan@chromium.org>
- * Scripts/webkitpy/style/checker.py:
- - Added SKIPPED_FILES_WITH_WARNING list.
- - Added SKIPPED_FILES_WITHOUT_WARNING list.
- - Added FileType class.
- - Added ProcessorDispatcher class.
- - In StyleChecker class:
- - Renamed process_patch() to check_patch().
- - Renamed process_file() to check_file().
- - Added _process_file().
- - Related refactoring.
- - Addressed check_patch() FIXME to share code with process_file().
-
- * Scripts/webkitpy/style/checker_unittest.py:
- - Added ProcessorDispatcherSkipTest class.
- - Added ProcessorDispatcherDispatchTest class.
- - Added StyleCheckerCheckFileTest class.
-
- * Scripts/webkitpy/style/cpp_style.py:
- - Renamed process_file_data() to _process_lines.
- - Removed process_file() (moved logic to checker.py).
- - Removed can_handle() (moved logic to checker.py).
- - Added CppProcessor class.
- - Removed is_exempt() (moved logic to checker.py).
- - Added process_file_data() back as a wrapper function.
-
- * Scripts/webkitpy/style/cpp_style_unittest.py:
- - Removed test_can_handle().
- - Removed test_is_exempt().
- - Added CppProcessorTest class.
-
- * Scripts/webkitpy/style/text_style.py:
- - Added TextProcessor class.
- - Removed process_file().
- - Removed can_handle().
-
- * Scripts/webkitpy/style/text_style_unittest.py:
- - Removed test_can_handle().
- - Added TextProcessorTest class.
-
-2010-01-21 Chris Jerdonek <cjerdonek@webkit.org>
+ Reviewed by Tony Chang.
- Reviewed by David Kilzer.
+ [chromium] add debug logging to help diagnose flakiness dashboard issues
+ https://bugs.webkit.org/show_bug.cgi?id=48657
- Create a unit-tested subroutine to parse patch files created
- by svn-create-patch.
+ The appengine app thinks it's getting empty files uploaded. Add some logging
+ to see if new-run-webkit-tests agrees.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- https://bugs.webkit.org/show_bug.cgi?id=33475
+2010-10-29 Dimitri Glazkov <dglazkov@chromium.org>
- * Scripts/VCSUtils.pm:
- - Added parseDiff().
- - Added parsePatch().
+ Reviewed by Ojan Vafai.
- * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl: Added.
- - Added unit tests for parseDiff().
+ [Chromium/DRT] Add master-name flag to new-run-webkit-tests.
+ https://bugs.webkit.org/show_bug.cgi?id=48649
- * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
- - Total number of tests now computed dynamically.
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added flag.
- * Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl: Added.
- - Added unit tests for parsePatch().
+2010-10-29 Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
-2010-01-21 Kevin Ollivier <kevino@theolliviers.com>
+ Reviewed by Martin Robinson.
- [wx] Build fix, add new directory to dir list.
+ Enable popup window in GtkLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=48335
- * wx/build/settings.py:
+ The GtkLauncher application does not support opening new window when
+ a link with "target=_blank" is clicked or similar call to
+ window.open(). Instead, GtkLauncher does nothing which breaks
+ navigation of some websites.
-2010-01-21 Adam Barth <abarth@webkit.org>
+ * GtkLauncher/main.c:
+ (activate_uri_entry_cb):
+ (update_title):
+ (link_hover_cb):
+ (notify_title_cb):
+ (notify_load_status_cb):
+ (notify_progress_cb):
+ (destroy_cb):
+ (go_back_cb):
+ (go_forward_cb):
+ (create_web_view_cb):
+ (web_view_ready_cb):
+ (close_web_view_cb):
+ (create_browser):
+ (create_statusbar):
+ (create_toolbar):
+ (create_window):
+ (main):
- Reviewed by Eric Seidel.
+2010-10-29 Adam Roben <aroben@apple.com>
- Make the EWS transactional
- https://bugs.webkit.org/show_bug.cgi?id=33978
+ Teach check-webkit-style about WebKit2's idiosyncracies
- Now if the EWS gets interrupted in the middle of processing a patch,
- the bots will re-process the patch.
+ Fixes <http://webkit.org/b/48638> Style bot complains about a number
+ of WebKit2 conventions
- * Scripts/test-webkitpy:
- * Scripts/webkitpy/commands/queues.py:
- * Scripts/webkitpy/commands/queues_unittest.py:
- * Scripts/webkitpy/patchcollection.py:
- * Scripts/webkitpy/patchcollection_unittest.py: Added.
+ Reviewed by Anders Carlsson.
-2010-01-21 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/style/checker.py: Excluded some rules for various
+ WebKit2-related files. Also updated the excluded rules for
+ WebKitAPITest to match the current code.
- Unreviewed. Add missing "ago" for style in the status bubble.
+2010-10-29 Csaba Osztrogonác <ossy@webkit.org>
- * QueueStatusServer/templates/statusbubble.html:
+ Reviewed by Adam Roben and David Kilzer.
-2010-01-21 Adam Barth <abarth@webkit.org>
+ Fix and cleanup of build systems
+ https://bugs.webkit.org/show_bug.cgi?id=48342
- Reviewed by David Levin.
+ * Scripts/build-webkit:
+ - Remove unnecessary ENABLE_SANDBOX option.
+ - Add ENABLE_FULLSCREEN_API option.
- [style-queue] should not complain about identifier names with underscores under WebKit/gtk/webkit/
- https://bugs.webkit.org/show_bug.cgi?id=33356
+2010-10-28 Adam Roben <aroben@apple.com>
- White list unix_hacker_style names in WebKit/gtk/webkit because these
- are used in the GTK+ API.
+ Switch the Windows WebKit2 bot to the Release configuration
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ We only have one machine testing WebKit2 on Windows right now, and
+ Debug is just too slow for it to keep up.
-2010-01-21 Diego Gonzalez <diego.gonzalez@openbossa.org>
+ Fixes (hopefully!) <http://webkit.org/b/48615> Windows WebKit2 bot is
+ always way behind
- Reviewed by Kenneth Rohde Christiansen.
+ Reviewed by Jon Honeycutt.
- [Qt] add setDomainRelaxationForbiddenForURLScheme in Qt DRT
- https://bugs.webkit.org/show_bug.cgi?id=33945
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+2010-10-29 Leandro Gracia Gil <leandrogracia@google.com>
-2010-01-21 Simon Hausmann <simon.hausmann@nokia.com>
+ Reviewed by Jeremy Orlow.
- No review, rolling out 53615 as it causes two
- crashes on the bot.
+ Added a second parameter to setMockSpeechInputResult for
+ the language used in speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::createWindow):
- * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::maybeDump):
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ (LayoutTestController::pageSizeAndMarginsInPixels):
-2010-01-21 Robert Hogan <robert@roberthogan.net>
+2010-10-28 Ojan Vafai <ojan@chromium.org>
- Reviewed by Simon Hausmann.
+ Reviewed by Tony Chang.
- Qt DRT: respect window.close() and window.closed()
+ [chromium] add a result-small.json file for the test dashboard
+ https://bugs.webkit.org/show_bug.cgi?id=48547
- Qt DRT needs to maintain a correct count of open windows
- for windowCount(). It also needs to delete windows that
- have been closed by window.close().
+ Output both a results.json file and a results-small.json file.
+ The dashboard will load results-small.json by default so it loads faster.
- This fixes the following tests:
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/jsonresults_unittest.py:
+ Added a bunch of sys.path hackery. Unforunately, this uses hardcoded
+ paths. That obviously needs to be fixed, but at least this way it
+ clearly documents what paths are necessary.
- plugins/destroy-during-npp-new.html
- fast/dom/Document/early-document-access.html
- fast/dom/Window/window-early-properties.html
- fast/events/open-window-from-another-frame.html
- fast/events/popup-blocking-click-in-iframe.html
+2010-10-28 Eric Seidel <eric@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=32953
+ Reviewed by Adam Barth.
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::createWindow):
- (WebCore::DumpRenderTree::windowCloseRequested):
- * DumpRenderTree/qt/DumpRenderTreeQt.h:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::maybeDump):
+ webkit-patch upload calls changed_files more often than it should
+ https://bugs.webkit.org/show_bug.cgi?id=48567
-2010-01-20 Eric Seidel <eric@webkit.org>
+ Passing changed_files around everywhere isn't a very elegant solution
+ but it's the one we have for the moment. I think keeping an explicit
+ cache on Checkout (or making StepState() a real class) is a better
+ long-term option.
- No review, rolling out r53593.
- http://trac.webkit.org/changeset/53593
- https://bugs.webkit.org/show_bug.cgi?id=33496
+ Previously bug_id_for_this_commit was calling changed_files and the
+ result was never getting cached on the state. Now we're explicitly
+ caching the result on the state and passing that to the bug_id_for_this_commit call.
- Re-rollout this patch, the commit-queue should not have landed
- it again, but it did due to land-diff and rollout both not
- clearing flags.
+ I looked into building unit tests for this. Doing so would require
+ using a real Checkout object with a MockSCM and overriding the appropriate
+ calls on SCM to count how often we're stating the file system.
+ That's a useful set of tests to build for a separate change.
- * Scripts/webkitpy/commands/early_warning_system.py:
- * Scripts/webkitpy/commands/queues.py:
- * Scripts/webkitpy/queueengine.py:
- * Scripts/webkitpy/scm.py:
- * Scripts/webkitpy/scm_unittest.py:
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/mocktool.py:
-2010-01-20 Eric Seidel <eric@webkit.org>
+2010-10-28 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- webkit-commit-queue status page is confusing
- https://bugs.webkit.org/show_bug.cgi?id=33496
-
- This should improve the status page by removing more Fail messages.
- To do this, I re-factored the CommitQueue and the AbstractReviewQueues
- to behave more like one another. This meant moving where the failure reporting was done.
- Previously the AbstractReviewQueue always used the parent process to report the error,
- while CommitQueue used the subprocess when possible, and the parent only reported errors
- that we didn't know how to handle (bugs in the commit-queue itself).
- Now the AbstractReviewQueue follow's the commit-queue's model. This got rid of a try-block
- in both implementations and required teaching handle_script_error in each to post Fail messages
- to the status server instead of calling exit(1).
-
- This will also make the style-queue share more bug posting logic with other queues:
- https://bugs.webkit.org/show_bug.cgi?id=33871
-
- * Scripts/webkitpy/commands/early_warning_system.py:
- - Don't exit(1) as that will cause the calling queue to also report Fail to the status server.
- Implementors of handle_script_error are expected to update the status server if needed, but only exit if the error could not be handled.
- So we instead pass patch_has_failed_this_queue=True to _update_status_for_script_error in the case that this was a real failure.
- _update_status_for_script_error knows how to post the Fail message to the status server.
- - Teach _update_status_for_script_error how to post Fail messages to the status server.
- * Scripts/webkitpy/commands/queues.py:
- - Remove the try block from process_work_item since the caller already has one.
- - Only CC watchers on failure to cut down on commit-queue generated mail.
- - handle_unexpected_error needs to mark _did_fail now that the try block is gone from process_work_item.
- - Abstract _format_script_error_output_for_bug to share code between all queues.
- - The new _format_script_error_output_for_bug allows the style-queue to share the posting limit with other queues, as well as support linking to the full output.
- - Rename _can_build_and_test to _current_checkout_builds_and_passes_tests to better explain what revision it's testing.
- - Move logging out of _can_build_and_test and make the logs explain what revision we're testing.
- - handle_script_error now posts Fail instead of the try block in process_work_item handling it.
- * Scripts/webkitpy/queueengine.py:
- - QueueEngine is no longer used just by the commit-queue, update the logging to say "processing" instead of landing.
- * Scripts/webkitpy/scm.py:
- - Add new checkout_revision function.
- * Scripts/webkitpy/scm_unittest.py:
- - Test our new checkout_revision function.
-
-2010-01-20 Fumitoshi Ukai <ukai@chromium.org>
+ Make suggest-reviewers slightly faster
+ https://bugs.webkit.org/show_bug.cgi?id=48562
- Reviewed by Alexey Proskuryakov.
-
- WebSocket: Missing Request-URI, when no tralling slash in host
- https://bugs.webkit.org/show_bug.cgi?id=33689
-
- Update pywebsocket to 0.4.7.1, which supports alias for resource
- name, so that we could test for ws://127.0.0.1:8880
+ Add @memoized to one more common call.
- * Scripts/run-webkit-tests:
- * Scripts/run-webkit-websocketserver:
- * pywebsocket/mod_pywebsocket/dispatch.py:
- * pywebsocket/mod_pywebsocket/handshake.py:
- * pywebsocket/mod_pywebsocket/standalone.py:
- * pywebsocket/setup.py:
- * pywebsocket/test/test_dispatch.py:
- * pywebsocket/test/test_handshake.py:
+ * Scripts/webkitpy/common/checkout/api.py:
-2010-01-20 Eric Seidel <eric@webkit.org>
+2010-10-28 Eric Seidel <eric@webkit.org>
- No review, rolling out r53537.
- http://trac.webkit.org/changeset/53537
- https://bugs.webkit.org/show_bug.cgi?id=33496
+ Reviewed by Adam Barth.
- Added a failure condition to the commit-queue and looks to
- have broken the EWS bots
+ webkit-patch suggest-reviewers -g 260550a6e30b7bf34f16bdb4a5396cf26264fc1c is still very slow
+ https://bugs.webkit.org/show_bug.cgi?id=48536
- * Scripts/webkitpy/commands/early_warning_system.py:
- * Scripts/webkitpy/commands/queues.py:
- * Scripts/webkitpy/queueengine.py:
- * Scripts/webkitpy/scm.py:
- * Scripts/webkitpy/scm_unittest.py:
+ This patch makes it about 40 seconds faster, but it still
+ takes 1:40. This will require more refinement.
-2010-01-20 Jon Honeycutt <jhoneycutt@apple.com>
+ The suggested reviewers list appears to be the same.
- MSAA: accSelect() is not implemented
+ I think the next step may be to have it stop the search after
+ 5 reviewers are found. We never want to suggest 30 people.
- https://bugs.webkit.org/show_bug.cgi?id=33918
- <rdar://problem/7436861>
+ * Scripts/webkitpy/common/checkout/scm.py:
+ - Using --remove-empty to theoretically stop lookups past
+ when a file is removed. I'm not entirely clear that the option
+ does what it says it does. Example:
+ git log --pretty=format:%H -5 --remove-empty -- /Projects/WebKit/WebCore/platform/wx/SearchPopupMenuWx.h
+ returns only one commit
+ vs.
+ git log --pretty=format:%H -5 -- /Projects/WebKit/WebCore/platform/wx/SearchPopupMenuWx.h
+ which returns 5. I was not aware that wx files were ever removed from the repository?
- Reviewed by Darin Adler.
+2010-10-28 Kinuko Yasuda <kinuko@chromium.org>
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (takeFocusCallback):
- Call the object's takeFocus() function.
- (takeSelectionCallback):
- Call its takeSelection() function.
- (addSelectionCallback):
- Call its addSelection() function.
- (removeSelectionCallback):
- Call its removeSelection() function.
- (AccessibilityUIElement::getJSClass):
- Add new functions to the JS class definition.
-
- * DumpRenderTree/AccessibilityUIElement.h:
- Declare new functions.
+ Reviewed by David Levin.
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::takeFocus):
- Stubbed.
- (AccessibilityUIElement::takeSelection):
- Stubbed.
- (AccessibilityUIElement::addSelection):
- Stubbed.
- (AccessibilityUIElement::removeSelection):
- Stubbed.
+ [Chromium] Support FileSystem in chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=47643
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::takeFocus):
- Stubbed.
- (AccessibilityUIElement::takeSelection):
- Stubbed.
- (AccessibilityUIElement::addSelection):
- Stubbed.
- (AccessibilityUIElement::removeSelection):
- Stubbed.
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::openFileSystem): Added.
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost::openFileSystem): Added.
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::takeFocus):
- Call the object's accSelect() function, passing the appropriate flag.
- (AccessibilityUIElement::takeSelection):
- Ditto.
- (AccessibilityUIElement::addSelection):
- Ditto.
- (AccessibilityUIElement::removeSelection):
- Ditto.
+2010-10-28 Sam Weinig <sam@webkit.org>
-2010-01-20 Andras Becsi <abecsi@inf.u-szeged.hu>
+ Reviewed by Anders Carlsson.
- Reviewed by Alexey Proskuryakov.
+ WKURLRefs should be allowed to be null
+ <rdar://problem/8575621>
+ https://bugs.webkit.org/show_bug.cgi?id=48535
- Extract Apache handling to httpd.pm module and use the provided functionality
- in scripts where Apache is needed.
- The module httpd.pm stores the PID of Apache in a variable and cleans up
- the PID directory after Apache properly shut down. Catching INT and TERM
- signals allows the scripts to close Apache and clean up its PID directory
- even if the testing was interrupted.
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
+ (TestWebKitAPI::didStartProvisionalLoadForFrame):
+ (TestWebKitAPI::didCommitLoadForFrame):
+ (TestWebKitAPI::didFinishLoadForFrame):
+ Test that URLs are null pointers when unset.
- https://bugs.webkit.org/show_bug.cgi?id=33153
+2010-10-28 Chris Fleizach <cfleizach@apple.com>
- * Scripts/webkitperl/httpd.pm: Added.
- * Scripts/run-iexploder-tests:
- * Scripts/run-webkit-httpd:
- * Scripts/run-webkit-tests:
+ Reviewed by Adele Peterson.
-2010-01-20 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ AX: multi select group option does not handle setting of AXSelectedChildren correctly
+ https://bugs.webkit.org/show_bug.cgi?id=48464
- Reviewed by Simon Hausmann.
+ Add support for querying information about selected children to DRT, including:
+ selectedChildAtIndex
+ selectedChildrenCount
+ setSelectedChild
- [Qt] Make DumpRenderTree build on Windows
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (selectedChildAtIndexCallback):
+ (setSelectedChildCallback):
+ (selectedChildrenCountCallback):
+ (AccessibilityUIElement::setSelectedChild):
+ (AccessibilityUIElement::selectedChildrenCount):
+ (AccessibilityUIElement::selectedChildAtIndex):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::selectedChildAtIndex):
+ (AccessibilityUIElement::selectedChildrenCount):
+ (AccessibilityUIElement::setSelectedChild):
- * DumpRenderTree/qt/DumpRenderTree.pro:
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- * DumpRenderTree/qt/DumpRenderTreeQt.h:
- * DumpRenderTree/qt/main.cpp:
+2010-10-27 Sam Weinig <sam@webkit.org>
-2010-01-20 Steve Block <steveblock@google.com>
+ Reviewed by Anders Carlsson.
- Reviewed by Eric Seidel.
+ Add WebKit2 API for window feature getter/setters
+ <rdar://problem/8590373>
+ https://bugs.webkit.org/show_bug.cgi?id=48496
- Fix commit bot to land patches in order of the bug last modification date.
- https://bugs.webkit.org/show_bug.cgi?id=33395
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
- * Scripts/webkitpy/bugzilla.py: Modified. Added 'order=Last+Changed' to bugzilla commit queue URL.
+2010-10-28 Søren Gjesse <sgjesse@chromium.org>
-2010-01-20 Adam Barth <abarth@webkit.org>
+ Reviewed by Tony Chang.
- Reviewed by Eric Seidel.
+ Added support for the DumpRenderTree flags --multiple-loads and --js-flags to the Python test runner.
+ https://bugs.webkit.org/show_bug.cgi?id=48236
- Teach check-webkit-style about WebKit/gtk/tests
- https://bugs.webkit.org/show_bug.cgi?id=33892
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- Removes false positives found in
- https://bugs.webkit.org/show_bug.cgi?id=30883
+2010-10-28 Sergio Villar Senin <svillar@igalia.com>
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ Reviewed by Martin Robinson.
-2010-01-20 Adam Barth <abarth@webkit.org>
+ [GTK] WebKitWebFrame's load-status is not properly notified to the tests
+ https://bugs.webkit.org/show_bug.cgi?id=48048
- Reviewed by Eric Seidel.
+ DRT now listens to WebKitWebFrame load-status signals for each
+ created frame instead of the load-status signal of the
+ WebKitWebView that only notifies about changes in the main frame.
- Teach check-webkit-style about QGVLauncher
- https://bugs.webkit.org/show_bug.cgi?id=33890
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewLoadFinished):
+ (webFrameLoadStatusNotified):
+ (frameCreatedCallback):
+ (createWebView):
+ (main):
- Remove false positives found in
- https://bugs.webkit.org/show_bug.cgi?id=33708
+2010-10-28 Tony Chang <tony@chromium.org>
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ Reviewed by Kent Tamura.
-2010-01-20 Eric Seidel <eric@webkit.org>
+ [chromium] fix textInputController.{selectedRange,markedRange}
+ https://bugs.webkit.org/show_bug.cgi?id=48487
- Reviewed by Adam Barth.
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::markedRange): Return arrays of ints, rather than a string
+ (TextInputController::selectedRange): Ditto.
- webkit-commit-queue status page is confusing
- https://bugs.webkit.org/show_bug.cgi?id=33496
-
- This should improve the status page by removing more Fail messages.
- To do this, I re-factored the CommitQueue and the AbstractReviewQueues
- to behave more like one another. This meant moving where the failure reporting was done.
- Previously the AbstractReviewQueue always used the parent process to report the error,
- while CommitQueue used the subprocess when possible, and the parent only reported errors
- that we didn't know how to handle (bugs in the commit-queue itself).
- Now the AbstractReviewQueue follow's the commit-queue's model. This got rid of a try-block
- in both implementations and required teaching handle_script_error in each to post Fail messages
- to the status server instead of calling exit(1).
-
- This will also make the style-queue share more bug posting logic with other queues:
- https://bugs.webkit.org/show_bug.cgi?id=33871
-
- * Scripts/webkitpy/commands/early_warning_system.py:
- - Don't exit(1) as that will cause the calling queue to also report Fail to the status server.
- Implementors of handle_script_error are expected to update the status server if needed, but only exit if the error could not be handled.
- So we instead pass patch_has_failed_this_queue=True to _update_status_for_script_error in the case that this was a real failure.
- _update_status_for_script_error knows how to post the Fail message to the status server.
- - Teach _update_status_for_script_error how to post Fail messages to the status server.
- * Scripts/webkitpy/commands/queues.py:
- - Remove the try block from process_work_item since the caller already has one.
- - Only CC watchers on failure to cut down on commit-queue generated mail.
- - handle_unexpected_error needs to mark _did_fail now that the try block is gone from process_work_item.
- - Abstract _format_script_error_output_for_bug to share code between all queues.
- - The new _format_script_error_output_for_bug allows the style-queue to share the posting limit with other queues, as well as support linking to the full output.
- - Rename _can_build_and_test to _current_checkout_builds_and_passes_tests to better explain what revision it's testing.
- - Move logging out of _can_build_and_test and make the logs explain what revision we're testing.
- - handle_script_error now posts Fail instead of the try block in process_work_item handling it.
- * Scripts/webkitpy/queueengine.py:
- - QueueEngine is no longer used just by the commit-queue, update the logging to say "processing" instead of landing.
- * Scripts/webkitpy/scm.py:
- - Add new checkout_revision function.
- * Scripts/webkitpy/scm_unittest.py:
- - Test our new checkout_revision function.
-
-2010-01-20 Adam Barth <abarth@webkit.org>
+2010-10-27 Ojan Vafai <ojan@chromium.org>
- Reviewed by Darin Adler.
+ Reviewed by Tony Chang.
- Exempt JavaScriptCore/qt/api from style checks
- https://bugs.webkit.org/show_bug.cgi?id=33879
+ [chromium] add a master-name flag to new-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=48488
- Apparently there is a JavaScriptCore API for Qt as well as a WebKit
- API.
+ The test results server now allows adding a master name to
+ the uploaded files. This lets us distinguish bots that have
+ the same name, but are on different masters.
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
-2010-01-19 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+2010-10-28 Adam Roben <aroben@apple.com>
- Reviewed by Simon Hausmann.
+ Don't append a newline to the test output if the frame has no document
+ element in WebKitTestRunner
- [Qt] Don't use QSocketNotifier in the DRT for reading stdin
+ Fixes <http://webkit.org/b/48526> Extra trailing newline when running
+ plugins/document-open.html in WebKitTestRunner
- QSocketNotifier is not available on Windows. Instead we read
- stdin synchronously after each test using signals and slots.
+ Reviewed by Anders Carlsson.
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- * DumpRenderTree/qt/DumpRenderTreeQt.h:
- * DumpRenderTree/qt/main.cpp:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::toJS): Added. Turns a UTF-8 C string into a JSStringRef.
+ (WTR::hasDocumentElement): Added. Uses the JSC API to figure out
+ whether the frame has a document element.
+ (WTR::dumpFrameText): Match DRT by bailing (rather than appending an
+ empty string and a newline) if the frame has no document element.
-2010-01-19 Adam Barth <abarth@webkit.org>
+2010-10-28 Adam Roben <aroben@apple.com>
- Rubber stamped by Eric Seidel.
+ Skip npn-invalidate-rect-invalidates-window.html on headless XP
+ machines
- Move chromium-ews back to building release only to make the EWS faster.
+ TestNetscapePlugIn never receives a WM_PAINT message on headless XP
+ machines, so this test times out. Fixing the test is covered by
+ <http://webkit.org/b/48333>.
- * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/old-run-webkit-tests: Skip
+ npn-invalidate-rect-invalidates-window.html on Windows if accelerated
+ compositing support is disabled, which likely means we're on a headless
+ XP machine.
-2010-01-17 Jon Honeycutt <jhoneycutt@apple.com>
+2010-10-28 Kimmo Kinnunen <kimmok@iki.fi>
- MSAA: The child <option> elements of a non-multiple <select> are not
- exposed
+ Adding myself as a committer.
- https://bugs.webkit.org/show_bug.cgi?id=33773
- <rdar://problem/7550556>
+ * Scripts/webkitpy/common/config/committers.py:
- Reviewed by Alice Liu.
+2010-10-27 Eric Seidel <eric@webkit.org>
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getIsVisibleCallback):
- Call the object's isVisible() function.
- (getIsOffScreenCallback):
- Ditto, for isOffScreen().
- (getIsCollapsedCallback):
- Ditto, for isCollapsed().
- (getHasPopupCallback):
- Ditto, for hasPopup().
- (AccessibilityUIElement::getJSClass):
- Add isVisible and isOffScreen attributes.
+ Reviewed by Adam Barth.
- * DumpRenderTree/AccessibilityUIElement.h:
- Declare new functions.
+ webkit-patch suggest-reviewers -g 260550a6e30b7bf34f16bdb4a5396cf26264fc1c is very slow
+ https://bugs.webkit.org/show_bug.cgi?id=48500
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::isVisible):
- Stubbed.
- (AccessibilityUIElement::isOffScreen):
- Stubbed.
- (AccessibilityUIElement::isCollapsed):
- Stubbed.
- (AccessibilityUIElement::hasPopup):
- Stubbed.
+ This doesn't fix the problem, but it makes things slightly better.
+ Each git svn find-rev call takes about .25 seconds on my desktop.
+ This patch uses a new memoized class to avoid those calls when possible.
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::isVisible):
- Stubbed.
- (AccessibilityUIElement::isOffScreen):
- Stubbed.
- (AccessibilityUIElement::isCollapsed):
- Stubbed.
- (AccessibilityUIElement::hasPopup):
- Stubbed.
+ The real slowness is still git log on some files, like:
+ git log --pretty=format:%H -5 -- /Projects/WebKit/WebCore/platform/wx/SearchPopupMenuWx.h
+ I'm not yet sure how to make the pathological git logs better.
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::showMenu):
- Call the object's accDoDefaultAction() to show its popup menu.
- (AccessibilityUIElement::isEnabled):
- Check that the object does not have the "unavailable" state.
- (AccessibilityUIElement::isVisible):
- Check that the object does not have the "invisible" state.
- (AccessibilityUIElement::isOffScreen):
- Check whether the object has the "offscreen" state.
- (AccessibilityUIElement::isCollapsed):
- Check whether the object has the "collapsed" state.
- (AccessibilityUIElement::hasPopup):
- Check whether the object has the "has popup" state.
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/memoized.py: Added.
+ * Scripts/webkitpy/common/memoized_unittest.py: Added.
-2010-01-19 Victor Wang <victorw@chromium.org>
+2010-10-27 Eric Seidel <eric@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Ojan Vafai.
- Correct committer name.
- https://bugs.webkit.org/show_bug.cgi?id=33868
+ EWS bots should not use --quiet when running build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=48482
- * Scripts/webkitpy/committers.py:
+ --quiet is only correct when the sub-process does the error reporting.
+ In the case of _can_build() the parent process is reporting the error.
+ We'd like the full build log at queues.webkit.org so someone can look
+ at the log and understand why the EWS is failing to build trunk.
-2010-01-19 Kent Tamura <tkent@chromium.org>
+ * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- Reviewed by Darin Adler.
+2010-10-27 Brian Weinstein <bweinstein@apple.com>
- [DRT][Mac] Add modifiers parameter to eventSender.mouseDown() and eventSender.mouseUp()
- https://bugs.webkit.org/show_bug.cgi?id=33783
+ More Windows build fixage. Rename a variable that was named string.
- Some listbox tests check selection behavior by click events with
- "meta" or "shift" keys. Behaviors for such modifier keys are
- platform-dependent. The new parameter of mouseDown() and mouseUp()
- allows to specify not only concrete modifier keys such as
- "shiftKey" "metaKey", but also functional names like
- "addSelectionKey" "rangeSelectionKey".
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::hasPrefix):
- * DumpRenderTree/mac/EventSendingController.mm:
- (+[EventSendingController isSelectorExcludedFromWebScript:]):
- (+[EventSendingController webScriptNameForSelector:]):
- (buildModifierFlags):
- (-[EventSendingController mouseDown:withModifiers:]):
- (-[EventSendingController mouseDown:]):
- (-[EventSendingController mouseUp:withModifiers:]):
- (-[EventSendingController mouseUp:]):
- (-[EventSendingController keyDown:withModifiers:withLocation:]):
+2010-10-27 Ojan Vafai <ojan@chromium.org>
-2010-01-19 Adam Barth <abarth@webkit.org>
+ Reviewed by Dimitri Glazkov.
- Reviewed by Eric Seidel.
+ [chromium] Make the test results server store which master the bot is on
+ https://bugs.webkit.org/show_bug.cgi?id=48478
- Unbreak --request-commit
- https://bugs.webkit.org/show_bug.cgi?id=33832
+ The chromium bots recently changed so that there are multiple slaves with
+ the same name on different masters. Up till now, the test results server
+ assumed slave names were unique. Adds a master field to the file in order
+ to distinguish.
- * Scripts/webkitpy/bugzilla.py:
+ Also, for files that currently lack a master or testtype, set them appropriately.
-2010-01-19 Eric Seidel <eric@webkit.org>
+ * TestResultServer/handlers/testfilehandler.py:
+ * TestResultServer/index.yaml:
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/testfile.py:
+ * TestResultServer/templates/showfilelist.html:
+ * TestResultServer/templates/uploadform.html:
- Reviewed by Adam Barth.
+2010-10-26 Darin Adler <darin@apple.com>
- validate-committer-lists throws exception and committers.py needs a refresh
- https://bugs.webkit.org/show_bug.cgi?id=33831
+ Reviewed by Sam Weinig.
- * Scripts/validate-committer-lists: use webkit_logging
- * Scripts/webkitpy/committers.py: Add recently minted committers. Fix Simon Hausmanns email address list to include his webkit-committers@lists address.
+ WebKitTestRunner needs to support layoutTestController.dumpBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42322
+ rdar://problem/8193631
+
+ WebKitTestRunner needs to support layoutTestController.clearBackForwardList
+ https://bugs.webkit.org/show_bug.cgi?id=42333
+ rdar://problem/8193643
+
+ * WebKitTestRunner/Configurations/InjectedBundle.xcconfig:
+ Renamed the product to WebKitTestRunnerInjectedBundle to avoid
+ name conflicts in the build directory.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added dumpBackForwardList and clearBackForwardList.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::InjectedBundle): Removed initialization of m_mainPage.
+ (WTR::InjectedBundle::didCreatePage): Removed unneeded underscore.
+ (WTR::InjectedBundle::willDestroyPage): Ditto.
+ (WTR::InjectedBundle::didReceiveMessage): Ditto.
+ (WTR::InjectedBundle::initialize): Ditto.
+ (WTR::InjectedBundle::didCreatePage): Changed code to use m_pages
+ instead of m_mainPage and m_otherPages.
+ (WTR::InjectedBundle::willDestroyPage): Ditto.
+ (WTR::InjectedBundle::page): Ditto.
+ (WTR::InjectedBundle::beginTesting): Ditto.
+ (WTR::InjectedBundle::done): Ditto.
+ (WTR::InjectedBundle::closeOtherPages): Ditto.
+ (WTR::InjectedBundle::dumpBackForwardListsForAllPages): Added.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Changed
+ page function to longer be inline, and pageCount function
+ to use m_pages. Added dumpBackForwardListsForAllPages, and
+ removed some underscores. Replaced m_mainPage and m_otherPageas
+ with m_pages.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::adoptWK): Added.
+ (WTR::hasPrefix): Added.
+ (WTR::InjectedBundlePage::reset): Added code to set up
+ m_previousTestBackForwardListItem.
+ (WTR::InjectedBundlePage::dump): Added code to call
+ dumpBackForwardListsForAllPages.
+ (WTR::compareByTargetName): Added.
+ (WTR::dumpBackForwardListItem): Added.
+ (WTR::InjectedBundlePage::dumpBackForwardList): Added.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added
+ dumpBackForwardList and m_previousTestBackForwardListItem.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Initialize
+ m_shouldDumpBackForwardListsForAllWindows to false.
+ (WTR::LayoutTestController::clearBackForwardList): Added.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ Added dumpBackForwardList, clearBackForwardList,
+ shouldDumpBackForwardListsForAllWindows, and
+ m_shouldDumpBackForwardListsForAllWindows.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize): Set up
+ didReceiveSynchronousMessageFromInjectedBundle.
+ (WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
+ Added.
+ * WebKitTestRunner/TestController.h: Ditto.
+
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
+ Added.
+ * WebKitTestRunner/TestInvocation.h: Ditto.
+
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ Renamed bundle to WebKitTestRunnerInjectedBundle (see above).
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::initializeInjectedBundlePath): Ditto.
+
+2010-10-27 Chris Rogers <crogers@google.com>
+
+ Reviewed by Chris Marrin.
+
+ Add ENABLE_WEB_AUDIO feature enable flag (initially disabled) to build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=48279
-2010-01-18 Adam Roben <aroben@apple.com>
+ * Scripts/build-webkit:
- Add LayoutTestController support for calling new WebKit SPI to
- disallow setting document.domain
+2010-10-27 Eric Seidel <eric@webkit.org>
- DRT part of fixing <http://webkit.org/b/33806>
- <rdar://problem/7552837> Would like API to disallow setting of
- document.domain for pages with certain URL schemes
+ Unreviewed.
- Reviewed by Sam Weinig.
+ build-webkit should collect Visual Studio Express logs and display them
+ https://bugs.webkit.org/show_bug.cgi?id=39199
- * DumpRenderTree/LayoutTestController.cpp:
- (setDomainRelaxationForbiddenForURLSchemeCallback): Added. Calls
- through to LayoutTestController.
- (LayoutTestController::staticFunctions): Added
- setDomainRelaxationForbiddenForURLScheme.
+ It turns out my previous patch wasn't actually working on the win-ews
+ machine. So I've fixed my mistakes from before.
- * DumpRenderTree/LayoutTestController.h: Added
- setDomainRelaxationForbiddenForURLScheme.
+ * Scripts/build-webkit:
+ - Windows VSE builds change the CWD while building. Why? Who knows.
+ * Scripts/print-vse-failure-logs:
+ - windows VSE builds don't use Debug/Release as I expected, so I've
+ moved off of --configuration to --top-level and added the /obj
+ optimization while I was there.
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
- Added. Calls through to WebKit.
+2010-10-27 Dimitri Glazkov <dglazkov@chromium.org>
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
- Stubbed out.
+ Unreviewed, rolling out r70674.
+ http://trac.webkit.org/changeset/70674
+ https://bugs.webkit.org/show_bug.cgi?id=48053
-2010-01-18 Adam Barth <abarth@webkit.org>
+ Broke Chromium Windows build.
- Reviewed by Adam Roben.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- Rename patches-to-commit to patches-in-commit-queue
- https://bugs.webkit.org/show_bug.cgi?id=33789
+2010-10-25 Tony Chang <tony@chromium.org>
- The command really lists the patches in the commit-queue not all the
- patches that are pending-commit (as the FIXME commands).
+ Reviewed by Anders Carlsson.
- * Scripts/webkitpy/commands/queries.py:
- * Scripts/webkitpy/commands/queries_unittest.py:
+ compile TestNetscapePlugIn on chromium linux
+ https://bugs.webkit.org/show_bug.cgi?id=48274
-2010-01-18 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NP_Initialize): On Linux, plugin funcs are set in initialize.
+ (NPP_New): Mark the plugin as windowless.
+ (NPP_GetValue): Handle mime type values.
+ (NP_GetMIMEDescription):
+ (NP_GetValue):
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h: define TRUE and FALSE, which are in webkit's npapi.h.
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h: Pull in npapi.h to get TRUE/FALSE (matches webkit's npfunctions.h)
- Reviewed by Simon Hausmann.
+2010-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
- [Qt] Force qmake to generate a single makefile for DerivedSources.pro
+ Reviewed by Anders Carlsson.
- * Scripts/webkitdirs.pm:
+ Remove contentSizeChanged callbacks as it is no longer
+ part of the public UIClient.
-2010-01-18 Adam Roben <aroben@apple.com>
+ Make WKPageContentsSizeChangedCallback be a private API
+ https://bugs.webkit.org/show_bug.cgi?id=48409
- Clean up use of /useenv when invoking Visual C++
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
- This change reverts things to their pre-r49485 state. That revision
- (and, subsequently, r49664 and r51788) started passing /useenv to
- Visual C++, even in cases where we don't want to do so (such as when
- invoking Visual C++ Express), in the name of making the Chromium build
- work. Now that Chromium isn't using buildVisualStudioProject or
- pdevenv, we can put things back they way they were.
+2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- Fixes <http://webkit.org/b/33797> build-webkit fails with VC++ Express
- (due to /useenv flag)
+ Reviewed by Ojan Vafai.
- Reviewed by Sam Weinig.
+ Make http locking default in NRWT.
+ https://bugs.webkit.org/show_bug.cgi?id=48053
- * Scripts/pdevenv: Always pass /useenv. Chromium doesn't use this
- script anymore.
- * Scripts/webkitdirs.pm:
- (buildVisualStudioProject): Never pass /useenv anymore. pdevenv takes
- care of this itself, and we don't want to pass /useenv when not using
- pdevenv (e.g., when using VC++ Express, because that will cause it to
- ignore the Platform SDK).
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
-2010-01-18 Adam Barth <abarth@webkit.org>
+2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- Reviewed by Eric Seidel.
+ Reviewed by Tony Chang.
- webkit-patch land-safely should obsolete old patches
- https://bugs.webkit.org/show_bug.cgi?id=33788
+ [NRWT] Fix http lock on Windows platform
+ https://bugs.webkit.org/show_bug.cgi?id=48321
- When posting a commit-queue+ patch with land-safely, we should
- obsolete the old patches on the bug. They're really confusing
- because the main use case is to address reviewer feedback on a
- previous patch.
+ * Scripts/webkitpy/layout_tests/port/http_lock.py:
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/commands/upload_unittest.py:
+2010-10-27 Satish Sampath <satish@chromium.org>
-2010-01-18 Adam Barth <abarth@webkit.org>
+ Unreviewed, rolling out r70665.
+ http://trac.webkit.org/changeset/70665
+ https://bugs.webkit.org/show_bug.cgi?id=47089
- Reviewed by David Levin.
+ Need to address Alexey's review comments.
- webkit-patch should authenticate more often
- https://bugs.webkit.org/show_bug.cgi?id=33701
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
- This makes it easier to work with security patches.
+2010-10-27 Leandro Gracia Gil <leandrogracia@google.com>
- * Scripts/webkitpy/bugzilla.py:
+ Reviewed by Jeremy Orlow.
-2010-01-18 Adam Barth <abarth@webkit.org>
+ Added a second parameter to setMockSpeechInputResult for
+ the language used in speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
- Reviewed by Darin Adler.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ (LayoutTestController::pageSizeAndMarginsInPixels):
- style checker needs to know about GObject-specific requirements
- inside WebCore/bindings/gobject/
- https://bugs.webkit.org/show_bug.cgi?id=33606
+2010-10-27 Adam Roben <aroben@apple.com>
- Add an exception to the underscore rule for certain
- GObject-specific names.
+ Reset TestNetscapePlugIn's NPP_GetValue pointer when
+ NullNPPGetValuePointer finishes running
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ Fixes <http://webkit.org/b/48435> REGRESSION (r70655): Many plugins
+ tests are failing on Qt
-2010-01-18 Adam Barth <abarth@webkit.org>
+ Reviewed by Anders Carlsson.
- Reviewed by Shinichiro Hamaji.
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::NPP_Destroy):
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
+ Added a do-nothing NPP_Destroy implementation.
- [check-webkit-style] does understand ResourceHandleWin.h
- https://bugs.webkit.org/show_bug.cgi?id=32975
+ * DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp:
+ (NullNPPGetValuePointer::NullNPPGetValuePointer): Save the original
+ NPP_GetValue pointer in m_originalNPPGetValuePointer so we can restore
+ it later.
+ (NullNPPGetValuePointer::NPP_Destroy): Added. Restores the original
+ NPP_GetValue pointer so it can be used in other tests.
- I'm not 100% convinced this fix is correct, but without more examples,
- it's hard to generalize. We can always generalize the fix in the
- future.
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_Destroy):
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_destroy_instance):
+ Call through to the PluginTest when NPP_Destroy is called.
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+2010-10-26 Brian Weinstein <bweinstein@apple.com>
-2010-01-18 Adam Barth <abarth@webkit.org>
+ Reviewed by Adam Roben.
- Unreviewed "build" fix.
+ WebKit2 shouldn't try to send an empty user agent
+ https://bugs.webkit.org/show_bug.cgi?id=48397
+
+ Add a test that when we set our custom user agent to an empty string, we don't send
+ an empty user agent.
- * Scripts/webkitpy/bugzilla.py:
+ * TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp: Added.
+ (TestWebKitAPI::didRunJavaScript): Make sure that the result of navigator.userAgent isn't empty.
+ (TestWebKitAPI::TEST): Set our custom user agent to the empty string, and run navigator.userAgent.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add the new file.
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj: Ditto.
-2010-01-18 Adam Barth <abarth@webkit.org>
+2010-10-27 Adam Roben <aroben@apple.com>
- Unreviewed. Actually make land-safely mark commit-queue+ as
- discussed with Eric.
+ Check in file I forgot in r70653
- * Scripts/webkitpy/bugzilla.py:
- * Scripts/webkitpy/steps/postdiffforcommit.py:
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (NP_Initialize): Save the NPPluginFuncs struct the browser passed to us
+ so we can be naughty and modify it later.
-2010-01-17 Adam Barth <abarth@webkit.org>
+2010-10-27 Adam Roben <aroben@apple.com>
- Reviewed by Darin Adler.
+ Test that WebKit doesn't crash if the plugin passes 0 for its
+ NPP_GetValue pointer
- style-queue complains about one-line macros that include multiple statements
- https://bugs.webkit.org/show_bug.cgi?id=33173
+ Test for <http://webkit.org/b/48433> Crash in
+ NetscapePlugin::shouldLoadSrcURL when using Shockwave Director 10.3 in
+ WebKit2 on Windows
- Add an exception for multiple statements on a line that starts a macro.
+ Reviewed by Eric Carlson.
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * GNUmakefile.am:
+ Added NullNPPGetValuePointer.cpp.
-2010-01-17 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+ Set up a place to store the NPPluginFuncs struct the browser passed to us.
- Reviewed by Darin Adler.
+ * DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp: Added.
+ (NullNPPGetValuePointer::NullNPPGetValuePointer): Null out the
+ NPP_GetValue pointer we passed to the browser to simulate a plugin that
+ doesn't implement NPP_GetValue.
+ (NullNPPGetValuePointer::NPP_GetValue): Print an error message. If this
+ function is called, it means that WebKit has changed in a way that
+ makes this test invalid.
- [check-webkit-style] qt unit testing false positives
- https://bugs.webkit.org/show_bug.cgi?id=32833
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NP_GetEntryPoints): Save the NPPluginFuncs struct the browser passed
+ to us so we can be naughty and modify it later.
- Exempt the Qt API and unit tests from the style checker.
+2010-10-27 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ Reviewed by Andreas Kling.
-2010-01-17 Adam Barth <abarth@webkit.org>
+ Remove references to ancient QGVLauncher and QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=48430
- Reviewed by Darin Adler.
+ QtTestBrowser substitutes both and has checks enabled.
- style-check script reports loads of errors on gtk2drawing.c
- https://bugs.webkit.org/show_bug.cgi?id=33771
+ * Scripts/webkitpy/style/checker.py: remove references
+ * Scripts/webkitpy/style/checker_unittest.py: ditto
- Exempt WebCore/platform/gtk/gtk2drawing.c and
- WebCore/platform/gtk/gtk2drawing.h from style checks.
+2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ Reviewed by Ojan Vafai.
-2010-01-17 Chris Jerdonek <cjerdonek@webkit.org>
+ [NRWT] Don't use image hash when it's no need in single test mode.
+ https://bugs.webkit.org/show_bug.cgi?id=48326
- Reviewed by Shinichiro Hamaji.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
- Finished eliminating _cpp_style_state global state variable from
- check-webkit-style code and eliminating _CppStyleState class.
+2010-10-27 David Kilzer <ddkilzer@apple.com>
- https://bugs.webkit.org/show_bug.cgi?id=33764
+ Fix leak of CFMutableDictionaryRef in createXMLStringFromWebArchiveData()
- * Scripts/webkitpy/style/checker.py:
- - Minor updates caused by changes to cpp_style.py.
+ Reviewed by Adam Roben.
- * Scripts/webkitpy/style/cpp_style.py:
- - Removed _CppStyleState class.
- - Removed verbose_level functions.
- - Added verbosity as a parameter to _FunctionState constructor.
- - Added verbosity as a parameter to process_file().
- - Added verbosity as a parameter to process_file_data().
+ Follow-up fix for: <https://bugs.webkit.org/show_bug.cgi?id=48278>
- * Scripts/webkitpy/style/cpp_style_unittest.py:
- - Added helper functions to set verbosity while running tests.
+ * DumpRenderTree/cf/WebArchiveDumpSupport.cpp:
+ (createXMLStringFromWebArchiveData): Use RetainPtr<> to fix a
+ leak introduced in r70613.
-2010-01-17 Adam Barth <abarth@webkit.org>
+2010-10-27 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- Reviewed by Shinichiro Hamaji.
+ Reviewed by Csaba Osztrogonác.
- check-webkit-style underscore check should be disabled for Qt methods starting with qt_
- https://bugs.webkit.org/show_bug.cgi?id=33663
+ [NRWT] Add platform specific baseline search paths for Qt port
+ https://bugs.webkit.org/show_bug.cgi?id=48428
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/qt.py:
-2010-01-17 Adam Barth <abarth@webkit.org>
+2010-10-27 Adam Roben <aroben@apple.com>
- Reviewed by Eric Seidel.
+ Catch exceptions when checking if we're inside a git working directory
- style-queue complains about missing #include of config.h for non-WebCore projects
- https://bugs.webkit.org/show_bug.cgi?id=33170
+ Fixes <http://webkit.org/b/48420> REGRESSION (r70562): test-webkitpy
+ fails on systems without git installed
- WebKitAPITests are consumers of the WebKit API and therefore do not
- need to follow the same include discipline as the rest of WebKit. This
- patch exempts them from the include checks.
+ Reviewed by Anders Carlsson.
- * Scripts/webkitpy/style/cpp_style.py:
- * Scripts/webkitpy/style/cpp_style_unittest.py:
+ * Scripts/webkitpy/common/net/credentials.py:
+ (Credentials._credentials_from_git): Put the call to
+ Git.in_working_directory inside the try/except since it, too, attempts
+ to execute git and thus will throw on systems that don't have git
+ installed.
-2010-01-17 Adam Barth <abarth@webkit.org>
+2010-10-27 Nikolas Zimmermann <nzimmermann@rim.com>
- Reviewed by Eric Seidel.
+ Reviewed by David Kilzer.
- EWS (Early Warning Systems) should build both debug and release
- https://bugs.webkit.org/show_bug.cgi?id=33681
+ Convert DumpRenderTree webarchive code to CoreFoundation
+ https://bugs.webkit.org/show_bug.cgi?id=48278
- Build both debug and release for chromium-ews.
+ CFPropertyListCreateWithData and CFPropertyListCreateData are only available in 10.6+.
+ Replace CFPropertyListCreateWithData by a combination of CFReadStreamCreateWithBytesNoCopy and CFPropertyListCreateFromStream.
+ Replace CFPropertyListCreateData by CFPropertyListCreateXMLData.
- * Scripts/webkitpy/commands/early_warning_system.py:
+ These changes are wrapped in BUILDING_ON_LEOPARD, as the methods are deprecated on 10.6+.
-2010-01-17 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/cf/WebArchiveDumpSupport.cpp:
+ (createXMLStringFromWebArchiveData):
- Reviewed by Darin Adler.
+2010-10-26 Antonio Gomes <agomes@rim.com>
- style-queue should include instructions for how to file bugs against check-webkit-style
- https://bugs.webkit.org/show_bug.cgi?id=32345
+ Reviewed by Martin Robinson.
- Added some text to the error message asking folks to file bugs against
- false positives.
+ Remove the absolute path used to include DumpRenderTreeSupportGtk.h from LayoutTestController.h
- * Scripts/webkitpy/commands/queues.py:
+ It turns out this is rather unneeded since WebKitTools/GNUMakefile.am has WebKit/gtk/ in its include
+ path, and then we can just do #include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
-2010-01-17 Chris Jerdonek <cjerdonek@webkit.org>
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- Reviewed by Adam Barth.
+2010-10-26 David Kilzer <ddkilzer@apple.com>
- Eliminated the error_count global variable and related
- check-webkit-style refactoring.
+ Rename WebArchiveDumpSupport.mm to WebArchiveDumpSupport.cpp
- https://bugs.webkit.org/show_bug.cgi?id=33678
+ Reviewed by Adam Roben.
- * Scripts/check-webkit-style:
- - Updated to use webkit_argument_defaults().
- - Renamed styleChecker to style_checker.
+ Part 4 of 4: <http://webkit.org/b/48278> Convert DumpRenderTree webarchive code to CoreFoundation
- * Scripts/webkitpy/style/checker.py:
- - Prefixed the three default arguments with WEBKIT_DEFAULT.
- - Added webkit_argument_defaults().
- - Added default filter_rules parameter to CategoryFilter constructor.
- - Added __ne__() to CategoryFilter class.
- - Added __eq__() and __ne__() to ProcessorOptions class.
- - Added error_count and _write_error attributes to StyleChecker class.
- - Made StyleChecker._handle_error() increment the error count.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Updated for file moves and renames.
+ * DumpRenderTree/cf/WebArchiveDumpSupport.cpp: Renamed from DumpRenderTree/mac/WebArchiveDumpSupport.mm.
+ * DumpRenderTree/cf/WebArchiveDumpSupport.h: Renamed from DumpRenderTree/mac/WebArchiveDumpSupport.h.
- * Scripts/webkitpy/style/checker_unittest.py:
- - Improved CategoryFilterTest.test_eq().
- - Added CategoryFilterTest.test_ne().
- - Added test_eq() and test_ne() to ProcessorOptionsTest class.
- - Updated unit tests to use webkit_argument_defaults().
- - Added StyleCheckerTest class.
+2010-10-26 David Kilzer <ddkilzer@apple.com>
- * Scripts/webkitpy/style/cpp_style.py:
- - Removed references to global error_count.
+ Convert WebArchiveDumpSupport.mm from NS objects to CF types
- * Scripts/webkitpy/style/cpp_style_unittest.py:
- - Removed CppStyleStateTest class.
+ Reviewed by Adam Roben.
-2010-01-15 Jon Honeycutt <jhoneycutt@apple.com>
+ Part 3 of 4: <http://webkit.org/b/48278> Convert DumpRenderTree webarchive code to CoreFoundation
- get_accParent should try to retrieve parent AccessibilityObject, before
- calling upon window
+ In order to share WebArchive code between the Mac and Windows
+ ports, the code in WebArchiveDumpSupport.mm was converted from
+ Cocoa to C++ using CoreFoundation (CF) types.
- https://bugs.webkit.org/show_bug.cgi?id=22893
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (dump): Renamed serializeWebArchiveToXML() to
+ createXMLStringFromWebArchiveData() and added HardAutorelease()
+ to prevent leaks.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.h:
+ (createXMLStringFromWebArchiveData): Renamed from
+ serializeWebArchiveToXML(). Changed to use CF types.
+ (createCFURLResponseFromResponseData): Renamed from
+ unarchiveNSURLResponseFromResponseData(). Changed to use CF
+ types for its parameter and return type.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.mm: Replaced use of
+ NS objects with CF types. It will be renamed to *.cpp in a
+ future commit.
+ (convertMIMEType): Changed to use case-insensitive string
+ comparisons.
+ (convertWebResourceDataToString):
+ (normalizeHTTPResponseHeaderFields):
+ (normalizeWebResourceURL):
+ (convertWebResourceResponseToDictionary):
+ (compareResourceURLs):
+ (createXMLStringFromWebArchiveData):
+ * DumpRenderTree/mac/WebArchiveDumpSupportMac.mm:
+ (createCFURLResponseFromResponseData): Renamed from
+ unarchiveNSURLResponseFromResponseData(). Changed to use CF
+ types for its parameter and return type.
+
+2010-10-26 David Kilzer <ddkilzer@apple.com>
+
+ Extract use of NSKeyedUnarchiver from WebArchiveDumpSupport.mm
- Reviewed by Darin Adler.
+ Reviewed by Adam Roben.
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::parentElement):
- Get the object's parent. Query it for IAccessible, and return it.
+ Part 2 of 4: <http://webkit.org/b/48278> Convert DumpRenderTree webarchive code to CoreFoundation
-2010-01-16 Dan Bernstein <mitz@apple.com>
+ There is no equivalent to NSKeyedUnarchiver in CoreFoundation,
+ so extract it into a platform-specific source file.
- Reviewed by Mark Rowe.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.h:
+ (unarchiveNSURLResponseFromResponseData): Added declaration.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.mm:
+ (convertWebResourceResponseToDictionary): Extracted code to
+ unarchiveNSURLResponseFromResponseData() in
+ WebArchiveDumpSupportMac.mm. Updated logic to return early if
+ nil is returned from unarchiveNSURLResponseFromResponseData().
+ * DumpRenderTree/mac/WebArchiveDumpSupportMac.mm:
+ (unarchiveNSURLResponseFromResponseData): Added. Extracted
+ code from convertWebResourceResponseToDictionary() in
+ WebArchiveDumpSupport.mm.
- <rdar://problem/7529519> DumpRenderTree crashes in makeLargeMallocFailSilently()
+2010-10-26 David Kilzer <ddkilzer@apple.com>
- * DumpRenderTree/mac/CheckedMalloc.cpp:
- (makeLargeMallocFailSilently): Temporarily allow writing to the default
- malloc zone structure while modifying it.
+ Extract call to -[WebHTMLRepresentation supportedNonImageMIMETypes] from WebArchiveDumpSupport.mm
-2010-01-16 David Kilzer <ddkilzer@apple.com>
+ Reviewed by Adam Roben.
- Added back removed properties to iExploder input files
+ Part 1 of 4: <http://webkit.org/b/48278> Convert DumpRenderTree webarchive code to CoreFoundation
- While the update-iexploder-cssproperties script works great to
- add new properties, it has the side-effect of removing old
- properties that once were parsed.
+ The call to -[WebHTMLRepresentation supportedNonImageMIMETypes]
+ is not cross-platform between Mac and Windows, so extract it
+ into a platform-specific source file.
- * iExploder/htdocs/cssproperties.in: Added back removed
- properties into their own section.
- * iExploder/htdocs/htmlattrs.in: Ditto.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added
+ WebArchiveDumpSupportMac.mm to the project.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.h:
+ (supportedNonImageMIMETypes): Added declaration.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.mm:
+ (convertWebResourceDataToString): Replaced call to
+ -[WebHTMLRepresentation supportedNonImageMIMETypes] with
+ supportedNonImageMIMETypes().
+ * DumpRenderTree/mac/WebArchiveDumpSupportMac.mm: Added.
+ (supportedNonImageMIMETypes): Added. Extracted from
+ WebArchiveDumpSupport.mm.
-2010-01-16 Holger Hans Peter Freyther <zecke@selfish.org>
+2010-10-26 Antonio Gomes <agomes@rim.com>
- Reviewed by David Kilzer.
+ Reviewed by Martin Robinson.
- Update iExploder/htdocs/*.in by running update-iexploder-cssproperties
- https://bugs.webkit.org/show_bug.cgi?id=33756
+ [GTK] Implement DumpRenderTreeSupportGtk (similarly to DumpRenderTreeSupportQt idea)
+ https://bugs.webkit.org/show_bug.cgi?id=48199
- * iExploder/htdocs/cssproperties.in: New CSS attributes
- * iExploder/htdocs/htmlattrs.in: New HTML attributes
- * iExploder/htdocs/htmltags.in: New HTML tags
+ Implements support to WebKitTabToLinksPreferenceKey through LayoutTestController::overridePreference.
+ The corresponding DumpRenderTreeSupportGtk method is called in the DRT context only.
-2010-01-15 Chris Jerdonek <chris.jerdonek@gmail.com>
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ (createWebView):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::overridePreference):
- Reviewed by David Kilzer.
+2010-10-26 Ariya Hidayat <ariya@sencha.com>
- Altered parseDiffHeader() to skip unrecognized lines and
- other minor clean-ups.
+ Unreviewed, change the order of my emails for bugzilla autocompletion.
- https://bugs.webkit.org/show_bug.cgi?id=33476
+ * Scripts/webkitpy/common/config/committers.py:
- * Scripts/VCSUtils.pm:
- - Changed parseDiffHeader() as follows:
- - Skips over unrecognized lines.
- - Addressed FIXME to remove substitution for "diff" line.
- - Renamed "version" header hash key to "sourceRevision".
- - Eliminated "copiedFromVersion" header hash key.
- - Included "sourceRevision" also for copied files.
- - Checks that copy revision number matches "sourceRevision".
- - No longer returns $foundHeaderEnding.
- - Dies if header ending not found.
- - Diff header dividing line now always added.
-
- * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
- - Made necessary changes in parseDiffHeader() unit tests.
- - Shortened the file paths in some test cases.
-
-2010-01-14 Yuzo Fujishima <yuzo@google.com>
+2010-10-26 Eric Seidel <eric@webkit.org>
- Reviewed by Alexey Proskuryakov.
+ Reviewed by David Kilzer.
- Update pywebsocket to 0.4.6
- https://bugs.webkit.org/show_bug.cgi?id=32299
- The newer pywebsocket can handle more simultaneous connections.
+ build-webkit should collect Visual Studio Express logs and display them
+ https://bugs.webkit.org/show_bug.cgi?id=39199
- * pywebsocket/mod_pywebsocket/handshake.py:
- * pywebsocket/mod_pywebsocket/standalone.py:
- * pywebsocket/setup.py:
- * pywebsocket/test/test_handshake.py:
+ * Scripts/build-webkit:
+ * Scripts/print-vse-failure-logs: Added.
+ * Scripts/webkitdirs.pm:
-2010-01-14 Eric Seidel <eric@webkit.org>
+2010-10-26 David Kilzer <ddkilzer@apple.com>
- Reviewed by Adam Barth.
+ <http://webkit.org/b/48224> build-webkit: add support for --meter-tag switch
- REGRESSION(53133): commit-queue no longer rejects patches with invalid committers, instead it hangs
- https://bugs.webkit.org/show_bug.cgi?id=33638
-
- * Scripts/webkitpy/bugzilla.py:
- - Add Bug.id() to match Attachment.id()
- - Give Bug.reviewed_patches and commit_queued_patches the option to return patches with invalid committers/reviewers.
- - Add back a missing variable to _validate_setter_email found by the new unit tests!
- * Scripts/webkitpy/commands/queries.py:
- - Add FIXMEs about the commands being confusingly named.
- * Scripts/webkitpy/commands/queries_unittest.py:
- - Update results to reflect the newly restructured mock bug cache.
- * Scripts/webkitpy/commands/queues.py:
- - Add a new _validate_patches_in_commit_queue method (this is what fixes the regression).
- - Add a FIXME about eventually sorting the patches into some order.
- * Scripts/webkitpy/commands/queues_unittest.py:
- - Update results now that with the newly restructure mock bug cache we're testing cq+'d patches with an invalid committer.
- * Scripts/webkitpy/commands/upload_unittest.py:
- - Update results to match the newly restructured mock bug cache.
- * Scripts/webkitpy/mock_bugzillatool.py:
- - Restructure fetch_ methods to not use a manual list of ids, but rather use Bug and Attachment classes to make real queries from all of the Bugs.
- - Add a few more attachments and bug dictionaries for use by the tests.
-
-2010-01-13 Diego Gonzalez <diego.gonzalez@openbossa.org>
+ Reviewed by Csaba Osztrogonác.
- Reviewed by Kenneth Christiansen.
+ * Scripts/build-webkit: Added support for --meter-tag switch.
+ It should have been added with r60820.
- [Qt] DRT missing setUserStyleSheetLocation and setUserStyleSheetEnabled in LayoutTestController
- https://bugs.webkit.org/show_bug.cgi?id=33617
+2010-10-26 Ademar de Souza Reis Jr. <ademar.reis@openbossa.org>
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::WebPage::resetSettings):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setUserStyleSheetLocation):
- (LayoutTestController::setUserStyleSheetEnabled):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ Reviewed by Dumitru Daniliuc.
-2010-01-14 Adam Roben <aroben@apple.com>
+ check-webkit-style fails on operator+=, operator-=, ... methods
+ https://bugs.webkit.org/show_bug.cgi?id=48258
- Add LayoutTestController API to force
- -webView:resource:willSendRequest:: to return null
+ * Scripts/webkitpy/style/checkers/cpp.py: Added exceptions
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Added unit-tests
- Enables tests for <rdar://problem/7533333> <http://webkit.org/b/33533>
- window.onload never fires if page contains an <iframe> with a bad
- scheme or whose load is cancelled by returning null from resource load
- delegate's willSendRequest
+2010-10-26 Ojan Vafai <ojan@chromium.org>
- Reviewed by Brady Eidson.
+ Reviewed by Tony Chang.
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::LayoutTestController): Initialize new member.
- (setWillSendRequestReturnsNullCallback): Call through to
- LayoutTestController.
- (LayoutTestController::staticFunctions): Added new function.
+ remove DEFER support from new-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=48387
- * DumpRenderTree/LayoutTestController.h: Added
- m_willSendRequestReturnsNull.
- (LayoutTestController::willSendRequestReturnsNull):
- (LayoutTestController::setWillSendRequestReturnsNull):
- Added standard accessors.
+ DEFER was needed when we were trying to ship Chrome beta.
+ Now it's just extra complication.
- * DumpRenderTree/mac/ResourceLoadDelegate.mm:
- (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
- * DumpRenderTree/win/ResourceLoadDelegate.cpp:
- (ResourceLoadDelegate::willSendRequest):
- Return null if LayoutTestController says to.
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
-2010-01-14 Kevin Ollivier <kevino@theolliviers.com>
+2010-10-26 Eric Seidel <eric@webkit.org>
- [wx] Build fix after removal of XBM support.
+ Unreviewed. Adding import with_statement to fix python 2.5.
- * wx/build/settings.py:
+ Teach webkit-patch how to read credentials from the environment
+ https://bugs.webkit.org/show_bug.cgi?id=48275
-2010-01-14 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
+ - import with_statement to fix python 2.5.
- Reviewed by Simon Hausmann.
+2010-10-26 Alexey Proskuryakov <ap@apple.com>
- Add support for partial building on Symbian.
+ Reviewed by Sam Weinig.
- The build happens in the source directory as out of source builds are
- not supported by qmake for Symbian.
+ https://bugs.webkit.org/show_bug.cgi?id=48375
+ <rdar://problem/8392724> Need delegate calls in PageLoaderClient to indicate if we have
+ loaded insecure content
- Also the actual build isn't started but it is left to the developer
- to choose the architecture/configuration.
+ Updated for WebKit2 changes.
- * Scripts/webkitdirs.pm:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (didDisplayInsecureContentForFrame):
+ (didRunInsecureContentForFrame):
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::didDisplayInsecureContentForFrame):
+ (WTR::InjectedBundlePage::didRunInsecureContentForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
-2010-01-14 Simon Hausmann <simon.hausmann@nokia.com>
+2010-10-26 Adam Roben <aroben@apple.com>
- Reviewed by Kenneth Rohde Christiansen.
+ Clear up confusion between "3D rendering" and "accelerated compositing"
- Add support for "detecting" Symbian environments by either
- looking for the EPOCROOT environment variable or via --symbian
- being passed on the commandline.
+ WebKit has no software-based 3D rendering implementation, so 3D
+ rendering can only be enabled when accelerated compositing is. But DRT
+ was falsely reporting that 3D rendering was available on machines that
+ don't support accelerated compositing, leading to much confusion.
- * Scripts/webkitdirs.pm:
+ Reviewed by Darin Adler.
-2010-01-14 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+ Fixes <http://webkit.org/b/48370> REGRESSION (r70540): Many
+ transforms/3d tests are failing on the XP bots
- Unreviewed.
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main): When ENABLE(3D_RENDERING) is turned on, only report that 3D
+ rendering is available when acclerated compositing is also available.
- [Qt] Use a different Makefile names for sources generation and compilation.
- This prevents Makefile overwriting when running build-webkit twice.
+ * Scripts/old-run-webkit-tests: Skip tests that use the
+ -webkit-transform-3d media query when 3D rendering is disabled,
+ rather than when accelerated compositing is disabled.
- * Scripts/webkitdirs.pm:
+2010-10-26 Eric Seidel <eric@webkit.org>
-2010-01-14 Andreas Kling <andreas.kling@nokia.com>
+ Reviewed by Ojan Vafai.
- Reviewed by Kenneth Rohde Christiansen.
+ Remove rietveld code now that it's unused
+ https://bugs.webkit.org/show_bug.cgi?id=48359
- [Qt] Add an "alien_QLabel" classId for manual testing of alien widgets.
+ Was cool that we added this support, but now that it's
+ not used it makes little sense to keep it around.
+ We can always restore this code from SVN if we need it.
- https://bugs.webkit.org/show_bug.cgi?id=33373
+ * Scripts/webkitpy/common/config/__init__.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/common/net/rietveld.py: Removed.
+ * Scripts/webkitpy/common/net/rietveld_unittest.py: Removed.
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/__init__.py:
+ * Scripts/webkitpy/tool/steps/postcodereview.py: Removed.
- * QtLauncher/main.cpp:
- (WebPage::createPlugin):
+2010-10-26 Anders Carlsson <andersca@apple.com>
-2010-01-14 Eric Seidel <eric@webkit.org>
+ Reviewed by Sam Weinig.
- No review, rolling out r53249.
- http://trac.webkit.org/changeset/53249
- https://bugs.webkit.org/show_bug.cgi?id=33617
+ pageDidScroll callback should be on the UI process client rather than (or in addition to) the web process client
+ https://bugs.webkit.org/show_bug.cgi?id=48366
+ <rdar://problem/8595202>
- This caused http/tests/security/local-user-CSS-from-
- remote.html to fail on the Qt Release Build Bot.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::WebPage::resetSettings):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::overridePreference):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+2010-10-26 Eric Seidel <eric@webkit.org>
-2010-01-14 Chris Jerdonek <chris.jerdonek@gmail.com>
+ Reviewed by Tony Chang.
- Reviewed by Shinichiro Hamaji.
+ Teach webkit-patch how to read credentials from the environment
+ https://bugs.webkit.org/show_bug.cgi?id=48275
- Moved error() from cpp_style.py to checker.py.
+ This makes it possible for svn users to have their bugzilla credentials
+ stored in their environment instead of typing them every time.
- https://bugs.webkit.org/show_bug.cgi?id=33620
+ We need this for making it easy to run the win-ews bot (which currently
+ uses svn instead of git).
- * Scripts/check-webkit-style:
- - Addressed FIXME to not set global state.
+ * Scripts/webkitpy/common/net/credentials.py:
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
- * Scripts/webkitpy/style/checker.py:
- - Added argument validation to ProcessorOptions constructor.
- - Added should_report_error() to ProcessorOptions class.
- - Removed set_options().
- - Added StyleChecker class.
+2010-10-26 Kenichi Ishibashi <bashi@google.com>
- * Scripts/webkitpy/style/checker_unittest.py:
- - Added unit test class for ProcessorOptions class.
- - Added unit test to check that parse() strips white space.
+ Reviewed by Kent Tamura.
- * Scripts/webkitpy/style/cpp_style.py:
- - Removed "filter" and "output_format" methods.
- - Removed should_print_error() and error() functions.
- - Removed default parameter value from process_file().
+ Input Method inserts conversion candidates unexpectedly
+ https://bugs.webkit.org/show_bug.cgi?id=46868
- * Scripts/webkitpy/style/cpp_style_unittest.py:
- - Removed call to cpp_style._should_print_error().
- - Removed test_filter() and test_filter_appending().
+ Adds setComposition() to TextInputController to make DRT emulate
+ an input method behavior.
- * Scripts/webkitpy/style/text_style.py:
- - Removed default parameter value from process_file().
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::TextInputController):
+ (TextInputController::setComposition): Added.
+ * DumpRenderTree/chromium/TextInputController.h:
-2010-01-14 Diego Gonzalez <diego.gonzalez@openbossa.org>
+2010-10-26 Simon Fraser <simon.fraser@apple.com>
- Reviewed by Kenneth Rohde Christiansen.
+ Reviewed by Sam Weinig.
- [Qt] DRT missing setUserStyleSheetLocation and setUserStyleSheetEnabled in LayoutTestController
- https://bugs.webkit.org/show_bug.cgi?id=33617
+ Support layoutTestController.layerTreeAsText in WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=42145
+
+ Implement layerTreeAsText() in WebKitTestRunner.
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::WebPage::resetSettings):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setUserStyleSheetLocation):
- (LayoutTestController::setUserStyleSheetEnabled):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::layerTreeAsText):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
-2010-01-13 Adam Barth <abarth@webkit.org>
+2010-10-26 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- Fix CloseBugForLandDiff unittest to actually run
- https://bugs.webkit.org/show_bug.cgi?id=33640
+ webkit-patch rollout produces incorrect patch when using svn move
+ https://bugs.webkit.org/show_bug.cgi?id=48244
- * Scripts/webkitpy/mock_bugzillatool.py:
- * Scripts/webkitpy/steps/closebugforlanddiff_unittest.py:
+ We need to flush our caches when we modify the working copy.
-2010-01-12 Jon Honeycutt <jhoneycutt@apple.com>
+ * Scripts/webkitpy/tool/steps/revertrevision.py:
- MSAA: selected, selectable, extended selectable, and multiple
- selectable states are not reported
+2010-10-26 Eric Seidel <eric@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=33574
- <rdar://problem/7536826>
+ Reviewed by Adam Barth.
- Reviewed by Darin Adler.
+ commit-queue flaky test message can list the same author more than once
+ https://bugs.webkit.org/show_bug.cgi?id=48268
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getIsSelectableCallback):
- Return the result of calling isSelectable().
- (getIsMultiSelectableCallback):
- Return the result of calling isMultiSelectable().
- (AccessibilityUIElement::getJSClass):
- Add isSelected and isMultiSelectable properties to the JSClass
- definition.
+ tonikitoo reported to me over IRC this morning that he's seen
+ the commit-queue report flaky tests with author lists like:
+ "adam, adam and adam", suggesting we're not uniquing authors
+ before writing the message.
- * DumpRenderTree/AccessibilityUIElement.h:
- Declare isSelectable() and isMultiSelectable().
+ I fixed the uniquing and added a bunch more unit testing.
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::isSelectable):
- Stubbed.
- (AccessibilityUIElement::isMultiSelectable):
- Stubbed.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::isSelectable):
- Stubbed.
- (AccessibilityUIElement::isMultiSelectable):
- Stubbed.
+2010-10-26 Adam Roben <aroben@apple.com>
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (accessibilityState):
- Get the object's state, and return it.
- (AccessibilityUIElement::isSelected):
- Check the object's selected state.
- (AccessibilityUIElement::isSelectable):
- Check the object's selectable state.
- (AccessibilityUIElement::isMultiSelectable):
- Check the object's extended/multiple selectable state.
+ Pull in the FeatureDefines*.vsprops files when building DRT
-2010-01-13 Adam Barth <abarth@webkit.org>
+ This ensures that various ENABLE() macros will get set correctly.
+ (Prior to r70320 we were picking up the ENABLE(3D_RENDERING) flag
+ through wtf/Platform.h.)
- Unreviewed. Repeat the below for CloseBugForLandDiff.
+ Fixes <http://webkit.org/b/48343> REGRESSION (r70320): DumpRenderTree
+ says 3D_RENDERING is disabled even when it is enabled
- * Scripts/test-webkitpy:
- * Scripts/webkitpy/steps/closebugforlanddiff.py:
- * Scripts/webkitpy/steps/closebugforlanddiff_unittest.py: Added.
+ Reviewed by Ada Chan.
-2010-01-13 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Added
+ FeaturesDefines*.vsprops to all configurations.
- Unreviewed. Turn the mac-ews status bubbles back on now that this bot
- is running again.
+ * DumpRenderTree/win/DumpRenderTreeWin.h: Touched to force a rebuild.
- * QueueStatusServer/templates/statusbubble.html:
+2010-10-26 Søren Gjesse <sgjesse@chromium.org>
-2010-01-13 Adam Barth <abarth@webkit.org>
+ Reviewed by Dimitri Glazkov.
- Reviewed by Darin Adler.
+ Added options --multiple-loads and --js-flags to chromium DumpRenderTree. The option --multiple-loads=X
+ is used to have DumpRenderTree load each test it runs X times. To be able to have more fine-grained control
+ of how the JavaScript engine behaves for each load the flag --js-flags can specify a list of flag-sets like this
- REGRESSION(53133): webkit-patch land dies if it can't find a bug id.
- https://bugs.webkit.org/show_bug.cgi?id=33634
+ --js-flags="--xxx,--noxxx --yyy,--noyyy"
- Deal with the case of no bug patch object in the state.
+ First load will run with --xxx, the second with --yyy and the third without any (the 'no' prefix is handled by
+ V8 to turn off the flag).
- * Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py:
- * Scripts/webkitpy/steps/updatechangelogswithreviewer.py:
+ The changes to the Python test runner will be in a separate change.
-2010-01-13 Kenneth Russell <kbr@google.com>
- Unreviewed; added myself to the committers list.
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (runTest):
+ (main):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ (TestShell::runFileTest):
+ (TestShell::testFinished):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::loadCount):
+ (TestShell::setLoadCount):
+ (TestShell::javaScriptFlagsForLoad):
+ (TestShell::setJavaScriptFlags):
+ (TestShell::setDumpWhenFinished):
- * Scripts/webkitpy/committers.py:
+2010-10-26 Adam Roben <aroben@apple.com>
-2010-01-13 Darin Adler <darin@apple.com>
+ Skip more tests that depend on accelerated compositing when accelerated
+ compositing is disabled
- Ignore compiled Python in more of webkitpy.
+ Fixes <http://webkit.org/b/48329> Some tests fail when accelerated
+ compositing is disabled
- * Scripts/webkitpy/commands: Added property svn:ignore.
- * Scripts/webkitpy/steps: Added property svn:ignore.
- * Scripts/webkitpy/style: Added property svn:ignore.
+ Reviewed by John Sullivan.
-2010-01-13 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+ * Scripts/old-run-webkit-tests: Added more tests to skip when
+ accelerated compositing is disable. The tests all have output that
+ changes depending on whether accelerated compositing is enabled.
- Reviewed by Simon Hausmann.
+2010-10-25 Eric Seidel <eric@webkit.org>
- [Qt] Fix build problem related to the pushd command
+ Reviewed by Adam Barth.
- * Scripts/webkitdirs.pm:
+ webkit-patch should clean up svn locks when passed --force-clean
+ https://bugs.webkit.org/show_bug.cgi?id=48269
-2010-01-13 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+ * Scripts/webkitpy/common/checkout/scm.py:
- Reviewed by Simon Hausmann.
+2010-10-25 Anders Carlsson <andersca@apple.com>
- [Qt] Split the build process in two different .pro files.
- This allows qmake to be run once all source files are available.
+ Reviewed by Adam Roben.
- * Scripts/webkitdirs.pm: Add calls to make DerivedSources.pro in JSC and WC.
+ Add a pageDidScroll BundleUIClient callback
+ https://bugs.webkit.org/show_bug.cgi?id=48260
+ <rdar://problem/8531159>
-2010-01-13 Shinichiro Hamaji <hamaji@chromium.org>
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
- Unreviewed tiny typo fix in docstrings.
+2010-10-25 Johnny Ding <jnd@chromium.org>
- * Scripts/webkitpy/style/checker_unittest.py:
+ Reviewed by Tony Chang.
-2010-01-13 Chris Jerdonek <chris.jerdonek@gmail.com>
+ Dump the gesture status of frame in frame load callbacks in DumpRenderTree
+ by adding a new method dumpUserGestureInFrameLoadCallbacks.
+ Now only dump the gesture status in "DidStartProvisionalLoad" callback.
+ https://bugs.webkit.org/show_bug.cgi?id=47849
- Reviewed by Shinichiro Hamaji.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (dumpUserGestureInFrameLoadCallbacksCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
+ (LayoutTestController::setDumpUserGestureInFrameLoadCallbacks):
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
+ (LayoutTestController::reset):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController::shouldDumpUserGestureInFrameLoadCallbacks):
+ (LayoutTestController::setShouldDumpUserGestureInFrameLoadCallbacks):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::shouldDumpUserGestureInFrameLoadCallbacks):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didStartProvisionalLoad):
+ (WebViewHost::printFrameUserGestureStatus):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ (-[WebFrame _drt_printFrameUserGestureStatus]):
+ (-[FrameLoadDelegate webView:didStartProvisionalLoadForFrame:]):
+ (-[FrameLoadDelegate webView:didCommitLoadForFrame:]):
+ (-[FrameLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]):
+ (-[FrameLoadDelegate webView:didFinishLoadForFrame:]):
+ (-[FrameLoadDelegate webView:didFailLoadWithError:forFrame:]):
+ (-[FrameLoadDelegate webView:windowScriptObjectAvailable:]):
+ (-[FrameLoadDelegate webView:didReceiveTitle:forFrame:]):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::dumpUserGestureInFrameLoadCallbacks):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
- Created a CategoryFilter class to encapsulate the logic of
- filter rules.
+2010-10-25 Sheriff Bot <webkit.review.bot@gmail.com>
- https://bugs.webkit.org/show_bug.cgi?id=33454
+ Unreviewed, rolling out r70442.
+ http://trac.webkit.org/changeset/70442
+ https://bugs.webkit.org/show_bug.cgi?id=48248
- * Scripts/webkitpy/style/checker.py:
- - Added CategoryFilter class.
+ http locking doesn't work on Windows (Requested by Ossy on
+ #webkit).
- * Scripts/webkitpy/style/checker_unittest.py:
- - Added CategoryFilter unit tests.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * Scripts/webkitpy/style/cpp_style.py:
- - Updated filter methods to use CategoryFilter.
+2010-10-25 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- * Scripts/webkitpy/style/cpp_style_unittest.py:
- - Updated references to filters.
+ Reviewed by Ojan Vafai.
-2010-01-12 Shinichiro Hamaji <hamaji@chromium.org>
+ Make http locking default in NRWT.
+ https://bugs.webkit.org/show_bug.cgi?id=48053
- Unreviewed. Now I can review :)
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * Scripts/webkitpy/committers.py:
+2010-10-25 David Kilzer <ddkilzer@apple.com>
-2010-01-12 Brent Fulgham <bfulgham@webkit.org>
+ <http://webkit.org/b/48185> build-webkit: add support for --progress-tag switch
+ (Re-landing r70413 after Qt minimal buildfix: r70440.)
- Reviewed by Darin Adler.
+ Reviewed by Kenneth Rohde Christiansen.
- Extend WinLauncher example with better printing features.
-
- * WinLauncher/PrintWebUIDelegate.cpp:
- (PrintWebUIDelegate::webViewPrintingMarginRect): Provide slightly
- larger margins.
- (PrintWebUIDelegate::webViewHeaderHeight): Compute header height based
- on text metrics.
- (PrintWebUIDelegate::webViewFooterHeight): Compute footer height based
- on text metrics.
- (PrintWebUIDelegate::drawHeaderInRect): Write useful header, along
- with separating line.
- (PrintWebUIDelegate::drawFooterInRect):
- * WinLauncher/PrintWebUIDelegate.h: Remove stubs.
- * WinLauncher/WinLauncher.cpp:
- (PrintView): Correct loop used to print individual pages.
- Previously it started at 0, which is a wild-card to print all
- pages at once.
+ * Scripts/build-webkit: Added support for --progress-tag switch.
+ It should have been added with r57051.
-2010-01-12 Alexey Proskuryakov <ap@apple.com>
+2010-10-24 Adam Barth <abarth@webkit.org>
- Reviewed by Darin Adler.
+ Reviewed by David Kilzer.
- https://bugs.webkit.org/show_bug.cgi?id=33540
- Make it possible to build in debug mode with assertions disabled
+ webkit-patch upload fails when the patch removes a file
+ https://bugs.webkit.org/show_bug.cgi?id=48187
- * DumpRenderTree/mac/ObjCController.m: (-[ObjCController accessStoredWebScriptObject]):
+ We need to use "--" to separate file names from the rest of the
+ command.
-2010-01-11 Darin Fisher <darin@chromium.org>
+ * Scripts/webkitpy/common/checkout/scm.py:
- Reviewed by Dimitri Glazkov.
+2010-10-24 Sheriff Bot <webkit.review.bot@gmail.com>
- [Chromium] "build-webkit --chromium" should run "make all" on Linux
- https://bugs.webkit.org/show_bug.cgi?id=33500
+ Unreviewed, rolling out r70413.
+ http://trac.webkit.org/changeset/70413
+ https://bugs.webkit.org/show_bug.cgi?id=48210
- * Scripts/webkitdirs.pm:
+ It broke Qt minimal build (Requested by Ossy on #webkit).
-2010-01-12 Eric Seidel <eric@webkit.org>
+ * Scripts/build-webkit:
- Reviewed by Adam Barth.
+2010-10-24 Yi Shen <yi.4.shen@nokia.com>
- AssignToCommitter does not need to fetch bugs twice
- https://bugs.webkit.org/show_bug.cgi?id=33530
+ Reviewed by Andreas Kling.
- This is a no-brainer patch now that we've added Bug.reviewed_patches
+ [Qt][QtTestBrowser] Toggle use of QGraphicsView messes up the menu
+ https://bugs.webkit.org/show_bug.cgi?id=48141
- * Scripts/webkitpy/commands/upload.py:
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::init):
+ (LauncherWindow::initializeView):
+ (LauncherWindow::toggleWebView):
-2010-01-12 Eric Seidel <eric@webkit.org>
+2010-10-24 Daniel Bates <dbates@rim.com>
- Reviewed by Adam Barth.
+ Reviewed by David Kilzer.
- bugzilla.py should have an Attachment object instead of passing around dictionaries
- https://bugs.webkit.org/show_bug.cgi?id=31594
-
- * Scripts/webkitpy/bugzilla.py:
- - Add a new Attachment class, with accessor methods for all the necessary properties.
- - Update Bug to carry a pointer back to bugzilla (attachments need to access Bugzilla for committer validation and url())
- - Move reviewed_patches and commit_queued_patches out of Bugzilla custom methods and onto Bug
- - Move committer validation logic into its own class.
- - Committer rejection is only used in one place. Make the new Bug reviewed_patches and commit_queued_patches
- handle the common case (of returning "reviewer" or "committer" as None), and let CommitterValidation handle
- the case where we want to reject patches in bugzilla.
- - Simplify fetch_patches_from_commit_queue now that committer validation is simpler.
- - Make all self.bugzilla.fetch_bug access go through BugzillaQueries._fetch_bug.
- - Mark set_flag_on_attachment as non-private to denote that CommitterValidation depends on it.
- - Move fetch_reviewed_patches_from_bug and fetch_commit_queue_patches_from_bug logic onto the Bug class.
- * Scripts/webkitpy/bugzilla_unittest.py:
- - Move test_flag_permission_rejection_message into a new CommitterValidationTest class.
- * Scripts/webkitpy/commands/download.py:
- - Store "bug_id" in state instead of making a fake patch object.
- - Update to use Attachment and Bug objects.
- * Scripts/webkitpy/commands/download_unittest.py:
- - Update expected results now that our testing framework covers more code.
- * Scripts/webkitpy/commands/early_warning_system.py: Update to use new Attachment class.
- * Scripts/webkitpy/commands/queries.py: Remove unused ReviewedPatches class.
- * Scripts/webkitpy/commands/queries_unittest.py: ditto.
- * Scripts/webkitpy/commands/queues.py: Update to use new Attachment and CommitterValidator classes.
- * Scripts/webkitpy/commands/queuestest.py: ditto.
- * Scripts/webkitpy/commands/upload.py: ditto.
- * Scripts/webkitpy/mock_bugzillatool.py:
- - Now that more logic has moved into Attachment and Bug, we have to actually
- provide real reviewer emails as well as real reviewer flags.
- - Update mock methods to return Attachment objects.
- * Scripts/webkitpy/scm.py: Update to use Attachment class.
- * Scripts/webkitpy/scm_unittest.py: Update to use Attachment class.
- * Scripts/webkitpy/statusserver.py: ditto.
- * Scripts/webkitpy/steps/applypatch.py: ditto.
- * Scripts/webkitpy/steps/applypatchwithlocalcommit.py: ditto.
- * Scripts/webkitpy/steps/closebug.py: ditto.
- * Scripts/webkitpy/steps/closebugforlanddiff.py: Handle either state["bug_id"] or state["patch"].bug_id()
- * Scripts/webkitpy/steps/closepatch.py: Update to use Attachment class.
- * Scripts/webkitpy/steps/obsoletepatches.py: ditto.
- * Scripts/webkitpy/steps/updatechangelogswithreviewer.py: ditto.
-
-2010-01-12 Adam Barth <abarth@webkit.org>
-
- Unreviewed typo fix. :(
-
- * Scripts/webkitpy/commands/early_warning_system.py:
- * Scripts/webkitpy/commands/queues.py:
-
-2010-01-12 Adam Barth <abarth@webkit.org>
-
- Unreviewed. Add "error" to the right part of the message.
-
- * Scripts/webkitpy/commands/queues.py:
-
-2010-01-12 Adam Barth <abarth@webkit.org>
+ Fix Perl uninitialized warnings in VCSUtils::svnStatus()
+ and VCSUtils::removeEOL().
+ https://bugs.webkit.org/show_bug.cgi?id=48196
- Reviewed by Eric Seidel.
+ VCSUtils::svnStatus() concatenates the output of svn status with
+ a new line character and svn status may return no output (say for
+ a file that has not been added, deleted, or modified). We should
+ only concatenate the output of svn status if there is some.
- EWS should show purple when svn-apply fails
- https://bugs.webkit.org/show_bug.cgi?id=33527
+ Also, VCSUtils::removeEOL() should ensure that its argument
+ is initialized before performing a string substitution.
- * Scripts/webkitpy/commands/early_warning_system.py:
- * Scripts/webkitpy/commands/queues.py:
+ * Scripts/VCSUtils.pm:
+ - Modified removeEOL() to return "" if its argument is undefined.
+ - Exported removeEOL() so that it can be tested.
+ * Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl: Added.
-2010-01-12 Adam Barth <abarth@webkit.org>
+2010-10-24 David Kilzer <ddkilzer@apple.com>
- Reviewed by Eric Seidel.
+ <http://webkit.org/b/48185> build-webkit: add support for --progress-tag switch
- Remove copy/paste code from subclasses of AbstractReviewQueue
- https://bugs.webkit.org/show_bug.cgi?id=33525
+ Reviewed by Kenneth Rohde Christiansen.
- * Scripts/webkitpy/commands/early_warning_system.py:
- * Scripts/webkitpy/commands/queues.py:
+ * Scripts/build-webkit: Added support for --progress-tag switch.
+ It should have been added with r57051.
-2010-01-12 Adam Barth <abarth@webkit.org>
+2010-10-24 David Kilzer <ddkilzer@apple.com>
- Reviewed by Eric Seidel.
+ <http://webkit.org/b/48184> build-webkit: reformat support variables for better maintainability
- Add Gustavo and Xan as gtk-ews watchers
- https://bugs.webkit.org/show_bug.cgi?id=33519
+ Reviewed by Daniel Bates.
- * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/build-webkit: Alphabetized the @features array based
+ on the name of the feature. Reformatted the list of support
+ variables so that they match the order of @features, and so that
+ each has its own line. This makes it easy to add new variables
+ in the correct order.
-2010-01-12 Adam Barth <abarth@webkit.org>
+2010-10-23 Eric Seidel <eric@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Adam Barth.
- webkit-patch shouldn't waste my time for with a component prompt
- https://bugs.webkit.org/show_bug.cgi?id=33521
+ EWS never removes invalid patch ids
+ https://bugs.webkit.org/show_bug.cgi?id=48173
- The component field isn't very useful for bugs created with
- webkit-patch because they're likely to be resolved quickly. Instead of
- always prompting for a component, we should just default to the "New
- Bugs" component. If the bug stays around for more than five minutes,
- we can assign it a proper component.
+ This is just sticking another finger in the dam.
+ However this adds more unit testing which will help
+ us make sure we're always releasing patches once we
+ redesign the release_patch API and call these from
+ a more central place.
- * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Added the ability to request invalid patches.
+ Log a warning message to make sure we don't ever have
+ tests use invalid patch fetches by mistake.
-2010-01-12 Adam Barth <abarth@webkit.org>
+2010-10-23 Dan Bernstein <mitz@apple.com>
- Reviewed by Eric Seidel.
+ Build fix. Add stub implementations for required NSDraggingInfo methods.
- Add experimental "land-safely" command to webkit-patch
- https://bugs.webkit.org/show_bug.cgi?id=33518
+ * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
+ (-[DumpRenderTreeDraggingInfo draggingFormation]):
+ (-[DumpRenderTreeDraggingInfo setDraggingFormation:]):
+ (-[DumpRenderTreeDraggingInfo animatesToDestination]):
+ (-[DumpRenderTreeDraggingInfo setAnimatesToDestination:]):
+ (-[DumpRenderTreeDraggingInfo numberOfValidItemsForDrop]):
+ (-[DumpRenderTreeDraggingInfo setNumberOfValidItemsForDrop:]):
+ (-[DumpRenderTreeDraggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/commands/upload_unittest.py:
- * Scripts/webkitpy/steps/__init__.py:
- * Scripts/webkitpy/steps/postdiffforcommit.py: Added.
+2010-10-23 David Kilzer <ddkilzer@apple.com>
-2010-01-11 Kevin Ollivier <kevino@theolliviers.com>
+ <http://webkit.org/b/48186> Remove unneeded WebHTMLRepresentationInternal.h header
- [wx] Build fix after introduction of JS_NO_EXPORT
-
- * wx/build/settings.py:
+ Reviewed by Sam Weinig.
-2010-01-11 Eric Seidel <eric@webkit.org>
+ The only method defined in WebHTMLRepresentationInternal.h is
+ also defined in WebHTMLRepresentation.h, so use that instead.
- No review, rolling out r53079.
- http://trac.webkit.org/changeset/53079
- https://bugs.webkit.org/show_bug.cgi?id=33197
+ * DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h: Removed.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.mm: Switched to use
+ WebHTMLRepresentation.h.
- Adam doens't think this actually works, and believe it caused
- a regression https://bugs.webkit.org/show_bug.cgi?id=33488 so
- rolling this out.
+2010-10-23 Sheriff Bot <webkit.review.bot@gmail.com>
- * Scripts/test-webkitpy:
- * Scripts/webkitpy/commands/abstractdiffcommand.py: Removed.
- * Scripts/webkitpy/commands/abstractdiffcommand_unittest.py: Removed.
- * Scripts/webkitpy/commands/download.py:
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/mock_bugzillatool.py:
+ Unreviewed, rolling out r70367.
+ http://trac.webkit.org/changeset/70367
+ https://bugs.webkit.org/show_bug.cgi?id=48176
-2010-01-10 Adam Barth <abarth@webkit.org>
+ It made 8-10 tests crash on Qt bot (Requested by Ossy on
+ #webkit).
- Reviewed by David Kilzer.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setCustomPolicyDelegateCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setCustomPolicyDelegate):
+ * DumpRenderTree/mac/PolicyDelegate.h:
+ * DumpRenderTree/mac/PolicyDelegate.mm:
+ (-[PolicyDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:]):
+ (-[PolicyDelegate setPermissive:]):
+ (-[PolicyDelegate setControllerToNotifyDone:]):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
- bugzilla-tool submit-patch mistakenly picks up bug URLs in non-ChangeLog files
- https://bugs.webkit.org/show_bug.cgi?id=33197
+2010-10-22 Eric Seidel <eric@webkit.org>
- We should just search for bug numbers in the ChangeLogs instead of in
- the whole diff.
-
- * Scripts/test-webkitpy:
- * Scripts/webkitpy/commands/abstractdiffcommand.py: Added.
- * Scripts/webkitpy/commands/abstractdiffcommand_unittest.py: Added.
- * Scripts/webkitpy/commands/download.py:
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/mock_bugzillatool.py:
+ Reviewed by Adam Barth.
-2010-01-11 Chris Jerdonek <chris.jerdonek@gmail.com>
+ EWS never releases patches which fail to apply
+ https://bugs.webkit.org/show_bug.cgi?id=48171
- Reviewed by David Kilzer.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
- Created a unit-tested function to parse the header block of
- a Git or SVN diff -- for future refactoring of svn-apply and
- svn-unapply.
+2010-10-22 Eric Seidel <eric@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=33447
+ Unreviewed.
- * Scripts/VCSUtils.pm:
- - Added parseDiffHeader().
- - Removed irrelevant comment from gitdiff2svndiff().
+ Make the EWS queues restart themselves more often.
+ This matches the commit-queue.
- * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl: Added.
- - Added 48 unit tests for parseDiffHeader().
+ * EWSTools/start-queue.sh:
-2010-01-10 Adam Barth <abarth@webkit.org>
+2010-10-22 Eric Seidel <eric@webkit.org>
- Rubber stamped by David Kilzer.
+ Reviewed by Adam Barth.
- bugzilla-tool submit-patch mistakenly picks up bug URLs in non-ChangeLog files
- https://bugs.webkit.org/show_bug.cgi?id=33197
+ commit-queue should not pass --quiet to subcommands now that the parent command does the reporting
+ https://bugs.webkit.org/show_bug.cgi?id=48165
- Fix a typo: Commmand -> Command.
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- * Scripts/webkitpy/commands/abstractsequencedcommand.py:
- * Scripts/webkitpy/commands/download.py:
- * Scripts/webkitpy/commands/queries.py:
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/multicommandtool.py:
+2010-10-22 Mario Sanchez Prada <msanchez@igalia.com>
-2010-01-10 Adam Barth <abarth@webkit.org>
+ Adding myself as a committer.
- Reviewed by Darin Adler.
+ * Scripts/webkitpy/common/config/committers.py:
- Let webkit-patch work with options in $EDITOR
- https://bugs.webkit.org/show_bug.cgi?id=33414
+2010-10-20 Anders Carlsson <andersca@apple.com>
- The $EDITOR evironment variable might have command line options like
- bbedit -w. This patch lets us run those $EDITORs.
+ Reviewed by Adam Barth and Darin Adler.
- * Scripts/webkitpy/user.py:
+ Using the decidePolicyForMIMEType delegate message in an asynchronous manner does not work
+ https://bugs.webkit.org/show_bug.cgi?id=48014
+ <rdar://problem/8202716>
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setCustomPolicyDelegateCallback):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
-2010-01-10 Robert Hogan <robert@roberthogan.net>
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
- Reviewed by Adam Barth.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setCustomPolicyDelegate):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
- [Qt] Add enableXSSAuditor support to QWebSettings and DRT.
+ * DumpRenderTree/mac/PolicyDelegate.h:
+ * DumpRenderTree/mac/PolicyDelegate.mm:
+ (-[PolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]):
+ If _callIgnoreInDecidePolicyForMIMETypeAfterOneSecond is true, call [listener ignore] after one second.
- https://bugs.webkit.org/show_bug.cgi?id=33419
+ (-[PolicyDelegate setCallIgnoreInDecidePolicyForMIMETypeAfterOneSecond:]):
+ Update _callIgnoreInDecidePolicyForMIMETypeAfterOneSecond.
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::WebPage::WebPage):
- (WebCore::WebPage::resetSettings):
- (WebCore::DumpRenderTree::createWindow):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setXSSAuditorEnabled):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ Add callIgnoreInDecidePolicyForMIMETypeAfterOneSecond argument.
-2010-01-10 Adam Barth <abarth@webkit.org>
+2010-10-22 Sam Weinig <sam@webkit.org>
- Unreviewed cosmetic change. Remove the status bubble for mac-ews
- because we don't have hardware for it at the moment.
+ Reviewed by Anders Carlsson.
- * QueueStatusServer/templates/statusbubble.html:
+ Rename the InjectedBundle for TestWebKitAPI to InjectedBundleTestWebKitAPI.bundle
-2010-01-09 Daniel Bates <dbates@webkit.org>
+ * TestWebKitAPI/Configurations/InjectedBundle.xcconfig:
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
+ (TestWebKitAPI::Util::createInjectedBundlePath):
- No review, rolling out r53044.
- http://trac.webkit.org/changeset/53044
- https://bugs.webkit.org/show_bug.cgi?id=33419
-
- We need to look into this some more because the Qt
- bot is failing the XSSAuditor tests. See bug #33419
- for more details.
+2010-10-22 Dirk Pranke <dpranke@chromium.org>
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::WebPage::WebPage):
- (WebCore::WebPage::resetSettings):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ Reviewed by Eric Seidel.
-2010-01-09 Daniel Bates <dbates@webkit.org>
+ test-webkitpy fails when passed -v (or any other option)
- Reviewed by Adam Barth.
+ Fix port/base_unittest to pass an explicit list of arguments
+ rather than accidentally picking up sys.argv.
- https://bugs.webkit.org/show_bug.cgi?id=33419
+ https://bugs.webkit.org/show_bug.cgi?id=48071
- Adds support for the XSSAuditor to the Qt DRT.
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::WebPage::WebPage):
- (WebCore::WebPage::resetSettings):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setXSSAuditorEnabled):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+2010-10-22 Brian Weinstein <bweinstein@apple.com>
-2010-01-09 Adam Barth <abarth@webkit.org>
+ Windows build fix. Update the createNewPage callback to account for the new
+ arguments.
- Reviewed by Eric Seidel.
+ * MiniBrowser/win/BrowserView.cpp:
+ (createNewPage):
- Retry writes to QueueStatusServer when we get 500 errors
- https://bugs.webkit.org/show_bug.cgi?id=33412
+2010-10-22 Sam Weinig <sam@webkit.org>
- This prevents the queues from failing to mark a patch as "pass" or
- "fail" when AppEngine throws 500 errors.
+ Reviewed by Anders Carlsson.
- * Scripts/test-webkitpy:
- * Scripts/webkitpy/networktransaction.py: Added.
- * Scripts/webkitpy/networktransaction_unittest.py: Added.
- * Scripts/webkitpy/statusserver.py:
- * Scripts/webkitpy/steps/closebugformarkbugfixed.py: Added.
- * Scripts/webkitpy/steps/closebugregardlessofpatches.py: Added.
- * Scripts/webkitpy/steps/findbugidfromsvnrevision.py: Added.
+ WebKit2 needs to pass the current event modifier flags when requesting a new window
+ https://bugs.webkit.org/show_bug.cgi?id=48140
-2010-01-09 David Kilzer <ddkilzer@apple.com>
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (createNewPage):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ Update for new signature for the WKPageCreateNewPageCallback.
- <http://webkit.org/b/33430> Fix rounded borders in queue status on older Firefox and Safari browsers
+2010-10-22 Eric Seidel <eric@webkit.org>
- Reviewed by Eric Seidel.
+ Unreviewed. Just adding a test case.
- * QueueStatusServer/templates/statusbubble.html: Added
- -moz-border-radius and -webkit-border-radius to provide rounded
- borders in older Firefox and Safari browsers.
+ The style-queue was not recognizing new patches. It turns
+ out I had fixed this in an earlier change, but just not
+ deployed to queues.webkit.org. As part of investigating why it
+ was broken, I wrote a test for my previous change which I'm now landing.
-2010-01-09 Chris Jerdonek <chris.jerdonek@gmail.com>
+ * QueueStatusServer/model/queues_unittest.py:
- Reviewed by David Kilzer.
+2010-10-22 Eric Seidel <eric@webkit.org>
- Modified VCSUtils::gitdiff2svndiff() to accept strings that
- end in vertical white space.
+ Reviewed by Adam Barth.
- https://bugs.webkit.org/show_bug.cgi?id=33415
+ EWS does not need to process obsolete patches
+ https://bugs.webkit.org/show_bug.cgi?id=48093
+
+ This was an easy change, but to test it I had to pipe
+ real Attachment objects into the queue testing system.
+ Doing so revealed a whole bunch of bugs in our unit tests,
+ which I fixed as part of this patch.
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ - This is the actual code change. This will not reduce the
+ backlog in the EWS queues much, but it will make rejections
+ much quicker for obsolete patches or closed bugs.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ - Test my new code.
+ - Used a real attachment object and got rid of MockPatch
+ - Shared code between the mac-ews and cr-mac-ews tests.
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ - Can't use MockPatch anymore.
+ - Removing MockPatch found more bugs here!
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ - MockBugzilla should not be a "Mock" object. Right now tool.bugs()
+ is allowed, but wrong. Making it not a Mock will make tool.bugs() correctly fail.
+
+2010-10-22 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r70301.
+ http://trac.webkit.org/changeset/70301
+ https://bugs.webkit.org/show_bug.cgi?id=48126
+
+ "Lang attribute layout tests failing" (Requested by satish on
+ #webkit).
- * Scripts/VCSUtils.pm:
- * Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl:
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
-2010-01-08 Eric Seidel <eric@webkit.org>
+2010-10-22 Leandro Gracia Gil <leandrogracia@google.com>
- Reviewed by Adam Barth.
+ Reviewed by Jeremy Orlow.
- run-javascriptcore-tests needs a --quiet flag
- https://bugs.webkit.org/show_bug.cgi?id=33399
+ Added a second parameter to setMockSpeechInputResult for
+ the language used in speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
- Until run-javascriptcore-tests has a --quiet flag, lets just stiffle the output in webkit-patch.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
- * Scripts/webkitpy/steps/runtests.py:
+2010-10-21 MORITA Hajime <morrita@google.com>
-2010-01-08 Andras Becsi <abecsi@inf.u-szeged.hu>
+ Reviewed by Kent Tamura.
- Reviewed by Alexey Proskuryakov.
+ [Win][DRT] should have LayoutTestController.hasSpellingMarker()
+ https://bugs.webkit.org/show_bug.cgi?id=47885
- Only run http and websocket tests as last if no argument is given to be able to explicitly control the test order.
+ - Implemented LayoutTestController.hasSpellingMarker(),
+ - Added fake spellcheck implementation.
- To be able to run multiple instances of run-webkit-tests besides each other on the same machine we need to minimize
- the time when Apache and WebSocketServer is locked by tests.
- Because closeHTTPD() and closeWebSocketServer() is only called at the end of the testing,
- we need to run http and websocket tests after all other tests.
- If one however explicitly specifies the tests to run in the argument list of run-webkit-tests
- we need to preserve the given order.
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+ * DumpRenderTree/win/EditingDelegate.cpp:
+ (indexOfFirstWordCharacter):
+ (wordLength):
+ (EditingDelegate::checkSpellingOfString):
+ * DumpRenderTree/win/EditingDelegate.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::hasSpellingMarker):
- * Scripts/run-webkit-tests:
+2010-10-21 Mihai Parparita <mihaip@chromium.org>
-2010-01-08 Adam Barth <abarth@webkit.org>
+ Unreviewed. Re-enable test that was mistakenly disabled by r67974.
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
- Don't post style-queue pass messages to bugs
- https://bugs.webkit.org/show_bug.cgi?id=33404
+2010-10-21 Mihai Parparita <mihaip@chromium.org>
- These messages aren't needed any more now that we have the status
- bubble reporting pass events passively.
+ Unreviewed fix for rebaseline-chromium-webkit-tests.
- * Scripts/webkitpy/commands/queues.py:
+ Port.diff_image no longer has a tolerance parameter. Also, use
+ get_option('tolerance') which is safer if the options object doesn't
+ define a tolerance attribute (it doesn't for the one used in
+ rebaseline_chromium_webkit_tests).
-2010-01-08 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- Reviewed by Eric Seidel.
+2010-10-21 Mihai Parparita <mihaip@chromium.org>
- Optimize the number of CPUs used for building Qt and Gtk
- https://bugs.webkit.org/show_bug.cgi?id=33394
+ Reviewed by Ojan Vafai.
- Instead of hardcoding the number 8, we should read the number of CPUs
- from the environment.
+ Add support for --tolerance in NRWT
+ https://bugs.webkit.org/show_bug.cgi?id=47959
+
+ Add support for the --tolerance flag in NRWT. The Port.diff_image
+ signature shouldn't need a tolerance parameter (it's not set per test),
+ just have ports that use it (currently only WebKitPort) read it from
+ the options object.
- * Scripts/webkitpy/executive.py:
- * Scripts/webkitpy/webkitport.py:
- * Scripts/webkitpy/webkitport_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
-2010-01-08 Chris Fleizach <cfleizach@apple.com>
+2010-10-21 Eric Seidel <eric@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Adam Barth.
- REGRESSION(52819?): AXLoadComplete and AXLayoutComplete causes 4 tests fail on Snow Leopard Debug bot
- https://bugs.webkit.org/show_bug.cgi?id=33300
+ Add --suggest-reviewers option to upload to auto-suggest reviewers for your patch
+ https://bugs.webkit.org/show_bug.cgi?id=48088
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::AccessibilityUIElement):
- (AccessibilityUIElement::~AccessibilityUIElement):
- (_accessibilityNotificationCallback):
- (AccessibilityUIElement::addNotificationListener):
+ This is a first-pass. Works, but we'll eventually
+ turn this on by default, refine the suggestion algorithm
+ and possibly move it to a different place in the upload step order.
-2010-01-08 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/__init__.py:
+ * Scripts/webkitpy/tool/steps/options.py:
- Reviewed by Simon Hausmann.
+2010-10-21 Mario Sanchez Prada <msanchez@igalia.com>
- commit-queue should run run-javascriptcore-tests
- https://bugs.webkit.org/show_bug.cgi?id=33376
+ Reviewed by Chris Fleizach.
- I also made it run the python and perl unit tests.
+ [GTK] Segfault while testing accessibility/iframe-bastardization.html
+ https://bugs.webkit.org/show_bug.cgi?id=30123
- * Scripts/webkitpy/steps/runtests.py:
- * Scripts/webkitpy/webkitport.py:
+ Check m_element before actually using it to get the parent.
-2010-01-07 Andras Becsi <abecsi@inf.u-szeged.hu>
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::parentElement): Add an extra check to
+ make sure m_element points to a valid value before actually using
+ it to get the parent. Also, assert ATK_IS_OBJECT(m_element).
- Reviewed by Darin Adler.
+2010-10-21 Anders Carlsson <andersca@apple.com>
- Run the http and websocket tests after all other tests.
- https://bugs.webkit.org/show_bug.cgi?id=33153
+ Reviewed by Adam Roben.
- * Scripts/run-webkit-tests:
+ Crash evaluating JavaScript string that throws an exception
+ https://bugs.webkit.org/show_bug.cgi?id=48092
+ <rdar://problem/8487657>
-2010-01-07 Adam Barth <abarth@webkit.org>
+ Add a test that evaluates a JavaScript string that throws an exception and check that
+ the callback is called.
- Reviewed by Eric Seidel.
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp: Added.
+ (TestWebKitAPI::didRunJavaScript):
+ (TestWebKitAPI::WebKit2_EvaluateJavaScript):
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj:
- Fix some test-webkitpy expectations
- https://bugs.webkit.org/show_bug.cgi?id=33345
+2010-10-21 Adam Roben <aroben@apple.com>
- I forgot to change these when I added the CheckStyle step.
+ Test that the plugin's HWND is invalidated when NPN_InvalidateRect is
+ called
- * Scripts/webkitpy/commands/upload_unittest.py:
+ Test for <http://webkit.org/b/48086> <rdar://problem/8482944>
+ Silverlight doesn't repaint in WebKit2
-2010-01-07 Adam Barth <abarth@webkit.org>
+ Reviewed by Anders Carlsson.
- Reviewed by Eric Seidel.
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::NPN_InvalidateRect): Added. Calls through to the browser.
+ (executeScript): Added. Asks the browser to evaluate the script.
+
+ (PluginTest::waitUntilDone):
+ (PluginTest::notifyDone):
+ Added. Calls through to layoutTestController.
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added
+ * NPN_InvalidateRect and waitUntilDone/notifyDone.
+
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp: Added.
+ (TemporaryWindowMover::moveSucceeded):
+ (TemporaryWindowMover::TemporaryWindowMover):
+ (TemporaryWindowMover::~TemporaryWindowMover):
+ This class moves a window on-screen and shows it, then moves it back and hides it.
+
+ (NPNInvalidateRectInvalidatesWindow::NPNInvalidateRectInvalidatesWindow):
+ Initialize our members.
+ (NPNInvalidateRectInvalidatesWindow::~NPNInvalidateRectInvalidatesWindow):
+ Delete our window mover if it hasn't been deleted already.
+ (NPNInvalidateRectInvalidatesWindow::NPP_SetWindow): Subclass the
+ plugin HWND and move the test harness window on screen.
+ (NPNInvalidateRectInvalidatesWindow::wndProc): Call through to onPaint
+ when we get a WM_PAINT message.
+ (NPNInvalidateRectInvalidatesWindow::onPaint): Do the test and tell
+ LayoutTestController we're done.
+ (NPNInvalidateRectInvalidatesWindow::testInvalidateRect): Validate
+ ourselves, invalidate our lower-right quadrant via NPN_InvalidateRect,
+ then check that our HWND's invalid region is the rect that we
+ invalidated.
+
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * Added NPNInvalidateRectInvalidatesWindow.
+
+2010-10-21 Daniel Bates <dbates@rim.com>
+
+ Add Git-support to do-file-rename
+ https://bugs.webkit.org/show_bug.cgi?id=48015
+
+ Fix tools. Export function scmMoveOrRenameFile so that it can be called from
+ do-file-rename and do-webcore-rename. I inadvertently left this out of the patch.
- webkit-patch edit-changelogs (or upload) will open blank files if run outside the root
- https://bugs.webkit.org/show_bug.cgi?id=33341
+ * Scripts/VCSUtils.pm:
- Fix this by moving to the root directory before editing ChangeLogs.
- There is a related bug with CheckStyle.
+2010-10-21 Eric Seidel <eric@webkit.org>
- * Scripts/webkitpy/steps/checkstyle.py:
- * Scripts/webkitpy/steps/editchangelog.py:
+ Reviewed by Adam Barth.
-2010-01-07 Eric Seidel <eric@webkit.org>
+ mac-ews is not properly releasing patches
+ https://bugs.webkit.org/show_bug.cgi?id=48076
- Reviewed by Nikolas Zimmermann.
+ mac-ews overrides process_work_item, so it was not calling
+ release_work_item like the default process_work_item would.
+ To fix this I made all the status-reporting methods just
+ release the patch. I expect we'll iterate on this design further.
- media/unsupported-tracks.html is failing on Snow Leopard Release bot
- https://bugs.webkit.org/show_bug.cgi?id=32339
+ * Scripts/webkitpy/common/net/statusserver.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- This is a speculative fix. I do not have a Snow Leopard machine to test on
- and I've not seen mention of someone being able to reproduce this locally.
+2010-10-18 Martin Robinson <mrobinson@igalia.com>
- Prevent watchdog timer from firing after a test completes but before
- the next one starts, causing the error to appear in the next test.
+ Reviewed by Gustavo Noronha Silva.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (dump): Stop the watchdog before printing #EOF for the test content.
- We only need to care about the JavaScript of the test running too long
- or some hang in WebCore. Any other failures will be covered by the calling
- script's own watchdog timer.
+ [GTK] mathml flaky tests after adding SystemFonts to the theme
+ https://bugs.webkit.org/show_bug.cgi?id=47727
-2010-01-07 Eric Seidel <eric@webkit.org>
+ The Fontconfig setup in the GTK+ now specifically checks for and
+ loads the STIX fonts for MathML tests.
- Reviewed by Adam Barth.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeFonts): Add hooks for loading the STIX fonts specifically.
- commit-queue is stuck spinning due to exception
- https://bugs.webkit.org/show_bug.cgi?id=33358
+2010-10-20 Adam Roben <aroben@apple.com>
- * Scripts/webkitpy/commands/queues.py:
- - Don't try to stringify the exception.
+ Test that the UI client gets notified when WKView receives a WM_CLOSE
+ message
-2010-01-07 Mark Rowe <mrowe@apple.com>
+ Test for <http://webkit.org/b/48044> <rdar://problem/8488446> Pressing
+ Ctrl+W when viewing a full-page PDF destroys the WKView but doesn't
+ close its parent window
Reviewed by Jon Honeycutt.
- Don't leak a JSStringRef within _accessibilityNotificationCallback.
+ * TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp: Added.
+ (TestWebKitAPI::close): Record that this function was called.
+ (TestWebKitAPI::WebKit2_WMCloseCallsUIClientClose): Create a WKView,
+ send it a WM_CLOSE message, and test that the UI client's close
+ callback got called. Note that this will hang if the bug is
+ reintroduced; <http://webkit.org/b/48043> covers making TestWebKitAPI
+ able to handle hangs.
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (_accessibilityNotificationCallback): Have a JSRetainPtr adopt the JSStringRef so that it will be cleaned up
- when it goes out of scope.
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj: Added the new test.
-2010-01-07 Simon Fraser <simon.fraser@apple.com>
+2010-10-20 Adam Roben <aroben@apple.com>
- Reviewed by Darin Adler.
+ Make prepare-ChangeLog much faster when using git
- Add proposed rename of HTMLPlugInImageElement to HTMLEmbeddedObjectElement.
+ This change also seems to make it detect renames better in some cases.
- * Scripts/do-webcore-rename:
+ Fixes <http://webkit.org/b/48040> prepare-ChangeLog is slow when using
+ git
-2010-01-07 Kim Grönholm <kim.gronholm@nomovok.com>
+ Reviewed by David Kilzer.
- Reviewed by Antti Koivisto.
+ * Scripts/prepare-ChangeLog:
+ (statusCommand):
+ (createPatchCommand):
+ Use "-M -C" instead of "-C -C -M" to tell git-diff to detect renames
+ and copies. The two "-C"s were making it read many more files than were
+ necessary.
- Wrong state and TouchLists in TouchEvents
- https://bugs.webkit.org/show_bug.cgi?id=32878
+2010-10-21 Sam Weinig <sam@webkit.org>
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::touchStart):
- (EventSender::touchEnd):
- (EventSender::clearTouchPoints):
- * DumpRenderTree/qt/EventSenderQt.h:
+ Reviewed by Adam Roben.
-2010-01-07 Chris Jerdonek <chris.jerdonek@gmail.com>
+ Null frame passed when running alert from UserScript run at document start
+ <rdar://problem/8573809>
+ https://bugs.webkit.org/show_bug.cgi?id=48036
- Reviewed by Adam Barth.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/InjectedBundleController.cpp:
+ (TestWebKitAPI::InjectedBundleController::didReceiveMessage):
+ (TestWebKitAPI::InjectedBundleController::initializeTestNamed):
+ * TestWebKitAPI/InjectedBundleController.h:
+ * TestWebKitAPI/InjectedBundleTest.h:
+ (TestWebKitAPI::InjectedBundleTest::initialize):
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp: Added.
+ (TestWebKitAPI::runJavaScriptAlert):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp: Added.
+ (TestWebKitAPI::DocumentStartUserScriptAlertCrashTest::DocumentStartUserScriptAlertCrashTest):
+ (TestWebKitAPI::DocumentStartUserScriptAlertCrashTest::initialize):
+ Add test for invoking an alert during a UserScript run at document start.
+
+2010-10-21 Andreas Kling <kling@webkit.org>
- Created a module that runs the style package unit tests.
+ Reviewed by Adam Roben.
- https://bugs.webkit.org/show_bug.cgi?id=32973
+ TestNetscapePlugIn: Actually call NPP_SetWindow on Unix
- * Scripts/test-webkitpy:
- * Scripts/webkitpy/style/unittests.py: Added.
+ We were just returning NPERR_NO_ERROR previously.
-2010-01-07 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_set_window):
- Reviewed by Maciej Stachowiak.
+2010-10-21 David Kilzer <ddkilzer@apple.com>
- Don't print a redundant message when confirming a diff
- https://bugs.webkit.org/show_bug.cgi?id=33315
+ <http://webkit.org/b/48051> Move macros from DumpRenderTreeMac.h to config.h
- Instead of saying "ERROR: User declined" we should just exit because
- the use knows they just declined!
+ Reviewed by Adam Roben.
- * Scripts/webkitpy/steps/confirmdiff.py:
+ * DumpRenderTree/config.h: Moved macros to here...
+ * DumpRenderTree/mac/DumpRenderTreeMac.h: ...from here.
+ Addresses a FIXME comment from r28419.
-2010-01-07 Adam Barth <abarth@webkit.org>
+2010-10-21 David Kilzer <ddkilzer@apple.com>
- Reviewed by Maciej Stachowiak.
+ <http://webkit.org/b/48047> Fix warnings found by check-Xcode-source-file-types
- Check style before uploading a patch
- https://bugs.webkit.org/show_bug.cgi?id=33314
+ Reviewed by Adam Roben.
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/steps/checkstyle.py:
- * Scripts/webkitpy/steps/options.py:
+ Fixes the following warnings:
-2010-01-07 Adam Barth <abarth@webkit.org>
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'PixelDumpSupport.cpp'.
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'LayoutTestController.cpp'.
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'WorkQueue.cpp'.
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'cg/PixelDumpSupportCG.cpp'.
+ WARNING: Incorrect file type 'sourcecode.cpp.objcpp' for file 'GCController.cpp'.
+ 5 issues found for WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj.
- Reviewed by Maciej Stachowiak.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Removed explicit file type for *.cpp files above to make them
+ match other C++ source files. This exposed the fact that
+ DumpRenderTreeMac.h was not safe to include in C++ source, which
+ caused PixelDumpSupport.cpp and PixelDumpSupportCG.cpp to fail
+ to build.
+ * DumpRenderTree/PixelDumpSupport.cpp: Adjusted header order.
+ * DumpRenderTree/mac/DumpRenderTreeMac.h: Made safe to include
+ in C++ source files. Included CoreFoundation/CoreFoundation.h
+ to make sure all CF types were defined. Removed CFStringRef
+ typedef.
- Add prepare and post to webkit-patch main help
- https://bugs.webkit.org/show_bug.cgi?id=33313
+2010-10-21 Adam Roben <aroben@apple.com>
- * Scripts/webkitpy/commands/upload.py:
+ Attempt to fix plugins/pass-different-npp-struct.html on GTK.
-2010-01-07 Eric Seidel <eric@webkit.org>
+ See <http://webkit.org/b/47690>.
- Reviewed by Adam Barth.
+ * GNUmakefile.am: Added PassDifferentNPPStruct.cpp.
- Add Chromium bots to the list of "core builders" (builders which stop the commit-queue when they turn red)
- https://bugs.webkit.org/show_bug.cgi?id=33290
+2010-10-21 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- Add the Chromium builders to our list of core builders and test that our regexps work.
- I also updated our regexp testing to make sure we cover all known builders at build.webkit.org.
+ Reviewed by Csaba Osztrogonác.
- * Scripts/webkitpy/buildbot.py:
- * Scripts/webkitpy/buildbot_unittest.py:
+ [NRWT] Set ImageDiff path on Qt port
+ https://bugs.webkit.org/show_bug.cgi?id=48052
-2010-01-07 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+
+2010-10-21 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- bugzilla-tool needs a new name
- https://bugs.webkit.org/show_bug.cgi?id=28459
-
- Rename bugzilla-tool to webkit-patch. Also, rename some commands to
- make more sense with the new name.
-
- * Scripts/bugzilla-tool: Removed.
- * Scripts/webkit-patch: Added.
- * Scripts/webkit-tools-completion.sh:
- * Scripts/webkitpy/bugzilla_unittest.py:
- * Scripts/webkitpy/commands/download.py:
- * Scripts/webkitpy/commands/download_unittest.py:
- * Scripts/webkitpy/commands/early_warning_system.py:
- * Scripts/webkitpy/commands/queries.py:
- * Scripts/webkitpy/commands/queues.py:
- * Scripts/webkitpy/commands/queues_unittest.py:
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/commands/upload_unittest.py:
- * Scripts/webkitpy/queueengine.py:
- * Scripts/webkitpy/steps/completerollout.py:
-
-2010-01-07 Chris Jerdonek <chris.jerdonek@gmail.com>
+ Don't CC authors of flaky tests
+ https://bugs.webkit.org/show_bug.cgi?id=48038
- Reviewed by Eric Seidel.
+ Some authors found this too annoying. We'll look for another way to
+ close the flaky test loop.
- Moved style-related modules to webkitpy.style sub-package.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- https://bugs.webkit.org/show_bug.cgi?id=32971
+2010-10-21 Eric Seidel <eric@webkit.org>
- * Scripts/check-webkit-style:
- - Updated import statement.
+ Reviewed by Adam Barth.
- * Scripts/test-webkitpy:
- - Updated import statements.
+ commit-queue should run run-webkit-tests with --no-new-test-results
+ https://bugs.webkit.org/show_bug.cgi?id=47998
- * Scripts/webkitpy/cpp_style.py: Removed.
- - Moved to webkitpy/style.
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
- * Scripts/webkitpy/cpp_style_unittest.py: Removed.
- - Moved to webkitpy/style.
+2010-10-21 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- * Scripts/webkitpy/style.py: Removed.
- - Moved to webkitpy/style/checker.py.
+ Reviewed by Ojan Vafai.
- * Scripts/webkitpy/style/__init__.py: Added.
- - Added containing webkitpy directory to package search path.
+ [NRWT] Get child process number from an environment variable
+ https://bugs.webkit.org/show_bug.cgi?id=47981
- * Scripts/webkitpy/style/checker.py: Copied from Scripts/webkitpy/style.py.
- * Scripts/webkitpy/style/checker_unittest.py: Copied from Scripts/webkitpy/style_unittest.py.
- - Updated import statement.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * Scripts/webkitpy/style/cpp_style.py: Copied from Scripts/webkitpy/cpp_style.py.
- * Scripts/webkitpy/style/cpp_style_unittest.py: Copied from Scripts/webkitpy/cpp_style_unittest.py.
- - Update import statement.
+2010-10-20 David Kilzer <ddkilzer@apple.com>
- * Scripts/webkitpy/style/text_style.py: Copied from Scripts/webkitpy/text_style.py.
- * Scripts/webkitpy/style/text_style_unittest.py: Copied from Scripts/webkitpy/text_style_unittest.py.
- * Scripts/webkitpy/style_unittest.py: Removed.
- - Moved to webkitpy/style/checker_unittest.py.
+ <http://webkit.org/b/47754> New script to verify explicit source file types in Xcode project files
- * Scripts/webkitpy/text_style.py: Removed.
- - Moved to webkitpy/style.
+ Reviewed by Darin Adler.
- * Scripts/webkitpy/text_style_unittest.py: Removed.
- - Moved to webkitpy/style.
+ The script parses an Xcode project file and makes sure the file
+ extension matches the explicit file type set for all source
+ files. Note that the majority of source files will have their
+ type set by Xcode, so the script doesn't check them since there
+ is no need to second-guess Xcode.
-2010-01-06 Kinuko Yasuda <kinuko@chromium.org>
+ * Scripts/check-Xcode-source-file-types: Added. Code borrowed
+ heavily from sort-Xcode-project-file.
- Reviewed by Eric Seidel.
+2010-10-20 Adam Roben <aroben@apple.com>
+
+ Windows build fix
- [Qt] Support the 3rd argument of EventSender.keyDown that
- has been recently added to report keyLocation
- (see also: https://bugs.webkit.org/show_bug.cgi?id=28247).
- https://bugs.webkit.org/show_bug.cgi?id=33250
+ * TestWebKitAPI/win/PlatformUtilitiesWin.cpp: Added missing #include.
- Test: fast/events/keydown-numpad-keys.html
+2010-10-20 Adam Roben <aroben@apple.com>
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::keyDown):
- * DumpRenderTree/qt/EventSenderQt.h:
+ Qt test fix
-2010-01-06 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro: Added
+ PassDifferentNPPStruct.cpp.
- Reviewed by Adam Barth.
+2010-10-20 Sam Weinig <sam@webkit.org>
- Add long_help for all common commands.
- https://bugs.webkit.org/show_bug.cgi?id=33261
+ Reviewed by Adam Roben.
- For now these long_helps are pretty basic.
- These were all written to just explain the steps
- that each command runs. This style long_help could
- be made easier by using:
- https://bugs.webkit.org/show_bug.cgi?id=33257
+ Add ability to test injected bundle API using TestWebKitAPI
+ https://bugs.webkit.org/show_bug.cgi?id=48027
- * Scripts/webkitpy/commands/download.py:
- * Scripts/webkitpy/commands/queries.py:
+ * TestWebKitAPI/InjectedBundleController.cpp: Added.
+ * TestWebKitAPI/InjectedBundleController.h: Added.
+ Shared main object for bundle functionality.
-2010-01-06 Diego Gonzalez <diego.gonzalez@openbossa.org>
+ * TestWebKitAPI/InjectedBundleMain.cpp: Added.
+ Bundle entry point.
- Reviewed by Kenneth Christiansen.
+ * TestWebKitAPI/InjectedBundleTest.h: Added.
+ Base class for which the bundle portion of a test derives from.
- [Qt] Add page zooming support to Qt DumpRenderTree
- https://bugs.webkit.org/show_bug.cgi?id=32898
+ * TestWebKitAPI/PlatformUtilities.h:
+ * TestWebKitAPI/PlatformUtilities.cpp: Added.
+ * TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
+ * TestWebKitAPI/win/PlatformUtilitiesWin.cpp:
+ (TestWebKitAPI::Util::createInjectedBundlePath):
+ (TestWebKitAPI::Util::createURLForResource):
+ (TestWebKitAPI::Util::URLForNonExistentResource):
+ Add helper to create a context with the shared injected bundle,
+ and send the initial message to set up the test.
- Patch by Kim Grönholm <kim.gronholm@nomovok.com>,
- Diego Gonzalez <diego.gonzalez@openbossa.org> and
- Afonso Costa <afonso.costa@openbossa.org>
+ * TestWebKitAPI/Configurations/InjectedBundle.xcconfig: Added.
+ * TestWebKitAPI/InjectedBundle-Info.plist: Added.
+ Add mac configuration files.
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::zoomPageIn):
- (EventSender::zoomPageOut):
- * DumpRenderTree/qt/EventSenderQt.h:
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ Add the new files.
-2010-01-06 Eric Seidel <eric@webkit.org>
+ * TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp: Added.
+ * TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp: Added.
+ Add a simple initial bundle test.
- No review, just adding Mike Belshe's new bugzilla email at his request.
+2010-10-20 Eric Seidel <eric@webkit.org>
- * Scripts/webkitpy/committers.py:
+ Unreviewed. Fixing /release-patch url used by the EWS bots.
-2010-01-06 Eric Seidel <eric@webkit.org>
+ EWS should test patches with r+
+ https://bugs.webkit.org/show_bug.cgi?id=35460
- Unreviewed. Rolling out r52869 and r52853 due to bot
- and local run-webkit-test failures
+ * Scripts/webkitpy/common/net/statusserver.py:
+ - I changed the URL during development, and 404s are
+ intentionally silenced during release_patch.
- REGRESSION(52854?) fast/workers/shared-worker-constructor.html failed on Leopard Build Bot
- https://bugs.webkit.org/show_bug.cgi?id=33256
+2010-10-14 Adam Roben <aroben@apple.com>
- The original bug was https://bugs.webkit.org/show_bug.cgi?id=33153
+ Test that passing a different NPP struct back to the browser doesn't
+ cause an assertion failure
- * Scripts/run-webkit-tests:
+ Test for <http://webkit.org/b/47690> <rdar://problem/8553020>
+ Assertion failure in NetscapePlugin::fromNPP when using Shockwave in
+ WebKit2
-2010-01-06 Eric Seidel <eric@webkit.org>
+ Reviewed by John Sullivan.
- Unreviewed "build" fix. Just adding missing include.
+ * DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp: Copied from WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp.
+ (PassDifferentNPPStruct::PassDifferentNPPStruct): Initialize our
+ members.
+ (PassDifferentNPPStruct::NPP_SetWindow): Pass a different NPP to the
+ browser than the one it gave us in NPP_New and see if it works.
- bugzilla-tool rollout --complete-rollout should make a nicer bug comment
- https://bugs.webkit.org/show_bug.cgi?id=29212
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ Added PassDifferentNPPStruct.
- * Scripts/webkitpy/steps/completerollout.py:
+2010-10-19 Adam Roben <aroben@apple.com>
-2010-01-06 Eric Seidel <eric@webkit.org>
+ Gently nudge old-run-webkit-tests toward working with Win32 Perl
- Reviewed by Adam Barth.
+ This makes old-run-webkit-tests able to build DRT and find all the
+ tests to run. It even invokes DRT and passes it the list of tests. But
+ DRT ends up hung blocking on I/O.
- bugzilla-tool rollout --complete-rollout should make a nicer bug comment
- https://bugs.webkit.org/show_bug.cgi?id=29212
+ Fixes <http://webkit.org/b/47961> Get old-run-webkit-tests mostly
+ working with Win32 Perl
- * Scripts/webkitpy/bugzilla.py:
- - Make reopen_bug robust against the bug already being open.
- * Scripts/webkitpy/commands/download.py:
- - Remove dead code from Rollout.
- * Scripts/webkitpy/steps/completerollout.py:
- - Improve the rollout comment.
+ Reviewed by David Kilzer.
-2010-01-06 Andras Becsi <abecsi@inf.u-szeged.hu>
+ * Scripts/old-run-webkit-tests:
+ - Use File::Spec instead of manually concatenating paths
+ - Use dirname instead of manually stripping off the base name
+ - Use isCygwin/isWindows/isAppleWinWebKit more judiciously
+ - Explicitly invoke Perl when running Perl scripts
+ - Quote paths when using them in regular expressions to allow them
+ to include characters that have special meanings in regular
+ expressions
- Reviewed by Darin Adler.
+ * Scripts/run-webkit-tests: Use File::Spec instead of manually
+ concatenating paths.
- Set isHttpdOpen to 0 if pidfile does not exist for some reason.
- Speculative fix for https://bugs.webkit.org/show_bug.cgi?id=33256.
+ * Scripts/webkitdirs.pm:
+ - Remove the unused $windowsTmpPath variable
+ - Use isCygwin/isWindows/isAppleWinWebKit more judiciously
+ - Only pass paths to cygpath when using Cygwin Perl
+ - Only use pdevenv when using Cygwin Perl, for now
- * Scripts/run-webkit-tests:
+2010-10-20 Daniel Bates <dbates@rim.com>
-2010-01-06 Andras Becsi <abecsi@inf.u-szeged.hu>
+ Reviewed by Martin Robinson.
- Reviewed by Darin Adler.
+ Add Git-support to do-file-rename
+ https://bugs.webkit.org/show_bug.cgi?id=48015
- Change hardcoded /tmp in run-webkit-tests to File::Spec->tmpdir(),
- and remove the httpd's pidfile directory if httpd terminated.
+ Also, abstracts the SCM move/rename functionality in do-file-rename and
+ do-webcore-rename into a common function VCSUtils::scmMoveOrRenameFile().
- * Scripts/run-webkit-tests:
+ Currently, do-file-rename is hard coded to assume the SCM is Subversion.
+ Instead, we should abstract the rename logic to be SCM-independent. This
+ will allow us to add Git support as well move such functionality into
+ our SCM library VCSUtils, where it can be shared by do-webcore-rename.
-2010-01-05 Chris Jerdonek <chris.jerdonek@gmail.com>
+ * Scripts/VCSUtils.pm:
+ - Added function scmMoveOrRenameFile.
+ * Scripts/do-file-rename: Modified to call VCSUtils::scmMoveOrRenameFile().
+ * Scripts/do-webcore-rename: Ditto.
- Reviewed by David Levin.
+2010-10-20 Adam Roben <aroben@apple.com>
- Refactored check-webkit-style's argument parser to not rely
- on global state, and improved its error handling and unit
- test coverage.
+ Fix old-run-webkit-tests when there's a space in the path to DRT
- https://bugs.webkit.org/show_bug.cgi?id=32966
+ Reviewed by Jon Honeycutt.
- * Scripts/check-webkit-style:
- - Adjusted to use new argument parser.
-
- * Scripts/webkitpy/cpp_style.py:
- - Changed _CppStyleState to accept an array of filter rules
- instead of a comma-delimited string.
- - Eliminated cpp_style._DEFAULT_FILTER_RULES.
- - Eliminated cpp_style._USAGE.
-
- * Scripts/webkitpy/cpp_style_unittest.py:
- - Updated test_filter() and test_default_filter().
-
- * Scripts/webkitpy/style.py:
- - Converted style._USAGE to create_usage().
- - Corrected usage instructions by removing 0 as a valid
- --verbose flag value.
- - Removed use_webkit_styles().
- - Added ProcessorOptions class.
- - Added ArgumentDefaults class.
- - Added ArgumentPrinter class.
- - Removed parse_arguments and added ArgumentParser class.
- - Moved exit_with_usage() and exit_with_categories() into
- ArgumentParser.
- - Refactored parse_arguments() as ArgumentParser.parse().
- - Improved parser error handling.
-
- * Scripts/webkitpy/style_unittest.py:
- - Added DefaultArgumentsTest class.
- - Addressed FIXME to check style.WEBKIT_FILTER_RULES
- against style.STYLE_CATEGORIES.
- - Added ArgumentPrinterTest class.
- - Added ArgumentParserTest class and rewrote parser unit tests.
-
-2010-01-05 Adam Roben <aroben@apple.com>
-
- Test that it's safe to call IWebView::close when
- IWebView::initWithFrame hasn't been called
-
- Part of <http://webkit.org/b/32827> Crash when calling
- IWebView::close, then releasing the WebView, without calling
- DestroyWindow
+ * Scripts/old-run-webkit-tests: Quote the path to DRT before executing
+ it.
- Reviewed by Steve Falkenburg.
+2010-10-20 Kenneth Russell <kbr@google.com>
- * WebKitAPITest/tests/WebViewDestruction.cpp:
- (WebKitAPITest::CloseWithoutInitWithFrame): Calls IWebView::close
- without ever calling IWebView::initWithFrame and tests that we don't
- crash or leak.
+ Reviewed by Dimitri Glazkov.
-2010-01-05 Adam Roben <aroben@apple.com>
+ Regression in chromium_gpu_unittests after r70175
+ https://bugs.webkit.org/show_bug.cgi?id=48008
- Add more WebViewDestruction tests
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py:
- Fixes <http://webkit.org/b/33216>.
+2010-10-20 Kenneth Russell <kbr@google.com>
- Reviewed by Eric Seidel.
+ Reviewed by James Robinson.
- * WebKitAPITest/tests/WebViewDestruction.cpp:
- (WebKitAPITest::NoInitWithFrame):
- (WebKitAPITest::CloseThenDestroyViewWindow):
- (WebKitAPITest::DestroyViewWindowThenClose):
- (WebKitAPITest::DestroyHostWindow):
- (WebKitAPITest::DestroyHostWindowThenClose):
- (WebKitAPITest::CloseThenDestroyHostWindow):
- Added these tests that exercise tearing down a WebView in various
- ways, all of which we eventually want to have work. Some of them
- currently crash or leak.
+ chromium_gpu port of new-run-webkit-tests must do Linux -> Win expectations fallback
+ https://bugs.webkit.org/show_bug.cgi?id=48005
-2010-01-05 Robert Hogan <robert@roberthogan.net>
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
- Reviewed by Eric Seidel.
+2010-10-20 Adam Barth <abarth@webkit.org>
- [Qt] fix DRT link failures on --no-svg builds when only making changes to DRT
-
- If you're working from a --minimal or --no-svg build and make changes to the
- DRT, then recompile, the build will fail.
-
- This is because the current behavior at build time is to assume that the
- previous Qt build supported SVG and consequently delete libQtWebKit.so.
- Unfortunately, just deleting libQtWebKit.so will not cause the library to
- re-link. Instead the build will see libQtWebKit.so.4 and co., pass over the
- linking phase, and attempt to link the DRT with libQtWebKit.so absent. This
- results in a link failure on the DRT.
-
- Since re-linking libQtWebKit can take up to ten minutes and should be avoided
- in cases where not actually required, remove the assumption that
- the previous Qt build supported SVG, and amend the symbol detection to look for
- a symbol name that is not present in SVG builds. Currently webkitdirs.pm looks
- for 'SVGElement' but even non-SVG builds contain the symbol 'isSVGElement'.
-
- https://bugs.webkit.org/show_bug.cgi?id=32992
+ Reviewed by Eric Seidel.
- * Scripts/webkitdirs.pm:
+ webkit-patch doesn't get along with git rm
+ https://bugs.webkit.org/show_bug.cgi?id=47940
-2010-01-05 Chris Jerdonek <chris.jerdonek@gmail.com>
+ Turns out we need to pass "--" to tell git this is a path.
- Reviewed by David Kilzer.
+ * Scripts/webkitpy/common/checkout/scm.py:
- Switched to generating list of Perl unit test files dynamically,
- instead of explicitly.
+2010-10-20 Robert Hogan <robert@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=33200
+ Reviewed by Antonio Gomes.
- * Scripts/test-webkitperl:
+ [Qt] Fix layoutTestController.getJsObjectCount
-2010-01-05 Yael Aharon <yael.aharon@nokia.com>
+ Qt Bridge doesn't know size_t so pass result as unsigned int.
- Reviewed by Kenneth Rohde Christiansen.
+ Unskip fast/dom/gc-10.html
- [Qt] Reimplement EventSender::leapForward
- https://bugs.webkit.org/show_bug.cgi?id=33114
+ https://bugs.webkit.org/show_bug.cgi?id=47931
- Follow Windows implementation of leapForward. When leapForward is called,
- messages are queued and posted after the timeout. A new event loop is created to
- handle those messages and the additional messages that are created as a result.
+ * DumpRenderTree/qt/GCControllerQt.cpp:
+ (GCController::getJSObjectCount):
+ * DumpRenderTree/qt/GCControllerQt.h:
- * DumpRenderTree/qt/DumpRenderTree.pro:
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::EventSender):
- (EventSender::mouseDown):
- (EventSender::mouseUp):
- (EventSender::mouseMoveTo):
- (EventSender::leapForward):
- (EventSender::sendOrQueueEvent):
- (EventSender::replaySavedEvents):
- (EventSender::eventFilter):
- * DumpRenderTree/qt/EventSenderQt.h:
+2010-10-20 Sheriff Bot <webkit.review.bot@gmail.com>
-2010-01-05 Adam Barth <abarth@webkit.org>
+ Unreviewed, rolling out r70149.
+ http://trac.webkit.org/changeset/70149
+ https://bugs.webkit.org/show_bug.cgi?id=47989
- Reviewed by Darin Adler.
+ "Build breaks in mac and win" (Requested by satish on
+ #webkit).
- Fix obscure queue crash in queueengine
- https://bugs.webkit.org/show_bug.cgi?id=33196
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
- Sometimes we get an exception that can't be stringified. For example:
+2010-10-20 Leandro Gracia Gil <leandrogracia@google.com>
- AttributeError: 'ParseError' object has no attribute 'msg'
+ Reviewed by Jeremy Orlow.
- In these cases, the whole queue dies because we're in the global
- exception handler. Instead of dieing here, we should just print a less
- informative message to the console. We're already printing the whole
- backtrace anyway, so there's not much point to stringifying the
- exception anyway.
+ Added a second parameter to setMockSpeechInputResult for
+ the language used in speech input.
+ https://bugs.webkit.org/show_bug.cgi?id=47089
- * Scripts/webkitpy/queueengine.py:
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult):
-2010-01-05 Dominic Mazzoni <dmazzoni@google.com>
+2010-10-19 Adam Roben <aroben@apple.com>
- Reviewed by Darin Adler.
+ Teach update-webkit-support-libs about the new versioning of
+ WebKitSupportLibrary
- https://bugs.webkit.org/show_bug.cgi?id=32571
+ Fixes <http://webkit.org/b/47915> update-webkit-support-libs should
+ check version numbers instead of modification times
- For an object with an aria role of "checkbox" or "radiobutton",
- use the "aria-checked" attribute to determine if it's checked.
- These changes add an isChecked() method to AccessibilityUIElement
- so that we can check for this property from a layout test.
+ Reviewed by Sam Weinig.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getIsCheckedCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::isChecked):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::isChecked):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::isChecked):
+ * Scripts/update-webkit-support-libs: Fetch the expected version
+ number from developer.apple.com, then compare with the version number
+ of the extracted library and of the zipped library to see if anything
+ needs to be done. Removed code that tracked the modified timestamp of
+ the library, as it is no longer needed.
-2010-01-05 David Levin <levin@chromium.org>
+2010-10-19 Eric Seidel <eric@webkit.org>
- Reviewed by Darin Adler.
+ Reviewed by Adam Barth.
- Having a comment for the #endif for a header guard is not required WebKit style.
- https://bugs.webkit.org/show_bug.cgi?id=33214
+ EWS should test patches with r+
+ https://bugs.webkit.org/show_bug.cgi?id=35460
- * Scripts/webkitpy/cpp_style.py: removed the check and made the loop exit
- early when it has all the needed information to continue.
- * Scripts/webkitpy/cpp_style_unittest.py: removed the corresponding tests.
+ * QueueStatusServer/handlers/submittoews.py:
+ * QueueStatusServer/model/queues.py:
+ * Scripts/webkitpy/tool/bot/patchcollection.py: Removed.
+ * Scripts/webkitpy/tool/bot/patchcollection_unittest.py: Removed.
+ * Scripts/webkitpy/tool/commands/queues.py:
-2010-01-05 Adam Roben <aroben@apple.com>
+2010-10-19 Eric Seidel <eric@webkit.org>
- Share more code in the WebViewDestruction tests
+ Reviewed by Adam Barth.
- Part of <http://webkit.org/b/33212> Small fixes/improvements to
- WebKitAPITest
+ Teach feeder-queue how to feed the EWS bots
+ https://bugs.webkit.org/show_bug.cgi?id=47943
- Reviewed by Sam Weinig.
+ queues.webkit.org already knew how to accept EWS submissions
+ via /submit-to-ews. This teaches the feeder queue how to post
+ to that page with any new r? patches it sees.
- * WebKitAPITest/tests/WebViewDestruction.cpp:
- (WebKitAPITest::createAndInitializeWebView): Renamed from
- createWebView. Now initializes the HostWindow and returns the
- WebView's HWND via an out-parameter.
- (WebKitAPITest::finishWebViewDestructionTest): Added. Code came from
- the CloseWithoutDestroyWindow test.
- (WebKitAPITest::CloseWithoutDestroyViewWindow): Renamed from
- CloseWithoutDestroyWindow and changed to use the new functions.
- (WebKitAPITest::MainFrameAfterClose): Changed to use the new
- functions.
- (WebKitAPITest::NoCloseOrDestroyViewWindow): Renamed from
- NoCloseOrDestroyWindow and changed to use the new functions.
+ * QueueStatusServer/model/activeworkitems_unitest.py: Added.
+ - More unit testing is always a good thing.
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/statusserver.py:
+ * Scripts/webkitpy/tool/bot/feeders.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
-2010-01-05 Adam Roben <aroben@apple.com>
+2010-10-19 Eric Seidel <eric@webkit.org>
- Don't show HostWindows by default
+ Unreviewed, just fixing test-webkitpy. I'm really on a roll today.
- This was making WebKitAPITest very flashy as windows appeared and
- disappeared.
+ commit-queue gets stuck when release-patch returns 404
+ https://bugs.webkit.org/show_bug.cgi?id=47935
- Part of <http://webkit.org/b/33212> Small fixes/improvements to
- WebKitAPITest
+ Fix test-webkitpy and unittest NetworkTransaction.
- Reviewed by Sam Weinig.
+ * Scripts/webkitpy/common/net/networktransaction.py:
+ * Scripts/webkitpy/common/net/networktransaction_unittest.py:
- * WebKitAPITest/HostWindow.cpp:
- (WebKitAPITest::HostWindow::initialize): Removed the WS_VISIBLE style
- from the window.
+2010-10-19 Eric Seidel <eric@webkit.org>
-2010-01-05 Adam Roben <aroben@apple.com>
+ Unreviewed.
- Don't hang in WebKitAPITest if no messages have been posted
+ commit-queue gets stuck when release-patch returns 404
+ https://bugs.webkit.org/show_bug.cgi?id=47935
- Part of <http://webkit.org/b/33212> Small fixes/improvements to
- WebKitAPITest
+ Turns out ClientForm gets upset if passed an int() instead of a string type.
+ Yay for untestable code.
- Reviewed by Sam Weinig.
+ * Scripts/webkitpy/common/net/statusserver.py:
- * WebKitAPITest/tests/WebViewDestruction.cpp:
- (WebKitAPITest::runMessagePump): Use PeekMessage instead of GetMessage
- to avoid hanging if no messages have been posted.
+2010-10-19 Eric Seidel <eric@webkit.org>
-2010-01-05 Adam Roben <aroben@apple.com>
+ Unreviewed. Will get Adam's commentary after his meeting
+ for now this gets the commit-cluster back running.
- Fix WebKitCreateInstance helper
+ commit-queue gets stuck when release-patch returns 404
+ https://bugs.webkit.org/show_bug.cgi?id=47935
- Part of <http://webkit.org/b/33212> Small fixes/improvements to
- WebKitAPITest
+ I taught NetworkTransaction the basics of 404 handling.
+ We'll want to go back and teach it how to handle urllib2 404's too
+ and then deploy it to the places that want it.
- Reviewed by Sam Weinig.
+ * QueueStatusServer/handlers/releasepatch.py:
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/networktransaction.py:
+ * Scripts/webkitpy/common/net/statusserver.py:
- * WebKitAPITest/tests/WebViewDestruction.cpp:
- (WebKitAPITest::WebKitCreateInstance): Pass the pointer straight
- through, instead of taking its address.
+2010-10-19 Eric Seidel <eric@webkit.org>
-2010-01-04 Maciej Stachowiak <mjs@apple.com>
+ Unreviewed. Fixing typos in my previous commit.
- Reviewed by Darin Fisher.
+ Make patch release explicit and not a magic part of "retry" status
+ https://bugs.webkit.org/show_bug.cgi?id=47909
- Reorganize, document and rename OS() platform macros.
- https://bugs.webkit.org/show_bug.cgi?id=33198
+ All of these typos again due to our inability to unit
+ test much of this code. I added one unit test where
+ possible. activeworkitems_unittest.py will be in a separate patch.
- Adapt to name changes.
-
- * DumpRenderTree/DumpRenderTree.h:
- * DumpRenderTree/config.h:
+ * QueueStatusServer/handlers/releasepatch.py:
+ * QueueStatusServer/main.py:
+ * QueueStatusServer/model/activeworkitems.py:
+ * QueueStatusServer/model/workitems.py:
+ * QueueStatusServer/model/workitems_unittest.py:
+ * QueueStatusServer/templates/releasepatch.html:
+ * Scripts/webkitpy/common/net/statusserver.py:
-2010-01-05 Chris Jerdonek <chris.jerdonek@gmail.com>
+2010-10-19 Tony Chang <tony@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Kent Tamura.
- Minor improvements to test-webkit-scripts, as suggested
- by an earlier review.
+ [chromium] Use webkit's TestNetscapePlugIn in DRT mac
+ https://bugs.webkit.org/show_bug.cgi?id=47850
- https://bugs.webkit.org/show_bug.cgi?id=33125
+ * DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist: Added. Forked
+ because we're going to name our plugin WebKitTestNetscapePlugIn
+ temporarily until the chromium forked plugin goes away.
- * Scripts/test-webkit-scripts:
- - Used OptionParser class instead of getopt.getopt().
- - Created main() method for __main__ block.
- - Enclosed functions in a class.
+2010-10-19 Eric Seidel <eric@webkit.org>
-2010-01-05 Chris Fleizach <cfleizach@apple.com>
+ Reviewed by Adam Barth.
- No review. Fix DRT breakage on Tiger/Leopard.
+ Make patch release explicit and not a magic part of "retry" status
+ https://bugs.webkit.org/show_bug.cgi?id=47909
+
+ This moves us another step closer to running r+ patches on the EWS bots.
+ Currently all bots just spam /update-work-items with their list of current
+ work items. queues.webkit.org uses that data for display. As part of making
+ the EWS run r+ patches, we're moving the official list of patches-to-process
+ into the server, and feeding them out to bots one at a time. We need to be
+ able to remove patches from the queues one at a time instead of just spamming
+ /update-work-items with a new complete list. That's what this patch adds.
+
+ * QueueStatusServer/handlers/nextpatch.py:
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/handlers/releasepatch.py: Added.
+ * QueueStatusServer/handlers/statusbubble_unittest.py:
+ - Fix a typo causing test failure. This was not caught by the bots
+ because they don't have AppEngineLauncher installed and thus don't run
+ the QueueStatusServer tests.
+ * QueueStatusServer/handlers/updatestatus.py:
+ * QueueStatusServer/model/activeworkitems.py:
+ * QueueStatusServer/templates/releasepatch.html: Added.
+ * Scripts/webkitpy/common/net/statusserver.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- Add ARIA "Live Region" support
- https://bugs.webkit.org/show_bug.cgi?id=33117
+2010-10-19 Eric Seidel <eric@webkit.org>
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ Reviewed by Adam Barth.
-2010-01-04 Chris Fleizach <cfleizach@apple.com>
+ cr-mac bubble has caused status bubbles to wrap
+ https://bugs.webkit.org/show_bug.cgi?id=47928
- Reviewed by Darin Adler.
+ We now have too many EWSes to fit in the bugs.webkit.org
+ status-bubble iframe when more than a couple EWS builds are pending.
+ To fix this I've reduced the space taken up by queue position,
+ and also moved cr-mac to the end of the list (since it's going to be
+ triple-digits for a while).
- Add ARIA "Live Region" support
- https://bugs.webkit.org/show_bug.cgi?id=33117
+ * QueueStatusServer/model/queues.py:
+ * QueueStatusServer/templates/statusbubble.html:
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (indexOfChildCallback):
- (boolAttributeValueCallback):
- (stringAttributeValueCallback):
- (addNotificationListenerCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::indexOfChild):
- (AccessibilityUIElement::stringAttributeValue):
- (AccessibilityUIElement::boolAttributeValue):
- (AccessibilityUIElement::addNotificationListener):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::indexOfChild):
- (AccessibilityUIElement::stringAttributeValue):
- (AccessibilityUIElement::boolAttributeValue):
- (_accessibilityNotificationCallback):
- (AccessibilityUIElement::addNotificationListener):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::indexOfChild):
- (AccessibilityUIElement::stringAttributeValue):
- (AccessibilityUIElement::boolAttributeValue):
- (AccessibilityUIElement::addNotificationListener):
+2010-10-19 Kenneth Russell <kbr@google.com>
-2010-01-04 Eric Seidel <eric@webkit.org>
+ Reviewed by David Levin.
- Reviewed by Adam Barth.
+ chromium_gpu port of new-run-webkit-tests must search chromium-gpu directory for expectations
+ https://bugs.webkit.org/show_bug.cgi?id=47874
+
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py:
+
+2010-10-19 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] DumpRenderTree shouldn't put '.' in include path
+ https://bugs.webkit.org/show_bug.cgi?id=47877
+
+ Fix include paths.
+
+ * DumpRenderTree/chromium/AccessibilityController.cpp:
+ * DumpRenderTree/chromium/AccessibilityUIElement.cpp:
+ * DumpRenderTree/chromium/AccessibilityUIElement.h:
+ * DumpRenderTree/chromium/CppBoundClass.cpp:
+ * DumpRenderTree/chromium/CppVariant.cpp:
+ * DumpRenderTree/chromium/CppVariant.h:
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
+ * DumpRenderTree/chromium/DRTDevToolsCallArgs.h:
+ * DumpRenderTree/chromium/DRTDevToolsClient.cpp:
+ * DumpRenderTree/chromium/DRTDevToolsClient.h:
+ * DumpRenderTree/chromium/EventSender.cpp:
+ * DumpRenderTree/chromium/EventSender.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/MockSpellCheck.cpp:
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
+ * DumpRenderTree/chromium/NotificationPresenter.h:
+ * DumpRenderTree/chromium/PlainTextController.cpp:
+ * DumpRenderTree/chromium/Task.cpp:
+ * DumpRenderTree/chromium/TestNavigationController.h:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ * DumpRenderTree/chromium/TestWebWorker.h:
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ * DumpRenderTree/chromium/WebPreferences.h:
+ * DumpRenderTree/chromium/WebThemeEngineDRT.cpp:
+ * DumpRenderTree/chromium/WebThemeEngineDRT.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ * DumpRenderTree/chromium/WebViewHost.h:
+
+2010-10-19 Sam Weinig <sam@webkit.org>
- bugzilla-tool rollout should require a reason
- https://bugs.webkit.org/show_bug.cgi?id=30810
+ Reviewed by Dan Bernstein.
- * Scripts/webkitpy/changelogs.py: Add support for a reason, add auto-wrapping logic.
- * Scripts/webkitpy/changelogs_unittest.py: Test reason support.
- * Scripts/webkitpy/commands/download.py: rollout now requires a reason, remove unused BUGID argument
- * Scripts/webkitpy/commands/download_unittest.py: pass required reason
- * Scripts/webkitpy/steps/preparechangelogforrevert.py: pass reason to update_for_revert
+ Need to include WKErrorRef in the WKPageDidFail... functions
+ https://bugs.webkit.org/show_bug.cgi?id=47871
-2010-01-04 Jon Honeycutt <jhoneycutt@apple.com>
+ Update tools for new parameter in failure callbacks.
- MSAA: <select> elements should broadcast value change events
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (didFailProvisionalLoadWithErrorForFrame):
+ (didFailLoadWithErrorForFrame):
+ (-[BrowserWindowController updateProvisionalURLForFrame:]):
+ * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp:
+ (TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
- https://bugs.webkit.org/show_bug.cgi?id=33088
+2010-10-19 Luiz Agostini <luiz.agostini@openbossa.org>
- <rdar://problem/7332364>
+ Reviewed by Antti Koivisto.
- Reviewed by Darin Adler.
+ [Qt] WebKit2 MacOS build fix
+ https://bugs.webkit.org/show_bug.cgi?id=47897
- * DumpRenderTree/AccessibilityController.cpp:
- (logValueChangeEventsCallback):
- Start logging value change events.
- (AccessibilityController::getJSClass):
- Add a "logValueChangeEvents" to the AccessibilityController's JS class
- definition.
- (AccessibilityController::resetToConsistentState):
- Disable logging of value change events.
-
- * DumpRenderTree/AccessibilityController.h:
- Declare setLogValueChangeEvents(), and add a member variable for the
- value change event hook.
-
- * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
- (AccessibilityController::setLogValueChangeEvents):
- Stubbed.
+ Qt WebKit2 MacOS build fix.
- * DumpRenderTree/mac/AccessibilityControllerMac.mm:
- (AccessibilityController::setLogValueChangeEvents):
- Stubbed.
+ * WebKitTestRunner/PlatformWebView.h:
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
- * DumpRenderTree/win/AccessibilityControllerWin.cpp:
- (AccessibilityController::AccessibilityController):
- Initialize new member var.
- (AccessibilityController::~AccessibilityController):
- Disable logging of value change events.
- (logEventProc):
- When we receive an EVENT_OBJECT_VALUECHANGE, log the name of the object
- and its value.
- (AccessibilityController::setLogValueChangeEvents):
- If disabling logging, unhook the event, and clear the event hook
- member var. Otherwise, query for the root element to enable
- accessibility, and hook EVENT_OBJECT_VALUECHANGE.
-
-2010-01-04 Adam Barth <abarth@webkit.org>
+2010-10-19 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- long_help for submit-patch
- https://bugs.webkit.org/show_bug.cgi?id=33184
+ webkit-patch stats the filesystem too many times
+ https://bugs.webkit.org/show_bug.cgi?id=47883
- * Scripts/webkitpy/commands/upload.py:
+ This patch attempts to cache the list of changed files more agressively
+ and to use that list to compute the diff instead of stating the file
+ system again.
-2010-01-04 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/editchangelog.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
- Reviewed by Eric Seidel.
+2010-10-19 David Kilzer <ddkilzer@apple.com>
- commit-queue can wrongly reject patches if the buildbots are behind
- https://bugs.webkit.org/show_bug.cgi?id=30098
+ <http://webkit.org/b/47741> Make sort-Xcode-project-file a little more friendly
- Check to make sure we can currently build and test before trying to
- land a patch.
+ Reviewed by Darin Adler.
- * Scripts/webkitpy/commands/queues.py:
+ * Scripts/sort-Xcode-project-file:
+ - Don't print an error message about missing arguments when
+ -h|--help is used.
+ - Allow Xcode project files to be specified as Project.xcodeproj
+ instead of Project.xcodeproj/project.pbxproj.
-2010-01-04 Adam Roben <aroben@apple.com>
+2010-10-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
- Add a test harness for the Windows WebKit API, and a few tests
+ Reviewed by Andreas Kling.
- We currently only have tests for a handful of bugs regarding WebView
- destruction, but more tests can easily be added later. Eventually
- we'll run these tests as part of run-webkit-tests.
+ [Qt] QtTestBrowser: Prevent calling load() directly from loadFinished() in robot mode.
+ https://bugs.webkit.org/show_bug.cgi?id=47809
- Fixes <http://webkit.org/b/33167>.
+ Connecting a call to load from the loadFinished signal can cause
+ re-entrance crashes in WebCore. This patch uses a timer to do so,
+ also giving some time to subsequent frames to finish loading.
- Reviewed by Sam Weinig.
+ * QtTestBrowser/urlloader.cpp:
+ (UrlLoader::UrlLoader):
+ (UrlLoader::loadNext):
+ (UrlLoader::checkIfFinished):
+ (UrlLoader::frameLoadStarted):
+ (UrlLoader::frameLoadFinished):
+ * QtTestBrowser/urlloader.h:
- * WebKitAPITest/HostWindow.cpp: Added.
- (WebKitAPITest::HostWindow::HostWindow): Initialize m_window.
- (WebKitAPITest::HostWindow::~HostWindow): Destroy our window if
- needed.
- (WebKitAPITest::HostWindow::initialize): Create our window.
- (WebKitAPITest::HostWindow::clientRect): Return our window's client
- rect.
- (WebKitAPITest::HostWindow::registerWindowClass): Does what it says.
- (WebKitAPITest::HostWindow::wndProc): Just call through to
- DefWindowProcW.
-
- * WebKitAPITest/HostWindow.h: Added.
- (WebKitAPITest::HostWindow::window): Simple getter.
-
- * WebKitAPITest/Test.h: Added. This file defines some macros useful
- for writing tests.
-
- * WebKitAPITest/TestsController.cpp: Added.
- (WebKitAPITest::TestsController::TestsController): Initialize our
- members.
- (WebKitAPITest::TestsController::shared): Return the shared instance.
- (WebKitAPITest::TestsController::runAllTests): Run a message pump
- until a WM_QUIT message is received, then return whether all tests
- succeeded.
- (WebKitAPITest::TestsController::addTest): Add the test to m_tests and
- start running tests soon.
- (WebKitAPITest::TestsController::testFailed): Record the failure and
- print a message about it to stdout.
- (WebKitAPITest::TestsController::runNextTest): If we don't have any
- tests to run, post a WM_QUIT message to stop the message pump.
- Otherwise, run the test and print whether it passed, then schedule the
- next test.
- (WebKitAPITest::TestsController::runNextTestSoon): Set a 0-delay timer
- to run the next test.
- (WebKitAPITest::TestsController::registerWindowClass): Does what it
- says.
- (WebKitAPITest::TestsController::wndProc): If the runNextTestTimer
- fired, call runNextTest(). Pass everything else through to
- DefWindowProcW.
-
- * WebKitAPITest/TestsController.h: Added.
-
- * WebKitAPITest/WebKitAPITest.vcproj: Added.
-
- * WebKitAPITest/WebKitAPITestCommon.vsprops: Added.
-
- * WebKitAPITest/main.cpp: Added.
- (main): (Mostly) just calls TestsController::runAllTests.
-
- * WebKitAPITest/tests/WebViewDestruction.cpp: Added.
- (WebKitAPITest::WebKitCreateInstance): Helper function template to
- call through to the real WebKitCreateInstance.
- (WebKitAPITest::webViewCount): Helper function to call through to
- IWebKitStatistics::webViewCount.
- (WebKitAPITest::createWebView): Helper function to create a WebView
- and put it inside a HostWindow.
- (WebKitAPITest::runMessagePump): Helper function to run a message pump
- for a specified number of milliseconds, or until a WM_QUIT message is
- received.
- (WebKitAPITest::CloseWithoutDestroyWindow): Test for
- <http://webkit.org/b/32827>.
- (WebKitAPITest::MainFrameAfterClose): Test for
- <http://webkit.org/b/32868>.
- (WebKitAPITest::NoCloseOrDestroyWindow): Test for
- <http://webkit.org/b/33162>.
-
-2010-01-04 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+2010-10-19 Sergio Villar Senín <svillar@igalia.com>
- Reviewed by David Kilzer.
+ Reviewed by Xan Lopez.
- Add support for Git's "diff.mnemonicprefix" config option to WebKitTools
+ [GTK] http/history tests are failing
+ https://bugs.webkit.org/show_bug.cgi?id=36173
- https://bugs.webkit.org/show_bug.cgi?id=32820
+ Clear the history each time a test is run. Return the actual
+ history item count when calling
+ LayoutTestController::webHistoryItemCount
- * Scripts/VCSUtils.pm:
- * Scripts/svn-apply:
- * Scripts/svn-unapply:
- * Scripts/test-webkitperl: Run gitdiff2svndiff test
- * Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl: Added.
- * Scripts/webkitpy/diff_parser.py:
- * Scripts/webkitpy/diff_parser_unittest.py:
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::webHistoryItemCount):
-2010-01-04 Chris Jerdonek <chris.jerdonek@gmail.com>
+2010-10-18 Eric Seidel <eric@webkit.org>
- Reviewed by David Kilzer.
+ Reviewed by Adam Barth.
+
+ Add Chromium Mac EWS to the list of queues at queues.webkit.org
+ https://bugs.webkit.org/show_bug.cgi?id=47878
- Divided the Perl unit tests into separate files and put
- them in a separate directory, and renamed test-webkit-perl
- to test-webkitperl.
+ * QueueStatusServer/model/queues.py:
- https://bugs.webkit.org/show_bug.cgi?id=33124
+2010-10-18 Eric Seidel <eric@webkit.org>
- * Scripts/VCSUtils.pm:
- - Renamed generateRunPatchCommand() to generatePatchCommand().
+ Reviewed by Adam Barth.
- * Scripts/VCSUtils_unittest.pl: Removed.
- - Divided into three files in Scripts/webkitperl/VCSUtils_unittest.
+ queues.webkit.org/next_patch is always 404
+ https://bugs.webkit.org/show_bug.cgi?id=47881
- * Scripts/test-webkit-perl: Removed.
- - Renamed to test-webkitperl.
+ With the addition of the Queue class, I changed most of the
+ code to lookup WorkItems using get_or_insert with a key_name
+ instead of WorkItems.all().filter(queue_name=).
+ Because the new get_or_insert code uses an explicit key_name
+ (which is obviously different from the previously autogenerated
+ ones), there were new WorkItem records created for each queue.
+ However, some parts of the code still use WorkItems.all().filter,
+ thus some parts were getting the new record and some parts the old record.
- * Scripts/test-webkit-scripts:
- - Updated paths to test-webkitpy and test-webkitperl.
+ The same basic bug was occurring with ActiveWorkItems, because I
+ changed the key_name for that class as well.
- * Scripts/test-webkitperl: Copied from Scripts/test-webkit-perl.
- - Added paths to new test files.
+ To fix this I've moved more of the code over to using Queue.*work_items.
+ I've also enabled the datastore_admin (new in GAE 1.3.8) so that
+ we can go delete the old WorkItems records.
+ I also changed remote_api to use the new builtin: syntax (also added in GAE 1.3.8).
- * Scripts/webkitperl: Added.
- * Scripts/webkitperl/VCSUtils_unittest: Added.
- * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl: Added.
- * Scripts/webkitperl/VCSUtils_unittest/generatePatchCommand.pl: Added.
- * Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl: Copied from Scripts/VCSUtils_unittest.pl.
+ * QueueStatusServer/app.yaml:
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/handlers/recentstatus.py:
+ * QueueStatusServer/handlers/updatestatus.py:
+ * QueueStatusServer/handlers/updateworkitems.py:
-2010-01-04 Eric Seidel <eric@webkit.org>
+2010-10-18 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- Make bugzilla-tool rollout include a bug link in the ChangeLog entry
- https://bugs.webkit.org/show_bug.cgi?id=33146
-
- One more step towards better rollouts.
+ Correct a bunch of typos in QueueStatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=47880
- * Scripts/webkitpy/changelogs.py:
- * Scripts/webkitpy/changelogs_unittest.py:
- * Scripts/webkitpy/steps/preparechangelogforrevert.py:
+ These are all due to our complete lack of unit testing in QueueStatusServer.
+ I added a couple unit tests to cover a few of these fixes, but most of these
+ are still only caught by actually running the application.
-2010-01-04 Adam Barth <abarth@webkit.org>
+ * QueueStatusServer/handlers/nextpatch.py:
+ * QueueStatusServer/handlers/statusbubble.py:
+ * QueueStatusServer/handlers/statusbubble_unittest.py: Added.
+ * QueueStatusServer/handlers/updateworkitems.py:
+ * QueueStatusServer/model/attachment.py:
+ * QueueStatusServer/model/queuepropertymixin.py:
+ * QueueStatusServer/model/queuepropertymixin_unittest.py:
+ * QueueStatusServer/model/workitems.py:
+ * QueueStatusServer/model/workitems_unittest.py: Added.
- Reviewed by Eric Seidel.
+2010-10-18 Adam Barth <abarth@webkit.org>
- Sort the step options
- https://bugs.webkit.org/show_bug.cgi?id=33144
+ Disable this test because it's failing on the bots and the authors
+ aren't around to fix it.
- * Scripts/webkitpy/steps/options.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
-2010-01-04 Eric Seidel <eric@webkit.org>
+2010-10-18 Adam Barth <abarth@webkit.org>
- Reviewed by Adam Barth.
+ Reviewed by Eric Seidel.
- Need support for longer text in per-command help
- https://bugs.webkit.org/show_bug.cgi?id=33143
+ CC authors of flaky tests when the commit-queue hits a flaky test
+ https://bugs.webkit.org/show_bug.cgi?id=47872
- Add some minimal additional help to land-diff and
- pave the way for adding better help to all commands.
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/net/layouttestresults.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- * Scripts/webkitpy/commands/download.py: Add small amount of additional help to land-diff
- * Scripts/webkitpy/multicommandtool.py: support long_help
- * Scripts/webkitpy/multicommandtool_unittest.py: test long_help
+2010-10-18 Eric Seidel <eric@webkit.org>
-2010-01-04 Adam Barth <abarth@webkit.org>
+ Reviewed by Adam Barth.
- Reviewed by Eric Seidel.
+ Make it possible to run a chromium-mac-ews builder
+ https://bugs.webkit.org/show_bug.cgi?id=47876
- Add unit test for MarkBugFixed
- https://bugs.webkit.org/show_bug.cgi?id=33142
+ Since we can't run Mac OS X in a VM, we need to only run committer patches.
+ There was a multiple inheritance problem which was holding this patch back,
+ but I decided to just ignore the problem and go with a functional hack for now.
- MarkBugFixed is way behind in command technology, but it still needs a
- unit test, as the FIXME commands.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
- Also, remove mark-bug-fixed and create-bug from main help since we have
- more modern commands to replace them.
+2010-10-18 Kenneth Russell <kbr@google.com>
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/commands/upload_unittest.py:
- * Scripts/webkitpy/mock_bugzillatool.py:
+ Reviewed by Tony Chang.
-2010-01-04 Adam Barth <abarth@webkit.org>
+ Regression in run_webkit_tests_unittest from r70017
+ https://bugs.webkit.org/show_bug.cgi?id=47875
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- Add missing unit test for CommitMessageForCurrentDiff
- https://bugs.webkit.org/show_bug.cgi?id=33141
+2010-10-18 Adam Barth <abarth@webkit.org>
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/commands/upload_unittest.py:
+ Reviewed by Eric Seidel.
-2010-01-04 Adam Barth <abarth@webkit.org>
+ Implement webkit-patch suggest-reviewers
+ https://bugs.webkit.org/show_bug.cgi?id=47866
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ - The main logic. We look at the last five changes to each
+ modified (non-ChangeLog) file and collect up the reviewers of
+ those changes as well as the authors of those changes who are
+ reviewers.
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ - Test the logic with some fun mocks.
+ * Scripts/webkitpy/common/checkout/scm.py:
+ - Fix a bug when you have local git commits.
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ - Test that the bug is fixed.
+ * Scripts/webkitpy/tool/commands/queries.py:
+ - Add the query.
+
+2010-10-18 Kenneth Russell <kbr@google.com>
Reviewed by Eric Seidel.
- Remove raw_input from queues in favor of user.prompt
- https://bugs.webkit.org/show_bug.cgi?id=33140
-
- This lets up properly mock out the user interaction instead of hacking
- around it with the options.
+ new-run-webkit-tests produces corrupt PNG baselines on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=47867
- * Scripts/webkitpy/commands/queues.py:
- * Scripts/webkitpy/commands/queuestest.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
-2010-01-04 Eric Seidel <eric@webkit.org>
+2010-10-18 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- bugzilla-tool should not require users to install mechanize
- https://bugs.webkit.org/show_bug.cgi?id=32635
+ Make it possible to submit patches to the EWS bots
+ https://bugs.webkit.org/show_bug.cgi?id=47869
- * Scripts/webkitpy/__init__.py: Add missing declaration for ClientForm (which mechanize requires).
+ * QueueStatusServer/handlers/nextpatch.py:
+ - Move more logic into Queue, so that it can be shared with SubmitToEWS.
+ * QueueStatusServer/handlers/queuestatus.py:
+ - Fix two typos from a previous commit.
+ * QueueStatusServer/handlers/submittoews.py: Added.
+ * QueueStatusServer/handlers/updatestatus.py:
+ - Use the new is_retry_request method to share this (hacky) code with SubmitToEWS
+ * QueueStatusServer/main.py:
+ - Add /submit-to-ews
+ * QueueStatusServer/model/queuepropertymixin.py:
+ - Fix circular imports caused by adding Queue.work_items()
+ * QueueStatusServer/model/queues.py:
+ - Add work_items() and active_work_items()
+ * QueueStatusServer/model/queuestatus.py:
+ * QueueStatusServer/model/workitems.py:
+ - Add transaction-safe add/remove methods.
+ * QueueStatusServer/templates/submittoews.html: Added.
-2010-01-04 Eric Seidel <eric@webkit.org>
+2010-10-18 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- bugzilla-tool should not require users to install mechanize
- https://bugs.webkit.org/show_bug.cgi?id=32635
+ Deploy Queue class in more places throughout QueueStatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=47855
- Use the nifty "autoinstall" module from Daniel Krech:
- http://pypi.python.org/pypi/autoinstall/0.2
- http://code.google.com/p/pyautoinstall/
- It's available under a WebKit-compatible BSD license.
+ I also caught two typos from the previous change. Unfortunately
+ I don't yet know how to unittest request handlers yet.
- * Scripts/webkitpy/__init__.py:
- - bind "mechanize" to an autoinstall importer which will
- auto-download mechanize if necessary.
- * Scripts/webkitpy/autoinstall.py: Added.
- * Scripts/webkitpy/bugzilla.py: use "mechanize" instead of webkit_mechanize
- * Scripts/webkitpy/statusbot.py: ditto.
- * Scripts/webkitpy/webkit_mechanize.py: Removed.
+ * QueueStatusServer/handlers/dashboard.py:
+ * QueueStatusServer/handlers/statusbubble.py:
+ * QueueStatusServer/handlers/updateworkitems.py:
+ * QueueStatusServer/model/activeworkitems.py:
+ * QueueStatusServer/model/attachment.py:
+ * QueueStatusServer/model/queuepropertymixin.py: Added.
+ * QueueStatusServer/model/queuepropertymixin_unittest.py: Added.
+ * QueueStatusServer/model/queuestatus.py:
+ * QueueStatusServer/model/workitems.py:
-2010-01-04 Adam Barth <abarth@webkit.org>
+2010-10-18 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- [bzt] Move AbstractSequencedCommand to a more general location
- https://bugs.webkit.org/show_bug.cgi?id=33137
+ scm.py should be able tell us what revisions made changes to a given file
+ https://bugs.webkit.org/show_bug.cgi?id=47863
- I do what the FIXME tell me to do.
+ Look again, your SCM.py can now log files.
- * Scripts/webkitpy/commands/abstractsequencedcommand.py: Added.
- * Scripts/webkitpy/commands/download.py:
- * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
-2010-01-04 Adam Barth <abarth@webkit.org>
+2010-10-18 Dirk Pranke <dpranke@chromium.org>
- Reviewed by Eric Seidel.
-
- Rename StatusBot to StatusServer
- https://bugs.webkit.org/show_bug.cgi?id=33139
+ Reviewed by Eric Siedel.
- It's not a bot. It's a server.
+ new-run-webkit-tests: clean up the options-parsing code in the port
+ classes.
+
+ This change modifies the Port interface to have a get_option() and
+ set_option_default() method for accessing the options argument
+ passed to the constructor. If the constructor is not passed an
+ options argument, we default to a MockOptions() argument from
+ mocktool, which has the same semantics we want.
+
+ Note that there is a disadvantage to port.get_option('foo') over
+ port._options.foo, which is that you lose some of the checking
+ for whether 'foo' is set (typos result in the default value, not
+ an exception being raised. This is desired in this case, since the
+ Port class is not allowed to assume that options does have any
+ particular values set, and so this change ensures that all of
+ the subclasses are following the same, intended, logic.
+
+ Arguably this is the wrong semantics to have, and the Port
+ classes should be able to assume a default set of
+ attributes/arguments, but that change will need to wait for a
+ different CL where we can modify new-run-webkit-tests to pull a
+ list of arguments from the port factory routines.
+
+ Also, add unit tests for webkitpy.tool.mocktool.MockOptions .
+
+ https://bugs.webkit.org/show_bug.cgi?id=47510
- * Scripts/bugzilla-tool:
- * Scripts/webkitpy/bugzilla.py:
- * Scripts/webkitpy/commands/early_warning_system.py:
- * Scripts/webkitpy/commands/queues.py:
- * Scripts/webkitpy/mock_bugzillatool.py:
- * Scripts/webkitpy/queueengine.py:
- * Scripts/webkitpy/statusbot.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ * Scripts/webkitpy/layout_tests/port/factory_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
+ * Scripts/webkitpy/tool/mocktool_unittest.py: Added.
-2010-01-04 Adam Barth <abarth@webkit.org>
+2010-10-18 Dirk Pranke <dpranke@chromium.org>
Reviewed by Eric Seidel.
- [bzt] submit-pach should have a -o/--open option to open the bug after submit
- https://bugs.webkit.org/show_bug.cgi?id=33136
+ Re-submit a revised version of r69638 - enabling new-run-webkit-tests
+ under cygwin. The initial version had a bug in base:uri_to_test_name
+ that was causing tests to fail. This version corrects that bug, but
+ also makes the code safer by calling cygpath more reliably, and
+ leaving a long-running cygpath process open.
- Python makes this very easy.
+ This patch also corrects a couple of minor bugs in http_lock_unittest,
+ chromium_unittest, and dedpulicate_tests_unittest that showed up
+ while testing this.
- * Scripts/webkitpy/mock_bugzillatool.py:
- * Scripts/webkitpy/steps/options.py:
- * Scripts/webkitpy/steps/postdiff.py:
- * Scripts/webkitpy/user.py:
+ https://bugs.webkit.org/show_bug.cgi?id=47220
-2010-01-04 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/common/system/path.py:
+ * Scripts/webkitpy/common/system/path_unittest.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/http_lock_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- Reviewed by Eric Seidel.
+2010-10-18 Eric Seidel <eric@webkit.org>
- [bzt] Move steps to a submodule
- https://bugs.webkit.org/show_bug.cgi?id=33135
+ Reviewed by Adam Barth.
- For great victory. This will probably introduce some regressions
- because our test coverage isn't perfect, but I've tried to be careful.
+ Add Queue class and add minimal unittesting of QueueStatusServer code
+ https://bugs.webkit.org/show_bug.cgi?id=47847
+ * QueueStatusServer/handlers/dashboard.py:
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/handlers/recentstatus.py:
+ * QueueStatusServer/handlers/statusbubble.py:
+ * QueueStatusServer/handlers/updateworkitems.py:
+ * QueueStatusServer/model/attachment.py:
+ * QueueStatusServer/model/queues.py:
+ * QueueStatusServer/model/queues_unittest.py: Added.
+ * QueueStatusServer/model/svnrevision.py:
* Scripts/test-webkitpy:
- * Scripts/webkitpy/buildsteps.py: Removed.
- * Scripts/webkitpy/buildsteps_unittest.py: Removed.
- * Scripts/webkitpy/commands/download.py:
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/steps/__init__.py: Added.
- * Scripts/webkitpy/steps/abstractstep.py: Added.
- * Scripts/webkitpy/steps/applypatch.py: Added.
- * Scripts/webkitpy/steps/applypatchwithlocalcommit.py: Added.
- * Scripts/webkitpy/steps/build.py: Added.
- * Scripts/webkitpy/steps/checkstyle.py: Added.
- * Scripts/webkitpy/steps/cleanworkingdirectory.py: Added.
- * Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py: Added.
- * Scripts/webkitpy/steps/closebug.py: Added.
- * Scripts/webkitpy/steps/closebugforlanddiff.py: Added.
- * Scripts/webkitpy/steps/closepatch.py: Added.
- * Scripts/webkitpy/steps/commit.py: Added.
- * Scripts/webkitpy/steps/completerollout.py: Added.
- * Scripts/webkitpy/steps/confirmdiff.py: Added.
- * Scripts/webkitpy/steps/createbug.py: Added.
- * Scripts/webkitpy/steps/editchangelog.py: Added.
- * Scripts/webkitpy/steps/ensurebuildersaregreen.py: Added.
- * Scripts/webkitpy/steps/ensurelocalcommitifneeded.py: Added.
- * Scripts/webkitpy/steps/metastep.py: Added.
- * Scripts/webkitpy/steps/obsoletepatches.py: Added.
- * Scripts/webkitpy/steps/options.py: Added.
- * Scripts/webkitpy/steps/postdiff.py: Added.
- * Scripts/webkitpy/steps/preparechangelog.py: Added.
- * Scripts/webkitpy/steps/preparechangelogforrevert.py: Added.
- * Scripts/webkitpy/steps/promptforbugortitle.py: Added.
- * Scripts/webkitpy/steps/revertrevision.py: Added.
- * Scripts/webkitpy/steps/runtests.py: Added.
- * Scripts/webkitpy/steps/steps_unittest.py: Added.
- * Scripts/webkitpy/steps/update.py: Added.
- * Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py: Added.
- * Scripts/webkitpy/steps/updatechangelogswithreviewer.py: Added.
- * Scripts/webkitpy/stepsequence.py:
-
-2010-01-04 Daniel Bates <dbates@webkit.org>
-
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/test/main.py:
- https://bugs.webkit.org/show_bug.cgi?id=33097
+2010-10-18 Anders Carlsson <andersca@apple.com>
- Cleans up the File menu to better conform to the File menu in Safari
- both in terms of options and keyboard shortcuts. Adds a "Quit" menu
- options to close all open windows. Also, renames the Tools menu to
- Develop.
+ Fix build.
- * QtLauncher/main.cpp:
- (MainWindow::setupUI):
-
-2010-01-04 Daniel Bates <dbates@webkit.org>
-
- https://bugs.webkit.org/show_bug.cgi?id=33039
-
- Unreviewed fix.
-
- * Scripts/webkitpy/credentials.py:
- * Scripts/webkitpy/credentials_unittest.py:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (handleEventCarbon):
-2010-01-04 Daniel Bates <dbates@webkit.org>
+2010-10-18 Stuart Morgan <stuartmorgan@chromium.org>
Reviewed by Eric Seidel.
- https://bugs.webkit.org/show_bug.cgi?id=33039
+ Switch to using the new Carbon NPAPI event declarations, and remove
+ the old ones.
- [bzt] Second attempt to fix an issue where bugzilla-tool dies
- when the keychain lookup fails to find an entry for bugs.webkit.org.
+ https://bugs.webkit.org/show_bug.cgi?id=40784
- * Scripts/webkitpy/credentials.py:
- * Scripts/webkitpy/credentials_unittest.py:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (handleEventCarbon):
-2010-01-04 Eric Seidel <eric@webkit.org>
+2010-10-18 David Levin <levin@chromium.org>
Reviewed by Adam Barth.
- Make Rollout an AbstractSequencedCommmand
- https://bugs.webkit.org/show_bug.cgi?id=33133
+ check-webkit-style should treat the GObject binding directory like other GTK directories.
+ https://bugs.webkit.org/show_bug.cgi?id=47796
- As suggested by Adam in:
- https://bugs.webkit.org/show_bug.cgi?id=33131#c2
+ * Scripts/webkitpy/style/checker.py: Added the GObject binding directory
+ with the other gtk directories (and fixed typo).
- * Scripts/webkitpy/commands/download.py:
+2010-10-18 David Levin <levin@chromium.org>
-2010-01-04 Eric Seidel <eric@webkit.org>
+ Reviewed by Oliver Hunt.
- Reviewed by Adam Barth.
+ check-webkit-style needs to ignore underscores in opcode names and vm_throw
+ https://bugs.webkit.org/show_bug.cgi?id=47789
- Make all commands AbstractDeclarativeCommmands instead of direct Command subclasses
- https://bugs.webkit.org/show_bug.cgi?id=33131
+ * Scripts/webkitpy/style/checker.py: Added the exception for the assembler directory.
+ * Scripts/webkitpy/style/checkers/cpp.py: Added special cased names.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Added unit tests for the special cases.
- Evenetually we'll probably roll AbstractDeclarativeCommmand directly into Command
- but for now we just deploy it everywhere and don't try to fix up the few valid uses
- of Command.
+2010-10-18 MORITA Hajime <morrita@google.com>
- * Scripts/webkitpy/commands/download.py:
- * Scripts/webkitpy/commands/queries.py:
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/multicommandtool.py:
+ Reviewed by Kent Tamura.
-2010-01-03 Adam Barth <abarth@webkit.org>
+ TextInputController.hasSpellingMarkers() should be owned by LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=47659
+
+ Moved hasSpellingMarkers() from TextInputController to
+ LayoutTestController. Currently the implementation is available
+ only for Mac and for Chromium.
- Unreviewed "build" fix. Need to import ScriptError.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (hasSpellingMarkerCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::hasSpellingMarker):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::TextInputController):
+ (TextInputController::makeAttributedString):
+ * DumpRenderTree/chromium/TextInputController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::hasSpellingMarker):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::hasSpellingMarker):
+ * DumpRenderTree/mac/TextInputController.m:
+ (+[TextInputController isSelectorExcludedFromWebScript:]):
+ (+[TextInputController webScriptNameForSelector:]):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::hasSpellingMarker):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::hasSpellingMarker):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::hasSpellingMarker):
- * Scripts/webkitpy/buildsteps.py:
+2010-10-18 Adam Barth <abarth@webkit.org>
-2010-01-03 Adam Barth <abarth@webkit.org>
+ Reviewed by David Levin.
- Reviewed by Eric Seidel.
+ commit-queue's flaky test notice is very Pythony
+ https://bugs.webkit.org/show_bug.cgi?id=47790
- [bzt] Make it easier to run submit-patch when previous run cancelled
- https://bugs.webkit.org/show_bug.cgi?id=33070
+ This patch make the list of tests delimted by \n instead of just
+ converting the array to a string.
- This patch renames create-review to submit-patch (as requested by
- Maciej).
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- This patch makes it easier to run submit-patch after the user has
- already cancelled a previous run of submit-patch by detecting when we
- already have ChangeLogs and reading the bug number from them (and not
- attempting to recreate them). Aside from performance and the extra
- edit step, this command should not subsume post-dif.
+2010-10-14 Antonio Gomes <agomes@rim.com>
- Also, added a --email command line argument so that the output of
- prepare-ChangeLog makes sense when it can't find the user's email
- address.
+ Reviewed by Martin Robinson and Xan Lopez.
- * Scripts/webkitpy/bugzilla.py:
- * Scripts/webkitpy/buildsteps.py:
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/commands/upload_unittest.py:
- * Scripts/webkitpy/mock_bugzillatool.py:
- * Scripts/webkitpy/user.py:
+ [Gtk]: DRT does not support frame flattening testing
+ https://bugs.webkit.org/show_bug.cgi?id=38650
-2010-01-03 Eric Seidel <eric@webkit.org>
+ Implement DRT's support for toggling on/off frame flattening
+ support.
- Reviewed by Adam Barth.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setFrameFlatteningEnabled):
- Rename Scripts/modules to Scripts/webkitpy
- https://bugs.webkit.org/show_bug.cgi?id=33128
+2010-10-15 Dirk Pranke <dpranke@chromium.org>
- Just search-replace and svn mv commands.
+ Reviewed by Eric Siedel.
- * Scripts/bugzilla-tool:
- * Scripts/check-webkit-style:
- * Scripts/modules: Removed.
- * Scripts/modules/BeautifulSoup.py: Removed.
- * Scripts/modules/__init__.py: Removed.
- * Scripts/modules/bugzilla.py: Removed.
- * Scripts/modules/bugzilla_unittest.py: Removed.
- * Scripts/modules/buildbot.py: Removed.
- * Scripts/modules/buildbot_unittest.py: Removed.
- * Scripts/modules/buildsteps.py: Removed.
- * Scripts/modules/buildsteps_unittest.py: Removed.
- * Scripts/modules/changelogs.py: Removed.
- * Scripts/modules/changelogs_unittest.py: Removed.
- * Scripts/modules/commands: Removed.
- * Scripts/modules/commands/__init__.py: Removed.
- * Scripts/modules/commands/commandtest.py: Removed.
- * Scripts/modules/commands/download.py: Removed.
- * Scripts/modules/commands/download_unittest.py: Removed.
- * Scripts/modules/commands/early_warning_system.py: Removed.
- * Scripts/modules/commands/early_warning_system_unittest.py: Removed.
- * Scripts/modules/commands/queries.py: Removed.
- * Scripts/modules/commands/queries_unittest.py: Removed.
- * Scripts/modules/commands/queues.py: Removed.
- * Scripts/modules/commands/queues_unittest.py: Removed.
- * Scripts/modules/commands/queuestest.py: Removed.
- * Scripts/modules/commands/upload.py: Removed.
- * Scripts/modules/commands/upload_unittest.py: Removed.
- * Scripts/modules/comments.py: Removed.
- * Scripts/modules/committers.py: Removed.
- * Scripts/modules/committers_unittest.py: Removed.
- * Scripts/modules/cpp_style.py: Removed.
- * Scripts/modules/cpp_style_unittest.py: Removed.
- * Scripts/modules/credentials.py: Removed.
- * Scripts/modules/credentials_unittest.py: Removed.
- * Scripts/modules/diff_parser.py: Removed.
- * Scripts/modules/diff_parser_unittest.py: Removed.
- * Scripts/modules/executive.py: Removed.
- * Scripts/modules/executive_unittest.py: Removed.
- * Scripts/modules/grammar.py: Removed.
- * Scripts/modules/mock.py: Removed.
- * Scripts/modules/mock_bugzillatool.py: Removed.
- * Scripts/modules/multicommandtool.py: Removed.
- * Scripts/modules/multicommandtool_unittest.py: Removed.
- * Scripts/modules/outputcapture.py: Removed.
- * Scripts/modules/patchcollection.py: Removed.
- * Scripts/modules/queueengine.py: Removed.
- * Scripts/modules/queueengine_unittest.py: Removed.
- * Scripts/modules/scm.py: Removed.
- * Scripts/modules/scm_unittest.py: Removed.
- * Scripts/modules/statusbot.py: Removed.
- * Scripts/modules/stepsequence.py: Removed.
- * Scripts/modules/style: Removed.
- * Scripts/modules/style.py: Removed.
- * Scripts/modules/style_unittest.py: Removed.
- * Scripts/modules/text_style.py: Removed.
- * Scripts/modules/text_style_unittest.py: Removed.
- * Scripts/modules/user.py: Removed.
- * Scripts/modules/webkit_logging.py: Removed.
- * Scripts/modules/webkit_logging_unittest.py: Removed.
- * Scripts/modules/webkit_mechanize.py: Removed.
- * Scripts/modules/webkitport.py: Removed.
- * Scripts/modules/webkitport_unittest.py: Removed.
- * Scripts/test-webkit-python: Removed.
- * Scripts/test-webkitpy: Copied from WebKitTools/Scripts/test-webkit-python.
- * Scripts/validate-committer-lists:
- * Scripts/webkitpy: Copied from WebKitTools/Scripts/modules.
- * Scripts/webkitpy/bugzilla.py:
- * Scripts/webkitpy/bugzilla_unittest.py:
- * Scripts/webkitpy/buildbot.py:
- * Scripts/webkitpy/buildbot_unittest.py:
- * Scripts/webkitpy/buildsteps.py:
- * Scripts/webkitpy/buildsteps_unittest.py:
- * Scripts/webkitpy/commands/commandtest.py:
- * Scripts/webkitpy/commands/download.py:
- * Scripts/webkitpy/commands/download_unittest.py:
- * Scripts/webkitpy/commands/early_warning_system.py:
- * Scripts/webkitpy/commands/early_warning_system_unittest.py:
- * Scripts/webkitpy/commands/queries.py:
- * Scripts/webkitpy/commands/queries_unittest.py:
- * Scripts/webkitpy/commands/queues.py:
- * Scripts/webkitpy/commands/queues_unittest.py:
- * Scripts/webkitpy/commands/queuestest.py:
- * Scripts/webkitpy/commands/upload.py:
- * Scripts/webkitpy/commands/upload_unittest.py:
- * Scripts/webkitpy/comments.py:
- * Scripts/webkitpy/credentials.py:
- * Scripts/webkitpy/credentials_unittest.py:
- * Scripts/webkitpy/executive.py:
- * Scripts/webkitpy/executive_unittest.py:
- * Scripts/webkitpy/mock_bugzillatool.py:
- * Scripts/webkitpy/multicommandtool.py:
- * Scripts/webkitpy/multicommandtool_unittest.py:
- * Scripts/webkitpy/queueengine.py:
- * Scripts/webkitpy/queueengine_unittest.py:
- * Scripts/webkitpy/scm.py:
- * Scripts/webkitpy/scm_unittest.py:
- * Scripts/webkitpy/statusbot.py:
- * Scripts/webkitpy/stepsequence.py:
- * Scripts/webkitpy/webkit_logging_unittest.py:
- * Scripts/webkitpy/webkitport_unittest.py:
-
-2010-01-03 Chris Jerdonek <chris.jerdonek@gmail.com>
+ mocktool.MockOptions is inheriting from Mock, which has the side
+ effect of defaulting any attribute to another MockObject. So,
+ MockOptions().foo would always evaluate to true. This was
+ covering over bugs in the unit tests, and is probably the wrong
+ default behavior for anything attempting to mock out the options
+ argument returned from optparse.parse_args().
- Reviewed by Eric Seidel.
+ This patch changes the default behavior. The new MockOptions()
+ class takes an optional list of keyword parameters to set; this
+ patch doesn't use that feature but the fix for bug 47510 will.
- Added script to test both Perl and Python, and renamed
- run-webkit-unittests to test-webkit-python.
+ Also, this patch just fills in the default values necessary to
+ get all of the tests to pass; I didn't stare at each test by
+ hand to determine the "right" values. We can either fix that in
+ subsequent patches or let me know if we want to do that now (and
+ give me some guidance on what those values might want to be).
- https://bugs.webkit.org/show_bug.cgi?id=33045
+ https://bugs.webkit.org/show_bug.cgi?id=47709
- * Scripts/VCSUtils_unittest.pl:
- - Tweaked so it can be run from outside Scripts directory.
+ * Scripts/webkitpy/tool/commands/commandtest.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py:
- * Scripts/run-webkit-unittests: Removed.
- - Renamed to test-webkit-python.
+2010-10-15 Simon Fraser <simon.fraser@apple.com>
- * Scripts/test-webkit-perl:
- - Tweaked so it can be run from outside Scripts directory.
+ Fix the build; need to add new slot to PageUIClient callbacks.
- * Scripts/test-webkit-python: Copied from Scripts/run-webkit-unittests.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
- * Scripts/test-webkit-scripts: Added.
- - Runs both test-webkit-perl and test-webkit-python.
+2010-10-15 Simon Fraser <simon.fraser@apple.com>
-2010-01-03 Adam Barth <abarth@webkit.org>
+ Add Matt Delaney to committers.py.
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/common/config/committers.py:
- commit-queue/bugzilla-tool should build both Debug and Release
- https://bugs.webkit.org/show_bug.cgi?id=28450
+2010-10-15 Tony Chang <tony@chromium.org>
- Add a --build-style command that lets the master process tell the child
- process to build both debug and release. Eventually we want to teach
- the test step to understand this option too, but that's a patch for
- another day.
+ Reviewed by Kent Tamura.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/webkitport.py:
- * Scripts/modules/webkitport_unittest.py:
+ [chromium] compile TestNetscapePlugIn on Chromium mac
+ https://bugs.webkit.org/show_bug.cgi?id=47633
-2010-01-03 Jakub Wieczorek <faw217@gmail.com>
+ * DumpRenderTree/DumpRenderTree.gypi: files to compile
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp: Use ifdef because gcc was complaining
+ (NP_GetEntryPoints):
+ (NPP_New):
+ (NPP_Destroy):
+ (NPP_HandleEvent):
+ (NPP_GetValue):
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h: Added.
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h: Added.
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h: Added.
- Reviewed by Eric Seidel.
+2010-10-15 Leandro Pereira <leandro@profusion.mobi>
- [Qt] EventSender: add support for Enter key events
- https://bugs.webkit.org/show_bug.cgi?id=33064
+ Reviewed by Gustavo Noronha Silva.
- Unskip 5 tests that are fixed now.
+ build-webkit: Should die when make fails when build a CMake project
+ https://bugs.webkit.org/show_bug.cgi?id=47726
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::keyDown):
+ * Scripts/webkitdirs.pm: If make fails, die immediately.
-2010-01-03 Adam Barth <abarth@webkit.org>
+2010-10-15 Sheriff Bot <webkit.review.bot@gmail.com>
- Reviewed by Eric Seidel.
+ Unreviewed, rolling out r69809.
+ http://trac.webkit.org/changeset/69809
+ https://bugs.webkit.org/show_bug.cgi?id=47725
- [bzt] Add test for previous typo fix
- https://bugs.webkit.org/show_bug.cgi?id=33083
+ Broke chromium mac compile (Requested by japhet on #webkit).
- A trivial test for a trivial fix, as requested by Eric.
+ * DumpRenderTree/DumpRenderTree.gypi:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NP_GetEntryPoints):
+ (NPP_New):
+ (NPP_Destroy):
+ (NPP_HandleEvent):
+ (NPP_GetValue):
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h: Removed.
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h: Removed.
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h: Removed.
- * Scripts/modules/bugzilla_unittest.py:
+2010-10-15 Adam Barth <abarth@webkit.org>
-2010-01-03 Adam Barth <abarth@webkit.org>
+ Reviewed by Adam Barth.
- Reviewed by Eric Seidel.
+ test-webkitpy fails on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=47713
- Implement mac-ews
- https://bugs.webkit.org/show_bug.cgi?id=33072
+ The old code failed on Linux because the MacPort tries to read
+ something out of platform that doesn't make sense on Linux.
- The mac-ews is slightly different than the other early warning systems
- because we can't run Mac OS X inside a VM. For that reason, we only
- process patches that were uploaded by committers. This isn't as much
- coverage as the other EWS bots, but it's better than nothing.
+ * Scripts/webkitpy/tool/mocktool.py:
- * Scripts/modules/commands/early_warning_system.py:
- * Scripts/modules/commands/early_warning_system_unittest.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/commands/queuestest.py:
- * Scripts/modules/mock_bugzillatool.py:
+2010-10-14 Balazs Kelemen <kbalazs@webkit.org>
-2010-01-03 Chris Jerdonek <chris.jerdonek@gmail.com>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by David Kilzer.
+ [Qt] WTR is sloooow
+ https://bugs.webkit.org/show_bug.cgi?id=47695
- Refactored svn-apply and svn-unapply to use a common "patch"
- command method, and added unit tests for this new method.
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ Change the timer interval of RunUntilConditionLoop from
+ 50 milliseconds to 1 to avoid wasting time after the
+ test had been finished.
- https://bugs.webkit.org/show_bug.cgi?id=33098
+2010-10-14 Eric Seidel <eric@webkit.org>
- * Scripts/VCSUtils.pm:
- - Added generateRunPatchCommand().
- - Added runPatchCommand().
- - Added exitStatus() from webkitdirs.pm to address FIXME.
+ Unreviewed, just fixing an exception seen on the commit-queue.
- * Scripts/VCSUtils_unittest.pl:
- - Added 10 unit tests for generateRunPatchCommand().
- - Added 4 unit tests for runPatchCommand().
- - Added callSilently() method.
+ I should have unit tested this function before.
- * Scripts/svn-apply:
- - Refactored applyPatch().
- - Removed $pathScriptWasRunFrom global variable.
- - Addressed issue where "--force" option was getting added twice.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- * Scripts/svn-unapply:
- - Refactored applyPatch().
- - Removed $pathScriptWasRunFrom global variable.
- - Added support for --force option.
- - Enhanced to return meaningful exit status.
+2010-10-14 Eric Seidel <eric@webkit.org>
- * Scripts/webkitdirs.pm:
- - Moved exitStatus() implementation to VCSUtils.pm.
+ Reviewed by Adam Barth.
-2009-12-31 Adam Barth <abarth@webkit.org>
+ commit-queue should not fail patches due to flaky tests
+ https://bugs.webkit.org/show_bug.cgi?id=47647
+
+ This patch makes it so that the *same* flaky test has to fail
+ twice in a row to have a false negative from a flaky test.
+
+ If different flaky tests fail (or if a test fails and then passes
+ in a second run) then we will warn in the bug that we encountered
+ a flaky test.
+
+ This patch grew to include moving port off of steps onto tool
+ (which Adam wrote and then I integrated), as well as removing the
+ use of tool from CommitQueueTask.
+
+ * Scripts/webkitpy/common/config/ports.py:
+ - Added a layout_test_results_path method. This covers old-run-webkit-tests
+ but doesn't cover NRWT. This is probably not the long term solution, but
+ putting this knowledge on port makes more sense than in LayoutTestResults.
+ * Scripts/webkitpy/common/net/buildbot.py:
+ - LayoutTestResults shouldn't know how to fetch from the network, make
+ the Build code do that instead.
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ - Code style fix.
+ * Scripts/webkitpy/common/net/layouttestresults.py:
+ - Remove code for reading from the network.
+ * Scripts/webkitpy/common/net/layouttestresults_unittest.py:
+ - Test the new entrypoint.
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ - Make the delegate interface explicit.
+ - Remove the _tool member, since using the delegate for
+ everything is cleaner.
+ - Teach the testing logic how to deal with flaky tests.
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+ - Update to match the CommitQueueTask changes.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ - Use the new CommitQueueTaskDelegate interface.
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ - Fix the SecondThoughtsCommitQueue test which was broken.
+ - Add a new test to make sure the flaky test reporting works.
+ * Scripts/webkitpy/tool/main.py:
+ - Store the port on the tool object.
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Add a port() accessor to MockTool
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ - Move port() off of Step and onto Tool.
+ * Scripts/webkitpy/tool/steps/build.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ - Two tests with the same name! only the latter was being run.
+ * Scripts/webkitpy/tool/steps/update.py:
+
+2010-10-14 Dirk Pranke <dpranke@chromium.org>
Reviewed by Eric Seidel.
- [bzt] Implement build-and-test
- https://bugs.webkit.org/show_bug.cgi?id=33073
+ new-run-webkit-tests will now handle missing Ruby installs (or
+ missing PrettyPatch scripts) more cleanly - previously this
+ would be detected when we actually tried to create the diff, and
+ the error message was obscure. Now we'll log a warning up front
+ and otherwise be silent.
- Some of the early warning system bots want to use build-and-test so
- they can cover LayoutTests in addition to just compilation.
+ This change also refactors some global variables to be class or
+ instance variables to be slightly more testable and more
+ modular. There are no cases where we create lots of port objects
+ and can't afford to test for configurations repeatedly, so
+ there's no performance concern here.
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/download_unittest.py:
+ https://bugs.webkit.org/show_bug.cgi?id=47466
-2009-12-31 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
- Reviewed by Eric Seidel.
+2010-10-08 Martin Robinson <mrobinson@igalia.com>
- Show mac-ews status on QueueStatusServer
- https://bugs.webkit.org/show_bug.cgi?id=33076
+ Reviewed by Xan Lopez.
- Also make error status purple.
+ [GTK] Form controls do not respect GTK+ font size
+ https://bugs.webkit.org/show_bug.cgi?id=47134
- * QueueStatusServer/model/attachment.py:
- * QueueStatusServer/model/queues.py:
- * QueueStatusServer/templates/dashboard.html:
- * QueueStatusServer/templates/statusbubble.html:
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeGtkFontSettings): Initialize the font control size when running
+ DumpRenderTree to a standard value.
-2009-12-31 Adam Barth <abarth@webkit.org>
+2010-10-14 Tony Chang <tony@chromium.org>
- Unreviewed.
+ Reviewed by Kent Tamura.
- [bzt] REGRESSION: Bugzila is a typo
- https://bugs.webkit.org/show_bug.cgi?id=33074
+ [chromium] compile TestNetscapePlugIn on Chromium mac
+ https://bugs.webkit.org/show_bug.cgi?id=47633
- Eric should test his code before landing! :)
+ * DumpRenderTree/DumpRenderTree.gypi: files to compile
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp: Use ifdef because gcc was complaining
+ (NP_GetEntryPoints):
+ (NPP_New):
+ (NPP_Destroy):
+ (NPP_HandleEvent):
+ (NPP_GetValue):
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h: Added.
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h: Added.
+ * DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h: Added.
- * Scripts/modules/bugzilla.py:
+2010-10-14 Victor Wang <victorw@chromium.org>
-2009-12-31 Adam Barth <abarth@webkit.org>
+ Reviewed by Nate Chapin.
- Unreviewed. Fix the unit tests!
+ [Chromium] Fix rebaseline_chromium_webkit_tests to use 0 tolerance image diff.
- * Scripts/run-webkit-unittests:
+ https://bugs.webkit.org/show_bug.cgi?id=47686
-2009-12-30 Kevin Watters <kevinwatters@gmail.com>
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- Reviewed by Kevin Ollivier.
+2010-10-14 Eric Seidel <eric@webkit.org>
- [wx] Alter a couple of default settings in the test app.
-
- https://bugs.webkit.org/show_bug.cgi?id=32956
+ Reviewed by Adam Barth.
- * wx/browser/browser.cpp:
- (MyApp::OnInit):
+ test-webkitpy spews Delegate terminated queue messages
+ https://bugs.webkit.org/show_bug.cgi?id=47678
-2009-12-30 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
- Reviewed by Adam Barth.
+2010-10-14 Adam Roben <aroben@apple.com>
- logging.py should be renamed to webkit_logging.py and eventually die
- https://bugs.webkit.org/show_bug.cgi?id=33058
-
- Change all imports of "logging" to webkit_logging,
- except the ones which came from Google's cpp_lint.py and diff_parser.py
- which clearly are assuming python's logging.py.
-
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/buildbot.py:
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/queries.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/commands/upload.py:
- * Scripts/modules/credentials.py:
- * Scripts/modules/executive.py:
- * Scripts/modules/multicommandtool.py:
- * Scripts/modules/queueengine.py:
- * Scripts/modules/scm.py:
- * Scripts/modules/statusbot.py:
- * Scripts/modules/stepsequence.py:
- * Scripts/modules/webkit_logging.py: Renamed from WebKitTools/Scripts/modules/logging.py.
- * Scripts/modules/webkit_logging_unittest.py: Renamed from WebKitTools/Scripts/modules/logging_unittest.py.
-
-2009-12-30 Jakub Wieczorek <faw217@gmail.com>
+ Test that pressing the Alt key generates a WM_SYSCOMMAND message
- Reviewed by Simon Hausmann.
+ Test for <http://webkit.org/b/47671> <rdar://problem/8435594> Pressing
+ the Alt key when MiniBrowser's WKView is focused doesn't send focus to
+ the menu bar
- [Qt] layoutTestController.pathToLocalResource() should return a path, not an URL
- https://bugs.webkit.org/show_bug.cgi?id=33051
+ Reviewed by Steve Falkenburg.
- Moreover, its primary function is to normalize the path in regard of platform
- specific directory separators. Therefore, it can simply make use of the
- QDir::toNativeSeparators function.
+ * TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops: Added
+ TestWebKitAPI/win to the include path so that WindowMessageObserver
+ can be found.
+
+ * TestWebKitAPI/PlatformWebView.h: Added simulateAltKeyPress and
+ Windows-specific members.
+ (TestWebKitAPI::PlatformWebView::setParentWindowMessageObserver):
+ Added this simple setter.
+
+ * TestWebKitAPI/Tests/WebKit2/win/AltKeyGeneratesWMSysCommand.cpp: Added.
+ (TestWebKitAPI::WMSysCommandObserver::WMSysCommandObserver):
+ Initialize our lone data member.
+ (TestWebKitAPI::WMSysCommandObserver::windowDidReceiveWMSysCommand):
+ Simple getter.
+ (TestWebKitAPI::WMSysCommandObserver::windowReceivedMessage): Record
+ when a WM_SYSCOMMAND message is received.
+ (TestWebKitAPI::didNotHandleKeyEventCallback): Record when a
+ WM_SYSKEYUP message is not handled.
+ (TestWebKitAPI::WebKit2_AltKeyGeneratesWMSysCommand): Simulate
+ pressing the Alt key and check that a WM_SYSCOMMAND message got sent
+ to the WKView's parent window.
+
+ * TestWebKitAPI/win/PlatformWebViewWin.cpp:
+ (TestWebKitAPI::PlatformWebView::registerWindowClass): Made this a
+ member function so it could access PlatformWebView::wndProc. Use
+ PlatformWebView::wndProc as the WNDPROC.
+ (TestWebKitAPI::PlatformWebView::PlatformWebView): Initialize our new
+ data member and pass the this pointer to CreateWindowEx so we can
+ store it on the HWND.
+ (TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress): Moved some
+ constants from here to the top of the file.
+ (TestWebKitAPI::PlatformWebView::simulateAltKeyPress): Added. Sends
+ the same messages that Notepad receives when you press the Alt key.
+ (TestWebKitAPI::PlatformWebView::wndProc): Added.
+ - When WM_CREATE is received, we set the PlatformWebView instance
+ pointer as a property on the HWND so we can access it later.
+ - For other messages, we try to get the PlatformWebView instance
+ pointer from the HWND property.
+ - When WM_NCDESTROY is received (which is the last message we will
+ receive), we remove the PlatformWebView instance property.
+ - Pass messages to the parent window's message observer, if there is
+ one.
+ - Pass all messages through to ::DefWindowProcW.
+
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj: Added WindowMessageObserver
+ and AltKeyGeneratesWMSysCommand.
+
+ * TestWebKitAPI/win/WindowMessageObserver.h: Added. This class can be
+ used to observe messages sent to one or more windows.
+
+2010-10-01 Martin Robinson <mrobinson@igalia.com>
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::pathToLocalResource):
+ Reviewed by Holger Freyther.
+
+ [GTK] REGRESSION: FreeType backend does not respect XSettings font settings after r68558
+ https://bugs.webkit.org/show_bug.cgi?id=47033
-2009-12-30 David D. Kilzer <ddkilzer@webkit.org>
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeGtkFontSettings): Added this method which initializes XSettings
+ font settings to consistent values before running a test. For the one test
+ in which we need subpixel aliasing turned on, do that.
+ (initializeFonts): Accepts a testURL parameter now and delegates to initializeGtkFontSettings.
+ (runTest): Pass the testURL to initializeFonts.
- Fix executable bits for r52646
+2010-10-14 Adam Barth <abarth@webkit.org>
- * Scripts/VCSUtils_unittest.pl: Added property svn:executable.
- * Scripts/test-webkit-perl: Ditto.
+ Reviewed by Eric Seidel.
-2009-12-29 Chris Jerdonek <chris.jerdonek@gmail.com>
+ ChromiumXVFBPort.run_webkit_tests_command has infinite recursion
+ https://bugs.webkit.org/show_bug.cgi?id=47655
- Reviewed by David Kilzer.
+ * Scripts/webkitpy/common/config/ports.py:
+ * Scripts/webkitpy/common/config/ports_unittest.py:
- Fixed a bug in fixChangeLogPatch, made it work correctly in
- more circumstances, and added unit tests.
+2010-10-13 Eric Seidel <eric@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=32919
+ Reviewed by Adam Barth.
- * Scripts/VCSUtils.pm:
- Rewrote fixChangeLogPatch.
-
- * Scripts/VCSUtils_unittest.pl: Added.
- Added 7 unit tests for fixChangeLogPatch.
+ beat diff_parser with the ugly stick
+ https://bugs.webkit.org/show_bug.cgi?id=47626
- * Scripts/test-webkit-perl: Added.
- Added test harness for unit tests of Perl code.
+ * Scripts/webkitpy/common/checkout/diff_parser.py:
+ * Scripts/webkitpy/style/patchreader.py:
+ * Scripts/webkitpy/style/patchreader_unittest.py:
-2009-12-29 Eric Seidel <eric@webkit.org>
+2010-10-13 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- Split out BugzillaQueries class from Bugzilla
- https://bugs.webkit.org/show_bug.cgi?id=33042
-
- * Scripts/modules/bugzilla.py:
- - Split out BugzillaQueries from Bugzilla.
- - Try to isolate self.bugzilla usage into helper functions whenever possible.
- - Add a bunch of FIXMEs.
- - Rename fetch_bug_ids_from_needs_commit_list to fetch_bug_ids_from_pending_commit_list
- * Scripts/modules/bugzilla_unittest.py:
- - Create a new BugzillaQueriesTest testcase and move logic there.
- * Scripts/modules/buildsteps_unittest.py:
- - Use Bug 75 instead of 1 since bug 1 doesn't actually exist.
- * Scripts/modules/commands/queries.py:
- - Update to use bugzilla.queries
- * Scripts/modules/commands/queues.py:
- - Ditto.
- * Scripts/modules/commands/upload.py:
- - Ditto.
- * Scripts/modules/mock_bugzillatool.py:
- - Add a MockBugzillaQueries.
- - Make patches and bugs global privates.
- - Let _id_to_object_dictionary take a variable argument list instead of an array.
-
-2009-12-29 Daniel Bates <dbates@webkit.org>
+ Break LayoutTestResults out into its own file
+ https://bugs.webkit.org/show_bug.cgi?id=47637
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ * Scripts/webkitpy/common/net/layouttestresults.py: Added.
+ * Scripts/webkitpy/common/net/layouttestresults_unittest.py: Added.
- https://bugs.webkit.org/show_bug.cgi?id=33041
+2010-10-13 Adam Barth <abarth@webkit.org>
- Speed up the test method test_read_credentials_with_SVN by not actually
- creating an SVN repository to test against (by default). Instead, it is
- sufficient to create a temporary directory that does not contain a Git
- repository.
+ Unreviewed.
- Also, renamed method test_read_credentials_with_SVN to
- test_read_credentials_without_git_repo, to better reflect what it is
- testing.
+ Chromium port can't run JavaScriptCore tests
+ https://bugs.webkit.org/show_bug.cgi?id=47654
- * Scripts/modules/credentials_unittest.py:
+ This lets webkit-patch build-and-test work on Chromium.
-2009-12-29 Daniel Bates <dbates@webkit.org>
+ * Scripts/webkitpy/common/config/ports.py:
+ * Scripts/webkitpy/tool/steps/runtests.py:
- Reviewed by Adam Barth.
+2010-10-13 Adam Barth <abarth@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=33039
+ Reviewed by Eric Seidel.
- [bzt] Fixes an issue where bugzilla-tool dies when the keychain lookup
- fails to find an entry for bugs.webkit.org.
-
- Under Mac OS X, bugzilla-tool tries to query the keychain and Security
- framework (via /usr/sbin/security) for an internet-password entry for
- bugs.webkit.org so that it can use it to login to bugs.webkit.org.
- However, if no such entry exists then bugzilla-tool dies with an error.
+ Make --port a global option and pass the port information to the commit-queue subprocess
+ https://bugs.webkit.org/show_bug.cgi?id=47650
- * Scripts/modules/credentials.py: Modified method _parse_security_tool_output to return
- [None, None] if /usr/sbin/security cannot find keychain entry for bugs.webkit.org.
- * Scripts/modules/credentials_unittest.py: Added method test_security_output_parse_entry_not_found.
+ This patch paves the way to run the commit-queue on a non-Mac port.
-2009-12-29 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ * Scripts/webkitpy/tool/steps/update.py:
- Rubber-stamped by Adam Barth.
+2010-10-13 Adam Barth <abarth@webkit.org>
- Remove unused BugzillaException.
+ Reviewed by Eric Seidel.
- * Scripts/modules/bugzilla.py:
+ Introduce the ChromiumXVFBPort for running commit-queue on EC2
+ https://bugs.webkit.org/show_bug.cgi?id=47653
-2009-12-29 Eric Seidel <eric@webkit.org>
+ I'm not entirely sure this is the best way to do this, but we need to
+ run the tests under XVFB on EC2 because the EC2 instances don't have a
+ real monitor hooked up. This patch adds a ChromiumXVFBPort that runs
+ that way. The idea is that XVFB is like a platform for the Chromium
+ port, but we don't have a real notion of platform separate from port.
- Reviewed by Adam Barth.
+ * Scripts/webkitpy/common/config/ports.py:
- Need a script to assign bugs with r+ patches to committers for landing
- https://bugs.webkit.org/show_bug.cgi?id=33009
-
- This is just one more small tool to help in the fight against our
- ever-growing list of to-be-committed patches.
-
- * Scripts/modules/bugzilla.py:
- - Rename assign_to_email to assigned_to_email (typo).
- - Add assigned_to_email() method on Bug.
- - Add reassign_bug method.
- - Add Bugzilla.unassigned_email, eventually should move to some webkit_config.py module.
- * Scripts/modules/bugzilla_unittest.py:
- - Update test after assigned_to_email rename.
- * Scripts/modules/commands/commandtest.py:
- - Call bind_to_tool to that self.tool works in Command testing.
- * Scripts/modules/commands/download.py:
- - Move AbstractDeclarativeCommmand multicommandtool.py, it should be part of Command.
- * Scripts/modules/commands/queries_unittest.py:
- - One of the test patches is now posted by "eric@webkit.org" which is a committer.
- - Eventually we'll mock out CommitterList and be able to better control what's a committer and what's not.
- * Scripts/modules/commands/upload.py:
- - Add new assign-to-committer command.
- * Scripts/modules/commands/upload_unittest.py:
- - Add basic assign-to-committer test.
- * Scripts/modules/committers.py:
- - Add bugzilla_email() accessor.
- * Scripts/modules/committers_unittest.py:
- - Test our assumption that bugzilla_email is the first email.
- * Scripts/modules/mock_bugzillatool.py:
- - Add _id_to_object_dictionary for generating bug_cache from list of bugs.
- - Remove unused fetch_attachments_from_bug.
- - Add fetch_bug support and a bug_cache.
- * Scripts/modules/multicommandtool.py:
- - Move AbstractDeclarativeCommmand here from download.py
-
-2009-12-29 Adam Barth <abarth@webkit.org>
+2010-10-13 Sergio Villar Senin <svillar@igalia.com>
- Reviewed by Eric Seidel.
+ Reviewed by Martin Robinson.
- [bzt] Don't crash if user types a number during PromptForBugOrTitleStep
- https://bugs.webkit.org/show_bug.cgi?id=33038
+ [GTK] Add HTTP caching support
+ https://bugs.webkit.org/show_bug.cgi?id=44261
- Simple fix with test.
+ Add include paths for the new soup HTTP cache code.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/buildsteps_unittest.py:
+ * GNUmakefile.am: Add paths for the new soup HTTP cache code.
-2009-12-29 Adam Barth <abarth@webkit.org>
+2010-10-13 Yi Shen <yi.4.shen@nokia.com>
- Reviewed by Eric Seidel.
+ Reviewed by Antonio Gomes.
- [bzt] post-diff requires reading to the end
- https://bugs.webkit.org/show_bug.cgi?id=33036
+ [Qt] QtTestBrowser shows two Url input fields
+ https://bugs.webkit.org/show_bug.cgi?id=47613
- Catch the IOError caused by not reading to the end of the diff. We
- don't have a good way to test this currently.
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::buildUI):
- * Scripts/modules/user.py:
+2010-10-13 Yi Shen <yi.4.shen@nokia.com>
-2009-12-29 Chang Shu <Chang.Shu@nokia.com>
+ Reviewed by Tony Chang.
- Reviewed by Adam Barth.
+ [gdb] Add pretty-print supports for UString, Identifier and JSString
+ https://bugs.webkit.org/show_bug.cgi?id=47601
- [Qt] Move logic that handles Qt headers before primary headers
- so that Qt headers won't be treated as primary headers by mistake.
- https://bugs.webkit.org/show_bug.cgi?id=32991
+ * gdb/webkit.py:
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+2010-10-13 Adam Barth <abarth@webkit.org>
-2009-12-29 Eric Seidel <eric@webkit.org>
+ Reviewed by Eric Seidel.
- Reviewed by Adam Barth.
+ Add list of Ubuntu packages needed by the EWS bots
+ https://bugs.webkit.org/show_bug.cgi?id=47628
- Add the start of a Bug object for bugzilla.py
- https://bugs.webkit.org/show_bug.cgi?id=32995
-
- This allowed us to get rid of some duplicated "is_obsolete" checks.
-
- * Scripts/modules/bugzilla.py:
- - Add a new Bug class, and move patches/unreviewed_patches filtering logic there.
- - Add _fetch_bug_page for possible future mocking.
- (I did not try to test fetch_*_from_bug now due to difficulties with our current validate_reviewer logic.)
- - Rename fetch_bug to fetch_bug_dictionary and add a new fetch_bug which returns a Bug object.
- - Use fetch_bug and attachments(), patches(), etc. instead of custom fetch_*_from_bug methods.
- - Reduce code in fetch_patches_from_pending_commit_list and fetch_patches_from_review_queue
- using list comprehensions. Use a sum(list, []) trick to flatten a list of lists into a single list.
- * Scripts/modules/bugzilla_unittest.py:
- - Remove an unneeded unicode string marker.
- * Scripts/modules/buildsteps.py:
- - define __all__ to include just the BuildSteps
- * Scripts/modules/commands/download.py:
- - import * now that we have an __all__ defined.
- * Scripts/modules/commands/upload.py:
- - Use fetch_bug_dictionary instead of fetch_bug.
-
-2009-12-29 Daniel Bates <dbates@webkit.org>
+ I've been copy/pasting this list between bots, but it's better to have
+ this checked in.
- Reviewed by Ariya Hidayat.
+ * EWSTools/ubuntu-ews-packages: Added.
- https://bugs.webkit.org/show_bug.cgi?id=32925
+2010-10-13 Leandro Pereira <leandro@profusion.mobi>
- Adds an Open File dialog to make it convenient to open a file
- to view in the browser.
+ Reviewed by Csaba Osztrogonác.
- Currently a person must either specify the path to a file as a
- command-line argument or type a file URL. Instead, we should
- have a file dialog to allow a person to open a file without
- memorizing its path.
+ [EFL] Adds a build slave.
+ https://bugs.webkit.org/show_bug.cgi?id=47290
- * QtLauncher/main.cpp:
- (MainWindow::MainWindow): Changed urlEdit->setText(qurl.toEncoded())
- to urlEdit->setText(qurl.toString()).
- (MainWindow::openFile): Added.
- (MainWindow::changeLocation): Moved code to load URL into method
- MainWindow::loadURL.
- (MainWindow::loadURL): Added.
- (MainWindow::setupUI): Added menu item Open File.
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Add an
+ entry for a release build of the EFL port.
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Add platform
+ flag to build the EFL port.
-2009-12-29 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+2010-10-13 Adam Barth <abarth@webkit.org>
- Reviewed by Holger Freyther.
+ Reviewed by Csaba Osztrogonác.
- [GTK] fails fast/harness/use-page-cache.html
- https://bugs.webkit.org/show_bug.cgi?id=33013
+ webkit-patch build shouldn't need --build to actually build!
+ https://bugs.webkit.org/show_bug.cgi?id=47438
- Make sure settings are forwarded to child WebViews.
+ Yeah, requiring --build for the build command is really dumb. We did
+ this originally because the build step is usually optional in other
+ commands. We don't have a good way of reversing the default for an
+ option in one command. This approach is slightly hacky since --build
+ still shows up as an option on the help page, but at least it makes
+ progress. Passing --build is harmless, so the EWS bots shouldn't
+ explode because of this change.
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (createWebView):
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
-2009-12-29 Daniel Bates <dbates@webkit.org>
+2010-10-13 Sheriff Bot <webkit.review.bot@gmail.com>
- Reviewed by Eric Seidel.
+ Unreviewed, rolling out r69638.
+ http://trac.webkit.org/changeset/69638
+ https://bugs.webkit.org/show_bug.cgi?id=47595
- https://bugs.webkit.org/show_bug.cgi?id=32778
+ "Broke win and chromium-win bots" (Requested by dglazkov on
+ #webkit).
- Changes $diffPercentage to be a number to resolve Perl
- warning about comparing a string to a number.
+ * Scripts/webkitpy/common/system/path.py:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * Scripts/run-webkit-tests:
+2010-10-13 John Knottenbelt <jknotten@chromium.org>
-2009-12-29 Jakub Wieczorek <faw217@gmail.com>
+ Reviewed by Steve Block.
- Reviewed by Eric Seidel.
+ First step towards client-based Geolocation in Chromium. Build
+ fixes for CLIENT_BASED_GEOLOCATION preprocessor feature define.
+ https://bugs.webkit.org/show_bug.cgi?id=47586
- [Qt] DRT: Frame loader callbacks differ from the Mac port
- https://bugs.webkit.org/show_bug.cgi?id=32989
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ * DumpRenderTree/chromium/WebViewHost.h:
- Remove messages from the callbacks that should not dump them to match
- the expected results for the http/loading tests.
+2010-10-13 Adam Roben <aroben@apple.com>
- Unskip some http/loading tests which succeed now.
+ Test that pressing the spacebar in a text field does not scroll the
+ document
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::dump):
+ Test for <http://webkit.org/b/47544> <rdar://problem/8540645>
+ REGRESSION: Pressing spacebar in a text field in WebKit2 does not
+ insert a space, scrolls the page instead
-2009-12-29 Robert Hogan <robert@roberthogan.net>
+ Reviewed by Sam Weinig.
- Reviewed by Eric Seidel.
+ * TestWebKitAPI/PlatformUtilities.h: Added isKeyDown.
- [Qt] fix fast/dom/Window/window-onFocus.html
-
- Add support for layouttestcontroller.windowIsKey to Qt DRT and fix issue where
- window.onblur was getting dispatched twice from QtWebKit.
-
- https://bugs.webkit.org/show_bug.cgi?id=32990
+ * TestWebKitAPI/PlatformWebView.h: Added simulateSpacebarKeyPress.
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::switchFocus):
- * DumpRenderTree/qt/DumpRenderTreeQt.h:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setWindowIsKey):
- (LayoutTestController::setMainFrameIsFirstResponder):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj:
+ * TestWebKitAPI/win/copy-resources.cmd:
+ Added new files.
-2009-12-28 Kinuko Yasuda <kinuko@chromium.org>
+ * TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp: Added.
+ (TestWebKitAPI::JavaScriptCallbackContext::JavaScriptCallbackContext):
+ We use this to track what the result of calling into JavaScript was.
+ (TestWebKitAPI::didFinishLoadForFrame): Records when the page
+ finishes loading.
+ (TestWebKitAPI::didNotHandleKeyEventCallback): Records when a key down
+ event is not handled.
+ (TestWebKitAPI::javaScriptCallback): Records that JavaScript finished
+ executing and whether the result matched our expectation.
+ (TestWebKitAPI::wk): Turns a UTF-8 C string into a WKStringRef.
+ (TestWebKitAPI::runJSTest): Calls into JS, waits for the call to
+ complete, and returns whether we got back the expected result.
+ (TestWebKitAPI::WebKit2_SpacebarScrolling): Tests that pressing
+ spacebar inside a text field does not scroll the document and that
+ pressing it outside the text field does scroll the document.
- Reviewed by Maciej Stachowiak.
+ * TestWebKitAPI/Tests/WebKit2/spacebar-scrolling.html: Added.
- Extended EventSender.keyDown method to take another (3rd) argument
- for indicating the keyLocation to make numeric pad key events testable.
- Expected values for the argument is one of the KeyLocationCode
- specified in DOM Level 3
- (http://www.w3.org/TR/DOM-Level-3-Events/#events-keyboardevents).
- https://bugs.webkit.org/show_bug.cgi?id=28247
+ * TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
+ (TestWebKitAPI::Util::isKeyDown): Checks the event's type.
- Test: fast/events/keydown-numpad-keys.html
+ * TestWebKitAPI/mac/PlatformWebViewMac.mm:
+ (TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress): Copied
+ code from DRT's EventSendingController.
- * DumpRenderTree/mac/EventSendingController.mm:
- (+[EventSendingController isSelectorExcludedFromWebScript:]):
- (+[EventSendingController webScriptNameForSelector:]):
- (-[EventSendingController keyDown:withModifiers:withLocation:]):
+ * TestWebKitAPI/win/PlatformUtilitiesWin.cpp:
+ (TestWebKitAPI::Util::isKeyDown): Checks the message's type.
-2009-12-28 Ariya Hidayat <ariya.hidayat@gmail.com>
+ * TestWebKitAPI/win/PlatformWebViewWin.cpp:
+ (TestWebKitAPI::PlatformWebView::simulateSpacebarKeyPress): Send the
+ same messages that get sent when you press spacebar in Notepad.
- Unreviewed, update my email address.
+2010-10-13 Adam Roben <aroben@apple.com>
- * Scripts/modules/committers.py:
+ Fix a couple of issues with the TestWebKitAPI build
-2009-12-28 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+ * TestWebKitAPI/Configurations/TestWebKitAPICFLite.vsprops:
+ * TestWebKitAPI/Configurations/TestWebKitAPICoreFoundation.vsprops:
+ Fixed a typo.
- Reviewed by Adam Barth.
+ * TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj: Use common.vsprops
+ to set our output and intermediate directories so that we don't spew
+ files into the source tree.
- [Qt] Fix build break for Qt 4.4
- https://bugs.webkit.org/show_bug.cgi?id=30327
+2010-10-13 Balazs Kelemen <kbalazs@webkit.org>
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp: Include QLocale
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp: Ditto.
- * QtLauncher/main.cpp:
- (MainWindow::MainWindow): Qt::WA_TranslucentBackground was
- introduced in Qt version 4.5
+ Reviewed by Csaba Osztrogonác.
-2009-12-28 Adam Barth <abarth@webkit.org>
+ WTR should accept relative paths
+ https://bugs.webkit.org/show_bug.cgi?id=47486
- Reviewed by Eric Seidel.
+ * WebKitTestRunner/StringFunctions.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::createWKURL): Moved from StringFunctions.h since it is
+ used only here. Extend relative paths to absolute.
- [bzt] Add an edit-changelog command
- https://bugs.webkit.org/show_bug.cgi?id=32986
+2010-10-12 Adam Roben <aroben@apple.com>
- This command makes it easier to edit ChangeLogs. It's similar to
- prepare-ChangeLog -o, except it works with already existing ChangeLogs.
+ Make TestWebKitAPI work on Windows
- * Scripts/modules/commands/upload.py:
- * Scripts/modules/commands/upload_unittest.py:
+ Fixes <http://webkit.org/b/47552> <rdar://problem/8541708>.
-2009-12-28 Adam Barth <abarth@webkit.org>
+ Reviewed by Sam Weinig.
- Reviewed by Eric Seidel.
+ * Scripts/build-api-tests: Build TestWebKitAPI.sln on Windows.
- [bzt] Create an ASAD command for uploading a patch
- https://bugs.webkit.org/show_bug.cgi?id=32979
+ * Scripts/run-api-tests: Fix the PATH so that TestWebKitAPI can be
+ run on Windows.
+ (runTest): Added code to run TestWebKitAPI.exe on Windows and to die
+ on unsupported platforms.
+ (populateTests): Added code to run TestWebKitAPI.exe on Windows and to
+ die on other platforms. Extracted some formerly-Mac-specific code to
+ be cross-platform and made it handle any style of line-endings.
- The create-review command goes through the whole process of preparing a
- code review, including creating a bug, editing the ChangeLogs, and
- uploading the patch. It is indeed the All Sing, All Dance upload
- command.
+ * TestWebKitAPI/Configurations/TestWebKitAPICFLite.vsprops: Added.
+ Links against CFLite.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/upload.py:
- * Scripts/modules/commands/upload_unittest.py:
- * Scripts/modules/mock_bugzillatool.py:
- * Scripts/modules/user.py:
+ * TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops: Added.
+ Contains most properties for the project.
-2009-12-28 Adam Barth <abarth@webkit.org>
+ * TestWebKitAPI/Configurations/TestWebKitAPICoreFoundation.vsprops:
+ Added. Links against CoreFoundation.
- Unreviewed "build" fix (with test!).
+ * TestWebKitAPI/TestWebKitAPIPrefix.h: Added a Windows-specific
+ section and moved the cross-platform section after the
+ platform-specific parts.
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/bugzilla_unittest.py:
+ * TestWebKitAPI/win/PlatformUtilitiesWin.cpp: Added.
+ (TestWebKitAPI::Util::run): Runs a normal message pump until we're
+ done.
+ (TestWebKitAPI::Util::cf): Turns a UTF-8 C string into a CFString.
+ (TestWebKitAPI::Util::createURLForResource): Uses CFBundle to get the
+ resource path.
+ (TestWebKitAPI::Util::URLForNonExistentResource): Creates a bogus
+ WKURL.
-2009-12-27 Eric Seidel <eric@webkit.org>
+ * TestWebKitAPI/win/PlatformWebViewWin.cpp: Added.
+ (TestWebKitAPI::registerWindowClass):
+ (TestWebKitAPI::PlatformWebView::PlatformWebView):
+ (TestWebKitAPI::PlatformWebView::~PlatformWebView):
+ (TestWebKitAPI::PlatformWebView::page):
+ This was mostly copied from WebKitTestRunner's PlatformWebView.
- Reviewed by Adam Barth.
+ * TestWebKitAPI/win/TestWebKitAPI.sln: Added. Builds both
+ TestWebKitAPI and TestWebKitAPIGeneratd. This is used by the
+ build-api-tests script.
- Add more awesome bug-parsing logic to bugzilla.py in preparation for assign-to-committer command
- https://bugs.webkit.org/show_bug.cgi?id=32980
+ * TestWebKitAPI/win/TestWebKitAPI.vcproj: Added. Builds
+ TestWebKitAPI.exe.
- * Scripts/modules/bugzilla.py:
- - Add a new _parse_bug_page function and use it in fetch_attachments_from_bug
- - Replace fetch_title_from_bug with a new fetch_bug call instead.
- - Use list comprehensions where possible to reduce code duplication.
- * Scripts/modules/bugzilla_unittest.py:
- - Add a minimal bug parsing test.
- - Share code between bug parsing and attachment parsing tests with _assert_dictionaries_equal
- * Scripts/modules/commands/upload.py:
- - Use fetch_bug(bug_id)["title"] instead of fetch_title_from_bug
+ * TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj: Added. Just calls
+ through to copy-resources.cmd.
-2009-12-27 Adam Barth <abarth@webkit.org>
+ * TestWebKitAPI/win/copy-resources.cmd: Added. Copies resources into
+ or deletes resources from TestWebKitAPI.resources.
- Reviewed by Eric Seidel.
+ * TestWebKitAPI/win/main.cpp: Added.
+ (main): Calls through to TestsController.
- Status bubble shouldn't be transparent for bots that haven't run yet
- https://bugs.webkit.org/show_bug.cgi?id=32977
+2010-10-13 Gyuyoung Kim <gyuyoung.kim@samsung.com>
- * QueueStatusServer/templates/statusbubble.html:
+ Reviewed by Kenneth Rohde Christiansen.
-2009-12-27 Adam Barth <abarth@webkit.org>
+ [EFL] Support viewport configuration and add new arguments for WebKit EFL
+ https://bugs.webkit.org/show_bug.cgi?id=47084
- Reviewed by Eric Seidel.
+ Opera spec regarding to viewport meta tag was adjusted to WebCore. So, EFL port
+ needs to be modified according to the changes.
- [QueueStatusServer] Run gc cron job less often
- https://bugs.webkit.org/show_bug.cgi?id=32958
+ * EWebLauncher/main.c:
+ (on_viewport_changed):
- Now that we've cleaned out the backlog of idle messages, we don't need
- to run the gc job every half hour. We could also stop logging the idle
- messages, but this seems easier for the time being.
+2010-10-12 Dirk Pranke <dpranke@chromium.org>
- * QueueStatusServer/cron.yaml:
+ Reviewed by Eric Seidel.
-2009-12-27 Daniel Bates <dbates@webkit.org>
+ This patch enables new-run-webkit-tests (in particular the
+ chromium-win port) to run under Cygwin as well as Win32. Mostly
+ this just required some conversions from cygwin paths to Win32
+ paths when we spawn off Win32 binaries like test_shell.
- Reviewed by Adam Barth.
+ https://bugs.webkit.org/show_bug.cgi?id=47220
- https://bugs.webkit.org/show_bug.cgi?id=32896
+ * Scripts/webkitpy/common/system/path.py:
+ - Expose the cygpath() function for path conversion
- Fixes an issue where bugzilla-tool tries to read the username and password from
- Git regardless of whether Git is installed. In particular, if Git is not
- installed then bugzilla-tool dies (with a trace) when it attempts to query Git
- for the authentication credentials to log into bugs.webkit.org.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - shift filename->uri conversion in the TestInfo objects to the
+ dump_render_tree thread
- Moreover, modifies Executive.run_command to catch and pass OSError exceptions to
- the specified error handler. For instance, the specified error handler will now
- be called when the command does not exist (i.e. OSError errno 2).
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - use cygpath()
- * Scripts/modules/credentials.py: Added check for Git.
- * Scripts/modules/credentials_unittest.py: Added test method
- test_read_credentials_with_SVN.
- * Scripts/modules/executive.py: Modified method run_command to catch
- OSError exceptions (i.e [Errno 2] No such file or directory) and call
- the specified error handler.
- * Scripts/modules/executive_unittest.py: Added.
- * Scripts/run-webkit-unittests: Added import executive_unittest.py.
+2010-10-12 Yuta Kitamura <yutak@chromium.org>
-2009-12-27 Daniel Bates <dbates@webkit.org>
+ Unreviewed. Add Yuta Kitamura (yutak) to the committers list.
- Unreviewed. Added missing file style_unittest.py that wasn't committed
- in change set 52541 (http://trac.webkit.org/changeset/52541) as part of
- the patch for bug #32592.
+ * Scripts/webkitpy/common/config/committers.py:
- * Scripts/modules/style_unittest.py: Added.
+2010-10-12 Sam Weinig <sam@webkit.org>
-2009-12-27 Daniel Bates <dbates@webkit.org>
+ Reviewed by Dan Bernstein.
- Reviewed by Eric Seidel.
+ When a provisional load fails, the provisional URL returned
+ from WKFrameCopyProvisionalURL should be empty
+ <rdar://problem/8540878>
+ https://bugs.webkit.org/show_bug.cgi?id=47546
- https://bugs.webkit.org/show_bug.cgi?id=32964
+ Add test.
- [bzt] Updated the unit test based on the change made in bug #32951.
+ * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp:
+ (TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame):
- The change made in bug #32951 added the command-line argument:
- --makeargs="-j8" to the build-webkit command. However, the associated
- unit test was not updated.
+2010-10-12 Anders Carlsson <andersca@apple.com>
- * Scripts/modules/webkitport_unittest.py:
+ Reviewed by Sam Weinig.
-2009-12-27 Yael Aharon <yael.aharon@nokia.com>
+ Start fleshing out find page overlays
+ https://bugs.webkit.org/show_bug.cgi?id=47559
- Reviewed by Darin Adler.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController find:]):
+ Pass kWKFindOptionsShowOverlay to WKPageFindString.
- check-webkit-style should not mark moc files inclusion as errors
- https://bugs.webkit.org/show_bug.cgi?id=32669
+2010-10-12 Robert Hogan <robert@webkit.org>
- Add a new header type for moc files, and skip them when checking the order of header files.
+ Reviewed by Antonio Gomes.
- * Scripts/modules/cpp_style.py:
+ [Qt] editing/input/emacs-ctrl-o.html
-2009-12-26 Adam Barth <abarth@webkit.org>
+ ctrl-o is bound to a sequence of commands on Mac, namely:
+ insertParagraphSeparator then moveLeft. In the DRT, we just interpret
+ ctrl-o in EventSenderQt as '\n', i.e. insertParagraphSeparator. As a
+ result we only issue one command, so don't generate the change in caret
+ position that results in the extra editing delegate messages.
- Reviewed by Eric Seidel.
+ So for the sake of not managing suspicious-looking differences, just
+ make DRT issue the appropriate edit commands to pass the test.
- [bzt] Make the qt build go fast
- https://bugs.webkit.org/show_bug.cgi?id=32951
+ https://bugs.webkit.org/show_bug.cgi?id=47548
- Make use of multiple cores, if available.
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::keyDown):
- * Scripts/modules/webkitport.py:
+2010-10-12 Anders Carlsson <andersca@apple.com>
-2009-12-25 Daniel Bates <dbates@rim.com>
+ Reviewed by Sam Weinig.
- Reviewed by Eric Seidel.
+ Add a simple Find UI to MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=47553
- https://bugs.webkit.org/show_bug.cgi?id=32682
+ * MiniBrowser/mac/BrowserWindow.xib:
+ Add Find panel.
- Fixes an issue where checkFrameworks always dies with an error under Windows
- since the clause "unless (-x $path)" is always satisfied because files under
- Windows do not have an explict executable bit.
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController performFindPanelAction:]):
+ Show the find panel.
- * Scripts/webkitdirs.pm:
+ (-[BrowserWindowController find:]):
+ Tell the WKPageRef to find the given string.
-2009-12-23 Eric Seidel <eric@webkit.org>
+2010-10-12 Tony Chang <tony@chromium.org>
- Reviewed by Adam Barth.
+ Unreviewed, fixing DRT compile on Windows after r69586.
- bugzilla-tool should accept global options anywhere
- https://bugs.webkit.org/show_bug.cgi?id=26912
-
- * Scripts/bugzilla-tool:
- - Use the new global_options class property.
- - Add a handle_global_options callback to avoid needing callbacks for each global option.
- * Scripts/modules/multicommandtool.py:
- - Make the code use one combined option parser.
- This allows us to accept global options anywhere and
- individual command options before commands.
- - Add a handle_global_options callback to avoid needing callbacks for each global option.
- - Make the Command hold the option parser, but allow the tool to override it.
- - The default option parser is used for help printing and when Commands are run stand alone,
- but are otherwise not used.
- - Add Command.main to codify the idea that Commands should support being run stand-alone.
- - Change _split_args to _split_command_name_from_args now that args are unified.
- * Scripts/modules/multicommandtool_unittest.py:
- - Test that "tool" and "tool help" show the same help.
- - Test that args are accepted before commands
-
-2009-12-20 Chris Jerdonek <chris.jerdonek@gmail.com>
+ * DumpRenderTree/chromium/WebThemeEngineDRT.h:
- Reviewed by David Levin.
+2010-10-12 Tony Chang <tony@chromium.org>
- Moved some sections of code in preparation to refactor
- check-webkit-style's argument parser to avoid setting
- global variables.
+ Unreviewed, trying to fix NRWT on Windows.
- https://bugs.webkit.org/show_bug.cgi?id=32592
+ * Scripts/webkitpy/layout_tests/port/http_lock.py:
- * Scripts/check-webkit-style:
- - Moved _USAGE string to style.py.
- - Addressed FIXME by eliminating dependencies on cpp_style.py.
+2010-10-12 Balazs Kelemen <kbalazs@webkit.org>
- * Scripts/modules/cpp_style.py:
- - Moved default arguments and style categories to style.py.
- - Moved exit_with_usage(), exit_with_categories(), and
- parse_arguments() to style.py.
- - Removed references in _CppStyleState to the global
- variables now in style.py.
+ Reviewed by Kenneth Rohde Christiansen.
- * Scripts/modules/cpp_style_unittest.py:
- - Moved parse_arguments() unit tests to style_unittest.py.
+ [Qt][WTR] Checking the path of the injected bundle is bogus
+ https://bugs.webkit.org/show_bug.cgi?id=47541
- * Scripts/modules/style.py:
- - Added _USAGE string from check-webkit-style.
- - Added default arguments and style categories from cpp_style.py.
- - Added exit_with_usage(), exit_with_categories(), and
- parse_arguments() from cpp_sstyle.py.
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ (WTR::isExistingLibrary): Added (static helper).
+ Extend the path with the appropriate suffix(es) on the
+ platform and check that the file exists.
+ (WTR::TestController::initializeInjectedBundlePath):
+ There were two bugs with the path checking:
+ - the condition should have been inverted
+ - QLibrary::fileName does not give back the filename
+ with the library suffix so we cannot check
+ that existance of the file this way.
- * Scripts/modules/style_unittest.py: Added.
- - Added parse_arguments() unit tests from cpp_style_unittest.py.
+2010-10-12 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- * Scripts/run-webkit-unittests:
- - Added unit tests from style_unittest.py.
+ Reviewed by Tony Chang.
-2009-12-23 Eric Seidel <eric@webkit.org>
+ Implement http locking in NRWT.
+ https://bugs.webkit.org/show_bug.cgi?id=47072
- Reviewed by Adam Barth.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/http_lock.py: Added.
+ * Scripts/webkitpy/layout_tests/port/http_lock_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- commit-queue should mention bug 30084 when rejecting patches until it can be fixed
- https://bugs.webkit.org/show_bug.cgi?id=32911
+2010-10-12 Mark Rowe <mrowe@apple.com>
- * Scripts/modules/bugzilla.py: Make the message even more fancy.
- * Scripts/modules/bugzilla_unittest.py: Test our new fancy message.
+ Fix the 32-bit WebKit2 build.
-2009-12-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (getWindowFrame): Use NSRect rather than CGRect since that's what -frame returns.
+ (setWindowFrame): Use NSMakeRect rather than CGRectMake since that's what -setFrame:display: expects.
- Not reviewed, adding myself to the reviewers list.
+2010-10-11 Tony Chang <tony@chromium.org>
- * Scripts/modules/committers.py:
+ Reviewed by Adam Barth.
-2009-12-23 Adam Barth <abarth@webkit.org>
+ change the order of mrobinson's email addresses so bugs.webkit.org suggests the right one
+ https://bugs.webkit.org/show_bug.cgi?id=47513
- Reviewed by Eric Seidel.
+ bugs.webkit.org suggests mrobinson@igalia.com as an autocomplete,
+ which doesn't actually work.
- [bzt] Create a prepare-diff command that creates a bug and a ChangeLog
- https://bugs.webkit.org/show_bug.cgi?id=32895
+ * Scripts/webkitpy/common/config/committers.py:
- The workflow Maciej and I discussed is as follows:
+2010-10-11 Prasad Tammana <prasadt@chromium.org>
- 1) Write code.
- 2) bugzilla-tool prepare-diff
- 3) Edit ChangeLogs
- 4) bugzilla-tool post-diff
+ Reviewed by Dmitry Titov.
- We might want to experimenting with combining 2-4 into a single
- command, but that might be stressful to edit the ChangeLogs modally.
+ Added support for showModalDialog on chromium port.
- Removed submit-patch since it has the modal ChangeLog editing but none
- oof the bug creating fun.
+ Implement showModalDialog for Layout tests for chromium port
+ https://bugs.webkit.org/show_bug.cgi?id=46759
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/upload.py:
- * Scripts/modules/commands/upload_unittest.py:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::closeWidgetSoon): Quit current message loop if in a modal loop.
+ (WebViewHost::runModal): Start a nested message loop and remember that.
+ (WebViewHost::WebViewHost): Initialize m_inModalLoop.
+ * DumpRenderTree/chromium/WebViewHost.h: Add m_inModalLoop.
-2009-12-23 Gabor Loki <loki@webkit.org>
+2010-10-11 Martin Robinson <mrobinson@igalia.com>
- Unreviewed; added myself to the committers list.
+ Reviewed by Gustavo Noronha Silva.
- * Scripts/modules/committers.py:
+ [GTK] Cleanup font selection code for the Freetype backend
+ https://bugs.webkit.org/show_bug.cgi?id=47503
-2009-12-22 Adam Barth <abarth@webkit.org>
+ Update DRT to set values for the cursive and fantasy font families, so
+ that we can generate consistent results for tests that use these families.
+ Add some missing information to fonts.conf.
- Reviewed by Maciej Stachowiak.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues): Always set the fantasy and cursive font
+ family names.
+ * DumpRenderTree/gtk/fonts/fonts.conf: Add aliases for cursive and fantasy fonts
+ to our default serif font. Eventually we may want to import or require some "real"
+ fonts, but this should at least ensure consistent rendering during test runs. Also
+ add aliases for some other commonly used fonts in tests (Arial and Lucida Grande).
+ Finally, add a missing oblique specification for DejaVu Serif, which was resulting
+ in some incorrect baselines for the synthetic oblique test.
- [bzt] Don't call create-patch twice during post-diff
- https://bugs.webkit.org/show_bug.cgi?id=32893
+2010-10-11 Adam Barth <abarth@webkit.org>
- If we call create-patch to get the bug number, cache the diff in the
- state so we don't need to call it again.
+ Unreviewed.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/upload.py:
+ Fix sheriffbot not to crash when there are failing tests. It turns out
+ Python sets don't support the + operator. We need to use union
+ instead. There's a more elegant way to do this in Python 2.6, but we
+ need this code to work in 2.5.
-2009-12-22 Daniel Bates <dbates@rim.com>
+ * Scripts/webkitpy/common/net/failuremap.py:
+ * Scripts/webkitpy/common/net/failuremap_unittest.py:
- Reviewed by Eric Seidel.
+2010-10-10 Robert Hogan <robert@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=32680
+ Unreviewed, fix failing test from r69468.
- Fixes an issue in builtDylibPathForName so that it returns the correct
- path to the built QtWebKit library on the Qt Windows port. Currently,
- it returns the path to the file named QtWebKit.dll but this file does
- not exist on the Qt Windows build. Instead, the file is named
- QtWebKit4.dll.
+ [Qt] Put all DRT-created pages in a page group
- * Scripts/webkitdirs.pm:
+ Fix on r69468.
-2009-12-22 Marc-Antoine Ruel <maruel@chromium.org>
+ Because we don't delete closed pages immediately in DRT we need
+ to remove them from the page group explicitly instead.
- Reviewed by Adam Roben.
+ Fixes failure of fast/events/popup-blocked-from-fake-user-gesture.html
- Remove the only dependency on perl-libwin32 in cygwin
+ https://bugs.webkit.org/show_bug.cgi?id=47469
- * Scripts/num-cpus:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::windowCloseRequested):
-2009-12-22 Darin Adler <darin@apple.com>
+2010-10-10 Leandro Pereira <leandro@profusion.mobi>
- * pywebsocket/mod_pywebsocket: Added property svn:ignore to ignore
- generated ".pyc" files.
+ Reviewed by Adam Barth.
-2009-12-22 Darin Adler <darin@apple.com>
+ commit-queue: Add EFL-EWS status bubble to Bugzilla, now that the
+ EFL-EWS bot is up and running.
+ https://bugs.webkit.org/show_bug.cgi?id=47277
- Reviewed by Mark Rowe.
+ * QueueStatusServer/handlers/statusbubble.py:
- Turn off datagrid by default, at least for all platforms Apple ships.
- The datagrid implementation isn't ready for general web use yet.
+2010-10-10 Robert Hogan <robert@webkit.org>
- * Scripts/build-webkit: Turn off datagrid by default.
+ Reviewed by Antonio Gomes.
-2009-12-22 Eric Seidel <eric@webkit.org>
+ [Qt] Put all DRT-created pages in a page group
- Reviewed by Darin Adler.
+ https://bugs.webkit.org/show_bug.cgi?id=47469
- validate-committer-lists fails when run from an SVN checkout
- https://bugs.webkit.org/show_bug.cgi?id=31974
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::createWindow):
- * Scripts/validate-committer-lists:
- - Make it print a warning message instead of throwing
- an exception when running from an SVN checkout.
+2010-10-09 Sam Weinig <sam@webkit.org>
-2009-12-22 Philippe Normand <pnormand@igalia.com>
+ Reviewed by Dan Bernstein.
- Reviewed by Adam Barth.
+ WKFrameGetFrameLoadState() returns kWKFrameLoadStateCommitted after the load has been stopped
+ <rdar://problem/8173667>
+ https://bugs.webkit.org/show_bug.cgi?id=47461
- check-webkit-style should not warn about NULL usage in g_object_{get,set}
- https://bugs.webkit.org/show_bug.cgi?id=32858
+ * TestWebKitAPI/PlatformUtilities.h:
+ * TestWebKitAPI/Test.h:
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp: Added.
+ (TestWebKitAPI::didFailProvisionalLoadWithErrorForFrame):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
+ (TestWebKitAPI::Util::URLForNonExistentResource):
+ Adds a test for the frame load state after a failed provisional load. I wanted to test
+ the frame load state after a committed load failed, but I don't believe that is possible
+ to do without hooking up the http server to serve a long loading page.
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+2010-10-09 Sam Weinig <sam@webkit.org>
-2009-12-22 Simon Hausmann <simon.hausmann@nokia.com>
+ Reviewed by Dan Bernstein.
- Rubber-stamped by Holger Freyther.
+ Add WebKit2 version of runBeforeUnloadConfirmPanelWithMessage
+ <rdar://problem/8447690>
+ https://bugs.webkit.org/show_bug.cgi?id=47459
- Moved QtLauncher from WebKit/qt.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (runBeforeUnloadConfirmPanel):
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
- * QtLauncher: Copied from WebKit/qt/QtLauncher.
- * QtLauncher/QtLauncher.pro:
+2010-10-09 Sam Weinig <sam@webkit.org>
-2009-12-21 Adam Barth <abarth@webkit.org>
+ Reviewed by Dan Bernstein.
- Reviewed by Eric Seidel.
+ Need implementation of ChromeClient windowRect related functions.
+ <rdar://problem/8469476>
+ https://bugs.webkit.org/show_bug.cgi?id=47386
- [bzt] Automate the process of calling prepare-ChangeLog
- https://bugs.webkit.org/show_bug.cgi?id=32816
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (getWindowFrame):
+ (setWindowFrame):
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/PlatformWebView.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+ * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+ (WTR::PlatformWebView::windowFrame):
+ (WTR::PlatformWebView::setWindowFrame):
+ * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+ (WTR::PlatformWebView::windowFrame):
+ (WTR::PlatformWebView::setWindowFrame):
+ * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+ (WTR::PlatformWebView::windowFrame):
+ (WTR::PlatformWebView::setWindowFrame):
- This patch automates the process of creating a bug and patch and
- uploading it to bugzilla. The first cut just calls
- prepare-ChangeLog.
+2010-10-08 Adam Barth <abarth@webkit.org>
- This patch required some refactoring of upload.py to the Step
- model, but that's worth doing anyway.
+ Unreviewed (Eric is on vacation in this change is trivial).
- * Scripts/bugzilla-tool:
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/upload.py:
- * Scripts/modules/commands/upload_unittest.py:
- * Scripts/modules/mock_bugzillatool.py:
+ Add a "clean" command to webkit-patch to clean the working directory
+ https://bugs.webkit.org/show_bug.cgi?id=47436
-2009-12-21 Darin Adler <darin@apple.com>
+ This command is useful when using SVN because "svn revert" leaves
+ unversioned files behind.
- * Scripts/do-webcore-rename: Did a rename, so checking in the
- version of the script I used.
+ * Scripts/webkitpy/tool/commands/download.py:
-2009-12-21 Adam Barth <abarth@webkit.org>
+2010-10-08 Andras Becsi <abecsi@webkit.org>
- Reviewed by Eric Seidel.
+ Unreviewed build fix.
- Update status-bubble to show all the queues
- https://bugs.webkit.org/show_bug.cgi?id=32838
+ [Qt] Add missing limits.h include since the Qt version currently
+ ran on the bot does need that.
- Also, move statusbubble over to use memcache.
+ * WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp:
- * QueueStatusServer/handlers/statusbubble.py:
- * QueueStatusServer/templates/statusbubble.html:
+2010-10-08 Balazs Kelemen <kbalazs@webkit.org>
-2009-12-21 Adam Barth <abarth@webkit.org>
+ Reviewed by Csaba Osztrogonác.
- Reviewed by Eric Seidel.
+ [Qt] Turn on building WTR
+ https://bugs.webkit.org/show_bug.cgi?id=47349
- Delete the boring "Empty queue" status messages in QueueStatusServer
- https://bugs.webkit.org/show_bug.cgi?id=32818
+ * Scripts/webkitdirs.pm:
- * QueueStatusServer/app.yaml:
- * QueueStatusServer/cron.yaml:
- * QueueStatusServer/handlers/gc.py:
- * QueueStatusServer/main.py:
+2010-10-08 Balazs Kelemen <kbalazs@webkit.org>
-2009-12-21 Adam Barth <abarth@webkit.org>
+ Reviewed by Andreas Kling.
- Reviewed by Eric Seidel.
+ [Qt] TestController needs its platform dependent methods
+ https://bugs.webkit.org/show_bug.cgi?id=47413
- Exception on queue status server
- https://bugs.webkit.org/show_bug.cgi?id=32812
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ (WTR::TestController::initializeInjectedBundlePath):
+ If the WTR_INJECTEDBUNDLE_PATH environmental variable is
+ set then use that otherwise use the path where the bundle
+ lives in a normal trunk build.
+ (WTR::TestController::initializeTestPluginDirectory):
+ Set the bundle's value. It is not used currently.
+ (WTR::TestController::platformInitializeContext):
+ * WebKitTestRunner/qt/WebKitTestRunner.pro:
- Turns out we need to pass the id to the filter.
+2010-10-08 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
- * QueueStatusServer/filters/webkit_extras.py:
- * QueueStatusServer/templates/patch.html:
- * QueueStatusServer/templates/recentstatus.html:
+ Reviewed by Kenneth Rohde Christiansen.
-2009-12-20 Chris Jerdonek <chris.jerdonek@gmail.com>
+ WTR: Prevent sending the Done message twice on test timeout.
+ https://bugs.webkit.org/show_bug.cgi?id=47410
- Reviewed by Eric Seidel.
+ When InjectedBundle::done() calls stopLoading, this may trigger
+ InjectedBundlePage::didFailLoadWithErrorForFrame which calls
+ InjectedBundle::done() itself later in the stack.
+ This would output the timeout failure message twice and confuse
+ the run-webkit-tests script.
- Created "style" folder for code supporting check-webkit-style.
+ This patch adds a third state, Stopping, which prevents WebCore
+ errors to trigger done() when testing is over.
- * Scripts/modules/style: Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::done):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
-2009-12-20 Adam Barth <abarth@webkit.org>
+2010-10-08 Andras Becsi <abecsi@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Kenneth Rohde Christiansen.
- REGRESSION: error when running commit-queue
- https://bugs.webkit.org/show_bug.cgi?id=32806
+ [Qt] Add an activateFonts() implementation similar to DRT's initializeFonts().
+ Original code by Simon Hausmann.
+ https://bugs.webkit.org/show_bug.cgi?id=47402
- Fix typo and add test!
+ * WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp: Added.
+ (WTR::activateFonts):
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/bugzilla_unittest.py:
+2010-10-08 Andras Becsi <abecsi@webkit.org>
-2009-12-20 Adam Barth <abarth@webkit.org>
+ Reviewed by Csaba Osztrogonác.
- [bzt] Optimize status updates for new dashboard
- https://bugs.webkit.org/show_bug.cgi?id=32797
+ [Qt] Add support for Qt's WebKitTestRunner to old-run-webkit-tests.
+ https://bugs.webkit.org/show_bug.cgi?id=47401
- This patch makes the queues slightly more chatty with the web service.
- Also, this patch introduces some testing for the queues!
+ * Scripts/build-webkittestrunner:
+ * Scripts/old-run-webkit-tests:
- * Scripts/modules/commands/early_warning_system.py:
- * Scripts/modules/commands/early_warning_system_unittest.py: Added.
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/commands/queues_unittest.py:
- * Scripts/modules/commands/queuestest.py: Added.
- * Scripts/modules/mock_bugzillatool.py:
- * Scripts/modules/patchcollection.py:
- * Scripts/modules/queueengine.py:
- * Scripts/run-webkit-unittests:
+2010-10-07 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
-2009-12-20 Adam Barth <abarth@webkit.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by Eric Seidel.
+ [Qt] WTR first compile: fix compile issues.
+ https://bugs.webkit.org/show_bug.cgi?id=47343
- Prepare QueueStatusServer for new status messages
- https://bugs.webkit.org/show_bug.cgi?id=32805
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h:
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ * WebKitTestRunner/TestController.cpp:
+ * WebKitTestRunner/TestInvocation.cpp:
- * QueueStatusServer/handlers/recentstatus.py:
- * QueueStatusServer/index.html: Removed.
- * QueueStatusServer/model/attachment.py:
- * QueueStatusServer/model/queues.py: Added.
- * QueueStatusServer/templates/recentstatus.html: Added.
+2010-10-07 Antonio Gomes <agomes@rim.com>
-2009-12-20 Shinichiro Hamaji <hamaji@chromium.org>
+ Reviewed by Simon Fraser.
- Reviewed by Adam Barth.
+ [Mac] [DRT] implement setSpatialNavigationEnabled
+ https://bugs.webkit.org/show_bug.cgi?id=47291
- [check-webkit-style] static_cast is not misnamed!
- https://bugs.webkit.org/show_bug.cgi?id=32796
+ Implemented LayoutTestController::setSpatialNavigationEnabled for Mac's DRT
+ so it can track regression on the existing implementation and future improvements
+ we are making.
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setSpatialNavigationEnabled):
-2009-12-20 Alejandro G. Castro <alex@igalia.com>
+2010-10-07 Dirk Pranke <dpranke@chromium.org>
- Reviewed by Gustavo Noronha Silva.
+ Reviewed by Adam Barth.
- [GTK] Failing test platform/gtk/editing/pasteboard/middle-button-paste.html
- https://bugs.webkit.org/show_bug.cgi?id=32788
+ rebaseline-chromium-webkit-tests relied on the filename_to_uri()
+ hook in the Port infrastructure to generate URIs for the files
+ in its summary HTML report; however, that method is supposed to only
+ be used for test files (and should really be renamed), so this would
+ crash.
- Do not increase the click count if we are using a different button.
+ This change adds a new "path" module to the system package with a
+ routine called abspath_to_uri() that handles converting paths to
+ file: URIs independently of anything in the layout_tests package,
+ and changes the code to use this. At some point in the near future
+ the layout_tests/port/* code should use this as well.
- * DumpRenderTree/gtk/EventSender.cpp:
+ This change also deletes a bunch of unused code and fixes some
+ comments in rebaseline_chromium_webkit_tests.py.
-2009-12-20 Adam Barth <abarth@webkit.org>
+ https://bugs.webkit.org/show_bug.cgi?id=47319
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/common/system/path.py: Added.
+ * Scripts/webkitpy/common/system/path_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
- [QueueStatusServer] Add a per-patch details page
- https://bugs.webkit.org/show_bug.cgi?id=32784
+2010-10-07 Martin Robinson <mrobinson@igalia.com>
- This is a first cut at a per-patch details page. I'm sure we'll have
- to iterate.
+ Reviewed by Gustavo Noronha Silva.
- * QueueStatusServer/filters/webkit_extras.py:
- * QueueStatusServer/handlers/patch.py: Added.
- * QueueStatusServer/index.yaml:
- * QueueStatusServer/main.py:
- * QueueStatusServer/model/attachment.py:
- * QueueStatusServer/stylesheets/dashboard.css:
- * QueueStatusServer/templates/dashboard.html:
- * QueueStatusServer/templates/patch.html: Added.
+ [GTK] The FreeType backend does not respect the FC_EMBOLDEN property
+ https://bugs.webkit.org/show_bug.cgi?id=46216
-2009-12-20 Adam Barth <abarth@webkit.org>
+ Fix my latest commit, as it contained some bad changes from a merge gone wrong.
- Reviewed by Eric Seidel.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeFonts): Also initialize the DevaVu Sans font.
- Use memcache to make dashboard to fast
- https://bugs.webkit.org/show_bug.cgi?id=32780
+2010-10-07 Daniel Cheng <dcheng@chromium.org>
- * QueueStatusServer/app.yaml:
- * QueueStatusServer/handlers/dashboard.py:
- * QueueStatusServer/handlers/updatestatus.py:
- * QueueStatusServer/model/attachment.py: Added.
+ Reviewed by Tony Chang.
-2009-12-19 Brent Fulgham <bfulgham@webkit.org>
+ [chromium] Minor naming cleanup in WebDragData, part 2
+ https://bugs.webkit.org/show_bug.cgi?id=47227
- Reviewed by Adam Roben.
+ Update DRT to use the renamed methods.
- Provide an example implementation for printing under Windows.
- http://bugs.webkit.org/show_bug.cgi?id=32504.`
-
- * WinLauncher/PrintWebUIDelegate.cpp: Added.
- (PrintWebUIDelegate::QueryInterface):
- (PrintWebUIDelegate::AddRef):
- (PrintWebUIDelegate::Release):
- (PrintWebUIDelegate::webViewPrintingMarginRect):
- * WinLauncher/PrintWebUIDelegate.h: Added.
- (PrintWebUIDelegate::PrintWebUIDelegate):
- (PrintWebUIDelegate::createWebViewWithRequest):
- (PrintWebUIDelegate::webViewShow):
- (PrintWebUIDelegate::webViewClose):
- (PrintWebUIDelegate::webViewFocus):
- (PrintWebUIDelegate::webViewUnfocus):
- (PrintWebUIDelegate::webViewFirstResponder):
- (PrintWebUIDelegate::makeFirstResponder):
- (PrintWebUIDelegate::setStatusText):
- (PrintWebUIDelegate::webViewStatusText):
- (PrintWebUIDelegate::webViewAreToolbarsVisible):
- (PrintWebUIDelegate::setToolbarsVisible):
- (PrintWebUIDelegate::webViewIsStatusBarVisible):
- (PrintWebUIDelegate::setStatusBarVisible):
- (PrintWebUIDelegate::webViewIsResizable):
- (PrintWebUIDelegate::setResizable):
- (PrintWebUIDelegate::setFrame):
- (PrintWebUIDelegate::webViewFrame):
- (PrintWebUIDelegate::setContentRect):
- (PrintWebUIDelegate::webViewContentRect):
- (PrintWebUIDelegate::runJavaScriptAlertPanelWithMessage):
- (PrintWebUIDelegate::runJavaScriptConfirmPanelWithMessage):
- (PrintWebUIDelegate::runJavaScriptTextInputPanelWithPrompt):
- (PrintWebUIDelegate::runBeforeUnloadConfirmPanelWithMessage):
- (PrintWebUIDelegate::runOpenPanelForFileButtonWithResultListener):
- (PrintWebUIDelegate::mouseDidMoveOverElement):
- (PrintWebUIDelegate::contextMenuItemsForElement):
- (PrintWebUIDelegate::validateUserInterfaceItem):
- (PrintWebUIDelegate::shouldPerformAction):
- (PrintWebUIDelegate::dragDestinationActionMaskForDraggingInfo):
- (PrintWebUIDelegate::willPerformDragDestinationAction):
- (PrintWebUIDelegate::dragSourceActionMaskForPoint):
- (PrintWebUIDelegate::willPerformDragSourceAction):
- (PrintWebUIDelegate::contextMenuItemSelected):
- (PrintWebUIDelegate::hasCustomMenuImplementation):
- (PrintWebUIDelegate::trackCustomPopupMenu):
- (PrintWebUIDelegate::measureCustomMenuItem):
- (PrintWebUIDelegate::drawCustomMenuItem):
- (PrintWebUIDelegate::addCustomMenuDrawingData):
- (PrintWebUIDelegate::cleanUpCustomMenuDrawingData):
- (PrintWebUIDelegate::canTakeFocus):
- (PrintWebUIDelegate::takeFocus):
- (PrintWebUIDelegate::registerUndoWithTarget):
- (PrintWebUIDelegate::removeAllActionsWithTarget):
- (PrintWebUIDelegate::setActionTitle):
- (PrintWebUIDelegate::undo):
- (PrintWebUIDelegate::redo):
- (PrintWebUIDelegate::canUndo):
- (PrintWebUIDelegate::canRedo):
- (PrintWebUIDelegate::printFrame):
- (PrintWebUIDelegate::ftpDirectoryTemplatePath):
- (PrintWebUIDelegate::webViewHeaderHeight):
- (PrintWebUIDelegate::webViewFooterHeight):
- (PrintWebUIDelegate::drawHeaderInRect):
- (PrintWebUIDelegate::drawFooterInRect):
- (PrintWebUIDelegate::canRunModal):
- (PrintWebUIDelegate::createModalDialog):
- (PrintWebUIDelegate::runModal):
- (PrintWebUIDelegate::isMenuBarVisible):
- (PrintWebUIDelegate::setMenuBarVisible):
- (PrintWebUIDelegate::runDatabaseSizeLimitPrompt):
- (PrintWebUIDelegate::paintCustomScrollbar):
- (PrintWebUIDelegate::paintCustomScrollCorner):
- * WinLauncher/WinLauncher.cpp: Add new UI delegate for print support.
- (WinLauncherWebHost::updateAddressBar): check-webkit-style fixes.
- (WinLauncherWebHost::QueryInterface): check-webkit-style fixes.
- (WinLauncherWebHost::AddRef): check-webkit-style fixes.
- (WinLauncherWebHost::Release): check-webkit-style fixes.
- (resizeSubViews): check-webkit-style fixes.
- (_tWinMain): check-webkit-style fixes.
- (MyRegisterClass): check-webkit-style fixes.
- (InitInstance): check-webkit-style fixes.
- (AbortProc): New print support function.
- (getPrinterDC): New print support function.
- (initDocStruct): New print support function.
- (PrintView): New printing implementation.
- (WndProc): Add support for printing.
- (MyEditProc): check-webkit-style fixes.
- (About): check-webkit-style fixes.
- (loadURL): check-webkit-style fixes.
- * WinLauncher/WinLauncher.h:
- (WinLauncherWebHost::WinLauncherWebHost):
- (WinLauncherWebHost::didStartProvisionalLoadForFrame):
- (WinLauncherWebHost::didReceiveServerRedirectForProvisionalLoadForFrame):
- (WinLauncherWebHost::didFailProvisionalLoadWithError):
- (WinLauncherWebHost::didCommitLoadForFrame):
- (WinLauncherWebHost::didReceiveTitle):
- (WinLauncherWebHost::didReceiveIcon):
- (WinLauncherWebHost::didFinishLoadForFrame):
- (WinLauncherWebHost::didFailLoadWithError):
- (WinLauncherWebHost::didChangeLocationWithinPageForFrame):
- (WinLauncherWebHost::willPerformClientRedirectToURL):
- (WinLauncherWebHost::didCancelClientRedirectForFrame):
- (WinLauncherWebHost::willCloseFrame):
- (WinLauncherWebHost::windowScriptObjectAvailable):
- * WinLauncher/WinLauncher.rc: Add menu entry for printing.
- * WinLauncher/WinLauncher.vcproj: Add new files.
- * WinLauncher/resource.h: Add menu entry for printing.
-
-2009-12-19 Adam Barth <abarth@webkit.org>
-
- Unreviewed. Tweak the CSS to make the dashboard prettier.
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::beginDragWithFiles):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (addDRTFakeFileToDataObject):
- * QueueStatusServer/stylesheets/dashboard.css:
- * QueueStatusServer/templates/dashboard.html:
+2010-10-07 Anders Carlsson <andersca@apple.com>
-2009-12-19 Adam Barth <abarth@webkit.org>
+ Reviewed by Sam Weinig.
- Reviewed by Eric Seidel.
+ Add a WKPageFindClient, hook up WKPageCountStringMatches
+ https://bugs.webkit.org/show_bug.cgi?id=47373
- QueueStatusServer needs a human readable dashboard
- https://bugs.webkit.org/show_bug.cgi?id=32769
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ Remove hard coded paths.
- Here is a first cut at the dashboard. There's a lot left to do.
+ * TestWebKitAPI/Tests/WTF/VectorBasic.cpp:
+ (TestWebKitAPI::TEST):
+ Fix expected result.
- * QueueStatusServer/filters/webkit_extras.py:
- * QueueStatusServer/handlers/dashboard.py: Added.
- * QueueStatusServer/handlers/patchstatus.py:
- * QueueStatusServer/handlers/recentstatus.py:
- * QueueStatusServer/handlers/showresults.py:
- * QueueStatusServer/handlers/statusbubble.py:
- * QueueStatusServer/handlers/updatestatus.py:
- * QueueStatusServer/main.py:
- * QueueStatusServer/model/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
- * QueueStatusServer/model/queuestatus.py: Renamed from WebKitTools/QueueStatusServer/model.py.
- * QueueStatusServer/stylesheets/dashboard.css: Added.
- * QueueStatusServer/templates/dashboard.html: Added.
- * QueueStatusServer/templates/statusbubble.html: Renamed from WebKitTools/QueueStatusServer/status_bubble.html.
- * QueueStatusServer/templates/updatestatus.html: Renamed from WebKitTools/QueueStatusServer/update_status.html.
+ * TestWebKitAPI/Tests/WebKit2/Find.cpp: Added.
+ (TestWebKitAPI::didFinishLoadForFrame):
+ (TestWebKitAPI::didCountStringMatches):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/find.html: Added.
+ Add test for WKPageCountStringMatches.
-2009-12-19 Daniel Bates <dbates@webkit.org>
+2010-09-21 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Timothy Hatcher.
+ Reviewed by Chris Fleizach.
- https://bugs.webkit.org/show_bug.cgi?id=32462
+ [GTK] The FreeType backend does not respect the FC_EMBOLDEN property
+ https://bugs.webkit.org/show_bug.cgi?id=46216
- Added --inspector-frontend flag to build-webkit to copy any changes
- to the inspector front-end files to the built WebCore framework. This
- will make inspector development more consistent with the rest of
- WebKit development.
+ * DumpRenderTree/gtk/fonts/fonts.conf: Add a setting which enables FC_EMBOLDEN
+ for DejaVu Serif when there is no bold version available. This is necessary to
+ properly test the property in layout tests.
- * Scripts/build-webkit:
- * Scripts/webkitdirs.pm:
+2010-10-07 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>, Andras Becsi <abecsi@webkit.org>, Balazs Kelemen <kbalazs@webkit.org>
-2009-12-19 Adam Barth <abarth@webkit.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Unreviewed fixes for me being terrible at python.
+ [Qt] Add WTR's InjectedBundle build files.
+ https://bugs.webkit.org/show_bug.cgi?id=47333
- * Scripts/modules/bugzilla.py:
- * Scripts/run-webkit-unittests:
+ * Scripts/webkitdirs.pm:
+ * WebKitTestRunner/DerivedSources.pro: Added.
+ * WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro: Added.
+ * WebKitTestRunner/WebKitTestRunner.pro: Added.
+ * WebKitTestRunner/qt/DerivedSources.pro: Removed.
+ Content merged in ../DerivedSources.pro
-2009-12-18 Adam Barth <abarth@webkit.org>
+2010-10-07 Sheriff Bot <webkit.review.bot@gmail.com>
- Reviewed by Eric Seidel.
+ Unreviewed, rolling out r69315.
+ http://trac.webkit.org/changeset/69315
+ https://bugs.webkit.org/show_bug.cgi?id=47363
- Split QueueStatus server into modules
- https://bugs.webkit.org/show_bug.cgi?id=32768
+ Forgot to add the new files (Requested by kbalazs on #webkit).
- One monolithic file is no good.
+ * Scripts/webkitdirs.pm:
+ * WebKitTestRunner/qt/DerivedSources.pro: Added.
- * QueueStatusServer/app.yaml:
- * QueueStatusServer/handlers/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
- * QueueStatusServer/handlers/patchstatus.py: Added.
- * QueueStatusServer/handlers/recentstatus.py: Added.
- * QueueStatusServer/handlers/showresults.py: Added.
- * QueueStatusServer/handlers/statusbubble.py: Added.
- * QueueStatusServer/handlers/updatestatus.py: Added.
- * QueueStatusServer/main.py: Added.
- * QueueStatusServer/model.py: Added.
- * QueueStatusServer/queue_status.py: Removed.
+2010-10-07 Sam Weinig <sam@webkit.org>
-2009-12-18 Adam Barth <abarth@webkit.org>
+ Reviewed by Anders Carlsson.
- Rubber stamped by Eric Seidel.
+ Change API tester to ask the executable for the list of all
+ tests instead of relying on the directory structure.
+ https://bugs.webkit.org/show_bug.cgi?id=47359
- Renamed WorkQueue to QueueEngine. WorkQueue is not a queue.
+ * Scripts/run-test-webkit-api: Added.
+ * Scripts/webkitdirs.pm:
+ Add additional script to just launch the api tester with the correct settings.
+
+ * Scripts/run-api-tests:
+ Change to use the new --dump-tests options to build the list of tests and change
+ output to reflect a (suite, testcase) tuple for each test. Also adds some color.
+
+ * TestWebKitAPI/Test.h:
+ (TestWebKitAPI::Test::Register::Register):
+ * TestWebKitAPI/Tests/WTF/VectorBasic.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/WKString.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp:
+ (TestWebKitAPI::TEST):
+ Give each test a suite name in addition to the test name.
+
+ * TestWebKitAPI/TestsController.cpp:
+ (TestWebKitAPI::TestsController::dumpTestNames):
+ (TestWebKitAPI::TestsController::runTestNamed):
+ * TestWebKitAPI/TestsController.h:
+ * TestWebKitAPI/mac/main.mm:
+ (main):
+ Add option to print all registered tests.
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/queueengine.py: Added.
- * Scripts/modules/queueengine_unittest.py: Added.
- * Scripts/modules/stepsequence.py:
- * Scripts/modules/workqueue.py: Removed.
- * Scripts/modules/workqueue_unittest.py: Removed.
+2010-10-07 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>, Andras Becsi <abecsi@webkit.org>, Balazs Kelemen <kbalazs@webkit.org>
-2009-12-18 Adam Barth <abarth@webkit.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by Eric Seidel.
+ [Qt] Add WTR's InjectedBundle build files.
+ https://bugs.webkit.org/show_bug.cgi?id=47333
- Add watches for EWS
- https://bugs.webkit.org/show_bug.cgi?id=32767
+ * Scripts/webkitdirs.pm:
+ * WebKitTestRunner/DerivedSources.pro: Added.
+ * WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro: Added.
+ * WebKitTestRunner/WebKitTestRunner.pro: Added.
+ * WebKitTestRunner/qt/DerivedSources.pro: Removed.
+ Content merged in ../DerivedSources.pro
- dglazkov wanted to be added.
+2010-10-07 Balazs Kelemen <kbalazs@webkit.org>
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/commands/early_warning_system.py:
- * Scripts/modules/commands/queues.py:
+ Unreviewed. Do a renaming that was recommended by the reviewer
+ (Kenneth) but I forgot to do before landing (http://trac.webkit.org/changeset/69253)
-2009-12-18 Eric Seidel <eric@webkit.org>
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ (WTR::RunUntilConditionLoop::start):
+ (WTR::RunUntilConditionLoop::RunUntilConditionLoop):
+ (WTR::TestController::runUntil):
- Reviewed by David Levin.
+2010-10-07 Balazs Kelemen <kbalazs@webkit.org>
- move bugzilla.py off of urllib2
- https://bugs.webkit.org/show_bug.cgi?id=32729
+ Reviewed by Kenneth Rohde Christiansen.
- * Scripts/modules/bugzilla.py: use mechanize for all url fetching.
+ [Qt] Watchdog timer implementation for WTR
+ https://bugs.webkit.org/show_bug.cgi?id=47337
-2009-12-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Factor out
+ the definition of the timer type to a typedef.
+ * WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp: Added.
+ Timer implementation with QTimer and a helper QObject class.
+ (WTR::WatchdogTimerHelper::instance):
+ (WTR::WatchdogTimerHelper::timerFired):
+ (WTR::WatchdogTimerHelper::WatchdogTimerHelper):
+ (WTR::LayoutTestController::platformInitialize):
+ (WTR::LayoutTestController::invalidateWaitToDumpWatchdogTimer):
+ (WTR::LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded):
- Rubber-stamped by Xan Lopez.
+2010-10-07 Balazs Kelemen <kbalazs@webkit.org>
- [GTK] New events (pageshow and pagehide) tests failing
- https://bugs.webkit.org/show_bug.cgi?id=28823
+ Unreviewed buildfix for 69297 again
- Original patch by Jan Michael Alonzo.
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::blankURL):
- Disable page cache for tests.
+2010-10-07 Balazs Kelemen <Balazs Kelemen>
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (copyWebSettingKey):
- (LayoutTestController::overridePreference):
+ Unreviewed trivial build fix for r69297
-2009-12-18 Fumitoshi Ukai <ukai@chromium.org>
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::blankURL):
- Reviewed by David Levin.
+2010-10-07 Balazs Kelemen <kbalazs@webkit.org>
- Check one space before end of line comments.
- https://bugs.webkit.org/show_bug.cgi?id=32597
-
- Fix to check one space before end of line comments in whitespace and build/header_guard.
- Also fix build/header_guard to use WebKit header guard defines.
+ Reviewed by Kenneth Rohde Christiansen.
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+ WebKitTestRunner should be portable
+ https://bugs.webkit.org/show_bug.cgi?id=45393
-2009-12-17 Sam Weinig <sam@webkit.org>
+ Use only the WebKit API for working with urls.
+ * WebKitTestRunner/StringFunctions.h:
+ (WTR::createWKURL):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::blankURL):
+ (WTR::TestController::resetStateToConsistentValues):
+ (WTR::TestController::didFinishLoadForFrame):
- Reviewed by Mark Rowe.
+2010-10-07 Carlos Garcia Campos <cgarcia@igalia.com>
- Add BUILDING_ON_SNOW_LEOPARD #define.
+ Reviewed by Xan Lopez.
- * DumpRenderTree/mac/DumpRenderTreeMac.h:
+ [GTK] Use gtk_widget_draw() instead of gtk_widget_get_snapshot() in PixelDumpSupportGtk when building with gtk3
+ https://bugs.webkit.org/show_bug.cgi?id=47332
-2009-12-17 Yuzo Fujishima <yuzo@google.com>
+ * DumpRenderTree/gtk/PixelDumpSupportGtk.cpp:
+ (createBitmapContextFromWebView):
- Reviewed by Alexey Proskuryakov.
+2010-10-06 Chris Guillory <chris.guillory@google.com>
- Update pywebsocket to 0.4.5 and make handshake checking stricter
- https://bugs.webkit.org/show_bug.cgi?id=32249
+ Reviewed by Chris Fleizach.
- * Scripts/run-webkit-tests:
- * pywebsocket/mod_pywebsocket/handshake.py:
- * pywebsocket/mod_pywebsocket/memorizingfile.py: Added.
- * pywebsocket/mod_pywebsocket/standalone.py:
- * pywebsocket/setup.py:
- * pywebsocket/test/test_handshake.py:
- * pywebsocket/test/test_memorizingfile.py: Added.
+ Remove unused accessibility functions from webkit.
+ https://bugs.webkit.org/attachment.cgi?bugid=46707
-2009-12-17 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::postAccessibilityNotification):
+ * DumpRenderTree/chromium/WebViewHost.h:
- Reviewed by Adam Barth.
+2010-10-06 Lucas Forschler <lforschler@apple.com>
- Command.show_in_main_help should default to False
- https://bugs.webkit.org/show_bug.cgi?id=32686
+ Reviewed by Adam Roben.
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/queries.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/commands/upload.py:
- * Scripts/modules/multicommandtool.py:
+ Fix the sunspider-compare-results to actually use the passed in value for $root.
-2009-12-17 Alejandro G. Castro <alex@igalia.com>
+ * Scripts/sunspider-compare-results:
- Reviewed by Eric Seidel.
+2010-10-06 Balazs Kelemen <kbalazs@webkit.org>
- Added the key WebKitEnableCaretBrowsing to the
- layoutTestController.overridePreference in order to activate caret
- browsing.
- https://bugs.webkit.org/show_bug.cgi?id=32612
+ Reviewed by Kenneth Rohde Christiansen.
- * DumpRenderTree/gtk/DumpRenderTree.cpp: Added the reset value of
- the setting.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Inserted the new
- key in the keytable.
+ [Qt] Runloop implementation for WTR
+ https://bugs.webkit.org/show_bug.cgi?id=47280
-2009-12-17 Chris Fleizach <cfleizach@apple.com>
+ * WebKitTestRunner/qt/TestControllerQt.cpp:
+ Implemented TestController::runUntil by a timerEvent
+ and a QEventLoop. We step into the event loop from runUntil.
+ While we are waiting in the loop a timerEvent is periodically
+ checking the value of the condition. Once the condition has
+ becoming true the timerEvent wakes us up.
+ (WTR::RunUntilLoop::start):
+ (WTR::RunUntilLoop::RunUntilLoop):
+ (WTR::RunUntilLoop::run):
+ (WTR::RunUntilLoop::timerEvent):
+ (WTR::TestController::platformInitialize):
+ (WTR::TestController::runUntil):
+ * WebKitTestRunner/qt/main.cpp:
+ Start the main event loop first and creating the TestController later.
+ (Launcher::Launcher):
+ (Launcher::~Launcher):
+ (Launcher::launch): Creating the TestController.
+ (main): Setting up a timer for calling Launcher::launch from
+ the main event loop.
- Reviewed by David Kilzer.
+2010-10-06 Dirk Pranke <dpranke@chromium.org>
- AX: DRT needs to support URL for accessibility
- https://bugs.webkit.org/show_bug.cgi?id=32666
+ Reviewed by Kenneth Russell.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getURLCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::url):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::url):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::url):
+ new-run-webkit-tests: fix typo in chromium-gpu that was trying to
+ enable 'accelerated-composting' instead of 'accelerated-compositing'.
-2009-12-17 Philippe Normand <pnormand@igalia.com>
+ https://bugs.webkit.org/show_bug.cgi?id=47312
- Unreviewed; added myself to committers
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py:
- * Scripts/modules/committers.py:
+2010-10-06 Balazs Kelemen <kbalazs@webkit.org>
-2009-12-17 Benjamin Otte <otte@gnome.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Unreviewed; added myself to committers
+ [Qt] PlatformWebView implementation for WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=47276
+
+ The implementation follows the way how
+ we use the API in MiniBrowser.
+ * WebKitTestRunner/PlatformWebView.h:
+ * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+ (WTR::WebView::wkView):
+ (WTR::WebView::~WebView):
+ (WTR::WebView::WebView):
+ (WTR::PlatformWebView::PlatformWebView):
+ (WTR::PlatformWebView::~PlatformWebView):
+ (WTR::PlatformWebView::resizeTo):
+ (WTR::PlatformWebView::page):
+ (WTR::PlatformWebView::focus):
+ * WebKitTestRunner/qt/WebKitTestRunner.pro:
+
+2010-10-06 Balazs Kelemen <kbalazs@webkit.org>
- * Scripts/modules/committers.py:
+ Reviewed by Kenneth Rohde Christiansen.
-2009-12-17 Adam Barth <abarth@webkit.org>
+ [Qt] Add WebKitTestRunner's build files
+ https://bugs.webkit.org/show_bug.cgi?id=44155
+
+ Parts was taken by Zoltan Horvath's patch.
+
+ * Scripts/generate-forwarding-headers.pl: Moved from WebKit2.
+ * Scripts/webkitdirs.pm: Make the generated files needed by WTR.
+ * WebKitTestRunner/PlatformWebView.h: Addeed typedefs for
+ PlatformWKView and PlatformWindow (void* for now).
+ Buildfix the case when __APPLE__ is not defined.
+ * WebKitTestRunner/qt/DerivedSources.pro: Added.
+ * WebKitTestRunner/qt/PlatformWebViewQt.cpp: Added.
+ Empty stub implementation.
+ (WTR::registerWindowClass):
+ (WTR::PlatformWebView::PlatformWebView):
+ (WTR::PlatformWebView::~PlatformWebView):
+ (WTR::PlatformWebView::resizeTo):
+ (WTR::PlatformWebView::page):
+ (WTR::PlatformWebView::focus):
+ * WebKitTestRunner/qt/TestControllerQt.cpp: Added.
+ Empty stub implementation.
+ (WTR::registerWindowClass):
+ (WTR::TestController::runUntil):
+ (WTR::TestController::platformInitialize):
+ (WTR::TestController::initializeInjectedBundlePath):
+ (WTR::TestController::initializeTestPluginDirectory):
+ (WTR::TestController::platformInitializeContext):
+ * WebKitTestRunner/qt/WebKitTestRunner.pro: Added.
+ * WebKitTestRunner/qt/main.cpp: Added.
+ (main):
- Rubber stamp by Seidel.
+2010-10-06 Tony Chang <tony@chromium.org>
- Clean up exception handling in WorkQueue. Basically, a bunch of the
- delegate messages can throw exceptions because of network errors. We
- want the queues to keep on ticking instead of erroring out. That means
- we want to catch generic exceptions and continue looping.
+ Unreviewed, rolling out r69202.
+ http://trac.webkit.org/changeset/69202
+ https://bugs.webkit.org/show_bug.cgi?id=46937
- Also, cleaned up the exception handling in the EWS to properly log
- failures.
+ Broke compile of test_shell
- * Scripts/modules/commands/early_warning_system.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/workqueue.py:
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::beginDragWithFiles):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (addDRTFakeFileToDataObject):
-2009-12-16 Adam Barth <abarth@webkit.org>
+2010-10-06 Daniel Cheng <dcheng@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Tony Chang.
- [bzt] Make UpdateStep quiet
- https://bugs.webkit.org/show_bug.cgi?id=32599
+ [chromium] Minor naming cleanup in WebDragData, part 2
+ https://bugs.webkit.org/show_bug.cgi?id=46937
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/buildsteps_unittest.py:
+ Update DRT to use the renamed methods.
-2009-12-16 Evan Martin <evan@chromium.org>
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::beginDragWithFiles):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (addDRTFakeFileToDataObject):
- Reviewed by Adam Barth.
+2010-10-06 David Kilzer <ddkilzer@apple.com>
- Add Gtk to the early warning system WebKit port list.
+ <http://webkit.org/b/47270> Move WebArchive serialization code into its own file
- https://bugs.webkit.org/show_bug.cgi?id=32629
+ Reviewed by Adam Roben.
- * Scripts/modules/commands/early_warning_system.py:
- * Scripts/modules/webkitport.py:
- * Scripts/modules/webkitport_unittest.py:
+ This is the first step in making webarchive tests work on
+ Windows.
-2009-12-16 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added
+ new files to the project.
+ * DumpRenderTree/mac/DumpRenderTree.mm: Removed code that moved
+ to WebArchiveDumpSupport.mm.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.h: Added.
+ * DumpRenderTree/mac/WebArchiveDumpSupport.mm: Copied from WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm.
+ (serializeWebArchiveToXML):
- Reviewed by Adam Barth.
+2010-10-05 Daniel Bates <dbates@rim.com>
- post-diff is failing with exception under guess_reviewer_from_bug
- https://bugs.webkit.org/show_bug.cgi?id=32642
-
- Also refactor output capturing code into
- OutputCapture.assert_outputs to share more code between tests.
-
- * Scripts/modules/buildsteps.py:
- - Add the missing include.
- - Give guess_reviewer_from_bug a private underscore.
- * Scripts/modules/buildsteps_unittest.py: Added.
- - Test to make sure _guess_reviewer_from_bug works as expected.
- * Scripts/modules/commands/commandtest.py:
- - Custom code is now obsoleted by OutputCapture.assert_outputs
- * Scripts/modules/commands/queues_unittest.py:
- - ditto
- * Scripts/modules/credentials_unittest.py:
- - ditto
- * Scripts/modules/mock_bugzillatool.py:
- - fetch_reviewed_patches_from_bug can never return None
- * Scripts/modules/multicommandtool_unittest.py:
- - Custom code is now obsoleted by OutputCapture.assert_outputs
- * Scripts/modules/outputcapture.py:
- - Add assert_outputs to share more code between tests.
- * Scripts/run-webkit-unittests:
- - Add buildsteps_unittest.py
-
-2009-12-16 Adam Barth <abarth@webkit.org>
-
- Unreviewed. Added a default argument to _update_status so that callers
- don't have to explictly pass None when they don't have a patch object.
-
- * Scripts/modules/commands/queues.py:
-
-2009-12-16 Kent Tamura <tkent@chromium.org>
+ Reviewed by David Kilzer.
- Reviewed by David Levin.
+ Add infrastructure to towards detecting change log diffs that aren't at the top of the ChangeLog
+ https://bugs.webkit.org/show_bug.cgi?id=46058
- check-webkit-style supports for TAB check against text files.
- https://bugs.webkit.org/show_bug.cgi?id=32538
+ Make VCSUtils::fixChangeLogPatch() return a reference to a hash
+ structure so as to support returning additional information
+ about a change log diff.
- * Scripts/check-webkit-style:
- Move process_patch() to style.py.
- * Scripts/modules/cpp_style.py:
- Add can_handle().
- * Scripts/modules/cpp_style_unittest.py:
- Add tests for can_handle().
- * Scripts/modules/style.py:
- Added. This is a front-end of cpp_style and text_style. It dispatches
- files to an appropriate linter.
- * Scripts/modules/text_style.py:
- Added. This is a linter module for generic text files. It supports
- only for TAB checking at this moment.
- * Scripts/modules/text_style_unittest.py:
- Added. Tests for text_style.py.
- * Scripts/run-webkit-unittests:
- Add text_style_unittest.
-
-2009-12-16 Eric Seidel <eric@webkit.org>
+ Currently, VCSUtils::fixChangeLogPatch() returns a string that
+ represents the change log diff. Towards supporting the return
+ of additional information, such as whether the change log diff
+ inserts an entry at the top of the ChangeLog file, we need to
+ make VCSUtils::fixChangeLogPatch() return a reference to hash
+ structure.
- Reviewed by David Levin.
+ * Scripts/VCSUtils.pm:
+ - Modified fixChangeLogPatch() to return a reference to a
+ hash structure.
+ - Added documentation to fixChangeLogPatch().
+ - Modified call site in mergeChangeLogs() as necessary.
+ * Scripts/svn-apply:
+ - Modified call site in patch() as necessary.
+ * Scripts/svn-create-patch:
+ - Modified call site in generateDiff() as necessary.
+ * Scripts/svn-unapply:
+ - Modified call site in patch() as necessary.
+ * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl:
+ - Modified the unit tests as necessary.
- bugzilla-tool should not require users to install mechanize
- https://bugs.webkit.org/show_bug.cgi?id=32635
+2010-10-05 Tony Chang <tony@chromium.org>
- Centralize our import logic.
+ Reviewed by Darin Adler.
- * Scripts/modules/bugzilla.py: use webkit_mechanize
- * Scripts/modules/statusbot.py: use webkit_mechanize
- * Scripts/modules/webkit_mechanize.py: Added.
+ fix the link to the expected image on windows
+ https://bugs.webkit.org/show_bug.cgi?id=47228
-2009-12-16 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py: On
+ windows, the file must be opened in binary mode when writing
+ binary data.
- Reviewed by Adam Barth.
+2010-10-05 Adam Barth <abarth@webkit.org>
- Generalize commit-queue recent status page for all queues
- https://bugs.webkit.org/show_bug.cgi?id=32633
+ Update expected result of unittest to match Tony's change below.
- * QueueStatusServer/index.html:
- - Generalize to support other queues.
- * QueueStatusServer/queue_status.py:
- - Generalize MainPage to support other queues.
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
-2009-12-16 Evan Martin <evan@chromium.org>
+2010-10-05 Tony Chang <tony@chromium.org>
- Reviewed by Adam Barth.
+ Reviewed by Ojan Vafai (over the shoulder).
- Early warning system server should display output as UTF-8.
+ Paper over errors in image_diff so we don't crash the whole test run.
- https://bugs.webkit.org/show_bug.cgi?id=32625
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
- * QueueStatusServer/queue_status.py:
+2010-10-05 Tony Chang <tony@chromium.org>
-2009-12-16 Adam Barth <abarth@webkit.org>
+ Unreviewed, make shutil.rmtree more resiliant to errors
+ since windows was raising WindowsError: The process cannot access the file because it
+ is being used by another process.
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
- [bzt] Add error handling to the early warning system
- https://bugs.webkit.org/show_bug.cgi?id=32594
+2010-10-05 Tony Chang <tony@chromium.org>
- This should be the last step in making the EWS operational. When we
- have a build error, we post the log to QueueStatusServer and add a link
- to the bug.
+ Reviewed by Ojan Vafai.
- * Scripts/modules/commands/early_warning_system.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/executive.py:
+ [chromium] fix image diffing in NRWT
+ https://bugs.webkit.org/show_bug.cgi?id=47128
-2009-12-16 Simon Hausmann <simon.hausmann@nokia.com>
+ * Scripts/webkitpy/layout_tests/port/chromium.py: Stop using
+ NamedTemporaryFile since it doesn't work on Windows.
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
- Reviewed by Holger Freyther.
+2010-10-05 Kenneth Russell <kbr@google.com>
- Fix crash with tests that use custom font faces.
+ Reviewed by Tony Chang.
- https://bugs.webkit.org/show_bug.cgi?id=32600
+ [chromium] Implement layerTreeAsText in DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=47216
- In the DRT we call QApplication::removeAllApplicationFonts(), to make sure
- that custom font faces between tests don't influence each other. Calling this
- function in Qt however also invalidates all existing handles with QFontDatabase.
+ Plumbed Frame::layerTreeAsText through Chromium's WebKit API to
+ make it callable from DumpRenderTree.
- In order to make sure that WebCore also drops these handles we call QWebSettings::clearMemoryCaches(),
- which implies a call to WebCore::FontCache::fontCache()->invalidate().
+ No new tests; verified with existing compositor layout tests.
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
- (WebCore::DumpRenderTree::open):
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::layerTreeAsText):
+ * DumpRenderTree/chromium/LayoutTestController.h:
-2009-12-16 Andreas Kling <andreas.kling@nokia.com>
+2010-10-05 Brent Fulgham <bfulgham@webkit.org>
- Reviewed by Simon Hausmann.
+ Unreviewed build correction.
- [Qt] Maintain button state between mouse events.
+ * DumpRenderTree/win/ImageDiff.vcproj: Use WinCairo debug
+ property sheet so proper libraries are linked.
- This allows eventSender to generate drag events.
+2010-10-05 Robert Hogan <robert@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=32601
+ Reviewed by Andreas Kling.
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::mouseDown):
- (EventSender::mouseUp):
- (EventSender::mouseMoveTo):
- * DumpRenderTree/qt/EventSenderQt.h:
+ [Qt] Fix url conversion in QWebHistory
-2009-12-15 Chris Jerdonek <chris.jerdonek@gmail.com>
+ Converting from KURL to WFT::String to QUrl does not
+ permit proper percent encoding later.
- Reviewed by David Levin.
+ https://bugs.webkit.org/show_bug.cgi?id=47048
- Code clean-up in check-webkit-style as described below.
- The only functional changes are minor improvements to the
- script's help output.
-
- https://bugs.webkit.org/show_bug.cgi?id=32487
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::dumpHistoryItem):
- * Scripts/check-webkit-style:
- - Added the module docstring from cpp_style.py.
- - Improved wording of the --help output and added some of the
- default values as substitution strings.
- - Called cpp_style.exit_with_usage instead of sys.stderr.write
- in main function.
- - Made changes caused by changes to cpp_style.py.
+2010-10-05 Anders Carlsson <andersca@apple.com>
- * Scripts/modules/cpp_style.py:
- - Removed module docstring, as well as redundant _USAGE string
- and main() function obsoleted by check-webkit-style.
- - Moved specification of default script values from within a
- function definition to global variables.
- - Moved the default webkit filter rules to be near the other
- global variables.
- - Renamed "FILTER" global variables to "FILTER_RULES" to
- establish unambiguous terminology.
- - Renamed _ERROR_CATEGORIES to _STYLE_CATEGORIES.
- - Changed _STYLE_CATEGORIES from a string to a list.
- - Added default webkit filter rules to --filter= output.
- - Renamed "print_" methods to "exit_with_" since they exist
- and added a temporary display_help parameter.
- - Added a temporary display_help parameter to parse_arguments.
+ Reviewed by Sam Weinig.
- * Scripts/modules/cpp_style_unittest.py:
- - Made changes caused by changes to cpp_style.py.
- - Lower-cased ErrorCollector's ERROR_CATEGORIES instance
- variables since they are not global.
+ REGRESSION (r68966?): All dumpAsText test fail on WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=47188
+ <rdar://problem/8514104>
-2009-12-15 Adam Barth <abarth@webkit.org>
+ When constructing the std::string, use the real string length instead of the maximum buffer size.
- Unreviewed fix for the style-queue.
- Typo: _updates_status -> _update_status
+ * TestWebKitAPI/PlatformUtilities.h:
+ (TestWebKitAPI::Util::toSTD):
+ * WebKitTestRunner/StringFunctions.h:
+ (WTR::toSTD):
- We need to improve our testing infrastructure for the queues.
+2010-10-04 Sam Weinig <sam@webkit.org>
- * Scripts/modules/commands/queues.py:
+ Reviewed by Mark Rowe.
-2009-12-15 Adam Barth <abarth@webkit.org>
+ Add MIMEType accessor to WKFrame
+ <rdar://problem/8347683>
+ https://bugs.webkit.org/show_bug.cgi?id=47138
+
+ * TestWebKitAPI/PlatformUtilities.h:
+ (TestWebKitAPI::Util::toSTD):
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp: Added.
+ (TestWebKitAPI::didStartProvisionalLoadForFrame):
+ (TestWebKitAPI::didCommitLoadForFrame):
+ (TestWebKitAPI::didFinishLoadForFrame):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp: Added.
+ (TestWebKitAPI::didStartProvisionalLoadForFrame):
+ (TestWebKitAPI::didCommitLoadForFrame):
+ (TestWebKitAPI::didFinishLoadForFrame):
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/basic-1.html: Removed.
+ * TestWebKitAPI/Tests/WebKit2/icon.png: Added.
+ * TestWebKitAPI/Tests/WebKit2/simple.html: Added.
+ * TestWebKitAPI/mac/PlatformUtilitiesMac.mm:
+ (TestWebKitAPI::Util::createURLForResource):
+
+2010-10-05 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Ojan Vafai.
+
+ [NRWT] Rename current_dir to current_group because it's not a directory
+ https://bugs.webkit.org/show_bug.cgi?id=47169
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-10-04 Dirk Pranke <dpranke@chromium.org>
- Unreviewed fix for the style-queue. I suspect this is a recent
- regression from Eric's change below.
+ Unreviewed, build fix.
- * Scripts/modules/commands/queues.py:
+ r69065 broke test-webkitpy by trying to create a '/tmp-X' directory,
+ which can't always be done. This test uses tempfile.mkdtemp(), which
+ should be safe.
-2009-12-15 Yaar Schnitman <yaar@chromium.org>
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- Reviewed by Darin Fisher.
+2010-10-04 Dirk Pranke <dpranke@chromium.org>
- update-webkit-chromium to auto-install gclient
+ Unreviewed, build fix.
- https://bugs.webkit.org/show_bug.cgi?id=32587
+ Add missing "from __future__ import with_statement" that was
+ breaking test-webkitpy on the Leopard bots (broke in r69040).
- * Scripts/update-webkit-chromium:
+ * Scripts/webkitpy/layout_tests/port/google_chrome.py:
-2009-12-15 Eric Seidel <eric@webkit.org>
+2010-10-04 Sheriff Bot <webkit.review.bot@gmail.com>
- Reviewed by Adam Barth.
+ Unreviewed, rolling out r69066.
+ http://trac.webkit.org/changeset/69066
+ https://bugs.webkit.org/show_bug.cgi?id=47163
- bugzilla-tool / commit-queue should add results links to bugs when more results are available on the status bot
- https://bugs.webkit.org/show_bug.cgi?id=32546
+ Made NRWT reliability worse. (Requested by tkent on #webkit).
- You can see an example of this working in:
- https://bugs.webkit.org/show_bug.cgi?id=32585#c3
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
- * QueueStatusServer/queue_status.py:
- - Output the id of the newly created status.
- * Scripts/modules/commands/queues.py:
- - Tweak the commit-queue logging to include a full status link.
- * Scripts/modules/statusbot.py:
- - update_status should return the newly created status id.
+2010-10-04 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
-2009-12-15 Andras Becsi <abecsi@inf.u-szeged.hu>
+ Reviewed by Tony Chang.
- Reviewed by Tor Arne Vestbø.
+ [NRWT] Reverse the http tests to alphabetical order.
+ https://bugs.webkit.org/show_bug.cgi?id=47075
- [Qt] Rename Qt DRT components to match other ports' naming convention and to be more understandable.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * DumpRenderTree/qt/DumpRenderTree.cpp: Removed.
- * DumpRenderTree/qt/DumpRenderTree.h: Removed.
- * DumpRenderTree/qt/DumpRenderTree.pro: Updated.
- * DumpRenderTree/qt/DumpRenderTreeQt.cpp: Copied from WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp.
- * DumpRenderTree/qt/DumpRenderTreeQt.h: Copied from WebKitTools/DumpRenderTree/qt/DumpRenderTree.h.
- * DumpRenderTree/qt/GCControllerQt.cpp: Copied from WebKitTools/DumpRenderTree/qt/jsobjects.cpp.
- (GCController::GCController):
- * DumpRenderTree/qt/GCControllerQt.h: Copied from WebKitTools/DumpRenderTree/qt/jsobjects.h.
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- * DumpRenderTree/qt/WorkQueueItem.h: Removed.
- * DumpRenderTree/qt/WorkQueueItemQt.cpp: Updated includes.
- * DumpRenderTree/qt/WorkQueueItemQt.h: Copied from WebKitTools/DumpRenderTree/qt/WorkQueueItem.h.
- * DumpRenderTree/qt/jsobjects.cpp: Removed.
- * DumpRenderTree/qt/jsobjects.h: Removed.
- * DumpRenderTree/qt/main.cpp: Updated includes.
+2010-10-04 Robert Hogan <robert@webkit.org>
-2009-12-15 Adam Barth <abarth@webkit.org>
+ Reviewed by Andreas Kling.
- Reviewed by Eric Seidel.
+ [Qt] Fix timeout on http/tests/navigation/post-goback2.html and postredirect-goback2.html
- We have two mark-fixed commands
- https://bugs.webkit.org/show_bug.cgi?id=32073
+ We need to queue back and forward navigations in the DRT from the
+ LayoutTestController so that maybeDump() knows about them.
- * Scripts/mark-bug-fixed: Removed.
- * Scripts/modules/commands/upload.py:
- * Scripts/modules/commands/upload_unittest.py:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::queueBackNavigation):
+ (LayoutTestController::queueForwardNavigation):
-2009-12-15 Eric Seidel <eric@webkit.org>
+2010-10-04 Tony Chang <tony@chromium.org>
- Reviewed by Adam Barth.
+ Reviewed by Kent Tamura.
- bugzilla-tool/commit-queue needs to upload failure logs when patches are rejected
- https://bugs.webkit.org/show_bug.cgi?id=28286
+ [chromium] fix image diffing in NRWT
+ https://bugs.webkit.org/show_bug.cgi?id=47128
- * QueueStatusServer/index.html:
- - Show [results] links if a results log was uploaded.
- * QueueStatusServer/queue_status.py:
- - Empty file uploads appear as u"" and Blob does not handle unicode, so convert to str().
- * Scripts/modules/commands/queues.py:
- - Post to the status bot when a patch fails and include the failure log as a results file.
+ * Scripts/webkitpy/layout_tests/port/chromium.py: Flush data to the
+ temp file and check the image_diff error code more carefully
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
-2009-12-15 Eric Seidel <eric@webkit.org>
+2010-10-04 Dirk Pranke <dpranke@chromium.org>
Reviewed by Adam Barth.
- queue sub-commands need --status-host so they can report status
- https://bugs.webkit.org/show_bug.cgi?id=32313
+ aroben's change in r68792 actually broke new-run-webkit-tests when
+ running the DRT code path. His change was intended to fix the
+ way we were converting windows paths to URIs when running under
+ Cygwin (the paths were getting one too many "/" on the front).
+ However, the change ended up breaking the chromium_win port, which
+ had slightly different logic.
- Make --status-bot a global option and make
- run_bugzilla_tool pass --status-bot to sub-commands.
+ This patch removes the port-specific code and adds tests to make
+ sure we're getting the behavior we expect. The Port object no longer
+ exposes a get_absolute_path() method that can be used outside of
+ of converting test filenames, because it's unreliable otherwise
+ (we don't have the right context to know which conversion is intended).
- * Scripts/bugzilla-tool:
- - Rename _status to status_bot and make it non-lazy.
- * Scripts/modules/commands/queues.py:
- - Move status updates out of WorkQueue and into individual queues.
- * Scripts/modules/commands/queues_unittest.py:
- - Test that --status-host is passed to bugzilla-tool when run as subcommand.
- * Scripts/modules/mock_bugzillatool.py:
- - Add a MockStatusBot
- * Scripts/modules/workqueue.py:
- - Remove status_host and work_work_logs_directory callbacks.
- - Add new work_item_log_path callback so that WorkQueue doesn't need to know about patches!
- * Scripts/modules/workqueue_unittest.py:
- - Update unit tests to reflect new callbacks.
+ https://bugs.webkit.org/show_bug.cgi?id=47140
-2009-12-15 Adam Barth <abarth@webkit.org>
-
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- scm_unittest.py is too slow
- https://bugs.webkit.org/show_bug.cgi?id=31818
+2010-10-04 Dirk Pranke <dpranke@chromium.org>
- Now we don't run the SCM unit tests unless we get the --all flag on the
- command line. Eric and I were commenting out this test because it was
- too painful to run.
+ Unreviewed, build fix.
- * Scripts/run-webkit-unittests:
+ Handle crash introduced in r69040 if we are not running in a
+ Chromium checkout.
-2009-12-14 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
- Unreviewed. Fix failing unittest.
+2010-10-04 Dirk Pranke <dpranke@chromium.org>
- * Scripts/modules/bugzilla_unittest.py:
+ Reviewed by Tony Chang.
-2009-12-14 Eric Seidel <eric@webkit.org>
+ Add a way for us to have test expectations that are specific to the
+ official builds of Google Chrome (as opposed to Chromium). This change
+ looks for an additional "test_expectations_chrome.txt" file in
+ Chromium's repository (webkit/tools/layout_tests), and uses the
+ concatenation of that file and the regular test_expectations.txt
+ file for test overrides.
- Reviewed by Adam Barth.
+ https://bugs.webkit.org/show_bug.cgi?id=46854
- Move Credential handling out into a separate module
- https://bugs.webkit.org/show_bug.cgi?id=32531
+ * Scripts/webkitpy/layout_tests/port/google_chrome.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/credentials.py: Added.
- * Scripts/modules/credentials_unittest.py: Added.
- * Scripts/run-webkit-unittests:
+2010-10-04 Simon Fraser <simon.fraser@apple.com>
-2009-12-14 Adam Barth <abarth@webkit.org>
+ Color tests in the list based on existing pass/fail result.
+
+ Fix the summary data to account for htmlOnly and nonHTML tests.
+
+ * CSSTestSuiteHarness/harness/harness.css:
+ (#test-list > option.pass):
+ (#test-list > option.fail):
+ (#test-list > option.skipped):
+ * CSSTestSuiteHarness/harness/harness.js:
+ (Test):
+ (Test.prototype.statusForFormat):
+ (TestSuite.prototype.fillTestList):
+ (TestSuite.prototype.updateTestList):
+ (TestSuite.prototype.recordResult):
+ (TestSuite.prototype.markTestCompleted):
+ (TestSuite.prototype.countTestsWithFlag):
+ (TestSuite.prototype.queryDatabaseForSummary.this.db.transaction):
+ (TestSuite.prototype.queryDatabaseForSummary):
+
+2010-10-04 Chris Fleizach <cfleizach@apple.com>
- Reviewed by Eric Seidel.
+ Reviewed by Beth Dakin.
- Kill _create_step_sequence
- https://bugs.webkit.org/show_bug.cgi?id=32539
+ AX: doAXRangeForLine does not work
+ https://bugs.webkit.org/show_bug.cgi?id=47101
- It's cleaner to represent not having these sequences as an empty
- sequence instead of None.
+ DRT support to handle NSAccessibilityRangeForLineParameterizedAttribute.
- * Scripts/modules/commands/download.py:
- * Scripts/modules/stepsequence.py:
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (rangeForLineCallback):
+ (AccessibilityUIElement::rangeForLine):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::rangeForLine):
-2009-12-14 Adam Barth <abarth@webkit.org>
+2010-10-04 Andrey Kosyakov <caseq@chromium.org>
- Unreviewed. Address reviewer comments from an earlier patch. I didn't
- do this earlier because I was worried about conflicts in dependent
- patches.
+ Unreviewed. Adding myself to the committers list.
- * Scripts/modules/commands/download.py:
+ * Scripts/webkitpy/common/config/committers.py:
-2009-12-14 Adam Barth <abarth@webkit.org>
+2010-10-04 Sam Weinig <sam@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Anders Carlsson.
- [bzt] Make download commands declarative
- https://bugs.webkit.org/show_bug.cgi?id=32469
+ Add ability to set the CacheModel in Webkit2
+ https://bugs.webkit.org/show_bug.cgi?id=47066
- This patch "properly" factors most of the download commands. These
- commands are now largely declarative, which is the final step of this
- grand refactoring.
+ * MiniBrowser/mac/AppDelegate.m:
+ (-[BrowserAppDelegate init]): Opt minibrowser into
+ a PrimaryWebBrowser cache model.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
+2010-10-03 Simon Fraser <simon.fraser@apple.com>
-2009-12-14 Adam Barth <abarth@webkit.org>
+ Make sure to enter all tests when creating the database
+ for the first time.
+
+ When migrating to a new version of the suite, be sure to
+ sync up the database and testinfo.data by removing old
+ tests, and inserting new ones.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.openDatabase.creation):
+ (TestSuite.prototype.databaseCreated):
+ (TestSuite.prototype.populateDatabaseFromTestInfoData):
+ (TestSuite.prototype.insertTest):
+
+2010-10-03 Simon Fraser <simon.fraser@apple.com>
+
+ More work on treating HTML4 and XHTML1 independently; when
+ changing the format, rebuild the test list, and update the
+ numbers in the chapter popup.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ (Test):
+ (Test.prototype.runForFormat):
+ (Test.prototype.completedForFormat):
+ (ChapterSection):
+ (ChapterSection.prototype.countTests):
+ (Chapter):
+ (Chapter.prototype.description):
+ (Chapter.prototype.countTests):
+ (Chapter.prototype.testCount):
+ (Chapter.prototype.untestedCount):
+ (TestSuite.prototype.buildChapters):
+ (TestSuite.prototype.loadCurrentTest):
+ (TestSuite.prototype.updateProgressLabel):
+ (TestSuite.prototype.processFlags):
+ (TestSuite.prototype.formatChanged):
+
+2010-10-03 Simon Fraser <simon.fraser@apple.com>
+
+ Update test suite version 20101001.
+
+ Handle database migration, and delete tests from the db that are
+ not present in testinfo.data.
+
+ Load about:blank into the test frame before the test url, to make
+ missing tests more obvious.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.loadTest):
+ (TestSuite.prototype.openDatabase.creation):
+ (TestSuite.prototype.openDatabase.migration1_0To1_1):
+ (TestSuite.prototype.openDatabase.if.return):
+ (TestSuite.prototype.databaseReady):
+ (TestSuite.prototype.populateDatabaseFromTestInfoData):
+ (TestSuite.prototype.syncDatabaseWithTestInfoData.this.db.transaction):
+ (TestSuite.prototype.syncDatabaseWithTestInfoData):
- Reviewed by Eric Seidel.
+2010-10-02 Simon Fraser <simon.fraser@apple.com>
- [bzt] Add AbstractPatchSequencingCommand to remove redundant code
- https://bugs.webkit.org/show_bug.cgi?id=32468
+ Add the ability to jump to a specific test.
- Redundant code is bad. This patch moves us towards more declarative
- commands.
+ * CSSTestSuiteHarness/harness/harness.html:
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.goToTestByName):
+ (TestSuite.prototype.switchToFormat):
- * Scripts/modules/commands/download.py:
+2010-10-02 Simon Fraser <simon.fraser@apple.com>
-2009-12-14 Adam Barth <abarth@webkit.org>
+ For a ref test, load the ref in the same format (HTML4 vs XHTML1)
+ as the test.
- Reviewed by Eric Seidel.
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.loadRef):
- [bzt] Kill WebKitApplyingScripts
- https://bugs.webkit.org/show_bug.cgi?id=32467
+2010-10-02 Simon Fraser <simon.fraser@apple.com>
- Ah! I've been wanting to do this for a long time. This patch brings
- the applying commands into the patch processing fold.
+ Update the UI to reflect the fact that each test needs to be tested
+ in both HTML4 and XHTML1 format.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ (Test):
+ (Chapter.prototype.description):
+ (Chapter.prototype.untestedCount):
+ (TestSuite.prototype.fillChapterPopup):
+ (TestSuite.prototype.updateChapterPopup):
+ (TestSuite.prototype.fillTestList):
+ (TestSuite.prototype.updateTestList):
+ (TestSuite.prototype.goToNextIncompleteTest):
+ (TestSuite.prototype.firstIncompleteTestIndex):
+ (TestSuite.prototype.recordResult):
+ (TestSuite.prototype.formatChanged):
+ (TestSuite.prototype.markTestCompleted):
+ (TestSuite.prototype.resetTestStatus):
+
+2010-10-01 Simon Fraser <simon.fraser@apple.com>
+
+ Add the ability to remove results for re-testing, and
+ to import results.
+
+ * CSSTestSuiteHarness/harness/harness.css:
+ (.custom button):
+ (#overlay):
+ (#overlay.visible):
+ (.overlay-contents):
+ (.overlay-contents textarea):
+ (.overlay-contents .buttons):
+ (.overlay-contents .note):
+ (.overlay-contents .buttons button):
+ * CSSTestSuiteHarness/harness/harness.html:
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.importResults):
+ (TestSuite.prototype.clearResults):
+ (TestSuite.prototype.markTestCompleted):
+ (TestSuite.prototype.resetTestStatus):
+ (TestSuite.prototype.storeTestResult):
+ (TestSuite.prototype.importTestResults):
+ (TestSuite.prototype.clearTestResults):
+
+2010-10-01 Sam Weinig <sam@webkit.org>
- * Scripts/bugzilla-tool:
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/download_unittest.py:
- * Scripts/modules/mock_bugzillatool.py:
+ Reviewed by Jon Honeycutt.
-2009-12-14 Adam Barth <abarth@webkit.org>
+ Deploy the new WKString functions to remove most uses of CF from
+ the WebKitTestRunner.
- Reviewed by Eric Seidel.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::didReceiveMessage):
+ (WTR::InjectedBundle::done):
+ * WebKitTestRunner/StringFunctions.h:
+ (WTR::toWK):
+ (WTR::toJS):
+ (WTR::toSTD):
+ (WTR::operator<<):
+ (WTR::copyURLString):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::resetStateToConsistentValues):
+ (WTR::TestController::didFinishLoadForFrame):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::invoke):
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
- [bzt] Convert rollout to StepSequence
- https://bugs.webkit.org/show_bug.cgi?id=32406
+2010-10-01 Mihai Parparita <mihaip@chromium.org>
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/download_unittest.py:
- * Scripts/modules/mock_bugzillatool.py:
+ Unreviewed TestResultsServer change.
-2009-12-14 Adam Barth <abarth@webkit.org>
+ Add files introduced by http://crrev.com/61273 to the list of dashboard
+ files to update.
- Reviewed by Eric Seidel.
+ * TestResultServer/handlers/dashboardhandler.py:
- [bzt] Kill LandingSequence
- https://bugs.webkit.org/show_bug.cgi?id=32464
+2010-10-01 Brian Weinstein <bweinstein@apple.com>
- Removes LandingSequence in favor of StepSequence. This required
- changing the Step API slightly to carry a general notion of state
- instead of carrying patches specifically.
+ Build Fix for Windows.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/landingsequence.py: Removed.
- * Scripts/modules/stepsequence.py:
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj: Don't copy ForwardingHeaders from
+ WebKitTestRunner/ForwardingHeaders, instead, add $(WebKitOutputDir)/include/WebCore/
+ ForwardingHeaders to the include path.
-2009-12-14 Robert Hogan <robert@roberthogan.net>
+2010-10-01 Sam Weinig <sam@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Anders Carlsson.
- [Qt] Fix https://bugs.webkit.org/show_bug.cgi?id=32437
-
- Amend the behaviour of DRT::notifyDone to dump only when
- the page has finished loading.
-
- This fix permits removal of the following tests from the Qt skipped list:
- fast/forms/textarea-linewrap-dynamic.html
- fast/forms/textarea-setvalue-submit.html
- fast/forms/textarea-hard-linewrap-empty.html
- fast/forms/submit-to-url-fragment.html
- http/tests/misc/percent-sign-in-form-field-name.html
- http/tests/security/escape-form-data-field-names.html
-
- However it also requires the following two to be added to the skipped list:
-
- http/tests/xmlhttprequest/access-control-basic-denied-preflight-cache.html
- svg/custom/use-instanceRoot-as-event-target.xhtml
-
- It appears the behaviour of notifyDone was masking problems with these two
- tests.
+ Add SPI to convert a WKStringRef to a JSStringRef and vice-versa.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::reset):
- (LayoutTestController::processWork):
- (LayoutTestController::maybeDump):
- (LayoutTestController::notifyDone):
- (LayoutTestController::provisionalLoad):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
- (LayoutTestController::resetLoadFinished):
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/WKString.cpp:
+ (TestWebKitAPI::TEST):
+ * TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp: Added.
+ (TestWebKitAPI::TEST):
-2009-12-14 Simon Hausmann <hausmann@webkit.org>
+2010-10-01 Sam Weinig <sam@webkit.org>
- Reviewed by Holger Freyther.
+ Reviewed by Kenneth Rohde Christiansen.
- [Qt] Add support for keyboard modifiers to Qt DRT's EventSender for touch events
+ Add additional WKString API
+ https://bugs.webkit.org/show_bug.cgi?id=46958
- https://bugs.webkit.org/show_bug.cgi?id=32482
+ Add basic WKStringRef tests.
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::setTouchModifier):
- (EventSender::clearTouchPoints):
- (EventSender::sendTouchEvent):
- * DumpRenderTree/qt/EventSenderQt.h:
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit2/WKString.cpp: Added.
-2009-12-13 Maciej Stachowiak <mjs@apple.com>
+2010-10-01 Sam Weinig <sam@webkit.org>
- Reviewed by Gavin Barraclaugh.
+ Reviewed by Dan Bernstein.
- Fix minor problem in sunspider-compare-results which left it broken.
+ Add makefile for TestWebKitAPI and call it from the base makefile.
- * Scripts/sunspider-compare-results: Declare $parseonly
+ * Makefile:
+ * TestWebKitAPI/Makefile: Added.
-2009-12-12 Maciej Stachowiak <mjs@apple.com>
+2010-10-01 Sam Weinig <sam@webkit.org>
- Reviewed by Oliver Hunt.
+ Reviewed by Adam Roben.
- Give command-line sunspider the ability to handle multiple suites and versions
- https://bugs.webkit.org/show_bug.cgi?id=32477
+ Remove unnecessary ForwardingHeaders from test runners.
+ https://bugs.webkit.org/show_bug.cgi?id=47010
- * Scripts/run-sunspider: Updated for changes to command-line parameters.
- * Scripts/sunspider-compare-results: ditto
+ * TestWebKitAPI/Configurations/Base.xcconfig:
+ * TestWebKitAPI/ForwardingHeaders: Removed.
+ * WebKitTestRunner/Configurations/Base.xcconfig:
+ * WebKitTestRunner/ForwardingHeaders: Removed.
-2009-12-12 Maciej Stachowiak <mjs@apple.com>
+2010-09-30 Adam Barth <abarth@webkit.org>
- Not reviewed, fixing previous comment.
+ Reviewed by Eric Seidel.
- Remove accidental change to sunspider-compare-results
+ WebSocket tests are flaky
+ https://bugs.webkit.org/show_bug.cgi?id=46956
- * Scripts/sunspider-compare-results:
+ Update these tools to understand how to run the WebSocket tests off the
+ Apache server.
-2009-12-11 Yael Aharon <yael.aharon@nokia.com>
+ * Scripts/old-run-webkit-tests:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- Unreviewed build fix for Qt versions < 4.6.
- Guard every slot individually with #ifdef.
+2010-10-01 Adam Roben <aroben@apple.com>
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::addTouchPoint):
- (EventSender::updateTouchPoint):
- (EventSender::touchStart):
- (EventSender::touchMove):
- (EventSender::touchEnd):
- (EventSender::clearTouchPoints):
- (EventSender::releaseTouchPoint):
- (EventSender::sendTouchEvent):
- * DumpRenderTree/qt/EventSenderQt.h:
+ Encode Executive command arguments using UTF-8 on Cygwin
-2009-12-11 Eric Seidel <eric@webkit.org>
+ Cygwin's Python's os.execv doesn't support unicode command arguments.
+ Cygwin's execv expects arguments to be encoded using the current code
+ page. But code pages are limited in what characters they can handle,
+ and our tests include characters that the English code page can't
+ handle. So for now we'll just encode everything in UTF-8 on Cygwin,
+ which can handle all characters but might confuse some commands, for
+ expediency's sake. I'm sure we'll run into cases where UTF-8 isn't
+ good enough, but we can deal with that when the problem arises.
Reviewed by Adam Barth.
- CommandsTest.assert_execute_outputs doesn't check stderr
- https://bugs.webkit.org/show_bug.cgi?id=32352
+ Fixes <http://webkit.org/b/46892> <rdar://problem/8496639>
+ webkitpy.common.system.executive_unittest.ExecutiveTest.test_run_command_with_unicode
+ fails on Windows
- Fix assert_execute_outputs to check stderr
- and then fix all the unit tests which needed to
- pass stderr output.
+ * Scripts/webkitpy/common/system/executive.py:
+ (Executive._run_command_with_teed_output):
+ (Executive.run_command):
+ On Cygwin, encode arguments using UTF-8.
- * Scripts/modules/commands/commandtest.py:
- * Scripts/modules/commands/download_unittest.py:
- * Scripts/modules/commands/upload_unittest.py:
+2010-10-01 Sam Weinig <sam@webkit.org>
-2009-12-11 Adam Barth <abarth@webkit.org>
+ Reviewed by Adam Roben.
- Reviewed by Eric Seidel.
+ Add simple API tester for WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=46953
+
+ This adds a very simple testing infrastructure for testing APIs exposed
+ through the WebKit project. It consists of two parts: 1) a project that
+ builds the all the tests 2) a script that searches the tests directory and
+ calls the tester once for each test.
+
+ This adds the infrastructure and two tests:
+ - Tests/WTF/Vector1.cpp - A proof of concept test of WTF data-structures.
+ - Tests/WebKit2/BasicTest1.cpp - A proof of concept test of WebKit2 API.
+
+ This currently only works on the mac, but is designed to be easily ported
+ to any platform.
+
+ * Scripts/run-api-tests: Added.
+ * Scripts/build-api-tests: Added.
+ Scripts to build/run the tests.
+
+ * TestWebKitAPI: Added.
+ * TestWebKitAPI/Configurations: Added.
+ * TestWebKitAPI/Configurations/Base.xcconfig: Added.
+ * TestWebKitAPI/Configurations/DebugRelease.xcconfig: Added.
+ * TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig: Added.
+ * TestWebKitAPI/ForwardingHeaders: Added.
+ * TestWebKitAPI/ForwardingHeaders/wtf: Added.
+ * TestWebKitAPI/PlatformUtilities.h: Added.
+ * TestWebKitAPI/PlatformWebView.h: Added.
+ (TestWebKitAPI::PlatformWebView::platformView):
+ * TestWebKitAPI/StringFunctions.h: Added.
+ * TestWebKitAPI/Test.h: Added.
+ (TestWebKitAPI::Test::~Test):
+ (TestWebKitAPI::Test::name):
+ (TestWebKitAPI::Test::Register::Register):
+ (TestWebKitAPI::Test::Register::create):
+ (TestWebKitAPI::Test::Test):
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj: Added.
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added.
+ * TestWebKitAPI/TestWebKitAPIPrefix.h: Added.
+ * TestWebKitAPI/TestsController.cpp: Added.
+ (TestWebKitAPI::TestsController::shared):
+ (TestWebKitAPI::TestsController::TestsController):
+ (TestWebKitAPI::TestsController::runTestNamed):
+ (TestWebKitAPI::TestsController::testFailed):
+ (TestWebKitAPI::TestsController::registerCreateTestFunction):
+ * TestWebKitAPI/TestsController.h: Added.
+ * TestWebKitAPI/mac: Added.
+ * TestWebKitAPI/mac/PlatformUtilitiesMac.mm: Added.
+ (TestWebKitAPI::Util::run):
+ (TestWebKitAPI::Util::createURLForResource):
+ * TestWebKitAPI/mac/PlatformWebViewMac.mm: Added.
+ (TestWebKitAPI::PlatformWebView::PlatformWebView):
+ (TestWebKitAPI::PlatformWebView::resizeTo):
+ (TestWebKitAPI::PlatformWebView::~PlatformWebView):
+ (TestWebKitAPI::PlatformWebView::page):
+ (TestWebKitAPI::PlatformWebView::focus):
+ * TestWebKitAPI/mac/main.mm: Added.
+ Infrastructure.
+
+ * TestWebKitAPI/Tests: Added.
+ * TestWebKitAPI/Tests/WTF: Added.
+ * TestWebKitAPI/Tests/WTF/Vector1.cpp: Added.
+ * TestWebKitAPI/Tests/WebKit2: Added.
+ * TestWebKitAPI/Tests/WebKit2/BasicTest1.cpp: Added.
+ (TestWebKitAPI::State::State):
+ * TestWebKitAPI/Tests/WebKit2/basic-1.html: Added.
+ Proof of concept tests.
+
+2010-10-01 Adam Roben <aroben@apple.com>
+
+ Don't assume AccessibleObjectFromEvent succeeds
+
+ Fixes <http://webkit.org/b/44136> <rdar://problem/8321684> Crash in
+ DumpRenderTree!notificationListenerProc when running
+ plugins/access-after-page-destroyed.html
- [check-webkit-style] False positive for tst_QWebFrame
- https://bugs.webkit.org/show_bug.cgi?id=32436
+ Reviewed by Sam Weinig.
- Add an exception for function names that start with "tst_". These are
- used by the Qt unit testing framework.
+ * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+ (notificationListenerProc): Check both the return value of
+ AccessibleObjectFromEvent and the object it returns, as MSDN
+ recommends.
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+2010-10-01 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
-2009-12-11 Simon Hausmann <hausmann@webkit.org>, Kim Grönholm <kim.gronholm@nomovok.com>
+ Reviewed by Tony Chang.
- Reviewed by Antti Koivisto.
+ [NRWT] Put the http and websocket tests first in the test list.
+ https://bugs.webkit.org/show_bug.cgi?id=46453
- Added support for creating synthetic touch events with EventSender
- in Qt's DumpRenderTree.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- https://bugs.webkit.org/show_bug.cgi?id=32114
+2010-10-01 Fady Samuel <fsamuel@chromium.org>
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::addTouchPoint):
- (EventSender::updateTouchPoint):
- (EventSender::touchStart):
- (EventSender::touchMove):
- (EventSender::touchEnd):
- (EventSender::clearTouchPoints):
- (EventSender::releaseTouchPoint):
- (EventSender::sendTouchEvent):
- * DumpRenderTree/qt/EventSenderQt.h:
+ Unreviewed, adding myself to the committer list.
-2009-12-11 Benjamin Poulain <benjamin.poulain@nokia.com>
+ * Scripts/webkitpy/common/config/committers.py:
- Reviewed by Darin Adler.
+2010-10-01 Adam Roben <aroben@apple.com>
- The values of RuntimeArray are not enumerable
- https://bugs.webkit.org/show_bug.cgi?id=29005
+ Test NPN_GetValue(NPNVnetscapeWindow)
- * DumpRenderTree/mac/ObjCController.m:
- (+[ObjCController isSelectorExcludedFromWebScript:]):
- (+[ObjCController webScriptNameForSelector:]):
- (-[ObjCController arrayOfString]):
+ Test for <http://webkit.org/b/46726> <rdar://problem/8486319>
+ Right-clicking on windowless Flash plugin in WebKit2 makes a context
+ menu appear in the bottom-right corner of the screen
-2009-12-10 Eric Seidel <eric@webkit.org>
+ Reviewed by Anders Carlsson.
- No review, just updating unit tests to match recent checkins.
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::NPN_GetValue): Added. Calls through to the browser.
- * Scripts/modules/mock_bugzillatool.py:
- - Add missing red_core_builders_names method causing exception.
- * Scripts/modules/workqueue_unittest.py:
- - processutils is dead, use executive.py instead.
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added NPN_GetValue.
-2009-12-10 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp: Added.
+ (GetValueNetscapeWindow::GetValueNetscapeWindow): Initialize members.
+ (GetValueNetscapeWindow::NPP_SetWindow): Test that
+ NPN_GetValue(NPNVnetscapeWindow) returns a valid HWND and that it
+ isn't our HWND.
- Reviewed by Adam Barth.
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ Added GetValueNetscapeWindow.
- Move run_command onto Executive to make code which uses run_command testable
- https://bugs.webkit.org/show_bug.cgi?id=32396
+2010-10-01 Andreas Kling <andreas.kling@nokia.com>
- * Scripts/modules/executive.py:
- - Move run_command and error handlers onto Executive.
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py:
+ Unreviewed, adding my webkit.org identity to reviewer list.
-2009-12-09 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/common/config/committers.py:
- Reviewed by Adam Barth.
+2010-09-30 Adam Barth <abarth@webkit.org>
- bugzilla-tool needs a command to list patches needing cq+
- https://bugs.webkit.org/show_bug.cgi?id=32351
+ Reviewed by Eric Seidel.
- * Scripts/modules/bugzilla.py:
- - Parse attacher_email from attachment xml.
- * Scripts/modules/bugzilla_unittest.py:
- - Test new attacher_email parsing.
- * Scripts/modules/commands/queries.py:
- - Add PatchesToCommitQueue
- * Scripts/modules/commands/queries_unittest.py:
- - Tests for PatchesToCommitQueue
- * Scripts/modules/mock_bugzillatool.py:
- - Add necessary mock methods for running PatchesToCommitQueue
+ The WebSocket server should flush its logs
+ https://bugs.webkit.org/show_bug.cgi?id=46946
-2009-12-10 Adam Barth <abarth@webkit.org>
+ The WebSocket server logs are truncated because the driver just
+ terminates the child. It should run Python without buffering so we can
+ see the end of the log.
- Unreviewed. Turns out every StepSequence command needs a --quiet
- option.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
- * Scripts/modules/stepsequence.py:
+2010-09-30 Simon Fraser <simon.fraser@apple.com>
-2009-12-10 Eric Z. Ayers <zundel@google.com>
+ Add a button to jump to the next untested test.
+
+ * CSSTestSuiteHarness/harness/harness.css:
+ (.test-type):
+ (.name > button):
+ * CSSTestSuiteHarness/harness/harness.html:
+ * CSSTestSuiteHarness/harness/harness.js:
+ (Chapter.prototype.description):
+ (Chapter.prototype.untestedCount):
+ (TestSuite.prototype.testInfoDataLoaded):
+ (TestSuite.prototype.fillChapterPopup):
+ (TestSuite.prototype.updateChapterPopup):
+ (TestSuite.prototype.buildTestListForChapter):
+ (TestSuite.prototype.goToNextIncompleteTest):
+ (TestSuite.prototype.firstIncompleteTestIndex):
+ (TestSuite.prototype.testCompletionStateChanged):
+
+2010-09-29 Jon Honeycutt <jhoneycutt@apple.com>
+
+ WebKit2 on Windows should use Windows fonts for the various standard
+ font families
+ https://bugs.webkit.org/show_bug.cgi?id=43499
+ <rdar://problem/8272758>
- Reviewed by Pavel Feldman.
+ Reviewed by Adam Roben.
- Implements displayWebView() to force an invalidation and repaint.
- This fixes a problem running the timeline-paint.html unit test.
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::resetStateToConsistentValues):
+ Use the Mac fonts for running tests. This matches DRT behavior.
- https://bugs.webkit.org/show_bug.cgi?id=31729
+2010-09-30 Adam Barth <abarth@webkit.org>
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (displayWebView):
+ Third attempt. We need a better integration test environment.
-2009-12-10 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/common/net/failuremap.py:
+ * Scripts/webkitpy/common/net/failuremap_unittest.py:
- Reviewed by Eric Seidel.
+2010-09-30 Robert Hogan <robert@webkit.org>
- [bzt] Convert more commands to StepSequences
- https://bugs.webkit.org/show_bug.cgi?id=32362
+ Reviewed by Andreas Kling.
- We should eventually convert all the commands, but I'm starting with
- the easy ones.
+ [Qt] Support for PlainTextController
- * Scripts/modules/commands/download.py:
+ Unskip editing/text-iterator/basic-iteration.html
-2009-12-10 Xan Lopez <xlopez@igalia.com>
+ https://bugs.webkit.org/show_bug.cgi?id=38805
- Reviewed by Jan Alonzo.
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::initJSObjects):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/PlainTextControllerQt.cpp: Added.
+ (PlainTextController::PlainTextController):
+ (PlainTextController::plainText):
+ * DumpRenderTree/qt/PlainTextControllerQt.h: Added.
- [GTK] editing/selection/shrink-selection-after-shift-pagedown.html failing
- https://bugs.webkit.org/show_bug.cgi?id=31103
+2010-09-30 Adam Barth <abarth@webkit.org>
- Give focus to the webviews when we create them, since some tests expect this.
+ Unreviewed. Second attempt to fix sheriffbot.
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (main):
+ * Scripts/webkitpy/common/net/buildbot.py:
-2009-12-10 Eric Seidel <eric@webkit.org>
+2010-09-30 Adam Barth <abarth@webkit.org>
- Reviewed by Adam Barth.
+ Unreviewed.
- bugzilla-tool "builders are red" error should tell you which builders
- https://bugs.webkit.org/show_bug.cgi?id=32211
+ This patch should stop the sheriffbot from throwing an exception.
- * Scripts/modules/buildsteps.py:
+ * Scripts/webkitpy/common/net/buildbot.py:
-2009-12-09 Marwan Al Jubeh <marwan.aljubeh@gmail.com>
+2010-09-30 Brian Weinstein <bweinstein@apple.com>
Reviewed by Adam Roben.
- Fixes: https://bugs.webkit.org/show_bug.cgi?id=31228
- Set the WebKitOutputDir, WebKitLibrariesDir and Cygwin environment variables automatically
- in Windows as part of running update_webkit.
+ The same bots shouldn't run both Windows Debug Tests and Windows Release Tests.
+ https://bugs.webkit.org/show_bug.cgi?id=46926
- * Scripts/update-webkit:
- - Run setupAppleWinEnv() on Apple's Windows port.
- * Scripts/webkitdirs.pm:
- - Added functions that return the source directory, libraries directory and default build directory on Windows.
- - Added isWindowsNT() which tests if the current Windows version is from the Windows NT family.
- - Implemented setupAppleWinEnv() which sets the environment variables WebKitOutputDir, WebKitLibrariesDir
- and Cygwin to their desired values.
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Have two bots running Windows
+ Release Tests, and two bots running Windows Debug Tests, instead of four running both.
-2009-12-09 Adam Barth <abarth@webkit.org>
+2010-09-30 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- exception thrown when running apply-patches
- https://bugs.webkit.org/show_bug.cgi?id=32344
-
- The update step now takes a port option. Once we finish the Steps
- refactoring, we won't have to worry about this kind of bug again.
+ webkit-patch find-flaky-tests should print results URLs
+ https://bugs.webkit.org/show_bug.cgi?id=46917
- * Scripts/modules/commands/download.py:
+ Printing out the results URL makes find-flaky-tests more actionable
+ because you can see what happens when a test fails. The output from
+ the script is still pretty noisy, but it seems useful.
-2009-12-09 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/tool/commands/queries.py:
- Unreviewed. Fix ScriptError includes. I don't understand why these
- didn't throw during unit testing...
+2010-09-30 Chris Marrin <cmarrin@apple.com>
- * Scripts/modules/commands/download.py:
- * Scripts/modules/logging_unittest.py:
- * Scripts/modules/workqueue.py:
+ Reviewed by Simon Fraser.
-2009-12-09 Adam Barth <abarth@webkit.org>
+ Make 2D accelerated canvas rendering build on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=46007
+
+ Added ACCELERATED_2D_CANVAS to build-webkit
- Reviewed by Eric Seidel.
+ * Scripts/build-webkit:
- [bzt] Remove unused PatchCollection class
- https://bugs.webkit.org/show_bug.cgi?id=32312
+2010-09-29 Kenneth Russell <kbr@google.com>
- It's dead code.
+ Reviewed by Dimitri Glazkov.
- * Scripts/modules/patchcollection.py:
- * Scripts/modules/patchcollection_unittest.py: Removed.
+ [chromium] Add accelerated compositing support to DumpRenderTree and test_shell
+ https://bugs.webkit.org/show_bug.cgi?id=46849
-2009-12-09 Adam Barth <abarth@webkit.org>
+ Added offscreen code path for WebGraphicsContext3DDefaultImpl which
+ works with the compositor integration in both DumpRenderTree and
+ test_shell, since both pass a non-null WebCanvas* to WebViewImpl::paint
+ and thereby trigger the compositor's readback code path. Added support
+ for --enable-accelerated-compositing to DumpRenderTree.
- Unreviewed "build" fix. CheckStyle needs a --no-upate option.
+ Tested in both test_shell and DumpRenderTree on Linux, the latter by
+ modifying a compositing layout test, dumping the pixels and verifying
+ that they matched the output when the compositor was active.
- * Scripts/modules/commands/download.py:
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ (TestShell::resetWebSettings):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::setAcceleratedCompositingEnabled):
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ (WebPreferences::applyTo):
+ * DumpRenderTree/chromium/WebPreferences.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::scheduleComposite):
+ * DumpRenderTree/chromium/WebViewHost.h:
+
+2010-09-30 Adam Roben <aroben@apple.com>
+
+ Ensure that QueueEngine cleans up its log files when its delegate
+ tells it to stop processing work
-2009-12-09 Adam Barth <abarth@webkit.org>
+ Reviewed by Adam Barth.
- Reviewed by Eric Seidel.
+ Fixes <http://webkit.org/b/46891> <rdar://problem/8496638> Many tests
+ in webkitpy.tool.bot.queueengine_unittest.QueueEngineTest crash on
+ Windows
+
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ (QueueEngine.run): Stop ourselves normally (including cleaning up log
+ files) when the delegate tells us to stop processing work.
+
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ (LoggingDelegate.__init__): Moved code here from
+ RaisingDelegate.__init__.
+ (LoggingDelegate.expeced_callbacks): Added the stop_work_queue
+ callback.
+ (LoggingDelegate.stop_work_queue): Moved here from RaisingDelegate.
+ (RaisingDelegate.__init__): Removed code that LoggingDelegate takes
+ care of for us now.
+ (QueueEngineTest.test_trivial): Make sure we got the expected stop
+ message.
+ (QueueEngineTest.test_not_safe_to_proceed): Changed to explicitly
+ remove the callbacks that are related to processing a single work
+ item, rather than removing all callbacks after a certain point, as
+ there are now more callbacks we expect to receive at the end.
- [bzt] Convert Build to use Sequence
- https://bugs.webkit.org/show_bug.cgi?id=32310
+2010-09-30 Adam Roben <aroben@apple.com>
- So much prettier.
+ Fix path -> URL conversion on Cygwin
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/stepsequence.py: Added.
+ Reviewed by Adam Barth.
-2009-12-09 Adam Barth <abarth@webkit.org>
+ Fixes <http://webkit.org/b/46890> <rdar://problem/8496637> Many tests
+ in webkitpy.layout_tests.run_webkit_tests_unittest assert on Windows
- Add missing file.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ (Port.filename_to_uri): Treat Cygwin like other UNIX-y platforms by
+ assuming paths already have a leading slash.
- * Scripts/modules/executive.py: Added.
+2010-09-30 Adam Roben <aroben@apple.com>
-2009-12-09 Adam Barth <abarth@webkit.org>
+ Teach WindowGeometryInitializedBeforeSetWindow that NPP_SetWindow can
+ be called more than once
- Unreviewed "build" fix.
+ The NPP_SetWindow call made when the plugin is torn down was confusing
+ us, and was causing us to spew an error into the next test.
- * Scripts/modules/landingsequence.py:
+ Fixes <http://webkit.org/b/46900> <rdar://problem/8496888> REGRESSION
+ (r68520): plugins/access-after-page-destroyed.html failing on Windows
-2009-12-09 Adam Barth <abarth@webkit.org>
+ Reviewed by Anders Carlsson.
- Reviewed by Eric Seidel.
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp:
+ (WindowGeometryInitializedBeforeSetWindow::WindowGeometryInitializedBeforeSetWindow):
+ Initialize member.
+ (WindowGeometryInitializedBeforeSetWindow::NPP_SetWindow): Bail if
+ this isn't the first time this is called.
- [bzt] Implement abstract Steps
- https://bugs.webkit.org/show_bug.cgi?id=32212
-
- This is a fairly disruptive change that refactors how we build
- commands. Instead of using a landing sequence, we can now assemble a
- sequence of steps directly. We still use the landing sequence in the
- interim, but this will be removed soon.
-
- * Scripts/bugzilla-tool:
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/early_warning_system.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/commands/queues_unittest.py:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/mock_bugzillatool.py:
- * Scripts/modules/processutils.py: Removed.
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py:
- * Scripts/modules/webkitport.py:
-
-2009-12-08 Eric Seidel <eric@webkit.org>
+2010-09-30 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- run_command and ScriptError should move into processutils.py
- https://bugs.webkit.org/show_bug.cgi?id=32305
+ webkit-patch upload warns that I'm using Xcode when I'm not
+ https://bugs.webkit.org/show_bug.cgi?id=46869
- Turns out there are a zillion callers to run_command.
+ String.find returns -1 when not found, so switched to "in".
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/early_warning_system.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/logging_unittest.py:
- * Scripts/modules/processutils.py:
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py:
- * Scripts/modules/workqueue.py:
- * Scripts/modules/workqueue_unittest.py:
+ * Scripts/webkitpy/common/system/user.py:
+ * Scripts/webkitpy/common/system/user_unittest.py:
-2009-12-08 Kevin Watters <kevinwatters@gmail.com>
+2010-09-30 Eric Seidel <eric@webkit.org>
- Reviewed by Kevin Ollivier.
+ Reviewed by Adam Barth.
- [wx] Mac plugins support.
-
- https://bugs.webkit.org/show_bug.cgi?id=32236
+ webkit-patch failure-reason dies if non-trunk commits are in the blame range
+ https://bugs.webkit.org/show_bug.cgi?id=46866
- * wx/browser/wscript:
+ I also made failure-reason use RegressionWindow in a cleaner way.
-2009-12-08 David Levin <levin@chromium.org>
+ * Scripts/webkitpy/tool/commands/queries.py:
- Reviewed by Adam Barth.
+2010-09-29 Adam Barth <abarth@webkit.org>
- [check-webkit-style] False positive for DEFINE_OPCODE(op_jtrue) {
- https://bugs.webkit.org/show_bug.cgi?id=32193
+ Reviewed by Eric Seidel.
- * Scripts/modules/cpp_style.py: For the function { rule, if there is space
- at the beginning of line, ignore lines which then have a macro.
- * Scripts/modules/cpp_style_unittest.py: Add tests to verify the
- new behavior.
+ webkit-patch find-flaky-tests
+ https://bugs.webkit.org/show_bug.cgi?id=46876
-2009-12-08 Dmitry Titov <dimich@chromium.org>
+ This command helps us find flaky tests so we can squash them.
- Rubber-stamped by David Levin.
+ * Scripts/webkitpy/tool/commands/queries.py:
- Revert and reopen "Add asserts to RefCounted to make sure ref/deref happens on the right thread."
- It may have caused massive increase of reported leaks on the bots.
- https://bugs.webkit.org/show_bug.cgi?id=31639
+2010-09-29 Simon Fraser <simon.fraser@apple.com>
- * DumpRenderTree/ForwardingHeaders/wtf/ThreadVerifier.h: Removed.
+ Fix export to use '?' instead of 'null' for
+ tests with no results.
+
+ * CSSTestSuiteHarness/harness/harness.js:
-2009-12-08 Dmitry Titov <dimich@chromium.org>
+2010-09-29 Simon Fraser <simon.fraser@apple.com>
- Reviewed by Darin Adler.
+ Add a warning when a test requires special steps.
+ Add a Print Preview button for 'paged' tests that
+ brings up the print dialog, allowing the user to
+ judge paged media tests.
- Add asserts to RefCounted to make sure ref/deref happens on the right thread.
- https://bugs.webkit.org/show_bug.cgi?id=31639
+ * CSSTestSuiteHarness/harness/harness.css:
+ * CSSTestSuiteHarness/harness/harness.html:
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.loadTest):
+ (TestSuite.prototype.processFlags):
- * DumpRenderTree/ForwardingHeaders/wtf/ThreadVerifier.h: Added.
+2010-09-29 Adam Barth <abarth@webkit.org>
-2009-12-08 David Levin <levin@chromium.org>
+ Reviewed by Eric Seidel.
- Reviewed by Adam Barth.
+ Remove revisions_casuing_failures
+ https://bugs.webkit.org/show_bug.cgi?id=46872
- [check-webkit-style] False positive for camel case of JSC op codes
- https://bugs.webkit.org/show_bug.cgi?id=32192
+ This function exists only to be unit tested.
- * Scripts/modules/cpp_style.py: Added an exception for the JSC op
- code functions and const_iterator as well since I noticed a false
- positive there when testing the fix.
- * Scripts/modules/cpp_style_unittest.py: Added tests for these
- changes.
+ * Scripts/webkitpy/common/net/failuremap.py:
+ * Scripts/webkitpy/common/net/failuremap_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
-2009-12-08 Nikolas Zimmermann <nzimmermann@rim.com>
+2010-09-29 Adam Barth <abarth@webkit.org>
- Rubber-stamped by Maciej Stachowiak.
+ Reviewed by Eric Seidel.
- Turn on (SVG) Filters for Win.
- https://bugs.webkit.org/show_bug.cgi?id=32224
+ SheriffBot should post the list of failing tests to bugs
+ https://bugs.webkit.org/show_bug.cgi?id=46871
- * Scripts/webkitdirs.pm:
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/failuremap.py:
+ * Scripts/webkitpy/common/net/regressionwindow.py:
+ * Scripts/webkitpy/tool/bot/sheriff.py:
+ * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
-2009-12-08 Nikolas Zimmermann <nzimmermann@rim.com>
+2010-09-29 Brent Fulgham <bfulgham@webkit.org>
- Rubber-stamped by Maciej Stachowiak.
+ Reviewed by Martin Robinson, Eric Seidel, and Mark Rowe.
- Turn on (SVG) Filters for Gtk.
- https://bugs.webkit.org/show_bug.cgi?id=32224
+ [WinCairo] Adds a build slave.
+ https://bugs.webkit.org/show_bug.cgi?id=46360
- * Scripts/build-webkit:
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Add
+ entries for a debug build of the WinCairo port.
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Add
+ platform flag to configuration for wincairo (like gtk, chromium, etc.)
+ * Scripts/build-webkit: Change 'cairo-win32' labeling to 'wincairo'
+ * Scripts/webkitdirs.pm: Change 'cairo-win32' labeling to 'wincairo'
-2009-12-07 Shinichiro Hamaji <hamaji@chromium.org>
+2010-09-29 Adam Barth <abarth@webkit.org>
- Reviewed by David Levin.
+ Reviewed by Eric Seidel.
- [check-webkit-style] S_OK is a fine identifier
- https://bugs.webkit.org/show_bug.cgi?id=32225
+ Move more SheriffBot smarts into FailureMap
+ https://bugs.webkit.org/show_bug.cgi?id=46703
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+ This patch pushes the FailureMap model object further into the
+ SheriffBot machine. In addition, it moves a couple operations on this
+ object from SheriffBot itself to the model.
-2009-12-07 Nikolas Zimmermann <nzimmermann@rim.com>
+ Eventually, FailureMap will be the canonical context object for
+ SheriffBot operations. FailureMap represents a map of the current
+ failures on the bots that might require remediation.
- Rubber-stamped by Maciej Stachowiak.
+ * Scripts/webkitpy/common/net/failuremap.py:
+ * Scripts/webkitpy/common/net/regressionwindow.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- Turn on (SVG) Filters for Qt.
- https://bugs.webkit.org/show_bug.cgi?id=32224
+2010-09-29 Tony Chang <tony@chromium.org>
- * Scripts/build-webkit:
+ Reviewed by James Robinson.
-2009-12-07 Yuzo Fujishima <yuzo@google.com>
+ [chromium] enable -Werror for DRT and webkit_unit_tests on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=46829
- Reviewed by Alexey Proskuryakov.
+ * DumpRenderTree/chromium/DRTDevToolsClient.cpp:
+ (DRTDevToolsClient::DRTDevToolsClient):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::postAccessibilityNotification):
+ (WebViewHost::WebViewHost):
- Make run-webkit-websocketserver log to stderr rather than to a file.
- https://bugs.webkit.org/show_bug.cgi?id=32234
+2010-09-29 Chris Fleizach <cfleizach@apple.com>
- * Scripts/run-webkit-websocketserver:
-
-2009-12-07 Dmitry Titov <dimich@chromium.org>
+ Reviewed by Darin Adler.
- Rubber-stamped by Darin Adler.
+ AX: implement CSS3 Speech "speak"
+ https://bugs.webkit.org/show_bug.cgi?id=46827
- Remove ENABLE_SHARED_SCRIPT flags
- https://bugs.webkit.org/show_bug.cgi?id=32245
- This patch was obtained by "git revert" command and then un-reverting of ChangeLog files.
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (speakCallback):
+ (AccessibilityUIElement::speak):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::speak):
- * Scripts/build-webkit:
+2010-09-29 Mihai Parparita <mihaip@chromium.org>
-2009-12-07 Simon Fraser <simon.fraser@apple.com>
+ Reviewed by Adam Barth.
- Reviewed by Darin Adler.
+ Record bot ID when updating queue status
+ https://bugs.webkit.org/show_bug.cgi?id=46764
+
+ Since we now have multiple bots handling patches from the commit queue,
+ we need to differentiate status updates from them, so that we can group
+ the queue status page in a less confusing way.
+
+ * QueueStatusServer/handlers/updatestatus.py: Accept bot_id as input
+ * QueueStatusServer/model/queuestatus.py: Add bot_id property
+ * QueueStatusServer/templates/updatestatus.html: Add bot_id input
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py: Extract MockBrowser
+ * Scripts/webkitpy/common/net/statusserver.py: Add bot_id
+ * Scripts/webkitpy/common/net/statusserver_unittest.py: Added.
+ * Scripts/webkitpy/tool/main.py: Add --bot-id
+ * Scripts/webkitpy/tool/mocktool.py: Add MockBrowser
+
+2010-09-29 Simon Fraser <simon.fraser@apple.com>
+
+ No review.
+
+ References always refert to a file in .xht format, even
+ for HTML tests, so fix their loading.
- <rdar://problem/7450481> One compositing test keeps DRT in "compositing mode", breaks repaint tests
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.loadRef):
- The counter that WebView used to keep track of the number of enclosed WebHTMLViews using
- accelerated compositing was hard to manage, and maintained incorrectly in a number of cases.
- This caused one compositing test make DumpRenderTree think that all subsequent tests
- were compositing too.
+2010-09-28 Johnny Ding <jnd@chromium.org>
- Replace this counter with notifications, which are only fired if a client (DRT) requests them. The
- notification informs the client that a WebHTMLView entered compositing mode (or an already-
- compositing WebHTML was added); it does not say when a view becomes uncomposited, or all
- compositing subviews were removed, since this is tricky to get right.
-
- DumpRenderTreeWindow listens for this notification, and uses it to turn on window
- autodisplay, which is necessary to kick-start Core Animation rendering and animations.
- We ensure that window autodisplay is turned off before every test.
+ Reviewed by Adam Barth.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (createWebViewAndOffscreenWindow):
- (resetWebViewToConsistentStateBeforeTesting):
- * DumpRenderTree/mac/DumpRenderTreeWindow.h:
- * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
- (-[DumpRenderTreeWindow close]):
- (-[DumpRenderTreeWindow startListeningForAcceleratedCompositingChanges]):
- (-[DumpRenderTreeWindow webViewStartedAcceleratedCompositing:]):
+ https://bugs.webkit.org/show_bug.cgi?id=41292
+ Add a new parameter to the test plugin to allow specifying a script
+ and a mouse/keyboard event. The specified script will be evaluated
+ in the browser when the specified event is received by the plugin.
-2009-12-07 Nikolas Zimmermann <nzimmermann@rim.com>
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (pluginAllocate):
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
+ (handleEventCarbon):
+ (handleEventCocoa):
- Reviewed by Holger Hans Peter Freyther.
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
- Turn on (SVG) Filters support, by default.
- https://bugs.webkit.org/show_bug.cgi?id=32224
+ Fix export by adding missing argument.
- For now only enable FILTERS build flag on WebKit/mac. Other platforms will follow soon.
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite.prototype.showResultsForAllTests):
- * Scripts/build-webkit:
+2010-09-28 Kevin Ollivier <kevino@theolliviers.com>
-2009-12-07 Yaar Schnitman <yaar@chromium.org>
+ [wx] Build fix, add missing import.
- Reviewed by Darin Fisher.
+ * wx/packaging/build-win-installer.py:
- Chromium buildbots are not red when they fail
- https://bugs.webkit.org/show_bug.cgi?id=32235
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
- * Scripts/build-webkit:
+ No review
+
+ Show which tests have been run by dimming them out in the test list.
+
+ Adjust some element sizes.
+
+ * CSSTestSuiteHarness/harness/harness.css:
+ (#test-list > option.untested):
+ (#test-list > option.completed):
+ (#output):
+ (.output-options):
+ * CSSTestSuiteHarness/harness/harness.js:
+ (Test):
+ (TestSuite.prototype.fillTestList):
+ (TestSuite.prototype.updateTestList):
+ (TestSuite.prototype.setSelectedChapter):
+ (TestSuite.prototype.recordResult):
+ (TestSuite.prototype.markTestCompleted):
+ (TestSuite.prototype.testCompletionStateChanged):
+ (TestSuite.prototype.loadTestStatus):
+
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
+
+ No review.
+
+ Implement export of various queries on the test database, sharing
+ code with that which displays results inline.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ ():
+ (TestSuite.prototype.exportResultsCompletion.var):
+ (TestSuite.prototype.exportResultsCompletion):
+ (TestSuite.prototype.showResultsForCompletedTests):
+ (TestSuite.prototype.exportResultsForCompletedTests):
+ (TestSuite.prototype.showResultsForAllTests):
+ (TestSuite.prototype.exportResultsForAllTests):
+ (TestSuite.prototype.exportResultsForTestsNotRun):
+ (TestSuite.prototype.exportResultsForTestsWithStatus):
+ (TestSuite.prototype.exportResultsForTestsWithMismatchedResults):
+
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
+
+ No review.
+
+ Work around uncertainty about the order of database
+ transactions when creating the database, so that we don't
+ try to query the table before it has been created.
+
+ * CSSTestSuiteHarness/harness/harness.js:
+ (TestSuite):
+ (TestSuite.prototype.databaseCreated):
+ (TestSuite.prototype.storeTestResult):
+ (TestSuite.prototype.populateDatabaseFromTestInfoData):
+ (TestSuite.prototype.queryDatabaseForTestsWithStatus):
+ (TestSuite.prototype.queryDatabaseForTestsWithMixedStatus):
+ (TestSuite.prototype.queryDatabaseForCompletedTests):
+ (TestSuite.prototype.queryDatabaseForTestsNotRun):
+
+2010-09-28 Tony Chang <tony@chromium.org>
-2009-12-07 Yaar Schnitman <yaar@chromium.org>
+ Reviewed by Eric Seidel.
- Reviewed by Darin Fisher.
+ add python keyring support to webkit-patch
+ https://bugs.webkit.org/show_bug.cgi?id=41269
- Typo in chromium linux builder
- https://bugs.webkit.org/show_bug.cgi?id=32238
+ * Scripts/webkitpy/common/net/credentials.py: Add the ability to read passwords using
+ the python keyring module
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
+ * Scripts/webkitpy/common/system/user.py: Allow confirm() to default to no and add testing params.
+ * Scripts/webkitpy/common/system/user_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- * Scripts/webkitdirs.pm:
+2010-09-28 Martin Robinson <mrobinson@igalia.com>
-2009-12-07 Yaar Schnitman <yaar@chromium.org>
+ Reviewed by Gustavo Noronha Silva.
- Reviewed by Darin Fisher.
+ [Cairo] FreeType fonts should obey FontConfig hinting/anti-aliasing settings
+ https://bugs.webkit.org/show_bug.cgi?id=46740
- fixes to build-webkit --chromium
- https://bugs.webkit.org/show_bug.cgi?id=32179
+ * DumpRenderTree/gtk/fonts/fonts.conf: Add specialized variants of common
+ fonts which can be used to fully test FontConfig rendering settings.
- * Scripts/webkitdirs.pm:
+2010-09-28 Martin Robinson <mrobinson@igalia.com>
-2009-12-07 Eric Seidel <eric@webkit.org>
+ Reviewed by Gustavo Noronha Silva.
- No review, just adding two recently approved committers.
+ [gtk] Fedora has a different path for the liberation fonts
+ https://bugs.webkit.org/show_bug.cgi?id=46709
- * Scripts/modules/committers.py:
+ When searching for DRT fonts, also look in the path where those fonts
+ are commonly found on Fedora systems.
-2009-12-07 Alexey Proskuryakov <ap@apple.com>
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeFonts): Include logic for looking for Fedora-style font paths.
- * Scripts/run-webkit-websocketserver: Added property svn:executable.
+2010-09-28 Martin Robinson <mrobinson@igalia.com>
-2009-12-07 Yuzo Fujishima <yuzo@google.com>
+ Reviewed by Andreas Kling.
- Reviewed by Alexey Proskuryakov.
+ run-webkit-tests needs an updated list of directories with webgl tests
+ https://bugs.webkit.org/show_bug.cgi?id=46747
- Add run-webkit-websocketserver
+ Update the list of directories containing WebGL tests and a unit test
+ which depends on this list.
- https://bugs.webkit.org/show_bug.cgi?id=31390
+ * Scripts/old-run-webkit-tests: Update the list of directories.
+ * Scripts/webkitpy/layout_tests/port/webkit.py: Ditto.
+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: Update the expected result.
- * Scripts/run-webkit-websocketserver: Added.
+2010-09-28 Adam Barth <abarth@webkit.org>
-2009-12-07 Steve Falkenburg <sfalken@apple.com>
+ Reviewed by Eric Seidel.
- Build fix. Be flexible about which version of ICU is used on Windows.
+ Introduce FailureMap to summaries the failures status of all the bots
+ https://bugs.webkit.org/show_bug.cgi?id=46700
- * DumpRenderTree/win/DumpRenderTree.vcproj: Add optional xcopy commands to copy ICU 4.2.
+ This patch gives the SheriffBot a handle on the list of failing tests.
-2009-12-07 Dirk Schulze <krit@webkit.org>
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/failuremap.py: Added.
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- Not reviewed, adding myself to the reviewers list.
+2010-09-28 Adam Roben <aroben@apple.com>
- * Scripts/modules/committers.py:
+ Update for the addition of WKPageUIClient::didNotHandleKeyEvent
-2009-12-06 Eric Seidel <eric@webkit.org>
+ Fixes <http://webkit.org/b/46660> <rdar://problem/8483465> Need API to
+ tell a WebKit2 client application that a key event was not handled
- Reviewed by Adam Barth.
+ Reviewed by Kenneth Rohde Christiansen and Sam Weinig.
- Add an API for uploading results files to StatusBot
- https://bugs.webkit.org/show_bug.cgi?id=32210
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
- Add Content-Type: plain/text which was forgotten
- from the previous commit when I landed with land-patches
- instead of land-diff.
+2010-09-28 Simon Fraser <simon.fraser@apple.com>
- * QueueStatusServer/queue_status.py:
+ Unreviewed.
-2009-12-06 Eric Seidel <eric@webkit.org>
+ Update the CSSTestSuiteHarness to not scrape the XHTML chapter files
+ for the test order, but instead use information from testinfo.data.
+
+ * CSSTestSuiteHarness/harness/harness.html:
+ * CSSTestSuiteHarness/harness/harness.js:
- Reviewed by Adam Barth.
+2010-09-28 Kevin Ollivier <kevino@theolliviers.com>
- Status Server needs a way to handle uploaded results
- https://bugs.webkit.org/show_bug.cgi?id=32209
+ [wx] Build fix, don't try to get the svn revision from the git repo when packaging,
+ it causes the process to hang on the gitorious repo.
- * QueueStatusServer/queue_status.py: Add a ShowResults (results/*) command
- * QueueStatusServer/update_status.html: Add file upload.
+ * wx/packaging/build-mac-installer.py:
+ * wx/packaging/build-win-installer.py:
-2009-12-06 Eric Seidel <eric@webkit.org>
+2010-09-28 Adam Roben <aroben@apple.com>
- Reviewed by Adam Barth.
+ Test that a plugin's HWND is sized/positioned before NPP_SetWindow is
+ called
- Add an API for uploading results files to StatusBot
- https://bugs.webkit.org/show_bug.cgi?id=32210
+ Reviewed by Anders Carlsson.
- * Scripts/modules/statusbot.py:
+ Test for <http://webkit.org/b/46716> <rdar://problem/8482014>
+ Full-page Adobe Reader does not paint until window is resized
-2009-12-06 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::NPP_SetWindow): Added. Just returns NPERR_NO_ERROR at
+ this level.
- Reviewed by Adam Barth.
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Declared
+ NPP_SetWindow.
- Status Server needs a way to handle uploaded results
- https://bugs.webkit.org/show_bug.cgi?id=32209
+ * DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp: Added.
+ (WindowGeometryInitializedBeforeSetWindow::NPP_SetWindow): Checks that
+ the plugin's HWND has a non-zero size and that its size/position
+ matches that specified in the NPWindow.
- * QueueStatusServer/queue_status.py: Add a ShowResults (results/*) command
- * QueueStatusServer/update_status.html: Add file upload.
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_SetWindow): Call through to the PluginTest.
-2009-12-06 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ Added WindowGeometryInitializedBeforeSetWindow.cpp, and let VS reorder
+ the files as it saw fit.
- Reviewed by Eric Seidel.
+2010-09-28 Benjamin Poulain <benjamin.poulain@nokia.com>
- [bzt] BuildAttachment should not check the builders
- https://bugs.webkit.org/show_bug.cgi?id=32207
+ Reviewed by Andreas Kling.
- This is code that got copied here by accident when the class was created.
+ [Qt] Remove support for Qt 4.5
+ https://bugs.webkit.org/show_bug.cgi?id=46718
- * Scripts/modules/commands/download.py:
+ Remove the code for versions of Qt prior to 4.6.
-2009-12-06 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::addTouchPoint):
+ (EventSender::updateTouchPoint):
+ (EventSender::setTouchModifier):
+ (EventSender::touchStart):
+ (EventSender::touchMove):
+ (EventSender::touchEnd):
+ (EventSender::clearTouchPoints):
+ (EventSender::releaseTouchPoint):
+ (EventSender::sendTouchEvent):
+ * DumpRenderTree/qt/EventSenderQt.h:
+ * DumpRenderTree/qt/TextInputControllerQt.cpp:
+ (TextInputController::setMarkedText):
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::initializeView):
+ (LauncherWindow::createChrome):
+ (LauncherWindow::sendTouchEvent):
+ (LauncherWindow::eventFilter):
+ (LauncherWindow::applyZoom):
+ (LauncherWindow::setTouchMocking):
+ * QtTestBrowser/launcherwindow.h:
+ * QtTestBrowser/utils.cpp:
+ (urlFromUserInput):
+ * QtTestBrowser/webview.cpp:
+ (WebViewGraphicsBased::animatedFlip):
+ (WebViewGraphicsBased::animatedYFlip):
+ * QtTestBrowser/webview.h:
+ (WebViewGraphicsBased::setYRotation):
- Reviewed by Eric Seidel.
+2010-09-28 İsmail Dönmez <ismail@namtrac.org>
- [bzt] Make LandingSequence.update aware of ports
- https://bugs.webkit.org/show_bug.cgi?id=32208
+ Reviewed by Andreas Kling.
- This is required to make build work on the Chromium port because
- Chromium has a custom update-webkit.
+ Fix DRT compilation on WinCE. Introduce a WCECOMPAT variable
+ which should point to wcecompat installation. Needs wcecompat
+ library from http://github.com/mauricek/wcecompat .
- * Scripts/modules/landingsequence.py:
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
-2009-12-06 Adam Barth <abarth@webkit.org>
+2010-09-28 Daniel Bates <dbates@rim.com>
- Reviewed by Eric Seidel.
+ Rollout changeset 68493 <http://trac.webkit.org/changeset/68493>
+ <https://bugs.webkit.org/show_bug.cgi?id=39136>
- Add early warning system commands to bugzilla-tool.
+ Rollout changeset 68493 because it broke Sheriffbot's rollout feature.
+ In particular, this change caused Sheriffbot to raise an exception when
+ trying to parse the bug id on a bug page. We need to look into this
+ some more.
- * Scripts/bugzilla-tool:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/webkitport.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/tool/bot/sheriff.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/steps/closebug.py:
+ * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
-2009-12-06 Adam Barth <abarth@webkit.org>
+2010-09-28 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- [bzt] Implement Qt EarlyWarningSystem and Chromium EarlyWarningSystem
- https://bugs.webkit.org/show_bug.cgi?id=32205
-
- * Scripts/modules/commands/early_warning_system.py: Added.
- * Scripts/modules/commands/queues.py:
+ Move RegressionWindow further up the dependency chain
+ https://bugs.webkit.org/show_bug.cgi?id=46698
-2009-12-06 Dan Bernstein <mitz@apple.com>
+ Baby steps towards pushing this information into bug posts.
- Reviewed by Adele Peterson.
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ * Scripts/webkitpy/common/net/regressionwindow.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
- REGRESSION (r51728): update-webkit fails when the current directory is
- not inside a Subversion working copy
- https://bugs.webkit.org/show_bug.cgi?id=32204
+2010-09-27 Daniel Bates <dbates@rim.com>
- * Scripts/update-webkit: Invoke isSVN() in the correct working
- directory.
+ Reviewed by Adam Barth.
-2009-12-06 Adam Barth <abarth@webkit.org>
+ sheriffbot can't roll out security patches
+ https://bugs.webkit.org/show_bug.cgi?id=39136
+
+ Make SheriffBot determine if it's authorized to view a bug
+ whose change it wants to rollout before it tries to rollout
+ the change.
+
+ Moreover, make both webkit-patch and Sheriffbot provide human-
+ readable error messages when they are not authorized to view
+ a bug and when a bug number is invalid.
+
+ Currently, Sheriffbot does not parse Bugzilla bugs for
+ <bug error="...">, which indicates an error when retrieving
+ a bug. In particular, error="NotPermitted" if a person (or bot)
+ is not authorized to view a bug. For such error="NotPermitted" bugs,
+ Sheriffbot raises an exception when parsing the bug report and
+ this exception does not explicitly indicate Sheriffbot's lack
+ of authorization. Instead, Sheriffbot should explicitly check
+ for the presence <bug error="..."> before operating on a bug
+ and error with a human-readable message if it's not permitted
+ to view it.
+
+ * Scripts/webkitpy/common/net/bugzilla.py: Added BugzillaError class.
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ - Added unit test test_bug_parsing_for_bugzilla_not_permitted_error().
+ - Added unit test test_bug_parsing_for_bugzilla_not_found_error().
+ - Added unit test test_bug_parsing_for_bugzilla_invalid_bug_id_error().
+ * Scripts/webkitpy/tool/bot/sheriff.py: Modified to catch BugzillaError.
+ * Scripts/webkitpy/tool/commands/download.py: Ditto.
+ * Scripts/webkitpy/tool/commands/queues.py: Ditto.
+ * Scripts/webkitpy/tool/commands/upload.py: Ditto.
+ * Scripts/webkitpy/tool/steps/closebug.py: Ditto.
+ * Scripts/webkitpy/tool/steps/obsoletepatches.py: Ditto.
+ * Scripts/webkitpy/tool/steps/preparechangelog.py: Ditto.
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py: Ditto.
+
+2010-09-27 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- [bzt] Rename AbstractTryQueue to AbstractReviewQueue
- https://bugs.webkit.org/show_bug.cgi?id=32202
+ Expose more more failure information from Buildbot to SheriffBot
+ https://bugs.webkit.org/show_bug.cgi?id=46697
- * Scripts/modules/commands/queues.py:
+ This patch moves the information about what tests failured closer to
+ SheriffBot. There are still a couple more patches to go before
+ SheriffBot can post this information to bugs, but this is a step in
+ that direction. Yay for unit tests, which caught some bugs in earlier
+ versions of this patch.
-2009-12-05 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ * Scripts/webkitpy/common/net/regressionwindow.py: Added.
+ * Scripts/webkitpy/tool/commands/queries.py:
- Reviewed by Eric Seidel.
+2010-09-27 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Fixing 500 error seen in the status server.
- [bzt] Implement ChromiumPort
- https://bugs.webkit.org/show_bug.cgi?id=32182
+ It turns out that a = b = []; b.append(1); then a[0] will be 1!
+ This should have been obvious to me, I guess, but it was not what I was expecting.
- * Scripts/modules/webkitport.py:
- * Scripts/modules/webkitport_unittest.py:
+ * QueueStatusServer/model/activeworkitems.py:
-2009-12-05 Adam Barth <abarth@webkit.org>
+2010-09-27 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- Move update-webkit into BuildSteps
- https://bugs.webkit.org/show_bug.cgi?id=32181
+ commit-queue should reject patches that fail to land
+ https://bugs.webkit.org/show_bug.cgi?id=46694
- We need to move update-webkit out of SCM.py because SCM isn't supposed to know
- that WebKit exists. The proper place for the knowledge of the existence of
- update-webkit is in WebKitPort because some ports have specialized update
- scripts (analogous to build-webkit).
+ This can happen, for example, if there's no reviewer. Without this
+ patch, we'll keep retrying the patch.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/scm.py:
- * Scripts/modules/webkitport.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
-2009-12-05 Adam Barth <abarth@webkit.org>
+2010-09-27 Simon Fraser <simon.fraser@apple.com>
- Reviewed by Eric Seidel.
+ Rubber-stamped by Adele Peterson.
- update-webkit should call git svn rebase and resolve-ChangeLogs -f
- https://bugs.webkit.org/show_bug.cgi?id=27162
+ Add a harness for running the CSS 2.1 test suite.
+
+ This harness assumes that you've got a local a copy of the suite
+ adjacent to the 'harness' directory.
+
+ The harness lets you go through the tests in chapter order,
+ denoting pass/fail/skipped for each test.
+
+ It uses a client-side database to store the results of testing.
- Teach update-webkit about Git. I didn't add the call to
- resolve-ChangeLogs -f because sometimes that script goes bananas. We
- can iterate from here, however.
+ * CSSTestSuiteHarness/harness/harness.css: Added.
+ * CSSTestSuiteHarness/harness/harness.html: Added.
+ * CSSTestSuiteHarness/harness/harness.js: Added.
- * Scripts/update-webkit:
+2010-09-27 Eric Seidel <eric@webkit.org>
-2009-12-04 Yael Aharon <yael.aharon@nokia.com>
+ Reviewed by Adam Barth.
- Unreviewed build fix.
+ Patch locks should expire if a patch is marked for retry
+ https://bugs.webkit.org/show_bug.cgi?id=46682
- [Qt] build fix after r51634 removed unused QBoxLayout include which included limits.h.
+ This was part Adam's original CommitQueueTask design,
+ but support for it was missing from the server.
+ I added the support, but triggering lock-release based on this
+ special "retry" status feels a bit strange so I added a FIXME.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
+ I also changed the text in queuestatus.html to say "Lock Acquired"
+ since "Last Activity" isn't really true. We only update the lock
+ date when the patch is started, not on every status update.
-2009-12-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ I also noticed an exception in next-patch, which I fixed by re-writing
+ the unzip logic in activeworkitems.py again.
- Reviewed by Adam Treat.
+ * QueueStatusServer/handlers/updatestatus.py:
+ * QueueStatusServer/model/activeworkitems.py:
+ * QueueStatusServer/templates/queuestatus.html:
- Add some missing methods for showing and hiding the
- Web Inspector.
+2010-09-27 Tony Chang <tony@chromium.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
- (WebCore::WebPage::~WebPage):
- (WebCore::WebPage::webInspector):
- * DumpRenderTree/qt/DumpRenderTree.h:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::showWebInspector):
- (LayoutTestController::hideWebInspector):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ Reviewed by David Levin.
-2009-12-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ [chromium] fix a warning when compiling DRT on 32-bit linux
+ https://bugs.webkit.org/show_bug.cgi?id=46641
- Reviewed by Adam Treat.
+ * DumpRenderTree/chromium/TestEventPrinter.cpp:
+ (DRTPrinter::handleImage):
- Implement the setAllowUniversalAccessFromFileURLs method
- for the Qt LayoutTestController.
+2010-09-27 Eric Seidel <eric@webkit.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::resetSettings):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setAllowUniversalAccessFromFileURLs):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ Reviewed by Adam Barth.
-2009-12-04 Chris Fleizach <cfleizach@apple.com>
+ queue-status should report when the patch was last locked to a queue
+ https://bugs.webkit.org/show_bug.cgi?id=46674
- Reviewed by Darin Adler.
+ This isn't necessarily the best way to expose this information
+ but having this accessible via the web interface is very
+ useful until we come up with a nicer way to display this.
- REGRESSION: AX: buttons now extremely repetitive
- https://bugs.webkit.org/show_bug.cgi?id=32164
+ I also cleaned up the code in activeworkitems.py a little
+ to use list comprehensions and to have the code work with
+ pairs instead of two lists at once. Eventually I think those
+ item/time pairs need to be their own little helper class.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (isAttributeSupportedCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::isAttributeSupported):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::isAttributeSupported):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::isAttributeSupported):
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/model/activeworkitems.py:
+ * QueueStatusServer/templates/queuestatus.html:
-2009-12-03 Shinichiro Hamaji <hamaji@chromium.org>
+2010-09-27 Tony Chang <tony@chromium.org>
Reviewed by David Levin.
- check-webkit-style should check for camelCase variable names
- https://bugs.webkit.org/show_bug.cgi?id=32051
+ [chromium] fix detection of missing fonts on DRT
+ https://bugs.webkit.org/show_bug.cgi?id=46651
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+ * DumpRenderTree/chromium/TestShellGtk.cpp:
+ (setupFontconfig): Only print an error message if lohit isn't found in both locations.
-2009-12-03 Chris Fleizach <cfleizach@apple.com>
+2010-09-27 Tony Chang <tony@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Dimitri Glazkov.
- AX: VO just says "term" on many web sites
- https://bugs.webkit.org/show_bug.cgi?id=32139
+ add webkit unit tests to the chromium testers
+ https://bugs.webkit.org/show_bug.cgi?id=46669
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getRoleDescriptionCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::roleDescription):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::roleDescription):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::roleDescription):
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ * Scripts/run-chromium-webkit-unit-tests: Fix a bug where we weren't using the right configuration.
-2009-12-03 Chris Fleizach <cfleizach@apple.com>
+2010-09-27 Kwang Yul Seo <skyul@company100.net>
- Reviewed by Beth Dakin.
+ Unreviewed.
- Implement WAI-ARIA scrollbar role and related property aria-orientation
- https://bugs.webkit.org/show_bug.cgi?id=32126
+ Adding myself to the committers list.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getOrientationCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::orientation):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::orientation):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::orientation):
+ * Scripts/webkitpy/common/config/committers.py:
-2009-12-03 Eric Carlson <eric.carlson@apple.com>
+2010-09-27 Mihai Parparita <mihaip@chromium.org>
- Reviewed by Adam Roben.
+ Reviewed by Eric Seidel.
- Minor correction to r51663.
+ webkitpy.common.system.user_unittest.UserTest.test_prompt_with_list spams the console
+ https://bugs.webkit.org/show_bug.cgi?id=46634
+
+ Use OutputCapture to prevent console spam (and also check for expected
+ output).
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (addQTDirToPATH):
- GetEnvironmentVariable -> GetEnvironmentVariableW.
+ * Scripts/webkitpy/common/system/user_unittest.py:
-2009-12-03 Eric Carlson <eric.carlson@apple.com>
+2010-09-27 Eric Seidel <eric@webkit.org>
- Reviewed by Adam Roben.
+ Reviewed by James Robinson.
- ~96 regression tests fail when using QuickTime 7.6 (they pass with QuickTime 7.3)
- https://bugs.webkit.org/show_bug.cgi?id=30256
+ start-commit-queue should abort any rebases in progress
+ https://bugs.webkit.org/show_bug.cgi?id=46640
- Add the QuickTime dll directory to the PATH environment variable so
- inialization can succeed.
+ webkit-patch commit-queue would do this itself, but this just
+ helps ensure that the commit-queue script is properly updated
+ before we run it (in the case where a previous rebase is in
+ progress the git svn rebase would not work before we run the
+ commit-queue).
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (addQTDirToPATH):
- (initialize):
+ * EWSTools/start-commit-queue.sh:
-2009-12-03 Shu Chang <Chang.Shu@nokia.com>
+2010-09-18 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Kenneth Rohde Christiansen.
-
- [Qt] After revision 32643, sender() is of type QWebPage instead of QWebFrame.
-
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::maybeDump):
+ Reviewed by Gustavo Noronha Silva.
-2009-12-03 Yuzo Fujishima <yuzo@google.com>
+ [GTK] Clean up the DRT fonts.conf and switch to Liberation
+ https://bugs.webkit.org/show_bug.cgi?id=46038
- Reviewed by Eric Seidel.
+ Switch to Liberation fonts for GTK+ layout tests. This will make our
+ test results metric-compatible with many Windows/Chromium results. It
+ also simplifies the fonts.conf that we load and prepares the way for
+ fixing many font bugs.
- Update pywebsocket to 0.4.3
- This version logs friendlier and higher-level messages in WARN level, which is used for LayoutTests.
- Stack trace is logged now in INFO level.
- https://bugs.webkit.org/show_bug.cgi?id=32097
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeFonts): Initialize a known list of fonts instead of loading
+ every font in the WEBKIT_TESTFONTS directory.
+ * DumpRenderTree/gtk/fonts.conf: Removed.
+ * DumpRenderTree/gtk/fonts/AHEM____.TTF: Copied from WebKitTools/DumpRenderTree/qt/fonts/AHEM____.TTF.
+ * DumpRenderTree/gtk/fonts/fonts.conf: Added.
+ * GNUmakefile.am: Modify FONTS_CONF_FILE to be FONTS_CONF_DIR, so that
+ we can load both fonts.conf and AHEM____.TTF from this location.
+ * Scripts/old-run-webkit-tests: Remove the check for WEBKIT_TESTFONTS, since
+ it is no longer used.
+
+2010-09-26 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ new-run-webkit-httpd fails if Perl is not installed
+ https://bugs.webkit.org/show_bug.cgi?id=46602
+
+ Make Port._read_configuration catch all exceptions, since trying to run
+ perl (because of _webkit_build_directory) when it's not installed throws
+ a WindowsError or OSError, not an IOError (this became an issue after
+ r68268, since ChromiumPort ends up calling Port.default_configuration in
+ its constructor, which means that we're ending up on this codepath in
+ non-NRWT cases too, e.g. for the Chromium NaCl tests, which use
+ new-run-webkit-httpd).
- * pywebsocket/mod_pywebsocket/dispatch.py:
- * pywebsocket/mod_pywebsocket/msgutil.py:
- * pywebsocket/mod_pywebsocket/standalone.py:
- * pywebsocket/mod_pywebsocket/util.py:
- * pywebsocket/setup.py:
- * pywebsocket/test/test_dispatch.py:
- * pywebsocket/test/test_util.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
-2009-12-03 Sam Weinig <sam@webkit.org>
+2010-09-26 Gyuyoung Kim <gyuyoung.kim@samsung.com>
- Reviewed by Gavin Barraclough.
+ Reviewed by Antonio Gomes.
- Fix JSClassRef leak.
+ [EFL] Add setting API to set a local storage database path.
+ https://bugs.webkit.org/show_bug.cgi?id=45446
- * DumpRenderTree/AccessibilityController.cpp:
- (AccessibilityController::makeWindowObject):
- * DumpRenderTree/GCController.cpp:
- (GCController::makeWindowObject):
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::makeWindowObject):
+ Add a setting API to set local storage database path.
-2009-12-03 Brady Eidson <beidson@apple.com>
+ * EWebLauncher/main.c:
+ (on_key_down):
+ (browserCreate):
+ (main):
- Reviewed by Sam Weinig.
+2010-09-26 Sam Weinig <sam@webkit.org>
- <rdar://problem/7214236> and http://webkit.org/b/32052 - Implement HTML5 state object history API
+ Reviewed by Anders Carlsson.
- Keep DRT-win building...
+ Move shared WebKit2 API (used by both bundle and main API) to WebKit2/Shared/API
+ https://bugs.webkit.org/show_bug.cgi?id=46587
- * DumpRenderTree/win/FrameLoadDelegate.h:
- (FrameLoadDelegate::didPushStateWithinPageForFrame):
- (FrameLoadDelegate::didReplaceStateWithinPageForFrame):
- (FrameLoadDelegate::didPopStateWithinPageForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
-2009-12-03 Andras Becsi <abecsi@inf.u-szeged.hu>
+2010-09-26 Antonio Gomes <agomes@rim.com>
- Unreviewed build fix.
+ Reviewed by Kenneth Rohde Christiansen.
- [Qt] ARM-Linux build fix after r51634 removed unused QBoxLayout include which included limits.h on ARM.
+ DRT/Mac nodesFromRect support
- * DumpRenderTree/qt/DumpRenderTree.cpp:
+ [Mac][DRT] Implement LayoutTestController::nodesFromRect
+ https://bugs.webkit.org/show_bug.cgi?id=46580
-2009-12-03 Andras Becsi <abecsi@inf.u-szeged.hu>
+ Implements LayoutTestController::nodesFromRect for Mac DRT, and
+ adding stubs for GTK+ and Windows.
- Reviewed by Kenneth Rohde Christiansen.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (nodesFromRectCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::LayoutTestController::nodesFromRect):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::nodesFromRect):
- [Qt] Refactor DRT to not crash on tests which open child windows from javascript.
- Prevent DRT from showing the main view if these childs get deleted.
- This fixes https://bugs.webkit.org/show_bug.cgi?id=31591.
+2010-09-25 Nicolas Weber <thakis@chromium.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::~DumpRenderTree):
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
- (WebCore::DumpRenderTree::open):
- (WebCore::DumpRenderTree::closeRemainingWindows):
- (WebCore::DumpRenderTree::createWindow):
- (WebCore::DumpRenderTree::windowCount):
- * DumpRenderTree/qt/DumpRenderTree.h:
+ Reviewed by Adam Barth.
-2009-12-02 Eric Seidel <eric@webkit.org>
+ https://bugs.webkit.org/show_bug.cgi?id=46555
+ Fix typo in prepare-ChangeLog's help output.
- Reviewed by Adam Barth.
+ * Scripts/prepare-ChangeLog:
- REGRESSION(51595): commit-queue is throwing exceptions
- https://bugs.webkit.org/show_bug.cgi?id=32083
-
- * Scripts/modules/commands/queues.py:
- - Don't use default value of [] as it ends up getting shared.
- - Make log_progress accept arrays of ints as well as strings.
- - Return an exit code from execute()
- * Scripts/modules/commands/queues_unittest.py: Added.
- - Test to make sure log_progress will accept ints.
- - Test to make sure run_bugzilla_tool will accept ints.
- * Scripts/modules/workqueue.py:
- - Print the stack trace on unexpected exceptions for easier debugging.
- * Scripts/run-webkit-unittests:
- - Add queues_unittest.
-
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/commands/queues_unittest.py: Copied from WebKitTools/Scripts/modules/commands/commandtest.py.
- * Scripts/modules/mock_bugzillatool.py:
- * Scripts/modules/workqueue.py:
- * Scripts/run-webkit-unittests:
-
-2009-12-02 David Levin <levin@chromium.org>
+2010-09-24 Sam Weinig <sam@webkit.org>
- Reviewed by Adam Barth.
+ Reviewed by Darin Adler.
- check-webkit-style is too noisy about namespace indenting issues.
- https://bugs.webkit.org/show_bug.cgi?id=32096
+ Implement WebKit2 callback equivalent to -[WebUIDelegate mouseDidMoveOverElement:modifierFlags:]
+ <rdar://problem/8359279>
+ https://bugs.webkit.org/show_bug.cgi?id=46546
- * Scripts/modules/cpp_style.py:
- Added a _FileState object to be able to track file level information. In this
- case, it simply tracks whether the error has already been given, so that it isn't
- done again.
- * Scripts/modules/cpp_style_unittest.py:
- Modified test cases to pass in the _FileState object and fix a test that expected
- to see the namespace error twice (now it only occurs once). No new tests because
- existing tests cover the change in functionality.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (mouseDidMoveOverElement):
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (mouseDidMoveOverElement):
+ (BrowserView::create):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
-2009-12-01 Kevin Ollivier <kevino@theolliviers.com>
+2010-09-24 Mihai Parparita <mihaip@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Adam Barth.
- [wx] Get DumpRenderTree building after waf switch.
+ Allow rebaselines for webkit-patch rebaseline to be chosen
+ https://bugs.webkit.org/show_bug.cgi?id=46407
- https://bugs.webkit.org/show_bug.cgi?id=32041
+ Instead of always rebaselining all failing tests, allow a subset to be
+ chosen.
- * DumpRenderTree/wscript: Added.
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::setTimelineProfilingEnabled):
- (LayoutTestController::evaluateScriptInIsolatedWorld):
- (LayoutTestController::disableImageLoading):
- (LayoutTestController::whiteListAccessFromOrigin):
- (LayoutTestController::counterValueForElementById):
- * Scripts/build-webkit:
+ * Scripts/webkitpy/common/system/user.py:
+ * Scripts/webkitpy/tool/commands/rebaseline.py:
-2009-12-02 Adam Barth <abarth@webkit.org>
+2010-09-24 Ryosuke Niwa <rniwa@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Tony Chang.
- [bzt] build-attachment shouldn't check whether the builders are red
- https://bugs.webkit.org/show_bug.cgi?id=32062
+ [chromium] Implement TextInputController::firstRectForCharacterRange
+ https://bugs.webkit.org/show_bug.cgi?id=38100
- build-attachment doesn't touch the remote repository, so there isn't a
- need to hold off when the builders are red.
+ Implemented TextInputController::firstRectForCharacterRange for chromium platform.
+ No new tests are added since we need to implement the same feature in chromium side
+ in order to enable any tests that uses this function.
- * Scripts/modules/commands/download.py:
- * Scripts/modules/landingsequence.py:
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::firstRectForCharacterRange): Added.
-2009-12-02 Eric Seidel <eric@webkit.org>
+2010-09-24 Adam Barth <abarth@webkit.org>
- Reviewed by Adam Barth.
+ Reviewed by Eric Seidel.
- REGRESSION(51590): style-queue and build-queue think their empty when they are not
- https://bugs.webkit.org/show_bug.cgi?id=32061
+ commit-queue reports land failures as "PASS"
+ https://bugs.webkit.org/show_bug.cgi?id=46530
- * Scripts/modules/bugzilla.py: make all id lookups return ints instead of strings.
- * Scripts/modules/bugzilla_unittest.py: Add and update unit tests to use ints.
+ We were ignoring the return value of land instead of passing it back to
+ CommitQueue. Of course, this was the one case I forgot to test!
-2009-12-02 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
- Reviewed by Adam Barth.
+2010-09-24 Kenichi Ishibashi <bashi@google.com>
- build-queue is throwing exceptions and complaining about
- lack of --no-update on build-attachment. Make it stop.
+ Reviewed by Eric Seidel.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
+ new-run-webkit-tests prints out nothing when build-dumprendertree fails
+ https://bugs.webkit.org/show_bug.cgi?id=37563
-2009-12-02 Adam Barth <abarth@webkit.org>
+ Print error message when build-dumprendertree fails.
- Unreviewed "build" fix. Forgot to declare my variables. :(
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * QueueStatusServer/queue_status.py:
+2010-09-24 Mihai Parparita <mihaip@chromium.org>
-2009-12-02 Adam Barth <abarth@webkit.org>
+ Reviewed by Tony Chang.
- Reviewed by Eric Seidel.
+ NRWT doesn't respect config set with set-webkit-configuration
+ https://bugs.webkit.org/show_bug.cgi?id=46278
+
+ Use Port.default_configuration() instead of hardcoding Release in
+ ChromiumPort configuration initialization, so that we still inherit the
+ configuration set by set-webkit-configuration.
- [bzt] Implement status bubble view
- https://bugs.webkit.org/show_bug.cgi?id=32057
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
- The status bubble is a compact representation of the queue status for a
- given patch. This will eventually help us reduce the comment spam from
- the queues.
+2010-09-24 Chang Shu <chang.shu@nokia.com>
- * QueueStatusServer/index.html: Added HTML5 doctype for sanity.
- * QueueStatusServer/queue_status.py:
- * QueueStatusServer/status_bubble.html: Added.
+ Reviewed by Csaba Osztrogonác.
-2009-12-02 Eric Seidel <eric@webkit.org>
+ [Qt] Fix the code to check file existence.
+ https://bugs.webkit.org/show_bug.cgi?id=46465
- Reviewed by Adam Barth.
+ * QtTestBrowser/main.cpp:
+ (main):
- trim commands/*.py includes now that commands are unit tested
- https://bugs.webkit.org/show_bug.cgi?id=32056
+2010-09-23 Tony Chang <tony@chromium.org>
- In the course of ensuring that the unit tests still
- passed after this change, I had to actually make them
- pass in the first place.
+ Unreviewed, rolling out r68232.
+ http://trac.webkit.org/changeset/68232
- * Scripts/modules/bugzilla.py:
- - Fix _parse_attachment_ids_request_query to return ints instead of strings.
- * Scripts/modules/commands/download.py: Remove unneeded imports.
- * Scripts/modules/commands/queries.py: Ditto.
- * Scripts/modules/commands/queues.py: Ditto.
- * Scripts/modules/commands/upload.py: Ditto.
- * Scripts/modules/scm_unittest.py:
- - Fix to expect the \n after the path since echo adds an \n.
+ Broken NRWT on the canary bots.
-2009-12-01 Yaar Schnitman <yaar@chromium.org>
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
- build-webkit: Remove flex,bison,gperf check for chromium
- https://bugs.webkit.org/show_bug.cgi?id=32043
+2010-09-23 Dirk Pranke <dpranke@chromium.org>
- * Scripts/webkitdirs.pm:
+ Unreviewed, build fix.
-2009-12-01 Chris Fleizach <cfleizach@apple.com>
+ r68008 broke new-run-webkit-tests in that the chromium ports no
+ longer respect set-webkit-configuration. The correct fix for this
+ is being pursued in bug 46278 (along with a bunch of unit tests),
+ but in the meantime I'm reverting the particular lines that broke
+ things. This was tested by hand.
- Build fixage for Windows/GTK for DumpRenderTree.
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
- WAI-ARIA: implement support for ARIA drag and drop
- https://bugs.webkit.org/show_bug.cgi?id=32007
+2010-09-23 Sam Weinig <sam@webkit.org>
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::ariaIsGrabbed):
- (AccessibilityUIElement::ariaDropEffects):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::ariaIsGrabbed):
- (AccessibilityUIElement::ariaDropEffects):
+ Reviewed by Anders Carlsson.
-2009-12-01 Chris Fleizach <cfleizach@apple.com>
+ WebKit2 API: Need way to know when a frame is removed from the hierarchy
+ <rdar://problem/8414062>
+ https://bugs.webkit.org/show_bug.cgi?id=46432
- Reviewed by Darin Adler.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (didRemoveFrameFromHierarchy):
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
- WAI-ARIA: implement support for ARIA drag and drop
- https://bugs.webkit.org/show_bug.cgi?id=32007
+2010-09-23 Tony Chang <tony@chromium.org>
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getARIADropEffectsCallback):
- (getARIAIsGrabbedCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::ariaIsGrabbed):
- (AccessibilityUIElement::ariaDropEffects):
-
-2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+ Reviewed by Dimitri Glazkov.
- Not reviewed. GTK DRT try 2.
+ [chromium] implement layoutTestController.sampleSVGAnimationForElementAtTime
+ https://bugs.webkit.org/show_bug.cgi?id=46426
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
(LayoutTestController::sampleSVGAnimationForElementAtTime):
+ * DumpRenderTree/chromium/LayoutTestController.h:
-2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+2010-09-23 Martin Robinson <mrobinson@igalia.com>
- Not reviewed. Try to fix gtk DRT build.
+ Reviewed by Nate Chapin.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ [GTK] r68199 introduced two test failures
+ https://bugs.webkit.org/show_bug.cgi?id=46424
-2009-12-01 David Levin <levin@chromium.org>
+ Fix a regression handling preference overrides that are attached to boolean properties.
- Reviewed by Eric Seidel.
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::overridePreference): g_strcasecmp returns 0 when strings match
+ so we must check for that when converting a string to a boolean.
- check-webkit-style does not understand (Prefix)Foo(Custom|Gtk|CG|Mac).cpp including Foo.h
- https://bugs.webkit.org/show_bug.cgi?id=32033
+2010-09-23 Dimitri Glazkov <dglazkov@chromium.org>
- * Scripts/modules/cpp_style.py: Changed check for a possible primary header to use find
- instead of startswith.
- * Scripts/modules/cpp_style_unittest.py: Added a unit test for the new behavior.
+ Reviewed by David Levin.
-2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+ Fix a condition check in ServerProcess, which becomes relevant when reading binary data.
+ https://bugs.webkit.org/show_bug.cgi?id=46406
- Not reviewed. Qt build almost fixed, DumpRenderTree should compile now as well.
+ This breaks when the method is called with specified size of data (image data), and the
+ buffer hasn't yet reached this size.
- * DumpRenderTree/qt/LayoutTestControllerQt.h: Update old function signature.
+ * Scripts/webkitpy/layout_tests/port/server_process.py: Changed to check for values of
+ index larger than 0.
-2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+2010-09-23 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Simon Fraser.
+ Reviewed by Nate Chapin.
- Add SVG animation test framework with 'snapshot' functionality
- https://bugs.webkit.org/show_bug.cgi?id=31897
+ [GTK] Some tests from r68174 fail on the GTK+ bots
+ https://bugs.webkit.org/show_bug.cgi?id=46396
- Add new 'sampleSVGAnimationForElementAtTime' DRT method,
- used by the new SVG animation testing framework, implemented
- for qt/gtk/win/mac.
+ Simplify LayoutTestController::overridePreference to make it easier for
+ people unfamiliar with the code to keep the list of preferences up to date.
+ Add the conversion for enable-hyperlink-auditing.
- * DumpRenderTree/LayoutTestController.cpp:
- (sampleSVGAnimationForElementAtTimeCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
* DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::sampleSVGAnimationForElementAtTime):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::sampleSVGAnimationForElementAtTime):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::sampleSVGAnimationForElementAtTime):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::sampleSVGAnimationForElementAtTime):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::sampleSVGAnimationForElementAtTime):
+ (LayoutTestController::overridePreference): Use a simple if-else block to determine
+ out the property name for overrridePreference. Also simplify the logic for setting
+ string properties. Add the conversion for enable-hyperlink-auditing.
-2009-12-01 Adam Roben <aroben@apple.com>
+2010-09-23 Tony Chang <tony@chromium.org>
- Remove user content before running each test on Windows
+ Reviewed by David Levin.
- Fixes <http://webkit.org/b/31479> Make websocket tests work on Windows
+ [chromium] add caretBrowsingEnabled to WebSettings and DRT
+ https://bugs.webkit.org/show_bug.cgi?id=46388
- Reviewed by Alexey Proskuryakov.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ (WebPreferences::applyTo):
+ * DumpRenderTree/chromium/WebPreferences.h:
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting): Remove all user content
- before each test, which matches Mac.
+2010-09-23 Nate Chapin <japhet@chromium.org>
-2009-12-01 Yuzo Fujishima <yuzo@google.com>
+ Reviewed by Darin Fisher.
- Reviewed by Alexey Proskuryakov.
+ Allow DRT to toggle hyperlink auditing (i.e., <a ping>).
+ https://bugs.webkit.org/show_bug.cgi?id=30458
- Make pywebsocket log errors to a file
- https://bugs.webkit.org/show_bug.cgi?id=31604
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ (WebPreferences::applyTo):
+ * DumpRenderTree/chromium/WebPreferences.h:
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::overridePreference):
- * Scripts/run-webkit-tests: Log output to a pywebsocket_log.txt file in results directory
- (by passing the path to the server via a recently added -l option).
+2010-09-21 Stephen White <senorblanco@chromium.org>
-2009-12-01 Adam Roben <aroben@apple.com>
+ Reviewed by David Levin.
- Fix tests that use the TestNetscapePlugin in Debug_Internal builds
+ Implement --enable-accelerated-2d-canvas flag in DumpRenderTree.
+ https://bugs.webkit.org/show_bug.cgi?id=46208
- Reviewed by Ada Chan.
+ This flag allows the layout tests to be run with or without accelerated
+ 2D canvas rendering.
- Fixes <http://webkit.org/b/32027> REGRESSION (r49705): Tests that use
- TestNetscapePlugin fail in Debug_Internal builds
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main):
+ Declare the new flag string, and check for it on startup.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ Add a boolean for the new flag, in order to preserve its value over
+ preferences reset.
+ (TestShell::resetWebSettings):
+ Set the new flag to the stored value on reset.
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::setAccelerated2dCanvasEnabled):
+ Add an accessor for the new flag.
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::reset):
+ Initialize the new flag to false.
+ (WebPreferences::applyTo):
+ Copy the flag's value to the WebSettings.
+ * DumpRenderTree/chromium/WebPreferences.h:
+ Add the new flag.
+
+2010-09-23 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
- * DumpRenderTree/win/DumpRenderTree.cpp: Use the "_Debug" plugin
- directory in Debug and Debug_All builds, but not in Debug_Internal
- builds.
+ Reviewed by Simon Hausmann.
-2009-12-01 Adam Roben <aroben@apple.com>
+ [Qt] Refactor QtWebKitPlatformPlugin interface
- Re-enable DRT's watchdog timer on Windows
+ Make it easier to keep source-compability for the
+ QtWebKitPlatformPlugin interface, and run qmake
+ on the example (but not build) for convenience.
- It was accidentally disabled in r50907.
+ https://bugs.webkit.org/show_bug.cgi?id=46345
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setWaitToDump): Remove a "false &&" that snuck
- into an if condition.
+ * Scripts/webkitdirs.pm:
-2009-12-01 Adam Barth <abarth@webkit.org>
+2010-09-23 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- check-webkit-style complains about #imports with / in them
- https://bugs.webkit.org/show_bug.cgi?id=32022
-
- We need to exclude #import directives in addition to #include from the
- binary operator whitespace checks.
+ Tweak some status messages that Eric thought were confusing
+ https://bugs.webkit.org/show_bug.cgi?id=46342
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
-2009-11-30 Adam Barth <abarth@webkit.org>
+2010-09-22 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- check-webkit-style is slightly too verbose
- https://bugs.webkit.org/show_bug.cgi?id=32010
+ Fix comm-queue typo
+ https://bugs.webkit.org/show_bug.cgi?id=46339
- check-webkit-style prints out a bunch of "done" lines that seem redundant,
- especially for the style-queue.
+ We were missing a "self". The real problem is that we didn't have an
+ integration test for the failure case.
- * Scripts/modules/cpp_style.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
-2009-11-30 Alejandro G. Castro <alex@igalia.com>
+2010-09-22 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- [GTK] Moved the functions that are closing the result log of the
- tests to the last line of the runTest function, this avoids
- reporting crashes in the wrong test if there is a problem when
- reseting the state after the test.
+ commit-queue should log more detailed messages to the QueueStatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=46333
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (dump):
- (runTest):
+ When I created CommitQueueTask, I removed most of the previous logging.
+ This patch adds back more detailed logging so folks can see their patch
+ progress through the queue.
-2009-11-30 Sam Weinig <sam@webkit.org>
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py:
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- Reviewed by Geoffrey Garen.
+2010-09-22 Mihai Parparita <mihaip@chromium.org>
- Fix for https://bugs.webkit.org/show_bug.cgi?id=31286
- fast/js/date-proto-generic-invocation breaks another test
+ Reviewed by Darin Fisher.
- Don't cache JSClassRefs, a change to the prototype chain will
- last between tests.
+ [Chromium] User style layout tests don't pass on Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=46069
- * DumpRenderTree/AccessibilityController.cpp:
- (AccessibilityController::getJSClass):
- * DumpRenderTree/GCController.cpp:
- (GCController::getJSClass):
- * DumpRenderTree/GCController.h:
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::getJSClass):
+ Fix a typo in LayoutTestController::addUserStyleSheet that was causing a
+ crash the Chromium DRT. Pass InjectInExistingDocuments to mimic DRT
+ behavior from other ports.
-2009-11-30 Yuzo Fujishima <yuzo@google.com>
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::addUserStyleSheet):
- Reviewed by Alexey Proskuryakov.
+2010-09-22 Brent Fulgham <bfulgham@webkit.org>
- Update pywebsocket to 0.4.2.1.
- This is to fix a bug that some messages are logged to stderr even when the log file is specified.
- https://bugs.webkit.org/show_bug.cgi?id=31976
+ Reviewed by Martin Robinson.
- * pywebsocket/mod_pywebsocket/standalone.py:
- * pywebsocket/setup.py:
+ [WinCairo] Part 2: Update WebKitTestRunner and DumpRenderTree Build.
+ https://bugs.webkit.org/show_bug.cgi?id=46303.
-2009-11-30 Adam Barth <abarth@webkit.org>
+ * MiniBrowser/Configurations/MiniBrowserCFLite.vsprops: Added.
+ * MiniBrowser/Configurations/MiniBrowserCommon.vsprops: Moved
+ CoreFoundation-specific stuff to new MiniBrowserCoreFoundation
+ property sheet.
+ * MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops: Added.
+ * MiniBrowser/MiniBrowser.vcproj: Updated configuration to use
+ appropriate property sheet for the build types.
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj: Updated the
+ configuration to use appropriate property sheet for CoreFoundation
+ and CFLite-style builds.
+
+2010-09-22 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- [bzt] Generate pass messages for style-queue
- https://bugs.webkit.org/show_bug.cgi?id=31995
+ Optimize commit-queue performance for green trees
+ https://bugs.webkit.org/show_bug.cgi?id=46254
- With this change, the style-queue posts "pass" messages to bugs as
- well. Also, added more information to the state store w.r.t. passing
- and failing.
+ This patch redesigns the controller logic for the commit-queue. In the
+ new design, the controller exercises much finer-grained control over
+ the landing process. In particular:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/patchcollection.py:
+ - Patches that fail to apply now get rejected almost immediately.
+ - Patches that fail to build get rejects after two builds (instead of
+ three builds and one test run).
+ - Patches that run into a flaky test now get accepted after one build
+ and two test runs instead of three full build-and-test runs.
-2009-11-30 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+ The main cost of these optimizations is that we don't find out the tree
+ has a failing test until the very end of the process, but if the tree
+ has a busted test, there's not much we can do anyway. We might as well
+ burn commit-queue resources spinning optimisticly.
- Reviewed by Simon Fraser.
+ * Scripts/webkitpy/tool/bot/commitqueuetask.py: Added.
+ * Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py: Added.
+ * Scripts/webkitpy/tool/commands/queues.py:
- Check for WEBKIT_TESTFONTS environment variable in
- run-webkit-tests, for GTK+, to have a more prominent error
- message.
+2010-09-22 Brent Fulgham <bfulgham@webkit.org>
- * Scripts/run-webkit-tests:
+ Reviewed by Martin Robinson.
-2009-11-30 Yaar Schnitman <yaar@chromium.org>
+ [WinCairo] Update WebKitTestRunner and DumpRenderTree Build.
+ https://bugs.webkit.org/show_bug.cgi?id=46303.
- Reviewed by Dimitri Glazkov.
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Disable local MD5 sources
+ for Cairo build. Copy wtf MD5 header to ForwardingHeaders for the
+ WinCairo build.
+ * WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops: Added.
+ * WebKitTestRunner/win/InjectedBundle.vcproj: Update win new *_Cairo
+ build targets that use the new InjectedBundleCFLite.vsprops file.
- update-webkit --chromium forces gclient sync
+2010-09-22 Dirk Pranke <dpranke@chromium.org>
- https://bugs.webkit.org/show_bug.cgi?id=31967
+ Unreviewed, build fix.
- * Scripts/update-webkit-chromium:
+ Fix bustage of rebaseline-chromium-webkit-tests resulting from
+ r67974. Really need better unit tests for this tool :(
-2009-11-29 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- Add Erik Arvidsson to committers.py since by r51326 he clear has commit rights.
+2010-09-22 Adam Roben <aroben@apple.com>
- * Scripts/modules/committers.py:
+ Unbreak test-webkitpy
-2009-11-29 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/test/main.py:
+ (Tester.run_tests): Add a line that mysteriously got deleted.
- No review, just adding missing svn property.
+2010-09-22 Adam Roben <aroben@apple.com>
- Set svn:executable property on new scripts.
- These were added by commit-queue commits, but the executable
- property was lost due to a bug in svn-apply:
- https://bugs.webkit.org/show_bug.cgi?id=27204
+ Make test-webkitpy test WebKit2's scripts
- * Scripts/update-webkit-chromium: Added property svn:executable.
- * Scripts/validate-committer-lists: Added property svn:executable.
+ These scripts can't be in WebKitTools due to limitations of Apple's
+ build process. But that doesn't mean we can't test them!
-2009-11-29 Eric Seidel <eric@webkit.org>
+ Fixes <http://webkit.org/b/46297> test-webkitpy should test code in
+ WebKit2/Scripts
Reviewed by Adam Barth.
- Need a way to validate that committers.py includes all committers/reviewers
- https://bugs.webkit.org/show_bug.cgi?id=30970
-
- Add a script which knows how to compare our public committer/reviewer
- lists and show discrepancies between them.
+ * Scripts/test-webkitpy:
+ (_clean_packages_with_test): Renamed from _clean_webkitpy_with_test.
+ Now takes an external_package_paths parameter and cleans both webkitpy
+ and any external packages.
+ (init): Added an external_package_paths parameter which we pass along
+ to _clean_packages_with_test.
+ (top level): Add WebKit2/Scripts/webkit2 as our only external package
+ and pass it along to init and Tester.run_tests.
- Validates mailing lists vs. committers.py:
- - committers.py committers missing from webkit-committers@lists
- - webkit-committers@lists members missing from committers.py
- - committers.py reviewers missing from webkit-reviewers@lists
- - webkit-reviewers@lists members missing from committers.py
- - webkit-reviewers@lists members missing from committers.py reviewer list
+ * Scripts/webkitpy/test/main.py:
+ (Tester.run_tests): Added an optional external_package_paths
+ parameter. We modify sys.path so that the external packages can be
+ imported, and search for unittest files inside all external packages
+ in addition to inside webkitpy.
- Validates committers.py vs. trunk/ SVN history:
- - committers who have not committed in over a year
- - SVN committers missing from committers.py
- - committers.py members who have no record in SVN.
+2010-09-22 Dirk Pranke <dpranke@chromium.org>
- All of these lists still show "false positives" until a few more committers.py updates are made, like:
- https://bugs.webkit.org/show_bug.cgi?id=31366
+ Reviewed by Tony Chang.
- * Scripts/validate-committer-lists: Added.
+ new-run-webkit-tests: r68063 broke linux python tests
-2009-11-28 Adam Barth <abarth@webkit.org>
+ Add a missing "from __future__ import with_statement" to this
+ new file; the perils of testing only on the Mac and by review :(
- Reviewed by Eric Seidel.
+ https://bugs.webkit.org/show_bug.cgi?id=46293
- [bzt] style-queue sends ~100 requests to QueueStatusServer every 5 minutes
- https://bugs.webkit.org/show_bug.cgi?id=31950
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
- Now we cache the last status that we get back from QueueStatusServer.
- Eventually we'll have to do something more fancy if we want to support
- a "try again" button on QueueStatusServer, but we can cross that bridge
- when we come to it.
+2010-09-22 Dirk Pranke <dpranke@chromium.org>
- * Scripts/modules/patchcollection.py:
+ Reviewed by Tony Chang.
-2009-11-28 Adam Barth <abarth@webkit.org>
+ Add a 'chromium-gpu' set of ports that will test the accelerated
+ GPU paths. This patch adds:
- Reviewed by Eric Seidel.
+ - support for the '--accelerated-compositing' and
+ 'accelerated-2d-canvas' flags to new-run-webkit-tests (and the
+ 'no-' flags)
+ - adds a new set of Ports that will look under
+ platform/chromium-gpu-$OS/ for baselines before looking in the
+ regular chromium search path
+ - adds a new test_expectations.txt file in platform/chromium-gpu
+ that skips all but the tests we actually want to run with
+ acceleration.
- StyleQueue scans ~100 bug pages every 5 minutes
- https://bugs.webkit.org/show_bug.cgi?id=31947
+ This patch will allow us to run both with and without acceleration
+ and to change the defaults for both the regular and -gpu options
+ as the code evolves.
- Instead of getting the pending-review attachment ids by scanning each
- bug (which results in a network request), we should just get them all
- from webkit.org/pending-review in one shot.
+ We plan to add both --chromium-$OS and --chromium-gpu-$OS runs to
+ each test bot.
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/bugzilla_unittest.py:
- * Scripts/modules/commands/queries.py:
- * Scripts/modules/commands/queries_unittest.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/mock_bugzillatool.py:
- * Scripts/modules/patchcollection.py:
+ https://bugs.webkit.org/show_bug.cgi?id=46225
-2009-11-28 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_gpu.py:
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
- Reviewed by Eric Seidel.
+2010-09-22 Jamey Hicks <jamey.hicks@nokia.com>
- [bzt] CC webkit-bot-watchers whenever the bots touch bugs
- https://bugs.webkit.org/show_bug.cgi?id=31952
+ Reviewed by Kenneth Rohde Christiansen.
- The mailing list is open for anyone to subscribe.
+ [Qt] Web Inspector: Remote Web Inspector support for QtWebKit
+ https://bugs.webkit.org/show_bug.cgi?id=43988
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/commands/queues.py:
+ Runs a web debug server on port specified by QtTestBrowser
+ argument -remote-inspector-port. Property
+ _q_webInspectorServerPort of the QWebPage instance will be set
+ according to the argument. All pages with that property set will
+ be remotely inspectable.
-2009-11-28 Adam Barth <abarth@webkit.org>
+ URL for remote inspection of first QWebPage is
+ http://localhost:9222/webkit/inspector/inspector.html?page=1
+ where 1 is the number of the QWebPage instance.
- Reviewed by Eric Seidel.
+ The base URL yields an index page with links to the individual inspectors:
+ http://localhost:9222/
- [bzt] style-queue should report style errors to bugzilla
- https://bugs.webkit.org/show_bug.cgi?id=31945
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::init):
+ * QtTestBrowser/launcherwindow.h:
+ * QtTestBrowser/main.cpp:
+ (LauncherApplication::handleUserOptions):
- Currently, we're just logging the style errors locally. With this
- patch we'll actually log the errors to bugzilla. Note: I plan to run
- with the "local-only" logging during development.
+2010-09-22 Adam Roben <aroben@apple.com>
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/scm.py:
+ Fix webkit-patch failure-reason now that build.webkit.org has been
+ updated
-2009-11-28 Adam Barth <abarth@webkit.org>
+ Fixes <http://webkit.org/b/46273> webkit-patch failure-reason crashes
+ every time
Reviewed by Eric Seidel.
- [bzt] style-queue shouldn't reject patches from the commit-queue
- https://bugs.webkit.org/show_bug.cgi?id=31944
+ * Scripts/webkitpy/common/net/buildbot.py:
+ (BuildBot._file_cell_text): Added. Travels down the firstChild chain
+ looking for an element that contains text, then returns it.
+ (BuildBot._parse_twisted_file_row): Use _file_cell_text to get the
+ text out of the cells. This way it doesn't matter whether the cells
+ have <b> children (as for cells in directory rows) or not (as for
+ cells in file rows)
+ (BuildBot._parse_twisted_directory_listing): Look for rows that have
+ the "directory" or "file" class, rather than rows with any class,
+ since header rows now have a class attribute.
- Currently the style-queue subprocess gets confused and thinks its the
- commit-queue. If the patch has an error, it rejects it from the
- commit-queue. Instead, we should have style-queue specific logic.
- This patch doesn't add that logic, but it gives us a callback we can
- use to add that logic.
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ (BuildBotTest._example_directory_listing): Updated to more closely
+ match the markup that build.webkit.org is producing now.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/landingsequence.py:
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
-2009-11-27 Adam Barth <abarth@webkit.org>
+ Unreviewed, build fix.
- Rubber stamped by Eric Seidel.
+ new-run-webkit-tests: fix bug introduced in r68008 where if you
+ specify --chromium and no --platform, and you're running on
+ windows, you use the 'chromium-win' port by default instead of the
+ version-specific port. This breaks the buildbots.
- Rename CommitQueueStatus to QueueStatusServer to allow for more queues.
+ It will be good for this refactoring to settle down so I can
+ rewrite the logic for default ports and the unit tests to be
+ clearer (and the testing more comprehensive).
- * CommitQueueStatus: Removed.
- * CommitQueueStatus/app.yaml: Removed.
- * CommitQueueStatus/filters: Removed.
- * CommitQueueStatus/filters/__init__.py: Removed.
- * CommitQueueStatus/filters/webkit_extras.py: Removed.
- * CommitQueueStatus/index.html: Removed.
- * CommitQueueStatus/index.yaml: Removed.
- * CommitQueueStatus/queue_status.py: Removed.
- * CommitQueueStatus/stylesheets: Removed.
- * CommitQueueStatus/stylesheets/main.css: Removed.
- * CommitQueueStatus/update_status.html: Removed.
- * QueueStatusServer: Copied from WebKitTools/CommitQueueStatus.
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
-2009-11-27 Adam Barth <abarth@webkit.org>
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Adam Barth.
- style-queue should only process each patch once
- https://bugs.webkit.org/show_bug.cgi?id=31939
+ Modify the Port interface to take only a series of keyword arguments
+ in the constructor, and modify Port/factory.get() to accomodate that,
+ and to accept user=XXX as an argument so we can pass
+ webkitpy.common.system.user.User objects in.
- Actually address reviewer comments!
+ Then, modify new-run-webkit-tests and rebaseline-chromium-webkit-tests
+ to use the common routine in webkitpy.common.system.user.open_url()
+ to display HTML files.
- * Scripts/bugzilla-tool:
+ There was a routine in the Port interface to do the same thing,
+ but I see no need for a port-specific hook for this, since it is
+ something that will always be executed by the host environment
+ and displaying web pages has nothing to do with running layout tests.
-2009-11-27 Adam Barth <abarth@webkit.org>
+ Note that new-run-webkit-tests used to use test_shell to display
+ the page; this is potentially useful so that you can actually click
+ from a result to the broken page; however, since DumpRenderTree
+ doesn't support this functionality, it will be going away eventually.
- Reviewed by Eric Seidel.
+ https://bugs.webkit.org/show_bug.cgi?id=46128
- [bzt] style-queue fails to apply a bunch of patches for no reason
- https://bugs.webkit.org/show_bug.cgi?id=31942
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/gtk.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/win.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- By passing --non-interactive to check-style, we convince check-style
- to pass --force to svn-apply, which lets it apply more patches.
+2010-09-21 Lucas De Marchi <lucas.demarchi@profusion.mobi>
- * Scripts/modules/commands/queues.py:
+ Reviewed by Kenneth Rohde Christiansen.
-2009-11-27 Adam Barth <abarth@webkit.org>
+ [EFL] Get fresh theme when running EWebLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=46210
+
+ If user tried to run EWebLauncher outside of the build tree, it would
+ not find the theme and fallback to the installed one. However, since
+ EWebLauncher is not installed, we always want to take the theme from
+ the just compiled source code. If user had never installed WebKit's
+ EFL port it could even receive a segv since no theme would be found.
+
+ Now EWebLauncher does not fallback to the installed theme and CMake
+ gives as DATA_DIR the directory of the theme it has just built.
+
+ * CMakeListsEfl.txt: Pass the build directory as DATA_DIR to
+ EWebLauncher.
+ * EWebLauncher/main.c: Use only the theme from build director. Do not
+ fallback to others as this could hide real bugs.
+ (quit):
+ (browserCreate):
+ (findThemePath):
+ (main):
- Reviewed by Eric Seidel.
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
- [bzt] Support --status-host in style-queue
- https://bugs.webkit.org/show_bug.cgi?id=31941
+ Unreviewed, build fix.
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/statusbot.py:
+ Don't pass the --test-shell arg to the Chromium Mac port of DRT;
+ it just confuses it.
-2009-11-27 Adam Barth <abarth@webkit.org>
+ https://bugs.webkit.org/show_bug.cgi?id=46230
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
- style-queue should only process each patch once
- https://bugs.webkit.org/show_bug.cgi?id=31939
+2010-09-21 Lucas Forschler <lforschler@apple.com>
- Before processing a patch, the try-queues now ask the web service
- whether they have already processed the patch. This is an initial cut
- of this functionality. I expect we're make it richer over time.
+ Reviewed by Stephanie Lewis.
- * Scripts/bugzilla-tool:
- * Scripts/modules/commands/queues.py:
- * Scripts/modules/patchcollection.py:
+ Make a new buildbot for Leopard Debug Test
-2009-11-27 Adam Barth <abarth@webkit.org>
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
- Reviewed by Eric Seidel.
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
- PatchStatus does not return status
- https://bugs.webkit.org/show_bug.cgi?id=31938
+ Unreviewed, build fix.
- We need to parse attachment_id as an int. Otherwise, we can't find
- anything in the datastore.
+ Fix breakage of Chromium Mac DRT port caused by r67905.
- * CommitQueueStatus/queue_status.py:
+ https://bugs.webkit.org/show_bug.cgi?id=46230
-2009-11-27 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
- Reviewed by Eric Seidel.
+2010-09-21 Dirk Pranke <dpranke@chromium.org>
- Make commit-queue status not throw an exception where there is not
- status
- https://bugs.webkit.org/show_bug.cgi?id=31936
+ Unreviewed, build fix.
- We need to actually fetch the results of the query to see what's in the
- datastore.
+ Add missing import of 'tempfile'.
- * CommitQueueStatus/queue_status.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
-2009-11-27 Adam Barth <abarth@webkit.org>
+2010-09-17 Dirk Pranke <dpranke@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Ojan Vafai.
- [bzt] unit test ApplyPatches and ApplyAttachment
- https://bugs.webkit.org/show_bug.cgi?id=31935
+ new-run-webkit-tests: pull the list of tests from the Port, and
+ make it possible to run with no actual test files in the filesystem.
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/download_unittest.py:
+ This set of changes allows us to delete the special
+ webkitpy/layout_tests/data directory and test the generic code without
+ touching the filesystem (except to write results). This speeds up
+ test-webkitpy substantially.
-2009-11-27 Adam Barth <abarth@webkit.org>
+ This also cleans up and removes several code paths in the generic
+ code and fixes some minor bugs, notably in the test_expectations
+ parsing, which was previously fragile if the tests weren't present.
- Reviewed by Eric Seidel.
+ We also change the way we diff image results to be able to do so
+ in memory, without relying on files. This slows down chromium
+ test_shell, which always writes images to files, but should speed
+ up DRT and ImageDiff-based implementations slightly.
- [bzt] Unit test download commands
- https://bugs.webkit.org/show_bug.cgi?id=31923
+ Note that pulling the list of tests to run from the Port will allow
+ ports to specify what tests to run as an inclusive list; previously
+ you could only do this as an exclusive list by using a
+ test_expectations file or Skipped files; nothing actually uses this
+ feature yet and it's unclear if it should be used.
- Adds download_unittest and fixes a bug found while testing.
+ Note that there are no functional changes -- apart from now
+ always printing out the location of the checksum file when we are
+ tracing test runs -- and the total number of lines of non-test code
+ actually drops by two.
- * Scripts/modules/commands/commandtest.py:
- * Scripts/modules/commands/download.py:
- Fixed a bug where we'd throw an error because [].append returns
- None.
- * Scripts/modules/commands/download_unittest.py: Added.
- * Scripts/modules/mock_bugzillatool.py:
- * Scripts/run-webkit-unittests:
+ There is some more cleanup that can be done in the Port/Driver
+ interface and in some handling of filenames, but I'll save that
+ for another change.
-2009-11-27 Adam Barth <abarth@webkit.org>
+ https://bugs.webkit.org/show_bug.cgi?id=45801
- Unreviewed "build" fix found while writing unit tests.
+ * Scripts/webkitpy/layout_tests/data/*: Removed.
+ - no longer need special mock layout_tests_directory in the
+ repository.
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ - add code to display missing text files, checksums when tracing
+ - update to not look at the filesystem directly.
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ - remove tests_are_present flag
+ - update with changes in Port interface - no longer access
+ the filesystem directly, although we still use os.path for
+ filename manipulation.
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/layout_package/test_files.py: Removed.
+ - renamed to port/test_files.py
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - change diff_image() to expect actual image data, not filenames
+ - add expected_checksum(), expected_image(), expected_text() to
+ return the content of the files so that we don't need a filesystem
+ - add path_exists(), path_isdir() for filesystem-like access.
+ - add test_dirs() to keep clobber-test-results from needing to
+ actually look at a real layout tests dir
+ - add tests() to return the list of tests to run on the port
+ (calls port/test_files to do the work).
+ - add update_baseline() to be able to save new baselines
+ - add uri_to_test_name() from port/dryrun.py so we can easily check
+ filename_to_uri()
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - change diff_image() to accept image content, not filenames.
+ This will be slower for test_shell/image_diff, but faster
+ for DRT/ImageDiff.
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ - simplify greatly
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
+ - add more unit tests
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ - massive rewrite to use in-script list of tests and expectations
+ * Scripts/webkitpy/layout_tests/port/test_files.py:
+ - rename from layout_package/test_files.
+ * Scripts/webkitpy/layout_tests/port/test_files_unittest.py:
+ - add unit tests
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - update diff_image() to take image contents, not files. Should
+ make things slightly faster.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ - update with changes to diff_image()
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
+ - update with changes to diff_image()
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - remove tests_are_present from test_expectations
+ - pull the list of tests from port.tests() instead
+ of calling test_files.py directly.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ - update unit tests
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ - update with changes to
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ - update with change in Port interface
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ - update with change in Port interface
+ * Scripts/webkitpy/style/checkers/test_expectations.py:
+ - remove the tests_are_present flag
- * Scripts/modules/commands/download.py:
+2010-09-21 Anders Carlsson <andersca@apple.com>
-2009-11-27 Adam Barth <abarth@webkit.org>
+ Disable logging.
- Reviewed by Eric Seidel.
+ * MiniBrowser/mac/MiniBrowser_Prefix.pch:
- [bzt] Kill WebKitLandingScripts
- https://bugs.webkit.org/show_bug.cgi?id=31904
+2010-09-21 Tony Chang <tony@chromium.org>
- Step 6: Kill the rest.
+ Reviewed by Kent Tamura.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/commands/queries.py:
- * Scripts/modules/commands/upload.py:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/scm.py:
- * Scripts/modules/webkitlandingscripts.py: Removed.
+ add a script for running webkit_unit_tests
+ https://bugs.webkit.org/show_bug.cgi?id=46014
-2009-11-27 Adam Barth <abarth@webkit.org>
+ * Scripts/run-chromium-webkit-unit-tests: Added.
- Reviewed by Eric Seidel.
+2010-09-21 Fridrich Strba <fridrich.strba@bluewin.ch>
- [bzt] Unit test upload commands
- https://bugs.webkit.org/show_bug.cgi?id=31903
+ Reviewed by Martin Robinson.
- Adds unit tests for all but two of the upload commands. The two
- remaining ones are more difficult. I'll return to them later. The
- goal of these tests is just to run the commands. We can test more
- detailed behavior later.
+ Fix linking problems on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=45844
- * Scripts/modules/commands/commandtest.py:
- * Scripts/modules/commands/upload.py:
- * Scripts/modules/commands/upload_unittest.py:
- * Scripts/modules/mock.py: Added.
- * Scripts/modules/mock_bugzillatool.py:
+ * GNUmakefile.am: link the executables with winmm.dll
-2009-11-26 Adam Barth <abarth@webkit.org>
+2010-09-21 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- [bzt] Kill WebKitLandingScripts
- https://bugs.webkit.org/show_bug.cgi?id=31904
+ feeder-queue svn updates more often than needed
+ https://bugs.webkit.org/show_bug.cgi?id=46171
- Step 5: Kill run_and_throw_if_fail.
+ We don't need to poll SVN every time we feed the feeders. Rather, we
+ can count on the wrapper shell script to auto-update the queue.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/processutils.py: Added.
- * Scripts/modules/webkitlandingscripts.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
-2009-11-26 Adam Barth <abarth@webkit.org>
+2010-09-21 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
- Reviewed by Eric Seidel.
-
- [bzt] Kill WebKitLandingScripts
- https://bugs.webkit.org/show_bug.cgi?id=31904
-
- Step 4: Kill run_webkit_script.
+ Reviewed by Andreas Kling.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/webkitlandingscripts.py:
+ [Qt] Add robot loader timeout and extra time options.
+ https://bugs.webkit.org/show_bug.cgi?id=46172
-2009-11-26 Adam Barth <abarth@webkit.org>
-
- Reviewed by Eric Seidel.
+ [-robot-timeout <s>]: Load the next page after s seconds if the current
+ page didn't finish loading.
+ [-robot-extra-time <s>]: Wait s seconds after the current page finished
+ loading before loading the next one. This should allow some time for the
+ page's JavaScript to execute.
- [bzt] Kill WebKitLandingScripts
- https://bugs.webkit.org/show_bug.cgi?id=31904
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::applyPrefs):
+ * QtTestBrowser/main.cpp:
+ (LauncherApplication::robotTimeout):
+ (LauncherApplication::robotExtraTime):
+ (LauncherApplication::LauncherApplication):
+ (LauncherApplication::handleUserOptions):
+ (main):
+ * QtTestBrowser/urlloader.cpp:
+ (UrlLoader::UrlLoader):
+ (UrlLoader::loadNext):
+ (UrlLoader::loadUrlList):
+ * QtTestBrowser/urlloader.h:
- Step 3: Kill build_webkit.
+2010-09-21 Pavel Podivilov <podivilov@chromium.org>
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/webkitlandingscripts.py:
+ Unreviewed.
-2009-11-26 Adam Barth <abarth@webkit.org>
+ Adding myself to the committers list.
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/common/config/committers.py:
- [bzt] Kill WebKitLandingScripts
- https://bugs.webkit.org/show_bug.cgi?id=31904
+2010-09-20 Philippe Normand <pnormand@igalia.com>
- Step 2: Kill ensure_builders_are_green.
+ Reviewed by Eric Carlson.
- * Scripts/modules/buildsteps.py:
- * Scripts/modules/commands/download.py:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/webkitlandingscripts.py:
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
-2009-11-26 Adam Barth <abarth@webkit.org>
+ EventSender::contextClick() now returns an array of js
+ objects. Each object has a title property and a click() method.
- Reviewed by Eric Seidel.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (getMenuItemTitleCallback):
+ (setMenuItemTitleCallback):
+ (menuItemClickCallback):
+ (getMenuItemClass):
+ (contextClickCallback):
- [bzt] Kill WebKitLandingScripts
- https://bugs.webkit.org/show_bug.cgi?id=31904
+2010-09-20 Hayato Ito <hayato@chromium.org>
- Step 1: Kill prepare_clean_working_directory and run_webkit_tests.
+ Unreviewed.
+ Adding myself to the committers list.
- * Scripts/bugzilla-tool:
- * Scripts/modules/buildsteps.py: Added.
- * Scripts/modules/commands/download.py:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/webkitlandingscripts.py:
+ * Scripts/webkitpy/common/config/committers.py:
-2009-11-26 Zoltan Horvath <zoltan@webkit.org>
+2010-09-20 Adam Barth <abarth@webkit.org>
- Reviewed by Adam Barth.
+ Reviewed by Eric Seidel.
- Remove directory prefixes from linux commands
+ The tool member variable should be called _tool
+ https://bugs.webkit.org/show_bug.cgi?id=46160
- SCM unittests can cause errors on some systems if we use absolute reference to
- the commands, so directory prefixes have been removed.
+ Created by find-and-replace.
- * Scripts/modules/scm_unittest.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/openbugs.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/rebaseline.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/multicommandtool.py:
-2009-11-21 Holger Hans Peter Freyther <zecke@selfish.org>
+2010-09-20 Adam Barth <abarth@webkit.org>
- Reviewed by Kenneth Rohde Christiansen.
+ I ran the tests before landing but ignored the fact that they failed. :(
- Link DumpRenderTree to the Qt Ui Tools
- https://bugs.webkit.org/show_bug.cgi?id=31203
+ * Scripts/webkitpy/tool/commands/queues.py:
- Implement QWebPage::createPlugin using the Qt Ui Tools
- to be able to create classes like QProgressBar from within
- the <object></object> tags This is required for the
- new automatic test of Qt Plugins.
+2010-09-20 Adam Barth <abarth@webkit.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::createPlugin):
- * DumpRenderTree/qt/DumpRenderTree.h:
- * DumpRenderTree/qt/DumpRenderTree.pro:
+ Reviewed by Eric Seidel.
-2009-11-25 Yuzo Fujishima <yuzo@google.com>
+ Add a feeder queue that polls bugs.webkit.org for the commit-cluster
+ https://bugs.webkit.org/show_bug.cgi?id=46141
- Reviewed by Eric Seidel.
+ The feeder-queue polls bugs.webkit.org every 30 seconds and updates the
+ list of work items on the status server. The individual commit-cluster
+ nodes then grab the patches from the server and process them.
- Update pywebsocket to 0.4.2
+ * Scripts/webkitpy/tool/bot/feeders.py: Added.
+ * Scripts/webkitpy/tool/bot/feeders_unittest.py: Added.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
- Update pywebsocket to 0.4.2
- https://bugs.webkit.org/show_bug.cgi?id=31861
+2010-09-20 Leandro Pereira <leandro@profusion.mobi>
- * pywebsocket/example/echo_client.py:
- * pywebsocket/example/echo_wsh.py:
- * pywebsocket/mod_pywebsocket/__init__.py:
- * pywebsocket/mod_pywebsocket/dispatch.py:
- * pywebsocket/mod_pywebsocket/msgutil.py:
- * pywebsocket/mod_pywebsocket/standalone.py:
- * pywebsocket/setup.py:
- * pywebsocket/test/test_dispatch.py:
- * pywebsocket/test/test_msgutil.py:
+ Reviewed by Darin Adler.
-2009-11-25 Adam Barth <abarth@webkit.org>
+ build-webkit: Add support for CMake build system
+ https://bugs.webkit.org/show_bug.cgi?id=44979
- Reviewed by Eric Seidel.
+ * Scripts/build-webkit: Add "--efl" command-line option to build the
+ EFL port of WebKit.
+ * Scripts/webkitdirs.pm: Define buildCMakeProject() and
+ buildEflCMakeProject() subroutines.
- Add unit test for mark-fixed
- https://bugs.webkit.org/show_bug.cgi?id=31896
+2010-09-20 Dirk Pranke <dpranke@chromium.org>
- * Scripts/modules/commands/commandtest.py: Added.
- * Scripts/modules/commands/queries_unittest.py:
- * Scripts/modules/commands/upload_unittest.py: Added.
- * Scripts/modules/mock_bugzillatool.py:
- * Scripts/run-webkit-unittests:
+ Reviewed by Ojan Vafai.
-2009-11-25 Adam Barth <abarth@webkit.org>
+ new-run-webkit-tests: refactor command line args getting passed to DRT
- Reviewed by Eric Seidel.
+ This change cleans up some argument parsing between functions to get
+ rid of some overlapping data structures. There should be no functional
+ changes in this patch; it is pure refactoring in preparation for
+ landing the Chrome GPU port and adding a generic way to pass
+ args to DRT/TestShell.
- bugzilla-tool should have a mark-fixed command
- https://bugs.webkit.org/show_bug.cgi?id=31853
+ https://bugs.webkit.org/show_bug.cgi?id=46135
- Pretty simple stuff.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - pass the options argument explicitly to the threads and drivers,
+ also consolidate the passing of options to the driver.
+ - pass options directly to process_output() to remove a couple
+ parameters (minor cleanup).
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - pass the options argument to Port.create_driver().
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ - update Port.create_driver() test
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - pass the options argument to Port.create_driver(), and clean up
+ building of the cmd line for DRT.
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ - pass the options argument to Port.create_driver()
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ - pass the options argument to Port.create_driver()
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - pass the options argument to Port.create_driver(), and clean up
+ building of the cmd line for DRT.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - consolidate args in _get_dump_render_tree_args and rename to
+ _get_test_args(); move all of the command-line args to the
+ Port implementations.
+
+2010-09-20 Andrew Wilson <atwilson@chromium.org>
+
+ Revert change which was accidentally committed along with some expectation changes.
- * Scripts/modules/commands/upload.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
-2009-11-25 Eric Seidel <eric@webkit.org>
+2010-09-20 Mihai Parparita <mihaip@chromium.org>
Reviewed by Adam Barth.
- 'bugzilla-tool help' should only show common commands like how 'git help' does
- https://bugs.webkit.org/show_bug.cgi?id=31772
-
- I also took this opportunity to make 'help' a real Command.
- Making 'help' a real command required adding Command.tool (which we've wanted to do for a while).
-
- * Scripts/bugzilla-tool:
- - change should_show_command_help to should_show_in_main_help
- * Scripts/modules/commands/download.py:
- - Mark commands as being shown in main help or not.
- - show_in_main_help = False is not required (default is false),
- but it seemed to make the commands more self-documenting.
- * Scripts/modules/commands/queries.py: ditto
- * Scripts/modules/commands/queues.py: ditto
- * Scripts/modules/commands/upload.py: ditto
- * Scripts/modules/multicommandtool.py:
- - Make Command hold a pointer to tool in self.tool. Most Command
- subclasses do not take advantage of this yet, but it was required
- for HelpCommand to be able to reach the tool from _help_epilog().
- - Move MultiCommandTool._standalone_help_for_command to Command.standalone_help
- - Move MultiCommandTool._help_epilog to Command._help_epilog
- - Move "help" logic into HelpCommand.execute()
- - Change should_show_command_help to should_show_in_main_help and add a default implementation.
- * Scripts/modules/multicommandtool_unittest.py:
- - Test hiding of Commands in --help, and that all commands are shown in 'help --all-commands'
-
-2009-11-25 Brian Weinstein <bweinstein@apple.com>
-
- Reviewed by Dan Bernstein.
+ Add explicit --force-patch flag to webkitpy tools
+ https://bugs.webkit.org/show_bug.cgi?id=46103
- Patch by Mark Rowe.
+ It wasn't obvious until I read the applypatch.py source code that
+ --non-interfactive implies passing --force to patch. Add --force-patch
+ as an alias to the flag, so that this behavior is more discoverable.
- The buildbots are failing on Windows because when they were upgraded
- to 4.0.4, Apple Application Support was not in their path. Add it to
- the path to fix the buildots.
+ * Scripts/webkitpy/tool/steps/applypatch.py:
+ * Scripts/webkitpy/tool/steps/options.py:
- * Scripts/webkitdirs.pm:
+2010-09-20 Eric Seidel <eric@webkit.org>
-2009-11-25 Csaba Osztrogonác <ossy@webkit.org>
+ Unreviewed, adding a line which got dropped and is trivially correct (and tested).
- Reviewed by David Kilzer.
+ commit-queue can't land patches
+ https://bugs.webkit.org/show_bug.cgi?id=46138
- run-webkit-tests doesn't accept directories/files with --skipped=only parameter
- https://bugs.webkit.org/show_bug.cgi?id=31799
+ Add a line of code I forgot in my last commit.
- * Scripts/run-webkit-tests: Fixed.
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
-2009-11-25 Zoltan Horvath <zoltan@webkit.org>
+2010-09-20 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
- Change run_command to give back stderr by default
- https://bugs.webkit.org/show_bug.cgi?id=31734
+ The commit-cluster bots still race to lock patch_ids
+ https://bugs.webkit.org/show_bug.cgi?id=46130
- Change run_command to give back stderr by default.
- Set run_commands's 'svn-create-patch' calling to put only the stdout into the patches.
- Change the related unittest call.
+ It turns out we need to use a transaction object to make the
+ read/modify/write lock operation atomic. From reading the AppEngine
+ documentation, I think this patch should do what we want. It's hard to
+ test locally because the test instance isn't distributed in the same
+ way the production instance is.
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py:
+ * QueueStatusServer/handlers/nextpatch.py:
+ * QueueStatusServer/model/activeworkitems.py: Added.
-2009-11-25 Eric Seidel <eric@webkit.org>
+2010-09-20 Andy Estes <aestes@apple.com>
Reviewed by Adam Barth.
- Centralize required argument parsing in Command
- https://bugs.webkit.org/show_bug.cgi?id=31872
+ REGRESSION (HTML5 Parser): Pages broken due to <tag<tag> parsing changes
+ https://bugs.webkit.org/show_bug.cgi?id=40961
- * Scripts/modules/commands/download.py: remove custom required arg message.
- * Scripts/modules/commands/upload.py: ditto.
- * Scripts/modules/multicommandtool.py:
- - Add _parse_required_arguments.
- - Pass program name off to OptionParser.
- - Add name() for access to tool name.
- - Add check_arguments_and_execute and make it return a return code.
- - Replace a couple uses of + with %.
- * Scripts/modules/multicommandtool_unittest.py: test _parse_required_arguments
+ Implement WebKitUsePreHTML5ParserQuirks preference.
-2009-11-25 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues): Reset WebKitUsePreHTML5ParserQuirks
+ to false after a test finishes.
- Reviewed by Adam Barth.
+2010-09-20 Adam Roben <aroben@apple.com>
- Abstract out capturing stdout/stderr into a new OutputCapture class for re-use among the various unit tests.
- https://bugs.webkit.org/show_bug.cgi?id=31870
+ Windows build fix
- * Scripts/modules/commands/queries_unittest.py: Use the new class.
- * Scripts/modules/multicommandtool_unittest.py: Ditto.
- * Scripts/modules/outputcapture.py: Added.
+ * MiniBrowser/Configurations/MiniBrowserCommon.vsprops: Put
+ $(WebKitOutputDir)\include before $(WebKitLibrariesDir)\include so
+ we'll pick up the most recent versions of the headers.
-2009-11-24 Dmitry Titov <dimich@chromium.org>
+2010-09-20 Eric Seidel <eric@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Adam Barth.
- Add ENABLE_SHARED_SCRIPT feature define and flag for build-webkit
- https://bugs.webkit.org/show_bug.cgi?id=31444
+ commit-queue should check commit-queue+ again just before committing
+ https://bugs.webkit.org/show_bug.cgi?id=32679
- * Scripts/build-webkit:
+ Added a _revalidate_patch check, right before landing.
-2009-11-24 Chris Marrin <cmarrin@apple.com>
+ Since _revalidate_patch passes the patch_id from the work item
+ back to bugzilla, I had to fix all of the previous queue tests to
+ use valid attachment ids (that's the majority of this change).
- Reviewed by Simon Fraser.
+ In order to validate that the bug was still open, I had to teach
+ bugzilla.Bug about open/closed states.
- Changes the way 3D_RENDERING and ACCELERATED_COMPOSITING related tests are excluded
- https://bugs.webkit.org/show_bug.cgi?id=27314
-
- Now the script allows the directories with these tests to be included on all
- platforms but Mac, where they behave the same as always. For all other platforms
- the tests need to be excluded using the Skipped files, which is currently done
- for all platforms (including win since we're not turned on yet)
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- * Scripts/webkitdirs.pm:
+2010-09-20 Mihai Parparita <mihaip@chromium.org>
-2009-11-24 Eric Seidel <eric@webkit.org>
+ Unreviewed.
- Reviewed by Adam Barth.
+ Adding myself as a comitter.
- queries_unittest.py should test command output
- https://bugs.webkit.org/show_bug.cgi?id=31845
+ * Scripts/webkitpy/common/config/committers.py:
- * Scripts/modules/commands/queries_unittest.py:
- - Capture stdout and stderr and compare with expected strings.
+2010-09-20 Adam Barth <abarth@webkit.org>
-2009-11-24 Simon Fraser <simon.fraser@apple.com>
+ Reviewed by Eric Seidel.
- No Review.
+ Two instances of commit-queue try to process the same patch
+ https://bugs.webkit.org/show_bug.cgi?id=46113
- Fix spelling error ("depenedencies").
+ This patch makes next-patch atomic so that the server won't vend the
+ same patch twice in the same hour.
- * Scripts/build-webkit:
+ * QueueStatusServer/handlers/nextpatch.py:
-2009-11-24 Mark Rowe <mrowe@apple.com>
+2010-09-20 Adam Roben <aroben@apple.com>
- Land the configuration that includes the two debug GTK Linux builders.
+ Make WebKitTestRunner's wait-to-dump watchdog timer work on Windows
- * BuildSlaveSupport/build.webkit.org-config/config.json:
+ We were previously trying to use a CFRunLoopTimer, but since Windows
+ doesn't use CFRunLoop on most threads this doesn't work. Now we use a
+ Windows-style timer on Windows.
-2009-11-24 David Kilzer <ddkilzer@apple.com>
+ I also replaced all uses of "watchdog" with "watchdog timer".
- <http://webkit.org/b/31840> bisect-builds broke after r50080
+ Fixes <http://webkit.org/b/46101> WebKitTestRunner's wait-to-dump
+ watchdog timer doesn't work on Windows
- Reviewed by Dan Bernstein.
+ Reviewed by Anders Carlsson.
- * Scripts/bisect-builds:
- (mountAndRunNightly): Switched back to using backticks to run
- the hdiutil command since exec() will terminate the existing
- script, which is not what we want. Store the output of
- File::Spec->devnull() in a variable for use in the hdiutil
- detach commands.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::dump): Updated for rename.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: Removed
+ platform-specific functions.
+ (WTR::LayoutTestController::LayoutTestController): Added call to
+ platformInitialize.
+ (WTR::LayoutTestController::waitUntilDone): Changed to call
+ initializeWaitToDumpWatchdogTimerIfNeeded instead of doing the work
+ right in this function.
+ (WTR::LayoutTestController::waitToDumpWatchdogTimerFired): Updated for
+ rename.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Added new
+ members needed to support the watchdog timer abstraction. Replaced
+ some "watchdog"s with "watchdog timer".
+
+ * WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm:
+ Added.
+ (WTR::LayoutTestController::platformInitialize): Does nothing on this
+ platform.
+ (WTR::LayoutTestController::invalidateWaitToDumpWatchdog): Moved here
+ from LayoutTestController.cpp and changed to use an early return.
+ (WTR::waitUntilDoneWatchdogTimerFired): Moved here from
+ LayoutTestController.cpp.
+ (WTR::LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded):
+ Moved code here from LayoutTestController::waitUntilDone and changed
+ to use an early return.
+
+ * WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp:
+ Added.
+ (WTR::LayoutTestController::platformInitialize): Initialize our
+ watchdog timer.
+ (WTR::LayoutTestController::invalidateWaitToDumpWatchdog): Added.
+ Kills and clears the watchdog timer.
+ (WTR::waitToDumpWatchdogTimerFired): Added. Calls through to the
+ LayoutTestController member function of the same name.
+ (WTR::LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded):
+ Added. Sets up the timer if it isn't already set.
+
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Added
+ LayoutTestControllerMac.mm.
-2009-11-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+ * WebKitTestRunner/win/InjectedBundle.vcproj: Added
+ LayoutTestControllerWin.cpp.
- Reviewed by Kenneth Rohde Christiansen.
+2010-09-20 Martin Robinson <mrobinson@igalia.com>
- Include "config.h" to meet Coding Style Guidelines
- https://bugs.webkit.org/show_bug.cgi?id=31792
+ Reviewed by Daniel Bates.
- * DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp:
- * DumpRenderTree/qt/jsobjects.cpp:
- * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
+ [GTK] fast/forms/listbox-selection.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=45942
-2009-11-23 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+ Use the gdkModifersFromJSValue helper to parse all appropriate modifier
+ strings in keyDownCallback.
- Reviewed by Oliver Hunt.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (keyDownCallback): Use the gdkModifersFromJSValue instead of duplicating the
+ modifier parsing logic.
- Implement new required function to pass test we used to pass. This
- change is required since r51294.
+2010-09-19 Sam Weinig <sam@webkit.org>
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+ Reviewed by Anders Carlsson.
-2009-11-23 Jakub Wieczorek <faw217@gmail.com>
+ WebKit2 decidePolicyForNavigationAction should include mouse button information
+ <rdar://problem/8413165>
+ https://bugs.webkit.org/show_bug.cgi?id=46060
- Reviewed by Kenneth Rohde Christiansen.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (decidePolicyForNavigationAction):
+ (decidePolicyForNewWindowAction):
- [Qt] DRT: dumpBackForwardList() does not work properly with non-file URLs.
- https://bugs.webkit.org/show_bug.cgi?id=31775
+2010-09-19 Daniel Bates <dbates@rim.com>
- LayoutTestController::dumpBackForwardList() should work with local URLs
- as well as with normal URLs (in http tests for instance).
- Currently it does not output the latter properly.
+ Reviewed by Martin Robinson.
- Unskip a bunch of passing http/navigation tests.
+ Add unit tests for diffs that delete or modify a change log entry
+ or describe changes that are far apart
+ https://bugs.webkit.org/show_bug.cgi?id=46046
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::dumpHistoryItem):
+ Add additional unit tests to test change log diffs that contain
+ deletions or changes that are far apart from each other in the
+ ChangeLog file.
-2009-11-22 Chris Fleizach <cfleizach@apple.com>
+ * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl:
+ - Added the following unit tests:
+ "fixChangeLogPatch: [no change] In-place change."
+ "fixChangeLogPatch: [no change] Remove first entry."
+ "fixChangeLogPatch: [no change] Remove entry in the middle."
+ "fixChangeLogPatch: [no change] Far apart changes (i.e. more than one chunk)."
- Reviewed by Oliver Hunt.
+2010-09-19 Sam Weinig <sam@webkit.org>
- ARIA: support aria-flowto
- https://bugs.webkit.org/show_bug.cgi?id=31762
+ Reviewed by Anders Carlsson.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (ariaFlowToElementAtIndexCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::ariaFlowToElementAtIndex):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::ariaFlowToElementAtIndex):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::ariaFlowToElementAtIndex):
+ Replace WKBundleRangeRef with WKBundleRangeHandleRef.
+ https://bugs.webkit.org/show_bug.cgi?id=46054
-2009-11-22 Antonio Gomes <tonikitoo@webkit.org>
+ The new one acts like WKBundleNodeHandleRef and allows for getting a
+ wrapper in a specific world for the handle.
- Reviewed by Kenneth Christiansen.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::propertyValue):
+ (WTR::propertyValueDouble):
+ (WTR::propertyValueInt):
+ (WTR::numericWindowPropertyValue):
+ (WTR::toStr):
+ (WTR::InjectedBundlePage::shouldBeginEditing):
+ (WTR::InjectedBundlePage::shouldEndEditing):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ (WTR::InjectedBundlePage::shouldInsertText):
+ (WTR::InjectedBundlePage::shouldDeleteRange):
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::shouldApplyStyle):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
- [Qt] fast/history/back-forward-reset-after-error-handling.html failing due to WorkQueue not being un-frozen
- https://bugs.webkit.org/show_bug.cgi?id=31638
+2010-09-19 Kent Tamura <tkent@chromium.org>
- Unfreeze WorkQueue after each test execution.
+ Unreviewed. Fix WebGL test regressions by r67809.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ * DumpRenderTree/chromium/WebPreferences.cpp:
+ (WebPreferences::applyTo): Call setExperimentalWebGLEnabled().
-2009-11-22 Jakub Wieczorek <faw217@gmail.com>
+2010-09-19 Kent Tamura <tkent@chromium.org>
Reviewed by Adam Barth.
- [Qt] DumpRenderTree should explicitly ignore any SSL certificate errors
- for localhost and 127.0.0.1.
- https://bugs.webkit.org/show_bug.cgi?id=31783
-
- Unskip the http/tests/ssl/verify-ssl-enabled.php test, which is passing now.
+ [DRT/Chromium] Fix a WebSettings handling bug
+ https://bugs.webkit.org/show_bug.cgi?id=45945
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::NetworkAccessManager::NetworkAccessManager):
- (WebCore::NetworkAccessManager::sslErrorsEncountered):
- (WebCore::WebPage::WebPage):
- * DumpRenderTree/qt/DumpRenderTree.h:
+ Before this change, Chromium DRT reset WebSettings for every new
+ window. It was wrong.
+ If new window is not the first one, we have to apply the same
+ settings as the first window. So, we introduce WebPreference to
+ store the current settings, and apply it to new windows. It's same
+ as test_shell's behavior.
-2009-11-22 Chris Evans <cevans@chromium.org>
+ * DumpRenderTree/DumpRenderTree.gypi:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ Use WebPreferences instead of WebSettings.
+ (LayoutTestController::setUserStyleSheetEnabled):
+ (LayoutTestController::setUserStyleSheetLocation):
+ (LayoutTestController::setAuthorAndUserStylesEnabled):
+ (LayoutTestController::setPopupBlockingEnabled):
+ (LayoutTestController::disableImageLoading):
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ (LayoutTestController::setXSSAuditorEnabled):
+ (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+ (LayoutTestController::setAllowFileAccessFromFileURLs):
+ (LayoutTestController::overridePreference):
+ (LayoutTestController::setEditingBehavior):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings): Use WebPreferences.
+ (TestShell::runFileTest): ditto.
+ (TestShell::createNewWindow): Apply existing WebPreferences to a new WebView.
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::preferences):
+ (TestShell::applyPreferences):
+ * DumpRenderTree/chromium/WebPreferences.cpp: Added.
+ * DumpRenderTree/chromium/WebPreferences.h: Added.
+
+2010-09-18 Prasad Tammana <prasadt@chromium.org>
- Reviewed by Adam Barth.
+ Reviewed by David Levin.
- Disable access to file:/// directory listings
- https://bugs.webkit.org/show_bug.cgi?id=31329
+ update-webkit --chromium spitting out a spurious error
+ https://bugs.webkit.org/show_bug.cgi?id=45868
- Implemented setAllowUniversalAccessFromFileURLs to support testing of
- file URL security.
+ * Scripts/update-webkit-chromium: Use commandExists() function to check for existence of gclient.
- * DumpRenderTree/LayoutTestController.cpp:
- (setAllowUniversalAccessFromFileURLsCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setAllowUniversalAccessFromFileURLs):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::setAllowUniversalAccessFromFileURLs):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setAllowUniversalAccessFromFileURLs):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+2010-09-18 Sam Weinig <sam@webkit.org>
-2009-11-22 Jakub Wieczorek <faw217@gmail.com>
+ Reviewed by Dan Bernstein.
- Reviewed by Kenneth Rohde Christiansen.
+ Improve/unify the PageLoadClient interfaces
+ https://bugs.webkit.org/show_bug.cgi?id=46043
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (didStartProvisionalLoadForFrame):
+ (didReceiveServerRedirectForProvisionalLoadForFrame):
+ (didFailProvisionalLoadWithErrorForFrame):
+ (didCommitLoadForFrame):
+ (didFinishDocumentLoadForFrame):
+ (didFinishLoadForFrame):
+ (didFailLoadWithErrorForFrame):
+ (didReceiveTitleForFrame):
+ (didFirstLayoutForFrame):
+ (didFirstVisuallyNonEmptyLayoutForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didCommitLoadForFrame):
+ (WTR::InjectedBundlePage::didFinishLoadForFrame):
+ (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didReceiveTitleForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::didReceiveMessageFromInjectedBundle):
+ (WTR::TestController::didFinishLoadForFrame):
+ * WebKitTestRunner/TestController.h:
+
+2010-09-17 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Adding a shell script I use to run the
+ commit-queue. Now that multiple machines run the cq,
+ it makes sense to share the script between them.
+
+ * EWSTools/start-commit-queue.sh: Added.
+
+2010-09-17 Brian Weinstein <bweinstein@apple.com>
- [Qt] Fix the timeout of fast/frames/frame-navigation.html
- https://bugs.webkit.org/show_bug.cgi?id=31638
+ Reviewed by Jon Honeycutt.
- The test is timeouting, because it uses the WorkQueue to load a document in one
- of the child frames and once the loading is finished, the DRT does not dump the
- tree. This is because it waits for the QWebFrame::loadFinished() signal from
- the main frame, while it should connect to QWebPage::loadFinished().
+ The colors on the new build.webkit.org (after upgrading the master to 0.8.1) are
+ slightly harder to read, so this reverts the previous background colors for various
+ states, making it easier to read.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
+ * BuildSlaveSupport/build.webkit.org-config/public_html/default.css:
+ (.success):
+ (.failure):
+ (.warnings):
+ (.exception):
+ (.start,.running,td.building):
+ (.offline,td.offline):
-2009-11-21 Eric Seidel <eric@webkit.org>
+2010-09-17 Sheriff Bot <webkit.review.bot@gmail.com>
- Reviewed by Adam Barth.
+ Unreviewed, rolling out r67692.
+ http://trac.webkit.org/changeset/67692
+ https://bugs.webkit.org/show_bug.cgi?id=46011
- bugzilla-tool --help spews way too much text
- https://bugs.webkit.org/show_bug.cgi?id=31771
+ broke layout test dashboard (Requested by johnny_g on
+ #webkit).
- * Scripts/bugzilla-tool:
- - Remove self.cached_scm initialization hack.
- * Scripts/modules/buildbot.py:
- - Make default_host accessible to callers.
- * Scripts/modules/commands/download.py:
- - Phrase help for all commands consistently and remove spurious help text punctuation.
- * Scripts/modules/commands/queries.py: Ditto.
- * Scripts/modules/commands/queues.py: Ditto.
- * Scripts/modules/commands/upload.py: Ditto.
- * Scripts/modules/multicommandtool.py:
- - Add HelpPrintingOptionParser.format_epilog to replace
- NonWrappingEpilogIndentedHelpFormatter and allow us to lazily initialize
- per-command help (thus removing the need for the cached_scm hack in BugzillaTool).
- - Make --help only show a list of commands like "svn help" and "git help" do --
- previously --help was listing all commands and options.
- - Sort list of commands alphabetically.
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
-2009-11-21 Eric Seidel <eric@webkit.org>
+2010-09-17 Martin Robinson <mrobinson@igalia.com>
- No review. Fixing a typo from the previous patch for bug 31767.
+ Reviewed by Oliver Hunt.
- AbstractQueue.run_bugzilla_tool throws an exception
- https://bugs.webkit.org/show_bug.cgi?id=31769
+ Style bot complains about cairo forward declaration naming
+ https://bugs.webkit.org/show_bug.cgi?id=45867
- * Scripts/modules/commands/queues.py:
+ Exclude Cairo forward declarations from indentifiers with underscores checks.
-2009-11-21 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/style/checkers/cpp.py: Add exclusion for Cairo forward-declarations.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Add some tests for this.
- Reviewed by Adam Barth.
+2010-09-16 Kinuko Yasuda <kinuko@chromium.org>
- commit-queue fails to run with "permissions error" due to bad bugzilla-tool path
- https://bugs.webkit.org/show_bug.cgi?id=31767
+ Reviewed by Ojan Vafai.
- What we really want to test is BugzillaTool.path() instead of TrivialTool.path().
- Since we don't have a good way to test BugzillaTool pieces, I've
- left out a test for now.
+ Include detailed test modifiers (e.g. FLAKY) in results.json for failing non-layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=45408
- * Scripts/bugzilla-tool:
- - Add a path() implementation to expose bugzilla-tool's __file__ path to commit-queue.
- * Scripts/modules/commands/queues.py:
- - Use tool.path() instead of __file__.
- * Scripts/modules/multicommandtool.py:
- - Add a new path() method to MultiComandTool.
- * Scripts/modules/multicommandtool_unittest.py:
- - Provide a path() method. Little point in testing this mock implementation.
+ This change also tries to remove duplicated upload_results_json methods
+ in run_webkit_tests.py and json_results_generator.py.
-2009-11-21 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- Unreviewed "build" fix. Turns out I was testing the wrong copy of
- WebKitTools.
+2010-09-16 Antonio Gomes <tonikitoo@webkit.org>
- * Scripts/modules/commands/download.py:
+ Reviewed by Andreas Kling.
-2009-11-21 Adam Barth <abarth@webkit.org>
+ [Qt] When switching views (WebViewGraphicsBased <--> WebViewTraditional), QWebPage signals and QActions have to be re-set.
- Reviewed by Eric Seidel.
+ Recently r67554 changed the way different views use the WebPage class: it was previously being shared between
+ different views, but now for each view switch, a new WebPage class is constructed and set. Signals and QAction's
+ were not being set to the new WebPage though. Patch fix that, by re constructing the toolbar, and then re-hooking
+ all page specific stuff to the UI.
- Convert check-style to use LandingSequence
- https://bugs.webkit.org/show_bug.cgi?id=31763
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::initializeView):
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::buildUI):
+ (MainWindow::setPage):
+ * QtTestBrowser/mainwindow.h:
- Instead of manipulating the working copy by hand, we should use the
- LandingSequence in CheckStyle. This will make this code eaiser to
- test.
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
- * Scripts/modules/commands/download.py:
+ Reviewed by Andreas Kling.
-2009-11-20 Adam Barth <abarth@webkit.org>
+ Make all accesses to m_item (GraphicsWebView) done by WebViewGraphicsBased class happen though graphicsWebView getter method.
- Reviewed by Eric Seidel.
+ This patch is mostly a preparation for another commit, where the ownership of the m_item/GraphicsWebView
+ object will move to the qgraphicsscene instead of the qgraphicsview.
- Unit test query commands
- https://bugs.webkit.org/show_bug.cgi?id=31755
+ * QtTestBrowser/webview.cpp:
+ (WebViewGraphicsBased::setPage):
+ (WebViewGraphicsBased::setResizesToContents):
+ (WebViewGraphicsBased::resizeEvent):
+ (WebViewGraphicsBased::animatedFlip):
+ * QtTestBrowser/webview.h:
+ (WebViewGraphicsBased::setItemCacheMode):
+ (WebViewGraphicsBased::itemCacheMode):
- These tests are pretty rough, but hopefully they'll grow.
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
- * Scripts/modules/commands/queries_unittest.py: Added.
- * Scripts/modules/mock_bugzillatool.py: Added.
- * Scripts/run-webkit-unittests:
+ Reviewed by Andreas Kling.
-2009-11-20 Eric Seidel <eric@webkit.org>
+ Moved setYRotation method body out of the class (WebViewGraphicsBased) definition.
- Reviewed by Adam Barth.
+ We usually separate methods whose body are larger than a few lines from the class definition.
- Fix a bunch of unit test regressions from our recent bugzilla-toll hacking
- https://bugs.webkit.org/show_bug.cgi?id=31758
+ * QtTestBrowser/webview.h:
+ (WebViewGraphicsBased::yRotation):
+ (WebViewGraphicsBased::setYRotation):
- * Scripts/modules/multicommandtool.py:
- - Allow passing of explicit commands to MultiCommandTool.__init__
- * Scripts/modules/multicommandtool_unittest.py:
- - Use new Command.name naming system.
- - Test Command auto-discovery.
- * Scripts/modules/workqueue.py:
- - bug_id no longer exists, use patch['bug_id'] instead.
- * Scripts/modules/workqueue_unittest.py:
- - WorkQueues require names now.
- - should_proceed_with_work_item must return a patch object.
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
-2009-11-20 Chris Fleizach <cfleizach@apple.com>
+ Reviewed by Andreas Kling.
- Reviewed by Beth Dakin.
+ Make initializeView method of LauncherWindow private.
- WAI-ARIA: add support for aria-owns
- https://bugs.webkit.org/show_bug.cgi?id=31702
+ No one else needs to be able to call it but LauncherWindow.
+ Also moving the declation of isGraphicsBased method down in the same file, in order
+ to better group related methods.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (ariaOwnsElementAtIndexCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::ariaOwnsElementAtIndex):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::ariaOwnsElementAtIndex):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::ariaOwnsElementAtIndex):
+ * QtTestBrowser/launcherwindow.h:
-2009-11-20 Eric Seidel <eric@webkit.org>
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
- Reviewed by Adam Barth.
+ Reviewed by Andreas Kling.
- Fix exception thrown when running the commit-queue.
+ Make the getter 'page' method of MainWindow const.
- * Scripts/modules/statusbot.py: patch is optional.
- * Scripts/modules/workqueue.py: WorkQUeue requires a name.
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::page):
+ * QtTestBrowser/mainwindow.h:
-2009-11-20 Eric Seidel <eric@webkit.org>
+2010-09-12 Antonio Gomes <tonikitoo@webkit.org>
- Reviewed by Adam Barth.
+ Reviewed by Andreas Kling.
- Teach the StatusBot how to support more than just the commit-queue
- https://bugs.webkit.org/show_bug.cgi?id=31754
+ Remove useless parameter from MainWindow class' constructor.
- * Scripts/modules/workqueue.py: Another typo.
+ The parameter defaults to an empty URL and is not being used by any caller. Apart from that it is also
+ not referred in the constructor body and does not make much sense.
-2009-11-20 Eric Seidel <eric@webkit.org>
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::MainWindow):
+ * QtTestBrowser/mainwindow.h:
- Reviewed by Adam Barth.
+2010-09-15 Tony Chang <tony@chromium.org>
- Teach the StatusBot how to support more than just the commit-queue
- https://bugs.webkit.org/show_bug.cgi?id=31754
+ Reviewed by Kent Tamura.
- * Scripts/modules/commands/queues.py: Fix silly typo.
+ [Chromium] Needs DRT queueLoadHTMLString and setDeferMainResourceLoad-implementations
+ https://bugs.webkit.org/show_bug.cgi?id=42151
-2009-11-20 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (WorkItemLoadHTMLString::WorkItemLoadHTMLString):
+ (WorkItemLoadHTMLString::run):
+ (LayoutTestController::queueLoadHTMLString):
+ (LayoutTestController::reset):
+ (LayoutTestController::setDeferMainResourceDataLoad):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController::deferMainResourceDataLoad):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didCreateDataSource):
- Reviewed by Adam Barth.
+2010-09-16 Adrienne Walker <enne@google.com>
- Teach the StatusBot how to support more than just the commit-queue
- https://bugs.webkit.org/show_bug.cgi?id=31754
-
- * CommitQueueStatus/index.yaml:
- - Add indices required for the new queries.
- * CommitQueueStatus/queue_status.py:
- - Add a patch-status page and move update_status to update-status.
- - Only display "commit-queue" status records for the commit-queue.
- - Add support for a queue_name property on status records.
- - Fix _int_from_request to actually work.
- * CommitQueueStatus/update_status.html:
- - Add support for a queue_name on status records.
- - Remove unused list of bug ids.
- * Scripts/modules/commands/queues.py
- - Make the queues pass the patch instead of the bug_id to StatusBot.
- * Scripts/modules/statusbot.py:
- - Support passing the queue_name to the status updates.
- - Support fetching patch status with patch_status().
- * Scripts/modules/workqueue.py:
- - Pass the patch to the StatusBot instead of the bug_id.
- - Let WorkQueues have a name.
-
-2009-11-20 Adam Barth <abarth@webkit.org>
+ Reviewed by Kenneth Russell.
- Reviewed by Eric Seidel.
+ Add script to synchronize WebKit and Khronos WebGL tests
+ https://bugs.webkit.org/show_bug.cgi?id=42336
- Move bugzilla-tool commands into their own file
- https://bugs.webkit.org/show_bug.cgi?id=31752
+ * Scripts/update-webgl-conformance-tests: Added.
+ * Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py: Added.
+ * Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py: Added.
- This will let us write unit tests.
+2010-09-16 Sam Weinig <sam@webkit.org>
- * Scripts/bugzilla-tool:
- * Scripts/modules/commands/__init__.py: Added.
- * Scripts/modules/commands/download.py: Added.
- * Scripts/modules/commands/queries.py: Added.
- * Scripts/modules/commands/queues.py: Added.
- * Scripts/modules/commands/upload.py: Added.
- * Scripts/modules/grammar.py: Added.
+ Reviewed by Anders Carlsson.
-2009-11-20 Adam Barth <abarth@webkit.org>
+ Add support for sending synchronous messages from the InjectedBundle to the WKContext
+ <rdar://problem/8365320>
+ https://bugs.webkit.org/show_bug.cgi?id=44785
- Reviewed by Eric Seidel.
+ * MiniBrowser/mac/AppDelegate.m:
+ (didReceiveSynchronousMessageFromInjectedBundle):
+ (-[BrowserAppDelegate init]):
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (didCreatePage):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
- BuildQueue should check if the tree is currently buildable
- https://bugs.webkit.org/show_bug.cgi?id=31744
+2010-09-16 Leonid Ebril <leonid.ebril@nokia.com>
- * Scripts/bugzilla-tool:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/webkitlandingscripts.py:
+ Reviewed by Andreas Kling.
-2009-11-20 Adam Barth <abarth@webkit.org>
+ [Qt] QtTestBrowser: Disable creation of a new window for screenshot on Symbian platform.
+ https://bugs.webkit.org/show_bug.cgi?id=45885
- Reviewed by Eric Seidel.
+ Avoid creation of an additional window for screenshot to prevent overlapping with original window.
- Move prepare_clean_working_directory into the LandingSequence
- https://bugs.webkit.org/show_bug.cgi?id=31743
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::screenshot):
- * Scripts/bugzilla-tool:
- * Scripts/modules/landingsequence.py:
+2010-09-16 Anders Carlsson <andersca@apple.com>
-2009-11-20 Yael Aharon <yael.aharon@nokia.com>
+ Fix clang++ build.
- Reviewed by Kenneth Rohde Christiansen.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController zoomIn:]):
+ (-[BrowserWindowController zoomOut:]):
+ (-[BrowserWindowController resetZoom:]):
+ Remove trailing semicolons.
- NPN_ReloadPlugins does not reload the page even if reloadPages is true.
- https://bugs.webkit.org/show_bug.cgi?id=30460
+2010-09-16 Sheriff Bot <webkit.review.bot@gmail.com>
- Added code for calling NPN_ReloadPlugins with reloadPages true and false.
+ Unreviewed, rolling out r67628.
+ http://trac.webkit.org/changeset/67628
+ https://bugs.webkit.org/show_bug.cgi?id=45904
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
- (pluginInvoke):
+ broke the build (Requested by eric_carlson on #webkit).
-2009-11-20 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (contextClickCallback):
- Reviewed by Eric Seidel.
+2010-09-16 Balazs Kelemen <kbalazs@webkit.org>
- Pass the port information to the child process
- https://bugs.webkit.org/show_bug.cgi?id=31736
+ Unreviewed.
- We need to do this so the child process knows what to build!
+ Adding myself as a comitter.
- * Scripts/bugzilla-tool:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/webkitport.py:
- * Scripts/modules/webkitport_unittest.py:
+ * Scripts/webkitpy/common/config/committers.py:
-2009-11-20 Adam Barth <abarth@webkit.org>
+2010-09-15 Philippe Normand <pnormand@igalia.com>
- Reviewed by Eric Seidel.
+ Reviewed by Eric Carlson.
- Support Qt port in build-queue
- https://bugs.webkit.org/show_bug.cgi?id=31733
+ [GTK] enhanced context menu for media elements
+ https://bugs.webkit.org/show_bug.cgi?id=45021
- * Scripts/bugzilla-tool:
+ EventSender::contextClick() now returns an array of js
+ objects. Each object has a title property and a click() method.
-2009-11-20 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (getMenuItemTitleCallback):
+ (setMenuItemTitleCallback):
+ (menuItemClickCallback):
+ (getMenuItemClass):
+ (contextClickCallback):
- Reviewed by Eric Seidel.
+2010-09-14 Philippe Normand <pnormand@igalia.com>
- Implement a build-queue
- https://bugs.webkit.org/show_bug.cgi?id=31725
+ Reviewed by Eric Carlson and Martin Robinson.
- Currently this just builds the first 10 patches in the review queue.
- We'll want to do something smarter soon.
+ [GTK] eventSender.contextClick() should return the contents of the context menu
+ https://bugs.webkit.org/show_bug.cgi?id=39102
- * Scripts/bugzilla-tool:
+ Make the eventSender use the new private WebKitGtk+ API to
+ retrieve the context-menu item titles and store them in an array.
-2009-11-20 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (contextClickCallback):
- Reviewed by Eric Seidel.
+2010-09-16 Eric Uhrhane <ericu@chromium.org>
- Make commit-queue and style-queue show up in help
- https://bugs.webkit.org/show_bug.cgi?id=31724
+ Reviewed by Jian Li.
- We need to store their names on their class to make these commands
- properly register themselves with MultiCommandTool.
+ Unify FILE_SYSTEM and FILE_WRITER enables under the name FILE_SYSTEM.
+ https://bugs.webkit.org/show_bug.cgi?id=45798
- * Scripts/bugzilla-tool:
+ * Scripts/build-webkit:
-2009-11-20 Adam Barth <abarth@webkit.org>
+2010-09-16 Robert Hogan <robert@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Antonio Gomes.
- Implement bugzilla-tool build-attachment
- https://bugs.webkit.org/show_bug.cgi?id=31722
+ [Qt] Support globalhistory tests
+ https://bugs.webkit.org/show_bug.cgi?id=45774
- This command builds an attachment from bugzilla. It leaves the built
- patch in the working copy.
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::isGlobalHistoryTest):
+ (WebCore::DumpRenderTree::open):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::dumpHistoryCallbacks):
+ (LayoutTestController::removeAllVisitedLinks):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
- * Scripts/bugzilla-tool:
- * Scripts/modules/landingsequence.py:
- * Scripts/modules/webkitlandingscripts.py:
+2010-09-10 Tony Chang <tony@chromium.org>
-2009-11-20 Alejandro G. Castro <alex@igalia.com>
+ Reviewed by Eric Seidel.
- Reviewed by Xan Lopez.
+ deduplicate-tests should be runnable from any WebKit directory
+ https://bugs.webkit.org/show_bug.cgi?id=44709
- [GTK] DRT release event does not create the state correctly
- https://bugs.webkit.org/show_bug.cgi?id=31717
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
- * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+2010-09-15 Tony Chang <tony@chromium.org>
-2009-11-20 Eric Seidel <eric@webkit.org>
+ Reviewed by Kent Tamura.
- Reviewed by Adam Barth.
+ [chromium] sort testing methods in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=45850
- MultiCommandTool should find Command objects automatically instead of with a manual list
- https://bugs.webkit.org/show_bug.cgi?id=31710
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::EventSender):
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::TextInputController):
- * Scripts/bugzilla-tool:
- * Scripts/modules/multicommandtool.py:
- - Use some wild python-fu to crawl all the known subclasses of Command.
+2010-09-15 Mihai Parparita <mihaip@chromium.org>
-2009-11-20 Adam Barth <abarth@webkit.org>
+ Reviewed by Adam Barth.
- Unreviewed "build" fix. Added missing import.
+ CQ status shows items out of order
+ https://bugs.webkit.org/show_bug.cgi?id=45846
+
+ Only group consecutive status items with the same patch ID into the same
+ group, so that overall item ordering is preserved.
+
+ Also don't indent status items that only have a single item in their
+ group.
- * Scripts/bugzilla-tool:
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/templates/includes/singlequeuestatus.html: Added.
+ * QueueStatusServer/templates/queuestatus.html:
-2009-11-20 Adam Barth <abarth@webkit.org>
+2010-09-15 Eric Seidel <eric@webkit.org>
- Unreviewed "build" fix. I failed to update LandingSequence.test
- properly.
+ Reviewed by Adam Barth.
- * Scripts/modules/landingsequence.py:
+ Add queue start/stop messages
+ https://bugs.webkit.org/show_bug.cgi?id=45853
-2009-11-20 Adam Barth <abarth@webkit.org>
+ I ended up needing to clean up a bunch of our unit testing
+ in order to test this new code path nicely.
- Reviewed by Eric Seidel.
+ There are also a few PEP8 changes needed to pass check-webkit-style.
- Create LandingSequence as the all-sing, all-dance landing class
- https://bugs.webkit.org/show_bug.cgi?id=31709
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
- Client can inherit from this class to carefully control exactly which
- steps they wish to have happen in the landing sequence.
+2010-09-15 Simon Fraser <simon.fraser@apple.com>
- * Scripts/bugzilla-tool:
- * Scripts/modules/landingsequence.py: Added.
- * Scripts/modules/webkitlandingscripts.py: Added.
+ https://bugs.webkit.org/show_bug.cgi?id=45849
+ WKURLCreateWithCFURL crashes with null url
+
+ Fix MiniBrowser crash when the url is not parseable.
-2009-11-19 Adam Barth <abarth@webkit.org>
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController fetch:]):
- Reviewed by Eric Seidel.
+2010-09-15 Patrick Gansterer <paroga@paroga.com>
- Abstract AbstractPatchProcessingCommand from AbstractPatchLandingCommand
- https://bugs.webkit.org/show_bug.cgi?id=31707
+ Unreviewed.
- This is to help when we implement build-attachment.
+ Adding myself to the committers list.
- * Scripts/bugzilla-tool:
+ * Scripts/webkitpy/common/config/committers.py:
-2009-11-19 Adam Barth <abarth@webkit.org>
+2010-09-14 Eric Seidel <eric@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Adam Barth.
- Support Qt port in bugzilla-tool
- https://bugs.webkit.org/show_bug.cgi?id=31701
+ Make it possible to run more than one commit-queue instance
+ https://bugs.webkit.org/show_bug.cgi?id=45786
- Now we support building with Qt!
+ Mostly we need to make sure the two (or more) instances get
+ different patches to work on. To do this, I re-worked
+ the code responsible for getting the next work item to
+ round trip through the status server. The status server only
+ vends patches from the work items list, only if those patches
+ have not had status reported for them in the last hour.
- * Scripts/bugzilla-tool:
- * Scripts/modules/webkitport.py: Added.
- * Scripts/modules/webkitport_unittest.py: Added.
- * Scripts/run-webkit-unittests:
+ This is another step towards making all queues go through the
+ status server, thus making it possible to run more than one
+ instance of various EWS bots (as requested in bug 44292).
-2009-11-19 Zoltan Horvath <zoltan@webkit.org>
+ The webkitpy changes are already covered by existing unit tests.
+ The QueueStatusSever sadly has no testing infrastructure yet. :(
- Reviewed by Adam Barth.
+ * QueueStatusServer/handlers/nextpatch.py: Added.
+ * QueueStatusServer/index.yaml:
+ * QueueStatusServer/main.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
- Remove inserting stderr into patch in bugzilla-tool
- https://bugs.webkit.org/show_bug.cgi?id=29914
+2010-09-15 Mihai Parparita <mihaip@chromium.org>
- Modify SCM python module's run_command function to avoid return of stderr
- by default, so stderr won't be inserted into the patches.
- Modify the related unit test.
+ Reviewed by Tony Chang.
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py:
+ NRWT fails with UnicodeDecodeError on editing/selection/mixed-editability-10.html
+ https://bugs.webkit.org/show_bug.cgi?id=45791
-2009-11-19 Eric Seidel <eric@webkit.org>
+ Force filenames to be raw bytes before running difflib.unified_diff.
- Reviewed by Adam Barth.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
- bugzilla-tool needs per-command help
- https://bugs.webkit.org/show_bug.cgi?id=31697
+2010-09-15 Simon Hausmann <simon.hausmann@nokia.com>
- Added support for "bugzilla-tool help command-name"
- and a unit test to make sure it works.
+ Reviewed by Tor Arne Vestbø.
- * Scripts/modules/multicommandtool.py:
- * Scripts/modules/multicommandtool_unittest.py:
+ [Qt] QtTestBrowser crashes when enabling QGraphicsView mode after first loading page without it enabled
+ https://bugs.webkit.org/show_bug.cgi?id=35247
-2009-11-19 Eric Seidel <eric@webkit.org>
+ The main issue when changing the views is that the plugins and any other components that
+ depend on view specific attributes such as the native window id are not teared down.
+ Even if we had a tear-down procedure, we'd have to re-initialize the plugin after
+ switching to the new view (QGraphicsWebView). This is a rather uncommon situation, so
+ we decided to work around this in QtTestBrowser by making toggling between QWebView
+ and QGraphicsWebView also re-create the page.
- Reviewed by Adam Barth.
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::initializeView):
+ * QtTestBrowser/mainwindow.h:
- Move MultiCommandTool and Command into a separate file and add some basic unit tests
- https://bugs.webkit.org/show_bug.cgi?id=31695
+2010-09-14 Mihai Parparita <mihaip@chromium.org>
- * Scripts/bugzilla-tool:
- * Scripts/modules/multicommandtool.py: Added.
- * Scripts/modules/multicommandtool_unittest.py: Added.
- * Scripts/run-webkit-unittests:
+ Reviewed by Adam Barth.
-2009-11-19 Eric Seidel <eric@webkit.org>
+ Send webkit accessibility notifications to Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45156
- No review, just adding a FIXME.
+ Move printf inside shouldDumpAccessibilityNotifications check.
- Split out command parsing and help printing from BugzillaTool
- https://bugs.webkit.org/show_bug.cgi?id=31688
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::postAccessibilityNotification):
- * Scripts/bugzilla-tool: Add an extra comment about current design failures.
+2010-09-14 Tony Chang <tony@chromium.org>
-2009-11-19 Eric Seidel <eric@webkit.org>
+ Reviewed by Kent Tamura.
- Reviewed by Adam Barth.
+ [chromium] fix http/tests/security/local-user-CSS-from-remote.html
+ https://bugs.webkit.org/show_bug.cgi?id=45788
- Split out command parsing and help printing from BugzillaTool
- https://bugs.webkit.org/show_bug.cgi?id=31688
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setUserStyleSheetLocation): use a base64 url like in Chrome
- * Scripts/bugzilla-tool:
- - Add new MultiCommandTool class to contain option parsing and help printing logic.
- - Rename private methods to use _ pattern.
- - MultiCommandTool has two abstract methods should_show_command_help and should_execute_command.
- -
+2010-09-14 Tony Chang <tony@chromium.org>
-2009-11-19 Eric Seidel <eric@webkit.org>
+ Reviewed by Ojan Vafai.
- Reviewed by Adam Barth.
+ [chromium] Remove WebKit::areLayoutTestImagesOpaque since it's no longer needed
+ https://bugs.webkit.org/show_bug.cgi?id=45768
- Re-factor help printing to use modern python idioms
- https://bugs.webkit.org/show_bug.cgi?id=31685
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dumpImage): new baselines are checked in and Linux will match Windows going forward.
- * Scripts/bugzilla-tool:
+2010-09-14 Kevin Ollivier <kevino@theolliviers.com>
-2009-11-19 Eric Seidel <eric@webkit.org>
+ [wx] Build fix, add newly added directories to the directory list.
- Reviewed by Darin Adler.
+ * wx/build/settings.py:
- commit-queue empty queue logs twice
- https://bugs.webkit.org/show_bug.cgi?id=31679
+2010-09-14 Sam Weinig <sam@webkit.org>
- * Scripts/bugzilla-tool:
+ Reviewed by Anders Carlsson.
-2009-11-19 Eric Seidel <eric@webkit.org>
+ Remove WKBundleNodeRef, replacing uses with WKBundleNodeHandleRef.
+ https://bugs.webkit.org/show_bug.cgi?id=45785
- Reviewed by Darin Adler.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::propertyValue):
+ (WTR::numericWindowPropertyValue):
+ (WTR::dumpPath):
+ (WTR::toStr):
+ (WTR::operator<<):
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ (WTR::InjectedBundlePage::shouldBeginEditing):
+ (WTR::InjectedBundlePage::shouldEndEditing):
+ (WTR::InjectedBundlePage::shouldInsertText):
+ (WTR::InjectedBundlePage::shouldDeleteRange):
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::shouldApplyStyle):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
- bugzilla-tool's reviewer/committer rejection message should be clearer
- https://bugs.webkit.org/show_bug.cgi?id=31126
+2010-09-14 Adam Barth <abarth@webkit.org>
- Add more explanatory prose to bugzilla-tool's flag permission rejection message.
+ Fix two typos in commit-queue. The first is harmless. The second
+ causes the queue to reject patches when the build is broken. :(
- * Scripts/modules/bugzilla.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
-2009-11-19 Eric Z. Ayers <zundel@google.com>
+2010-09-14 Chris Guillory <chris.guillory@google.com>
- Reviewed by Pavel Feldman.
+ Reviewed by Chris Fleizach.
- Forces a WM_PAINT event on calling layoutTestController.display()
- in order to enable the timeline-paint.html test on Windows.
- ::UpdateWindow() does not force an event becaue the window is
- not visible.
+ Send all accessibility notifications to Chromium.
+ https://bugs.webkit.org/show_bug.cgi?id=45156
- https://bugs.webkit.org/show_bug.cgi?id=31402
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::postAccessibilityNotification):
+ * DumpRenderTree/chromium/WebViewHost.h:
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (displayWebView):
+2010-09-14 Adam Barth <abarth@webkit.org>
-2009-11-19 Michelangelo De Simone <michelangelo@webkit.org>
+ Reviewed by Eric Seidel.
- No review needed.
+ commit-queue is slow during the day
+ https://bugs.webkit.org/show_bug.cgi?id=45780
- Added myself to committers list.
+ Thanks to the new logging, we've noticed that checkout-is-out-of-date
+ errors in the first pass of landing don't retry the land. Instead,
+ they're treated as failures and cause the commit-queue to do two more
+ builds before really trying to land the patch. Worse, in the second
+ build, we can get bitten by a flaky test.
- * Scripts/modules/committers.py:
+ This patch takes a slightly different approach to the commit-queue's
+ main control logic. We now use a separate subprocess for building and
+ testing and for landing. This means we should very rarely see the
+ checkout-is-out-of-date error, and when we do see it, we should retry
+ more quickly. If my understanding is correct, this should be a big
+ speed win for the commit-queue.
-2009-11-19 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- Reviewed by Eric Seidel.
+2010-09-14 Tony Chang <tony@chromium.org>
- Bugzilla-tool command classes should match command names
- https://bugs.webkit.org/show_bug.cgi?id=31666
+ Reviewed by Dimitri Glazkov.
- I renamed all the commands except CommitMessageForCurrentDiff because
- the new name would conflict with an existing class.
+ [chromium] implement layoutTestController.setDomainRelaxationForbiddenForURLScheme
+ https://bugs.webkit.org/show_bug.cgi?id=45762
- * Scripts/bugzilla-tool:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
+ * DumpRenderTree/chromium/LayoutTestController.h:
-2009-11-19 Pavel Feldman <pfeldman@chromium.org>
+2010-09-14 Csaba Osztrogonác <ossy@webkit.org>
- Reviewed by Gustavo Noronha Silva.
+ Adding myself as a reviewer.
- Web Inspector: Implement "show inspector" in WebKit GTK
- API and enable console tests.
+ * Scripts/webkitpy/common/config/committers.py:
- https://bugs.webkit.org/show_bug.cgi?id=31669
+2010-09-14 Zoltan Horvath <zoltan@webkit.org>
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::showWebInspector):
+ Reviewed by Kenneth Rohde Christiansen.
-2009-11-19 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ [Qt] Build-webkit shows a warning when WebKitBuild directory is not exist
+ https://bugs.webkit.org/show_bug.cgi?id=45736
- Reviewed by Simon Hausmann.
+ Build-webkit has showed a warning when WebKitBuild didn't exist, add
+ an additional condition to avoid it.
- Minor refactoring + more documentation.
+ * Scripts/build-webkit:
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::clearHistory):
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+2010-09-13 Eric Seidel <eric@webkit.org>
-2009-11-19 Fumitoshi Ukai <ukai@chromium.org>
+ Reviewed by Adam Barth.
- Reviewed by Eric Seidel.
+ commit-queue should log when it's retrying due to checkout out of date error
+ https://bugs.webkit.org/show_bug.cgi?id=45725
- Ignore websocket tests when --no-http is specified.
- https://bugs.webkit.org/show_bug.cgi?id=31662
+ This will allow us to better track how often we see these errors
+ and how long it takes the queue to recover from them.
- * Scripts/run-webkit-tests:
+ In order to pass the tests, I had to correct an error
+ from a previous change. The UnitTestPort should not have
+ ever been using the base port method as that will read
+ a file from disk. If the unit tests haven't passed the contents
+ it should raise an IOError as though the file doesn't exist.
-2009-11-18 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- Reviewed by Eric Seidel.
+2010-09-13 Mihai Parparita <mihaip@chromium.org>
- Normalize ' and " in bugzilla-tool
- https://bugs.webkit.org/show_bug.cgi?id=31655
+ Reviewed by Adam Barth.
- We decided " is better than ' and we should be consistent.
+ Upload results when cq patch landing fails
+ https://bugs.webkit.org/show_bug.cgi?id=45683
+
+ Include script errors when CommitQueue._land fails.
- * Scripts/bugzilla-tool:
+ * Scripts/webkitpy/tool/commands/queues.py:
-2009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+2010-09-13 Chris Fleizach <cfleizach@apple.com>
- Reviewed by Kenneth Rohde Christiansen.
+ Reviewed by David Kilzer.
- [Qt] Remove support for Qt v4.3 or older versions
- https://bugs.webkit.org/show_bug.cgi?id=29469
+ AX: accessibilityIsIgnored is returning nil when return value expects a BOOL
+ https://bugs.webkit.org/show_bug.cgi?id=45548
- * DumpRenderTree/qt/DumpRenderTree.pro:
- * DumpRenderTree/qt/ImageDiff.pro:
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (isIgnoredCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isIgnored):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isIgnored):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isIgnored):
-2009-11-18 Shinichiro Hamaji <hamaji@chromium.org>
+2010-09-13 Csaba Osztrogonác <ossy@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Andreas Kling.
- GitTest.test_create_binary_patch fails if /tmp is symlink
- https://bugs.webkit.org/show_bug.cgi?id=31536
+ jscPath() is incorrect in Windows' cmd.exe shell
+ https://bugs.webkit.org/show_bug.cgi?id=45651
- * Scripts/modules/scm_unittest.py:
+ * Scripts/webkitdirs.pm: Add ".exe" suffix to $jscName on Windows.
-2009-11-18 Yaar Schnitman <yaar@chromium.org>
+2010-09-13 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler.
- Configuration for Chromium Build Slaves.
-
- https://bugs.webkit.org/show_bug.cgi?id=31442
+ REGRESSION (r64816-r64889): Crash in WebCore::AccessibilityRenderObject
+ https://bugs.webkit.org/show_bug.cgi?id=43807
- * BuildSlaveSupport/build.webkit.org-config/config.json:
- * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (textMarkerForPointCallback):
+ (AccessibilityUIElement::textMarkerForPoint):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::textMarkerForPoint):
-2009-11-18 Eric Seidel <eric@webkit.org>
+2010-09-13 Andreas Kling <andreas.kling@nokia.com>
- Reviewed by Darin Adler.
+ Reviewed by Kenneth Rohde Christiansen.
- workqueue.py results in totally broken commit-queue UI
- https://bugs.webkit.org/show_bug.cgi?id=31645
+ [Qt] build-webkit: Add --v8 option to build against V8
- * Scripts/bugzilla-tool:
- - Remove unneeded use of PatchCollection.
- - Grab a new copy of the cq'd patches every run of the queue.
+ Note that V8 is picked up from QtScript, so this currently requires building
+ against the experimental qt-script-v8 branch.
-2009-11-18 Sam Weinig <sam@webkit.org>
+ * Scripts/build-webkit:
- Reviewed by Anders Carlsson.
+2010-09-13 Hans Wennborg <hans@chromium.org>
- Make the Mac Geolocation API async.
+ Reviewed by Jeremy Orlow.
- Update DRT to use the new async Mac Geolocation API.
+ Add WebDeviceOrientationClientMock::create() and use it from DRT.
+ https://bugs.webkit.org/show_bug.cgi?id=45650
- * DumpRenderTree/mac/UIDelegate.mm:
- (-[UIDelegate webView:decidePolicyForGeolocationRequestFromOrigin:frame:listener:]):
+ Do not use the WebDeviceOrientationClientMock constructor directly,
+ but use the create() member function.
-2009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+ This should fix the linker errors for the multi-DLL Chromium DRT build.
- Reviewed by Kenneth Rohde Christiansen.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ (LayoutTestController::deviceOrientationClient):
- Add and option to toggle HTML5 datalist support to build-webkit
- https://bugs.webkit.org/show_bug.cgi?id=31599
+2010-08-27 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
- * Scripts/build-webkit:
+ Reviewed by Antti Koivisto.
-2009-11-18 Kevin Watters <kevinwatters@gmail.com>
+ Add support for testing the viewport meta tag algorithm,
+ based on the following draft spec:
- Reviewed by Kevin Ollivier.
+ http://people.opera.com/rune/TR/ED-css-viewport-20100806/
- Enable wx plugin support using the Windows implementation as a base.
-
- https://bugs.webkit.org/show_bug.cgi?id=31636
+ Add common handling of viewport meta tag based on new Opera spec
+ https://bugs.webkit.org/show_bug.cgi?id=44201
- * wx/build/settings.py:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::dumpConfigurationForViewport):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
-2009-11-18 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-09-12 Kent Tamura <tkent@chromium.org>
- Reviewed by Simon Hausmann.
+ Reviewed by Tony Chang.
- Change the initialization order so that the controllers
- will be created before exporting them to the JS DOM window.
+ [DRT/Chromium] Remove dependency to base/string16.h and gfx/codec/png_codec.h
+ https://bugs.webkit.org/show_bug.cgi?id=45517
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
+ Use webkit_support_gfx.h for PNG encoding/decoding instead of png_codec.h
-2009-11-18 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * DumpRenderTree/chromium/ImageDiff.cpp:
+ (Image::craeteFromStdin):
+ (Image::createFromFilename):
+ (diffImages):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dumpImage):
- Reviewed by Simon Hausmann.
+2010-09-10 MORITA Hajime <morrita@google.com>
- Fix a code copy and paste error. m_page should be page.
+ Reviewed by Tony Chang.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::createWindow):
+ [Chromium] Implement textInputController.hasSpellingMarker() for Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=45441
-2009-11-17 Mark Rowe <mrowe@apple.com>
+ Added TextInputController::hasSpellingMarker().
+
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::TextInputController):
+ (TextInputController::hasSpellingMarker):
+ * DumpRenderTree/chromium/TextInputController.h:
- Reviewed by Alexey Proskuryakov.
+2010-09-12 Dirk Pranke <dpranke@chromium.org>
- <http://webkit.org/b/31603> WebSocket server is confused if WebKit tests run from within /tmp on Mac OS X
+ Unreviewed, build fix.
- * pywebsocket/mod_pywebsocket/dispatch.py: Use os.path.realpath as it returns the canonical path of a file.
- This prevents symlinks from confusing the descendant check.
+ My last change accidentally contained a local change to the
+ rebaselinig script; webkit-patch land picked it up without telling
+ me and committed it :(
-2009-11-17 Mark Rowe <mrowe@apple.com>
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- Reviewed by Alexey Proskuryakov.
+2010-09-11 Maciej Stachowiak <mjs@apple.com>
- <http://webkit.org/b/31602> Failing to start the WebSocket server shouldn’t terminate entire test run
+ Reviewed by Anders Carlsson.
- If the WebSocket server fails to start have DRT load an error page in place of tests that require the
- server to be up rather than having run-webkit-tests abort immediately.
+ Attempt to fix Windows MiniBrowser build (untested)
+ https://bugs.webkit.org/show_bug.cgi?id=45609
- * Scripts/run-webkit-tests:
+ * MiniBrowser/win/BrowserView.cpp:
+ (runJavaScriptConfirm):
+ (runJavaScriptPrompt):
-2009-11-17 Eric Seidel <eric@webkit.org>
+2010-09-11 Sam Weinig <sam@webkit.org>
- Reviewed by Darin Adler.
+ Reviewed by Maciej Stachowiak.
- commit-queue is failing to set reviewer in ChangeLogs
- https://bugs.webkit.org/show_bug.cgi?id=31592
+ Fix zoom related tests when testing WebKit2.
- * Scripts/bugzilla-tool: Clarify the "applying" log message.
- * Scripts/modules/bugzilla.py:
- - Add a new _validate_committer_and_reviewer function as a
- temporary solution until we can make a real Attachment object
- which knows how to fill in its committer/reviewer fields automatically.
+ * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+ (WTR::EventSendingController::zoomPageIn): Zoom in and zoom out are not the same.
-2009-11-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-09-11 Sam Weinig <sam@webkit.org>
- Unreviewed buildbot fix.
+ Reviewed by Dan Bernstein.
- Revert part of earlier patch and add comment, as it
- was causing timeouts on the buildbot.
+ Implement WebKit2 callback equivalent to - [WebUIDelegate webView:setStatusText:]
+ <rdar://problem/8359252>
+ https://bugs.webkit.org/show_bug.cgi?id=45605
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (setStatusText):
+ (contentsSizeChanged):
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (runJavaScriptConfirm):
+ (runJavaScriptPrompt):
+ (setStatusText):
+ (contentsSizeChanged):
+ (BrowserView::create):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage):
+ (WTR::TestController::initialize):
+
+2010-09-11 Sam Weinig <sam@webkit.org>
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::notifyDone):
+ Reviewed by Dan Bernstein.
-2009-11-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Add callback mechanism for the getting the source of a frame
+ <rdar://problem/8364681>
+ https://bugs.webkit.org/show_bug.cgi?id=45604
- Reviewed by Oliver Hunt.
+ Add ability to dump the main frame's source to the console.
- Make the timeout 15 sec as for the other DRT's and make
- it print out the same output when a test timeout.
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController dumpSourceToConsole:]):
+ * MiniBrowser/mac/MainMenu.xib:
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::waitUntilDone):
- (LayoutTestController::notifyDone):
- (LayoutTestController::timerEvent):
+2010-09-11 Eric Seidel <eric@webkit.org>
-2009-11-17 Joseph Pecoraro <joepeck@webkit.org>
+ Reviewed by Adam Barth.
- Reviewed by Timothy Hatcher.
+ Remove unneeded Empty Queue messages
+ https://bugs.webkit.org/show_bug.cgi?id=45602
- Fixed typos in comments.
+ We already have a /gc job to delete these.
+ recentstatus.py is already smart enough to use the
+ most recent of the workitems last update or the most recent status,
+ so removing these should not change the _last_status_date() return
+ value more than a few milliseconds.
- * Scripts/modules/committers.py:
+ These messages just spam the recent status log.
-2009-11-17 Pavel Feldman <pfeldman@chromium.org>
+ * Scripts/webkitpy/tool/commands/queues.py:
- Reviewed by Timothy Hatcher.
+2010-09-11 Mihai Parparita <mihaip@chromium.org>
- Web Inspector: Make DRT show web inspector for tests in inspector/ folder.
- - Updated DRT to show/close inspector for all tests under /inspector
- - Introduced LayoutTestController::setTimelineProfilingEnabled and
- WebInspector::setTimelineProfilingEnabled beside setJavaScriptProfilingEnabled
- - Removed reload on each inspector test
- - Renamed fast/inspector to fast/inspector-support in order not to trigger
- inspector for those.
- - Reimplemented timeline tests in order to get rid of reload there.
- - Moved tests that don't require harness into the fast group.
+ Reviewed by Adam Barth.
- https://bugs.webkit.org/show_bug.cgi?id=31472
+ Fix Python exception when generating synthetic patch IDs
+ https://bugs.webkit.org/show_bug.cgi?id=45592
- * DumpRenderTree/LayoutTestController.cpp:
- (setTimelineProfilingEnabledCallback):
- (closeWebInspectorCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (shouldOpenWebInspector):
- (runTest):
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setTimelineProfilingEnabled):
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (shouldOpenWebInspector):
- (runTest):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::setTimelineProfilingEnabled):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (shouldOpenWebInspector):
- (runTest):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setTimelineProfilingEnabled):
+ Can't concatenate strings and numbers directly.
-2009-11-17 Oliver Hunt <oliver@apple.com>
+ * QueueStatusServer/handlers/queuestatus.py:
- Reviewed by Maciej Stachowiak.
+2010-09-11 Mihai Parparita <mihaip@chromium.org>
- Incorrect use of JavaScriptCore API in DumpRenderTree
- https://bugs.webkit.org/show_bug.cgi?id=31577
+ Reviewed by Adam Barth.
- Return undefined rather than a literal null.
+ Group statuses in queue status by patch ID
+ https://bugs.webkit.org/show_bug.cgi?id=45588
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (setSelectedTextRangeCallback):
- (incrementCallback):
- (decrementCallback):
- (showMenuCallback):
+ Group statuses by patch ID so that the status page is easier
+ to scan.
-2009-11-16 Chris Fleizach <cfleizach@apple.com>
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/stylesheets/dashboard.css:
+ (.status-group):
+ (.status-bug):
+ (.status-group ul):
+ (.status-group ul li):
+ (.status-group ul li:hover):
+ (.status-cell):
+ (.status-cell:hover):
+ (.status-cell.pass):
+ (.status-cell.fail):
+ (.status-cell.pending):
+ (.status-cell.error):
+ * QueueStatusServer/templates/dashboard.html:
+ * QueueStatusServer/templates/queuestatus.html:
- Reviewed by Beth Dakin.
+2010-09-11 Mihai Parparita <mihaip@chromium.org>
- AX: aria-labelledby duplicates some of its WAI-ARIA label
- https://bugs.webkit.org/show_bug.cgi?id=31565
+ Reviewed by Tony Chang.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (titleUIElementCallback):
- (getIsValidCallback):
- (AccessibilityUIElement::getJSClass):
+ Implement layoutTestController.dumpResourceResponseMIMETypes in Chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=45479
-2009-11-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Implement layoutTestController.dumpResourceResponseMIMETypes (modelled after
+ implementation in ResourceLoadDelegate in the Mac port).
- Reviewed by Simon Hausmann.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::dumpResourceResponseMIMETypes):
+ (LayoutTestController::reset):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController::setShouldDumpResourceResponseMIMETypes):
+ (LayoutTestController::shouldDumpResourceResponseMIMETypes):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::shouldDumpResourceResponseMIMETypes):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didReceiveResponse):
- r50942 broke output from created windows. Make the
- m_enableTextOutput a member of the DRT and not the
- WebPage.
+2010-09-11 Eric Seidel <eric@webkit.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
- (WebCore::WebPage::javaScriptAlert):
- (WebCore::WebPage::javaScriptConsoleMessage):
- (WebCore::WebPage::javaScriptConfirm):
- (WebCore::WebPage::javaScriptPrompt):
- (WebCore::WebPage::acceptNavigationRequest):
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::open):
- (WebCore::DumpRenderTree::createWindow):
- * DumpRenderTree/qt/DumpRenderTree.h:
- (WebCore::DumpRenderTree::setTextOutputEnabled):
- (WebCore::DumpRenderTree::isTextOutputEnabled):
- (WebCore::WebPage::shouldInterruptJavaScript):
- (WebCore::WebPage::isTextOutputEnabled):
- (WebCore::WebPage::setViewGeometry):
+ Reviewed by Adam Barth.
-2009-11-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ queues.webkit.org should expose /remote_api for data upload/download
+ https://bugs.webkit.org/show_bug.cgi?id=45559
- Reviewed by Gustavo Noronha Silva.
+ * QueueStatusServer/app.yaml:
+ - /remote_api is a standard app-engine service which allows use of
+ the bulk uploader for data upload/download. Exposing this
+ (for admin access only) allows us to use
- Moved DumpRenderTree/gtk/TestNetscapePlugin to DumpRenderTree/unix/TestNetscapePlugin
- as the implementation is being used by at least Qt and Gtk+.
+2010-09-10 Sam Weinig <sam@webkit.org>
- Update buildsystems as well.
+ Reviewed by Dan Bernstein.
- * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
- * DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npapi.h:
- * DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npfunctions.h:
- * DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npruntime.h:
- * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
- * GNUmakefile.am:
+ Add zoom support to WebKit2 API
+ <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45585
+
+ - Add zoom options to MiniBrowser that mimic Safari's options using
+ the new WebKit2 zoom APIs.
+ - Switch uses of float for the zoom APIs to use double.
+
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController initWithPageNamespace:]):
+ (-[BrowserWindowController validateMenuItem:]):
+ (-[BrowserWindowController validateUserInterfaceItem:]):
+ (-[BrowserWindowController currentZoomFactor]):
+ (-[BrowserWindowController setCurrentZoomFactor:]):
+ (-[BrowserWindowController canZoomIn]):
+ (-[BrowserWindowController zoomIn:]):
+ (-[BrowserWindowController canZoomOut]):
+ (-[BrowserWindowController zoomOut:]):
+ (-[BrowserWindowController canResetZoom]):
+ (-[BrowserWindowController resetZoom:]):
+ (-[BrowserWindowController toggleZoomMode:]):
+ * MiniBrowser/mac/MainMenu.xib:
+ * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+ (WTR::EventSendingController::textZoomIn):
+ (WTR::EventSendingController::textZoomOut):
+ (WTR::EventSendingController::zoomPageIn):
+ (WTR::EventSendingController::zoomPageOut):
+
+2010-09-10 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Fix crash in DRT in standalone mode
+
+ https://bugs.webkit.org/show_bug.cgi?id=45454
-2009-11-16 Yuzo Fujishima <yuzo@google.com>
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::loadNextTestInStandAloneMode):
- Reviewed by Alexey Proskuryakov.
+2010-09-10 Sam Weinig <sam@webkit.org>
- Disable wss until all platforms support pyOpenSSL
+ Reviewed by Darin Adler.
- https://bugs.webkit.org/show_bug.cgi?id=31479
+ Remove unnecessary constraint in WebCore of choosing either text zoom or full page zoom.
+ Precursor to <rdar://problem/7660657>
+ https://bugs.webkit.org/show_bug.cgi?id=45522
- * Scripts/run-webkit-tests:
+ Update for changes to the Bundle API to allow separate control of page and text zoom
+ levels.
-2009-11-14 Antonio Gomes <tonikitoo@webkit.org>
+ * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+ (WTR::EventSendingController::textZoomIn):
+ (WTR::EventSendingController::textZoomOut):
+ (WTR::EventSendingController::zoomPageIn):
+ (WTR::EventSendingController::zoomPageOut):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::reset):
- Reviewed by Kenneth Christiansen.
+2010-09-10 Yael Aharon <yael.aharon@nokia.com>
- [Qt] Implement load error pages support for Qt's DRT.
- https://bugs.webkit.org/show_bug.cgi?id=31509
+ Reviewed by Andreas Kling.
- For now, it will not be a default feature, and layout tests
- that want to make use of this have to explicitily call
- 'handleErrorPages();' for the test source.
+ [Qt] Support click event for notifications
+ https://bugs.webkit.org/show_bug.cgi?id=44836
- Any of the other DumpRenderTree's (mac, win and gtk)
- support handling error pages. Qt's will be the first.
+ Add support for simulateDesktopNotificationClick by calling
+ back to DumpRenderTreeSupportQt.cpp.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::supportsExtension):
- (WebCore::WebPage::extension):
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::reset):
+ (LayoutTestController::simulateDesktopNotificationClick):
* DumpRenderTree/qt/LayoutTestControllerQt.h:
- (LayoutTestController::shouldHandleErrorPages):
- (LayoutTestController::handleErrorPages):
-2009-11-16 Eric Seidel <eric@webkit.org>
+2010-09-10 Mihai Parparita <mihaip@chromium.org>
- Reviewed by Adam Barth.
+ Reviewed by Eric Seidel.
- Rename the --commit-queue flag on land-* now that the commit-queue needs no special treatment
- https://bugs.webkit.org/show_bug.cgi?id=31549
+ Update queue status when patches fail their first land attempt
+ https://bugs.webkit.org/show_bug.cgi?id=45583
- Renamed --commit-queue to --non-interactive in most places
- and remove the code in land-patches which is no longer needed.
+ Add a few more _update_status calls to make it more obvious if a patch is
+ being retried because tests failed.
- * Scripts/bugzilla-tool:
+ * Scripts/webkitpy/tool/commands/queues.py:
-2009-11-16 Eric Seidel <eric@webkit.org>
+2010-09-10 Balazs Kelemen <kb@inf.u-szeged.hu>
- Reviewed by Adam Barth.
+ Reviewed by Andreas Kling.
- The commit-queue should use land-attachment
- https://bugs.webkit.org/show_bug.cgi?id=31548
+ [Qt] MiniBrowser crashes with multiply windows when closing one of them
+ https://bugs.webkit.org/show_bug.cgi?id=45536
- * Scripts/bugzilla-tool:
+ * MiniBrowser/qt/BrowserView.cpp:
+ (BrowserView::BrowserView): Reference the context instead of adopting it
+ because it can be shared across different views.
-2009-11-16 Adam Barth <abarth@webkit.org>
+2010-09-10 Tony Chang <tony@chromium.org>
- Reviewed by Eric Seidel.
+ Unreviewed, rolling out r67241.
+ http://trac.webkit.org/changeset/67241
+ https://bugs.webkit.org/show_bug.cgi?id=44709
- Convert CommitQueue over to PatchCollection
- https://bugs.webkit.org/show_bug.cgi?id=31547
+ Accidentally committed.
- Also fixes a bug in workqueue and adds a test!
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
- * Scripts/bugzilla-tool:
- * Scripts/modules/workqueue.py:
- * Scripts/modules/workqueue_unittest.py:
+2010-09-10 Tony Chang <tony@chromium.org>
-2009-11-16 Adam Barth <abarth@webkit.org>
-
- Reviewed by Eric Seidel.
+ Reviewed by Ojan Vafai.
- Move StyleQueue over to using PatchCollection
- https://bugs.webkit.org/show_bug.cgi?id=31544
+ deduplicate-tests should be runnable from any WebKit directory
+ https://bugs.webkit.org/show_bug.cgi?id=44709
- That's what the class it's for.
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
- * Scripts/bugzilla-tool:
- * Scripts/modules/patchcollection.py:
- * Scripts/modules/patchcollection_unittest.py:
+2010-09-10 Tony Chang <tony@chromium.org>
-2009-11-16 Eric Seidel <eric@webkit.org>
+ Unreviewed, rolling out r67216.
+ http://trac.webkit.org/changeset/67216
+ https://bugs.webkit.org/show_bug.cgi?id=44709
- Reviewed by Adam Barth.
+ Broke
- bugzilla-tool needs a land-attachment command
- https://bugs.webkit.org/show_bug.cgi?id=31546
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
- * Scripts/bugzilla-tool:
- - Move all the logic into AbstractLandingCommand and
- add a new LandAttachment command subclass.
- - Split out _collect_patches_by_bug logging from _fetch_list_of_patches_to_land.
+2010-09-10 Tony Chang <tony@chromium.org>
-2009-11-16 Eric Seidel <eric@webkit.org>
+ Reviewed by Ojan Vafai.
- Reviewed by Adam Barth.
+ deduplicate-tests should be runnable from any WebKit directory
+ https://bugs.webkit.org/show_bug.cgi?id=44709
- Move more patch-landing code into WebKitLandingScripts in preparation for land-attachment
- https://bugs.webkit.org/show_bug.cgi?id=31543
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
- Just moving code and updating the one caller to use WebKitLandingScripts instead of 'self'.
+2010-09-09 Hans Wennborg <hans@chromium.org>
- * Scripts/bugzilla-tool:
+ Reviewed by Jeremy Orlow.
-2009-11-16 Eric Seidel <eric@webkit.org>
+ Hook up LayoutTestController.setMockDeviceOrientation() in Chromium DumpRenderTree.
+ https://bugs.webkit.org/show_bug.cgi?id=45460
- Reviewed by Adam Barth.
+ This enables DumpRenderTree to run layout tests for DeviceOrientation.
- Disable the style queue from posting to the commit queue status page.
+ Also declare the LayoutTestController destructor out-of-line.
+ Otherwise the implicit destructor would cause compiler errors because
+ of the OwnPtr<WebKit::WebDeviceOrientationClientMock> member.
- * Scripts/bugzilla-tool:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::~LayoutTestController):
+ (LayoutTestController::setMockDeviceOrientation):
+ (LayoutTestController::deviceOrientationClient):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::deviceOrientationClient):
+ * DumpRenderTree/chromium/WebViewHost.h:
-2009-11-16 Adam Barth <abarth@webkit.org>
+2010-09-09 Sheriff Bot <webkit.review.bot@gmail.com>
- Reviewed by Eric Seidel.
+ Unreviewed, rolling out r67119.
+ http://trac.webkit.org/changeset/67119
+ https://bugs.webkit.org/show_bug.cgi?id=45505
- Implement PatchCollection
- https://bugs.webkit.org/show_bug.cgi?id=31541
+ Extra newlines in results (Requested by tony^work on #webkit).
- This class holds a set of patches and lets clients iterate through
- them. Optionally, clients can install a filter.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::reset):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/TestShell.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (printResponseDescription):
+ (printNodeDescription):
+ (printRangeDescription):
+ (WebViewHost::shouldBeginEditing):
+ (WebViewHost::shouldEndEditing):
+ (WebViewHost::shouldInsertNode):
+ (WebViewHost::shouldChangeSelectedRange):
+ (WebViewHost::shouldDeleteRange):
+ (WebViewHost::shouldApplyStyle):
+ (WebViewHost::didBeginEditing):
+ (WebViewHost::didChangeSelection):
+ (WebViewHost::didChangeContents):
+ (WebViewHost::didEndEditing):
+ (WebViewHost::decidePolicyForNavigation):
+ (WebViewHost::didCancelClientRedirect):
+ (WebViewHost::didStartProvisionalLoad):
+ (WebViewHost::didReceiveServerRedirectForProvisionalLoad):
+ (WebViewHost::didFailProvisionalLoad):
+ (WebViewHost::didCommitProvisionalLoad):
+ (WebViewHost::didFinishDocumentLoad):
+ (WebViewHost::didHandleOnloadEvents):
+ (WebViewHost::didFailLoad):
+ (WebViewHost::didFinishLoad):
+ (WebViewHost::didChangeLocationWithinPage):
+ (WebViewHost::willSendRequest):
+ (WebViewHost::didReceiveResponse):
+ (WebViewHost::didFinishResourceLoad):
+ (WebViewHost::didFailResourceLoad):
+ (WebViewHost::didDisplayInsecureContent):
+ (WebViewHost::didRunInsecureContent):
+ (WebViewHost::printFrameDescription):
+
+2010-09-09 Michael Saboff <msaboff@apple.com>
+
+ Unreviewed, adding myself to committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-09-09 Mihai Parparita <mihaip@chromium.org>
+
+ Reviewed by Tony Chang.
+
+ Implement layoutTestController.dumpResourceResponseMIMETypes in Chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=45479
+
+ Implement layoutTestController.dumpResourceResponseMIMETypes (modelled after
+ implementation in ResourceLoadDelegate in the Mac port).
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::dumpResourceResponseMIMETypes):
+ (LayoutTestController::reset):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController::setShouldDumpResourceResponseMIMETypes):
+ (LayoutTestController::shouldDumpResourceResponseMIMETypes):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::shouldDumpResourceResponseMIMETypes):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didReceiveResponse):
- * Scripts/modules/patchcollection.py: Added.
- * Scripts/modules/patchcollection_unittest.py: Added.
- * Scripts/run-webkit-unittests:
+2010-09-09 Mihai Parparita <mihaip@chromium.org>
-2009-11-16 Eric Seidel <eric@webkit.org>
+ Reviewed by Daniel Bates.
- Reviewed by Adam Barth.
+ svn-apply tries to delete directories it shouldn't
+ https://bugs.webkit.org/show_bug.cgi?id=45424
- bugzilla-tool land-patches will close bugs with patches r=?
- https://bugs.webkit.org/show_bug.cgi?id=28230
+ isDirectoryEmptyForRemoval had the wrong check. If an item in the
+ directory is itself a directory, then the directory is definitely
+ not empty.
- The commit-queue shouldn't close patches with outstanding reviews on them,
- even if many reviewers seem to be against multi-patch bugs.
+ * Scripts/svn-apply:
- * Scripts/bugzilla-tool:
+2010-09-09 Chris Fleizach <cfleizach@apple.com>
-2009-11-16 Eric Seidel <eric@webkit.org>
+ Fixing GTK and windows build failure.
- Reviewed by Adam Barth.
+ AX: Support AccessibilityTextMarkers in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=44778
- bugzilla-tool check-style should work with attachment ids instead of bug ids
- https://bugs.webkit.org/show_bug.cgi?id=31540
+ * DumpRenderTree/AccessibilityTextMarker.h:
+ (AccessibilityTextMarker::platformTextMarker):
+ (AccessibilityTextMarkerRange::platformTextMarkerRange):
+ * DumpRenderTree/mac/AccessibilityTextMarkerMac.mm:
+ (AccessibilityTextMarker::platformTextMarker):
+ (AccessibilityTextMarkerRange::platformTextMarkerRange):
- * Scripts/bugzilla-tool:
+2010-09-09 Chris Fleizach <cfleizach@apple.com>
-2009-11-16 Eric Seidel <eric@webkit.org>
+ Reviewed by David Kilzer.
- Reviewed by Adam Barth.
+ AX: Support AccessibilityTextMarkers in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=44778
+
+ Add AccessibilityTextMarker and AccessibilityTextMarkerRange which encapsulate the AXTextMarkers
+ that WebCore uses when vending information about its VisiblePositions through AX.
+
+ There are a few new methods in AccessibilityUIElement to retrieve and use text markers, and some basic
+ methods for encapsulating and checking equality.
+
+ This will allow future bug fixes in the text marker system to be adequately tested.
+
+ * DumpRenderTree/AccessibilityTextMarker.cpp: Added.
+ (toTextMarker):
+ (isMarkerEqualCallback):
+ (markerFinalize):
+ (AccessibilityTextMarker::makeJSAccessibilityTextMarker):
+ (AccessibilityTextMarker::getJSClass):
+ (toTextMarkerRange):
+ (isMarkerRangeEqualCallback):
+ (markerRangeFinalize):
+ (AccessibilityTextMarkerRange::makeJSAccessibilityTextMarkerRange):
+ (AccessibilityTextMarkerRange::getJSClass):
+ * DumpRenderTree/AccessibilityTextMarker.h: Added.
+ (AccessibilityTextMarker::platformTextMarker):
+ (AccessibilityTextMarkerRange::platformTextMarkerRange):
+ (AccessibilityTextMarker::AccessibilityTextMarker):
+ (AccessibilityTextMarker::~AccessibilityTextMarker):
+ (AccessibilityTextMarker::isEqual):
+ (AccessibilityTextMarkerRange::AccessibilityTextMarkerRange):
+ (AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange):
+ (AccessibilityTextMarkerRange::isEqual):
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (textMarkerRangeForElementCallback):
+ (textMarkerRangeLengthCallback):
+ (textMarkerRangeForMarkersCallback):
+ (startTextMarkerForTextMarkerRangeCallback):
+ (endTextMarkerForTextMarkerRangeCallback):
+ (accessibilityElementForTextMarkerCallback):
+ (AccessibilityUIElement::textMarkerRangeForElement):
+ (AccessibilityUIElement::textMarkerRangeLength):
+ (AccessibilityUIElement::startTextMarkerForTextMarkerRange):
+ (AccessibilityUIElement::endTextMarkerForTextMarkerRange):
+ (AccessibilityUIElement::accessibilityElementForTextMarker):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/mac/AccessibilityTextMarkerMac.mm: Added.
+ (AccessibilityTextMarker::AccessibilityTextMarker):
+ (AccessibilityTextMarker::~AccessibilityTextMarker):
+ (AccessibilityTextMarker::isEqual):
+ (AccessibilityTextMarkerRange::AccessibilityTextMarkerRange):
+ (AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange):
+ (AccessibilityTextMarkerRange::isEqual):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::textMarkerRangeForElement):
+ (AccessibilityUIElement::textMarkerRangeLength):
+ (AccessibilityUIElement::textMarkerRangeForMarkers):
+ (AccessibilityUIElement::startTextMarkerForTextMarkerRange):
+ (AccessibilityUIElement::endTextMarkerForTextMarkerRange):
+ (AccessibilityUIElement::accessibilityElementForTextMarker):
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
- WorkQueue is the only place that should know about special exit codes
- https://bugs.webkit.org/show_bug.cgi?id=31534
+2010-08-25 Tony Chang <tony@chromium.org>
- Move LandPatchesFromBugs.handled_error to WorkQueue.exit_after_handled_error
- and add tests for handling exit codes.
- I also cleaned up workqueue_unittest.py more.
+ Reviewed by Ojan Vafai.
- * Scripts/bugzilla-tool:
- * Scripts/modules/workqueue.py:
- * Scripts/modules/workqueue_unittest.py:
+ don't delete duplicates needed because of intermediate results
+ https://bugs.webkit.org/show_bug.cgi?id=44653
-2009-11-16 Eric Seidel <eric@webkit.org>
+ Also, output the full path so we can pipe the output to rm.
- Reviewed by Adam Barth.
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
- Re-factor workqueue_unittest to allow for more than one test.
- https://bugs.webkit.org/show_bug.cgi?id=31535
+2010-09-09 Balazs Kelemen <kb@inf.u-szeged.hu>
- * Scripts/modules/workqueue_unittest.py:
+ Reviewed by Andreas Kling.
-2009-11-16 Eric Seidel <eric@webkit.org>
+ [Qt] MiniBrowser does not starts properly
+ https://bugs.webkit.org/show_bug.cgi?id=45459
- Reviewed by Adam Barth.
+ Do not try set up the first window by calling newWindow on a
+ newly created BrowserWindow since it creates a new object.
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserWindow::BrowserWindow):
+ * MiniBrowser/qt/main.cpp:
+ (main):
- land-patches needs to be re-factored into smaller chunks
- https://bugs.webkit.org/show_bug.cgi?id=31532
+2010-09-09 Martin Robinson <mrobinson@igalia.com>
- * Scripts/bugzilla-tool: fix a couple obvious typos.
+ Reviewed by Xan Lopez.
-2009-11-16 Eric Seidel <eric@webkit.org>
+ [GTK] Get ImageDiff building on Win32
+ https://bugs.webkit.org/show_bug.cgi?id=45353
- Reviewed by Adam Barth.
+ * DumpRenderTree/gtk/ImageDiff.cpp:
+ (main): Switch from using strtok to g_strsplit.
- land-patches needs to be re-factored into smaller chunks
- https://bugs.webkit.org/show_bug.cgi?id=31532
+2010-09-09 Zoltan Horvath <zoltan@webkit.org>
- The next patch will move these methods into WebKitLandingScripts.
+ Reviewed by Andreas Kling.
- * Scripts/bugzilla-tool:
- - Split out _land_patch and _close_bug_if_no_active_patches.
+ [Qt] Modify load method of MiniBrowser's BrowserView class
+ https://bugs.webkit.org/show_bug.cgi?id=45442
-2009-11-16 Adam Barth <abarth@webkit.org>
+ Modify load method to take a QString as argument, remove unnecessary QT_VERSION_CHECK.
- Reviewed by Eric Seidel.
+ * MiniBrowser/qt/BrowserView.cpp:
+ (BrowserView::load):
+ * MiniBrowser/qt/BrowserView.h:
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserWindow::load):
- Fix silly copy-and-paste code. I am a terrible coder.
+2010-09-09 Tony Chang <tony@chromium.org>
- * Scripts/modules/bugzilla.py:
+ Reviewed by Ojan Vafai.
-2009-11-16 Adam Barth <abarth@webkit.org>
+ fix show_results in new-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=45413
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
- Implement a StyleQueue
- https://bugs.webkit.org/show_bug.cgi?id=31537
+2010-09-08 Victor Wang <victorw@chromium.org>
- The first iteration of the style queue only produces output locally.
- There is also a limit of 10 patches because it's not that useful to
- iterate through the entire review queue at this point. We can remove
- the limit later.
+ Reviewed by Ojan Vafai.
- * Scripts/bugzilla-tool:
- * Scripts/modules/bugzilla.py:
+ [Chromium] Fix test results server to make sure
+ it does not have corrupted data.
-2009-11-16 Adam Barth <abarth@webkit.org>
+ results.json file size coulbe be >1M and we split
+ the data into multiple data store entries in this
+ case. This patch fixes the issue that the data may
+ be corrupted if data store error happens in the middle
+ of saving multiple entries.
- Reviewed by Eric Seidel.
+ https://bugs.webkit.org/show_bug.cgi?id=45063
- Unit test WorkQueue
- https://bugs.webkit.org/show_bug.cgi?id=31531
+ * TestResultServer/model/datastorefile.py:
- Adds basic unit testing for WorkQueue. Just runs through one cycle.
+2010-09-08 Peter Varga <pvarga@inf.u-szeged.hu>
- * Scripts/bugzilla-tool:
- * Scripts/modules/statusbot.py:
- * Scripts/modules/workqueue.py:
- * Scripts/modules/workqueue_unittest.py: Added.
- * Scripts/run-webkit-unittests:
+ Reviewed by Kenneth Rohde Christiansen.
-2009-11-16 Eric Seidel <eric@webkit.org>
+ Fix ignoring return value warning in case of gcc 4.4.4
+ https://bugs.webkit.org/show_bug.cgi?id=45384
- Reviewed by Adam Barth.
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (testPostURLFile):
+ If fwrite have written zero byte then the testPostURLFile function
+ returns with false as tempFile can't be opened.
+ * DumpRenderTree/qt/ImageDiff.cpp:
+ (main):
+ Put fwrite function into an if condition without body to avoid
+ warning. It is safe because this function writes to the stdout.
- bugzilla-tool land-diff should know how to parse bug ids out of ChangeLogs
- https://bugs.webkit.org/show_bug.cgi?id=31530
+2010-09-08 Satish Sampath <satish@chromium.org>
- * Scripts/bugzilla-tool:
+ Unreviewed, adding myself to committers list.
-2009-11-16 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/common/config/committers.py:
- Reviewed by Adam Barth.
+2010-09-08 Hans Wennborg <hans@chromium.org>
- bugzilla-tool needs apply-attachment
- https://bugs.webkit.org/show_bug.cgi?id=31528
-
- * Scripts/bugzilla-tool:
- - Add ApplyAttachment command.
- - Abstract applying code into WebKitApplyingScripts.
- - Rename setup_for_landing to prepare_clean_working_directory and make local_commit checking optional.
- * Scripts/modules/bugzilla.py:
- - Add fetch_attachment and bug_id_for_attachment_id.
- * Scripts/modules/bugzilla_unittest.py:
- - Add test for new parsing.
- - Fix previous parsing test which broke with Adam's check-style patch (bug 31515).
+ Unreviewed.
-2009-11-16 Eric Seidel <eric@webkit.org>
+ Adding myself as a committer in committers.py.
- Reviewed by Adam Barth.
+ * Scripts/webkitpy/common/config/committers.py:
- Document check-style's use of force_clean.
+2010-09-08 Zoltan Horvath <zoltan@webkit.org>
- * Scripts/bugzilla-tool:
- * Scripts/modules/scm.py:
+ Reviewed by Simon Hausmann.
-2009-11-16 Adam Barth <abarth@webkit.org>
+ [Qt] Refactor MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=45173
- Reviewed by Eric Seidel.
+ Split BrowserWindow into two source files and headers. Remove unnecessary header includes.
- Move WorkQueue to its own file
- https://bugs.webkit.org/show_bug.cgi?id=31529
+ * MiniBrowser/qt/BrowserView.cpp: Added.
+ (createNewPage):
+ (BrowserView::BrowserView):
+ (BrowserView::resizeEvent):
+ (BrowserView::load):
+ (BrowserView::view):
+ * MiniBrowser/qt/BrowserView.h: Added.
+ (BrowserView::~BrowserView):
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ * MiniBrowser/qt/BrowserWindow.h:
+ * MiniBrowser/qt/MiniBrowser.pro:
- WorkQueue and WorkQueueDelegate are separate concerns from
- bugzilla-tool. Also added a missing include to logging.py.
+2010-09-08 Adam Barth <abarth@webkit.org>
- * Scripts/bugzilla-tool:
- * Scripts/modules/logging.py:
- * Scripts/modules/workqueue.py:
+ Rubber-stamped by Eric Seidel.
-2009-11-16 Adam Barth <abarth@webkit.org>
+ Rename DocLoader to CachedResourceLoader because that's what it does.
- Reviewed by Eric Seidel.
+ * Scripts/do-webcore-rename:
- Move OutputTee to logging.py.
+2010-09-07 Kinuko Yasuda <kinuko@chromium.org>
- * Scripts/bugzilla-tool:
- * Scripts/modules/logging.py:
+ Reviewed by Ojan Vafai.
-2009-11-15 Adam Barth <abarth@webkit.org>
+ Enable incremental results.json generation for non-layout tests.
+ https://bugs.webkit.org/show_bug.cgi?id=45315
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py: Enable generate_incremental_results=True by default. (This still keeps to generate results.json.) Also add a code to upload results json files to the app-engine server. Need a chromium change to actually start the uploading.
- Refactor bugzilla-tool to allow for multiple queues
- https://bugs.webkit.org/show_bug.cgi?id=31513
+ * TestResultServer/model/jsonresults.py: Make sure we save the file with test_type for incremental cases too.
- Divide the commit queue class into three class to make creating
- additional queues easier.
- * Scripts/bugzilla-tool:
+2010-09-07 Dirk Pranke <dpranke@chromium.org>
-2009-11-15 Shinichiro Hamaji <hamaji@chromium.org>
+ Unreviewed, build fix
- Reviewed by Eric Seidel.
+ Missed one test in mac_unittest.py in previous change; for some
+ reason the method is listed twice. I will fix both for now, but will
+ figure this out in a later, not-time-sensitive patch.
- svn-apply may not handle git patches created by bugzilla-tool
- https://bugs.webkit.org/show_bug.cgi?id=31457
+ https://bugs.webkit.org/show_bug.cgi?id=45357
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
-2009-11-15 Shinichiro Hamaji <hamaji@chromium.org>
+2010-09-07 Kent Tamura <tkent@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Tony Chang.
- bugzilla-tool should post git binary diff
- https://bugs.webkit.org/show_bug.cgi?id=31458
+ test-webkitpy: Fix load error of
+ webkitpy/layout_tests/port/factory_unittest.py on Win32 Python
+ https://bugs.webkit.org/show_bug.cgi?id=45356 Need a short
- Add --binary option to Git.create_patch.
+ * Scripts/webkitpy/layout_tests/port/server_process.py:
+ Avoid to import fcntl on win32. Win32 Python doesn't have fcntl
+ and we don't use server_process.py on Win32 Python. However
+ unittest.py tries to load everything in a module.
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py:
+2010-09-07 Dirk Pranke <dpranke@chromium.org>
-2009-11-15 Adam Barth <abarth@webkit.org>
+ Reviewed by Kent Tamura.
- Reviewed by Darin Adler.
+ Fix regression introduced in previous change to new-run-webkit-tests
+ (bug 45090) to not try to run unittests for the Mac implementation
+ of the Port interface if we aren't running on a Mac.
- Add bugzilla-tool check-style
- https://bugs.webkit.org/show_bug.cgi?id=31515
+ Also fix the overrides implementation mock in the chromium unittests
+ to fix the case where there are overrides checked in that cause
+ problems.
- * Scripts/bugzilla-tool:
- * Scripts/modules/bugzilla.py:
+ https://bugs.webkit.org/show_bug.cgi?id=45357
-2009-11-13 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py:
- Reviewed by Simon Hausmann.
+2010-09-01 Dirk Pranke <dpranke@chromium.org>
- Make the Qt Linux only --valgrind feature, suppress errors
- defined in the SuppressedValgrindErrors file.
+ Reviewed by Ojan Vafai.
- * Scripts/run-webkit-tests:
+ new-run-webkit-tests: still more unit tests
-2009-11-13 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Clean up and remove unnecessary code. Biggest notable change is
+ moving the chromium-specific imagediff code from port/base to
+ port/chromium.
- Reviewed by Simon Hausmann.
+ Add more unit tests for run_webkit_tests.py, port/base.py,
+ port/factory.py, port/dryrun.py, and
+ layout_package/dump_render_tree_thread.py
- Set the locale to C and not to the current one in use on the system.
+ This covers almost all of the generic and test code paths except for
+ a few error paths involving invalid or port-specific command line
+ arguments, and the code path for uploading results files to the
+ buildbots.
+
+ https://bugs.webkit.org/show_bug.cgi?id=45090
+
+ * Scripts/webkitpy/layout_tests/data/failures/expected/hang.html: Added.
+ * Scripts/webkitpy/layout_tests/data/http/tests/passes/text-expected.txt: Copied from WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text-expected.txt.
+ * Scripts/webkitpy/layout_tests/data/http/tests/passes/text.html: Copied from WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text.html.
+ * Scripts/webkitpy/layout_tests/data/http/tests/ssl/text-expected.txt: Copied from WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text-expected.txt.
+ * Scripts/webkitpy/layout_tests/data/http/tests/ssl/text.html: Copied from WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text.html.
+ * Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt:
+ * Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text-expected.txt: Copied from WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text-expected.txt.
+ * Scripts/webkitpy/layout_tests/data/websocket/tests/passes/text.html: Copied from WebKitTools/Scripts/webkitpy/layout_tests/data/passes/text.html.
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ * Scripts/webkitpy/layout_tests/port/factory_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/port_testcase.py: Added.
+ * Scripts/webkitpy/layout_tests/port/server_process.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-09-07 Joseph Pecoraro <joepeck@webkit.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ Reviewed by Darin Adler.
-2009-11-13 Adam Roben <aroben@apple.com>
+ Provide a way to trigger a <select multiple> onchange event on changes
+ https://bugs.webkit.org/show_bug.cgi?id=45192
- Add support for
- http/tests/security/isolatedWorld/didClearWindowObject.html
+ Adds a selector on ObjCController for testing
+ -[DOMHTMLSelectElement _activateItemAtIndex:allowMultipleSelection:] and
+ its different uses.
- Fixes <http://webkit.org/b/31124> Tell the WebFrameLoadDelegate when
- window objects in isolated worlds are cleared
+ * DumpRenderTree/mac/ObjCController.m:
+ (+[ObjCController isSelectorExcludedFromWebScript:]):
+ (+[ObjCController webScriptNameForSelector:]):
+ (-[ObjCController setSelectElement:selectedIndex:allowingMultiple:]):
- Reviewed by Dave Hyatt.
+2010-09-07 James Robinson <jamesr@chromium.org>
- * DumpRenderTree/mac/DumpRenderTreeMac.h: Declared worldIDForWorld.
+ Rubber-stamped by Dimitri Glazkov.
- * DumpRenderTree/mac/FrameLoadDelegate.mm:
- (-[FrameLoadDelegate didClearWindowObjectInStandardWorldForFrame:]):
- Added. Moved code here from -webView:didClearWindowObject:forFrame:.
- (-[FrameLoadDelegate didClearWindowObjectForFrame:inIsolatedWorld:]):
- Added. Sets a __worldID property on the global object whose value is
- the ID of this world.
- (-[FrameLoadDelegate webView:didClearWindowObjectForFrame:inScriptWorld:]):
- Respond to this new delegate callback by calling through to one of the
- above new methods.
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (worldMap): Added. Returns a HashMap containing all the worlds we've
- created.
- (worldIDForWorld): Added. Returns the ID for this world, or 0 if we
- haven't kept track of this world.
- (LayoutTestController::evaluateScriptInIsolatedWorld): Use worldMap()
- instead of declaring our own.
-
- * DumpRenderTree/win/DumpRenderTreeWin.h: Declared worldIDForWorld.
-
- * DumpRenderTree/win/FrameLoadDelegate.cpp:
- (FrameLoadDelegate::didClearWindowObject): Moved code from hear to
- didClearWindowObjectForFrameInStandardWorld.
- (FrameLoadDelegate::didClearWindowObjectForFrameInScriptWorld):
- Respond to this new delegate callback by calling through to one of the
- below new methods.
- (FrameLoadDelegate::didClearWindowObjectForFrameInIsolatedWorld):
- Added. Sets a __worldID property on the gobal object whose value is
- the ID of this world.
- (FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld):
- Added. Moved code here from didClearWindowObject.
-
- * DumpRenderTree/win/FrameLoadDelegate.h: Added the
- didClearWindowObjectForFrame* functions.
+ Move myself from the committer to the reviewer list.
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (worldMap): Added. Returns a HashMap containing all the worlds we've
- created.
- (worldIDForWorld): Added. Returns the ID of this world, or 0 if we
- haven't kept track of this world.
- (LayoutTestController::evaluateScriptInIsolatedWorld): Use worldMap()
- instead of declaring our own.
+ * Scripts/webkitpy/common/config/committers.py:
-2009-11-13 Adam Roben <aroben@apple.com>
+2010-09-07 Tony Chang <tony@chromium.org>
- Finish replacing worldIDs with world objects
+ Reviewed by Darin Fisher.
- The only remaining use of worldIDs was in a method only used by DRT
- for the isolated worlds tests.
+ [chromium] Make a public flag for how DRT generates bitmaps on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=45133
- Fixes <http://webkit.org/b/31414> Replace worldIDs with world objects
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dumpImage):
- Reviewed by Mark Rowe.
+2010-09-07 Kent Tamura <tkent@chromium.org>
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::evaluateScriptInIsolatedWorld):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::evaluateScriptInIsolatedWorld):
- Updated for changes to WebFrame. Now holds the map of worldID -> world
- at this level instead of making WebKit do it.
+ Reviewed by Dimitri Glazkov.
-2009-11-13 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ [DRT/Chromium] Implement --check-layout-test-sys-deps
+ https://bugs.webkit.org/show_bug.cgi?id=45283
- Reviewed by Simon Hausmann.
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main): Check --check-layout-test-sys-deps and call checkLayoutTestSystemDependencies().
+ * DumpRenderTree/chromium/TestShell.h: Declare checkLayoutTestSystemDependencies().
+ * DumpRenderTree/chromium/TestShellGtk.cpp:
+ (checkLayoutTestSystemDependencies): Add an empty implementation.
+ * DumpRenderTree/chromium/TestShellMac.mm:
+ (checkLayoutTestSystemDependencies): Add an empty implementation.
+ * DumpRenderTree/chromium/TestShellWin.cpp:
+ (checkLayoutTestSystemDependencies): Port similar function of test_shell.
- [Qt] Ensure the DRT does not output anything until first test is run
+2010-09-07 Jessie Berlin <jberlin@apple.com>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- * DumpRenderTree/qt/DumpRenderTree.h:
+ Unreviewed. Mac build fix.
-2009-11-13 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (didClearWindowObjectForFrame):
- Reviewed by Tor Arne Vestbø.
+2010-09-07 Jessie Berlin <jberlin@apple.com>
- Clear the undo stack in before each new test run.
+ Reviewed by Darin Adler.
- Locally fixes 3 incorrect layouts, 9 timeouts and 7 crashes.
+ Indicate which one of the ScriptWorlds for a Frame the Window Object has been cleared for
+ https://bugs.webkit.org/show_bug.cgi?id=45217
+
+ Make WebKitTestRunner work with this change.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didClearWindowForFrame):
+ Make sure the ScriptWorld here is the normal world, since that is no longer being done in
+ WebFrameLoaderClient.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
-2009-11-13 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+2010-09-07 Philippe Normand <pnormand@igalia.com>
- Reviewed by Kenneth Rohde Christiansen.
+ Unreviewed, build fix.
- [Qt] Add WebKitUsesPageCachePreferenceKey overriding support to DRT's LayoutTestController.
+ webkit-patch command to find the ports covering a specific layout test
+ https://bugs.webkit.org/show_bug.cgi?id=42832
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::resetSettings):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::overridePreference):
+ * Scripts/webkitpy/layout_tests/port/chromium.py: Don't assume the
+ tests are present when building the expectations. This is needed
+ for the unittests.
-2009-11-13 Eric Seidel <eric@webkit.org>
+2010-09-06 Philippe Normand <pnormand@igalia.com>
Reviewed by Adam Barth.
- Update committers.py based on svn records
- https://bugs.webkit.org/show_bug.cgi?id=31366
+ webkit-patch command to find the ports covering a specific layout test
+ https://bugs.webkit.org/show_bug.cgi?id=42832
- This list was generated using validate-committer-lists from
- https://bugs.webkit.org/show_bug.cgi?id=30970
- and makes committers.py current for committers who have
- committed in the last 3 years.
+ To use it: webkit-patch skipped-ports some/layout/test.html
- * Scripts/modules/committers.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/factory_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-09-07 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
-2009-11-12 Anantanarayanan G Iyengar <ananta@chromium.org>
+ Reviewed by Eric Seidel.
- Reviewed by Adam Barth.
+ [NRWT] Add temp directory to all running drivers.
+ https://bugs.webkit.org/show_bug.cgi?id=45261
- The document-open.html test was flaky at times. The test invokes the layout test plugin
- which in its destroy stream handler opens a new document. This basically tears down the
- stream and the associated plugin instance. The pluginLog function in the layout test
- plugin attempts to retrieve the window script object on a torn down plugin instance
- which crashed consistently on windows in the debugger. The functions which issue
- these logs already have a valid window script object. We now have variants of the pluginLog
- function which take in a window script object with and without variable arguments.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
- https://bugs.webkit.org/show_bug.cgi?id=31067
+2010-09-06 Dimitri Glazkov <dglazkov@chromium.org>
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
- (pluginLogWithWindowObject):
- (pluginLogWithWindowObjectVariableArgs):
- (pluginLog):
- (notifyTestCompletion):
- (testDocumentOpen):
- (testWindowOpen):
+ Reviewed by Kent Tamura.
-2009-11-12 Joanmarie Diggs <joanmarie.diggs@gmail.com>
+ [Chromium/DRT] Empty out user stylesheet after each test run.
+ https://bugs.webkit.org/show_bug.cgi?id=45282
- Reviewed by Gustavo Noronha Silva.
+ This should significantly cut down on the number of the mysterious flaky tests
+ whose diffs looked like the page was blown up to a very lage size. This
+ was indeed the dirty work of platform/mac/fast/loader/user-stylesheet-fast-path.html,
+ which set the base body font to 100px.
- https://bugs.webkit.org/show_bug.cgi?id=30997
- [Gtk] Implemment AtkDocument
+ Since the user stylesheet was never reset, _all_ pixel tests that ran after it in
+ the same thread failed.
- Added testing support.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings): Set user stylesheet to an empty URL.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- * DumpRenderTree/AccessibilityUIElement.h:
- (getDocumentEncodingCallback):
- (getDocumentURICallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::documentEncoding):
- (AccessibilityUIElement::documentURI):
+2010-09-06 Kent Tamura <tkent@chromium.org>
-2009-11-12 Adam Roben <aroben@apple.com>
+ Reviewed by Dimitri Glazkov.
- Replace worldIDs with world objects
+ [DRT/Chromium] Do not generate pixel results for text/plain resources
+ https://bugs.webkit.org/show_bug.cgi?id=45253
- Part of <http://webkit.org/b/31414> Implement new SPI for dealing with
- user scripts/stylesheets and isolated worlds
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dump): Clear shouldGeneratePixelResults flag for text/plain.
- Reviewed by Sam Weinig.
+2010-09-06 Ojan Vafai <ojan@chromium.org>
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::addUserScript):
- (LayoutTestController::addUserStyleSheet):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::addUserScript):
- (LayoutTestController::addUserStyleSheet):
- Changed these functions to create a new WebJSWorld each time they're
- called and to pass that world to WebKit.
+ Reviewed by Kent Tamura.
-2009-11-11 Chris Fleizach <cfleizach@apple.com>
+ print out correct error when a DRT thread dies in NRWT
+ https://bugs.webkit.org/show_bug.cgi?id=45281
- Reviewed by Oliver Hunt.
+ Not sure why, but with the parens, python 2.6.5 on Linux
+ gives an error that raise takes 5 arguments and 0 were given.
+ Didn't test other platforms or python versions, but putting it
+ all on one line fixes it and correctly prints the exception
+ from the DRT thread.
- need to implement aria tree roles
- https://bugs.webkit.org/show_bug.cgi?id=31284
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (disclosedRowAtIndexCallback):
- (selectedRowAtIndexCallback):
- (isEqualCallback):
- (isAttributeSettableCallback):
- (isActionSupportedCallback):
- (disclosedByRowCallback):
- (hierarchicalLevelCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- (AccessibilityUIElement::isEqual):
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::hierarchicalLevel):
- (AccessibilityUIElement::disclosedRowAtIndex):
- (AccessibilityUIElement::selectedRowAtIndex):
- (AccessibilityUIElement::disclosedByRow):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::getChildAtIndex):
- (AccessibilityUIElement::disclosedRowAtIndex):
- (AccessibilityUIElement::selectedRowAtIndex):
- (AccessibilityUIElement::titleUIElement):
- (AccessibilityUIElement::parentElement):
- (AccessibilityUIElement::disclosedByRow):
- (AccessibilityUIElement::hierarchicalLevel):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::hierarchicalLevel):
- (AccessibilityUIElement::disclosedRowAtIndex):
- (AccessibilityUIElement::selectedRowAtIndex):
- (AccessibilityUIElement::disclosedByRow):
+2010-09-06 Eric Seidel <eric@webkit.org>
-2009-11-11 Shinichiro Hamaji <hamaji@chromium.org>
+ Unreviewed, just adding some emails from lists.webkit.org.
- Reviewed by Darin Adler.
+ Update committers.py to include emails from lists.webkit.org
+ as found by the validate-committer-lists script.
- svn-apply can not handle git binary diffs
- https://bugs.webkit.org/show_bug.cgi?id=26830
+ * Scripts/webkitpy/common/config/committers.py:
- Support "literal" type git binary diffs.
+2010-09-06 Martin Robinson <mrobinson@igalia.com>
- * Scripts/VCSUtils.pm:
- * Scripts/modules/scm_unittest.py:
- * Scripts/svn-apply:
+ Reviewed by Xan Lopez.
-2009-11-11 Dmitry Titov <dimich@chromium.org>
+ [GTK] Small code cleanup in DumpRenderTreeGtk.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=45213
- Not reviewed, removing duplicate entry for myself in committers.py.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeFonts): Made this function do nothing for non-X11 platforms, so we don't
+ have to surround the invocation with #ifdefs.
+ (useLongRunningServerMode): Added.
+ (runTestingServerLoop): Added.
+ (initializeGlobalsFromCommandLineOptions): Added.
+ (runTest): Removed ifdefs.
+ (main): Use new helper functions.
- * Scripts/modules/committers.py:
+2010-09-06 Martin Robinson <mrobinson@igalia.com>
-2009-11-11 Alexey Proskuryakov <ap@apple.com>
+ Reviewed by Xan Lopez.
- Reviewed by Darin Adler and Mark Rowe.
+ [GTK] EventSender should support modifier keys with mouseDown and mouseUp events
+ https://bugs.webkit.org/show_bug.cgi?id=45235
- https://bugs.webkit.org/show_bug.cgi?id=31200
- Tests in http/tests/security/mixedContent start to fail when new tests are added
+ Add support for interpreting the modifier key arguments to the mouseDown and mouseUp
+ methods of the EventSender.
- * DumpRenderTree/mac/DumpRenderTree.mm: (dumpRenderTree): Added a workaround for Tiger bug.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (prepareMouseButtonEvent): Allow passing in a modifier bitmask, which will be OR'd
+ with the current modifiers.
+ (contextClickCallback): Always send no modifiers when preparing the mouse event.
+ (gdkModifersFromJSValue): Added, converts a JSValue array into a GDK modifier bitmask.
+ (mouseDownCallback): Send in the requested modifiers to prepareMouseButtonEvent.
+ (mouseUpCallback): Ditto.
-2009-11-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+2010-09-05 Peter Kasting <pkasting@google.com>
- Reviewed by Jan Alonzo.
+ Reviewed by Adam Barth.
- Create, and display a window for the inspector, for inspector
- tests.
+ Make Chromium/Mac generate continuous mousewheel events with the same wheelDelta values as Safari/Mac.
+ https://bugs.webkit.org/show_bug.cgi?id=45155
- Need to also show/hide the inspector window to avoid having
- problems with code assuming it is realized
- https://bugs.webkit.org/show_bug.cgi?id=31347
+ * DumpRenderTree/chromium/EventSender.cpp: Modify Chromium DRT mousewheel event generation to match new behavior on Mac.
+ (EventSender::handleMouseWheel):
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (webInspectorShowWindow):
- (webInspectorCloseWindow):
- (webInspectorInspectWebView):
- (createWebView):
+2010-09-05 Yury Semikhatsky <yurys@chromium.org>
-2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Reviewed by Joseph Pecoraro.
- Unreviewed Qt buildbot fix.
+ Web Inspector: remove WebDevToolsAgentClient::forceRepaint which is not used
+ https://bugs.webkit.org/show_bug.cgi?id=45179
- My previous fix was wrong, so revert that change and fix it by
- returning when the document of the frame has no document element.
- Idea is borrowed from mac and win DRT.
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::dumpFramesAsText):
+2010-09-05 Andreas Kling <andreas.kling@nokia.com>
-2009-11-11 Eric Seidel <eric@webkit.org>
+ Rubber-stamped by Daniel Bates.
- Reviewed byg Kenneth Rohde Christiansen.
+ Adding myself as reviewer.
- Update Kenneth's committer record to include the email he
- uses on lists.webkit.org.
+ * Scripts/webkitpy/common/config/committers.py:
- * Scripts/modules/committers.py:
+2010-09-04 Daniel Bates <dbates@rim.com>
-2009-11-11 Eric Seidel <eric@webkit.org>
+ Reviewed by Martin Robinson.
- Reviewed by Gustavo Noronha Silva.
+ Teach svn-apply/unapply about svn:mergeinfo
+ https://bugs.webkit.org/show_bug.cgi?id=45236
- Several committers use separate email addresses for bugzilla and svn.webkit.org
- https://bugs.webkit.org/show_bug.cgi?id=31364
+ Recognize the svn:mergeinfo property and ignore it for now.
- Update records for existing committers to include email addresses
- used in svn.webkit.org and lists.webkit.org.
- Most committers use the same email address in all 3 places, but some use
- separate addresses. committers.py needs record of each of these addresses.
+ Currently, svn-apply/unapply recognize only '+' and '-'
+ property changes within a diff. We should add support
+ to recognize "Merged" and "Reverse-merged" changes as well.
+ Because svn:mergeinfo is metadata that is used only by SVN
+ and tends to be error-prone and/or nuisance (*), we will ignore
+ it for now.
+ (*) See "Parting Thoughts" of <http://www.collab.net/community/subversion/articles/merge-info.html>.
- * Scripts/modules/committers.py:
+ * Scripts/VCSUtils.pm:
+ - Modified parseSvnProperty() to recognize "Merged" and
+ "Reverse-merged" as the start of a property value.
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl:
+ - Added the following unit tests:
+ "simple: add svn:mergeinfo"
+ "simple: delete svn:mergeinfo"
+ "simple: modified svn:mergeinfo"
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl:
+ - Added the following unit tests:
+ "simple: add svn:mergeinfo"
+ "simple: delete svn:mergeinfo"
+ "simple: modified svn:mergeinfo"
+ "simple: modified svn:mergeinfo using SVN 1.4 syntax"
+ "'Merged' change followed by 'Merged' change"
+ "'Reverse-merged' change followed by 'Reverse-merged' change"
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl:
+ - Added the following unit tests:
+ "'Merged' change"
+ "'Reverse-merged' change"
+ "'Reverse-merged' change followed by 'Merge' change"
+ "'Merged' change followed by 'Merge' change"
+ "'Reverse-merged' change followed by 'Reverse-merged' change"
+ "'Reverse-merged' change followed by 'Reverse-merged' change followed by 'Merged' change"
+
+2010-09-04 Lucas De Marchi <lucas.demarchi@profusion.mobi>
-2009-11-11 Eric Seidel <eric@webkit.org>
+ Reviewed by Kenneth Rohde Christiansen.
- No review, adding second email address for an existing committer.
+ [EFL] Move test browser to WebKitTools directory
+ https://bugs.webkit.org/show_bug.cgi?id=45212
+
+ Follow other ports like QT and GTK which moved the test browser to
+ WebKitTools directory.
+
+ * CMakeListsEfl.txt: Added.
+ * EWebLauncher/main.c: Added.
+ (print_history):
+ (zoom_level_set):
+ (on_ecore_evas_resize):
+ (title_set):
+ (viewport_set):
+ (on_title_changed):
+ (on_progress):
+ (on_load_finished):
+ (on_toolbars_visible_set):
+ (on_toolbars_visible_get):
+ (on_statusbar_visible_set):
+ (on_statusbar_visible_get):
+ (on_scrollbars_visible_set):
+ (on_scrollbars_visible_get):
+ (on_menubar_visible_set):
+ (on_menubar_visible_get):
+ (on_tooltip_text_set):
+ (on_inputmethod_changed):
+ (on_viewport_changed):
+ (on_mouse_down):
+ (on_focus_out):
+ (on_focus_in):
+ (on_resized):
+ (on_key_down):
+ (on_browser_del):
+ (on_closeWindow):
+ (quit):
+ (browserCreate):
+ (browserDestroy):
+ (closeWindow):
+ (main_signal_exit):
+ (findThemePath):
+ (main):
- Add Yong Li's second bugzilla account to his committer record.
- See: https://bugs.webkit.org/show_bug.cgi?id=27371#c27
+2010-09-03 Simon Fraser <simon.fraser@apple.com>
- * Scripts/modules/committers.py:
+ Reviewed by Adam Roben.
-2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Set project dependencies so that they build serially. This fixes
+ issues when running run-webkit-tests if DRT is not built yet.
- Reviewed by Simon Hausmann.
+ * DumpRenderTree/DumpRenderTree.sln:
- If the frame has no innerText don't append it, and
- do not add a newline which breaks some cross platform
- results.
+2010-09-03 Dimitri Glazkov <dglazkov@chromium.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::dumpFramesAsText):
+ Reviewed by Adam Barth.
-2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Fix reading configuraiton in NWRT to work on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=45180
- Reviewed by Simon Hausmann.
+ * Scripts/webkitpy/layout_tests/port/base.py: Added 'perl' argument, because Windows doesn't know what to do
+ with the file otherwise.
- Implement missing functionality in the Gtk/Qt TestNetscapePlugin.
+2010-09-03 Chris Rogers <crogers@google.com>
- * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
- (webkit_test_plugin_new_instance):
- (webkit_test_plugin_destroy_instance):
- (webkit_test_plugin_destroy_stream):
+ Unreviewed
-2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Add myself to the committers list
+ https://bugs.webkit.org/show_bug.cgi?id=45189
- Reviewed by Mark Rowe.
+ * Scripts/webkitpy/common/config/committers.py:
- Implement the functionality needed by plugins/window-open.html
+2010-09-03 Andrey Kosyakov <caseq@chromium.org>
- * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
- (webkit_test_plugin_new_instance):
- (webkit_test_plugin_set_window):
+ Reviewed by Yury Semikhatsky.
-2009-11-11 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ http/tests/inspector/console-xhr-logging.html and http/tests/inspector/resource-har-conversion.html are failing on chromium win bot
+ Changed MIME type for .js to application/x-javascript for consistency with apache used on other platforms.
+ https://bugs.webkit.org/show_bug.cgi?id=45137
- Reviewed by Simon Hausmann.
+ * Scripts/webkitpy/layout_tests/port/lighttpd.conf:
- [Qt] Force -graphicssystem raster and -style windows when running DRT
+2010-09-03 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- * DumpRenderTree/qt/main.cpp:
- * Scripts/run-webkit-tests:
+ Reviewed by Eric Seidel.
-2009-11-11 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ Add feature detection support to NRWT.
+ https://bugs.webkit.org/show_bug.cgi?id=41842
- Reviewed by Simon Hausmann.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: Added.
- Compute correct library paths for Qt
+2010-09-03 Hironori Bono <hbono@chromium.org>
- * Scripts/webkitdirs.pm:
+ Reviewed by Kent Tamura.
-2009-11-10 Mark Rowe <mrowe@apple.com>
+ Adds textInputController.hasSpellingMarker() to avoid using pixel tests for spellchecking tests
+ and implements it for Mac.
+ https://bugs.webkit.org/show_bug.cgi?id=41832
- Reviewed by Sam Weinig.
+ * DumpRenderTree/mac/TextInputController.m: Added [TextInputController hasSpellingMarker:length:]
+ and bind it so we can call it from JavaScript.
+ (+[TextInputController isSelectorExcludedFromWebScript:]):
+ (+[TextInputController webScriptNameForSelector:]):
+ (-[TextInputController hasSpellingMarker:length:]):
- <http://webkit.org/b/31200> Tests in http/tests/security/mixedContent start to fail when new tests are added
+2010-09-02 Eric Seidel <eric@webkit.org>
- The first request to an HTTPS URL results in didFailProvisionalLoadWithError being called with an error
- about the validity of the self-signed certificates used in the regression tests. We would then add the
- host to the ignore list for SSL certificate errors and retry the request. If this happened during a test
- that had enabled frame load delegate logging this would result in extra log messages being generated,
- causing the test to fail.
+ Reviewed by Adam Barth.
- We address this by explicitly ignoring SSL certificate errors for localhost and 127.0.0.1 before running any
- tests.
+ Add a unit test for commit-queue retries
+ https://bugs.webkit.org/show_bug.cgi?id=45162
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (dumpRenderTree):
- * DumpRenderTree/mac/FrameLoadDelegate.mm:
- (-[FrameLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]):
+ I think commit-queue retries are not correctly avoiding
+ build and test on retries. So I started testing the code.
+ Unfortunately this test did not find the bug. But now
+ that we have the test we might as well keep it.
+ I also fixed a broken import in validate-committer-lists.
-2009-11-10 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+ * Scripts/validate-committer-lists:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- Reviewed by Kenneth Rohde Christiansen.
+2010-09-02 Kent Tamura <tkent@chromium.org>
- [Qt] Remove obsolete scrollbar policy settings from DRT constructor.
+ Reviewed by Dimitri Glazkov.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
+ [DRT/Chromium] Remove dependency to base/task.h and base/timer.h
+ https://bugs.webkit.org/show_bug.cgi?id=45091
+
+ Task.{cpp,h} introduces a simpler version of Chromium
+ base/task.h. It doesn't have TupleN and Method.
+
+ * DumpRenderTree/DumpRenderTree.gypi:
+ Add Task.cpp and Task.h
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ (DRTDevToolsAgent::DRTDevToolsAgent):
+ (DRTDevToolsAgent::reset):
+ (DRTDevToolsAgent::asyncCall):
+ (DRTDevToolsAgent::frontendLoaded):
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
+ (DRTDevToolsAgent::taskList): Added to use MethodTask<T>.
+ * DumpRenderTree/chromium/DRTDevToolsClient.cpp:
+ (DRTDevToolsClient::DRTDevToolsClient):
+ (DRTDevToolsClient::~DRTDevToolsClient):
+ (DRTDevToolsClient::reset):
+ (DRTDevToolsClient::asyncCall):
+ * DumpRenderTree/chromium/DRTDevToolsClient.h:
+ (DRTDevToolsClient::taskList): Added to use MethodTask<T>.
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::EventSender):
+ (EventSender::reset):
+ (EventSender::scheduleAsynchronousClick):
+ * DumpRenderTree/chromium/EventSender.h:
+ (EventSender::taskList): Added to use MethodTask<T>.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::WorkQueue::processWorkSoon):
+ (LayoutTestController::waitUntilDone):
+ (LayoutTestController::notifyDone):
+ (LayoutTestController::reset):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController::taskList): Added to use MethodTask<T>.
+ (LayoutTestController::WorkQueue::taskList): Added to use MethodTask<T>.
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
+ (deferredDisplayDispatch):
+ (NotificationPresenter::show):
+ * DumpRenderTree/chromium/Task.cpp: Added.
+ * DumpRenderTree/chromium/Task.h: Added.
-2009-11-10 Philippe Normand <pnormand@igalia.com>
+2010-09-02 Steve Block <steveblock@google.com>
- Reviewed by Jan Alonzo.
+ Reviewed by Adam Barth.
- [GTK] Remove WebSocket configuration from WebKitWebSettings
- https://bugs.webkit.org/show_bug.cgi?id=31244
+ Hook up LayoutTestController.setMockDeviceOrientation() on Mac.
+ https://bugs.webkit.org/show_bug.cgi?id=43181
- Follow-up of r50724. Don't set the enable-web-socket property
- anymore.
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (createWebViewAndOffscreenWindow):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockDeviceOrientation):
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+2010-08-31 Adam Roben <aroben@apple.com>
-2009-11-10 Oliver Hunt <oliver@apple.com>
+ Fix flashiness when resizing the browser window on Windows
- Reviewed by Maciej Stachowiak.
+ Reviewed by Sam Weinig.
- Rename 3D Canvas related classes to use WebGL prefix
- https://bugs.webkit.org/show_bug.cgi?id=29095
+ * MiniBrowser/win/BrowserWindow.cpp:
+ (BrowserWindow::wndProc): Override WM_ERASEBKGND so Windows won't
+ periodically fill the window with white.
- Checkin new version of do-webcore-rename used to do the WebGL type rename,
- and upate webkitdirs script to new method of testing for WebGL.
+2010-09-02 Peter Kasting <pkasting@google.com>
- * Scripts/do-webcore-rename:
- * Scripts/webkitdirs.pm:
+ Reviewed by Dimitri Glazkov.
-2009-11-09 Oliver Hunt <oliver@apple.com>
+ Implement [continuous]MouseScrollBy() on Chromium, and partly on GTK.
+ https://bugs.webkit.org/show_bug.cgi?id=45073
- Reviewed by Geoff Garen.
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::EventSender):
+ (EventSender::mouseScrollBy):
+ (EventSender::continuousMouseScrollBy):
+ (EventSender::sendCurrentTouchEvent):
+ (EventSender::handleMouseWheel):
+ * DumpRenderTree/chromium/EventSender.h:
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (mouseScrollByCallback):
+ (continuousMouseScrollByCallback):
- Make do-webcore-rename work with git.
+2010-09-01 Dirk Pranke <dpranke@chromium.org>
- * Scripts/do-webcore-rename:
+ Reviewed by Tony Chang.
-2009-11-09 Simon Hausmann <simon.hausmann@nokia.com>
+ Land a patched version of r66542 - change TestRunner to have an
+ separate cleanup method and fix the ordering of cleanup between
+ TestRunner and the printing module, and then wrap everything in a
+ try/finally block to ensure reliable cleanup without needing to
+ rely on stuff happening in the destructor of the TestRunner.
- Adding Kenneth to the reviewers list.
+ Also refactor run_webkit_tests.run() to be much smaller and cleaner
+ by creating a bunch of helper methods and moving more stuff into
+ the TestRunner class.
- * Scripts/modules/committers.py:
+ This fixes the crash at the end of the linux test run of
+ new-run-webkit-tests (and undoes the rollout in 66547).
-2009-11-09 Martin Robinson <martin.james.robinson@gmail.com>
+ https://bugs.webkit.org/show_bug.cgi?id=44902
- Reviewed by Jan Alonzo.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/exception.html: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/keyboard.html: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/error-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/error.html: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- [GTK] Expose Page::tabKeyCyclesThroughElements in the API
- https://bugs.webkit.org/show_bug.cgi?id=30482
+2010-09-01 Mark Rowe <mrowe@apple.com>
- LayoutTestControllerGtk now uses the exposed
- Page::tabKeyCyclesThroughElements API
+ Reviewed by Adam Roben.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setTabKeyCyclesThroughElements):
+ Fix TestNetscapePlugIn to compile without access to QuickDraw private headers.
-2009-11-08 Shu Chang <Chang.Shu@nokia.com>
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
- Reviewed by Holger Freyther.
+2010-09-01 Brian Weinstein <bweinstein@apple.com>
- [Qt] Added support for key code 8 (backspace) in EventSenderQt.
- This helps to pass the test case below. Also replaced hardcoded
- code numbers with defined constants.
- https://bugs.webkit.org/show_bug.cgi?id=31185
-
- Test: editing/undo/undo-deleteWord.html
+ Reviewed by Adam Roben.
- * DumpRenderTree/qt/EventSenderQt.cpp:
- (EventSender::keyDown):
+ Have kill-old-processes kill debug and release variants of WebKit2WebWebProcess
+ and WebKitTestRunner.
-2009-11-07 Antonio Gomes <tonikitoo@webkit.org>
+ * BuildSlaveSupport/win/kill-old-processes:
- Reviewed by Holger Freyther.
+2010-09-01 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- [Qt] [DRT] Fix wrong logic in LayoutTestController processWork
- https://bugs.webkit.org/show_bug.cgi?id=31164
+ Reviewed by Antonio Gomes.
- Fixed wrong logic to assume WorkQueue is done in QT's DRT.
+ [Qt] Remove obsolete include path from DumpRenderTree.pro
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::processWork):
+ * DumpRenderTree/qt/DumpRenderTree.pro:
-2009-11-05 Antonio Gomes <tonikitoo@webkit.org>
+2010-09-01 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
- Reviewed by Holger Freyther.
+ Reviewed by Laszlo Gombos.
- [Qt][DRT] Replace queueScript by queueNonLoadingScript and queueLoadingScript method
- https://bugs.webkit.org/show_bug.cgi?id=31158
+ [Qt] QWebPage::allowGeolocationRequest should be async API
+ https://bugs.webkit.org/show_bug.cgi?id=41364
- By invoking a script queue'd by queueScript(), 'true' was beeing returned
- always, which from WorkQueue prospective means that a load has been started
- and the queue processing should stop and wait for the load to finish.
- Spinning it off into a loading and a non-loading variants was the solution
- adopted by Mac's DRT to work around this problem. The former keeps returning
- 'true' while the later executes the script synchronously and returns 'false'
- making it possible to the WorkQueue to proceed right away.
+ Implements new async API for geolocation permission similar to
+ Notification. WebPage maintains list of geolocation permission request
+ QtWebkit and set's when LayoutTestController gets the access from test JS
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ (WebCore::WebPage::requestPermission):
+ (WebCore::WebPage::cancelPermission):
+ (WebCore::WebPage::permissionSet):
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::processLine):
+ (WebCore::DumpRenderTree::geolocationPermissionSet):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::processWork):
- (LayoutTestController::queueLoadingScript):
- (LayoutTestController::queueNonLoadingScript):
+ (LayoutTestController::reset):
+ (LayoutTestController::setGeolocationPermission):
+ (LayoutTestController::setGeolocationPermissionCommon):
* DumpRenderTree/qt/LayoutTestControllerQt.h:
- * DumpRenderTree/qt/WorkQueueItem.h:
- (LoadingScriptItem::LoadingScriptItem):
- (LoadingScriptItem::invoke):
- (NonLoadingScriptItem::NonLoadingScriptItem):
- (NonLoadingScriptItem::invoke):
-2009-11-07 Mark Rowe <mrowe@apple.com>
+2010-09-01 Andras Becsi <abecsi@webkit.org>
- Rubber-stamped by Cameron Zwarich.
+ Reviewed by Antti Koivisto.
- Invoke prepare-ChangeLog via an absolute path rather than assuming it can be found in PATH.
+ [Qt] Auto-generate WebKit2 forwarding headers
+ https://bugs.webkit.org/show_bug.cgi?id=44692
- * Scripts/commit-log-editor:
+ * MiniBrowser/qt/BrowserWindow.h: use source style includes
+ * MiniBrowser/qt/MiniBrowser.pro: add missing include paths
+ * Scripts/enumerate-included-framework-headers: Removed.
-2009-11-07 Mark Rowe <mrowe@apple.com>
+2010-08-31 Ademar de Souza Reis Jr <ademar.reis@openbossa.org>
- Reviewed by Darin Adler.
+ Reviewed by Adam Barth.
- Fix <https://bugs.webkit.org/show_bug.cgi?id=28168>.
- commit-log-editor does not support all the email address configurations that prepare-Changelog supports
+ Allow Ctrl+C inside Bugzilla::fetch_bug_dictionary
+ https://bugs.webkit.org/show_bug.cgi?id=44789
- Move logic for determining the name and email address to use in a ChangeLog entry from
- prepare-ChangeLog to VCSUtils so that commit-log-editor can use it. It wants to check
- whether the author of the patch matches committer, and therefore needs access to the
- email address that would be used in a ChangeLog entry.
+ * Scripts/webkitpy/common/net/bugzilla.py:
- Based on a patch by Pierre d'Herbemont.
-
- * Scripts/VCSUtils.pm:
- * Scripts/commit-log-editor:
- * Scripts/prepare-ChangeLog:
- * Scripts/webkitdirs.pm:
-
-2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org>
+2010-08-31 Leandro Pereira <leandro@profusion.mobi>
Reviewed by Adam Barth.
- Added functionality to the layout test plugin to invoke document.open and
- window.open with default arguments. The associated webkit bug is
- https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium. Basically
- window.open and document.open calls issued by NPAPI plugins via NPN_Invoke don't
- work in Chromium (V8) if there is no calling javascript context. To achieve this
- effect we invoke these functions in the layout test plugin in the NPP_SetWindow
- for the window.open test case and in NPP_DestroyStream for the document.open test case.
+ ews: Add support for EFL-EWS
+ https://bugs.webkit.org/show_bug.cgi?id=44982
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
- (testDocumentOpen):
- (testWindowOpen):
- (pluginAllocate):
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
- * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
- (NPP_New):
- (NPP_SetWindow):
- (NPP_DestroyStream):
- * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
- (NPP_New):
- (NPP_SetWindow):
- (NPP_NewStream):
- (NPP_DestroyStream):
+ * QueueStatusServer/model/queues.py: Add "efl-ews" to queues list.
+ * Scripts/webkitpy/common/config/ports.py: Define a EflPort class
+ and add it to the ports dict.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py: Define a
+ EflEWS class.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py: Add
+ a test case for the EFL EWS.
-2009-11-06 Eric Seidel <eric@webkit.org>
+2010-08-31 Alexey Proskuryakov <ap@apple.com>
- Reviewed by Adam Barth.
-
- bugzilla-tool crashed with exception
- https://bugs.webkit.org/show_bug.cgi?id=31092
-
- * Scripts/modules/bugzilla.py: Change a ',' to a '%' to fix the error.
+ Reviewed by Sam Weinig.
-2009-11-04 Eric Seidel <eric@webkit.org>
+ https://bugs.webkit.org/show_bug.cgi?id=42195
+ <rdar://problem/8186761> WebKitTestRunner needs to support layoutTestController.setXSSAuditorEnabled
- No review, just add a line which got left out of the patch uploaded for commit.
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: (WTR::LayoutTestController::setXSSAuditorEnabled):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ Added setXSSAuditorEnabled, calling through to an WKBundle private method. Calling this method
+ makes WebProcess use a different value for this preference than UIProcess thinks it uses.
- commit-queue is crashing when trying to reject patches after unknown failures
- https://bugs.webkit.org/show_bug.cgi?id=31091
+ * WebKitTestRunner/TestController.cpp: (WTR::TestController::resetStateToConsistentValues):
+ Reset xssAuditorEnabled. Even though the value doesn't change, this calls through to WebProcess,
+ which forgets its override.
- * Scripts/bugzilla-tool: Set bug_log = None after closing to we don't re-close and crash.
+2010-08-31 Sam Weinig <sam@webkit.org>
-2009-11-04 Adam Roben <aroben@apple.com>
+ Reviewed by Gavin Barraclough.
- Remove bogus else clause in bugzilla-tool
+ WebKitTestRunner needs layoutTestController.addUserStyleSheet
+ https://bugs.webkit.org/show_bug.cgi?id=42680
- Fixes <http://webkit.org/b/31125> REGRESSION (r47121): bugzilla-tool
- create-bug raises exception after entering bug description
+ WebKitTestRunner needs layoutTestController.addUserScript
+ https://bugs.webkit.org/show_bug.cgi?id=42681
- Reviewed by David Kilzer.
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::beginTesting):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::addUserScript):
+ (WTR::LayoutTestController::addUserStyleSheet):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
- * Scripts/bugzilla-tool:
- (CreateBug): else clauses are only hit if no exception is raised, so
- it makes no sense to try to re-raise the exception in an else clause.
- The exception will automatically be re-raised if it doesn't match any
- of the except clauses, so we don't have to do anything special here at
- all to get the desired behavior.
+2010-08-31 Dirk Pranke <dpranke@chromium.org>
-2009-11-04 Eric Seidel <eric@webkit.org>
+ Unreviewed, rolling out r66542.
+ http://trac.webkit.org/changeset/66542
+ https://bugs.webkit.org/show_bug.cgi?id=44902
- Reviewed by David Kilzer.
+ r66542 - the weird logging dependencies in Python stuck again ...
- svn-apply's fixChangeLogPatch function seems broken
- https://bugs.webkit.org/show_bug.cgi?id=30683
+ * Scripts/webkitpy/layout_tests/data/failures/expected/exception.html: Removed.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/keyboard.html: Removed.
+ * Scripts/webkitpy/layout_tests/data/passes/error-expected.txt: Removed.
+ * Scripts/webkitpy/layout_tests/data/passes/error.html: Removed.
+ * Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- Update fixChangeLogPatch to be able to handle patches which
- don't start at line 1.
- Add unit tests for svn-apply to scm_unittest.py.
+2010-08-31 Dumitru Daniliuc <dumi@chromium.org>
- * Scripts/VCSUtils.pm:
- * Scripts/modules/scm_unittest.py:
+ Reviewed by Tony Chang.
-2009-11-04 Chris Fleizach <cfleizach@apple.com>
+ Implementing LayoutTestController::markerTextForListItem() in Chromium's DRT.
- Reviewed by Beth Dakin.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::markerTextForListItem):
+ * DumpRenderTree/chromium/LayoutTestController.h:
- Need to implement ARIA role="combobox"
- https://bugs.webkit.org/show_bug.cgi?id=31096
+2010-08-31 Dirk Pranke <dpranke@chromium.org>
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (showMenuCallback):
- (getIsExpandedCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::isExpanded):
- (AccessibilityUIElement::showMenu):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::isExpanded):
- (AccessibilityUIElement::showMenu):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::isSelected):
- (AccessibilityUIElement::isExpanded):
- (AccessibilityUIElement::showMenu):
+ Reviewed by Ojan Vafai.
-2009-11-04 Eric Seidel <eric@webkit.org>
+ new-run-webkit-tests: add more unit tests
- Reviewed by Adam Barth.
+ Add more unit tests for new-run-webkit-tests; we now cover all but
+ the most obscure code paths in the generic code. We still need to
+ add coverage for the http server and web socket paths, and add better
+ coverage of the platform-specific logic. Note that the rebaselining
+ tool is still not well tested.
- commit-queue is crashing when trying to reject patches after unknown failures
- https://bugs.webkit.org/show_bug.cgi?id=31091
+ Also clean up some of the configuration logic for the printing
+ module and the way it interacts with the Python logging module; that
+ is a crufty interface, to be certain.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44902
+
+ * Scripts/webkitpy/layout_tests/data/failures/expected/exception.html: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/keyboard.html: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/error-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/error.html: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- * Scripts/bugzilla-tool:
- - patch['id'] was a copy/paste mistake. This code has no 'patch' variable
- so we have to find out what the current patch is by asking bugzilla again.
- - Discovered that this code was also leaking file descriptors, so fixed that.
+2010-08-31 Darin Adler <darin@apple.com>
-2009-11-04 Adam Roben <aroben@apple.com>
+ Reviewed by Anders Carlsson.
- Make run-webkit-tests work for the Debug_Internal Windows
- configuration
+ * Scripts/check-for-global-initializers: Add a file that ends up having global initializers
+ in a debug build when built with certain compilers.
- In Debug_Internal, DumpRenderTree.exe and ImageDiff.exe have no _debug
- suffix.
+2010-08-31 Martin Robinson <mrobinson@igalia.com>
- Fixes <http://webkit.org/b/31123>.
+ Reviewed by Gustavo Noronha Silva.
- Reviewed by Sam Weinig.
+ [GTK] Isolate all GTK+ typedefs into one file
+ https://bugs.webkit.org/show_bug.cgi?id=44900
- * Scripts/run-webkit-tests: Don't add the _debug suffix in
- Debug_Internal, either.
+ * DumpRenderTree/gtk/EventSender.h: Remove GTK+ typedefs.
-2009-11-04 Eric Seidel <eric@webkit.org>
+2010-08-31 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- committers.py needs a way to store non-bugzilla email addresses
- https://bugs.webkit.org/show_bug.cgi?id=31037
+ Show more status on queue status pages
+ https://bugs.webkit.org/show_bug.cgi?id=44938
- Make Committer and Reviewer constructors take a single email or a list of emails.
- Change committer_by_bugzilla_email functions to committer_by_email to support lookup by any email.
- Expose reviewers(), used by validate-committer-lists on bug 30970.
+ I upped the number of status lines from 6 to 15 --
+ this has been bugging me for a while...
- * Scripts/modules/committers.py:
- * Scripts/modules/committers_unittest.py: Added tests for the new code.
+ I also disabled showing the chromium-win EWS queue
+ since it's been down for almost 5 months now.
-2009-11-03 Yuzo Fujishima <yuzo@google.com>
+ * QueueStatusServer/handlers/dashboard.py:
+ * QueueStatusServer/handlers/queuestatus.py:
+ * QueueStatusServer/model/queues.py:
- Reviewed by David Levin.
+2010-08-31 Zoltan Horvath <zoltan@webkit.org>
- Start/Stop Web Socket and Web Socket Secure servers for layout tests.
- https://bugs.webkit.org/show_bug.cgi?id=27491
+ Reviewed by Antonio Gomes.
- The test path determination logic is changed to handle websocket and websocket/ssl cases.
- The logic for non-http (and now also non-websocket) tests is moved toward the end of the if-elsif statement.
+ [Qt] Read command line arguments and open them as URLs in new windows
+ https://bugs.webkit.org/show_bug.cgi?id=44944
- Functions to start or stop Web Socket servers are added.
+ Extend MiniBrowser to accept command line arguments and open them as URLs in new browser windows.
- * Scripts/run-webkit-tests:
+ * MiniBrowser/qt/main.cpp:
+ (main):
-2009-11-03 Eric Seidel <eric@webkit.org>
+2010-08-31 Adrian Perez <aperez@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ Support scripts to run Buildbot slaves under daemontools (gtk related)
+ https://bugs.webkit.org/show_bug.cgi?id=40053
+
+ * BuildSlaveSupport/gtk: Added.
+ * BuildSlaveSupport/gtk/README: Added.
+ * BuildSlaveSupport/gtk/buildbot: Added.
+ * BuildSlaveSupport/gtk/buildbot/log: Added.
+ * BuildSlaveSupport/gtk/buildbot/log/run: Added.
+ * BuildSlaveSupport/gtk/buildbot/run: Added.
+ * BuildSlaveSupport/gtk/crashmon: Added.
+ * BuildSlaveSupport/gtk/crashmon/crashmon: Added.
+ * BuildSlaveSupport/gtk/crashmon/log: Added.
+ * BuildSlaveSupport/gtk/crashmon/log/run: Added.
+ * BuildSlaveSupport/gtk/crashmon/run: Added.
+ * BuildSlaveSupport/gtk/daemontools-buildbot.conf: Added.
+ * BuildSlaveSupport/gtk/pulseaudio: Added.
+ * BuildSlaveSupport/gtk/pulseaudio/run: Added.
+ * BuildSlaveSupport/gtk/xvfb: Added.
+ * BuildSlaveSupport/gtk/xvfb/log: Added.
+ * BuildSlaveSupport/gtk/xvfb/log/run: Added.
+ * BuildSlaveSupport/gtk/xvfb/run: Added.
+
+2010-08-27 John Gregg <johnnyg@google.com>
- No review, just changing wording of log message.
+ Reviewed by David Levin.
- Change log string to say "failed" instead of "rejected"
- when a commit fails due to an out of date checkout.
- This makes grepping the commit-queue log for rejected patches easier.
+ Notifications should support a click event.
+ Adds necessary hooks to chromium's DRT so that clicks on desktop notifications
+ can be simulated during a layout test. Requires storing a list of active
+ notifications so that they can be referred to later for clicking.
+ https://bugs.webkit.org/show_bug.cgi?id=44800
- * Scripts/bugzilla-tool:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::simulateDesktopNotificationClick):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
+ (NotificationPresenter::simulateClick):
+ (NotificationPresenter::show):
+ (NotificationPresenter::cancel):
+ (NotificationPresenter::objectDestroyed):
+ * DumpRenderTree/chromium/NotificationPresenter.h:
-2009-11-03 Eric Seidel <eric@webkit.org>
+2010-08-30 Alice Liu <alice.liu@apple.com>
- No review, adding commonly known committers missing from the file.
+ Reviewed by Darin Adler.
- * Scripts/modules/committers.py: Add committers found by looking at SVN records.
+ Add missing parts of didFinishDocumentLoadForFrame
+ https://bugs.webkit.org/show_bug.cgi?id=44913
-2009-11-03 Eric Seidel <eric@webkit.org>
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (didFinishDocumentLoadForFrame): Added
+ (-[BrowserWindowController awakeFromNib]): Updated struct
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage): Rearranged function ptr
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize): Updated struct
- No review, just sort-order cleanup.
+2010-08-30 Vangelis Kokkevis <vangelis@chromium.org>
- * Scripts/modules/committers.py: Sort committers/reviewers alphabetically.
+ Unreviewed: Add myself to the list of Committers.
-2009-11-03 Stephen White <senorblanco@chromium.org>
+ * Scripts/webkitpy/common/config/committers.py:
- (Unreviewed).
+2010-08-30 Kent Tamura <tkent@chromium.org>
- Add myself to committers.py.
+ Reviewed by Adam Barth.
- * Scripts/modules/committers.py:
+ Fix fast/notifications/notifications-display-close-events.html failure
+ https://bugs.webkit.org/show_bug.cgi?id=44585
-2009-11-03 Robin Dunn <robin@alldunn.com>
+ Apply http://crrev.com/48893. We should dispatch display events
+ asynchronously.
- Reviewed by Kevin Ollviier.
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
+ (deferredDisplayDispatch):
+ (NotificationPresenter::show):
- Add packaging scripts for Debian-based Linux distros.
-
- https://bugs.webkit.org/show_bug.cgi?id=31075
+2010-08-30 Robert Hogan <robert@webkit.org>
- * wx/packaging/build-debian-installer.py: Added.
- * wx/packaging/debian: Added.
+ Reviewed by Simon Hausmann.
-2009-11-03 Dan Bernstein <mitz@apple.com>
+ allow ports with windowed plugins to support windowless plugin tests
- Reviewed by Anders Carlsson and Beth Dakin.
+ https://bugs.webkit.org/show_bug.cgi?id=40730
- https://bugs.webkit.org/show_bug.cgi?id=31070
+ Ports that implement plugins windowed by default need to have a way of
+ supporting plugin tests that assume the plugin is windowless. Add this
+ feature to the tests and support it in the webkit test plugin. Also
+ add mouse and keyboard event logging to the webkit-test plugin on Unix.
- Added an 'ondestroy' parameter to the test plug-in. When the plug-in is
- destroyed, it executes the value of the 'ondestroy' parameter as a
- script.
+ Unskip the following tests on Qt:
+
+ plugins/mouse-events.html
+ plugins/keyboard-events.html
+ plugins/mouse-events-fixedpos.html
* DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
- (pluginAllocate): Initialize onDestroy.
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: Define
- onDestroy.
+ (pluginSetProperty):
* DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
- (NPP_New): Set onDestroy to the value of the 'ondestroy' parameter, if
- specified.
- (NPP_Destroy): Execute the value of 'ondestroy' as a script.
+ (NPP_New):
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_handle_event):
+
+2010-08-30 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after addition of fileapi directory in WebCore.
+
+ * wx/build/settings.py:
-2009-11-02 Joanmarie Diggs <joanmarie.diggs@gmail.com>
+2010-08-30 Alejandro G. Castro <alex@igalia.com>
Reviewed by Xan Lopez.
- https://bugs.webkit.org/show_bug.cgi?id=31035
- [GTK] some accessibility tests hitting assertion in debug builds
+ Fixed compilation error, now that we have included the
+ GtkVersioning.h we have to remove some version dependent code from
+ EventSender.
- Get the correct Gtk+ object before attempting to turn it into an AtkObject.
+ * DumpRenderTree/gtk/EventSender.cpp:
- * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
- (AccessibilityController::rootElement):
+2010-08-30 Alejandro G. Castro <alex@igalia.com>
-2009-11-02 Chris Fleizach <cfleizach@apple.com>
+ Reviewed by Martin Robinson.
- Reviewed by Beth Dakin.
+ [Gtk] gdk_display_get_core_pointer and gdk_device_get_core_pointer
+ are deprecated
+ https://bugs.webkit.org/show_bug.cgi?id=44787
- Support ARIA "tab" roles
- https://bugs.webkit.org/show_bug.cgi?id=30842
+ We have replaced GtkVersioning.cpp with GtkVersioning.c and
+ created a function (getDefaultGDKPointerDevice) to get the pointer
+ of the window with the new APIs. We added that function to DRT and
+ copyandpaste unit test.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (prepareMouseButtonEvent):
+ (mouseMoveToCallback):
+ (keyDownCallback):
+ * GNUmakefile.am:
+
+2010-08-30 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
-2009-11-01 Eric Seidel <eric@webkit.org>
+ [Qt] Add new window menu to MiniBrowser
+
+ Implement newWindow function and add a menu item for opening new window in MiniBrowser.
+
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserWindow::BrowserWindow):
+ (BrowserWindow::newWindow):
+ * MiniBrowser/qt/BrowserWindow.h:
+ * MiniBrowser/qt/main.cpp:
+ (main):
+
+2010-08-29 James Robinson <jamesr@chromium.org>
Reviewed by David Levin.
- buildbots should use --exit-after-N-failures
- https://bugs.webkit.org/show_bug.cgi?id=30809
+ Make failing the download step fail the build
+ https://bugs.webkit.org/show_bug.cgi?id=44298
- Make the bots exit after 20 failures to prevent never-ending
- test runs where every test spends a minute crashing.
+ If the download step fails on a test bot, this ensures that
+ the build goes red instead of only the download step going red
+ and the overall build staying green.
* BuildSlaveSupport/build.webkit.org-config/master.cfg:
-2009-11-01 Laszlo Gombos <laszlo.1.gombos@nokia.com>
-
- Reviewed by Eric Seidel.
+2010-08-29 Kent Tamura <tkent@chromium.org>
- Turn on warnings for QtWebKit for gcc
- https://bugs.webkit.org/show_bug.cgi?id=30958
+ Reviewed by Dimitri Glazkov.
- * DumpRenderTree/qt/main.cpp:
- (crashHandler): Mark function NO_RETURN
+ [DRT/Chromium] Remove dependency to base/keyboard_codes.h
+ https://bugs.webkit.org/show_bug.cgi?id=44847
-2009-11-01 Jessie Berlin <jberlin@webkit.org>
+ * DumpRenderTree/chromium/EventSender.cpp:
+ Use webkit_support::VKEY_* instead of base::VKEY_*.
- Adding myself to the committers list.
+2010-08-29 Darin Adler <darin@apple.com>
- * Scripts/modules/committers.py:
+ https://bugs.webkit.org/show_bug.cgi?id=40589
-2009-10-30 Jon Honeycutt <jhoneycutt@apple.com>
+ * Scripts/prepare-ChangeLog: Only prepend namespaces to non-empty
+ function names.
- Fix an issue that Adam noticed in DRT.
+2010-08-26 Holger Hans Peter Freyther <holger@moiji-mobile.com>
Reviewed by Darin Adler.
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::role):
- Get the length of the role text, and create a buffer dynamically.
+ [iExploder] Add new CSS Properties and HTML Attributes
+ https://bugs.webkit.org/show_bug.cgi?id=44746
-2009-10-30 Eric Seidel <eric@webkit.org>
+ Updated the files with the update-iexploder-cssproperties script
+ and manually readded the -webkit-binding CSS Property to the list.
- No review, rolling out r50105.
- http://trac.webkit.org/changeset/50105
+ * iExploder/htdocs/cssproperties.in:
+ * iExploder/htdocs/htmlattrs.in:
+ * iExploder/htdocs/htmltags.in:
- This commit was causing:
- https://bugs.webkit.org/show_bug.cgi?id=30869
- We'll re-implement the feature a different way.
+2010-08-26 Holger Hans Peter Freyther <holger@moiji-mobile.com>
- * Scripts/bugzilla-tool:
+ Reviewed by Darin Adler.
-2009-10-29 Jon Honeycutt <jhoneycutt@apple.com>
+ Fix Coverage build after the addition of ANGLE
+ https://bugs.webkit.org/show_bug.cgi?id=44744
- Test for MSAA: Accessibility of headings is not correct
+ ANGLE is using libtool to build a static library and the version of
+ libtool on Leopard refuses to handle the -fprofile-arcs and -ftest-coverage
+ parameters. The easiest way to handle this is to not build ANGLE with
+ coverage information.
- https://bugs.webkit.org/show_bug.cgi?id=30937
+ This is achieved by applying the XCode options for each project
+ separately and exclude ANGLE.
- Reviewed by Adam Roben.
+ * Scripts/build-webkit: Remove -framework AppKit due link errors.
+ * Scripts/webkitdirs.pm: Do not apply the XCode options for ANGLE.
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::role):
- Allow the role returned to be a BSTR.
- (AccessibilityUIElement::description):
- Fix a copy/paste error.
+2010-08-28 Kevin Ollivier <kevino@theolliviers.com>
-2009-10-29 Jon Honeycutt <jhoneycutt@apple.com>
+ [wx] Build fix after directory addition.
- Test for MSAA: Accessibility of links is wrong
+ * wx/build/settings.py:
- https://bugs.webkit.org/show_bug.cgi?id=30928
+2010-08-28 Chris Guillory <chris.guillory@google.com>
- Reviewed by Darin Adler.
+ Reviewed by Chris Fleizach.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getAccessibilityValueCallback):
- Return the accessibility value.
- (AccessibilityUIElement::getJSClass):
- Added "accessibilityValue" value.
+ Add AX notification for childrenChanged
+ https://bugs.webkit.org/show_bug.cgi?id=44472
- * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/chromium/AccessibilityController.cpp:
+ (AccessibilityController::AccessibilityController):
+ (AccessibilityController::reset):
+ (AccessibilityController::getRootElement):
+ (AccessibilityController::dumpAccessibilityNotifications):
+ * DumpRenderTree/chromium/AccessibilityController.h:
+ (AccessibilityController::shouldDumpAccessibilityNotifications):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didChangeAccessibilityObjectChildren):
+ * DumpRenderTree/chromium/WebViewHost.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::accessibilityValue):
- Stubbed.
+2010-08-28 Eric Seidel <eric@webkit.org>
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::accessibilityValue):
- Stubbed.
+ Reviewed by Adam Barth.
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::accessibilityValue):
- Get the object's value, and return it as a JS string.
+ Update commit-queue failure message
+ https://bugs.webkit.org/show_bug.cgi?id=44798
-2009-10-30 Kevin Ollivier <kevino@theolliviers.com>
+ The commit-queue auto-restarts itself and has for a very long time.
+ No need for people to email me to request a restart anymore.
- Fix typo in command name used by wx build system.
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- * wx/build/build_utils.py:
+2010-07-27 Jer Noble <jer.noble@apple.com>
-2009-10-30 Adam Barth <abarth@webkit.org>
+ Reviewed by Eric Carlson.
- Reviewed by Darin Adler.
+ Add JavaScript API to allow a page to go fullscreen.
+ rdar://problem/6867795
+
+ Added basic full screen support to DumpRenderTree: when a webView requests
+ that DumpRenderTree go "full screen", just call the provided callback listener object's
+ will/did Enter/Exit full screen methods. Also, register a new user default which
+ enables full screen support.
- Patch v1 is a dumb default name for patches
- https://bugs.webkit.org/show_bug.cgi?id=30952
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/UIDelegate.mm:
+ (-[UIDelegate webView:supportsFullscreenForElement:]):
+ (-[UIDelegate webView:enterFullscreenForElement:listener:]):
+ (-[UIDelegate webView:exitFullscreenForElement:listener:]):
- Let's use "Patch" instead.
+2010-08-27 Benjamin Poulain <benjamin.poulain@nokia.com>
- * Scripts/bugzilla-tool:
+ Unreviewed. Add myself to the committers list.
-2009-10-30 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+ * Scripts/webkitpy/common/config/committers.py:
- Unreviewed trivial buildfix.
+2010-08-27 Kent Tamura <tkent@chromium.org>
- [Qt] Buildfix for r50333.
+ Reviewed by Pavel Feldman.
- * DumpRenderTree/qt/DumpRenderTree.pro:
+ [DRT/Chromium] Fix inspector test failures
+ https://bugs.webkit.org/show_bug.cgi?id=44748
-2009-10-30 Antonio Gomes <tonikitoo@webkit.org>
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ (DRTDevToolsAgent::createClientMessageLoop):
+ Returns a valid WebKitClientMessageLoop instance
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
- Reviewed by Holger Freyther.
+2010-08-26 Jon Honeycutt <jhoneycutt@apple.com>
- [Qt] Remove qt/WorkQueue.cpp|h in favor of platform independent WorkQueue
- https://bugs.webkit.org/show_bug.cgi?id=30953
+ Add Windows WebKit2 Tester to buildbot
+ <rdar://problem/7887703>
- DumpRenderTree/WorkQueue and DumpRenderTree/qt/WorkQueue share mostly the
- same implementation. Some Q_ASSERTs differ from ASSERTs basically. Patch
- makes qt DRT to share this implementation (as gtk and mac ports do).
+ Reviewed by Dan Bernstein.
- * DumpRenderTree/qt/DumpRenderTree.pro:
- * DumpRenderTree/qt/WorkQueue.cpp: Removed.
- * DumpRenderTree/qt/WorkQueue.h: Removed.
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
-2009-10-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-08-26 Philippe Normand <pnormand@igalia.com>
- Unreviewed potential buildbot fix.
+ Reviewed by Martin Robinson.
- Second try: Reset page history before running each test.
+ [GTK] Needs DRT queueLoadHTMLString and setDeferMainResourceLoad-implementations
+ https://bugs.webkit.org/show_bug.cgi?id=42152
- Apparently the QWebHistory::clear() keeps the current page
- in history which is not what we want, so we not additionally
- sets the history capacity to 0 (forces removing everything)
- and then sets it back to its original value.
+ * DumpRenderTree/gtk/WorkQueueItemGtk.cpp:
+ (LoadHTMLStringItem::invoke): Implementation using
+ webkit_web_frame_load_string().
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+2010-08-25 Jon Honeycutt <jhoneycutt@apple.com>
-2009-10-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ <rdar://problem/8334338> run-webkit-tests sometimes hangs when using
+ WebKitTestRunner (44331)
- Unreviewed potential buildbot fix.
+ Reviewed by Darin Adler.
- Reset page history before running each test.
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+ The hang occurs when WebKitTestRunner begins launching the WebKit2
+ web process then exits before it finishes launching. Work around this by
+ looking for the --print-supported-features argument and exiting without
+ creating the web process.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+2010-08-26 Dirk Pranke <dpranke@chromium.org>
-2009-10-30 Roland Steiner <rolandsteiner@chromium.org>
+ Reviewed by Tony Chang.
- Reviewed by Eric Seidel.
-
- Remove ENABLE_RUBY guards as discussed with Dave Hyatt and Maciej Stachowiak.
+ new-run-webkit-tests: add rebaselining tests for test_expectations
+
+ This patch adds more unit tests for the rebaselining code in the
+ test_expectations module. It doesn't add any tests for
+ rebaseline_chromium_webkit_tests itself; that will come some other
+ time.
- Bug 28420 - Implement HTML5 <ruby> rendering
- (https://bugs.webkit.org/show_bug.cgi?id=28420)
+ https://bugs.webkit.org/show_bug.cgi?id=44648
- No new tests (no functional change).
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
- * Scripts/build-webkit:
+2010-08-26 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
-2009-10-29 Dan Bernstein <mitz@apple.com>
+ Reviewed by Martin Robinson.
- Reviewed by Mark Rowe.
+ [GTK] Add HTTP caching support
+ https://bugs.webkit.org/show_bug.cgi?id=44261
- Fix “Undefined subroutine†errors in svn-*apply by moving the removeEOL subroutine
- from the two scripts that define it but don’t use it to the script that uses it but doesn’t
- define it.
+ Ignore new soup API that we decided to merge into the soup backend
+ while it is being cooked. It follows the libsoup style, and will
+ be removed from WebKit as soon as it is merged into libsoup.
- * Scripts/VCSUtils.pm:
- * Scripts/svn-apply:
- * Scripts/svn-unapply:
+ * Scripts/webkitpy/style/checker.py:
-2009-10-29 Xan Lopez <xlopez@igalia.com>
+2010-08-26 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
- Reviewed by Gustavo Noronha.
+ Reviewed by Kenneth Rohde Christiansen.
- Use the GTK+ main loop instead of rolling our own mini-version of
- it.
+ [Qt] DumpRenderTree runs only one test from command mode
+ https://bugs.webkit.org/show_bug.cgi?id=44012
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (dump):
- (runTest):
- (webViewLoadFinished):
+ Enables support to run multiple test files and single
+ folder containing html files in stand alone mode
-2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::processArgsLine):
+ (WebCore::DumpRenderTree::loadNextTestInStandAloneMode):
+ (WebCore::DumpRenderTree::processLine):
+ (WebCore::DumpRenderTree::dump):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ (WebCore::DumpRenderTree::setStandAloneMode):
+ (WebCore::DumpRenderTree::isStandAloneMode):
+ * DumpRenderTree/qt/main.cpp:
+ (main):
- Reviewed by Oliver Hunt.
+2010-08-25 Martin Robinson <mrobinson@igalia.com>
- Implement the Qt version of DRT dumpBackForwardList().
+ Updating webkitpy test expectations.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::dumpHistoryItem):
- (WebCore::DumpRenderTree::dumpBackForwardList):
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
-2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+2010-08-25 Ojan Vafai <ojan@chromium.org>
- Reviewed by Adam Roben.
+ Reviewed by Eric Seidel.
- Implement DRT functionality for Qt introduced in
- r28690 and r28705.
+ fix the always squash git config
+ https://bugs.webkit.org/show_bug.cgi?id=44651
- - Implemented pathToLocalResource which exposes the functionality of
- converting a given unix path to the correct location on Windows.
- - Implemented a way to remove machine-dependent information from paths
- in layout test results.
+ Fix help text and apparently underscores are not allowed
+ in git config keys.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::urlSuitableForTestResult):
- (WebCore::WebPage::javaScriptConsoleMessage):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::pathToLocalResource):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/tool/steps/commit.py:
-2009-10-28 Roland Steiner <rolandsteiner@chromium.org>
+2010-08-25 Darin Adler <darin@apple.com>
- Adding myself to the committers list.
+ Reviewed by John Sullivan.
- * Scripts/modules/committers.py:
+ * Scripts/commit-log-editor: Fix perl warning for people who have no
+ value for SVN_LOG_EDITOR or CVS_LOG_EDITOR.
-2009-10-28 Chris Fleizach <cfleizach@apple.com>
+2010-08-25 Ojan Vafai <ojan@chromium.org>
- Adding myself to the committers list.
+ Reviewed by Eric Seidel.
- * Scripts/modules/committers.py:
+ stop blocking commits when the bots are red
+ https://bugs.webkit.org/show_bug.cgi?id=44644
-2009-10-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+ This check currently is just annoying. It doesn't actually
+ help keep the tree green. We can always add it back later
+ if we decide the tree is generally more green.
- Reviewed by Jan Alonzo.
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py:
- [GTK] API to start inspector for a WebView
- https://bugs.webkit.org/show_bug.cgi?id=22551
+2010-08-25 Eric Seidel <eric@webkit.org>
- Use the new inspector API to implement the LayoutTestController
- interfaces used to test the inspector.
+ Reviewed by Simon Fraser.
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (webInspectorInspectWebView):
- (createWebView):
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::showWebInspector):
- (LayoutTestController::closeWebInspector):
- (LayoutTestController::evaluateInWebInspector):
+ REGRESSION: media/video-loop.html is timing out on the commit-queue Leopard Bot
+ https://bugs.webkit.org/show_bug.cgi?id=38912
-2009-10-28 Shinichiro Hamaji <hamaji@chromium.org>
+ I know of nothing else to do but skip all media tests for the cq.
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/tool/steps/runtests.py:
- [Qt] WebFrame::counterValueForElementById must not be exposed
- https://bugs.webkit.org/show_bug.cgi?id=30882
+2010-08-25 Dirk Pranke <dpranke@chromium.org>
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::counterValueForElementById):
+ Reviewed by Ojan Vafai.
-2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ new-run-webkit-tests: add more unit tests for test_expectations
+ This adds unit tests to cover (almost?) all of the non-rebaselining
+ functionality.
- Rubberstamped by Oliver Hunt.
+ https://bugs.webkit.org/show_bug.cgi?id=44579
- Fix the warning:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
- "warning: ignoring return value of 'char* getcwd(char*, size_t)',
- declared with attribute warn_unused_result".
+2010-08-25 Dirk Pranke <dpranke@chromium.org>
- by actually checking the result. In the case it is null, an
- error has occoured, so treat it as the other fatal errors.
+ Reviewed by Ojan Vafai.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::initializeFonts):
+ new-run-webkit-tests: add more unit tests
-2009-10-27 Shinichiro Hamaji <hamaji@chromium.org>
+ This change adds more unit tests for the image_diff, test_failures,
+ and test_files modules, bringing them to 100% coverage (and adds a
+ couple tests to run_webkit_tests while we're at it).
- Reviewed by Darin Adler.
+ This test also turns on the "dryrun" port for testing when run on
+ the mac, increasing coverage in a few other places.
- Provide a way to get counter values with layoutTestContoller
- https://bugs.webkit.org/show_bug.cgi?id=30555
+ https://bugs.webkit.org/show_bug.cgi?id=44578
- Define layoutTestContoller.counterValueForElementById.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.checksum: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/checksum-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/checksum.html: Copied from WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum.html.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/missing_check-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/missing_check.html: Copied from WebKitTools/Scripts/webkitpy/layout_tests/data/failures/expected/missing_image.html.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/timeout.html: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt:
+ * Scripts/webkitpy/layout_tests/data/resources/README.txt: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- * DumpRenderTree/LayoutTestController.cpp:
- (counterValueForElementByIdCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::counterValueForElementById):
+2010-08-25 Dirk Pranke <dpranke@chromium.org>
-2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Reviewed by Ojan Vafai.
- Rubberstamped by Oliver Hunt.
+ new-run-webkit-tests: add more unit tests for layout_package/printing.py
- Change two methods to be internal for DRT use only.
+ This change adds more unit tests to get the test coverage to 100%
+ for the printing module. This code is actually pretty crufty and
+ has some layering violations that need to be cleaned up but I'll
+ save that for another CL after we get all the unit tests written and
+ we fix the multithreading issues. At least now we'll be able to tell
+ if we break things.
- Part of [Qt] Review all new API in Qt 4.6
- https://bugs.webkit.org/show_bug.cgi?id=29843#c11
+ https://bugs.webkit.org/show_bug.cgi?id=44576
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::whiteListAccessFromOrigin):
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
-2009-10-27 Eric Seidel <eric@webkit.org>
+2010-08-25 Ojan Vafai <ojan@chromium.org>
Reviewed by Adam Barth.
- REGRESSION: svn-apply exits(1) when applying a patch with a file add
- https://bugs.webkit.org/show_bug.cgi?id=30826
+ new-run-webkit-tests should respect set-webkit-configuration
+ https://bugs.webkit.org/show_bug.cgi?id=44633
- * Scripts/svn-apply:
- - Add () around all system() calls.
- - Use the correct system() == 0 or die instead of system() or die
- - Add descriptive messages to all die statements.
+ Moves the getting of the configuration into the base Port so that
+ chromium ports use it as well. In the downstream chromium port,
+ this should still just return Release.
-2009-10-27 Steve Block <steveblock@google.com>
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
- Reviewed by NOBODY.
+2010-08-25 Tony Chang <tony@chromium.org>
- Adds steveblock@google.com to list of committers.
+ Not reviewed, changing svn props for a script.
- * Scripts/modules/committers.py: Adds steveblock@google.com to list of committers.
+ * Scripts/deduplicate-tests: Added properties svn:executable and svn:eol-style.
-2009-10-27 Eric Seidel <eric@webkit.org>
+2010-08-25 Adam Barth <abarth@webkit.org>
- Reviewed by Adam Barth.
+ Reviewed by Eric Seidel.
- svn-apply can exit(0) even on patch failure
- https://bugs.webkit.org/show_bug.cgi?id=29622
+ Remove WebKit2 from core builders
+ https://bugs.webkit.org/show_bug.cgi?id=44625
- * Scripts/svn-apply:
- - Add a bunch of "or die" statements, hopefully catching all
- possible cases where failure could still exit(0).
+ This builder was added to the core builders by accident. It doesn't
+ appear to be green enough to be a core builder yet.
-2009-10-27 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
- Reviewed by Adam Barth.
+2010-08-19 Adam Roben <aroben@apple.com>
- svn-* scripts should share code through VCSUtils.pm
- https://bugs.webkit.org/show_bug.cgi?id=30791
+ Test that NP_Initialize and NP_GetEntryPoints are called in the
+ correct order
- Just moving code into a shared location.
+ The order differs between Mac and Windows (see r38858).
- * Scripts/VCSUtils.pm:
- * Scripts/prepare-ChangeLog:
- * Scripts/resolve-ChangeLogs:
- * Scripts/svn-apply:
- * Scripts/svn-create-patch:
- * Scripts/svn-unapply:
- * Scripts/update-webkit:
+ Fixes <http://webkit.org/b/44270> <rdar://problem/8330393> Crash in
+ NP_Initialize when loading QuickTime when running
+ plugins/embed-attributes-setting.html in WebKit2 on Windows
-2009-10-27 Vadim Zeitlin <vadim@wxwidgets.org>
+ Reviewed by John Sullivan.
- Suppress a huge number of MSVC warnings when building wxWebKit.
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp: Added a CRASH macro and
+ a boolean to record whether NP_GetEntryPoints has been called.
+ (NP_Initialize): Crash on Windows if NP_GetEntryPoints hasn't been
+ called yet. This matches Flash and QuickTime's behavior.
+ (NP_GetEntryPoints): Crash on Mac if NP_Initialize hasn't been called
+ yet. This matches Silverlight's behavior.
- * wx/build/settings.py:
+2010-08-25 Martin Robinson <mrobinson@igalia.com>
-2009-10-26 Eric Seidel <eric@webkit.org>
+ Reviewed by Gustavo Noronha Silva.
- No review, just adding Mike Belshe to the committers list.
+ Cairo and EFL port shouldn't depend on glib.
+ https://bugs.webkit.org/show_bug.cgi?id=44354
- * Scripts/modules/committers.py:
+ Replace occurrences of GRefPtr and adoptGRef with PlatformRefPtr and
+ adoptPlatformRef.
-2009-10-26 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isSelected):
- Reviewed by Darin Adler.
+2010-08-25 Ojan Vafai <ojan@chromium.org>
- Make .rc files compile on Windows without depending on MFC headers
- https://bugs.webkit.org/show_bug.cgi?id=30750
+ Fix order of Timothy's email address. The script, and
+ other tools all assume that the first email is the bugzilla address.
- * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.rc: Use
- windows.h instead of afxres.h because it exists even when MFC is not
- installed, and is all that's needed here.
+ * Scripts/webkitpy/common/config/committers.py:
- * FindSafari/FindSafari.rc: Ditto
+2010-08-24 Kent Tamura <tkent@chromium.org>
-2009-10-24 Eric Seidel <eric@webkit.org>
+ Reviewed by Pavel Feldman.
- Reviewed by Adam Barth.
+ [DRT/Chromium] Fix 26 inspector test crashes
+ https://bugs.webkit.org/show_bug.cgi?id=44580
- bugzilla-tool post-diff should know how to mark commit-queue=?
- https://bugs.webkit.org/show_bug.cgi?id=29202
+ - DRTDevToolsAgent has a reference to the main WebView. So we
+ should not clear it in closeDevTools() and should clear it in
+ ~TestShell().
+ - DRTDevToolsClient has a reference to a DevTools WebView and no
+ way to update it. So we should delete DRTDevToolsClient instances
+ in closeDevTools().
- * Scripts/bugzilla-tool:
- - Add --commit-queue option to post-diff, post-commits and create-bug.
- * Scripts/modules/bugzilla.py:
- - Added support for --commit-queue to add_patch_to_bug and create_bug_with_patch.
- - Added _fill_attachment_form to share code between add_patch_to_bug and create_bug_with_patch.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::~TestShell):
+ (TestShell::closeDevTools):
-2009-10-23 Eric Seidel <eric@webkit.org>
+2010-08-24 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- bugzilla-tool commit-queue does not notice modifications to committers.py
- https://bugs.webkit.org/show_bug.cgi?id=30084
+ unicode(Exception(\u"0x1234")) is busted in python 2.5, disable tests which hit this
+ https://bugs.webkit.org/show_bug.cgi?id=44584
- * Scripts/bugzilla-tool:
- - Make commit-queue re-exec itself instead of using while(1).
- - Add a --is-relaunch parameter to commit-queue to bypass initialization on re-launch.
- - Add a _next_patch() method which calls exec() (and could eventually call update-webkit too).
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
-2009-10-22 Eric Seidel <eric@webkit.org>
+2010-08-24 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- commit-queue will get stuck on patches if land-patches terminates unexpectedly
- https://bugs.webkit.org/show_bug.cgi?id=30634
+ commit-queue and EWS bots should report all failures
+ https://bugs.webkit.org/show_bug.cgi?id=41820
- * Scripts/bugzilla-tool:
- - Add a way for land-patches to exit(2) to indicate an error, but one it has handled.
- - Make commit-queue auto cq- any patch where land-patches exited anything other than '0' or '2'.
+ Right now commit-queue/EWS only report failures when the
+ patch under testing fails. We should report all failures
+ to the status server so that we can diagnose when the bots
+ are wedged w/o needing to log into the machines.
-2009-10-26 Yuzo Fujishima <yuzo@google.com>
+ I also reduced the amount of data we upload since we've seen
+ timeouts during status upload.
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- Upgrade pywebsocket to 0.4.1. This will make reusing LayoutTests/fast/js/resources easier, for example.
+2010-08-24 Eric Seidel <eric@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=30763
+ Reviewed by Adam Barth.
- * pywebsocket/mod_pywebsocket/__init__.py:
- * pywebsocket/mod_pywebsocket/dispatch.py:
- * pywebsocket/mod_pywebsocket/headerparserhandler.py:
- * pywebsocket/mod_pywebsocket/standalone.py:
- * pywebsocket/setup.py:
- * pywebsocket/test/test_dispatch.py:
+ Remove HTML5 parser testing infrastructure now that we don't need it
+ https://bugs.webkit.org/show_bug.cgi?id=44581
-2009-10-26 Carol Szabo <carol.szabo@nokia.com>
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ (initializeGlobalsFromCommandLineOptions):
+ * Scripts/old-run-webkit-tests:
+ * Scripts/test-html5-parser: Removed.
- Reviewed by David Levin.
+2010-08-24 Kent Tamura <tkent@chromium.org>
- REGRESSION: 2 failures in run-webkit-unittests
- https://bugs.webkit.org/show_bug.cgi?id=30645
+ Reviewed by Dimitri Glazkov.
- * Scripts/modules/cpp_style_unittest.py:
- Fixed a few test scenarios which apparently lost some spaces from
- text literals.
+ [DRT/Chromium] Fix 28 inspector test crashes
+ https://bugs.webkit.org/show_bug.cgi?id=44574
-2009-10-26 Kevin Ollivier <kevino@theolliviers.com>
+ Reset DevToolsClient and DevToolsAgent before closing a DevTools
+ WebView in order to avoid accessing to a deleted WebView instance.
- wx build fix. Make sure isQt() doesn't return true if --wx was passed to build-webkit.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::closeDevTools):
- * Scripts/webkitdirs.pm:
+2010-08-24 Dirk Pranke <dpranke@chromium.org>
-2009-10-26 Csaba Osztrogonác <ossy@webkit.org>
+ Reviewed by Ojan Vafai.
- Reviewed by Darin Adler.
+ new-run-webkit-tests: clean up code for test_types, test_failures
- Unification of using null device in perl scripts.
- https://bugs.webkit.org/show_bug.cgi?id=30572
+ Add a bunch of unit tests for webkitpy.layout_tests.test_types and
+ webkitpy.layout_tests.layout_package.test_failures, and remove
+ some dead code and otherwise clean up things.
- * Scripts/VCSUtils.pm:
- * Scripts/bisect-builds:
- * Scripts/resolve-ChangeLogs:
- * Scripts/run-iexploder-tests:
- * Scripts/run-jsc:
- * Scripts/run-mangleme-tests:
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
- Using File::Spec->devnull() instead of hard coded /dev/null.
+ https://bugs.webkit.org/show_bug.cgi?id=44559
-2009-10-26 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
- Reviewed by Holger Freyther.
+2010-08-24 Dirk Pranke <dpranke@chromium.org>
- Reviewers are missing from committers.py
- https://bugs.webkit.org/show_bug.cgi?id=30733
+ Reviewed by Eric Seidel.
- * Scripts/modules/committers.py:
+ new-run-webkit-tests: revise unit testing strategy for test failures
+
+ This change revamps the way we store test data for new-run-webkit-tests.
+ Previously we had a few copies of test files from the main test tree.
+ Now we have a bunch of completely fake test data and use the test
+ data to generate different kinds of test failures, getting
+ much better coverage.
+
+ https://bugs.webkit.org/show_bug.cgi?id=44556
+
+ * Scripts/webkitpy/layout_tests/data/failures/expected/crash.html: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.checksum: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/image-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/image.html: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.checksum: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/image_checksum.html: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/missing_image.html: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/missing_text.html: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/text-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/expected/text.html: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.checksum: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/failures/unexpected/text-image-checksum.html: Added.
+ * Scripts/webkitpy/layout_tests/data/image/canvas-bg.html: Removed.
+ * Scripts/webkitpy/layout_tests/data/image/canvas-zoom-expected.checksum: Removed.
+ * Scripts/webkitpy/layout_tests/data/image/canvas-zoom-expected.png: Removed.
+ * Scripts/webkitpy/layout_tests/data/image/canvas-zoom-expected.txt: Removed.
+ * Scripts/webkitpy/layout_tests/data/image/canvas-zoom.html: Removed.
+ * Scripts/webkitpy/layout_tests/data/misc/crash-expected.txt: Removed.
+ * Scripts/webkitpy/layout_tests/data/misc/crash.html: Removed.
+ * Scripts/webkitpy/layout_tests/data/misc/missing-expectation.html: Removed.
+ * Scripts/webkitpy/layout_tests/data/misc/passing-expected.txt: Removed.
+ * Scripts/webkitpy/layout_tests/data/misc/passing.html: Removed.
+ * Scripts/webkitpy/layout_tests/data/passes/image-expected.checksum: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/image-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/image-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/image.html: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.checksum: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/platform_image-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/platform_image.html: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/text-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/passes/text.html: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/image/canvas-bg-expected.checksum: Removed.
+ * Scripts/webkitpy/layout_tests/data/platform/test/image/canvas-bg-expected.png: Removed.
+ * Scripts/webkitpy/layout_tests/data/platform/test/image/canvas-bg-expected.txt: Removed.
+ * Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.checksum: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/passes/platform_image-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt:
+ * Scripts/webkitpy/layout_tests/data/text/article-element-expected.txt: Removed.
+ * Scripts/webkitpy/layout_tests/data/text/article-element.html: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ * Scripts/webkitpy/style/checkers/test_expectations_unittest.py:
+
+2010-08-24 Dirk Pranke <dpranke@chromium.org>
-2009-10-23 Eric Seidel <eric@webkit.org>
+ Reviewed by Eric Seidel.
- No review, only adding Alice to the list of reviewers.
+ speed up new-run-webkit-tests unit tests
- * Scripts/modules/committers.py:
+ Add a --no-record-results flag that turns off generating the JSON
+ results file on every test run. Generating the file requires us to
+ fetch the old results down from the bots, which can be slow. This
+ flag is off by default.
+
+ Reduce the sleep time in wait_for_threads_to_finish from 0.1s to 0.01s.
+
+ These changes together shorten the test cycle from ~4.5s to ~1.5s
+ - a 3x speedup.
-2009-10-23 Eric Seidel <eric@webkit.org>
+ https://bugs.webkit.org/show_bug.cgi?id=44553
- Reviewed by Eric Carlson.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- fast/media/mq-transform-02.html failed on Leopard Commit Bot
- https://bugs.webkit.org/show_bug.cgi?id=30700
+2010-08-24 Tony Chang <tony@chromium.org>
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues): Update QuickTime version check.
+ Reviewed by Eric Seidel.
-2009-10-23 Kevin Ollivier <kevino@theolliviers.com>
+ [chromium] fix the platform result fallback order on mac/win
+ https://bugs.webkit.org/show_bug.cgi?id=44483
- wxMac 10.4 build fix, needs to link against WebKitSystemInterfaceTiger to get
- character measurement APIs that are private on Tiger.
+ * Scripts/webkitpy/layout_tests/port/google_chrome.py:
- * wx/build/settings.py:
+2010-08-24 Xan Lopez <xlopez@igalia.com>
-2009-10-22 Gavin Barraclough <barraclough@apple.com>
+ Reviewed by Martin Robinson.
- Reviewed by NOBODY (build fix).
- Build fix following bug #30696.
+ Set a device to the event struct when building with GTK+ 3.x, it's
+ mandatory.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::evaluateScriptInIsolatedWorld):
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (keyDownCallback):
-2009-10-22 Gavin Barraclough <barraclough@apple.com>
+2010-08-24 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Sam Weinig & Geoff Garen.
+ Reviewed by Xan Lopez.
- https://bugs.webkit.org/show_bug.cgi?id=30696
- Enable isolated-worlds tests on mac.
+ [GTK] GTK3: EventSender and API tests should use gdk_event_new when synthesizing events
+ https://bugs.webkit.org/show_bug.cgi?id=44534
- Add private interface for DRT to invoke execution in a given world.
+ Fix two double-frees introduced in my previous commit.
- * DumpRenderTree/LayoutTestController.cpp:
- (evaluateScriptInIsolatedWorldCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::evaluateScriptInIsolatedWorld):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::evaluateScriptInIsolatedWorld):
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (contextClickCallback): Copy the event before using it again.
+ (keyDownCallback): Ditto.
-2009-10-21 Eric Seidel <eric@webkit.org>
+2010-08-24 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Adam Barth.
+ Reviewed by Xan Lopez.
- bugzilla-tool's "patch failed to download an apply" error should give more information
- https://bugs.webkit.org/show_bug.cgi?id=30632
+ [GTK] GTK3: EventSender and API tests should use gdk_event_new when synthesizing events
+ https://bugs.webkit.org/show_bug.cgi?id=44534
- * Scripts/modules/scm.py:
- - Use the common run_command method instead of custom POpen code.
- - Make run_command know how to take pipes as input.
- * Scripts/modules/scm_unittest.py:
- - Add new tests to cover change.
- - Also move test_error_handlers into new SCMClassTests so we don't run it 3 times.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (prepareMouseButtonEvent): Use gdk_event_new and reference the reference the GdkWindow
+ when setting it on the event. It is dereferenced by gdk_event_free(...).
+ (contextClickCallback): Ditto.
+ (mouseDownCallback): Ditto.
+ (mouseUpCallback): Ditto.
+ (mouseMoveToCallback): Ditto.
+ (mouseWheelToCallback): Ditto.
+ (sendOrQueueEvent): Take a GdkEvent* instead of a GdkEvent.
+ (dispatchEvent): Ditto. Also free the event when we are done with it.
+ (keyDownCallback): Use gdk_event_new and reference the GdkWindow.
-2009-10-21 Kent Tamura <tkent@chromium.org>
+2010-08-24 Andras Becsi <abecsi@webkit.org>
- Unreviewed. Adding myself to the committers list.
+ [Qt] WebKit2 build fix.
- * Scripts/modules/committers.py:
+ * Scripts/enumerate-included-framework-headers:
+ Remove stray global option form sed.
-2009-10-21 Robin Dunn <robin@alldunn.com>
+2010-08-24 Kent Tamura <tkent@chromium.org>
- Reviewed by Kevin Ollivier.
+ Reviewed by Jeremy Orlow.
- Update the Windows installer builder to work with Vista / Win 7 and with git.
-
- https://bugs.webkit.org/show_bug.cgi?id=30649
+ [DRT/Chromium] Support for IndexedDB tests
+ https://bugs.webkit.org/show_bug.cgi?id=44490
- * wx/build/build_utils.py:
- * wx/packaging/build-mac-installer.py:
- * wx/packaging/build-win-installer.py:
- * wx/packaging/wxWebKitInstaller.iss.in:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell): Enable IndexedDB.
-2009-10-21 Alejandro G. Castro <alex@igalia.com>
+2010-08-23 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Gustavo Noronha.
+ Reviewed by Gustavo Noronha Silva.
- [GTK] Added conditional code to avoid using
- gdk_window_get_root_coords if we do not have a gtk+ release newer
- than 2.17.3.
- https://bugs.webkit.org/show_bug.cgi?id=30636
+ [GTK] The 64-bit Release bot is showing crashes on tests that use mouse buttons
+ https://bugs.webkit.org/show_bug.cgi?id=44465
- * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+ Initialize the axes field of mouse button and motion events to null.
+ This is the value that should be used for events originating from the
+ mouse device.
-2009-10-21 Shu Chang <Chang.Shu@nokia.com>
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (prepareMouseButtonEvent): Initalize button event axes field to null.
+ (mouseMoveToCallback): Initialize motion event axes field to null.
- Reviewed by Eric Seidel.
+2010-08-23 Sheriff Bot <webkit.review.bot@gmail.com>
- [Qt] Added dummy implementation for keepWebHistory()
- https://bugs.webkit.org/show_bug.cgi?id=30592
+ Unreviewed, rolling out r65703.
+ http://trac.webkit.org/changeset/65703
+ https://bugs.webkit.org/show_bug.cgi?id=44460
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::keepWebHistory):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ "Causing lots of crashes on Snow Leopard when running the
+ layout tests" (Requested by eseidel2 on #webkit).
-2009-10-21 Alejandro G. Castro <alex@igalia.com>
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NP_Initialize):
+ (NP_GetEntryPoints):
- Reviewed by Xan Lopez.
+2010-08-23 Jon Honeycutt <jhoneycutt@apple.com>
- [GTK] Fixed the double click condition, it is not double click if
- we move in just in one direction.
- https://bugs.webkit.org/show_bug.cgi?id=30636
+ Layout tests do not run when using WebKitTestRunner in a Debug build.
+ https://bugs.webkit.org/show_bug.cgi?id=44409
- * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+ Reviewed by Dan Bernstein.
-2009-10-21 Alejandro G. Castro <alex@igalia.com>
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::initializeInjectedBundlePath):
+ Use InjectedBundle_debug.dll when building Debug.
- Reviewed by Xan Lopez.
+2010-08-23 Xan Lopez <xlopez@igalia.com>
- [GTK] Initialize the events completly before emitting them.
- https://bugs.webkit.org/show_bug.cgi?id=30633
+ Reviewed by Martin Robinson.
- * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+ [GTK] run-launcher fails if WebKitGTK+ compiled with GTK+-3.0 support
+ https://bugs.webkit.org/show_bug.cgi?id=42026
-2009-10-21 Kevin Ollivier <kevino@theolliviers.com>
+ If a GTK+ 3.x build is present return that as the library to use,
+ otherwise fallback to the GTK+ 2.x build.
- wx build fix. Fix for when linking using --as-needed with gcc.
+ * Scripts/webkitdirs.pm:
- * wx/browser/wscript:
+2010-08-23 Balazs Kelemen <kb@inf.u-szeged.hu>
-2009-10-21 Kevin Ollivier <kevino@theolliviers.com>
+ Reviewed by Ariya Hidayat.
- wxMac 10.4 build fix. Build and link against a version of libcurl new enough
- to support all the features used by CURL backend.
-
- * wx/build/settings.py:
- * wx/install-unix-extras:
+ [Qt] Find needed forwarding headers for WebKit2 automatically
+ https://bugs.webkit.org/show_bug.cgi?id=44336
-2009-10-20 Anton Muhin <antonm@chromium.org>
+ * MiniBrowser/qt/BrowserWindow.cpp: Use normal (not framework style) includes here.
+ The new script does not satisfy the needs of this file however using normal includes
+ is generally better here.
+ * MiniBrowser/qt/MiniBrowser.pro: Added include paths.
+ * Scripts/enumerate-included-framework-headers: Enumerates headers included from the
+ given frameworks by files in the current directory (and subdirectories).
+ In the future this needs to be rewritten in perl for being able to use on Windows.
- Reviewed by Adam Barth.
+2010-08-22 No'am Rosenthal <noam.rosenthal@nokia.com>
- Add {ager,antonm,yurys}@chromium.org into committers.py
- https://bugs.webkit.org/show_bug.cgi?id=30560
+ Reviewed by Ariya Hidayat.
- * Scripts/modules/committers.py:
+ [Qt] Qt test browser: enable a QGLWidget viewport with a command line argument
+ https://bugs.webkit.org/show_bug.cgi?id=43010
-2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::applyPrefs):
+ * QtTestBrowser/main.cpp:
+ (LauncherApplication::handleUserOptions):
- Reviewed by Tor Arne Vestbø.
+2010-08-21 Sam Weinig <sam@webkit.org>
- Make the Netscape Test plugin available to the Qt launcher.
+ Reviewed by Dan Bernstein.
- * Scripts/run-launcher:
+ Remove specialized retain/release functions in favor of a single one for WKTypeRefs
+ https://bugs.webkit.org/show_bug.cgi?id=44386
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (didRecieveMessageFromInjectedBundle):
+ (didNavigateWithNavigationData):
+ (-[BrowserAppDelegate init]):
+ (-[BrowserAppDelegate applicationWillTerminate:]):
+ * MiniBrowser/mac/BrowserStatisticsWindowController.m:
+ (-[BrowserStatisticsWindowController initWithThreadedWKContextRef:processWKContextRef:]):
+ (-[BrowserStatisticsWindowController dealloc]):
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController initWithPageNamespace:]):
+ (-[BrowserWindowController fetch:]):
+ (-[BrowserWindowController windowWillClose:]):
+ (-[BrowserWindowController applicationTerminating]):
+ (closePage):
+ (runJavaScriptAlert):
+ (runJavaScriptConfirm):
+ (runJavaScriptPrompt):
+ (-[BrowserWindowController updateProvisionalURLForFrame:]):
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (didClearWindowObjectForFrame):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::goToURL):
+ * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+ (WTR::PlatformWebView::~PlatformWebView):
+
+2010-08-20 Benjamin Poulain <benjamin.poulain@nokia.com>
-2009-10-20 Fumitoshi Ukai <ukai@chromium.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by David Levin.
+ WebKit does not build with Python 2.3
+ https://bugs.webkit.org/show_bug.cgi?id=44373
- Removed WebSocket runtime settings.
- https://bugs.webkit.org/show_bug.cgi?id=29896
+ Replaced the function sorted() by a call to sort()
+ on the entry list.
+ The function sorted() has been added to Python 2.4.
+ The function method sort() of List works with older
+ versions of Python.
- WebSocket runtime configuration is supported by chromium/v8 only.
+ * Scripts/create-html-entity-table:
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+2010-08-20 Martin Robinson <mrobinson@igalia.com>
-2009-10-19 Nate Chapin <japhet@chromium.org>
+ Reviewed by Pavel Feldman.
- Reviewed by Adam Barth.
+ Web Inspector: Inspector tests were disabled for GTK.
+ https://bugs.webkit.org/show_bug.cgi?id=43977
- Add testFail() to test plugin so we can test our handling of a
- plugin invoke call returning false.
+ * Scripts/old-run-webkit-tests: Set the WEBKIT_INSPECTOR_PATH to the appropriate
+ path before running tests.
- https://bugs.webkit.org/show_bug.cgi?id=30239
+2010-08-20 Daniel Bates <dbates@rim.com>
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: Add testFail().
- (pluginInvoke):
- (testIdentifierToString): Always return true, since returning false will now cause an exception to be thrown.
+ Reviewed by Eric Seidel.
-2009-10-19 Zan Dobersek <zandobersek@gmail.com>
+ svn-apply doesn't detect empty line with Windows line endings
+ after property value
+ https://bugs.webkit.org/show_bug.cgi?id=43981
+
+ Part 2 of 2
+
+ Add unit tests that were not landed in the first commit.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+ - Added the following test cases:
+ "SVN: binary file (isBinary true) using Windows line endings"
+ "SVN: property diff, followed by file change diff using Windows line endings"
+ "SVN: two consecutive property diffs using Windows line endings"
+ "SVN: binary file with executable bit change usng Windows line endings"
+ "SVN: binary file followed by property change on different file using Windows line endings"
+ "SVN: binary file followed by file change on different file using Windows line endings"
+ "SVN: file change diff with property change, followed by property change diff using Windows line endings"
+ "SVN: file change diff with property change, followed by file change diff using Windows line endings"
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl:
+ - Added the following test cases:
+ "add svn:executable, followed by empty line and start of next diff using Windows line endings"
+ "add svn:executable, followed by empty line and start of next property diff using Windows line endings"
+ "multi-line '+' change, followed by empty line and start of next diff using Windows line endings"
+ "multi-line '+' change, followed by empty line and start of next property diff using Windows line endings"
+ "add svn:executable, followed by empty line and start of binary patch using Windows line endings"
+ "multi-line '+' change, followed by empty line and start of binary patch using Windows line endings"
+ "multi-line '-' change, followed by multi-line '+' change, empty line, and start of binary patch using Windows line endings"
+ "single-line '+' with trailing new line using Windows line endings"
+ "single-line '+' with trailing new line, followed by empty line and start of binary patch using Windows line endings"
+ "single-line '-' change with trailing new line, and single-line '+' change using Windows line endings"
+ "multi-line '-' change with trailing new line, and multi-line '+' change using Windows line endings"
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl:
+ - Added the following test cases:
+ "single-line '-' change followed by empty line with Windows line endings"
+ "multi-line '+' change and start of binary patch with Windows line endings"
+
+2010-08-20 Daniel Bates <dbates@rim.com>
- Reviewed by Gustavo Noronha.
+ Reviewed by Eric Seidel.
- Enable DOM pasting when running layout tests.
+ svn-apply doesn't detect empty line with Windows line endings
+ after property value
+ https://bugs.webkit.org/show_bug.cgi?id=43981
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+ Fixes an issue where an empty line following the property value
+ in an SVN property change diff would not be detected if it had
+ Windows line endings (i.e. ended in CRLF). Hence it was consumed
+ as if it was part of a multi-line property value.
-2009-10-18 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * Scripts/VCSUtils.pm:
+ - Modified parseSvnPropertyValue() to detect empty line
+ with Windows line endings.
+ - Added toWindowsLineEndings().
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+ - Added the following test cases:
+ "SVN: binary file (isBinary true) using Windows line endings"
+ "SVN: property diff, followed by file change diff using Windows line endings"
+ "SVN: two consecutive property diffs using Windows line endings"
+ "SVN: binary file with executable bit change usng Windows line endings"
+ "SVN: binary file followed by property change on different file using Windows line endings"
+ "SVN: binary file followed by file change on different file using Windows line endings"
+ "SVN: file change diff with property change, followed by property change diff using Windows line endings"
+ "SVN: file change diff with property change, followed by file change diff using Windows line endings"
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl:
+ - Added the following test cases:
+ "add svn:executable, followed by empty line and start of next diff using Windows line endings"
+ "add svn:executable, followed by empty line and start of next property diff using Windows line endings"
+ "multi-line '+' change, followed by empty line and start of next diff using Windows line endings"
+ "multi-line '+' change, followed by empty line and start of next property diff using Windows line endings"
+ "add svn:executable, followed by empty line and start of binary patch using Windows line endings"
+ "multi-line '+' change, followed by empty line and start of binary patch using Windows line endings"
+ "multi-line '-' change, followed by multi-line '+' change, empty line, and start of binary patch using Windows line endings"
+ "single-line '+' with trailing new line using Windows line endings"
+ "single-line '+' with trailing new line, followed by empty line and start of binary patch using Windows line endings"
+ "single-line '-' change with trailing new line, and single-line '+' change using Windows line endings"
+ "multi-line '-' change with trailing new line, and multi-line '+' change using Windows line endings"
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl:
+ - Added the following test cases:
+ "single-line '-' change followed by empty line with Windows line endings"
+ "multi-line '+' change and start of binary patch with Windows line endings"
+
+2010-08-19 David Kilzer <ddkilzer@apple.com>
+
+ BUILD FIX: Fix Mac build after Windows WebKit2 changes for Netscape Plug-ins
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (decidePolicyForNavigationAction): Updated method signature.
+ (decidePolicyForNewWindowAction): Updated method signature.
+
+2010-08-19 Adam Roben <aroben@apple.com>
+
+ Test that NP_Initialize and NP_GetEntryPoints are called in the
+ correct order
+
+ The order differs between Mac and Windows (see r38858).
+
+ Fixes <http://webkit.org/b/44270> <rdar://problem/8330393> Crash in
+ NP_Initialize when loading QuickTime when running
+ plugins/embed-attributes-setting.html in WebKit2 on Windows
- Reviewed by Simon Hausmann.
+ Reviewed by Sam Weinig.
- Use the setPreferredContentsSize method instead
- of setFixedContentsSize, as the method has been renamed.
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp: Added a CRASH macro and
+ a boolean to record whether NP_GetEntryPoints has been called.
+ (NP_Initialize): Crash on Windows if NP_GetEntryPoints hasn't been
+ called yet. This matches Flash and QuickTime's behavior. Crash on Mac
+ if NP_GetEntryPoints has been called already. This matches
+ Silverlight's behavior.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::open):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setFixedContentsSize):
+2010-08-19 Adam Roben <aroben@apple.com>
-2009-10-16 Steve Falkenburg <sfalken@apple.com>
+ Make build-webkittestrunner build TestNetscapePlugIn on Windows
- Reviewed by Dan Bernstein.
+ Fixes <http://webkit.org/b/44268> <rdar://problem/8330388>
- https://bugs.webkit.org/show_bug.cgi?id=30456
- Fixes for new Debug_All Windows build configuration.
+ Reviewed by Sam Weinig.
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (sharedCFURLCache): Use new DEBUG_ALL preprocessor define for library naming.
- * DumpRenderTree/win/DumpRenderTree.vcproj: Remove unused DEBUG_WEBKIT_HAS_SUFFIX.
+ * WebKitTestRunner/WebKitTestRunner.sln: Added TestNetscapePlugIn.
+ Threaded it in between ImageDiff and InjectedBundleGenerated.
-2009-10-16 Eric Seidel <eric@webkit.org>
+2010-08-19 Ojan Vafai <ojan@chromium.org>
Reviewed by Adam Barth.
- commit-queue status bot should list which buildbot is blocking the queue
- https://bugs.webkit.org/show_bug.cgi?id=30452
+ install rietveld's upload script from a versioned url
+ https://bugs.webkit.org/show_bug.cgi?id=44291
- Add new methods and testing.
+ autoinstall expects the file at a given URL to never change.
+ In order to be able to update the file, we need to be able to
+ change the path.
- * Scripts/bugzilla-tool:
- * Scripts/modules/buildbot.py:
- * Scripts/modules/buildbot_unittest.py:
+ * Scripts/webkitpy/thirdparty/__init__.py:
-2009-10-16 Eric Seidel <eric@webkit.org>
+2010-08-19 Ojan Vafai <ojan@chromium.org>
Reviewed by Adam Barth.
- run-webkit-tests fails when CWD is not inside a WebKit checkout
- https://bugs.webkit.org/show_bug.cgi?id=30451
+ add --webkit_patch_id to reitveld uploads
+ https://bugs.webkit.org/show_bug.cgi?id=44289
- * Scripts/modules/scm.py: in_working_directory shouldn't throw exceptions on failure.
- * Scripts/modules/scm_unittest.py:
- - Remove use of original_path (we don't need to restore the CWD).
- - Don't use '.' to find the webkit checkout, use __file__ instead.
+ This is the first step in having rietveld store which
+ patches have been uploaded and getting rid of the
+ in-rietveld flag.
-2009-10-16 Steve Falkenburg <sfalken@apple.com>
+ * Scripts/webkitpy/common/net/rietveld.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/postcodereview.py:
- Reviewed by Adam Roben.
-
- Add a Debug_All configuration to build entire stack as debug.
- Change Debug_Internal to:
- - stop using _debug suffix for all WebKit/Safari binaries
- - not use _debug as a DLL naming suffix
- - use non-debug C runtime lib.
-
- * DumpRenderTree/DumpRenderTree.sln: Add Debug_All configuration.
- * DumpRenderTree/win/DumpRenderTree.vcproj: Add Debug_All configuration.
- * DumpRenderTree/win/ImageDiff.vcproj: Add Debug_All configuration.
- * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
- Add missing debug.vsprops inherited property sheet.
- Add Debug_All configuration.
- * FindSafari/FindSafari.vcproj: Renamed single configuration from "Release" to "all".
- * WinLauncher/WinLauncher.vcproj:
- Removed extraneous definitions inherited from vsprops.
- Add Debug_All configuration.
-
-2009-10-16 Carol Szabo <carol.szabo@nokia.com>
+2010-08-19 Kenneth Russell <kbr@google.com>
Reviewed by David Levin.
- check-webkit-style is wrong about indent checking in namespaces
- in header files and a few other things
- https://bugs.webkit.org/show_bug.cgi?id=30362
+ Adjust my status from committer to reviewer
+ https://bugs.webkit.org/show_bug.cgi?id=44277
- The few other things include:
- + check-webkit-style does not require spaces around the equal sign
- inside 'if' statements and around binary operators that take
- numeric literals.
- + check-webkit-style reports false errors for the / operator
- when part of a filename in the #include directive.
+ * Scripts/webkitpy/common/config/committers.py:
- * Scripts/modules/cpp_style.py:
- Improved indentation checking and space checking around
- binary operators. While the checks are still not perfect,
- they are clearly better than before.
- * Scripts/modules/cpp_style_unittest.py:
- Added test cases for the newly supported checks and modified old
- test cases to match the new guidelines
+2010-08-19 Pavel Feldman <pfeldman@chromium.org>
-2009-10-16 Kevin Ollivier <kevino@theolliviers.com>
+ Reviewed by Yury Semikhatsky.
- wxMSW build fix. Link to MSW library needed by PluginPackageWin.cpp.
+ Chromium DevTools: remove injected script fetcher from test harness.
+ https://bugs.webkit.org/show_bug.cgi?id=44266
- * wx/build/settings.py:
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
-2009-10-15 Yuzo Fujishima <yuzo@google.com>
+2010-08-19 Pavel Feldman <pfeldman@chromium.org>
- Reviewed by David Levin.
+ Reviewed by Yury Semikhatsky.
- Add mod_pywebsocket to test Web Sockets.
- http://code.google.com/p/pywebsocket/
- https://bugs.webkit.org/show_bug.cgi?id=27490
-
- * pywebsocket/COPYING: Added.
- * pywebsocket/MANIFEST.in: Added.
- * pywebsocket/README: Added.
- * pywebsocket/example/echo_client.py: Added.
- * pywebsocket/example/echo_wsh.py: Added.
- * pywebsocket/mod_pywebsocket/__init__.py: Added.
- * pywebsocket/mod_pywebsocket/dispatch.py: Added.
- * pywebsocket/mod_pywebsocket/handshake.py: Added.
- * pywebsocket/mod_pywebsocket/headerparserhandler.py: Added.
- * pywebsocket/mod_pywebsocket/msgutil.py: Added.
- * pywebsocket/mod_pywebsocket/standalone.py: Added.
- * pywebsocket/mod_pywebsocket/util.py: Added.
- * pywebsocket/setup.py: Added.
- * pywebsocket/test/config.py: Added.
- * pywebsocket/test/mock.py: Added.
- * pywebsocket/test/run_all.py: Added.
- * pywebsocket/test/test_dispatch.py: Added.
- * pywebsocket/test/test_handshake.py: Added.
- * pywebsocket/test/test_mock.py: Added.
- * pywebsocket/test/test_msgutil.py: Added.
- * pywebsocket/test/test_util.py: Added.
- * pywebsocket/test/testdata/handlers/blank_wsh.py: Added.
- * pywebsocket/test/testdata/handlers/origin_check_wsh.py: Added.
- * pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py: Added.
- * pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py: Added.
- * pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py: Added.
- * pywebsocket/test/testdata/handlers/sub/plain_wsh.py: Added.
- * pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py: Added.
- * pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py: Added.
-
-2009-10-15 James Robinson <jamesr@google.com>
+ Chromium DevTools: There is no need in resource-based InjectedScript.js source.
+ Now that we populate front-end after its onload handler, we don't need
+ to install injected script early. Exposing injected script source on the WebCore
+ level here.
+ https://bugs.webkit.org/show_bug.cgi?id=44029
- Reviewed by David Levin.
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ (DRTDevToolsAgent::runtimePropertyChanged):
+ (DRTDevToolsAgent::delayedFrontendLoaded):
+ (DRTDevToolsAgent::frontendLoaded):
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
- Updates check-webkit-style to reflect that code inside a namespace should not be indented, even in a header file.
+2010-08-19 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
- https://bugs.webkit.org/show_bug.cgi?id=30426
+ Reviewed by Kenneth Rohde Christiansen.
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+ [Gtk] Enable view mode media feature layout test
+ https://bugs.webkit.org/show_bug.cgi?id=43278
-2009-10-15 Brian Weinstein <bweinstein@apple.com>
+ Add view mode media feature testing infrastructure, and add
+ placeholder methods for the other platforms'
+ LayoutTestControllers.
- Reviewed by Adam Roben.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setViewModeMediaFeatureCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setViewModeMediaFeature):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setViewModeMediaFeature):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setViewModeMediaFeature):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setViewModeMediaFeature):
- Fixes <http://webkit.org/b/30411>.
- REGRESSION(49485): pdevenv doesn't compile in parallel for non-chromium builds on Windows.
-
- Added a check for isChromium() in pdevenv, and pass /useenv if we are not
- building Chromium.
+2010-08-18 Mark Rowe <mrowe@apple.com>
- * Scripts/pdevenv:
+ Reviewed by Sam Weinig.
-2009-10-15 Robin Dunn <robin@alldunn.com>
+ Make it so the WebKit2 test slave runs the WebKit2 tests
- Reviewed by Kevin Ollivier.
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
- Add Mac package building scripts for wx.
-
- https://bugs.webkit.org/show_bug.cgi?id=30405
+2010-08-18 Sam Weinig <sam@webkit.org>
- * wx/build/build_utils.py:
- * wx/build/settings.py:
- * wx/packaging/build-mac-installer.py: Added.
+ Reviewed by Mark Rowe.
-2009-10-15 Zan Dobersek <zandobersek@gmail.com>
+ Make run-webkit-tests --webkit-test-runner build DumpRenderTree
+ in addition to WebKitTestRunner to get the DumpRenderTreeSupport
+ module and the TestNetscapePlugin.
- Reviewed by Gustavo Noronha.
+ * Scripts/old-run-webkit-tests:
- Enable Web Sockets support when running layout tests.
+2010-08-18 Adam Roben <aroben@apple.com>
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+ Fix hang when saving crash logs on Windows
-2009-10-15 Xan Lopez <xlopez@igalia.com>
+ * Scripts/old-run-webkit-tests:
+ (setUpWindowsCrashLogSaving):
+ (END):
+ Pass -s to regtool so it will write the Auto value as a string instead
+ of as a number. This was causing a "do you want to debug?" dialog to
+ appear.
- Reviewed by Gustavo Noronha.
+2010-08-17 Victor Wang <victorw@chromium.org>
- Need to initialize event.button.button, since in most cases a
- button number is not passed as an argument.
+ Unreviewed. Fixed chromium incremental test json upload.
+ Quote builder name and test results server in url.
- * DumpRenderTree/gtk/EventSender.cpp:
- (mouseDownCallback):
- (mouseUpCallback):
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
-2009-10-15 Kevin Ollivier <kevino@theolliviers.com>
+2010-08-17 Laszlo Gombos <laszlo.1.gombos@nokia.com>
- wx build fix. More SDK fixes for Mac, make sure we use the SDK corresponding to
- the OS if none was explicitly set.
+ Reviewed by Ariya Hidayat.
- * wx/build/settings.py:
+ [Qt] [Symbian] Consistently use Q_OS_SYMBIAN to guard all Symbian platform dependencies
+ https://bugs.webkit.org/show_bug.cgi?id=44124
-2009-10-14 Pavel Feldman <pfeldman@chromium.org>
+ Q_WS_S60 is not defined for Symbian^4 devices as Q_WS_S60 used to guard
+ Avkon UI framework dependencies. Use Q_OS_SYMBIAN everywhere to mark
+ Symbian dependencies.
- Reviewed by Timothy Hatcher.
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::open):
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::init):
+ (LauncherWindow::toggleFullScreenMode):
+ (LauncherWindow::showFPS):
+ (LauncherWindow::updateFPS):
+ * QtTestBrowser/launcherwindow.h:
+ (WindowOptions::WindowOptions):
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::buildUI):
- Web Inspector: enable developers extras within inspector layout tests.
+2010-08-17 Dirk Pranke <dpranke@chromium.org>
- https://bugs.webkit.org/show_bug.cgi?id=30014
+ Reviewed by David Levin.
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::showWebInspector):
- (LayoutTestController::closeWebInspector):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::showWebInspector):
- (LayoutTestController::closeWebInspector):
+ new-run-webkit-tests: remove --show-sources option
-2009-10-14 José Millán Soto <jmillan@igalia.com>
+ --show-sources is pretty much obsolete with --trace everything, so
+ I'm removing it.
- Reviewed by Jan Alonzo.
+ Also rename a couple of methods in the TestTextDiff class to make their
+ intended visibility (private) more obvious.
- GtkLauncher is using a deprecated signal
- https://bugs.webkit.org/show_bug.cgi?id=30364
+ https://bugs.webkit.org/show_bug.cgi?id=44143
- Modified GtkLauncher to use notify::title signal instead of
- deprecated title-changed signal
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
- * GtkLauncher/main.c:
- (notify_title_cb):
- (create_browser):
+2010-08-17 Dirk Pranke <dpranke@chromium.org>
-2009-10-14 Brady Eidson <beidson@apple.com>
+ Reviewed by David Levin.
- Reviewed by Sam Weinig.
+ remove --fuzzy-image-diff in new-run-webkit-tests (it doesn't work)
- Don't set the history delegate on new windows that are opened during a test, as the history delegate:
- 1 - Disables WebHistory
- 2 - Doesn't make sense in that context anyway.
+ This code bit-rotted at some point more than a year ago, and nobody seems
+ to miss it. old-run-webkit-tests has a --tolerance flag that new-run-webkit-tests
+ should support instead, making this flag unnecessary anyway.
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (createWebViewAndOffscreenWindow):
+ https://bugs.webkit.org/show_bug.cgi?id=44141
-2009-10-14 Kevin Ollivier <kevino@theolliviers.com>
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py: Removed.
- wxMac build fix. Ensure 10.4 compatibility for deps, and allow the user to specify
- the SDK to use since Python overrides any user-set value of MACOSX_DEPLOYMENT_TARGET.
+2010-08-17 Victor Wang <victorw@chromium.org>
- * wx/build/settings.py:
- * wx/install-unix-extras:
+ Reviewed by Ojan Vafai.
-2009-10-14 Brady Eidson <beidson@apple.com>
+ Update json results generator to have incremental json including
+ results for tests that pass in current run but failed before.
- Reviewed by Sam Weinig.
+ https://bugs.webkit.org/show_bug.cgi?id=44119
- WebKit Win API should provide a delegate interface for global history.
- https://bugs.webkit.org/show_bug.cgi?id=29905
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::LayoutTestController):
- * DumpRenderTree/LayoutTestController.h:
- (LayoutTestController::dumpHistoryDelegateCallbacks):
- (LayoutTestController::setDumpHistoryDelegateCallbacks):
-
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (shouldLogHistoryDelegates):
- (runTest):
- (createWebViewAndOffscreenWindow):
- (main):
- * DumpRenderTree/win/DumpRenderTree.vcproj:
-
- Add the IWebHistoryDelegate to DRT Windows:
- * DumpRenderTree/win/HistoryDelegate.cpp: Added.
- (wstringFromBSTR):
- (HistoryDelegate::HistoryDelegate):
- (HistoryDelegate::~HistoryDelegate):
- (HistoryDelegate::QueryInterface):
- (HistoryDelegate::AddRef):
- (HistoryDelegate::Release):
- (HistoryDelegate::didNavigateWithNavigationData):
- (HistoryDelegate::didPerformClientRedirectFromURL):
- (HistoryDelegate::didPerformServerRedirectFromURL):
- (HistoryDelegate::updateHistoryTitle):
- (HistoryDelegate::populateVisitedLinksForWebView):
- * DumpRenderTree/win/HistoryDelegate.h: Added.
+2010-08-17 Dirk Pranke <dpranke@chromium.org>
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::removeAllVisitedLinks):
+ Reviewed by Eric Seidel.
-2009-10-14 Shu Chang <Chang.Shu@nokia.com>
+ fix test-webkitpy, add easy way to find a checkout root
- Reviewed by Simon Hausmann.
+ test-webkitpy currently doesn't work right if run from someplace other
+ than the checkout root, and it spews a bunch of debug logging because
+ the deduplicate_tests tests contaminates the test environment.
- [Qt] Implement support for setPOSIXLocale on Qt.
- https://bugs.webkit.org/show_bug.cgi?id=30268
-
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- (LayoutTestController::setPOSIXLocale):
- * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ This patch cleans up the deduplicate_tests unit tests, and creates
+ two new methods in scm.py: find_checkout_root() and default_scm(),
+ both of which use a single algorithm for guessing what checkout root
+ to use if you aren't explicitly told one from a path.
-2009-10-13 Stephanie Lewis <slewis@apple.com>
+ https://bugs.webkit.org/show_bug.cgi?id=44001
- Unreviewed, adding myself to reviewers list.
+ * Scripts/deduplicate-tests:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py:
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py:
+ * Scripts/webkitpy/tool/main.py:
- * Scripts/modules/committers.py:
+2010-08-17 Victor Wang <victorw@chromium.org>
-2009-10-13 Stephanie Lewis <slewis@apple.com>
+ Reviewed by Ojan Vafai.
- Reviewed by Mark Rowe.
+ Add support to the test results server for downloading json that
+ contains test list only.
- Fix null assignment so root tests work again.
+ This is for json results generator to generate incremental json
+ results so that it includes results not only for tests failed in
+ current run, but also tests failed before.
- * Scripts/webkitdirs.pm:
+ Also set the results type to "N" (no data) instead of "P" (pass)
+ if test results cannot be found in incremental json file.
-2009-10-13 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+ https://bugs.webkit.org/show_bug.cgi?id=44117
- Reviewed by Simon Hausmann.
+ * TestResultServer/handlers/testfilehandler.py:
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/jsonresults_unittest.py:
- [Qt] Refactor LayoutTestController, EventSender, TextInputController and WorkQueueItem classes
- out of jsobjects into separate files to get a more structured DumpRenderTree implementation.
- This is done in preparation of implementing missing features in DRT.
- No functionality changes made yet.
+2010-08-17 Adam Roben <aroben@apple.com>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- * DumpRenderTree/qt/DumpRenderTree.pro:
- * DumpRenderTree/qt/EventSenderQt.cpp: Added.
- (EventSender::EventSender):
- (EventSender::mouseDown):
- (EventSender::mouseUp):
- (EventSender::mouseMoveTo):
- (EventSender::leapForward):
- (EventSender::keyDown):
- (EventSender::contextClick):
- (EventSender::scheduleAsynchronousClick):
- (EventSender::frameUnderMouse):
- * DumpRenderTree/qt/EventSenderQt.h: Added.
- (EventSender::clearKillRing):
- * DumpRenderTree/qt/LayoutTestControllerQt.cpp: Added.
- (LayoutTestController::LayoutTestController):
- (LayoutTestController::reset):
- (LayoutTestController::processWork):
- (LayoutTestController::maybeDump):
- (LayoutTestController::waitUntilDone):
- (LayoutTestController::notifyDone):
- (LayoutTestController::windowCount):
- (LayoutTestController::clearBackForwardList):
- (LayoutTestController::dumpEditingCallbacks):
- (LayoutTestController::dumpResourceLoadCallbacks):
- (LayoutTestController::queueBackNavigation):
- (LayoutTestController::queueForwardNavigation):
- (LayoutTestController::queueLoad):
- (LayoutTestController::queueReload):
- (LayoutTestController::queueScript):
- (LayoutTestController::provisionalLoad):
- (LayoutTestController::timerEvent):
- (LayoutTestController::encodeHostName):
- (LayoutTestController::decodeHostName):
- (LayoutTestController::setJavaScriptProfilingEnabled):
- (LayoutTestController::setFixedContentsSize):
- (LayoutTestController::setPrivateBrowsingEnabled):
- (LayoutTestController::setPopupBlockingEnabled):
- (LayoutTestController::pauseAnimationAtTimeOnElementWithId):
- (LayoutTestController::pauseTransitionAtTimeOnElementWithId):
- (LayoutTestController::numberOfActiveAnimations):
- (LayoutTestController::disableImageLoading):
- (LayoutTestController::dispatchPendingLoadRequests):
- (LayoutTestController::setDatabaseQuota):
- (LayoutTestController::clearAllDatabases):
- (LayoutTestController::whiteListAccessFromOrigin):
- (LayoutTestController::waitForPolicyDelegate):
- (LayoutTestController::overridePreference):
- * DumpRenderTree/qt/LayoutTestControllerQt.h: Added.
- (LayoutTestController::isLoading):
- (LayoutTestController::setLoading):
- (LayoutTestController::shouldDumpAsText):
- (LayoutTestController::shouldDumpBackForwardList):
- (LayoutTestController::shouldDumpChildrenAsText):
- (LayoutTestController::shouldDumpDatabaseCallbacks):
- (LayoutTestController::shouldDumpStatusCallbacks):
- (LayoutTestController::shouldWaitUntilDone):
- (LayoutTestController::canOpenWindows):
- (LayoutTestController::shouldDumpTitleChanges):
- (LayoutTestController::waitForPolicy):
- (LayoutTestController::dumpAsText):
- (LayoutTestController::dumpChildFramesAsText):
- (LayoutTestController::dumpDatabaseCallbacks):
- (LayoutTestController::dumpStatusCallbacks):
- (LayoutTestController::setCanOpenWindows):
- (LayoutTestController::dumpBackForwardList):
- (LayoutTestController::setCloseRemainingWindowsWhenComplete):
- (LayoutTestController::display):
- (LayoutTestController::dumpTitleChanges):
- (LayoutTestController::dumpSelectionRect):
- * DumpRenderTree/qt/TextInputControllerQt.cpp: Added.
- (TextInputController::TextInputController):
- (TextInputController::doCommand):
- * DumpRenderTree/qt/TextInputControllerQt.h: Added.
- * DumpRenderTree/qt/WorkQueue.cpp:
- * DumpRenderTree/qt/WorkQueue.h:
- * DumpRenderTree/qt/WorkQueueItem.h:
- * DumpRenderTree/qt/WorkQueueItemQt.cpp: Added.
- (findFrameNamed):
- (LoadItem::invoke):
- (ReloadItem::invoke):
- (ScriptItem::invoke):
- (BackForwardItem::invoke):
- * DumpRenderTree/qt/jsobjects.cpp: Move all the above classes into separate files
- * DumpRenderTree/qt/jsobjects.h:
+ Use the right path style
-2009-10-13 Dmitry Titov <dimich@chromium.org>
+ * Scripts/old-run-webkit-tests:
- Not reviewed, adding myself to the list of reviewers.
+2010-08-17 Adam Roben <aroben@apple.com>
- * Scripts/modules/committers.py:
+ Fix typo
-2009-10-13 Anders Carlsson <andersca@apple.com>
+ * Scripts/old-run-webkit-tests:
- Reviewed by Sam Weinig.
+2010-08-17 Adam Roben <aroben@apple.com>
- <rdar://problem/6660507> Add "privacy mode" to Netscape Plug-in API
+ Don't hang when running run-webkit-tests as a non-Administrator on
+ Vista/7
- Make the private browsing mode testable by the test plug-in.
-
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
- (pluginGetProperty):
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
- * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
- (NPP_New):
- (NPP_SetValue):
-
-2009-10-13 Pavel Feldman <pfeldman@chromium.org>
-
- No review, just adding self to the list of reviewers.
+ * Scripts/old-run-webkit-tests:
+ (setUpWindowsCrashLogSaving): Use regtool to set NTSD as the
+ post-mortem debugger, rather than using NTSD itself. The latter waits
+ for user input when it fails to set the registry values; the former
+ does not.
- * Scripts/modules/committers.py:
+2010-08-17 Adam Roben <aroben@apple.com>
-2009-10-12 Pavel Feldman <pfeldman@chromium.org>
+ Teach run-webkit-tests, DumpRenderTree, and WebKitTestRunner how to
+ save crash logs on Windows
- Reviewed by Adam Roben.
-
- Web Inspector: Use proper web view in inspector layout
- tests for windows.
-
- https://bugs.webkit.org/show_bug.cgi?id=30298
+ The crash logs are saved to /tmp/layout-test-results and have names
+ like CrashLog_02bc_2010-08-17_14-36-20-108.txt.
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::showWebInspector):
- (LayoutTestController::closeWebInspector):
- (LayoutTestController::evaluateInWebInspector):
+ Unfortunately, crashes in the WebKit2 web process are recorded as
+ time-outs by run-webkit-tests. Fixing this is covered by
+ <http://webkit.org/b/44121>.
-2009-10-12 Fumitoshi Ukai <ukai@chromium.org>
+ Fixes <http://webkit.org/b/37859> <rdar://problem/7883560>
+ DumpRenderTree should save a stack trace and/or dump file when it
+ crashes
Reviewed by Sam Weinig.
- Enable experimentalWebSocket in DumpRenderTree for LayoutTest.
- https://bugs.webkit.org/show_bug.cgi?id=29841
-
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+ (exceptionFilter):
+ (main):
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::exceptionFilter):
+ (WTR::TestController::platformInitialize):
+ These changes set up an exception filter that prints #CRASHED to
+ stderr, then lets the exception propagate normally. This allows
+ run-webkit-tests to detect when we've crashed even when a post-mortem
+ debugger attaches to the process.
+
+ * Scripts/old-run-webkit-tests:
+ (top level): Declared some variables used by the crash-log-saving
+ code.
+ (openDumpTool): Copy _NT_SYMBOL_PATH into the clean environment so
+ that the post-mortem debugger has access to it.
+ (toCygwinPath): Added. This is the opposite of toWindowsPath.
+ (readFromDumpToolWithTimer): If the dump tool prints #CRASHED to
+ stderr, consider it a crash.
+ (setUpWindowsCrashLogSaving): Added. Saves the current post-mortem
+ debugger, then sets ntsd as the post-mortem debugger. ntsd is
+ configured to save a crash log and then quit automatically.
+ (END): Added. Restores the previous post-mortem debugger when the
+ script exits.
+
+2010-08-17 Victor Wang <victorw@chromium.org>
+
+ Reviewed by ojan@chromium.org.
+
+ Update test results server:
+ 1. Normalize test results and times after merging (prune tests where
+ all runs pass or do not have data, truncate all test items to max
+ number of builds)
+ 2. times should be int not string.
+ 3. when inserting a new test item, should keep old data regardless
+ whether or not they have same item type with new one.
+
+ https://bugs.webkit.org/show_bug.cgi?id=43861
+
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/jsonresults_unittest.py:
+
+2010-08-16 Sam Weinig <sam@webkit.org>
-2009-10-12 Yaar Schnitman <yaar@chromium.org>
+ Reviewed by Mark Rowe.
- Reviewed by Dimitri Glazkov.
+ Add WebKit2 Mac tester to buildbot.
- Chromium Port - Windows
- https://bugs.webkit.org/show_bug.cgi?id=29969
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
- * Scripts/pdevenv: removed msvc's /useenv for chromium builds
- * Scripts/webkitdirs.pm:
+2010-08-16 Paul Sawaya <psawaya@apple.com>
-2009-10-12 Csaba Osztrogonac <ossy@webkit.org>
+ Reviewed by Chris Marrin.
- Reviewed by Darin Adler.
+ Added shader validation via ANGLE
+ https://bugs.webkit.org/show_bug.cgi?id=42405
- jsc scripts cleanup and Qt/GTK fix
- https://bugs.webkit.org/show_bug.cgi?id=30288
+ Added ANGLE to webkit build
- Duplicated jscPath() moved to webkitdirs.pm.
- New jscProductDir() added to webkitdirs.pm instead of duplicated codes.
- Configuration added (release/debug) to path for Qt-port on Windows.
+ * Scripts/build-webkit:
- * Scripts/run-javascriptcore-tests:
- * Scripts/run-jsc:
- * Scripts/run-sunspider:
- * Scripts/sunspider-compare-results:
- * Scripts/webkitdirs.pm:
+2010-08-16 Kevin Ollivier <kevino@theolliviers.com>
-2009-10-11 Adam Barth <abarth@webkit.org>
+ [wx] Build fix, do not build WebCore as a convenience library as this leads to
+ errors in the Win build w/export symbols and causes problems with DOM bindings
+ debugging in gdb.
- Unreviewed. Add Collin to committers.py.
+ * DumpRenderTree/wscript:
+ * Scripts/build-webkit:
+ * wx/browser/wscript:
+ * wx/build/settings.py:
+ * wx/build/waf_extensions.py:
- * Scripts/modules/committers.py:
+2010-08-16 Dan Bernstein <mitz@apple.com>
-2009-10-11 Kevin Ollivier <kevino@theolliviers.com>
+ Build fix.
- wx build fix, add bindings to source/include dirs now that there are sources there.
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::createOtherPage): Initialize the contentsSizeChanged member.
+ (WTR::TestController::initialize): Ditto.
- * wx/build/settings.py:
+2010-08-16 Balazs Kelemen <kb@inf.u-szeged.hu>
-2009-10-09 Mark Rowe <mrowe@apple.com>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by Brady Eidson.
+ Handle content size change in WebKit2
+ Re-landing after fix.
- Enable plug-in halting in DumpRenderTree.
+ https://bugs.webkit.org/show_bug.cgi?id=43198
- We drop the plug-in halting delay to 1 second and opt in the delegate method to never halt plug-ins.
- This is sufficient to ensure that the crash covered by <rdar://problem/7290671> no longer occurs.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]): Initialize WKPageUICallback::contetsSizeChanged to 0.
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create): Initialize WKPageUICallback::contetsSizeChanged to 0.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/mac/UIDelegate.mm:
- (-[UIDelegate webView:shouldHaltPlugin:]):
+2010-08-16 Sheriff Bot <webkit.review.bot@gmail.com>
-2009-10-08 Brady Eidson <beidson@apple.com>
+ Unreviewed, rolling out r65419.
+ http://trac.webkit.org/changeset/65419
+ https://bugs.webkit.org/show_bug.cgi?id=44053
- Reviewed by Dan Bernstein.
+ Broke the Windows build (Requested by bbandix on #webkit).
- Ask the History Delegate to populate the visited links hash.
- <rdar://problem/7285293> and https://webkit.org/b/29904
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
- Add the ability for LayoutTestController to clear all visited links.
- Also lets the History Delegate dump visited links, but only if this test specifically cleared them.
+2010-08-16 Balazs Kelemen <kb@inf.u-szeged.hu>
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::LayoutTestController):
- (removeAllVisitedLinksCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::removeAllVisitedLinks):
+ Reviewed by Kenneth Rohde Christiansen.
- * DumpRenderTree/mac/HistoryDelegate.mm:
- (-[HistoryDelegate populateVisitedLinksForWebView:]):
+ Handle content size change in WebKit2
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::removeAllVisitedLinks):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::removeAllVisitedLinks):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::removeAllVisitedLinks):
+ https://bugs.webkit.org/show_bug.cgi?id=43198
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]): Initialize WKPageUICallback::contetsSizeChanged to 0.
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create): Initialize WKPageUICallback::contetsSizeChanged to 0.
-2009-10-08 Daniel Bates <dbates@webkit.org>
+2010-08-16 Ariya Hidayat <ariya@sencha.com>
- Reviewed by Adam Roben.
+ Add my new email address to committers.py.
- https://bugs.webkit.org/show_bug.cgi?id=30175
-
- The Windows DRT equivalent of DoDragDrop (i.e. UIDelegate::doDragDrop) does not return
- the OLE drag-and-drop return value like the function it emulates. Currently,
- UIDelegate::doDragDrop returns a hard-coded S_OK. Hence, the caller cannot determine
- whether the drag-and-drop operation was successful or was cancelled.
-
- This patch fixes this issue by having UIDelegate::doDragDrop return the OLE drag-and-drop
- return value according to whether the drop operation was successful or not.
+ * Scripts/webkitpy/common/config/committers.py:
- * DumpRenderTree/win/EventSender.cpp:
- (doMouseUp): Added parameter oleDragAndDropReturnValue.
- (replaySavedEvents): Ditto.
- * DumpRenderTree/win/EventSender.h:
- * DumpRenderTree/win/UIDelegate.cpp:
- (UIDelegate::doDragDrop): Modified to return OLE drag-and-drop return value.
+2010-08-16 Zoltan Horvath <zoltan@webkit.org>
-2009-10-08 Alejandro G. Castro <alex@igalia.com>
+ Add my old e-mail addresses to committers.py.
- Reviewed by Xan Lopez.
+ * Scripts/webkitpy/common/config/committers.py:
- [GTK] Added support for a parameter setting the button that was
- pressed in the mouseDown function.
- https://bugs.webkit.org/show_bug.cgi?id=30220
+2010-08-15 Jon Honeycutt <jhoneycutt@apple.com>
- * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+ WebEditorClient::didBeginEditing is never called in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42939
-2009-10-08 Alejandro G. Castro <alex@igalia.com>
+ Reviewed by Sam Weinig.
- Reviewed by Xan Lopez.
+ * WebKitTestRunner/PlatformWebView.h:
+ Declare focus().
- [GTK] Added a line to the bottom of the expected result to match
- the output of the test.
- https://bugs.webkit.org/show_bug.cgi?id=30220
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::resetStateToConsistentValues):
+ Focus the PlatformWebView.
- * LayoutTests/platform/gtk/editing/pasteboard/middle-click-onpaste-
- expected.txt:
+ * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+ (WTR::PlatformWebView::focus):
+ Stubbed.
-2009-10-08 Adam Roben <aroben@apple.com>
+ * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+ (WTR::PlatformWebView::focus):
+ Focus the view.
- Use QueryInterface to get IWebInspectorPrivate
+2010-08-15 Jon Honeycutt <jhoneycutt@apple.com>
- Fixes <http://webkit.org/b/30215> Make IWebInspectorPrivate be
- accessed in a more standard way
+ run-webkit-tests should not strip editing callbacks when using
+ WebKitTestRunner on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=44000
- Reviewed by John Sullivan and Tim Hatcher.
+ Reviewed by Mark Rowe.
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::evaluateInWebInspector): Get the IWebInspector
- by calling IWebViewPrivate::inspector, then use QueryInterface to get
- to the IWebInspectorPrivate interface.
+ * Scripts/old-run-webkit-tests:
+ Leave $stripEditingCallbacks undefined until we look for command-line
+ arguments. If using WebKit2, set it to 0 if not explicity set on the
+ command line. Later, set it to isCygwin() to match old behavior if it is
+ not yet defined.
-2009-10-07 Adam Roben <aroben@apple.com>
+2010-08-15 Kevin Ollivier <kevino@theolliviers.com>
- Implement DRT support for origin whitelisting
+ [wx] Build fix, remove define always set to the correct value by wtf/Platform.h.
- Fixes <http://webkit.org/b/30185>.
+ * wx/build/settings.py:
- Reviewed by Eric Seidel.
+2010-08-14 Martin Robinson <mrobinson@igalia.com>
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting): Reset any origin
- whitelist, to match Mac DRT.
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::whiteListAccessFromOrigin): Call through to
- IWebViewPrivate::whiteListAccessFromOrigin.
+ Reviewed by Kenneth Rohde Christiansen.
-2009-10-07 Brady Eidson <beidson@apple.com>
+ [GTK] autogen.sh not executed if build-webkit options change
+ https://bugs.webkit.org/show_bug.cgi?id=42266
- Reviewed by Darin Adler.
+ Rerun autogen.sh in situations where the arguments to build-webkit have
+ changed since the previous build. This will fix some issues on the bots
+ where the build does not notice changes to default build-webkit arguments.
- Send title changes to the global history delegate.
- <rdar://problem/7285293> and https://webkit.org/b/29904
+ * Scripts/webkitdirs.pm: Add special logic for detecting changes to build-webkit arguments.
- * DumpRenderTree/mac/HistoryDelegate.mm:
- (-[HistoryDelegate webView:updateHistoryTitle:forURL:]):
+2010-08-14 Eric Seidel <eric@webkit.org>
-2009-10-07 Adam Barth <abarth@webkit.org>
+ Unreviewed. Another fix to support python 2.3.
- Unreviewed. Remove some folks from committers.py who were listed on
- the WebKit Team wiki page but who weren't actually listed as commit+.
- At some point, we should coorelate this list with the committers
- mailing list.
+ Add support for MathML entities
+ https://bugs.webkit.org/show_bug.cgi?id=43949
- * Scripts/modules/committers.py:
+ * Scripts/webkitpy/thirdparty/simplejson/decoder.py:
+ - It looks like our simplejson is version 1.7.3 which
+ should be python 2.3 compatible. But someone modified
+ our copy slightly from the original source.
+ I've removed the relative import in hopes this fixes
+ the problem.
-2009-10-07 Adam Barth <abarth@webkit.org>
+2010-08-13 Eric Seidel <eric@webkit.org>
- Unreviewed. Import a bunch of committers from the WebKit Team page on
- the wiki into committers.py.
+ Unreviewed. Build fix only.
- * Scripts/modules/committers.py:
+ Add support for MathML entities
+ https://bugs.webkit.org/show_bug.cgi?id=43949
-2009-10-07 Adam Barth <abarth@webkit.org>
+ * Scripts/create-html-entity-table:
+ - Hack sys.path to avoid executing 2.5 dependent python
+ on systems (like chromium-win and Tiger) which do not have 2.5 python.
- Unreviewed. Added Aaron Boodman to committers.py.
+2010-08-13 Adam Barth <abarth@webkit.org>
- * Scripts/modules/committers.py:
+ Reviewed by Eric Seidel.
-2009-10-07 Evan Martin <evan@chromium.org>
+ Rename some concepts in HTML entity search to be more self-documenting
+ https://bugs.webkit.org/show_bug.cgi?id=44004
- Reviewed by Darin Adler.
+ Reflect name change in generator script.
- Add API to LayoutTestController for re/setting the system locale.
- https://bugs.webkit.org/show_bug.cgi?id=18994
+ * Scripts/create-html-entity-table:
- * DumpRenderTree/LayoutTestController.cpp:
- (setLocaleCallback):
- (LayoutTestController::staticFunctions):
- (LayoutTestController::setLocale):
- * DumpRenderTree/LayoutTestController.h:
+2010-08-12 Adam Barth <abarth@webkit.org>
-2009-10-06 Shinichiro Hamaji <hamaji@chromium.org>
+ Reviewed by Eric Seidel.
- Reviewed by Jan Alonzo.
+ Add support for MathML entities
+ https://bugs.webkit.org/show_bug.cgi?id=43949
- [Layout tests] [Gtk] Gtk DumpRenderTree should use WebKit test fonts
- https://bugs.webkit.org/show_bug.cgi?id=29689
+ A script for generating the C++ state data structure describing all the
+ entities from a JSON description.
- Build fix by adding -lfontconfig for DumpRenderTree.
+ * Scripts/create-html-entity-table: Added.
- * GNUmakefile.am:
+2010-08-13 Dirk Pranke <dpranke@chromium.org>
-2009-10-07 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+ Reviewed by Eric Seidel.
- Reviewed by Simon Hausmann.
+ Rewrite new-run-webkit-test's wait_for_threads_to_finish loop to
+ check for exceptions on all threads, not just the first thread.
+
+ This change also changes the logging behavior for wedged threads
+ to only dump the stacks of threads that are actually wedged.
- Re-enable use-remote-links-to-tests for Qt. Disabled in r46416.
+ Refactor the thread classes in the dump_render_tree_thread module
+ to make the contract between TestRunner and TestShellThread clearer.
- * Scripts/run-webkit-tests:
+ Added a bunch of unit tests.
+ https://bugs.webkit.org/show_bug.cgi?id=38561
-2009-10-07 Xan Lopez <xlopez@igalia.com>
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
- Reviewed by Gustavo Noronha.
+2010-08-13 Kenichi Ishibashi <bashi@google.com>
- "delete" in EventSender is the backspace key, not the delete one.
+ Reviewed by Shinichiro Hamaji.
- * DumpRenderTree/gtk/EventSender.cpp:
- (keyDownCallback):
+ Add test_expectations.txt syntax checker to check-webkit-style.
+ https://bugs.webkit.org/show_bug.cgi?id=43899
-2009-10-07 Xan Lopez <xlopez@igalia.com>
+ Just utilizing layout_tests/layout_package/test_expectations.py for checking
+ the syntax of test_expectations.txt.
+ This change also moves tab checking class from style/checkers/text.py to
+ style/checkers/common.py for sharing code.
- Reviewed by Gustavo Noronha.
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checkers/common.py:
+ * Scripts/webkitpy/style/checkers/common_unittest.py:
+ * Scripts/webkitpy/style/checkers/test_expectations.py: Added.
+ * Scripts/webkitpy/style/checkers/test_expectations_unittest.py: Added.
+ * Scripts/webkitpy/style/checkers/text.py:
+ * Scripts/webkitpy/style_references.py:
- getChildrenWithRange expects as last parameter the end index, not
- the length of the range. Correct this and clarify the variable
- names to reflect how the code works.
+2010-08-12 Jon Honeycutt <jhoneycutt@apple.com>
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::getChildrenWithRange):
- (AccessibilityUIElement::getChildAtIndex):
+ WebKitTestRunner does not correctly resize WebView for W3C SVG tests
+ https://bugs.webkit.org/show_bug.cgi?id=43945
-2009-10-06 Mark Rowe <mrowe@apple.com>
+ Reviewed by Sam Weinig.
- Reviewed by Simon Fraser.
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::sizeWebViewForCurrentTest):
+ Allow for a Windows-style path.
- <http://webkit.org/b/30138> update-webkit-localizable-strings assumes that WebKitTools/Scripts is in the PATH
+ * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+ (WTR::PlatformWebView::resizeTo):
+ Call SetWindowPos to resize the view window.
- * Scripts/update-webkit-localizable-strings: Use an explicit path to extract-localizable-strings based on the
- the fact we have already changed the working directory to the top of the open source tree.
+2010-08-12 David Levin <levin@chromium.org>
-2009-10-06 Julie Parent <jparent@chromium.org>
+ Build break fix.
- Unreviewed. Fixing the entry for myself in committers.py to use my bugzilla email,
- rather than my committer email.
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::resetStateToConsistentValues): Removed usage
+ of a variable that doesn't exist in the class.
- * Scripts/modules/committers.py:
+2010-08-12 Jon Honeycutt <jhoneycutt@apple.com>
-2009-10-06 Jakub Wieczorek <faw217@gmail.com>
+ WebKitTestRunner needs to run tests without using native controls
+ https://bugs.webkit.org/show_bug.cgi?id=43772
- Reviewed by Eric Seidel.
+ Reviewed by Sam Weinig.
- [Qt] LayoutTestController: Reset m_dumpStatusCallbacks to false in reset().
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+ Call platformInitializeContext().
- r49189 added support for the 'dumpStatusCallbacks' setting but didn't reset
- it after each layout test as it should do, making the DRT dump additional output
- for all of the subsequent layout tests.
+ * WebKitTestRunner/TestController.h:
+ Declare platformInitializeContext().
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::reset):
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::platformInitializeContext):
+ Stubbed.
-2009-10-06 Jakub Wieczorek <faw217@gmail.com>
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::platformInitializeContext):
+ Call WKContextSetShouldPaintNativeControls() to disable native control
+ drawing.
- Reviewed by Simon Hausmann.
+2010-08-12 Sam Weinig <sam@webkit.org>
- [Qt] Implement layoutTestController.dumpStatusCallbacks() and unskip the
- fast/dom/assign-to-window-status.html test, which is passing as a result.
+ Reviewed by Alexey Proskuryakov.
- https://bugs.webkit.org/show_bug.cgi?id=30127
+ WebKitTestRunner should be more aggressive about ensuring consistent state between tests
+ https://bugs.webkit.org/show_bug.cgi?id=43653
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::InjectedBundle):
+ (WTR::InjectedBundle::didReceiveMessage):
+ (WTR::InjectedBundle::beginTesting):
+ (WTR::InjectedBundle::done):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (WTR::InjectedBundle::isTestRunning):
+ (WTR::InjectedBundle::):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::stopLoading):
+ (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::dump):
+ (WTR::InjectedBundlePage::didFinishLoadForFrame):
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didReceiveTitleForFrame):
+ (WTR::InjectedBundlePage::didClearWindowForFrame):
+ (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
+ (WTR::InjectedBundlePage::willAddMessageToConsole):
+ (WTR::InjectedBundlePage::willSetStatusbarText):
+ (WTR::InjectedBundlePage::willRunJavaScriptAlert):
+ (WTR::InjectedBundlePage::willRunJavaScriptConfirm):
+ (WTR::InjectedBundlePage::shouldBeginEditing):
+ (WTR::InjectedBundlePage::shouldEndEditing):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ (WTR::InjectedBundlePage::shouldInsertText):
+ (WTR::InjectedBundlePage::shouldDeleteRange):
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::shouldApplyStyle):
+ (WTR::InjectedBundlePage::didBeginEditing):
+ (WTR::InjectedBundlePage::didEndEditing):
+ (WTR::InjectedBundlePage::didChange):
+ (WTR::InjectedBundlePage::didChangeSelection):
+ Don't do any work if we are not currently running a test.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+ * WebKitTestRunner/StringFunctions.h:
+ (WTR::toCF):
+ Add conversion function for WKURLRef -> CFURLRef
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::TestController):
+ (WTR::TestController::initialize):
+ (WTR::TestController::resetStateToConsistentValues):
+ (WTR::TestController::runTest):
+ (WTR::TestController::didFinishLoadForFrame):
+ * WebKitTestRunner/TestController.h:
+ (WTR::TestController::):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::invoke):
+ * WebKitTestRunner/TestInvocation.h:
+ Move resetting code to TestController.
+
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::runUntil):
+ * WebKitTestRunner/mac/TestInvocationMac.mm: Removed.
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::runUntil):
+ * WebKitTestRunner/win/TestInvocationWin.cpp: Removed.
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj:
+ Move runUntil to TestController.
+
+2010-08-12 Lucas De Marchi <lucas.demarchi@profusion.mobi>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::statusBarMessage):
- * DumpRenderTree/qt/DumpRenderTree.h:
- * DumpRenderTree/qt/jsobjects.h:
- (LayoutTestController::shouldDumpStatusCallbacks):
- (LayoutTestController::dumpStatusCallbacks):
+ Unreviewed.
-2009-10-06 Jakub Wieczorek <faw217@gmail.com>
+ Adding myself to the committers list.
- Reviewed by Simon Hausmann.
+ * Scripts/webkitpy/common/config/committers.py:
- [Qt] The implementation of EventSender::mouseUp() and EventSender::mouseDown()
- ignores the argument indicating which mouse button to trigger.
- https://bugs.webkit.org/show_bug.cgi?id=30048
+2010-08-12 Hayato Ito <hayato@chromium.org>
- This affects the fast/events/mouse-click-events.html layout test.
+ Reviewed by Tony Chang.
- * DumpRenderTree/qt/jsobjects.cpp:
- (EventSender::mouseDown):
- (EventSender::mouseUp):
- * DumpRenderTree/qt/jsobjects.h:
+ Merge pretty printers for gdb.
+ https://bugs.webkit.org/show_bug.cgi?id=43850
-2009-10-06 Jakub Wieczorek <faw217@gmail.com>
+ We need to update webcore.py because basic string classes have moved to WTF from WebCore.
+ It is good timing to merge webcore.py and wtf.py and name it 'webkit.py'.
+ webcore.py is left for backward compatibility.
- Reviewed by Simon Hausmann.
+ * gdb/webcore.py:
+ * gdb/webkit.py: Added.
+ * gdb/wtf.py: Removed.
- [Qt] Fix the EventSender::keyDown() implementation
- https://bugs.webkit.org/show_bug.cgi?id=30043
+2010-08-11 Tony Chang <tony@chromium.org>
- It should post both a key press event and a key release event,
- just like other ports do.
+ Reviewed by David Levin.
- * DumpRenderTree/qt/jsobjects.cpp:
- (EventSender::keyDown):
+ [chromium] add google-chrome layout test result directories
+ https://bugs.webkit.org/show_bug.cgi?id=43889
-2009-10-05 Kevin Ollivier <kevino@theolliviers.com>
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/google_chrome.py: Added.
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
- wx build fix. Add jpeg to the list of libs to link against.
+2010-08-11 Kent Tamura <tkent@chromium.org>
- * wx/build/settings.py:
+ Reviewed by Dimitri Glazkov.
-2009-10-05 Jakub Wieczorek <faw217@gmail.com>
+ [DRT/Chromium] Disable accelerated compositing
+ https://bugs.webkit.org/show_bug.cgi?id=43894
- Reviewed by Simon Hausmann.
+ Disable accelerated compositing because DRT is not ready for
+ it. This change fixes hundreds of test crashes on Windows and
+ Linux.
- [Qt] EventSender::keyDown() cannot send function-key events.
- https://bugs.webkit.org/show_bug.cgi?id=30044
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings):
- This affects the fast/events/keydown-function-keys.html layout test.
+2010-08-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
- * DumpRenderTree/qt/jsobjects.cpp:
- (EventSender::keyDown):
+ Unreviewed. Adding my Collabora personality to the list.
-2009-10-05 Vadim Zeitlin <vadim@wxwidgets.org>
+ * Scripts/webkitpy/common/config/committers.py:
- Added --wx-compiler-prefix waf option to allow building wxWebKit with
- wxWidgets built using "nmake COMPILER_PREFIX=something-non-default".
+2010-08-11 Martin Robinson <mrobinson@igalia.com>
- * wx/build/settings.py:
- * wx/build/wxpresets.py:
+ Adding myself as a reviewer.
-2009-10-05 Pavel Feldman <pfeldman@chromium.org>
+ * Scripts/webkitpy/common/config/committers.py:
- Reviewed by Timothy Hatcher.
+2010-08-11 Daniel Bates <dbates@rim.com>
- Web Inspector: add testing harness for Web Inspector.
+ Reviewed by Darin Adler.
- https://bugs.webkit.org/show_bug.cgi?id=30010
+ Perl warnings when running commit-log-editor
+ https://bugs.webkit.org/show_bug.cgi?id=43856
- * DumpRenderTree/LayoutTestController.cpp:
- (showWebInspectorCallback):
- (closeWebInspectorCallback):
- (evaluateInWebInspectorCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::showWebInspector):
- (LayoutTestController::closeWebInspector):
- (LayoutTestController::evaluateInWebInspector):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::showWebInspector):
- (LayoutTestController::closeWebInspector):
- (LayoutTestController::evaluateInWebInspector):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::showWebInspector):
- (LayoutTestController::closeWebInspector):
- (LayoutTestController::evaluateInWebInspector):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::showWebInspector):
- (LayoutTestController::closeWebInspector):
- (LayoutTestController::evaluateInWebInspector):
+ Fixes Perl warnings introduced by the patch for Bug #40548.
-2009-10-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ Perl doesn't have symbolic names for True/False. Instead, we
+ should use boolean values. Moreover, the variable installedEditorApplication
+ is not be used and should be renamed builtEditorApplication so that it
+ uses the existing machinery to set the commit log editor application.
- Reviewed by Ariyha Hidayat.
+ * Scripts/commit-log-editor:
- Pass arguments to system() as a string instead of array
+2010-08-11 Adam Barth <abarth@webkit.org>
- When passed as an array entries with a space fail to translate
- to two arguments to the child process, so instead of manually
- splitting all the entries in @buildArgs we pass the whole thing
- as a string instead.
+ Reviewed by Eric Seidel.
- * Scripts/webkitdirs.pm:
+ Trying waiting for httpd lock in the EWS
+ https://bugs.webkit.org/show_bug.cgi?id=43833
-2009-10-04 Carol Szabo <carol.szabo@nokia.com>
+ If this works, we can probably run the tests on the mac-ews, which
+ would be very exciting. :)
- Reviewed by David Levin.
+ * Scripts/webkitpy/tool/steps/runtests.py:
- check-webkit-style misses whitespace errors for operators:
- <<, >>, <<=, >>=, &=, |=, +=, -=, *=, /=, /, |, &&, ||.
- https://bugs.webkit.org/show_bug.cgi?id=30021
+2010-08-11 Marcus Bulach <bulach@chromium.org>
- * Scripts/modules/cpp_style.py:
- Added the operators mentioned above to the same list as == and !=.
+ Reviewed by Eric Seidel.
-2009-10-02 Julie Parent <jparent@chromium.org>
+ Check in a script to list redundant test outputs.
+ https://bugs.webkit.org/show_bug.cgi?id=37630
- Unreviewed.
+ If e.g. platform/mac-leopard is missing an expected test output, we
+ fall back on platform/mac. This means it's possible to grow redundant
+ test outputs, where we have the same expected data in both a platform
+ directory and another platform it falls back on.
+ (original patch by Evan Marting <evan@chromium.org> https://bugs.webkit.org/attachment.cgi?id=53398)
- Adding myself and Ojan Vafai as committers, because we are committers.
+ * Scripts/deduplicate-tests: Added.
+ * Scripts/webkitpy/layout_tests/deduplicate_tests.py: Added.
+ * Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py: Added.
- * Scripts/modules/committers.py:
+2010-08-11 Antonio Gomes <tonikitoo@webkit.org>
-2009-10-02 Brian Weinstein <bweinstein@apple.com>
+ Reviewed by Ariya Hidayat.
- Reviewed by Adam Roben.
+ [Qt] QtTestBrowser: after switching between QWebView and QGraphicsWebView, rotation actions get broken
+ https://bugs.webkit.org/show_bug.cgi?id=43853
- svn-create-patch should have an --ignore-changelogs to not add ChangeLogs to the diff,
- this will help the patch merging process when TryBots are used.
+ LauncherWindow::createChrome is connecting menu itens to WebViewGraphicsBased's slots directly.
+ It behaviors badly when user launches the QtTestBrowser in QWebView mode, since then switching to
+ QGraphicsWebView mode, createChrome is not called again, and menu items end up not getting connected
+ to slots at all.
- * Scripts/svn-create-patch:
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::createChrome):
+ (LauncherWindow::animatedFlip):
+ (LauncherWindow::animatedYFlip):
+ * QtTestBrowser/launcherwindow.h:
-2009-10-02 Jakub Wieczorek <faw217@gmail.com>
+2010-08-11 Antonio Gomes <tonikitoo@webkit.org>
Reviewed by Simon Hausmann.
- [Qt] Implement layoutTestController.overridePreference().
- https://bugs.webkit.org/show_bug.cgi?id=29970
+ [Qt] QtTestBrowser: switching between QWebView and QGraphicsWebView modes is broken
+ https://bugs.webkit.org/show_bug.cgi?id=43851
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
- (WebCore::WebPage::resetSettings):
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::reset):
- (LayoutTestController::setPrivateBrowsingEnabled):
- (LayoutTestController::setPopupBlockingEnabled):
- (LayoutTestController::overridePreference):
- * DumpRenderTree/qt/jsobjects.h:
+ All window options data (including the bool holding if the view is either QWebView or
+ QGraphicsWebView based) is stored in m_windowOptions, a class member of LauncherWindow.
+ When toggle the view from QWebView to QGraphicsWebView based (and vice-versa), we were
+ not updating LauncherWindow::WindowOptions::m_useGraphicsView bit, and then things were
+ getting broken.
-2009-10-01 Chris Marrin <cmarrin@apple.com>
+ Patch addresses this issue.
- Reviewed by Oliver Hunt.
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::createChrome):
+ (LauncherWindow::toggleWebView):
+ (LauncherWindow::toggleAcceleratedCompositing):
- Turn on ENABLE_3D_CANVAS in TOT
- https://bugs.webkit.org/show_bug.cgi?id=29906
+2010-08-10 Antonio Gomes <tonikitoo@webkit.org>
- * Scripts/build-webkit:
+ Reviewed by Ariya Hidayat.
-2009-10-01 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ [Qt] QtTestBrowser: lazy instantiate "YRotation" state machine and related objects
+ https://bugs.webkit.org/show_bug.cgi?id=43831
- Rubberstamped by Simon Hausmann.
+ Only instantiate QStateMachine and friends associated to the YRotation action on demand.
- Enable HTTP tests for Qt
+ * QtTestBrowser/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebViewGraphicsBased::animatedYFlip):
- * Scripts/run-webkit-tests:
+2010-08-11 Darin Adler <darin@apple.com>
-2009-10-01 Yaar Schnitman <yaar@chromium.org>
+ Reviewed by John Sullivan.
- Reviewed by Dimitri Glazkov.
+ Improved editor options for prepare-ChangeLog and commit-log-editor
+ https://bugs.webkit.org/show_bug.cgi?id=40548
- build-webkit --chromium now also works on cygwin.
+ * Scripts/commit-log-editor: Split editor strings on spaces so EDITOR
+ values like "xed --launch --wait" work properly.
- https://bugs.webkit.org/show_bug.cgi?id=29973
+ * Scripts/prepare-ChangeLog: Added a new CHANGE_LOG_EDITOR so we can
+ use a command line tool with the $openChangeLogs feature.
- * Scripts/webkitdirs.pm:
+2010-08-11 Yury Semikhatsky <yurys@chromium.org>
-2009-10-01 Zoltan Horvath <zoltan@webkit.org>
+ Reviewed by Pavel Feldman.
- Reviewed by Simon Hausmann.
+ Web Inspector: remove InjectDispatch.js
+ https://bugs.webkit.org/show_bug.cgi?id=43835
- [Qt] Don't use TCmalloc in DumpRenderTree
- https://bugs.webkit.org/show_bug.cgi?id=27029
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
- Add USE_SYSTEM_MALLOC macro to the DRT's profile to avoid using TCmalloc in Qt's DRT.
+2010-08-10 Dirk Pranke <dpranke@chromium.org>
- * DumpRenderTree/qt/DumpRenderTree.pro:
+ Reviewed by Eric Seidel.
-2009-10-01 Jakub Wieczorek <faw217@gmail.com>
+ webkit-patch should refuse to run under Win32 Python
+ https://bugs.webkit.org/show_bug.cgi?id=40962
- Reviewed by Simon Hausmann.
+ Given that there are lots of places in webkit-patch's code that
+ assume unix-style filenames (forward slashes), webkit-patch fails
+ with weird file-not-found errors when run under a native windows
+ Python. It would be nice if we just trapped this and errored out
+ at the beginning, rather than producing unpredictable errors.
- [Qt] Implement eventSender.scheduleAsynchronousClick().
+ * Scripts/webkit-patch:
- https://bugs.webkit.org/show_bug.cgi?id=29931
+2010-08-10 Kent Tamura <tkent@chromium.org>
- * DumpRenderTree/qt/jsobjects.cpp:
- (EventSender::scheduleAsynchronousClick):
- * DumpRenderTree/qt/jsobjects.h:
+ Unreviewed, build fix.
+
+ Chromium build fix for r65107.
-2009-10-01 Jakub Wieczorek <faw217@gmail.com>
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
- Reviewed by Simon Hausmann.
+2010-08-10 Sergio Villar Senin <svillar@igalia.com>
- [Qt] Implement setPopupBlockingEnabled() in the LayoutTestController and remove
- fast/events/open-window-from-another-frame.html from the Skipped list.
+ Reviewed by Xan Lopez.
- https://bugs.webkit.org/show_bug.cgi?id=29930
+ [GTK] http/tests/media/video-cookie.html fails
+ https://bugs.webkit.org/show_bug.cgi?id=42240
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::setPopupBlockingEnabled):
- * DumpRenderTree/qt/jsobjects.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setAlwaysAcceptCookies): create the
+ SoupCookieJar if it does not exist. Otherwise the accept policy
+ won't be set.
-2009-09-30 Cameron McCormack <cam@mcc.id.au>
+2010-08-10 Chris Marrin <cmarrin@apple.com>
- Unreviewed.
+ Reviewed by Oliver Hunt.
- Added myself to the list of committers.
+ Add suspendAnimations/resumeAnimation API to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43733
+
+ Adds suspendAnimations() and resumeAnimations() to LayoutTestController.
+ Calls functions with the same names on AnimationController for the
+ mainFrame.
- * Scripts/modules/committers.py:
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/LayoutTestController.cpp:
+ (suspendAnimationsCallback):
+ (resumeAnimationsCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::suspendAnimations):
+ (LayoutTestController::resumeAnimations):
-2009-09-30 Eric Seidel <eric@webkit.org>
+2010-08-10 Dimitri Glazkov <dglazkov@chromium.org>
- No review, just adding Geoff to the list of reviewers.
+ Reviewed by Ojan Vafai.
- * Scripts/modules/committers.py:
+ [Chromium/DRT] Enable saving layout test results.
+ https://bugs.webkit.org/show_bug.cgi?id=43796
-2009-09-30 Dan Bernstein <mitz@apple.com>
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added more
+ parameters to the new-run-webkit-tests, including the name
+ of the test results server.
- Reviewed by Sam Weinig.
+2010-08-10 Jian Li <jianli@chromium.org>
- Added the WebKit Layout Tests fonts that are referenced in
- LayoutTests/platform/win/css2.1/resources/Mac-compatible-font-fallback.css
+ More chromium build fix.
- * DumpRenderTree/fonts/WebKit Layout Tests 2.ttf: Added.
- * DumpRenderTree/fonts/WebKit Layout Tests.ttf: Added.
+ * DumpRenderTree/chromium/MockSpellCheck.cpp:
+ (MockSpellCheck::spellCheckWord):
+ (MockSpellCheck::initializeIfNeeded):
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
+ (NotificationPresenter::grantPermission):
+ (NotificationPresenter::show):
+ (NotificationPresenter::checkPermission):
-2009-09-30 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+2010-08-10 Jian Li <jianli@chromium.org>
- Reviewed by David Kilzer.
+ Chromium build fix.
- Make sunspider scripts work on Windows platform.
- https://bugs.webkit.org/show_bug.cgi?id=29656
+ * DumpRenderTree/chromium/MockSpellCheck.cpp:
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
- * Scripts/run-sunspider: Perl scripts invoked with same Perl interpreter.
- * Scripts/sunspider-compare-results: Perl scripts invoked with same Perl interpreter.
- * Scripts/webkitdirs.pm: currentPerlPath() added.
+2010-08-10 Victor Wang <victorw@chromium.org>
-2009-09-29 Brady Eidson <beidson@apple.com>
+ Reviewed by Ojan Vafai.
- Rubberstamped by Dan Bernstein.
+ Update test results server merge logic so the aggregated
+ results and times are updated for tests that are
+ in aggragated json but not in incremental json.
- Fix license and some sorting in new files.
+ Also update unittest to test this case.
- * DumpRenderTree/mac/HistoryDelegate.h:
- * DumpRenderTree/mac/HistoryDelegate.mm:
+ https://bugs.webkit.org/show_bug.cgi?id=43769
-2009-09-29 Yaar Schnitman <yaar@chromium.org>
+ * TestResultServer/model/jsonresults.py:
+ * TestResultServer/model/jsonresults_unittest.py:
- Reviewed by David Kilzer.
+2010-08-09 Antonio Gomes <tonikitoo@webkit.org>
- Fixed how error codes are handled.
- https://bugs.webkit.org/show_bug.cgi?id=29898
+ Reviewed by Ariya Hidayat.
- * Scripts/update-webkit:
- * Scripts/update-webkit-chromium:
+ [Qt] QtTestBrowser: proper set scene rect
-2009-09-29 Brady Eidson <beidson@apple.com>
+ When resizesToContents is ON scene's rect is set to the boundary of
+ the mainFrame. However, navigating to other web page should keep resizing
+ scene's rect according to the new document loaded. Patch addresses this issue.
- Reviewed by John Sullivan.
+ Now resizesToContents and scrolling properly work on QtTestBrowser.
- Updated way-out-of-date sorting throughout the dump methods/flags.
+ * QtTestBrowser/webview.cpp:
+ (WebViewGraphicsBased::setPage):
+ (WebViewGraphicsBased::contentsSizeChanged):
+ (WebViewGraphicsBased::setResizesToContents):
+ (WebViewGraphicsBased::resizeEvent):
+ * QtTestBrowser/webview.h:
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::LayoutTestController):
- (dumpAsPDFCallback):
- (dumpAsTextCallback):
- (dumpFrameLoadCallbacksCallback):
- (dumpResourceLoadCallbacksCallback):
- (LayoutTestController::staticFunctions):
+2010-08-09 Antonio Gomes <tonikitoo@webkit.org>
- * DumpRenderTree/LayoutTestController.h:
- (LayoutTestController::dumpAsText):
- (LayoutTestController::setDumpAsText):
- (LayoutTestController::dumpFrameLoadCallbacks):
- (LayoutTestController::setDumpFrameLoadCallbacks):
- (LayoutTestController::dumpSelectionRect):
- (LayoutTestController::setDumpSelectionRect):
- (LayoutTestController::dumpSourceAsWebArchive):
- (LayoutTestController::setDumpSourceAsWebArchive):
- (LayoutTestController::dumpStatusCallbacks):
- (LayoutTestController::setDumpStatusCallbacks):
- (LayoutTestController::dumpTitleChanges):
- (LayoutTestController::setDumpTitleChanges):
- (LayoutTestController::dumpWillCacheResponse):
- (LayoutTestController::setDumpWillCacheResponse):
-
-2009-09-29 Brady Eidson <beidson@apple.com>
+ Reviewed by Ariya Hidayat.
- Reviewed by John Sullivan.
+ [Qt] QtTestBrowser: Clean up LauncherWindow code.
- WebKit Mac API should provide a delegate interface for global history.
- <rdar://problem/7042773> and https://webkit.org/b/29904
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::LauncherWindow): Moves applyPrefs methods call from the constructor to init().
+ (LauncherWindow::init): Fixed comments.
+ (LauncherWindow::applyPrefs): Move the method around.
+ (LauncherWindow::createChrome): Move more code of this method around, for grouping, and fixing up comments.
- Adding the dumping of global history delegate callbacks.
+2010-08-09 Antonio Gomes <tonikitoo@webkit.org>
- * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Reviewed by Ariya Hidayat.
- Automatically dump history delegate callbacks for tests with "globalhistory/" in their URL:
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (createWebViewAndOffscreenWindow):
- (allocateGlobalControllers):
- (shouldLogFrameLoadDelegates):
- (shouldLogHistoryDelegates):
- (runTest):
+ [Qt] QtTestBrowser: make reset-zooming to animate when tiled backing store is on.
- Dump history delegate callbacks:
- * DumpRenderTree/mac/HistoryDelegate.h: Added.
- * DumpRenderTree/mac/HistoryDelegate.mm: Added.
- (-[HistoryDelegate webView:didNavigateWithNavigationData:inFrame:]):
- (-[HistoryDelegate webView:didPerformClientRedirectFromURL:toURL:inFrame:]):
- (-[HistoryDelegate webView:didPerformServerRedirectFromURL:toURL:inFrame:]):
+ It gets control+0 the same visual effect as control++ or control-.
-2009-09-29 Daniel Bates <dbates@webkit.org>
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::toggleZoomTextOnly):
- Reviewed by Adam Roben.
+2010-08-09 Antonio Gomes <tonikitoo@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=28902
-
- Fixes an issue where the drop effect returned by Window Dump Render Tree
- was always DROPEFFECT_NONE (since it was hard coded to do so).
-
- This patch corrects this issue by determining the actual drop effect
- performed by the corresponding drag-and-drop operation so that we can
- return it.
-
- * DumpRenderTree/win/DraggingInfo.h: Added field m_dropEffect to store performed drop effect.
- (DraggingInfo::DraggingInfo):
- (DraggingInfo::performedDropEffect): Added method.
- (DraggingInfo::setPerformedDropEffect): Added method.
- * DumpRenderTree/win/EventSender.cpp:
- (doMouseUp): Calls method DraggingInfo::setPerformedDropEffect with performed drop effect.
- Moved delete draggingInfo to UIDelegate::doDragDrop.
- * DumpRenderTree/win/UIDelegate.cpp:
- (UIDelegate::doDragDrop): Sets performedDropEffect to DraggingInfo::performedDropEffect().
+ Reviewed by Ariya Hidayat.
-2009-09-29 Dan Bernstein <mitz@apple.com>
+ [Qt] QtTestBrowser:: make m_zoomLevels a static member.
- Reviewed by Adam Roben.
+ Not all instances of LauncherWindow need its own m_zoomLevel.
- Remove copying of unnecessary or nonexistent files from the ImageDiff
- post-build event.
+ * QtTestBrowser/launcherwindow.cpp:
+ * QtTestBrowser/launcherwindow.h:
- * DumpRenderTree/win/ImageDiff.vcproj:
+2010-08-09 Sam Weinig <sam@webkit.org>
-2009-09-29 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+ Reviewed by Geoffrey Garen.
- Reviewed by David Kilzer.
+ Add zoom support for injected bundle
+ https://bugs.webkit.org/show_bug.cgi?id=43759
- [Qt] Make build-webkit script work on Windows
- https://bugs.webkit.org/show_bug.cgi?id=29802
+ Use zoom factor SPI to implement zoom related eventSender functions.
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
- - Removed unnecessary -p switch for mkdir on Windows.
- - Use canonical path, which uses slashes or backslashes depends on platform.
- - isWindows() only test for Windows and not for Cyqwin.
+ * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
+ * WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
+ (WTR::EventSendingController::textZoomIn):
+ (WTR::EventSendingController::textZoomOut):
+ (WTR::EventSendingController::zoomPageIn):
+ (WTR::EventSendingController::zoomPageOut):
+ * WebKitTestRunner/InjectedBundle/EventSendingController.h:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::reset): Reset zoom mode and level for each test.
-2009-09-29 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+2010-08-09 Gavin Barraclough <barraclough@apple.com>
- Reviewed by Simon Hausmann.
+ Speculative chromium build fix III.
- Fix time measurement in build-webkit after refactoring done in r48853.
+ * DumpRenderTree/chromium/MockSpellCheck.h:
+ * DumpRenderTree/chromium/NotificationPresenter.h:
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost::addClearHeader):
+ (WebViewHost::clearHeaders):
- * Scripts/build-webkit:
+2010-08-09 Ojan Vafai <ojan@chromium.org>
-2009-09-29 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+ Reviewed by Tony Chang.
- Reviewed by Tor Arne Vestbø.
+ increase the number of test results that we save
+ https://bugs.webkit.org/show_bug.cgi?id=43763
- [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard.
- This fixes https://bugs.webkit.org/show_bug.cgi?id=19674.
+ Now that we do incremental uploads, we can increase the number of
+ results that we save for http://test-results.appspot.com/dashboards/flakiness_dashboard.html.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
-2009-09-29 Jakub Wieczorek <faw217@gmail.com>
+2010-08-09 Evan Martin <evan@chromium.org>
- Reviewed by Simon Hausmann.
+ Reviewed by Tony Chang.
- [Qt] Implement eventSender.contextClick().
- https://bugs.webkit.org/show_bug.cgi?id=29821
+ [chromium] DRT error print statement incorrectly tries to print a FILE*
+ https://bugs.webkit.org/show_bug.cgi?id=43747
- * DumpRenderTree/qt/jsobjects.cpp:
- (EventSender::contextClick):
- * DumpRenderTree/qt/jsobjects.h:
+ * DumpRenderTree/chromium/ImageDiff.cpp:
+ (writeFile): pass the correct pointer.
-2009-09-28 Fumitoshi Ukai <ukai@chromium.org>
+2010-08-09 Victor Wang <victorw@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by Ojan Vafai.
- Add experimentalWebSocketsEnabled in WebPreferences.
- https://bugs.webkit.org/show_bug.cgi?id=28941
+ Upload incremental test results json to server by default.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+ https://bugs.webkit.org/show_bug.cgi?id=43743
-2009-09-28 Yaar Schnitman <yaar@chromium.org>
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- Reviewed by David Kilzer.
+2010-08-09 Eric Seidel <eric@webkit.org>
- Integrated chromium port building into webkit tools update-webkit and
- build-webkit.
+ Reviewed by Adam Barth.
- https://bugs.webkit.org/show_bug.cgi?id=29749
+ EWS bots wait 2 minutes between patches
+ https://bugs.webkit.org/show_bug.cgi?id=43731
- * Scripts/build-webkit: When --chromium is specified, will build
- the chromium port (currently only Mac is supported).
- * Scripts/update-webkit: When --chromium is specified, delegates to
- update-webkit-chromium.
- * Scripts/webkitdirs.pm: Added chromium specific defs.
- * Scripts/update-webkit-chromium: Uses gclient and gyp to fetch
- chromium port's dependencies and update its project files.
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ - Don't sleep after failures. This was a hold-over from
+ an earlier design.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ - EWS bots were not properly reporting true/false from process_work_item.
+ They were always returning None, thus false, thus always logging
+ as a failure and sleeping 2 minutes after each patch.
-2009-09-28 Fumitoshi Ukai <ukai@chromium.org>
+2010-08-09 Sam Weinig <sam@webkit.org>
- Unreviewed.
+ Reviewed by Anders Carlsson.
- Add myself to list of committers.
+ Stub out EventSender for WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=43703
+
+ * WebKitTestRunner/DerivedSources.make:
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+ Add ability to pass javascript arguments to the wrapped object.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl: Added.
+ * WebKitTestRunner/InjectedBundle/EventSendingController.cpp: Added.
+ (WTR::EventSendingController::create):
+ (WTR::EventSendingController::EventSendingController):
+ (WTR::EventSendingController::~EventSendingController):
+ (WTR::EventSendingController::wrapperClass):
+ (WTR::setExceptionForString):
+ (WTR::EventSendingController::mouseDown):
+ (WTR::EventSendingController::mouseUp):
+ (WTR::EventSendingController::mouseMoveTo):
+ (WTR::EventSendingController::keyDown):
+ (WTR::EventSendingController::contextClick):
+ (WTR::EventSendingController::leapForward):
+ (WTR::EventSendingController::textZoomIn):
+ (WTR::EventSendingController::textZoomOut):
+ (WTR::EventSendingController::zoomPageIn):
+ (WTR::EventSendingController::zoomPageOut):
+ (WTR::EventSendingController::makeWindowObject):
+ * WebKitTestRunner/InjectedBundle/EventSendingController.h: Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::reset):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (WTR::InjectedBundle::eventSendingController):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didClearWindowForFrame):
+ Add stubbed out EventSenderController.
+
+ * WebKitTestRunner/InjectedBundle/GCController.h:
+ Remove incorrect comment.
+
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ * WebKitTestRunner/win/InjectedBundle.vcproj:
+ Add new files.
+
+2010-08-08 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, trivial fix.
+
+ Fix "WindowsError: [Error 32] The process cannot access the file
+ because it is being used by another process" introduced by r64959.
- * Scripts/modules/committers.py:
+ * BuildSlaveSupport/test-result-archive:
-2009-09-27 Jakub Wieczorek <faw217@gmail.com>
+2010-08-08 Kent Tamura <tkent@chromium.org>
- Reviewed by Darin Adler.
+ Reviewed by Tony Chang.
- run-webkit-tests: Do not strip the metrics when there is no expected result for a test.
- https://bugs.webkit.org/show_bug.cgi?id=29771
+ Chromium buildbot: Avoid "zip" command dependency
+ https://bugs.webkit.org/show_bug.cgi?id=43470
- * Scripts/run-webkit-tests:
+ * BuildSlaveSupport/test-result-archive:
+ For Chromium port, creates a zip archive with zipfile package of Python
+ instead of external "zip" command. We'd like to avoid additional
+ command installation.
-2009-09-27 Jakub Wieczorek <faw217@gmail.com>
+2010-08-08 Jon Honeycutt <jhoneycutt@apple.com>
- Reviewed by Simon Hausmann.
+ WebKitTestRunner should add the QuickTime dir to the PATH environment
+ variable
+ https://bugs.webkit.org/show_bug.cgi?id=43686
- [Qt] Implement layoutTestController.waitForPolicyDelegate.
- https://bugs.webkit.org/show_bug.cgi?id=25037
+ Reviewed by Dan Bernstein.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::acceptNavigationRequest):
- * DumpRenderTree/qt/DumpRenderTree.pro:
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::reset):
- (LayoutTestController::notifyDone):
- (LayoutTestController::waitForPolicyDelegate):
- * DumpRenderTree/qt/jsobjects.h:
- (LayoutTestController::waitForPolicy):
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::addQTDirToPATH):
+ Copied from DRT.
+ (WTR::TestController::platformInitialize):
+ Call addQTDirToPath().
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj:
+ Link to shlwapi.lib for SHGetValue.
-2009-09-26 David Kilzer <ddkilzer@apple.com>
+2010-08-07 Sam Weinig <sam@webkit.org>
- <http://webkit.org/b/29764> mark-bug-fixed: add -o|--open switch
+ Reviewed by Maciej Stachowiak.
- Reviewed by Eric Seidel.
+ WebKitTestRunner needs layoutTestController.dumpTitleChanges
+ <rdar://problem/8213861>
+ https://bugs.webkit.org/show_bug.cgi?id=42683
- The -o|--open switch uses the open(1) command on Mac OS X to
- open the bug URL in the default web browser. If there are
- similar mechanisms on other platforms, they may be added later.
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didReceiveTitleForFrame):
+ (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpTitleChanges):
+ (WTR::LayoutTestController::shouldDumpTitleChanges):
- * Scripts/mark-bug-fixed:
- (MarkBugFixed.__init__): Added -o|--open switch to list of parse
- options.
- (MarkBugFixed._determine_bug_id_and_svn_revision): Moved logging
- code into main() and extracted prompting code into
- _prompt_user_for_correctness().
- (MarkBugFixed._open_bug_in_web_browser): Added.
- (MarkBugFixed._prompt_user_for_correctness): Added.
- (MarkBugFixed.main): Added logging code from
- _determine_bug_id_and_svn_revision(). Added code to call
- _open_bug_in_web_browser() if the switch is set. Added code to
- call _prompt_user_for_correctness() when needed.
- * Scripts/modules/bugzilla.py:
- (Bugzilla.short_bug_url_for_bug_id): Added.
+2010-08-07 Sam Weinig <sam@webkit.org>
-2009-09-26 David Kilzer <ddkilzer@apple.com>
+ Reviewed by Anders Carlsson.
- svn-unapply and svn-apply don't work when used outside multiple svn working directories
+ WebKitTestRunner needs to print onunload handler information
+ <rdar://problem/8213831>
+ https://bugs.webkit.org/show_bug.cgi?id=42703
- <http://webkit.org/b/29744>
- <rdar://problem/7252905>
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::operator<<):
+ (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
- Reviewed by Eric Seidel.
+2010-08-07 Sam Weinig <sam@webkit.org>
- Some users have a workflow where svn-create-patch, svn-apply and
- svn-unapply are used outside of multiple svn working
- directories. Instead of aborting the scripts in these cases,
- print a warning and assume that Subversion is being used.
+ Reviewed by Anders Carlsson.
- * Scripts/VCSUtils.pm:
- (determineVCSRoot): Call warn() instead of die() if both isGit()
- and isSVN() initially return false. Set $VCSUtils::isSVN to 1
- to enforce the assumption about Subversion, then return
- determineSVNRoot().
- * Scripts/svn-apply: Switch to using isGit() and isSVN() from
- VCSUtils.pm. They both already cache their values and checking
- here is redundant since determineVCSRoot() is called later.
+ Add additional loader client functions need to complete WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=43684
+
+ Remove unnecessary and jarring underscores as well.
+
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (didClearWindowObjectForFrame):
+ (didCreatePage):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didCommitLoadForFrame):
+ (WTR::InjectedBundlePage::didFinishLoadForFrame):
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didReceiveTitleForFrame):
+ (WTR::InjectedBundlePage::didClearWindowForFrame):
+ (WTR::InjectedBundlePage::didCancelClientRedirectForFrame):
+ (WTR::InjectedBundlePage::willPerformClientRedirectForFrame):
+ (WTR::InjectedBundlePage::didChangeLocationWithinPageForFrame):
+ (WTR::InjectedBundlePage::didFinishDocumentLoadForFrame):
+ (WTR::InjectedBundlePage::didHandleOnloadEventsForFrame):
+ (WTR::InjectedBundlePage::didDisplayInsecureContentForFrame):
+ (WTR::InjectedBundlePage::didRunInsecureContentForFrame):
+ (WTR::InjectedBundlePage::willAddMessageToConsole):
+ (WTR::InjectedBundlePage::willSetStatusbarText):
+ (WTR::InjectedBundlePage::willRunJavaScriptAlert):
+ (WTR::InjectedBundlePage::willRunJavaScriptConfirm):
+ (WTR::InjectedBundlePage::willRunJavaScriptPrompt):
+ (WTR::InjectedBundlePage::shouldBeginEditing):
+ (WTR::InjectedBundlePage::shouldEndEditing):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ (WTR::InjectedBundlePage::shouldInsertText):
+ (WTR::InjectedBundlePage::shouldDeleteRange):
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::shouldApplyStyle):
+ (WTR::InjectedBundlePage::didBeginEditing):
+ (WTR::InjectedBundlePage::didEndEditing):
+ (WTR::InjectedBundlePage::didChange):
+ (WTR::InjectedBundlePage::didChangeSelection):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+
+2010-08-07 Dan Bernstein <mitz@apple.com>
+
+ Build fix.
+
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Made the references
+ to JSGCController.{cpp,h} relative to the build root.
+
+2010-08-07 Sam Weinig <sam@webkit.org>
-2009-09-26 Zan Dobersek <zandobersek@gmail.com>
+ Reviewed by Anders Carlsson.
- Reviewed by Gustavo Noronha.
+ WebKitTestRunner needs GCController
+ <rdar://problem/8213834>
+ https://bugs.webkit.org/show_bug.cgi?id=42701
+
+ * WebKitTestRunner/DerivedSources.make:
+ * WebKitTestRunner/InjectedBundle/Bindings/GCController.idl: Added.
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h:
+ (WTR::setProperty):
+ * WebKitTestRunner/InjectedBundle/GCController.cpp: Added.
+ (WTR::GCController::create):
+ (WTR::GCController::GCController):
+ (WTR::GCController::~GCController):
+ (WTR::GCController::wrapperClass):
+ (WTR::GCController::collect):
+ (WTR::GCController::collectOnAlternateThread):
+ (WTR::GCController::getJSObjectCount):
+ (WTR::GCController::makeWindowObject):
+ * WebKitTestRunner/InjectedBundle/GCController.h: Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::reset):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (WTR::InjectedBundle::bundle):
+ (WTR::InjectedBundle::gcController):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didClearWindowForFrame):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::keepWebHistory):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ * WebKitTestRunner/win/InjectedBundle.vcproj:
+
+2010-08-05 Jon Honeycutt <jhoneycutt@apple.com>
+
+ WebKitTestRunner needs to be able to set the font smoothing type
+ https://bugs.webkit.org/show_bug.cgi?id=43406
- [Layout tests] [Gtk] Gtk DumpRenderTree should use WebKit test fonts
- https://bugs.webkit.org/show_bug.cgi?id=29689
+ Reviewed by Adam Roben.
- Load test fonts through FontConfig before each test.
- This ensures a more proper rendering of the tests.
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::resetPreferencesToConsistentValues):
+ Set the font smoothing level to
+ kWKFontSmoothingLevelNoSubpixelAntiAliasing to match DRT.
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (initializeFonts):
- (runTest):
- (main):
- * DumpRenderTree/gtk/fonts.conf: Copied from WebKitTools/DumpRenderTree/qt/fonts.conf.
- * GNUmakefile.am:
+2010-08-06 Jon Honeycutt <jhoneycutt@apple.com>
-2009-09-25 David Kilzer <ddkilzer@apple.com>
+ Fix a missed variable rename.
- <http://webkit.org/b/29718> mark-bug-fixed: add -u|--update-only switch
+ Unreviewed.
- Reviewed by Eric Seidel.
+ * Scripts/old-run-webkit-tests:
- * Scripts/mark-bug-fixed:
- (MarkBugFixed.__init__): Added -u|--update-only switch to list
- of parse options.
- (MarkBugFixed.main): When -u|--update-only is specified, add a
- comment to the bug without marking it Resolved/Fixed.
+2010-08-06 Jon Honeycutt <jhoneycutt@apple.com>
-2009-09-25 Darin Adler <darin@apple.com>
+ mac-wk2/Skipped should be used on Windows when running regression tests
+ https://bugs.webkit.org/show_bug.cgi?id=43494
- Reviewed by Geoffrey Garen.
+ Reviewed by Adam Roben.
- * Scripts/prepare-ChangeLog: Leave files from the script-tests directory
- out, just as we do for the resources directory.
+ * Scripts/old-run-webkit-tests:
+ If the platform is win-wk2, also read the mac-wk2 skipped list.
-2009-09-25 Adam Barth <abarth@webkit.org>
+2010-08-06 Kent Tamura <tkent@chromium.org>
- Unreviewed. Added Tony to committers.py because he's a
- committer now.
+ Reviewed by Dimitri Glazkov.
- * Scripts/modules/committers.py:
+ [DRT/Chromium] Should revoke scheduled tasks
+ https://bugs.webkit.org/show_bug.cgi?id=43560
-2009-09-25 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ (DRTDevToolsAgent::reset): Calls RevokeAll().
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
+ * DumpRenderTree/chromium/DRTDevToolsClient.cpp:
+ (DRTDevToolsClient::reset): Calls RevokeAll().
+ * DumpRenderTree/chromium/DRTDevToolsClient.h:
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::reset): Calls RevokeAll().
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::reset): Calls RevokeAll().
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetTestController): Calls DRTDevToolsAgent::reset() and DRTDevToolsClient::reset().
- Reviewed by Simon Fraser.
+2010-08-06 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
- REGRESSION: media/video-pause-empty-events.html is occasionally timing out on bots
- https://bugs.webkit.org/show_bug.cgi?id=28624
+ Reviewed by Antonio Gomes.
- Disable hardware compositing on Leopard for versions of QuickTime 7.6.4 and older.
+ [Qt] Fix the DRT build on Mac OS X
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
+ * DumpRenderTree/qt/DumpRenderTree.pro:
-2009-09-25 Eric Seidel <eric@webkit.org>
+2010-08-06 Jochen Eisinger <jochen@chromium.org>
- Reviewed by Adam Barth.
+ Reviewed by Pavel Feldman.
- commit-queue should auto-retry patches which fail to commit due to out of date files
- https://bugs.webkit.org/show_bug.cgi?id=28316
+ Rietvield's upload.py moved to a different location.
+ https://bugs.webkit.org/show_bug.cgi?id=43613
- * Scripts/bugzilla-tool:
- - Handle new CheckoutNeedsUpdate exception.
- * Scripts/modules/logging_unittest.py:
- - Call the ScriptError constructor correctly (this test had regressed).
- * Scripts/modules/scm.py:
- - Added the ability to define custom error handlers for run_command
- and added a commit_error_handler which throws CheckoutNeedsUpdate
- instead of ScriptError.
- - Re-ordered ScriptError constructor arguments to make ScriptError("message text") usage possible.
- * Scripts/modules/scm_unittest.py:
- - Added tests of new error handlers.
+ * Scripts/webkitpy/thirdparty/__init__.py:
-2009-09-25 Eric Seidel <eric@webkit.org>
+2010-05-23 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
- commit-queue should give better feedback when failing a patch
- https://bugs.webkit.org/show_bug.cgi?id=29316
+ QueueStatusServer needs better queue-status pages
+ https://bugs.webkit.org/show_bug.cgi?id=39562
- * Scripts/bugzilla-tool:
- - Update ScriptError uses to the new constructor format.
- - Move CommitQueue._run_command to WebKitLandingScripts.run_command_with_teed_output
- so that we can print to both stdout as well as an output buffer for error reporting.
- - Update run_and_throw_if_fail to use teed output so that it can report the "output" as part of ScriptError.
- - Use e.message_with_output() when failing a patch (this is the real fix here).
- I also removed use of "This patch will require manual commit." as that's not always true.
- - Add missing word "bug" from log message.
- * Scripts/modules/scm.py:
- - Make ScriptError save a bunch more data so that error messages can be nicer.
- - Update ScriptError callers.
+ The primary goal of this patch is to display queue
+ positions somewhere on the site so that it's easier
+ for commit-queue users to know when their pach will
+ be landed. I also tried to improve the root page
+ to be more useful than the previous wall of status text.
-2009-09-24 John Gregg <johnnyg@google.com>
-
- Reviewed by Eric Seidel.
+ * QueueStatusServer/handlers/recentstatus.py:
+ * QueueStatusServer/main.py:
+ * QueueStatusServer/model/queues.py:
+ * QueueStatusServer/templates/recentstatus.html:
- Enable switch for notifications (experimental) in Page Settings
- https://bugs.webkit.org/show_bug.cgi?id=28930
+2010-08-05 Victor Wang <victorw@chromium.org>
- Now that desktop notifications are controlled by run-time switch,
- set that switch to true for DumpRenderTree.
+ Reviewed by Ojan Vafai.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/win/UIDelegate.cpp:
- (UIDelegate::QueryInterface):
+ Add option to generate/upload incremental json results to test result server.
+ Also refactor the json results generator unittest code to test
+ incremental and aggregated json results.
-2009-09-24 Kevin Ollivier <kevino@theolliviers.com>
+ https://bugs.webkit.org/show_bug.cgi?id=43519
- wx build fix. SnowLeopard fixes for Mac dependencies.
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * wx/build/build_utils.py:
- * wx/build/settings.py:
- * wx/install-unix-extras:
+2010-08-05 Jian Li <jianli@chromium.org>
-2009-09-24 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+ Reviewed by David Levin.
- Reviewed by Oliver Hunt.
+ Unify blob related feature defines to ENABLE(BLOB).
+ https://bugs.webkit.org/show_bug.cgi?id=43081
- Add support for DRT to send mouse wheel events.
+ * Scripts/build-webkit:
- https://bugs.webkit.org/show_bug.cgi?id=29348
- [Gtk] Scrollwheel on horizontal scrollbars should slide horizontally
+2010-08-05 Satish Sampath <satish@chromium.org>
- * DumpRenderTree/gtk/EventSender.cpp:
- (mouseWheelToCallback):
+ Reviewed by Jeremy Orlow.
-2009-09-17 Eric Seidel <eric@webkit.org>
+ Add speech input controller mock in WebKit and a layout test.
+ https://bugs.webkit.org/show_bug.cgi?id=43477
- Reviewed by David Levin.
+ Added LayoutTestController::setMockSpeechInputResultCallback method.
- commit-queue needs web-based status reporting
- https://bugs.webkit.org/show_bug.cgi?id=29307
-
- Add a first-pass web-based status for the commit-queue.
- The bot is currently reachable at:
- http://webkit-commit-queue.appspot.com/
-
- * CommitQueueStatus/app.yaml: Added.
- - Application description file required by App Engine.
- * CommitQueueStatus/filters/__init__.py: Added.
- - Required by python to treat 'filters' as a module.
- * CommitQueueStatus/filters/webkit_extras.py: Added.
- - Support for turning 'bug 123' and 'patch 123' into links.
- This lets us use plain text strings in our logs yet display nice HTML (help prevent XSS attacks on the page).
- * CommitQueueStatus/index.html: Added.
- * CommitQueueStatus/index.yaml: Added.
- - Some auto-generated file from app engine.
- * CommitQueueStatus/queue_status.py: Added.
- - The core logic of this bot. We could eventually split this file out into pieces.
- * CommitQueueStatus/stylesheets/main.css: Added.
- - Some basic lame-o CSS to make the page look less awful.
- * CommitQueueStatus/update_status.html: Added.
- - The form that the commit-queue (or a human) can use to update the status.
- * Scripts/bugzilla-tool:
- - Add some very basic update_status calls.
- * Scripts/modules/statusbot.py: Added.
- - Knows how to post to the CommitQueueStatus web application.
-
-2009-09-24 David Kilzer <ddkilzer@apple.com>
-
- <http://webkit.org/b/29712> mark-bug-fixed: add -m|--comment switch
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockSpeechInputResultCallback): Wrapper invoking the member function.
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::setMockSpeechInputResult): Sets the mock result.
+ (LayoutTestController::speechInputController): Creates the mock controller.
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::speechInputController): Creates the mock controller.
+ * DumpRenderTree/chromium/WebViewHost.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockSpeechInputResult): dummy method.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockSpeechInputResult): dummy method.
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockSpeechInputResult): dummy method.
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp: dummy method.
+ (LayoutTestController::setMockSpeechInputResult):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp: dummy method.
+ (LayoutTestController::setMockSpeechInputResult):
- Reviewed by Adam Roben.
+2010-08-04 Adam Roben <aroben@apple.com>
- * Scripts/mark-bug-fixed:
- (MarkBugFixed.__init__): Added -m|--comment switch to list of
- parse options.
- (MarkBugFixed.main): When specified, prepend comment from
- -m|--comment command-line switch to the bug comment.
+ Fix the path to TestNetscapePlugin's directory on Windows
-2009-09-24 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+ Fixes <http://webkit.org/b/43513> WebKitTestRunner on Windows fails to
+ load TestNetscapePlugin
- Reviewed by Jan Alonzo.
+ Reviewed by Jon Honeycutt.
- [GTK] DRT must display window instead of just realizing, to enable synthesizing events correctly
- https://bugs.webkit.org/show_bug.cgi?id=29693
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::initializeTestPluginDirectory):
+ TestNetscapePlugin is in a TestNetscapePlugin[_Debug] directory that's
+ next to WebKitTestRunner.exe. Previously we were passing the directory
+ that contains WebKitTestRunner.exe. Also fixed some leaks.
- Show the window, to be able to synthesize events correctly.
+2010-08-05 Kenichi Ishibashi <bashi@google.com>
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (runTest):
- (main):
+ Reviewed by Shinichiro Hamaji.
-2009-09-24 Oliver Hunt <oliver@apple.com>
+ check-webkit-style returns non-zero when patch is entirely minus lines.
+ https://bugs.webkit.org/show_bug.cgi?id=38169
- Reviewed by NOBODY(rollout)
+ * Scripts/check-webkit-style:
+ Check whether a patch contains modified files that are entirely minus lines.
+ * Scripts/webkitpy/style/filereader.py:
+ Add a variable that holds number of files that contain only deleted lines.
+ * Scripts/webkitpy/style/patchreader.py:
+ Count up modified files that contain only deleted lines.
- Roll out r48712 as it is incorrect.
+2010-08-05 Pavel Feldman <pfeldman@chromium.org>
- * DumpRenderTree/mac/ObjCController.m:
- (+[ObjCController isSelectorExcludedFromWebScript:]):
- (+[ObjCController webScriptNameForSelector:]):
+ Reviewed by Yury Semikhatsky.
-2009-09-24 Benjamin Poulain <benjamin.poulain@nokia.com>
+ DevTools: get rid of delayed command dispatching on front-end side.
- Reviewed by Eric Seidel.
+ https://bugs.webkit.org/show_bug.cgi?id=43479
- https://bugs.webkit.org/show_bug.cgi?id=29005
- The indices of RuntimeArray should be enumerated like for a regular array.
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ (DRTDevToolsAgent::detach):
+ (DRTDevToolsAgent::frontendLoaded):
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
+ * DumpRenderTree/chromium/DRTDevToolsClient.cpp:
+ (DRTDevToolsClient::~DRTDevToolsClient):
+ (DRTDevToolsClient::sendFrontendLoaded):
+ * DumpRenderTree/chromium/DRTDevToolsClient.h:
- * DumpRenderTree/mac/ObjCController.m:
- (+[ObjCController isSelectorExcludedFromWebScript:]):
- (+[ObjCController webScriptNameForSelector:]):
- (-[ObjCController arrayOfString]):
+2010-08-04 Kenichi Ishibashi <bashi@google.com>
-2009-09-23 David Kilzer <ddkilzer@apple.com>
+ Reviewed by Shinichiro Hamaji.
- <http://webkit.org/b/28910> Move bugzilla-tool mark-fixed to standalone mark-bug-fixed tool
+ Fixes check-webkit-style false positive on "new uint32_t."
+ https://bugs.webkit.org/show_bug.cgi?id=43077
- Reviewed by Darin Adler.
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
- Also fixed a bug where specifying a revision on the command-line
- as 'r12345' would fail. See <http://webkit.org/b/29699>.
+2010-08-04 Kent Tamura <tkent@chromium.org>
- * Scripts/bugzilla-tool: Updated module import statements.
- (parse_bug_id): Removed. Moved to bugzilla.py.
- (bug_comment_from_svn_revision): Removed. Moved to comments.py.
- (bug_comment_from_commit_text): Removed. Moved to comments.py.
- (MarkBugFixed): Removed. Code moved to mark-bug-fixed.
- (BugzillaTool.__init__): Removed mark-fixed subcommand.
- * Scripts/mark-bug-fixed: Added.
- * Scripts/modules/bugzilla.py:
- (parse_bug_id): Added. Moved from bugzilla-tool.
- * Scripts/modules/comments.py: Added.
- (bug_comment_from_svn_revision): Added. Moved from bugzilla-tool.
- (bug_comment_from_commit_text): Added. Moved from bugzilla-tool.
+ Reviewed by Dimitri Glazkov.
-2009-09-23 Marshall Culpepper <mculpepper@appcelerator.com>
+ [DRT/Chromium] Remove base/linked_ptr.h dependency
+ https://bugs.webkit.org/show_bug.cgi?id=43472
+
+ Replace linked_ptr<TestNavigationEntry> with RefPtr<TestNavigationEntry>.
+ We need to use RefPtr<> because m_pendingEntry points an object in
+ m_entries or not in m_entries.
+
+ * DumpRenderTree/chromium/TestNavigationController.cpp:
+ (TestNavigationEntry::create): Added.
+ (TestNavigationController::activeEntry):
+ (TestNavigationController::didNavigateToEntry):
+ (TestNavigationController::discardPendingEntry):
+ (TestNavigationController::insertEntry):
+ (TestNavigationController::navigateToPendingEntry):
+ * DumpRenderTree/chromium/TestNavigationController.h:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::loadURLForFrame):
+ Use TestNavigationEntry::create().
+ (WebViewHost::updateURL):
+ Use RefPtr<>.
+ (WebViewHost::updateSessionHistory):
+ Remove unnecessary static_cast<>.
+
+2010-08-04 Kent Tamura <tkent@chromium.org>
- Reviewed by Eric Seidel.
-
- jpeg.lib is now libjpeg.lib in DRT Cairo dependencies. return
- "false" in non-implemented stub for setAlwaysAcceptCookies.
- https://bugs.webkit.org/show_bug.cgi?id=29661
+ Reviewed by Dimitri Glazkov.
- * DumpRenderTree/win/DumpRenderTree.vcproj:
- * DumpRenderTree/win/DumpRenderTree.cpp:
+ Fix a problem that "archived test results" step doesn't work on Chromium buildbots
+ https://bugs.webkit.org/show_bug.cgi?id=43333
-2009-09-23 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+ * BuildSlaveSupport/test-result-archive:
+ - Make layoutTestResultsDir local and pass it to archiveTestResults()
+ - Adjust layoutTestResultsDir for Chromium
- Reviewed by Xan Lopez.
+2010-08-04 Kent Tamura <tkent@chromium.org>
- [GTK] need to dump number of pending unload handlers
- https://bugs.webkit.org/show_bug.cgi?id=29685
+ Reviewed by Dimitri Glazkov.
- Implement dumping of the number of pending unload handlers.
+ NRWT: websocket_server startup detection failure
+ https://bugs.webkit.org/show_bug.cgi?id=43466
- The following tests will pass:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ Increase timeout value: 5 second -> 10 second
- fast/loader/unload-form-about-blank.html
- fast/loader/unload-form-post-about-blank.html
- fast/loader/unload-form-post.html
- fast/loader/unload-form.html
- fast/loader/unload-hyperlink.html
- fast/loader/unload-javascript-url.html
- fast/loader/unload-reload.html
- fast/loader/unload-window-location.html
+2010-08-04 Victor Wang <victorw@chromium.org>
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (getFrameNameSuitableForTestResult):
- (webViewLoadFinished):
+ Reviewed by Ojan Vafai.
-2009-09-22 Shinichiro Hamaji <hamaji@chromium.org>
+ -. Add result.json incremental merging functionality to test results app engine.
+ -. blobstore is not suitable for AE data merging and there is no API to
+ programatically edit existing blob or write a new one yet, so replace blobstore
+ with datastore. If file is oversize (>1000*1000 bytes), store file data in
+ multiple datastore entries.
+ -. Fix styles.
- Reviewed by Eric Seidel.
+ Test: jsonresults_unittest to test merging logics.
- js tests should move into jstests subdirectory instead of resources/
- https://bugs.webkit.org/show_bug.cgi?id=25880
+ https://bugs.webkit.org/show_bug.cgi?id=38599
- Remove support of resources directory.
+ * TestResultServer/handlers/dashboardhandler.py:
+ * TestResultServer/handlers/menu.py:
+ * TestResultServer/handlers/testfilehandler.py:
+ * TestResultServer/main.py:
+ * TestResultServer/model/dashboardfile.py:
+ * TestResultServer/model/datastorefile.py: Added.
+ * TestResultServer/model/jsonresults.py: Added.
+ * TestResultServer/model/jsonresults_unittest.py: Added.
+ * TestResultServer/model/testfile.py:
+ * TestResultServer/templates/uploadform.html:
- * Scripts/make-script-test-wrappers:
+2010-08-04 Antonio Gomes <tonikitoo@webkit.org>
-2009-09-22 Eric Seidel <eric@webkit.org>
+ Reviewed by Kenneth Christiansen.
- No review, only fixing typo (missing space character).
+ [Qt] [QtTestBrowser] Remove unneeded QAction class members
+ https://bugs.webkit.org/show_bug.cgi?id=43518
- Fix typo from https://bugs.webkit.org/show_bug.cgi?id=29220
+ LauncherWindow class has two totally unneeded class members: m_flopAnimated and
+ m_flipYAnimated. Also, in initializeView method there are some dead code block
+ trying to connect them at the wrong time, when they have not been instanciated.
- * Scripts/run-webkit-tests:
+ This patch:
-2009-09-22 Eric Seidel <eric@webkit.org>
+ - removes the two cited class members in favor of local variables in createChrome method;
+ - removes the dead code block.
- Reviewed by Darin Adler.
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::initializeView):
+ (LauncherWindow::createChrome):
+ * QtTestBrowser/launcherwindow.h:
+
+2010-08-04 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann and Kenneth Christiansen.
+
+ [Qt] [QtTestBrowser] Clean up static and global menu state controls
+ https://bugs.webkit.org/show_bug.cgi?id=43448
+
+ After LauncherWindow class was refactored out of from main.cpp, all global variables that
+ were hanging in main.cpp became temporarily public static class members of newly added
+ LauncherWindow class. This design was not properly handling the initial purpose of the
+ global variables: newly created launcher windows should inherit the settings of the originating
+ one.
+
+ In order to properly fix the problem, this patch introduces a WindowOptions class, as a POD. It
+ comprises all data needed to handling the goal described above.
+
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::LauncherWindow): The class now receives an optional WindowOptions pointer object
+ holding all user settings configured in the menus and command line.
+ It also receices an optional QGraphicsScene points in case we are doing
+ a "Clone Window".
+ (LauncherWindow::init): Removed the usesGraphics parameter because the class member m_userData holds its
+ value.
+ (LauncherWindow::initializeView): Ditto.
+ (LauncherWindow::createChrome): Changed all references to gXXX to m_userData.XXX
+ (LauncherWindow::applyPrefs): Removed the "LauncherWindow* source" parameter. All data needed to properly
+ apply the preferences is provided by m_userData.
+ (LauncherWindow::toggleAcceleratedCompositing): Change gXXX by m_userData.XXX
+ (LauncherWindow::toggleResizesToContents): Ditto.
+ (LauncherWindow::toggleWebGL): Ditto.
+ (LauncherWindow::toggleFrameFlattening): Ditto.
+ (LauncherWindow::toggleQGLWidgetViewport): Ditto.
+ (LauncherWindow::changeViewportUpdateMode): Ditto.
+ (LauncherWindow::showFPS): Ditto.
+ (LauncherWindow::newWindow): Changed to pass the userData.
+ (LauncherWindow::cloneWindow): Ditto.
+ * QtTestBrowser/launcherwindow.h:
+ (WindowOptions::WindowOptions):
+ * QtTestBrowser/main.cpp:
+ (requiresGraphicsView):
+ (LauncherApplication::handleUserOptions):
+ (main):
- run-webkit-tests needs a --repeat-each=N option (AAABBBCCC instead of ABCABCABC)
- https://bugs.webkit.org/show_bug.cgi?id=29220
+2010-08-04 Kevin Ollivier <kevino@theolliviers.com>
- * Scripts/run-webkit-tests:
+ [wx] Build fix for gcc not importing all symbols from convenience libraries.
+ Works on 10.6 only for Mac until the build system is reworked.
-2009-09-22 Eric Seidel <eric@webkit.org>
+ * wx/build/settings.py:
- Reviewed by David Kilzer.
+2010-08-04 Markus Goetz <Markus.Goetz@nokia.com>
- svn-apply can't handle single-line binary file additions
- https://bugs.webkit.org/show_bug.cgi?id=29100
+ Reviewed by Simon Hausmann.
- Fixed the regexp and added a unit test.
+ [Qt] Change wording in QtTestBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=43241
- * Scripts/modules/scm_unittest.py:
- * Scripts/svn-apply:
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::createChrome):
-2009-09-11 Eric Seidel <eric@webkit.org>
+2010-08-04 Aaron Boodman <aa@chromium.org>
- Reviewed by David Kilzer.
+ Reviewed by Eric Seidel.
- post-diff and post-commits should be able to find bug urls in ChangeLogs.
- https://bugs.webkit.org/show_bug.cgi?id=29206
+ prepare-ChangeLog fails mysteriously if curl doesn't support ssl
+ https://bugs.webkit.org/show_bug.cgi?id=43460
- * Scripts/bugzilla-tool:
- - Share common options by adding a PostDiffAsPatchToBug.posting_options() method.
- - Rename --no-comment to --add-log-as-comment and reverse behavior.
- Comments tend to just be noise. I'll eventually remove this argument if no one uses it.
- - Split out code into helper functions to try and make execute() more legible.
- - Make post-diff find the bug url in the ChangeLogs if not passed as an argument.
- - Fallback to bug urls in commit diffs, instead of just in commit messages,
- meaning post-commits will now find bug urls in ChangeLogs.
+ * Scripts/prepare-ChangeLog:
-2009-09-21 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+2010-08-03 MORITA Hajime <morrita@google.com>
- Reviewed by Maciej Stachowiak.
+ Reviewed by Tony Chang.
- --parse-only parameter wasn't passed to SunSpider/sunspider script.
- https://bugs.webkit.org/show_bug.cgi?id=29611
+ [DRT] Assertion failed when drag and move a draggable element.
+ https://bugs.webkit.org/show_bug.cgi?id=41695
- * Scripts/run-sunspider: Missing parameter passing added.
+ mouseMoveToX() did call [WebHTMLView mouseDragged] even if dragging started.
+ But Cocoa doesn't call mouseDragged() until dragging is done.
+ Other part of DumpRenderTree also assumes Cocoa behavior and an assertion
+ on UIDelegate failed when mouseDragged() is called during dragging.
+ This change eliminated the mouseDragged() call when dragging begins,
+ which is implicated by draggingInfo instance.
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (-[EventSendingController mouseMoveToX:Y:]):
-2009-09-20 David Kilzer <ddkilzer@apple.com>
+ Test: fast/events/dragging-mouse-moves.html
+
+2010-08-02 Steve Block <steveblock@google.com>
- <http://webkit.org/b/29521> run-webkit-tests: use require instead eval to load DumpRenderTreeSupport module
+ Reviewed by Alexey Proskuryakov.
- Reviewed by Mark Rowe.
+ Adds Geolocation LayoutTests for the case where permission is not granted or denied immediately
+ https://bugs.webkit.org/show_bug.cgi?id=40002
- The require statement is like the use statement, except that it
- is run during script execution instead of during the 'BEGIN'
- phase. This makes it possible to change @INC before the require
- statement is run. See 'require' and 'use' in the perlfunc(1)
- manpage and 'BEGIN' in perlmod(1) manpage.
+ The code in LayoutTestController::setGeolocationPermission() was moved to
+ setGeolocationPermissionCommon() to allow each port to provide its own
+ implementation of setGeolocationPermission().
- * Scripts/run-webkit-tests: Replace eval statement with require
- statement.
+ For the Mac port, setGeolocationPermission() notifies the UIDelegate of the
+ new permission, so it can call back to WebCore if permission requests are in
+ progress and are waiting for a response. A minor fix to the Mac
+ MockGeolocationProvider was also required to make sure that the mock provider
+ calls back to WebCore when it is first started.
-2009-09-18 Kevin Ollivier <kevino@theolliviers.com>
+ For other ports, LayoutTestController::setGeolocationPermission() is not
+ implemented.
- wx build fixes. Fix the config name under git and allow users to specify
- their own waf install for experimenting with new versions.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::setGeolocationPermissionCommon):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setGeolocationPermission):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setGeolocationPermission):
+ * DumpRenderTree/mac/MockGeolocationProvider.mm:
+ (-[MockGeolocationProvider registerWebView:]):
+ * DumpRenderTree/mac/UIDelegate.h:
+ * DumpRenderTree/mac/UIDelegate.mm:
+ (-[UIDelegate webView:decidePolicyForGeolocationRequestFromOrigin:frame:listener:]):
+ (-[UIDelegate setGeolocationPermission:]):
+ (-[UIDelegate dealloc]):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setGeolocationPermission):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setGeolocationPermission):
- * Scripts/webkitdirs.pm:
- * wx/build/settings.py:
+2010-08-03 Kent Tamura <tkent@chromium.org>
-2009-09-18 Alex Milowski <alex@milowski.com>
+ Reviewed by Dimitri Glazkov.
- Reviewed by Maciej Stachowiak.
+ [DRT/Chromium] Implement --testshell-startup-dialog
+ https://bugs.webkit.org/show_bug.cgi?id=40616
- Added checkWebCoreMathMLSupport and hasMathMLSupport to support
- checking for whether MathML tests should be run
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main): Check --testshell-startup-dialog, and call openStartUpDialog()
+ if it is specfied.
+ * DumpRenderTree/chromium/TestShell.h:
+ Declare openStartUpDialog().
+ * DumpRenderTree/chromium/TestShellGtk.cpp:
+ (openStartupDialog):
+ * DumpRenderTree/chromium/TestShellMac.mm:
+ (openStartupDialog):
+ * DumpRenderTree/chromium/TestShellWin.cpp:
+ (openStartupDialog):
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
+2010-08-03 Kent Tamura <tkent@chromium.org>
-2009-08-28 Darin Adler <darin@apple.com>
+ Reviewed by Dimitri Glazkov.
- Reviewed by Mark Rowe.
+ [DRT/Chromium] Remove dependency of base/md5.h
+ https://bugs.webkit.org/show_bug.cgi?id=43403
- Break more of run-webkit-tests into separate functions
- https://bugs.webkit.org/show_bug.cgi?id=29497
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dumpImage): Use wtf/MD5.h
- Some small steps toward improving run-webkit-tests. My goal is to
- refactor much more of the script into functions. Later we can add
- parallel test running to the tool. But better structure may help
- even if someone decides to translate this into another scripting
- language instead.
+2010-08-03 Joseph Pecoraro <joepeck@webkit.org>
- * Scripts/run-webkit-tests: Break more pieces of the script into
- seprate functions. Added readSkippedFiles, findTestsToRun, and
- printResults functions. Removed custom code to skip results.html
- and instead just put it into the ignoredFiles hash. Fixed some
- indentation. Sorted function declarations, global variables,
- and options at the top of the file alphabetically so they're not
- in a semi-random order.
+ Reviewed by David Kilzer.
-2009-09-17 Kevin Ollivier <kevino@theolliviers.com>
+ Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
+ https://bugs.webkit.org/show_bug.cgi?id=40627
- wx build fix, add missing dependency.
+ Part 6 - LayoutTest and Cleanup
- * wx/browser/wscript:
+ Allow tests to delete application caches and set application cache
+ origin quotas, so they can be tested.
-2009-09-16 Mark Rowe <mrowe@apple.com>
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (dumpApplicationCacheDelegateCallbacksCallback): JavaScript callback, delegates to the controller.
+ (clearAllApplicationCachesCallback): should delete all application caches.
+ (setApplicationCacheOriginQuotaCallback): should set the origin quota for the localhost tests.
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::dumpApplicationCacheDelegateCallbacks): accessor to see if application cache callbacks should be output.
+ (LayoutTestController::setDumpApplicationCacheDelegateCallbacks): enable or disable debug output when the application cache quota is reached.
- Split the SnowLeopard build across a few machines.
+ Mac implementation.
- * BuildSlaveSupport/build.webkit.org-config/config.json:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::clearAllApplicationCaches): delete application caches.
+ (LayoutTestController::setApplicationCacheOriginQuota): set the quota for localhost.
+ * DumpRenderTree/mac/UIDelegate.mm:
+ (-[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]): style fix.
+ (-[UIDelegate webView:exceededApplicationCacheOriginQuotaForSecurityOrigin:]): reset the quota.
-2009-09-16 Kevin Ollivier <kevino@theolliviers.com>
+ Stub implementations for other platforms.
- wx build fix to support monolithic builds on Windows.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::clearAllApplicationCaches):
+ (LayoutTestController::setApplicationCacheOriginQuota):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::clearAllApplicationCaches):
+ (LayoutTestController::setApplicationCacheOriginQuota):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::clearAllApplicationCaches):
+ (LayoutTestController::setApplicationCacheOriginQuota):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::clearAllApplicationCaches):
+ (LayoutTestController::setApplicationCacheOriginQuota):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::clearAllApplicationCaches):
+ (LayoutTestController::setApplicationCacheOriginQuota):
- * wx/build/wxpresets.py:
+2010-08-03 Joseph Pecoraro <joepeck@webkit.org>
-2009-09-16 Kevin Ollivier <kevino@theolliviers.com>
+ Reviewed by David Kilzer.
- wx build fix, improve debug support and 2.9 support on MSW.
+ Limit ApplicationCache Total and Per-Origin Storage Capacity (Quotas)
+ https://bugs.webkit.org/show_bug.cgi?id=40627
- * wx/build/settings.py:
- * wx/build/wxpresets.py:
+ Part 5 - Refactor Quota Management in WebSecurityOrigin into Managers
-2009-09-16 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+ Change old style calls to make use of the managers.
- Blind try at fixing new test failure on Windows.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setDatabaseQuota):
+ * DumpRenderTree/mac/UIDelegate.mm:
+ (-[UIDelegate webView:frame:exceededDatabaseQuotaForSecurityOrigin:database:]):
- * DumpRenderTree/win/FrameLoadDelegate.cpp:
- (FrameLoadDelegate::didReceiveTitle):
+2010-08-03 Mark Rowe <mrowe@apple.com>
-2009-09-15 Alex Milowski <alex@milowski.com>
+ Add a new Leopard build slave to run the release tests.
- Reviewed by Tor Arne Vestbø.
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
- Added mathml toggle
+2010-08-03 Jon Honeycutt <jhoneycutt@apple.com>
- * Scripts/build-webkit:
+ WebKitTestRunner needs to activate the Mac font ascent hack
+ https://bugs.webkit.org/show_bug.cgi?id=43404
-2009-09-15 Kevin Ollivier <kevino@theolliviers.com>
+ Reviewed by Darin Adler.
- wx build fix. Allow waf build to support Python < 2.6.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::initialize):
+ Call WKBundleActivateMacFontAscentHack().
- * wx/build/waf_extensions.py:
+2010-08-03 Alex Milowski <alex@milowski.com>
-2009-09-14 Chris Marrin <cmarrin@apple.com>
+ Reviewed by Beth Dakin.
- Reviewed by Oliver Hunt.
+ Changed the default for MathML support so that is is enabled by default.
- Add LayoutTests infrastructure to enable and disable webgl tests.
- https://bugs.webkit.org/show_bug.cgi?id=29254
+ * Scripts/build-webkit:
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
+2010-08-03 Sam Weinig <sam@webkit.org>
-2009-09-14 Simon Fraser <simon.fraser@apple.com>
+ Roll r64566 back in this time with all the overloads in place..
- Reviewed by Darin Adler.
-
- Add --iterations option to run-webkit-tests to repeat the tests N times
- https://bugs.webkit.org/show_bug.cgi?id=29263
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ * WebKitTestRunner/StringFunctions.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::resetPreferencesToConsistentValues):
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
- When run with --iterations N, run-webkit-tests will repeat the tests N times.
+2010-08-03 Sam Weinig <sam@webkit.org>
- * Scripts/run-webkit-tests:
+ Rollout r64566. It broke all the WebKit2 tests.
-2009-09-14 Brady Eidson <beidson@apple.com>
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::operator<<):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ * WebKitTestRunner/StringFunctions.h: Removed.
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::createWKURL):
+ (WTR::WKStringToUTF8):
+ (WTR::TestInvocation::resetPreferencesToConsistentValues):
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
- Not reviewed, maybe should've been:
+2010-08-03 Sam Weinig <sam@webkit.org>
- Cleaning up more Windows-specific fallout from the fix for:
- <rdar://problem/7174050> and https://bugs.webkit.org/show_bug.cgi?id=29160
+ Reviewed by Anders Carlsson.
- * DumpRenderTree/win/ResourceLoadDelegate.cpp:
- (ResourceLoadDelegate::didReceiveAuthenticationChallenge): Correct printf() formatter,
- and call the correct method to get the Sender.
+ WTR: Move all the utility functions for working with strings to a shared header.
+ https://bugs.webkit.org/show_bug.cgi?id=43386
-2009-09-14 Jon Honeycutt <jhoneycutt@apple.com>
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ * WebKitTestRunner/StringFunctions.h: Added.
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::resetPreferencesToConsistentValues):
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
- GTK build fix.
+2010-08-02 Antonio Gomes <tonikitoo@webkit.org>
- Unreviewed.
+ Reviewed by Kenneth Christiansen.
- * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
- (AccessibilityController::setLogScrollingStartEvents):
+ [Qt] QtTestBrowser not setting preferredContentsSize for resizesToContents
+ https://bugs.webkit.org/show_bug.cgi?id=43168
-2009-09-11 Jon Honeycutt <jhoneycutt@apple.com>
+ QGraphicsWebView resizesToContents property has to work together with QWebPage's
+ setPreferredContentsSize as stated by the docs. Patch addresses that for QtTestBrowser.
- DRT/test part of
- <rdar://problem/7197644> WebKit should broadcast an MSAA event when
- jumping to a named anchor
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::applyPrefs):
+ * QtTestBrowser/webview.cpp:
+ (WebViewGraphicsBased::setResizesToContents): Properly handle scene, webview and viewport sizes
+ needed when toggle resizesToContents on/off.
+ (WebViewGraphicsBased::resizeEvent):
+ * QtTestBrowser/webview.h:
+ (WebViewGraphicsBased::setCustomLayoutSize): Setter helper.
+ (WebViewGraphicsBased::customLayoutSize): Getter helper.
- https://bugs.webkit.org/show_bug.cgi?id=28899
+2010-08-03 Jochen Eisinger <jochen@chromium.org>
- Reviewed by Adam Roben.
+ Unreviewed. Adding myself as committer.
- * DumpRenderTree/AccessibilityController.cpp:
- (logScrollingStartEventsCallback):
- Turn on logging of scrolling start events.
- (AccessibilityController::getJSClass):
- Add a "logScrollingStartEvents" to the AccessibilityController's JS
- class definition.
- (AccessibilityController::resetToConsistentState):
- Turn off logging of scrolling start events.
-
- * DumpRenderTree/AccessibilityController.h:
- Declare setLogScrollingStartEvents(). Add a member for the scrolling
- start event hook.
-
- * DumpRenderTree/mac/AccessibilityControllerMac.cpp:
- (AccessibilityController::setLogScrollingStartEvents):
- Stubbed.
+ * Scripts/webkitpy/common/config/committers.py:
- * DumpRenderTree/win/AccessibilityControllerWin.cpp:
- (AccessibilityController::AccessibilityController):
- Initialize the handle to 0.
- (logEventProc):
- Renamed from logFocusEventProc; now logs scrolling start events, too.
- Removed the assertion that the event is a focus event. Added a switch
- to print a message for focus, scrolling start, and other, unknown
- events.
- (AccessibilityController::setLogFocusEvents):
- Changed to use logEventProc.
- (AccessibilityController::setLogScrollingStartEvents):
- If turning logging off, unhook the scrolling start event hook, and clear
- the member holding the handle. If turning on, query for the root
- accessible, so that accessibility is enabled for the WebView, and call
- SetWinEventHook to setup an event hook using logEventProc as the
- callback function.
-
-2009-09-14 Brady Eidson <beidson@apple.com>
-
- Windows build fix.
+2010-08-02 Pavel Feldman <pfeldman@chromium.org>
- * DumpRenderTree/LayoutTestController.cpp:
- (setAuthenticationPasswordCallback):
- (setAuthenticationUsernameCallback):
-
- * DumpRenderTree/win/ResourceLoadDelegate.cpp:
- (ResourceLoadDelegate::didReceiveAuthenticationChallenge):
+ Reviewed by Yury Semikhatsky.
-2009-09-14 Brady Eidson <beidson@apple.com>
+ Chromium DevTools: Get rid of DevTools RPC.
- Reviewed by Alexey Proskuryakov.
+ https://bugs.webkit.org/show_bug.cgi?id=43335
- Safari 4 cannot be used to update firmware on Linksys routers.
- <rdar://problem/7174050> and https://bugs.webkit.org/show_bug.cgi?id=29160
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp:
+ (DRTDevToolsAgent::sendMessageToInspectorFrontend):
+ (DRTDevToolsAgent::call):
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h:
+ * DumpRenderTree/chromium/DRTDevToolsCallArgs.h:
+ (DRTDevToolsCallArgs::DRTDevToolsCallArgs):
+ * DumpRenderTree/chromium/DRTDevToolsClient.cpp:
+ (DRTDevToolsClient::sendMessageToBackend):
+ (DRTDevToolsClient::call):
+ * DumpRenderTree/chromium/DRTDevToolsClient.h:
- Add the ability for DRT to handle authentication challenges.
+2010-08-02 Kent Tamura <tkent@chromium.org>
- * DumpRenderTree/LayoutTestController.cpp:
- (setAuthenticationPasswordCallback):
- (setAuthenticationUsernameCallback):
- (setHandlesAuthenticationChallengesCallback):
- (LayoutTestController::staticFunctions):
-
- * DumpRenderTree/LayoutTestController.h:
- (LayoutTestController::handlesAuthenticationChallenges):
- (LayoutTestController::setHandlesAuthenticationChallenges):
- (LayoutTestController::authenticationUsername):
- (LayoutTestController::setAuthenticationUsername):
- (LayoutTestController::authenticationPassword):
- (LayoutTestController::setAuthenticationPassword):
+ Reviewed by Dimitri Glazkov.
- * DumpRenderTree/mac/ResourceLoadDelegate.mm:
- (-[ResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]):
+ [DRT/Chromium] Remove dependencies to some Chromium headers
+ https://bugs.webkit.org/show_bug.cgi?id=43396
- * DumpRenderTree/win/ResourceLoadDelegate.cpp:
- (ResourceLoadDelegate::didReceiveAuthenticationChallenge):
- * DumpRenderTree/win/ResourceLoadDelegate.h:
+ * DumpRenderTree/chromium/CppVariant.h:
+ Remove base/basictypes.h because webkit_support.h contains it.
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (getCurrentEventTimeSec): Use new wrapper function.
+ * DumpRenderTree/chromium/TestNavigationController.h:
+ Remove base/basictypes.h because webkit_support.h contains it.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (dumpHistoryItem): Use new wrapper function.
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::cancelledError): Use new wrapper function.
+ (WebViewHost::didFailResourceLoad): Use new wrapper function.
-2009-09-12 Mark Rowe <mrowe@apple.com>
+2010-08-02 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Dan Bernstein.
+ Reviewed by Xan Lopez.
- Test for <rdar://problem/6954546> and <rdar://problem/7090444>.
+ [GTK] DRT implement execCommand()
+ https://bugs.webkit.org/show_bug.cgi?id=35351
- Add a flag on the test plug-in that asks it to clear the document during the call to NPP_New.
- This is the trigger for both <rdar://problem/6954546> and <rdar://problem/7090444>.
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::execCommand): Implement using webkit_web_view_execute_core_command_by_name.
+ (LayoutTestController::isCommandEnabled): Implement using webkit_web_view_is_command_enabled.
+ (LayoutTestController::setCacheModel): Move below LayoutTestController::isCommandEnabled.
- * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
- (NPP_New):
+2010-08-02 Sam Weinig <sam@webkit.org>
-2009-09-14 Kevin Ollivier <kevino@theolliviers.com>
+ Reviewed by Anders Carlsson.
- wx build fix for non-wxPython builds and a fix for errors when updating swig.py.
+ Add alias for run-webkit-tests --webkit-test-runner (run-webkit-tests -2).
- * wx/build/build_utils.py:
- * wx/build/settings.py:
+ * Scripts/old-run-webkit-tests:
-2009-09-14 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+2010-08-02 Jon Honeycutt <jhoneycutt@apple.com>
- Reviewed by Tor Arne Vestbø.
+ WebKitTestRunner needs to support loading custom fonts (via the
+ WEBKIT_TESTFONTS environment variable)
+ https://bugs.webkit.org/show_bug.cgi?id=42782
- [Qt] Build fix for windows build.
+ Reviewed by Adam Roben.
- * Scripts/bisect-builds: Add missing paranthesis for tmpdir function.
+ * WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp:
+ (WTR::fontsPath):
+ Copied from DRT code. Removed the fallback to DumpRenderTree.resources/,
+ as this directory doesn't appear to be created anymore.
+ (WTR::activateFonts):
+ Loop through the fonts, and call AddFontResourceExW() for each.
-2009-09-13 Kevin Ollivier <kevino@theolliviers.com>
+2010-08-02 Jon Honeycutt <jhoneycutt@apple.com>
- Fix typo accidently landed in last commit.
+ Restore the WebKitTestRunner.sln that was removed, and remove the
+ correct one.
- * wx/build/settings.py:
+ Rubber-stamped by Sam Weinig.
-2009-09-13 Kevin Ollivier <kevino@theolliviers.com>
+ * WebKitTestRunner/WebKitTestRunner.sln: Added.
+ * WebKitTestRunner/win/WebKitTestRunner.sln: Removed.
- wx build fix, error out if using the wrong Python.
+2010-08-02 Jon Honeycutt <jhoneycutt@apple.com>
- * wx/build/settings.py:
+ Move InjectedBundle.vcproj to where the other WebKitTestRunner vcprojs live.
-2009-09-13 Xan Lopez <xlopez@igalia.com>
+ Remove the unused WebKitTestRunner.sln.
- Build fix for GTK+ < 2.14.
+ Reviewed by Sam Weinig.
- Do not use gtk_widget_get_window, access the window directly
- through the struct.
+ * WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops:
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj: Removed.
+ * WebKitTestRunner/WebKitTestRunner.sln: Removed.
+ * WebKitTestRunner/win/InjectedBundle.vcproj: Added.
+ * WebKitTestRunner/win/WebKitTestRunner.sln:
- * DumpRenderTree/gtk/EventSender.cpp:
- (contextClickCallback):
- (mouseDownCallback):
- (mouseUpCallback):
- (mouseMoveToCallback):
- (keyDownCallback):
+2010-08-02 Sam Weinig <sam@webkit.org>
-2009-09-13 Martin Robinson <martin.james.robinson@gmail.com>
+ Fix the windows build.
- Reviewed by Xan Lopez and Jan Alonzo.
+ * WebKitTestRunner/win/main.cpp:
- [GTK] EventSender does not set 'window' property on synthesized GDK events
- https://bugs.webkit.org/show_bug.cgi?id=29169
+2010-07-29 Jon Honeycutt <jhoneycutt@apple.com>
- Set the window property on synthesized GDK events in the GTK+ EventSender.
+ Add a Skipped list on Windows, and have run-webkit-tests respect it.
- * DumpRenderTree/gtk/EventSender.cpp:
- (contextClickCallback):
- (mouseDownCallback):
- (mouseUpCallback):
- (mouseMoveToCallback):
- (keyDownCallback):
+ Part of <rdar://problem/8233237> Fill WebKit2 Windows skipped list so
+ there are zero tests failing
+ https://bugs.webkit.org/show_bug.cgi?id=43374
-2009-09-12 Drew Wilson <atwilson@google.com>
+ Reviewed by Adam Roben.
- Reviewed by Mark Rowe.
+ * Scripts/old-run-webkit-tests:
+ If using WebKitTestRunner and Apple Windows WebKit, set the platform to
+ win-wk2. When building the result hierarchy, if the platform is win-wk2,
+ add it first to the list of platforms.
- run-webkit-tests has a timeout value that is too low
- https://bugs.webkit.org/show_bug.cgi?id=29223
+2010-08-02 Darin Adler <darin@apple.com>
- * Scripts/run-webkit-tests:
- Changed timeout value to 20 seconds to avoid timing out too early.
+ Reviewed by Sam Weinig.
-2009-09-11 Kevin Ollivier <kevino@theolliviers.com>
+ WebKitTestRunner needs layoutTestController.setCanOpenWindows
+ https://bugs.webkit.org/show_bug.cgi?id=42321
+
+ WebKitTestRunner needs layoutTestController.setCloseRemainingWindowsWhenComplete
+ https://bugs.webkit.org/show_bug.cgi?id=42779
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: Added
+ setCanOpenWindows, setCloseRemainingWindowsWhenComplete, and windowCount
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::InjectedBundle): Initialize m_mainPage to 0 instead of
+ waiting for the first call to didCreatePage.
+ (WTR::InjectedBundle::didCreatePage): Set m_mainPage only when the first page
+ is created. Put other pages into a map.
+ (WTR::InjectedBundle::willDestroyPage): Added code to handle the destruction
+ of the main page.
+ (WTR::InjectedBundle::closeOtherPages): Added. Closes all the pages other than
+ the main page.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Added pageCount and
+ closeOtherPages functions.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didFinishLoadForFrame): Don't let pages other than
+ the main page affect dumping.
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame): Ditto.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Initialize the new
+ m_shouldCloseExtraWindows member.
+ (WTR::LayoutTestController::setCanOpenWindows): Added. Empty for now.
+ (WTR::LayoutTestController::windowCount): Added.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ Added setCanOpenWindows, setCloseRemainingWindowsWhenComplete,
+ windowCount, shouldCloseExtraWindowsAfterRunningTest, and
+ m_shouldCloseExtraWindows.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::shared): Return a pointer to the shared copy, but
+ don't allocate and leak it. This seemed cleaner than adding an explicit
+ finalize call to go along with the explicit initialize call.
+ (WTR::TestController::TestController): Added calls to the initialize and
+ run function, which are now done automatically.
+ (WTR::TestController::~TestController): Added, since it's called now.
+ (WTR::closeOtherPage): Added. Used to close pages other than the main page.
+ (WTR::createOtherPage): Added. Used to create pages other than the main page.
+ (WTR::TestController::initialize): Added code to set up createOtherPage.
+ (WTR::TestController::run): Removed unused return value.
+ * WebKitTestRunner/TestController.h: Made constructor and destructor public,
+ and initialize and run private. Changed m_mainWebView to be an OwnPtr.
+
+ * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+ (WTR::PlatformWebView::PlatformWebView): Added a call to setReleasedWhenClosed
+ to avoid releasing the window twice. Another way to handle it would be to
+ remove the release, but this approach is slightly more robust because it works
+ even if some other code calls the close method an extra time.
+
+ * WebKitTestRunner/mac/main.mm:
+ (main): Use a stack-allocated TestController object instead of calling
+ initalize and run on a globally allocated one.
+
+2010-08-02 Tony Chang <tony@chromium.org>
- wx build fix. Mark dependencies as mandatory and declare which MSVC versions and
- architectures are supported for building wxWebKit.
+ Reviewed by David Levin.
- * wx/build/settings.py:
+ add myself to the reviewers list
+ https://bugs.webkit.org/show_bug.cgi?id=43366
-2009-09-11 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/common/config/committers.py:
- Reviewed by David Levin.
+2010-08-02 Anders Carlsson <andersca@apple.com>
- bugzilla-tool rollout threw exception under svn
- https://bugs.webkit.org/show_bug.cgi?id=29211
+ Reviewed by Sam Weinig.
- * Scripts/modules/scm.py: add missing return, and convert number arguments to strings.
- * Scripts/modules/scm_unittest.py: add testing for this fix.
+ Cache JSNPObjects and fix bugs in the object map
+ https://bugs.webkit.org/show_bug.cgi?id=43368
-2009-09-11 Brian Weinstein <bweinstein@apple.com>
+ Test that we correctly throw exceptions when trying to do things to a JSObject that used to
+ wrap an NPObject that came from a plug-in that is now destroyed.
- Add myself to the committers list.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
+ (PluginTest::Object::getProperty):
+ (PluginTest::Object::NP_GetProperty):
+ (PluginTest::Object::npClass):
+ * DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp: Added.
+ (NPRuntimeObjectFromDestroyedPlugin::NPRuntimeObjectFromDestroyedPlugin):
+ (NPRuntimeObjectFromDestroyedPlugin::ScriptableObject::hasProperty):
+ (NPRuntimeObjectFromDestroyedPlugin::ScriptableObject::getProperty):
+ (NPRuntimeObjectFromDestroyedPlugin::NPP_GetValue):
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * GNUmakefile.am:
- * Scripts/modules/committers.py:
+2010-08-02 Martin Robinson <mrobinson@igalia.com>
-2009-09-11 Eric Seidel <eric@webkit.org>
+ Reviewed by Xan Lopez.
- Reviewed by Adam Barth.
+ [Gtk] DOM listeners get wrong keycodes for some keys
+ https://bugs.webkit.org/show_bug.cgi?id=35170
- bugzilla-tool land-patches should only fail-fast in --commit-queue mode
- https://bugs.webkit.org/show_bug.cgi?id=29201
+ Add support to all event senders for simulating keypad insert
+ and print screen keys.
- * Scripts/bugzilla-tool:
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::keyDown): Add support for generating keypad insert and print screen.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (keyDownCallback): Ditto.
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (-[EventSendingController keyDown:withModifiers:withLocation:]): Ditto.
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::keyDown): Ditto.
+ * DumpRenderTree/win/EventSender.cpp:
+ (keyDownCallback): Ditto.
-2009-09-11 Adam Roben <aroben@apple.com>
+2010-08-02 Martin Robinson <mrobinson@igalia.com>
- Make commit-log-editor move common prefixes to the top of the log
+ Build fix for building against development versions of GTK+. GTK 2.22
+ has not yet been released, so these function definitions must be conditionalized
+ on the development version.
- Fies <http://webkit.org/b/29190> commit-log-editor should move common
- prefixes to the top of the commit log
+ * DumpRenderTree/gtk/EventSender.cpp: Fix GTK+ 2.21 build.
- Reviewed by Darin Adler.
+2010-08-02 Tony Chang <tony@chromium.org>
- * Scripts/commit-log-editor: Find and remove the longest common prefix
- ending in a double newline from each ChangeLog entry, then put that
- common prefix at the top of the commit log.
- (removeLongestCommonPrefixEndingInDoubleNewline): Added. Finds,
- removes, and returns the longest common prefix ending in a double
- newline from a hash of strings
+ Reviewed by Kent Tamura.
-2009-09-11 Eric Seidel <eric@webkit.org>
+ [chromium] use ChromiumDriver on Linux when running webkit tests
+ https://bugs.webkit.org/show_bug.cgi?id=43273
- Fix obvious typo in previous commit, no review.
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
- bugzilla-tool should automate rollouts
- https://bugs.webkit.org/show_bug.cgi?id=26715
+2010-08-02 Kent Tamura <tkent@chromium.org>
- * Scripts/bugzilla-tool: add back missing "scm" argument.
+ Reviewed by Dimitri Glazkov.
-2009-09-11 Eric Seidel <eric@webkit.org>
+ [DRT/Chromium] Always initialize GTK
+ https://bugs.webkit.org/show_bug.cgi?id=43327
- Reviewed by Adam Barth.
+ Call gtk_init() in order to fix plugin test crash.
- bugzilla-tool should automate rollouts
- https://bugs.webkit.org/show_bug.cgi?id=26715
-
- bugzilla-tool rollout will do the rollout locally and leave the diff for you to verify and commit.
- The --complete-rollout option will automatically land and update the bug.
- Eventually --complete-rollout will be default, but that will require more testing.
-
- This first pass is good enough for others to try and file bugs about.
-
- * Scripts/bugzilla-tool:
- - Move modified_changelogs into scm.py.
- - Move svn_revision_from_commit_text logic into scm.py.
- - Add RolloutCommit command.
- * Scripts/modules/bugzilla.py:
- - Add reopen_bug command used by RolloutCommit.
- * Scripts/modules/scm.py:
- - Add functions to support RolloutCommit.
- - Abstract find_uuid into value_from_svn_info so it can be re-used for _repository_url (needed by svn merge).
- - Add a str() call so that svn_commit_log can take a numeric argument.
- - Remove a bunch of very slow code from last_svn_commit_log and used the built-in 'BASE' alias instead.
- - Made dry_run commits return something that svn_revision_from_commit_text can parse.
- * Scripts/modules/scm_unittest.py:
- - Add read_from_path for easy file reading.
- - Put test4 on a new line to make reverts work w/o conflict.
- - Add an "svn update" call so that the checkout revision matches the server revision.
- - Add tests for svn_revision_from_commit_text.
- - Add a simple test for apply_reverse_diff.
- - Add a new self.scm member and use it in the new tests (eventually other tests can use it too).
- - Add test for svn_commit_log to make sure my 'BASE' change above worked as expected.
-
-2009-09-11 Adam Roben <aroben@apple.com>
-
- Get user script/stylesheet tests running on Windows
-
- Fixes <http://webkit.org/b/29181> User script/stylesheet tests are
- skipped on Windows
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main): Pass argc/argv to platformInit().
+ * DumpRenderTree/chromium/TestShell.h:
+ * DumpRenderTree/chromium/TestShellGtk.cpp:
+ (platformInit): Update parameters, call gtk_init().
+ * DumpRenderTree/chromium/TestShellMac.mm:
+ (platformInit): Update parameters.
+ * DumpRenderTree/chromium/TestShellWin.cpp:
+ (platformInit): Update parameters.
- Reviewed by John Sullivan.
+2010-08-02 Balazs Kelemen <kb@inf.u-szeged.hu>
- * DumpRenderTree/win/DumpRenderTree.vcproj: Link all configurations
- against comsuppw.lib so we can use _bstr_t.
+ Reviewed by Simon Hausmann.
- * DumpRenderTree/win/LayoutTestControllerWin.cpp: Fixed #include
- order, added #include of comutil.h for _bstr_t.
+ [Qt] Generate forwarding headers for WebKit2
- (bstrT): Helper function to convert a JSStringRef to a _bstr_t.
- (LayoutTestController::addUserScript):
- (LayoutTestController::addUserStyleSheet):
- Implemented. Implementations were based on those in
- LayoutTestControllerMac.mm.
+ https://bugs.webkit.org/show_bug.cgi?id=43336
-2009-09-10 David Kilzer <ddkilzer@apple.com>
+ * Scripts/webkitdirs.pm: Call make on WebKit2/Makefile.DerivedSources.
- <http://webkit.org/b/29147> run-webkit-tests: make -h show help
+2010-08-02 Fumitoshi Ukai <ukai@chromium.org>
- Reviewed by Mark Rowe.
+ Reviewed by Kent Tamura.
- * Scripts/run-webkit-tests: Updated to make -h switch show help.
+ WebSocket server should start with SO_REUSEADDR
+ https://bugs.webkit.org/show_bug.cgi?id=43329
-2009-09-10 Fumitoshi Ukai <ukai@chromium.org>
+ Pulls in pywebsocket-0.5.2.
+ pywebsocket-0.5.2 includes a small fix to start server with SO_REUSE_ADDR.
+ http://code.google.com/p/pywebsocket/source/detail?r=273
- Reviewed by Alexey Proskuryakov.
+ * Scripts/webkitpy/thirdparty/__init__.py: Bump pywebsocket version
- Add WebCore/websockets directory in wx build system.
- https://bugs.webkit.org/show_bug.cgi?id=28038
+2010-08-01 Kent Tamura <tkent@chromium.org>
- * wx/build/settings.py:
+ Reviewed by Dimitri Glazkov.
-2009-09-10 Martin Robinson <martin.james.robinson@gmail.com>
+ [DRT/Chromium] Remove string_util.h dependency
+ https://bugs.webkit.org/show_bug.cgi?id=43312
- [GTK] EventSender does not properly convert some keyDown strings
- https://bugs.webkit.org/show_bug.cgi?id=29119
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::pathToLocalResource):
+ Use string::find() instead of StartsWithASCII().
+ (LayoutTestController::cppVariantToInt32):
+ Use strtol() instead of StringToNumber().
- Add more keyDown string to character code conversions for GTK+ EventSender.
+2010-08-01 Sam Weinig <sam@webkit.org>
- * DumpRenderTree/gtk/EventSender.cpp:
- (keyDownCallback):
+ Reviewed by Anders Carlsson.
-2009-09-09 Steve Block <steveblock@google.com>
+ Add ability to reset frame names for WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=43316
- Reviewed by Maciej Stachowiak.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::reset):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::reset):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
- Geolocation Coordinates::toString() prints bogus values for unspecified properties.
- https://bugs.webkit.org/show_bug.cgi?id=29080
+2010-08-01 Anders Carlsson <andersca@apple.com>
- * Scripts/make-script-test-wrappers: Modified. Adds asynchronous Geolocation tests to exclusion list.
+ Reviewed by Sam Weinig.
-2009-09-09 Eric Seidel <eric@webkit.org>
+ Implement NPN_RemoveProperty
+ https://bugs.webkit.org/show_bug.cgi?id=43315
- Reviewed by Eric Carlson.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Add NPRuntimeRemoveProperty.cpp
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::NPN_GetStringIdentifier):
+ (PluginTest::NPN_GetIntIdentifier):
+ (PluginTest::NPN_RemoveProperty):
+ Add NPN_ helpers.
- reviewer/committer lookups are backwards
- https://bugs.webkit.org/show_bug.cgi?id=29113
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
+ Support more NPClass functions.
- I also moved Eric Carlson from the committer list to the reviewer list now that he is one.
+ * DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp: Added.
+ (NPRuntimeRemoveProperty::NPRuntimeRemoveProperty):
+ Test for NPN_RemoveProperty.
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/committers.py:
+ (NPRuntimeRemoveProperty::TestObject::hasMethod):
+ (NPRuntimeRemoveProperty::TestObject::invoke):
+ Add a testRemoveProperty method.
-2009-09-09 Cameron McCormack <cam@mcc.id.au>
+ (NPRuntimeRemoveProperty::NPP_GetValue):
+ Return the test object.
- Reviewed by Eric Seidel.
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * GNUmakefile.am:
+ Add NPRuntimeRemoveProperty.cpp
- svn-unapply doesn't revert directories correctly
- https://bugs.webkit.org/show_bug.cgi?id=29065
+2010-07-30 Anders Carlsson <andersca@apple.com>
- * Scripts/svn-unapply: Make svnStatus consistently return status
- lines including a newline.
- * Scripts/svn-apply: Keep svnStatus in sync with the one in
- svn-unapply, in lieu of moving it to a common file.
+ Reviewed by Sam Weinig.
-2009-09-09 Cameron McCormack <cam@mcc.id.au>
+ Add an NPObject class template helper to TestNetscapePlugin
+ https://bugs.webkit.org/show_bug.cgi?id=43288
- Reviewed by Eric Seidel.
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
+ Add some template magic to be able to figure out if a class has a member function of a given type.
- svn-apply doesn't handle changes to files copied to new directories properly
- https://bugs.webkit.org/show_bug.cgi?id=29059
+ (PluginTest::Object::create):
+ Create an object.
- * Scripts/svn-apply: Don't treat "--- revision 0" patches as being
- additions if we know that we've just copied a file to this name.
+ (PluginTest::Object::invokeDefault):
+ Add dummy function, this should never be called.
-2009-09-09 Eric Seidel <eric@webkit.org>
+ (PluginTest::Object::Object):
+ Initialize m_pluginTest to 0.
- Reviewed by David Levin.
+ (PluginTest::Object::~Object):
+ Add virtual destructor.
- commit-queue hangs if a builder has never built
- https://bugs.webkit.org/show_bug.cgi?id=29091
+ (PluginTest::Object::NP_Allocate):
+ Create a new object.
- * Scripts/modules/buildbot.py:
- * Scripts/modules/buildbot_unittest.py:
+ (PluginTest::Object::NP_Deallocate):
+ Delete the object.
-2009-09-09 Zan Dobersek <zandobersek@gmail.com>
+ (PluginTest::Object::NP_InvokeDefault):
+ Call invokeDefault.
- Reviewed by Gustavo Noronha.
+ (PluginTest::Object::npClass):
+ Initialize the NPClass struct.
- [GTK] DumpRenderTree needs eventSender object and implementation
- https://bugs.webkit.org/show_bug.cgi?id=25990
+ * DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp:
+ (DocumentOpenInDestroyStream::NPP_DestroyStream):
+ Move this inline.
- Implements most of the EventSender object's functionality for
- the DumpRenderTree tool. Implementation still lacks support
- for drag and drop tests and forward leaps.
+ * DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp:
+ (PluginScriptableNPObjectInvokeDefault::NPObjectWithInvokeDefault::invokeDefault):
+ (PluginScriptableNPObjectInvokeDefault::NPP_GetValue):
+ Use the PluginTest::Object class template.
- Based on work by Holger Hans Peter Freyther.
+2010-07-31 Sam Weinig <sam@webkit.org>
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (runTest): Focus on the view before loading a new test.
- (webViewWindowObjectCleared):
- * DumpRenderTree/gtk/EventSender.cpp: Added.
- (getDragModeCallback):
- (setDragModeCallback):
- (leapForwardCallback):
- (contextClickCallback):
- (updateClickCount):
- (mouseDownCallback):
- (mouseUpCallback):
- (mouseMoveToCallback):
- (beginDragWithFilesCallback):
- (replaySavedEvents):
- (keyDownCallback):
- (textZoomInCallback):
- (textZoomOutCallback):
- (zoomPageInCallback):
- (zoomPageOutCallback):
- (getClass):
- (makeEventSender):
- * DumpRenderTree/gtk/EventSender.h: Added.
- * GNUmakefile.am: Add build rules for EventSender.
+ Reviewed by Dan Bernstein.
-2009-09-09 Daniel Bates <dbates@webkit.org>
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=43305
+ Add back WKBundleFrameCopyInnerText to fix ~50 test failures
+ due to SVGElements not having the innerText function.
- Reviewed by Adam Roben.
-
- https://bugs.webkit.org/show_bug.cgi?id=28953
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::dumpFrameText):
- Added pre- and post- build events so that on build failure, the file
- buildfailed is written to the directory $(WebKitOutputDir).
+2010-07-30 Sam Weinig <sam@webkit.org>
- * WinLauncher/WinLauncher.vcproj:
+ Reviewed by Maciej Stachowiak.
-2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=43290
+ Add structured message passing from the injected bundle to UIProcess
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (didRecieveMessageFromInjectedBundle):
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (didClearWindowForFrame):
+ (didRecieveMessage):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::done):
+ (WTR::InjectedBundle::didReceiveMessage):
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+ (WTR::TestController::didReceiveMessageFromInjectedBundle):
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
+ * WebKitTestRunner/TestInvocation.h:
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+
+2010-07-30 Sam Weinig <sam@webkit.org>
- Unreviewed.
+ Reviewed by Anders Carlsson.
- Add myself to list of committers.
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=43275
+ Make WKArrayRef more usable.
- * Scripts/modules/committers.py:
+ Remove now unnecessary const_casts.
-2009-09-08 Eric Seidel <eric@webkit.org>
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::dumpDescendantFrameScrollPositions):
+ (WTR::dumpDescendantFramesText):
- Reviewed by David Levin.
+2010-07-30 Sam Weinig <sam@webkit.org>
- commit-queue gets stuck if a non-committer sets commit-queue+ or review+
- https://bugs.webkit.org/show_bug.cgi?id=28605
- https://bugs.webkit.org/show_bug.cgi?id=28916
-
- * Scripts/bugzilla-tool:
- - Fix comment and adjust reject_patch_from_commit_queue call to pass "manual commit"
- comment now that it's used for rejecting patches for invalid committers too.
- - Pass reject_invalid_patches=True for commit-queue calls, normally we just ignore patches with invalid reviewers, the commit-queue rejects them.
- - Make the commit queue print patches count instead of bugs count, this also fixes https://bugs.webkit.org/show_bug.cgi?id=28916.
- * Scripts/modules/bugzilla.py:
- - Make _parse_attachment_element not validate reviewer/committer.
- - Share flag parsing code in _parse_attachment_flag.
- - Add _validate* methods for validating reviewers and committers and updating bugs when validation fails.
- - Add reject_invalid_patches argument so the commit-queue can update bugs on failed validation and other "read only" commands will not.
- - Add reject_patch_from_review_queue using a new _set_flag_on_attachment abstraction.
- * Scripts/modules/bugzilla_unittest.py:
- - Update this test to no longer expect committer/reviewer validation.
- * Scripts/modules/committers.py:
- - Return None on failed lookups instead of raising Exceptions.
- * Scripts/modules/committers_unittest.py:
- - Update tests to expect None returns instead of exceptions.
-
-2009-09-09 David Kilzer <ddkilzer@apple.com>
-
- <http://webkit.org/b/29061> Fix obvious copy-paste error in AccessibilityUIElement::clickPointY()
+ Reviewed by Anders Carlsson.
- Reviewed by Mark Rowe.
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=43274
+ Add first pass of structured message passing.
+
+ Update Minibrowser and WebKitTestRunner to work with the new post message
+ function.
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (didRecieveMessageFromInjectedBundle):
+ (-[BrowserAppDelegate init]):
+ * MiniBrowser/mac/MiniBrowser_Prefix.pch:
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (didStartProvisionalLoadForFrame):
+ (didReceiveServerRedirectForProvisionalLoadForFrame):
+ (didFailProvisionalLoadWithErrorForFrame):
+ (didCommitLoadForFrame):
+ (didFinishLoadForFrame):
+ (didFailLoadWithErrorForFrame):
+ (didReceiveTitleForFrame):
+ (didClearWindowForFrame):
+ (didCreatePage):
+ (willDestroyPage):
+ (didRecieveMessage):
+ (WKBundleInitialize):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::_didReceiveMessage):
+ (WTR::InjectedBundle::didReceiveMessage):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::invoke):
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+
+2010-07-30 Anders Carlsson <andersca@apple.com>
+
+ Try to fix the layout test failures.
- No change to layout test results.
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_get_value):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::clickPointY): Changed to return y value
- instead of x value.
+2010-07-29 Anders Carlsson <andersca@apple.com>
-2009-09-08 Dimitri Glazkov <dglazkov@chromium.org>
+ Reviewed by Adam Roben.
- Reviewed by Mark Rowe.
+ Replace plugins/npruntime/bindings-test.html with a more sophisticated test
+ https://bugs.webkit.org/show_bug.cgi?id=43232
- Reduce dglazkov's boboiness by properly concatenating revision value.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Add PluginScriptableNPObjectInvokeDefault.cpp.
- * BuildSlaveSupport/build.webkit.org-config/master.cfg: Used substitution
- rather than "+".
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ Remove invokeDefault callback function.
-2009-09-08 Kevin Ollivier <kevino@theolliviers.com>
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ (PluginTest::create):
+ Move this to the top of the file.
- wxWebKit Python extension build fix - get swig.py if it doesn't exist.
+ (PluginTest::NPP_GetValue):
+ Add default implementation.
- * wx/build/build_utils.py:
+ (PluginTest::NPN_CreateObject):
+ Add NPN_ wrapper.
-2009-09-08 Mark Rowe <mrowe@apple.com>
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
+ (PluginTest::identifier):
+ Add identifier getter.
- Fix an incorrect variable name in UpdateChromiumSource.
+ * DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp:
+ (DocumentOpenInDestroyStream::DocumentOpenInDestroyStream):
+ Add "using namespace std".
- * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_GetValue):
+ Give PluginTest a chance to return a value.
-2009-09-08 Mark Rowe <mrowe@apple.com>
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * GNUmakefile.am:
+ Add PluginScriptableNPObjectInvokeDefault.cpp.
+
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_get_value):
+ Give PluginTest a chance to return a value.
- Don't check for leaks on the release SnowLeopard builder.
+2010-07-30 Steve Block <steveblock@google.com>
- * BuildSlaveSupport/build.webkit.org-config/config.json:
+ Reviewed by Steve Block.
-2009-09-08 Mark Rowe <mrowe@apple.com>
+ Add LayoutTestController methods to test DeviceOrientation
+ https://bugs.webkit.org/show_bug.cgi?id=39589
- Add a SnowLeopard release builder.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockDeviceOrientationCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::setMockDeviceOrientation):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockDeviceOrientation):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ * Scripts/build-webkit:
- * BuildSlaveSupport/build.webkit.org-config/config.json:
+2010-07-29 Antonio Gomes <tonikitoo@webkit.org>
-2009-09-08 David Levin <levin@chromium.org>
+ Reviewed by Kenneth Christiansen.
- Reviewed by Darin Adler.
+ [Qt] QtTestBrowser: -resizes-to-contents command line parameter is broken
+ https://bugs.webkit.org/show_bug.cgi?id=43209
- Remove end of line whitespace check from check-webkit-style.
- https://bugs.webkit.org/show_bug.cgi?id=29053
+ When -resizes-to-content was being passed as a command line parameter it was simply
+ not being set (although the corresponding menu item was marked as ON).
+ User had to toggle the menu OFF and then ON again for it to take place.
- * Scripts/modules/cpp_style.py:
+ Reason: LauncherWindow::applyPrefs method sets many user options passed in from
+ the command line, but not resizesToContents. Patch addresses that.
-2009-09-08 Cameron McCormack <cam@mcc.id.au>
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::createChrome):
+ (LauncherWindow::applyPrefs):
+ (LauncherWindow::toggleResizesToContents):
+ * QtTestBrowser/webview.h:
+ (WebViewGraphicsBased::resizesToContents):
- Reviewed by Darin Adler.
+2010-07-29 Antonio Gomes <tonikitoo@webkit.org>
- Fix DumpRenderTree build from clean tree on Tiger
- https://bugs.webkit.org/show_bug.cgi?id=28927
+ Rubber-stamped by Simon Fraser.
- * DumpRenderTree/mac/PerlSupport/Makefile: Ensure the
- DerivedSources/DumpRenderTree directory exists when
- building on Tiger.
+ [Qt] QtTestBrowser: more method grouping and clean ups.
-2009-09-08 Kevin Ollivier <kevino@theolliviers.com>
+ Moving blocks of code around. Basically grouping related methods close to each.
- wx build fix after introduction of platform/mock directory.
+ * QtTestBrowser/launcherwindow.cpp:
+ (LauncherWindow::initializeView):
+ (LauncherWindow::createChrome):
+ (LauncherWindow::changeViewportUpdateMode):
+ (LauncherWindow::showFPS):
+ (LauncherWindow::newWindow):
+ (LauncherWindow::cloneWindow):
+ * QtTestBrowser/launcherwindow.h:
- * wx/build/settings.py:
+2010-07-30 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
-2009-09-08 Yael Aharon <yael.aharon@nokia.com>
+ Reviewed by Tor Arne Vestbø.
- Unreviewed.
+ [QT][Symbian] QtTestBrowser missing location capabilities
+ https://bugs.webkit.org/show_bug.cgi?id=43235
- Add myself to list of committers.
+ QtTestBrowser missing capabilities to use QtMobility::QLocation.
- * Scripts/modules/committers.py:
+ * QtTestBrowser/QtTestBrowser.pro:
-2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+2010-07-29 Anders Carlsson <andersca@apple.com>
- Unreviewed.
+ Add PluginTest.cpp
- Add myself to list of committers.
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
- * Scripts/modules/committers.py:
+2010-07-29 Dirk Pranke <dpranke@chromium.org>
-2009-09-08 Cameron McCormack <cam@mcc.id.au>
+ Reviewed by Eric Seidel.
- Reviewed by Darin Adler.
+ Update download URLs for python irclib package; the old URLs
+ pointed at a specific mirror host and not the general sourceforge
+ URLs.
- prepare-ChangeLog too chatty on file additions
- https://bugs.webkit.org/show_bug.cgi?id=29019
+ https://bugs.webkit.org/show_bug.cgi?id=43228
- * Scripts/prepare-ChangeLog: Omit description of added properties
- on newly added files.
+ * Scripts/webkitpy/thirdparty/__init__.py:
-2009-09-08 Steve Block <steveblock@google.com>
+2010-07-29 Anders Carlsson <andersca@apple.com>
- Reviewed by Adam Barth.
+ Fix typo.
- Adds a LayoutTestController method to set the permission state for Geolocation.
- This is required to use the mock Geolocation service for testing.
- https://bugs.webkit.org/show_bug.cgi?id=29027
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
- * DumpRenderTree/LayoutTestController.cpp: Modified.
- (setDatabaseQuotaCallback): Modified. Style fix.
- (setGeolocationPermissionCallback): Added. Sets the Geolocation permission state.
- (LayoutTestController::staticFunctions): Modified. Registers the above function on the LayoutTestController.
- * DumpRenderTree/LayoutTestController.h: Modified.
- (LayoutTestController::setGeolocationPermission): Added. Sets the Geolocation permission state.
- (LayoutTestController::isGeolocationPermissionSet): Added. Returns whether the Geolocation permission has been set.
- (LayoutTestController::geolocationPermission): Added. Returns the Geolocation permission state.
- * DumpRenderTree/mac/UIDelegate.mm: Modified.
- (-[UIDelegate webView:frame:requestGeolocationPermission:securityOrigin:]): Added. Implement chrome method to respond to request for Geolocation permission state. Response is made using above methods to access permission state.
+2010-07-29 Anders Carlsson <andersca@apple.com>
-2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+ Another attempt at fixing the Qt and GTK+ build.
- Reviewed by Simon Hausmann.
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_instance):
+ (webkit_test_plugin_destroy_stream):
- [Qt] QtWebKit single API to enable persistency
- https://bugs.webkit.org/show_bug.cgi?id=28682
+2010-07-29 Anders Carlsson <andersca@apple.com>
- Use the new enablePersistentStorage API instead
- of enabling all persistent features one-by-one.
+ Another build fix attempt.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
- (WebCore::DumpRenderTree::DumpRenderTree):
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_instance):
+ * GNUmakefile.am:
-2009-09-07 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+2010-07-29 Anders Carlsson <andersca@apple.com>
- Reviewed by Tor Arne Vestbø.
+ Try to fix Windows and Unix builds.
- Refactor --strict switch to --ignore-metrics and correct the
- implementation to make the feature usable on all platforms.
- https://bugs.webkit.org/show_bug.cgi?id=28907
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_instance):
+ (webkit_test_plugin_destroy_stream):
- run-webkit-tests --ignore-metrics strips the font related metrics from
- the actual and expected data before comparing them.
- In this way the render trees can be checked for obvious differences but
- a successful test implies by no means that the layout is actually correct.
+2010-07-29 Anders Carlsson <andersca@apple.com>
- * Scripts/run-webkit-tests:
+ Reviewed by Sam Weinig.
-2009-09-07 Steve Block <steveblock@google.com>
+ Refactor TestNetscapePlugin so tests can be split in separate files
+ https://bugs.webkit.org/show_bug.cgi?id=43220
- Reviewed by Adam Barth.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ Add PluginTest.cpp, PluginTest.h and Tests/DocumentOpenInDestroyStream.cpp.
- Adds a mock Geolocation service. This will be used to provide predictable behavior of the
- Geolocation API for use in LayoutTests. Later changes will integrate the the mock
- Geolocation service with DumpRenderTree.
- https://bugs.webkit.org/show_bug.cgi?id=28264
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (pluginAllocate):
+ Initialize pluginTest to 0. Remove testDocumentOpenInDestroyStream.
- * DumpRenderTree/LayoutTestController.cpp: Modified.
- (setMockGeolocationPositionCallback): Added. Configures the mock Geolocation service.
- (setMockGeolocationErrorCallback): Added. Configures the mock Geolocation service.
- (LayoutTestController::staticFunctions): Added. Registers the above functions on the LayoutTestController.
- * DumpRenderTree/LayoutTestController.h: Modified.
- * DumpRenderTree/mac/LayoutTestControllerMac.mm: Modified.
- (LayoutTestController::setMockGeolocationPosition): Added. Configures the mock Geolocation service.
- (LayoutTestController::setMockGeolocationError): Added. Configures the mock Geolocation service.
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp: Added.
+ (PluginTest::PluginTest):
+ Initialize m_npp and the test identifier.
+
+ (PluginTest::createTestFunctions):
+ Return the map from identifiers to createTest functions.
-2009-09-07 Drew Wilson <atwilson@google.com>
+ (PluginTest::registerCreateTestFunction):
+ Insert the identifier and create function pair in the map.
- Reviewed by David Levin.
+ (PluginTest::create):
+ Look for a createTest function. If one is found, call it. Otherwise create a vanilla PluginTest object.
- Enable SHARED_WORKERS by default
- https://bugs.webkit.org/show_bug.cgi?id=28959
+ * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Added.
+ (PluginTest::Register::Register):
+ Helper class template for registering plug-in tests.
+
+ (PluginTest::Register::create):
+ Create a new test of the given type.
- * Scripts/build-webkit:
+ * DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp: Added.
+ (DocumentOpenInDestroyStream::DocumentOpenInDestroyStream):
+ Add a test that calls testDocumentOpen from its NPP_DestroyStream callback.
-2009-09-07 Kevin Ollivier <kevino@theolliviers.com>
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
+ Create a PluginTest given the identifier. Remove the check for "testdocumentopenindestroystream".
- wx build fixes for wx SVN trunk.
+ (NPP_DestroyStream):
+ Call the plug-in test NPP_DestroyStream member function.
- * wx/build/settings.py:
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ Add PluginTest.cpp, PluginTest.h and Tests/DocumentOpenInDestroyStream.cpp.
-2009-09-04 Kevin Ollivier <kevino@theolliviers.com>
+2010-07-29 Martin Robinson <mrobinson@igalia.com>
- wx build fix. Switch USE_ defines over to the compiler so that they can be
- checked by files not including config.h (like WebCorePrefix.h).
+ Unreviewed build fix.
- * wx/build/settings.py:
+ Add missing second argument to assert_lint in new style checker tests.
-2009-09-04 Adam Barth <abarth@webkit.org>
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
- Unreviewed build fix.
+2010-07-29 Anders Carlsson <andersca@apple.com>
- Update declaration of FrameLoadDelegate to reflect that
- IWebFrameLoadDelegatePrivate2 inherits from
- IWebFrameLoadDelegatePrivate.
+ Reviewed by Adam Roben.
- * DumpRenderTree/win/FrameLoadDelegate.h:
+ check-webkit-style shouldn't complain about NPAPI functions
+ https://bugs.webkit.org/show_bug.cgi?id=43211
-2009-09-04 Adam Barth <abarth@webkit.org>
+ Allow underscores in functions that start with NPN_, NPP_ or NP_.
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
- https://bugs.webkit.org/show_bug.cgi?id=24696
+2010-07-29 Victor Wang <victorw@chromium.org>
- Add testing instrumentation for mixed content.
+ Unreviewed, rolling out r64270.
+ http://trac.webkit.org/changeset/64270
+ https://bugs.webkit.org/show_bug.cgi?id=39589
- * DumpRenderTree/mac/FrameLoadDelegate.mm:
- (-[FrameLoadDelegate webView:]):
- (-[FrameLoadDelegate webView:didRunInsecureContent:]):
- * DumpRenderTree/win/FrameLoadDelegate.cpp:
- (descriptionSuitableForTestResult):
- (FrameLoadDelegate::QueryInterface):
- (FrameLoadDelegate::didDisplayInsecureContent):
- (FrameLoadDelegate::didRunInsecureContent):
- * DumpRenderTree/win/FrameLoadDelegate.h:
+ The patch breaks chromium webkit unittest
-2009-09-03 Kevin Watters <kevinwatters@gmail.com>
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ * Scripts/build-webkit:
- Reviewed by Kevin Ollivier.
+2010-07-29 Antonio Gomes <tonikitoo@webkit.org>
- [wx] Frames support
- https://bugs.webkit.org/show_bug.cgi?id=19041
+ Reviewed by Kenneth Christiansen.
- * wx/build-wxwebkit:
+ [Qt] QtTestBrowser: Move WebPage class methods definitions from main.cpp to webpage.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=43199
-2009-09-02 David Kilzer <ddkilzer@apple.com>
+ There is no sense in keeping WebPage method definitions in main.cpp once
+ webpage.cpp already exists.
- <http://webkit.org/b/28880> svn-apply --force doesn't actually work
+ No behavior change.
- Reviewed by Eric Seidel.
+ * QtTestBrowser/main.cpp:
+ * QtTestBrowser/webpage.cpp:
+ (WebPage::createWindow):
+ (WebPage::createPlugin):
- This fixes "svn-apply --force" and adds unit tests for the
- scm.apply_patch() method which uses this script.
-
- * Scripts/svn-apply: Created $globalExitCode variable that
- defaults to 0. Exit with a value of $globalExitCode when the
- script is finished.
- (applyPatch): Ignore a non-zero $exitCode if $force is true, but
- set $globalExitCode to $exitCode so that svn-apply exits with a
- non-zero status if any patches did not apply cleanly. Also
- print out the actual patch command if $force was not true.
-
- * Scripts/modules/scm.py:
- (scripts_directory): Added. Extracted from script_path().
- (script_path): Extracted scripts_directory().
- * Scripts/modules/scm_unittest.py: Import urllib.
- (SVNTestRepository.setup): Save the original working directory
- in test_object since this represents the WebKit repository from
- where the unit tests are run.
- (SCMTest): Created new super class to hold utility methods.
- (SCMTest._create_patch): Creates a patch file on disk and a
- dictionary for use with scm.svn_apply().
- (SCMTest._setup_webkittools_scripts_symlink): Sets up a symlink
- back to WebKitTools/Scripts in the test repository so that
- scm.apply_patch() is able to find the svn-apply script.
- (SVNTest): Inherit from SCMTest instead of unittest.TestCase.
- (SVNTest.tearDown): Make sure to change directories back to the
- original_path before the next test.
- (SVNTest.test_apply_svn_patch): New test case for applying an
- svn patch with scm.apply_patch().
- (SVNTest.test_apply_svn_patch_force): New test case for applying
- an svn patch with scm.apply_patch() that conflicts.
- (GitTest): Inherit from SCMTest instead of unittest.TestCase.
- (GitTest.tearDown): Make sure to change directories back to the
- original_path before the next test.
- (GitTest.test_apply_git_patch): New test case for applying a git
- patch with scm.apply_patch().
- (GitTest.test_apply_git_patch_force): New test case for applying
- a git patch with scm.apply_patch() that conflicts.
-
-2009-09-02 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+2010-07-29 Antonio Gomes <tonikitoo@webkit.org>
- Reviewed by Mark Rowe.
+ Reviewed by Kenneth Christiansen.
- [Qt] Add support for platform-spesific layout-test results
+ [Qt] Factor out LauncherWindow class out of main.cpp (QtTestBrowser)
+ https://bugs.webkit.org/show_bug.cgi?id=43170
- For the Qt port we use the qt-[mac|linux|win] directories and then fall
- back to the generic qt directory for both test results and skipped list.
+ Moving LauncherWindow class out of main.cpp to its own .cpp and .h files:
+ launcherwindow.{cpp|h}
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
+ No behavior change.
-2009-09-02 Laurent Cerveau <lcerveau@me.com>
+ Also changed all global static variables (named "gXXX") from main.cpp to
+ static public variables of the LauncherWindow class.
- Reviewed by David Kilzer.
+ * QtTestBrowser/QtTestBrowser.pro:
+ * QtTestBrowser/launcherwindow.cpp: Added.
+ * QtTestBrowser/launcherwindow.h: Added.
+ * QtTestBrowser/main.cpp:
+ (LauncherApplication::handleUserOptions):
+ (main):
- <http://webkit.org/b/25517> build-webkit script should print build time at end
+2010-07-29 Martin Robinson <mrobinson@igalia.com>
- * Scripts/build-webkit:
- Added startTime and endTime variable so that the build time is computed and printed as
- part of the build message; display formatting has been separated in a dedicated subroutine.
+ Reviewed by Xan Lopez.
-2009-09-02 David Kilzer <ddkilzer@apple.com>
+ Build fix for building against GTK+ 3.x. GSEAL requires that we
+ access internals of the GdkDragContext via methods. For older versions
+ of GTK+, define those methods.
- <http://webkit.org/b/28881> svn-create-patch should check if the repo path is the same when trying to find the root
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (gdk_drag_context_get_selected_action): Added.
+ (gdk_drag_context_get_actions): Added.
+ (dispatchEvent): Use the two new accessor methods.
- Reviewed by Eric Seidel.
+2010-07-29 Adam Roben <aroben@apple.com>
- * Scripts/VCSUtils.pm:
- (determineSvnRoot): Added back check for repository root that
- was removed in r46134 when this code lived in svn-create-patch.
- It's necessary to check both the repository root and the
- repository UUID in case two different working directories are
- checked out from the same repository.
+ Always say "plugins directory" when referring to a directory
+ containing one or more plugins
-2009-09-02 Timothy Hatcher <timothy@apple.com>
+ Fixes <http://webkit.org/b/43197> WebKit2 often says "plugin
+ directory" when it means "plugins directory"
- Use new 512x512 icons for nightly builds.
+ Reviewed by John Sullivan.
- Rubber-stamped by Mark Rowe.
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize): Updated for rename.
- * WebKitLauncher/webkit.icns:
+2010-07-29 Adam Roben <aroben@apple.com>
-2009-09-02 Kevin Ollivier <kevino@theolliviers.com>
+ Always say "directory" when referring to a plugin directory
- waf build fix. Remove local variable shadowing global.
+ Fixes <http://webkit.org/b/43195> WebKit2 often says "plugin path"
+ when it means "plugin directory"
- * wx/build/settings.py:
+ Reviewed by John Sullivan.
-2009-09-02 Zan Dobersek <zandobersek@gmail.com>
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize): Updated for renames.
- Reviewed by David Kilzer.
+ * WebKitTestRunner/TestController.h: Renamed m_testPluginPath to
+ m_testPluginDirectory.
+ (WTR::TestController::testPluginDirectory): Renamed from
+ testPluginPath.
- Calls exitStatus function from the main package where it is also defined.
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::initializeTestPluginDirectory):
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::initializeTestPluginDirectory):
+ Renamed from initializeTestPluginPath and updated for rename.
- * Scripts/VCSUtils.pm:
+2010-07-29 Csaba Osztrogonác <ossy@webkit.org>
-2009-09-02 Kevin Ollivier <kevino@theolliviers.com>
+ Reviewed by Antonio Gomes.
- waf build fixes for Windows/MSVC and Mac/Snow Leopard.
+ Initialize all members of NPClass struct.
+ https://bugs.webkit.org/show_bug.cgi?id=43193
- * wx/browser/wscript:
- * wx/build/build_utils.py:
- * wx/build/settings.py:
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
-2009-08-10 Kevin Ollivier <kevino@theolliviers.com>
+2010-07-29 Csaba Osztrogonác <ossy@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Antonio Gomes.
- Changes needed for build-webkit to support the waf build system for the wx port.
-
- https://bugs.webkit.org/show_bug.cgi?id=27619
+ Warning fix on platforms where XP_MACOSX is undefined.
+ https://bugs.webkit.org/show_bug.cgi?id=43192
- * Scripts/build-webkit:
- * Scripts/run-launcher:
- * Scripts/webkitdirs.pm:
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+ Use #if defined(XP_MACOSX) instead of #if XP_MACOSX .
-2009-09-02 David Kilzer <ddkilzer@apple.com>
+2010-07-29 Adam Roben <aroben@apple.com>
- <http://webkit.org/b/27168> With Subversion 1.6, update-webkit prompts on conflicts
+ Give find-included-framework-headers our standard license
- Reviewed by Eric Seidel.
+ * Scripts/find-included-framework-headers: Used the license from
+ WebCore/LICENSE-APPLE.
- * Scripts/update-webkit: Added "--accept postpone" to
- @svnOptions when running with svn-1.6 or newer.
+2010-07-29 Adam Roben <aroben@apple.com>
-2009-09-02 David Kilzer <ddkilzer@apple.com>
+ Speed up find-included-framework-headers
- Moved svn 1.6 version check into VCSUtils::isSVNVersion16OrNewer()
+ We only do one invocation of find now, no longer pipe to grep, and
+ replace uniq with sort -u.
- Reviewed by Eric Seidel.
+ Also added a license header.
- * Scripts/VCSUtils.pm:
- (@EXPORT): Added &isSVNVersion16OrNewer.
- (svnVersion): Added. Internal method that gets the SVN version
- and caches it.
- (isSVNVersion16OrNewer): Added. Method that does the SVN 1.6
- version check.
- * Scripts/prepare-ChangeLog: Switched to use new
- isSVNVersion16OrNewer() method.
- * Scripts/resolve-ChangeLogs: Ditto.
- * Scripts/svn-create-patch: Ditto.
+ * Scripts/find-included-framework-headers:
-2009-09-02 David Kilzer <ddkilzer@apple.com>
+2010-07-29 Steve Block <steveblock@google.com>
- Clean up VCSUtils.pm
+ Reviewed by Jeremy Orlow.
- Reviewed by Eric Seidel.
+ Add LayoutTestController methods to test DeviceOrientation
+ https://bugs.webkit.org/show_bug.cgi?id=39589
- * Scripts/VCSUtils.pm: Added proper package statement. Fixed
- indentation of BEGIN block. Listed each exported method on a
- line by itself. Added methods to the export list after adding
- the package statement. Sorted module variables. Moved
- definiton of $gitRoot next to other module variables.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setMockDeviceOrientationCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockDeviceOrientation):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setMockDeviceOrientation):
+ * Scripts/build-webkit:
-2009-09-01 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+2010-07-28 Kenichi Ishibashi <bashi@google.com>
- Rubber-stamped by Simon Hausmann.
+ Reviewed by Shinichiro Hamaji.
- [Qt] Fix layout-test plugins/plugin-javascript-access.html
+ Fixed <https://bugs.webkit.org/show_bug.cgi?id=33814>
+ check-webkit-style gives false positives in single-line functions.
- * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
-2009-09-02 Shinichiro Hamaji <hamaji@chromium.org>
+2010-07-28 Darin Adler <darin@apple.com>
- Reviewed by Eric Seidel.
+ Reviewed by Sam Weinig.
- js tests should move into jstests subdirectory instead of resources/
- https://bugs.webkit.org/show_bug.cgi?id=25880
+ WebKitTestRunner needs to support layoutTestController.execCommand
+ <https://bugs.webkit.org/show_bug.cgi?id=42538>
- make-script-wrappers supports both resources and script-tests directories.
- run-webkit-tests ignores files in script-tests.
- Move script tests of animations to check the new script is working.
+ WebKitTestRunner needs layoutTestController.isCommandEnabled
+ <https://bugs.webkit.org/show_bug.cgi?id=42671>
- * Scripts/make-script-test-wrappers:
- * Scripts/run-webkit-tests:
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added execCommand and isCommandEnabled.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::execCommand): Added.
+ (WTR::LayoutTestController::isCommandEnabled): Added.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Ditto.
-2009-09-02 Szabo Carol <carol.szabo@nokia.com>
+2010-07-28 Kent Tamura <tkent@chromium.org>
- Reviewed by David Levin.
+ Reviewed by Dimitri Glazkov.
- check-webkit-style uses python from /usr/bin instead of the PATH
- https://bugs.webkit.org/show_bug.cgi?id=28225
+ [DRT/Chromium] Introduce drt_expectations.txt for NRWT
+ https://bugs.webkit.org/show_bug.cgi?id=43123
- * Scripts/bugzilla-tool:
- * Scripts/check-webkit-style:
- * Scripts/run-webkit-unittests:
- * Scripts/update-sources-list.py:
- Changed the first line from
- #!/usr/bin/python
- to
- #!/usr/bin/env python
- which causes python to be invoked from the path location returned
- by "which python" when any of these scripts are launched.
- these are currently all the python scripts in WebKitTools/Scripts.
+ Introduce LayoutTests/platform/chromium/drt_expectations.txt,
+ which overrides test expectations only for DumpRenderTree, in
+ order to manage what problems are investigated.
+ This change will be reverted when we switch to DRT completely.
-2009-09-01 David Kilzer <ddkilzer@apple.com>
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ Add drt_expectations.txt content to the result of
+ test_expectations_overrides() if --use-drt is specified.
- <http://webkit.org/b/28601> bugzilla-tool post-commits posts commits backwards
+2010-07-28 Brady Eidson <beidson@apple.com>
- Reviewed by Adam Barth.
+ Reviewed by Darin Adler.
- * Scripts/modules/scm.py:
- (Git.commit_ids_from_commitish_arguments): Reverse the list of
- commits returned from git-rev-list since we always want to post
- the oldest patches first to bugs.webkit.org.
- * Scripts/modules/scm_unittest.py:
- (run): Added return statement to return the output now that we
- want it sometimes.
- (SVNTestRepository._setup_test_commits): Added a fourth commit
- so the GitTest.test_commitish_order() test has more commits to
- work with.
- (GitTest.test_commitish_order): Added unit test for change to
- Git.commit_ids_from_commitish_arguments() in scm.py.
+ First pass at visited link support for WK2
+ https://bugs.webkit.org/show_bug.cgi?id=43157
-2009-09-01 David Kilzer <ddkilzer@apple.com>
+ * MiniBrowser/mac/AppDelegate.m:
+ (didNavigateWithNavigationData):
+ (didPerformClientRedirect):
+ (didPerformServerRedirect):
+ (didUpdateHistoryTitle):
+ (populateVisitedLinks): Added for the new version of the HistoryClient.
+ (-[BrowserAppDelegate init]): Set the HistoryClient right after creating the context(s)
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
- <http://webkit.org/b/28877> Implement bugzilla-tool mark-fixed
+2010-07-28 Robin Dunn <robin@alldunn.com>
- Reviewed by David Levin.
+ Reviewed by Kevin Ollivier.
- The mark-fixed subcommand is for those times when you don't use
- bugzilla-tool to commit a patch, but you want to use it to close
- the bug with a committed-revision message.
-
- * Scripts/bugzilla-tool:
- (bug_comment_from_svn_revision): Added. Extracted from
- bug_comment_from_commit_text().
- (bug_comment_from_commit_text): Extracted
- bug_comment_from_svn_revision() from this method.
- (MarkBugFixed.__init__): Added.
- (MarkBugFixed._fetch_commit_log): Added. Retrieves the commit
- log from the last commit if no svn revision is specified, else
- the commit log for the specified svn revision.
- (MarkBugFixed._determine_bug_id_and_svn_revision): Added.
- Attempts to determine the bug id and svn revision if one or both
- were not defined on the command line.
- (MarkBugFixed.execute): Added. Adds a comment about the
- revision that fixed the bug and closes the bug.
- (BugzillaTool.__init__): Added mark-fixed subcommand.
- * Scripts/modules/bugzilla.py:
- (Bugzilla.fetch_title_from_bug): Added. Returns the title of a
- bug given a bug id.
- * Scripts/modules/scm.py:
- (SCM.strip_r_from_svn_revision): Added. Utility method to strip
- the leading 'r' from an svn revision.
- (SCM.svn_commit_log): Added. Subclasses must override.
- (SCM.last_svn_commit_log): Added. Subclasses must override.
- (SVN.svn_commit_log): Added. Returns svn log for a given
- revision.
- (SVN.last_svn_commit_log): Added. Uses svnversion to find the
- last commit in an svn working directory and then runs svn log.
- (Git.svn_commit_log): Added. Returns svn log for a given
- revision.
- (Git.last_svn_commit_log): Added. Runs git-svn-log with a limit
- of one log message.
-
-2009-09-01 David Kilzer <ddkilzer@apple.com>
-
- <http://webkit.org/b/28880> svn-apply --force doesn't actually work
+ Add DOM bindings support for wx port.
- Reviewed by Brady Eidson.
+ * DumpRenderTree/wscript:
+ * wx/browser/wscript:
+ * wx/build/settings.py:
- * Scripts/svn-apply:
- (applyPatch): Add "--force" to $options arrayref if $force is
- set.
+2010-07-28 Tony Chang <tony@chromium.org>
-2009-09-01 David Kilzer <ddkilzer@apple.com>
+ Reviewed by Kent Tamura.
- <http://webkit.org/b/28725> resolve-ChangeLogs: determineVCSRoot() returns incorrect repository root during git filter-branch
+ [chromium] cleanup temp files left by Linux DRT
+ https://bugs.webkit.org/show_bug.cgi?id=43062
- Reviewed by Adam Roben.
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Rename the chromium bots to include the OS
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: add a step on chromium-linux to delete temp files left
+ by crashed DRTs
- When git-filter-branch has been invoked to rewrite ChangeLog
- files on series of git commits, it changes directories into
- .git-rewrite/t before re-running resolve-ChangeLogs. This
- causes determineVCSRoot() in VCSUtils.pm to return
- ".git-rewrite/t", which causes that path to be prepended to all
- ChangeLog paths, which results in an error like this:
+2010-07-28 Antonio Gomes <tonikitoo@webkit.org>
- error: pathspec '.git-rewrite/t/ChangeLog' did not match any file(s) known to git.
- Died at WebKitTools/Scripts/resolve-ChangeLogs line 376.
+ Rubber-stamped by Kenneth Christiansen.
- The correct way to fix this is not to try to find the repository
- root when invoked by git-filter-branch.
+ More Developer menu items reordering.
- * Scripts/resolve-ChangeLogs: If isInGitFilterBranch() is true,
- set $relativePath to '.' instead of calling
- chdirReturningRelativePath(determineVCSRoot()).
- (isInGitFilterBranch): Added. Checks for the existence of the
- MAPPED_PREVIOUS_COMMIT environment variable.
+ Grouping related menu items together, visually and logically (in the code).
-2009-09-01 Xan Lopez <xlopez@igalia.com>
+ No behavior change.
- Reviewed by Gustavo Noronha.
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::createChrome):
- Add support for Fedora distros in the http tests
- https://bugs.webkit.org/show_bug.cgi?id=28263
+2010-07-27 Kinuko Yasuda <kinuko@chromium.org>
- Add detection code for Fedora distribution, and use the proper
- httpd conf file when needed.
+ Reviewed by Ojan Vafai.
- * Scripts/run-webkit-httpd:
- * Scripts/run-webkit-tests:
- * Scripts/webkitdirs.pm:
+ Add FILE_SYSTEM build flag for FileSystem API
+ https://bugs.webkit.org/show_bug.cgi?id=42915
-2009-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
+ * Scripts/build-webkit:
- Reviewed by Eric Seidel.
+2010-07-27 Martin Robinson <mrobinson@igalia.com>
- [Gtk] DRT needs implementation of overridePreference
- https://bugs.webkit.org/show_bug.cgi?id=28830
+ Reviewed by David Levin.
- Implement overridePreference.
+ Stylebot should not complain about NULL usage in calls to gdk_pixbuf_save_to
+ https://bugs.webkit.org/show_bug.cgi?id=43090
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
- (setDefaultsToConsistentStateValuesForTesting):
- (runTest):
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (toWebSettingKey):
- (LayoutTestController::overridePreference):
+ * Scripts/webkitpy/style/checkers/cpp.py: Add exemption for some GdkPixbuf methods.
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py: Added some tests for this behavior.
-2009-09-01 Joseph Pecoraro <joepeck@webkit.org>
+2010-07-27 Kent Tamura <tkent@chromium.org>
- <http://webkit.org/b/28623> svn-[un]apply should change directories to the repository root before [un]applying
+ Unreviewed, trivial typo fix.
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ Fix a wrong method name committed by r64109.
- Jump back and forth between the repository root directory (to apply) and the
- directory the script was run from (to find the patch).
+2010-07-27 Sam Weinig <sam@webkit.org>
- * Scripts/svn-apply:
- * Scripts/svn-unapply:
+ Reviewed by Anders Carlsson.
-2009-08-31 Adam Roben <aroben@apple.com>
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=43087
+ Clean up handling of strings at the WebKit2 API layer.
- Fall back to a Release version of Safari if a Debug one doesn't exist
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (runJavaScriptAlert):
+ (runJavaScriptConfirm):
+ (runJavaScriptPrompt):
+ (didNavigateWithNavigationData):
+ (-[BrowserWindowController updateProvisionalURLForFrame:]):
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didClearWindowForFrame):
- <http://webkit.org/b/28849>
+2010-07-27 Ojan Vafai <ojan@chromium.org>
- Reviewed by Sam Weinig.
+ Reviewed by Eric Seidel.
- * Scripts/webkitdirs.pm:
- (safariPath): If the user is working with a Debug build, but there's
- no Debug version of Safari present, fall back to using a Release
- version of Safari.
+ webkit-patch post-commits is broken: AttributeError: Values instance has no attribute 'no_squash'
+ https://bugs.webkit.org/show_bug.cgi?id=42984
-2009-08-31 Adam Roben <aroben@apple.com>
+ squash and no_squash have been intentionally erroring for a couple weeks now.
+ But post-commits was just broken. Just remove squash/no_squash.
- Make safariPath() work for Debug builds of Safari on Windows
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/options.py:
- <http://webkit.org/b/28849>
+2010-07-27 Kevin Ollivier <kevino@theolliviers.com>
- Reviewed by Sam Weinig.
+ [wx] Build fix after introduction of EXECUTABLE_ALLOCATOR_DEMAND.
- * Scripts/webkitdirs.pm:
- (safariPath): If the user is working with a Debug build, add the
- _debug suffix to Safari.exe.
+ * wx/build/settings.py:
-2009-08-28 Eric Seidel <eric@webkit.org>
+2010-07-27 Adam Roben <aroben@apple.com>
- Reviewed by Adam Barth.
+ Mac build fix
- commit-queue needs a master process
- https://bugs.webkit.org/show_bug.cgi?id=28040
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (processDidExit):
+ (-[BrowserWindowController awakeFromNib]):
+ Added processDidExit support.
- Add a bugzilla-tool commit-queue command
- Keeps per-bug logs, but doesn't yet upload them anywhere.
+2010-07-26 Antonio Gomes <tonikitoo@webkit.org>
- * Scripts/bugzilla-tool: Add LandPatchesFromCommitQueue to handle 'commit-queue'
- * Scripts/modules/buildbot.py: remove noisy log message
- * Scripts/modules/logging.py: add a 'tee()' call for splitting outputs in python
+ Rubber-stamped by Simon Hausmann.
-2009-08-28 Jan Michael Alonzo <jmalonzo@webkit.org>
+ [Qt] Reorder some items in Developers' menu so QGraphicsView one is easier accessible.
- Reviewed by Gustavo Noronha.
+ Move some less useful menu items on Developers menu from the top to the bottom, so
+ QGraphicsView menu goes to the top, and becomes more quickly accessible.
- [GTK] Geolocation needs permission API before being enabled by default
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::createChrome):
- Build the Gtk port with geolocation enabled. This option is only
- enabled for the buildbot. The autotools option will be enabled by
- default once the permissions API is implemented.
+2010-07-26 Adam Roben <aroben@apple.com>
- * Scripts/build-webkit:
+ Fix the path to InjectedBundle.dll in Debug_Internal builds
-2009-08-26 Cameron McCormack <cam@mcc.id.au>
+ Fixes <http://webkit.org/b/42994> WebKitTestRunner fails to load
+ InjectedBundle.dll in the Debug_Internal configuration
- Reviewed by David Kilzer.
+ Reviewed by Anders Carlsson.
- Make prepare-ChangeLog notice property changes
- https://bugs.webkit.org/show_bug.cgi?id=28675
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::initializeInjectedBundlePath): Add the _debug
+ suffix only in Debug_All builds.
- Make the generated ChangeLog entry include a short description of
- property changes if there were such changes. Also make
- prepare-ChangeLog not bail if the only changes are property changes.
+2010-07-25 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
- * Scripts/prepare-ChangeLog:
+ Reviewed by Darin Adler.
-2009-08-26 Adam Barth <abarth@webkit.org>
+ https://bugs.webkit.org/show_bug.cgi?id=42947
+ Check for WEBKIT_TESTFONTS for qt, gtk and windows port and throw
+ error. Without which dumpRenderTree crashes.
- Reviewed by Oliver Hunt.
+ * Scripts/old-run-webkit-tests:
- Don't let local files access web URLs
- https://bugs.webkit.org/show_bug.cgi?id=28480
+2010-07-27 Kent Tamura <tkent@chromium.org>
- A bunch of our LayoutTests rely on our old behavior, so we explicitly
- grant local files universal access during testing. Mainly, these tests
- involve making XMLHttpRequests for data URLs.
+ Reviewed by Dimitri Glazkov.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+ https://bugs.webkit.org/show_bug.cgi?id=42956
+ [DRT/Chromium] Fix "out of sync" assertion error
-2009-08-26 John Gregg <johnnyg@google.com>
+ Fix an assertion error on Windows like the following:
+ 100721 20:16:46 chromium.py:386 CRITICAL Test got out of sync:
+ |file:///c:/WebKitBuildSlave2/chromium-win-release-tests/build/LayoutTests/http/tests/local/blob/send-data-blob.html|
+ |file:///C:/WebKitBuildSlave2/chromium-win-release-tests/build/LayoutTests/http/tests/local/blob/send-data-blob.html|
- Reviewed by David Levin.
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ If the url matches with "file:///[a-z]:", does case-ignore comparison.
+ GURL capitalize the driver letter of a file: URL.
- Minor style correction and include fix for notifications
- https://bugs.webkit.org/show_bug.cgi?id=28745
+2010-07-26 Darin Adler <darin@apple.com>
- * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
- change to correct EnumStyle
- (DRTDesktopNotificationPresenter::checkNotificationPermission):
+ Reviewed by Sam Weinig.
-2009-08-26 David Levin <levin@chromium.org>
+ WebKitTestRunner needs to support layoutTestController.counterValueForElementById
+ https://bugs.webkit.org/show_bug.cgi?id=42537
+
+ WebKitTestRunner needs layoutTestController.markerTextForListItem
+ https://bugs.webkit.org/show_bug.cgi?id=42549
+
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+ Fixed _paramterExpression typo. Improved support for string type as a
+ return value, so we don't try to include DOMString.h and we can convert
+ the string to a JSValue by calling JSValueMakeStringOrNull.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h:
+ Added JSValueMakeStringOrNull, used by the code generator.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added counterValueForElementById and markerTextForListItem.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ Moved constant to the top of the file.
+ (WTR::toCF): Added. Converts strings to CFStringRef.
+ (WTR::toWK): Added. Converts strings to WKStringRef.
+ (WTR::toJS): Added. Converts strings to JSStringRef.
+ (WTR::setProperty): Moved this function to the top of the file
+ rather than having it down where it's used inside the class. Also
+ renamed it so it's a separate function rather than an overload of
+ JSObjectSetProperty.
+ (WTR::propertyValue): Copied this here from InjectedBundlePage.cpp.
+ Should move it somewhere we can share it.
+ (WTR::propertyObject): Ditto.
+ (WTR::getElementById): Added. Calls getElementById through the magic
+ of JavaScript.
+ (WTR::LayoutTestController::pauseAnimationAtTimeOnElementWithId):
+ Chagned to use toWK instead of four local variables.
+ (WTR::LayoutTestController::counterValueForElementById): Added.
+ Calls WKBundleFrameCopyCounterValue.
+ (WTR::LayoutTestController::markerTextForListItem): Added.
+ Calls WKBundleFrameCopyMarkerText.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ Added counterValueForElementById and markerTextForListItem.
+
+2010-07-26 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Alexey Proskuryakov.
+ Reviewed by Gustavo Noronha Silva.
- XMLHttpRequest.withCredentials=false shouldn't save cookies.
- https://bugs.webkit.org/show_bug.cgi?id=28743
+ [GTK] The EventSender should support simulating drop events
+ https://bugs.webkit.org/show_bug.cgi?id=39844
- Added the support to the layout test controller on OSX and
- Windows (for CFNETWORK) to allow for changing the accept cookie
- policy.
+ Add initial dropping support to the GTK+ EventSender.
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::LayoutTestController): Added a bool
- to track the state of accepting cookies.
- (setAlwaysAcceptCookiesCallback): Standard wrapper method
- to go from js to a C++ method.
- (LayoutTestController::staticFunctions): Added the
- setAlwaysAcceptCookies method to the js layoutTestController.
- * DumpRenderTree/LayoutTestController.h:
- (LayoutTestController::alwaysAcceptCookies): Returns the value.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setAlwaysAcceptCookies): Stub out method.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues): Reset the accept cookie to
- its default.
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::setAlwaysAcceptCookies): Does the work for
- OSX to change the cookie accept policy.
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (setAlwaysAcceptCookies): Method to handle all the calls necessary
- to change the accept cookie policy on Windows.
- (resetDefaultsToConsistentValues): Reset the accept cookie to
- its default.
- * DumpRenderTree/win/DumpRenderTreeWin.h:
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setAlwaysAcceptCookies): Stub out method.
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::setAlwaysAcceptCookies): Stub out method.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (createWebView): Listen for some new drag-and-drop signals.
+ * DumpRenderTree/gtk/EventSender.cpp: Add currentDragSourceContext.
+ (dispatchEvent):
+ Detect situations where a drag is either starting or ending and massage
+ GTK+ into sending the appropriate signals to the WebView.
+ (replaySavedEvents): Remove comment.
+ (makeEventSender): Clear the currentDragSourceContext when creating a new EventSender.
+ (dragBeginCallback): Capture the new currentDragSourceContext when a drag begins.
+ (dragEndCallback): Clear the currentDragSourceContext when a drag ends.
+ (dragFailedCallback): Disable the GTK+ drag failed animation.
+ * DumpRenderTree/gtk/EventSender.h: Add declarations for new signal callbacks.
+
+2010-07-26 Daniel Bates <dbates@rim.com>
-2009-08-26 Dimitri Glazkov <dglazkov@chromium.org>
+ Reviewed by Darin Adler.
- Unreviewed.
+ svn-unapply warns of uninitialized variable when unapplying
+ a patch that describes an svn move operation
+ https://bugs.webkit.org/show_bug.cgi?id=42036
- Remove accidentally left in clobber option.
- https://bugs.webkit.org/show_bug.cgi?id=28400
+ Fixes Perl uninitialized variable warnings when un-applying
+ a patch that moves a file.
- * BuildSlaveSupport/build.webkit.org-config/master.cfg: Removed clobber option.
+ * Scripts/svn-unapply:
+ - Modified patch() so that it initializes $patch to the empty
+ string when we don't have svnConvertedText (such as when
+ reversing a diff that represents a svn copy/move operation).
-2009-08-26 Dimitri Glazkov <dglazkov@chromium.org>
+2010-07-26 Sam Weinig <sam@webkit.org>
- Reviewed by Mark Rowe.
+ Reviewed by Anders Carlsson.
- Add canary-style Chromium WebKit build slave to the waterfall.
- https://bugs.webkit.org/show_bug.cgi?id=28400
+ Move some non-APIish functions into private headers.
- * BuildSlaveSupport/build.webkit.org-config/config.json: Added one Chromium/Windows slave
- * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added support for Chromium slave commands.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
-2009-08-25 Cameron McCormack <cam@mcc.id.au>
+2010-07-26 Sam Weinig <sam@webkit.org>
- Reviewed by Darin Adler.
+ Reviewed by Anders Carlsson.
- make-script-test-wrappers should be executable
- https://bugs.webkit.org/show_bug.cgi?id=28669
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=42986
+ Add prompt and confirm client functions to WebKit2
- Make make-script-test-wrappers and update-sources-list.py both be
- executable.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController awakeFromNib]):
- * Scripts/update-sources-list.py:
- * Scripts/make-script-test-wrappers:
+2010-07-26 Adam Roben <aroben@apple.com>
-2009-08-25 Brent Fulgham <bfulgham@webkit.org>
+ Windows build fix
- Build fix
+ * MiniBrowser/MiniBrowser.vcproj:
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj:
+ Removed empty attributes so the values will be picked up from the
+ vsprops files. (Also removed a couple of attributes that accidentally
+ duplicated values from the vsprops files.)
- Revise Debug_Cairo targets to point inherit from the
- debug_wincairo.vsprops property sheet so that they link
- against the proper libraries in Debug build.
+2010-07-26 Brian Weinstein <bweinstein@apple.com>
- * DumpRenderTree/win/DumpRenderTree.vcproj:
- * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
- * WinLauncher/WinLauncher.vcproj:
+ Rubber-stamped by Adam Roben.
+
+ Touch MiniBrowser's stdafx to fix the build.
-2009-08-25 David Levin <levin@chromium.org>
+ * MiniBrowser/win/stdafx.h:
- Reviewed by Adam Roben.
+2010-07-26 Hayato Ito <hayato@chromium.org>
- PLATFORM(CFNETWORK) should be USE(CFNETWORK).
- https://bugs.webkit.org/show_bug.cgi?id=28713
+ Reviewed by Shinichiro Hamaji.
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (main):
+ Add pretty printer of WTF::Vector for GDB 7.
-2009-08-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ https://bugs.webkit.org/show_bug.cgi?id=40909
- Reviewed by Ariya Hidayat.
+ * gdb/wtf.py: Added.
- [Qt/Mac] Use CONFIG+=build_all only when building libraries
+2010-07-26 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
- If no configuration is specified when building WebKit we pass the
- debug_and_release option to QMake which results in Makefiles for
- both configurations being generated.
+ Reviewed by Simon Hausmann.
- Previously we built both of these configurations by default, for
- all targets (both the QtWebKit framework/dyldlib and the various
- executables such as QtLauncher and tests). This makes sense for
- the libraries, which get the _debug suffix and can be loaded on
- demand by setting the DYLD_IMAGE_SUFFIX, but for executables we
- ended up building the same executable twice.
+ [Qt] Fix feature detection regexp
- We now only build one instance of each executable, and since this
- is a developer build we build the debug-version. Passing either
- --debug or --release to build-webkit will override this, and
- even in the default case the release version can still be built
- by running 'make release' in the the build directory of each
- target.
+ We were missing the last feature
- * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
* Scripts/webkitdirs.pm:
-2009-08-24 Hironori Bono <hbono@chromium.org>
+2010-07-25 Darin Adler <darin@apple.com>
- Reviewed by Adam Barth.
+ Reviewed by Dan Bernstein.
- Fix Bug 27827 "[Chromium] Functions Keys don't work in google spreadsheet".
- <https://bugs.webkit.org/show_bug.cgi?id=27827>.
+ WebKitTestRunner needs to support layoutTestController.dumpSelectionRect
+ https://bugs.webkit.org/show_bug.cgi?id=42326
- Because of the lack of mappings from GDK key-codes to WebKit key-codes,
- Chromium cannot send valid key-codes to JavaScript when a user types
- function keys. This change just copies the mappings from 'KeyEventGtk.cpp'.
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added dumpSelectionRect.
- To write layout tests for this issue, added mappings from function-key
- names to platform-specific key-codes to EventSendingController objects
- so that eventSender.keyDown() can send function-key events without using
- platform-specific key codes. (Unfortunately, this eventSender.keyDown() change
- is only for Mac. So this change adds this new test to Skipped tests for other
- platforms to prevent this change from crashing the build trees.)
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpSelectionRect): Added. For now, this
+ does nothing because its purpose is to change pixel test output and
+ we do not have pixel tests implemented yet.
- * DumpRenderTree/mac/EventSendingController.mm:
- (-[EventSendingController keyDown:withModifiers:]):
+2010-07-25 Darin Adler <darin@apple.com>
-2009-08-23 Jan Michael Alonzo <jmalonzo@webkit.org>
+ Reviewed by Maciej Stachowiak.
- Reviewed by Xan Lopez.
+ WebKitTestRunner needs to support layoutTestController.keepWebHistory
+ https://bugs.webkit.org/show_bug.cgi?id=42323
+
+ Added keepWebHistory and computedStyleIncludingVisitedInfo.
+
+ Also fixed misspellings of the word "receive".
+
+ Also tweaked the names of some of the LayoutTestController members.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm:
+ Added support for a type named "object" that is passed and returns as
+ a JSValueRef.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added keepWebHistory and computedStyleIncludingVisitedInfo. Also
+ put setAcceptsEditing up nearer the top.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::_didReceiveMessage): Fixed mispellings of receive.
+ (WTR::InjectedBundle::initialize): Ditto.
+ (WTR::InjectedBundle::didReceiveMessage): Ditto.
+ (WTR::InjectedBundle::reset): Reset the state of visited links between
+ tests. Also eliminated the unused argument to the LayoutTestController
+ create function.
+ (WTR::InjectedBundle::setShouldTrackVisitedLinks): Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Ditto.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::shouldBeginEditing): Call shouldAllowEditing
+ instead of acceptsEditing.
+ (WTR::InjectedBundlePage::shouldEndEditing): Ditto.
+ (WTR::InjectedBundlePage::shouldInsertNode): Ditto.
+ (WTR::InjectedBundlePage::shouldInsertText): Ditto.
+ (WTR::InjectedBundlePage::shouldDeleteRange): Ditto.
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange): Ditto.
+ (WTR::InjectedBundlePage::shouldApplyStyle): Ditto.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::create): Removed uneeded argument.
+ (WTR::LayoutTestController::LayoutTestController): Removed unneeded
+ argument. Updated for rename of m_acceptsEditing to m_shouldAllowEditing.
+ (WTR::LayoutTestController::numberOfActiveAnimations): Added some FIXMEs
+ about the fact that this works on the main frame.
+ (WTR::LayoutTestController::pauseAnimationAtTimeOnElementWithId): Ditto.
+ (WTR::LayoutTestController::keepWebHistory): Added.
+ (WTR::LayoutTestController::computedStyleIncludingVisitedInfo): Added.
+ (WTR::JSObjectSetProperty): Added. Helper to make the function below
+ cleaner.
+ (WTR::LayoutTestController::makeWindowObject): Changed to use the
+ overload of JSObjectSetProperty above.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Changes to
+ match above.
+
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize): Fixed mispellings of receive.
+ (WTR::TestController::_didReceiveMessageFromInjectedBundle): Ditto.
+ (WTR::TestController::didReceiveMessageFromInjectedBundle): Ditto.
+ * WebKitTestRunner/TestController.h: Ditto.
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): Ditto.
+ * WebKitTestRunner/TestInvocation.h: Ditto.
+
+2010-07-25 Alexey Proskuryakov <ap@apple.com>
- [Gtk] API for disabling local file access to web URLs
- https://bugs.webkit.org/show_bug.cgi?id=28663
+ Reviewed by Sam Weinig.
- Enable this setting for DRT.
+ https://bugs.webkit.org/show_bug.cgi?id=42193
+ Support layoutTestController.dumpEditingDelegates in WebKitTestRunner
+
+ Step 2 - add the rest of editing delegates.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::operator<<): Fixed to not crash when range is null.
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::_shouldEndEditing):
+ (WTR::InjectedBundlePage::_shouldInsertNode):
+ (WTR::InjectedBundlePage::_shouldInsertText):
+ (WTR::InjectedBundlePage::_shouldDeleteRange):
+ (WTR::InjectedBundlePage::_shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::_shouldApplyStyle):
+ (WTR::InjectedBundlePage::_didBeginEditing):
+ (WTR::InjectedBundlePage::_didEndEditing):
+ (WTR::InjectedBundlePage::_didChange):
+ (WTR::InjectedBundlePage::_didChangeSelection):
+ (WTR::InjectedBundlePage::shouldEndEditing):
+ (WTR::InjectedBundlePage::shouldInsertNode):
+ (WTR::InjectedBundlePage::shouldInsertText):
+ (WTR::InjectedBundlePage::shouldDeleteRange):
+ (WTR::InjectedBundlePage::shouldChangeSelectedRange):
+ (WTR::InjectedBundlePage::shouldApplyStyle):
+ (WTR::InjectedBundlePage::didBeginEditing):
+ (WTR::InjectedBundlePage::didEndEditing):
+ (WTR::InjectedBundlePage::didChange):
+ (WTR::InjectedBundlePage::didChangeSelection):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+
+2010-07-24 Chris Fleizach <cfleizach@apple.com>
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting):
+ Reviewed by David Kilzer.
-2009-08-22 Adam Barth <abarth@webkit.org>
+ AX: need a layout test testing misspelled words in attributed strings
+ https://bugs.webkit.org/show_bug.cgi?id=42899
- Revert 47684. We're going to do this later once clients have had a
- chance to opt into the setting they like.
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (attributedStringForRangeCallback):
+ (attributedStringRangeIsMisspelledCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::attributedStringForRange):
+ (AccessibilityUIElement::attributedStringRangeIsMisspelled):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::attributedStringForRange):
+ (AccessibilityUIElement::attributedStringRangeIsMisspelled):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::attributedStringForRange):
+ (AccessibilityUIElement::attributedStringRangeIsMisspelled):
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+2010-07-23 David Kilzer <ddkilzer@apple.com>
-2009-08-22 Adam Barth <abarth@webkit.org>
+ <http://webkit.org/b/42911> Update ruby tools to work with shallow framework bundles
- Reviewed by Eric Seidel.
+ Reviewed by Mark Rowe.
- Don't let local files access web URLs
- https://bugs.webkit.org/show_bug.cgi?id=28480
+ * Scripts/check-for-inappropriate-files-in-framework: Added
+ check for the SHALLOW_BUNDLE environment variable so that the
+ script will work with iOS WebKit builds.
+ * Scripts/check-for-webkit-framework-include-consistency: Ditto.
- A bunch of our LayoutTests rely on our old behavior, so we explicitly
- grant local files universal access during testing. Mainly, these tests
- involve making XMLHttpRequests for data URLs.
+2010-07-22 Darin Adler <darin@apple.com>
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetDefaultsToConsistentValues):
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues):
+ Reviewed by Sam Weinig.
-2009-08-22 Mark Rowe <mrowe@apple.com>
+ Eliminate unneeded WKBundleFrameCopyInnerText function from WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=42847
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::operator<<): Replaced the WKStringToUTF8 function with
+ a set of overloaded stream operators.
+ (WTR::dumpPath): Changed to use ostringstream and return a string.
+ (WTR::propertyValue): Added.
+ (WTR::propertyObject): Added.
+ (WTR::propertyString): Added.
+ (WTR::numericWindowPropertyValue): Changed to call propertyValue.
+ (WTR::dumpFrameScrollPosition): Removed now unneeded WKStringToUTF8 sequence
+ since we now have suitable streaming functions.
+ (WTR::dumpFrameText): Use propertyObject and propertyString instead of
+ WKBundleFrameCopyInnerText.
+ (WTR::dumpDescendantFramesText): Removed now unneeded WKStringToUTF8 sequence
+ since we now have suitable streaming functions.
+ (WTR::InjectedBundlePage::dump): Ditto.
+ (WTR::InjectedBundlePage::willAddMessageToConsole): Ditto.
+ (WTR::InjectedBundlePage::willSetStatusbarText): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptAlert): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptConfirm): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto.
+
+2010-07-22 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Sam Weinig and Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=42193
+ Support layoutTestController.dumpEditingDelegates in WebKitTestRunner
+
+ Step 1: Add the method, and implement one actual delegate call as proof of concept. No tests
+ fixed, but this makes difference one line smaller on many editing tests.
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added dumpEditingCallbacks() and setAcceptsEditing().
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::dumpPath): Dump path to a node in a format that's compatible with DumpRenderTree.
+ (WTR::operator<<): Print a range.
+ (WTR::InjectedBundlePage::InjectedBundlePage): Set editor client in addition to existing
+ clients.
+ (WTR::InjectedBundlePage::_shouldBeginEditing): The only client method implemented so far.
+ (WTR::InjectedBundlePage::shouldBeginEditing): Ditto.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added a section for editor client
+ calls.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpEditingCallbacks):
+ (WTR::LayoutTestController::setAcceptsEditing):
+ (WTR::LayoutTestController::acceptsEditing):
+ (WTR::LayoutTestController::shouldDumpEditingCallbacks):
+ Store m_acceptsEditing and m_dumpEditingCallbacks.
+
+2010-07-22 Yael Aharon <yael.aharon@nokia.com>
- Rubber-stamped by Anders Carlsson.
+ Reviewed by Laszlo Gombos.
- Bring signed updates to the Mac nightly builds.
+ [Qt] QtWebKit needs public API for Notifications.
+ https://bugs.webkit.org/show_bug.cgi?id=41413
- * WebKitLauncher/Info.plist:
- * WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj:
- * WebKitLauncher/WebKitNightlyEnablerSparkle.m:
- (initializeSparkle):
- * WebKitLauncher/nightly.webkit.org.public.pem: Added.
+ Update DumpRenderTree and QtTestBrowser to use the new API.
+ Add new DRT API to flag that notifications permission requests should be ignored.
-2009-08-21 Jan Michael Alonzo <jmalonzo@webkit.org>
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::requestPermission):
+ (WebCore::WebPage::checkPermission):
+ (WebCore::WebPage::cancelRequestsForPermission):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::ignoreDesktopNotificationPermissionRequests):
+ (LayoutTestController::checkDesktopNotificationPermission):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::ignoreReqestForPermission):
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ * QtTestBrowser/webpage.cpp:
+ (WebPage::WebPage):
+ (WebPage::requestPermission):
+ (WebPage::checkPermission):
+ (WebPage::cancelRequestsForPermission):
+ * QtTestBrowser/webpage.h:
- Rubberstamped by Simon Fraser.
+2010-07-22 Darin Adler <darin@apple.com>
- Remove GNOME keyring support in build-webkit. This dependency's
- already been removed in the Gtk port.
+ Reviewed by Sam Weinig.
- * Scripts/build-webkit:
+ WebKitTestRunner needs to support layoutTestController.dumpChildFramesAsText
+ https://bugs.webkit.org/show_bug.cgi?id=42325
-2009-08-20 Brian Weinstein <bweinstein@apple.com>
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ Added dumpChildFramesAsText.
- Reviewed by Adam Roben.
- Based on original patch by Stephanie Lewis.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::dumpFrameText): Added.
+ (WTR::dumpDescendantFramesText): Added.
+ (WTR::InjectedBundlePage::dumpAllFramesText): Added.
+ (WTR::InjectedBundlePage::dump): Changed to use the new whatToDump function
+ instead of the shouldDumpAsText function, and added a case for AllFramesText.
- Added support of the Windows malloc history format to parse-malloc history, so we can
- read and parse it.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added dumpAllFramesText.
- * Scripts/parse-malloc-history:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Replaced m_dumpAsText with
+ m_whatToDump.
-2009-08-20 Chris Fleizach <cfleizach@apple.com>
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Added
+ dumpChildFramesAsText. Removed shouldDumpAsText, shouldDumpDOMAsWebArchive,
+ and shouldDumpSourceAsWebArchive. Added whatToDump.
- Reviewed by Darin Adler.
+2010-07-22 Adam Roben <aroben@apple.com>
- Enable various "grouping" ARIA roles
- https://bugs.webkit.org/show_bug.cgi?id=28486
+ Windows build fix
- Expose the ability to retrieve the subrole through accessibility for DRT.
+ Inspired by r63881.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ * MiniBrowser/MiniBrowser.vcproj:
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj:
+ Removed pre- and post-build events so they will be inherited from the
+ vsprops files.
-2009-08-20 Joseph Pecoraro <joepeck@webkit.org>
+2010-07-21 Darin Adler <darin@apple.com>
- Unreviewed.
+ Reviewed by Sam Weinig.
- Added myself as a committer.
+ WebKitTestRunner needs layoutTestController.dumpChildFrameScrollPositions
+ https://bugs.webkit.org/show_bug.cgi?id=42548
+
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::numericWindowPropertyValue): Renamed this and moved it up higher in the file.
+ (WTR::dumpFrameScrollPosition): Added argument telling whether to dump the frame name.
+ Changed to a file-internal function instead of a member function.
+ (WTR::dumpDescendantFrameScrollPositions): Added.
+ (WTR::InjectedBundlePage::dumpAllFrameScrollPositions): Added.
+ (WTR::InjectedBundlePage::dump): Changed to call dumpAllFrameScrollPositions when
+ appropriate. Also streamlined all the WKStringToUTF8 call sites.
+ (WTR::InjectedBundlePage::willAddMessageToConsole): Streamlined use of WKStringToUTF8.
+ (WTR::InjectedBundlePage::willSetStatusbarText): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptAlert): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptConfirm): Ditto.
+ (WTR::InjectedBundlePage::willRunJavaScriptPrompt): Ditto.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Updated for above changes.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Initialize
+ m_shouldDumpAllFrameScrollPositions.
+ (WTR::LayoutTestController::shouldDumpMainFrameScrollPosition): Renamed from
+ shouldDumpFrameScrollPositions.
+
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Reorganized the file a
+ bit, added dumpChildFrameScrollPositions and shouldDumpAllFrameScrollPositions,
+ and renamed shouldDumpFrameScrollPositions to shouldDumpMainFrameScrollPosition.
+
+2010-07-21 Darin Adler <darin@apple.com>
- * Scripts/modules/committers.py:
+ Reviewed by Sam Weinig.
-2009-08-20 Xan Lopez <xlopez@igalia.com>
+ WebKitTestRunner needs to support dumping of scroll position
+ https://bugs.webkit.org/show_bug.cgi?id=42514
- Reviewed by Gustavo Noronha.
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didClearWindowForFrame): Use JSGlobalContextRef instead of JSContextRef.
- Fix memory leaks.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::_didClearWindowForFrame): Use JSGlobalContextRef
+ instead of JSContextRef.
+ (WTR::InjectedBundlePage::dump): Call dumpFrameScrollPosition when appropriate.
+ (WTR::numericWindowProperty): Added. Helper for dumpFrameScrollPosition.
+ (WTR::InjectedBundlePage::dumpFrameScrollPosition): Added.
+ (WTR::InjectedBundlePage::didClearWindowForFrame): Use JSGlobalContextRef
+ instead of JSContextRef.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::whiteListAccessFromOrigin):
- (LayoutTestController::pauseAnimationAtTimeOnElementWithId):
- (LayoutTestController::pauseTransitionAtTimeOnElementWithId):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Removed names from
+ arguments that simply repeat the argument type. Added dumpFrameScrollPosition.
-2009-08-20 Eric Seidel <eric@webkit.org>
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::shouldDumpDOMAsWebArchive): Added. Currently
+ returns false.
+ (WTR::LayoutTestController::shouldDumpSourceAsWebArchive): Added. Currently
+ returns false.
+ (WTR::LayoutTestController::shouldDumpFrameScrollPositions): Added. Matches
+ the logic in DumpRenderTree.
- Reviewed by Adam Barth.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Updated for above changes.
- bugzilla-tool post-diff can post partial diffs from SVN checkouts.
- https://bugs.webkit.org/show_bug.cgi?id=28445
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj: Added property svn:ignore.
- Pass the checkout root as the cwd. Also wrote a test to ensure this.
+2010-07-21 Kevin Ollivier <kevino@theolliviers.com>
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py:
+ [wx] Build fix, adding the WebCore/bindings/generic dir to the list of build dirs.
-2009-08-20 Mark Rowe <mrowe@apple.com>
+ * wx/build/settings.py:
- Reviewed by Adele Peterson.
+2010-07-21 Sam Weinig <sam@webkit.org>
- Don't leak the JSStringRef returned by AccessibilityUIElement::attributeValue.
+ Reviewed by Anders Carlsson.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (attributeValueCallback):
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42539
+ WebKitTestRunner needs to support printing ALERT, PROMPT and CONFIRM messages
-2009-08-20 Ariya Hidayat <ariya.hidayat@nokia.com>
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::_willAddMessageToConsole):
+ (WTR::InjectedBundlePage::_willSetStatusbarText):
+ (WTR::InjectedBundlePage::_willRunJavaScriptAlert):
+ (WTR::InjectedBundlePage::_willRunJavaScriptConfirm):
+ (WTR::InjectedBundlePage::_willRunJavaScriptPrompt):
+ (WTR::InjectedBundlePage::willAddMessageToConsole):
+ (WTR::InjectedBundlePage::willSetStatusbarText):
+ (WTR::InjectedBundlePage::willRunJavaScriptAlert):
+ (WTR::InjectedBundlePage::willRunJavaScriptConfirm):
+ (WTR::InjectedBundlePage::willRunJavaScriptPrompt):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
- Unreviewed, build fix.
+2010-07-21 Adam Roben <aroben@apple.com>
- [Qt] The template-based qMax() compares two qreals.
+ Give InjectedBundle our standard set of configurations (minus the
+ *_Cairo variants)
- * DumpRenderTree/qt/ImageDiff.cpp:
- (main):
+ InjectedBundle's Debug_All configuration was the same as is Debug
+ configuration, and it was missing a Debug_Internal configuration.
-2009-08-20 David Levin <levin@chromium.org>
+ Fixes <http://webkit.org/b/42749> InjectedBundle's build
+ configurations are screwy
- Reviewed by David Kilzer.
+ Reviewed by Darin Adler.
- bugzilla-tool patch retrieval should handle 302 redirects.
- https://bugs.webkit.org/show_bug.cgi?id=28485
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj: Added
+ debug_internal.vsprops and debug_all.vsprops to the Debug_All
+ configuration. Added a Debug_Internal configuration.
- * Scripts/modules/scm.py: Pass the --location parameter to curl
- so that 302's are followed.
+ * WebKitTestRunner/WebKitTestRunner.sln: Build the Debug_Internal
+ variant of InjectedBundle when we're using the Debug_Internal solution
+ configuration.
-2009-08-20 Aaron Boodman <aa@chromium.org>
+2010-07-21 Adam Roben <aroben@apple.com>
- One more speculative build for gtk.
+ Move InjectedBundle's settings to a vsprops file
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ This will make it easier to change settings for all configurations,
+ and to add new configurations.
-2009-08-20 Aaron Boodman <aa@chromium.org>
+ Fixes <http://webkit.org/b/42748> InjectedBundle should use vsprops
+ files
- Speculative build for gtk.
+ Reviewed by Darin Adler.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::whiteListAccessFromOrigin):
+ * WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops: Added.
+ Moved settings here...
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj: ...from
+ here.
-2009-08-20 Mark Rowe <mrowe@apple.com>
+2010-07-21 Adam Roben <aroben@apple.com>
- Ignore some leaks that are known to originate from ImageIO.
+ Give MiniBrowser our standard set of configurations (minus the *_Cairo
+ variants)
- * Scripts/run-webkit-tests:
+ MiniBrowser already had a configuration called "Release", but it was
+ using mostly the same settings as Debug. And its Debug configuration
+ was using the settings that Debug_Internal should be using.
-2009-08-20 Aaron Boodman <aa@chromium.org>
+ Fixes <http://webkit.org/b/42746> MiniBrowser's build configurations
+ are screwy
- With David Levin.
+ Reviewed by Darin Adler.
- Speculative build fix for qt.
+ * MiniBrowser/MiniBrowser.vcproj: Removed debug_internal.vsprops from
+ the Debug configuration. Remove debug.vsprops and
+ debug_internal.vsprops from the Release configuration and replace them
+ with release.vsprops. Added Debug_Internal and Debug_All
+ configurations.
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::whiteListAccessFromOrigin):
- * DumpRenderTree/qt/jsobjects.h:
+2010-07-21 Adam Roben <aroben@apple.com>
-2009-08-19 Mark Rowe <mrowe@apple.com>
+ Move MiniBrowser's settings to a vsprops file
- Reviewed by Dan Bernstein.
+ This will make it easier to change settings for all configurations,
+ and to add new configurations.
- Fix <http://webkit.org/b/28484> Plug-in-related leaks seen on the build bot
+ MiniBrowser should use vsprops files
+ https://bugs.webkit.org/show_bug.cgi?id=42745
- Update check-for-global-initializers to accommodate the new uses of RefCountedLeakCounter in WebKit.
+ Reviewed by Darin Adler.
- * Scripts/check-for-global-initializers:
+ * MiniBrowser/Configurations/MiniBrowserCommon.vsprops: Added. Moved
+ settings here...
+ * MiniBrowser/MiniBrowser.vcproj: ...from here.
-2009-08-19 Aaron Boodman <aa@chromium.org>
+2010-07-21 Adam Roben <aroben@apple.com>
- Reviewed by David Levin.
+ Fix compiler warnings when building MiniBrowser
- https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
- specify a more granular policy for cross-origin XHR access.
+ Also cleaned up the .vcproj a bit.
- * DumpRenderTree/LayoutTestController.cpp: Expose whiteListAccessFromOrigin() to layout tests.
- (whiteListAccessFromOriginCallback): Ditto.
- (LayoutTestController::staticFunctions): Ditto.
- * DumpRenderTree/LayoutTestController.h: Ditto.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Ditto.
- (LayoutTestController::whiteListAccessToOrigin): Ditto.
- * DumpRenderTree/mac/LayoutTestControllerMac.mm: Ditto.
- (LayoutTestController::whiteListAccessFromOrigin): Ditto.
- * DumpRenderTree/qt/jsobjects.cpp: Ditto.
- (LayoutTestController::whiteListAccessFromOrigin): Ditto.
- * DumpRenderTree/win/LayoutTestControllerWin.cpp: Stub out whiteListAccessFromOrigin().
- (LayoutTestController::whiteListAccessFromOrigin): Ditto.
- * DumpRenderTree/gtk/DumpRenderTree.cpp: Reset origin access lists before each test.
- (resetWebViewToConsistentStateBeforeTesting): Ditto.
- * DumpRenderTree/mac/DumpRenderTree.mm: Ditto.
- (resetWebViewToConsistentStateBeforeTesting): Ditto.
- * DumpRenderTree/qt/DumpRenderTree.cpp: Ditto.
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting): Ditto.
-
-2009-08-19 Mark Rowe <mrowe@apple.com>
+ Fixes <http://webkit.org/b/42743>.
- Rubber-stamped by Dan Bernstein.
+ Reviewed by Darin Adler.
- Ignore some leaks that are known to originate from QTKit.
+ * MiniBrowser/MiniBrowser.vcproj: Removed all settings that are
+ already defined in .vsprops files. This also fixes a warning about
+ /EDITANDCONTINUE being incompatible with /SAFESEH.
- * Scripts/run-webkit-tests:
+ * MiniBrowser/win/MiniBrowser.rc: Replaced afxres.h with winresrc.h so
+ that we stop getting warnings about ID_FILE_OPEN and ID_FILE_CLOSE
+ being redefined. (I think this will also get us closer to building
+ with VC++ Express.)
-2009-08-19 Eric Seidel <eric@webkit.org>
+2010-07-20 Sam Weinig <sam@webkit.org>
- Reviewed by Adam Barth.
+ Reviewed by Jon Honeycutt.
- commit-queue/bugzilla-tool can get wedged if git is mid-rebase
- https://bugs.webkit.org/show_bug.cgi?id=28436
+ Fix obvious typo.
- Make clean_working_directory cancel rebases too (even though that's a bit of a hack).
- This code will only ever be run when --force-clean is passed.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::setStatusbarText): Need to call ->data() to actually get the string value.
- I also added a new unit test to make sure this code actually works. :)
+2010-07-20 Tony Chang <tony@chromium.org>
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py:
+ Reviewed by Kent Tamura.
-2009-08-19 Eric Seidel <eric@webkit.org>
+ [chromium] by default, dumpAsText should disable pixel results
+ https://bugs.webkit.org/show_bug.cgi?id=42715
- Reviewed by David Levin.
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::dumpAsText): disable pixel results, but allow JS to override
- WebKit needs a changelogs.py to hold changelog-related code
- https://bugs.webkit.org/show_bug.cgi?id=28477
+2010-07-20 Adam Roben <aroben@apple.com>
- This is moving code and adding tests. There was only one functional
- change (which was removing a trailing newline from the last_entry() result).
+ Windows build fix
- * Scripts/bugzilla-tool:
- * Scripts/modules/changelogs.py: Added.
- * Scripts/modules/changelogs_unittest.py: Added.
- * Scripts/run-webkit-unittests:
+ * MiniBrowser/MiniBrowser.vcproj: Link against the new, shiny
+ WebKit.lib instead of the old, dusty WebKit2.lib.
-2009-08-20 Eric Seidel <eric@webkit.org>
+2010-07-20 Adam Roben <aroben@apple.com>
- Reviewed by Adam Barth.
+ Stop linking WebKitTestRunner against getopt
- bugzilla-tool needs a way to ask build.webkit.org if the bots are passing
- https://bugs.webkit.org/show_bug.cgi?id=28222
+ Use of getopt was removed in r63700.
- Basic support for now. This has been in testing for 24 hours now and worked great!
+ Fixes <http://webkit.org/b/42714> WebKitTestRunner links against
+ getopt, but doesn't need to
- * Scripts/bugzilla-tool:
- * Scripts/modules/buildbot.py: Added.
- * Scripts/modules/buildbot_unittest.py: Added.
- * Scripts/run-webkit-unittests:
+ Reviewed by Sam Weinig.
-2009-08-19 Jan Michael Alonzo <jmalonzo@webkit.org>
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj: Removed getopt.lib
+ from all configurations.
- Reviewed by Gustavo Noronha.
+2010-07-20 Adam Roben <aroben@apple.com>
- [Gtk] Bump waitToDumpWatchdog interval to 15 seconds to match the
- default timeout used by run-webkit-tests. Mac and Win ports were
- recently bumped in http://trac.webkit.org/changeset/r47465.
+ Make run-webkit-tests --webkit-test-runner "work" on Windows
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setWaitToDump):
+ WebKitTestRunner crashes on launch, but at least the scripts build and
+ launch it!
-2009-08-19 David D. Kilzer <ddkilzer@webkit.org>
+ Fixes <http://webkit.org/b/42709> run-webkit-tests
+ --webkit-test-runner bails with an error on Windows
- DumpRenderTreeSupport.pm: provide pre-generated swig source for Tiger
+ Reviewed by Anders Carlsson.
- Reviewed by Mark Rowe.
+ * Scripts/build-webkittestrunner: Build WebKitTestRunner.sln on
+ Windows.
+ * WebKitTestRunner/WebKitTestRunner.sln: Added. Contains the following
+ projects (from first-built to last-built): FindSafari, ImageDiff,
+ InjectedBundleGenerated, InjectedBundle, WebKitTestRunner.
- Provide pre-generated swig source files for Tiger so it may
- benefit from the faster run-webkit-tests.
-
- * DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportTiger.pm:
- Generated by swig.
- * DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport_wrapTiger.c: Added.
- Generated by swig.
- (swig_type_info::SWIG_TypeNameComp):
- (swig_type_info::SWIG_TypeEquiv):
- (swig_type_info::SWIG_TypeRegisterTL):
- (swig_type_info::SWIG_TypeCheck):
- (swig_type_info::SWIG_TypeCast):
- (swig_type_info::SWIG_TypeDynamicCast):
- (swig_type_info::SWIG_TypeName):
- (swig_type_info::SWIG_TypePrettyName):
- (swig_type_info::SWIG_TypeQueryTL):
- (swig_type_info::SWIG_TypeClientDataTL):
- (swig_type_info::SWIG_PackData):
- (swig_type_info::SWIG_UnpackData):
- (swig_type_info::SWIG_PropagateClientDataTL):
- (swig_type_info::SWIG_PackVoidPtr):
- (swig_type_info::SWIG_UnpackVoidPtr):
- (swig_type_info::SWIG_PackDataName):
- (swig_type_info::SWIG_UnpackDataName):
- * DumpRenderTree/mac/PerlSupport/Makefile: Updated to build on
- Tiger using pre-generated files.
-
-2009-08-18 Shinichiro Hamaji <hamaji@chromium.org>
+2010-07-20 Adam Roben <aroben@apple.com>
- Reviewed by David Kilzer.
+ Change build-webkit back to building WebKit.sln on Windows
- run-webkit-tests hangs when WebCore tries to log too much
- https://bugs.webkit.org/show_bug.cgi?id=15743
+ WebKit.sln builds all the same projects as WebKit2.sln, and the latter
+ is being removed.
- Read stdout and stderr in parallel.
+ Rubber-stamped in advance by Steve Falkenburg.
- * Scripts/run-webkit-tests:
+ * Scripts/build-webkit:
-2009-08-18 Mark Rowe <mrowe@apple.com>
+2010-07-20 Adam Roben <aroben@apple.com>
- Rubber-stamped by Oliver Hunt.
+ Windows build fix
- Add a new build configuration that checks for leaks during the layout tests,
- and hook a new machine up to it.
+ * MiniBrowser/win/BrowserWindow.cpp: Added missing #include.
- * BuildSlaveSupport/build.webkit.org-config/config.json:
- * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+2010-07-20 Joseph Pecoraro <joepeck@webkit.org>
-2009-08-18 Aaron Boodman <aa@chromium.org>
+ Reviewed by Geoffrey Garen.
- Reviewed by Maciej Stachowiak.
+ WebScriptObject Should Allow Safely Checking For Key Existence
+ https://bugs.webkit.org/show_bug.cgi?id=42613
- https://bugs.webkit.org/show_bug.cgi?id=28412: Leak of WebCore::XMLHttpRequest object during layout tests.
+ Normal ObjCController workflow for a WebScriptObject test.
- No new tests: Already covered by existing tests.
+ * DumpRenderTree/mac/ObjCController.m:
+ (+[ObjCController isSelectorExcludedFromWebScript:]):
+ (+[ObjCController webScriptNameForSelector:]):
+ (-[ObjCController testHasWebScriptKey:]):
- * Scripts/check-for-global-initializers: Allow global initialization of WTF::RefCountedLeakCounter for XMLHttpRequest.
+2010-07-20 Chris Marrin <cmarrin@apple.com>
-2009-08-18 Mark Rowe <mrowe@apple.com>
+ Reviewed by Simon Fraser.
- Rubber-stamped by Geoff Garen.
+ https://bugs.webkit.org/show_bug.cgi?id=42118
+ Disable compositing/webgl tests if WebGL is not enabled
- Bump waitToDumpWatchdogInterval to 15 seconds to match the time-out used by run-webkit-tests.
+ * Scripts/old-run-webkit-tests:
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+2010-07-20 Anton Muhin <antonm@chromium.org>
-2009-08-18 Brian Weinstein <bweinstein@apple.com>
+ Reviewed by Darin Adler.
- Rubber-stamped by Adam Roben.
+ Print additional information about exception if failed to connect to apache (in verbose mode).
+ https://bugs.webkit.org/show_bug.cgi?id=42627
- Changed use of CComBSTR in exceededDatabaseQuota to BSTRs, and free them,
- and removed include to fix building on VC++ Express.
+ * Scripts/webkitpy/layout_tests/port/http_server_base.py:
- * DumpRenderTree/win/UIDelegate.cpp:
- (UIDelegate::exceededDatabaseQuota):
+2010-07-20 Tony Chang <tony@chromium.org>
-2009-08-18 Brian Weinstein <bweinstein@apple.com>
+ Reviewed by David Levin.
- Reviewed by Oliver Hunt.
+ [chromium] only pass --force to gclient sync if explicitly stated
+ https://bugs.webkit.org/show_bug.cgi?id=42581
- Fix of <https://bugs.webkit.org/show_bug.cgi?id=28326> DRT on Windows doesn't support
- LayoutTestController::setQuota or print a callback on UIDelegate::exceededDatabaseQuota.
-
- Implemenent setDatabaseQuota and added a new function to the IWebDatabaseManager interface.
- Also added a console output on UIDelegate::exceededDatabaseQuota to match the mac.
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: bots should
+ always pass --force since it's hard to do manual cleanups
+ * Scripts/update-webkit-chromium: only pass --force if --force is
+ passed in
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setDatabaseQuota):
- * DumpRenderTree/win/UIDelegate.cpp:
- (UIDelegate::exceededDatabaseQuota):
+2010-07-19 Anders Carlsson <andersca@apple.com>
-2009-08-18 Peter Kasting <pkasting@google.com>
+ Fix build.
- Reviewed by Eric Seidel.
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ Paths of generated files should be relative to the build product.
- https://bugs.webkit.org/show_bug.cgi?id=28415
- Set svn:eol-style CRLF on all .sln and .vcproj files that don't already
- have it.
+2010-07-19 Daniel Bates <dbates@rim.com>
- * record-memory-win/record-memory-win.vcproj:
- * WinLauncher/WinLauncher.vcproj:
- * WebKitLauncherWin/WebKitLauncherWin.vcproj:
- * DumpRenderTree/win/ImageDiff.vcproj:
- * FindSafari/FindSafari.vcproj:
+ Reviewed by Adam Roben.
-2009-08-18 Drew Wilson <atwilson@google.com>
+ [Win] Implement LayoutTestController::markerTextForListItem()
+ https://bugs.webkit.org/show_bug.cgi?id=37930
- Reviewed by Eric Seidel.
+ Implements DRT support for markerTextForListItem in the Windows port.
- Need to extend DumpRenderTree to expose number of worker threads
- https://bugs.webkit.org/show_bug.cgi?id=28292
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::markerTextForListItem): Implemented.
- Added layoutTestController.workerThreadCount, and implementations on various platforms that call into WebKit.
+2010-07-19 Jessie Berlin <jberlin@apple.com>
- * DumpRenderTree/LayoutTestController.cpp:
- (getWorkerThreadCountCallback):
- (LayoutTestController::staticValues):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::workerThreadCount):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::workerThreadCount):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::workerThreadCount):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::workerThreadCount):
+ Windows build fix. Unreviewed.
-2009-08-18 Xan Lopez <xlopez@igalia.com>
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::initializeTestPluginPath):
- Reviewed by Jan Alonzo.
+2010-07-19 Sam Weinig <sam@webkit.org>
- Initialize x and y in the GtkAllocation structure to shut up
- valgrind.
+ Reviewed by Jon Honeycutt.
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (runTest):
+ Remove dependency on getopt from WebKitTestRunner.
-2009-08-17 Shinichiro Hamaji <hamaji@chromium.org>
+ - Simplify options parsing and eliminate unused options.
- Reviewed by Darin Adler.
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::TestController):
+ (WTR::TestController::initialize):
+ * WebKitTestRunner/TestController.h:
+ (WTR::TestController::testPluginPath):
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::platformInitialize):
+ (WTR::TestController::initializeTestPluginPath):
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::platformInitialize):
+ (WTR::TestController::initializeTestPluginPath):
- Some HTMLs are modified by make-script-test-wrappers
- https://bugs.webkit.org/show_bug.cgi?id=28213
+2010-07-19 Diego Gonzalez <diegohcg@webkit.org>
- Add fast/js/const.js and fast/canvas/canvas-2d-imageData-create-nonfinite.js into
- the exclude list, modified fast/dom/Geolocation/resources/TEMPLATE.html, and
- re-generated wml/* and Geolocation/* .
+ Reviewed by Antonio Gomes.
- * Scripts/make-script-test-wrappers:
+ [Qt] MiniBrowser: Progress indication at address bar
+ https://bugs.webkit.org/show_bug.cgi?id=42565
-2009-08-17 Shinichiro Hamaji <hamaji@chromium.org>
+ Make possible to see load progress at address bar based on
+ QtTestBrowser solution
- Reviewed by Eric Seidel.
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserWindow::BrowserWindow):
+ (BrowserWindow::loadProgress):
+ * MiniBrowser/qt/BrowserWindow.h:
- -webkit-box-orient:horizontal doesn't work on <button> tag
- https://bugs.webkit.org/show_bug.cgi?id=34445
+2010-07-19 Diego Gonzalez <diegohcg@webkit.org>
- Make a flexible button's anonymous child flexible and pass the
- parent's box-orient to the anonymous child.
+ Reviewed by Antonio Gomes.
- Also, added a renderName for anonymous flexible boxes.
+ [Qt] Add MiniBrowser features: urlChanged, titleChanged and from user input load
+ https://bugs.webkit.org/show_bug.cgi?id=42564
- * Scripts/make-script-test-wrappers:
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserView::load):
+ (BrowserWindow::BrowserWindow):
+ (BrowserWindow::titleChanged):
+ (BrowserWindow::urlChanged):
+ * MiniBrowser/qt/BrowserWindow.h:
-2009-08-17 Eric Seidel <eric@webkit.org>
+2010-07-19 Sam Weinig <weinig@apple.com>
- Reviewed by Darin Adler.
+ Reviewed by Adam Roben.
- Can no longer --reset-results of a layout test directory
- https://bugs.webkit.org/show_bug.cgi?id=28336
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42532
+ Auto-generate the JS bindings for WebKitTestRunner's script objects.
+
+ * WebKitTestRunner/Configurations/Base.xcconfig:
+ * WebKitTestRunner/Configurations/DebugRelease.xcconfig:
+ * WebKitTestRunner/DerivedSources.make: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/GetPtr.h: Added.
+ * WebKitTestRunner/InjectedBundle/Bindings: Added.
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm: Added.
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h: Added.
+ (WTR::JSWrappable::~JSWrappable):
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp: Added.
+ (WTR::JSWrapper::wrap):
+ (WTR::JSWrapper::unwrap):
+ (WTR::unwrapObject):
+ (WTR::JSWrapper::initialize):
+ (WTR::JSWrapper::finalize):
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h: Added.
+ (WTR::toJS):
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::dump):
+ (WTR::InjectedBundlePage::setStatusbarText):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::wrapperClass):
+ (WTR::LayoutTestController::waitUntilDone):
+ (WTR::LayoutTestController::makeWindowObject):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::shouldDumpAsText):
+ (WTR::LayoutTestController::dumpAsText):
+ (WTR::LayoutTestController::shouldDumpStatusCallbacks):
+ (WTR::LayoutTestController::dumpStatusCallbacks):
+ (WTR::LayoutTestController::waitToDump):
+ (WTR::LayoutTestController::testRepaint):
+ (WTR::LayoutTestController::repaintSweepHorizontally):
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj:
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+ * WebKitTestRunner/win/InjectedBundleGenerated.vcproj: Added.
+ * WebKitTestRunner/win/build-generated-files.sh: Added.
+
+2010-07-19 Mark Rowe <mrowe@apple.com>
+
+ Clean up the buildbot configuration a little.
- --reset-results and --exit-after-n-failures are incompatible.
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
- * Scripts/run-webkit-tests:
+2010-07-19 Chris Marrin <cmarrin@apple.com>
-2009-08-17 David Kilzer <ddkilzer@apple.com>
+ Reviewed by Darin Adler.
- <http://webkit.org/b/26920> bugzilla-tool dumps too much junk the the commit comment from git
+ https://bugs.webkit.org/show_bug.cgi?id=42118
+ Disable WebGL on Leopard for now.
- Reviewed by Adam Roben.
+ LayoutTests fail on some graphics hardware on Leopard because one of the features we use,
+ GL_ARB_framebuffer_object, is not universally available in Leopard like it is in
+ SnowLeopard. This will allow LayoutTests to pass on Leopard until we add logic to use a
+ software OpenGL driver on machines without this support.
- New commit message:
- Committed r12345: <http://trac.webkit.org/changeset/12345>
+ * Scripts/build-webkit:
- * Scripts/bugzilla-tool:
- (bug_comment_from_commit_text): Print out a compact,
- standardized commit message for both git and svn.
+2010-07-19 Simon Fraser <simon.fraser@apple.com>
-2009-08-17 Peter Kasting <pkasting@google.com>
+ Reviewed by Brady Eidson.
- Reviewed by Steve Falkenburg.
+ Fix MiniBrowser to update URL as you browse
+ https://bugs.webkit.org/show_bug.cgi?id=42591
+
+ Hook up various loading notifications to update the URL bar in MiniBrowser.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (_didStartProvisionalLoadForFrame):
+ (_didReceiveServerRedirectForProvisionalLoadForFrame):
+ (_didFailProvisionalLoadWithErrorForFrame):
+ (_didCommitLoadForFrame):
+ (_didFailLoadWithErrorForFrame):
+ (-[BrowserWindowController updateProvisionalURLForFrame:]):
+ (-[BrowserWindowController didStartProvisionalLoadForFrame:]):
+ (-[BrowserWindowController didReceiveServerRedirectForProvisionalLoadForFrame:]):
+ (-[BrowserWindowController didFailProvisionalLoadWithErrorForFrame:]):
+ (-[BrowserWindowController didFailLoadWithErrorForFrame:]):
+ (-[BrowserWindowController didCommitLoadForFrame:]):
+
+2010-07-19 Alexey Proskuryakov <ap@apple.com>
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Only add Cygwin to the path when it isn't already there. This avoids
- causing problems for people who purposefully have non-Cygwin versions of
- executables like svn in front of the Cygwin ones in their paths.
+ Reviewed by Darin Adler.
- * DumpRenderTree/win/DumpRenderTree.vcproj:
- * DumpRenderTree/win/ImageDiff.vcproj:
- * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+ https://bugs.webkit.org/show_bug.cgi?id=42586
+ Log all canceled authentication attempts in DumpRenderTree
+
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]):
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::didReceiveAuthenticationChallenge):
+ It's important to know whether an auth sheet appeared. Added logging to "no preset credentials"
+ case.
+
+2010-07-19 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r63671.
+ http://trac.webkit.org/changeset/63671
+ https://bugs.webkit.org/show_bug.cgi?id=42575
+
+ broke windows (Requested by weinig on #webkit).
+
+ * WebKitTestRunner/Configurations/Base.xcconfig:
+ * WebKitTestRunner/Configurations/DebugRelease.xcconfig:
+ * WebKitTestRunner/DerivedSources.make: Removed.
+ * WebKitTestRunner/ForwardingHeaders/wtf/GetPtr.h: Removed.
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm: Removed.
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h: Removed.
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp: Removed.
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h: Removed.
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: Removed.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::dump):
+ (WTR::InjectedBundlePage::setStatusbarText):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::setWaitToDump):
+ (WTR::displayCallback):
+ (WTR::dumpAsTextCallback):
+ (WTR::dumpStatusCallbacksCallback):
+ (WTR::waitUntilDoneCallback):
+ (WTR::notifyDoneCallback):
+ (WTR::numberOfActiveAnimationsCallback):
+ (WTR::pauseAnimationAtTimeOnElementWithIdCallback):
+ (WTR::repaintSweepHorizontallyCallback):
+ (WTR::testRepaintCallback):
+ (WTR::layoutTestControllerObjectFinalize):
+ (WTR::LayoutTestController::makeWindowObject):
+ (WTR::LayoutTestController::getJSClass):
+ (WTR::LayoutTestController::staticFunctions):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpAsText):
+ (WTR::LayoutTestController::setDumpAsText):
+ (WTR::LayoutTestController::dumpStatusCallbacks):
+ (WTR::LayoutTestController::setDumpStatusCallbacks):
+ (WTR::LayoutTestController::setTestRepaint):
+ (WTR::LayoutTestController::setTestRepaintSweepHorizontally):
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+
+2010-07-19 Sam Weinig <sam@webkit.org>
-2009-08-17 David Kilzer <ddkilzer@apple.com>
+ Reviewed by Adam Roben.
- <http://webkit.org/b/28393> check-webkit-style: add check for use of std::max()/std::min() instead of MAX()/MIN()
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42532
+ Auto-generate the JS bindings for WebKitTestRunner's script objects.
+
+ * WebKitTestRunner/Configurations/Base.xcconfig:
+ * WebKitTestRunner/Configurations/DebugRelease.xcconfig:
+ * WebKitTestRunner/DerivedSources.make: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/GetPtr.h: Added.
+ * WebKitTestRunner/InjectedBundle/Bindings: Added.
+ * WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm: Added.
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h: Added.
+ (WTR::JSWrappable::~JSWrappable):
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp: Added.
+ (WTR::JSWrapper::wrap):
+ (WTR::JSWrapper::unwrap):
+ (WTR::unwrapObject):
+ (WTR::JSWrapper::initialize):
+ (WTR::JSWrapper::finalize):
+ * WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h: Added.
+ (WTR::toJS):
+ * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl: Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::dump):
+ (WTR::InjectedBundlePage::setStatusbarText):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::wrapperClass):
+ (WTR::LayoutTestController::waitUntilDone):
+ (WTR::LayoutTestController::makeWindowObject):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::shouldDumpAsText):
+ (WTR::LayoutTestController::dumpAsText):
+ (WTR::LayoutTestController::shouldDumpStatusCallbacks):
+ (WTR::LayoutTestController::dumpStatusCallbacks):
+ (WTR::LayoutTestController::waitToDump):
+ (WTR::LayoutTestController::testRepaint):
+ (WTR::LayoutTestController::repaintSweepHorizontally):
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+
+2010-07-19 Tony Chang <tony@chromium.org>
Reviewed by David Levin.
- * Scripts/modules/cpp_style.py:
- (_ERROR_CATEGORIES): Added 'runtime/max_min_macros'.
- (check_max_min_macros): Added. Returns level 4 error when MAX()
- and MIN() macros are used in header files and C++ source files.
- (check_style): Added call to check_max_min_macros().
- * Scripts/modules/cpp_style_unittest.py: Added unit tests.
- (test_max_macro): Added.
- (test_min_macro): Added.
+ fix chromium linux compile on ubuntu maverick
+ https://bugs.webkit.org/show_bug.cgi?id=42528
-2009-08-13 Mike Fenton <mike.fenton@torchmobile.com>
+ * Scripts/webkitdirs.pm: add a chomp to eat a newline that breaks the make command line
- Reviewed by Eric Seidel.
+2010-07-19 Adam Roben <aroben@apple.com>
- Move adjustLineToPixelBoundaries overlapping function to GraphicsContext.cpp
- and remove from GraphicsContextCairo.cpp and GraphicsContextQt.cpp.
+ When dumping a response's MIME type, print its URL's last path
+ component rather than its suitable-for-test-result form
- https://bugs.webkit.org/show_bug.cgi?id=28268
+ This matches the Mac behavior.
- * platform/graphics/GraphicsContext.cpp:
- (WebCore::GraphicsContext::adjustLineToPixelBoundaries):
- * platform/graphics/GraphicsContext.h:
- * platform/graphics/cairo/GraphicsContextCairo.cpp:
- * platform/graphics/qt/GraphicsContextQt.cpp:
+ Fixes <http://webkit.org/b/42276>
+ http/tests/loading/preload-slow-loading.php and
+ http/tests/mime/uppercase-mime-type.html fail on Windows
-2009-08-10 Mike Fenton <mike.fenton@torchmobile.com>
+ Reviewed by Anders Carlsson.
- Reviewed by Adam Treat.
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (urlSuitableForTestResult): Moved code to actually extract the last
+ path component from here...
+ (lastPathComponent): ...to here.
- Style fixes for DumpRenderTree/qt/jsobjects.cpp based on cpp_style.py and
- WebKit style guide.
+ * DumpRenderTree/win/DumpRenderTreeWin.h: Added lastPathComponent.
- https://bugs.webkit.org/show_bug.cgi?id=28161
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::didReceiveResponse): Use the URL's last path
+ component, rather than its suitable-for-test-result form, to match
+ Mac.
- * DumpRenderTree/qt/jsobjects.cpp:
- (findFrameNamed):
- (LoadItem::invoke):
- (LayoutTestController::provisionalLoad):
- (LayoutTestController::timerEvent):
- (LayoutTestController::pauseAnimationAtTimeOnElementWithId):
- (LayoutTestController::pauseTransitionAtTimeOnElementWithId):
- (LayoutTestController::numberOfActiveAnimations):
- (EventSender::keyDown):
- (EventSender::frameUnderMouse):
- (TextInputController::doCommand):
+2010-07-19 Anders carlsson <andersca@apple.com>
-2009-08-16 David Kilzer <ddkilzer@apple.com>
+ Reviewed by Adam Roben.
- <http://webkit.org/b/28370> check-webkit-style: add check for 'using std::foo;' statements
+ WebKit2 does not have application cache
+ https://bugs.webkit.org/show_bug.cgi?id=42552
- Reviewed by David Levin.
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::resetPreferencesToConsistentValues):
+ Set up default preferences. Right now just enables the web application cache.
- In <http://webkit.org/b/28355#c1>, it was noted that new source
- files use 'using namespace std;' instead of individual
- 'using std::foo;' statements. This adds a level 4 check for
- such statements.
+ (WTR::TestInvocation::invoke):
+ Call resetPreferencesToConsistentValues.
- * Scripts/modules/cpp_style.py:
- (_ERROR_CATEGORIES): Added 'build/using_std'.
- (check_using_std): Added.
- (check_style): Added call to check_using_std().
- * Scripts/modules/cpp_style_unittest.py:
- (WebKitStyleTest.test_using_std): Added unit test.
+ * WebKitTestRunner/TestInvocation.h:
-2009-08-16 David Kilzer <ddkilzer@apple.com>
+2010-07-19 Kent Tamura <tkent@chromium.org>
- Backed out r47343 which was mistakenly committed
+ Reviewed by Adam Roben.
- * Scripts/bugzilla-tool:
- * Scripts/modules/scm.py:
+ Fix NewRunWebKitTests to work on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=41180
-2009-08-16 David Kilzer <ddkilzer@apple.com>
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ Specifying python explicitly.
- <http://webkit.org/b/28367> bugzilla.py: replace ScriptError class with BugzillaError class
+2010-07-18 Anders Carlsson <andersca@apple.com>
- Reviewed by David Levin.
+ Reviewed by Dan Bernstein.
- The ScriptError class doesn't exist in bugzilla.py, so any
- errors print error messages about ScriptError instead of the
- actual error:
+ Add dumping of statusbar text to WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=42516
- NameError: global name 'ScriptError' is not defined
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::_setStatusbarText):
+ (WTR::InjectedBundlePage::setStatusbarText):
+ Dump the statusbar text.
- * Scripts/modules/bugzilla.py:
- (BugzillaError): Added class. Modeled after ScriptError class
- in scm.py.
- (Bugzilla.authenticate): Changed to use BugzillaError instead of
- ScriptError.
- (Bugzilla._check_create_bug_response): Ditto.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController):
+ Initialize m_dumpStatusCallbacks to false.
-2009-08-14 Adam Bergkvist <adam.bergkvist@ericsson.com>
+ (WTR::dumpStatusCallbacksCallback):
+ Implement JSC callback.
- Reviewed by Sam Weinig.
+ (WTR::LayoutTestController::staticFunctions):
+ Add dumpStatusCallbacks.
- Added EventSource to the build script (default on).
- https://bugs.webkit.org/show_bug.cgi?id=14997
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::dumpStatusCallbacks):
+ (WTR::LayoutTestController::setDumpStatusCallbacks):
+ Add setter and getter for m_dumpStatusCallbacks.
- * Scripts/build-webkit:
+2010-07-17 Anders Carlsson <andersca@apple.com>
-2009-08-15 Ryosuke Niwa <rniwa@webkit.org>
+ Reviewed by Maciej Stachowiak.
- Unreviewed.
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+ Get the test plug-in path and set it on the context.
- Add myself to list of committers.
+ * WebKitTestRunner/TestController.h:
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::TestController::initializeInjectedBundlePath):
+ Simplify this code by using NSBundle.
- * Scripts/modules/committers.py:
+ (WTR::TestController::testPluginPath):
+ Return the test plug-in path.
-2009-08-15 Jon Honeycutt <jhoneycutt@apple.com>
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::testPluginPath):
+ Ditto.
- Fix layout test failures after r47312.
+2010-07-16 Adam Barth <abarth@webkit.org>
- Reviewed by Cameron Zwarich.
+ Reviewed by Eric Seidel.
- * DumpRenderTree/AccessibilityController.h:
- Replaced logFocusEvents() with setLogFocusEvents(), which takes a
- boolean argument to turn logging of focus events on or off.
- Added a function to reset the AccessibilityController to a consistent
- state.
+ Teach webkitpy about queues.webkit.org
+ https://bugs.webkit.org/show_bug.cgi?id=42492
- * DumpRenderTree/AccessibilityController.cpp:
- (logFocusEventsCallback):
- Call setLogFocusEvents() to enable logging.
- (AccessibilityController::resetToConsistentState):
- Call setLogFocusEvents() to disable logging.
+ * Scripts/webkitpy/common/net/statusserver.py:
- * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
- (AccessibilityController::setLogFocusEvents):
- Update stub.
+2010-07-16 Ada Chan <adachan@apple.com>
- * DumpRenderTree/mac/AccessibilityControllerMac.mm:
- (AccessibilityController::setLogFocusEvents):
- Update stub.
+ Reviewed by Alice Liu.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetWebViewToConsistentStateBeforeTesting):
- Call the FrameLoadDelegate's resetToConsistentState method.
+ Fix Windows build.
- * DumpRenderTree/mac/FrameLoadDelegate.h:
- Declare the resetToConsistentState method.
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj:
- * DumpRenderTree/mac/FrameLoadDelegate.mm:
- (-[FrameLoadDelegate resetToConsistentState]):
- Call the AccessibilityController's resetToConsistentState() function.
+2010-07-16 Sam Weinig <sam@webkit.org>
- * DumpRenderTree/win/AccessibilityControllerWin.cpp:
- (AccessibilityController::~AccessibilityController):
- Turn off focus event logging when the controller is destroyed.
- (AccessibilityController::setLogFocusEvents):
- If the caller passes false, unhook the focus event, and clear
- m_focusEventHook.
+ Reviewed by Anders Carlsson.
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting):
- Call the FrameLoadDelegate's resetToConsistentState function.
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=42482
+ <rdar://problem/8197701>
+ Add notification of when the BackForwardList changes
+ to aid invalidation of Back/Forward related UI elements.
- * DumpRenderTree/win/FrameLoadDelegate.h:
- Declare the resetToConsistentState() function.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (_didStartProvisionalLoadForFrame):
+ (_didCommitLoadForFrame):
+ (_didFailLoadWithErrorForFrame):
+ (_didChangeBackForwardList):
+ (-[BrowserWindowController awakeFromNib]):
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
- * DumpRenderTree/win/FrameLoadDelegate.cpp:
- (FrameLoadDelegate::resetToConsistentState):
- Call the AccessibilityController's resetToConsistentState() function.
+2010-07-16 Kent Tamura <tkent@chromium.org>
+ Reviewed by Darin Fisher.
-2009-08-14 Jon Honeycutt <jhoneycutt@apple.com>
+ [Chromium] <input type=number> UI implementation for Windows
+ https://bugs.webkit.org/show_bug.cgi?id=42259
- Add a mechanism for logging MSAA focus events.
+ * DumpRenderTree/chromium/WebThemeEngineDRT.cpp:
+ (WebThemeEngineDRT::paintSpinButton):
+ Added. Check state consistency and use existing arrow painting code.
+ * DumpRenderTree/chromium/WebThemeEngineDRT.h:
- Part of <rdar://problem/6218721> No MSAA focus events fired for Webkit
- nightly (20866)
+2010-07-16 Alice Liu <alice.liu@apple.com>
- https://bugs.webkit.org/show_bug.cgi?id=20866
+ Reviewed by Sam Weinig.
- Reviewed by Oliver Hunt.
+ https://bugs.webkit.org/show_bug.cgi?id=42430
+ Make WebKitTestRunner on Windows actually load and run a test
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp: Export WKBundleInitialize.
+ (WKBundleInitialize):
+ * WebKitTestRunner/InjectedBundle/win/InjectedBundle.vcproj: Added. Output is a dll.
+ * WebKitTestRunner/TestInvocation.cpp: Create a Windows-style path on Windows
+ (WTR::createWKURL):
+ * WebKitTestRunner/WebKitTestRunnerPrefix.h: Change check for Windows platform to match
+ other existing checks, and avoid including Platform.h
+ * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+ (WTR::registerWindowClass): Added.
+ (WTR::PlatformWebView::PlatformWebView): Implemented.
+ (WTR::PlatformWebView::~PlatformWebView): Implemented.
+ (WTR::PlatformWebView::page): Implemented.
+ * WebKitTestRunner/win/TestControllerWin.cpp:
+ (WTR::TestController::initializeInjectedBundlePath): Implemented. Provide build
+ configuration specific path to InjectedBundle.dll.
+ * WebKitTestRunner/win/TestInvocationWin.cpp:
+ (WTR::TestInvocation::runUntil): Implemented.
+ * WebKitTestRunner/win/WebKitTestRunner.sln: Added InjectedBundle project.
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj: Cleaned up unnecessary dependencies.
+
+2010-07-16 Brady Eidson <beidson@apple.com>
- * DumpRenderTree/AccessibilityController.cpp:
- (logFocusEventsCallback):
- Call the AccessibilityController's logFocusEvents() function.
- (AccessibilityController::getJSClass):
- Add a "logFocusEvents" function to the AccessibilityController's JS
- class definition.
+ Reviewed by Sam Weinig.
- * DumpRenderTree/AccessibilityController.h:
- On Windows, include windows.h, and add a member variable to hold the
- handle to the event hook for focus events. Add a declaration for a
- function that enables logging of focus events.
+ Make revalidation of back/forward work a little better with page loads
+ https://bugs.webkit.org/show_bug.cgi?id=42470
- * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
- (AccessibilityController::logFocusEvents):
- Stubbed.
+ * MiniBrowser/mac/BrowserWindow.xib:
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController validateToolbar]):
+ (_didStartProvisionalLoadForFrame):
+ (_didCommitLoadForFrame):
+ (_didFailLoadWithErrorForFrame):
- * DumpRenderTree/mac/AccessibilityControllerMac.mm:
- (AccessibilityController::logFocusEvents):
- Stubbed.
+2010-07-16 Nikolas Zimmermann <nzimmermann@rim.com>
- * DumpRenderTree/win/AccessibilityControllerWin.cpp:
- (AccessibilityController::AccessibilityController):
- (AccessibilityController::~AccessibilityController):
- If we hooked the focus event, unhook it.
- (logFocusEventProc):
- When we receive a focus event, get the accessible object for the event,
- and log its name to stdout.
- (AccessibilityController::logFocusEvents):
- Setup the focus event hook to listen for events in the current process.
+ Reviewed by Dirk Schulze.
-2009-08-14 Eric Seidel <eric@webkit.org>
+ Add possibility to dumpAsText and generate a pixel test result
+ https://bugs.webkit.org/show_bug.cgi?id=42374
- No review. Fix 5-space indent to be 4-spaces.
+ Add optional parameter to setDumpAsText() to allow generating a pixel test result even if dumpAsText mode.
+ setDumpAsText(true) will also generate a pixel test result now, when running run-webkit-tests --pixel-tests.
- * Scripts/bugzilla-tool:
+ This is needed for the svg/dynamic-updates tests, which don't want render tree dumps but text dumps + a pixel test result.
+ At some point DRT changed to not generate pixel test results when using dumpAsText - which makes sense, but breaks the svg/dynamic-updates test.
-2009-08-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+ Implemented for all DRT platforms, except Qt, as it's not clear how arguments to functions like "setDumpAsText" are handled.
+ (Qt always dumps pixel tests when using --pixel-tests mode, so it does not break anything)
- Reviewed by Simon Hausmann.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (dumpAsTextAndPixelsCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::dumpAsTextAndPixels):
+ (LayoutTestController::setDumpAsTextAndPixels):
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::dumpAsTextAndPixels):
+ (LayoutTestController::reset):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ (LayoutTestController::shouldDumpAsTextAndPixels):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dump):
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (dump):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (dump):
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::dump):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (dump):
+ * DumpRenderTree/wx/DumpRenderTreeWx.cpp:
+ (dump):
- [Qt] Public API to configure the storage path for HTML5 localStorage
- https://bugs.webkit.org/show_bug.cgi?id=28036
+2010-07-16 Kent Hansen <kent.hansen@nokia.com>
- Turn on LocalStorage support for Qt DumpRenderTree since
- LocalStorage is now disabled by defult for QtWebkit.
+ Unreviewed. Adding myself as committer.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
+ * Scripts/webkitpy/common/config/committers.py:
-2009-08-14 Xan Lopez <xlopez@igalia.com>
+2010-07-16 Shinichiro Hamaji <hamaji@chromium.org>
- Reviewed by Jan Alonzo.
+ Another uneviewed attempt to fix build.
- Do not unref the main webview, it's owned by its parent
- container. Instead destroy the container, which should take care
- of everything (not terribly important since we exit right after
- that, but still).
+ Printing test results differ between machines, we should use ImageDiff instead
+ https://bugs.webkit.org/show_bug.cgi?id=20011
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (main):
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ (createPagedBitmapContext):
-2009-08-13 Eric Seidel <eric@webkit.org>
+2010-07-16 Shinichiro Hamaji <hamaji@chromium.org>
- No review, correcting obvious python error seen in the commit queue.
+ Unreviewed tiger build fix.
- args can be a string or an array. Assuming args is always an array results in
- double-spaced text in error logs.
+ Printing test results differ between machines, we should use ImageDiff instead
+ https://bugs.webkit.org/show_bug.cgi?id=20011
- * Scripts/bugzilla-tool:
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ (createBitmapContext):
+ (createBitmapContextFromWebView):
-2009-08-13 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+2010-07-15 Shinichiro Hamaji <hamaji@chromium.org>
- Unreviewed build fix. Include stdio.h for using stdout, stderr,
- and fprintf.
+ Unreviewed build fix.
- * DumpRenderTree/LayoutTestController.cpp:
+ Printing test results differ between machines, we should use ImageDiff instead
+ https://bugs.webkit.org/show_bug.cgi?id=20011
-2009-08-13 Shinichiro Hamaji <hamaji@chromium.org>
+ * DumpRenderTree/PixelDumpSupport.cpp:
+ (dumpWebViewAsPixelsAndCompareWithExpected):
- Reviewed by Eric Seidel.
+2010-07-15 Shinichiro Hamaji <hamaji@chromium.org>
- rename make-js-test-wrappers to make-script-test-wrappers
- https://bugs.webkit.org/show_bug.cgi?id=28212
+ Reviewed by Darin Adler.
- * Scripts/make-script-test-wrappers: Renamed from WebKitTools/Scripts/make-js-test-wrappers.
+ Printing test results differ between machines, we should use ImageDiff instead
+ https://bugs.webkit.org/show_bug.cgi?id=20011
-2009-08-13 Drew Wilson <atwilson@chromium.org>
+ * DumpRenderTree/PixelDumpSupport.cpp:
+ (dumpWebViewAsPixelsAndCompareWithExpected):
+ * DumpRenderTree/PixelDumpSupport.h:
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ (createBitmapContext): This function was added to share bitmap context creation code.
+ (createBitmapContextFromWebView):
+ (createPagedBitmapContext):
- Unreviewed.
+2010-07-15 Yuta Kitamura <yutak@chromium.org>
- Add myself to list of committers.
+ Reviewed by Kent Tamura.
- * Scripts/modules/committers.py:
+ Pull in pywebsocket-0.5.1
+ https://bugs.webkit.org/show_bug.cgi?id=42353
-2009-08-13 John Sullivan <sullivan@apple.com>
+ pywebsocket-0.5.1 contains a small bug fix (*) that should fix a worker test
+ in Chromium. There is no other functional change.
- Unreviewed.
+ (*) http://code.google.com/p/pywebsocket/source/detail?r=265
- Add myself to list of committers.
+ * Scripts/webkitpy/thirdparty/__init__.py: Bump pywebsocket version to 0.5.1.
- * Scripts/modules/committers.py:
+2010-07-15 Brady Eidson <beidson@apple.com>
-2009-08-13 Eric Seidel <eric@webkit.org>
+ Reviewed by Sam Weinig.
- Correct spelling error in file name. No review.
+ Add toolbar and toolbar item validation for MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=42422
- * Scripts/modules/committers_unittest.py: Renamed from WebKitTools/Scripts/modules/commiters_unittest.py.
- * Scripts/run-webkit-unittests:
+ * MiniBrowser/MBToolbarItem.h: Added.
+ * MiniBrowser/MBToolbarItem.m: Added.
+ (-[MBToolbarItem validate]):
-2009-08-13 Eric Seidel <eric@webkit.org>
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController validateUserInterfaceItem:]):
- Reviewed by Simon Fraser.
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/mac/BrowserWindow.xib:
- REGRESSION(r47175): error running run-webkit-tests
- https://bugs.webkit.org/show_bug.cgi?id=28261
+2010-07-15 Victor Wang <victorw@chromium.org>
- Fix "Use of uninitialized value in concatenation (.) or string at
- WebKitTools/Scripts/run-webkit-tests line 191." by setting
- $testsPerDumpTool to 1000 by default.
+ Unreviewed, add victorw irc nickname to committer list.
- * Scripts/run-webkit-tests:
+ * Scripts/webkitpy/common/config/committers.py:
-2009-08-13 Nate Chapin <japhet@chromium.org>
+2010-07-15 Adam Roben <aroben@apple.com>
- Unreviewed.
+ Make killing Apache more reliable (on both Mac and Windows)
- Add myself to list of committers.
+ We previously had two ways of determining whether we had succeeded in
+ killing Apache:
+ 1) checking the return value of kill(0, $apachePID)
+ 2) checking whether Apache's PID file still exists
- * Scripts/modules/committers.py:
+ On Cygwin, Apache doesn't always delete its PID file when it exits,
+ making (2) unreliable. We unfortunately misdiagnosed this as an
+ impotency of Perl's kill function, which led to r63177 and r63355.
-2009-08-13 Brent Fulgham <bfulgham@webkit.org>
+ Now that we know that the real problem is that Apache doesn't always
+ delete its PID file on Windows, we can make a much better fix: always
+ use method (1) to determine whether we've killed Apache.
- Unreviewed.
+ Fixes <http://webkit.org/b/42415> Killing Apache is unreliable,
+ leading to regression test failures (and general annoyance).
- Add 'Brent Fulgham' to the committers list.
+ Reviewed by Anders Carlsson.
- * Scripts/modules/committers.py:
+ * Scripts/webkitperl/httpd.pm:
+ (openHTTPD): Moved killing code from here to killHTTPD. Added a call
+ to delete the PID file in case Apache doesn't do this itself when
+ killed. Our later logic relies on the PID file being deleted after
+ this point.
+ (closeHTTPD): Removed killing logic and changed to just call killHTTPD
+ instead. killHTTPD's logic is a bit different from the logic we had
+ here, for the reasons stated above.
+ (killHTTPD): Added. Code came from openHTTPD.
+ (handleInterrupt): Bonus fix for Mac: don't hang when pressing Ctrl-C!
+ On Mac, don't try to kill Apache when we receive a signal, as Apache
+ will already have been killed by this point (though for some reason
+ this isn't detected by our killing logic in killHTTPD). On Cygwin, we
+ still need to kill Apache manually.
+
+2010-07-15 Sam Weinig <sam@webkit.org>
-2009-08-13 Adam Langley <agl@chromium.org>
+ Reviewed by Anders Carlsson.
- Review not required.
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=42399
+ Update MiniBrowser for WKFrameNavigationType
- * Scripts/modules/committers.py:
- Adding myself to this list because Eric told me to.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (_decidePolicyForNavigationAction):
+ (_decidePolicyForNewWindowAction):
-2009-08-13 Greg Bolsinga <bolsinga@apple.com>
+2010-07-15 Stephanie Lewis <slewis@apple.com>
- Unreviewed.
+ Reviewed by Geoff Garen.
- Add 'Greg Bolsinga' to the committers list.
+ http://bugs.webkit.org/show_bug.cgi?id=42406
+ Make SunSpider work better with roots.
- * Scripts/modules/committers.py:
+ * Scripts/sunspider-compare-results: fix argument bug
+ * Scripts/webkitdirs.pm: look inside JavaScriptCore if jsc isn't top-level.
-2009-08-13 Adam Roben <aroben@apple.com>
+2010-07-15 Brady Eidson <beidson@apple.com>
- Fix off-by-one result comparisons in media tests on Windows Debug
- builds
+ Reviewed by Sam Weinig.
- media/video-played.html seems always to time out in Windows Debug
- builds. A race condition between media/video-test.js's "hang" timer and
- DumpRenderTree's built-in "watchdog" timer was causing results for
- media/video-played.html to be printed twice, causing all future media
- tests to be compared to the previous test's results.
+ Hook up back/forward in MiniBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=42397
- The fix is to make the watchdog timer got through the same code path
- as calling notifyDone manually, so that the results will only get
- printed once. A subsequent patch will remove video-test.js's hang
- timer entirely, since it is redundant.
+ * MiniBrowser/mac/BrowserWindow.xib:
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController goBack:]):
+ (-[BrowserWindowController goForward:]):
- Fixes <http://webkit.org/b/28265>.
+2010-07-15 Daniel Bates <dbates@rim.com>
- Reviewed by Mark Rowe.
+ Reviewed by Darin Adler.
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::waitToDumpWatchdogTimerFired): Added. Code came
- from Gtk/Mac/Win's watchdog timer handlers, but we now call
- notifyDone() instead of dump() so that a subsequent call to
- notifyDone() won't print the results out again.
+ [Mac] Implement LayoutTestController::markerTextForListItem()
+ https://bugs.webkit.org/show_bug.cgi?id=37929
- * DumpRenderTree/LayoutTestController.h: Added
- waitToDumpWatchdogTimerFired.
+ Implements DRT support for markerTextForListItem in the Mac port.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (waitToDumpWatchdogFired):
* DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (waitUntilDoneWatchdogFired):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (waitUntilDoneWatchdogFired):
- Changed to call waitToDumpWatchdogTimerFired.
+ (LayoutTestController::markerTextForListItem): Implemented.
-2009-08-13 Eric Carlson <eric.carlson@apple.com>
+2010-07-15 Adam Barth <abarth@webkit.org>
Unreviewed.
- Added 'Eric Carlson' to the committers list.
+ Update the port names to be more specific. Before this patch,
+ port-specific results for Mac would end up in the wrong place.
- * Scripts/modules/committers.py:
+ * Scripts/webkitpy/tool/commands/rebaseline.py:
+ * Scripts/webkitpy/tool/commands/rebaseline_unittest.py:
-2009-08-13 Dirk Schulze <krit@webkit.org>
+2010-07-14 Eric Seidel <eric@webkit.org>
- Unreviewed.
- Added 'Dirk Schulze' to the committers list.
+ Reviewed by Adam Barth.
- * Scripts/modules/committers.py:
+ WebKit needs a rebaselining tool (finally)
+ https://bugs.webkit.org/show_bug.cgi?id=42339
-2009-08-13 Adam Roben <aroben@apple.com>
+ This is a very basic rebaselining tool. It's not
+ quite as fancy as chromium's as it will only handle
+ updating failing results. It cannot yet handle adding new
+ results, or updating results where the results should not
+ replace existing results.
- Enable running testapi in run-javascriptcore-tests on Windows
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/tool/commands/__init__.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/rebaseline.py: Added.
+ * Scripts/webkitpy/tool/commands/rebaseline_unittest.py: Added.
- Fixes <http://webkit.org/b/24856> run-javascriptcore-tests should run
- testapi on Windows
+2010-07-14 Sheriff Bot <webkit.review.bot@gmail.com>
- Reviewed by Mark Rowe.
+ Unreviewed, rolling out r63352.
+ http://trac.webkit.org/changeset/63352
+ https://bugs.webkit.org/show_bug.cgi?id=42341
- * Scripts/run-javascriptcore-tests: Allow testapi to run if we're in
- the AppleWinWebKit configuration.
+ Broke plugin-initiate-popup-window.html and plugin-javascript-
+ access.html on snow leopard (Requested by abarth on #webkit).
-2009-08-13 Adam Roben <aroben@apple.com>
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (pluginAllocate):
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
+ (handleEventCarbon):
+ (handleEventCocoa):
- Re-enable testapi in run-javascriptcore-tests on Mac
+2010-07-14 Maciej Stachowiak <mjs@apple.com>
- This seems to have been mistakenly disabled in r47089.
+ Reviewed by Mark Rowe.
- Rubber-stamped by Mark Rowe.
+ Lower WebKitTestRunner notifyDone timeout to 6.0 for now, to make it easier to grind through the failures.
- * Scripts/run-javascriptcore-tests: Removed comment markers that were
- preventing running testapi.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
-2009-08-12 George Staikos <george.staikos@torchmobile.com>
+2010-07-14 Sheriff Bot <webkit.review.bot@gmail.com>
- Reviewed by Adam Treat.
+ Unreviewed, rolling out r63346.
+ http://trac.webkit.org/changeset/63346
+ https://bugs.webkit.org/show_bug.cgi?id=42295
- Enable WCSS and XHTML-MP flags for build-webkit.
+ Broke lots of tests, some of which probably just need new
+ results (Requested by aroben on #webkit).
- * Scripts/build-webkit:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (urlSuitableForTestResult):
-2009-08-12 David Kilzer <ddkilzer@apple.com>
+2010-07-14 Adam Roben <aroben@apple.com>
- run-webkit-tests: document --nthly flag in help message
+ Speed up killing of Apache on Windows
- Reviewed by Simon Fraser.
+ Fixes <http://webkit.org/b/42289> Killing Apache (and thus quitting
+ run-webkit-tests) takes a long time on Windows
- * Scripts/run-webkit-tests: Added --nthly flag to $usage string.
- Also noted that -1|--singly implies --nthly 1.
+ Reviewed by Darin Adler and Jon Honeycutt.
-2009-08-12 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitperl/httpd.pm:
+ (closeHTTPD): Use taskkill to kill Apache and its child processes.
+ Perl's kill seems ineffectual. We were already using taskkill, but
+ only after trying kill 20 times. Since kill never works, let's just
+ skip it entirely.
- No review, just fixing mismerged ChangeLogs.
+2010-07-14 Johnny Ding <jnd@chromium.org>
-2009-08-12 Eric Seidel <eric@webkit.org>
+ Reviewed by Adam Barth.
- Reviewed by Mark Rowe.
+ https://bugs.webkit.org/show_bug.cgi?id=41292
+ Add a new parameter to the test plugin to allow to specify a script and a
+ mouse/keyboard event. The specified script will be evaluated in the browser
+ when the specified event is received by the plugin.
- run-webkit-tests needs a --exit-after-failures=N option
- https://bugs.webkit.org/show_bug.cgi?id=28192
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (pluginAllocate):
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
+ (handleEventCarbon):
+ (handleEventCocoa):
- Added the option and deployed it to bugzilla-tool.
+2010-07-14 Adam Roben <aroben@apple.com>
- * Scripts/bugzilla-tool:
- * Scripts/run-webkit-tests:
+ Make urlSuitableForTestResult work for http: URLs, too
-2009-08-11 Eric Seidel <eric@webkit.org>
+ Fixes <http://webkit.org/b/42276>
+ http/tests/loading/preload-slow-loading.php and
+ http/tests/mime/uppercase-mime-type.html fail on Windows.
- Reviewed by Mark Rowe.
+ Reviewed by Darin Adler.
- bugzilla-tool : various improvements for running the commit-queue
- https://bugs.webkit.org/show_bug.cgi?id=28199
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (urlSuitableForTestResult): Don't bail if the URL starts with http://.
+ We want this function to work for those URLs, too!
- Make run_and_throw_if_fail silence STDERR as well as STDIN.
- I also changed run_and_throw_if_fail to use the /dev/null trick instead of .communicate() to avoid ever buffering the output (per abarth's suggestion).
- Change a few "print" statements to "log" so they appear in the output.
- Changed all string + uses to use string formatting instead (this is less error prone as it will automatically convert non-string objects).
- Added a little more logging so that --quiet mode is easier to understand.
- Changed clear_attachment_review_flag to clear_attachment_flags and made it clear the commit-queue flag as well.
- Added the ability for bugzilla-tool to reject patches from the commit-queue when they fail to compile/apply/etc.
- Added _find_select_element_for_flag to make the code for finding flag <select> elements clearer.
- Made curl call (downloading patch files) quieter.
+2010-07-13 Maciej Stachowiak <mjs@apple.com>
- * Scripts/bugzilla-tool:
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/scm.py:
+ Reviewed by Oliver Hunt.
-2009-08-12 Peter Kasting <pkasting@google.com>
+ Add placebo versions of some repaint test functions to WebKitTestRunner - good enough for non-pixel tests
+ https://bugs.webkit.org/show_bug.cgi?id=42227
- Reviewed by Darin Adler.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Initialize new bool
+ members.
+ (WTR::LayoutTestController::display): Dummy method.
+ (WTR::displayCallback): Call the dummy.
+ (WTR::repaintSweepHorizontallyCallback): ditto
+ (WTR::testRepaintCallback): ditto
+ (WTR::LayoutTestController::staticFunctions): Expose new methods.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::setTestRepaint): Set the flag (which currently does
+ nothing).
+ (WTR::LayoutTestController::setTestRepaintSweepHorizontally): ditto
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Change pattern that strips all trailing whitespace to just remove EOL
- chars (\r, \n), to make it clear that varying EOL chars is the primary
- problem being solved.
+2010-07-13 Andreas Kling <andreas.kling@nokia.com>
- * Scripts/prepare-ChangeLog:
- * Scripts/resolve-ChangeLogs:
- * Scripts/svn-create-patch:
- * Scripts/update-webkit:
+ Unreviewed. Adding myself as committer.
-2009-08-12 Kevin Ollivier <kevino@theolliviers.com>
+ * Scripts/webkitpy/common/config/committers.py:
- wx waf build fix, add new directories to the build.
+2010-07-07 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
- * wx/build/settings.py:
+ Reviewed by Darin Adler.
-2009-08-11 Adam Roben <aroben@apple.com>
+ Prevent assertion/duplicate loads for non-deferred subtitute-data loads
- Update DumpRenderTree for IWebUIDelegatePrivate changes
+ https://bugs.webkit.org/show_bug.cgi?id=30879
- Reviewed by Dave Hyatt.
+ MainResourceLoader uses the member m_initialRequest to store requests for future
+ deferred loads. When doing the actual load in handleDataLoadNow(), we therefore
+ have to clear this request so that subsequent entries into the loader will not
+ start yet another load.
- * DumpRenderTree/win/UIDelegate.h: Updated to match
- IWebUIDelegatePrivate.
+ This can happen as a result of a PageGroupLoadDeferrer going out of scope when
+ returning from Chrome::runJavaScriptAlert(), which calls setDeferredLoading(false),
+ but only in the case of using both substitute-data and non-deferred main resource
+ load together. That's why two new DRT functions were added:
-2009-08-12 Adam Roben <aroben@apple.com>
+ * queueLoadHTMLString()
+ * setDeferMainResourceLoad()
- Don't try to seek to the end of stdin on Cygwin
+ The change adds DRT hooks for Mac, Win and Qt for these two functions. For Mac
+ and Win the hook uses new SPI in WebDataSource. For Qt a new static member was
+ added to the FrameLoaderClientQt and accessed though DumpRenderTreeSupportQt.
- Doing so seems to always cause an exception (for unknown reasons).
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (queueLoadHTMLStringCallback):
+ (setDeferMainResourceDataLoadCallback):
+ (LayoutTestController::staticFunctions):
+ (LayoutTestController::queueLoadHTMLString):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::deferMainResourceDataLoad):
+ (LayoutTestController::setDeferMainResourceDataLoad):
+ * DumpRenderTree/WorkQueueItem.h:
+ (LoadHTMLStringItem::LoadHTMLStringItem):
+ * DumpRenderTree/gtk/WorkQueueItemGtk.cpp:
+ (LoadHTMLStringItem::invoke):
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
+ * DumpRenderTree/mac/WorkQueueItemMac.mm:
+ (LoadHTMLStringItem::invoke):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::setDeferMainResourceDataLoad):
+ (LayoutTestController::queueLoadHTMLString):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/qt/WorkQueueItemQt.cpp:
+ (LoadHTMLStringItem::invoke):
+ * DumpRenderTree/qt/WorkQueueItemQt.h:
+ (LoadHTMLStringItem::LoadHTMLStringItem):
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::willSendRequest):
+ * DumpRenderTree/win/WorkQueueItemWin.cpp:
+ (LoadHTMLStringItem::invoke):
+ * DumpRenderTree/wx/WorkQueueItemWx.cpp:
+ (LoadHTMLStringItem::invoke):
- Fixes <http://webkit.org/b/28159> create-bug throws an exception in
- Cygwin
+2010-07-13 Maciej Stachowiak <mjs@apple.com>
- Reviewed by Dave Kilzer.
+ Reviewed by Nikolas Zimmermann.
- * Scripts/bugzilla-tool:
- (CreateBug.prompt_for_bug_title_and_comments): Ignore IOErrors
- generated by calling sys.stdin.seek, since these seem to be generated
- for no good reason on Cygwin.
+ Activate test fonts for layout tests in WebKitTestRunner (on Mac)
+ https://bugs.webkit.org/show_bug.cgi?id=42153
+
+ * WebKitTestRunner/InjectedBundle/ActivateFonts.h: Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::initialize): Activate fonts on startup.
+ * WebKitTestRunner/InjectedBundle/mac: Added.
+ * WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm: Added.
+ (WTR::activateFonts): Activate our fonts.
+ * WebKitTestRunner/InjectedBundle/win: Added.
+ * WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp: Added.
+ (WTR::activateFonts): Dummy version.
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Copy fonts to bundle;
+ add more files.
+ * WebKitTestRunner/fonts: Added.
+ * WebKitTestRunner/fonts/AHEM____.TTF: Added.
+ * WebKitTestRunner/fonts/ColorBits-A.png: Added.
+ * WebKitTestRunner/fonts/ColorBits.ttf: Added.
+ * WebKitTestRunner/fonts/WebKit Layout Tests 2.ttf: Added.
+ * WebKitTestRunner/fonts/WebKit Layout Tests.ttf: Added.
+ * WebKitTestRunner/fonts/WebKitWeightWatcher100.ttf: Added.
+ * WebKitTestRunner/fonts/WebKitWeightWatcher200.ttf: Added.
+ * WebKitTestRunner/fonts/WebKitWeightWatcher300.ttf: Added.
+ * WebKitTestRunner/fonts/WebKitWeightWatcher400.ttf: Added.
+ * WebKitTestRunner/fonts/WebKitWeightWatcher500.ttf: Added.
+ * WebKitTestRunner/fonts/WebKitWeightWatcher600.ttf: Added.
+ * WebKitTestRunner/fonts/WebKitWeightWatcher700.ttf: Added.
+ * WebKitTestRunner/fonts/WebKitWeightWatcher800.ttf: Added.
+ * WebKitTestRunner/fonts/WebKitWeightWatcher900.ttf: Added.
+
+2010-07-13 Dumitru Daniliuc <dumi@chromium.org>
-2009-08-12 Adam Roben <aroben@apple.com>
+ Reviewed by Eric Seidel.
- Don't raise an exception when --cc is not passed to create-bug
+ Remove check-header-includes, as it didn't turn out to be very useful.
+ https://bugs.webkit.org/show_bug.cgi?id=41970
- Fixes <http://webkit.org/b/28158> create-bug throws an exception if
- --cc is not specified
+ * Scripts/check-header-includes: Removed.
- Reviewed by Dave Kilzer.
+2010-07-12 Steve Falkenburg <sfalken@apple.com>
- * Scripts/modules/bugzilla.py:
- (Bugzilla.create_bug_with_patch): Only set the "cc" field if a CC
- string was specified. Otherwise we'll generate an exception about the
- "cc" variable not being a string.
+ Reviewed by Maciej Stachowiak.
-2009-08-11 Eric Seidel <eric@webkit.org>
+ Make WebKit2 be built by build-webkit (so it will be built by build.webkit.org bots)
+ https://bugs.webkit.org/show_bug.cgi?id=40922
+
+ Always build WebKit2 on Windows. Necessary since our WebKit build on
+ Windows is packaged into a DLL with WebKit2.
- Reviewed by Adam Barth.
+ * Scripts/build-webkit: Always build WebKit2 on Windows.
- bugzilla-tool : various improvements for running the commit-queue
- https://bugs.webkit.org/show_bug.cgi?id=28199
+2010-07-12 Brian Weinstein <bweinstein@apple.com>
- Make run_and_throw_if_fail silence STDERR as well as STDIN.
- I also changed run_and_throw_if_fail to use the /dev/null trick instead of .communicate() to avoid ever buffering the out
- Change a few "print" statements to "log" so they appear in the output.
- Changed all string + uses to use string formatting instead (this is less error prone as it will automatically convert non
- Added a little more logging so that --quiet mode is easier to understand.
- Changed clear_attachment_review_flag to clear_attachment_flags and made it clear the commit-queue flag as well.
- Added the ability for bugzilla-tool to reject patches from the commit-queue when they fail to compile/apply/etc.
- Added _find_select_element_for_flag to make the code for finding flag <select> elements clearer.
- Made curl call (downloading patch files) quieter.
+ Reviewed by Steve Falkenburg.
- * Scripts/bugzilla-tool:
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/scm.py:
+ One http test timing out on Windows can cause all future tests to time out
+ https://bugs.webkit.org/show_bug.cgi?id=42146
+
+ There have been multiple times on the Windows bots where one http test timing out causes all future
+ http tests to time out. This is because the httpd process becomes unresponsive. When an http test
+ times out, we should restart httpd on Cygwin to prevent this.
-2009-08-11 Eric Seidel <eric@webkit.org>
+ * Scripts/old-run-webkit-tests: If an http test timed out on Cygwin, close httpd and restart it.
+ * Scripts/webkitperl/httpd.pm: Add additional logic to closeHTTPD to teach it about taskkill if
+ using kill fails.
- No review, script regression fix only.
+2010-07-12 Maciej Stachowiak <mjs@apple.com>
- run-webkit-tests --quiet hangs
- https://bugs.webkit.org/show_bug.cgi?id=28202
+ Reviewed by Dan Bernstein.
- Do a huge dance to get open3 to pipe to /dev/null w/o blocking.
- This was what I came up with after discussions in #perl.
+ Remove use of auto_ptr in WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=42134
+
+ Replaced auto_ptr with PassOwnPtr / OwnPtr.
- * Scripts/run-webkit-tests:
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::WKStringToUTF8):
+ (WTR::InjectedBundlePage::dump):
+ (WTR::InjectedBundlePage::addMessageToConsole):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::WKStringToUTF8):
+ (WTR::TestInvocation::didRecieveMessageFromInjectedBundle):
-2009-08-11 John Gregg <johnnyg@google.com>
+2010-07-12 Maciej Stachowiak <mjs@apple.com>
- Reviewed by Maciej Stachowiak.
+ Reviewed by Sam Weinig.
- Switch DumpRenderTree to contain a WebUIDelegate2, which extends
- WebUIDelegate, so that the notifications tests will still work.
- https://bugs.webkit.org/show_bug.cgi?id=28198
+ Need support for a WebKit2-specific Skipped list (and initially add accessibility tests to it)
+ https://bugs.webkit.org/show_bug.cgi?id=42132
- * DumpRenderTree/win/UIDelegate.h:
+ * Scripts/old-run-webkit-tests: In --webkit-test-runner mode, add mac-wk2 to list of
+ platform directories.
-2009-08-11 Darin Adler <darin@apple.com>
+2010-07-12 Maciej Stachowiak <mjs@apple.com>
- Try to fix GTK build.
+ Reviewed by Anders Carlsson.
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
- (AccessibilityUIElement::stringForRange): Added.
+ Make WebKitTestRunner resize the view specially for the W3C SVG tests.
+ https://bugs.webkit.org/show_bug.cgi?id=42126
+
+ * WebKitTestRunner/PlatformWebView.h:
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::TestInvocation): Store the path as a C
+ string for later use.
+ (WTR::TestInvocation::~TestInvocation):
+ (WTR::sizeWebViewForCurrentTest): Resize the WebView to the proper
+ size, depending on whether this is a W3C SVG test.
+ (WTR::TestInvocation::invoke): Call the size function.
+ * WebKitTestRunner/TestInvocation.h:
+ * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+ (WTR::PlatformWebView::resizeTo): Implement.
+ * WebKitTestRunner/win/PlatformWebViewWin.cpp:
+ (WTR::PlatformWebView::resizeTo): Placeholder.
+
+2010-07-12 Mario Sanchez Prada <msanchez@igalia.com>
-2009-08-10 Mike Fenton <mike.fenton@torchmobile.com>
+ Reviewed by Xan Lopez.
- Reviewed by Adam Treat.
+ Ensure DRT loads GAIL (Gtk+ module), for a11y tests
+ https://bugs.webkit.org/show_bug.cgi?id=38648
- Add processing for string constants used by the tests to trigger
- common actions like up, down, left, right, etc. for the Qt
- implementation of DumpRenderTree.
+ Add the GTK_MODULES envvar (set to "gail") to the clean
+ environment when running DRT for the Gtk+ port
- Note this allows fast/forms/textarea-arrow-navigation.html to pass
- correctly.
+ * Scripts/old-run-webkit-tests:
- https://bugs.webkit.org/show_bug.cgi?id=28161
+2010-07-12 Martin Robinson <mrobinson@igalia.com>
- * DumpRenderTree/qt/jsobjects.cpp:
- (EventSender::keyDown):
+ Reviewed by Dirk Schulze.
-2009-08-11 Chris Fleizach <cfleizach@apple.com>
+ [GTK] Support pixel tests
+ https://bugs.webkit.org/show_bug.cgi?id=31518
- Reviewed by Darin Adler.
+ Finish support for pixel tests on GTK+.
- Bug 28200 - ListMarker should be included as part of the text value to parse
- https://bugs.webkit.org/show_bug.cgi?id=28200
+ * DumpRenderTree/PixelDumpSupport.cpp: Remove unecessary RetainPtr include (only
+ works on CoreFoundation systems) and add missing cstdio include.
+ * DumpRenderTree/cairo/PixelDumpSupportCairo.cpp: Switch to using the MD5 support found
+ in JSC library. MD5.cpp and MD5.h are only available for the Windows build.
+ (computeMD5HashStringForBitmapContext): The number of bytes per row should be the row stride
+ of the image, not the row stride multiplied by the width. Use JSC MD5 implementation to calculate
+ the MD5 hash here. According to glibc manpages, using snprintf to build a string in unsupported
+ by the ANSI standard and this fails on Linux, so unroll the loop here.
+ * DumpRenderTree/cairo/PixelDumpSupportCairo.h: Correct some constructor misbehavior.
+ (BitmapContext::BitmapContext): There is no reason to check the value of the
+ m_context member in the constructor and it certainly should not be freed. Instead
+ just initialize it with the incoming value.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp: Fix the order of includes.
+ (dump): Actually call dumpWebViewAsPixelsAndCompareWithExpected when it is time to
+ dump pixels.
+ * DumpRenderTree/gtk/PixelDumpSupportGtk.cpp: Added.
+ (createBitmapContextFromWebView):
+ * GNUmakefile.am: Add new files to the build.
- Add the ability to retrieve a string given a plain NSRange.
+2010-07-12 Adam Barth <abarth@webkit.org>
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (stringForRangeCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::valueDescription):
- (AccessibilityUIElement::stringForRange):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::stringForRange):
+ Unreviewed.
-2009-08-11 Dmitry Titov <dimich@chromium.org>
+ Remove stray "raise e" that got included in a previous patch. This
+ caused the EWS bots to turn red instead of purple when a patch failed
+ to apply.
- Reviewed by NOBODY (Speculative fix for the layout test failure).
+ * Scripts/webkitpy/tool/commands/stepsequence.py:
- Fix fast/dom/prototype-inheritance.html
- and fast/dom/prototype-inheritance-2.html
- broken on Windows by http://trac.webkit.org/changeset/47018
+2010-07-12 Sheriff Bot <webkit.review.bot@gmail.com>
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues): enable app cache in Windows DRT.
+ Unreviewed, rolling out r63101.
+ http://trac.webkit.org/changeset/63101
+ https://bugs.webkit.org/show_bug.cgi?id=42103
-2009-08-11 Eric Seidel <eric@webkit.org>
+ Broke one API test (Requested by xan_ on #webkit).
- Reviewed by Adam Barth.
+ * Scripts/old-run-webkit-tests:
- bugzilla-tool: Re-factor shared landing logic into helper class to share more code
- https://bugs.webkit.org/show_bug.cgi?id=28193
+2010-07-12 Alexey Proskuryakov <ap@apple.com>
- Added new WebKitLandingScripts class to hold this shared logic.
- Also added a view_source_url function to move more webkit-specific urls out of bugzilla-tool core.
+ Reviewed by Adam Roben.
- * Scripts/bugzilla-tool:
+ https://bugs.webkit.org/show_bug.cgi?id=13075
+ XMLHttpRequest with failed authentication should set status to 401
-2009-08-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ https://bugs.webkit.org/show_bug.cgi?id=6871
+ <rdar://problem/3363403> 401 error page is never shown
- Reviewed by Adam Treat.
+ Fix crashes in Windows DumpRenderTree.
- Fix the current failures on the buildbot.
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp: (ResourceLoadDelegate::didReceiveAuthenticationChallenge):
+ If we return an error, WebKit will call continueWithoutCredentialForAuthenticationChallenge()
+ again on a destroyed sender.
- As Qt hooks up the maybeDump to loadFinished, we need to make
- sure that calling dump() will not call maybeDump on loadFinished.
+2010-07-12 Adam Roben <aroben@apple.com>
- As dump is called my emitting done() which calls dump() and then
- setting m_isLoading to false. So in the case m_isLoading is false,
- do not dump again.
+ Windows failure-to-launch fix
- The current code is confusing, and should be made more clear
- in another commit.
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Copy CoreVideo.dll and
+ CoreVideo.pdb into WebKitOutputDir in the post-build event, too, like
+ we already do for CoreFoundation, CFNetwork, etc.
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::maybeDump):
- (LayoutTestController::notifyDone):
+2010-07-12 Mario Sanchez Prada <msanchez@igalia.com>
-2009-08-11 John Gregg <johnnyg@google.com>
+ Reviewed by Xan Lopez.
- Reviewed by Maciej Stachowiak.
+ Ensure DRT loads GAIL (Gtk+ module), for a11y tests
+ https://bugs.webkit.org/show_bug.cgi?id=38648
- Add support for desktop notifications API to DumpRenderTree,
- and support for ENABLE_NOTIFICATIONS flag to build-webkit.
+ Add the GTK_MODULES envvar (set to "gail") to the clean
+ environment when running DRT for the Gtk+ port
- * DumpRenderTree/LayoutTestController.cpp:
- (grantDesktopNotificationPermissionCallback):
- (LayoutTestController::staticFunctions):
- (LayoutTestController::grantDesktopNotificationPermission):
- (LayoutTestController::checkDesktopNotificationPermission):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp: Added.
- (DRTDesktopNotificationPresenter::DRTDesktopNotificationPresenter):
- (DRTDesktopNotificationPresenter::QueryInterface):
- (DRTDesktopNotificationPresenter::AddRef):
- (DRTDesktopNotificationPresenter::Release):
- (DRTDesktopNotificationPresenter::showDesktopNotification):
- (DRTDesktopNotificationPresenter::cancelDesktopNotification):
- (DRTDesktopNotificationPresenter::notificationDestroyed):
- (DRTDesktopNotificationPresenter::checkNotificationPermission):
- (DRTDesktopNotificationPresenter::requestNotificationPermission):
- * DumpRenderTree/win/DRTDesktopNotificationPresenter.h: Added.
- * DumpRenderTree/win/DumpRenderTree.vcproj:
- * DumpRenderTree/win/UIDelegate.cpp:
- (UIDelegate::UIDelegate):
- (UIDelegate::desktopNotificationsDelegate):
- * DumpRenderTree/win/UIDelegate.h:
- * Scripts/build-webkit:
+ * Scripts/old-run-webkit-tests:
-2009-08-11 Peter Kasting <pkasting@google.com>
+2010-07-09 Alexey Proskuryakov <ap@apple.com>
Reviewed by Darin Adler.
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Handle arbitrary line endings when manufacturing patches for additions
- with history.
+ https://bugs.webkit.org/show_bug.cgi?id=13075
+ XMLHttpRequest with failed authentication should set status to 401
- * Scripts/svn-create-patch:
+ https://bugs.webkit.org/show_bug.cgi?id=6871
+ <rdar://problem/3363403> 401 error page is never shown
-2009-08-11 Peter Kasting <pkasting@google.com>
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]):
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::didReceiveAuthenticationChallenge):
+ Do respond even if handlesAuthenticationChallenges() is false. Pretend that the user pressed
+ the Cancel button.
- Reviewed by Darin Adler.
+2010-07-12 Andreas Kling <andreas.kling@nokia.com>
- https://bugs.webkit.org/show_bug.cgi?id=28183
- Support VS2008 as well as VS2005 in a few scripts.
+ Reviewed by Tor Arne Vestbø.
- * Scripts/pdevenv: Check both $VS80COMNTOOLS and $VS90COMNTOOLS.
- * Scripts/webkitdirs.pm: Use $VSINSTALLDIR if available instead of hardcoding the VS2005 dir.
+ [Qt] Add location bar (Ctrl+L) shortcut in QtTestBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=42082
-2009-08-11 Eric Seidel <eric@webkit.org>
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::createChrome):
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::openLocation):
+ * QtTestBrowser/mainwindow.h:
- Reviewed by Adam Barth.
+2010-07-12 Adam Roben <aroben@apple.com>
- run-webkit-tests --quiet should not output build-dumprendertree output
- https://bugs.webkit.org/show_bug.cgi?id=28189
+ Make the Python autoinstaller not use a dead SourceForge server
- * Scripts/run-webkit-tests:
+ Fixes <http://webkit.org/b/42080> webkit-patch is broken due to
+ offline SourceForge server
-2009-08-11 Eric Seidel <eric@webkit.org>
+ Reviewed by Anders Carlsson.
- Reviewed by Darin Adler.
+ * Scripts/webkitpy/thirdparty/__init__.py: Use
+ surfnet.dl.sourceforge.net instead of hivelocity.dl.sourceforge.net,
+ which seems to be down.
- Exception in land-patches
- https://bugs.webkit.org/show_bug.cgi?id=27962
+2010-07-12 Adam Roben <aroben@apple.com>
- Use ("%s" % object) instead of ("" + object).
- Added unit tests for logging.py.
+ Make run-webkit-tests print how many tests timed out when exiting
+ early
- * Scripts/modules/logging.py:
- * Scripts/modules/logging_unittest.py: Added.
- * Scripts/run-webkit-unittests:
+ The number of timed-out tests is taken into account when deciding
+ whether to exit early. Leaving it out of the output just makes the
+ script look buggy (because it might say something like "Exiting early
+ after 0 crashes.").
-2009-08-11 Dmitry Titov <dimich@chromium.org>
+ Fixes <http://webkit.org/b/42077> run-webkit-tests prints confusing
+ messages when exiting early due to crashes and time-outs
- Reviewed by NOBODY (Windows layout tests fix).
+ Reviewed by Anders Carlsson.
- Fix for layout tests failures. Need to initialize some preferences early
- because WebView on Windows uses them during create time.
+ * Scripts/old-run-webkit-tests:
+ (stopRunningTestsEarlyIfNeeded): When stopping, print the number of
+ timed-out tests, too.
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (main):
+2010-07-11 Maciej Stachowiak <mjs@apple.com>
-2009-08-11 Dmitry Titov <dimich@chromium.org>
+ Reviewed by Dan Bernstein.
- Reviewed by Adam Roben.
+ Implement animation-related methods for WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=42053
+
+ Implemented numberOfActiveAnimatiosn and pauseAnimationAtTimeOnElementWithId. Many
+ animation tests were hanging otherwise.
- Originally implemented by Glenn Wilson <gwilson@chromium.org>.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::numberOfActiveAnimations):
+ (WTR::LayoutTestController::pauseAnimationAtTimeOnElementWithId):
+ (WTR::numberOfActiveAnimationsCallback):
+ (WTR::pauseAnimationAtTimeOnElementWithIdCallback):
+ (WTR::LayoutTestController::staticFunctions):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
- Added support for overriding default preferences per-test.
- See https://bugs.webkit.org/show_bug.cgi?id=20534
+2010-07-11 Daniel Bates <dbates@rim.com>
- * DumpRenderTree/LayoutTestController.cpp:
- (overridePreferenceCallback): add wiring for layoutTestController.overridePreference.
- (LayoutTestController::staticFunctions): same.
- * DumpRenderTree/LayoutTestController.h: same.
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::overridePreference): added empty overridePreference method.
- * DumpRenderTree/mac/DumpRenderTree.mm: implemented preference override.
- (resetDefaultsToConsistentValues): new method, resets preferences to same set of value before every test.
- (setDefaultsToConsistentValuesForTesting): new method, sets other details of testing environment, every time DRT starts.
- (resetWebViewToConsistentStateBeforeTesting): move some preference setting from here to new resetDefaultsToConsistentValues().
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::overridePreference):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetDefaultsToConsistentValues): new method, resets preferences to same set of value before every test.
- (resetWebViewToConsistentStateBeforeTesting): move some preference setting from here to new resetDefaultsToConsistentValues().
- (createWebViewAndOffscreenWindow): same.
- (main): same.
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::overridePreference):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::overridePreference):
+ Reviewed by David Kilzer.
-2009-08-11 Brian Weinstein <bweinstein@apple.com>
+ Enable executable support for svn-apply and svn-unapply
+ https://bugs.webkit.org/show_bug.cgi?id=39409
- Reviewed by Sam Weinig.
+ Connect up the Git and SVN executable bit support in parseDiff() so that
+ executable bit changes are propagated via the returned diff hash to the
+ patch function in svn-apply and svn-unapply.
- Added support for DRT to support arguments for eventSender.mouseDown and eventSender.mouseUp for Windows.
- https://bugs.webkit.org/show_bug.cgi?id=28166.
-
- This is a step towards fixing fast/events/mouse-click-events.html on Windows.
+ * Scripts/VCSUtils.pm:
+ - Modified parseDiff() to call parseSvnDiffProperties when
+ it finds the start of an SVN property change diff.
+ - Removed FIXME comment above parseSvnDiffProperties() since
+ it is now being used by parseDiff().
+ - Export method scmToggleExecutableBit() now that we added the
+ executableBitDelta hash key. (This should have been exported
+ when we added this function in Bug #38423 <https://bugs.webkit.org/show_bug.cgi?id=38423>).
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+ - Updated results for:
+ "rename (with executable bit change)"
+ - Test value of executableBitDelta (now that we have support).
+ "SVN: binary file (isBinary true)"
+ - Remove the property change diff from svnConvertedText. We plan
+ to remove svnConvertedText in the future. So, we decided
+ against adding such support to any new code, such as the
+ property parsing routines. Therefore, we do not keep SVN
+ converted text for property change diffs.
+ - Added unit tests:
+ "SVN: file change diff with property change diff"
+ "SVN: file change diff, followed by property change diff on different file"
+ "SVN: property diff, followed by file change diff"
+ "SVN: copied file with property change"
+ "SVN: two consecutive property diffs"
+ "SVN: binary file with executable bit change"
+ "SVN: binary file followed by property change on different file"
+ "SVN: binary file followed by file change on different file"
+ "SVN: file change diff with property change, followed by property change diff"
+ "SVN: file change diff with property change, followed by file change diff"
+
+2010-07-11 Maciej Stachowiak <mjs@apple.com>
- * DumpRenderTree/win/EventSender.cpp:
- (mouseDownCallback):
- (mouseUpCallback):
- (replaySavedEvents):
+ Reviewed by Dan Bernstein.
-2009-08-11 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ Implement waitUntilDone and notifyDone for WebKitTestRunner
+ https://bugs.webkit.org/show_bug.cgi?id=42049
- Reviewed by Simon Hausmann.
+ With this fix, most of the DOM tests pass.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::didCreatePage): Track the main page. Not
+ a great way to do it in the future case where we may get multiple
+ pages - we really need a way to send it over from the ui process.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (WTR::InjectedBundle::page): A way to get the main page.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage): Initialize m_isLoading to false.
+ (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame): Track that we
+ are loading.
+ (WTR::InjectedBundlePage::dump): Factor into a method so this can be
+ called by the layout test controller. Also, cancel any pending watchdogs.
+ (WTR::InjectedBundlePage::didFinishLoadForFrame): Note that we are done loading.
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame): Ditto.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
+ (WTR::InjectedBundlePage::isLoading): A way to track if we are loading.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp:
+ (WTR::LayoutTestController::LayoutTestController): Initialize m_waitToDump
+ to false.
+ (WTR::LayoutTestController::invalidateWaitToDumpWatchdog): Invalidate
+ the watchdog.
+ (WTR::waitUntilDoneWatchdogFired): Static helper for the watchdog timer.
+ (WTR::LayoutTestController::setWaitToDump): Set the flag.
+ (WTR::LayoutTestController::waitToDumpWatchdogTimerFired): Handle the case
+ where waitUntilDone times out.
+ (WTR::LayoutTestController::notifyDone): Dump, if loading is done.
+ (WTR::waitUntilDoneCallback): JS glue for waitUntilDone.
+ (WTR::notifyDoneCallback): JS glue for notifyDone.
+ (WTR::LayoutTestController::staticFunctions): Add waitUntilDone and notifyDone
+ to the layoutController.
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+ (WTR::LayoutTestController::waitToDump): Inline method to get the wait state.
+
+2010-07-09 Brian Weinstein <bweinstein@apple.com>
- Build the TestNetscapePlugin on Qt/Mac
+ Rubber-stamped by Dan Bernstein.
- * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ Windows testers running Windows 7 were hanging during test_kill_process. Changing the
+ number of attempts from 3 to 10 fixes the problem on the new bots (and doesn't seem to
+ slow down the tests).
-2009-08-11 Dmitry Titov <dimich@chromium.org>
+ * Scripts/webkitpy/common/system/executive.py:
- Reviewed by NOBODY (build fix).
+2010-07-09 Luiz Agostini <luiz.agostini@openbossa.org>
- Attempt to fix the Windows test bot. Reverted r47015 caused one of the Windows
- bots that runs Layout Tests to save "JS disabled" and "default font 24pt"
- preferences permanently. Since these preferences are not initialized explicitly in DRT,
- almost all Layout tests are failing. Attempt to fix by explicit
- initialization of these into defaults (enabled, 16pt) at the beginning of the DRT.
+ Reviewed by Kenneth Rohde Christiansen.
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (main): see above.
+ [Qt] Mac build fix
+ https://bugs.webkit.org/show_bug.cgi?id=41967
-2009-08-10 Steve Falkenburg <sfalken@apple.com>
+ Adding file PluginObjectMac.mm and frameworks Cocoa and QuartzCore.
- Windows nightly fix.
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
- Reviewed by Ada Chan.
+2010-07-09 Diego Gonzalez <diegohcg@webkit.org>
- * FindSafari/FindSafari.cpp:
- (_tmain): Copy Safari.dll if it exists.
+ Reviewed by Antonio Gomes.
-2009-08-10 David Levin <levin@chromium.org>
+ [Qt] [WebKit2] Add navigation actions to MiniBrowser toolbar
+ https://bugs.webkit.org/show_bug.cgi?id=41966
- Reviewed by David Kilzer.
+ * MiniBrowser/qt/BrowserWindow.cpp:
+ (BrowserWindow::BrowserWindow):
- check-webkit-style doesn't catch braces around single line statements when followed by else.
- https://bugs.webkit.org/show_bug.cgi?id=28164
+2010-07-09 Leon Clarke <leonclarke@google.com>
- * Scripts/modules/cpp_style.py: Added else to the regex that finds ending }'s when
- checking the no braces for "single lines" rule.
- * Scripts/modules/cpp_style_unittest.py: Added test case.
+ Reviewed by Adam Barth.
-2009-08-10 David Kilzer <ddkilzer@apple.com>
+ add support for link prefetching
+ https://bugs.webkit.org/show_bug.cgi?id=3652
- <http://webkit.org/b/28163> bugzilla-tool: scm module should not import bugzilla module
+ * Scripts/build-webkit:
- Reviewed by David Levin.
+2010-07-09 Ojan Vafai <ojan@chromium.org>
- * Scripts/bugzilla-tool:
- (parse_bug_id): Added. Moved from CommitMessage.parse_bug_id()
- in scm module.
- * Scripts/modules/scm.py: Removed import of bugzilla module.
- (CommitMessage.parse_bug_id): Deleted.
+ Reviewed by Adam Barth.
-2009-08-10 Peter Kasting <pkasting@google.com>
+ r63004 broke some python tests
+ https://bugs.webkit.org/show_bug.cgi?id=42007
- Reviewed by David Kilzer.
+ AbstractStep now checks options.no_squash and options.squash, so
+ they needed to have real values. Mock would return an object for those,
+ which would then act as if the values were True.
- https://bugs.webkit.org/show_bug.cgi?id=18599
- Work around apparent bug in abs2rel() with symlinked directories.
+ * Scripts/webkitpy/tool/commands/commandtest.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/stepsequence.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog_unittest.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer_unittest.py:
- * Scripts/resolve-ChangeLogs:
+2010-07-09 Ojan Vafai <ojan@chromium.org>
-2009-08-10 Dan Bernstein <mitz@apple.com>
+ Reviewed by Adam Barth.
- Build fix
+ --squash should go away and become the default
+ https://bugs.webkit.org/show_bug.cgi?id=39624
- * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
- (NPP_New):
+ If there are local commits and working copy changes, then prompt the user
+ whether to continue. Setting git config webkit-patch.commit_should_always_squash
+ true bypasses the prompt.
-2009-08-10 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ --git-commit=HEAD.. operates on working copy changes only.
+ --git-commit=committish operates on a range of commits as a single commit.
+ e.g. --git-commit=HEAD only operates on the HEAD commit.
+ --git-commit=HEAD~4..HEAD~2 will operate on HEAD~3 and HEAD~2 as a single commit.
- Reviewed by Simon Hausmann.
+ --no-squash and --squash are left in with descriptive error messages if used.
- Fix a bunch of build warnings in TestNetscapePlugin
-
- * DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp:
- * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ * Scripts/check-webkit-style:
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/common/net/rietveld.py:
+ * Scripts/webkitpy/common/system/user.py:
+ * Scripts/webkitpy/style/optparser.py:
+ * Scripts/webkitpy/style_references.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py:
+ * Scripts/webkitpy/tool/steps/checkstyle.py:
+ * Scripts/webkitpy/tool/steps/checkstyle_unittest.py: Removed.
+ * Scripts/webkitpy/tool/steps/commit.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+
+2010-07-09 Mark Rowe <mrowe@apple.com>
+
+ Add two new Windows test build slaves.
-2009-08-10 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
- Reviewed by Adam Roben.
-
- Allow TestNetscapePlugIn to fall back to the Carbon event model
-
- Previously the plugin would fail, even though the Carbon event
- model was available. The only way to get the Carbon event model
- was to pass the "forcecarbon" argument in the test markup, but no
- tests were using this.
-
- Now the plugin uses carbon either if it's forced, or if the Cocoa
- event model is not supported.
-
- This helps us run most of the plugin tests on Qt/Mac, which still
- does not support the Cocoa event model.
-
- * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
- (NPP_New):
+2010-07-09 Albert J. Wong <ajwong@chromium.org>
-2009-08-08 Adam Barth <abarth@webkit.org>
+ Reviewed by David Levin.
- Reviewed by Eric Seidel.
+ rebaseline_chromium_webkit_tests missing --use_drt option on linux
+ https://bugs.webkit.org/show_bug.cgi?id=41985
- bugzilla-tool needs a --quiet option
- https://bugs.webkit.org/show_bug.cgi?id=28060
+ This adds in the --use_drt option for rebaseline_chromium_webkit_tests
+ so that it works on linux. This is essentially a "compile-fix" for the
+ script.
- A first pass at a --quiet option. This doesn't do all the excting
- things we might want, but it addresses 80% of the use case.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- * Scripts/bugzilla-tool:
+2010-07-09 Nico Weber <thakis@chromium.org>
-2009-08-08 Jan Michael Alonzo <jmalonzo@webkit.org>
+ Unreviewed. Adding myself as committer.
- Reviewed by Xan Lopez.
+ * Scripts/webkitpy/common/config/committers.py:
- [Gtk] Enable accessibility in Gtk DRT
- https://bugs.webkit.org/show_bug.cgi?id=25989
+2010-07-09 David Kilzer <ddkilzer@apple.com>
- Add Accessibility support to the GTK DRT.
+ Revert "<http://webkit.org/b/41788> commit-log-editor: wrong ChangeLog read when invoked from subdir with git"
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp: Added.
- (AccessibilityController::AccessibilityController):
- (AccessibilityController::~AccessibilityController):
- (AccessibilityController::focusedElement):
- (AccessibilityController::rootElement):
- * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp: Added.
- (AccessibilityUIElement::AccessibilityUIElement):
- (AccessibilityUIElement::~AccessibilityUIElement):
- (AccessibilityUIElement::getLinkedUIElements):
- (AccessibilityUIElement::getDocumentLinks):
- (AccessibilityUIElement::getChildren):
- (AccessibilityUIElement::getChildrenWithRange):
- (AccessibilityUIElement::childrenCount):
- (AccessibilityUIElement::elementAtPoint):
- (AccessibilityUIElement::getChildAtIndex):
- (AccessibilityUIElement::allAttributes):
- (AccessibilityUIElement::attributesOfLinkedUIElements):
- (AccessibilityUIElement::attributesOfDocumentLinks):
- (AccessibilityUIElement::titleUIElement):
- (AccessibilityUIElement::parentElement):
- (AccessibilityUIElement::attributesOfChildren):
- (AccessibilityUIElement::parameterizedAttributeNames):
- (AccessibilityUIElement::role):
- (AccessibilityUIElement::title):
- (AccessibilityUIElement::description):
- (AccessibilityUIElement::language):
- (AccessibilityUIElement::x):
- (AccessibilityUIElement::y):
- (AccessibilityUIElement::width):
- (AccessibilityUIElement::height):
- (AccessibilityUIElement::clickPointX):
- (AccessibilityUIElement::clickPointY):
- (AccessibilityUIElement::intValue):
- (AccessibilityUIElement::minValue):
- (AccessibilityUIElement::maxValue):
- (AccessibilityUIElement::valueDescription):
- (AccessibilityUIElement::isEnabled):
- (AccessibilityUIElement::insertionPointLineNumber):
- (AccessibilityUIElement::isActionSupported):
- (AccessibilityUIElement::isRequired):
- (AccessibilityUIElement::attributesOfColumnHeaders):
- (AccessibilityUIElement::attributesOfRowHeaders):
- (AccessibilityUIElement::attributesOfColumns):
- (AccessibilityUIElement::attributesOfRows):
- (AccessibilityUIElement::attributesOfVisibleCells):
- (AccessibilityUIElement::attributesOfHeader):
- (AccessibilityUIElement::indexInTable):
- (AccessibilityUIElement::rowIndexRange):
- (AccessibilityUIElement::columnIndexRange):
- (AccessibilityUIElement::lineForIndex):
- (AccessibilityUIElement::boundsForRange):
- (AccessibilityUIElement::cellForColumnAndRow):
- (AccessibilityUIElement::selectedTextRange):
- (AccessibilityUIElement::setSelectedTextRange):
- (AccessibilityUIElement::attributeValue):
- (AccessibilityUIElement::isAttributeSettable):
- (AccessibilityUIElement::increment):
- (AccessibilityUIElement::decrement):
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (webViewWindowObjectCleared):
- (main):
- * GNUmakefile.am:
+ This reverts commit r62692.
-2009-08-07 Jan Michael Alonzo <jmalonzo@webkit.org>
+ * Scripts/commit-log-editor:
- Unreviewed Gtk build fix.
+2010-07-08 Kinuko Yasuda <kinuko@chromium.org>
- DRT needs internal WTF symbols so we link to libJavaScriptCore.la
- too. Also don't force Gtk to use USE_SYSTEM_MALLOC.
+ Reviewed by Ojan Vafai.
- * GNUmakefile.am:
+ cleanup json_results_generator dependencies so that non-layout-tests can also use it safely
+ https://bugs.webkit.org/show_bug.cgi?id=38693
-2009-08-07 Darin Adler <darin@apple.com>
+ Introduced a new base class JSONResultsGeneratorBase that doesn't
+ have any dependency on layout_tests packages.
+ Turned JSONResultsGenerator into a wrapper class of the base class
+ so that the old code can work with it during the cleanup.
- * Scripts/commit-log-editor: Fix unchecked access to environment
- variable that may not be there.
+ Added json_results_generator_unittest.py.
-2009-08-07 Mark Rowe <mrowe@apple.com>
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py: Added
- Handle the case where only a single test is missing results.
+2010-07-09 Abhishek Arya <inferno@chromium.org>
- * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ Unreviewed.
-2009-08-07 George Wright <george.wright@torchmobile.com>
+ Marking myself as a committer.
- Reviewed by Adam Treat
+ * Scripts/webkitpy/common/config/committers.py:
- Fix DumpRenderTree for the Qt port to always dump the PNG data unless
- the expected and actual hashes match.
+2010-07-09 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
- https://bugs.webkit.org/show_bug.cgi?id=28077
+ Reviewed by Antti Koivisto.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::dump):
+ Implement MiniBrowser for Qt.
+ https://bugs.webkit.org/show_bug.cgi?id=40233
+
+ * MiniBrowser/qt/BrowserWindow.cpp: Added.
+ (createNewPage):
+ (BrowserView::BrowserView):
+ (BrowserView::resizeEvent):
+ (BrowserView::load):
+ (BrowserView::view):
+ (BrowserWindow::BrowserWindow):
+ (BrowserWindow::load):
+ (BrowserWindow::changeLocation):
+ (BrowserWindow::~BrowserWindow):
+ * MiniBrowser/qt/BrowserWindow.h: Added.
+ (BrowserView::~BrowserView):
+ * MiniBrowser/qt/MiniBrowser.pro: Added.
+ * MiniBrowser/qt/main.cpp: Added.
+ (main):
-2009-08-07 Pierre d'Herbemont <pdherbemont@apple.com>
+2010-07-09 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
- Reviewed by Eric Seidel.
+ Reviewed by Simon Hausmann.
- commit-log-editor does not produce a git commit log that is git friendly.
- https://bugs.webkit.org/show_bug.cgi?id=27754
+ Introduce the Qt autotest launcher.
- We make sure we end up with:
- - A first paragraph describing the bug. It is eventually prefixed by
- "WebKit: <line>" or "WebCore: <line>". This used to be
- "WebCore:\n\n<line>".
- - The Reviewed By line.
- - An eventual Patch By line if author and committer doesn't match.
- - The rest of the commit.
+ Qt autotests should be executed more frequently, ideally by the Qt
+ build bot. This is the first step to provide the tests more accessible.
- * Scripts/commit-log-editor:
+ [Qt] It should be easier to run all Qt's autotests.
+ https://bugs.webkit.org/show_bug.cgi?id=31625
-2009-08-07 Adam Barth <abarth@webkit.org>
+ * Scripts/run-qtwebkit-tests: Added.
- Unreviewed. (Darin Adler indicated he'd prefer if we landed these
- kinds of changes unreviewed, like editing the WebKit Team wiki page.)
+2010-07-09 Adam Barth <abarth@webkit.org>
- Added Pierre d'Herbemont to list of committers.
+ Reviewed by Eric Seidel.
- * Scripts/modules/committers.py:
+ commit-queue should merge to TOT when checkout needs update
+ https://bugs.webkit.org/show_bug.cgi?id=41944
-2009-08-07 Shinichiro Hamaji <hamaji@chromium.org>
+ There are a bunch of different designs that are possible here. This
+ one merges to top of tree by cleaning out the working copy and
+ re-applying the patch. Once you decide to merge that way, you need to
+ decide who's going to retry. In this patch, we retry in the child
+ process instead of plumbing the failure reason to the master process.
- Reviewed by Adele Peterson.
+ This patch is difficult to test end-to-end, but hopefully it will work.
+ :)
- Cannot scroll for box-reflect:right
- https://bugs.webkit.org/show_bug.cgi?id=27979
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/stepsequence.py:
+ * Scripts/webkitpy/tool/multicommandtool.py:
+ * Scripts/webkitpy/tool/multicommandtool_unittest.py:
- Update m_overflowLeft an m_overflowWidth for reflection just like
- m_overflowTop and m_overflowHeight.
+2010-07-09 Dumitru Daniliuc <dumi@chromium.org>
- * Scripts/make-js-test-wrappers: Added regexp to skip box-shadow-overflo
-w-scroll.js
+ Reviewed by Darin Adler.
-2009-08-06 Shinichiro Hamaji <hamaji@chromium.org>
+ Add a script to check for unnecessary includes in header files.
+ https://bugs.webkit.org/show_bug.cgi?id=41894
- Reviewed by Adam Barth.
+ * Scripts/check-header-includes: Added.
- box-shadow's spread is ignored with <table>
- https://bugs.webkit.org/show_bug.cgi?id=28017
+2010-07-09 Adam Barth <abarth@webkit.org>
- Use RenderStyle::getBoxShadowExtent just like RenderBlock.
+ Reviewed by Eric Seidel.
- * Scripts/make-js-test-wrappers: Added regexp to skip box-shadow-overflow-scroll.js
+ Add --html5-treebuilder option to run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=41922
-2009-08-06 Eric Seidel <eric@webkit.org>
+ We're down to one or two regressions in the HTML5lib test suite. It's
+ getting to be time to look at fixing LayoutTests.
- No review, only changing make-js-test-wrappers.
+ * Scripts/old-run-webkit-tests:
- Fix make-js-test-wrappers to ignore a few more js tests
- with custom templates.
+2010-07-08 Simon Fraser <simon.fraser@apple.com>
- * Scripts/make-js-test-wrappers:
+ Fix Tiger plugin test failures; the #ifdefs were incorrect, resulting
+ in the drawing model never getting set on Tiger.
-2009-08-06 Chris Marrin <cmarrin@apple.com>
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
- Reviewed by David Hyatt.
+2010-07-08 Aaron Boodman <aa@chromium.org>
- Added ENABLE_3D_CANVAS flag to build, default to off
+ Reviewed by Timothy Hatcher.
- * Scripts/build-webkit:
+ Add the ability for user scripts and user styles to affect just the top frame.
-2009-08-05 Brady Eidson <beidson@apple.com>
+ https://bugs.webkit.org/show_bug.cgi?id=41529
- Reviewed by Darin Adler.
+ * DumpRenderTree/LayoutTestController.h: Added new allFrames param.
+ * DumpRenderTree/LayoutTestController.cpp: Ditto.
+ (addUserScriptCallback):
+ (addUserStyleSheetCallback):
+ * DumpRenderTree/chromium/LayoutTestController.cpp: Ditto.
+ (LayoutTestController::addUserScript):
+ (LayoutTestController::addUserStyleSheet):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Ditto.
+ (LayoutTestController::addUserScript):
+ (LayoutTestController::addUserStyleSheet):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm: Ditto.
+ (LayoutTestController::addUserScript):
+ (LayoutTestController::addUserStyleSheet):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp: Ditto.
+ (LayoutTestController::addUserScript):
+ (LayoutTestController::addUserStyleSheet):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp: Ditto.
+ (LayoutTestController::addUserScript):
+ (LayoutTestController::addUserStyleSheet):
- Win DRT's resource load delegate is missing didReceiveResponse
- https://bugs.webkit.org/show_bug.cgi?id=28033
+2010-07-08 Adele Peterson <adele@apple.com>
- * DumpRenderTree/win/FrameLoadDelegate.cpp:
- Added:
- (FrameLoadDelegate::didReceiveServerRedirectForProvisionalLoadForFrame):
- (FrameLoadDelegate::willPerformClientRedirectToURL):
- (FrameLoadDelegate::didCancelClientRedirectForFrame):
+ Reviewed by Jon Honeycutt, Adam Roben, and Darin Adler.
- Minor style cleanup:
- (FrameLoadDelegate::didStartProvisionalLoadForFrame):
- (FrameLoadDelegate::didReceiveTitle):
- (FrameLoadDelegate::didFinishLoadForFrame):
- (FrameLoadDelegate::willCloseFrame):
- (FrameLoadDelegate::didClearWindowObject):
- * DumpRenderTree/win/FrameLoadDelegate.h:
+ Test infrastructure for https://bugs.webkit.org/show_bug.cgi?id=41721
+ <rdar://problem/8158561> Missing plug-in indicator should have a pressed state
-2009-08-05 Brady Eidson <beidson@apple.com>
+ Log when the missing plugin button is pressed.
- Reviewed by Darin Adler.
+ * DumpRenderTree/mac/UIDelegate.mm:
+ (-[UIDelegate webView:didPressMissingPluginButton:]):
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::QueryInterface):
+ (UIDelegate::createWebViewWithRequest):
+ (UIDelegate::drawBackground):
+ (UIDelegate::decidePolicyForGeolocationRequest):
+ (UIDelegate::didPressMissingPluginButton):
+ * DumpRenderTree/win/UIDelegate.h:
- Win DRT's resource load delegate is missing didReceiveResponse
- https://bugs.webkit.org/show_bug.cgi?id=28033
+2010-07-08 Simon Fraser <simon.fraser@apple.com>
- * DumpRenderTree/win/ResourceLoadDelegate.cpp:
- (ResourceLoadDelegate::didReceiveResponse):
- * DumpRenderTree/win/ResourceLoadDelegate.h:
+ Fix the Tiger build.
-2009-08-05 Darin Fisher <darin@chromium.org>
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
- Reviewed by Darin Adler.
+2010-07-08 Simon Fraser <simon.fraser@apple.com>
- Add layoutTestController.dumpWillCacheResponse
- https://bugs.webkit.org/show_bug.cgi?id=28010
+ Fix windows build.
- willCacheResponse is only interesting for embedders of mainline WebKit on Mac.
- Splitting off a new dumpWillCacheResponse allows a number of existings tests
- to run across platforms.
+ #ifdef code for Mac.
- The test that was specifically verifying willCacheResponse now calls
- dumpWillCacheResponse.
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
- * DumpRenderTree/LayoutTestController.cpp: Add dumpWillCacheResponse
- (LayoutTestController::LayoutTestController):
- (dumpWillCacheResponseCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- (LayoutTestController::dumpWillCacheResponse):
- (LayoutTestController::setDumpWillCacheResponse):
- * DumpRenderTree/mac/ResourceLoadDelegate.mm: Inspect dumpWillCacheResponse
- instead of dumpResourceLoadCallbacks.
- (-[ResourceLoadDelegate webView:resource:willCacheResponse:fromDataSource:]):
+2010-07-08 Simon Fraser <simon.fraser@apple.com>
-2009-08-05 Jeremy Orlow <jorlow@chromium.org>
+ Reviewed by Anders Carlsson.
- Reviewed by Adam Barth.
+ Allow the TestPlugin to use Core Animation rendering for testing
+ https://bugs.webkit.org/show_bug.cgi?id=41872
+
+ Add the ability for the TestPlugin to use the CoreAnimation rendering model
+ when available, based on the "drawingmodel" attribute of the embed tag:
+ drawingmodel="coreanimation"
- Add my name to committers.py
- https://bugs.webkit.org/show_bug.cgi?id=28013
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Add PluginObjectMac.mm
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h: Add some macros so we can detect
+ when building on Tiger. Add a void* coreAnimationLayer member.
+
+ * DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm: Added.
+ (createCoreAnimationLayer): Obj-C method to create the CALayer.
+
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New): Look for the drawingmodel attribute to decide which drawing
+ model to use.
+ (NPP_Destroy): Release the CALayer if we have one.
+ (NPP_GetValue): Return the retained CALayer.
- Add my name to committers.py.
+2010-07-08 Martin Robinson <mrobinson@igalia.com>
- * Scripts/modules/committers.py:
+ Reviewed by Xan Lopez.
-2009-08-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ [GTK] Support pixel tests
+ https://bugs.webkit.org/show_bug.cgi?id=31518
- Reviewed by Simon Hausmann.
+ Convert this file from CRLF to NL line endings. It will soon
+ be used on more than just the WinCairo platform.
- A minor refactoring of the Qt DRT to be a bit more similar to
- the other DRTs, as well as more understandable.
+ * DumpRenderTree/cairo/PixelDumpSupportCairo.cpp:
+ (writeFunction):
+ (printPNG):
+ (computeMD5HashStringForBitmapContext):
+ (dumpBitmap):
- Splitting up resetJSObjects into a LayoutTestController->reset()
- plus a new closeRemainingWindows() method.
+2010-07-08 Steve Falkenburg <sfalken@apple.com>
- Added a resetToConsistentStateBeforeTesting() method to keep
- the code in one place, making it easier to verify that we are
- doing things properly.
+ Reviewed by Darin Adler.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
- (WebCore::DumpRenderTree::open):
- (WebCore::DumpRenderTree::closeRemainingWindows):
- * DumpRenderTree/qt/DumpRenderTree.h:
+ Enable Data Execution Prevention for our test harnesses on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=41882
-2009-08-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/ImageDiff.vcproj:
+ * WebKitAPITest/WebKitAPITest.vcproj:
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj:
- Reviewed by Simon Hausmann.
+2010-07-07 Robert Hogan <robert@webkit.org>
- Make the Qt DRT WorkQueue work similarily to the cross platform
- one. This means that all items return true if they started
- loading.
+ Reviewed by Kenneth Rohde Christiansen.
- This change paves the way for unforking the WorkQueue, if we [Qt]
- would like that.
+ [Qt] Add DRT support for pageProperty etc.
- * DumpRenderTree/qt/WorkQueue.cpp:
- (WorkQueue::processWork):
- * DumpRenderTree/qt/WorkQueue.h:
- * DumpRenderTree/qt/WorkQueueItem.h:
- * DumpRenderTree/qt/jsobjects.cpp:
- (LoadItem::invoke):
- (ReloadItem::invoke):
- (ScriptItem::invoke):
- (BackForwardItem::invoke):
- (LayoutTestController::processWork):
- (LayoutTestController::maybeDump):
+ https://bugs.webkit.org/show_bug.cgi?id=41584
-2009-08-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::isPageBoxVisible):
+ (LayoutTestController::pageSizeAndMarginsInPixels):
+ (LayoutTestController::pageProperty):
+ (LayoutTestController::addUserStyleSheet):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
- Reviewed by Simon Hausmann.
+2010-07-08 Martin Robinson <mrobinson@igalia.com>
- If load of a test fails, don't dump as it will be dumped
- in the preceding test, resulting in a invalid incorrect layout.
+ Reviewed by Xan Lopez.
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::maybeDump):
+ Remove a warnings from the ImageDiff build by using the proper
+ printf format string for the gsize data type.
-2009-08-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * DumpRenderTree/gtk/ImageDiff.cpp:
+ (printImage): Use the proper printf format string for the gsize data type.
- Reviewed by Simon Hausmann.
+2010-07-08 Alice Liu <alice.liu@apple.com>
- Make the Qt DumpRenderTree more similar to the mac one.
+ Reviewed by Sam Weinig.
- Changes include:
- 1) Reset zoom factor before each test
- 2) Only dump the backforward list when we got other dump result
- 3) When we dump the render tree, and got zero result print out:
- [mainFrame renderTreeAsExternalRepresentation]
- and not:
- [frame renderTreeAsExternalRepresentation]
+ https://bugs.webkit.org/show_bug.cgi?id=41653
+ Add new WebKitTestRunner project for Windows
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::open):
- (WebCore::methodNameStringForFailedTest):
- (WebCore::DumpRenderTree::dump):
+ * WebKitTestRunner/WebKitTestRunnerPrefix.h:
+ Similar to how it's done in DumpRenderTree, define max and min early
+ on so that they don't get replaced by a macro requiring 2 arguments.
-2009-08-05 chris fleizach <cfleizach@apple.com>
+ * WebKitTestRunner/win: Added.
+ * WebKitTestRunner/win/WebKitTestRunner.sln: Added.
+ * WebKitTestRunner/win/WebKitTestRunner.vcproj: Added.
+ * WebKitTestRunner/win/main.cpp: Added.
+ (main): Implemented
- Fix Tiger build breakage.
+ Added these files with stubbed out functions:
+ * WebKitTestRunner/win/PlatformWebViewWin.cpp: Added.
+ (WTR::PlatformWebView::PlatformWebView):
+ (WTR::PlatformWebView::~PlatformWebView):
+ (WTR::PlatformWebView::page):
+ * WebKitTestRunner/win/TestControllerWin.cpp: Added.
+ (WTR::TestController::initializeInjectedBundlePath):
+ * WebKitTestRunner/win/TestInvocationWin.cpp: Added.
+ (WTR::TestInvocation::runUntil):
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+2010-07-07 Martin Robinson <mrobinson@igalia.com>
-2009-08-04 Chris Fleizach <cfleizach@apple.com>
+ Reviewed by Gustavo Noronha Silva.
- Reviewed by Darin Adler.
+ [GTK] Implement ImageDiff and add it to the build system
+ https://bugs.webkit.org/show_bug.cgi?id=41779
- Bug 27994 - WAI-ARIA: aria-valuetext needs to be implemented
- https://bugs.webkit.org/show_bug.cgi?id=27994
+ Add the initial implementation of the ImageDiff tool for the GTK+
+ port. This is an essential tool for doing pixel tests. The implementation
+ is based on the Mac and Chromium ports.
- Expose valueDescription for accessibility.
+ * DumpRenderTree/gtk/ImageDiff.cpp: Added.
+ (readPixbufFromStdin): Added.
+ (differenceImageFromDifferenceBuffer): Ditto.
+ (calculateDifference): Ditto.
+ (printImage): Ditto.
+ (printImageDifferences): Ditto.
+ (main): Ditto.
+ * GNUmakefile.am: Add ImageDiff to the WebKitTools build scripts.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getValueDescriptionCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::valueDescription):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::valueDescription):
+2010-07-08 Jay Civelli <jcivelli@chromium.org>
-2009-08-04 Eric Seidel <eric@webkit.org>
+ Unreviewed. Adding myself as a committer.
- Reviewed by Mark Rowe.
+ * Scripts/webkitpy/common/config/committers.py:
- REGRESSION: run-webkit-tests crashes if you have non-system perl in PATH
- https://bugs.webkit.org/show_bug.cgi?id=28006
+2010-07-08 Adam Roben <aroben@apple.com>
- Hard-code perl to /usr/bin/perl and swig to /usr/bin/swig
+ Make Windows stop running tests from platform/mac
- * DumpRenderTree/mac/PerlSupport/Makefile:
+ r62742 made a change (at my suggestion!) that caused us to start
+ looking for tests in platform/mac, rather than just looking for
+ expected results in platform/mac. This patch just undoes that part of
+ r62742.
-2009-08-04 Adam Barth <abarth@webkit.org>
+ Fixes <http://webkit.org/b/41855> REGRESSION (r62742): Windows runs
+ tests from platform/mac, but shouldn't
- Reviewed by Darin Adler.
+ Reviewed by Antti Koivisto and Anders Carlsson.
- Add pkasting to bugzilla-tool as a committer
- https://bugs.webkit.org/show_bug.cgi?id=28002
+ * Scripts/old-run-webkit-tests:
+ (top level): Removed "mac-snowleopard" and "mac" from @winPlatforms,
+ so we won't look in those directories for tests to run.
+ (expectedDirectoryForTest): Added back code from pre-r62742 to look in
+ platform/mac-snowleopard and platform/mac for expected results.
- * Scripts/modules/committers.py:
+2010-07-08 Antonio Gomes <tonikitoo@webkit.org>
-2009-08-04 Chris Fleizach <cfleizach@apple.com>
+ Unreviewed. Adding myself as a reviewer.
- Reviewed by Darin Adler.
+ * Scripts/webkitpy/common/config/committers.py:
- Bug 27993 - AXSliders are missing required attributes and actions
- https://bugs.webkit.org/show_bug.cgi?id=27993
+2010-07-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
- Add ability to check if any arbitrary action is supported.
+ Update my e-mail in committers.py
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (isActionSupportedCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::isActionSupported):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::isActionSupported):
+ * Scripts/webkitpy/common/config/committers.py:
-2009-08-04 Adam Barth <abarth@webkit.org>
+2010-07-07 Daniel Bates <dbates@rim.com>
- Reviewed by Eric Seidel.
+ Reviewed by Dumitru Daniliuc.
- bugzilla-tool unit tests need a test harness
- https://bugs.webkit.org/show_bug.cgi?id=27977
+ VCSUtils.pm complains about uninitialized value $newLine
+ https://bugs.webkit.org/show_bug.cgi?id=41333
- * Scripts/run-webkit-unittests: Added.
+ Fixes an issue where VCSUtils::fixChangeLogPatch() may read off the end of
+ an array when fixing a change log entry that overlaps with an earlier
+ entry. In particular, when a patch contains a change log entry inserted
+ earlier in the change log file, but after an entry with the same author
+ and date.
-2009-08-04 Mark Rowe <mrowe@apple.com>
+ * Scripts/VCSUtils.pm:
+ - Added for-loop constraint to fixChangeLogPatch() so that it does not
+ read off the end of the @overlappingLines array.
+ * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl: Added unit test.
- Rubber-stamped by Gavin "Gavvy" Barraclough.
+2010-07-07 Anders Carlsson <andersca@apple.com>
- Ensure that DumpRenderTreeSupport is regenerated when switching between OS versions
- by listing the DumpRenderTree binary as a dependency. Xcode has the smarts to rebuild
- DumpRenderTree itself when switching OS versions so this dependency removes the need
- for any smarts in the Makefile.
+ Comment out a part of TestNetscapePlugin that caused tests to fail on Tiger and Leopard.
- * DumpRenderTree/mac/PerlSupport/Makefile:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
-2009-08-04 Eric Seidel <eric@webkit.org>
+2010-07-07 Kent Tamura <tkent@chromium.org>
Reviewed by Adam Barth.
- bugzilla-tool needs unit tests
- https://bugs.webkit.org/show_bug.cgi?id=26916
+ [DRT/Chromium] Support for indeterminate checkbox
+ https://bugs.webkit.org/show_bug.cgi?id=41747
- Add some basic unit testing for scm.py.
+ Import http://src.chromium.org/viewvc/chrome?view=rev&revision=51499
- * Scripts/modules/scm.py:
- * Scripts/modules/scm_unittest.py: Added.
+ * DumpRenderTree/chromium/WebThemeControlDRT.cpp:
+ (WebThemeControlDRT::draw):
+ * DumpRenderTree/chromium/WebThemeControlDRT.h:
+ (WebThemeControlDRT::):
+ * DumpRenderTree/chromium/WebThemeEngineDRT.cpp:
+ (WebThemeEngineDRT::paintButton):
-2009-08-04 Mike Fenton <mike.fenton@torchmobile.com>
+2010-07-07 Sam Weinig <sam@webkit.org>
- Reviewed by Adam Treat.
+ Reviewed by Mark Rowe.
- Fix --skipped=only mode to honor flags such as --no-http and platform ignored directories by checking
- to make sure the Skipped entries are not in the $ignoredDirectories array. Directories commonly included
- are (http, media, compositing, wml, wcss).
+ Clean up MiniBrowser Xcode project.
+
+ - Use xcconfig files.
+ - Rename plists to canonical Info.plist
+ - Remove localizations.
+
+ * MiniBrowser/Configurations: Added.
+ * MiniBrowser/Configurations/Base.xcconfig: Added.
+ * MiniBrowser/Configurations/DebugRelease.xcconfig: Added.
+ * MiniBrowser/Configurations/MiniBrowser.xcconfig: Added.
+ * MiniBrowser/Configurations/WebBundle.xcconfig: Added.
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/WebBundle-Info.plist: Removed.
+ * MiniBrowser/mac/BrowserStatisticsWindowController.m:
+ (-[BrowserStatisticsWindowController initWithThreadedWKContextRef:processWKContextRef:]):
+ * MiniBrowser/mac/BrowserWindow.xib: Added.
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController initWithPageNamespace:]):
+ * MiniBrowser/mac/English.lproj: Removed.
+ * MiniBrowser/mac/English.lproj/BrowserWindow.xib: Removed.
+ * MiniBrowser/mac/English.lproj/InfoPlist.strings: Removed.
+ * MiniBrowser/mac/English.lproj/MainMenu.xib: Removed.
+ * MiniBrowser/mac/Info.plist: Copied from MiniBrowser/mac/MiniBrowser-Info.plist.
+ * MiniBrowser/mac/MainMenu.xib: Added.
+ * MiniBrowser/mac/MiniBrowser-Info.plist: Removed.
+ * MiniBrowser/mac/WebBundle/Info.plist: Copied from MiniBrowser/WebBundle-Info.plist.
+
+2010-07-07 Kent Tamura <tkent@chromium.org>
- https://bugs.webkit.org/show_bug.cgi?id=27893
+ Reviewed by Dimitri Glazkov.
- * Scripts/run-webkit-tests:
+ [DRT/Chromium] Fix two regressions
+ https://bugs.webkit.org/show_bug.cgi?id=41745
-2009-08-03 Chris Fleizach <cfleizach@apple.com>
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::paintInvalidatedRegion):
+ Repaint three times to fix svg/W3C-SVG-1.1/struct-use-01-t.svg
+ and svg/custom/use-on-g-containing-foreignObject-and-image.svg
+ though test_shell does it twice. Probably DRT needs it because
+ DRT delays painting as possible.
- Reviewed by Jon Honeycutt.
+2010-07-07 Anders Carlsson <andersca@apple.com>
- Bug 27958 - WAI-ARIA: Implement 'aria-required' attribute.
- https://bugs.webkit.org/show_bug.cgi?id=27958
+ Try to fix build.
- Exposed isRequired to DumpRenderTree for accessibility.
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_destroy_stream):
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getIsRequiredCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::isRequired):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::isRequired):
+2010-07-07 Anders Carlsson <andersca@apple.com>
-2009-08-04 Adam Barth <abarth@webkit.org>
+ Try to fix the GTK+ and Qt test failures by merging the newly added code from TestNetscapePlugin/main.cpp
- Reviewed by Eric Seidel.
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_stream):
+ (webkit_test_plugin_destroy_stream):
+ (webkit_test_plugin_write_ready):
+ (webkit_test_plugin_write):
- bugzilla-tool --commit-queue should validate commit-queue setter is a committer
- https://bugs.webkit.org/show_bug.cgi?id=27974
+2010-07-07 Sam Weinig <sam@webkit.org>
- With a test!
+ Reviewed by Mark Rowe.
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/bugzilla_unittest.py:
+ Don't hard code the Mac OS X 10.6 SDK for MiniBrowser.
-2009-08-04 Eric Seidel <eric@webkit.org>
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
- Reviewed by Adam Barth.
+2010-07-07 Anders Carlsson <andersca@apple.com>
- REGRESSION(r46700): bugzilla-tool land-diff double-spaces ChangeLogs
- https://bugs.webkit.org/show_bug.cgi?id=27973
+ Use the correct XP_MACOSX define instead of XP_MAC. This was causing test failures on some platforms.
- The trailing comma (suppresses newlines) was lost in r46700.
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_New):
+ (NPP_HandleEvent):
- * Scripts/bugzilla-tool:
+2010-07-07 Brian Weinstein <bweinstein@apple.com>
-2009-08-04 Adam Barth <abarth@webkit.org>
+ Reviewed by Adam Roben.
- Reviewed by Eric Seidel.
+ Need to have a way to specify different results for Windows XP and 7
+ https://bugs.webkit.org/show_bug.cgi?id=41776
+
+ Add the ability to have platform/win-xp, platform/win-vista, and platform/win-7
+ subdirectories, so we can have different results for tests on Windows XP, Windows
+ Vista, and Windows 7.
- bugzilla-tool has too many fatal errors
- https://bugs.webkit.org/show_bug.cgi?id=27969
+ Windows XP will try the order: win-xp, win-vista, win-7, win, mac-snowleopard, mac.
+ Windows Vista will try the order: win-vista, win-7, win, mac-snowleopard, mac.
+ Windows 7 will try the order: win-7, win, mac-snowleopard, mac.
- Replace several fatal errors with ScriptError exceptions.
+ This matches the behavior of the mac.
- * Scripts/bugzilla-tool:
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/scm.py:
+ * Scripts/old-run-webkit-tests: Add multiple platforms for Windows, and if we are on XP
+ or Vista, try looking in other win-* subdirectories before win.
+ * Scripts/webkitdirs.pm: Add some helper functions to determine what version of Windows
+ we are running.
-2009-08-04 Eric Seidel <eric@webkit.org>
+2010-07-07 Kent Tamura <tkent@chromium.org>
- No review, ChangeLog fix only.
+ Reviewed by Dimitri Glazkov.
- Fix a ChangeLog line-spacing disaster caused by:
- https://bugs.webkit.org/show_bug.cgi?id=27973
+ [DRT/Chromium] Remove ASSERT_NOT_REACHED in some functions
+ https://bugs.webkit.org/show_bug.cgi?id=41753
- Still unsure what the fix for bugzilla-tool will be.
+ The original code of the following functions in
+ test_shell_devtools_client.cc have NOTIMPLEMENTED(), not
+ ASSERT_NOT_REACHED(). The program shouldn't stop at these
+ functions.
-2009-08-04 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/chromium/DRTDevToolsClient.cpp:
+ (DRTDevToolsClient::activateWindow):
+ (DRTDevToolsClient::closeWindow):
+ (DRTDevToolsClient::dockWindow):
+ (DRTDevToolsClient::undockWindow):
- Reviewed by Eric Seidel.
+2010-07-07 Anders Carlsson <andersca@apple.com>
- bugzilla-tool --commit-queue should only land commit-queue+ patches
- https://bugs.webkit.org/show_bug.cgi?id=27970
+ Reviewed by Sam Weinig.
- commit-queue mode for bugzilla-tool
- https://bugs.webkit.org/show_bug.cgi?id=27918
+ Test that we call NPP_DestroyStream if a plug-in returns -1 from its NPP_Write function
+ https://bugs.webkit.org/show_bug.cgi?id=41821
- Make bugzilla tool smart enough to find the commit-queue+ flags and
- land those patches.
- When we call land-patches with --commit-queue, we should filter the
- patches we land to only those that have the commit-queue+ flag set.
- That way, when we call bugzilla-tool from a main commit queue process,
- we won't land the wrong patches.
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp:
+ (pluginGetProperty):
+ (pluginSetProperty):
+ (pluginAllocate):
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h:
+ Add and initialize the returnNegativeOneFromWrite property.
- * Scripts/bugzilla-tool:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (NPP_NewStream):
+ Set the stream type to NP_NORMAL so we'll get write callbacks.
-2009-08-04 Eric Seidel <eric@webkit.org>
+ (NPP_DestroyStream):
+ Treat the onstreamdestroy attribute as a function name and not a string.
- Reviewed by Adam Barth.
+ (NPP_WriteReady):
+ Have this return a nonzero value.
- committer logic should be split out of bugzilla.py into its own module
+ (NPP_Write):
+ If returnNegativeOneFromWrite is true return -1.
- https://bugs.webkit.org/show_bug.cgi?id=27972
+2010-07-07 Kevin Ollivier <kevino@theolliviers.com>
- I also added unit tests for the functionality I added.
+ [wx] Build fix for machines with both MSVC 2005 and 2008 installed. Ensures the
+ latest version is selected by default, and allows the version to be specified.
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/bugzilla_unittest.py: Added.
- * Scripts/modules/commiters_unittest.py: Added.
- * Scripts/modules/committers.py: Added.
+ * wx/build/settings.py:
-2009-08-03 Peter Kasting <pkasting@google.com>
+2010-07-07 Chris Fleizach <cfleizach@apple.com>
- Reviewed by David Kilzer.
+ Reviewed by Darin Adler.
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Handle any kind of line endings in svn-apply and svn-unapply, instead
- of assuming LF.
+ AX: TextArea should return AXSelectedTextRange of 0,0 if the cursor is not in the text area
+ https://bugs.webkit.org/show_bug.cgi?id=41810
- * Scripts/svn-apply:
- * Scripts/svn-unapply:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::selectedTextRange):
-2009-08-03 Adam Barth <abarth@webkit.org>
+2010-07-07 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Eric Seidel.
+ Unreviewed.
- bugzilla-tool land-patches needs --queue mode
- https://bugs.webkit.org/show_bug.cgi?id=27961
+ Build fix after r62700.
- Add a --commit-queue command line option to suppress user interaction.
+ * GNUmakefile.am: Update the source list to reflect the new TestNetscapePlugIn
+ source file locations.
- * Scripts/bugzilla-tool:
- * Scripts/modules/scm.py:
+2010-07-07 Ojan Vafai <ojan@chromium.org>
-2009-08-03 Mark Rowe <mrowe@apple.com>
+ Reviewed by David Levin.
- Build fix. Add installsrc, installhdrs and install targets.
+ change --exit-after-n-crashes to --exit-after-n-crashes-or-timeouts
+ https://bugs.webkit.org/show_bug.cgi?id=41814
- * DumpRenderTree/mac/PerlSupport/Makefile:
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ * Scripts/old-run-webkit-tests:
-2009-08-03 Eric Carlson <eric.carlson@apple.com>
+2010-07-07 Ojan Vafai <ojan@chromium.org>
- Reviewed by Eric Seidel.
+ Reviewed by David Levin.
- HTMLInputElement is not controllable by assistive technologies
- https://bugs.webkit.org/show_bug.cgi?id=27941
+ add --exit-after-n-crashes to run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=41811
- Accessibility control of a slider required adding increment() and decrement()
- methods to AccessibilityObject, so expose thos methods on AccessibilityUIElement.
+ Change the bots at build.webkit.org to use --exit-after-n-crashes
+ instead of --exit-after-n-failures since we want to be able to have
+ more than 20 failures on those bots, but more than 20 crashes means
+ something should be rolled out.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (incrementCallback): New, call UI element increment method.
- (decrementCallback): New, call UI element decrement method.
- (AccessibilityUIElement::getJSClass): Expose increment and decrement methods.
+ * Scripts/old-run-webkit-tests:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::increment): New, send NSAccessibilityIncrementAction to Mac wrapper.
- (AccessibilityUIElement::decrement): New, send NSAccessibilityDecrementAction to Mac wrapper.
+2010-07-07 Brian Weinstein <bweinstein@apple.com>
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::increment): New, do nothing.
- (AccessibilityUIElement::decrement): New, do nothing.
+ Fix the Windows build by removing win/TestNetscapePlugin/main.cpp from the
+ TestNetscapePlugin project, because this was removed from the tree.
-2009-08-02 David D. Kilzer <ddkilzer@webkit.org>
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
- <http://webkit.org/b/27930> bugzilla-tool hates Tor Arne Vestbø
+2010-07-07 Anders Carlsson <andersca@apple.com>
- Reviewed by Tor Arne Vestbø.
+ Reviewed by Simon Fraser.
- * Scripts/bugzilla-tool:
- (set_reviewer_in_changelog): Made sure reviewer is properly
- encoded when calling replace().
+ Unify Mac and Windows TestNetscapePlugin main.cpp files
+ https://bugs.webkit.org/show_bug.cgi?id=41798
+
+ * DumpRenderTree/DumpRenderTree.sln:
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+ (strcasecmp):
+ (NP_Initialize):
+ (NP_GetEntryPoints):
+ (NP_Shutdown):
+ (NPP_New):
+ (NPP_Destroy):
+ (NPP_HandleEvent):
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp: Removed.
-2009-08-02 Kevin Ollivier <kevino@theolliviers.com>
+2010-07-07 Kevin Ollivier <kevino@theolliviers.com>
- Reviewed by David Levin.
+ [wx] Build fix. pageProperty needs to return a value.
- Script for building the wxBrowser sample app for wx.
- https://bugs.webkit.org/show_bug.cgi?id=27619
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::pageProperty):
- * wx/browser/wscript: Added.
+2010-07-07 David Kilzer <ddkilzer@apple.com>
-2009-08-02 Kevin Ollivier <kevino@theolliviers.com>
+ <http://webkit.org/b/41788> commit-log-editor: wrong ChangeLog read when invoked from subdir with git
- Reviewed by Jan Alonzo.
+ Reviewed by Anders Carlsson.
- Scripts needed for the waf build.
- https://bugs.webkit.org/show_bug.cgi?id=27619
+ For both svn and git, commit-log-editor is invoked from the root
+ of the working directory. Unlike svn, git returns a list of
+ changed files that are relative to the directory where the
+ command was invoked. This caused the ChangeLog file in the root
+ directory to be read instead of the ChangeLog in the current
+ directory.
- * wx/build: Added.
- * wx/build/build_utils.py: Added.
- * wx/build/settings.py: Added.
- * wx/build/waf_extensions.py: Added.
- * wx/build/wxpresets.py: Added.
+ The fix is to use $ENV{PWD} as the base directory when fixing
+ the path to the ChangeLog files. With svn, this has no net
+ effect since $ENV{PWD} is the root of the working directory and
+ the ChangeLog paths are already relative to that directory.
+ With git, $ENV{PWD} is the directory that the commit was invoked
+ from, which fixes the ChangeLog paths so that the correct files
+ are read when creating the commit log entry.
-2009-08-01 Dan Bernstein <mitz@apple.com>
+ Note that the call to makeFilePathRelative() was supposed to
+ address this issue, but it doesn't because (a) it does nothing
+ with svn working directories by design, and (b) it does nothing
+ with git working directories because it's invoked when the
+ current directory is the root of the working directory, thus
+ giving no relative path.
- Reviewed by Darin Adler.
+ * Scripts/commit-log-editor: Removed call to
+ makeFilePathRelative() since since it does nothing. Moved code
+ to fix up $changeLog path so that it's fixed before trying to
+ open the file, and use $ENV{PWD} as the base path. Also use
+ canonicalizePath() to clean up paths with "../" in them.
- Make pixel test results more consistent across Mac OS X versions
+2010-07-07 Anders Carlsson <andersca@apple.com>
- * DumpRenderTree/cg/ImageDiffCG.cpp:
- (createDifferenceImage): Avoid color correction when rendering the
- images into graphics contexts, so that the actual color values are
- compared, regardless of how the images are tagged.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (createWebViewAndOffscreenWindow): Set the window’s color space to the
- main screen’s color space, even though the window is off-screen.
+ Another attempt at fixing the Qt build.
-2009-08-01 Mark Rowe <mrowe@apple.com>
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
- Try again to make the Qt build bot happy.
+2010-07-07 Anders Carlsson <andersca@apple.com>
- * BuildSlaveSupport/test-result-archive: Create a placeholder file inside the newly-created
- directory to prevent 'zip' from failing due to the directory containing no files.
+ Try to fix Qt build.
-2009-08-01 Mark Rowe <mrowe@apple.com>
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
- Try and make the Qt build bot happy.
+2010-07-07 Anders Carlsson <andersca@apple.com>
- * BuildSlaveSupport/test-result-archive: Handle the case where run-webkit-tests generates
- no output files at all and thus does not create the layout-test-results directory.
+ Reviewed by Simon Fraser.
-2009-08-01 Mark Rowe <mrowe@apple.com>
+ Rename TestNetscapePlugin.subproj and move platform specific files to subdirectories
+ https://bugs.webkit.org/show_bug.cgi?id=41781
- Move the include of DumpRenderTreeSupport to after DumpRenderTree has been built.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp: Renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp.
+ * DumpRenderTree/TestNetscapePlugIn/PluginObject.h: Renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h.
+ * DumpRenderTree/TestNetscapePlugIn/TestObject.cpp: Renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp.
+ * DumpRenderTree/TestNetscapePlugIn/TestObject.h: Renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h.
+ * DumpRenderTree/TestNetscapePlugIn/mac/Info.plist: Renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/Info.plist.
+ * DumpRenderTree/TestNetscapePlugIn/main.cpp: Renamed from WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp.
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def: Renamed from WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.def.
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc: Renamed from WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.rc.
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: Added.
+ * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin_debug.def: Renamed from WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin_debug.def.
+ * DumpRenderTree/TestNetscapePlugIn/win/resource.h: Renamed from WebKitTools/DumpRenderTree/win/TestNetscapePlugin/resource.h.
+ * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj: Removed.
- * Scripts/run-webkit-tests:
+2010-07-07 Andras Becsi <abecsi@webkit.org>
-2009-08-01 Mark Rowe <mrowe@apple.com>
+ Unreviewed trivial fix.
- Reviewed by Sam Weinig and David D. Kilzer.
+ Remove DUMPRENDERTREE_TEMP environment variable from NRWT
+ which was checked in accidentally in r62635.
- Fix <https://bugs.webkit.org/show_bug.cgi?id=27923>.
- Bug 27923: run-webkit-tests should not invoke "ps" repeatedly on Mac OS X
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
- run-webkit-tests invokes "ps" after each test on Mac OS X to determine whether DumpRenderTree is
- in the process of crashing. We can do the same test more efficiently with a simple call to sysctl.
- I couldn't find any built-in way of doing this directly from perl, so we do it from a simple C module
- instead. This speeds up run-webkit-tests by around 8%.
+2010-07-07 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
- * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
- * DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport.c: Added.
- (processIsCrashing):
- * DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportTiger.pm: Added. Tiger does not have the SWIG tool
- that is used to generate the Perl binding to the C code, so we fall back to the old implementation on Tiger.
- * DumpRenderTree/mac/PerlSupport/Makefile: Added.
- * Scripts/run-webkit-tests:
+ Reviewed by Eric Seidel.
-2009-08-01 Mark Rowe <mrowe@apple.com>
+ Pass port specific environment to server process.
+ https://bugs.webkit.org/show_bug.cgi?id=41593
- Reviewed by David D. Kilzer.
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
- Display the reminder once rather than once per ChangeLog.
+2010-07-06 Kent Tamura <tkent@chromium.org>
- * Scripts/prepare-ChangeLog:
+ Reviewed by Shinichiro Hamaji.
-2009-08-01 David Kilzer <ddkilzer@apple.com>
+ Fix a wrong dup detection of rebaseline-chromium-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=41644
- resolve-ChangeLogs: add error checking to git ls-files command on close()
+ rebaseline-chromium-webkit-tests used ImageDiff with 0.1%
+ tolerance. We don't need tolerance for rebaseline.
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ Add optional tolerance parameter to diff_image().
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ Add optional tolerance parameter to diff_image().
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ Add optional tolerance parameter to diff_image(), and pass it to ImageDiff command.
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ diff_files() always calls diff_image() with tolerance=0.
+ diff_files() is used only by rebaseline-chromium-webkit-tests.
- Item 2 of <https://bugs.webkit.org/show_bug.cgi?id=18599#c0>.
+2010-07-06 Sam Weinig <sam@webkit.org>
- * Scripts/resolve-ChangeLogs: Added error checking to close()
- after running git ls-files. Added error checking to all
- system() calls by checking for a non-zero WEXITSTATUS($?).
- Changed "|| die;" expressions to "or die $!;".
+ Fix MiniBrowser build.
-2009-08-01 David Kilzer <ddkilzer@apple.com>
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
- <http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths
+2010-07-06 Sam Weinig <sam@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Anders Carlsson.
- * Scripts/resolve-ChangeLogs: Used chdirReturningRelativePath()
- and determineVCSRoot() to change directories to the root of the
- project before running the command and to provide a path for
- removeChangeLogArguments() to make sure any ChangeLog arguments
- on the command line are still found.
- (canonicalRelativePath): Added. Returns a canonical path (e.g.,
- stripping 'dir/../' from the path) relative to the current
- directory.
- (removeChangeLogArguments): Added argument which contains a
- relative path that must be prepended to any ChangeLog arguments.
- Used canonicalRelativePath() and File::Spec->catfile() to
- construct a normalized, relative path to each file.
+ Add support for dumping the contents of messages to the console to WebKitTestRunner
-2009-08-01 David Kilzer <ddkilzer@apple.com>
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::_addMessageToConsole):
+ (WTR::InjectedBundlePage::addMessageToConsole):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h:
- Implement VCSUtils::chdirReturningRelativePath()
+2010-07-06 Sam Weinig <sam@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Anders Carlsson.
- Step 2 to fix:
- <http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=41708
+ Add dumpAsText support for WebKitTestRunner
- * Scripts/VCSUtils.pm:
- (VCSUtils::chdirReturningRelativePath): Moved here from
- chdirAndGetDifference() in svn-create-patch.
- * Scripts/svn-create-patch: Switched to use
- chdirReturningRelativePath() instead of chdirAndGetDifference().
- (chdirAndGetDifference): Removed.
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::InjectedBundle):
+ (WTR::InjectedBundle::reset): Reset the LayoutTestController for each test.
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::InjectedBundlePage::didFinishLoadForFrame): Use the new WKBundleFrameCopyInnerText
+ API to dump the main frames text.
-2009-08-01 David Kilzer <ddkilzer@apple.com>
+2010-07-06 Darin Adler <darin@apple.com>
- Implement VCSUtils::determineVCSRoot()
+ Fix Chromium build.
- Reviewed by Eric Seidel.
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::didCreateDataSource): Call leakPtr instead of release.
+ (WebViewHost::didNavigateWithinPage): Ditto.
+ (WebViewHost::updateURL): Ditto.
- Step 1 to fix:
- <http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths
+2010-07-06 Martin Robinson <mrobinson@igalia.com>
- * Scripts/VCSUtils.pm: Removed reference to webkitdirs module.
- (VCSUtils::EXPORT): Added &determineVCSRoot. Realphabetized.
- (VCSUtils::determineGitRoot): Added. Based on code in
- commit-log-editor.
- (VCSUtils::determineVCSRoot): Implemented using
- determineGitRoot() and determineSVNRoot().
- * Scripts/commit-log-editor: Replaced use of
- topLevelSourceDirectory() with determineVCSRoot(). Resorted
- use statements.
- (topLevelSourceDirectory): Removed.
+ Reviewed by Xan Lopez.
-2009-07-31 Daniel Bates <dbates@intudata.com>
+ [GTK] build-webkit should not run autogen.sh unconditionally
+ https://bugs.webkit.org/show_bug.cgi?id=41704
+
+ * Scripts/webkitdirs.pm: Only run autogen.sh during a build if GNUmakefile
+ doesn't exist. Autotools should re-run autogen.sh when necessary. Also do
+ some very minor cleanup.
+
+2010-07-06 Darin Adler <darin@apple.com>
+
+ Try to fix Chromium build.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp: Added include of PassOwnPtr.h.
+
+2010-07-06 Darin Adler <darin@apple.com>
+
+ Fix build.
+
+ * WebKitAPITest/TestsController.cpp:
+ (WebKitAPITest::TestsController::addTest): Use leakPtr instead of release.
+
+2010-07-06 Roland Steiner <rolandsteiner@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Bug 40558 - [DRT/Chromium] Upstream TestShellDevTools for Chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=40558
+
+ Upstream DevTools for Chromium DRT.
+ (original Chromium files rev. 51287)
+
+ * DumpRenderTree/DumpRenderTree.gypi:
+ * DumpRenderTree/chromium/DRTDevToolsAgent.cpp: Added.
+ (DRTDevToolsAgent::DRTDevToolsAgent):
+ (DRTDevToolsAgent::setWebView):
+ (DRTDevToolsAgent::sendMessageToFrontend):
+ (DRTDevToolsAgent::forceRepaint):
+ (DRTDevToolsAgent::runtimeFeatureStateChanged):
+ (DRTDevToolsAgent::injectedScriptSource):
+ (DRTDevToolsAgent::injectedScriptDispatcherSource):
+ (DRTDevToolsAgent::debuggerScriptSource):
+ (DRTDevToolsAgent::asyncCall):
+ (DRTDevToolsAgent::call):
+ (DRTDevToolsAgent::webDevToolsAgent):
+ (DRTDevToolsAgent::attach):
+ (DRTDevToolsAgent::detach):
+ (DRTDevToolsAgent::setTimelineProfilingEnabled):
+ (DRTDevToolsAgent::evaluateInWebInspector):
+ (DRTDevToolsAgent::dispatchMessageLoop):
+ * DumpRenderTree/chromium/DRTDevToolsAgent.h: Added.
+ (DRTDevToolsAgent::~DRTDevToolsAgent):
+ (DRTDevToolsAgent::hostIdentifier):
+ * DumpRenderTree/chromium/DRTDevToolsCallArgs.cpp:
+ * DumpRenderTree/chromium/DRTDevToolsCallArgs.h:
+ (DRTDevToolsCallArgs::DRTDevToolsCallArgs):
+ (DRTDevToolsCallArgs::~DRTDevToolsCallArgs):
+ (DRTDevToolsCallArgs::callsCount):
+ * DumpRenderTree/chromium/DRTDevToolsClient.cpp: Added.
+ (DRTDevToolsClient::DRTDevToolsClient):
+ (DRTDevToolsClient::~DRTDevToolsClient):
+ (DRTDevToolsClient::sendMessageToAgent):
+ (DRTDevToolsClient::sendDebuggerCommandToAgent):
+ (DRTDevToolsClient::activateWindow):
+ (DRTDevToolsClient::closeWindow):
+ (DRTDevToolsClient::dockWindow):
+ (DRTDevToolsClient::undockWindow):
+ (DRTDevToolsClient::asyncCall):
+ (DRTDevToolsClient::call):
+ (DRTDevToolsClient::allMessagesProcessed):
+ * DumpRenderTree/chromium/DRTDevToolsClient.h:
+ * DumpRenderTree/chromium/EventSender.cpp:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::setTimelineProfilingEnabled):
+ (LayoutTestController::evaluateInWebInspector):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ (TestShell::~TestShell):
+ (TestShell::createDRTDevToolsClient):
+ (TestShell::showDevTools):
+ (TestShell::closeDevTools):
+ (TestShell::runFileTest):
+ (TestShell::createNewWindow):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::drtDevToolsAgent):
+ (TestShell::drtDevToolsClient):
+ * DumpRenderTree/chromium/config.h:
+
+2010-07-06 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
Reviewed by Eric Seidel.
-
- https://bugs.webkit.org/show_bug.cgi?id=27757
- Resolves Perl redefinition warnings about functions tmpfile and tmpnam which are
- defined in both File::Temp and POSIX.
-
- This stops the warnings by preventing the "import" method of File::Temp from being called,
- which would otherwise add these functions into the primary namespace. Note, "use POSIX"
- will import these functions into the primary namespace anyway. We only need one instance
- of these functions in our namespace (or we get redefinition warnings), so lets use the
- one's in the POSIX package.
-
- * Scripts/update-webkit-auxiliary-libs: Changed "use File::Temp" to "use File::Temp ()".
- * Scripts/update-webkit-support-libs: ditto
+ Don't pass image hash to DRT when pixel tests are disabled.
+ https://bugs.webkit.org/show_bug.cgi?id=41597
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
-2009-07-31 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+2010-07-05 Csaba Osztrogonác <ossy@webkit.org>
Reviewed by Eric Seidel.
- Add a top level build option to control datagrid support
- https://bugs.webkit.org/show_bug.cgi?id=27915
+ REGRESSION(r60652): WebKitTools/Scripts/ensure-valid-python should cleanup temporary directory
+ https://bugs.webkit.org/show_bug.cgi?id=41612
- * Scripts/build-webkit:
+ * Scripts/ensure-valid-python: File::Temp::tempdir call fixed.
-2009-07-31 David Levin <levin@chromium.org>
+2010-07-05 Adam Barth <abarth@webkit.org>
- Reviewed by Adam Treat.
+ Reviewed by Eric Seidel.
- check-webkit-style --git-commit has bugs if you select a commit in the past
- https://bugs.webkit.org/show_bug.cgi?id=27908
+ We should be able to specify a bug to block for webkit-patch upload
+ https://bugs.webkit.org/show_bug.cgi?id=41648
- * Scripts/check-webkit-style:
- (main): Made the git-commit command only select the first commit
- if a range is given (and print a warning).
- * Scripts/modules/scm.py:
- (SCM::create_patch_from_local_commit):
- (SCM::create_patch_since_local_commit):
- (SCM::commit_locally_with_message):
- (SCM::discard_local_commits):
- Added an error messages in case these aren't overriden.
+ This will be useful for working on the HTML5 parser.
- (Git::create_patch_since_local_commit):
- Added this command to allow doing a diff of everything after a given commit.
+ * Scripts/webkitpy/tool/steps/createbug.py:
+ * Scripts/webkitpy/tool/steps/options.py:
-2009-07-31 Jan Michael Alonzo <jmalonzo@webkit.org>
+2010-07-05 Martin Robinson <mrobinson@igalia.com>
- Speculative Qt build fix. Not reviewed.
+ Reviewed by Oliver Hunt.
- Add LayoutTestController::disableImageLoading() in jsobjects.h.
+ The style checker exempts gtk2drawing.h when it should exempt gtkdrawing.h
+ https://bugs.webkit.org/show_bug.cgi?id=41017
- * DumpRenderTree/qt/jsobjects.h:
+ * Scripts/webkitpy/style/checker.py: Exempt gtkdrawing.h instead of gtk2drawing.h
+ * Scripts/webkitpy/style/checker_unittest.py: Update the unit test to reflect the change.
-2009-07-31 Brady Eidson <beidson@apple.com>
+2010-07-04 MORITA Hajime <morrita@google.com>
- Reviewed by John Sullivan.
+ rebaseline-chromium-webkit-tests: UnicodeDecodeError
+ https://bugs.webkit.org/show_bug.cgi?id=41589
- <rdar://problem/6973106> and https://bugs.webkit.org/show_bug.cgi?id=27896
- Favicons are still loaded when automatic image loading is disabled.
+ * run() method can result non-utf-8 bytes, that causes utf-8
+ decoding fail. Fixed to disable decoding.
+ * Fixed Git.find_checkout_root() to make a test pass.
- * DumpRenderTree/LayoutTestController.cpp:
- (disableImageLoadingCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetWebViewToConsistentStateBeforeTesting):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::disableImageLoading):
+2010-07-03 Patrick Gansterer <paroga@paroga.com>
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::disableImageLoading):
-
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::disableImageLoading): Stubbed for now.
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::disableImageLoading): Ditto.
+ Reviewed by Simon Hausmann.
-2009-07-30 Eric Seidel <eric@webkit.org>
+ [Qt] Fix DumpRenderTree userStyleSheet handling.
+ https://bugs.webkit.org/show_bug.cgi?id=41570
- Reviewed by David Kilzer.
+ DumpRenderTree did only set the userStyleSheet at
+ layoutTestController.setUserStyleSheetEnabled().
- bugzilla-tool post-commits trunk..head errors out
- https://bugs.webkit.org/show_bug.cgi?id=27847
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::setUserStyleSheetLocation):
+ (LayoutTestController::setUserStyleSheetEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
- Rename commit_ids_from_range_arguments to commit_ids_from_commitish_arguments
- and make it handle the new arguments format proposed in the bug.
+2010-07-03 Robert Hogan <robert@webkit.org>
- * Scripts/bugzilla-tool:
- * Scripts/modules/scm.py:
+ Reviewed by Kenneth Rohde Christiansen.
-2009-07-30 Eric Seidel <eric@webkit.org>
+ [Qt] support dumpChildFrameScrollPositions
- Reviewed by David Levin.
+ https://bugs.webkit.org/show_bug.cgi?id=41088
- clean up build-webkit to use less copy/paste code and remove unneeded SVG warning
- https://bugs.webkit.org/show_bug.cgi?id=27857
+ Unskip:
- * Scripts/build-webkit:
+ http/tests/navigation/anchor-subframeload.html
+ http/tests/navigation/relativeanchor-frames.html
-2009-07-31 David Kilzer <ddkilzer@apple.com>
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::dumpFrameScrollPosition):
+ (WebCore::DumpRenderTree::dump):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::shouldDumpChildFrameScrollPositions):
+ (LayoutTestController::dumpChildFrameScrollPositions):
- <http://webkit.org/b/27894> bugzilla-tool: Bugzilla.clear_attachment_review_flag() fails with ClientForm-0.2.10 and python-2.5
+2010-07-02 Sam Weinig <sam@webkit.org>
- Reviewed by Eric Seidel.
+ Reviewed by Anders Carlsson.
- * Scripts/modules/bugzilla.py:
- (Bugzilla.clear_attachment_review_flag): Specify which 'comment'
- form field to use when setting its value.
+ Rename new scripts so that they don't make autocompleting run-webkit-tests annoying.
-2009-07-31 Eric Seidel <eric@webkit.org>
+ * Scripts/debug-test-runner: Copied from Scripts/debug-webkittestrunner.
+ * Scripts/debug-webkittestrunner: Removed.
+ * Scripts/run-test-runner: Copied from Scripts/run-webkittestrunner.
+ * Scripts/run-webkittestrunner: Removed.
- Reviewed by David Kilzer.
+2010-07-02 Brian Weinstein <bweinstein@apple.com>
- bugzilla-tool post-commits obsoletes its own work :(
- https://bugs.webkit.org/show_bug.cgi?id=27849
+ Reviewed by Steve Falkenburg.
- Simple fix. Use .add() instead of .update()
+ Some http tests fail on Windows with Cygwin 1.7
+ https://bugs.webkit.org/show_bug.cgi?id=41537
+
+ With Cygwin 1.7, the registry key at SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/
+ doesn't exist anymore, because the mount points are stored in /etc/fstab. However, we
+ just need root mount point, which is defined in SOFTWARE\\Cygwin\\setup.
- * Scripts/bugzilla-tool:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (resolveCygwinPath): Fall back to SOFTWARE\\Cygwin\\setup if
+ SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/ doesn't work.
-2009-07-31 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+2010-06-23 Martin Robinson <mrobinson@igalia.com>
- Reviewed by Anders Carlsson.
+ Reviewed by Gustavo Noronha Silva.
- Improve platform-detection in run-webkit-tests
+ [GTK] Separate DerivedSources per-project
+ https://bugs.webkit.org/show_bug.cgi?id=41109
- This prevents miss-detection of mac-* over Qt/Mac.
+ The JavaScriptCore cppflags used to include the top-level DerivedSources directory
+ allowing the tools to build as a side-effect. Now that the top-level directory
+ is no longer in the list of JavaScriptCore includes, include it explicitly.
- * Scripts/run-webkit-tests:
+ * GNUmakefile.am:
-2009-07-30 Mark Rowe <mrowe@apple.com>
+2010-07-01 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
- Reviewed by Cameron Zwarich.
+ Reviewed by Kenneth Rohde Christiansen.
- Teach buildbot to detect test cases that are missing results.
+ [Qt] Make context menus show up in the right place in QTestBrowser
- * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ Context menus were shown at scene-relative coordinates for
+ QGraphicsWebView while QMenu expects them to be global. The
+ change to the QWidget case was to get rid of the mapToGlobal.
-2009-07-30 Mark Rowe <mrowe@apple.com>
+ * QtTestBrowser/webview.cpp:
- Things work better when you create the correct directories.
+2010-07-01 Robert Hogan <robert@webkit.org>
- * Scripts/run-webkit-tests:
+ Reviewed by Kenneth Rohde Christiansen.
-2009-07-30 Mark Rowe <mrowe@apple.com>
+ [Qt] dump frames in ascending alphabetical order of title
- Include some information about the error when we die.
+ https://bugs.webkit.org/show_bug.cgi?id=41261
- * Scripts/run-webkit-tests:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::dumpHistoryItem):
-2009-07-30 Mark Rowe <mrowe@apple.com>
+2010-07-01 Martin Robinson <mrobinson@igalia.com>
- Ensure that the path exists before writing results to it.
- Hopefully this will make the Windows build bot happy.
+ Unreviewed.
- * Scripts/run-webkit-tests:
+ Fix the GTK+ build after r62278.
-2009-07-30 Mark Rowe <mrowe@apple.com>
+ * Scripts/webkitdirs.pm: If the make arguments have already been specified,
+ let them override the automatic CPU detection for autotools builds.
- Reviewed by Adam Treat and Jon Honeycutt.
+2010-07-01 Martin Robinson <mrobinson@igalia.com>
- Teach run-webkit-tests to always store the actual results in the results directory for new tests.
- This allows us to give a working link to the results from the result summary page, even if we're
- not generating new results in to the tree.
+ Unreviewed.
- * Scripts/run-webkit-tests:
+ Fix the Windows build after r62278.
-2009-07-30 Mark Rowe <mrowe@apple.com>
+ * Scripts/num-cpus: Use FindBin to add the Scripts directory to the list of library directories.
- Add a Qt Linux build bot.
+2010-07-01 Martin Robinson <mrobinson@igalia.com>
- * BuildSlaveSupport/build.webkit.org-config/config.json:
-
-2009-07-30 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ Reviewed by Gustavo Noronha Silva.
- Reviewed by Adam Roben.
+ [GTK] build-webkit does not detect the number of CPUs
+ https://bugs.webkit.org/show_bug.cgi?id=41469
- Add --minimal option to webkit-build.
- https://bugs.webkit.org/show_bug.cgi?id=27852
+ Pass the appropriate -j<#> flag to make when building autotools builds.
+ This causes make to spawn that many number of child processes for doing
+ parallel builds.
- This option disables all optional build features unless
- they are explicitly enabled.
+ * Scripts/num-cpus: Use the newly abstracted numberOfCPUs to return the number
+ of CPUs. This makes the script work across more platforms.
+ * Scripts/webkitdirs.pm: Create a numberOfCPUs/determineNumberOfCPUs to determine the
+ number of CPUs across several platforms. Use this new function to determine the appropriate
+ arguments to pass to make for doing parallel builds with autotools build files.
- * Scripts/build-webkit:
+2010-07-01 Simon Hausmann <simon.hausmann@nokia.com>
-2009-07-30 Jakub Wieczorek <faw217@gmail.com>
+ Rubber-stamped by Laszlo Gombos.
- [Qt] Fix build with GCC 4.4.
+ [Qt][Symbian] Bumped up the maximum heap size to 96MB
- * DumpRenderTree/qt/ImageDiff.cpp:
+ * QtTestBrowser/QtTestBrowser.pro: Removed explicit heap size declaration
+ and use the one from WebKit.pri instead.
-2009-07-29 Ariya Hidayat <ariya.hidayat@nokia.com>
+2010-07-01 Adam Barth <abarth@webkit.org>
- Reviewed by Simon Hausmann.
+ Reviewed by Eric Seidel.
- https://bugs.webkit.org/show_bug.cgi?id=27813
+ Promote webkit-patch land-safely to main help
+ https://bugs.webkit.org/show_bug.cgi?id=41446
- [Qt] Support pixel tests in DumpRenderTree for the Qt port.
+ I've been using this command a bunch and recommending it to folks. We
+ should show it in main help as it's past the experimental phase.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::open):
- (WebCore::DumpRenderTree::setDumpPixels):
- (WebCore::DumpRenderTree::dump):
- * DumpRenderTree/qt/DumpRenderTree.h:
- * DumpRenderTree/qt/main.cpp:
- (main):
+ * Scripts/webkitpy/tool/commands/upload.py:
-2009-07-29 Ariya Hidayat <ariya.hidayat@nokia.com>
+2010-06-28 MORITA Hajime <morrita@google.com>
- Reviewed by Simon Hausmann.
+ Reviewed by Shinichiro Hamaji.
- https://bugs.webkit.org/show_bug.cgi?id=27813
+ rebaseline-chromium-webkit-tests doesn't do diffs right with a Git checkout of WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=38775
- [Qt] Implement ImageDiff.
+ - Introduced SCM.show_head() and SCM.diff_for_file().
+ - Replaced direct svn invocations with newly implement SCM methods.
- * DumpRenderTree/qt/ImageDiff.cpp: Added.
- * DumpRenderTree/qt/ImageDiff.pro: Added.
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
-2009-07-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+2010-06-30 Simon Fraser <simon.fraser@apple.com>
- Reviewed by Eric Seidel.
+ Reviewed by Sam Weinig.
- build-webkit: Reorder logic for determining the baseProductDir
-
- https://bugs.webkit.org/show_bug.cgi?id=27699
+ Allow MiniBrowser to open local files
+ https://bugs.webkit.org/show_bug.cgi?id=41104
- We now do port-spesific probing for the product dir first, and then
- fall back to either the generic WEBKITOUTPUTDIR (which now also works
- on Mac), or WebKitBuild.
-
- Then we add the git branch if the git branch build option is enabled.
+ Wire up the openDocument: message with an NSOpenPanel, so we can open
+ local files.
- Finally we massage the product dir based on the port. For example the
- Mac port will now always set the SYMROOT and OBJROOT configuration for
- XCode.
+ Also change the xib so that the window remembers its size.
- Note that isAppleWinWebkit() and isCygwin() is not mutually exclusive,
- hence the normal if and not elsif in the last two blocks.
-
- * Scripts/webkitdirs.pm:
+ * MiniBrowser/mac/AppDelegate.m:
+ (-[BrowserAppDelegate frontmostBrowserWindowController]):
+ (-[BrowserAppDelegate openDocument:]):
+ (-[BrowserAppDelegate openPanelDidEnd:returnCode:contextInfo:]):
+ * MiniBrowser/mac/English.lproj/BrowserWindow.xib:
-2009-07-29 David Kilzer <ddkilzer@apple.com>
+2010-06-30 Sam Weinig <sam@webkit.org>
- <http://webkit.org/b/27082> bugzilla-tool: Add --no-close switch to land-patches
-
- Reviewed by David Levin.
+ Rubber-stamped by Anders Carlsson.
- * Scripts/bugzilla-tool:
- (LandPatchesFromBugs.__init__): Added --no-close switch.
- (LandPatchesFromBugs.land_patches): Don't close the bug if the
- --no-close switch was used. Always clear the review+ flag on
- every landed patch using the commit_text message when cleared.
- This prevents patches from showing up in the commit queue if
- reopened and provides consistency with all landed patches.
- * Scripts/modules/bugzilla.py:
- (Bugzilla.clear_attachment_review_flag): Added.
+ Add debug-webkittestrunner and cleanup related scripts.
-2009-07-29 David Kilzer <ddkilzer@apple.com>
+ * Scripts/debug-webkittestrunner: Added.
+ * Scripts/run-webkittestrunner:
+ * Scripts/webkitdirs.pm:
- <http://webkit.org/b/27815> bugzilla-tool: add -m/--description to post-commits command
+2010-06-30 Kevin Ollivier <kevino@theolliviers.com>
- Reviewed by Eric Seidel.
+ [wx] Build fix after recent changes to LayoutTestController.
- * Scripts/bugzilla-tool:
- (PostDiffAsPatchToBug.execute): Changed default patch name from
- "patch" to "Patch v1".
- (PostCommitsAsPatchesToBug.__init__): Added -m/--description
- switch.
- (PostCommitsAsPatchesToBug.execute): Use description provided by
- -m/--description switch first, else fall back to the commit
- message.
-
-2009-07-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::pageSizeAndMarginsInPixels):
- Reviewed by Dave Levin.
+2010-06-29 Sam Weinig <sam@webkit.org>
- Make check-webkit-style support files as arguments.
- https://bugs.webkit.org/show_bug.cgi?id=27549
+ Reviewed by Anders Carlsson.
- * Scripts/check-webkit-style:
- Support files as argument. Change documentation and use basename
- on the binary name when used in the documentation. Also do not
- die when printing something containing non-ASCII characters.
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=41389
+ Make WebKitTestRunner work with more than one test at a time.
+
+ This converts WebKitTestRunner to a similar model as DumpRenderTree,
+ where there is a single WKView and each test is run it, rather than
+ the design I was using where each test got its own WKView.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::didRecieveMessage):
+ (WTR::InjectedBundle::reset):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ * WebKitTestRunner/TestController.cpp:
+ (WTR::TestController::initialize):
+ (WTR::TestController::runTest):
+ (WTR::TestController::_didRecieveMessageFromInjectedBundle):
+ (WTR::TestController::didRecieveMessageFromInjectedBundle):
+ * WebKitTestRunner/TestController.h:
+ (WTR::TestController::mainWebView):
+ (WTR::TestController::pageNamespace):
+ (WTR::TestController::context):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::TestInvocation):
+ (WTR::TestInvocation::~TestInvocation):
+ (WTR::TestInvocation::invoke):
+ (WTR::TestInvocation::didRecieveMessageFromInjectedBundle):
+ * WebKitTestRunner/TestInvocation.h:
+
+2010-06-30 Simon Hausmann <simon.hausmann@nokia.com>
-2009-08-06 Mike Fenton <mike.fenton@torchmobile.com>
+ Reviewed by Laszlo Gombos.
- Reviewed by David Levin.
+ [Qt][Symbian] Only 10 websites can be loaded consecutively when using QtWebkit 2.0
+ https://bugs.webkit.org/show_bug.cgi?id=40446
- Add validation for pointer and reference declaration as defined by webkit style guidelines to cpp_style.py.
- Add unit tests for validation and update existing c style cast test to be run explicitly as c validation.
+ We quickly run out of memory on Symbian when loading web pages. This is
+ caused by the default heap size, which is not suited for a web browser.
- https://bugs.webkit.org/show_bug.cgi?id=27984
+ This change bumps the max heap size to 32MB.
- * Scripts/modules/cpp_style.py:
- * Scripts/modules/cpp_style_unittest.py:
+ * QtTestBrowser/QtTestBrowser.pro:
-2009-07-29 David Kilzer <ddkilzer@apple.com>
+2010-06-30 Eric Seidel <eric@webkit.org>
- <http://webkit.org/b/27119> bugzilla-tool: Add create-bug command
+ Reviewed by Adam Barth.
- Reviewed by David Levin.
+ webkit-patch land allow the user to continue even if the builders are red
+ https://bugs.webkit.org/show_bug.cgi?id=41395
- Implement "create-bug" command for bugzilla-tool.
+ I don't think it's good that we've been teaching people
+ to always pass --ignore-builders. At least land is now
+ useable w/o --ignore-builders.
- * Scripts/bugzilla-tool: Added CreateBug class.
- (CreateBug.__init__): Added.
- (CreateBug.create_bug_from_commit): Added.
- (CreateBug.create_bug_from_patch): Added.
- (CreateBug.prompt_for_bug_title_and_comment): Added.
- (CreateBug.execute): Added.
- (BugzillaTool.__init__): Added create-bug command.
- * Scripts/modules/bugzilla.py:
- (Bugzilla.prompt_for_component): Added.
- (Bugzilla.check_create_bug_response_returning_bug_id_on_success): Added.
- (Bugzilla.create_bug_with_patch): Added.
+ * Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py:
-2009-07-29 Jan Michael Alonzo <jmalonzo@webkit.org>
+2010-06-29 Robert Hogan <robert@webkit.org>
- Reviewed by Eric Seidel and Xan Lopez.
+ Reviewed by Kenneth Rohde Christiansen.
- [Gtk] Enable http/tests/appcache tests
- https://bugs.webkit.org/show_bug.cgi?id=27674
+ [Qt] support dumpResourceResponseMIMETypes
+ https://bugs.webkit.org/show_bug.cgi?id=41260
- Add support for testing http/tests/appcache tests.
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::dumpResourceResponseMIMETypes):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting):
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setAppCacheMaximumSize):
+2010-06-29 Diego Gonzalez <diegohcg@webkit.org>
-2009-07-28 Mark Rowe <mrowe@apple.com>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by Oliver Hunt.
+ [Qt] Resize scene when Qt DRT WebPage receives a geometry change request
+ https://bugs.webkit.org/show_bug.cgi?id=41173
- Prevent nightly builds of WebKit from launching against old Safari versions that we no longer work with.
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::setViewGeometry):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
- * WebKitLauncher/main.m:
- (checkSafariVersion): Add a minimum required Safari version of 4.0. This matches the requirement on Windows.
- (main): If the minimum version requirement is not met, display an alert and bail out.
+2010-06-29 Diego Gonzalez <diegohcg@webkit.org>
-2009-07-28 David Levin <levin@chromium.org>
+ Reviewed by Simon Hausmann.
- Reviewed by Adam Treat.
+ [Qt] Deal with postEvent in case of graphics based DRT
+ https://bugs.webkit.org/show_bug.cgi?id=41174
- cpplint* should be named cpp_style*
- https://bugs.webkit.org/show_bug.cgi?id=27752
+ QGraphicsScene does not have a postEvent method, so make scene
+ send the event, in case of graphics based DRT, and delete it after that.
- The files were renamed. A few renames were done:
- CppLint -> CppStyle
- cpplint -> cpp_style
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::scheduleAsynchronousClick):
+ (EventSender::replaySavedEvents):
+ (EventSender::postEvent):
+ * DumpRenderTree/qt/EventSenderQt.h:
- * Scripts/check-webkit-style:
- * Scripts/modules/cpp_style.py: Copied from cpplint.py and
- did name fix ups.
- * Scripts/modules/cpp_style_unittest.py: Copied from cpplint_unittest.py and
- did name fix ups.
- * Scripts/modules/cpplint.py: Removed.
- * Scripts/modules/cpplint_unittest.py: Removed.
+2010-06-29 Diego Gonzalez <diegohcg@webkit.org>
-2009-07-28 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ Reviewed by Kenneth Rohde Christiansen.
- Rubber-stamped by Holger Freyther.
-
- Add Steve Falkenburg to bugzilla-tools' reviewers list
+ [Qt] Make switchFocus() method works with QGraphicsWebView in Qt DRT
+ https://bugs.webkit.org/show_bug.cgi?id=41172
- * Scripts/modules/bugzilla.py:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::switchFocus):
-2009-07-28 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
+2010-06-29 Mario Sanchez Prada <msanchez@igalia.com>
- Reviewed by Simon Hausmann.
+ Reviewed by Xan Lopez.
- Implement test result archive support for the Qt port.
+ [Gtk] Make DRT more coherent with other ports to allow reusing more tests
+ https://bugs.webkit.org/show_bug.cgi?id=40009
- * BuildSlaveSupport/test-result-archive:
+ Make sure "AXRole: ", "AXTitle: " and "AXDescription: " prefixes
+ are used when returning those values, for coherency with other ports.
-2009-07-27 Brady Eidson <beidson@apple.com>
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::role):
+ (AccessibilityUIElement::title):
+ (AccessibilityUIElement::description):
- Reviewed by Sam Weinig.
+2010-06-29 Sheriff Bot <webkit.review.bot@gmail.com>
- https://bugs.webkit.org/show_bug.cgi?id=27755
- Layout tests that dump resource load delegate calls should dump the request method and the response status code.
+ Unreviewed, rolling out r62106.
+ http://trac.webkit.org/changeset/62106
+ https://bugs.webkit.org/show_bug.cgi?id=41346
- * DumpRenderTree/mac/ResourceLoadDelegate.mm:
- (-[NSURLResponse _drt_descriptionSuitableForTestResult]):
- (-[NSURLRequest _drt_descriptionSuitableForTestResult]):
+ "Broke editing tests" (Requested by xan_ on #webkit).
- * DumpRenderTree/win/ResourceLoadDelegate.cpp:
- (descriptionSuitableForTestResult):
+ * Scripts/old-run-webkit-tests:
-2009-07-27 Pierre d'Herbemont <pdherbemont@apple.com>
+2010-06-29 Mario Sanchez Prada <msanchez@igalia.com>
- Reviewed by David Levin.
+ Reviewed by Xan Lopez.
- "bugzilla-tool post-commit head" doesn't work because it can't find the bug id from the commit load.
- https://bugs.webkit.org/show_bug.cgi?id=27747
+ Ensure DRT loads GAIL (Gtk+ module), for a11y tests
+ https://bugs.webkit.org/show_bug.cgi?id=38648
- modules.bugzilla is not found because not included.
+ Add the GTK_MODULES envvar (set to "gail") to the clean
+ environment when running DRT for the Gtk+ port
- * Scripts/modules/scm.py: Properly import modules.bugzilla.
+ * Scripts/old-run-webkit-tests:
-2009-07-24 Pierre d'Herbemont <pdherbemont@apple.com>
+2010-06-28 Adam Barth <abarth@webkit.org>
- Reviewed by David Kilzer.
+ Unreviewed.
- commit-log-editor should allow git commit --amend to regenerate the commit log based on the modifed ChangeLog
- https://bugs.webkit.org/show_bug.cgi?id=27664
+ Switch test-html5-parser back to using runner.html.
- * Scripts/commit-log-editor: Add --regenerate-log option.
- The user is asked if he wants to suppress previous ChangeLog and regenerate it,
- if this option is enabled.
+ * Scripts/test-html5-parser:
-2009-07-27 Gabor Rapcsanyi <rapcsanyi.gabor@stud.u-szeged.hu>
+2010-06-28 Adam Barth <abarth@webkit.org>
- Reviewed by Simon Hausmann.
+ Reviewed by Eric Seidel.
- Generating remote links causes a lot of unnecessary spew on Qt build bot too
+ Restore webkit-runner.html for use with new tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=41317
- * Scripts/run-webkit-tests:
+ For now, we just want to run webkit-runner when we test-html5-parser.
-2009-07-25 Kwang Yul Seo <skyul@company100.net>
+ * Scripts/test-html5-parser:
- Reviewed by Darin Adler.
+2010-06-23 John Gregg <johnnyg@google.com>
- Windows build break due to warning C4819
- https://bugs.webkit.org/show_bug.cgi?id=27416
+ Reviewed by Kent Tamura.
- Disable C4819 warning to fix build.
+ add ENABLE_DIRECTORY_UPLOAD build support
+ https://bugs.webkit.org/show_bug.cgi?id=41100
- * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+ * Scripts/build-webkit:
-2009-07-24 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
+2010-06-28 Gustavo Noronha Silva <gns@gnome.org>
- Not reviewed. Add Kevin McCullough as reviewer in bugzilla.py
+ Rubber-stamped by Xan Lopez.
- * Scripts/modules/bugzilla.py:
+ Update webkitdirs's knowledge of our library's name.
-2009-07-24 Eli Fidler <eli.fidler@torchmobile.com>
+ * Scripts/webkitdirs.pm:
- Reviewed by Adam Treat.
+2010-06-28 Sam Weinig <sam@webkit.org>
- Improve git workflow by populating commit messages with ChangeLog entries.
- https://bugs.webkit.org/show_bug.cgi?id=27605
+ Reviewed by Anders Carlsson.
- If the user doesn't manually modify the ChangeLog files, use
- prepare-ChangeLog to populate the git commit message. This behaviour
- can be disabled by the 'webkitGenerateCommitMessage' git configuration option.
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=41299
+ Build up WebKitTestRunner output in the InjectedBundle
+
+ Simplify WebKitTestRunner by building up the output in the InjectedBundle
+ and sending it over postMessage when done, instead of using the async
+ WKPageRenderTreeExternalRepresentation.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+ (WTR::InjectedBundle::done):
+ (WTR::InjectedBundle::didRecieveMessage):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+ (WTR::InjectedBundle::os):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+ (WTR::WKStringToUTF8):
+ (WTR::InjectedBundlePage::didFinishLoadForFrame):
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::WKStringToUTF8):
+ (WTR::TestInvocation::TestInvocation):
+ (WTR::TestInvocation::invoke):
+ (WTR::TestInvocation::initializeMainWebView):
+ (WTR::TestInvocation::_didRecieveMessageFromInjectedBundle):
+ (WTR::TestInvocation::didRecieveMessageFromInjectedBundle):
+ * WebKitTestRunner/TestInvocation.h:
+
+2010-06-28 Robert Hogan <robert@webkit.org>
+
+ Unreviewed, rolling out r62021.
+ http://trac.webkit.org/changeset/62021
+ https://bugs.webkit.org/show_bug.cgi?id=41261
+
+ Broke http/navigation tests among other
- * Scripts/commit-log-editor:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::dumpFramesAsText):
-2009-07-24 David Levin <levin@chromium.org>
+2010-06-28 Sam Weinig <sam@webkit.org>
- Reviewed by Adam Treat.
+ Reviewed by Anders Carlsson.
- cpplint crash when there is a duplicate header followed by another header.
- https://bugs.webkit.org/show_bug.cgi?id=27625
+ Add run-webkittestrunner to run WebKitTestRunner with the appropriate
+ environment.
- * Scripts/modules/cpplint.py: Ensure that include_state.header_types is updated even
- there is a duplicate header, which resulted in some code rearrangement. Also,
- changed some if's in this function to return early. This avoids having nearly the
- whole function content being indented.
- * Scripts/modules/cpplint_unittest.py: Added a test which would have exposed the crash.
+ * Scripts/run-webkittestrunner: Added.
+ * Scripts/webkitdirs.pm:
-2009-07-24 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+2010-06-28 Robert Hogan <robert@webkit.org>
- Reviewed by Adam Treat.
+ Reviewed by Kenneth Rohde Christiansen.
- Filetype support changes for cpplint and check_webkit_style
- https://bugs.webkit.org/show_bug.cgi?id=27653
+ [Qt] dump frames in ascending alphabetical order of title
- Introduce .c support for check_webkit_style, and remove support for
- .cc files in favor of .cpp.
+ https://bugs.webkit.org/show_bug.cgi?id=41261
- * Scripts/check-webkit-style:
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::dumpFramesAsText):
-2009-07-24 Eli Fidler <eli.fidler@torchmobile.com>
+2010-06-28 Robert Hogan <robert@webkit.org>
- Reviewed by David Levin.
+ Reviewed by Kenneth Rohde Christiansen.
- Improve git workflow by populating commit messages with ChangeLog entries.
- https://bugs.webkit.org/show_bug.cgi?id=27605
+ [Qt] dump bf history of child windows
- add --[no-]write prepare-ChangeLog options to bash completion
+ https://bugs.webkit.org/show_bug.cgi?id=41266
- * Scripts/webkit-tools-completion.sh:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::dumpBackForwardList):
+ (WebCore::DumpRenderTree::dump):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
-2009-07-24 Andrei Popescu <andreip@google.com>
+2010-06-28 Sam Weinig <sam@webkit.org>
Reviewed by Anders Carlsson.
- ApplicationCache should have size limit
- https://bugs.webkit.org/show_bug.cgi?id=22700
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=41288
+ WebKit2: Add frame API for InjectedBundle code
- Adds a new method on the LayoutTestController that
- allows a JS unit test to configure the maximum size
- of the Application Cache.
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didClearWindowForFrame):
- * DumpRenderTree/LayoutTestController.cpp:
- (setAppCacheMaximumSizeCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setAppCacheMaximumSize):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::setAppCacheMaximumSize):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setAppCacheMaximumSize):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::setAppCacheMaximumSize):
+2010-06-28 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
-2009-07-24 Adam Barth <abarth@webkit.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Rubber stamped by Eric Seidel.
+ [Qt] QtTestBrowser does not have a "Load" button ; therefore, unable to load pages on touch only symbian devices (portrait mode).
+ https://bugs.webkit.org/show_bug.cgi?id=38597
- Added andersca to list of reviewers.
+ Fix behavior so reload button really acts as a load and a reload button.
- * Scripts/modules/bugzilla.py:
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::changeLocation):
-2009-07-24 Mark Rowe <mrowe@apple.com>
+2010-06-28 Xan Lopez <xlopez@igalia.com>
- Reviewed by Xan Lopez.
+ Reviewed by Gustavo Noronha.
- Fix dozens of "Deallocation of a pointer not malloced" messages seen while running
- layout tests on the build bot.
+ [GTK] Does not compile with -DGSEAL_ENABLE
+ https://bugs.webkit.org/show_bug.cgi?id=37851
- Memory allocated via FastMalloc was being deleted via the system memory allocator
- due to an inconsistent including of FastMalloc.h. We address this by including it
- from config.h and including config.h from every implementation file, as in our other
- projects.
+ Fix build with GSEAL enabled.
- * DumpRenderTree/ForwardingHeaders/wtf/FastMalloc.h: Copied from JavaScriptGlue/ForwardingHeaders/wtf/FastMalloc.h.
- * DumpRenderTree/config.h:
- * DumpRenderTree/mac/AccessibilityControllerMac.mm:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- * DumpRenderTree/mac/AppleScriptController.m:
- * DumpRenderTree/mac/CheckedMalloc.cpp:
- * DumpRenderTree/mac/DumpRenderTree.mm:
- * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
- * DumpRenderTree/mac/DumpRenderTreePasteboard.m:
- * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
- * DumpRenderTree/mac/EditingDelegate.mm:
- * DumpRenderTree/mac/EventSendingController.mm:
- * DumpRenderTree/mac/FrameLoadDelegate.mm:
- * DumpRenderTree/mac/GCControllerMac.mm:
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- * DumpRenderTree/mac/NavigationController.m:
- * DumpRenderTree/mac/ObjCController.m:
- * DumpRenderTree/mac/ObjCPlugin.m:
- * DumpRenderTree/mac/ObjCPluginFunction.m:
- * DumpRenderTree/mac/PixelDumpSupportMac.mm:
- * DumpRenderTree/mac/PlainTextController.mm:
- * DumpRenderTree/mac/PolicyDelegate.mm:
- * DumpRenderTree/mac/ResourceLoadDelegate.mm:
- * DumpRenderTree/mac/TextInputController.m:
- * DumpRenderTree/mac/UIDelegate.mm:
- * DumpRenderTree/mac/WorkQueueItemMac.mm:
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (gtk_widget_get_window):
+ (prepareMouseButtonEvent):
+ (mouseMoveToCallback):
+ (mouseWheelToCallback):
+ (keyDownCallback):
-2009-07-24 Mark Rowe <mrowe@apple.com>
+2010-06-28 Xan Lopez <xlopez@igalia.com>
- Reviewed by Simon Hausmann.
+ Reviewed by Gustavo Noronha.
- Add a command line option to run-javascriptcore-tests to explicitly opt out of attempting to rebuild JavaScriptCore.
- This is primarily useful to speed up the build bots where one machine builds JavaScriptCore and a second runs the tests,
- leading to situations where the build system unnecessarily feels that the need to recompile.
+ [GTK] Add support for GTK+3
+ https://bugs.webkit.org/show_bug.cgi?id=41253
- * BuildSlaveSupport/build.webkit.org-config/master.cfg:
- * Scripts/run-javascriptcore-tests:
+ Adapt build system for 3.x support.
-2009-07-23 Jan Michael Alonzo <jmalonzo@webkit.org>
+ * GNUmakefile.am:
- Reviewed by Eric Seidel.
+2010-06-10 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
- [Gtk] Add implementation of GCController for DRT
- https://bugs.webkit.org/show_bug.cgi?id=27636
+ Reviewed by Simon Hausmann.
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (webViewWindowObjectCleared):
- (main):
- * DumpRenderTree/gtk/GCControllerGtk.cpp:
- (GCController::collect):
- (GCController::collectOnAlternateThread):
- (GCController::getJSObjectCount):
+ [QT][S60] build-webkit scripts picks wrong make spec for windows build
+ https://bugs.webkit.org/show_bug.cgi?id=41198
-2009-07-23 Mark Rowe <mrowe@apple.com>
+ Instead of checking for existence of %EPOCROOT% on windows, mandatory use of --symbian flag for symbian builds.
- Update build.webkit.org config for new machine.
+ * Scripts/webkitdirs.pm:
+ (determineIsSymbian): remove check for %EPOCROOT% as one can build for windows port of QT as well
- * BuildSlaveSupport/build.webkit.org-config/config.json:
+2010-06-28 Eric Seidel <eric@webkit.org>
-2009-07-23 Brady Eidson <beidson@apple.com>
+ Reviewed by Adam Barth.
- Remove accidentally checked in code.
+ Make it possible to test the new HTML5 TreeBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=41276
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (waitUntilDoneWatchdogFired):
- (LayoutTestController::setWaitToDump):
+ Adam was concerned that someone might make their port
+ depend on this setting (I guess we had some trouble with that
+ with the HTML5Parser setting), so I littered the code with warnings.
-2009-07-23 Brady Eidson <beidson@apple.com>
+ test-html5-parser now tests this code path.
- Reviewed by Geoff Garen.
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ (initializeGlobalsFromCommandLineOptions):
+ * Scripts/test-html5-parser:
- WebCore has a few places that don't gracefully handle a null request returned from willSendRequest.
- https://bugs.webkit.org/show_bug.cgi?id=27595
+2010-06-27 MORITA Hajime <morrita@google.com>
- Add the ability to tell the LayoutTestController to return a null request for willSendRequest
- redirect callbacks.
+ Unreviewed.
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::LayoutTestController):
- (setWillSendRequestReturnsNullOnRedirectCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- (LayoutTestController::willSendRequestReturnsNullOnRedirect):
- (LayoutTestController::setWillSendRequestReturnsNullOnRedirect):
+ Some never-called @staticmethods touched self.
+ Fixed it to replace these self with a class.
- * DumpRenderTree/mac/ResourceLoadDelegate.mm:
- (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
- * DumpRenderTree/win/ResourceLoadDelegate.cpp:
- (ResourceLoadDelegate::willSendRequest):
-
-2009-07-23 Mark Rowe <mrowe@apple.com>
+ * Scripts/webkitpy/common/checkout/scm.py:
- Reviewed Oliver Hunt.
+2010-06-27 MORITA Hajime <morrita@google.com>
- Fix DumpRenderTree to not fail an assertion on launch on a new machine.
-
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (setDefaultsToConsistentValuesForTesting): Disable the XSS auditor. It being enabled
- breaks all of the JavaScript tests within testStringByEvaluatingJavaScriptFromString,
- which causes us to exit due to an assertion failure. It's not clear why the XSS auditor
- decides to interfere with these tests.
+ Unreviewed.
+
+ Fixed exception raising syntax that is pointed out at
+ https://bugs.webkit.org/show_bug.cgi?id=41153
-2009-07-23 Mark Rowe <mrowe@apple.com>
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ Removed a bad line that I accidentally checked-in at last revision.
- Reviewed by Oliver Hunt.
+2010-06-24 MORITA Hajime <morrita@google.com>
- Update default state of the XSS auditor in GTK DumpRenderTree to match Mac and Windows
- in hopes of fixing some layout test failures seen on the build bot.
+ Reviewed by Eric Seidel.
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting):
+ rebaseline-chromium-webkit-tests should add or remove files to local git repository
+ https://bugs.webkit.org/show_bug.cgi?id=41153
-2009-07-23 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ - Added SCM.add() and SCM.remove()
+ - Replaced "svn add" and "svn remove"
+ rebaseline_chromium_webkit_tests.py: in with SCM method equivalents.
+ - add "-U" and "-q" options to rebaseline_chromium_webkit_tests.py
+ for debugging purpose.
- Reviewed by Adam Treat.
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
- Fix false positives for switch statement indentation check in cpplint.
- https://bugs.webkit.org/show_bug.cgi?id=27615
+2010-06-25 Yuzo Fujishima <yuzo@google.com>
- Makes one-line case statements (e.g. "case foo: bar();") work.
- Also a few general improvements to the robustness and readability of
- the check, and more test cases.
+ Reviewed by Shinichiro Hamaji.
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ Improve default value handling for page format properties.
+ https://bugs.webkit.org/show_bug.cgi?id=41150
-2009-07-23 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ * DumpRenderTree/LayoutTestController.cpp:
+ (parsePageNumber):
+ (parsePageNumberSizeMarings):
+ (pageSizeAndMarginsInPixelsCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::pageSizeAndMarginsInPixels):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::pageSizeAndMarginsInPixels):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::pageSizeAndMarginsInPixels):
- Reviewed by Adam Treat.
+2010-06-21 Robert Hogan <robert@webkit.org>
- Add check for line-breaking rule #3 to cpplint.
- https://bugs.webkit.org/show_bug.cgi?id=27610
+ Reviewed by Kenneth Rohde Christiansen.
- "An else if statement should be written as an if statement when
- the prior if concludes with a return statement."
+ [Qt] DRT Support for setCustomPolicyDelegate
- Implemented by a multi-line (kind of back-tracking) algorithm.
- Comes with loads of unit tests. Fixes the check for label indentation
- to be not so overzealous, as it didn't allow for completely unindented
- goto labels (at the very start of a line).
+ https://bugs.webkit.org/show_bug.cgi?id=39564
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setCustomPolicyDelegate):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
-2009-07-23 Eli Fidler <eli.fidler@torchmobile.com>
+2010-06-26 Robert Hogan <robert@webkit.org>
- Reviewed by Adam Treat.
+ Unreviewed, Qt build fix following http://trac.webkit.org/changeset/61879
+
+ Remove qwebscriptworld.h from LayoutTestControllerQt.cpp - it is no longer
+ exported.
- Improve git workflow by populating commit messages with ChangeLog entries.
- https://bugs.webkit.org/show_bug.cgi?id=27605
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
- add --[no-]write option to optionally output new ChangeLog entries to
- stdout instead of modifying ChangeLog files
+2010-06-26 Tony Gentilcore <tonyg@chromium.org>
- fix Torch Mobile copyright
+ Reviewed by Dimitri Glazkov.
- * Scripts/prepare-ChangeLog:
+ Add a build-webkit option for enabling Web Timing support.
+ https://bugs.webkit.org/show_bug.cgi?id=38924
-2009-07-23 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ * Scripts/build-webkit:
- Reviewed by Adam Treat.
+2010-06-25 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
- Enable cpplint for .c files.
- https://bugs.webkit.org/show_bug.cgi?id=27604
+ Reviewed by Kenneth Rohde Christiansen.
- Also make sure that the check for NULL does not apply to .c files.
+ [Qt] QtTestBrowser does not have a "Load" button ; therefore, unable to load pages on touch only symbian devices (portrait mode).
+ https://bugs.webkit.org/show_bug.cgi?id=38597
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ Make the reload button act as a load button as well.
-2009-07-22 Steve Falkenburg <sfalken@apple.com>
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::buildUI):
+ (MainWindow::changeLocation):
- Checkpoint new Windows nightly launcher.
-
- Reviewed by Mark Rowe.
+2010-06-25 Prasad Tammana <prasadt@chromium.org>
- * WebKitLauncherWin: Added.
- * WebKitLauncherWin/Resource.h: Added.
- * WebKitLauncherWin/WebKitLauncherWin.cpp: Added.
- (getStringValue): Retrieve a string registry value.
- (applePathFromRegistry): Get an Apple-related path out of the registry.
- (copyEnvironmentVariable): Copy an environment variable.
- (safariInstallDir): Helper function to get the install directory for Safari.
- (safariBrowserExe): Helper function to get the full path of the Safari executable.
- (_tWinMain): Locate Safari and launch it after setting up an environment variable.
- * WebKitLauncherWin/WebKitLauncherWin.h: Added.
- * WebKitLauncherWin/WebKitLauncherWin.rc: Added.
- * WebKitLauncherWin/WebKitLauncherWin.vcproj: Added.
- * WebKitLauncherWin/webkit.ico: Added.
+ Reviewed by Dmitry Titov.
-2009-07-22 David Levin <levin@chromium.org>
+ Add empty abortModal() method to all platforms.
+ https://bugs.webkit.org/show_bug.cgi?id=40864
- Reviewed by Adam Treat.
+ Add an empty abortModal() stub to LayoutTestController on all platforms to get rid of platform specific #ifs in
+ platform independent LayoutTestController code. Without this change, layout tests using LayoutTestController tests
+ that use abortModal will become mac specific which is not desirable.
- run-webkit-lint should be named check-webkit-style
- https://bugs.webkit.org/show_bug.cgi?id=27568
+ * DumpRenderTree/LayoutTestController.cpp:
+ (abortModalCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::abortModal):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::abortModal):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::abortModal):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::abortModal):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::abortModal):
- This name better reflects the fact that it is about checking the style of files.
+2010-06-25 Sam Weinig <sam@webkit.org>
- * Scripts/check-webkit-style: Renamed from WebKitTools/Scripts/run-webkit-lint.
+ Reviewed by Anders Carlsson.
-2009-07-22 Takeshi Yoshino <tyoshino@google.com>
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=41226
+ Flesh out injected bundle code for WebKitTestRunner and add basic LayoutTestController.
+
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: Added.
+ (WTR::InjectedBundle::shared):
+ (WTR::InjectedBundle::InjectedBundle):
+ (WTR::InjectedBundle::_didCreatePage):
+ (WTR::InjectedBundle::_willDestroyPage):
+ (WTR::InjectedBundle::_didRecieveMessage):
+ (WTR::InjectedBundle::initialize):
+ (WTR::InjectedBundle::didCreatePage):
+ (WTR::InjectedBundle::willDestroyPage):
+ (WTR::InjectedBundle::didRecieveMessage):
+ * WebKitTestRunner/InjectedBundle/InjectedBundle.h: Added.
+ (WTR::InjectedBundle::layoutTestController):
+ * WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp:
+ (WKBundleInitialize):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: Added.
+ (WTR::InjectedBundlePage::InjectedBundlePage):
+ (WTR::InjectedBundlePage::~InjectedBundlePage):
+ (WTR::InjectedBundlePage::_didStartProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::_didReceiveServerRedirectForProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::_didFailProvisionalLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::_didCommitLoadForFrame):
+ (WTR::InjectedBundlePage::_didFinishLoadForFrame):
+ (WTR::InjectedBundlePage::_didFailLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::_didReceiveTitleForFrame):
+ (WTR::InjectedBundlePage::_didClearWindowForFrame):
+ (WTR::InjectedBundlePage::didStartProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame):
+ (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didCommitLoadForFrame):
+ (WTR::InjectedBundlePage::didFinishLoadForFrame):
+ (WTR::InjectedBundlePage::didFailLoadWithErrorForFrame):
+ (WTR::InjectedBundlePage::didReceiveTitleForFrame):
+ (WTR::InjectedBundlePage::didClearWindowForFrame):
+ * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: Added.
+ (WTR::InjectedBundlePage::page):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.cpp: Added.
+ (WTR::LayoutTestController::create):
+ (WTR::LayoutTestController::LayoutTestController):
+ (WTR::LayoutTestController::~LayoutTestController):
+ (WTR::dumpAsTextCallback):
+ (WTR::layoutTestControllerObjectFinalize):
+ (WTR::LayoutTestController::makeWindowObject):
+ (WTR::LayoutTestController::getJSClass):
+ (WTR::LayoutTestController::staticFunctions):
+ * WebKitTestRunner/InjectedBundle/LayoutTestController.h: Added.
+ (WTR::LayoutTestController::dumpAsText):
+ (WTR::LayoutTestController::setDumpAsText):
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+
+2010-06-25 Sam Weinig <sam@webkit.org>
- Reviewed by Darin Adler.
+ Reviewed by Anders Carlsson.
- VC++ 2005 Express failed to build WebKit due to raw UTF-8 string in WebKit/win/WebCoreLocalizedStrings.cpp
- https://bugs.webkit.org/show_bug.cgi?id=26375
+ Make WebKitTestRunner really work with run-webkit-tests.
+
+ - Add Forwarding headers to allow some cleanup.
+
+ * WebKitTestRunner/ForwardingHeaders: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/ASCIICType.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/Assertions.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/Atomics.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/FastMalloc.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/HashMap.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/HashSet.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/HashTraits.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/Locker.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/MainThread.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/MathExtras.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/Noncopyable.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/OwnPtr.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/OwnPtrCommon.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/PassOwnPtr.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/PassRefPtr.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/Platform.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/RefCounted.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/RefPtr.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/RetainPtr.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/StringExtras.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/ThreadSafeShared.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/Threading.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/ThreadingPrimitives.h: Added.
+ * WebKitTestRunner/ForwardingHeaders/wtf/Vector.h: Added.
+ * WebKitTestRunner/TestInvocation.cpp:
+ (WTR::TestInvocation::dump): Dump the right number of #EOFs.
+ * WebKitTestRunner/TestInvocation.h:
+
+2010-06-25 Sam Weinig <sam@webkit.org>
- Make it able to use hexadecimal escape sequences in .*UI_STRING(_KEY)? macros. Now,
- the extract-localizable-strings script unescapes hexadecimal escape sequences in string literals
- in the macros before writing out them into the file to update.
+ Reviewed by Mark Rowe.
- By this fix, we can eliminate raw UTF-8 strings in source code while using raw UTF-16 big endian
- strings in the Localizable.strings file.
+ Add support for WebKitTestRunner to old-run-webkit-tests
- Bonus: There's no longer extract-webkit-localizable-strings script. Fix usage message to guide
- users to update-webkit-localizable-strings.
+ - Also adds a script to build WebKitTestRunner for old-run-webkit-tests to use.
- * Scripts/extract-localizable-strings:
+ * Scripts/build-webkittestrunner: Added.
+ * Scripts/old-run-webkit-tests:
-2009-07-22 Shinichiro Hamaji <hamaji@google.com>
+2010-06-25 Adam Barth <abarth@webkit.org>
Reviewed by David Levin.
- Tiny typo fixes for cpplint.py
- https://bugs.webkit.org/show_bug.cgi?id=27530
+ Incremental build failed on Chromium ews
+ https://bugs.webkit.org/show_bug.cgi?id=41011
- * Scripts/modules/cpplint.py:
+ The division of responsibility between update-webkit --chromium and
+ build-webkit --chromium is slightly unclear. In this patch, we make
+ build-webkit --chromium also update DEPS and re-run GYP in case the
+ developer has changed either since they updated.
-2009-07-22 Shinichiro Hamaji <hamaji@chromium.org>
+ This change is also helpful for the EWS, which wants to update DEPS and
+ re-run GYP after applying patches, but the EWS doesn't want to run
+ update-webkit --chromium because it has a dirty working copy.
- Reviewed by David Levin.
+ * Scripts/webkitdirs.pm:
- run-webkit-lint checks code which are not changed
- https://bugs.webkit.org/show_bug.cgi?id=27529
+2010-06-25 Robert Hogan <robert@webkit.org>
- Add check if the line is newly added.
+ Reviewed by Simon Hausmann.
- * Scripts/run-webkit-lint:
+ [Qt] Support evaluateScriptInIsolatedWorld()
-2009-07-22 Shinichiro Hamaji <hamaji@chromium.org>
+ https://bugs.webkit.org/show_bug.cgi?id=40079
- Reviewed by David Levin.
+ Remove evaluateScriptInIsolatedWorld() from QtWebKit API.
+ Remove QWebScriptWorld from exported headers.
+ Confine support to DumpRenderTreeSupportQt so that the tests can pass.
- run-webkit-lint should have --git-commit option
- https://bugs.webkit.org/show_bug.cgi?id=27528
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::evaluateScriptInIsolatedWorld):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
- * Scripts/modules/cpplint.py:
- * Scripts/run-webkit-lint:
+2010-06-25 Anders Carlsson <andersca@apple.com>
-2009-07-22 Peter Kasting <pkasting@google.com>
+ Revert accidental part and add a newline.
- Reviewed by David Kilzer.
+ * MiniBrowser/mac/AppDelegate.m:
+ * MiniBrowser/mac/MiniBrowser_Prefix.pch:
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Factor svn-create-patch's "determineSvnRoot()" into a function in
- VCSUtils.pm so commit-log-editor can use it too.
+2010-06-25 Anders Carlsson <andersca@apple.com>
- * Scripts/VCSUtils.pm: Add determineSVNRoot().
- * Scripts/commit-log-editor: Use determineSVNRoot() instead of old
- code (which didn't work as well).
- * Scripts/svn-create-patch: Remove determineSvnRoot() (moved).
+ Rubber-stamped by Dan Bernstein.
-2009-07-22 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ 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 Adam Treat.
+ Reviewed by Eric Seidel.
- Fix false positives in namespace indentation checks.
- https://bugs.webkit.org/show_bug.cgi?id=27567
+ commit-queue is taking too long to land patches because of red trees
+ https://bugs.webkit.org/show_bug.cgi?id=41194
- The regular expression detecting goto labels (in order
- to skip those) was too permissive, which caused other
- code like "Foo::Bar()" to be treated as a label too,
- thereby not stopping the processing loop as expected.
+ 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.
- Now comes with a stricter regexp, and more demanding
- test cases to check for these issues.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+2010-06-24 Martin Robinson <mrobinson@igalia.com>
-2009-07-22 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ Reviewed by Xan Lopez.
- Reviewed by Adam Treat.
+ [GTK] Clean up the use of gdk_window_get_root_coords in EventSender
+ https://bugs.webkit.org/show_bug.cgi?id=40843
- Fix cpplint generating false positives for
- "primary" includes in headers.
- https://bugs.webkit.org/show_bug.cgi?id=27553
+ Define the version for old GTK+s in a way that is forward-compatible
+ and clean up the logic a bit.
- Doing so by only flagging includes in header files
- as primary when the include filename exactly matches
- the header filename.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (gdk_window_get_root_coords): Renamed and cleaned up.
+ (prepareMouseButtonEvent): Remove #ifdefs.
+ (mouseMoveToCallback): Remove #ifdefs.
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+2010-06-24 Dimitri Glazkov <dglazkov@chromium.org>
-2009-07-22 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ Reviewed by Eric Seidel.
- Reviewed by Adam Treat.
+ Fix NewRunWebKitTests to work on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=41180
- cpplint generates false positives for primary includes
- https://bugs.webkit.org/show_bug.cgi?id=27544
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added "perl" as first arguments,
+ because Windows fails to understand what we're asking of it.
- Fix false positives for instances when cpplint would
- normally classify multiple includes as primary: After
- the first primary include, classify subsequent ones as
- "other" includes even if they look like primary ones.
+2010-06-24 Martin Robinson <mrobinson@igalia.com>
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ Reviewed by Xan Lopez.
-2009-07-22 Gabor Rapcsanyi <rapcsanyi.gabor@stud.u-szeged.hu>
+ [GTK] The url passed to the WebView during layout tests is invalid
+ https://bugs.webkit.org/show_bug.cgi?id=40832
- Reviewed by Simon Hausmann.
+ 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.
- Pass XAUTHORITY environment variable to $dumpTool as well.
+ * 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.
- * Scripts/run-webkit-tests:
+2010-06-24 Sam Weinig <sam@webkit.org>
-2009-07-21 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ Reviewed by Anders Carlsson.
- Reviewed by Adam Treat.
+ Fix WebKitTestRunner Makefile typos.
- Add check for correct wtf includes to cpplint.
- https://bugs.webkit.org/show_bug.cgi?id=27524
+ * WebKitTestRunner/Makefile:
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+2010-06-24 Adele Peterson <adele@apple.com>
-2009-07-21 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ Reviewed by Eric Carlson.
- Reviewed by David Levin.
+ DumpRenderTree part of testing <rdar://problem/8093680> "Paste and Match Style" should fire paste events
+ https://bugs.webkit.org/show_bug.cgi?id=41085
- Add checks for multi-line boolean operator placement.
- https://bugs.webkit.org/show_bug.cgi?id=27496
+ * DumpRenderTree/mac/DumpRenderTree.mm: (resetWebViewToConsistentStateBeforeTesting):
+ Clear the general pasteboard in between tests so Cut,Copy, and setData on ClipboardData won't have lasting effects.
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+2010-06-23 Sam Weinig <sam@webkit.org>
-2009-07-21 Adam Treat <adam.treat@torchmobile.com>
+ Reviewed by Anders Carlsson.
- Reviewed by David Levin.
+ 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):
- We can't match implementation file and primary header exactly
- since we have so many files in WebKit where the port suffix
- is appended to the filename.
+2010-06-24 Luiz Agostini <luiz.agostini@openbossa.org>
- Example: FooQt.cpp and the primary header is Foo.h.
+ Unreviewed. Adding myself to the committers list.
- * Scripts/modules/cpplint.py:
+ * Scripts/webkitpy/common/config/committers.py:
-2009-07-21 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+2010-06-23 Kevin Ollivier <kevino@theolliviers.com>
- Reviewed by David Levin.
+ [wx] Build fix, adding new LayoutTestController methods and enabling SVG_FOREIGN_OBJECT.
- Add checks for switch statement indentation to cpplint.
- https://bugs.webkit.org/show_bug.cgi?id=27508
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::isPageBoxVisible):
+ (LayoutTestController::pageAreaRectInPixels):
+ (LayoutTestController::preferredPageSizeInPixels):
+ * wx/build/settings.py:
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+2010-06-23 James Robinson <jamesr@chromium.org>
-2009-07-21 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ Unreviewed. Add my IRC handle to committers.py so the sheriffbot can yell at me.
- Reviewed by Adam Treat.
+ * Scripts/webkitpy/common/config/committers.py:
- Feature request: cpplint should check for braces - rule 2
- https://bugs.webkit.org/show_bug.cgi?id=27497
+2010-06-23 Kent Tamura <tkent@chromium.org>
- Add the requested feature: Make sure { is on the same line
- as the foreach "keyword".
+ Reviewed by Dimitri Glazkov.
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ Correct Chromium test configuration
+ https://bugs.webkit.org/show_bug.cgi?id=41057
-2009-07-20 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+ * 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.
- Reviewed by David Levin.
+2010-06-23 Sam Weinig <sam@webkit.org>
- Add checks for namespace indentation to cpplint.
- https://bugs.webkit.org/show_bug.cgi?id=27461
+ Reviewed by Anders Carlsson.
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=41073
+ WebKit2: Flesh out more of the InjectedBundle client API
-2009-07-20 Adam Treat <adam.treat@torchmobile.com>
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didStartProvisionalLoadForFrame):
+ (_didReceiveServerRedirectForProvisionalLoadForFrame):
+ (_didFailProvisionalLoadWithErrorForFrame):
+ (_didCommitLoadForFrame):
+ (_didFinishLoadForFrame):
+ (_didFailLoadWithErrorForFrame):
+ (_didReceiveTitleForFrame):
+ (_didClearWindowForFrame):
+ (_didCreatePage):
+ (_willDestroyPage):
+ (WKBundleInitialize):
- Reviewed by David Levin.
+2010-06-23 Yuzo Fujishima <yuzo@google.com>
- Add cpplint check for proper include order
- https://bugs.webkit.org/show_bug.cgi?id=27462
+ Reviewed by Shinichiro Hamaji.
- Add a new check to cpplint to flag cases where the include section of a file
- does not match the mandated include order and style of the Webkit coding style
- guidelines.
+ Implement page format data programming interface.
+ Add methods for testing.
+ https://bugs.webkit.org/show_bug.cgi?id=37538
- Add associated tests.
+ * 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):
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+2010-06-23 Sam Magnuson <smagnuson@netflix.com>
-2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+ Reviewed by Shinichiro Hamaji.
- Reviewed by David Levin.
+ 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
- Support lint for patches
- https://bugs.webkit.org/show_bug.cgi?id=27291
+ Modified test so that if( foo ) is not allowed as it appears not
+ to be the accepted convention.
- Add run-webkit-lint script, which lints recent changes in local
- repository. Also, modified cpplint.py so that we don't need to
- specify verbose level for process_file().
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
- * Scripts/modules/cpplint.py:
- * Scripts/run-webkit-lint: Added.
+2010-06-22 Eric Seidel <eric@webkit.org>
-2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+ Reviewed by Adam Barth.
- Reviewed by David Levin.
+ Run clean-header-guards to fix some header guards
+ https://bugs.webkit.org/show_bug.cgi?id=41044
- diff_parser should accept lines without trailing \n
- https://bugs.webkit.org/show_bug.cgi?id=27483
+ No functional changes, thus no tests.
- Normalize the input lines by removing a trailing newline.
- Also, add a case for unittest for newly added files.
+ 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.
- * Scripts/modules/diff_parser.py:
- * Scripts/modules/diff_parser_unittest.py:
+ 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.
-2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+ * DumpRenderTree/chromium/WebThemeControlDRT.h:
+ * DumpRenderTree/chromium/WebThemeEngineDRT.h:
+ * QtTestBrowser/fpstimer.h:
- Reviewed by David Levin.
+2010-06-22 Adam Barth <abarth@webkit.org>
- cpplint.py's process_file() should accept customized error function
- https://bugs.webkit.org/show_bug.cgi?id=27487
+ Reviewed by Eric Seidel.
- * Scripts/modules/cpplint.py:
+ Rename HTMLDocumentParser to LegacyHTMLDocumentParser
+ https://bugs.webkit.org/show_bug.cgi?id=41043
-2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+ Update the hash.
- Reviewed by David Levin.
+ * Scripts/do-webcore-rename:
- cpplint.py should have an interface to get global error count
- https://bugs.webkit.org/show_bug.cgi?id=27486
+2010-06-22 Sam Magnuson <smagnuson@netflix.com>
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ Reviewed by Shinichiro Hamaji.
-2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+ Follow proper convention for variable declaration spacing.
+ https://bugs.webkit.org/show_bug.cgi?id=40724
- Reviewed by David Levin.
+ Modified test so that 'int a;' is not allowed.
- cpplint's parse_argument should not exit even if no files are specified
- https://bugs.webkit.org/show_bug.cgi?id=27489
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+2010-06-22 Eric Seidel <eric@webkit.org>
-2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+ Unreviewed. Add Tony Gentilcore now that he's a committer.
- Reviewed by David Levin.
+ * Scripts/webkitpy/common/config/committers.py:
- diff_parser: s/add_deleted_line/add_old_line/g
- https://bugs.webkit.org/show_bug.cgi?id=27484
+2010-06-22 Eric Seidel <eric@webkit.org>
- * Scripts/modules/diff_parser.py:
+ Reviewed by Adam Barth.
-2009-07-21 Roland Steiner <rolandsteiner@google.com>
+ Remove Gtk 64-Release bot from core since it's broken
+ https://bugs.webkit.org/show_bug.cgi?id=41022
- Reviewed by David Levin.
+ 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.
- Add ENABLE_RUBY to list of build options
- https://bugs.webkit.org/show_bug.cgi?id=27324
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
- * Scripts/build-webkit: Added flag ENABLE_RUBY.
+2010-06-21 Dumitru Daniliuc <dumi@chromium.org>
-2009-07-20 Mark Rowe <mrowe@apple.com>
+ Reviewed by Eric Seidel.
- Reviewed by David D. Kilzer.
+ Fix the Windows build.
+ https://bugs.webkit.org/show_bug.cgi?id=40972
- Fix <https://bugs.webkit.org/show_bug.cgi?id=27482>.
- Bug 27482: svn-apply cannot apply patch generated by Windows SVN
+ * DumpRenderTree/win/ImageDiff.vcproj:
- A regexp in svn-apply was treating everything prior to a \n as part of the
- file name. The native Windows SVN client uses \r\n for line endings which
- meant that the \r was being included in the file name. This defeated the
- special-case logic for ChangeLogs to apply them with an increased fuzz factor,
- meaning that the ChangeLog portions of such patches would fail to apply.
+2010-06-21 Prasad Tammana <prasadt@chromium.org>
- Also updated two other regexps that look like they would hit similar problems
- with line-endings so that they will correctly handle patches from Windows SVN.
+ Reviewed by Darin Adler, Dmitry Titov.
- * Scripts/svn-apply:
+ DumpRenderTree should allow tests with modal dialogs
+ https://bugs.webkit.org/show_bug.cgi?id=35350
-2009-07-20 Peter Kasting <pkasting@google.com>
+ * 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.
- Reviewed by Mark Rowe.
+ * 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.
- https://bugs.webkit.org/show_bug.cgi?id=27468
- Back out r46060, which caused problems for some Apple developers.
+2010-06-21 Simon Fraser <simon.fraser@apple.com>
- * DumpRenderTree/win/DumpRenderTree.vcproj:
- * DumpRenderTree/win/ImageDiff.vcproj:
- * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+ Reviewed by Anders Carlsson.
+
+ Rename DrawingAreaProxyUpdateChunk to ChunkedUpdateDrawingArea
+ https://bugs.webkit.org/show_bug.cgi?id=40948
+
+ Have the script look in WebKit2.
-2009-07-20 Peter Kasting <pkasting@google.com>
+ * Scripts/do-webcore-rename:
- Reviewed by Darin Adler.
+2010-06-21 Robert Hogan <robert@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Use shorter, more correct code for determining the current directory,
- which works better with symbolic links on some systems. Also switch
- from checking repository root to checking UUID, to match scm.py.
+ Reviewed by Kenneth Rohde Christiansen.
- * Scripts/svn-create-patch:
+ [Qt] Unskip plugins/get-url-that-the-resource-load-delegate-will-disallow.html
-2009-07-20 Mark Rowe <mrowe@apple.com>
+ 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.
- Rubber-stamped by Dan Bernstein.
+ https://bugs.webkit.org/show_bug.cgi?id=33344
- Work around <rdar://problem/7075373> by ensuring that the URL is absolute before handing it off to CoreText.
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::addDisallowedURL):
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (activateFonts):
+2010-06-21 Sam Weinig <sam@webkit.org>
-2009-07-20 David Levin <levin@chromium.org>
+ Reviewed by Anders Carlsson.
- Reviewed by Adam Treat.
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=40940
+ Add message passing support to the WebKit2 API.
- Enable filename completion for run-webkit-test (added "-o default").
+ - Add some test messages.
- * Scripts/webkit-tools-completion.sh:
+ * MiniBrowser/mac/AppDelegate.m:
+ (_didRecieveMessageFromInjectedBundle):
+ (-[BrowserAppDelegate init]):
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didClearWindow):
+ (_didCreatePage):
+ (_didRecieveMessage):
+ (WKBundleInitialize):
-2009-07-20 Simon Hausmann <simon.hausmann@nokia.com>
+2010-06-21 Drew Wilson <atwilson@chromium.org>
- No review, just adding Gavin Barraclough as reviewer.
+ Unreviewed.
- * Scripts/modules/bugzilla.py:
+ Rolling back 61551 and 61555 due to test failures.
-2009-07-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setEditingBehavior):
+ * DumpRenderTree/mac/UIDelegate.mm:
- Reviewed by David Levin.
+2010-06-21 Anders Carlsson <andersca@apple.com>
- Add support for Qt's foreach to cpplint
- https://bugs.webkit.org/show_bug.cgi?id=27386
+ Reviewed by Sam Weinig.
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ Make DumpRenderTree build with clang++
-2009-07-18 Jan Michael Alonzo <jmalonzo@webkit.org>
+ * DumpRenderTree/mac/DumpRenderTreePasteboard.m:
+ (-[LocalPasteboard setPropertyList:forType:]):
+ * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+ (-[DumpRenderTreeWindow keyDown:]):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::elementDoesAutoCompleteForElementWithId):
+ (LayoutTestController::isCommandEnabled):
- https://bugs.webkit.org/show_bug.cgi?id=27145
- [Gtk][REGRESSION] subframe-navigate-during-main-frame-load.html fails after r45615
+2010-06-21 Satish Sampath <satish@chromium.org>
- Reviewed by Gustavo Noronha.
+ Reviewed by Steve Block.
- Normalize file URLs.
+ Speech Input Patch 0: Added compilation argument to conditionally compile pending patches.
+ https://bugs.webkit.org/show_bug.cgi?id=40878
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (dumpHistoryItem):
+ * Scripts/build-webkit:
-2009-07-17 Peter Kasting <pkasting@google.com>
+2010-06-21 Kent Tamura <tkent@chromium.org>
- Reviewed by David Kilzer.
+ Reviewed by Dimitri Glazkov.
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Further improve non-Cygwin SVN support.
+ [DRT/Chromium] Initialization for http/tests/loading/
+ https://bugs.webkit.org/show_bug.cgi?id=40902
- * Scripts/prepare-ChangeLog: Harmless change to be consistent with other
- places that consume whitespace at the end of svn output.
- * Scripts/resolve-ChangeLogs: Add support for SVN 1.6. Slightly
- optimize svn info parsing based on technique in svn-create-patch.
- Normalize paths and consume whitespace in the same way as
- prepare-ChangeLog, for Windows systems with a non-Cygwin SVN. Force
- diff and patch to run in binary mode so that they won't
- "intelligently" screw up line endings.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::runFileTest):
-2009-07-18 Simon Fraser <simon.fraser@apple.com>
+2010-06-21 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
- Fix Tiger DRT build.
+ Unreviewed.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (createWebViewAndOffscreenWindow):
- * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ Adding myself to the committers list.
-2009-07-17 Simon Fraser <simon.fraser@apple.com>
+ * Scripts/webkitpy/common/config/committers.py:
- Reviewed by Dan Bernstein.
+2010-06-20 Kent Tamura <tkent@chromium.org>
- DRT doesn't reliably snapshot composited layers
- https://bugs.webkit.org/show_bug.cgi?id=27399
-
- If we're doing an "onscreen" pixel capture, it means that we're snapshotting a view
- with composited content. In that case we need to force the view to display so that
- the composited layers are rendered to the screen.
-
- * DumpRenderTree/mac/PixelDumpSupportMac.mm:
- (createBitmapContextFromWebView):
+ Reviewed by Dimitri Glazkov.
-2009-07-17 Adam Barth <abarth@webkit.org>
+ [DRT/Chromium] Add --allow-external-pages option
+ https://bugs.webkit.org/show_bug.cgi?id=40762
- Reviewed by David Levin.
+ Add --allow-external-pages introduced by Chromium r45403.
+ http://src.chromium.org/viewvc/chrome?view=rev&revision=45403
- bugzilla-tool does not understand nested SVN repos
- https://bugs.webkit.org/show_bug.cgi?id=27404
+ * 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):
- Determine the root of the working copy by looking at SVN's UUIDs.
+2010-06-20 Joseph Pecoraro <joepeck@webkit.org>
- * Scripts/modules/scm.py:
+ Reviewed by Adam Barth.
-2009-07-17 David Levin <levin@chromium.org>
+ Sheriffbot: Should allow "r" in SVN_REVISION
+ https://bugs.webkit.org/show_bug.cgi?id=40889
- Reviewed by Mark Rowe.
+ * 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.
- webkit-tools-completion.sh has two typos and sorting issues.
- https://bugs.webkit.org/show_bug.cgi?id=27401
+2010-06-20 Joseph Pecoraro <joepeck@webkit.org>
- * Scripts/webkit-tools-completion.sh: Fix two typos "--dif" and "-clean".
- Also, sort all lists including items in the case statement and flags for
- the commands.
+ Reviewed by Dimitri Glazkov.
-2009-07-17 Peter Kasting <pkasting@google.com>
+ Python Tests Fail after r61508
+ https://bugs.webkit.org/show_bug.cgi?id=40891
- Reviewed by David Kilzer.
+ 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.
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Tweak some regexes for correctness.
+ Regex list fixed in r61512. Updated bot list.
- * Scripts/prepare-ChangeLog: Allow 1-character filenames (my previous
- change here didn't quite get things right).
- * Scripts/update-webkit: Detect conflicting ChangeLogs correctly by not
- including any trailing whitespace in the name "ChangeLog", and by
- normalizing paths before calling basename() to avoid confusing it.
- (normalizePath() copied from prepare-ChangeLog.)
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
-2009-07-17 Peter Kasting <pkasting@google.com>
+2010-06-20 Dimitri Glazkov <dglazkov@chromium.org>
- Reviewed by Steve Falkenburg.
+ Unreviewed, build fix.
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Only add Cygwin to the path when it isn't already there. This avoids
- causing problems for people who purposefully have non-Cygwin versions of
- executables like svn in front of the Cygwin ones in their paths.
+ Tweak test regexp list to match the change in http://trac.webkit.org/changeset/61508.
- * DumpRenderTree/win/DumpRenderTree.vcproj:
- * DumpRenderTree/win/ImageDiff.vcproj:
- * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py: Tweaked regexp.
-2009-07-17 David Levin <levin@chromium.org>
+2010-06-19 Justin Schuh <jschuh@chromium.org>
- Reviewed by Adam Treat.
+ Unreviewed.
- WebKit should have a bash completion script to aid with common commands.
- https://bugs.webkit.org/show_bug.cgi?id=27374
+ Adding myself to the committers list.
- * Scripts/webkit-tools-completion.sh: The script which enables option completion
- for several WebKit command line scripts.
+ * Scripts/webkitpy/common/config/committers.py:
-2009-07-17 Peter Kasting <pkasting@google.com>
+2010-06-19 Sam Weinig <sam@webkit.org>
- Reviewed by David Kilzer.
+ Reviewed by Anders Carlsson.
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Avoid error spew on Macs, and fix a few other tiny details.
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=40882
+ Add ability to have a WebProcess per WebContext.
- * Scripts/svn-create-patch:
+ Move to use new shared contexts API.
-2009-07-17 Adam Treat <adam.treat@torchmobile.com>
+ * 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):
- Reviewed by Dave Levin.
+2010-06-02 Robert Hogan <robert@webkit.org>
- https://bugs.webkit.org/show_bug.cgi?id=27377
- This makes cpplint complain about this for instance:
+ Reviewed by Adam Barth.
- if (true)
- {
- int foo;
- }
+ [Qt] Support evaluateScriptInIsolatedWorld()
- Add the appropriate unit tests.
+ https://bugs.webkit.org/show_bug.cgi?id=40079
- * Scripts/modules/cpplint.py:
- * Scripts/modules/cpplint_unittest.py:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::evaluateScriptInIsolatedWorld):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
-2009-07-17 Adam Treat <adam.treat@torchmobile.com>
+2010-06-18 Dimitri Glazkov <dglazkov@chromium.org>
- Reviewed by Dave Levin.
+ Reviewed by Darin Adler.
- https://bugs.webkit.org/show_bug.cgi?id=27377
- Don't filter whitespace at the end of the line. This is not
- explicitly a rule of webkit coding style, but there is no reason
- not to warn of this common style problem.
+ Add three more non-core Chromium builders to start testing DumpRenderTree.
+ https://bugs.webkit.org/show_bug.cgi?id=40335
- Don't filter whitespace newline. Now, cpplint will complain
- about the following situation:
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Added 3 builders.
- if (true) {
- doSomething();
- doSomethingAgain();
- }
- else
- doSomething();
+2010-06-18 Drew Wilson <atwilson@chromium.org>
- Which is a webkit coding style rule violation.
+ Reviewed by Darin Fisher.
- * Scripts/modules/cpplint.py:
+ [Chromium] Plumbing for top-level frame names
+ https://bugs.webkit.org/show_bug.cgi?id=40430
-2009-07-17 Adam Treat <adam.treat@torchmobile.com>
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::reset):
+ Changed obsolete call to clearName() to use setName(WebString()) instead.
- Reviewed by Dave Levin.
+2010-06-18 Sam Weinig <weinig@apple.com>
- https://bugs.webkit.org/show_bug.cgi?id=27377
- Move this comment to where it belongs.
+ Rolling http://trac.webkit.org/changeset/61297 back in.
- * Scripts/modules/cpplint_unittest.py:
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/mac/WebBundle/WebBundleMain.c: Removed.
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m: Added.
+ (_didClearWindow):
+ (_didCreatePage):
+ (WKBundleInitialize):
-2009-07-17 Brent Fulgham <bfulgham@webkit.org>
+2010-06-18 Alexey Proskuryakov <ap@apple.com>
- Reviewed by Adam Roben.
+ Reviewed by Darin Adler.
- Correct crash in WinLauncher due to improper mixing of BSTR
- and TCHAR types.
- https://bugs.webkit.org/show_bug.cgi?id=27381
+ https://bugs.webkit.org/show_bug.cgi?id=40803
+ TestNetscapePlugin has an incorrect implementation of "property" property
- * WinLauncher/WinLauncher.cpp:
- (loadURL): Perform SysReAllocString to update the BSTR with
- the contents of the TCHAR string.
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (pluginGetProperty): Don't
+ pass a static string back, it's going to be released by NPAPI implementation.
-2009-07-17 David Levin <levin@chromium.org>
+2010-06-18 Leandro Pereira <leandro@profusion.mobi>
- Reviewed by Adam Treat.
+ Unreviewed.
- cpplint should flag usages of NULL.
- https://bugs.webkit.org/show_bug.cgi?id=27341
+ Adding myself to the committers list.
- * Scripts/modules/cpplint.py: Add the check for NULL test and call it.
- Make the collapse_strings method public.
- * Scripts/modules/cpplint_unittest.py: Add several tests to verify
- the check for NULL behavior. Adjust existing tests due to the
- new NULL check:
- 1. Several had NULL removed (or were just removed completely).
- 2. Two tests now do an assert that allows the caller to check
- that a particular error is one of several that was returned.
+ * Scripts/webkitpy/common/config/committers.py:
-2009-07-17 Shinichiro Hamaji <hamaji@chromium.org>
+2010-06-17 Tony Chang <tony@chromium.org>
- Reviewed by David Levin.
+ Reviewed by Kent Tamura.
- Add a parser of patches for linter.
- https://bugs.webkit.org/show_bug.cgi?id=27363
+ [chromium] cleanup redundant DEPS value and remove buildbot cleanup code
+ https://bugs.webkit.org/show_bug.cgi?id=40615
- Adds a simple parser for unified diff format.
+ * Scripts/update-webkit-chromium: remove directory removal of third_party in old checkouts
- * Scripts/modules/diff_parser.py: Added.
- * Scripts/modules/diff_parser_unittest.py: Added.
+2010-06-17 Ada Chan <adachan@apple.com>
-2009-06-30 Holger Hans Peter Freyther <zecke@selfish.org>
+ Rolling out http://trac.webkit.org/changeset/61297 due to build errors.
- Reviewed by Simon Hausmann.
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/mac/WebBundle/WebBundleMain.c: Copied from MiniBrowser/mac/WebBundle/WebBundleMain.c.
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m: Removed.
- [GTK+] Remove check to be loadable in firefox
- https://bugs.webkit.org/show_bug.cgi?id=27345
+2010-06-17 Darin Adler <darin@apple.com>
- if (aMozillaVTable->size < sizeof (NPNetscapeFuncs))
- fails in firefox but no other example in the mozilla tree is
- doing that check. Remove and be happy.
+ One more try at fix for Chromium build.
- * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
- (NP_Initialize):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell): Use set again instead of =.
-2009-07-17 Adam Treat <adam.treat@torchmobile.com>
+2010-06-17 Darin Adler <darin@apple.com>
- Reviewed by Simon Hausmann.
+ Fix Chromium build.
- Something about having a single TAB in a style checking tool like this
- is equivalent to nails on a chalk board to me...
+ 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.
- * Scripts/modules/cpplint.py:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell): Changed back to using "new".
+ * DumpRenderTree/chromium/TestShell.h: Changed back to OwnPtr.
-2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+2010-06-17 Simon Hausmann <simon.hausmann@nokia.com>
- Reviewed by Simon Hausmann.
+ Unreviewed Qt build fix.
- Overwrite the plugin directories for the DRT.
- Part of https://bugs.webkit.org/show_bug.cgi?id=27215
+ LayoutTestController in the Qt DRT is not using refs :)
- * DumpRenderTree/qt/DumpRenderTree.cpp:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::DumpRenderTree):
-2009-07-16 Fumitoshi Ukai <ukai@chromium.org>
-
- Reviewed by David Levin.
+2010-06-17 Darin Adler <darin@apple.com>
- Add --web-sockets flag and ENABLE_WEB_SOCKETS define.
- https://bugs.webkit.org/show_bug.cgi?id=27206
-
- Add --web-sockets flag.
+ Reviewed by Sam Weinig.
- * Scripts/build-webkit: add --web-sockets flag.
+ Use adoptRef and create functions in more code paths
+ https://bugs.webkit.org/show_bug.cgi?id=40760
-2009-07-16 Adam Treat <adam.treat@torchmobile.com>
+ * DumpRenderTree/DumpRenderTree.h: Change gLayoutTestController to a RefPtr.
- Reviewed by Dave Levin.
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::create): Added.
+ * DumpRenderTree/LayoutTestController.h: Declare the create function.
- cpplint should check for one line control clauses that are surrounded
- by braces
- https://bugs.webkit.org/show_bug.cgi?id=27354
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell): Use create instead of new.
+ * DumpRenderTree/chromium/TestShell.h: Use RefPtr instead of OwnPtr.
- * Scripts/modules/cpplint.py: Added the new lint check.
- * Scripts/modules/cpplint_unittest.py: Add tests for the new lint check
- and fix the other tests as they were not passing this new lint check.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (runTest): Use RefPtr and create instead of OwnPtr and new.
-2009-07-16 Peter Kasting <pkasting@google.com>
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (runTest): Use RefPtr and create instead of OwnPtr and new.
- Reviewed by David Kilzer.
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree): Use create and releaseRef
+ instead of new.
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Improve support for WebKit checkouts hosted inside other checkouts
- (possible for some ports, e.g. Chromium).
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (runTest): Use RefPtr and create instead of OwnPtr and new.
- * Scripts/svn-create-patch: Determine SVN root by looking for Repository
- Root string and aborting when it's missing or different than what
- we've already seen.
+ * 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.
-2009-07-16 Peter Kasting <pkasting@google.com>
+2010-06-17 Kent Tamura <tkent@chromium.org>
- Reviewed by Adam Roben.
+ Reviewed by Shinichiro Hamaji.
- https://bugs.webkit.org/show_bug.cgi?id=27323
- Improve support for non-Cygwin SVNs on Windows.
+ [DRT/Chromium] Fix a bug of Windows pixel tests
+ https://bugs.webkit.org/show_bug.cgi?id=40763
- * Scripts/commit-log-editor: Modify regex so that trailing whitespace
- (e.g. \r) isn't included in filenames.
- * Scripts/prepare-ChangeLog: Fix a case of adding "\n" to the ChangeLog
- without normalizing. Normalize file paths early instead of late so
- all stages of the script work. Modify regexes so that trailing
- whitespace (e.g. \r) isn't included in filenames.
- * Scripts/svn-create-patch: Use a regex instead of chomp so we cut off
- line endings even if they don't match Perl's.
+ * DumpRenderTree/chromium/TestEventPrinter.cpp:
+ (TestShellPrinter::handleImage):
-2009-07-16 Joseph Pecoraro <joepeck02@gmail.com>
+2010-06-16 Kent Tamura <tkent@chromium.org>
- Reviewed by Darin Adler.
+ Reviewed by Shinichiro Hamaji.
- WebKitTools/Scripts/svn-create-patch is broken
- https://bugs.webkit.org/show_bug.cgi?id=27328
+ [DRT/Chromium] Fix crash on Mac Release
+ https://bugs.webkit.org/show_bug.cgi?id=40759
- * Scripts/svn-create-patch: one line fix for unusual perl behavior
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::paintRect): We should not use m_canvas directly because
+ it is created lazily in canvas().
-2009-07-16 David Levin <levin@chromium.org>
+2010-06-16 Kevin Ollivier <kevino@theolliviers.com>
- Reviewed by David Kilzer.
+ [wx] Build fix after new method addition.
- cpplint should check for equality comparisons to 0/true/false
- https://bugs.webkit.org/show_bug.cgi?id=27333
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::pageProperty):
- * Scripts/modules/cpplint.py: Added the new lint check.
- * Scripts/modules/cpplint_unittest.py: Add tests for the new lint check
- and fix a regex that in another unit test that caused it to fail when
- you have a directory with a number in it (like WebKit-2)
+2010-06-16 Kent Tamura <tkent@chromium.org>
-2009-07-16 David D. Kilzer <ddkilzer@webkit.org>
+ Reviewed by Dimitri Glazkov.
- <http://webkit.org/b/27241> bugzilla-tool post-commits silently fails with bad args
+ [DRT/Chromium] Set current working directory for each of tests
+ https://bugs.webkit.org/show_bug.cgi?id=40668
- Reviewed by Eric Seidel.
+ This change fixes tests with eventSender.beginDragWithFiles().
- * Scripts/bugzilla-tool:
- (PostCommitsAsPatchesToBug.execute): Added more error checking
- when consuming arguments.
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (runTest):
-2009-07-16 David D. Kilzer <ddkilzer@webkit.org>
+2010-06-16 Martin Robinson <mrobinson@igalia.com>
- TOOL FIX: scm.py: CommitMessage.message is ambiguous
+ Reviewed by Gustavo Noronha Silva.
- Fixes this error when running bugzilla-tool apply-patches
- --local-commit:
+ [GTK] r60803 broke media/controls-drag-timebar.html
+ https://bugs.webkit.org/show_bug.cgi?id=40269
- File "bugzilla-tool", line 188, in apply_patches
- scm.commit_locally_with_message(commit_message.message() or patch['name'])
- TypeError: 'list' object is not callable
+ 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.
- * Scripts/modules/scm.py: After r45940 (and r45971), rename
- CommitMessage.message attribute to CommitMessage.message_lines.
- (CommitMessage.__init__):
- (CommitMessage.body):
- (CommitMessage.description):
- (CommitMessage.message):
- (CommitMessage.parse_bug_id):
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (sendOrQueueEvent): Only queue events here if dragMode is true.
-2009-07-16 David D. Kilzer <ddkilzer@webkit.org>
+2010-06-16 Martin Robinson <mrobinson@igalia.com>
- TOOL FIX: bugzilla-tool: import CommitMessage class
+ Reviewed by Gustavo Noronha Silva.
- * Scripts/bugzilla-tool: After r45940, the CommitMessage class
- needs to be imported for commit_message_for_this_commit().
+ [GTK] Remove the abuse of GDK_CURRENT_TIME in the DRT
+ https://bugs.webkit.org/show_bug.cgi?id=40600
-2009-07-16 David Levin <levin@chromium.org>
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (prepareMouseButtonEvent): Remove logic adding an offset to GDK_CURRENT_TIME.
- Reviewed by Maciej Stachowiak.
+2010-06-16 Adam Barth <abarth@webkit.org>
- prepare-ChangeLog should display the --bug option in its help text.
- https://bugs.webkit.org/show_bug.cgi?id=27334
+ Reviewed by Dimitri Glazkov.
- * Scripts/prepare-ChangeLog: Added the help text.
+ Add a hidden land-cowboy command to webkit-patch to help land quick
+ build fixes.
-2009-07-15 Darin Adler <darin@apple.com>
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
- * Scripts/do-webcore-rename: Check in the version used to
- rename parseURL to deprecatedParseURL.
+2010-06-16 Adam Roben <aroben@apple.com>
-2009-07-10 David Kilzer <ddkilzer@apple.com>
+ Convert console messages to UTF-8 before printing them
- bugzilla-tool: create CommitMessage class
+ 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 Eric Seidel.
+ Reviewed by Alexey Proskuryakov.
- Create a CommitMessage class to encapsulate related code.
-
- * Scripts/bugzilla-tool:
- (bug_id_from_commit_message): Moved to
- CommitMessage.parse_bug_id().
- (commit_message_for_this_commit): Return a CommitMessage.
- (ApplyPatchesFromBug.apply_patches): Use CommitMessage.message().
- (LandPatchesFromBugs.build_and_commit): Ditto.
- (CommitMessageForCurrentDiff.execute): Ditto.
- (PostCommitsAsPatchesToBug.execute): Switched from
- Git.commit_message_for_commit() to
- Git.commit_message_for_local_commit(). Switched from
- bug_id_from_commit_message() to CommitMessage.parse_bug_id().
-
- * Scripts/modules/scm.py:
- (first_non_empty_line_after_index): Added.
- (CommitMessage.__init__): Added.
- (CommitMessage.body): Added.
- (CommitMessage.description): Added.
- (CommitMessage.message): Added.
- (CommitMessage.parse_bug_id): Added. Moved from
- bug_id_from_commit_message() in bugzilla-tool.
- (Git.commit_message_for_local_commit): Renamed from
- commit_message_for_commit(). Return a CommitMessage.
-
-2009-07-15 Joseph Pecoraro <joepeck02@gmail.com>
+ * 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.
- Reviewed by David Kilzer.
+ * DumpRenderTree/win/DumpRenderTreeWin.h: Declare the new toUTF8
+ overload.
- bugzilla-tool/svn-apply can't handle patches made from a non-root directory
- https://bugs.webkit.org/show_bug.cgi?id=26999
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::webViewAddMessageToConsole): Use toUTF8 to convert to
+ UTF-8 instead of letting printf convert to the current code page.
- * Scripts/svn-create-patch:
+2010-06-16 Drew Wilson <atwilson@chromium.org>
-2009-07-15 Shinichiro Hamaji <hamaji@chromium.org>
+ Reviewed by Kent Tamura.
- Reviewed by David Levin.
+ [Chromium] Plumbing for top-level frame names
+ https://bugs.webkit.org/show_bug.cgi?id=40430
- Move cpplint.py to module directory
- https://bugs.webkit.org/show_bug.cgi?id=27302
+ * 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.
- * Scripts/modules/cpplint.py: Renamed from WebKitTools/Scripts/cpplint.py.
- * Scripts/modules/cpplint_unittest.py: Renamed from WebKitTools/Scripts/cpplint_unittest.py.
+2010-06-16 Diego Gonzalez <diegohcg@webkit.org>
-2009-07-15 Simon Hausmann <simon.hausmann@nokia.com>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by Adam Treat.
+ [Qt] Scroll wheel event support to graphics based DRT
+ https://bugs.webkit.org/show_bug.cgi?id=40577
- https://bugs.webkit.org/show_bug.cgi?id=27295
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::continuousMouseScrollBy):
+ (EventSender::createGraphicsSceneWheelEvent):
+ * DumpRenderTree/qt/EventSenderQt.h:
- Re-implement QWebPage::shouldInterruptJavaScript to disable
- js interruption and avoid showing a messagebox during Qt DRT
- runs when script execution takes a bit longer.
+2010-06-16 Adam Roben <aroben@apple.com>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::shouldInterruptJavaScript): Return false
- in re-implemented slot.
+ Remove a stray newline from the Windows version of TestNetscapePlugin
-2009-07-15 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
+ Reviewed by Alexey Proskuryakov.
- Reviewed by Jan Alonzo.
+ Fixes <http://webkit.org/b/40728>
+ plugins/geturlnotify-during-document-teardown.html fails on Windows
- Fix the DumpRenderTree GTK+ build
- https://bugs.webkit.org/show_bug.cgi?id=27290
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_Destroy): Removed extra newline that the Mac version doesn't
+ have.
- Set USE_SYSTEM_MALLOC macro for the DumpRenderTree build to
- disable using TCmalloc in DumpRenderTree.
+2010-06-16 Adam Roben <aroben@apple.com>
- * GNUmakefile.am:
+ Respect LayoutTestController::isPrinting on Windows
-2009-07-14 Steve Falkenburg <sfalken@apple.com>
+ This gets some printing tests closer to passing (like
+ printing/page-rule-in-media-query.html).
- Reorganize JavaScriptCore headers into:
- API: include/JavaScriptCore/
- Private: include/private/JavaScriptCore/
+ Fixes <http://webkit.org/b/40727>.
- Reviewed by Darin Adler.
+ Reviewed by Dan Bernstein.
- * DumpRenderTree/win/DumpRenderTree.vcproj:
- * DumpRenderTree/win/ImageDiff.vcproj:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (dump): Pass LayoutTestController::isPrinting to
+ IWebFramePrivate::renderTreeAsExternalRepresentation.
-2009-07-14 Shinichiro Hamaji <hamaji@chromium.org>
+2010-06-15 Adam Barth <abarth@webkit.org>
- Reviewed by David Levin.
+ Reviewed by Eric Seidel.
- WebKit needs a style linting tool
- https://bugs.webkit.org/show_bug.cgi?id=25884
+ Enable HTML5 lexer
+ https://bugs.webkit.org/show_bug.cgi?id=40650
- Modifies cpplint (http://google-styleguide.googlecode.com/svn/trunk/cpplint/)
- based on WebKit's style guide.
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (initializeGlobalsFromCommandLineOptions):
- * Scripts/cpplint.py: Added.
- * Scripts/cpplint_unittest.py: Added.
+2010-06-10 Yuzo Fujishima <yuzo@google.com>
-2009-07-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+ Reviewed by Shinichiro Hamaji.
- Reviewed by Simon Hausmann.
+ Implement render style selection for pages to support CSS3 Paged Media.
+ https://bugs.webkit.org/show_bug.cgi?id=35961
- [Qt] DumpRenderTree no longer builds with Qt4.4
- https://bugs.webkit.org/show_bug.cgi?id=27257
+ * 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):
- Flag Qt 4.5 dependency to allow building with Qt 4.4.
+2010-06-15 Sam Weinig <sam@webkit.org>
- * DumpRenderTree/qt/main.cpp:
- (main):
+ Reviewed by Anders Carlsson.
-2009-07-13 Brent Fulgham <bfulgham@webkit.org>
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=40630
+ WebKit2: Add mechanism to inject code into the WebProcess on startup
- Reviewed by Adam Roben.
+ Add initial InjectedBundle support.
- Add new configuration flag for redistributable Windows build.
- https://bugs.webkit.org/show_bug.cgi=27087
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/WebBundle-Info.plist: Added.
+ Add test InjectedBundle to the project.
- * DumpRenderTree/config.h: Check for presence of WIN_CAIRO and
- select appropriate configuration. Defaults to standard Apple build.
- * DumpRenderTree/win/DumpRenderTree.vcproj: Add new WinCairo.vsprops
- to Debug_Cairo and Release_Cairo targets.
+ * 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.
-2009-07-13 Simon Hausmann <simon.hausmann@nokia.com>
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (_didChangeProgress):
+ Fix the build. This has been broken for a while.
- Reviewed by Ariya Hidayat.
+ * MiniBrowser/mac/WebBundle: Added.
+ * MiniBrowser/mac/WebBundle/WebBundleMain.c: Added.
+ (_didCreatePage):
+ (WKBundleInitialize):
+ Add really basic InjectedBundle.
- Always run the Qt DRT with the raster graphicssystem on X11, for
- increased stability in the image based tests, in particular canvas.
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+ Switch from WKContextCreateWithProcessModel to WKContextCreate and remove commented out code.
- * DumpRenderTree/qt/main.cpp:
- (main):
+2010-06-15 Dumitru Daniliuc <dumi@chromium.org>
-2009-07-13 Simon Hausmann <simon.hausmann@nokia.com>
+ Reviewed by Darin Adler.
- Reviewed by Ariya Hidayat.
+ Adding myself to the reviewers list.
+ https://bugs.webkit.org/show_bug.cgi?id=40693
- Fix test netscape plugin usage with the Qt DRT.
+ * Scripts/webkitpy/common/config/committers.py:
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage): Enable plugins in the settings.
- * Scripts/run-webkit-tests: Set the QT_WEBKIT_PLUGIN path to the correct build
- directory to make Qt DRT find the test netscape plugin.
+2010-06-15 Martin Robinson <mrobinson@igalia.com>
-2009-07-13 Simon Hausmann <hausmann@webkit.org>
+ Reviewed by Xan Lopez.
- Reviewed by Ariya Hidayat.
+ 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'.
- Make sure to disable the fixed contents size when resetting the page/view
- state between test runs, to avoid side-effects.
+ * GtkLauncher/main.c:
+ (filenameToURL): Use GIO instead of realpath to determine file URI.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::open): Call setFixedContentsSize() with an invalid
- QSize to disable the fixed layout.
+2010-06-15 Adam Roben <aroben@apple.com>
-2009-07-13 Simon Hausmann <hausmann@webkit.org>
+ Remove the redundant set-apple-windows-environment-variables script
- Reviewed by Ariya Hidayat.
+ Apparently update-webkit does this for you these days.
- When creating new windows, don't forget to connect the new
- page's main frame. This ensures that for example the layoutTestController
- is also available there.
+ Rubber-stamped by Steve Falkenburg.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::createWindow):
+ * Scripts/set-apple-windows-environment-variables: Removed.
-2009-07-13 Simon Hausmann <hausmann@webkit.org>
+2010-06-14 Adam Roben <aroben@apple.com>
- Reviewed by Ariya Hidayat.
+ Add a script to set the WebKitOutputDir and WebKitLibrariesDir
+ environment variables
- Added support for LayoutTestController.setPrivateBrowsingEnabled.
+ Fixes <http://webkit.org/b/40595>.
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::reset):
- (LayoutTestController::setPrivateBrowsingEnabled):
- * DumpRenderTree/qt/jsobjects.h:
+ Reviewed by Steve Falkenburg.
-2009-07-13 Simon Hausmann <hausmann@webkit.org>
+ * 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.
- Reviewed by Ariya Hidayat.
+2010-06-14 Adam Roben <aroben@apple.com>
- Added support for database callbacks, storage quota setting,
- and clearing of all databases.
+ Speed up run-safari/debug-safari on Windows
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree):
- (WebCore::DumpRenderTree::dumpDatabaseQuota):
- * DumpRenderTree/qt/DumpRenderTree.h:
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::reset):
- (LayoutTestController::setDatabaseQuota):
- (LayoutTestController::clearAllDatabases):
- * DumpRenderTree/qt/jsobjects.h:
- (LayoutTestController::shouldDumpDatabaseCallbacks):
- (LayoutTestController::dumpDatabaseCallbacks):
- * DumpRenderTree/qt/main.cpp:
- (main):
+ Fixes <http://webkit.org/b/40586>.
-2009-07-13 Simon Hausmann <hausmann@webkit.org>
+ Reviewed by Steve Falkenburg.
- Reviewed by Ariya Hidayat.
+ * 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.
- Setup the path in the Qt DRT for HTML 5 Databases, to enable some of
- the storage layout tests.
+2010-06-15 Diego Gonzalez <diegohcg@webkit.org>
- * DumpRenderTree/qt/main.cpp:
- (main):
+ Reviewed by Kenneth Rohde Christiansen.
-2009-07-13 Simon Hausmann <hausmann@webkit.org>
+ [Qt] DRT EventSender support to graphics context events
+ https://bugs.webkit.org/show_bug.cgi?id=40324
- Reviewed by Ariya Hidayat.
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::contextClick):
- Make the test output more robust by dumping only when the main
- frame finishes loading, instead of when _any_ frame finishes.
+2010-06-14 Tony Chang <tony@chromium.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree): Connect to the
- main frame's loadFinished() signal instead of the page's one.
+ Reviewed by Darin Fisher.
-2009-07-13 Simon Hausmann <hausmann@webkit.org>
+ [chromium] checkout chromium third_party directly
+ https://bugs.webkit.org/show_bug.cgi?id=40556
- Reviewed by Ariya Hidayat.
+ * Scripts/update-webkit-chromium: some migration code for the bots
- Implement the GCController DRT interface.
+2010-06-14 Alexey Proskuryakov <ap@apple.com>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree): Allocate the GCController.
- (WebCore::DumpRenderTree::initJSObjects): Register the interface with the JS engine.
- * DumpRenderTree/qt/DumpRenderTree.h: Declare m_gcController.
- * DumpRenderTree/qt/jsobjects.cpp: Implement GCController.
- (GCController::GCController):
- (GCController::collect):
- (GCController::collectOnAlternateThread):
- (GCController::getJSObjectCount):
- * DumpRenderTree/qt/jsobjects.h: Declare GCController.
+ Chromium build fix.
-2009-07-13 Simon Hausmann <hausmann@webkit.org>
+ * DumpRenderTree/chromium/EventSender.cpp: (EventSender::keyDown): Chromium uses differently
+ named constants for Windows virtual key codes, replacing VK_DELETE with VKEY_DELETE.
- Reviewed by Ariya Hidayat.
+2010-06-14 Alexey Proskuryakov <ap@apple.com>
- Implement the GCController DRT interface in the Qt DRT.
+ Reviewed by Darin Adler.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::DumpRenderTree): Allocate the GCController.
- (WebCore::DumpRenderTree::initJSObjects): Register the interface with the JS engine.
- * DumpRenderTree/qt/DumpRenderTree.h: Declare m_gcController.
- * DumpRenderTree/qt/jsobjects.cpp: Implement GCController.
- (GCController::GCController):
- (GCController::collect):
- (GCController::collectOnAlternateThread):
- (GCController::getJSObjectCount):
- * DumpRenderTree/qt/jsobjects.h: Declare GCController.
+ https://bugs.webkit.org/show_bug.cgi?id=40529
+ eventSender.keyDown("delete") incorrectly sends a backspace on some platforms
-2009-07-13 Jan Michael Alonzo <jmalonzo@webkit.org>
+ * 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.
- https://bugs.webkit.org/show_bug.cgi?id=26718 [Gtk] Add support for javascript windows for DRT
+ * 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.
- Reviewed by Gustavo Noronha and Xan Lopez.
+2010-06-14 Martin Robinson <mrobinson@igalia.com>
- Support running of tests that open and close JS windows automatically.
+ Reviewed by Xan Lopez.
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (dumpFramesAsText):
- (dumpBackForwardListForAllWebViews):
- (resetWebViewToConsistentStateBeforeTesting):
- (dump):
- (runTest):
- (webViewClose):
- (createWebView):
- (webViewCreate):
- (main):
- * DumpRenderTree/gtk/DumpRenderTreeGtk.h:
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::windowCount):
- (LayoutTestController::setPopupBlockingEnabled):
+ Small GtkLauncher build fix for some systems.
-2009-07-13 Shinichiro Hamaji <hamaji@chromium.org>
+ * GtkLauncher/main.c: Add <limit.h> include.
- Reviewed by Maciej Stachowiak.
+2010-06-14 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
- prepare-ChangeLog should decode HTML entities in short description
- https://bugs.webkit.org/show_bug.cgi?id=27122
+ Reviewed by Laszlo Gombos.
- Decode the short description by adding a function which decodes HTML
- entities. It can decode &, <, >, ", and ' . They may be sufficient
- as the description seems to be encoded by xml_quote in
- http://mxr.mozilla.org/bugzilla/source/Bugzilla/Util.pm
+ [Qt] navigator.geolocation support for Qt port
+ https://bugs.webkit.org/show_bug.cgi?id=39724
- * Scripts/prepare-ChangeLog:
+ Implementation for geolocation cases to DumpRenderTreeQt
-2009-07-13 Drew Wilson <atwilson@google.com>
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::allowGeolocationRequest):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setGeolocationPermission):
+ (LayoutTestController::setMockGeolocationError):
+ (LayoutTestController::setMockGeolocationPosition):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::isGeolocationPermissionSet):
+ (LayoutTestController::geolocationPermission):
- Reviewed by David Levin.
+2010-06-13 Nathan Lawrence <nlawrence@apple.com>
- Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs
- https://bugs.webkit.org/show_bug.cgi?id=26932
+ Reviewed by Darin Adler.
- Added support for --shared-workers (turned off by default)
+ Outside of Xcode (make or WebKitTools/Scripts), there doesn't seem to
+ be a way of overwriting the Xcode system path. Making
+ $WEBKITOUTPUTDIR take precedence over the system default would make
+ this possible.
- * Scripts/build-webkit:
+ * Scripts/webkitdirs.pm:
-2009-07-12 Dan Bernstein <mitz@apple.com>
+2010-06-13 Chris Fleizach <cfleizach@apple.com>
- Reviewed by Maciej Stachowiak.
+ Reviewed by Darin Adler.
- https://bugs.webkit.org/show_bug.cgi?id=27196
- Update check-for-global-initializers for the renaming for bidi.cpp to
- RenderBlockLineLayout.cpp
+ AX: link won't return linked element if URL contains #
+ https://bugs.webkit.org/show_bug.cgi?id=40192
- * Scripts/check-for-global-initializers:
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (linkedUIElementAtIndexCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::linkedUIElementAtIndex):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::linkedUIElementAtIndex):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::linkedUIElementAtIndex):
-2009-07-11 Simon Fraser <simon.fraser@apple.com>
+2010-06-13 Adam Barth <abarth@webkit.org>
- Enable support for accelerated compositing and 3d transforms on Leopard.
- <https://bugs.webkit.org/show_bug.cgi?id=20166>
- <rdar://problem/6120614>
+ Reviewed by Darin Adler.
- Reviewed by Oliver Hunt.
+ webkit-patch should add a bug URL to ChangeLogs if they don't have one yet
+ https://bugs.webkit.org/show_bug.cgi?id=39550
- * Configurations/FeatureDefines.xcconfig:
- * wtf/Platform.h:
+ This can cause an extra request to bugs.webkit.org durig upload, but it
+ shouldn't be too bad. Also, this won't work if you remove the
+ boilerplate created by prepare-ChangeLog.
-2009-07-10 David Kilzer <ddkilzer@apple.com>
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog_unittest.py: Added.
- <http://webkit.org/b/27173> svn-apply: Fix typo in git command used to find deleted files
+2010-06-08 Robert Hogan <robert@webkit.org>
Reviewed by Eric Seidel.
- * Scripts/svn-apply:
- (scmWillDeleteFile): Changed 'head' to 'HEAD'.
+ [Qt] Add support for callShouldCloseOnWebView() to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=40330
-2009-07-10 David Kilzer <ddkilzer@apple.com>
-
- <http://webkit.org/b/27167> bugzilla-tool: hide help for unsupported commands
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::callShouldCloseOnWebView):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::setCallCloseOnWebViews):
- Reviewed by Eric Seidel.
+2010-06-12 Eric Seidel <eric@webkit.org>
- When bugzilla-tool -h|--help is invoked in an svn working
- directory, don't print help for commands that are only supported
- on git working directories.
-
- * Scripts/bugzilla-tool:
- (Command.__init__): Added requires_local_commits argument with a
- default of False. Set self.requires_local_commits attribute.
- (PostCommitsAsPatchesToBug.execute): Removed
- SCM.supports_local_commits() check since this is now handled by
- BugzillaTool.main().
- (PostCommitsAsPatchesToBug.__init__): Added
- requires_local_commits=True argument to Command.__init__().
- (BugzillaTool.commands_usage): Don't print help for commands if
- they require local commits and the current SCM doesn't support
- them.
- (BugzillaTool.main): If command_object requires local commits
- and the current SCM doesn't, exit with an error message.
+ Reviewed by Daniel Bates.
-2009-07-10 David Kilzer <ddkilzer@apple.com>
+ do-webcore-rename should have a --verbose option
+ https://bugs.webkit.org/show_bug.cgi?id=40497
- <http://webkit.org/b/27117> bugzilla-tool: use Mac OS X keychain for authentication
+ * Scripts/do-webcore-rename:
+ - Unified how we handle skipping files/directories
+ this will allow us to "black list" certain files and
+ directories when performing renames.
+ - Made do-webcore-rename log what it's skipping when passed --verbose.
- Reviewed by Eric Seidel.
+2010-06-12 Darin Adler <darin@apple.com>
- Try reading credentials from git config first, then keychain if
- running on Mac OS X, else prompt at the command-line.
-
- * Scripts/modules/bugzilla.py: Added "import platform".
- (credentials_from_git): Added.
- (credentials_from_keychain): Added.
- (is_mac_os_x): Added.
- (read_credentials): Added.
- (Bugzilla.__init__): Moved instance attribute bug_server to a
- static attribute named bug-server_url.
- (Bugzilla.bug_server_host): Added. Extracted host name from
- bug_server_url.
- (Bugzilla.bug_server_regex): Updated to be created using
- bug_server_host.
- (Bugzilla.bug_server_url): Renamed from bug_server.
- (Bugzilla.bug_url_for_bug_id): Updated for renaming of
- bug_server to bug_server_url.
- (Bugzilla.attachment_url_for_id): Ditto.
- (Bugzilla.fetch_bug_ids_from_commit_queue): Ditto.
- (Bugzilla.authenticate): Ditto. Updated to use
- read_credentials().
- (Bugzilla.add_patch_to_bug): Ditto.
-
-2009-07-10 David Kilzer <ddkilzer@apple.com>
-
- <http://webkit.org/b/27115> bugzilla-tool: extract duplicate logging methods into a module
+ * Scripts/run-bindings-tests: Fixed a typo in a message.
- Reviewed by Adam Roben.
+2010-06-12 Kent Tamura <tkent@chromium.org>
- * Scripts/bugzilla-tool: Removed error() and log() methods and
- added import of new logging module.
- * Scripts/modules/bugzilla.py: Ditto. Removed "import sys".
- * Scripts/modules/scm.py: Ditto.
+ Reviewed by Dimitri Glazkov.
- * Scripts/modules/logging.py: Added.
- (log): Added.
- (error): Added. Prefix error messages with "ERROR: ".
+ [Chromium] new-run-webkit-tests --use-drt should work with Chromium checkout
+ https://bugs.webkit.org/show_bug.cgi?id=40402
-2009-07-10 Adam Roben <aroben@apple.com>
+ _build_path() of each Chromium port check existence of build path
+ of Chromium checkout first, then check existence of build path of
+ WebKit-only checkout.
- Sort all our Xcode projects
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
- Accomplished using sort-Xcode-project-file.
+2010-06-12 Robert Hogan <robert@webkit.org>
- Requested by Dave Kilzer.
+ Reviewed by Kenneth Rohde Christiansen.
- * DrawTest/DrawTest.xcodeproj/project.pbxproj:
- * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
- * WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj:
+ [Qt] Back-forward list dumping is incorrect
-2009-07-10 Adam Roben <aroben@apple.com>
+ https://bugs.webkit.org/show_bug.cgi?id=36392
- Print prepare-ChangeLog's reminders to STDERR so they don't end up in
- the diff output
+ Support dumping child history items in DRT.
- Fixes REGRESSION (r45647): prepare-ChangeLog -d puts non-diff lines
- into the diff
- <https://bugs.webkit.org/show_bug.cgi?id=27150>
+ Unskip:
- Reviewed by Maciej Stachowiak.
+ fast/loader/frame-src-change-added-to-history.html
+ fast/loader/frame-src-change-not-added-to-history.html
+ fast/loader/frame-location-change-not-added-to-history.html
- * Scripts/prepare-ChangeLog:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::dumpHistoryItem):
-2009-07-08 Adam Roben <aroben@apple.com>
+2010-06-10 Ojan Vafai <ojan@chromium.org>
- Use case-insensitive comparisons when sorting Xcode project files
+ Reviewed by Eric Seidel.
- This matches the sorting used in Xcode's files list.
+ upload all patches that lack in-rietveld to rietveld
+ https://bugs.webkit.org/show_bug.cgi?id=40444
- Fixes Bug 27079: sort-Xcode-project-file should sort
- case-insensitively, to match Xcode's files list
- <https://bugs.webkit.org/show_bug.cgi?id=27079>
+ If it's a patch, then we'll try to upload it as long as it
+ doesn't have in-rietveld set. No longer set in-rietveld? since
+ it's not needed.
- Reviewed by Dave Kilzer.
+ * Scripts/webkitpy/common/net/bugzilla.py:
- * Scripts/sort-Xcode-project-file:
- (sortChildrenByFileName):
- (sortFilesByFileName):
- Lowercase the strings before comparing them so that the comparison
- will be case-insensitive.
+2010-06-10 Ojan Vafai <ojan@chromium.org>
-2009-07-08 Simon Hausmann <hausmann@webkit.org>
+ Reviewed by Darin Fisher.
- Reviewed by Holger Freyther.
+ Fix rietveld upload when message length > 100 characters
+ https://bugs.webkit.org/show_bug.cgi?id=40457
- https://bugs.webkit.org/show_bug.cgi?id=27109
+ * Scripts/webkitpy/common/net/rietveld.py:
- Fix side-effects in the Qt DRT with tests using application fonts.
+2010-06-11 Yael Aharon <yael.aharon@nokia.com>
- Detect if a test used application fonts and re-initialize the fontconfig
- application fontset accordingly.
+ Reviewed by Laszlo Gombos.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::open): call initializeFonts and remove all application fonts
- after running a testcase.
- (WebCore::DumpRenderTree::initializeFonts): Moved fontconfig initialization code
- here from main.
- * DumpRenderTree/qt/DumpRenderTree.h: Declare initializeFonts.
- * DumpRenderTree/qt/main.cpp:
- (main): Moved fontconfig initialization code to DRT::initializeFonts.
+ [Qt] There should be a way to enable popups in QtTestBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=40427
-2009-07-10 Antonio Gomes <antonio.gomes@openbossa.org>
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::toggleJavascriptCanOpenWindows):
+ (LauncherWindow::createChrome):
- Reviewed by Simon Hausmann.
+2010-06-10 Adam Barth <abarth@webkit.org>
- [QT] [ARM] Add pkg-config entry for FontConfig on DRT.pro
- https://bugs.webkit.org/show_bug.cgi?id=26990
+ Reviewed by Daniel Bates.
- Missing pkg-config entry for FontConfig in DRT.pro causes some compilers to
- not link fine against FontConfig bits.
+ Make SheriffBot more chatty
+ https://bugs.webkit.org/show_bug.cgi?id=40463
- * DumpRenderTree/qt/DumpRenderTree.pro:
+ People seem to like to talk to SheriffBot, so let's make him chat back.
-2009-07-09 Drew Wilson <atwilson@google.com>
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ * Scripts/webkitpy/tool/bot/irc_command.py:
+ * Scripts/webkitpy/tool/bot/irc_command_unittest.py: Added.
+ * Scripts/webkitpy/tool/bot/sheriffircbot.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
- Reviewed by Alexey Proskuryakov.
+2010-06-10 Brian Weinstein <bweinstein@apple.com>
- https://bugs.webkit.org/show_bug.cgi?id=26903
+ Reviewed by Darin Adler.
- Turned on CHANNEL_MESSAGING by default because the MessageChannel API
- can now be implemented for Web Workers and is reasonably stable.
+ Fix the Windows buildbot when WebKitAuxiliaryLibs.zip cannot be found on our server.
+
+ Robustify update-webkit-auxiliary-libs to be able to handle the case when WebKitAuxiliaryLibs.zip doesn't exist,
+ and allow the script to fall back to an existing file, only failing if there is no fallback file. Also switch to checking
+ WEXITSTATUS on $result instead of just comparing $result to 0.
- * Scripts/build-webkit:
+ * Scripts/update-webkit-auxiliary-libs:
-2009-07-09 David Kilzer <ddkilzer@apple.com>
+2010-06-10 Ojan Vafai <ojan@chromium.org>
- <http://webkit.org/b/27114> bugzilla-tool: Parse short bug URL from commit log messages
+ Reviewed by Alexey Proskuryakov.
- Reviewed by Adam Roben.
+ don't use Exception.message as it's deprecated in python 2.6+
+ https://bugs.webkit.org/show_bug.cgi?id=40449
- * Scripts/bugzilla-tool:
- (bug_id_from_commit_message): Check for the short bug URL before
- checking for the longer bugs.webkit.org URL.
+ * Scripts/webkitpy/tool/commands/queues.py:
-2009-07-08 David Kilzer <ddkilzer@apple.com>
+2010-06-10 Ojan Vafai <ojan@chromium.org>
- Bug 27062: bugzilla-tool: post-commits should read bug id from commit log and actually work
+ Reviewed by Adam Barth.
- <https://bugs.webkit.org/show_bug.cgi?id=27062>
+ fix handle_script_error in rietveld upload queue and add testing for handle_script_error
+ https://bugs.webkit.org/show_bug.cgi?id=40436
- Reviewed by Eric Seidel.
+ * Scripts/webkitpy/common/system/outputcapture.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
- Removed the required BUGID argument from the "post-commits"
- command and replaced it with a -b|--bug-id switch or parsing the
- commit log message for the bug URL. Fixed a bug in the
- "post-commits" that would ignore the COMMITISH used and post a
- patch of local changes against HEAD. Added --no-commit switch
- to disable using the bulk of the ChangeLog entry as the comment
- for the new patch.
-
- * Scripts/bugzilla-tool:
- (bug_id_from_commit_message): Added. Returns a bug id from the
- commit log message, thus enforcing the need for a bug URL in the
- message.
- (PostCommitsAsPatchesToBug.__init__): Updated help description
- to match new behavior of pulling bug ids from commit log
- messages instead of from the command line. Added -b|--bug-id
- switch and --no-comment switch.
- (PostCommitsAsPatchesToBug.execute): Updated to use
- bug_id_from_commit_message() to pull bug ids from commit log
- messages. Also switched from SCM.create_patch() to use
- SCM.create_patch_from_local_commit() to fix a bug where local
- repository changes were posted as a patch instead of the
- specific COMMITISH. Fall back to -b|--bug-id if no URL is found
- in the commit log message. Don't specify a comment for the
- patch if --no-comment is used. Set cherry_pick argument to True
- for Git.commit_ids_from_range_arguments() since we don't want
- implicit commit range behavior for this command.
-
- * Scripts/modules/bugzilla.py: Import datetime module.
- (timestamp): Added. Returns a timestamp in the form of
- "YYYYMMDDhhmmss".
- (Bugzilla.bug_server_regex): Added static attribute.
- (Bugzilla.add_patch_to_bug): Construct a more meaningful patch
- file name using the bug_id and timestamp().
-
- * Scripts/modules/scm.py:
- (SCM.create_patch_from_local_commit): Added.
- (Git.create_patch_from_local_commit): Added. Runs "git diff" to
- return a patch for the given commit_id.
-
-2009-07-08 Maciej Stachowiak <mjs@apple.com>
+2010-06-10 Jarkko Sakkinen <jarkko.j.sakkinen@gmail.com>
- Reviewed by Mark Rowe.
+ Reviewed by Simon Hausmann.
- Make prepare-ChangeLog less shouty
- https://bugs.webkit.org/show_bug.cgi?id=27098
+ [Qt] *All* WebGL layout tests fail!
+ https://bugs.webkit.org/show_bug.cgi?id=40296
- * Scripts/prepare-ChangeLog:
+ Added test for WebKitWebGLEnabled to
+ LayoutTestController::overridePreference().
-2009-07-08 David Kilzer <ddkilzer@apple.com>
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::overridePreference):
- Bug 27083: bugzilla.py: Clean up bug_server use
+2010-06-10 Diego Gonzalez <diegohcg@webkit.org>
- <https://bugs.webkit.org/show_bug.cgi?id=27083>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by Darin Adler.
+ [Qt] DRT EventSender support to graphics mouse events activation
+ https://bugs.webkit.org/show_bug.cgi?id=40017
- * Scripts/modules/bugzilla.py:
- (Bugzilla.fetch_bug_ids_from_commit_queue): Use bug_server
- instead of hard-coding the URL.
- (Bugzilla.authenticate): Remove extra '/' before URL path.
- (Bugzilla.add_patch_to_bug): Ditto.
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::mouseDown):
+ (EventSender::mouseUp):
+ (EventSender::mouseMoveTo):
+ (EventSender::keyDown):
+ (EventSender::contextClick):
+ (EventSender::sendTouchEvent):
+ (EventSender::sendOrQueueEvent):
+ (EventSender::eventFilter):
+ (EventSender::createGraphicsSceneMouseEvent):
+ (EventSender::sendEvent):
+ * DumpRenderTree/qt/EventSenderQt.h:
+ (EventSender::isGraphicsBased):
-2009-07-08 Brent Fulgham <bfulgham@webkit.org>
+2010-06-09 Adam Barth <abarth@webkit.org>
- Build fix for Windows Cairo.
+ Reviewed by Ojan Vafai.
- Cairo build was incorrectly #including the PixelDumpSupportCG.h
- instead of PixelDumpSupportCairo.h
+ webkit-patch upload fails for security bugs because there's no rietveld flag
+ https://bugs.webkit.org/show_bug.cgi?id=40309
- * DumpRenderTree/win/PixelDumpSupportWin.cpp: Correct #include
+ There's probably a more elegant way of seeing whether the form control
+ exists, but this seems to work.
-2009-07-08 David Faure <faure@kde.org>
+ * Scripts/webkitpy/common/net/bugzilla.py:
- Reviewed by Ariya Hidayat.
+2010-06-09 Ojan Vafai <ojan@chromium.org>
- Small documentation improvement for build-webkit --help
+ Reviewed by Adam Barth.
- * Scripts/build-webkit: mention --debug option
+ make rietveld upload faster and avoid posting to bug on errors
+ https://bugs.webkit.org/show_bug.cgi?id=40389
-2009-07-07 Brady Eidson <beidson@apple.com>
+ Only grab the first item of the upload queue instead of trying
+ to compute the whole list upfront (which is O(n) bugzilla lookups!).
- Tiger build fix, work around missing NSString API.
+ Also, don't post comments to the bug when uploading fails.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (dumpHistoryItem):
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/stepsequence.py:
+ * Scripts/webkitpy/tool/mocktool.py:
-2009-07-07 Brady Eidson <beidson@apple.com>
+2010-06-09 Ojan Vafai <ojan@chromium.org>
- Reviewed by Mark Rowe.
+ Reviewed by Adam Barth.
- https://bugs.webkit.org/show_bug.cgi?id=27049 - In dumpBackForwardList() mode, DRT should normalize file urls.
+ Rietveld upload queue fails when setting in-rietveld flag
+ https://bugs.webkit.org/show_bug.cgi?id=40371
- Make the dump of a history item agnostic to the layout of filesystem on the testing machine.
+ Make the comment arguments to set_flag_on_attachment optional
+ and add it to the MockBugzilla.
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (dumpHistoryItem):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (dumpHistoryItem):
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
-2009-07-07 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
-
- Rubber-stamped by Simon Hausmann.
+2010-06-09 Kenneth Russell <kbr@google.com>
- Correct git url of the Qt test-fonts.
+ Reviewed by Dimitri Glazkov.
- * DumpRenderTree/qt/main.cpp:
- (main):
+ Rename FloatArray to Float32Array
+ https://bugs.webkit.org/show_bug.cgi?id=40323
-2009-07-07 Simon Hausmann <hausmann@webkit.org>
+ Used do-webcore-rename to perform renaming. Manually undid
+ incorrect changes to WebCore/bridge/jni/jsc/JNIBridgeJSC.cpp,
+ WebCore/manual-tests/resources/ArrayParameterTestApplet.java and
+ ArrayParameterTestApplet.class. Updated LayoutTests. Built and ran
+ all layout tests on Safari; built Chromium and ran selected WebGL
+ tests.
- Reviewed by Holger Freyther.
+ * Scripts/do-webcore-rename:
- Clear the main frame's name between loading pages, like in r36652. This
- reduces the side-effects between test cases.
+2010-06-08 Tony Chang <tony@chromium.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::open):
+ Reviewed by David Levin.
-2009-07-06 Simon Hausmann <hausmann@webkit.org>
+ [chromium] compile linux chromium in WebKit/out instead of WebKit/WebKit/chromium/out
+ https://bugs.webkit.org/show_bug.cgi?id=40285
- Reviewed by Holger Freyther.
+ * Scripts/webkitdirs.pm:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
- Fix various layout tests with Qt's DRT.
+2010-06-03 Roland Steiner <rolandsteiner@chromium.org>
- Remember to set the focus on the web page before
- loading.
+ Reviewed by Tamura Kent.
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::DumpRenderTree::open):
+ Bug 40052 - [DRT/Chromium] Upstream test_shell_webthemeengine as WebThemeEngineDRT
+ https://bugs.webkit.org/show_bug.cgi?id=40052
+
+ Add WebThemeEngineDRT and WebThemeControlDRT ported from Chromium rev. 48907
+
+ * DumpRenderTree/DumpRenderTree.gypi:
+ * DumpRenderTree/chromium/TestShellWin.cpp:
+ (platformInit):
+ * DumpRenderTree/chromium/WebThemeControlDRT.cpp: Added.
+ (WebKit::):
+ (WebKit::WebThemeControlDRT::WebThemeControlDRT):
+ (WebKit::WebThemeControlDRT::~WebThemeControlDRT):
+ (WebKit::WebThemeControlDRT::box):
+ (WebKit::WebThemeControlDRT::line):
+ (WebKit::WebThemeControlDRT::triangle):
+ (WebKit::WebThemeControlDRT::roundRect):
+ (WebKit::WebThemeControlDRT::oval):
+ (WebKit::WebThemeControlDRT::circle):
+ (WebKit::WebThemeControlDRT::nestedBoxes):
+ (WebKit::WebThemeControlDRT::markState):
+ (WebKit::WebThemeControlDRT::draw):
+ (WebKit::WebThemeControlDRT::drawTextField):
+ (WebKit::WebThemeControlDRT::drawProgressBar):
+ * DumpRenderTree/chromium/WebThemeControlDRT.h: Added.
+ (WebKit::WebThemeControlDRT::):
+ * DumpRenderTree/chromium/WebThemeEngineDRT.cpp: Added.
+ (WebKit::):
+ (WebKit::WebThemeEngineDRT::paintButton):
+ (WebKit::WebThemeEngineDRT::paintMenuList):
+ (WebKit::WebThemeEngineDRT::paintScrollbarArrow):
+ (WebKit::WebThemeEngineDRT::paintScrollbarThumb):
+ (WebKit::WebThemeEngineDRT::paintScrollbarTrack):
+ (WebKit::WebThemeEngineDRT::paintTextField):
+ (WebKit::WebThemeEngineDRT::paintTrackbar):
+ (WebKit::WebThemeEngineDRT::paintProgressBar):
+ * DumpRenderTree/chromium/WebThemeEngineDRT.h: Added.
+ (WebKit::WebThemeEngineDRT::WebThemeEngineDRT):
+
+2010-06-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r60878.
+ http://trac.webkit.org/changeset/60878
+ https://bugs.webkit.org/show_bug.cgi?id=40349
+
+ broke linux build (Requested by tony^work on #webkit).
-2009-07-07 Simon Hausmann <hausmann@webkit.org>
+ * Scripts/webkitdirs.pm:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
- Reviewed by Tor Arne Vestbø and Holger Freyther.
+2010-06-08 Tony Chang <tony@chromium.org>
- Fix timeout timer handling in Qt DRT.
+ Reviewed by David Levin.
- Use QBasicTimer instead of startTimer/killTimer, to fix the
- problem that starting the timeout timer did not stop a
- previously started timer, causing multiple emissions of timeout.
- The timerEvent() implementation now also checks the timer id, to
- protect against double timeouts.
+ [chromium] compile linux chromium in WebKit/out instead of WebKit/WebKit/chromium/out
+ https://bugs.webkit.org/show_bug.cgi?id=40285
- * DumpRenderTree/qt/jsobjects.cpp:
- (LayoutTestController::LayoutTestController):
- (LayoutTestController::reset):
- (LayoutTestController::waitUntilDone):
- (LayoutTestController::notifyDone):
- (LayoutTestController::timerEvent):
- * DumpRenderTree/qt/jsobjects.h:
+ * Scripts/webkitdirs.pm:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
-2009-07-06 Eric Seidel <eric@webkit.org>
+2010-06-08 Kenneth Russell <kbr@google.com>
- Reviewed by Maciej Stachowiak.
+ Unreviewed, build fix.
- bugzilla-tool fails to close bugs with bugzilla 3.0
- https://bugs.webkit.org/show_bug.cgi?id=27008
+ Fix build breakage from 38145
+ https://bugs.webkit.org/show_bug.cgi?id=40346
- Update bugzilla.py to match changes in the bug page "changeform"
- Update scm.py to add bug_ids to attachments to make error reporting nicer.
+ The fix for bug 38145 broke the Chromium Win build because
+ Microsoft's cmath doesn't define log2. Suggested fix by zmo is to
+ change log2(x) to log(x) / log(2). Built and ran WebGL layout
+ tests in Safari on Mac OS X. Changed download mirrors for
+ python-irclib to working ones.
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/scm.py:
+ * Scripts/webkitpy/thirdparty/__init__.py:
-2009-07-03 Maciej Stachowiak <mjs@apple.com>
+2010-06-08 Fumitoshi Ukai <ukai@chromium.org>
Reviewed by Eric Seidel.
- bugzilla-tool forgot how to obsolete patches
- https://bugs.webkit.org/show_bug.cgi?id=26951
+ old-run-webkit-tests should use ensure-valid-python to check if it can run the websockets tests
+ https://bugs.webkit.org/show_bug.cgi?id=39058
- * Scripts/modules/bugzilla.py:
+ * Scripts/old-run-webkit-tests:
+ use sourceDir() to find ensure-valid-python in checkPythonVersion()
-2009-07-02 Brent Fulgham <bfulgham@webkit.org>
+2010-06-08 Andras Becsi <abecsi@webkit.org>
- Unreviewed build fix (Cairo this time) for DumpRenderTree.
- Put Cairo code back in, but use original include order
- for the CG stuff to avoid compile issues.
+ Unreviewed buildfix after r60479.
- * DumpRenderTree/win/PixelDumpSupportWin.cpp:
- (createBitmapContextFromWebView):
-
-2009-07-02 Eric Seidel <eric@webkit.org>
-
- Correct blatant typo (missing []), no review.
-
- * Scripts/modules/scm.py:
+ [GTK] Move the declaration of getRootCoords higher up to fix the build on GTK
+ versions other than 2.17.3.
-2009-07-02 Brent Fulgham <bfulgham@webkit.org>
-
- Windows build fix, no review.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (getRootCoords):
+2010-06-07 Martin Robinson <mrobinson@igalia.com>
- Reverting PixelDumpSupportWin.cpp change to avoid strange
- error on the build-bot.
-
- * DumpRenderTree/win/PixelDumpSupportWin.cpp:
- (createBitmapContextFromWebView):
+ Reviewed by Oliver Hunt.
-2009-07-02 Brent Fulgham <bfulgham@webkit.org>
+ [GTK] Mouse movement should not trigger a replay of saved events in the event sender
+ https://bugs.webkit.org/show_bug.cgi?id=40267
- Build fix, no review.
+ When a mouse button is down, automatically queue mouse motion events and
+ do not play them back until the mouse button is released. This matches the
+ behavior of other ports' EventSenders.
- * DumpRenderTree/config.h:
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (mouseMoveToCallback): Don't automatically replaySavedEvents for mouse motion.
+ (sendOrQueueEvent): Add a shouldReplaySavedEvents argument defaulting to true.
-2009-07-02 Eric Seidel <eric@webkit.org>
+2010-06-07 Nikolas Zimmermann <nzimmermann@rim.com>
- Reviewed by David Levin.
-
- bugzilla-tool needs to handle login failure
- https://bugs.webkit.org/show_bug.cgi?id=26913
+ Reviewed by Sam Weinig.
- We now exit(1) on login failure.
+ Add CPP bindings generator
+ https://bugs.webkit.org/show_bug.cgi?id=38279
- * Scripts/modules/bugzilla.py:
+ Integrate CPP bindings in run-bindings-tests.
-2009-06-30 Brent Fulgham <bfulgham@webkit.org>
+ * Scripts/run-bindings-tests:
- Reviewed by Adam Roben.
+2010-06-04 Tony Gentilcore <tonyg@chromium.org>
- Add build support for a Windows Cairo version of
- DumpRenderTree. Share as much logic between the
- CG and Cairo builds as possible.
- https://bugs.webkit.org/show_bug.cgi?id=26457
-
- * DumpRenderTree/PixelDumpSupport.cpp: Added.
- (dumpWebViewAsPixelsAndCompareWithExpected): Moved common logic
- from CG-specific file.
- (printPNG): Moved common logic from CG-specific file.
- * DumpRenderTree/PixelDumpSupport.h: Add declaration for new
- common printPNG function.
- * DumpRenderTree/cairo: Added.
- * DumpRenderTree/cairo/PixelDumpSupportCairo.cpp: Added.
- Implement cairo-specific logic for dealing with Cairo surfaces.
- (writeFunction):
- (printPNG): Cairo-specific PNG handling logic.
- (computeMD5HashStringForBitmapContext): New Cairo routine using
- the generic BitmapContext signature.
- (dumpBitmap): New function containing Cairo-specific portions of
- the dumping routine.
- * DumpRenderTree/cairo/PixelDumpSupportCairo.h: Added.
- Provide Cairo version of the BitmapContext structure so that
- dumping routines can work on an abstract type.
- (BitmapContext::createByAdoptingBitmapAndContext):
- (BitmapContext::~BitmapContext):
- (BitmapContext::cairoContext):
- (BitmapContext::BitmapContext):
- * DumpRenderTree/cg/PixelDumpSupportCG.cpp:
- (printPNG): CG-specific PNG handling logic.
- (computeMD5HashStringForBitmapContext): Revised to use generic
- BitmapContext signature.
- (dumpBitmap): New function containing CG-specific portions of
- the dumping routine.
- * DumpRenderTree/cg/PixelDumpSupportCG.h: Add new signatures.
- * DumpRenderTree/win/DumpRenderTree.cpp: Disable CFNetwork logic
- when building the non-CFNetwork version.
- (main):
- * DumpRenderTree/win/DumpRenderTree.vcproj:
- * DumpRenderTree/win/PixelDumpSupportWin.cpp:
- (createBitmapContextFromWebView): Provide parallel Cairo implementation
- of CG bitmap/context setup.
+ Reviewed by Ojan Vafai.
-2009-07-02 Eric Seidel <eric@webkit.org>
+ Rename 'svn_merge_base' -> 'remote_merge_base'. This was left out of r60633.
+ https://bugs.webkit.org/show_bug.cgi?id=40183
- No review, just adding Antti as a reviewer.
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
- * Scripts/modules/bugzilla.py:
+2010-06-04 Martin Robinson <mrobinson@igalia.com>
-2009-07-02 Antonio Gomes <antonio.gomes@openbossa.org>
+ Unreviewed.
- Reviewed by Simon Hausmann.
+ Add my new email and IRC nick to committers.py.
- https://bugs.webkit.org/show_bug.cgi?id=26896
+ * Scripts/webkitpy/common/config/committers.py:
- [Qt] Set DRT's default fontsize to 13.
+2010-06-04 Kinuko Yasuda <kinuko@chromium.org>
- * DumpRenderTree/qt/DumpRenderTree.cpp:
- (WebCore::WebPage::WebPage):
+ Unreviewed.
-2009-07-01 Eric Seidel <eric@webkit.org>
+ Revert changes in json_results_generator.py's _get_svn_revision.
- Reviewed by Adam Barth.
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
- bugzilla-tool fails for SVN users
- https://bugs.webkit.org/show_bug.cgi?id=26914
+2010-06-04 Martin Robinson <mrobinson@igalia.com>
- To fix this I moved svn from -F - to using -m
- In order for -m to work I had to move us off of shell=True
- To move off of shell=True all call sites for run_command
- which take args, need to pass their args as an list instead of a string.
+ Reviewed by Xan Lopez.
- In order for the final bug update to work correctly, I had to
- abstract the way that we parse out revision numbers from the commit text.
+ [GTK] GtkLauncher should support relative file paths
+ https://bugs.webkit.org/show_bug.cgi?id=39944
- * Scripts/bugzilla-tool:
- * Scripts/modules/scm.py:
+ Allow GtkLauncher to handle relative file paths passed via command-line arguments.
-2009-07-01 Eric Seidel <eric@webkit.org>
+ * GtkLauncher/main.c:
+ (filename_to_url): Added.
+ (main): Try to resolve arguments as relative file URLs first.
- Reviewed by Maciej Stachowiak.
+2010-06-04 Martin Robinson <mrobinson@igalia.com>
- prepare-ChangeLog should have a --bug= argument and use it for url autofill
- https://bugs.webkit.org/show_bug.cgi?id=26383
+ Reviewed by Xan Lopez.
- prepare-ChangeLog now knows how to grab the bug title from bugs.webkit.org
- I also added a bit more template text in an effort to get better ChangeLogs
- from casual contributers.
+ [GTK] EventSender should call gtk_main_do_event instead of invoking signal handlers directly
+ https://bugs.webkit.org/show_bug.cgi?id=40182
- * Scripts/prepare-ChangeLog:
+ Instead of invoking signal handlers directly via g_signal_emit_by_name, call
+ gtk_main_do_event. This will allow us to call gtk_get_current_event() in WebKit
+ without breaking DRT.
-2009-07-01 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (dispatchEvent): Use gtk_main_do_event instead of invoking signal handlers directly.
+ (keyDownCallback): Use dispatchEvent here which now uses gtk_main_do_event.
- Reviewed by Adam Roben.
+2010-06-04 Anders Carlsson <andersca@apple.com>
- prepare-ChangeLog should fail when EMAIL_ADDRESS or REAL_NAME are missing:
- https://bugs.webkit.org/show_bug.cgi?id=26692
+ Reviewed by David Hyatt.
- I also made prepare-ChangeLog sanity-check names and email addresses a little.
- Names must contain a space, and email addresses must contain '@'
+ Make the editing/spelling/context-menu-suggestions.html test more robust
+ https://bugs.webkit.org/show_bug.cgi?id=40178
- Also "fixed" $email_address to $emailAddress. This script uses mixed variable name styles.
+ Change the contextClick method to return an array of strings describing the context menu items.
- * Scripts/prepare-ChangeLog:
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (+[EventSendingController isSelectorExcludedFromWebScript:]):
+ (+[EventSendingController webScriptNameForSelector:]):
+ (-[EventSendingController contextClick]):
-2009-07-01 Chris Fleizach <cfleizach@apple.com>
+2010-06-03 Kinuko Yasuda <kinuko@chromium.org>
- Reviewed by Beth Dakin.
+ Reviewed by Shinichiro Hamaji.
- Bug 26900: AX: Manual spell check with Command-; does not bring up suggestions
- https://bugs.webkit.org/show_bug.cgi?id=26900
+ Clean up chromium-specific code from json_results_generator.py.
+ https://bugs.webkit.org/show_bug.cgi?id=39665
- Expose the ability to get the click point of an element through accessibility.
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getClickPointXCallback):
- (getClickPointYCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::clickPointX):
- (AccessibilityUIElement::clickPointY):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::clickPointX):
- (AccessibilityUIElement::clickPointY):
+2010-06-04 Tony Gentilcore <tonyg@chromium.org>
-2009-07-01 Mark Rowe <mrowe@apple.com>
+ Reviewed by Adam Barth.
- Reviewed by Simon Fraser.
+ Utilize new takeFirst() method where appropriate.
+ https://bugs.webkit.org/show_bug.cgi?id=40089
- Change how WebKitNightlyEnabler.dylib lies about Safari's identity to LaunchServices.
- This makes WebKit.app behave as expected when set as the default web browser on a wider
- range of OS versions.
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::replaySavedEvents):
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::WorkQueue::processWork):
+ (LayoutTestController::WorkQueue::reset):
- * WebKitLauncher/WebKitNightlyEnabler.m:
- (poseAsWebKitApp):
- (enableWebKitNightlyBehaviour):
+2010-06-04 Yael Aharon <yael.aharon@nokia.com>
-2009-07-01 Mark Rowe <mrowe@apple.com>
+ Reviewed by Simon Hausmann.
- Reviewed by Simon Fraser.
+ [Qt] QtTestLauncher should allow notifications by default.
+ https://bugs.webkit.org/show_bug.cgi?id=40078
- Shuffle some code around in preparation for a change to how poseAsWebKitApp works.
+ * QtTestBrowser/main.cpp:
+ (NotificationsPermissionController::NotificationsPermissionController):
+ (NotificationsPermissionController::checkPermission):
+ (NotificationsPermissionController::requestPermission):
+ (LauncherWindow::LauncherWindow):
- * WebKitLauncher/WebKitNightlyEnabler.m:
- (systemVersion):
- (webKitLauncherBundle):
- (insideSafari4OnTigerTrampoline):
+2010-06-04 Tony Gentilcore <tonyg@chromium.org>
-2009-06-30 Xan Lopez <xlopez@igalia.com>
+ Reviewed by Adam Barth.
- Reviewed by Jan Alonzo.
+ Detect whether the user's environment can open a browser.
+ https://bugs.webkit.org/show_bug.cgi?id=40136
- https://bugs.webkit.org/show_bug.cgi?id=26877
- [GTK] DRT fixes to pass new plugin test
+ Some environments like cygwin silently fail webbrowser.open() causing
+ webkit-patch upload not to display any diff. This detects environments
+ where webbrowser.open() would fail by testing if webbrowser.get()
+ raises an exception.
- Silence compiler warnings.
+ * Scripts/webkitpy/common/system/user.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/confirmdiff.py:
- Newer GCC don't like using or returning a static string where a
- 'char*' is expected. Ideally we'd change the function signatures
- to return or take 'const char*' I suppose, but since we can't do
- that just cast the strings to 'char*'.
+2010-06-03 Tony Gentilcore <tonyg@chromium.org>
- * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
- (webkit_test_plugin_get_value):
+ Reviewed by David Levin.
-2009-06-30 Xan Lopez <xlopez@igalia.com>
+ Add dependencies required to link with VS Express 2005.
+ https://bugs.webkit.org/show_bug.cgi?id=40038
- Reviewed by Jan Alonzo.
+ Visual Studio implicitly links against these libs.
+ VC++ Express does not.
- https://bugs.webkit.org/show_bug.cgi?id=26877
- [GTK] DRT fixes to pass new plugin test
+ * WebKitAPITest/WebKitAPITestCommon.vsprops:
+ * WinLauncher/WinLauncher.vcproj:
- Use the common pluginLog function instead of a local copy.
+2010-06-03 Fumitoshi Ukai <ukai@chromium.org>
- * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
- (webkit_test_plugin_new_instance):
- (webkit_test_plugin_destroy_instance):
- (webkit_test_plugin_set_window):
- (webkit_test_plugin_handle_event):
+ Reviewed by David Levin.
-2009-06-30 Xan Lopez <xlopez@igalia.com>
+ bad codecs.open in webkitpy/layout_tests/ports/websocket_server.py
+ https://bugs.webkit.org/show_bug.cgi?id=40105
- Reviewed by Jan Alonzo.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ - kill pywebsocket process when url is not alive and the process is not
+ terminated, not to leave pywebsocket server running.
+ - fix codecs.open parameters.
- https://bugs.webkit.org/show_bug.cgi?id=26877
- [GTK] DRT fixes to pass new plugin test
+2010-06-03 Fumitoshi Ukai <ukai@chromium.org>
- Modify our DRT as done in bug #15457 to log logSrc as src in order
- to pass test plugins/netscape-plugin-map-data-to-src.html.
+ Reviewed by Alexey Proskuryakov.
- * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
- (webkit_test_plugin_new_instance):
+ old-run-webkit-tests should use ensure-valid-python to check if it can run the websockets tests
+ https://bugs.webkit.org/show_bug.cgi?id=39058
-2009-06-30 Adrien Nader <camaradetux@gmail.com>
+ * Scripts/ensure-valid-python:
+ - Perl 5.8 doesn't have File::Temp->newdir(). Use File::Temp->tempdir() instead.
+ - Add --check-only and --help option.
+ - --check-only option only checks python version and don't try to install Python 2.5.
+ - Set executable bit.
+ * Scripts/old-run-webkit-tests:
+ - Check if it can run the websocket tests by calling ensure-valid-python --check-only.
- Reviewed by Jan Alonzo.
+2010-05-14 Ojan Vafai <ojan@chromium.org>
- [GTK] GtkLauncher depends on gtk+2-2.15 because of gtk_orientable_set_orientation()
- https://bugs.webkit.org/show_bug.cgi?id=26835
+ Reviewed by Adam Barth.
- * GtkLauncher/main.c:
- (create_toolbar):
+ add a RietveldUploadQueue to upload in-rietveld? patches to rietveld
+ https://bugs.webkit.org/show_bug.cgi?id=38918
-2009-06-30 Eric Seidel <eric@webkit.org>
+ Patches with in-rietveld? get uploaded to rietveld and get marked
+ in-rietveld+. If the upload fails, they are marked in-rietveld-
+ and an error is logged to the bug, like the commit-queue.
- Typo fix only, no review.
+ Also, get rid of --fancy-review and the ability to upload to rietveld
+ using webkit-patch upload/post.
- Fix typo causing failure during land-diff
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+ * Scripts/webkitpy/tool/steps/postcodereview.py:
- * Scripts/bugzilla-tool:
+2010-05-24 Ojan Vafai <ojan@chromium.org>
-2009-06-30 Simon Fraser <simon.fraser@apple.com>
+ Reviewed by Chris Jerdonek.
- Reviewed by Dan Bernstein.
-
- Fix drawing of view background in pixel snapshots when using compositing.
- We still need to call -displayIfNeeded to ensure that the NSView drawing
- has happened.
+ many webkit-patch commands fail in a non-svn tracking git checkout
+ https://bugs.webkit.org/show_bug.cgi?id=38156
- * DumpRenderTree/mac/PixelDumpSupportMac.mm:
- (createBitmapContextFromWebView):
+ If the svn-tracking-branch (trunk) doesn't exist, fallback to the git remote-tracking-branch (master).
+ If neither exists, then error out. This makes webkit-patch work
+ for anyone that follows the intructions at http://trac.webkit.org/wiki/UsingGitWithWebKit
+ to checkout webkit. The fallback to master is for people who don't
+ do the steps on that page for tracking svn.
-2009-06-30 Simon Fraser <simon.fraser@apple.com>
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
- Reviewed by Mark Rowe.
+2010-06-03 Mike Fenton <mifenton@rim.com>
- createBitmapContextFromWebView() incorrectly used #ifdef BUILDING_ON_LEOPARD,
- and thus failed on SnowLeopard.
-
- * DumpRenderTree/mac/PixelDumpSupportMac.mm:
- (createBitmapContextFromWebView):
+ Unreviewed.
-2009-06-30 Eric Seidel <eric@webkit.org>
+ Reverse e-mail for myself in committers.py to correspond with bugzilla account.
- Reviewed by Nikolas Zimmermann.
+ * Scripts/webkitpy/common/config/committers.py:
- Make bugzilla tool print a message explaining how to get help on failure:
- https://bugs.webkit.org/show_bug.cgi?id=26861
+2010-06-03 Pavel Feldman <pfeldman@chromium.org>
- % bugzilla-tool
- Usage: bugzilla-tool [options] command [command-options] [command-arguments]
+ Reviewed by Yury Semikhatsky.
- bugzilla-tool: error: No command specified
+ Web Inspector: a number of fixes that make InspectorController
+ happy with null redirects.
- Type 'bugzilla-tool --help' to see usage.
+ https://bugs.webkit.org/show_bug.cgi?id=40109
- * Scripts/bugzilla-tool:
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (runTest):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (runTest):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (runTest):
-2009-06-30 Eric Seidel <eric@webkit.org>
+2010-06-02 Tasuku Suzuki <tasuku.suzuki@nokia.com>
- Reviewed by Maciej Stachowiak.
+ Reviewed by Shinichiro Hamaji.
- Include a built copy of BeautifulSoup 3.1.0.1 so that
- bugzilla-tool users do not need to install it manually.
- https://bugs.webkit.org/show_bug.cgi?id=26833
+ [Qt] Fix compilation with QT_NO_PROPERTIES
+ https://bugs.webkit.org/show_bug.cgi?id=38324
- BeautifulSoup is BSD-licensed (thus WebKit compatible) and available from:
- http://www.crummy.com/software/BeautifulSoup
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::init):
- * Scripts/bugzilla-tool: fixed a typo in a log message.
- * Scripts/modules/BeautifulSoup.py: Added.
- * Scripts/modules/bugzilla.py:
+2010-06-02 Diego Gonzalez <diegohcg@webkit.org>
-2009-06-30 Eric Seidel <eric@webkit.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by Simon Hausmann.
+ [Qt] Make possible run DRT with QGraphicsWebView
+ https://bugs.webkit.org/show_bug.cgi?id=40016
- Fix our create_patch handling to not
- hang when creating large patches.
- https://bugs.webkit.org/show_bug.cgi?id=26834
+ Make possible to use a environment variable for switching backend.
+ Usage: QT_DRT_WEBVIEW_MODE=graphics WebKitTools/Scripts/run-webkit-tests --qt
- We're now using StringIO to make an in-memory buffer for the patch
- instead of piping from the patch command directly to the upload.
- The previous hang was caused by calling wait() when the process had already
- filed the stdout buffer.
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ (WebCore::DumpRenderTree::setGraphicsBased):
+ (WebCore::DumpRenderTree::isGraphicsBased):
+ (WebCore::WebViewGraphicsBased::graphicsView):
+ (WebCore::WebViewGraphicsBased::setPage):
+ * Scripts/old-run-webkit-tests:
- * Scripts/modules/scm.py:
+2010-06-02 Csaba Osztrogonác <ossy@webkit.org>
-2009-06-29 Sam Weinig <sam@webkit.org>
+ Reviewed by Eric Seidel.
- Reviewed by Mark Rowe.
+ Slave lost shouldn't be recognized as build failed.
+ https://bugs.webkit.org/show_bug.cgi?id=39282
- Remove more unused scons support.
+ * Scripts/webkitpy/common/net/buildbot.py: Treat slave lost as green.
+ * Scripts/webkitpy/common/net/buildbot_unittest.py: Add unit test for slave lost.
- * Scripts/build-jsc:
- * Scripts/build-webkit:
- * Scripts/webkitdirs.pm:
+2010-06-01 Yael Aharon <yael.aharon@nokia.com>
-2009-06-26 Eric Seidel <eric@webkit.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by David Levin.
+ [Qt] Fix the lifecycle of notification objects
+ https://bugs.webkit.org/show_bug.cgi?id=40003
- Rename land-and-update to land-diff and make it awesome.
- https://bugs.webkit.org/show_bug.cgi?id=26734
+ Remove the dependency of notifications on QWebPage.
- Renamed land-and-update to land-diff
- Made the BUGID argument optional.
- Added optional support for building and testing before landing.
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::requestPermissionCallback):
+ (WebCore::WebPage::WebPage):
+ (WebCore::DumpRenderTree::requestPermission):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
- land-diff [options] [BUGID] Lands the current working directory diff and updates the bug if provided.
- Options:
- -r REVIEWER, --reviewer=REVIEWER
- Update ChangeLogs to say Reviewed by REVIEWER.
- --no-close Leave bug open after landing.
- --no-build Commit without building first, implies --no-test.
- --no-test Commit without running run-webkit-tests.
+2010-06-02 Sheriff Bot <webkit.review.bot@gmail.com>
- * Scripts/bugzilla-tool:
+ Unreviewed, rolling out r60559.
+ http://trac.webkit.org/changeset/60559
+ https://bugs.webkit.org/show_bug.cgi?id=40055
-2009-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
+ It broke python unit test (Requested by Ossy on #webkit).
- Gtk build fix - include stdarg.h for va_start/va_end.
+ * Scripts/webkitpy/common/net/buildbot.py:
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+2010-06-02 Csaba Osztrogonác <ossy@webkit.org>
-2009-06-28 John Abd-El-Malek <jam@chromium.org>
+ Reviewed by Eric Seidel.
- https://bugs.webkit.org/show_bug.cgi?id=15457
+ Slave lost shouldn't be recognized as build failed.
+ https://bugs.webkit.org/show_bug.cgi?id=39282
- Modify NPAPI test plugin to verify that "src" paramater is added when
- it's missing but "data" is present.
+ * Scripts/webkitpy/common/net/buildbot.py:
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
- (pluginLog):
- * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
- * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
- (NPP_New):
- (NPP_Destroy):
- (NPP_SetWindow):
- (handleEventCarbon):
- (handleEventCocoa):
- * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
- (NPP_New):
+2010-06-02 Tony Gentilcore <tonyg@chromium.org>
-2009-06-27 Emilio Pozuelo Monfort <pochu27@gmail.com>
+ Reviewed by Eric Seidel.
- Reviewed by Jan Alonzo.
+ Fix crash caused when assigned_to is disabled
+ https://bugs.webkit.org/show_bug.cgi?id=40039
- [GTK] Don't use deprecated GTK+ symbols.
- https://bugs.webkit.org/show_bug.cgi?id=26583
+ * Scripts/webkitpy/common/net/bugzilla.py:
- * GtkLauncher/main.c:
- (create_toolbar):
+2010-06-02 Sterling Swigart <sswigart@google.com>
-2009-06-26 Adam Barth <abarth@webkit.org>
+ Reviewed by David Levin.
- Reviewed by Eric Seidel.
+ Image Resizer Patch 0: Added compilation argument to conditionally compile pending patches.
+ https://bugs.webkit.org/show_bug.cgi?id=39906
- Make SVN work (again?).
+ * Scripts/build-webkit:
- * Scripts/modules/scm.py:
+2010-06-01 Raine Makelainen <raine.makelainen@nokia.com>
-2009-06-26 Chris Fleizach <cfleizach@apple.com>
+ Reviewed by Simon Hausmann.
- Reviewed by Oliver Hunt.
+ Fixed tests to use QWebSettings::JavascriptCanAccessClipboard instead of QWebSettings::JavaScriptCanAccessClipboard.
- Add ability to query isEnabled
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getIsEnabledCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::isEnabled):
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::isEnabled):
+2010-06-01 Alexey Proskuryakov <ap@apple.com>
-2009-06-26 Brady Eidson <beidson@apple.com>
+ Reviewed by Mark Rowe.
- Reviewed by Sam Weinig
+ A nicer Tiger build fix.
- <rdar://problem/6961578> REGRESSION (r43511): Opening .fdf files from Acrobat Professional fails
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/mac/Configurations/Base.xcconfig:
+ Enable GCC_OBJC_CALL_CXX_CDTORS via .xcconfig.
- Add a dumpResourceResponseMIMETypes() mode so the ResourceLoadDelegate will dump the mime type from
- the NSURLResponse. Needed for the test for this bug fix.
+2010-06-01 Alexey Proskuryakov <ap@apple.com>
- * DumpRenderTree/LayoutTestController.cpp:
- (LayoutTestController::LayoutTestController):
- (dumpResourceResponseMIMETypesCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- (LayoutTestController::dumpResourceResponseMIMETypes):
- (LayoutTestController::setDumpResourceResponseMIMETypes):
+ A real Tiger build fix.
- * DumpRenderTree/mac/ResourceLoadDelegate.mm:
- (-[ResourceLoadDelegate webView:resource:didReceiveResponse:fromDataSource:]):
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Enable GCC_OBJC_CALL_CXX_CDTORS
+ for all configurations, not just debug.
-2009-06-26 David Kilzer <ddkilzer@apple.com>
+2010-06-01 Alexey Proskuryakov <ap@apple.com>
- Update build-dumprendertree to use buildXCodeProject()
+ Tiger build fix.
- Reviewed by Adam Roben.
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Enable GCC_OBJC_CALL_CXX_CDTORS.
- * Scripts/build-dumprendertree: Updated to use
- buildXCodeProject() when building for isAppleMacWebKit(). This
- provides additional command-line switch parsing for free. Also
- added --clean and --help switches. Updated copyright.
+2010-06-01 Martin Robinson <mrobinson@igalia.com>
-2009-06-26 Eric Seidel <eric@webkit.org>
+ Reviewed by Xan Lopez.
- Reviewed by Tor Arne Vestbø.
+ [GTK] Get more mouse tests passing
+ https://bugs.webkit.org/show_bug.cgi?id=39040
- Remove non-sense --update option to land-patches
- and make land-patches update before every patch application.
- This makes it slightly less likely that multi-patch landings will fail.
+ Reproduce the logic from the Windows EventSender for mapping
+ button numbers to GDK button numbers. Move this logic to the
+ prepareMouseButtonEvent helper.
- Also updated git diff command to include staged modifications.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (prepareMouseButtonEvent): Reproduce Windows logic.
+ (contextClickCallback): Move mapping logic to prepareMouseButtonEvent.
+ (mouseDownCallback): Ditto.
+ (mouseUpCallback): Ditto.
- * Scripts/bugzilla-tool:
- * Scripts/modules/scm.py:
+2010-06-01 Alexey Proskuryakov <ap@apple.com>
-2009-06-25 Eric Seidel <eric@webkit.org>
+ Reviewed by Sam Weinig.
- Reviewed by Jan Alonzo.
+ https://bugs.webkit.org/show_bug.cgi?id=39434
+ REGRESSION (r59811): Geolocation callbacks cannot be created
- Fix obsolete_attachment to work when passed a comment.
- https://bugs.webkit.org/show_bug.cgi?id=26745
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added MockGeolocationProvider.
- * Scripts/modules/bugzilla.py:
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (createWebViewAndOffscreenWindow): Tell the view to use MockGeolocationProvider.
+ (resetWebViewToConsistentStateBeforeTesting): Make sure that mock notifications don't leak
+ into subsequent tests.
-2009-06-25 Jan Michael Alonzo <jmalonzo@webkit.org>
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setMockGeolocationPosition): Changed to use MockGeolocationProvider.
+ (LayoutTestController::setMockGeolocationError): Ditto.
+
+ * DumpRenderTree/mac/MockGeolocationProvider.h: Added.
+ * DumpRenderTree/mac/MockGeolocationProvider.mm: Added.
+ (+[MockGeolocationProvider shared]):
+ (-[MockGeolocationProvider dealloc]):
+ (-[MockGeolocationProvider setPosition:]):
+ (-[MockGeolocationProvider setError:]):
+ (-[MockGeolocationProvider registerWebView:]):
+ (-[MockGeolocationProvider unregisterWebView:]):
+ (-[MockGeolocationProvider lastPosition]):
+ (-[MockGeolocationProvider stopTimer]):
+ (-[MockGeolocationProvider timerFired]):
- Reviewed by Mark Rowe.
+ * DumpRenderTree/mac/UIDelegate.mm:
+ (-[UIDelegate webView:decidePolicyForGeolocationRequestFromOrigin:frame:listener:]):
+ This delegate method must send a response. I'm not sure what the two-stage check is supposed
+ to achieve, it seems unnecessary.
- bugzilla-tool apply-patch throws exception in Linux
- https://bugs.webkit.org/show_bug.cgi?id=26738
+2010-05-12 Martin Robinson <mrobinson@igalia.com>
- HEAD is case-sensitive in Linux. Convert uses of head to HEAD in
- the scm module.
+ Reviewed by Xan Lopez.
- * Scripts/modules/scm.py:
+ [GTK] Double clicks cause three button press events
+ https://bugs.webkit.org/show_bug.cgi?id=38853
-2009-06-25 Eric Seidel <eric@webkit.org>
+ WebKit now filters the extra GDK_BUTTON_PRESS before GDK_2BUTTON_PRESS
+ and GDK_3BUTTON_PRESS via gdk_event_peek(). Since EventSender bypasses
+ the GDK event queue entirely, we simply do not send the extra event.
- Reviewed by Jan Alonzo.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (mouseDownCallback): Do not send extra event. Send GDK_3BUTTON_PRESS appropriately.
+ (dispatchEvent): Properly handle GDK_3BUTTON_PRESS.
- bugzilla-tool post-diff needs to obsolete old patches before posting
- https://bugs.webkit.org/show_bug.cgi?id=26740
+2010-06-01 Martin Robinson <mrobinson@igalia.com>
- I've also added a --no-obsolete to disable this behavior.
-
- I also finally updated the bug page parsing to use XML. So much less code!
+ Not reviewed. Build fix.
- * Scripts/bugzilla-tool:
- * Scripts/modules/bugzilla.py:
+ Fix GTK+ build caused by a bad merge.
-2009-06-25 Eric Seidel <eric@webkit.org>
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (prepareMouseButtonEvent): Use the GdkEvent union as a pointer here.
- Reviewed by Mark Rowe.
+2010-06-01 Martin Robinson <mrobinson@webkit.org>
- Call WebKitTools/Scripts scripts by their absolute paths
- https://bugs.webkit.org/show_bug.cgi?id=26704
+ Reviewed by Xan Lopez.
- bugzilla-tool used to use whatever build-webkit was in your path.
- That could end up building the wrong copy of WebKit.
+ [GTK] Double clicks cause three button press events
+ https://bugs.webkit.org/show_bug.cgi?id=38853
- * Scripts/bugzilla-tool:
- * Scripts/modules/scm.py:
+ Small EventSender cleanups. Consolidate some common code. Style fixes.
-2009-06-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (prepareMouseButtonEvent): Added.
+ (contextClickCallback): Use prepareMouseButtonEvent.
+ (mouseDownCallback): Use prepareMouseButtonEvent.
+ (mouseUpCallback): Use prepareMouseButtonEvent.
+ (mouseMoveToCallback): Small style fix.
- Reviewed by Dave Levin.
+2010-06-01 Martin Robinson <mrobinson@igalia.com>
- Use unicode() instead of str when reading from bugzilla.
- Also add Simon Fraser as a reviewer.
- https://bugs.webkit.org/show_bug.cgi?id=26719
+ Reviewed by Xan Lopez.
- * Scripts/modules/bugzilla.py:
+ [GTK] Double clicks cause three button press events
+ https://bugs.webkit.org/show_bug.cgi?id=38853
-2009-06-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ Add rudimentary leapForward support to the GTK+ DRT. leapForward allows a test
+ to pause for a specified amount of time. It is used in the processing of drag-
+ -and-drop data as well as to separate distinct mouse double-clicks in some tests.
+ This patch enables tests that rely on the latter behavior to pass.
- Reviewed by Simon Hausmann.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewWindowObjectCleared): Only initialize the EventSender when loading the top frame.
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (leapForwardCallback): Add support for adjusting the time offset on leapForward().
+ (contextClickCallback): Use sendOrQueueEvent.
+ (updateClickCount): Take the time offset into account when counting clicks.
+ (mouseDownCallback): Use sendOrQueueEvent.
+ (getStateFlags): Change down/currentEventButton into buttonCurrentlyDown/lastClickButton.
+ (mouseUpCallback): Use sendOrQueueEvent.
+ (mouseMoveToCallback): Ditto.
+ (mouseWheelToCallback): Ditto.
+ (sendOrQueueEvent): Added.
+ (dispatchEvent): Added.
+ (replaySavedEvents): Pause when an event has a delay and defer to dispatchEvent.
+ (makeEventSender): Only initialize the EventSender when loading the top frame.
+ * DumpRenderTree/gtk/EventSender.h: Ditto.
+
+2010-06-01 Martin Robinson <mrobinson@igalia.com>
- Use Q_ASSERT in Qt's DumpRenderTree instead of JSC's ASSERT
-
- The WTFReportAssertionFailure function in JSC is not exported when
- building QtWebKit in both debug and release on Mac, so DRT fails to
- link.
-
- We can revert this patch once the Qt port builds JSC as a separate
- library, and we add the proper export macros to Assertions.cpp
+ Reviewed by Xan Lopez.
- * DumpRenderTree/qt/WorkQueue.cpp:
- (WorkQueue::queue):
- (WorkQueue::dequeue):
+ [GTK] css1/color_and_background/background_attachment.html fails on the 32-bit debug bot
+ https://bugs.webkit.org/show_bug.cgi?id=39101
-2009-06-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+ Work around timing issues for render tree dumps by pumping the
+ main loop before doing the dump. Resize events are asynchronous
+ in GTK+, so sometimes resize requests are still pending when DRT
+ dumps the tree.
- Reviewed by Jan Alonzo.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (dump): Pump the main loop before dumping the render tree.
- bugzilla-tool: Add Simon Hausmann as reviewer
+2010-05-31 Kent Tamura <tkent@chromium.org>
- * Scripts/modules/bugzilla.py:
+ Reviewed by Dimitri Glazkov.
-2009-06-24 Eric Seidel <eric@webkit.org>
+ [DRT/Chromium] Fix crash of a test after another test with multiple windows
+ https://bugs.webkit.org/show_bug.cgi?id=39942
- Reviewed by Dave Levin.
+ If a test opens multiple windows, focuses on non-main window, and
+ the focused window is closed, TestShell::m_focusedWidget points a
+ deleted object.
- Support local commits during apply-patches
- and let land-patches take multiple bug ids.
- https://bugs.webkit.org/show_bug.cgi?id=26703
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::closeWindow): Clear m_focusedWidget.
- I also restructured parts of land-patches into
- class methods and static methods in preparation
- for future code sharing with other commands.
+2010-05-30 Kent Tamura <tkent@chromium.org>
- * Scripts/bugzilla-tool:
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/scm.py:
+ Reviewed by Dimitri Glazkov.
-2009-06-25 Eric Seidel <eric@webkit.org>
+ new-run-webkit-tests: Support DRT on Chromium-win
+ https://bugs.webkit.org/show_bug.cgi?id=39810
- Reviewed by Tor Arne Vestbø.
+ Add --test-shell flag to DRT/Chromium, and it changes DRT so that
+ it behaves like test_shell about command analysis, printing
+ format, pixel dumping, and timeout handling.
- Make svn-apply work with Git too
- https://bugs.webkit.org/show_bug.cgi?id=26299
+ chromium.py and chromium_win.py supports the --test-shell flag and
+ DRT/Chromium-win binary names.
- Add an --force option to svn-apply and otherwise make svn-apply
- exit non-zero when patch application fails.
- https://bugs.webkit.org/show_bug.cgi?id=26300
+ * DumpRenderTree/DumpRenderTree.gypi: Add new files.
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (runTest): Support for test_shell-style command.
+ (main): Introduce --test-shell.
+ * DumpRenderTree/chromium/TestEventPrinter.cpp: Added.
+ * DumpRenderTree/chromium/TestEventPrinter.h: Added.
+ TestEventPrinter class manages stdio output and image output.
+ TestEventPrinter.cpp has two implementations; DRTPrinter and
+ TestShellPrinter.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ Some changes for TestEventPrinter.
+ (TestShell::TestShell):
+ (TestShell::runFileTest):
+ (TestShell::testTimedOut):
+ (TestShell::dump):
+ (TestShell::dumpImage):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::printer):
+ (TestShell::layoutTestTimeout):
+ (TestShell::layoutTestTimeoutForWatchDog):
+ (TestShell::setLayoutTestTimeout):
+ * DumpRenderTree/chromium/TestShellWin.cpp:
+ (watchDogThread): Use TestShell::layoutTestTimeoutForWatchDog().
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
- I did not update svn-unapply, because it makes no sense in a Git world.
- You don't roll in and out patch files. You make commits and deal with those.
- Git users can just git reset --hard to get the same functionality.
+2010-05-30 Robert Hogan <robert@webkit.org>
- * Scripts/svn-apply:
+ Reviewed by Kenneth Rohde Christiansen.
-2009-06-25 Eric Seidel <eric@webkit.org>
+ [Qt] Enhance Qt DRT implementation to support platform scroll wheel events.
- Reviewed by Tor Arne Vestbø.
+ https://bugs.webkit.org/show_bug.cgi?id=36004
- Remove use of os.system to fix reviewers with unicode chars in their names
- https://bugs.webkit.org/show_bug.cgi?id=26713
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::EventSender): QApplication::setWheelScrollLines(2) in order to match
+ Scrollbar::pixelsPerLineStep() for DRT testing.
+ (EventSender::mouseScrollBy): Added
+ (EventSender::continuousMouseScrollBy): Added
+ * DumpRenderTree/qt/EventSenderQt.h:
- Also change to latin1 encoding of ø to make python happy.
+2010-05-28 Adam Barth <abarth@webkit.org>
- * Scripts/modules/bugzilla.py:
- * Scripts/modules/scm.py:
+ Reviewed by David Levin.
-2009-06-25 Eric Seidel <eric@webkit.org>
+ webkit-patch should support CHANGE_LOG_EDIT_APPLICATION
+ https://bugs.webkit.org/show_bug.cgi?id=39546
- Reviewed by Tor Arne Vestbø.
+ One sublty is that we want to wait for the user to finish editing the
+ ChangeLog before moving on to the next step. That means we want to pass
+ -W to open. However, if the user is using Xcode to edit the ChangeLog,
+ we don't want them to have to exit the Xcode application. For this reason,
+ we create a new instance of the application with -n.
+
+ Overall, xed seems like a better solution, so we recommend that too.
- Add Adam Roben and Tor Arne Vestbø to the reviewers list.
+ * Scripts/webkitpy/common/system/user.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/editchangelog.py:
- * Scripts/modules/bugzilla.py:
+2010-05-21 Dirk Pranke <dpranke@chromium.org>
-2009-06-24 Chris Fleizach <cfleizach@apple.com>
+ Reviewed by Ojan Vafai.
- Windows build fix.
+ new-run-webkit-tests: fix handling of Ctrl-C to exit even if some
+ threads are wedged. Also, the script will print the results of the
+ tests completed when the interrupt occurs.
- * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
- (AccessibilityUIElement::language):
+ https://bugs.webkit.org/show_bug.cgi?id=33238
-2009-06-24 Chris Fleizach <cfleizach@apple.com>
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
- Reviewed by Oliver Hunt.
+2010-05-28 Darin Adler <darin@apple.com>
- Bug 26668: AX: need a way to retrieve the language for an element
- Support ability to retrieve AXLanguage for testing
+ Ignore more Python messiness.
- * DumpRenderTree/AccessibilityUIElement.cpp:
- (getLanguageCallback):
- (AccessibilityUIElement::getJSClass):
- * DumpRenderTree/AccessibilityUIElement.h:
- * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
- (AccessibilityUIElement::language):
+ * Scripts/webkitpy/layout_tests/data/platform/test: Added property svn:ignore.
+ * Scripts/webkitpy/layout_tests/layout_package: Added property svn:ignore.
+ * Scripts/webkitpy/layout_tests/test_types: Added property svn:ignore.
+ * Scripts/webkitpy/test: Added property svn:ignore.
+ * Scripts/webkitpy/thirdparty/simplejson: Added property svn:ignore.
-2009-06-24 Eric Seidel <eric@webkit.org>
+2010-05-28 Chris Fleizach <cfleizach@apple.com>
- Reviewed by Maciej Stachowiak.
-
- Spell Maciej's name right and add Brady Eidson.
+ Reviewed by Beth Dakin.
- * Scripts/modules/bugzilla.py:
+ Adding myself as a reviewer.
-2009-06-23 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/common/config/committers.py:
- Reviewed by Dave Levin.
+2010-05-28 Chris Fleizach <cfleizach@apple.com>
- Fix missing comment message during land-patches and SVN.commit_with_message respecting --dry-run
- https://bugs.webkit.org/show_bug.cgi?id=26669
+ Build fix. No review.
- * Scripts/bugzilla-tool:
- * Scripts/modules/scm.py:
+ AX: need to catch NSAccessibilityExceptions in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=39881
-2009-06-23 Takeshi Yoshino <tyoshino@google.com>
+ It looks like Tiger doesn't like seeing a NSMakeRange inside a @try.
- Reviewed by Mark Rowe.
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::rowIndexRange):
+ (AccessibilityUIElement::columnIndexRange):
+ (AccessibilityUIElement::selectedTextRange):
- Bug 26537: Builds from command-line fail if custom build product directory is set and ~/Library/Preferences/xcodebuild.plist exists
- https://bugs.webkit.org/show_bug.cgi?id=26537
+2010-05-28 Chris Fleizach <cfleizach@apple.com>
- Let determineBaseProductDir subroutine remove
- ~/Library/Preferences/xcodebuild.plist. It can prevent xcodebuild from
- respecting global settings such as a custom build products directory
- (<rdar://problem/5585899>).
+ Reviewed by Darin Adler.
- * Scripts/webkitdirs.pm:
+ AX: need to catch NSAccessibilityExceptions in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=39881
-2009-06-23 Eric Seidel <eric@webkit.org>
+ Normally, accessibility exceptions are caught in the AX Runtime on the Mac, but
+ because DRT is its own AX client, no one is there to catch these otherwise innocuous exceptions.
+
+ So DRT should wrap exception handlers around its AX related calls.
- Reviewed by Dave Levin.
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (attributesOfElement):
+ (AccessibilityUIElement::getLinkedUIElements):
+ (AccessibilityUIElement::getDocumentLinks):
+ (AccessibilityUIElement::getChildren):
+ (AccessibilityUIElement::getChildrenWithRange):
+ (AccessibilityUIElement::ariaOwnsElementAtIndex):
+ (AccessibilityUIElement::ariaFlowToElementAtIndex):
+ (AccessibilityUIElement::disclosedRowAtIndex):
+ (AccessibilityUIElement::selectedRowAtIndex):
+ (AccessibilityUIElement::titleUIElement):
+ (AccessibilityUIElement::parentElement):
+ (AccessibilityUIElement::disclosedByRow):
+ (AccessibilityUIElement::stringAttributeValue):
+ (AccessibilityUIElement::boolAttributeValue):
+ (AccessibilityUIElement::isAttributeSettable):
+ (AccessibilityUIElement::isAttributeSupported):
+ (AccessibilityUIElement::role):
+ (AccessibilityUIElement::subrole):
+ (AccessibilityUIElement::roleDescription):
+ (AccessibilityUIElement::title):
+ (AccessibilityUIElement::description):
+ (AccessibilityUIElement::orientation):
+ (AccessibilityUIElement::stringValue):
+ (AccessibilityUIElement::language):
+ (AccessibilityUIElement::helpText):
+ (AccessibilityUIElement::x):
+ (AccessibilityUIElement::y):
+ (AccessibilityUIElement::width):
+ (AccessibilityUIElement::height):
+ (AccessibilityUIElement::clickPointX):
+ (AccessibilityUIElement::clickPointY):
+ (AccessibilityUIElement::intValue):
+ (AccessibilityUIElement::minValue):
+ (AccessibilityUIElement::maxValue):
+ (AccessibilityUIElement::valueDescription):
+ (AccessibilityUIElement::insertionPointLineNumber):
+ (AccessibilityUIElement::isActionSupported):
+ (AccessibilityUIElement::isEnabled):
+ (AccessibilityUIElement::isRequired):
+ (AccessibilityUIElement::isSelected):
+ (AccessibilityUIElement::isExpanded):
+ (AccessibilityUIElement::hierarchicalLevel):
+ (AccessibilityUIElement::ariaIsGrabbed):
+ (AccessibilityUIElement::ariaDropEffects):
+ (AccessibilityUIElement::lineForIndex):
+ (AccessibilityUIElement::boundsForRange):
+ (AccessibilityUIElement::stringForRange):
+ (AccessibilityUIElement::attributesOfColumnHeaders):
+ (AccessibilityUIElement::attributesOfRowHeaders):
+ (AccessibilityUIElement::attributesOfColumns):
+ (AccessibilityUIElement::attributesOfRows):
+ (AccessibilityUIElement::attributesOfVisibleCells):
+ (AccessibilityUIElement::attributesOfHeader):
+ (AccessibilityUIElement::rowCount):
+ (AccessibilityUIElement::columnCount):
+ (AccessibilityUIElement::indexInTable):
+ (AccessibilityUIElement::rowIndexRange):
+ (AccessibilityUIElement::columnIndexRange):
+ (AccessibilityUIElement::cellForColumnAndRow):
+ (AccessibilityUIElement::selectedTextRange):
+ (AccessibilityUIElement::setSelectedTextRange):
+ (AccessibilityUIElement::increment):
+ (AccessibilityUIElement::decrement):
+ (AccessibilityUIElement::showMenu):
+ (AccessibilityUIElement::press):
+ (AccessibilityUIElement::url):
+ (AccessibilityUIElement::hasPopup):
- Make SCM.run_command smarter, and make all previous
- os.system and subprocess.popen use SCM.run_command instead.
- https://bugs.webkit.org/show_bug.cgi?id=26666
+2010-05-28 Yael Aharon <yael.aharon@nokia.com>
- This makes it easier to handle errors in a standard way throughout all the code.
- Since this new code raises by default when the exit_code != 0,
- we should prevent future problems of bugzilla-tool continuing after
- a git or svn command failed.
+ Reviewed by Laszlo Gombos.
- * Scripts/modules/scm.py:
+ [Qt] Pass all web notification layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=39146
-2009-06-23 Joe Mason <joe.mason@torchmobile.com>
+ Mimic Chromium's test_shell security model in Qt's DRT.
+ It makes a list of origins which were granted permission to display
+ notifications, and only those origins can display notifications.
- Reviewed by Adam Treat.
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::checkPermissionCallback):
+ (WebCore::requestPermissionCallback):
+ (WebCore::WebPage::WebPage):
+ (WebCore::DumpRenderTree::checkPermission):
+ (WebCore::DumpRenderTree::requestPermission):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::grantDesktopNotificationPermission):
+ (LayoutTestController::checkDesktopNotificationPermission):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
- https://bugs.webkit.org/show_bug.cgi?id=26664
- * Scripts/prepare-ChangeLog: Added --git-index mode to list only the
- changes which are already staged in the index. Useful to create an
- entry for what you're about to commit while ignoring unstaged changes.
+2010-05-27 Philippe Normand <pnormand@igalia.com>
-2009-06-23 Anders Carlsson <andersca@apple.com>
+ Reviewed by Shinichiro Hamaji.
- Reviewed by Darin Adler.
-
- Update for WebKit changes.
-
- * DumpRenderTree/win/UIDelegate.h:
- (UIDelegate::willPerformDragSourceAction):
+ check-webkit-style complains about use of NULL in GTK function calls that require sentinels
+ https://bugs.webkit.org/show_bug.cgi?id=39372
-2009-06-23 Eric Seidel <eric@webkit.org>
+ Don't warn about NULL in g_*() calls. Zero can't be used instead
+ for calls like g_build_filename and g_object_get/set.
- Reviewed by Mark Rowe.
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
- * Scripts/modules/scm.py: Fix commit_with_message to return the commit output.
+2010-05-27 Luiz Agostini <luiz.agostini@openbossa.org>
-2009-06-23 Eric Seidel <eric@webkit.org>
+ Reviewed by Kenneth Rohde Christiansen.
- Reviewed by Mark Rowe.
+ [Qt] Platform plugin example
+ https://bugs.webkit.org/show_bug.cgi?id=39489
- * Scripts/modules/scm.py: Fix error seen when commiting r44979.
+ Exempting directory WebKit/qt/examples/ from style guide.
-2009-06-18 Eric Seidel <eric@webkit.org>
+ * Scripts/webkitpy/style/checker.py:
- Reviewed by Dave Levin.
+2010-05-26 Philippe Normand <pnormand@igalia.com>
- WebKit needs a script to interact with bugzilla and automate
- parts of the patch posting and commit processes.
- https://bugs.webkit.org/show_bug.cgi?id=26283
+ Reviewed by David Levin.
- This is really a first-draft tool.
- It's to the point where it's useful to more people than just me now though.
- Git support works. SVN support is written, but mostly untested.
+ [style] Allow usage of NULL in gst_*_many()
+ https://bugs.webkit.org/show_bug.cgi?id=39740
- This tool requires BeautifulSoup and mechanize python modules to run:
- sudo easy_install BeautifulSoup
- sudo easy_install mechanize
+ Don't warn if NULL is used by gst_*_many() functions. Zero can't
+ be used for the reason explained in Bug 32858.
- More important than the tool itself are the Bugzilla, Git and SVN class abstractions
- which I hope will allow easy writing of future tools.
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
- The tool currently implements 10 commands, described below.
+2010-05-27 Adam Barth <abarth@webkit.org>
- Helpers for scripting dealing with the commit queue:
- bugs-to-commit Bugs in the commit queue
- patches-to-commit Patches attached to bugs in the commit queue
+ Reviewed by Eric Seidel.
- Dealing with bugzilla:
- reviewed-patches BUGID r+'d patches on a bug
- apply-patches BUGID Applies all patches on a bug to the local working directory without committing.
- land-and-update BUGID Lands the current working directory diff and updates the bug.
- land-patches [options] BUGID Lands all patches on a bug optionally testing them first
- obsolete-attachments BUGID Marks all attachments on a bug as obsolete.
- commit-message Prints a commit message suitable for the uncommitted changes.
+ Update script to run the normal version of the parser tests.
- These effectively replace git-send-bugzilla:
- post-diff BUGID Attaches the current working directory diff to a bug as a patch file.
- post-commits BUGID COMMITISH Attaches a range of local commits to a bug as patch files.
+ * Scripts/test-html5-parser:
- post-diff works for SVN and Git, post-commits only works for SCMs with local-commit support (like Git)
+2010-05-27 Adam Barth <abarth@webkit.org>
- land-* commands in a Git environment only work with simple patches due to svn-apply bugs:
- https://bugs.webkit.org/show_bug.cgi?id=26299
- https://bugs.webkit.org/show_bug.cgi?id=26300
+ Reviewed by Eric Seidel.
- This script follows python style (similar to how for Obj-C we follow AppKit style)
- http://www.python.org/doc/essays/styleguide.html
- The Python community has a strong style culture and the WebKit style guide is silent re: Python.
+ Add HTML5 parser support to run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=39815
- I've filed a bug to update the WebKit style guide to mention python:
- https://bugs.webkit.org/show_bug.cgi?id=26524
+ * Scripts/old-run-webkit-tests:
- * Scripts/bugzilla-tool: Added.
+2010-05-26 Adam Barth <abarth@webkit.org>
-2009-06-22 Steve Falkenburg <sfalken@apple.com>
+ Reviewed by Eric Seidel.
- Remove errant line of code mistakenly checked in.
+ Make HTML5 lexer not ASSERT when resuming partial parses
+ https://bugs.webkit.org/show_bug.cgi?id=39755
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (main):
+ Add webkit-resumer.html to the HTML5 parser test suite.
-2009-06-22 Steve Falkenburg <sfalken@apple.com>
+ * Scripts/test-html5-parser:
- Pass correct value to setShouldPaintNativeControls.
-
- Rubber stamped by Mark Rowe.
+2010-05-24 Tony Chang <tony@chromium.org>
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (main):
+ Reviewed by Kent Tamura.
-2009-06-22 Steve Falkenburg <sfalken@apple.com>
+ [chromium] setup fonts on chromium linux DRT
+ https://bugs.webkit.org/show_bug.cgi?id=39644
- Fix last DumpRenderTree change to correctly set preferences flag without crashing.
-
- Reviewed by Mark Rowe.
+ * DumpRenderTree/chromium/TestShellGtk.cpp:
+ (setupFontconfig):
+ (platformInit):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::paintRect): Fix a bug where in release builds, we didn't initialize m_canvas.
+ * DumpRenderTree/chromium/fonts.conf: Added.
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (main):
+2010-05-24 Dirk Pranke <dpranke@chromium.org>
-2009-06-21 Steve Falkenburg <sfalken@apple.com>
+ Reviewed by Dimitri Glazkov.
- Set up global native controls flag before creating the first WebView.
-
- Reviewed by Darin Adler.
+ Re-commit r58765 - it had been rolled out to see if it was causing
+ a perf regression (in r59787 and r59789), but that does not seem to
+ have been the case.
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (main):
+ https://bugs.webkit.org/show_bug.cgi?id=39605
-2009-06-21 Mark Rowe <mrowe@apple.com>
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
+ (NotificationPresenter::show):
- Reviewed by Sam Weinig.
+2010-05-25 Ojan Vafai <ojan@chromium.org>
- Set a sensible user agent string for the HTTP requests that Sparkle makes (checking for and downloading updates).
+ Reviewed by Chris Jerdonek.
- * WebKitLauncher/WebKitNightlyEnablerSparkle.m:
- (userAgentStringForSparkle):
- (initializeSparkle):
+ remove suppression of rietveld logging
+ https://bugs.webkit.org/show_bug.cgi?id=39693
-2009-06-21 Mark Rowe <mrowe@apple.com>
+ Now that we only upload to rietveld explicitly, e.g. on the bot
+ or via webkit-patch post-attachment-to-rietveld, we should print
+ all the rietveld logging. It was suppressed before to avoid making
+ webkit-patch upload too noisy.
- Reviewed by Sam Weinig.
+ * Scripts/webkitpy/common/net/rietveld.py:
- Add a hook to the WebKit launcher application to allow a link on the nightly build start page to
- trigger an update via the built-in software update mechanism.
+2010-05-25 Antonio Gomes <tonikitoo@webkit.org>
- * WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj:
- * WebKitLauncher/WebKitLauncherURLProtocol.h: Added.
- * WebKitLauncher/WebKitLauncherURLProtocol.m: Added.
- (+[WebKitLauncherURLProtocol load]):
- (+[WebKitLauncherURLProtocol canInitWithRequest:]): Only allow use of the x-webkit-launcher scheme from .webkit.org subdomains.
- (+[WebKitLauncherURLProtocol canonicalRequestForRequest:]):
- (-[WebKitLauncherURLProtocol startLoading]):
- (-[WebKitLauncherURLProtocol stopLoading]):
- (-[WebKitLauncherURLProtocol handleIsWebKitLauncherAvailableJS]): Return a brief JavaScript snippet that can be used to programatically
- determine whether the x-webkit-launcher is available and working.
- (-[WebKitLauncherURLProtocol handleCheckForUpdates]): Trigger a software update on the main thread.
- (-[WebKitLauncherURLProtocol resourceNotFound]): Fail with a generic "File does not exist" error.
+ Reviewed by Ojan Vafai.
-2009-06-20 Jan Michael Alonzo <jmalonzo@webkit.org>
+ [Qt] Expose the editing behavior setting in DRT to test all editing code paths
+ https://bugs.webkit.org/show_bug.cgi?id=39680
- Reviewed by Gustavo Noronha and Xan Lopez.
+ Implement LayoutTestController::setEditingBehavior in Qt's DRT.
- [Gtk] Implement DRT XSS auditor support
- https://bugs.webkit.org/show_bug.cgi?id=26571
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setEditingBehavior):
- * DumpRenderTree/gtk/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting):
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setXSSAuditorEnabled):
+2010-05-25 Kevin Ollivier <kevino@theolliviers.com>
-2009-06-19 Darin Adler <darin@apple.com>
+ [wx] Build fix after API change and addition of WebCore/platform/text/transcoder dir.
- * Scripts/do-webcore-rename: More renaming ideas.
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setEditingBehavior):
+ * wx/build/settings.py:
-2009-06-15 Andre Pedralho <andre.pedralho@openbossa.org>
+2010-05-24 Antonio Gomes <tonikitoo@webkit.org>
- Reviewed by Tor Arne Vestbø.
+ Reviewed by Eric Seidel and Kent Tamura (for the Chromium part).
- Only pass --makeargs along if an argument is given.
+ editingBehavior settings needs to be set back to a reasonable default between tests
+ https://bugs.webkit.org/show_bug.cgi?id=39433
- * Scripts/build-webkit:
+ Similarly to r59861, hard code the default setting during reset for Gtk and Chromium,
+ so that the serialized version of the setting stays in sync with expectations.
-2009-06-19 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings):
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
- Unreviewed attempt to fix Windows build.
+2010-05-24 Eric Seidel <eric@webkit.org>
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setXSSAuditorEnabled):
+ Reviewed by Adam Barth.
-2009-06-18 Adam Barth <abarth@webkit.org>
+ webkit-patch land calls scm.changed_files 4 times!
+ https://bugs.webkit.org/show_bug.cgi?id=39584
- Reviewed by Sam Weinig.
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ - Assert that we don't call modified_changelogs too often.
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+ - Use cached changelogs list instead of calling modified_changelogs directly.
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+ - ditto.
- https://bugs.webkit.org/show_bug.cgi?id=26199
+2010-05-24 Kent Tamura <tkent@chromium.org>
- Add support for testing the XSSAuditor.
+ Reviewed by Dimitri Glazkov.
- * DumpRenderTree/LayoutTestController.cpp:
- (setXSSAuditorEnabledCallback):
- (LayoutTestController::staticFunctions):
- * DumpRenderTree/LayoutTestController.h:
- * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
- (LayoutTestController::setXSSAuditorEnabled):
- * DumpRenderTree/mac/DumpRenderTree.mm:
- (resetWebViewToConsistentStateBeforeTesting):
- * DumpRenderTree/mac/LayoutTestControllerMac.mm:
- (LayoutTestController::setXSSAuditorEnabled):
- * DumpRenderTree/win/DumpRenderTree.cpp:
- (resetWebViewToConsistentStateBeforeTesting):
- * DumpRenderTree/win/LayoutTestControllerWin.cpp:
- (LayoutTestController::setXSSAuditorEnabled):
- (LayoutTestController::setPopupBlockingEnabled):
- * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
- (LayoutTestController::setXSSAuditorEnabled):
+ [DRT/Chromium] Import layout_test_helper for Windows
+ https://bugs.webkit.org/show_bug.cgi?id=39581
-2009-06-18 Darin Adler <darin@apple.com>
+ Import Chromium win/layout_test_helper.cc as LayoutTestHelperWin.cpp.
+ http://src.chromium.org/viewvc/chrome/trunk/src/webkit/tools/test_shell/win/layout_test_helper.cc
- Rubber stamped by Mark Rowe.
+ * DumpRenderTree/chromium/LayoutTestHelperWin.cpp: Added.
- * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
- (-[DumpRenderTreeWindow close]): Resolved crashes seen during regression
- tests. The close method can be called on a window that's already closed
- so we can't assert here.
+2010-05-24 Kent Tamura <tkent@chromium.org>
-2009-06-17 Steve Falkenburg <sfalken@apple.com>
+ Reviewed by Dimitri Glazkov.
- Updated for consolidated WebKit COM interfaces.
-
- Reviewed by Adam Roben.
+ [DRT/Chromium] Reset frame name
+ https://bugs.webkit.org/show_bug.cgi?id=39586
- * DumpRenderTree/win/FrameLoadDelegate.cpp:
- * DumpRenderTree/win/FrameLoadDelegate.h:
- * DumpRenderTree/win/UIDelegate.cpp:
- * DumpRenderTree/win/UIDelegate.h:
- * WinLauncher/WinLauncher.h:
+ This change fixes about 70 unexpected results.
-2009-06-16 Adam Barth <abarth@webkit.org>
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::reset):
- Reviewed by Darin Adler.
+2010-05-24 Marcus Bulach <bulach@chromium.org>
- https://bugs.webkit.org/show_bug.cgi?id=26437
+ Reviewed by Kent Tamura.
- Make the commit-log-editor match the ambient line endings in commit
- messages.
+ [chromium] Adds WebGeolocationServiceMockImpl to remove public dependency on wtf/HashMap.h
+ https://bugs.webkit.org/show_bug.cgi?id=39587
- * Scripts/commit-log-editor:
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::geolocationService):
-2009-06-16 Xan Lopez <xlopez@igalia.com>
+2010-05-24 Robert Hogan <robert@webkit.org>
- Reviewed by Gustavo Noronha.
+ Reviewed by Laszlo Gombos.
- Update GtkLauncher to recent API changes in the progress property,
- which now goes from 0.0 to 1.0.
+ [Qt] DRT Support for removeOriginAccessWhitelistEntry
- * GtkLauncher/main.c:
+ Unskips http/tests/xmlhttprequest/origin-whitelisting-removal.html
-2009-06-16 Adam Barth <abarth@webkit.org>
+ [Qt] DRT Support for removeOriginAccessWhitelistEntry
+ https://bugs.webkit.org/show_bug.cgi?id=39565
- Reviewed by Darin Adler.
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::removeOriginAccessWhitelistEntry):
- https://bugs.webkit.org/show_bug.cgi?id=26000
+2010-05-24 Marcus Bulach <bulach@google.com>
- Teach prepare-ChangeLog to match the line ends that are already present
- in ChangeLog files. This helps folks whose use cygwin perl with CR LF
- line endings on Windows.
+ Reviewed by Ojan Vafai.
- Also, teach prepare-ChangeLog to normalize backslashes in paths. This
- helps folks who use Windows SVN prepare correct ChangeLogs.
+ _svn_branch_has_extra_commits needs to check for ^HEAD instead of ^head.
+ https://bugs.webkit.org/show_bug.cgi?id=39603
- * Scripts/prepare-ChangeLog:
+ * Scripts/webkitpy/common/checkout/scm.py:
-== Rolled over to ChangeLog-2009-06-16 ==
+== Rolled over to ChangeLog-2010-05-24 ==
diff --git a/WebKitTools/ChangeLog-2010-05-24 b/WebKitTools/ChangeLog-2010-05-24
new file mode 100644
index 0000000..f3f21b2
--- /dev/null
+++ b/WebKitTools/ChangeLog-2010-05-24
@@ -0,0 +1,35303 @@
+2010-05-24 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ add tests to ensure that --git-commit ranges are exclusive of the start of the range
+ https://bugs.webkit.org/show_bug.cgi?id=39612
+
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+
+2010-05-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add a temporary script for testing the html5 parser until it can run more layout tests
+ https://bugs.webkit.org/show_bug.cgi?id=39611
+
+ * Scripts/test-html5-parser: Added.
+
+2010-05-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Chris Jerdonek.
+
+ webkit-patch needs --verbose flag to enable DEBUG logging
+ https://bugs.webkit.org/show_bug.cgi?id=39208
+
+ I also added some code to print out how long commands take to run.
+
+ * Scripts/webkit-patch:
+ - Add hackish -v/--verbose parsing (similar to check-webkit-style)
+ * Scripts/webkitpy/common/system/executive.py:
+ - Log how long commands take to run.
+ * Scripts/webkitpy/tool/main.py:
+ - Add -v/--verbose option to global options.
+
+2010-05-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Split PatchReader out into its own file
+ https://bugs.webkit.org/show_bug.cgi?id=39576
+
+ This is in preparation for making check-webkit-style
+ support being passed paths to patch files on the command line.
+
+ * Scripts/check-webkit-style:
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checker_unittest.py:
+ * Scripts/webkitpy/style/patchreader.py: Added.
+ * Scripts/webkitpy/style/patchreader_unittest.py: Added.
+ * Scripts/webkitpy/style_references.py:
+
+2010-05-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ webkit-patch should let you add a comment when uploading a patch
+ https://bugs.webkit.org/show_bug.cgi?id=39552
+
+ As requested by Dan "the man" Bates.
+
+ * Scripts/webkitpy/tool/steps/options.py:
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+
+2010-05-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch should assign newly created bugs to their creator
+ https://bugs.webkit.org/show_bug.cgi?id=39548
+
+ As requested on webkit-dev.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+
+2010-05-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Hide prepare and post commands for webkit-patch
+ https://bugs.webkit.org/show_bug.cgi?id=39539
+
+ It turns out these commands aren't very popular and they confuse new
+ users. They'll still be there for advanced users, however.
+
+ * Scripts/webkitpy/tool/commands/upload.py:
+
+2010-05-23 Jesus Sanchez-Palencia <jesus@webkit.org>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] QtTestBrowser has two graphicsview options that aren't enabled correctly
+ https://bugs.webkit.org/show_bug.cgi?id=39491
+
+ Making toggleResizesToContents and toggleTiledBackingStore checkable when
+ QtTestBrowser is started on graphics view mode.
+
+ * QtTestBrowser/main.cpp:
+ (LauncherWindow::createChrome):
+
+2010-05-23 Jesus Sanchez-Palencia <jesus@webkit.org>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] QtTestBrowser is still called QtLauncher in the code
+ https://bugs.webkit.org/show_bug.cgi?id=39488
+
+ Finish the name change of QtLauncher to QtTestBrowser.
+
+ * QtTestBrowser/main.cpp:
+ (LauncherApplication::LauncherApplication):
+ (LauncherApplication::handleUserOptions):
+ * QtTestBrowser/mainwindow.cpp:
+ (MainWindow::MainWindow):
+ * QtTestBrowser/useragentlist.txt:
+
+2010-05-23 Marcus Bulach <bulach@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] Adds Geolocation support to DumpRenderTree.
+ https://bugs.webkit.org/show_bug.cgi?id=39440
+
+ Existing LayoutTests/fast/dom/Geolocation/* should pass.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::setGeolocationPermission):
+ (LayoutTestController::setMockGeolocationPosition):
+ (LayoutTestController::setMockGeolocationError):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::geolocationService):
+ * DumpRenderTree/chromium/WebViewHost.h:
+
+2010-05-22 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Re-order Yong's email addresses because his gmail account is the one he
+ uses for bugs.webkit.org.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-05-22 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Chris Jerdonek.
+
+ Add infrastructure to parse SVN property changes
+ https://bugs.webkit.org/show_bug.cgi?id=38885
+
+ Adds function VCSUtils::parseSvnDiffFooter to parse an SVN footer
+ that consists of one or more properties.
+
+ Note, the first line of an SVN footer begins with "Property changes on".
+
+ * Scripts/VCSUtils.pm:
+ - Added function parseSvnDiffFooter. Will use this function
+ towards resolving Bug #39409 <https://bugs.webkit.org/show_bug.cgi?id=39409>.
+ - Removed FIXME comment above function parseSvnProperty, since
+ it is being used by parseSvnDiffFooter.
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl: Added.
+ - Added unit tests.
+
+2010-05-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, fixing test results only.
+
+ Disable compositing tests on the commit-queue as a workaround for bug 38912
+ https://bugs.webkit.org/show_bug.cgi?id=39067
+
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ - Update test results after my previous change.
+
+2010-05-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed.
+
+ Disable compositing tests on the commit-queue as a workaround for bug 38912
+ https://bugs.webkit.org/show_bug.cgi?id=39067
+
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ - Disable all of compositing, not just compositing/iframes
+
+2010-05-22 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Link resources and load Ahem font for Windows
+ https://bugs.webkit.org/show_bug.cgi?id=39473
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main): Call platformInit().
+ * DumpRenderTree/chromium/TestShell.h:
+ Declare platformInit(). It is not related to TestShell class, but the
+ implementation of paltformInit() is placed at TestShell*.{cpp,mm}.
+ * DumpRenderTree/chromium/TestShellGtk.cpp:
+ (platformInit):
+ * DumpRenderTree/chromium/TestShellMac.mm:
+ (platformInit):
+ * DumpRenderTree/chromium/TestShellWin.cpp:
+ (platformInit):
+ - Make stdout/stderr binary mode
+ - Load Ahem font
+
+2010-05-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, EWS build fix only.
+
+ QueueStatusServer returns 500 error when EWS bots post empty queues
+ https://bugs.webkit.org/show_bug.cgi?id=39523
+
+ Mac python seems to have some built-in timezone support
+ however other python installs don't. So we need to ignore
+ timezones in our parsing.
+
+ Date parsing is tested by existing unit tests.
+
+ * QueueStatusServer/handlers/updateworkitems.py:
+ - Fix typo causing exception on server.
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ - Fix exception due to python's lack of timezone support.
+
+2010-05-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ QueueStatusServer returns 500 error when EWS bots post empty queues
+ https://bugs.webkit.org/show_bug.cgi?id=39523
+
+ updateworkitems handler was raising an exception because
+ int() couldn't convert "" to a number.
+
+ I attempted to unit test this but we don't yet have a system by
+ which to load unit tests for appengine classes which depend on
+ google.appengine libraries which are not in the python default install.
+
+ We'll need to write a wrapper script to load those into the python path
+ and then run the unit test files.
+
+ * QueueStatusServer/handlers/statusbubble.py:
+ - Hide cr-win-ews since we're not currently running this bot.
+ * QueueStatusServer/handlers/updateworkitems.py:
+ - Fix the parsing logic to be able to understand "".
+ * Scripts/webkitpy/common/net/statusserver.py:
+ - Only log the work items posted to the server to the debug log channel.
+
+2010-05-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, fixing the commit-queue to run again.
+
+ Make the EWSes report queue position in white bubbles
+ https://bugs.webkit.org/show_bug.cgi?id=39519
+
+ * Scripts/webkitpy/common/net/statusserver.py:
+ - Fix exception in _post_work_items_to_server when passed
+ integers. Unfortunately we have no good way to mock
+ the Browser object yet, and after several attempts I was
+ not able to create a good one, so no tests. :(
+
+2010-05-14 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch land --squash commits too much if branch is not up to date
+ https://bugs.webkit.org/show_bug.cgi?id=38852
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+
+2010-05-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make the EWSes report queue position in white bubbles
+ https://bugs.webkit.org/show_bug.cgi?id=39519
+
+ This also fixes sorting of commit-queue patches
+ to be in order of patch attachment.
+ https://bugs.webkit.org/show_bug.cgi?id=33395
+
+ This makes the various Queues post what patches they are about to process
+ so that we can display a list of patches on status server pages, as well
+ as report queue position in status bubbles.
+
+ This is the first step towards creating a control-channel for the queues.
+ Next step will be to have them read back the patches in order from the server
+ and finally we will add the ability for the server to control that order.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ - Teach bugzilla how to parse attach_date for attachments.
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ - Test that we're parsing dates correctly.
+ This may have timezone issues for non-PST contributers, unsure.
+ * Scripts/webkitpy/common/net/statusserver.py:
+ - Post work items to the status server for display.
+ * Scripts/webkitpy/tool/bot/patchcollection.py:
+ - Call StatusServer.update_work_items
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ - Update unit test results now that we're posting work item list.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ - Call StatusSever.update_work_items
+ - Sort patches so that the server's list understands
+ that the commit-queue gives priority to rollout patches.
+ - I also fixed patch sorting per bug 33395 while I was here.
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ - Update results after update_work_items changes.
+ - Test attachment sorting.
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Add mock for update_work_items
+
+2010-05-21 Robin Cao <robin.cao@torchmobile.com.cn>
+
+ Reviewed by Adam Roben.
+
+ fast/dom/HTMLObjectElement/children-changed.html times out on Windows run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=31315
+
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ (FrameLoadDelegate::didFailProvisionalLoadWithError): Need to invoke locationChangeDone here as mac port does.
+
+2010-05-20 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Dan Bernstein.
+
+ <rdar://problem/7848154> Remove the dependency on Foundation's private __COCOA_FORMAL_PROTOCOLS_2__ define.
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+
+2010-05-20 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Daniel Bates.
+
+ Look in /proc/registry64 for the Platform SDK on 64-bit Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=39296
+
+ The build-webkit script failed for me on Vista 64. A web search turned
+ up this blog post with a patch that worked for me:
+ http://www.nicholaswilson.me.uk/2010/04/hacking-webkit-fail/
+
+ * Scripts/webkitdirs.pm:
+
+2010-05-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ ThreadedMessageQueue should use with_statement for exception safety
+ https://bugs.webkit.org/show_bug.cgi?id=39233
+
+ * Scripts/webkitpy/common/thread/threadedmessagequeue.py:
+
+2010-05-20 Diego Gonzalez <diegohcg@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QtTestBrowser does not support websites which requires HTTP Authentication via dialogs
+ https://bugs.webkit.org/show_bug.cgi?id=38456
+
+ * QtTestBrowser/webpage.cpp:
+ (WebPage::WebPage):
+ (WebPage::authenticationRequired):
+ * QtTestBrowser/webpage.h:
+
+2010-05-20 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Eric Seidel.
+
+ editingBehavior settings needs to be set back to a reasonable default between tests
+ https://bugs.webkit.org/show_bug.cgi?id=39433
+
+ For now, hard code the default setting during reset, so that the serialized
+ version of the setting stays in sync with expectations.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues): Reset editing behavior to the appropriate platform default.
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues): Ditto.
+
+2010-05-20 Brent Fulgham <bfulgham@webkit.org>
+
+ Build fix. No review.
+
+ The WebKitAPITest targets do not use the "_debug" suffix needed
+ by the WinCairo port. Added Debug_Cairo target to correct this.
+
+ * WebKitAPITest/WebKitAPITest.vcproj:
+
+2010-05-20 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Ojan Vafai.
+
+ editing/selection/extend-selection-after-double-click.html crashes on the Leopard Intel release bot
+ https://bugs.webkit.org/show_bug.cgi?id=39431
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setEditingBehavior):
+ Prevent a double-free by not having this variable be in the auto-release pool.
+
+2010-05-20 Martin Robinson <mrobinson@webkit.org>
+
+ Reviewed by Ojan Vafai.
+
+ Expose the editing behavior setting in DRT to test all editing code paths
+ https://bugs.webkit.org/show_bug.cgi?id=38603
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setEditingBehaviorCallback): Added.
+ (LayoutTestController::staticFunctions): Expose the setEditingBehaviorCallback function.
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp: Add callback method for setting editing behavior.
+ * DumpRenderTree/chromium/LayoutTestController.h: Declaration for this method.
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setEditingBehavior): Implementation of editing behavior control.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setEditingBehavior): Ditto
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setEditingBehavior): Added stub implementation of editing behavior control.
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::setEditingBehavior): Add slot for controlling editor behavior.
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setEditingBehavior): Implementation of editing behavior control.
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setEditingBehavior): Added stub implementation of editing behavior control.
+
+2010-05-20 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [DRT/Chromium] Increase the time out value
+ https://bugs.webkit.org/show_bug.cgi?id=39203
+
+ Change the time out value of Chromium DRT to 30 seconds, which is
+ the same as other ports.
+ If a DRT process exits before new-run-webkit-tests detects time
+ out, new-run-webkit-tests assumes the DRT process crashed.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::layoutTestTimeout):
+ Change the time out value from 10 seconds to 30 seconds.
+
+2010-05-20 Chris Evans <cevans@google.com>
+
+ Unreviewed.
+
+ Marking myself as a committer.
+
+ * Scripts/webkitpy/common/config/committers.py: Add cevans@google.com.
+
+2010-05-20 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbo.
+
+ [Qt] Weekly binary builds on Mac OS X don't work when launched in the Finder
+ https://bugs.webkit.org/show_bug.cgi?id=37273
+
+ * QtTestBrowser/QtTestBrowser.pro: Build QtLauncher as bundle in package builds
+
+2010-05-20 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed fix for websocket test failures.
+
+ * Scripts/new-run-webkit-websocketserver:
+ options is named parameter for factory.get().
+
+2010-05-20 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Chromium: Add --chromium option to new-run-webkit-websocketserver
+ https://bugs.webkit.org/show_bug.cgi?id=37664
+
+ Missed to pass options to factory.get() in r59595
+
+ * Scripts/new-run-webkit-websocketserver:
+ Pass options to factory.get().
+
+2010-05-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ WinEWS should build Debug instead of Release
+ https://bugs.webkit.org/show_bug.cgi?id=39242
+
+ This is a workaround for
+ https://bugs.webkit.org/show_bug.cgi?id=39197
+ Adam Roben and Brian Weinstein believe this may
+ also make building faster since Debug builds
+ take less time to link.
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+
+2010-05-19 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ * DumpRenderTree/chromium/NotificationPresenter.cpp:
+ (NotificationPresenter::show):
+
+2010-05-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ user.py throws exception when readline module is missing
+ https://bugs.webkit.org/show_bug.cgi?id=39239
+
+ * Scripts/webkitpy/common/system/user.py:
+ - The error handling path requires the "sys" module,
+ so added an import sys at the top of the file.
+
+2010-05-18 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Fix a repaint issue and textarea tests
+ https://bugs.webkit.org/show_bug.cgi?id=39054
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::canvas): Remove m_paintRect initialization in canvas().
+ This line updated m_paintRect unexpectedly during paintRect().
+ We don't need to initialize m_paintRect because show() does it.
+
+2010-05-18 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] new-run-webkit-tests --use-drt should run on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=37845
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+
+2010-05-18 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Fix some initialization/reset issues
+ https://bugs.webkit.org/show_bug.cgi?id=39281
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::reset): Reset m_userStyleSheetLocation.
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ Remove unused variable, m_workQueueFrozen.
+ (LayoutTestController::WorkQueue::WorkQueue): Initialize m_frozen.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetTestController): Reset WebSettings too.
+
+2010-05-18 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ new-run-webkit-tests: implement '--reset-results' flag to complement
+ the '--new-baseline' flag. '--new-baseline' will always write the
+ results into the platform directory; '--reset-results' will update the
+ existing baseline wherever it happens to be. Both sets of behavior
+ are useful in different circumstances.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38879
+
+ * Scripts/webkitpy/layout_tests/data/image/canvas-bg.html: Added.
+ * Scripts/webkitpy/layout_tests/data/image/canvas-zoom-expected.checksum: Added.
+ * Scripts/webkitpy/layout_tests/data/image/canvas-zoom-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/image/canvas-zoom-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/image/canvas-zoom.html: Added.
+ * Scripts/webkitpy/layout_tests/data/misc/crash-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/misc/crash.html: Added.
+ * Scripts/webkitpy/layout_tests/data/misc/missing-expectation.html: Added.
+ * Scripts/webkitpy/layout_tests/data/misc/passing-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/misc/passing.html: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/image/canvas-bg-expected.checksum: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/image/canvas-bg-expected.png: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/image/canvas-bg-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/platform/test/test_expectations.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/text/article-element-expected.txt: Added.
+ * Scripts/webkitpy/layout_tests/data/text/article-element.html: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+
+2010-05-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add an --html5-parser option to DumpRenderTree to allow testing the new HTML5Lexer
+ https://bugs.webkit.org/show_bug.cgi?id=39311
+
+ This flag allows us to run the new HTML5Lexer code.
+ Right now all documents parse as empty documents, but
+ now that we're able to run the code we can fix that.
+
+ Once we're able to lex a few basic documents I'll add
+ an --html5-parser flag to run-webkit-tests so that we test
+ running all of the layout tests with the HTML5 parser.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ (initializeGlobalsFromCommandLineOptions):
+
+2010-05-08 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix http/tests/xmlhttprequest/cross-origin-no-authorization.html
+ and http/tests/xmlhttprequest/cross-origin-authorization.html
+
+ QHttpNetworkRequest adds Authorization and Cookie headers to XHRs
+ without knowing if this is valid behaviour or not. In order to allow
+ Qt to decide whether Cookie/Authorization headers should be added
+ to an XHR QtWebKit needs to use an attribute added to QNetworkRequest.
+ These new attributes are: QNetworkRequest::CookieLoadControlAttribute,
+ QNetworkRequest::CookieSaveControlAttribute,and
+ QNetworkRequest::AuthenticationReuseControlAttribute.
+
+ In order to properly support the tests, Qt's DRT needs to use one
+ NetworkAccessManager for all pages. This allows it to use cached
+ credentials where appropriate.
+
+ The tests now pass when run individually but there seems to be a problem with
+ leaking the results of requests across tests when run with the others in
+ http/tests. This will be addressed in a separate patch.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32967
+
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+
+
+2010-05-18 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ run_webkit_tests_unittest fails on SnowLeopard
+ https://bugs.webkit.org/show_bug.cgi?id=39279
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ Return copy of os.environ.
+ * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
+ Check os.environ was not modified.
+
+2010-05-18 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Chromium: new-run-webkit-httpd fails to setup_mount
+ https://bugs.webkit.org/show_bug.cgi?id=39257
+
+ * Scripts/webkitpy/common/system/executive.py:
+ Assert type of args in run_command.
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ Add test_run_command_args_type
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ Executive.run_command takes array for command line.
+ * Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py:
+ Test if setup_environ_for_server() run setup_mount.bat.
+
+2010-05-17 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by David Levin.
+
+ Chromium Windows build system does not rebuild correctly when
+ enabling/disabling a feature
+ https://bugs.webkit.org/show_bug.cgi?id=38926
+
+ Add a workaround of this issue.
+
+ * Scripts/update-webkit:
+ Chromium-Windows only: If WebKit/chromium/features.gyp has been
+ updated, remove WebKit/chromium/Debug and WebKit/chromium/Release.
+
+2010-05-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r59631.
+ http://trac.webkit.org/changeset/59631
+ https://bugs.webkit.org/show_bug.cgi?id=39255
+
+ chromium canaries can no longer run webkit_tests, suspect this
+ change. (Requested by atwilson on #webkit).
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-05-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Attempt to make new-run-webkit-tests --help more sane
+ https://bugs.webkit.org/show_bug.cgi?id=37836
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - Add a FIXME about options.singly and options.batch_size being different.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - Add support for hidden options.
+ - Add option groupings to attempt to simplify --help.
+ - Fix a bunch of option helps to start with a capitalized verb.
+ - Hide a bunch of options which make no sense to users.
+ - Sort options in --help.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ - Add tests for option sorting.
+
+2010-05-17 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Disable Icon Database by default in Qt DRT
+
+ Unskip:
+ http/tests/misc/favicon-loads-with-images-disabled.html
+ http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-in-body.html
+ http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag-parent-same-origin-deny.html
+ http/tests/security/XFrameOptions/x-frame-options-deny-meta-tag.html
+
+ https://bugs.webkit.org/show_bug.cgi?id=37382
+
+ Add support for layoutTestController.setIconDatabaseEnabled and layoutTestController.disableImageLoading().
+ The XFrameOptions tests were failing because of an extra resource load callback for favicon.ico requests.
+ These extra callbacks are removed by supporting both of the above layoutTestContoller commands.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings):
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ (WebCore::DumpRenderTree::drtStoragePath):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::disableImageLoading):
+ (LayoutTestController::setIconDatabaseEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-05-17 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Chromium: Add --chromium option to new-run-webkit-websocketserver
+ https://bugs.webkit.org/show_bug.cgi?id=37664
+
+ os.environ setup and setup_mount for cygwin are moved in ChromiumWinPort.setup_environ_for_server.
+
+ * Scripts/new-run-webkit-httpd:
+ Remove passing register_cygwin.
+ * Scripts/new-run-webkit-websocketserver:
+ Add --chromium flag.
+ Remove passing register_cygwin.
+ Create port object using options.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ Add setup_environ_for_server().
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ Ditto.
+ * Scripts/webkitpy/layout_tests/port/factory_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ Remove register_cygwin_parameter.
+ Call setup_environ_for_server().
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ Ditto.
+
+2010-05-16 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Chris Jerdonek.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39184
+
+ Adds function VCSUtils::parseSvnProperty to parse an SVN property with
+ either a single-line or multi-line value change.
+
+ * Scripts/VCSUtils.pm:
+ - Added function parseSvnProperty. We will use this function
+ towards resolving Bug #38885 <https://bugs.webkit.org/show_bug.cgi?id=38885>.
+ - Removed FIXME comment above function parseSvnPropertyValue, since
+ it is being used by parseSvnProperty.
+ - Modified function parseSvnPropertyValue to break out of "while (<$fileHandle>)"
+ loop when it encounters the start of the next property so that it can be
+ processed by its caller, parseSvnPropertyValue. We reference this bullet below
+ by (*).
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl: Added.
+ - Added unit tests.
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl:
+ - Changed the name of the unit test "simple multi-line '-' change" to
+ "single-line '-' change followed by empty line" since the former was an
+ incorrect description of this test.
+ - Added unit test "single-line '-' change followed by the next property", and
+ "multi-line '-' change followed by the next property" to test (*) above.
+
+2010-05-16 Tony Chang <tony@chromium.org>
+
+ Not reviewed, fixing layout test.
+
+ Don't output Inspect Element since this is not enabled on the bots,
+ but most developers probably have it installed.
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (-[EventSendingController contextClick:]):
+
+2010-05-12 Tony Chang <tony@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Spellcheck disabling does not disable context menu
+ https://bugs.webkit.org/show_bug.cgi?id=25639
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (+[EventSendingController isSelectorExcludedFromWebScript:]):
+ (+[EventSendingController webScriptNameForSelector:]):
+ (-[EventSendingController contextClick:]): add a bool parameter that
+ when true, dumps the context menu items to stdout.
+
+2010-05-16 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Unskip fast/loader/main-document-url-for-non-http-loads.html
+
+ Update Qt DRT to use frame loader, editor client and notification presenter
+ functions in DumpRenderTreeSupportQt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38867
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::open):
+ (WebCore::DumpRenderTree::dump):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::reset):
+ (LayoutTestController::dumpEditingCallbacks):
+ (LayoutTestController::dumpFrameLoadCallbacks):
+ (LayoutTestController::dumpResourceLoadCallbacks):
+ (LayoutTestController::setWillSendRequestReturnsNullOnRedirect):
+ (LayoutTestController::setWillSendRequestReturnsNull):
+ (LayoutTestController::setWillSendRequestClearHeader):
+
+2010-05-16 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, rolling out r59571.
+ http://trac.webkit.org/changeset/59571
+ https://bugs.webkit.org/show_bug.cgi?id=39054
+
+ Broke Cr Win, but we didn't notice immediately due to
+ https://bugs.webkit.org/show_bug.cgi?id=38926. It's possible
+ that this didn't actually break Cr Win, but rather that bug
+ 38926 necessitates a clean compile after this and sucessive
+ checkins only produced a partial recompile and thus failed to
+ build.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::canvas):
+
+2010-05-16 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt]Unskip security/set-form-autocomplete-attribute.html
+
+ Add support for layoutTestController.elementDoesAutoCompleteForElementWithId().
+
+ https://bugs.webkit.org/show_bug.cgi?id=38859
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::elementDoesAutoCompleteForElementWithId):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-05-16 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Fix repaint, WebGL, textarea tests
+ https://bugs.webkit.org/show_bug.cgi?id=39054
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::canvas): Remove m_paintRect initialization in canvas().
+ This line updated m_paintRect unexpectedly during paintRect().
+ We don't need to initialize m_paintRect because show() does it.
+
+2010-05-16 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Improve reporting of frame loader callbacks in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=36454
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewLoadStatusNotified):
+ (createWebView): added connection to notify::load-status and
+ signal callback
+
+2010-05-15 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Chris Jerdonek.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39170
+
+ Add function parseSvnPropertyValue to parse single-line and multi-line
+ property values of an SVN property change.
+
+ * Scripts/VCSUtils.pm:
+ Added function parseSvnPropertyValue. We will use this as part of
+ Bug #38885 <https://bugs.webkit.org/show_bug.cgi?id=38885>.
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl: Added.
+
+2010-05-15 Jochen Eisinger <jochen@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Add allowDatabase method to TestWebWorker.
+ https://bugs.webkit.org/show_bug.cgi?id=38742
+
+ * DumpRenderTree/chromium/TestWebWorker.h:
+ (TestWebWorker::allowDatabase):
+
+2010-05-15 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Antti Koivisto.
+
+ [Qt] Rename QtLauncher to QtTestBrowser
+ https://bugs.webkit.org/show_bug.cgi?id=37665
+
+ Forgot to remove the original directory after the rename.
+
+ * QtLauncher: Removed.
+
+2010-05-15 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r59544.
+ http://trac.webkit.org/changeset/59544
+ https://bugs.webkit.org/show_bug.cgi?id=39165
+
+ Cased LayoutTest to start crashing (Requested by abarth on
+ #webkit).
+
+ * Scripts/old-run-webkit-tests:
+
+2010-05-15 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ Ensure DRT loads GAIL (Gtk+ module), for a11y tests
+ https://bugs.webkit.org/show_bug.cgi?id=38648
+
+ Add the GTK_MODULES envvar (set to "gail") to the clean
+ environment when running DRT for the Gtk+ port
+
+ * Scripts/old-run-webkit-tests:
+
+2010-05-15 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Add script to check for minimum python version and install if missing on Tiger
+ https://bugs.webkit.org/show_bug.cgi?id=38886
+
+ Per Maciej's request on webkit-dev:
+ https://lists.webkit.org/pipermail/webkit-dev/2010-May/012785.html
+ provide a script which can automatically install Python on Tiger where
+ the system provided version is too old to be of use.
+
+ Note this uses the official Mac Python installer from python.org.
+ This installs a copy of Python in /Library/Frameworks/Python.framework.
+ It also makes symlinks from /usr/local/bin to the Python.framework/bin.
+
+ I have tested this script on Leopard and it worked fine. I have not
+ tested it on Tiger as I do not have access to a Tiger machine. In
+ either case this should provide a great starting point for someone
+ wishing to upgrade their copy of Python on Tiger.
+
+ Future patches can make our scripts depend on a success return from this
+ script and then they can either skip tests/sections for which python is
+ insufficient, or they can fail themselves.
+
+ * Scripts/ensure-valid-python: Added.
+
+2010-05-15 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Display queue position inside EWS bubbles
+ https://bugs.webkit.org/show_bug.cgi?id=38979
+
+ This ended up being a lot of clean-up to our status server code.
+
+ Added a new WorkItems model, a form with which to fill it,
+ and taught the Attachment class how to calculate the current queue
+ postion for an attachment using the data in WorkItems.
+
+ I also finally made statusbubble.* and dashboard.* not use copy-paste code.
+
+ The Attachment class has this summary() method which is very
+ controller/view-like and does not belong in a model class.
+ This patch got rid of all direct uses of summary().
+
+ * QueueStatusServer/handlers/dashboard.py:
+ - Build row objects to hand off to the view instead of handing off a
+ summary object and expecting the view to process it directly.
+ * QueueStatusServer/handlers/statusbubble.py:
+ - Build bubble object and hand them off to the view.
+ * QueueStatusServer/handlers/updatestatus.py:
+ - Code cleanup. Just move some code into _queue_status_from_request
+ to make the main put() handler easier to read.
+ * QueueStatusServer/handlers/updateworkitems.py: Added.
+ - Controller to handle storing WorkItems model objects.
+ * QueueStatusServer/main.py:
+ - Add route for /update-work-items
+ * QueueStatusServer/model/attachment.py:
+ - Add new methods to replace direct summary() access.
+ - Teach attachment how to calculate queue positions from WorkItems data.
+ * QueueStatusServer/model/queues.py:
+ - Move name_with_underscores here for easier re-use.
+ * QueueStatusServer/model/workitems.py: Added.
+ - New model for storing what items are currently queue for any bot.
+ * QueueStatusServer/templates/dashboard.html:
+ - Kill the copy/paste code!
+ * QueueStatusServer/templates/statusbubble.html:
+ - Kill the copy/paste code!
+ * QueueStatusServer/templates/updateworkitems.html: Added.
+ - Simple form for updating a queue's current work items.
+
+2010-05-15 Joanmarie Diggs <joanmarie.diggs@gmail.com>
+
+ Reviewed by Xan Lopez.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30500
+ [Gtk] Find a way for WebKit to "announce" itself so that ATs can readily distinguish it from true Gtk/Gail
+
+ The "announcement" is now made in the form of an object attribute
+ associated with the AtkObject.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::allAttributes):
+ (attributeSetToString):
+
+2010-05-15 Mario Sanchez Prada <msanchez@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ Accessibility: Implement isSelected in DRT for GTK
+ https://bugs.webkit.org/show_bug.cgi?id=31018
+
+ Implement AccessibilityUIElement::isSelected() for Gtk
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isSelected):
+
+2010-05-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ scm.py should use self.run instead of run_command
+ https://bugs.webkit.org/show_bug.cgi?id=38957
+
+ We've wanted to do this for a while, but it's a prerequiste for running
+ SVN from the cwd instead of the checkout_root.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+
+2010-05-14 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Consider implementing addOriginAccessWhitelistEntry method
+ https://bugs.webkit.org/show_bug.cgi?id=37578
+
+ Remove deprecated methods.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp
+ * DumpRenderTree/chromium/LayoutTestController.h
+
+2010-05-14 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Darin Adler.
+
+ Rename WebGLArray types to TypedArray types
+ https://bugs.webkit.org/show_bug.cgi?id=39091
+
+ Extended functionality of do-webcore-rename script and used it to
+ rename the WebGLArray types to the TypedArray naming convention.
+ The only source files which were touched by hand, and which are
+ being manually reviewed, are:
+ WebCore/page/DOMWindow.idl
+ WebCore/bindings/generic/RuntimeEnabledFeatures.h (script's changes undone)
+ WebKit/WebCore/bindings/js/JSDOMWindowCustom.cpp
+ WebKit/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+ These only needed to be touched to update the aliases between the
+ WebGLArray and TypedArray names introduced in bug 39036. (It was
+ not feasible to have do-webcore-rename handle this as it would
+ introduce circular renamings.) These aliases will be removed in
+ roughly a month once existing WebGL content has been updated.
+
+ No new tests; covered under existing WebGL tests. Updated
+ constructed-objects-prototypes and prototype-inheritance-2 tests.
+ Ran all layout tests in Safari and all WebGL tests in Chromium.
+
+ * Scripts/do-webcore-rename:
+ Handle the case where some renames are substrings of others.
+ Support renaming files containing custom JS bindings. If
+ isDOMTypeRename is non-zero, expand the regexp which rewrites
+ the file's contents in order to support custom JS bindings.
+
+2010-05-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch rollout throws exception if bug is already open
+ https://bugs.webkit.org/show_bug.cgi?id=38803
+
+ This was caused by someone incorrectly wrapping the code. :p
+ I'm going to have to start demanding unit tests for wrapping changes...
+
+ I also fixed the code to be able to reopen bugs which were never confirmed.
+ Before it regressed, the code would just log in that case. Now it actually
+ will reopen the bug, but there is a FIXME about how the logic is a bit backwards.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ - Yay testing!
+
+2010-05-14 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Antti Koivisto.
+
+ [Qt] Rename QtLauncher to QtTestBrowser
+
+ * QtTestBrowser: Copied from WebKitTools/QtLauncher.
+ * QtTestBrowser/QtLauncher.pro: Removed.
+ * QtTestBrowser/QtLauncher.qrc: Removed.
+ * QtTestBrowser/QtTestBrowser.pro: Copied from WebKitTools/QtLauncher/QtLauncher.pro.
+ * QtTestBrowser/QtTestBrowser.qrc: Copied from WebKitTools/QtLauncher/QtLauncher.qrc.
+ * Scripts/run-launcher:
+ * Scripts/webkitdirs.pm:
+
+2010-05-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Stop CCing webkit-bot-watchers
+ https://bugs.webkit.org/show_bug.cgi?id=39020
+
+ webkit-bot-watchers is somewhat of a failed experiment. No one
+ subscribed to the list (not even me). Removing it from the code
+ because wms says it bounces email sometimes.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+
+2010-05-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION: webkit-patch commit-message throws exception
+ https://bugs.webkit.org/show_bug.cgi?id=38997
+
+ * Scripts/webkitpy/tool/commands/upload.py:
+ - Fix to respect and pass the --squash and --git-commit options.
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ - Fix the unit test to use the central MockCheckout instead of
+ its own custom Mock which didn't require enough parameters.
+
+2010-05-13 Diego Gonzalez <diegohcg@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Improve QtLauncher user agent dialog resize
+ https://bugs.webkit.org/show_bug.cgi?id=39062
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::showUserAgentDialog):
+
+2010-05-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Ojan Vafai.
+
+ Disable compositing/iframes tests on the commit-queue as a workaround for bug 38912
+ https://bugs.webkit.org/show_bug.cgi?id=39067
+
+ Fix yet another typo in my original hack.
+ I also added another unit test for this fix.
+
+ * Scripts/webkitpy/common/config/ports.py:
+ * Scripts/webkitpy/common/config/ports_unittest.py:
+
+2010-05-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Ojan Vafai.
+
+ Disable compositing/iframes tests on the commit-queue as a workaround for bug 38912
+ https://bugs.webkit.org/show_bug.cgi?id=39067
+
+ My previous (unreviewed) hack didn't actually work due to checking "mac" instead of "Mac".
+ This change fixes my hack, and unit tests it.
+
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Make it possible to make run_command log too.
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ - Fix my hack to actually work.
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ - Test my hack (and basic RunTests behavior as well).
+
+2010-05-13 Antonio Gomes <tonikitoo@webkit.org>, Yi Shen <yi.4.shen@nokia.com>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo
+ https://bugs.webkit.org/show_bug.cgi?id=37759
+
+ WebKitTools:
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::computedStyleIncludingVisitedInfo):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-05-10 Adam Roben <aroben@apple.com>
+
+ Convert status bar text to UTF-8 before logging it on Windows
+
+ We were previously logging the text using printf("%S", bstr). This
+ converts the UTF-16 BSTR to a multibyte string using wctomb, which
+ uses the codepage for the current locale to perform the conversion.
+ The conversion was failing, causing printf to bail and truncate the
+ string. By converting to UTF-8 manually before logging, we avoid this
+ issue (and also end up with UTF-8 output, which is what the expected
+ results contain). We may have to do this in other places in DRT,
+ eventually.
+
+ Fixes <http://webkit.org/b/38849> REGRESSION (r59016):
+ plugins/set-status.html fails on Windows
+
+ Reviewed by Alexey Proskuryakov.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (toUTF8): Moved this here from FrameLoadDelegate. Renamed from
+ BSTRtoString.
+
+ * DumpRenderTree/win/DumpRenderTreeWin.h: Added declaration of toUTF8.
+
+ * DumpRenderTree/win/FrameLoadDelegate.cpp: Removed BSTRtoString.
+ (descriptionSuitableForTestResult): Updated for rename.
+
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::setStatusText): Convert the status bar text to UTF-8
+ before logging it so that Windows won't try (and fail) to convert it
+ to the current locale's codepage.
+
+2010-05-13 Eric Seidel <eric@webkit.org>
+
+ Unreviewed hack, attempting to get the commit-queue running again.
+
+ Disable compositing/iframes tests on the commit-queue as a workaround for bug 38912
+ https://bugs.webkit.org/show_bug.cgi?id=39067
+
+ I had this hack locally on the commit-queue, but it's fragile
+ and broke this morning. It will work much better if committed
+ to the repository. In either case it's temporary while we
+ work up a real fix for bug 38912.
+
+ * Scripts/webkitpy/common/config/ports.py:
+ - Expose an is_leopard() method.
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ - Don't run compositing/iframes tests on the commit-queue under leopard.
+
+2010-05-13 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed fix. Revert previous change.
+
+ Even if with-statments are changed in websocket_server.py, it also claims syntax error for with statement in http_server.py.
+ Until python 2.5 is installed on tiger bot, skips websocket/tests on tiger.
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: use with statement
+
+2010-05-13 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed fix.
+
+ On tiger bot, it claims syntax error for with statement.
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: rewrite with statement with try-finally.
+
+2010-05-13 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by David Levin.
+
+ WebSocket: pywebsocket 0.5
+ https://bugs.webkit.org/show_bug.cgi?id=38034
+
+ Remove pywebsocket from webkitpy/thirdparty.
+ Make pywebsocket autoinstalled.
+
+ * Scripts/new-run-webkit-websocketserver:
+ Add --output-dir option.
+ * Scripts/old-run-webkit-tests:
+ Use new-run-webkit-websocketserver, rather than directly run pywebsocket's standalone.py
+ * Scripts/run-webkit-websocketserver:
+ Ditto.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ Use autoinstalled pywebsocket.
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ Autoinstall pywebsocket
+ * Scripts/webkitpy/thirdparty/pywebsocket: Removed.
+
+2010-05-12 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Fixed a bug in svn-apply whereby the reviewer would not get set if
+ the portion of the patch for the ChangeLog contains "NOBODY (**PS!)"
+ in the leading junk.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38998
+
+ * Scripts/VCSUtils.pm:
+ - Added the $changeLogTimeZone variable from svn-apply.
+ - Added setChangeLogDateAndReviewer() from svn-apply.
+ - Added a localTimeInProjectTimeZone() subroutine.
+ - In setChangeLogDateAndReviewer():
+ - Added an $epochTime parameter to make the subroutine more testable.
+ - Made the "NOBODY (**PS!)" regular expression more specific so that
+ it will not apply to text in the leading junk.
+ - Updated to call localTimeInProjectTimeZone().
+ * Scripts/svn-apply:
+ - Removed the $changeLogTimeZone file variable.
+ - Added an $epochTime file variable to represent the current time.
+ - Removed the setChangeLogDateAndReviewer() subroutine.
+ - Updated patch() to use the new setChangeLogDateAndReviewer() syntax.
+ * Scripts/webkitperl/VCSUtils_unittest/setChangeLogDateAndReviewer.pl: Added.
+ - Added unit tests.
+
+2010-05-12 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ test-webkitpy fails on windows due to lack of readline module
+ https://bugs.webkit.org/show_bug.cgi?id=38884
+
+ Win32 Python does not have a readline module, so we should
+ not exit(1) if the import fails.
+
+ Also the failure message is mac-specific and doesn't need to be.
+ Only print the mac-specific install instructions on mac.
+
+ * Scripts/webkitpy/common/system/user.py:
+
+2010-05-12 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Nate Chapin.
+
+ [DRT/Chromium] Add a missing Sans-serif font setting
+ https://bugs.webkit.org/show_bug.cgi?id=38981
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings):
+ Set "Helvetica" for Sans-serif. It is the same as the default setting of test_shell.
+
+2010-05-10 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch upload --fancy-review now uses the bugzilla bug ID as the rietveld ID
+ https://bugs.webkit.org/show_bug.cgi?id=38866
+
+ wkrietveld.appspot.com has already been updated to allow you to
+ pass --issue for the issue creation as well as subsequent uploads.
+
+ Also, remove the extra code for trying to read out the issue ID
+ from the changelog description since we just use the bugzilla ID now.
+
+ * Scripts/webkitpy/common/config/__init__.py:
+ * Scripts/webkitpy/common/net/rietveld.py:
+ * Scripts/webkitpy/tool/steps/postcodereview.py:
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+
+2010-05-12 Ojan Vafai <ojan@chromium.org>
+
+ No review needed.
+
+ Marking myself as a reviewer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-05-12 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: add a --print default option so that you can
+ easily get the default output plus something (e.g., you can say
+ '--print default,config' instead of '--print misc,one-line-progress,
+ one-line-summary,unexpected,unexpected-results,updates,config'.
+
+ Also, add more unit tests for --verbose, --print everything, etc.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38877
+
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+
+2010-05-12 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Qt build failures cause SheriffBot false positives
+ https://bugs.webkit.org/show_bug.cgi?id=38969
+
+ Add Qt bots back to the core builders, because bug fixed by r59261.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-05-12 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Slave losts cause build break on bots
+ https://bugs.webkit.org/show_bug.cgi?id=38980
+
+ * Scripts/build-webkit: Remove 0 byte sized files from productDir before build.
+
+2010-05-12 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed trivial fix after r59254.
+
+ * Scripts/old-run-webkit-tests:
+
+2010-05-12 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ run-webkit-tests --exit-after-N-failures should not count new tests as failures
+ https://bugs.webkit.org/show_bug.cgi?id=31829
+
+ * Scripts/old-run-webkit-tests:
+
+2010-05-12 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Simon Fraser.
+
+ Disable smooth scrolling on OS X when running tests
+ https://bugs.webkit.org/show_bug.cgi?id=38964
+
+ Some tests (like fast/repaint/fixed-move-after-keyboard-scroll.html)
+ depend on smooth scrolling behavior. Since this is off by default
+ in Leopard and on by default in Snow Leopard, DRT should turn it
+ off always to ensure a consistent test environment.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+
+2010-05-10 Rodrigo Belem <rodrigo.belem@openbossa.org>
+
+ Reviewed by Kenneth Christiansen , Simon Hausmann and Gustavo Noronha.
+
+ [Qt, Gtk] Allows build-webkit script to receive an install prefix as parameter
+ https://bugs.webkit.org/show_bug.cgi?id=26224
+
+ Added more parameters to build-webkit script, the --prefix for gkt
+ and --install-libs, --install-headers for qt. Now it is possible
+ to change the install prefix for gtk and install path for qt.
+
+ * Scripts/build-webkit:
+ * Scripts/webkitdirs.pm:
+
+2010-05-12 Philippe Normand <pnormand@igalia.com>
+
+ Unreviewed, added my IRC nickname.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-05-11 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fixed two FIXME's in svn-apply: eliminated the unnecessary %copiedFiles
+ variable and changed gitKnowsOfFile() to use exitStatus().
+
+ https://bugs.webkit.org/show_bug.cgi?id=38862
+
+ * Scripts/svn-apply:
+
+2010-05-11 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, just fixing python typo.
+
+ EWS bots should poll more often than every 5 minutes
+ https://bugs.webkit.org/show_bug.cgi?id=38968
+
+ Typo in _now(), add a unittest to prove I fixed it.
+
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+
+2010-05-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Qt build failures cause SheriffBot false positives
+ https://bugs.webkit.org/show_bug.cgi?id=38969
+
+ The Qt buildbot randomly fails to compile occasionally because its
+ network connection causes SVn to leave zero-byte files around. These
+ compile failures confuse SheriffBot into thinking someone's patch
+ caused a build break.
+
+ In this patch, I've temporarily removed Qt from the list of core
+ builders. Ossy is working on a script to clean up the zero byte files.
+ Once that goes in, we can add Qt back to the core builders.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-05-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ sheriffbot is spammy.
+ https://bugs.webkit.org/show_bug.cgi?id=38936
+
+ Reduce sheriffbot spam by not warning about new blameworthy revisions
+ that can be explained by previously blamed revisions. This might cause
+ us to not warn about some real failures, but we're getting too much
+ spam from slow builders that have large blamelists (and we've already
+ poked the responsible folks using data from a fast builder).
+
+ * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+ - Removed unneeded import
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ - The logic change
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ - Tests of the change
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Merged two declarations of MockBuilder
+
+2010-05-11 Tony Chang <tony@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] detect num processors to pass to make -j on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=38833
+
+ * Scripts/webkitdirs.pm:
+
+2010-05-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ EWS bots should poll more often than every 5 minutes
+ https://bugs.webkit.org/show_bug.cgi?id=38968
+
+ We'll make them poll every 2 minutes to start with.
+ I'm going to re-write how polling works soon, so this is
+ a stop-gap to try and make the bots more responsive.
+
+ If Bill notices any additional load on bugzilla we'll drop
+ the polling frequency back to 5 minutes. He's historically said
+ that the EWS bots appear to be a drop in the bucket and thus
+ should be able to poll much more frequently w/o causing trouble.
+
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ - Add a test for sleep_message
+
+2010-05-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue should commit rollouts without running tests
+ https://bugs.webkit.org/show_bug.cgi?id=38940
+
+ Most of this change is improving our test coverage for the commit-queue.
+ The only functional change is removing the --test flag when the commit-queue
+ is running in rollouts mode.
+
+ I added test coverage for status updates, and updated the commit-queue status
+ messages to distinguish rollout vs. normal landing mode in its empty queue
+ and land patch messages.
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ - Got rid of a bunch of copy/paste code using _default_expected_stderr
+ * Scripts/webkitpy/tool/commands/queues.py:
+ - Moved rollout patch filtering out of _validate_patches_in_commit_queue
+ so that we only have to check if the builders are green in one place.
+ - Make the "empty queue" message note which queue it is referring to.
+ - Don't pass --text to land-attachment when in rollout mode.
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ - Update results now that we're testing status updates.
+ - Test _can_build_and_test since I made a typo in that call while
+ writing this change and the unit tests failed to catch it!
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Log status updates to make them testable in our unit tests.
+
+2010-05-11 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Apply recent changes of test_shell to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=38895
+
+ Port the changes to test_shell during (r40492, r46810] of Chromium.
+ Highlights:
+ - Introduce NotificationPresenter
+ - Fix parameter mismatch of WebViewClient::startDragging()
+
+ This change fixes dozens of unexpected behaviors.
+
+ * DumpRenderTree/DumpRenderTree.gypi:
+ Add NotificationPresenter.{cpp,h}
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (applyKeyModifier):
+ (EventSender::EventSender):
+ (EventSender::reset):
+ (EventSender::webview):
+ (EventSender::doDragDrop):
+ (EventSender::keyDown):
+ (EventSender::addTouchPoint):
+ (EventSender::clearTouchPoints):
+ (EventSender::releaseTouchPoint):
+ (EventSender::setTouchModifier):
+ (EventSender::updateTouchPoint):
+ (EventSender::cancelTouchPoint):
+ (EventSender::sendCurrentTouchEvent):
+ (EventSender::touchEnd):
+ (EventSender::touchMove):
+ (EventSender::touchStart):
+ (EventSender::touchCancel):
+ * DumpRenderTree/chromium/EventSender.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::reset):
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::setAuthorAndUserStylesEnabled):
+ (LayoutTestController::setScrollbarPolicy):
+ (LayoutTestController::setWillSendRequestClearHeader):
+ (LayoutTestController::callShouldCloseOnWebView):
+ (LayoutTestController::grantDesktopNotificationPermission):
+ (LayoutTestController::removeOriginAccessWhitelistEntry):
+ (LayoutTestController::addUserScript):
+ (LayoutTestController::addUserStyleSheet):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/NotificationPresenter.cpp: Added.
+ * DumpRenderTree/chromium/NotificationPresenter.h: Added.
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ (TestShell::runFileTest):
+ (TestShell::resetTestController):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::eventSender):
+ (TestShell::notificationPresenter):
+ (TestShell::showDevTools):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::createView):
+ (WebViewHost::createPopupMenu):
+ (WebViewHost::startDragging):
+ (WebViewHost::notificationPresenter):
+ (WebViewHost::createApplicationCacheHost):
+ (WebViewHost::willSendRequest):
+ (WebViewHost::updateAddressBar):
+ (WebViewHost::updateURL):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost::addClearHeader):
+ (WebViewHost::clearHeaders):
+
+2010-05-10 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: fix a path-handling bug that was breaking the
+ dryrun ports on windows, and add a comment about why we don't run
+ the chromium dryrun tests by default on every port.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38796
+
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-05-11 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <http://webkit.org/b/38941> build-webkit shouldn't always override ENABLE_FOO Xcode configuration settings
+
+ * Scripts/build-webkit: Don't pass the ENABLE setting to xcodebuild if the value matches the default.
+ This will lead to xcodebuild picking up the settings from FeatureDefines.xcconfig, and will aid in
+ revealing problems that are due to inconsistent values for settings across projects.
+
+2010-05-11 Mark Rowe <mrowe@apple.com>
+
+ Build fix.
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+
+2010-05-10 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by David Levin.
+
+ CheckStyle was eating script errors when there were local-commits and working copy changes
+ https://bugs.webkit.org/show_bug.cgi?id=38880
+
+ * Scripts/webkitpy/tool/steps/checkstyle.py:
+ * Scripts/webkitpy/tool/steps/checkstyle_unittest.py: Added.
+
+2010-05-11 Jian Li <jianli@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Expose FileReader interface.
+ https://bugs.webkit.org/show_bug.cgi?id=38609
+
+ * Scripts/build-webkit: turn on building FileReader for Apple's WebKit.
+
+2010-05-10 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] Build DRT when running build-webkit --chromium
+ https://bugs.webkit.org/show_bug.cgi?id=38730
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: Removed.
+ * Scripts/build-dumprendertree: This does nothing now.
+
+2010-05-10 Jon Honeycutt <jhoneycutt@apple.com>
+
+ REGRESSION(r59100): Added test is broken on many platforms.
+ https://bugs.webkit.org/show_bug.cgi?id=38881
+
+ Reviewed by Eric Seidel.
+
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_Destroy):
+ Use pluginLog, rather than printf, to match other platforms.
+
+2010-05-10 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ Fix a build failure caused by assuming the default platform in
+ a unit test for new-run-webkit-tests instead of specifying
+ --platform test.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-05-10 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build-fix
+
+ new-run-webkit-tests: fix test failure caused by me failing to update
+ the expected output. Also, run '--platform test' instead of
+ 'platform dryrun' since the former is guaranteed to work and the
+ latter isn't.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-05-10 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ new-run-webkit-tests: looks like the unicode conversion broke
+ --print-last-failures and --retest-last-failures. Fixing.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-05-10 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ Re-attempt to fix 38616 - newline handling in new-run-webkit-tests.
+ I didn't handle some cases correctly before and the solution was
+ confusing. The new patch assumes all calls to the printing module
+ don't have newlines, and will append newlines where necessary, just
+ like logging does.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38790
+
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream_unittest.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-05-10 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Make tkent a reviewer
+ https://bugs.webkit.org/show_bug.cgi?id=38875
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-05-07 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Crash closing window containing Flash plug-in
+ https://bugs.webkit.org/show_bug.cgi?id=38797
+ <rdar://problem/7935266>
+
+ Reviewed by Eric Seidel.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginAllocate):
+ Initialize new member to false.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+ Added a new member.
+
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_New):
+ Check whether the element has the "testGetURLOnDestroy" attribute, and
+ record that.
+ (NPP_Destroy):
+ If "testGetURLOnDestroy" is set, perform a load while destroying the
+ plug-in.
+
+2010-05-10 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ Executive.kill_* do not work with windows python
+ https://bugs.webkit.org/show_bug.cgi?id=38872
+
+ http://trac.webkit.org/changeset/57444 is where the original
+ breakage occurred.
+ http://trac.webkit.org/changeset/58314 is where the regression
+ started affecting chromium.
+
+ I have since learned that sys.platform has no "windows" value.
+ "win32" is always the value, under 32 or 64 bit windows
+
+ The tests for this code are not run anywhere because
+ test-webkitpy does not yet work on "win32". Mostly due to
+ depending on unixisms like "cat" and "yes".
+
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+
+2010-05-10 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix a bug in rebaseline-chromium-webkit-tests where we would crash
+ instead of logging an error and exiting if it couldn't find either a
+ debug or a release build of the image diff binary.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38692
+
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py: Added.
+
+2010-05-10 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests fails when run under sys.platform == "windows" due to undefined signal.SIGKILL
+ https://bugs.webkit.org/show_bug.cgi?id=38861
+
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+
+2010-05-10 Jer Noble <jer.noble@apple.com>
+
+ Unreviewed.
+
+ Adding myself as a committer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-05-10 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ [Chromium] Add quota parameter to WebViewClient::createSessionStorageNamespace()
+ https://bugs.webkit.org/show_bug.cgi?id=38750
+
+ Put a per-origin quota on session storage since it is using memory in
+ the browser process, and should not be allowed to grow arbitrarily
+ large. See also http://trac.webkit.org/changeset/58828.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::createSessionStorageNamespace):
+ * DumpRenderTree/chromium/WebViewHost.h:
+
+2010-05-10 Csaba Osztrogonác <ossy@webkit.org>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] Roll-out r59020 and r59021, because the Qt part of these changes
+ haven't been landed in Qt trunk yet. Should be rolled-in again after the merge.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32967
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+
+2010-05-09 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Chris Jerdonek.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38812
+
+ Make the regular expressions for parsing the start of an SVN
+ and Git header global variables since they are used throughout
+ VCSUtils.pm.
+
+ * Scripts/VCSUtils.pm:
+
+2010-05-09 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Finished moving the header-parsing logic from svn-apply and -unapply
+ to VCSUtils.pm's parsing methods.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38802
+
+ * Scripts/VCSUtils.pm:
+ - Added to parseGitDiffHeader() the ability to parse and store
+ whether a file is new or deleted.
+ - Also reordered in parseGitDiffHeader() some of the else statements
+ to a more readable ordering.
+ - Added to parseSvnDiffHeader() the ability to parse and store
+ whether a file is new.
+ * Scripts/svn-apply:
+ - Changed handleGitBinaryChange() to use the new "isNew" and "isDeletion"
+ diffHash key-values.
+ - Changed patch() to use the new "isNew" diffHash key-value.
+ * Scripts/svn-unapply:
+ - Changed patch() to use the new "isNew" and "isDeletion" diffHash key-values.
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+ - Added unit tests for new and deleted files.
+ * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl:
+ - Updated the unit tests as necessary.
+ - Added a unit test for a deleted file.
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl:
+ - Updated the unit tests as necessary.
+
+2010-05-08 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Added to svn-apply support for git renames and copies with similarity
+ index less than 100%.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32834
+
+ * Scripts/VCSUtils.pm:
+ - Added to parseGitDiffHeader() support for renames and similarity
+ index less than 100%.
+ - Added to parseDiff() support for processing renames, renames with
+ changes, and copies with changes.
+ - Added to parsePatch() the ability to process multiple return
+ values from parseDiff().
+ * Scripts/svn-apply:
+ - Added to patch() the ability to process diff hashes with the
+ isDeletion key-value set.
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+ - Updated the unit tests as necessary.
+ - Added unit tests for rename with similarity index 100%,
+ rename with similarity index < 100%, and rename with a change
+ to the executable bit.
+ * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl:
+ - Added unit tests for rename with similarity index 100%,
+ rename with similarity index < 100%, and rename with a change
+ to the executable bit.
+ * Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl:
+ - Updated the unit tests as necessary.
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl:
+ - Simplified the carriage-return unit test to more narrowly test
+ only carriage returns.
+
+2010-05-08 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ This revision suppresses the misleading "error: pathspec..." messages
+ when using svn-apply to add a binary file from a Git diff.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38047
+
+ When adding a new binary file from a Git diff, svn-apply prints
+ a misleading error of the form -- "error: pathspec '<filename>' did
+ not match any file(s) known to git. Did you forget to 'git add'?"
+ This patch suppresses these messages since they are normal.
+
+ * Scripts/VCSUtils.pm:
+ Added the callSilently() subroutine from runPatchCommand.pl, which
+ executes a Perl function while suppressing STDERR.
+ * Scripts/svn-apply:
+ Refactored the Git portion of scmKnowsOfFile() into a
+ gitKnowsOfFile(), and called this new subroutine using callSilently().
+ * Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl:
+ Removed callSilently() since it was moved to VCSUtils.pm in this patch.
+
+2010-05-08 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [chromium]: Upload test results json files to app engine server
+ Add an option to run_webkit_tests.py to upload generated
+ JSON files to app engine server. These JSON files will be used
+ by chromium layout test falkiness dashboard.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36063
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_results_uploader.py: Added.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-05-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Build the ImageDiff tool for all platforms including Windows and Symbian
+ https://bugs.webkit.org/show_bug.cgi?id=38706
+
+ Use qmath.h instead of math.h to make it portable.
+
+ * DumpRenderTree/qt/ImageDiff.cpp:
+ (main):
+
+2010-05-08 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix http/tests/xmlhttprequest/cross-origin-no-authorization.html
+ and http/tests/xmlhttprequest/cross-origin-authorization.html
+
+ QHttpNetworkRequest adds Authorization and Cookie headers to XHRs
+ without knowing if this is valid behaviour or not. In order to allow
+ Qt to decide whether Cookie/Authorization headers should be added
+ to an XHR QtWebKit needs to use an attribute added to QNetworkRequest.
+ These new attributes are: QNetworkRequest::CookieLoadControlAttribute,
+ QNetworkRequest::CookieSaveControlAttribute,and
+ QNetworkRequest::AuthenticationReuseControlAttribute.
+
+ In order to properly support the tests, Qt's DRT needs to use one
+ NetworkAccessManager for all pages. This allows it to use cached
+ credentials where appropriate.
+
+ The tests now pass when run individually but there seems to be a problem with
+ leaking the results of requests across tests when run with the others in
+ http/tests. This will be addressed in a separate patch.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32967
+
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+
+
+2010-05-04 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] unskip http/tests/plugins/npapi-response-headers.html
+
+ Turns out this failed because run-webkit-tests was eating the first occurrence
+ of 'Content-Type: text/plain' in the test output as a header. Strange but true.
+ So do as Chromium does and preface all text dumps with the
+ 'Content-Type: text/plain' header.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38541
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::dump):
+
+2010-05-08 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ test-webkitpy fails under cygwin
+ https://bugs.webkit.org/show_bug.cgi?id=38718
+
+ * Scripts/webkitpy/common/system/executive.py:
+ - Add _KILL_PROCESS_KILLED_PROCESS_EXIT_CODE and
+ _KILL_ALL_KILLED_PROCESS_EXIT_CODE to store the expected
+ exit codes of processes killed by kill_process and kill_all.
+ These two constants are only used by the unit tests but are
+ stored in executive.py so they can be right next to the platform ifs.
+ - Remove unnecessary str() conversion, run_command does that for us.
+ - Make os.kill retry on cygwin on EAGAIN. It's unclear why CYGWIN
+ throws EAGAIN, but it only does so sometimes. 3 may not be enough
+ retries, but we'll try it to start with.
+ - Add _windows_image_name to automatically convert "yes" to "yes.exe"
+ for use with taskkill.exe /im. Various callers to kill_all could
+ be updated to remove the .exe, but that can be done in another patch.
+ - Use taskkill.exe for killall on cygwin.
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ - Use the new *_KILLED_PROCESS_EXIT_CODE constants which are correctly
+ set to 0 on windows/cygwin systems where taskkill.exe is used.
+ - Test _windows_image_name
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ - Add FIXME about including mac-snowleopard in baseline_search_path.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - Make default_configuration actually read from the Configuration file.
+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: Added.
+ - Test default_configuration
+ * Scripts/webkitpy/layout_tests/port/win.py:
+ - Need a basic baseline_search_path if --platform dryrun is to work.
+
+2010-05-08 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, just reverting commit.
+
+ REGRESSION(59000): r59000 contained all sorts of changes it should not have, needs revert.
+ https://bugs.webkit.org/show_bug.cgi?id=38798
+
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/win.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+
+2010-05-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ test-webkitpy fails under cygwin
+ https://bugs.webkit.org/show_bug.cgi?id=38718
+
+ * Scripts/webkitpy/common/system/executive.py:
+ - Add _KILL_PROCESS_KILLED_PROCESS_EXIT_CODE and
+ _KILL_ALL_KILLED_PROCESS_EXIT_CODE to store the expected
+ exit codes of processes killed by kill_process and kill_all.
+ These two constants are only used by the unit tests but are
+ stored in executive.py so they can be right next to the platform ifs.
+ - Remove unnecessary str() conversion, run_command does that for us.
+ - Make os.kill retry on cygwin on EAGAIN. It's unclear why CYGWIN
+ throws EAGAIN, but it only does so sometimes. 3 may not be enough
+ retries, but we'll try it to start with.
+ - Add _windows_image_name to automatically convert "yes" to "yes.exe"
+ for use with taskkill.exe /im. Various callers to kill_all could
+ be updated to remove the .exe, but that can be done in another patch.
+ - Use taskkill.exe for killall on cygwin.
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ - Use the new *_KILLED_PROCESS_EXIT_CODE constants which are correctly
+ set to 0 on windows/cygwin systems where taskkill.exe is used.
+ - Test _windows_image_name
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ - Add FIXME about including mac-snowleopard in baseline_search_path.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - Make default_configuration actually read from the Configuration file.
+ * Scripts/webkitpy/layout_tests/port/webkit_unittest.py: Added.
+ - Test default_configuration
+ * Scripts/webkitpy/layout_tests/port/win.py:
+ - Need a basic baseline_search_path if --platform dryrun is to work.
+
+ 2010-05-07 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ DryrunTest fails on every platform other than mac
+ https://bugs.webkit.org/show_bug.cgi?id=38796
+
+ The test uses the port detection logic to find a suitable
+ port to use results from. However that detection logic assumes
+ chromium on linux, which requires a chromium checkout which the
+ bots don't have. The test is broken and we'll need to fix it.
+ For now I'm just going to disable the test on all platforms besides mac.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+ 2010-05-07 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Clean up baseline_search_path to use map to reduce copy/paste code
+ https://bugs.webkit.org/show_bug.cgi?id=38792
+
+ Reading which portnames a port falls back to is easier if
+ we convert port names to paths with map instead of using copy/paste code.
+
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+ 2010-05-07 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ rollout commands fail when commit is missing bug number
+ https://bugs.webkit.org/show_bug.cgi?id=38791
+
+ * Scripts/webkitpy/tool/commands/download.py:
+ - _commit_info failed to actually return the CommitInfo in the no-bug-id case.
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ - Test that the fix worked.
+
+2010-05-07 Darin Fisher <darin@chromium.org>
+
+ Fix build bustage: toElement<T> should be to<T>.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::elementDoesAutoCompleteForElementWithId):
+
+2010-05-07 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Refactored VCSUtils.pm's parse-related methods to leave inapplicable
+ hash values unset instead of setting them to "undef".
+
+ https://bugs.webkit.org/show_bug.cgi?id=38724
+
+ Preferring "not set" over "undef" keeps the unit tests smaller and
+ easier to maintain. Otherwise, we would have to update every unit
+ test case each time we add support for a new key-value pair --
+ instead of just the relevant ones.
+
+ * Scripts/VCSUtils.pm:
+ - In parseGitDiffHeader(), adjusted the handling of these key-values:
+ executableBitDelta and isBinary.
+ - In parseSvnDiffHeader(), adjusted the handling of these key-values:
+ copiedFromPath, isBinary, and sourceRevision.
+ - In parseDiffHeader(), adjusted the handling of these key-values:
+ isGit and isSvn.
+ - In parseDiff(), adjusted the handling of these key-values:
+ isBinary, isGit, isSvn, and sourceRevision.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+ - Updated the unit tests as necessary.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
+ - Updated the unit tests as necessary.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl:
+ - Updated the unit tests as necessary.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl:
+ - Updated the unit tests as necessary.
+
+2010-05-06 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Dan Bernstein.
+
+ Exclude leaks due to <rdar://problem/7815391> from the output.
+
+ * Scripts/old-run-webkit-tests:
+
+2010-05-06 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r58933.
+ http://trac.webkit.org/changeset/58933
+ https://bugs.webkit.org/show_bug.cgi?id=38717
+
+ "Broke all websocket tests on Tiger" (Requested by eseidel on
+ #webkit).
+
+ * Scripts/new-run-webkit-websocketserver:
+ * Scripts/old-run-webkit-tests:
+ * Scripts/run-webkit-websocketserver:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ * Scripts/webkitpy/thirdparty/pywebsocket/COPYING: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/MANIFEST.in: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/README: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/README.webkit: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/example/echo_client.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/example/echo_wsh.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/example/handler_map.txt: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/__init__.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/dispatch.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/handshake.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/headerparserhandler.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/memorizingfile.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/msgutil.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/util.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/setup.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/config.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/mock.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/run_all.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/test_dispatch.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/test_handshake.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/test_memorizingfile.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/test_mock.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/test_msgutil.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/test_util.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/README: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/blank_wsh.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/origin_check_wsh.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/plain_wsh.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/hello.pl: Added.
+
+2010-05-06 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by David Levin.
+
+ WebSocket: pywebsocket 0.5
+ https://bugs.webkit.org/show_bug.cgi?id=38034
+
+ Remove pywebsocket from webkitpy/thirdparty.
+ Make pywebsocket autoinstalled.
+
+ * Scripts/new-run-webkit-websocketserver:
+ Add --output-dir option.
+ * Scripts/old-run-webkit-tests:
+ Use new-run-webkit-websocketserver, rather than directly run pywebsocket's standalone.py
+ * Scripts/run-webkit-websocketserver:
+ Ditto.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ Use autoinstalled pywebsocket.
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ Autoinstall pywebsocket
+ * Scripts/webkitpy/thirdparty/pywebsocket: Removed.
+
+2010-05-06 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ svn-apply now understands the Git diff "copy from" syntax when the
+ similarity index is 100%.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38628
+
+ * Scripts/VCSUtils.pm:
+ - Adjusted parseGitDiffHeader() to parse the "copy from" and
+ "similarity index" lines.
+
+ * Scripts/svn-unapply:
+ - Adjusted the patch() subroutine so that copies are recognized
+ as file additions.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl:
+ - Added unit tests for the cases of a copy with similarity index
+ 100% and less than 100%.
+
+2010-05-06 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Removed the need for svn-apply and -unapply to re-parse whether
+ a diff is binary or not.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38320
+
+ * Scripts/VCSUtils.pm:
+ - Adjusted parseGitDiffHeader() to set the isBinary key.
+ - Adjusted parseSvnDiffHeader() to set the isBinary key.
+ - Adjusted parseDiffHeader() to set the isBinary key.
+ - Changed the scmFormat key set by parseDiffHeader() to
+ isGit and isSvn keys.
+ - Adjusted parseDiff() to set the isBinary, isGit, and isSvn keys.
+
+ * Scripts/svn-apply:
+ - Updated the patch() method to use the isBinary, isGit, and
+ isSvn keys.
+
+ * Scripts/svn-unapply:
+ - Updated the patch() method to use the isBinary and isSvn keys.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+ - Updated the unit tests as necessary.
+ - Added a test case to test that the isBinary key is getting set properly.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
+ - Updated the unit tests as necessary.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl:
+ - Updated the unit tests as necessary.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl:
+ - Updated the unit tests as necessary.
+
+2010-05-06 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add support for resources on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=38637
+
+ Repack webkit_chromium_resources.pak, webkit_strings_en-US.pak,
+ and webkit_resources.pak, and put them as Mac bundle resource.
+ The 'actions' section is almost same as a part of test_shell.gypi.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+
+2010-05-06 Csaba Osztrogonác <ossy@webkit.org>
+
+ [Qt] Unreviewed buildfix after r58917.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.h: Missing function declaration added.
+
+2010-05-06 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler and Dan Bernstein..
+
+ REGRESSION (r51617): when plugins are disabled, plugins show up as garbage characters
+ https://bugs.webkit.org/show_bug.cgi?id=38698
+ <rdar://problem/7942075>
+
+ Add a 'setPluginsEnabled' layoutTestController function for disabling plug-ins. This is only implemented on Mac currently
+ because the bug that needs this functionality is mac specific.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setPluginsEnabledCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setPluginsEnabled):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setPluginsEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setPluginsEnabled):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setPluginsEnabled):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setPluginsEnabled):
+
+2010-05-06 Jochen Eisinger <jochen@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Make ImageDiff depend on WebKit. When compiled from within Chromium, WTF is not a standalone dynamic library but depends on WebKit.
+ https://bugs.webkit.org/show_bug.cgi?id=38632
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+
+2010-05-06 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Replace public inspector url with private property for QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=35340
+
+ Replace the public API with a private dynamic property until this feature
+ is ready.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::init):
+
+2010-05-05 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: build-webkit --inspector-frontend Should Exclude *.re2js
+ https://bugs.webkit.org/show_bug.cgi?id=38449
+
+ * Scripts/webkitdirs.pm:
+
+2010-05-05 Charles Wei <charles.wei@torchmobile.com.cn>
+
+ Reviewed by George Staikos
+
+ This patch adds WCSS -wap-input-format and -wap-input-required support to WebKit
+ Make the test cases in fast/wcss optionional only when WCSS is enabled.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37848
+
+ * Scripts/old-run-webkit-tests:
+ * Scripts/webkitperl/features.pm:
+
+2010-05-05 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [DRT/Chromium] Remove InitWebCoreSystemInterface() call
+ https://bugs.webkit.org/show_bug.cgi?id=38624
+
+ Chromium r45167 <http://src.chromium.org/viewvc/chrome?view=rev&revision=45167>
+ added InitWebCoreSystemInterface() to webkit/support/platform_support_mac.mm.
+ So we don't need to call it from DumpRenderTree.cpp anymore.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main): Remove InitWebCoreSystemInterface().
+
+2010-05-05 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: clean up newline handling in printing
+
+ The new printing module seems to handle newlines somewhat
+ inconsistently, especially in --verbose mode. This change cleans up
+ the code to make things more consistent and adds a bunch of unit tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38616
+
+ * Scripts/webkitpy/common/array_stream.py: Added.
+ * Scripts/webkitpy/common/array_stream_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-05-05 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Ban the single letter 'l' as an identifier name
+ http://trac.webkit.org/changeset/58844
+
+ Add a lint rule to ban the single letter 'l' as an identifier name
+ since it is very easy to confuse with the numeral '1', especially
+ in code like WebCore/css/CSSHelper.cpp.
+
+ See http://trac.webkit.org/changeset/58844 as an example of a bug
+ caused by confusing short variable names.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+
+2010-05-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ PrettyPatch.pretty_diff("") should not hang
+ https://bugs.webkit.org/show_bug.cgi?id=38552
+
+ Also found a bug in PrettyPatch.pretty_diff where it would
+ hang when passed "" as input.
+
+ I suspect there may be bugs in prettify.rb (or our use there-of)
+ where it can hang, which would then cause the testing thread to hang.
+
+ * Scripts/webkitpy/common/prettypatch.py:
+ - Don't hang when passed ""
+ * Scripts/webkitpy/common/prettypatch_unittest.py:
+ - Test that we don't hang when passed ""
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - Add a FIXME that we should share code with prettypatch.rb
+
+2010-05-04 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: turn off threading on the Chromium Mac port until
+ we can stabilize the port more and figure out why it is hanging so
+ frequently.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38553
+
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ - override default_child_processes() and log a warning
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - fix a typo that caused us to print a method object instead of the
+ value the method object returns in the case where there is only
+ one child process.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+ - Add unit tests for the output of run_webkit_tests - in this case,
+ the handling of --child-processes and --print config
+
+2010-05-04 Timothy Hatcher <timothy@apple.com>
+
+ Fix the find command in extract-localizable-strings so skip
+ directories are correctly skipped and header files are searched.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38545
+ rdar://problem/7941295
+
+ Reviewed by Darin Adler.
+
+ * Scripts/extract-localizable-strings: Append -o after each -prune
+ so -and isn't implied. Surround all the -name arguments so they get
+ an implied -print action. Removed check for "icu". Skip any header that
+ ends in LocalizableStrings.h, so SafariLocalizableStrings.h is skipped.
+ * Scripts/update-webkit-localizable-strings: Add the two icu directories
+ to the skip list.
+
+2010-05-04 Jesus Sanchez-Palencia <jesus@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Wrong documentation on 'webkit-patch help land'.
+ https://bugs.webkit.org/show_bug.cgi?id=37871
+
+ Small fix on the help documentation for webkit-patch
+ land.
+
+ * Scripts/webkitpy/tool/commands/download.py:
+
+2010-05-04 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QWebPage viewMode property
+ https://bugs.webkit.org/show_bug.cgi?id=38119
+
+ Rename the property from wrt_viewMode to _q_viewMode.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setViewModeMediaFeature):
+
+2010-05-04 Jochen Eisinger <jochen@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Fix typo in run_webkit_tests.py: s/_print\./_printer./
+ https://bugs.webkit.org/show_bug.cgi?id=38515
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-05-04 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ This revision completes the terminology change from "processor" to
+ "checker" for the CarriageReturnProcessor, CppProcessor,
+ PythonProcessor, and TextProcessor classes, etc.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38262
+
+ The word "processor" currently has two uses in our code. This
+ revision renames the lower-level use to "checker" and preserves the
+ word "processor" for higher-level, more general uses. This
+ revision also makes whatever other name changes that logically
+ followed from this change.
+
+ * Scripts/check-webkit-style:
+ - Updated references to PatchChecker.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Renamed the StyleCheckerConfiguration class to
+ StyleProcessorConfiguration.
+ - Renamed the ProcessorDispatcher class to CheckerDispatcher, and
+ made similar changes for the class's method names.
+ - Renamed the PatchChecker class to PatchReader.
+ - Updated the file as necessary to accommodate the other class
+ renames in this patch.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated the unit test code as necessary.
+
+ * Scripts/webkitpy/style/checkers/common.py:
+ - Renamed the CarriageReturnProcessor class to CarriageReturnChecker,
+ and changed its process() method to check().
+
+ * Scripts/webkitpy/style/checkers/common_unittest.py:
+ - Updated the unit test code as necessary.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ - Renamed the CppProcessor class to CppChecker, and renamed its
+ process() method to check().
+
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+ - Updated the unit test code as necessary.
+
+ * Scripts/webkitpy/style/checkers/python.py:
+ - Renamed the PythonProcessor class to PythonChecker, and renamed
+ its process() method to check().
+
+ * Scripts/webkitpy/style/checkers/python_unittest.py:
+ - Updated the unit test code as necessary.
+
+ * Scripts/webkitpy/style/checkers/text.py:
+ - Renamed the TextProcessor class to TextChecker, and renamed
+ its process() method to check().
+
+ * Scripts/webkitpy/style/checkers/text_unittest.py:
+ - Updated the unit test code as necessary.
+
+ * Scripts/webkitpy/style/error_handlers.py:
+ - Updated the code as necessary.
+
+ * Scripts/webkitpy/style/error_handlers_unittest.py:
+ - Updated the unit test code as necessary.
+
+2010-05-04 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Adjusted svn-apply and -unapply to accept git diffs generated
+ using the --no-prefix flag.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32438
+
+ * Scripts/VCSUtils.pm:
+ - Loosened the regular expression for the "diff --git" line to
+ match when the --no-prefix flag is used with "git diff".
+ - Also refactored the code parsing the first line so that the
+ script exits with an error message if the first line cannot
+ be parsed.
+ * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl:
+ - Added a unit test case for the --no-prefix case.
+
+2010-05-04 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Changed VCSUtils.pm's parseDiffHeader() to call the new
+ parseGitDiffHeader() method.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38454
+
+ This revision makes more progress towards adding executable-bit
+ support to svn-apply and svn-unapply. It also makes more progress
+ towards refactoring the code into a more maintainable form.
+
+ * Scripts/VCSUtils.pm:
+ - Removed gitdiff2svndiff().
+ - Removed the Git-specific logic from parseDiffHeader() and
+ renamed it parseSvnDiffHeader().
+ - Added a new parseDiffHeader() subroutine which calls
+ parseSvnDiffHeader() or parseGitDiffHeader() depending on
+ the format of the first header line.
+
+ * Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl: Removed.
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
+ - Removed most of the test cases since these cases are now
+ covered by the unit tests for parseSvnDiffHeader() and
+ parseGitDiffHeader().
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl: Added.
+ - Copied the SVN unit tests from parseDiffHeader.pl and updated
+ them as necessary.
+
+2010-05-03 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Builders should run the perl and python unit tests on every commit
+ https://bugs.webkit.org/show_bug.cgi?id=37976
+
+ The unit tests take a few seconds to run, so they should not
+ have any noticable effect on builder speed.
+
+ We're running the tests everywhere but Tiger as Tiger's
+ Python version is ancient.
+ I would have rather have detected the python version of the
+ slave but I couldn't find any API to do that, and I didn't want
+ to hack version detection into test-webkitpy (at least not yet).
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2010-05-03 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Fixed a recent REGRESSION that caused svn-apply and -unapply to
+ skip over changes to the first file in a diff if leading junk was
+ present (like in an e-mail diff) and if the --force option was used.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38507
+
+ * Scripts/svn-apply:
+ - Removed the bit of code at the beginning of the patch()
+ subroutine that checks for the "Index:" line at the beginning
+ of a file diff (since the parsePatch() subroutine already
+ checks this).
+
+ * Scripts/svn-unapply:
+ - Removed the bit of code at the beginning of the patch()
+ subroutine that checks for the "Index:" line at the beginning
+ of a file diff (since the parsePatch() subroutine already
+ checks this).
+
+2010-05-03 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Adjusted the ChangeLog entry below for r58732 (bug 35804) to reflect
+ the fact that the change will not become active until the patch
+ for bug 38454 lands.
+
+2010-05-03 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Added code for svn-apply and -unapply to display an instructive error
+ message if the --binary flag is left off the "git diff" command
+ for diffs containing binary file differences.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35804
+
+ This change will become active when parseDiffHeader() is modified
+ to call parseGitDiffHeader (see bug 38454).
+
+ * Scripts/VCSUtils.pm:
+ - Adjusted parseDiffHeader() to exit with an appropriate error message
+ if it encounters a line of the form "Binary files <path1> and
+ <path2> differ".
+
+2010-05-03 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ new-run-webkit-tests: r58728 broke the buildbot logic for parsing the
+ output of the log; specifying --verbose should basically be equivalent
+ to --print everything, but instead it was equivalent to not specifying
+ --print and getting the default set. Now, --verbose acts as if
+ --print everything was implicitly specified as the default (you can
+ still override it if you specify both; this is a somewhat debatable
+ call).
+
+ https://bugs.webkit.org/show_bug.cgi?id=38504
+
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+
+2010-05-03 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ new-run-webkit-tests: Fix minor precedence bug introduced in r58728 where we printed
+ "-\n" 78 times instead of "-" 78 times followed by a single "\n".
+
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py:
+
+2010-05-03 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: refactor a large chunk of the printing/logging
+ code out of run-webkit-tests py (almost 300 lines out of 1900).
+
+ This change also renames --log to --print (to be slightly more
+ descriptive). I've also added better help messages for printing.
+
+ The new code has unit tests!
+
+ There is still more code to be moved, but this patch is big enough as
+ it is. Namely, still to move are the printing of the actual results
+ and the timing statistics, which should move another 300-400 lines
+ out of the file.
+
+ Notable changes to run_webkit_tests.py beyond code simply moving:
+ * MeteredStream is now hidden under the new printing.Printer class.
+ All the references to self._meter now point to self._printer.
+ * All logging configuration is done in printing.configure_logging()
+ * Instead of using write() lambdas to control what is and isn't
+ printed, we use separate methods on the printer object. This will
+ make it easier to grep which print statements are printed
+ under protection of each flag.
+ * The print_results flag I added a few revs back to suppress printing
+ in the unit tests has been replaced with --print nothing.
+ * The ResultSummary class now stores the entire TestResult for each
+ test, not just the actual result type.
+ * summarize_unexpected_results() got moved from a method on TestRunner
+ to a standalone function. This should move into a separate file
+ along with the ResultSummary class and the TestResult class
+ * The --trace option added recently has been replaced by
+ '--print trace-everything' and '--print trace-unexpected'
+
+ https://bugs.webkit.org/show_bug.cgi?id=38018
+
+ * Scripts/new-run-webkit-tests:
+ - update to new entry points in run_webkit_tests.py
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+ - fix a minor nit where we were printing an empty string where
+ we didn't need to
+ * Scripts/webkitpy/layout_tests/layout_package/printing.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py: Added
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ - implement relative_test_filename() and expected_filename() so
+ we can test printing unexpected results in a platform-neutral
+ way
+ * Scripts/webkitpy/run_webkit_test.py:
+ - move a lot of the printing code into printing.py
+ - change the signatures of the exported entry points for easier
+ unit testing
+ * Scripts/webkitpy/run_webkit_tests_unittest.py:
+ - update w/ changes to run_webkit_tests entry points.
+
+2010-05-03 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ [wx] Build and use Mac's ComplexTextController to support complex text in wx.
+ https://bugs.webkit.org/show_bug.cgi?id=38482
+
+ * wx/build/settings.py:
+
+2010-05-03 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add support for controlling clipboard access from javascript.
+ Clipboard access from javascript is enabled in test framework.
+ https://bugs.webkit.org/show_bug.cgi?id=27751
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setJavaScriptCanAccessClipboardCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings):
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+
+2010-05-03 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Maui MiniBrowser: Add an option to show/hide the web view
+ https://bugs.webkit.org/show_bug.cgi?id=38486
+
+ * MiniBrowser/win/BrowserWindow.cpp:
+ (BrowserWindow::createWindow):
+ Set the background brush to something other than null.
+
+ (BrowserWindow::onCommand):
+ Show and hide the web view accordingly.
+
+ * MiniBrowser/win/MiniBrowser.rc:
+ * MiniBrowser/win/resource.h:
+ Add new menu item.
+
+2010-05-03 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Added a parseGitDiffHeader() subroutine to VCSUtils.pm that
+ parses any changes to the executable bit in a Git diff.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38425
+
+ This revision is more preparation towards adding "executable bit"
+ support to svn-apply and svn-unapply. No code is going "live" in
+ this change except for the new unit tests in test-webkitperl.
+
+ * Scripts/VCSUtils.pm:
+ - Added isExecutable() to determine whether a file mode has the
+ executable bit set or not.
+ - Added parseGitDiffHeader() to parse the header of a Git diff.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl: Added.
+ - Added unit tests for parseGitDiffHeader().
+
+2010-05-03 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Chris Jerdonek.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38447
+
+ Refactor the unit tests in VCSUtils_unittest/parseDiff.pl to use
+ Test::More::is_deeply like we do in VCSUtils_unittest/parseDiffHeader.pl.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+
+2010-05-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Corrected a file path in the ChangeLog entry for r58663 (bug 38319) below.
+
+2010-05-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38319
+
+ * Scripts/VCSUtils.pm:
+ - In parseDiffHeader()--
+ - Added an "scmFormat" hash key to the return value to represent
+ whether the diff is Git or SVN formatted.
+ - Adjusted the code so the value of "copiedFromPath" will
+ be undef rather than "does not exist" if the file was not
+ copied.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+ - Added a FIXME to refactor these unit tests to use is_deeply().
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
+ - Updated the unit tests to test the "scmFormat" value.
+ - Simplified the unit tests by refactoring them to use is_deeply().
+
+2010-05-01 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Chris Jerdonek.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38423
+
+ Adds infrastructure to change the file mode of a file using
+ the appropriate SCM-specific routines.
+
+ No functionality was changed, so no new tests.
+
+ * Scripts/VCSUtils.pm: Added subroutines scmToggleExecutableBit,
+ scmAddExecutableBit, and scmRemoveExecutableBit.
+ * Scripts/svn-apply: Check for the hash key executableBitDelta
+ and toggle the executable bit.
+ * Scripts/svn-unapply: Ditto.
+
+2010-04-30 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Enabled accelerated compositing in DRT for Windows
+ https://bugs.webkit.org/show_bug.cgi?id=38404
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+
+2010-04-30 Anders Carlsson <andersca@apple.com>
+
+ Try to fix GTK+ build.
+
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_stream):
+
+2010-04-30 Anders Carlsson <andersca@apple.com>
+
+ Fix build.
+
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+
+2010-04-30 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Timothy Hatcher.
+
+ Next step towards fixing
+
+ https://bugs.webkit.org/show_bug.cgi?id=20784
+ move npapi.h to C99 integer types
+
+ Use the C99 types everywhere. The "old" types are still around but will be removed
+ in a subsequent commit.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (int32VariantToIdentifier):
+ (doubleVariantToIdentifier):
+ (testIdentifierToInt):
+ (testGetIntIdentifier):
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New):
+ (NPP_NewStream):
+ (NPP_WriteReady):
+ (NPP_Write):
+ (NPP_HandleEvent):
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_New):
+ (NPP_NewStream):
+ (NPP_WriteReady):
+ (NPP_Write):
+ (NPP_HandleEvent):
+
+2010-04-30 Steve Block <steveblock@google.com>
+
+ Reviewed by Jeremy Orlow.
+
+ Changed Steve Block from committer to reviewer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-28 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch doesn't work if a git repo is tracking multiple svn repos
+ https://bugs.webkit.org/show_bug.cgi?id=38290
+
+ Getting the tests to pass required getting our SVN repo to more closely
+ match the real svn.webkit.org repo by having a trunk directory.
+ That involved adding an extra commit at the beginning and thus changing
+ all the commit numbers in the tests.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+
+2010-04-29 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests can deadlock with Chromium's TestShell
+ https://bugs.webkit.org/show_bug.cgi?id=38298
+
+ Fix _write_command_and_read_line to never send unicode() to
+ test_shell, instead to always encode as utf-8. This was causing
+ random hangs because if test_shell ever encounters a \0 in the
+ stream it can deadlock with NRWT.
+
+ There is still a deadlock bug to fix in NRWT/test_shell design, however
+ this fix should make the deadlock occur less often.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
+
+2010-04-29 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Refactored svn-apply and svn-unapply to use the new
+ parsePatch() subroutine.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34033
+
+ * Scripts/VCSUtils.pm:
+ - Consolidated %diffHash documentation.
+ - Added prepareParsedPatch().
+
+ * Scripts/svn-apply:
+ - Replaced main while loop with calls to parsePatch() and
+ prepareParsedPatch().
+
+ * Scripts/svn-unapply:
+ - Replaced main while loop with calls to parsePatch() and
+ prepareParsedPatch().
+
+ * Scripts/test-webkitperl:
+ - Changed to render relative test paths rather than absolute
+ test paths.
+
+ * Scripts/webkitperl/VCSUtils_unittest/prepareParsedPatch.pl: Added.
+ - Added unit tests for prepareParsedPatch().
+
+2010-04-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Added to VCSUtils's parseDiffHeader() support for binary patches.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38094
+
+ The parseDiffHeader() function is part of new patch-parsing code
+ for svn-apply and svn-unapply that will go live in a subsequent
+ revision.
+
+ * Scripts/VCSUtils.pm:
+ - Added logic to parseDiffHeader() to recognize the ending of
+ the header portion of a binary diff.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
+ - Added unit test cases for SVN and Git binary diffs.
+
+2010-04-28 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ Document that subprocess.poll/wait are not threadsafe
+ https://bugs.webkit.org/show_bug.cgi?id=38289
+
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ * Scripts/webkitpy/layout_tests/port/server_process.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-04-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Daniel Bates.
+
+ Removed the dividing line (i.e. "====...") logic from the code
+ called by svn-apply and svn-unapply.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38093
+
+ The dividing line logic is unnecessary. Removing it simplifies the
+ code and makes some subsequent changes easier.
+
+ * Scripts/VCSUtils.pm:
+ - Removed the logic in gitdiff2svndiff() to convert the git
+ "index" line to an SVN dividing line.
+ - Adjusted the logic similarly in parseDiffHeader().
+
+ * Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl:
+ - Updated the unit tests as necessary.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl:
+ - Updated the unit tests as necessary.
+ - Corrected an error in the unit tests whereby all elements
+ of an array were referencing the same element rather than
+ distinct elements -- causing unit test failures to be masked.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
+ - Updated the unit tests as necessary.
+ - Made the same unit test correction as above for parseDiff.pl.
+
+2010-04-28 Evan Stade <estade@chromium.org>
+
+ Unreviewed.
+
+ * Scripts/webkitpy/common/config/committers.py: adding myself as a committer
+
+2010-04-28 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Add MiniBrowser to the lists of modules to build and only build it on
+ SnowLeopard and later.
+
+ * Makefile:
+ * MiniBrowser/Makefile:
+
+2010-04-28 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Make running MiniBrowser.app without explicitly setting DYLD_FRAMEWORK_PATH.
+
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/mac/make-launchable.sh: Added.
+
+2010-04-28 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ Audit all uses of subprocess in webkitpy
+ https://bugs.webkit.org/show_bug.cgi?id=38284
+
+ After further discussions with Jeffrey Yasskin
+ about http://bugs.python.org/issue2320
+ and related issues of using subprocess from
+ multiple threads, I have learned that subprocess
+ is known to be non-threadsafe through recent
+ Python 2.7 builds.
+
+ I'm attempting to lessen our exposure to these
+ subprocess bugs by auditing each use of subprocess
+ in webkitpy. I did not find any unsafe calls
+ in my audit, but I did remove numerous unneeded
+ import subprocess lines.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/system/deprecated_logging_unittest.py:
+ * Scripts/webkitpy/common/system/user.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py: Added.
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/gtk.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/win.py:
+
+2010-04-28 Darin Adler <darin@apple.com>
+
+ Ignore a directory the Python tools creates.
+
+ * Scripts/webkitpy/style: Modified property svn:ignore.
+
+2010-04-28 Darin Adler <darin@apple.com>
+
+ * Scripts/extract-localizable-strings: Fix minor mistake in
+ argument checking.
+
+2010-04-28 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QWebPage viewMode property
+ https://bugs.webkit.org/show_bug.cgi?id=38119
+
+ Replacing method qt_wrt_setViewMode by wrt_viewMode property.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setViewModeMediaFeature):
+
+2010-04-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Adjusted check-webkit-style so that files with file type NONE
+ are automatically skipped without warning.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38197
+
+ This change simplifies configuring which files to skip. It also
+ addresses an issue whereby check-webkit-style was unintentionally
+ checking .vcproj files for carriage returns.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Moved the C++, Python, and text file extensions to new
+ module-level configuration variables.
+ - Removed .pyc from the _SKIPPED_FILES_WITHOUT_WARNING configuration
+ variable.
+ - Changed the numeric values of the FileType enum so that
+ FileType.NONE evaluates to False.
+ - For ProcessorDispatcher.should_skip_without_warning():
+ - Changed the method to return True for FileType.NONE files.
+ - Made ChangeLog files an exception to getting skipped.
+ - Changed the StyleProcessor.process() method to raise an
+ exception if given a file path that should not be processed.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated the unit tests and added more test cases as necessary.
+
+2010-04-28 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Jeremy Orlow.
+
+ webkitpy: ScriptError('Failed to run "[u\'taskkill.exe\', u\'/f\', u\'/im\', u\'httpd.exe\']" exit_code: 128',)
+ https://bugs.webkit.org/show_bug.cgi?id=38248
+
+ The previous code did not check the return code of taskkill.
+ When I moved that callsite from using subprocess.call to
+ Executive.run_command having a non-zero return code became an error.
+
+ In this change I've centralized our killall handling in executive,
+ and added tests for it to make sure it works.
+
+ Currently kill_process and kill_all swallow exceptions in the cases
+ where the process(es) to be killed do(es) not exist.
+
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/gtk.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ * Scripts/webkitpy/layout_tests/port/win.py:
+
+2010-04-28 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ wdiff_text throws ScriptError because wdiff returns non-zero when files differ
+ https://bugs.webkit.org/show_bug.cgi?id=38246
+
+ wdiff returns 0 when files are the same, 1 when they differ.
+ run_command by default raises ScriptError if the return code is non-zero.
+ Fixed this by adding a custom error handler which only raises if the
+ return code is not 1.
+
+ I broke up the huge wdiff_text() method into little pieces
+ for easier unit testing. There is only one functional change here
+ and that is the addition of the custom error handler.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py:
+
+2010-04-28 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed build fix.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::dumpImage): format '%u' expects type 'unsigned int', but argument 2 has type 'size_t'.
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::willSendRequest): too few arguments for format.
+
+2010-04-27 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler and Eric Seidel.
+
+ Add layoutTestController.setPrinting()
+ https://bugs.webkit.org/show_bug.cgi?id=37203
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (setPrintingCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::isPrinting):
+ (LayoutTestController::setIsPrinting):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (dump):
+
+2010-04-27 Michael Nordman <michaeln@google.com>
+
+ Reviewed by Dmitry Titov.
+
+ [Chromium] Add two things to the webkit API to support appcaches in workers.
+ 1) WebURLRequest TargetTypes for worker and shared worker main resources.
+ 2) Factory method on class WebCommonWorkerClient to
+ createApplicationCacheHost() for the associated worker.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38147
+
+ * DumpRenderTree/chromium/TestWebWorker.h add a stub impl of the factory method
+ (TestWebWorker::createApplicationCacheHost):
+
+2010-04-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ run-bindings-tests doesn't work in an SVN checkout
+ https://bugs.webkit.org/show_bug.cgi?id=38225
+
+ Previously detect_scm_system needed an absolute path for SVN. Now we
+ accept a relative path.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+
+2010-04-27 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Stephanie Lewis.
+
+ Always build WebKit2 when building on SnowLeopard and later.
+
+ * Scripts/build-webkit:
+
+2010-04-27 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=38238
+ Allow both WebKit and WebKit2 to link to the same WebCore.framework
+
+ * Scripts/build-webkit: Remove the UMBRELLA_LDFLAGS override when building
+ WebCore for WebKit2, it is no longer necessary.
+
+2010-04-27 James Robinson <jamesr@chromium.org>
+
+ Reviewed by David Levin.
+
+ Fix a typo in chromium.py that causes NRWT to fail in --verbose
+ mode in a Chromium checkout.
+ https://bugs.webkit.org/show_bug.cgi?id=38234
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-27 Darin Fisher <darin@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] Remove deprecated form of didChangeLocationWithinPage
+ https://bugs.webkit.org/show_bug.cgi?id=38178
+
+ Switch over to implementing didNavigateWithinPage.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (TestWebViewDelegate::didNavigateWithinPage):
+ (WebViewHost::didChangeLocationWithinPage):
+ * DumpRenderTree/chromium/WebViewHost.h:
+
+2010-04-27 Evan Martin <evan@chromium.org>
+
+ Unreviewed.
+
+ Adding myself to commmitters list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ run-bindings-tests should use --reset-results instead of --overwrite
+ https://bugs.webkit.org/show_bug.cgi?id=38200
+
+ As requested by Ojan.
+
+ * Scripts/run-bindings-tests:
+
+2010-04-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ REGRESSION(r58261): webkit-patch edit-changelogs is broken
+ https://bugs.webkit.org/show_bug.cgi?id=38204
+
+ In 58261, we added code to abstract step that interrogates the squash
+ and git_commit options, but it doesn't declare that it uses those
+ options. That means any command that doesn't happen to declare those
+ options might be broken if it uses the cached_lookup mechanism.
+
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/applypatch.py:
+ * Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py:
+ * Scripts/webkitpy/tool/steps/build.py:
+ * Scripts/webkitpy/tool/steps/checkstyle.py:
+ * Scripts/webkitpy/tool/steps/cleanworkingdirectory.py:
+ * Scripts/webkitpy/tool/steps/closebug.py:
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff.py:
+ * Scripts/webkitpy/tool/steps/commit.py:
+ * Scripts/webkitpy/tool/steps/confirmdiff.py:
+ * Scripts/webkitpy/tool/steps/createbug.py:
+ * Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py:
+ * Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py:
+ * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+ * Scripts/webkitpy/tool/steps/postcodereview.py:
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ * Scripts/webkitpy/tool/steps/update.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+
+2010-04-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ prepare-ChangeLog --bug fails on some CYGWIN installs due to missing certs
+ https://bugs.webkit.org/show_bug.cgi?id=38212
+
+ * Scripts/prepare-ChangeLog:
+ - Pass --insecure to curl to work around CYGWIN missing certs.
+
+2010-04-27 Sam Weinig <sam@webkit.org>
+
+ Rubber-stamped by Beth Dakin.
+
+ It is no longer necessary to set ENABLE_EXPERIMENTAL_SINGLE_VIEW_MODE
+ or WTF_USE_WEB_THREAD. Remove them.
+
+ * Scripts/build-webkit:
+
+2010-04-27 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by David Levin.
+
+ Changed Chris Jerdonek from committer to reviewer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-27 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QGraphicsWebView: Arrow keys scroll the graphics-view instead of the web-page
+ https://bugs.webkit.org/show_bug.cgi?id=35834
+
+ The scene should always have the size of the web view otherwhise it is
+ possible to scroll the graphics view.
+
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::resizeEvent):
+
+2010-04-27 Diego Gonzalez <diegohcg@webkit.org>
+
+ Unreviewed.
+
+ Adding myself to committers.py
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ [chromium] new-run-webkit-tests hangs on Chromium Bots (OS X and Linux)
+ https://bugs.webkit.org/show_bug.cgi?id=37987
+
+ After further research, I believe the hang is caused by:
+ http://bugs.python.org/issue2320
+ Basically Popen() is not reentrant.
+ The workaround is to pass close_fds=True to Popen() on Mac/Linux.
+
+ I fixed our main Popen wrapper "Executive.run_command" to use close_fds=True
+ when appropriate.
+
+ I audited all places we call Popen() and either moved them to run_command
+ or left a FIXME that they are not thread safe. A few places I added the
+ close_fds workaround there and left an explanitory note.
+
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ - Added note that this Popen use is not threadsafe.
+ * Scripts/webkitpy/common/system/executive.py:
+ - Fixed our Executive.run_* to workaround python bug 2320.
+ * Scripts/webkitpy/common/system/user.py:
+ _ Added note that this Popen use is not threadsafe.
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - Change wdiff back to using run_command now that we believe it
+ to be threadsafe.
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - Fix to use Executive in places.
+ - Pass self._executive down to the Driver for easier unit testing.
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ - Re-factor to use a _kill_all method.
+ - Made the _kill_all method use run_command to be threadsafe.
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ - Add FIXME about using Executive.
+ * Scripts/webkitpy/layout_tests/port/server_process.py:
+ - Use Executive to be threadsafe.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - Pass self._executive down to the Driver.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ - Add note about Popen not being threadsafe.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ - Move one caller to run_command add notes about moving others.
+
+2010-04-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ REGRESSION(r58261): webkit-patch upload does not work in an SVN checkout.
+ https://bugs.webkit.org/show_bug.cgi?id=38186
+
+ Unfortunately, we don't have a good way of testing this change because
+ our test coverage of the scm.py API is poor...
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+
+2010-04-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Remove unused code from text_diff.py
+ https://bugs.webkit.org/show_bug.cgi?id=38170
+
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ - Remove is_render_tree_dump which appears unused.
+
+2010-04-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch pretty-diff is broken
+ https://bugs.webkit.org/show_bug.cgi?id=38172
+
+ We need to register for these options because they're used when we look
+ up the diff.
+
+ * Scripts/webkitpy/tool/steps/confirmdiff.py:
+
+2010-04-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add ObjC and GObject to run-bindings-test
+ https://bugs.webkit.org/show_bug.cgi?id=38168
+
+ * Scripts/run-bindings-tests:
+
+2010-04-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add testing infrastructure for JSC bindings generator
+ https://bugs.webkit.org/show_bug.cgi?id=38167
+
+ Add support for testing more than one bindings. Also, converted the
+ script to PEP8 style.
+
+ * Scripts/run-bindings-tests:
+
+2010-04-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Refactor results.html generation out into a new method and test it
+ https://bugs.webkit.org/show_bug.cgi?id=38164
+
+ Hopefully this results in no change in functionality.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-04-26 Adam Barth <abarth@webkit.org>
+
+ Unreviewed, rolling out r58265.
+ http://trac.webkit.org/changeset/58265
+ https://bugs.webkit.org/show_bug.cgi?id=38021
+
+ This change prevents me from uploading patches. It also breaks sheriff-bot.
+
+ * Scripts/webkitpy/tool/steps/options.py:
+
+2010-04-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ [chromium] new-run-webkit-tests hangs on Chromium Bots (OS X and Linux)
+ https://bugs.webkit.org/show_bug.cgi?id=37987
+
+ Rolled out:
+ http://trac.webkit.org/changeset/58062
+ http://trac.webkit.org/changeset/58060
+ http://trac.webkit.org/changeset/58059
+ http://trac.webkit.org/changeset/58055
+ http://trac.webkit.org/changeset/58054
+ and parts of:
+ http://trac.webkit.org/changeset/58050
+
+ I also wrote some new comments and a tiny amount of new
+ code to help make ChromiumDriver.run_test easier to read.
+
+ In order to unit-test my new code, I had to change ChromiumDriver
+ to not automatically start itself when created. That ended up
+ being a lot of plumbing, but is hopefully easier to understand now.
+
+ There are no tests for the (restored) wdiff code. wdiff does not
+ exist on all systems, so for now we will assume it worked since
+ it is just old code being reverted.
+
+ * Scripts/webkitpy/layout_tests/driver_test.py:
+ - Use create_driver instead of start_driver, and be sure to call .stop()
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - Use create_driver instead of start_driver
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - Added a comment to explain that diffs are binary files.
+ - Various patch reverts relating to wdiff
+ - Add Driver._command_wrapper to share code between WebKitDriver and ChromiumDriver.
+ - Made _command_wrapper use shlex.split to get rid of the FIXME.
+ * Scripts/webkitpy/layout_tests/port/base_unittest.py: Added.
+ - test the new _command_wrapper
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - Use _command_wrapper to get rid of a bunch of ugly code.
+ - Make __init__ stop auto-starting.
+ - Rename create_driver to start_driver.
+ - Added _write_command_and_read_line to make it possible to
+ put a FIXME next to read_line() w/o having to put it in two places.
+ - Moved test_shell command building into _test_shell_command and tested it.
+ - Fix comments to say test_shell since ChromiumDriver is test_shell only.
+ * Scripts/webkitpy/layout_tests/port/chromium_unittest.py: Added.
+ - Test the new test_shell_command method.
+ * Scripts/webkitpy/layout_tests/port/dryrun.py:
+ - Rename create_driver to start_driver.
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ - Rename create_driver to start_driver.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - Rename create_driver to start_driver.
+ - Treat output as binary arrays.
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ - Treat diff files as binary.
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ - Treat diff files as binary.
+
+2010-04-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move bindings test directory into the scripts directory
+ https://bugs.webkit.org/show_bug.cgi?id=38161
+
+ Change script to point to the new location of these data files.
+
+ * Scripts/run-bindings-tests:
+
+2010-04-26 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Mark run-bindings-tests executable so we can execute it.
+
+ * Scripts/run-bindings-tests:
+
+2010-04-26 Tony Chang <tony@chromium.org>
+
+ Reviewed by David Levin.
+
+ [chromium] build-webkit --chromium should build release by default
+ https://bugs.webkit.org/show_bug.cgi?id=38028
+
+ * Scripts/build-dumprendertree: Also should build release by default
+ * Scripts/build-webkit: Make sure to pass command line args through
+ * Scripts/webkitdirs.pm: Build the right configuration
+
+2010-04-26 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ complete rietveld bugzilla integration
+ https://bugs.webkit.org/show_bug.cgi?id=38021
+
+ Makes --fancy-review the default. All this means is that the patch will
+ be uploaded to rietveld in addition to bugs.webkit.org.
+
+ * Scripts/webkitpy/tool/steps/options.py:
+
+2010-04-26 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ For check-webkit-style, renamed the style/processors/ directory
+ to style/checkers/.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38122
+
+ * Scripts/webkitpy/style/checker.py:
+ - Updated import statements.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated import statements.
+
+ * Scripts/webkitpy/style/checkers: Copied from WebKitTools/Scripts/webkitpy/style/processors.
+ * Scripts/webkitpy/style/processors: Removed.
+ * Scripts/webkitpy/style/processors/__init__.py: Removed.
+ * Scripts/webkitpy/style/processors/common.py: Removed.
+ * Scripts/webkitpy/style/processors/common_unittest.py: Removed.
+ * Scripts/webkitpy/style/processors/cpp.py: Removed.
+ * Scripts/webkitpy/style/processors/cpp_unittest.py: Removed.
+ * Scripts/webkitpy/style/processors/python.py: Removed.
+ * Scripts/webkitpy/style/processors/python_unittest.py: Removed.
+ * Scripts/webkitpy/style/processors/python_unittest_input.py: Removed.
+ * Scripts/webkitpy/style/processors/text.py: Removed.
+ * Scripts/webkitpy/style/processors/text_unittest.py: Removed.
+
+2010-04-06 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Include git commits in the diff for webkit-patch upload/land.
+ https://bugs.webkit.org/show_bug.cgi?id=36394
+
+ Adds --squash, --no-squash and --git-commit.
+
+ --git-commit will use a specific local commit for land/upload.
+ If a commit-range is specified, then that range is treated as
+ a single squashed commit.
+
+ --squash will squash all local changes including working copy changes
+ into a single patch.
+
+ --no-squash is the legacy behavior (upload only considers the working copy,
+ land commits the working copy and then each local commit separately to SVN)
+
+ If neither is specified, then an informative error is raised if there is
+ more than one local commit or when there are local commit(s) and working
+ copy changes.
+
+ If the webkit-patch.squash git config parameter is set, then
+ that will be respected instead of raising an error.
+
+ * Scripts/check-webkit-style:
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/style/optparser.py:
+ --git-since is removed and --git-commit no longer implies commit_id..
+ Instead, it treats that individual commit, but also supports commit ranges
+ (e.g. commit_id..) as arguments.
+ * Scripts/webkitpy/style/optparser_unittest.py:
+ * Scripts/webkitpy/style_references.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py:
+ * Scripts/webkitpy/tool/steps/checkstyle.py:
+ * Scripts/webkitpy/tool/steps/commit.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+
+2010-04-26 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Deleted the StyleChecker-related classes that are no longer
+ being used.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38118
+
+ * Scripts/webkitpy/style/checker.py:
+ - Deleted the DeprecatedStyleChecker class.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Deleted the StyleCheckerTest, StyleCheckerCheckFileBase,
+ StyleCheckerCheckFileTest, and StyleCheckerCheckPathsTest classes.
+
+2010-04-26 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Changed the StyleChecker class to use the new TextFileReader class.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37066
+
+ This revision separates the code responsible for reading and iterating
+ over text files from the rest of check-webkit-style.
+
+ * Scripts/check-webkit-style:
+ - Changed the script to use the new StyleProcessor and
+ TextFileReader classes instead of the StyleChecker class.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added a FIXME to rename many of uses of the word "processor" to
+ "checker". We did this to clarify the difference between
+ ProcessorBase instances passed to the TextFileReader and
+ classes that process and check lines for style.
+ - Added a FIXME to remove FileType.NONE as a possible return value
+ of ProcessorDispatcher._file_type(). This will better consolidate
+ the logic of which files should be skipped.
+ - Added a FIXME to delete the StyleChecker class.
+ - Added the StyleProcessor class which implements ProcessorBase.
+ This class is responsible for processing lines to check style
+ (but not for reading files). For each file, this class creates
+ creates both a carriage-return checker and a format-specific
+ style checker (e.g. one of C++, Python, etc).
+ - Updated the PatchChecker class to use a TextFileReader instance
+ instead of a StyleChecker.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Added the StyleProcessor_EndToEndTest class to do "end-to-end"
+ tests of the StyleProcessor class.
+ - Added the StyleProcessor_CodeCoverageTest to test the
+ StyleProcessor class with more complete code coverage.
+ Unlike the StyleProcessor_EndToEndTest class, this class makes
+ heavy use of mock parameters.
+ - Added FIXME's to delete the unit test classes that are no
+ longer needed.
+ - Updated the PatchCheckerTest class to use a MockTextFileReader
+ instead of a MockStyleChecker.
+
+ * Scripts/webkitpy/style/filereader.py:
+ - Updated the TextFileReader class to use the preferred logic
+ of checking file existence at the beginning of the process_file()
+ method instead of in the except block, per
+ https://bugs.webkit.org/show_bug.cgi?id=37122
+
+ * Scripts/webkitpy/style/filereader_unittest.py:
+ - In the TextFileReaderTest class:
+ - Moved the test_process_file__should_not_process() method.
+ - Added a test_process_file__file_stdin() method to test
+ the file path "-".
+
+2010-04-20 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add more support for textInputController
+
+ Add support for selectedRange(), setMarkedText(), insertText(),
+ and firstRectForCharacterRange().
+
+ Unskip tests:
+
+ fast/forms/input-maxlength-ime-preedit.html
+ fast/forms/input-maxlength-ime-completed.html
+ fast/text/international/thai-cursor-position.html
+ fast/events/ime-composition-events-001.html
+ editing/selection/5825350-1.html
+ editing/selection/5825350-2.html
+ editing/selection/mixed-editability-10.html
+
+ https://bugs.webkit.org/show_bug.cgi?id=35702
+
+ * DumpRenderTree/qt/TextInputControllerQt.cpp:
+ (TextInputController::setMarkedText):
+ (TextInputController::insertText):
+ (TextInputController::selectedRange):
+ (TextInputController::firstRectForCharacterRange):
+ * DumpRenderTree/qt/TextInputControllerQt.h:
+
+2010-04-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ check-webkit-style complains about non-utf8 data in layout test result
+ https://bugs.webkit.org/show_bug.cgi?id=38027
+
+ The problem was we were assuming patch files/diff output as utf-8.
+ Turns out they're not. We have to treat them as binary data because
+ a single patch may have multiple text files in it with conflicting encodings!
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ - contents_at_revision returns a byte array, so decode it to unicode
+ before passing it to parse_latest_entry_from_file
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ - Update our mock mock_contents_at_revision to match the encoding
+ semantics of the real one.
+ * Scripts/webkitpy/common/checkout/scm.py:
+ - Be careful not to decode output which may contain file contents
+ (like diff, cat or show) as the encoding for that content is unknown.
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ - Update our tests to use both latin1 and utf-8 encoded data.
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ - _fill_attachment_form should not assume unicode data. Callers
+ may wish to attach other types of files to bugs.
+ * Scripts/webkitpy/common/prettypatch.py:
+ - Diffs are byte arrays, deal with them as such.
+ * Scripts/webkitpy/common/prettypatch_unittest.py:
+ - Test to make sure we handle diffs with multiple conflicting encodings.
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ - Make sure that our unicode support does not break our
+ byte array input support for run_command.
+
+2010-04-23 Sam Weinig <sam@webkit.org>
+
+ Reviewed by David Levin.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=38060
+ Split up Threading.h
+
+ Add necessary forwarding headers.
+
+ * DumpRenderTree/ForwardingHeaders/wtf/Atomics.h: Added.
+ * DumpRenderTree/ForwardingHeaders/wtf/ThreadSafeShared.h: Added.
+ * DumpRenderTree/ForwardingHeaders/wtf/ThreadingPrimitives.h: Added.
+
+2010-04-23 Xiaomei Ji <xji@chromium.org>
+
+ No need to review.
+
+ Add xji as committer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-23 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, add platform stub for new LayoutTestController method.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::markerTextForListItem):
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests: add a "--retry-failures" flag and a
+ "--no-retry-failures" flag (the former is the default). Also, rename
+ "--print-unexpected-results" and "--retry-unexpected-results" to
+ "--print-last-failures" and "--retry-last-failures" because the
+ retry flag was confusing. The new flag names aren't great, but
+ hopefully they're less confusing.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37838
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=38022
+ Move isMainThread predicate function to MainThread.h
+
+ Added forwarding header for MainThread.h
+
+ * DumpRenderTree/ForwardingHeaders/wtf/MainThread.h: Added.
+
+2010-04-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Disable Netscape plugin support for minimal configuration
+ https://bugs.webkit.org/show_bug.cgi?id=38026
+
+ Pass the minimal configuration option to Qt build system
+ as part of the CONFIG variable.
+
+ * Scripts/build-webkit:
+
+2010-04-22 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed fix.
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: fix NameError: global name 'f' is not defined.
+
+2010-04-22 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Revert 58077 and follow-ups. It's broken.
+ https://bugs.webkit.org/show_bug.cgi?id=37664
+
+ * Scripts/new-run-webkit-httpd:
+ * Scripts/new-run-webkit-websocketserver:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-04-22 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Integrate v8 testing utility with webkit tests
+ https://bugs.webkit.org/show_bug.cgi?id=37731
+
+ * Scripts/run-bindings-tests: Added.
+
+2010-04-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ new-run-webkit-tests --verbose shows ever-increasing #EOF lines
+ https://bugs.webkit.org/show_bug.cgi?id=37794
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - Remove the assert() since our ServerProcess code does not always
+ seem to be reading the full stderr output (or we're not waiting for it to).
+
+2010-04-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add code to help debug new-run-webkit-test hangs on the Chromium bots
+ https://bugs.webkit.org/show_bug.cgi?id=38011
+
+ I can see no reasonable way to test this change.
+ Stubbing out sys._current_frames() and traceback.extract_stack
+ seems folly. Dumping real data would have line number
+ (and possibly other call stack) variance between runs.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - Add _dump_thread_states and _dump_thread_states_if_necessary
+ to have our main thread dump the states of all threads every
+ 60 seconds when running in verbose mode.
+ - Better document what is going on in our main loop.
+
+2010-04-22 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=38002
+ Add rudimentary statistics gathering for WebKit2
+
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/mac/AppDelegate.h:
+ * MiniBrowser/mac/AppDelegate.m:
+ (-[BrowserAppDelegate init]):
+ (-[BrowserAppDelegate newWindow:]):
+ (-[BrowserAppDelegate getCurrentPageNamespace]):
+ (-[BrowserAppDelegate _setProcessModel:]):
+ (-[BrowserAppDelegate showStatisticsWindow:]):
+ (-[BrowserAppDelegate applicationWillTerminate:]):
+ * MiniBrowser/mac/BrowserStatisticsWindow.xib: Added.
+ * MiniBrowser/mac/BrowserStatisticsWindowController.h: Added.
+ * MiniBrowser/mac/BrowserStatisticsWindowController.m: Added.
+ (-[BrowserStatisticsWindowController initWithThreadedWKContextRef:processWKContextRef:]):
+ (-[BrowserStatisticsWindowController dealloc]):
+ (-[BrowserStatisticsWindowController windowDidLoad]):
+ (-[BrowserStatisticsWindowController refreshStatistics:]):
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/English.lproj/MainMenu.xib:
+ * MiniBrowser/mac/MiniBrowser_Prefix.pch:
+
+2010-04-22 Dave Moore <davemoore@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Add test support for icon changes.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33812
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (dumpIconChangesCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::dumpIconChanges):
+ (LayoutTestController::setDumpIconChanges):
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ (FrameLoadDelegate::didChangeIcons):
+ * DumpRenderTree/win/FrameLoadDelegate.h:
+ * WinLauncher/WinLauncher.h:
+ (WinLauncherWebHost::didChangeIcons):
+
+2010-04-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Script fix. Will ask dpranke to look tomorrow.
+
+ new-run-webkit-tests --verbose shows ever-increasing #EOF lines
+ https://bugs.webkit.org/show_bug.cgi?id=37794
+
+ The bots are seeing cases where .error is sometimes empty.
+ Lets make the code not crash in that case for now.
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-22 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed fix.
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: fix NameError: global name 'f' is not defined.
+
+2010-04-22 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed fix.
+
+ * Scripts/new-run-webkit-websocketserver: PyWebSocket no longer takes keyword argument 'register_cygwin'.
+
+2010-04-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Restore the Leopard bots to using
+ old-run-webkit-tests for now.
+
+ * Scripts/run-webkit-tests:
+
+2010-04-22 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed fix.
+
+ * Scripts/webkitpy/layout_tests/port/http_server.py: fix NameError: global name 'env' is not defined.
+
+2010-04-22 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed fix.
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: fix NameError: global name 'env' is not defined.
+
+2010-04-22 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Chromium: Add --chromium option to new-run-webkit-websocketserver
+ https://bugs.webkit.org/show_bug.cgi?id=37664
+
+ Move cygwin setup logic in chromium_win.py.
+
+ * Scripts/new-run-webkit-httpd: remove register_cygwin parameter to pass http_server.
+ * Scripts/new-run-webkit-websocketserver: add --chromium flag
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py: setup for cygwin
+ * Scripts/webkitpy/layout_tests/port/http_server.py: remove cygwin setup logic
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: remove cygwin setup logic
+
+2010-04-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests --verbose shows ever-increasing #EOF lines
+ https://bugs.webkit.org/show_bug.cgi?id=37794
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - Fix the log message to explain that this is stderr output, not test output.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - Be sure to reset the server_process.error after reading (seems like the wrong
+ place to do this, but at least this fixes the bug and dpranke and I can talk
+ about better designs later).
+ - Also remove the #EOF from the stderr output before returning it.
+
+2010-04-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Fixing new-run-webkit-tests on the bots.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - Fixing _compat_shim_option to take variable keyword args.
+ - Turns out that nargs + callback is ignored unless type is specified.
+ So I added the type so that the option was properly consumed.
+ This was why new-run-webkit-tests couldn't find any tests, it
+ was looking for them under "20" because that was the argument
+ which should have been consumed by --exit-after-n-failures.
+
+2010-04-22 Tony Chang <tony@chromium.org>
+
+ Not reviewed, build fix for chromium Windows.
+
+ [chromium] fix ImageDiff compile on windows
+ https://bugs.webkit.org/show_bug.cgi?id=37979
+
+ * DumpRenderTree/chromium/ImageDiff.cpp:
+
+2010-04-22 Adam Barth <abarth@webkit.org>
+
+ Unreviewed, rolling out r58069.
+ http://trac.webkit.org/changeset/58069
+ https://bugs.webkit.org/show_bug.cgi?id=27751
+
+ Broke compile on Windows.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+
+2010-04-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Just adding logging.
+
+ Adding logging to help debug why the Leopard Bot
+ can't find any tests to run.
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - Make it a fatal error to have no tests to run.
+
+2010-04-22 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add support for controlling clipboard access from javascript.
+ Clipboard access from javascript is enabled in test framework.
+ https://bugs.webkit.org/show_bug.cgi?id=27751
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setJavaScriptCanAccessClipboardCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::resetWebSettings):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setJavaScriptCanAccessClipboard):
+
+2010-04-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch can't fetch attachments on security bugs
+ https://bugs.webkit.org/show_bug.cgi?id=37975
+
+ Instead of calling CURL, we just need to use our Mechanize object,
+ which understand bugs.webkit.org authentication.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Temporary commit, will roll-out before morning.
+
+ Turning on new-run-webkit-tests for the Leopard build bot
+ for testing of the harness.
+ Users should not noctice (except for the results.html difference).
+
+ * Scripts/run-webkit-tests:
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Fix typo in my previous fix attempt.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ More on-the-bot debugging, sigh. I wish I had a local build.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Fix typo in my previous fix attempt.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - Add self. to class variable access.
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Another attempt to fix NRWT for chromium.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - wdiff_text was returning a byte array instead of a
+ unicode string. The simple fix was to just decode
+ the result. However, seeing so much duplicated code
+ with Executive made me cry, so I re-wrote the function
+ to be more like pretty_patch_text and use run_command
+ (which already knows how to handle unicode).
+
+2010-04-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Windows tests buildbots are too slow to be core builders
+ https://bugs.webkit.org/show_bug.cgi?id=37970
+
+ It's 10:45. The Windows test bots are still hours behind. They're too
+ slow to be core builders. When they get fast, we can add them back.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Attempt one more time to fix NRWT for chromium.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ I'm debugging in the blind because I don't have a chromium
+ build on this laptop.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - Apply the previous fix to a second caller.
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Attempt one more time to fix NRWT for chromium.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - Fix handling of test_shell output so that we always
+ decode it as utf-8.
+ Unlike DumpRenderTree test_shell does not ever return
+ pixel data. It spits out the pixel dumps in a separate
+ file, thus all output over stdout is utf-8 text.
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Attempt one more time to fix NRWT for chromium.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ - Pass encoding to _save_baseline_data and write_output_files
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ - Make _save_baseline_data and write_output_files take an encoding.
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ - Pass encoding to _save_baseline_data and write_output_files
+
+2010-04-21 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QtLauncher: make FPS measurement accurate
+ https://bugs.webkit.org/show_bug.cgi?id=37934
+
+ Instead of counting paints, which are not interchangeable with frames that
+ the user sees, we now set an arbitrary timer for FPS measurements. The idea is
+ that if the main thread is delayed for any reason, that timer would be delayed
+ as well.
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/fpstimer.cpp: Added.
+ (FpsTimer::FpsTimer):
+ (FpsTimer::numFrames):
+ (FpsTimer::start):
+ (FpsTimer::stop):
+ (FpsTimer::timerEvent):
+ * QtLauncher/fpstimer.h: Added.
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+ (WebViewGraphicsBased::updateFrameRate):
+ (WebViewGraphicsBased::paintEvent):
+ * QtLauncher/webview.h:
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, just adding missing ":" in python file.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ new-run-webkit-tests --chromium was borked.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ Third time is the charm. I've fixed all the
+ new-run-webkit-tests regressions from previous attempts.
+
+ I fixed the queue to not ignore Tor as a reviwer in r57531,
+ but instead it throws an exception every time his name is in a patch.
+
+ This fixes our Executive.run_command code to work around a Popen
+ bug http://bugs.python.org/issue5290 whereby python versions before 2.6
+ do not correctly handle unicode objects as input or output to
+ Popen.communicate.
+
+ Following the advice of:
+ http://farmdev.com/talks/unicode/
+ I have changed all of webkitpy to use unicode() objects as strings
+ instead of str objects (which in Python 3 are renamed "bytes").
+
+ String literals were left as "foo" instead of converting to u"foo"
+ as u"foo" is only required if the string has a non-ascii code point.
+ Python is smart about comparing str() and unicode() values and will
+ log an error to the console if the comparison is ever invalid.
+
+ Executive.run* now correctly accept and return unicode() objects.
+ I attempted to fix all the places that we call .write() to make sure we
+ encode any unicode() objects into utf-8.
+
+ I removed several uses of StringIO. StringIO should generally always be
+ passed a unicode() value.
+
+ Likewise I replaced most calls to open() with codecs.open().
+ codecs.open() matches Python 3 open semantics in requiring an encoding
+ parameter. Files opened with codecs.open() with a unicode-compatible
+ encoding will vend unicode() objects from their read() calls, like how
+ StringIO created with a unicode() object will do.
+
+ I also deployed "with" statements wider (now that the project has
+ settled on Python 2.5) to close a bunch of file descriptor leaks.
+
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ - Read/write utf-8 files instead of ascii.
+ - Update the tests to use test for proper unicode() handling.
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ - Document that parse_latest_entry_from_file expects
+ file-like objects which return unicode strings.
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+ - Use unicode() strings instead of str() byte arrays.
+ - Deploy "with" to close file descriptor leaks.
+ * Scripts/webkitpy/common/checkout/commitinfo.py:
+ - Remove unneeded import.
+ * Scripts/webkitpy/common/checkout/scm.py:
+ - Remove use of str().
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ - Read/write utf-8 files and use unicode() strings in testing.
+ * Scripts/webkitpy/common/config/committers.py:
+ - Use \u instead of \x to make slightly clearer what we're doing.
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ - Add a new _string_contents() method and explain why
+ we have to call unicode() on the result of soup.string
+ and why it's safe to do so w/o needing to pass a codec name.
+ - Remove the (unused) support for passing a file object to add_patch_to_bug().
+ * Scripts/webkitpy/common/net/buildbot.py:
+ - Use unicode() instead of str() when needing to coax a
+ NavigableString object into a unicode() object.
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ - Add a test which contains a unicode builder name.
+ * Scripts/webkitpy/common/net/statusserver.py:
+ - Remove use of str()
+ * Scripts/webkitpy/common/prettypatch.py:
+ - Write out the patch file as utf-8.
+ * Scripts/webkitpy/common/system/autoinstall.py:
+ - Write out files with a explicit encodings.
+ - Deploy "with" to close file descriptor leaks.
+ * Scripts/webkitpy/common/system/deprecated_logging.py:
+ - Write out log files as utf-8.
+ * Scripts/webkitpy/common/system/executive.py:
+ - Make run* properly take and return unicode() objects.
+ - Cleaned up input handling in run_command a little by adding
+ a _compute_input() method which can return early instead of having
+ such a long/cluttered if-block.
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ - Added a unit test to make sure we don't break Tor again!
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - Write out the test list as utf-8.
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ - Write out json files as utf-8.
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+ - Deploy "with" to close file descriptor leaks.
+ * Scripts/webkitpy/layout_tests/port/chromium.py: Add Executive.py FIXME.
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/gtk.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/mac.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+ - Make the skipped file parsing test unicode.
+ * Scripts/webkitpy/layout_tests/port/qt.py: Add Executive.py FIXME.
+ * Scripts/webkitpy/layout_tests/port/server_process.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - Deploy "with" to close file descriptor leaks.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ - Make explicit the encodings of log files and pid files.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ - Make encodings explicit and deploy "with".
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py: ditto.
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py: ditto.
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py: ditto.
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py: ditto.
+ * Scripts/webkitpy/style/filereader_unittest.py: ditto.
+ * Scripts/webkitpy/thirdparty/__init__.py: ditto.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ - Removed extra import.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ - No need to map args to strings now that run_command does.
+ - Update test results to match args changes.
+ - Document our global argument hacks.
+ * Scripts/webkitpy/tool/commands/upload.py:
+ - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Rename add_patch_to_bug argument to match bugzilla.py
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ - Executive.run_* now require lists instead of strings.
+ The lack of this change was what broke webkit-patch
+ for svn users the first time this was landed.
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+ - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+ * Scripts/webkitpy/tool/steps/postdiffforcommit.py: ditto
+ * Scripts/webkitpy/tool/steps/postdiffforrevert.py: ditto
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ - Fixed spurious logging seen when running test-webkitpy
+
+2010-04-21 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ aria-liveregion-notifications.html fails on leopard release bot
+ https://bugs.webkit.org/show_bug.cgi?id=37112
+
+ Change the way that notifications are listened for by forcing clients
+ to call a remove listener as well to match the add listener. DRT will
+ assert if those are not done in the correct order.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (removeNotificationListenerCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::removeNotificationListener):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (-[AccessibilityNotificationHandler initWithPlatformElement:]):
+ (-[AccessibilityNotificationHandler dealloc]):
+ (-[AccessibilityNotificationHandler _notificationReceived:]):
+ (-[AccessibilityNotificationHandler setCallback:]):
+ (AccessibilityUIElement::AccessibilityUIElement):
+ (AccessibilityUIElement::~AccessibilityUIElement):
+ (AccessibilityUIElement::addNotificationListener):
+ (AccessibilityUIElement::removeNotificationListener):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::removeNotificationListener):
+
+2010-04-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add debug menu items to show/hide the Web View.
+ https://bugs.webkit.org/show_bug.cgi?id=37958
+
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController showHideWebView:]):
+ (-[BrowserWindowController removeReinsertWebView:]):
+ (-[BrowserWindowController validateMenuItem:]):
+ * MiniBrowser/mac/English.lproj/MainMenu.xib:
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Rolling out unicode() changes as they broke NRWT for chromium.
+ Rolling out:
+ http://trac.webkit.org/changeset/58014
+ http://trac.webkit.org/changeset/58016
+ http://trac.webkit.org/changeset/58020
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbo
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+ * Scripts/webkitpy/common/checkout/commitinfo.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/common/config/committers.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ * Scripts/webkitpy/common/net/statusserver.py:
+ * Scripts/webkitpy/common/prettypatch.py:
+ * Scripts/webkitpy/common/system/autoinstall.py:
+ * Scripts/webkitpy/common/system/deprecated_logging.py:
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/gtk.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ * Scripts/webkitpy/layout_tests/port/server_process.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ * Scripts/webkitpy/style/filereader_unittest.py:
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+ * Scripts/webkitpy/tool/steps/postdiffforcommit.py:
+ * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, fixing NRWT for real this time.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ - Add a hack to fix new-run-webkit-tests
+ my understanding of codecs.open(encoding=None)
+ must have been wrong.
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, just fixing exception seen on builders.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ - Pass and encoding to _write_into_file_at_path
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ I fixed the queue to not ignore Tor as a reviwer in r57531,
+ but instead it throws an exception every time his name is in a patch.
+
+ This fixes our Executive.run_command code to work around a Popen
+ bug http://bugs.python.org/issue5290 whereby python versions before 2.6
+ do not correctly handle unicode objects as input or output to
+ Popen.communicate.
+
+ Following the advice of:
+ http://farmdev.com/talks/unicode/
+ I have changed all of webkitpy to use unicode() objects as strings
+ instead of str objects (which in Python 3 are renamed "bytes").
+
+ String literals were left as "foo" instead of converting to u"foo"
+ as u"foo" is only required if the string has a non-ascii code point.
+ Python is smart about comparing str() and unicode() values and will
+ log an error to the console if the comparison is ever invalid.
+
+ Executive.run* now correctly accept and return unicode() objects.
+ I attempted to fix all the places that we call .write() to make sure we
+ encode any unicode() objects into utf-8.
+
+ I removed several uses of StringIO. StringIO should generally always be
+ passed a unicode() value.
+
+ Likewise I replaced most calls to open() with codecs.open().
+ codecs.open() matches Python 3 open semantics in requiring an encoding
+ parameter. Files opened with codecs.open() with a unicode-compatible
+ encoding will vend unicode() objects from their read() calls, like how
+ StringIO created with a unicode() object will do.
+
+ I also deployed "with" statements wider (now that the project has
+ settled on Python 2.5) to close a bunch of file descriptor leaks.
+
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ - Read/write utf-8 files instead of ascii.
+ - Update the tests to use test for proper unicode() handling.
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ - Document that parse_latest_entry_from_file expects
+ file-like objects which return unicode strings.
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+ - Use unicode() strings instead of str() byte arrays.
+ - Deploy "with" to close file descriptor leaks.
+ * Scripts/webkitpy/common/checkout/commitinfo.py:
+ - Remove unneeded import.
+ * Scripts/webkitpy/common/checkout/scm.py:
+ - Remove use of str().
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ - Read/write utf-8 files and use unicode() strings in testing.
+ * Scripts/webkitpy/common/config/committers.py:
+ - Use \u instead of \x to make slightly clearer what we're doing.
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ - Add a new _string_contents() method and explain why
+ we have to call unicode() on the result of soup.string
+ and why it's safe to do so w/o needing to pass a codec name.
+ - Remove the (unused) support for passing a file object to add_patch_to_bug().
+ * Scripts/webkitpy/common/net/buildbot.py:
+ - Use unicode() instead of str() when needing to coax a
+ NavigableString object into a unicode() object.
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ - Add a test which contains a unicode builder name.
+ * Scripts/webkitpy/common/net/statusserver.py:
+ - Remove use of str()
+ * Scripts/webkitpy/common/prettypatch.py:
+ - Write out the patch file as utf-8.
+ * Scripts/webkitpy/common/system/autoinstall.py:
+ - Write out files with a explicit encodings.
+ - Deploy "with" to close file descriptor leaks.
+ * Scripts/webkitpy/common/system/deprecated_logging.py:
+ - Write out log files as utf-8.
+ * Scripts/webkitpy/common/system/executive.py:
+ - Make run* properly take and return unicode() objects.
+ - Cleaned up input handling in run_command a little by adding
+ a _compute_input() method which can return early instead of having
+ such a long/cluttered if-block.
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ - Added a unit test to make sure we don't break Tor again!
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - Write out the test list as utf-8.
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ - Write out json files as utf-8.
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+ - Deploy "with" to close file descriptor leaks.
+ * Scripts/webkitpy/layout_tests/port/chromium.py: Add Executive.py FIXME.
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/gtk.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/mac.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+ - Make the skipped file parsing test unicode.
+ * Scripts/webkitpy/layout_tests/port/qt.py: Add Executive.py FIXME.
+ * Scripts/webkitpy/layout_tests/port/server_process.py: ditto.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - Deploy "with" to close file descriptor leaks.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ - Make explicit the encodings of log files and pid files.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ - Make encodings explicit and deploy "with".
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py: ditto.
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py: ditto.
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py: ditto.
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py: ditto.
+ * Scripts/webkitpy/style/filereader_unittest.py: ditto.
+ * Scripts/webkitpy/thirdparty/__init__.py: ditto.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ - Removed extra import.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ - No need to map args to strings now that run_command does.
+ - Update test results to match args changes.
+ - Document our global argument hacks.
+ * Scripts/webkitpy/tool/commands/upload.py:
+ - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Rename add_patch_to_bug argument to match bugzilla.py
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ - Executive.run_* now require lists instead of strings.
+ The lack of this change was what broke webkit-patch
+ for svn users the first time this was landed.
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+ - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+ * Scripts/webkitpy/tool/steps/postdiffforcommit.py: ditto
+ * Scripts/webkitpy/tool/steps/postdiffforrevert.py: ditto
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ - Fixed spurious logging seen when running test-webkitpy
+
+2010-04-21 Kinuko Yasuda <kinuko@chromium.org>
+
+ Unreviewed.
+
+ Add myself in committers.py.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-21 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ new-run-webkit-tests: fix a bug in the Chromium port where we would
+ try to talk to a crashed test_shell and raise exceptions that weren't
+ being caught.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37941
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-21 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed.
+
+ [Qt] [Symbian] Build fix.
+
+ Work around a Qt quirk. Some versions of Symbian port Qt
+ QFontDatabase::removeAllApplicationFonts symbol is not available.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::open):
+
+2010-04-21 Alexey Proskuryakov <ap@apple.com>
+
+ Unreviewed.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37933
+ <rdar://problem/7719540> XMLHttpRequest.withCredentials should be better enforced.
+
+ Adding stub implementation of authenticateSession(). Depending on platform loader behavior,
+ a real implementation may or may not be necessary for the one test that currently uses it
+ to pass.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::authenticateSession):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-21 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37933
+ <rdar://problem/7719540> XMLHttpRequest.withCredentials should be better enforced.
+
+ Adding authenticateSession() method that adds credentials to per-process credential storage
+ (for platforms that even have such). No Windows implementation, because writing another
+ loader for DRT is painful.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (authenticateSessionCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (-[SynchronousLoader dealloc]):
+ (-[SynchronousLoader connectionShouldUseCredentialStorage:]):
+ (-[SynchronousLoader connection:didReceiveAuthenticationChallenge:]):
+ (-[SynchronousLoader connection:didFailWithError:]):
+ (-[SynchronousLoader connectionDidFinishLoading:]):
+ (+[SynchronousLoader makeRequest:withUsername:password:]):
+ (LayoutTestController::authenticateSession):
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::authenticateSession):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::authenticateSession):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::authenticateSession):
+ Stub implementations.
+
+2010-04-21 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Make DRT compilable in Chromium tree
+ https://bugs.webkit.org/show_bug.cgi?id=37923
+
+ We need to use different GYPs in a case of WebKit-only checkout
+ and a case of whole Chromium checkout because the relative paths
+ from webkit/ to WebKit/chromium/features.gypi are different in
+ these cases and we can't use 'conditions' for 'includes' in GYPs.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+
+2010-04-21 Jakub Wieczorek <jwieczorek@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ List item markers are not always updated after changes in the DOM.
+ https://bugs.webkit.org/show_bug.cgi?id=37060
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (markerTextForListItemCallback): A function that returns the marker text for a given list item.
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::markerTextForListItem): Implement it in the GTK port.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::markerTextForListItem): Add a stub.
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::markerTextForListItem): Implement it in the Qt port.
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::markerTextForListItem): Add a stub.
+
+2010-04-21 Adam Roben <aroben@apple.com>
+
+ Exclude leaks in CGGradientCreateWithColorComponents from
+ run-webkit-tests leaks output
+
+ The leak in CG is covered by <rdar://problem/7888492>.
+
+ Fixes <http://webkit.org/b/37927>.
+
+ Reviewed by Eric Carlson.
+
+ * Scripts/old-run-webkit-tests:
+ (sub countAndPrintLeaks): Exclude leaks in
+ CGGradientCreateWithColorComponents on certain OSs.
+
+2010-04-21 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [DRT/Chromium] Import MockSpellCheck from Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=37910
+
+ Import webkit/tools/test_shell/mock_spellcheck.{cc,h} rev.37241 of Chromium.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ Add ICU explicitly because WTFString.h includes ICU headers.
+ Add MockSpellCheck.{cpp,h}.
+ * DumpRenderTree/chromium/MockSpellCheck.cpp: Added.
+ * DumpRenderTree/chromium/MockSpellCheck.h: Added.
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::spellCheck):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ * DumpRenderTree/chromium/config.h: Define JS_EXPORTDATA, which is used
+ by wtf/text/AtomicString.h included by wtf/text/WTFString.h.
+
+2010-04-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add webkit-patch pretty-diff
+ https://bugs.webkit.org/show_bug.cgi?id=37892
+
+ This is slightly lame because it asks you whether the diff is correct,
+ but it's a starting point.
+
+ * Scripts/webkitpy/tool/commands/__init__.py:
+ * Scripts/webkitpy/tool/commands/prettydiff.py: Added.
+ * Scripts/webkitpy/tool/main.py:
+
+2010-04-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove mention of non-existant --no-build option
+ https://bugs.webkit.org/show_bug.cgi?id=37893
+
+ The option doesn't exist!
+
+ * Scripts/webkitpy/tool/commands/stepsequence.py:
+
+2010-04-21 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Interrupting JavaScript is cumbersome when you use QtLaucher for testing or profiling.
+ https://bugs.webkit.org/show_bug.cgi?id=37198
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::toggleInterruptingJavaScriptEnabled):
+ (LauncherWindow::newWindow):
+ (LauncherWindow::cloneWindow):
+ (LauncherWindow::createChrome):
+ (main):
+ * QtLauncher/webpage.cpp:
+ (WebPage::WebPage):
+ (WebPage::shouldInterruptJavaScript):
+ * QtLauncher/webpage.h:
+ (WebPage::setInterruptingJavaScriptEnabled):
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, rolling out r57963.
+ http://trac.webkit.org/changeset/57963
+ https://bugs.webkit.org/show_bug.cgi?id=37759
+
+ Three tests started crashing on the Qt bot.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-21 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Make new-run-webkit-tests work for the Qt port
+ https://bugs.webkit.org/show_bug.cgi?id=37588
+
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+
+2010-04-21 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: try to detect alternate apache path
+ https://bugs.webkit.org/show_bug.cgi?id=37587
+
+ _check_port_build() also needs to return true in the
+ base implementation to not fail the check_build step.
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-21 Yi Shen <yi.4.shen@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add LayoutTestController interface: computedStyleIncludingVisitedInfo
+ https://bugs.webkit.org/show_bug.cgi?id=37759
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::computedStyleIncludingVisitedInfo):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-21 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, test fix only.
+
+ new-run-webkit-tests: implement a --log trace message to be able to display detailed output of an individual test run
+ https://bugs.webkit.org/show_bug.cgi?id=37726
+
+ This change seems to have broken a test.
+ Attempting to handle the case where we don't have any
+ timing information. Dirk may have to correct this change.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests has much higher startup latency than run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=37643
+
+ I got rid of the -expected.checksum reads during startup.
+ This makes startup noticably better on my laptop.
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - Use image_hash() instead of .image_hash now that expected.checksum
+ file reads are done lazily.
+ * Scripts/webkitpy/layout_tests/port/http_server_base.py:
+ - Add debug logging for this sleep call.
+ In my testing I never saw this sleep() hit.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ - Sleep a shorter interval to make websocket server
+ startup more responsive. On my machine startup was
+ taking around 1 second.
+ - Remove the unconditional .5s delay on startup.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - Make image_hash file reads done lazily in a new image_hash() function.
+ - Add a "Starting testing ..." meter update after DRT threads have
+ been started, but before we get updates from the first one.
+ - Rename variable "t" to a full english name to match WebKit style.
+
+2010-04-20 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37748
+
+ Make Sheriffbot more inspirational.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/tool/bot/irc_command.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-20 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Import Chromium image_diff as ImageDiff
+ https://bugs.webkit.org/show_bug.cgi?id=37790
+
+ ImageDiff.cpp is based on tools/imagediff/image_diff.cc r41911 of Chromium.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * DumpRenderTree/chromium/ImageDiff.cpp: Added.
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+
+2010-04-20 Dirk Pranke <dpranke@chromium.org>
+
+ This patch to new-run-webkit-tests adds a --log 'trace' option
+ that prints out detailed info about a given test as it executes
+ (where the baselines are, what the expectation is, what we got,
+ how long it took).
+
+ https://bugs.webkit.org/show_bug.cgi?id=37726
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - use the newly exposed TestResult class and implement
+ --log trace
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_thread.py:
+ - rename TestStats to TestResult and make it more public, resulting
+ in cleaner code
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ - add expectation_to_string() as a separate callable function
+
+2010-04-20 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, rolling out r57907.
+ http://trac.webkit.org/changeset/57907
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ Appears to have broken MacEWS and possibly webkit-patch upload
+ for svn users. Needs further investigation.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+ * Scripts/webkitpy/common/checkout/commitinfo.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/common/config/committers.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ * Scripts/webkitpy/common/net/statusserver.py:
+ * Scripts/webkitpy/common/prettypatch.py:
+ * Scripts/webkitpy/common/system/autoinstall.py:
+ * Scripts/webkitpy/common/system/deprecated_logging.py:
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+ * Scripts/webkitpy/tool/steps/postdiffforcommit.py:
+ * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+
+2010-04-20 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed.
+
+ Update my irc handle in committers.py (natechapin -> japhet).
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION(57531): the commit-queue still hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37765
+
+ I fixed the queue to not ignore Tor as a reviwer in r57531,
+ but instead it throws an exception every time his name is in a patch.
+
+ This fixes our Executive.run_command code to work around a Popen
+ bug http://bugs.python.org/issue5290 whereby python versions before 2.6
+ do not correctly handle unicode objects as input or output to
+ Popen.communicate.
+
+ Following the advice of:
+ http://farmdev.com/talks/unicode/
+ I'm attempting to take the python unicode plunge and use unicode()
+ objects as strings instead of str() objects everywhere in webkitpy.
+
+ We do not have to use u"" instead of "" because u"a" == "a" as expected
+ in Python. Python will generate a warning to the console in cases where
+ a unicode() == str() operation cannot be performed.
+
+ I also cleaned up the input handling in run_command a little by adding
+ a new _compute_input() method which can return early instead of having
+ such a long/cluttered if-block.
+
+ Executive.run* now correctly accept and return unicode() objects.
+ I attempted to fix all the places that we call .write() to make sure we
+ encode any unicode() objects into utf-8.
+
+ All places which use StringIO need to be sure to pass StringIO a
+ pre-encoded byte-array (str object) instead of unicode so that
+ clients which read from the StringIO don't have encoding exceptions.
+ To make this easier, I removed the patch_file_object support from
+ add_patch_to_bug, and changed the 4 places which previously used
+ StringIO to create a fake patch file.
+
+ I attempted to document any places where we are not correctly converting
+ to/from bytes (str() objects) to strings (unicode() objects).
+
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ - Read/write utf-8 files instead of ascii.
+ - Update the tests to use test for proper unicode() handling.
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+ - Use unicode() strings instead of str() byte arrays.
+ * Scripts/webkitpy/common/checkout/scm.py:
+ - Remove use of str().
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ - Read/write utf-8 files and use unicode() strings in testing.
+ * Scripts/webkitpy/common/config/committers.py:
+ - Use \u instead of \x to make slightly clearer what we're doing.
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ - Add a new _string_contents() method and explain why
+ we have to call unicode() on the result of soup.string
+ and why it's safe to do so w/o needing to pass a codec name.
+ - Remove the (unused) support for passing a file object to add_patch_to_bug().
+ * Scripts/webkitpy/common/net/buildbot.py:
+ - Use unicode() instead of str() when needing to coax a
+ NavigableString object into a unicode() object.
+ * Scripts/webkitpy/common/net/statusserver.py:
+ - Remove use of str()
+ * Scripts/webkitpy/common/prettypatch.py:
+ - Write out the patch file as utf-8.
+ * Scripts/webkitpy/common/system/autoinstall.py:
+ - Add a FIXME about encoding.
+ * Scripts/webkitpy/common/system/deprecated_logging.py:
+ - Document that tee() works on bytes, not strings.
+ * Scripts/webkitpy/common/system/executive.py:
+ - Make run* properly take and return unicode() objects.
+ * Scripts/webkitpy/common/system/executive_unittest.py:
+ - Added a unit test to make sure we don't break Tor again!
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - Write out the test list as utf-8.
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ - Write out json files as utf-8.
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+ - Add FIXME about encoding handling.
+ * Scripts/webkitpy/tool/commands/upload.py:
+ - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+ * Scripts/webkitpy/tool/mocktool.py:
+ - Rename add_patch_to_bug argument to match bugzilla.py
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+ - Pass the diff directly to add_patch_to_bug instead of creating a StringIO file wrapper.
+ * Scripts/webkitpy/tool/steps/postdiffforcommit.py: ditto.
+ * Scripts/webkitpy/tool/steps/postdiffforrevert.py: ditto.
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ - Fixed spurious logging seen when running test-webkitpy
+
+2010-04-20 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ For check-webkit-style, implemented __eq__() and __ne__() (the
+ built-in equality and inequality methods) for the
+ DefaultStyleErrorHandler class.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37850
+
+ This will facilitate unit-testing for a subsequent patch,
+ namely for https://bugs.webkit.org/show_bug.cgi?id=37850
+
+ * Scripts/webkitpy/style/error_handlers.py:
+ - Added __eq__() and __ne__() to the DefaultStyleErrorHandler
+ class.
+
+ * Scripts/webkitpy/style/error_handlers_unittest.py:
+ - Added unit tests for __eq__() and __ne__().
+ - Also included a minor clean-up refactoring of combining the
+ StyleErrorHandlerTestBase class (which has not needed to
+ be separate due to previous changes) into the
+ DefaultStyleErrorHandlerTest class.
+
+2010-04-20 Jakub Wieczorek <jwieczorek@webkit.org>
+
+ Unreviewed.
+
+ Add my IRC nick to the committers.py list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-20 Kim Grönholm <kim.gronholm@nomovok.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Multitouch mocking in QtLauncher doesn't work with QGraphicsView
+ https://bugs.webkit.org/show_bug.cgi?id=37816
+
+ Fix multi-touch mocking in QtLauncher when using QGraphicsView.
+ Test: https://bug-32434-attachments.webkit.org/attachment.cgi?id=44955
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::eventFilter):
+ (LauncherWindow::initializeView):
+
+2010-04-20 MORITA Hajime <morrita@google.com>
+
+ Unreviewed, add myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-20 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [DRT/Chromium] Fix some unexpected results of editing
+ https://bugs.webkit.org/show_bug.cgi?id=37843
+
+ This change fixes about 70 unexpected results.
+ The original test_webview_delegate.cc doesn't have this bug.
+ The bug was introduced when I ported it to WebKit tree.
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (printRangeDescription): Replace the latter startContainer() with endContainer().
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ Turn off some unit tests for now - the new-run-webkit-tests dryrun
+ tests for chromium won't work if you don't have a chromium checkout.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37841
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ (Re-)add dryrun.py; this was renamed from passing.py in the previous
+ CL but apparently somehow didn't get checked in.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37841
+
+ * Scripts/webkitpy/layout_tests/port/dryrun.py: Added.
+
+2010-04-19 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ check-webkit-style: exits when encountering a deleted file
+ https://bugs.webkit.org/show_bug.cgi?id=37122
+
+ This reverts the quick fix done by r57119 and makes check_patch
+ not call check_file for deleted files.
+
+ Also this change fixes the behavior for "-", which should mean
+ stdin. Before this change, the style checker just ignored "-"
+ with a warning message.
+
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checker_unittest.py:
+
+2010-04-19 Daniel Bates <dbates@rim.com>
+
+ No review, rolling out 57868.
+ http://trac.webkit.org/changeset/57868
+ https://bugs.webkit.org/show_bug.cgi?id=37748
+
+ Sheriffbot wasn't very inspirational after this patch.
+ Instead, he was silent when you said hi :-(. Rolling
+ out this patch so that I can debug/test this some more.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/tool/bot/irc_command.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-19 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37748
+
+ Make Sheriffbot more inspirational.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/tool/bot/irc_command.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-19 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, add missing header.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests - repurpose the "Passing" port as "Dryrun" port
+ that can be used to test platforms other than the one you are running
+ on. This can be useful for checking baselines and testing code
+ coverage.
+
+ Note that running the code on the "wrong" port requires each
+ port-specific implementation to actually not require any
+ platform-specific python code (e.g., the chromium-win port must
+ test for the existence of windows functions before calling them).
+
+ https://bugs.webkit.org/show_bug.cgi?id=37782
+
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/dryrun.py: Renamed from WebKitTools/Scripts/webkitpy/layout_tests/port/passing.py.
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: add --build (default) and --no-build
+ options to make that step optional. This flag modifies what happens
+ in port.check_build().
+
+ https://bugs.webkit.org/show_bug.cgi?id=37786
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ new-run-webkit-tests - fix a typo in r57480 that caused us to stop
+ logging the actual list of unexpected results.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37831
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ From a patch by Tor Arne Vestbo <tor.arne.vestbo@nokia.com>
+
+ new-run-webkit-tests: make the retry step more explicit
+ https://bugs.webkit.org/show_bug.cgi?id=37606
+
+ It might be confusing to see the test and percent counters
+ reset without any notice of what's going on, so we make the
+ message that a retry-run is started explicit.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19 Sam Weinig <weinig@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Add support for opening a new window (File->New Window) to
+ Windows MiniBrowser. Accelerator doesn't work.
+
+ * MiniBrowser/win/BrowserView.cpp:
+ (createNewPage): Use BrowserView::create.
+ * MiniBrowser/win/BrowserWindow.cpp:
+ (BrowserWindow::onCommand): Respond to ID_FILE_NEW_WINDOW
+ by creating a new window.
+ * MiniBrowser/win/BrowserWindow.h:
+ (BrowserWindow::create): Added. Don't allow creating
+ BrowserWindows on the stack by making constructor
+ private and exposing the create function.
+ * MiniBrowser/win/MiniBrowser.cpp:
+ (MiniBrowser::createNewWindow): Move new window creation
+ logic here.
+ * MiniBrowser/win/MiniBrowser.h:
+ * MiniBrowser/win/MiniBrowser.rc:
+ * MiniBrowser/win/main.cpp:
+ (_tWinMain): Use the new MiniBrowser::createNewWindow().
+
+2010-04-19 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ AX: aria-haspopup needs to be exposed
+ https://bugs.webkit.org/show_bug.cgi?id=37808
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::hasPopup):
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Submit a better workaround for r57806 than the one in r57831 - log
+ an error and exit if you try to run new-run-webkit-tests with --use-drt
+ on Windows.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37822
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-19 Jesus Sanchez-Palencia <jesus@webkit.org>
+
+ Unreviewed.
+
+ Just adding myself as a committer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Add slightly better logging to the websocket python wrapper script,
+ including a --verbose flag for debug output.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37233
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/new-run-webkit-websocketserver:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: add a way (--print-unexpected-results) to
+ (re-)print out the tests that produced unexpected results in the
+ last run. Also add a way (--retry-unexpected-results) to
+ automatically re-test them.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37783
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Restructure the logging in new-run-webkit-tests so that many of log
+ messages that were logged to the MeteredStream also get logged in
+ --verbose mode.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37780
+
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests: add 'summary' and 'unexpected-results' options
+ to the --log flag. Also add a 'progress' flag to enable the regular
+ progress bar (as opposed to 'detailed-progress', which enables the
+ dots). Also add a 'nothing' flag to allow you to be explicit that
+ you don't want any logging on the command line.
+
+ The default is
+ '--log detailed-progress,summary,unexpected,unexpected-results'
+
+ (The default logging is unchanged by this patch, this just makes things
+ properly configurable).
+
+ Note that 'nothing' doesn't work properly yet; I need a couple other
+ patches to land to avoid rewriting things several different ways.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37785
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-19 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Make the URL change on committed load.
+
+ * QtLauncher/mainwindow.cpp:
+ (MainWindow::buildUI):
+ (MainWindow::setAddressUrl):
+ * QtLauncher/mainwindow.h:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix a typo in the rebaselining tool that causes us to use "debug"
+ instead of "Debug" in a directory path, which fails on platforms with
+ case-sensitive filesystems.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37819
+
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-04-19 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix.
+
+ Fix breakage of chromium-win canary bots caused by r57806. That patch
+ introduced the option of using Chrome's new port of DumpRenderTree,
+ but unfortunately that port relies on the webkit.py class
+ implementation which uses non-blocking I/O that isn't available on
+ Windows. This patch turns off that option and doesn't import the
+ class if we're running on Windows.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37817
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-19 James Robinson <jamesr@chromium.org>
+
+ Reviewed by abarth.
+
+ Fix a typo
+
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-04-19 Adam Roben <aroben@apple.com>
+
+ Fix run-webkit-tests when there are spaces in the path
+
+ Fixes <http://webkit.org/b/37809>
+
+ Reviewed by Adam Barth.
+
+ * Scripts/run-webkit-tests: Use an "indirect object" to specify the
+ path to the harness to exec(). According to perldoc, this usage will
+ prohibit perl from parsing the arguments to exec() via the shell,
+ which would incorrectly split paths with spaces in them, etc.
+
+2010-04-19 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Adam Roben.
+
+ WinLauncher.h should use LF line-endings and use native line-endings style.
+ https://bugs.webkit.org/show_bug.cgi?id=37807
+
+ * WinLauncher/WinLauncher.h: Added property svn:eol-style, converted to LF line-endings.
+
+2010-04-19 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [DRT/Chromium] Fix a test initialization problem
+ https://bugs.webkit.org/show_bug.cgi?id=37791
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (runTest): Call resetTestController() before runFileTest(). Some
+ controllers initialize their fields in reset() and not in their
+ constructors.
+
+2010-04-19 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [Chromium] new-run-webkit-tests should use WebKitDriver for --use-drt
+ https://bugs.webkit.org/show_bug.cgi?id=37793
+
+ We need to use WebKitDriver instead of ChromiumDriver for Chromium
+ DRT because its interface is different from test_shell.
+
+ Chromium DRT has no UI. So we can't use it to show test results.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-04-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Make failure-reason more forgiving
+ https://bugs.webkit.org/show_bug.cgi?id=37525
+
+ Removed search_limit, which wasn't very useful anyway.
+ Added a log about the long load time loading from the builders.
+ Prompt the user for what revision to start walking from (makes it easy to restart upon failure).
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-04-18 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Created a class for check-webkit-style that encapsulates iterating
+ over text files and reading them.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37754
+
+ This revision is an intermediate step towards separating our
+ style-checking code from the logic of iterating over files and
+ reading them.
+
+ * Scripts/webkitpy/common/system/logtesting.py:
+ - Added a logMessages() method to the LoggingTestCase class.
+ This method provides unit tests with access to the raw list
+ of log messages in case the tester needs to do something more
+ than simply assert the list of existing messages.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added a ProcessorBase class that processors of lists of lines
+ should eventually inherit from.
+ - Also added a FIXME to use the ProcessorBase class and the
+ TextFileReader class added below.
+
+ * Scripts/webkitpy/style/filereader.py: Added.
+ - Created a TextFileReader class that encapsulates reading
+ and iterating over text files.
+
+ * Scripts/webkitpy/style/filereader_unittest.py: Added.
+ - Added a TextFileReaderTest class to unit-test the
+ new TextFileReader class.
+
+2010-04-15 Tony Chang <tony@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [chromium] new-run-webkit-tests should be able to use chromium DRT
+ https://bugs.webkit.org/show_bug.cgi?id=37645
+
+ Make sure that the lack of a chromium checkout doesn't cause the script to
+ fail.
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py: Fix up a few paths
+ to be relative to an upstream output dir.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py: Add --use-drt flag.
+
+2010-04-18 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, fixing the Qt bot.
+
+ Add a layer of indirection when calling run-webkit-tests to allow testing new-run-webkit-tests on various platforms
+ https://bugs.webkit.org/show_bug.cgi?id=37632
+
+ * Scripts/run-webkit-tests:
+ - Exit non-zero of launching the harness fails.
+
+2010-04-18 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, fixing the Qt bot.
+
+ Add a layer of indirection when calling run-webkit-tests to allow testing new-run-webkit-tests on various platforms
+ https://bugs.webkit.org/show_bug.cgi?id=37632
+
+ * Scripts/run-webkit-tests:
+ - Fix the wrapper to work for users who do not
+ have WebKitTools/Scripts in their path.
+
+2010-04-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add a layer of indirection when calling run-webkit-tests to
+ allow testing new-run-webkit-tests on various platforms.
+ https://bugs.webkit.org/show_bug.cgi?id=37632
+
+ This will let us test and fix bugs in new-run-webkit-tests
+ without needing to restart the buildbot master between tests.
+
+ Currently this change leaves run-webkit-tests as-is, but once
+ its landed we will easily be able to turn on/off
+ new-run-webkit-tests for various ports/configurations.
+
+ I will send a note out to webkit-dev about how we will
+ be using this launcher script to test on the bots.
+
+ * Scripts/old-run-webkit-tests: Copied from WebKitTools/Scripts/run-webkit-tests.
+ * Scripts/run-webkit-tests:
+ - A new script which decides whether to run new- or old-
+ run-webkit-tests based on the platform.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ - Add some dummy argument handling for arguments which
+ old-run-webkit-tests supports but new-run-webkit-tests
+ does not yet.
+
+2010-04-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add Gtk bots to the list of "core builders" (builders which stop the commit-queue when they turn red)
+ https://bugs.webkit.org/show_bug.cgi?id=33295
+
+ The Gtk builders have been green every time I've looked
+ at them in the last 5 days or so. It would appear webkit
+ is now keeping them green and we should update the core
+ builder list to match reality.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-04-18 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add support for LayoutTestController commands:
+ setSmartInsertDeleteEnabled
+ setSelectTrailingWhitespaceEnabled
+ execCommand
+ isCommandEnabled
+
+ https://bugs.webkit.org/show_bug.cgi?id=35844
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setSmartInsertDeleteEnabled):
+ (LayoutTestController::setSelectTrailingWhitespaceEnabled):
+ (LayoutTestController::execCommand):
+ (LayoutTestController::isCommandEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove steps_references and commands_references
+ https://bugs.webkit.org/show_bug.cgi?id=37758
+
+ We tried using the mumble_references convention to manage our
+ dependencies, but it doesn't seem to be providing much value for the
+ steps and commands module because these modules are small pieces of the
+ larger tool module. In this patch, I've removed the references file
+ for these modules.
+
+ I've left the style_references file for the style module because that
+ module seems better isolated from the rest of webkitpy and the
+ style_references file appears to be providing some value.
+
+ * Scripts/webkitpy/tool/commands/commandtest.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/commands_references.py: Removed.
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer_unittest.py:
+ * Scripts/webkitpy/tool/steps_references.py: Removed.
+
+2010-04-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ WebKit needs a Chromium Mac EWS Builder
+ https://bugs.webkit.org/show_bug.cgi?id=37742
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+
+2010-04-17 Adam Barth <abarth@webkit.org>
+
+ Fix expected results for unit test broken by
+ http://trac.webkit.org/changeset/57772
+
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-04-17 Sam Weinig <weinig@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Teach windows MiniBrowser how to work with window.open()
+ and targeted links.
+
+ * MiniBrowser/win/BrowserView.cpp:
+ (createNewPage): Create a new BrowserWindow and return its page.
+ (showPage): Show the page.
+ (closePage): Empty implementation.
+ (runJavaScriptAlert): Empty implementation.
+ (BrowserView::create): Register a UIClient.
+ * MiniBrowser/win/BrowserView.h:
+ (BrowserView::webView): Added.
+ Change create to take a BrowserWindow instead of an HWND.
+
+ * MiniBrowser/win/BrowserWindow.cpp:
+ (BrowserWindow::wndProc): Respond to WM_NCDESTROY.
+ (BrowserWindow::goToURL): Added. Forwards to BrowserView.
+ (BrowserWindow::onCreate): Don't always go to the default
+ url. Let the caller do this.
+ (BrowserWindow::onNCDestroy): Delete the window.
+ * MiniBrowser/win/BrowserWindow.h:
+ (BrowserWindow::view): Added.
+ (BrowserWindow::window): Added.
+
+ * MiniBrowser/win/main.cpp:
+ (_tWinMain):
+ Go to the default URL for the initial page. Allocate the initial
+ window on the heap for correctness.
+
+2010-04-16 Adam Roben <aroben@apple.com>
+
+ Add the Windows Debug (Test) builder to the list of core builders
+
+ It's been green for a few days now, and all the known Windows
+ flakiness is Release-only.
+
+ Rubber-stamped by Mark Rowe.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ (BuildBot.core_builder_name_regexps): Added a regular expression to
+ match the "Windows Debug (Test)" builder.
+
+2010-04-16 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix window.open() and targeted links.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (_createNewPage): Use the correct initializer to and load the window.
+
+2010-04-16 Adam Roben <aroben@apple.com>
+
+ Fix links to layout test results from build status pages
+
+ Reviewed by Mark Rowe.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ (ExtractTestResults.finished): Prepend "/" on the URL of the test
+ results page so that it is treated as an absolute URL.
+
+2010-04-16 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] build DRT on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=37690
+
+ * Scripts/build-dumprendertree: Add support for win and linux
+
+2010-04-16 Sam Weinig <weinig@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Use the threaded process model for MiniBrowser if holding down
+ the shift key on startup.
+
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+
+2010-04-15 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] Add TestShellGtk.cpp so we can link on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=37561
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: Add new file and
+ add platform file exceptions.
+ * DumpRenderTree/chromium/TestShellGtk.cpp: Added.
+ (AlarmHandler):
+ (TestShell::waitTestFinished):
+
+2010-04-15 Tony Chang <tony@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ build DRT on chromium mac
+ https://bugs.webkit.org/show_bug.cgi?id=37639
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * Scripts/build-dumprendertree: enable build-dumprendertree --chromium
+
+2010-04-15 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add LayoutTestHelper for Mac
+ https://bugs.webkit.org/show_bug.cgi?id=37668
+
+ LayouTestHelper.mm is based on webkit/tools/test_shell/mac/layout_test_helper.mm
+ of Chromium.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * DumpRenderTree/chromium/LayoutTestHelper.mm: Added.
+
+2010-04-15 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37494
+ <rdar://problem/7857060> REGRESSION (r57340): fast/events/mouse-drag-from-frame-to-other-frame.html
+ fails on Windows
+
+ * DumpRenderTree/win/EventSender.cpp: (makeEventSender):
+ * DumpRenderTree/win/EventSender.h:
+ Tell EventSender if it's being created for a top frame.
+
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ (FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld): We only want to reset
+ EventSender machinery when a new test is loaded, not when an iframe (or just its global
+ object) is created.
+
+2010-04-15 Adam Roben <aroben@apple.com>
+
+ Fix Windows WebKit2 build.
+
+ * MiniBrowser/win/MiniBrowser.cpp:
+
+2010-04-15 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Include codereview issue number in patch description
+ https://bugs.webkit.org/show_bug.cgi?id=37677
+
+ This lets us know which rietveld issue this patch is tied to.
+
+ Also, make it so that --fancy-review overrides --no-review.
+
+ * Scripts/webkitpy/tool/steps/postcodereview.py:
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+
+2010-04-15 Adam Roben <aroben@apple.com>
+
+ Make --exit-after-n-failures work when all tests are timing out or crashing
+
+ Fixes <http://webkit.org/b/37679>.
+
+ Reviewed by Jon Honeycutt.
+
+ * Scripts/run-webkit-tests:
+ (top level): When a test crashes or times out, break out of the main loop if
+ stopRunningTestsEarlyIfNeeded returns true. Moved some code from the bottom of the main loop
+ from here...
+ (stopRunningTestsEarlyIfNeeded): ...to here.
+
+2010-04-15 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add WebHistoryClient support.
+ https://bugs.webkit.org/show_bug.cgi?id=37671
+
+ Add HistoryClient logging.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (_didNavigateWithNavigationData):
+ (_didPerformClientRedirect):
+ (_didPerformServerRedirect):
+ (_didUpdateHistoryTitle):
+ (-[BrowserWindowController awakeFromNib]):
+
+2010-04-15 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Start the mini browser in threaded mode if shift is pressed during startup.
+ https://bugs.webkit.org/show_bug.cgi?id=37670
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (-[BrowserAppDelegate init]):
+
+2010-04-15 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ AXHelp is being appended from ancestors incorrectly
+ https://bugs.webkit.org/show_bug.cgi?id=37659
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getHelpTextCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::helpText):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::helpText):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::helpText):
+
+2010-04-15 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Re-format run-webkit-tests to fit in 80-columns for PEP-8 compliance.
+ (broken by r57463 and r57381, at least). I've also filed bug 37477
+ to fix check-webkit-style to catch these things.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38586
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-15 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Add a way to override the user-visible name for the test binary since
+ some ports don't call it DumpRenderTree (e.g., Chromium Win uses
+ test_shell, Chromium Mac uses TestShell) by adding a driver_name()
+ method to the Port interface.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37631
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-14 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Add "Force Repaint" to debug menu.
+ https://bugs.webkit.org/show_bug.cgi?id=37627
+
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController forceRepaint:]):
+ * MiniBrowser/mac/English.lproj/MainMenu.xib:
+
+2010-04-15 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add debug-minibrowser script.
+
+ * Scripts/debug-minibrowser: Copied from Scripts/run-minibrowser.
+ * Scripts/webkitdirs.pm:
+
+2010-04-15 Roland Steiner <rolandsteiner@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Bug 37636 - [DRT/Chromium] Implement DRT/Chromium for Windows
+ https://bugs.webkit.org/show_bug.cgi?id=37636
+
+ Second patch: add Windows-specific implementation parts
+ of TestShell.
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::finishedEvent):
+ * DumpRenderTree/chromium/TestShellWin.cpp:
+ (watchDogThread):
+ (TestShell::waitTestFinished):
+
+2010-04-15 Roland Steiner <rolandsteiner@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Bug 37636 - [DRT/Chromium] Implement DRT/Chromium for Windows
+ https://bugs.webkit.org/show_bug.cgi?id=37636
+
+ First patch: fix compiler errors.
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::reset):
+ (EventSender::dispatchMessage):
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::pathToLocalResource):
+ * DumpRenderTree/chromium/TestWebWorker.h:
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ * DumpRenderTree/chromium/WebViewHost.h:
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+
+2010-04-14 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Moving setViewMode from DumpRenderTreeSupportQt to qwebpage.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=37622
+
+ Method qt_wrt_setViewMode was removed from qwebpage.cpp by mistake in r57433
+ (bug 35844). Moving it back.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setViewModeMediaFeature):
+
+2010-04-15 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add some very minimal unit tests for new-run-webkit-tests. This should
+ be enough to catch egregious brokenness like syntax errors and import
+ declaration issues.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37432
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py: Added.
+
+2010-04-14 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Add a way for the buildbot to kill any old processes that are running. This
+ is useful because the Windows bots can get in states where a process remains
+ running (httpd.exe, DumpRenderTree.exe), which causes the bots to get in a red
+ state, and the processes must be killed manually.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: If we are on Windows, kill
+ the old processes that might be running.
+ * BuildSlaveSupport/win/kill-old-processes: Added.
+
+2010-04-14 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Tear down WebKit more completely on window closing and application
+ termination. We still don't block application termination for pending
+ close, but this is a step in the right direction.
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (-[BrowserAppDelegate applicationWillTerminate:]):
+ * MiniBrowser/mac/BrowserWindowController.h:
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController dealloc]):
+ (-[BrowserWindowController windowWillClose:]):
+ (-[BrowserWindowController applicationTerminating]):
+
+2010-04-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Use pretty patch for confirming webkit-patch diffs
+ https://bugs.webkit.org/show_bug.cgi?id=37489
+
+ * Scripts/webkitpy/common/prettypatch.py: Added.
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/confirmdiff.py:
+
+2010-04-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Teach webkit-patch how to handle revisions missing ChangeLogs
+ https://bugs.webkit.org/show_bug.cgi?id=37519
+
+ Make commit_info_for_revision return None when revision
+ is missing a ChangeLog. Previously we would throw an array index
+ exception.
+ Teach callers how to handle None.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-04-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add Qt Bot to the list of "core builders" (builders which block the commit-queue when red)
+ https://bugs.webkit.org/show_bug.cgi?id=33297
+
+ This is an experiment. The bots have been green for
+ a while. We'll see if adding them under sheriff-bot protection
+ will keep them green.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-04-13 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, just fixing a constant in the Rietveld unit test.
+
+ * Scripts/webkitpy/common/net/rietveld_unittest.py
+
+2010-04-13 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, just adding missing Mock to fix python tests.
+
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-13 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add experimental prototype Rietveld integration to webkit-patch upload
+ https://bugs.webkit.org/show_bug.cgi?id=37418
+
+ This patch adds bare-bones integration with Rietveld for code reviews.
+ The behavior is hidden behind the --fancy-review command line flag.
+ Currently, there's no support for uploading more than one patch per
+ issue (which is a nice feature of Rietveld). The plan is to play with
+ this for a bit and see if it's useful.
+
+ Modified from Adam's original patch to autoinstall the rietveld upload script.
+
+ * Scripts/webkitpy/common/config/__init__.py:
+ * Scripts/webkitpy/common/net/rietveld.py: Added.
+ * Scripts/webkitpy/common/net/rietveld_unitttest.py: Added.
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/__init__.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+ * Scripts/webkitpy/tool/steps/postcodereview.py: Added.
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+
+2010-04-13 Sam Weinig <sam@webkit.org>
+
+ Rubber-stamped by Mark Rowe.
+
+ Add Makefile to MiniBrowser.
+
+ * MiniBrowser/Makefile: Added.
+
+2010-04-13 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, just adding a sanity check.
+
+ Add check to make sure commit-queue can never commit too short a message
+ https://bugs.webkit.org/show_bug.cgi?id=37528
+
+ The commit-queue made bogus messages here:
+ http://trac.webkit.org/changeset/57532
+ http://trac.webkit.org/changeset/57534
+
+ This was a regression caused by adding unicode parsing for
+ our ChangeLog files. Popen does not seem to play nice with
+ unicode strings.
+
+ I'm also adding an "assert" to make sure short ChangeLogs never happen again.
+
+ * Scripts/webkitpy/common/system/executive.py:
+ - Cast input to strings before passing to POpen
+ * Scripts/webkitpy/tool/steps/commit.py:
+ - Validate that commit messages are not to short.
+
+2010-04-13 Adam Roben <aroben@apple.com>
+
+ Robustify new-run-webkit-tests against paths with spaces in them
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+ (LayoutTestApacheHttpd.__init__): Quote all paths that we pass to
+ Apache to ensure that paths with spaces in them are interpreted
+ correctly.
+
+2010-04-13 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed buildfix after r57537.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.h: Declaration of removeOriginAccessWhitelistEntry() added.
+
+2010-04-13 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Make building new webkit API and MiniBrowser a little easier.
+
+ * Scripts/build-webkit: Make building with --webkit2 build the
+ MiniBrowser as well and tell you how to use it.
+ * Scripts/run-minibrowser: Copied from Scripts/run-safari.
+ * Scripts/webkitdirs.pm: Add runMiniBrowser function.
+
+2010-04-12 Timothy Hatcher <timothy@apple.com>
+
+ SecurityOrigin needs a way to remove individual OriginAccessEntries
+ https://bugs.webkit.org/show_bug.cgi?id=37449
+
+ Reviewed by Dave Hyatt.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (removeOriginAccessWhitelistEntryCallback): Added. Call LayoutTestController::removeOriginAccessWhitelistEntry.
+ (LayoutTestController::staticFunctions): Added removeOriginAccessWhitelistEntry.
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::removeOriginAccessWhitelistEntry): Added. FIXME to implement.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::removeOriginAccessWhitelistEntry): Added.
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::removeOriginAccessWhitelistEntry): Added. FIXME to implement.
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::removeOriginAccessWhitelistEntry): Added.
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::whiteListAccessFromOrigin): FIXME to implement.
+ (LayoutTestController::removeOriginAccessWhitelistEntry): Added. FIXME to implement.
+
+2010-04-13 Timothy Hatcher <timothy@apple.com>
+
+ Rename SecurityOrigin::whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+ And LayoutTestController.whiteListAccessFromOrigin to addOriginAccessWhitelistEntry.
+ And SecurityOrigin::resetOriginAccessWhiteLists to resetOriginAccessWhitelists.
+
+ SecurityOrigin needs a way to remove individual OriginAccessEntries
+ https://bugs.webkit.org/show_bug.cgi?id=37449
+
+ Reviewed by Dave Hyatt.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (addOriginAccessWhitelistEntryCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::addOriginAccessWhitelistEntry):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::addOriginAccessWhitelistEntry):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::addOriginAccessWhitelistEntry):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::addOriginAccessWhitelistEntry):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::addOriginAccessWhitelistEntry):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::addOriginAccessWhitelistEntry):
+
+2010-04-13 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Remove duplicate function for new-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=37517
+
+ The version() function was already implemented.
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ the commit-queue hates Tor Arne Vestbø
+ https://bugs.webkit.org/show_bug.cgi?id=37511
+
+ We were failing to read reviewers out of ChangeLogs
+ when the reviewer has unicode characters in his/her name.
+ I fixed this by explicitly decoding from utf8 every time we
+ read in a ChangeLog file (they are always UTF8).
+
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+
+2010-04-13 Adam Roben <aroben@apple.com>
+
+ Fix run-webkit-tests on Windows with spaces in the path
+
+ Fixes <http://webkit.org/b/37509>.
+
+ Reviewed by Steve Falkenburg.
+
+ * Scripts/run-webkit-tests:
+ (convertPathUsingCygpath): Remove spaces from the path before passing
+ them to cygpath, then add them back in after conversion, as some
+ versions of cygpath seem to convert spaces into newlines.
+
+2010-04-13 Adam Barth <abarth@webkit.org>
+
+ Unreviewed, but approved by Dumitru Daniliuc. (This patch is intended
+ to fix the downstream Chromium build bots. Hopefully it will work!)
+
+ Add a driver script for the new websocket server
+ https://bugs.webkit.org/show_bug.cgi?id=37495
+
+ websocket_server.py can't be run directly because its a module and not
+ a standalone script. This used to work by accident because it didn't
+ depend on any other modules.
+
+ * Scripts/new-run-webkit-websocketserver: Added.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-04-12 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make new-run-webkit-test PrettyPatch failure reporting more awesome
+ https://bugs.webkit.org/show_bug.cgi?id=37487
+
+ I also fixed an Executive/executive typo.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-04-12 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests should only build java support files on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=37482
+
+ Only the mac needs java support files, so I pushed _build_java
+ down into the Mac port using a new hook "_check_port_build".
+ In the process I noticed a bunch of code which could be shared
+ between all ports and thus got rid of _tests_for_disabled_features
+ and version() copy/paste between all webkit ports.
+ I also made check_build only bother to check for ImageDiff if we're
+ using pixel tests.
+
+ * Scripts/webkitpy/layout_tests/port/gtk.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/qt.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/win.py:
+
+2010-04-12 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, trying to make scripts work on machines without
+ Ruby...
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-04-12 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Add stub files for running new-run-webkit-tests for the Qt port
+
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/qt.py: Added.
+
+2010-04-12 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Modify run_webkit_tests.py to not call sys.exit() at the end of test
+ run; doing so makes it more difficult to embed the routine for,
+ among other things, unit tests. We push the exit calling up into
+ new-run-webkit-tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37464
+
+ * Scripts/new-run-webkit-tests:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-12 Eric Seidel <eric@webkit.org>
+
+ Unreviewed.
+
+ Add stub Gtk implementation for new-run-webkit-tests.
+
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/gtk.py: Added.
+
+2010-04-12 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests fails with exception on systems missing ruby
+ https://bugs.webkit.org/show_bug.cgi?id=37441
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - Catch failures similar to how wdiff code path does.
+ - After one failure, stop trying.
+
+2010-04-12 Tony Chang <tony@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix how we import simplejson based on how it's used in this file.
+ This fixes exceptions raised when trying to write the simplejson output.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-11 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Refactored check-webkit-style so that the StyleChecker class
+ has no dependencies on patch-related concepts.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37065
+
+ This patch is an intermediate step towards making the StyleChecker
+ class a generalized file processor that can do arbitary operations
+ on the files corresponding to a list of paths. This patch
+ also simplifies the unit-testing of patch-checking code.
+
+ * Scripts/check-webkit-style:
+ - Updated to use the new PatchChecker class.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Refactored the StyleChecker.check_patch() method into the
+ check() method of a new PatchChecker class.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Refactored the unit tests as necessary, changing the
+ StyleCheckerCheckPatchTest class to a PatchCheckerTest class.
+
+2010-04-11 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Fix new-run-webkit-tests regressions cased by Eric's option parsing patch
+ https://bugs.webkit.org/show_bug.cgi?id=37430
+
+ We need some basic unit testing of this script, or we're going to keep
+ breaking it like this. Added missing namespace qualifiers and
+ propagated renaming of an option.
+
+ * Scripts/webkitpy/common/config/ports.py:
+ * Scripts/webkitpy/layout_tests/driver_test.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Break new-run-webkit-tests options into groups for easier re-use and possible relocation
+ https://bugs.webkit.org/show_bug.cgi?id=37408
+
+ new-run-webkit-tests currently has one huge function for
+ dealing with all options-parsing.
+ This patch is a first attempt at trying to split that large
+ function down into smaller (hopefully more readable?) chunks
+ dealing with the different areas of options.
+ For example, it would make sense to move configuration
+ options off into some module which deals with the vagries of
+ WebKit's configuration system. It would also make sense to move
+ Chromium options off onto the Chromium port object (where they are used).
+ It may make sense to move results.json options over to the results.json code.
+ This change is a first iteration, and we will certainly need more
+ refinement to this code over time. Hopefully I didn't make things
+ harder to read here.
+
+ * Scripts/webkitpy/layout_tests/driver_test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ create-rollout copy needs to be updated to reflect removal of --no-build
+ https://bugs.webkit.org/show_bug.cgi?id=37425
+
+ Removed --no-build and --no-test from the instructions because these
+ don't exist anymore.
+
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ - Updated the expected results to reflect the new copy.
+ * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+
+2010-04-11 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r57460.
+ http://trac.webkit.org/changeset/57460
+ https://bugs.webkit.org/show_bug.cgi?id=37424
+
+ broke chromium builders (Requested by tony^work on #webkit).
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp:
+
+2010-04-11 Tony Chang <tony@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] update chromium DEPS for upstream compile
+ https://bugs.webkit.org/show_bug.cgi?id=36578
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: Small fix to avoid a circular dependency between
+ WebKit.gyp and webkit.gyp.
+
+2010-04-11 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ svn-apply errors out when removing directories in git
+ https://bugs.webkit.org/show_bug.cgi?id=34871
+
+ * Scripts/svn-apply:
+ (isDirectoryEmptyForRemoval): early break if the directory doesn't exist
+ (scmRemove): have git ignore unmatched files
+
+2010-04-11 Daniel Bates <dbates@rim.com>
+
+ No review, rolling out 57440.
+ http://trac.webkit.org/changeset/57440
+ https://bugs.webkit.org/show_bug.cgi?id=27204
+
+ Did not handle Git patches that included both file and property
+ changes to the same file. Rolling this change out while I look
+ into this.
+
+ * Scripts/VCSUtils.pm:
+ * Scripts/svn-apply:
+ * Scripts/svn-unapply:
+ * Scripts/webkitperl/VCSUtils_unittest/appendSVNExecutableBitChangeToPatch.pl: Removed.
+ * Scripts/webkitperl/VCSUtils_unittest/parseGitFileMode.pl: Removed.
+ * Scripts/webkitperl/VCSUtils_unittest/parseStartOfPatchOrPropertyChangeAndEndOfPropertyChange.pl: Removed.
+
+2010-04-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix typo in log path for AbstractQueue
+ https://bugs.webkit.org/show_bug.cgi?id=37414
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-04-11 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Add missing import statement.
+
+ * Scripts/webkitpy/common/system/executive.py:
+
+2010-04-11 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add setWillSendRequestReturnsNull and setWillSendRequestClearHeader
+
+ https://bugs.webkit.org/show_bug.cgi?id=37410
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::setWillSendRequestReturnsNull):
+ (LayoutTestController::setWillSendRequestClearHeader):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-11 Csaba Osztrogonác <ossy@webkit.org>
+
+ [Qt] Unreviewed buildfix for --debug build after r57433.
+
+ Refactor Qt DRT support in QtWebKit
+ https://bugs.webkit.org/show_bug.cgi?id=35844
+
+ * QtLauncher/main.cpp: qt_drt_garbageCollector_collect(); renamed to DumpRenderTreeSupportQt::garbageCollectorCollect();
+ (launcherMain):
+
+2010-04-11 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Make commit-log-editor Rubber-stamp aware. And other minor cleanups.
+ https://bugs.webkit.org/show_bug.cgi?id=37407
+
+ * Scripts/commit-log-editor:
+
+2010-04-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add PrettyPatch links to new-run-webkit-tests output
+ https://bugs.webkit.org/show_bug.cgi?id=37406
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+ - We're leaking a file handle here, add a FIXME.
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ - Add pretty diff links.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ - Add support for generating pretty diffs using PrettyPatch.
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ - We're leaking another file handle here, another FIXME.
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ - Update write_output_files signature.
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ - Remove unused arguments from write_output_files.
+ - Add support for dumping pretty diffs to write_output_files.
+ - Fix a bunch of file descriptor leaks in this file.
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ - Update write_output_files signature.
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ kill_process is copy/pasted in five places
+ https://bugs.webkit.org/show_bug.cgi?id=37405
+
+ We shouldn't replicate the kill_process logic in every port. Instead,
+ we should move the process interaction to Executive.
+
+ Dirk mentioned that he wanted this abstraction to make it easier to
+ mock things out for testing. It turns out this function is only used
+ in one place where it can't be used as a mock point for testing because
+ the corresponding create process actually creates a real process. In
+ the long term, we should indirect both these calls through a non-static
+ Executive as a mock point. However, we should wait on that until we
+ actually want to write the test.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/layout_tests/port/win.py:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests shouldn't alter its path to import packages
+ https://bugs.webkit.org/show_bug.cgi?id=37404
+
+ * Scripts/new-run-webkit-tests:
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+ * Scripts/webkitpy/thirdparty/simplejson/decoder.py:
+
+2010-04-10 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests should store results to a directory under the build tree
+ https://bugs.webkit.org/show_bug.cgi?id=37380
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-10 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27204
+
+ Implement support for changing the executable bit of a file.
+ The executable bit is among the most changed file properties.
+ Future support can include other property changes.
+
+ Currently, if a patch changes the executable bit of a file
+ it is not respected by svn-apply or svn-unapply. Since the
+ commit-queue bot uses these tools as part of its workflow,
+ such patches cannot be committed by it. That is, such patches
+ need to be committed by hand. Instead, we should add support
+ for the executable bit so that such patches can be committed
+ by the commit-queue bot.
+
+ * Scripts/VCSUtils.pm: Also change reference to Apple Computer, Inc.
+ in copyright to Apple, Inc.
+ * Scripts/svn-apply:
+ * Scripts/svn-unapply:
+ * Scripts/webkitperl/VCSUtils_unittest/appendSVNExecutableBitChangeToPatch.pl: Added.
+ * Scripts/webkitperl/VCSUtils_unittest/parseGitFileMode.pl: Added.
+ * Scripts/webkitperl/VCSUtils_unittest/parseStartOfPatchOrPropertyChangeAndEndOfPropertyChange.pl: Added.
+
+2010-04-10 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ WinEWS bot fails to svn update because scm.clean_working_directory leaves files around
+ https://bugs.webkit.org/show_bug.cgi?id=37401
+
+ The Git-based bots don't have this trouble because
+ Git.clean_working_directory fully removes files that were
+ marked as "add". SVN.clean_working_directory previously just
+ called "svn revert" which would leave added files in the
+ working directory untracked. This patch makes
+ SVN.clean_working_directory function more like
+ Git.clean_working_directory by removing added files after revert.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ - Add SCM.absolute_path for easy conversion between
+ repository-relative paths and absolute paths.
+ - Add SCM.add and SCM.added_files
+ - Make SVN.clean_working_directory remove any added_files after svn revert.
+ - The new unit tests found a bug in Git.status_command, change to use git diff --name-status instead.
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ - Add tests for added code.
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests can't find ImageDiff on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=37403
+
+ It turns out the build directory on Windows is structured differently
+ than it is on other platforms. Instead of assuming the normal
+ structure, we should just ask perl to figure it out for us.
+
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Rubber-stamped by Eric Seidel.
+
+ Change "Gathering files" status line to "Collecting tests". Gathering
+ the files sounds silly to me.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix bugs to make new-run-webkit-tests almost run on windows
+ https://bugs.webkit.org/show_bug.cgi?id=37400
+
+ Fix some minor bugs that prevent new-run-webkit-tests from being run on
+ Windows. I still haven't run it to completion, but I'm getting
+ further.
+
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+
+2010-04-10 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Refactor Qt DRT support in QtWebKit
+
+ Update Qt DRT to use new DumpRenderTreeSupportQt static class.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35844
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ (WebCore::DumpRenderTree::dumpFramesAsText):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/GCControllerQt.cpp:
+ (GCController::collect):
+ (GCController::collectOnAlternateThread):
+ (GCController::getJSObjectCount):
+ * DumpRenderTree/qt/GCControllerQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::counterValueForElementById):
+ (LayoutTestController::setViewModeMediaFeature):
+ (LayoutTestController::setMediaType):
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::evaluateInWebInspector):
+ (LayoutTestController::setFrameFlatteningEnabled):
+ (LayoutTestController::setJavaScriptProfilingEnabled):
+ (LayoutTestController::setTimelineProfilingEnabled):
+ (LayoutTestController::pauseAnimationAtTimeOnElementWithId):
+ (LayoutTestController::pauseTransitionAtTimeOnElementWithId):
+ (LayoutTestController::sampleSVGAnimationForElementAtTime):
+ (LayoutTestController::numberOfActiveAnimations):
+ (LayoutTestController::whiteListAccessFromOrigin):
+ (LayoutTestController::setCaretBrowsingEnabled):
+ (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
+ (LayoutTestController::workerThreadCount):
+ (LayoutTestController::pageNumberForElementById):
+ (LayoutTestController::numberOfPages):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move global queue log to the logs directory so it survives git clean -f
+ https://bugs.webkit.org/show_bug.cgi?id=37395
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ SheriffBot should spam when it encounters errors
+ https://bugs.webkit.org/show_bug.cgi?id=37329
+
+ We need to always update the status server so we don't get stuck in a
+ spam loop. I tried writing a test for this change, but it kind of
+ got out of control. We need a better way to do failure injection.
+
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Unreviewed attempt to fix the Chromium Mac canary.
+
+ * Scripts/webkitpy/common/config/ports.py:
+ * Scripts/webkitpy/common/config/ports_unittest.py:
+ * Scripts/webkitpy/common/system/executive.py:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Add the Apache bits to win.py for new-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=37397
+
+ I still have run this yet, but I looked around to figure out what the
+ various paths appear to be. I'll figure out a way to remove the
+ copy/paste code in a future patch.
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/win.py:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Sketch out the win port for new-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=37393
+
+ I haven't tried running this yet, but we've got to start somewhere.
+
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py:
+ * Scripts/webkitpy/layout_tests/port/win.py: Added.
+
+2010-04-10 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch land should not build and test by default
+ https://bugs.webkit.org/show_bug.cgi?id=33631
+
+ Reverse the sense of --no-build and --no-test to be --build and --test.
+ Also, decoupled the build and test options so you can test without
+ building.
+
+ (Patch manngled by Adam Barth. All bugs are his fault.)
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/steps/options.py:
+ * Scripts/webkitpy/tool/steps/runtests.py:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Factor WebKitPort out of MacPort to allow for WinPort
+ https://bugs.webkit.org/show_bug.cgi?id=37388
+
+ The split is a bit of a guess. We might have to adjust things once we
+ actually have a second port to work with.
+
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/webkit.py: Added.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-04-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ run_webkit_tests.py shouldn't have platform-specific logic
+ https://bugs.webkit.org/show_bug.cgi?id=37387
+
+ Dirk Pranke pointed out that my last patch was wrong because I
+ introduced platform-specific logic into run_webkit_tests.py, limiting
+ the parallelism in Chromium to work around a bug in the main Mac port.
+
+ * Scripts/webkitpy/common/system/executive.py:
+ - Fix a typo pointed out by Chris Jerdonek.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-10 Robert Hogan <robert@webkit.org>
+
+ Unreviewed fix to regressions in r57416.
+
+ [Qt] Fix regressions in http/tests/navigation from r57416
+
+ Reset willSendRequestReturnsNullOnRedirect after each test to
+ prevent it leaking to subsequent tests.
+
+ Error pointed out by Jakub Wieczorek.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37237
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+
+2010-04-11 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Update layoutTestController.DumpResourceLoadCallbacks to match other ports.
+
+ Add support for layoutTestController.setWillSendRequestReturnsNullOnRedirect to Qt DRT.
+ Prevent dumping resource load callbacks once layout test has dumped.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37237
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::dump):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setWillSendRequestReturnsNullOnRedirect):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Implement Desktop Notifications API for QtWebKit
+ https://bugs.webkit.org/show_bug.cgi?id=35503
+
+ DRT stubs for notification. Enables to run and pass
+ 3 (currently disabled) tests.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::grantDesktopNotificationPermission):
+ (LayoutTestController::checkDesktopNotificationPermission):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-04-09 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, another change to executive.py to make it run with
+ python 2.4.
+
+ * Scripts/webkitpy/common/system/executive.py:
+
+2010-04-09 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, attempting to make executive.py run with python 2.4
+ (which is still used on Chromium's Windows canary bot).
+
+ * Scripts/webkitpy/common/system/executive.py:
+
+2010-04-09 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ [wx] Basic implementation of SVG support for wx port.
+
+ * wx/build/settings.py:
+
+2010-04-09 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Don't reinvent Executive.cpu_count for every port
+ https://bugs.webkit.org/show_bug.cgi?id=37377
+
+ mac.py and chromium_mac.py had some copy/paste code. This code doesn't
+ actually have anything to do with WebKit ports. It's really just
+ something in the multiprocessing package. The lame bit is that package
+ isn't available in older versions of Python, so we need to implement a
+ fallback. However, we already have the fallback in common. We don't
+ need to reinvent it specificly for layout_tests.
+
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-09 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests --release fails to build release DRT when global configuration is Debug
+ https://bugs.webkit.org/show_bug.cgi?id=37376
+
+ We need to explicitly pass the --release flag. I bet there are more
+ instances of this bug.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-04-09 Tony Chang <tony@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [chromium] DRT compile fix on win/linux
+ https://bugs.webkit.org/show_bug.cgi?id=37314
+
+ Looks like this was missed when upstreaming.
+
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (applyKeyModifier):
+
+2010-04-09 Adam Barth <abarth@webkit.org>
+
+ Unreviewed, but approved by Dirk Pranke.
+
+ rename test_expectations_test.py to test_expectations_unittest.py so it actually gets run
+ https://bugs.webkit.org/show_bug.cgi?id=37372
+
+ We need to end unit tests with _unittest.py for them to be autodetected
+ by the test harness. +6 tests.
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py: Renamed from WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_test.py.
+
+2010-04-09 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests should talk about DumpRenderTree not test_shell
+ https://bugs.webkit.org/show_bug.cgi?id=37371
+
+ test_shell is some strange Chromium thing.
+ DumpRenderTree (tm) is the real deal.
+
+ * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/server_process.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-09 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fix 2 issues (what were introduced in r56524) in svn-create-patch's generateDiff()
+ https://bugs.webkit.org/show_bug.cgi?id=32582
+
+ Add missing return variable. Initialize $patch variable and remove unnecessary condition.
+
+ * Scripts/svn-create-patch:
+
+2010-04-09 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after addition of LayoutTestController method.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::computedStyleIncludingVisitedInfo):
+
+2010-04-09 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=37368
+ Add MiniBrowser.
+
+ * MiniBrowser: Added.
+ * MiniBrowser/MiniBrowser.vcproj: Added.
+ * MiniBrowser/MiniBrowser.xcodeproj: Added.
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: Added.
+ * MiniBrowser/mac: Added.
+ * MiniBrowser/mac/AppDelegate.h: Added.
+ * MiniBrowser/mac/AppDelegate.m: Added.
+ * MiniBrowser/mac/BrowserWindowController.h: Added.
+ * MiniBrowser/mac/BrowserWindowController.m: Added.
+ * MiniBrowser/mac/English.lproj: Added.
+ * MiniBrowser/mac/English.lproj/BrowserWindow.xib: Added.
+ * MiniBrowser/mac/English.lproj/InfoPlist.strings: Added.
+ * MiniBrowser/mac/English.lproj/MainMenu.xib: Added.
+ * MiniBrowser/mac/MiniBrowser-Info.plist: Added.
+ * MiniBrowser/mac/MiniBrowser_Prefix.pch: Added.
+ * MiniBrowser/mac/main.m: Added.
+ * MiniBrowser/win: Added.
+ * MiniBrowser/win/BrowserView.cpp: Added.
+ * MiniBrowser/win/BrowserView.h: Added.
+ * MiniBrowser/win/BrowserWindow.cpp: Added.
+ * MiniBrowser/win/BrowserWindow.h: Added.
+ * MiniBrowser/win/MiniBrowser.cpp: Added.
+ * MiniBrowser/win/MiniBrowser.h: Added.
+ * MiniBrowser/win/MiniBrowser.rc: Added.
+ * MiniBrowser/win/Resources: Added.
+ * MiniBrowser/win/main.cpp: Added.
+ * MiniBrowser/win/resource.h: Added.
+ * MiniBrowser/win/stdafx.cpp: Added.
+ * MiniBrowser/win/stdafx.h: Added.
+
+2010-04-09 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch attached my patch to the wrong bug
+ https://bugs.webkit.org/show_bug.cgi?id=37015
+
+ The problem here is that SVN was violating SCM's implicit
+ contract of always returning paths relative to the repository root.
+ That can easily be fixed by telling SVN that the CWD is the repository root.
+
+ When fixing this I realized there are a large number of places in SCM.py where
+ we want to consider explicitly passing self.checkout_root as the CWD.
+ That would allow scm methods to be executed even when the CWD is not inside
+ the scm tree at all, and would also make sure (in the case of SVN) that paths
+ returned are relative to the root. Git (almost always) returns paths relative
+ to the repository root.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ - Explicitly pass self.checkout_root as cwd in run_status_and_extract_filenames
+ - Add a ton of FIXMEs about the need to go back and decide which methods require cwd=self.checkout_root
+ and which do not. We'll probably add a helper function to scm (likely SCM._run) which
+ always passes cwd=self.checkout_root to Executive.run_command
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ - Add a test for this change.
+ * Scripts/webkitpy/tool/commands/upload.py:
+ - Removed the explicit os.chdir to the repository root, since scm.py methods
+ should be robust against the cwd not being equal to the root.
+
+2010-04-09 Adam Roben <aroben@apple.com>
+
+ Don't return 0 as a JSValueRef
+
+ That is an illegal use of the JSC API.
+
+ Fixes <http://webkit.org/b/37333> REGRESSION (r57292): :visited tests
+ are asserting on debug Windows and GTK builds
+
+ Reviewed by Anders Carlsson.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::computedStyleIncludingVisitedInfo):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::computedStyleIncludingVisitedInfo):
+ Return an "undefined" JSValueRef instead of 0.
+
+2010-04-09 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Make DumpRenderTree parallelizable
+ https://bugs.webkit.org/show_bug.cgi?id=36899
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (libraryPathForDumpRenderTree): Use DUMPRENDERTREE_TEMP if exist.
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree): Use DUMPRENDERTREE_TEMP if exist.
+ * Scripts/run-webkit-tests:
+ - Create a unique temporary directory and pass its path to
+ DumpRenderTree with DUMPRENDERTREE_TEMP environment variable.
+
+2010-04-09 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ <http://webkit.org/b/37326> IDL files are being copied in to the WebCore framework again
+
+ Add a script to detect the presence of inappropriate files in the frameworks. At present
+ it only looks for .css, .idl and .in files in the top level of WebCore.framework/Resources,
+ as these are the only cases we've encountered recently. It can be extended to check the
+ other frameworks or for other inappropriate files in the future.
+
+ * Scripts/check-for-inappropriate-files-in-framework: Added.
+
+2010-04-08 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Add option to build WebKit2 to build-webkit.
+
+ * Scripts/build-webkit:
+
+2010-04-08 Darin Adler <darin@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ run-webkit-tests should respect argument order
+ https://bugs.webkit.org/show_bug.cgi?id=37257
+
+ * Scripts/run-webkit-tests: Changed so that sorting is done only
+ on the results of iterating directories. Test order is based on
+ what's passed on the command line. Removed code that aimed to
+ eliminate duplicates since it can be useful to run the same test
+ more than once.
+
+2010-04-07 David Hyatt <hyatt@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24300, don't expose history info via CSS. Add a new method for
+ obtaining computed style with :visited info included. This allows layout tests to actually tell that
+ :visited is in effect.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (computedStyleIncludingVisitedInfoCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::computedStyleIncludingVisitedInfo):
+
+2010-04-07 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Enable rebaseline-chromium-webkit-tests to run from a webkit-only
+ checkout (i.e., you don't need anything from the Chromium tree checked
+ out). This requires us to introduce the concept of a "target"
+ port/platform that we use to get configuration information from as well
+ as the "running" port that we use to make directories and diff images
+ and the "rebaselining" port we use to actually manage baselines.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37238
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-04-05 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] REGRESSION:(r50665) QWebFrame::setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff) has no effect.
+ https://bugs.webkit.org/show_bug.cgi?id=29431
+
+ Added stubs for Mac, win, gtk and wx DRTs to implement setScrollbarPolicy method.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setScrollbarPolicyCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setScrollbarPolicy):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setScrollbarPolicy):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setScrollbarPolicy):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setScrollbarPolicy):
+
+2010-04-01 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by David Hyatt.
+
+ [Qt] REGRESSION:(r50665) QWebFrame::setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff) has no effect.
+ https://bugs.webkit.org/show_bug.cgi?id=29431
+
+ Make possible to DRT to set scrollbar policies (on, off or auto).
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setScrollbarPolicy):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * QtLauncher/main.cpp:
+ (LauncherWindow::toggleScrollbars):
+ (LauncherWindow::createChrome):
+
+2010-04-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests should give a percent complete indication
+ https://bugs.webkit.org/show_bug.cgi?id=37258
+
+ Because it's awesome.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-08 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Add back the --target option because it's needed by the downstream
+ Chromium bots.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ new-run-webkit-tests should understand set-webkit-configuration
+ https://bugs.webkit.org/show_bug.cgi?id=37252
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename target to configuration in new-run-webkit-tests to match the rest of WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=37251
+
+ The rest of our tools call --debug or --release the configuration.
+ It's confusing to call it target in this script.
+
+ * Scripts/webkitpy/layout_tests/driver_test.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+2010-04-07 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove depricated op.popen2 call in new-run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=37249
+
+ Python complains that this API is depricated. We already solved this
+ problem in executive.py.
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-04-07 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests crashes when run on a 64-bit machine
+ https://bugs.webkit.org/show_bug.cgi?id=37248
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ - The code was trying to always run the 32-bit intel version
+ of the DumpRenderTree binary. DRT does not build 32-bit on 64-bit
+ machines so that makes no sense. This may have made sense for test_shell
+ at some point, but I think we should just remove this for DRT.
+
+2010-04-07 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ WebKit Apache configs only listen on IPv4 addresses, causing random timeouts
+ https://bugs.webkit.org/show_bug.cgi?id=37104
+
+ Add warnings that the partial support for specifying what port numbers
+ apache should bind to is even more broken after this fix.
+
+ * Scripts/run-webkit-httpd:
+ * Scripts/run-webkit-tests:
+
+2010-04-07 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ LayoutTestController::m_handlesAuthenticationChallenges isn't initialized
+ https://bugs.webkit.org/show_bug.cgi?id=37190
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+
+2010-03-31 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add webkit-patch command to crawl buildbot history and find when tests
+ started to fail.
+ https://bugs.webkit.org/show_bug.cgi?id=36911
+
+ This is a very bare-bones implementation, which works, but isn't pretty.
+ We will need further re-factoring and improvement to this code, but
+ after long discussions with Adam, I think it's best that we land this
+ and iterate from there.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ - Add revision_build_pairs_with_results for cleaner code and possible
+ optimization of this command.
+ - Return None if a build number can't be found for a revision in
+ build_for_revision
+ - Separate out suspect_revisions_for_transition for re-use by
+ FailureReason
+ - Add LayoutTestResults.failing_tests() and make our parsing code
+ explict about what tables it accepts.
+ * Scripts/webkitpy/tool/commands/queries.py:
+ - Move _print_blame_information_for_commit out of WhatBroke for re-use
+ by FailureReason.
+ - Add FailureReason command which can crawl a given builder and explain
+ why it is currently red on a per-test basis.
+
+2010-04-06 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add DumpRenderTree.gyp, and some small fixes
+ https://bugs.webkit.org/show_bug.cgi?id=37137
+
+ - Add DumpRenderTree.gyp
+ - Remove some dependencies to base/string_util.h,
+ base/compiler_specific.h, base/file_path.h, base/file_util.h,
+ base/message_loop.h, base/sys_string_conversions.h,
+
+ * DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp: Added.
+ * DumpRenderTree/chromium/CppVariant.cpp:
+ (CppVariant::toStringVector):
+ * DumpRenderTree/chromium/EventSender.cpp:
+ (EventSender::EventSender):
+ (EventSender::keyDown):
+ (EventSender::scheduleAsynchronousClick):
+ (EventSender::beginDragWithFiles):
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setUserStyleSheetLocation):
+ (LayoutTestController::pathToLocalResource):
+ * DumpRenderTree/chromium/TextInputController.cpp:
+ (TextInputController::markedRange):
+ (TextInputController::selectedRange):
+
+2010-04-06 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Write stack traces into the results directory for new-run-webkit-tests,
+ instead of writing them alongside the test file.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36504
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+
+2010-04-06 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed build fix.
+
+ Enable pixel tests by default in new-run-webkit-tests unless
+ explicitly set by the port or by the command line. This was broken in
+ the fix for bug 36801 (rev. 57173).
+
+ https://bugs.webkit.org/show_bug.cgi?id=37184
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-06 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Disable pixel tests on the mac port by default.
+
+ Also, revamp the way we check for pixel tests being enabled or
+ disabled. We now look for options.pixel_tests instead of
+ options.no_pixel_tests, and we have the "--pixel-tests" (force enable)
+ and "--no-pixel-tests" (force disable) flags.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36801
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_test.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-04-06 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Added the iPhone and iPad latest user agent in QtLauncher UA switcher
+ https://bugs.webkit.org/show_bug.cgi?id=37159
+
+ * QtLauncher/useragentlist.txt:
+
+2010-04-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add current user-agent string for Symbian for QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=37131
+
+ * QtLauncher/useragentlist.txt:
+
+2010-04-06 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Explain how to handle rollout patches
+ https://bugs.webkit.org/show_bug.cgi?id=37139
+
+ We need to set expectations for how long landing rollout patches with
+ the commit-queue takes. The commit-queue is optimized for safety, not
+ performance. Also, give folks an alternative way to land patches
+ quickly.
+
+ In addition, improve our testing of add_patch_to_bug by having
+ MockBugzilla log. This caused me to tighten a bunch of tests and
+ notice that one of our tests wasn't being run.
+
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+
+2010-04-06 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Turns out commit_info.committer() can be None
+ https://bugs.webkit.org/show_bug.cgi?id=37106
+
+ When the committer isn't in committers.py, the committer() property on
+ commit_info can be None. We need to handle that case gracefully.
+
+ * Scripts/webkitpy/common/checkout/commitinfo.py:
+ * Scripts/webkitpy/tool/bot/sheriff.py:
+ * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-04-06 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] [Symbian] Build fix for Dumprendertree if Qt printing is not supported
+ https://bugs.webkit.org/show_bug.cgi?id=37082
+
+ Use the QT_NO_PRINTER guard to flag QPrinter dependent code.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::dryRunPrint):
+
+2010-04-05 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ SheriffBot should force_build builders that are idle and have failed exactly once
+ https://bugs.webkit.org/show_bug.cgi?id=37059
+
+ We can get into a deadlocked state where the commit-queue is stopped
+ because the builders are red but the SheriffBot hasn't taken action
+ because the builder has failed only once. The SheriffBot should force
+ build idle builders that have failed exactly once to either turn the
+ tree green again (if the test was flaky) or trigger the "failed twice"
+ remedies (IRC and bug posts).
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/tool/bot/sheriff.py:
+ * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-05 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Fixed check-webkit-style issue where the script was prematurely
+ exiting when encountering deleted files in patches.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37122
+
+ * Scripts/webkitpy/style/checker.py:
+ - Changed non-existent file message from ERROR to WARN.
+ - StyleChecker.check_file() no longer raises an exception when
+ a file is not found.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated unit tests as necessary.
+
+2010-04-05 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ SheriffBot should include blamelist when posting to bugs
+ https://bugs.webkit.org/show_bug.cgi?id=37113
+
+ When posting on bugs, we should include the full list of SVN revisions
+ that caused the regression to folks have a better sense of whether they
+ are to blame.
+
+ * Scripts/webkitpy/tool/bot/sheriff.py:
+ * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-05 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed after discussion with Adam, Darin, and Eric.
+
+ Deleted the auto-install directory since it is no longer needed in
+ source control (it is auto-generated).
+
+ Also added webkitpy/thirdparty/autoinstalled to webkitpy/thirdparty's
+ svn:ignore property.
+
+ * Scripts/webkitpy/thirdparty/autoinstalled: Removed.
+
+2010-04-05 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ Test case for <http://webkit.org/b/37115> / <rdar://problem/7829331>.
+ REGRESSION(r56989): Crash in Mail in WebCore::Position::isCandidate when deleting block using block deletion UI
+
+ Add a JavaScript hook in DRT to call through to WebView's -setEditable:. This is required in order to reproduce
+ the crash.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setWebViewEditableCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setWebViewEditable):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setWebViewEditable):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setWebViewEditable):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setWebViewEditable):
+ (LayoutTestController::layerTreeAsText):
+
+2010-04-05 Darin Adler <darin@apple.com>
+
+ Ignore more files the Python tools strew about the working directory.
+
+ * Scripts/webkitpy: Added property svn:ignore.
+ * Scripts/webkitpy/common: Added property svn:ignore.
+ * Scripts/webkitpy/common/checkout: Added property svn:ignore.
+ * Scripts/webkitpy/common/config: Added property svn:ignore.
+ * Scripts/webkitpy/common/net: Added property svn:ignore.
+ * Scripts/webkitpy/common/thread: Added property svn:ignore.
+ * Scripts/webkitpy/python24: Added property svn:ignore.
+ * Scripts/webkitpy/thirdparty/autoinstalled: Modified property svn:ignore.
+ * Scripts/webkitpy/tool/bot: Added property svn:ignore.
+
+2010-04-05 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Add Vitaly Repeshko as a committer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-05 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Update kenne's IRC nick to his registered nick.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-05 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ assorted helper functions and cleanup of git utilities
+ https://bugs.webkit.org/show_bug.cgi?id=37103
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ No code currently uses the optional dry_run argument. So removing it.
+ Change all uses of "trunk" to read the correct value out of the git config.
+ Made the dcommit call actually get called when dry_run==true.
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/common/net/credentials.py:
+ Move the git config call into scm.
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
+ * Scripts/webkitpy/common/system/executive.py:
+ If return_exit_code==true, don't error out, just return the exit_code.
+
+2010-04-05 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ prepare-ChangeLog should take a merge-base for which git branch to diff against.
+ https://bugs.webkit.org/show_bug.cgi?id=36394
+
+ * Scripts/prepare-ChangeLog:
+
+2010-04-05 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Removed the PatchStyleErrorHandler class and incorporated its
+ functionality into the DefaultStyleErrorHandler class.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37067
+
+ * Scripts/webkitpy/style/checker.py:
+ - In the StyleChecker class:
+ - Added a line_number parameter to the check_file() method.
+ - Renamed the handle_style_error parameter to
+ mock_handle_style_error to be consistent with the other mock_*
+ parameter names.
+ - Added a mock_check_file parameter to the check_patch() method
+ to facilitate unit testing the changes in this patch.
+ - Rewrote the check_patch() method with the patch-parsing logic
+ taken from the PatchStyleErrorHandler class.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Added a StyleCheckerCheckFileBase class and sub-classed the
+ existing StyleCheckerCheckFileTest class from it.
+ - Added a StyleCheckerCheckPatchTest class to unit-test the
+ rewritten check_patch() method.
+ - Removed the vestigial __main__ code at the bottom of the file.
+ This is left over from when check-webkit-style was implemented
+ as a module and a wrapper module.
+
+ * Scripts/webkitpy/style/error_handlers.py:
+ - Added an optional line_numbers parameter to the
+ DefaultStyleErrorHandler class constructor and adjusted the
+ __call__() method as necessary.
+ - Removed the PatchStyleErrorHandler class.
+
+ * Scripts/webkitpy/style/error_handlers_unittest.py:
+ - Removed the PatchStyleErrorHandlerTest class which unit-tested
+ the PatchStyleErrorHandler class which is being removed in this
+ patch.
+ - Added a test_line_numbers() test method to the
+ DefaultStyleErrorHandlerTest class to test use of the
+ DefaultStyleErrorHandler's new line_numbers attribute.
+
+2010-04-05 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Tighten SheriffBot's flaky test detector
+ https://bugs.webkit.org/show_bug.cgi?id=37063
+
+ Instead of just looking for two sequential red builds, look for two
+ sequential failures of the same test. This should reduce sheriffbot
+ false positive substantially.
+
+ I'm landing this change unreviewed because I've noticed SheriffBot
+ triggering a lot more false positives now that we've expanded the set
+ of core builders. I've tried to take Eric's comments on Bug 37063 into
+ account. I'm happy to iterate on this patch tomorrow once Eric wakes
+ up.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-04-04 John Gregg <johnnyg@google.com>
+
+ Unreviewed, add myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-04 Robert Hogan <robert@webkit.org>
+
+ Unreviewed, add myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-04 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, adding my IRC nickname to committers.py
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-04 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Refactored check-webkit-style's option-parsing code.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37064
+
+ * Scripts/check-webkit-style:
+ - Moved the "WebKit checkout not found" check from
+ ArgumentParser.parse() to the calling code.
+ - Moved the --git-commit argument validation from the calling
+ code to ArgumentParser.parse().
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated a unit test as necessary.
+
+ * Scripts/webkitpy/style/optparser.py:
+ - Renamed ArgumentParser._exit_with_help() to _parse_error()
+ and made its error_message parameter required.
+ - Removed the found_checkout parameter from ArgumentParser.parse().
+ - Removed the "WebKit checkout not found" check and moved it
+ to the calling code.
+ - Added --git-commit argument checking.
+
+ * Scripts/webkitpy/style/optparser_unittest.py:
+ - Adjusted the import statements to be fully qualified.
+ - Changed the ArgumentParserTest class to inherit from
+ LoggingTestCase, and updated the class as necessary.
+ - Added a unit-test for the --git-commit validation.
+ - Added unit tests for the --git-diff and --git-since variants
+ of --git-commit.
+
+2010-04-03 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ The check-webkit-style script now logs an ERROR and exits when
+ encountering a file path that does not exist. Previously, it failed
+ silently on such paths.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36957
+
+ * Scripts/webkitpy/common/system/logtesting.py:
+ - Added a FIXME to rename the LoggingTestCase class to
+ LoggingTestCaseBase.
+
+ * Scripts/webkitpy/style/checker.py:
+ - In the StyleChecker.check_file() method:
+ - Added a mock_os_path_exists parameter.
+ - Renamed the process_file parameter to mock_process_file.
+ - Added logic to log an error and exist if the given path does
+ not exist.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Refactored the StyleCheckerCheckFileTest class slightly to
+ inherit from LoggingTestCase.
+ - Added a test method to unit-test the case of a file that
+ does not exist.
+ - Adjusted the other test methods as necessary.
+
+2010-04-03 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add Tiger Bot to the list of "core builders" (builders which block the commit-queue when red)
+ https://bugs.webkit.org/show_bug.cgi?id=33289
+
+ Add Tiger and SnowLeopard Tests to the core builders. This is a bit of
+ an experiment now that the bots are green. Hopefully we can keep them
+ on the list and have the tree stay greener.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+
+2010-04-02 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Have Eric and Adam watch the SheriffBot
+ https://bugs.webkit.org/show_bug.cgi?id=37054
+
+ * Scripts/webkitpy/tool/bot/sheriff.py:
+ * Scripts/webkitpy/tool/bot/sheriff_unittest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-04-02 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ commit-queue should ignore builders when landing rollouts
+ https://bugs.webkit.org/show_bug.cgi?id=37051
+
+ When we moved the "builders are red" check into the master process, we
+ forgot about rollouts. I thought we had a test covering this case, but
+ looking at the test, it was a bit too loose. I added a new test and
+ introduced some new logging technology into MockTool to make the test
+ tighter.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-04-02 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ sherrifbot should ensure that the rollout reason doesn't start with - (and fix webkit-patch upload).
+ https://bugs.webkit.org/show_bug.cgi?id=37030
+
+ * Scripts/webkitpy/tool/bot/sheriff.py: Ensure that the rollout reason doesn't
+ start with -.
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py: A test with a rollout
+ reason which starts with -.
+ * Scripts/webkitpy/tool/steps/createbug.py: Fix webkit-patch upload.
+
+2010-04-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Fixed check-webkit-style to recognize the short form of the
+ --verbose option, as stated in --help.
+
+ * Scripts/check-webkit-style:
+ - Tweaked one line.
+
+2010-04-02 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix for DumpRenderTree after addition of layerTreeAsText.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::layerTreeAsText):
+
+2010-04-02 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Accept XHTML-MP content type as XHTML content
+ https://bugs.webkit.org/show_bug.cgi?id=34262
+
+ Register xhtmlmp file extension as the new type
+ for XHTML-MP test content.
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
+ * Scripts/webkitpy/layout_tests/port/lighttpd.conf:
+
+2010-04-02 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ create-rollout doesn't fill out ChangeLog
+ https://bugs.webkit.org/show_bug.cgi?id=37010
+
+ The contract between apply_reverse_diff and PrepareChangeLogForRevert
+ was unclear. I broke filling out the ChangeLog during rollout earlier
+ when I changed apply_reverse_diff to revert the ChangeLogs because
+ PrepareChangeLogForRevert thought that it was supposed to do that.
+ I've now taught PrepareChangeLogsForRevert the new contract.
+
+ It's unclear to me how to test this change because it's essentially an
+ integration issue that requires the file system. At some point we
+ should think about a testing strategy for integration. As the system
+ becomes larger, we're running into more of these issues.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+
+2010-04-02 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add cr-win-ews to QueueStatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=37004
+
+ * QueueStatusServer/model/queues.py:
+ * QueueStatusServer/templates/dashboard.html:
+ * QueueStatusServer/templates/statusbubble.html:
+
+2010-04-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Unit-test networktransaction.py's log messages, and add a base
+ class to make unit-testing log messages even easier.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36958
+
+ The purpose of this patch is also to provide a mini-tutorial on
+ how to unit-test Python logging.py messages.
+
+ * Scripts/webkitpy/common/net/networktransaction_unittest.py:
+ - Unit-tested the log messages in test_retry().
+
+ * Scripts/webkitpy/common/system/logtesting.py:
+ - Adjusted the LogTesting class by moving the code that clears
+ the array of log messages into a finally block. This prevents
+ redundant AssertionErrors from getting rendered to the screen
+ while running unit tests.
+ - Added a LoggingTestCase class so the setUp() and tearDown()
+ methods do not need to be implemented in order to test logging.
+ Rather, TestCase classes can simply inherit from this class.
+
+2010-04-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Re-wrote check-webkit-style's argument parsing code to use
+ Python's optparser module and more uniform error-handling logic.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34676
+
+ * Scripts/webkitpy/style/optparser.py:
+ - Removed "option help" from check-webkit-style's usage string
+ since that is provided separately by the OptionParser class.
+ - Also changed the usage string from a function to a constant
+ string _USAGE.
+ - Added an _EPILOG string which renders after OptionParser's
+ usage string and option help.
+ - In the ArgumentParser class:
+ - Changed the constructor's stderr_write parameter to a
+ mock_stderr since the OptionParser accepts a sys.stderr
+ substitute rather than a sys.stderr.write substitute.
+ - Changed the constructor to set a _parser data attribute with
+ an OptionParser instance.
+ - Added a _create_option_parser() method which instantiates
+ the OptionParser.
+ - Updated _exit_with_help() to interact with the OptionParser's
+ help method.
+ - Updated the parse() method as necessary. Also changed the
+ raising of ValueErrors to calls to _exit_with_help().
+
+ * Scripts/webkitpy/style/optparser_unittest.py:
+ - Removed the CreateUsageTest class since the create_usage method
+ was replaced by a constant string.
+ - Added a _MockStdErr class to the ArgumentParserTest class.
+ - Updated the unit tests as necessary.
+
+
+2010-04-02 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ The master commit-queue process should take responsibility for checking that the builders are green
+ https://bugs.webkit.org/show_bug.cgi?id=37009
+
+ We had a failure where the child process noticed that the builders were
+ red. We've always had this race condition, but the new optimistic
+ design made it easier to trigger.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-04-02 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Tweak rollout changelog to pass ValidateReviewer check
+ https://bugs.webkit.org/show_bug.cgi?id=37019
+
+ We need to use the magic word "unreviewed" to make the commit-queue
+ happy when landing rollouts.
+
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py:
+
+2010-04-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Removed duplicate ChangeLog entry.
+
+2010-04-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Rubber-stamped by Eric Seidel.
+
+ To the Python 2.4 error message, added a link to the wiki page
+ that contains instructions on how to upgrade.
+
+ * Scripts/test-webkitpy:
+ - Eliminated a use of the ternary operator in configure_logging()
+ to let the version warning display in case of Python 2.4.
+
+ * Scripts/webkitpy/python24/versioning.py:
+ - Added this link to the error text:
+ http://trac.webkit.org/wiki/PythonGuidelines
+
+ * Scripts/webkitpy/python24/versioning_unittest.py:
+ - Updated unit test text.
+
+2010-04-02 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Record the IRC nick of folks who request rollouts
+ https://bugs.webkit.org/show_bug.cgi?id=36999
+
+ * Scripts/webkitpy/common/net/irc/ircbot.py:
+ * Scripts/webkitpy/tool/bot/irc_command.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add cr-win-ews
+ https://bugs.webkit.org/show_bug.cgi?id=36974
+
+ Adds support for an Early Warning System for Chromium on Linux. The
+ interface to the Chromium port is the same on every platform, so we
+ don't need to create a new Port object for this queue.
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Using a failure exit code when failing to load a required import
+ https://bugs.webkit.org/show_bug.cgi?id=37000
+
+ Well spotted by Mark Rowe.
+
+ * Scripts/webkitpy/common/system/user.py:
+
+2010-04-01 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rewrote the revision (r56942) to disable the 79 character line
+ length limit Python/PEP8 style check.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33639#c39
+
+ This rewrite puts the disabling not in the PythonProcessor but
+ in the calling code's default filter rule configuration. This
+ allows the user to check line-length style from the command-line
+ if desired.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added "-pep8/E501" to the _BASE_FILTER_RULES configuration
+ variable to disable the line-length check.
+ - Added "-pep8/E501" to the list of recognized style categories
+ to permit the category to be checked from the command line.
+
+ * Scripts/webkitpy/style/processors/python.py:
+ - Reverted r56942: http://trac.webkit.org/changeset/56942
+
+2010-04-01 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Add FileThread for async file operation support in FileReader and FileWriter
+ https://bugs.webkit.org/show_bug.cgi?id=36896
+
+ Add options to enable FILE_READER and FILE_WRITER support.
+
+ * Scripts/build-webkit:
+
+2010-04-01 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed. Add missing license header.
+
+ * DumpRenderTree/chromium/TestShellMac.mm:
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Improve the error handling in rollout a bit
+ https://bugs.webkit.org/show_bug.cgi?id=36995
+
+ This patch does a few things to make the error handling in rollout a
+ bit more robust.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ The old logic here was wrong. We don't want to resolve the
+ ChangeLogs (that would remove the old ChangeLog entry). Instead,
+ we want to revert the ChangeLogs so we can fill them with the new
+ message.
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ Update test expectations because we're using a different mock object.
+ * Scripts/webkitpy/tool/commands/download.py:
+ - Added an update command to make updating from the SheriffBot more
+ robust.
+ - Now that we have CommitInfo, we can automatically CC the
+ responsible parties on the bug we create.
+ - Re-ordered the steps in create-rollout. Our original thinking
+ was that we always wanted to create the bug, but that's not
+ really true given how things appear to be playing out. If we
+ fail to apply the reverse diff, we don't want to create the bug.
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ - Use the new, more robust update command.
+ * Scripts/webkitpy/tool/steps/createbug.py:
+ Allow commands to pre-load who they want to be CCed on a new bug.
+
+2010-04-01 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add TestShell and WebViewHost class, main(), and so on
+ https://bugs.webkit.org/show_bug.cgi?id=36814
+
+ This change introduces:
+ - WebViewHost class
+ It's an implementation of some delegates required by Chromium
+ WebKit API, and manages painting of a WebView. It's base on
+ src/webkit/tools/test_shell/test_webview_delegate.{cc,h} of
+ Chromium rev.40492.
+ - TestShell class
+ The TestShell instance holds global states of DumpRenderTree process.
+ Unlike TestShell class of Chromium test_shell, TestShell instance is
+ created just once.
+ - DumpRenderTree.cpp
+ The program entry.
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp: Added.
+ * DumpRenderTree/chromium/TestShell.cpp: Added.
+ * DumpRenderTree/chromium/TestShell.h: Added.
+ * DumpRenderTree/chromium/TestShellMac.mm: Added.
+ * DumpRenderTree/chromium/WebViewHost.cpp: Added.
+ * DumpRenderTree/chromium/WebViewHost.h: Added.
+ * DumpRenderTree/chromium/config.h: Added.
+
+2010-04-01 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ sheriffbot rollout should verify that the svn revision is a number.
+ https://bugs.webkit.org/show_bug.cgi?id=37001
+
+ * Scripts/webkitpy/common/net/bugzilla.py: Allow for the message to be None.
+ * Scripts/webkitpy/tool/bot/sheriff.py: Did verification that svn revision
+ is a number. Fixed the imports (since the files uses ScriptError and log)
+ and a typo.
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py: Added a test to verify
+ the behavior.
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Print an error message for readline bogosity in MacPorts
+ https://bugs.webkit.org/show_bug.cgi?id=36979
+
+ * Scripts/webkitpy/common/system/user.py:
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Don't pass --non-interactive to create-rollout
+ https://bugs.webkit.org/show_bug.cgi?id=36989
+
+ It turns out you can't pass --non-interactive to create-rollout. Also,
+ improve our error reporting slighly to catch the case where we error
+ out after creating the rollout bug.
+
+ * Scripts/webkitpy/tool/bot/irc_command.py:
+ * Scripts/webkitpy/tool/bot/sheriff.py:
+
+2010-04-01 Ojan Vafai <ojan@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch can incorrectly think the working directory is modified
+ https://bugs.webkit.org/show_bug.cgi?id=36985
+
+ If a file's modification time is modified, but the contents are not,
+ then diff-index will think the file has been modified unless you do
+ some crazy update-index call. Instead, call diff --name-only, which
+ has the index update builtin.
+
+ Tried to write a test, but could not reproduce this in a unittest.
+ To test manually:
+ touch file-in-repo
+ git diff-index HEAD
+ git diff HEAD --name-only
+
+ The diff-index call incorrectly shows file-in-repo as modified.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add rollout command to sheriffbot
+ https://bugs.webkit.org/show_bug.cgi?id=36986
+
+ This IRC command creates a new bug an attaches a rollout patch. To
+ actually commit the rollout, a committer needs to mark the patch
+ commit-queue+ in bugs.webkit.org.
+
+ Also, factored out some of the logic from the queue into a separate
+ object for easier testing.
+
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/tool/bot/irc_command.py:
+ * Scripts/webkitpy/tool/bot/sheriff.py: Added.
+ * Scripts/webkitpy/tool/bot/sheriff_unittest.py: Added.
+ * Scripts/webkitpy/tool/bot/sheriffircbot.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+
+2010-04-01 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, only ignoring chatty style errors.
+
+ check-webkit-style: WebKit needs a python style checker
+ https://bugs.webkit.org/show_bug.cgi?id=33639
+
+ Remove the 79 char line limit by ignoring
+ pep8/E501. Because we have our own report_error
+ implementation we have to ignore E501 by hand
+ instead of passing --ignore=E501.
+
+ Right now over 1400 lines of our existing python
+ fail E501 so this rule just generates needless noise.
+ The rest of WebKit has no wrapping rule so it makes
+ little sense for our Python to differ here.
+
+ * Scripts/webkitpy/style/processors/python.py:
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Add cmarrin's IRC nickname.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ EWS spins hot when unable to build
+ https://bugs.webkit.org/show_bug.cgi?id=36981
+
+ The problem is that the queue engine things we have more work to do,
+ but the bot isn't actually able to do anything. After this change, we
+ back off the usual amount.
+
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-04-01 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Added layerTreeAsText function to DRT (for Mac)
+ https://bugs.webkit.org/show_bug.cgi?id=36782
+
+ This is the DRT side. It exposes the call to JavaScript
+ through the LayoutTestController.
+
+ * DumpRenderTree/LayoutTestController.cpp:Platform independent JavaScript shim
+ (layerTreeAsTextCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:Mac specific plumbing to WebKit
+ (LayoutTestController::layerTreeAsText):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:Windows specific plumbing to WebKit
+ (LayoutTestController::layerTreeAsText):
+
+2010-04-01 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after addition of JavaScriptCore/wtf/text directory.
+
+ * wx/build/settings.py:
+
+2010-04-01 Jian Li <jianli@chromium.org>
+
+ Rubber-stamped by David Levin.
+
+ Add myself to the reviewers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Turns out the Chromium Windows bots don't have pdevenv installed.
+
+ * Scripts/webkitdirs.pm:
+
+2010-04-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Let Chromium Windows build with Visual Studio Express
+ https://bugs.webkit.org/show_bug.cgi?id=36919
+
+ This is horrible, horrible copy/paste code, but that seems to be the
+ way of webkitdirs.pm. :(
+
+ Someone needs to go through an cleanup this code, but I don't have the
+ heart to do it in this patch.
+
+ * Scripts/webkitdirs.pm:
+
+2010-04-01 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Add myself to the committers list.
+ https://bugs.webkit.org/show_bug.cgi?id=36953
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-04-01 Eric Seidel <eric@webkit.org>
+
+ Rubber-stamped by Adam Barth.
+
+ Add Snow Leopard Release bot to the list of "core builders" (builders which stop the commit-queue when they turn red)
+ https://bugs.webkit.org/show_bug.cgi?id=33292
+
+ Just adding the "Build" builder for now.
+ We'll add the "Test" builders when the tests
+ are less flaky.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-04-01 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add myself to the reviewers list.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36935
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-03-31 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Dave Levin.
+
+ Added Python style checking to check-webkit-style using
+ the third-party pep8 module (via autoinstall).
+
+ https://bugs.webkit.org/show_bug.cgi?id=33639
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added PYTHON to FileType.
+ - Updated ProcessorDispatcher to return a PythonProcessor
+ for *.py files.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated the ProcessorDispatcher unit tests for *.py files.
+
+ * Scripts/webkitpy/style/processors/python.py: Added.
+ - Added PythonProcessor class.
+
+ * Scripts/webkitpy/style/processors/python_unittest.py: Added.
+ - Added PythonProcessor unit tests.
+
+ * Scripts/webkitpy/style/processors/python_unittest_input.py: Added.
+ - Added a sample Python file to test the PythonProcessor.process()
+ code path (since pep8 accepts a file path).
+
+ * Scripts/webkitpy/style/unittests.py:
+ - Updated the style unit test file to import python_unittest.py.
+
+ * Scripts/webkitpy/style_references.py:
+ - Adjusted style references to import pep8.
+
+2010-03-31 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Dave Levin.
+
+ Rewrote autoinstall.py to support unzipping *.zip files after
+ download, unzipping and extracting *.tar.gz files after download,
+ and copying installed files to a given destination directory.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35163
+
+ These changes will let us autoinstall pep8.py from the web and put
+ our third-party autoinstalled code in an explicit directory like
+ webkitpy/thirdparty/autoinstalled. These changes should also speed
+ up the execution of autoinstalled *.zip packages slightly since
+ *.pyc files cannot be generated when importing from zipped
+ packages using the current autoinstall.
+
+ * Scripts/test-webkitpy:
+ - Addressed the FIXME to enable auto-install logging once
+ autoinstall was rewritten not to log as verbosely.
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/common/net/irc/ircbot.py:
+ - Updated ircbot and irclib import statements.
+
+ * Scripts/webkitpy/common/net/networktransaction.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/common/net/networktransaction_unittest.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/common/net/statusserver.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/common/system/autoinstall.py: Added.
+ - Added AutoInstaller class.
+ - Added sample/testing usage to the __main__ block.
+
+ * Scripts/webkitpy/thirdparty/__init__.py:
+ - Updated the autoinstall lines to use the new autoinstall methods.
+ - Added pep8.py to the list of auto-installed packages.
+ - Added a README file to the target autoinstallation directory
+ so users know that the directory is safe to delete.
+
+ * Scripts/webkitpy/thirdparty/autoinstall.py: Removed.
+ - This is replaced by the rewritten autoinstall
+ webkitpy/common/system/autoinstall.py.
+
+ * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py: Removed.
+ - The target autoinstallation directory is now auto-generated.
+
+2010-03-31 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Tweak webkitpy's logtesting.LogTesting class to get more mileage out
+ of our unit tests that test log messages.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36886
+
+ This patch adds to the LogTesting class's tearDown() method a line
+ asserting that the array of remaining log messages is empty. This
+ ensures that no extra log messages are getting logged that the caller
+ might not be aware of or may have forgotten to check for.
+
+ * Scripts/webkitpy/common/system/logtesting.py:
+ - Modified the tearDown() method as described above.
+ - Also modified the assertMessages() method to clear the array
+ of log messages after asserting.
+
+2010-03-31 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Added support for a --verbose-logging flag to test-webkitpy.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36429
+
+ Verbose logging is useful for debugging test-webkitpy code that
+ runs before the actual unit tests -- things like autoinstalling and
+ unit-test auto-detection logic. This is different from verbose
+ logging of the unit tests themselves (which corresponds to the
+ unittest module's --verbose flag).
+
+ * Scripts/test-webkitpy:
+ - In the configure_logging() method--
+ - Added an is_verbose_logging parameter that sets the logging
+ level to logging.DEBUG instead of logging.INFO.
+ - Changed the method to throttle the logging level on the
+ root logger's handler instead of directly on the root logger
+ itself.
+ - Enabled logging of the autoinstall module when the flag is set.
+
+ * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py:
+ - Added a work-around for a bug in Python 2.6's logging module
+ that was discovered while working on this patch.
+
+2010-03-31 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Enabled Python's logging module for webkit-patch, and replaced
+ deprecated_logging with Python logging in networktransaction.py.
+ This eliminates some spurious output when running test-webkitpy.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36725
+
+ * Scripts/webkit-patch:
+ - Replaced the configure_logging() function with a call to
+ the new logutils.configure_logging() function.
+
+ * Scripts/webkitpy/common/net/networktransaction.py:
+ - Replaced the use of deprecated_logging with Python logging.
+
+ * Scripts/webkitpy/common/system/logutils.py:
+ - Added _default_handlers() which creates the default logging
+ handler for webkitpy.
+ - Added configure_logging() which configures default logging
+ for webkitpy.
+
+ * Scripts/webkitpy/common/system/logutils_unittest.py:
+ - Added unit tests for logutils.configure_logging().
+
+ * Scripts/webkitpy/style/checker.py:
+ - Refactored check-webkit-style's configure_logging() method
+ to call the new logutils.configure_logging().
+
+ * Scripts/webkitpy/style_references.py:
+ - Updated references as necessary.
+
+2010-03-31 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch land fails if not run from the root directory
+ https://bugs.webkit.org/show_bug.cgi?id=35822
+
+ The root of the problem was that ChangeLog.__init__ expects a path
+ relative to the current working directory, and SCM expects to
+ return paths relative to the SCM root. Fix it by converting from
+ SCM-relative to absolute paths in Checkout.modified_changelogs
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+
+2010-03-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add more tests for webkitpy.common.checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36926
+
+ We don't have a great way of testing checkout, sadly.
+
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+
+2010-03-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ REGRESSION: EWS crashes on failure
+ https://bugs.webkit.org/show_bug.cgi?id=36924
+
+ Turns out we need to pass one more argument. My test is kind of lame,
+ but at least it's there.
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+
+2010-03-31 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Fixed typo in WebKitTools/ChangeLog: opsys -> ospath.
+
+2010-03-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Make the EWS go faster by being optimistic
+ https://bugs.webkit.org/show_bug.cgi?id=36916
+
+ Have the EWS be optimistic that a patch will correctly build. This
+ should speed up the common case by not requiring two builds for every
+ patch.
+
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-03-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add the ability to restart sheriffbot from IRC
+ https://bugs.webkit.org/show_bug.cgi?id=36909
+
+ * Scripts/webkitpy/tool/bot/irc_command.py:
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+
+2010-03-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add win-ews to QueueStatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=36876
+
+ The win-ews is still experimental, but it seems to be more or less
+ running. We should show its results to the people.
+
+ * QueueStatusServer/model/queues.py:
+ * QueueStatusServer/templates/dashboard.html:
+ * QueueStatusServer/templates/statusbubble.html:
+
+2010-03-30 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Update rebaseline tool to check the release image diff binary and
+ fallback to debug if the release version does not exist.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36245
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-03-31 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Teach buildbot.py how to parse builder activity from /one_box_per_builder
+ https://bugs.webkit.org/show_bug.cgi?id=36898
+
+ I also removed some obsolete FIXMEs and
+ refactored one_box_per_builder parsing into multiple
+ methods for easier reading.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-03-31 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix logging in new-run-webkit-tests so that we don't report IMAGE
+ expected failures as unexpected passes when we run with pixel tests
+ disabled.
+
+ This change splits some of the logic embedded into the TestExpectations
+ classes out into separate pure functions (result_was_expected,
+ remove_image_failures) to make them easier to test. This also adds
+ a parameter to matches_an_expected_result() to indicate whether or
+ not pixel test results should be included in the expectations.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36771
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-31 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ In webkitpy, refactored two calls to os.path.relpath() replacements
+ to use a common method.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36891
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ - Replaced the relpath implementation with a call to
+ webkitpy.common.system.ospath.relpath().
+
+ * Scripts/webkitpy/common/system/ospath.py: Added.
+ - Moved the relpath() implementation from style/main.py.
+
+ * Scripts/webkitpy/common/system/ospath_unittest.py: Added.
+ - Moved the relpath() unit tests from style/main_unittest.py.
+
+ * Scripts/webkitpy/style/main.py:
+ - Replaced the relpath implementation with a call to
+ webkitpy.common.system.ospath.relpath().
+
+ * Scripts/webkitpy/style/main_unittest.py:
+ - Moved the relpath unit tests to ospath_unittest.py.
+
+2010-03-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a Builder.force_build method
+ https://bugs.webkit.org/show_bug.cgi?id=36875
+
+ We plan to eventually use this in SheriffBot to break deadlocks created
+ by flaky tests.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+
+2010-03-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch reads wrong bug url from unified diff context
+ https://bugs.webkit.org/show_bug.cgi?id=36477
+
+ Instead of trying to figure out the bug_id from the diff, we should
+ just get the information from the Checkout object, which understands
+ these concepts.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/commitinfo.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-03-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch commit-queue should land patches optimistically
+ https://bugs.webkit.org/show_bug.cgi?id=34187
+
+ This patch adds an optimistic path to commit-queue and a "fail twice"
+ requirement for rejecting patches. That means we'll land good patches
+ faster (via the optmistic first run) and we'll reject many fewer
+ patches due to flaky tests.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+
+2010-03-31 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Custom user agent for user agent switcher
+ https://bugs.webkit.org/show_bug.cgi?id=36757
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::showUserAgentDialog):
+
+2010-03-31 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ path to committers.py in commit-queue rejection message is wrong
+ https://bugs.webkit.org/show_bug.cgi?id=36865
+
+ This fix would have only been 3 lines long if we had
+ 1. Had access to an SCM object or tool to give us the checkout root
+ 2. Been able to depend on Python 2.6
+ Instead I've added a bunch of hack code, but at least now
+ we should never have to update this string again as the location
+ of committers.py is fully dynamically discovered. :p
+
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+
+2010-03-31 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Unreviewed test fix for r56809.
+
+ webkit-patch what-broke throws exception
+ https://bugs.webkit.org/show_bug.cgi?id=36852
+
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+
+2010-03-30 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Rubber stamped by Dave Levin.
+
+ Made check-webkit-style less chatty.
+
+ Examples include:
+ - https://bugs.webkit.org/show_bug.cgi?id=36866#c4
+ - https://bugs.webkit.org/show_bug.cgi?id=36472#c9
+
+ * Scripts/webkitpy/style/checker.py:
+ - Changed unrecognized file type log message from info to debug.
+
+2010-03-30 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after new method added.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::callShouldCloseOnWebView):
+
+2010-03-30 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch what-broke throws exception
+ https://bugs.webkit.org/show_bug.cgi?id=36852
+
+ * Scripts/webkitpy/common/checkout/api.py: Add missing import StringIO.
+ * Scripts/webkitpy/common/checkout/api_unittest.py: Test the function which previously threw and exception.
+
+2010-03-30 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36616
+ Dvorak-Qwerty keyboard layout gives unexpected results in javascript keydown
+
+ https://bugs.webkit.org/show_bug.cgi?id=36797
+ For non-Roman layouts, keydown Event.keyCode is always 0
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (-[EventSendingController keyDown:withModifiers:withLocation:]): Generate a correct keyCode
+ for keys used in tests (we used to always pass 0 for 'A').
+
+2010-03-30 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement win-ews
+ https://bugs.webkit.org/show_bug.cgi?id=36809
+
+ * Scripts/webkitpy/common/config/ports.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+
+2010-03-30 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Adjusted test-webkitpy to delete all orphaned *.pyc files
+ from webkitpy/ prior to importing any modules from webkitpy.
+ This ensures that no import statements in webkitpy falsely
+ succeed because of leftover *.pyc files.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36599
+
+ * Scripts/test-webkitpy:
+ - Added _clean_pyc_files() to delete orphaned *.pyc files
+ from a directory.
+ - Added _clean_webkitpy_with_test() to call and test
+ _clean_pyc_files().
+ - Moved the "import webkitpy.python24.versioning" statement
+ from the top of the module to the init() method -- immediately
+ after the call to _clean_webkitpy_with_test().
+
+2010-03-30 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [Chromium-Win] subprocess.call should be called with stdin=open(os.devnull,'r')
+ https://bugs.webkit.org/show_bug.cgi?id=36811
+
+ subproess.Popen() on Python 2.4/Windows with stdout,stdout, but no stdin will fail, because it uses return value of GetStdHandle(STD_INPUT_HANDLE), but DuplicateHandle requires integer, not the handle.
+ We don't need stdin, so use devnull as stdin.
+ Same as https://bugs.webkit.org/show_bug.cgi?id=36586
+
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py: open os.devnull for stdin
+
+2010-03-29 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, build fix only.
+
+ * Scripts/webkitpy/tool/steps/validatereviewer.py: Add missing import.
+
+2010-03-29 Hayato Ito <hayato@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Remove '_flymake' suffix from base part of file name so that
+ check-webkit-style uses a correct header guard name when it is called from Emacs's flymake.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36573
+
+ * Scripts/webkitpy/style/processors/cpp.py:
+ * Scripts/webkitpy/style/processors/cpp_unittest.py:
+
+2010-03-29 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Get the following test-webkitpy unit test working again:
+ scm_unittest.SVNTest.test_svn_apply().
+
+ https://bugs.webkit.org/show_bug.cgi?id=36696
+
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ - Add leading spaces to the empty lines of the ChangeLog strings.
+ - Manually set the _reviewer attribute on the Attachment object
+ to get the tests to pass.
+
+2010-03-29 Martin Robinson <mrobinson@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [GTK] suppress (un)desired launcher output that can make layout test to fail with stderr
+ https://bugs.webkit.org/show_bug.cgi?id=36390
+
+ Suppress debugging messages sent to the GLib logger during DRT runs.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (logHandler): Added.
+ (main): Use logHandler as the default GLib log message handler.
+
+2010-03-29 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ sheriff-bot should comment on bugs when builders break
+ https://bugs.webkit.org/show_bug.cgi?id=36786
+
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ - Add a new _post_blame_comment_to_bug and all it from process_work_item
+ - Move commit-queue logic into _post_rollout_patch to make its api match the other _post commands.
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ - Test the new _post_blame_comment_to_bug call
+
+2010-03-29 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ sheriff-bot fails to get information about certain builds
+ https://bugs.webkit.org/show_bug.cgi?id=36768
+
+ This seems to be caused by:
+ http://buildbot.net/trac/ticket/753
+ I have no work-around, but for now at least we're logging
+ the error better. I also added allow_none to our ServerProxy
+ creation in case that fixes things for other versions of python.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+
+2010-03-29 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add sign in/out link to TestResults appengine
+
+ Add a link to main menu for sign in/out to this appengine.
+ People signed in with admin privilege could perform
+ actions that are only allowed to admins like deleting files.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36767
+
+ * TestResultServer/handlers/menu.py:
+ * TestResultServer/stylesheets/menu.css:
+ (.sign):
+ * TestResultServer/templates/menu.html:
+
+2010-03-29 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ ValidateReviewer step is draconian and un-tested
+ https://bugs.webkit.org/show_bug.cgi?id=36792
+
+ ValidateReviewer logic was commented out in
+ http://trac.webkit.org/changeset/56744
+ That was a symptom of the fact that validatereviewer.py
+ is too inflexible to be used when real humans are driving webkit-patch.
+ For now we just disable ValidateReviewer when humans are at the keyboard.
+
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+ - Only run when in non-interactive mode.
+ * Scripts/webkitpy/tool/steps/validatereviewer_unittest.py: Added.
+ - Test our validation logic to make sure it's sane.
+
+2010-03-29 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Eliminate explicit slash characters from check-webkit-style's
+ _rel_path() method to make its implementation more platform
+ independent.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36759
+
+ * Scripts/webkitpy/style/main.py:
+ - Changed to use os.sep instead of slash_chars "/\\". This can
+ be done since os.path.abspath() converts slashes to os.sep.
+
+2010-03-29 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Change new-run-webkit-tests to not use more than four threads by
+ default on the mac port until
+ https://bugs.webkit.org/show_bug.cgi?id=36622 is fixed.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36687
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-29 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Reformat port/mac.py to fit witin 80 columns for PEP-8 compliance.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36691
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-29 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests fails java/lc3 on a clean checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36078
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ - Build the java support files in check_build
+ - Unwrap a line which would still fit under 80col
+
+2010-02-26 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Fraser.
+
+ Add support for Widgets 1.0: View Mode Media Feature
+ https://bugs.webkit.org/show_bug.cgi?id=35446
+
+ Add hooks to the Qt DRT for testing the view mode media feature.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setViewModeMediaFeature):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-03-29 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Update expected results for unit tests.
+
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+
+2010-03-29 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. I think Eric meant svn_revision.
+
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-03-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch commit-queue should notice if it breaks builders (and roll out its own changes)
+ https://bugs.webkit.org/show_bug.cgi?id=29311
+
+ Now that we have sheriff-bot watching the tree, it can post
+ rollout patches on behalf of the commit queue.
+
+ * Scripts/webkitpy/common/checkout/commitinfo.py: add responsible_parties()
+ * Scripts/webkitpy/common/checkout/commitinfo_unittest.py: test responsible_parties()
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ - Break IRC logic out into _post_irc_warning for easier testing.
+ - Add _post_rollout_patch for posting rollout patches to bugzilla.
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ - Test _rollout_reason
+ * Scripts/webkitpy/tool/grammar.py:
+ - Fix join_with_separators to not add Adam's "oxford comma" for two item lists.
+ * Scripts/webkitpy/tool/grammar_unittest.py:
+ - Test join_with_separators
+
+2010-03-29 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Sheriffbot should actually run commands
+ https://bugs.webkit.org/show_bug.cgi?id=36776
+
+ Some minor changes to Sheriffbot:
+
+ 1) We should actually run commands (by giving control back to the
+ command processing object.
+
+ 2) Use URLs instead of just numbers to represent SVN revisions (making
+ it easier to folks in IRC ot followup).
+
+ * Scripts/webkitpy/tool/bot/irc_command.py:
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+
+2010-03-26 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Antti Koivisto.
+
+ Renaming of frame flattening LayoutTestController method
+ to setFrameFlatteningEnabled(bool)
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setFrameFlatteningEnabledCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setFrameFlatteningEnabled):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setFrameFlatteningEnabled):
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setFrameFlatteningEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setFrameFlatteningEnabled):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setFrameFlatteningEnabled):
+
+2010-03-28 Gustavo Noronha Silva <gns@gnome.org>
+
+ No review, rolling out r56679.
+ http://trac.webkit.org/changeset/56679
+ https://bugs.webkit.org/show_bug.cgi?id=36454
+
+ Lots of tests broken.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (createWebView):
+
+2010-03-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Fixed typo in deprecated_logging_unittest.py, which is masking
+ sys.stderr while running test-webkitpy.
+
+ See also-- https://bugs.webkit.org/show_bug.cgi?id=36725#c3
+
+ * Scripts/webkitpy/common/system/deprecated_logging_unittest.py:
+
+2010-03-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Renamed check-webkit-style's --debug flag to --verbose to be more
+ in line with other WebKit scripts. Also renamed the current
+ --verbose flag to --min-confidence to allow the --debug rename.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36521
+
+ We also renamed the internal "verbose" variables to "confidence" or
+ "min_confidence," as appropriate, to avoid confusion with the
+ --verbose flag, and because the new names are more accurate.
+
+ * Scripts/check-webkit-style:
+ - Renamed is_debug to is_verbose.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Renamed _DEFAULT_VERBOSITY to _DEFAULT_CONFIDENCE.
+ - Renamed "verbosity" parameters to "min_confidence" throughout.
+ - Renamed configure_logging()'s is_debug parameter to is_verbose.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated the unit tests as necessary.
+
+ * Scripts/webkitpy/style/error_handlers.py:
+ - Updated the call to StyleCheckerConfiguration.write_style_error().
+
+ * Scripts/webkitpy/style/error_handlers_unittest.py:
+ - Updated the unit tests as necessary.
+
+ * Scripts/webkitpy/style/optparser.py:
+ - Updated the usage string with the new flag names.
+ - Renamed the verbosity parameter to min_confidence throughout.
+ - Renamed the is_debug parameter to is_verbose throughout.
+
+ * Scripts/webkitpy/style/optparser_unittest.py:
+ - Updated the unit tests as necessary.
+
+ * Scripts/webkitpy/style/processors/cpp.py:
+ - Renamed the verbosity parameter to min_confidence throughout.
+
+ * Scripts/webkitpy/style/processors/cpp_unittest.py:
+ - Updated the unit tests as necessary.
+
+2010-03-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Added back a line that accidentally got deleted in r56690.
+
+ * Scripts/check-webkit-style:
+
+2010-03-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Add to check-webkit-style support for checking directories.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35234
+
+ * Scripts/check-webkit-style:
+ - Replaced the call to check_file() with a call to check_paths().
+
+ * Scripts/webkitpy/style/checker.py:
+ - In the StyleChecker class:
+ - Added a check_paths() method that accepts a list of paths
+ to files and directories.
+ - Added a _check_directory() method that checks the files
+ in a directory.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Added a StyleCheckerCheckPathsTest to unit-test the new
+ check_paths() method.
+
+ * Scripts/webkitpy/style/optparser.py:
+ - Updated the usage string.
+
+2010-03-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Changed check-webkit-style to convert paths to paths relative to
+ the checkout root when invoking check-webkit-style with path
+ arguments. Also added warning messages where appropriate.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35498
+
+ Converting paths to paths relative to the checkout root ensures
+ that style checking will behave as expected (since path-specific
+ rules assume input paths are relative to a source root).
+
+ * Scripts/check-webkit-style:
+ - Added debug logging of whether the current directory was found
+ to be in a WebKit checkout.
+ - Added the found_checkout parameter to the call to parser.parse().
+ - Renamed the files variable to paths.
+ - Added a call to change_directory() prior to checking style.
+
+ * Scripts/webkitpy/style/checker.py:
+ - For StyleChecker.check_file():
+ - Updated the docstring.
+ - Added two log messages.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated a call to parser.parse() with the found_checkout parameter.
+
+ * Scripts/webkitpy/style/main.py: Added.
+ - Added a new file so the code in this patch could be unit-tested,
+ as opposed to adding new code to check-webkit-style.
+ - Added the method _rel_path() as a substitute for os.path.relpath(),
+ which is available only in Python 2.6.
+ - Added the method change_directory(), which contains most of the
+ new functionality in this patch.
+
+ * Scripts/webkitpy/style/main_unittest.py: Added.
+ - Added RelPathTest to test main._rel_path().
+ - Added ChangeDirectoryTest to test main.change_directory().
+
+ * Scripts/webkitpy/style/optparser.py:
+ - Updated check-webkit-style's usage string.
+ - For the ArgumentParser.parse() method:
+ - Added a found_checkout parameter.
+ - Renamed filenames to paths.
+ - Added logic so that an error is raised if no paths are passed
+ if found_checkout is False.
+
+ * Scripts/webkitpy/style/optparser_unittest.py:
+ - Updated the ArgumentParser.parse() unit tests to include
+ coverage for the new found_checkout parameter.
+
+ * Scripts/webkitpy/style/unittests.py:
+ - Added an import statement for main_unittest.
+
+ * Scripts/webkitpy/style_references.py:
+ - Renamed SimpleScm to WebKitCheckout.
+ - Added a detect_checkout() function to allow returning None
+ instead of a WebKitCheckout instance if no checkout is found.
+ - Renamed checkout_root to root_path.
+
+2010-03-27 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Eric Seidel.
+
+ Print didHandleOnloadEventsForFrame in the callback of
+ onload-event signal comming from frame loader
+
+ [GTK] Improve reporting of frame loader callbacks in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=36454
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewOnloadEvent):
+ (createWebView): added connection to signal::onload-event and
+ signal callback
+
+2010-03-27 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Eric Seidel.
+
+ Print didCommitLoadForFrame in the callback of signal::load-committed
+
+ [GTK] Improve reporting of frame loader callbacks in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=36454
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewLoadCommitted):
+ (createWebView): added connection to sinal::load-committed and
+ signal callback
+
+2010-03-27 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Eric Seidel.
+
+ Print didStartProvisionalLoadForFrame in the callback of
+ notify::load-status property change notification
+
+ [GTK] Improve reporting of frame loader callbacks in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=36454
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webInspectorCloseWindow):
+ (webInspectorInspectWebView):
+ (createWebView): added connection to notify::load-status and
+ signal callback
+
+2010-03-27 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ In webkitpy/, deleted the /unittests.py files since test-webkitpy
+ now auto-detects all *_unittest.py files.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36712
+
+ * Scripts/webkitpy/common/net/irc/unittests.py: Removed.
+ * Scripts/webkitpy/common/system/unittests.py: Removed.
+ * Scripts/webkitpy/common/thread/unittests.py: Removed.
+ * Scripts/webkitpy/common/unittests.py: Removed.
+ * Scripts/webkitpy/python24/unittests.py: Removed.
+ * Scripts/webkitpy/style/unittests.py: Removed.
+ * Scripts/webkitpy/tool/unittests.py: Removed.
+ * Scripts/webkitpy/unittests.py: Removed.
+
+2010-03-27 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Eric Seidel.
+
+ Add a CR after printing didFinishDocumentLoadForFrame
+
+ [GTK] Improve reporting of frame loader callbacks in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=36454
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewLoadFinished):
+
+2010-03-27 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Rubber-stamped by Adam Barth.
+
+ Fixed the name of a unit test file in webkitpy.
+
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py: Copied from WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py.
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py: Removed.
+
+2010-03-26 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ The test-webkitpy script now automatically detects all unit-test
+ files in webkitpy/. This lets us eliminate the need to have and
+ maintain all of the unittests.py files.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36591
+
+ * Scripts/test-webkitpy:
+ - Replaced the "from webkitpy.unittests import *" with a call
+ to webkitpy.test.main.Tester().run_tests().
+
+ * Scripts/webkitpy/test/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+ - Required file for the new webkitpy/test/ directory.
+
+ * Scripts/webkitpy/test/main.py: Added.
+ - Added a Tester class that contains the following methods:
+ - _find_unittest_files() to detect all the unit-test files.
+ - _modules_from_paths() to convert the paths to the unit-test
+ files to fully-qualified module names.
+ - run_tests() which calls the above two methods and then passes
+ the module names to Python's unittest module.
+
+2010-03-27 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Fraser.
+
+ [Qt/Win] Add support to unix and windows NS plugin for executing scripts on setWindow.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36701
+
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_instance): Add onSetWindow.
+ (webkit_test_plugin_destroy_instance): Add onSetWindow.
+ (webkit_test_plugin_set_window): Add onSetWindow.
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_New): Add onSetWindow.
+ (NPP_Destroy): Add onSetWindow.
+ (NPP_SetWindow): Add onSetWindow.
+
+2010-03-26 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Simon Hausmann.
+
+ Allow plugins implemented by the application, such as mimetype 'x-qt-plugin',
+ when pluginsEnabled is false.
+
+ Add support for LayoutTestController.WebKitPluginsEnabled
+
+ https://bugs.webkit.org/show_bug.cgi?id=32196
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (copyWebSettingKey):
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::overridePreference):
+
+2010-03-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add some basic IRC commands to sheriffbot
+ https://bugs.webkit.org/show_bug.cgi?id=36684
+
+ Adds support for sheriffbot to respond to a "hi" command and a
+ "last-green-revision" command. It's lame that we're rebuilding
+ MultiCommandTool, but as discussed in person we'll intergrate the two
+ once we see what the requirements are.
+
+ * Scripts/webkitpy/tool/bot/irc_command.py: Added.
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py: Added.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/unittests.py:
+
+2010-03-26 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. More errors in the IRC module. I have no idea how to test
+ ircbot.py, which is too bad. Hopefully we've abstracted it away enough
+ that we don't have to touch it very much after this patch.
+
+ * Scripts/webkitpy/common/net/irc/ircbot.py:
+
+2010-03-26 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Add a missing "_".
+
+ * Scripts/webkitpy/common/net/irc/ircproxy.py:
+ * Scripts/webkitpy/common/net/irc/ircproxy_unittest.py: Added.
+ * Scripts/webkitpy/common/net/irc/unittests.py:
+
+2010-03-26 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Fix a the commit queue after my recent change.
+
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+
+2010-03-26 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed fix.
+
+ Fix the return value for port/base.diff_image (changed from 1/0 to
+ True/False in bug 34826.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-03-26 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Change the Mac port of new-run-webkit-tests to look for a
+ test_expectations.txt file in addition to the Skipped files, so we
+ can track pixel failures.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36619
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-26 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement pixel tests (image diff) properly on the Mac port.
+
+ This change introduces a new "ServerPocess" class that can be used
+ to manage processes that the run-webkit-tests harness forks off and
+ expects to stay up for longer than a single request/response session.
+ Both DumpRenderTree and ImageDiff use this style of communication,
+ although the current code forks off a new ImageDiff for each diff
+ (We need to restructure other parts of the code to be able to do this
+ safely in a multi-threaded environment).
+
+ Also, now that the ServerProcess abstraction exists, we can probably
+ clean up and simplify some of the thread management logic in
+ test_shell_thread as well.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34826
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/server_process.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+
+2010-03-26 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Eric Seidel.
+
+ Print didFinishLoadForFrame outcome in DRT
+
+ [GTK] Improve reporting of frame loader callbacks in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=36454
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewLoadCommitted):
+
+2010-03-26 Eric Seidel <eric@webkit.org>
+
+ Unreviewed test fix.
+ My change conflicted with one of Adam's causing test-webkitpy to fail.
+
+ Move commit_message_for_this_commit from scm to checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36629
+
+ * Scripts/webkitpy/common/checkout/api_unittest.py:
+ - modified_changelogs is now on Checkout instead of scm.
+
+2010-03-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Refactor IRCBot controller logic to allow for commands
+ https://bugs.webkit.org/show_bug.cgi?id=36676
+
+ We need to move the controller logic into the tool package so it can
+ know about commands. The changes to queueengine could go in a
+ different patch, but we're going to need it anyway.
+
+ * Scripts/webkitpy/common/config/irc.py: Added.
+ * Scripts/webkitpy/common/net/irc/ircbot.py:
+ * Scripts/webkitpy/common/net/irc/ircproxy.py:
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/sheriffircbot.py: Added.
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+
+2010-03-26 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ Move the threading code into its own module. (It has nothing to do with IRC.)
+
+ * Scripts/webkitpy/common/net/irc/ircbot.py:
+ * Scripts/webkitpy/common/net/irc/ircproxy.py:
+ * Scripts/webkitpy/common/net/irc/messagepump.py: Removed.
+ * Scripts/webkitpy/common/net/irc/messagepump_unittest.py: Removed.
+ * Scripts/webkitpy/common/net/irc/threadedmessagequeue.py: Removed.
+ * Scripts/webkitpy/common/net/irc/threadedmessagequeue_unittest.py: Removed.
+ * Scripts/webkitpy/common/net/irc/unittests.py:
+ * Scripts/webkitpy/common/thread: Added.
+ * Scripts/webkitpy/common/thread/__init__.py: Added.
+ * Scripts/webkitpy/common/thread/messagepump.py: Copied from Scripts/webkitpy/common/net/irc/messagepump.py.
+ * Scripts/webkitpy/common/thread/messagepump_unittest.py: Copied from Scripts/webkitpy/common/net/irc/messagepump_unittest.py.
+ * Scripts/webkitpy/common/thread/threadedmessagequeue.py: Copied from Scripts/webkitpy/common/net/irc/threadedmessagequeue.py.
+ * Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py: Copied from Scripts/webkitpy/common/net/irc/threadedmessagequeue_unittest.py.
+ * Scripts/webkitpy/common/thread/unittests.py: Added.
+ * Scripts/webkitpy/common/unittests.py:
+
+2010-03-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Move commit_message_for_this_commit from scm to checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36629
+
+ Finally add some basic unit testing for Checkout.commit_message_for_this_commit
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/api_unittest.py: Added.
+ * Scripts/webkitpy/common/unittests.py:
+
+2010-03-26 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ [Qt] User Agent Switcher on QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=36451
+
+ Patch by Diego Gonzalez <diego.gonzalez@openbossa.org> on 2010-03-26
+ Reviewed by Simon Hausmann.
+
+ Make possible to change the QtLauncher user agent via
+ a predefined list.
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/QtLauncher.qrc: Added.
+ * QtLauncher/main.cpp:
+ (LauncherWindow::showUserAgentDialog):
+ (LauncherWindow::createChrome):
+ * QtLauncher/useragentlist.txt: Added.
+ * QtLauncher/webpage.cpp:
+ (WebPage::userAgentForUrl):
+ * QtLauncher/webpage.h:
+ (WebPage::setUserAgent):
+
+2010-03-26 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Host layout test flakiness dashboard in TestResultServer appengine.
+
+ Flakiness dashboard is a tool to monitor layout test status and
+ help layout test regression diagnostics.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36195
+
+ * TestResultServer/handlers/dashboardhandler.py: Added.
+ - New handler to handle dashboard request
+ * TestResultServer/handlers/menu.py:
+ - Add new dashboard links
+ * TestResultServer/handlers/testfilehandler.py:
+ - Request routes refactory
+ * TestResultServer/index.yaml:
+ * TestResultServer/main.py:
+ - Add new dashboard request routes and refactor test result file rountes.
+ * TestResultServer/model/dashboardfile.py: Added.
+ - Model to access datastore for dashboard files
+ * TestResultServer/model/testfile.py:
+ * TestResultServer/stylesheets/dashboardfile.css: Added.
+ * TestResultServer/templates/dashboardfilelist.html: Added.
+ * TestResultServer/templates/showfilelist.html:
+
+2010-03-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove some evil statics from CommitInfo
+ https://bugs.webkit.org/show_bug.cgi?id=36637
+
+ These methods should really be on checkout. You can tell because they
+ know about ChangeLogs and take an SCM as an argument. :)
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ * Scripts/webkitpy/common/checkout/commitinfo.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-03-23 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Add an option to QtLauncher to enable/disable a QGLWidget as Viewport
+ of the QGraphicsView when the launcher is running on graphicsview mode.
+
+ [Qt] QtLauncher needs an option to Enable/Disable a QGLWidget as Viewport
+ https://bugs.webkit.org/show_bug.cgi?id=36270
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/main.cpp:
+ (LauncherWindow::toggleQGLWidgetViewport):
+ (LauncherWindow::createChrome):
+
+2010-03-26 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [Chromium-Win] websocket_server.py failed to start
+ https://bugs.webkit.org/show_bug.cgi?id=36586
+
+ subproess.Popen() on Python 2.4/Windows with stdout,stdout, but no stdin will fail, because it uses return value of GetStdHandle(STD_INPUT_HANDLE), but DuplicateHandle requires integer, not the handle.
+ We don't need stdin, so use devnull as stdin.
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: open os.devnull for stdin
+
+2010-03-26 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add TestNavigationController and TestWebWorker
+ https://bugs.webkit.org/show_bug.cgi?id=36520
+
+ Add LayoutTestController class, which is going to be used by
+ DumpRenderTree Chromium port. These files are based on:
+ - src/webkit/tools/test_shell/layout_test_controller.cc
+ - src/webkit/tools/test_shell/layout_test_controller.h
+ of Chromium rev.40492.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp: Added.
+ * DumpRenderTree/chromium/LayoutTestController.h: Added.
+
+2010-03-25 Charlie Reis <creis@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ onbeforeunload not called at window close + frame or iframe focused
+ https://bugs.webkit.org/show_bug.cgi?id=27481
+
+ Adds a callShouldCloseOnWebView method to LayoutTestController,
+ to allow automated testing for bug 27481.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (callShouldCloseOnWebViewCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::callShouldCloseOnWebView):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::callShouldCloseOnWebView):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::callShouldCloseOnWebView):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::callShouldCloseOnWebView):
+
+2010-03-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add webkit-patch lkgr for finding last known good revision
+ https://bugs.webkit.org/show_bug.cgi?id=36626
+
+ This is rather slow for now because the command
+ has to compute this information from the buildbot.
+ A better long-term solution would be to have a server
+ somewhere store a pre-computed LKGR and then any
+ script (like webkit-patch) could just fetch it.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move modified_changelogs (and friends) from scm to checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36636
+
+ These functions know about ChangeLogs, which is forbidden knowledge in
+ scm.py.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+ * Scripts/webkitpy/tool/steps/revertrevision.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move apply_patch from scm to checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36635
+
+ SCM shouldn't have any knowledge of WebKit scripts.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/applypatch.py:
+
+2010-03-25 Eric Seidel <eric@webkit.org>
+
+ Unreviewed build fix to un-break webkit-patch land.
+ Test-case coming in follow-up commit.
+
+ Move commit_message_for_this_commit from scm to checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36629
+
+ * Scripts/webkitpy/common/checkout/api.py: import scm.CommitMessage
+
+2010-03-25 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/7728903> Support color bitmap fonts
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Added ColorBits.ttf
+ and ColorBits-A.png.
+ * DumpRenderTree/fonts/ColorBits-A.png: Copied from WebCore/inspector/front-end/Images/successGreenDot.png.
+ * DumpRenderTree/fonts/ColorBits.ttf: Added.
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (activateFonts): Activate ColorBits.ttf.
+
+2010-03-25 Mark Rowe <mrowe@apple.com>
+
+ Remove a printf that was causing commit-log-editor to spew the name of the editor
+ to the terminal many times during a commit.
+
+ * Scripts/commit-log-editor:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move commit_message_for_this_commit from scm to checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36629
+
+ This function requires knowledge of ChangeLogs, but scm shouldn't know
+ about ChangeLogs.
+
+ * Scripts/webkitpy/common/checkout/api.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py:
+ * Scripts/webkitpy/tool/steps/commit.py:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ REGRESSION: webkit-patch land can't land "rubber-stamped" patches
+ https://bugs.webkit.org/show_bug.cgi?id=36582
+
+ Allow a "-" in rubber stamped.
+
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Fix some copyright lines to remove extraneous comma and
+ python directive.
+
+ * Scripts/webkitpy/tool/bot/patchcollection.py:
+ * Scripts/webkitpy/tool/bot/patchcollection_unittest.py:
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/comments.py:
+ * Scripts/webkitpy/tool/grammar.py:
+ * Scripts/webkitpy/tool/multicommandtool.py:
+ * Scripts/webkitpy/tool/multicommandtool_unittest.py:
+
+2010-03-25 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler, Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36631
+ Allow the test plugin to run scripts in response to NPP_SetWindow calls
+
+ Hook up the ability for the TestNetscapePlugIn to run JavaScript in
+ response to NPP_SetWindow.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginAllocate):
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New):
+ (NPP_Destroy):
+ (NPP_SetWindow):
+
+2010-03-25 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed, build fix.
+
+ [Qt] Fix QtLauncher guards.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::showFPS):
+ (LauncherWindow::updateFPS):
+
+2010-03-25 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Allow running tests with enabled developer extras and closed Web Inspector. Tests that have inspector-enabled/ in their path/url will have developer extras enabled.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36610
+
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (shouldEnableDeveloperExtras):
+ (runTest):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setJavaScriptProfilingEnabled):
+ (LayoutTestController::setDeveloperExtrasEnabled):
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (shouldEnableDeveloperExtras):
+ (runTest):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setJavaScriptProfilingEnabled):
+ (LayoutTestController::setDeveloperExtrasEnabled):
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::shouldEnableDeveloperExtras):
+ (WebCore::DumpRenderTree::open):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::setDeveloperExtrasEnabled):
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::setJavaScriptProfilingEnabled):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (shouldEnableDeveloperExtras):
+ (runTest):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setJavaScriptProfilingEnabled):
+ (LayoutTestController::setDeveloperExtrasEnabled):
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ Tweaks to sheriffbot to improve latency by keeping the working copy up
+ to date even when there's no build break. Also, officially move
+ sheriffbot to #webkit.
+
+ (Also teach ValidateReviewer to understand rubber stamps.)
+
+ * Scripts/webkitpy/common/net/irc/ircbot.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+
+2010-03-22 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Not displaying FPS info on the terminal. On S60 and Maemo the
+ Window title will be used and Status bar will used on desktop.
+
+ [Qt] QtLauncher's FPS info should not be displayed on the terminal
+ https://bugs.webkit.org/show_bug.cgi?id=36244
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::initializeView):
+ (LauncherWindow::showFPS):
+ (LauncherWindow::updateFPS):
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+ (WebViewGraphicsBased::updateFrameRate):
+ * QtLauncher/webview.h:
+ (WebViewGraphicsBased::frameRateMeasurementEnabled):
+
+2010-03-25 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ Added missing frame flattening activation on
+ fast/frames/flattening/frameset-flattening-grid.html;
+ removed unnecessary CONSOLE MESSAGE from the expected file;
+ reset the setFrameSetFlatteningEnabled for each test.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings):
+
+2010-03-25 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Moved deprecated_logging unit test import statement from
+ webkitpy/unittests.py to webkitpy/common/system/unittests.py.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ This is part of the master bug to reorganize webkitpy.
+
+ * Scripts/webkitpy/common/system/unittests.py:
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-25 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Moved webkit_logging.py to common/system/deprecated_logging.py
+ inside webkitpy.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ This is part of the master bug to reorganize webkitpy.
+
+ * Scripts/validate-committer-lists:
+ * Scripts/webkitpy/common/checkout/changelog.py:
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/credentials.py:
+ * Scripts/webkitpy/common/net/irc/ircproxy.py:
+ * Scripts/webkitpy/common/net/networktransaction.py:
+ * Scripts/webkitpy/common/net/statusserver.py:
+ * Scripts/webkitpy/common/system/deprecated_logging.py: Copied from WebKitTools/Scripts/webkitpy/webkit_logging.py.
+ * Scripts/webkitpy/common/system/deprecated_logging_unittest.py: Copied from WebKitTools/Scripts/webkitpy/webkit_logging_unittest.py.
+ * Scripts/webkitpy/common/system/executive.py:
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py:
+ * Scripts/webkitpy/tool/commands/openbugs.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/commands/stepsequence.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/multicommandtool.py:
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/tool/steps/applypatch.py:
+ * Scripts/webkitpy/tool/steps/build.py:
+ * Scripts/webkitpy/tool/steps/checkstyle.py:
+ * Scripts/webkitpy/tool/steps/closebug.py:
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff.py:
+ * Scripts/webkitpy/tool/steps/confirmdiff.py:
+ * Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py:
+ * Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py:
+ * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/reopenbugafterrollout.py:
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ * Scripts/webkitpy/tool/steps/update.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+ * Scripts/webkitpy/unittests.py:
+ * Scripts/webkitpy/webkit_logging.py: Removed.
+ * Scripts/webkitpy/webkit_logging_unittest.py: Removed.
+
+2010-03-25 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ commit-log-editor can call itself in an infinite loop
+ https://bugs.webkit.org/show_bug.cgi?id=35291
+
+ if $editor ends up being commit-log-editor, the script will exec itself
+ in an infinite loop.
+
+ To avoid this, we now check that the $editor variable is not
+ commit-log-editor to avoid this case.
+
+ * Scripts/commit-log-editor: Added an isCommitLogEditor method and
+ reworked the $editor setting to add this check.
+
+2010-03-25 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add a Toggle Frame Flattening option to QtLauncher.
+ It will be enabled by default on Maemo5 and S60 platforms.
+
+ [Qt] Add enable/disable Frame Flattening option to QtLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=36558
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::applyPrefs):
+ (LauncherWindow::toggleFrameFlattening):
+ (LauncherWindow::createChrome):
+
+2010-03-25 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ svn-create-patch prints a warning for large patches
+ https://bugs.webkit.org/show_bug.cgi?id=32582
+
+ svn-create-patch prints a warning message for larger patches than 20k.
+
+ * Scripts/svn-create-patch:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Renamed early_warning_system.py to earlywarningsystem.py.
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ * Scripts/webkitpy/tool/commands/early_warning_system.py: Removed.
+ * Scripts/webkitpy/tool/commands/early_warning_system_unittest.py: Removed.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem.py: Copied from Scripts/webkitpy/tool/commands/early_warning_system.py.
+ * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py: Copied from Scripts/webkitpy/tool/commands/early_warning_system_unittest.py.
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/unittests.py:
+
+2010-03-25 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ In webkitpy, pushed the unit test import statements in
+ webkitpy/unittests.py into appropriate unittests.py files in the
+ new root-level packages beneath webkitpy.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ This is part of the master bug to reorganize webkitpy.
+
+ * Scripts/webkitpy/common/system/unittests.py:
+ * Scripts/webkitpy/common/unittests.py: Added.
+ * Scripts/webkitpy/python24/unittests.py: Added.
+ * Scripts/webkitpy/tool/unittests.py: Added.
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move WebKitCheckout into the webkitpy.common.checkout
+ package.
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ * Scripts/webkitpy/common/checkout/api.py: Copied from Scripts/webkitpy/webkitcheckout.py.
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/webkitcheckout.py: Removed.
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move OutputCapture to webkitpy.common.system.
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py:
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
+ * Scripts/webkitpy/common/system/outputcapture.py: Copied from Scripts/webkitpy/outputcapture.py.
+ * Scripts/webkitpy/outputcapture.py: Removed.
+ * Scripts/webkitpy/tool/commands/commandtest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/multicommandtool_unittest.py:
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move user.py to webkitpy.common.system.
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/net/bugzilla.py:
+ * Scripts/webkitpy/common/net/credentials.py:
+ * Scripts/webkitpy/common/system/user.py: Copied from Scripts/webkitpy/user.py.
+ * Scripts/webkitpy/common/system/user_unittest.py: Copied from Scripts/webkitpy/user_unittest.py.
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/unittests.py:
+ * Scripts/webkitpy/user.py: Removed.
+ * Scripts/webkitpy/user_unittest.py: Removed.
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move executive.py to webkitpy.common.system.
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ * Scripts/webkitpy/common/checkout/scm.py:
+ * Scripts/webkitpy/common/checkout/scm_unittest.py:
+ * Scripts/webkitpy/common/config/ports.py:
+ * Scripts/webkitpy/common/config/ports_unittest.py:
+ * Scripts/webkitpy/common/net/credentials.py:
+ * Scripts/webkitpy/common/net/credentials_unittest.py:
+ * Scripts/webkitpy/common/system/executive.py: Copied from Scripts/webkitpy/executive.py.
+ * Scripts/webkitpy/common/system/executive_unittest.py: Copied from Scripts/webkitpy/executive_unittest.py.
+ * Scripts/webkitpy/executive.py: Removed.
+ * Scripts/webkitpy/executive_unittest.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/early_warning_system.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/stepsequence.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/steps/checkstyle.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/unittests.py:
+ * Scripts/webkitpy/webkit_logging_unittest.py:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move grammary.py into webkitpy.tool.
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ * Scripts/webkitpy/grammar.py: Removed.
+ * Scripts/webkitpy/grammar_unittest.py: Removed.
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/grammar.py: Copied from Scripts/webkitpy/grammar.py.
+ * Scripts/webkitpy/tool/grammar_unittest.py: Copied from Scripts/webkitpy/grammar_unittest.py.
+ * Scripts/webkitpy/tool/multicommandtool.py:
+ * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-25 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ In webkitpy, moved init/ to common/system/.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ This is part of the master bug to reorganize webkitpy.
+
+ * Scripts/webkitpy/common/system: Copied from WebKitTools/Scripts/webkitpy/init.
+ * Scripts/webkitpy/common/system/logutils.py:
+ * Scripts/webkitpy/common/system/logutils_unittest.py:
+ * Scripts/webkitpy/init: Removed.
+ * Scripts/webkitpy/init/__init__.py: Removed.
+ * Scripts/webkitpy/init/logtesting.py: Removed.
+ * Scripts/webkitpy/init/logutils.py: Removed.
+ * Scripts/webkitpy/init/logutils_unittest.py: Removed.
+ * Scripts/webkitpy/init/unittests.py: Removed.
+ * Scripts/webkitpy/python24/versioning_unittest.py:
+ * Scripts/webkitpy/style_references.py:
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move stepsequence to webkitpy.tool.commands.
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ * Scripts/webkitpy/stepsequence.py: Removed.
+ * Scripts/webkitpy/tool/commands/abstractsequencedcommand.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/stepsequence.py: Copied from Scripts/webkitpy/stepsequence.py.
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Create webkitpy.common.checkout as described in
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ * Scripts/webkitpy/changelogs.py: Removed.
+ * Scripts/webkitpy/changelogs_unittest.py: Removed.
+ * Scripts/webkitpy/commitinfo.py: Removed.
+ * Scripts/webkitpy/commitinfo_unittest.py: Removed.
+ * Scripts/webkitpy/common/checkout: Added.
+ * Scripts/webkitpy/common/checkout/__init__.py: Copied from Scripts/webkitpy/common/__init__.py.
+ * Scripts/webkitpy/common/checkout/changelog.py: Copied from Scripts/webkitpy/changelogs.py.
+ * Scripts/webkitpy/common/checkout/changelog_unittest.py: Copied from Scripts/webkitpy/changelogs_unittest.py.
+ * Scripts/webkitpy/common/checkout/commitinfo.py: Copied from Scripts/webkitpy/commitinfo.py.
+ * Scripts/webkitpy/common/checkout/commitinfo_unittest.py: Copied from Scripts/webkitpy/commitinfo_unittest.py.
+ * Scripts/webkitpy/common/checkout/diff_parser.py: Copied from Scripts/webkitpy/diff_parser.py.
+ * Scripts/webkitpy/common/checkout/diff_parser_unittest.py: Copied from Scripts/webkitpy/diff_parser_unittest.py.
+ * Scripts/webkitpy/common/checkout/scm.py: Copied from Scripts/webkitpy/scm.py.
+ * Scripts/webkitpy/common/checkout/scm_unittest.py: Copied from Scripts/webkitpy/scm_unittest.py.
+ * Scripts/webkitpy/common/net/credentials.py:
+ * Scripts/webkitpy/diff_parser.py: Removed.
+ * Scripts/webkitpy/diff_parser_unittest.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/scm.py: Removed.
+ * Scripts/webkitpy/scm_unittest.py: Removed.
+ * Scripts/webkitpy/stepsequence.py:
+ * Scripts/webkitpy/style_references.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/comments.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+ * Scripts/webkitpy/unittests.py:
+ * Scripts/webkitpy/webkitcheckout.py:
+
+2010-03-25 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ In webkitpy, moved init/versioning.py to python24/.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ This is part of the master bug to reorganize webkitpy.
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkit-patch:
+ * Scripts/webkitpy/init/unittests.py:
+ * Scripts/webkitpy/init/versioning.py: Removed.
+ * Scripts/webkitpy/init/versioning_unittest.py: Removed.
+ * Scripts/webkitpy/python24: Added.
+ * Scripts/webkitpy/python24/__init__.py: Copied from WebKitTools/Scripts/webkitpy/tool/__init__.py.
+ * Scripts/webkitpy/python24/versioning.py: Copied from WebKitTools/Scripts/webkitpy/init/versioning.py.
+ * Scripts/webkitpy/python24/versioning_unittest.py: Copied from WebKitTools/Scripts/webkitpy/init/versioning_unittest.py.
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Create webkitpy.common.net as described in
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ * Scripts/webkitpy/bugzilla.py: Removed.
+ * Scripts/webkitpy/bugzilla_unittest.py: Removed.
+ * Scripts/webkitpy/buildbot.py: Removed.
+ * Scripts/webkitpy/buildbot_unittest.py: Removed.
+ * Scripts/webkitpy/commitinfo.py:
+ * Scripts/webkitpy/common/net: Added.
+ * Scripts/webkitpy/common/net/__init__.py: Added.
+ * Scripts/webkitpy/common/net/bugzilla.py: Copied from Scripts/webkitpy/bugzilla.py.
+ * Scripts/webkitpy/common/net/bugzilla_unittest.py: Copied from Scripts/webkitpy/bugzilla_unittest.py.
+ * Scripts/webkitpy/common/net/buildbot.py: Copied from Scripts/webkitpy/buildbot.py.
+ * Scripts/webkitpy/common/net/buildbot_unittest.py: Copied from Scripts/webkitpy/buildbot_unittest.py.
+ * Scripts/webkitpy/common/net/credentials.py: Copied from Scripts/webkitpy/credentials.py.
+ * Scripts/webkitpy/common/net/credentials_unittest.py: Copied from Scripts/webkitpy/credentials_unittest.py.
+ * Scripts/webkitpy/common/net/irc: Copied from Scripts/webkitpy/irc.
+ * Scripts/webkitpy/common/net/irc/ircbot.py:
+ * Scripts/webkitpy/common/net/irc/ircproxy.py:
+ * Scripts/webkitpy/common/net/irc/messagepump_unittest.py:
+ * Scripts/webkitpy/common/net/irc/threadedmessagequeue_unittest.py:
+ * Scripts/webkitpy/common/net/irc/unittests.py:
+ * Scripts/webkitpy/common/net/networktransaction.py: Copied from Scripts/webkitpy/networktransaction.py.
+ * Scripts/webkitpy/common/net/networktransaction_unittest.py: Copied from Scripts/webkitpy/networktransaction_unittest.py.
+ * Scripts/webkitpy/common/net/statusserver.py: Copied from Scripts/webkitpy/statusserver.py.
+ * Scripts/webkitpy/credentials.py: Removed.
+ * Scripts/webkitpy/credentials_unittest.py: Removed.
+ * Scripts/webkitpy/irc: Removed.
+ * Scripts/webkitpy/irc/__init__.py: Removed.
+ * Scripts/webkitpy/irc/ircbot.py: Removed.
+ * Scripts/webkitpy/irc/ircproxy.py: Removed.
+ * Scripts/webkitpy/irc/messagepump.py: Removed.
+ * Scripts/webkitpy/irc/messagepump_unittest.py: Removed.
+ * Scripts/webkitpy/irc/threadedmessagequeue.py: Removed.
+ * Scripts/webkitpy/irc/threadedmessagequeue_unittest.py: Removed.
+ * Scripts/webkitpy/irc/unittests.py: Removed.
+ * Scripts/webkitpy/networktransaction.py: Removed.
+ * Scripts/webkitpy/networktransaction_unittest.py: Removed.
+ * Scripts/webkitpy/scm_unittest.py:
+ * Scripts/webkitpy/statusserver.py: Removed.
+ * Scripts/webkitpy/tool/bot/queueengine.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-25 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ In webkitpy, renamed MockBugzillaTool to MockTool.
+
+ * Scripts/webkitpy/tool/commands/commandtest.py:
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py:
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py:
+
+2010-03-25 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ In Scripts/webkitpy, moved webkitport.py and committers.py into
+ common/config/ (also creating common/config/).
+
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ This is part of the master bug to reorganize webkitpy.
+
+ * Scripts/validate-committer-lists:
+ * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/bugzilla_unittest.py:
+ * Scripts/webkitpy/changelogs.py:
+ * Scripts/webkitpy/commitinfo.py:
+ * Scripts/webkitpy/commitinfo_unittest.py:
+ * Scripts/webkitpy/committers.py: Removed.
+ * Scripts/webkitpy/committers_unittest.py: Removed.
+ * Scripts/webkitpy/common: Added.
+ * Scripts/webkitpy/common/__init__.py: Copied from WebKitTools/Scripts/webkitpy/style/__init__.py.
+ * Scripts/webkitpy/common/config: Added.
+ * Scripts/webkitpy/common/config/__init__.py: Copied from WebKitTools/Scripts/webkitpy/style/__init__.py.
+ * Scripts/webkitpy/common/config/committers.py: Copied from WebKitTools/Scripts/webkitpy/committers.py.
+ * Scripts/webkitpy/common/config/committers_unittest.py: Copied from WebKitTools/Scripts/webkitpy/committers_unittest.py.
+ * Scripts/webkitpy/common/config/ports.py: Copied from WebKitTools/Scripts/webkitpy/webkitport.py.
+ * Scripts/webkitpy/common/config/ports_unittest.py: Copied from WebKitTools/Scripts/webkitpy/webkitport_unittest.py.
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ * Scripts/webkitpy/tool/commands/early_warning_system.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/steps/abstractstep.py:
+ * Scripts/webkitpy/unittests.py:
+ * Scripts/webkitpy/webkitport.py: Removed.
+ * Scripts/webkitpy/webkitport_unittest.py: Removed.
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move mock_bugzillatool.py to tool/mocktool.py.
+
+ * Scripts/webkitpy/mock_bugzillatool.py: Removed.
+ * Scripts/webkitpy/tool/commands/commandtest.py:
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/mocktool.py: Copied from Scripts/webkitpy/mock_bugzillatool.py.
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py:
+
+2010-03-24 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move comments.py and multicommandtool.py to their new
+ home.
+
+ * Scripts/webkitpy/comments.py: Removed.
+ * Scripts/webkitpy/multicommandtool.py: Removed.
+ * Scripts/webkitpy/multicommandtool_unittest.py: Removed.
+ * Scripts/webkitpy/tool/commands/abstractsequencedcommand.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/openbugs.py:
+ * Scripts/webkitpy/tool/commands/queries.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/comments.py: Copied from Scripts/webkitpy/comments.py.
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/tool/multicommandtool.py: Copied from Scripts/webkitpy/multicommandtool.py.
+ * Scripts/webkitpy/tool/multicommandtool_unittest.py: Copied from Scripts/webkitpy/multicommandtool_unittest.py.
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff.py:
+ * Scripts/webkitpy/tool/steps/closepatch.py:
+ * Scripts/webkitpy/tool/steps/reopenbugafterrollout.py:
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-24 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Fixup one import statement I didn't find because the .pyc
+ masked the error.
+
+ * Scripts/webkitpy/stepsequence.py:
+
+2010-03-24 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move queueengine.py to its new home.
+
+ * Scripts/webkitpy/queueengine.py: Removed.
+ * Scripts/webkitpy/queueengine_unittest.py: Removed.
+ * Scripts/webkitpy/tool/bot/queueengine.py: Copied from Scripts/webkitpy/queueengine.py.
+ * Scripts/webkitpy/tool/bot/queueengine_unittest.py: Copied from Scripts/webkitpy/queueengine_unittest.py.
+ * Scripts/webkitpy/tool/commands/early_warning_system.py:
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-24 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Move patchcollection.py to its new home.
+
+ * Scripts/webkitpy/patchcollection.py: Removed.
+ * Scripts/webkitpy/patchcollection_unittest.py: Removed.
+ * Scripts/webkitpy/tool/bot: Added.
+ * Scripts/webkitpy/tool/bot/__init__.py: Added.
+ * Scripts/webkitpy/tool/bot/patchcollection.py: Copied from WebKitTools/Scripts/webkitpy/patchcollection.py.
+ * Scripts/webkitpy/tool/bot/patchcollection_unittest.py: Copied from WebKitTools/Scripts/webkitpy/patchcollection_unittest.py.
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-24 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ In Scripts/webkitpy, moved steps_references.py and the steps
+ folder into webkitpy/patch.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36093
+
+ * Scripts/webkitpy/steps: Removed.
+ * Scripts/webkitpy/steps/__init__.py: Removed.
+ * Scripts/webkitpy/steps/abstractstep.py: Removed.
+ * Scripts/webkitpy/steps/applypatch.py: Removed.
+ * Scripts/webkitpy/steps/applypatchwithlocalcommit.py: Removed.
+ * Scripts/webkitpy/steps/build.py: Removed.
+ * Scripts/webkitpy/steps/checkstyle.py: Removed.
+ * Scripts/webkitpy/steps/cleanworkingdirectory.py: Removed.
+ * Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py: Removed.
+ * Scripts/webkitpy/steps/closebug.py: Removed.
+ * Scripts/webkitpy/steps/closebugforlanddiff.py: Removed.
+ * Scripts/webkitpy/steps/closebugforlanddiff_unittest.py: Removed.
+ * Scripts/webkitpy/steps/closepatch.py: Removed.
+ * Scripts/webkitpy/steps/commit.py: Removed.
+ * Scripts/webkitpy/steps/confirmdiff.py: Removed.
+ * Scripts/webkitpy/steps/createbug.py: Removed.
+ * Scripts/webkitpy/steps/editchangelog.py: Removed.
+ * Scripts/webkitpy/steps/ensurebuildersaregreen.py: Removed.
+ * Scripts/webkitpy/steps/ensurelocalcommitifneeded.py: Removed.
+ * Scripts/webkitpy/steps/metastep.py: Removed.
+ * Scripts/webkitpy/steps/obsoletepatches.py: Removed.
+ * Scripts/webkitpy/steps/options.py: Removed.
+ * Scripts/webkitpy/steps/postdiff.py: Removed.
+ * Scripts/webkitpy/steps/postdiffforcommit.py: Removed.
+ * Scripts/webkitpy/steps/postdiffforrevert.py: Removed.
+ * Scripts/webkitpy/steps/preparechangelog.py: Removed.
+ * Scripts/webkitpy/steps/preparechangelogforrevert.py: Removed.
+ * Scripts/webkitpy/steps/promptforbugortitle.py: Removed.
+ * Scripts/webkitpy/steps/reopenbugafterrollout.py: Removed.
+ * Scripts/webkitpy/steps/revertrevision.py: Removed.
+ * Scripts/webkitpy/steps/runtests.py: Removed.
+ * Scripts/webkitpy/steps/steps_unittest.py: Removed.
+ * Scripts/webkitpy/steps/update.py: Removed.
+ * Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py: Removed.
+ * Scripts/webkitpy/steps/updatechangelogswithreviewer.py: Removed.
+ * Scripts/webkitpy/steps/validatereviewer.py: Removed.
+ * Scripts/webkitpy/steps_references.py: Removed.
+ * Scripts/webkitpy/stepsequence.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/steps: Copied from WebKitTools/Scripts/webkitpy/steps.
+ * Scripts/webkitpy/tool/steps/__init__.py:
+ * Scripts/webkitpy/tool/steps/applypatch.py:
+ * Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py:
+ * Scripts/webkitpy/tool/steps/build.py:
+ * Scripts/webkitpy/tool/steps/checkstyle.py:
+ * Scripts/webkitpy/tool/steps/cleanworkingdirectory.py:
+ * Scripts/webkitpy/tool/steps/cleanworkingdirectorywithlocalcommits.py:
+ * Scripts/webkitpy/tool/steps/closebug.py:
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff.py:
+ * Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py:
+ * Scripts/webkitpy/tool/steps/closepatch.py:
+ * Scripts/webkitpy/tool/steps/commit.py:
+ * Scripts/webkitpy/tool/steps/confirmdiff.py:
+ * Scripts/webkitpy/tool/steps/createbug.py:
+ * Scripts/webkitpy/tool/steps/editchangelog.py:
+ * Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py:
+ * Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py:
+ * Scripts/webkitpy/tool/steps/metastep.py:
+ * Scripts/webkitpy/tool/steps/obsoletepatches.py:
+ * Scripts/webkitpy/tool/steps/postdiff.py:
+ * Scripts/webkitpy/tool/steps/postdiffforcommit.py:
+ * Scripts/webkitpy/tool/steps/postdiffforrevert.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+ * Scripts/webkitpy/tool/steps/preparechangelogforrevert.py:
+ * Scripts/webkitpy/tool/steps/promptforbugortitle.py:
+ * Scripts/webkitpy/tool/steps/reopenbugafterrollout.py:
+ * Scripts/webkitpy/tool/steps/revertrevision.py:
+ * Scripts/webkitpy/tool/steps/runtests.py:
+ * Scripts/webkitpy/tool/steps/steps_unittest.py:
+ * Scripts/webkitpy/tool/steps/update.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittests.py:
+ * Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py:
+ * Scripts/webkitpy/tool/steps/validatereviewer.py:
+ * Scripts/webkitpy/tool/steps_references.py: Copied from WebKitTools/Scripts/webkitpy/steps_references.py.
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-24 Eric Seidel <eric@webkit.org>
+
+ Unreviewed, build fix only.
+
+ Abstract LayoutTestResults logic for easier reuse
+ https://bugs.webkit.org/show_bug.cgi?id=36579
+
+ * Scripts/webkitpy/buildbot_unittest.py: Add a missing import.
+
+2010-03-24 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Fix a stray comma to test landing an patch without review.
+
+ * Scripts/webkitpy/commitinfo.py:
+
+2010-03-24 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ In Scripts/webkitpy, moved commands_references.py and the commands
+ folder into webkitpy/patch.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36483
+
+ This is part of master bug 36093 to organize webkitpy.
+
+ * Scripts/webkitpy/commands: Removed.
+ * Scripts/webkitpy/commands/__init__.py: Removed.
+ * Scripts/webkitpy/commands/abstractsequencedcommand.py: Removed.
+ * Scripts/webkitpy/commands/commandtest.py: Removed.
+ * Scripts/webkitpy/commands/download.py: Removed.
+ * Scripts/webkitpy/commands/download_unittest.py: Removed.
+ * Scripts/webkitpy/commands/early_warning_system.py: Removed.
+ * Scripts/webkitpy/commands/early_warning_system_unittest.py: Removed.
+ * Scripts/webkitpy/commands/openbugs.py: Removed.
+ * Scripts/webkitpy/commands/openbugs_unittest.py: Removed.
+ * Scripts/webkitpy/commands/queries.py: Removed.
+ * Scripts/webkitpy/commands/queries_unittest.py: Removed.
+ * Scripts/webkitpy/commands/queues.py: Removed.
+ * Scripts/webkitpy/commands/queues_unittest.py: Removed.
+ * Scripts/webkitpy/commands/queuestest.py: Removed.
+ * Scripts/webkitpy/commands/sheriffbot.py: Removed.
+ * Scripts/webkitpy/commands/sheriffbot_unittest.py: Removed.
+ * Scripts/webkitpy/commands/upload.py: Removed.
+ * Scripts/webkitpy/commands/upload_unittest.py: Removed.
+ * Scripts/webkitpy/commands_references.py: Removed.
+ * Scripts/webkitpy/tool/commands: Copied from WebKitTools/Scripts/webkitpy/commands.
+ * Scripts/webkitpy/tool/commands/commandtest.py:
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/commands/download_unittest.py:
+ * Scripts/webkitpy/tool/commands/early_warning_system.py:
+ * Scripts/webkitpy/tool/commands/early_warning_system_unittest.py:
+ * Scripts/webkitpy/tool/commands/openbugs_unittest.py:
+ * Scripts/webkitpy/tool/commands/queries_unittest.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+ * Scripts/webkitpy/tool/commands/queuestest.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot.py:
+ * Scripts/webkitpy/tool/commands/sheriffbot_unittest.py:
+ * Scripts/webkitpy/tool/commands/upload.py:
+ * Scripts/webkitpy/tool/commands/upload_unittest.py:
+ * Scripts/webkitpy/tool/commands_references.py: Copied from WebKitTools/Scripts/webkitpy/commands_references.py.
+ * Scripts/webkitpy/tool/main.py:
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename webkitpy.patch to webkitpy.tool
+ https://bugs.webkit.org/show_bug.cgi?id=36580
+
+ This is in preparation for the great webkitpy naming cleanup.
+
+ * Scripts/webkit-patch:
+ * Scripts/webkitpy/patch: Removed.
+ * Scripts/webkitpy/patch/__init__.py: Removed.
+ * Scripts/webkitpy/patch/patcher.py: Removed.
+ * Scripts/webkitpy/tool: Copied from WebKitTools/Scripts/webkitpy/patch.
+ * Scripts/webkitpy/tool/main.py: Copied from WebKitTools/Scripts/webkitpy/patch/patcher.py.
+ * Scripts/webkitpy/tool/patcher.py: Removed.
+
+2010-03-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Abstract LayoutTestResults logic for easier reuse
+ https://bugs.webkit.org/show_bug.cgi?id=36579
+
+ * Scripts/webkitpy/buildbot.py:
+ - Split out logic into new LayoutTestResults class.
+ * Scripts/webkitpy/buildbot_unittest.py:
+ - Rename the testing class to match.
+ * Scripts/webkitpy/commands/queries.py:
+ - Use the new LayoutTestResults class.
+
+2010-03-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move Bugzilla.prompt_for_component to User.prompt_with_list for re-use
+ https://bugs.webkit.org/show_bug.cgi?id=36577
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Move prompt_for_component to User
+ * Scripts/webkitpy/commands/queries.py:
+ - Add a missing argument_names declaration.
+ * Scripts/webkitpy/user.py:
+ - Add prompt_with_list
+ - Make staticmethods classmethods for easier mocking
+
+2010-03-24 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/36572> commit-log-editor: thinks mergeChangeLogs.pl is a ChangeLog file
+
+ Reviewed by Eric Seidel.
+
+ Fixes the following error when committing a file with
+ "ChangeLog" in the name that isn't a ChangeLog (like
+ mergeChangeLogs.pl from r56471 and r56472):
+
+ $ git commit .
+ Can't open WebKitTools/Scripts/webkitperl/VCSUtils_unittest/mergeChangeLog at commit-log-editor line 132.
+ error: There was a problem with the editor 'commit-log-editor'.
+ Please supply the message using either -m or -F option.
+
+ * Scripts/commit-log-editor: Added '$' to anchor "ChangeLog" to
+ the end of the file name when searching for ChangeLog files in a
+ commit.
+
+2010-03-24 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/36570> resolve-ChangeLogs: fall back to git-merge-file if ChangeLog can't be merged
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/resolve-ChangeLogs: Switched to exec git-merge-file if
+ the merge attempt fails.
+
+2010-03-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch or pre-commit hook should validate reviewer lines before committing
+ https://bugs.webkit.org/show_bug.cgi?id=26927
+
+ Validate that patches have valid reivewers listed in their ChangeLogs
+ before landing. For patches without reviewers can be landed if their
+ ChangeLogs state that they are unreviewed.
+
+ * Scripts/webkitpy/changelogs.py:
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commitinfo.py:
+ * Scripts/webkitpy/commitinfo_unittest.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ * Scripts/webkitpy/steps/__init__.py:
+ * Scripts/webkitpy/steps/validatereviewer.py: Added.
+
+2010-03-19 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by David Levin.
+
+ Undefined names reported by pyflakes in python scripts
+ https://bugs.webkit.org/show_bug.cgi?id=36403
+
+ Attempt to use names that exist or can exist in the lexical
+ scope instead of not being available at all.
+
+ * Scripts/webkitpy/changelogs.py: Use self._content.
+ * Scripts/webkitpy/layout_tests/port/base.py: Use os.stat
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py: Use self._port
+ * Scripts/webkitpy/style/processors/cpp_unittest.py: Use expected_message_re
+
+2010-03-24 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/36560> resolve-ChangeLogs: git-rebase fails when resolve-ChangeLogs can't merge
+
+ Reviewed by Eric Seidel.
+
+ When resolve-ChangeLogs fails to merge a patch while running as
+ a git merge driver, it deletes the original file, which causes
+ an internal failure and stops git mid-merge:
+
+ fatal: Failed to execute internal merge
+
+ The fix is to use the --force switch with patch so that it will
+ always attempt to apply the patch. (The change in
+ mergeChangeLogs() for the previous commit also fixed this, but
+ adding --force also prevents any potential user interaction that
+ patch may want to display.)
+
+ * Scripts/VCSUtils.pm:
+ (mergeChangeLogs): Added --force switch to patch command. Also
+ changed to use the exit status from the patch command to
+ determine the return value for this method.
+ * Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl: Added
+ test to cover this bug.
+
+2010-03-24 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/36560> resolve-ChangeLogs: move mergeChanges() into VCSUtils package
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/VCSUtils.pm:
+ (mergeChangeLogs): Copied from mergeChanges() in
+ resolve-ChangeLogs and renamed. Added method documentation.
+ Fixed bug found by new tests where the original file to be
+ patched was deleted when cleaning up after a traditinal rejected
+ patch failed to apply.
+ * Scripts/resolve-ChangeLogs: Switched to using
+ mergeChangeLogs().
+ (mergeChanges): Moved to VCSUtils.pm and renamed to
+ mergeChangeLogs().
+ * Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl: Added.
+
+2010-03-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add support for qt's unassigned list to webkit-patch assign-to-committer
+ https://bugs.webkit.org/show_bug.cgi?id=36559
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Move Bugzilla.unassigned_email into Bug and make it a set.
+ * Scripts/webkitpy/bugzilla_unittest.py:
+ - Test the new Bug.is_unassigned method
+ * Scripts/webkitpy/commands/upload.py:
+ - Use the new Bug.is_unassigned method instead of an explicit ==
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ - Bugzilla.unassigned_email no longer needs mocking
+
+2010-03-24 Kent Hansen <kent.hansen@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Rename QWebSettings::XSSAuditorEnabled to XSSAuditingEnabled
+ https://bugs.webkit.org/show_bug.cgi?id=36522
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setXSSAuditorEnabled): Use the new name.
+
+2010-03-24 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Added to check-webkit-style support for a --debug flag.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36100
+
+ The --debug flag adjusts the logging level to DEBUG and
+ includes the logger name and level in each log message.
+
+ * Scripts/check-webkit-style:
+ - Changed the code to check for the --debug flag and pass
+ the result to the configure_logging() method.
+ * Scripts/webkitpy/style/checker.py:
+ - Added an is_debug parameter to configure_logging().
+ - Refactored configure_logging() by adding calls to
+ the following two methods: _create_log_handlers() and
+ _create_debug_log_handlers().
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Added unit tests for configure_logging() with is_debug True
+ by splitting the ConfigureLoggingTest class into
+ ConfigureLoggingTest and ConfigureLoggingTestBase, and
+ adding ConfigureLoggingDebugTest.
+ * Scripts/webkitpy/style/optparser.py:
+ - Updated the usage string.
+ - Added an is_debug data attribute to the CommandOptionValues
+ class.
+ - Added support for the --debug flag to the ArgumentParser.parse()
+ method.
+ - Also added extra error information to the parse() method in
+ the case of an invalid flag.
+ * Scripts/webkitpy/style/optparser_unittest.py:
+ - Updated the unit tests as necessary.
+ - Also fixed an issue with the CommandOptionValuesTest.test_eq()
+ unit test.
+
+2010-03-23 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add TestNavigationController and TestWebWorker
+ https://bugs.webkit.org/show_bug.cgi?id=36489
+
+ Add TestNavigationController and TestWebWorker classes, which are
+ going to be used by DumpRenderTree Chromium port. These files are
+ based on:
+ - src/webkit/tools/test_shell/test_navigation_controller.{cc,h}
+ - src/webkit/tools/test_shell/test_web_worker.h
+ of Chromium rev.40492.
+
+ TestNavigationController has non-style changes.
+ - Change ContentState type: binary string -> WebHistoryItem
+ - Remove TestShell dependency by introducing NavigationHost interface.
+
+ * DumpRenderTree/chromium/TestNavigationController.cpp: Added.
+ * DumpRenderTree/chromium/TestNavigationController.h: Added.
+ * DumpRenderTree/chromium/TestWebWorker.h: Added.
+
+2010-03-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add support for revision -> build lookup in buildbot.py and layout test result parsing
+ https://bugs.webkit.org/show_bug.cgi?id=36474
+
+ * Scripts/webkitpy/bugzilla_unittest.py: Added a FIXME about sharing code.
+ * Scripts/webkitpy/buildbot.py:
+ - Add support for looking up builds by revision number.
+ - Add support for fetching and parsing results.html files from buildbot.
+ - build_for_revision has an allow_failed_lookups option to work around the fact that
+ our buildbot's xmlrpc calls return failure on old revision numbers.
+ - Add parsing support for twisted directory listings.
+ * Scripts/webkitpy/buildbot_unittest.py:
+ - Unit test all the new code.
+ * Scripts/webkitpy/commands/queries.py:
+ - Add a new results-for command which prints all the results for a given revision (very slow due to slow revision lookup)
+
+2010-03-23 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36048
+
+ Detect if the Windows Platform SDK is missing when building with
+ Visual C++ Express Edition and inform the user to download it.
+
+ * Scripts/webkitdirs.pm:
+
+2010-03-23 Darin Adler <darin@apple.com>
+
+ Tell Subversion about more directories that expect to have .pyc files.
+
+ * Scripts/webkitpy: Modified property svn:ignore.
+ * Scripts/webkitpy/irc: Added property svn:ignore.
+
+2010-03-23 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36149
+
+ Import the GNU readline interface to modify the behavior
+ of raw_input so as to provide line editing support. In
+ particular this will prevent "delete" characters from
+ appearing in the returned value for function raw_input.
+
+ * Scripts/webkitpy/user.py:
+
+2010-03-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Remove support for Qt v4.4
+ https://bugs.webkit.org/show_bug.cgi?id=36389
+
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+ * QtLauncher/mainwindow.cpp:
+ (MainWindow::MainWindow):
+
+2010-03-22 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make build_webkit_command() pass MAKEFLAGS environment variable to make.
+ https://bugs.webkit.org/show_bug.cgi?id=36440
+
+ * Scripts/webkitpy/webkitport.py:
+ * Scripts/webkitpy/webkitport_unittest.py:
+
+2010-03-22 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Change baseline_path() to point to the upstream locations for the
+ Chromium ports. Also change the reabselining scripts to use the
+ correct functions to get the baseline directories, and fix the
+ script's sys.path to pull in simplejson correctly.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36417
+
+ * Scripts/rebaseline-chromium-webkit-tests:
+ - fix sys.path to pick up simplejson properly
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ - change baseline_path() to use webkit_baseline_path()
+ - error out correctly if we can't find the chromium base dir
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ - call baseline_path(), not chromium_baseline_path()
+
+2010-03-22 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Refactored the cpu_count() code in executive.py.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36437
+
+ * Scripts/webkitpy/executive.py:
+ - Moved the import of the multiprocessing module to the top
+ of the file rather than importing from within a function.
+
+2010-03-22 Antonio Gomes <tonikitoo@webkit.org>
+
+ Unreviewed.
+
+ Rolling out r56183: http://trac.webkit.org/changeset/56183
+
+ https://bugs.webkit.org/show_bug.cgi?id=36244
+
+ Need to roll out because this patch will be re-worked by the author
+ and other reviewers agreed on it.
+
+2010-03-22 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Created a function for getting a module-specific logging.logger
+ based on the __file__ value of the module.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35821
+
+ This function allows us to get the module-specific logger for
+ a module without having to hard-code the fully-qualified name
+ of the module in the module itself. The code can be the same
+ in every case: "_log = logutils.get_logger(__file__)".
+
+ * Scripts/webkitpy/init/logutils.py: Added.
+ - Added a module with a get_logger() function to return
+ a module-specific logger based on the module's __file__
+ variable.
+
+ * Scripts/webkitpy/init/logutils_unittest.py: Added.
+ - Added unit tests for logutils.py.
+
+ * Scripts/webkitpy/init/unittests.py:
+ - Added logutils_unittest to the list of imports.
+
+2010-03-22 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] REGRESSION (r56209): fast/media/print-restores-previous-mediatype.htm crashes
+ https://bugs.webkit.org/show_bug.cgi?id=36386
+
+ Fix the regression by implementing a null printer for Qt DRT.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::NullPrinter::NullPaintEngine::begin):
+ (WebCore::NullPrinter::NullPaintEngine::end):
+ (WebCore::NullPrinter::NullPaintEngine::type):
+ (WebCore::NullPrinter::NullPaintEngine::drawPixmap):
+ (WebCore::NullPrinter::NullPaintEngine::updateState):
+ (WebCore::NullPrinter::paintEngine):
+ (WebCore::DumpRenderTree::dryRunPrint):
+
+2010-03-20 Martin Robinson <mrobinson@webkit.org>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] eventSender.zoomPageOut() bug?
+ https://bugs.webkit.org/show_bug.cgi?id=30575
+
+ Make zoomPage{In/Out}Callback respect the 1.2f zoom factor that DRT should be using.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (zoomIn): Added.
+ (zoomOut): Added.
+ (textZoomInCallback): Use zoomIn helper function.
+ (textZoomOutCallback): Use zoomOut helper function.
+ (zoomPageInCallback): Use zoomIn helper function, which respects zoom factor.
+ (zoomPageOutCallback): Use zoomOut helper function, which respects zoom factor.
+
+2010-03-20 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after recent database API change.
+
+ * wx/browser/browser.cpp:
+ (MyApp::OnInit):
+
+2010-03-20 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Renamed UnitTestLogStream to TestLogStream in webkitpy.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36099
+
+ TestLogStream is more concise and more consistent with the name of
+ the module (logtesting rather than logunittesting) and its main
+ class (LogTesting rather than LogUnitTesting).
+
+ * Scripts/webkitpy/init/logtesting.py:
+ - Renamings.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Renamings.
+
+ * Scripts/webkitpy/style_references.py:
+ - Renamings.
+
+2010-03-20 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fixes for new method in LayoutTestController.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setSpatialNavigationEnabled):
+ * wx/build/settings.py:
+
+2010-03-20 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, tool fix.
+
+ Remove vestiges of downstream directory names to unbreak rebaselining tool.
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py: Changed paths to use WebKit repo.
+
+2010-03-20 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Re-enable the downstream test_expectations overrides file that was
+ disabled in bug 36396 / r56287.
+
+ https://bugs.chromium.org/show_bug.cgi?id=36401
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Disable the downstream override expectations temporarily to allow
+ us to test that we've upstreamed everything correctly. Also, stop
+ looking at the downstream baselines at all (now you will only be
+ able to update baselines upstream). In theory this should work, but
+ if we need to we can always add the downstream dirs back in.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36396
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+
+2010-03-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ fix typo in chromium test expectations overrides routine
+ https://bugs.webkit.org/show_bug.cgi?id=36397
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Flip the Chromium ports to look first for the test expectations
+ in LayoutTests/platform/chromium and only afterwards look in the
+ Chromium repo downstream for overrides.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36326
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-19 James Hawkins <jhawkins@chromium.org>
+
+ Unreviewed.
+
+ Add myself to the committers list.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Fix SheriffBot exception lock when we can't retrieve the first build
+ from buildbot. (I'll ask Eric to review this change after the fact,
+ but he's at lunch and I want to get the bot unlocked.)
+
+ * Scripts/webkitpy/buildbot.py:
+ * Scripts/webkitpy/buildbot_unittest.py:
+
+2010-03-19 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36380
+ websocket/tests/frame-lengths.html times out on Tiger bot
+
+ https://bugs.webkit.org/show_bug.cgi?id=35041
+ websocket/tests/frame-lengths.html / websocket/tests/simple-stress.html fail on Windows bot
+
+ Double the timeout (from 15 seconds to 30 seconds). We can increase it more, if necessary -
+ sampling the DRT process on Mac OS X takes much longer anyway, so it's better to avoid
+ timing out than to detect it early.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setWaitToDump):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::waitUntilDone):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ * Scripts/run-webkit-tests:
+
+2010-03-19 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed.
+
+ Buildfix for Qt v4.5.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::applyZoom):
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Operational tweaks to SheriffBot
+ https://bugs.webkit.org/show_bug.cgi?id=36385
+
+ These changes aren't pretty, but they're helpful to make SheriffBot
+ work operationally. I plan to iterate in these areas, but I wanted to
+ get this patch landed so I could be running the bot against TOT.
+
+ * Scripts/webkitpy/commands/sheriffbot.py:
+ * Scripts/webkitpy/irc/ircbot.py:
+ * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py:
+
+2010-03-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Help sheriff-bot avoid warning about flaky tests (and add more unit testing)
+ https://bugs.webkit.org/show_bug.cgi?id=36354
+
+ * Scripts/webkitpy/buildbot.py:
+ - Make Build creation easier to Mock and test
+ * Scripts/webkitpy/buildbot_unittest.py:
+ - Test finding green to red transitions and suspect revisions
+ * Scripts/webkitpy/commands/queries.py:
+ - Make what-broke note when builders have only failed once.
+
+2010-03-19 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Fix the rebaselining tool, which was broken by r36324 when I
+ added the concept of overridding expectations.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36374
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Misc bug fixes to make the SheriffBot actually work
+ https://bugs.webkit.org/show_bug.cgi?id=36355
+
+ With these changes, I can actually run the sheriff-bot from start to
+ finish.
+
+ * Scripts/webkitpy/irc/ircproxy.py:
+ * Scripts/webkitpy/patch/patcher.py:
+ * Scripts/webkitpy/statusserver.py:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Actually import the sheriff-bot command so we can run it. Also, move
+ the bot to #webkit-test so it doesn't cause a ruckus while we test it.
+
+ * Scripts/webkitpy/patch/patcher.py:
+ * Scripts/webkitpy/irc/ircbot.py:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Second cut at SheriffBot
+ https://bugs.webkit.org/show_bug.cgi?id=36353
+
+ This patch should contain a complete SheriffBot that's capable of
+ saying reasonable things on IRC. I had to refactor the use of
+ CommitInfo to make the SheriffBot testable, but I did the minimum
+ necessary. We should grow webkitcheckout over time to contain the
+ knowledge of ChangeLogs from scm.
+
+ * Scripts/webkitpy/commands/sheriffbot.py:
+ * Scripts/webkitpy/commands/sheriffbot_unittest.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ * Scripts/webkitpy/patch/patcher.py:
+ * Scripts/webkitpy/webkitcheckout.py: Added.
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Fix Hyatt's IRC nickname.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Add IRC nicknames for the non-reviewer committers.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ More reviewer IRC nicknames.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Add a bunch of IRC nicknames for reviewers.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-03-19 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Added USE_SYSTEM_MALLOC flag to build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=21272
+
+ Add system-alloc flag to build-webkit. It makes easy to switch
+ between system allocator and TCmalloc.
+
+ * Scripts/build-webkit:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix.
+
+ Of course, I caused a regression in the file that isn't tested. :(
+
+ * Scripts/webkitpy/statusserver.py:
+
+2010-03-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add basic "who-broke-it" command and revision -> broken builder association code
+ https://bugs.webkit.org/show_bug.cgi?id=36352
+
+ The "what-broke" command prints builders and what revisions we suspect
+ broke them. who-broke-it prints revisions and what builders we suspect
+ they broke. The sheriff-bot needs this revision to broken builder mapping
+ so this change adds it!
+
+ * Scripts/webkitpy/buildbot.py:
+ * Scripts/webkitpy/commands/queries.py:
+
+2010-03-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Simplify BuildBot core builder code for easier re-use
+ https://bugs.webkit.org/show_bug.cgi?id=36350
+
+ I simply couldn't see anything through all this Yak-hair.
+
+ * Scripts/webkitpy/buildbot.py:
+ * Scripts/webkitpy/commands/queries.py:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ committers.py should know IRC nicknames
+ https://bugs.webkit.org/show_bug.cgi?id=36349
+
+ I'll add the actual nicknames in another patch.
+
+ * Scripts/webkitpy/committers.py:
+ * Scripts/webkitpy/committers_unittest.py:
+
+2010-03-18 Anders Bakken <agbakken@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36318
+
+ QtLauncher runs as a GuiClient by default in Qt Embedded which will
+ make it try to connect to an existing GuiServer. This patch makes it
+ run like a stand-alone app.
+
+ * QtLauncher/main.cpp:
+ (LauncherApplication::LauncherApplication):
+
+2010-03-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Move find_green_to_red_transition out of "what-broke" onto Builder for easier re-use
+ https://bugs.webkit.org/show_bug.cgi?id=36345
+
+ * Scripts/webkitpy/buildbot.py:
+ * Scripts/webkitpy/commands/queries.py:
+
+2010-03-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Actually pass the IRC password to the IRC object
+ https://bugs.webkit.org/show_bug.cgi?id=36346
+
+ I wanted to do this before, but both patches were in flight. This
+ patch finally closes the loop and makes the IRCProxy system complete.
+
+ * Scripts/webkitpy/patch/patcher.py:
+
+2010-03-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a StatusServer front end to the SVNRevision table on QueueStatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=36344
+
+ No test because Browser was too hard to mock. :( I couldn't figure
+ out how to make Mock be a dictionary as well as an object.
+
+ * Scripts/webkitpy/statusserver.py:
+
+2010-03-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Split out CommitInfo class and add unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=36343
+
+ Move more logic out of "what-broke" into a shared CommitInfo
+ class so that it can be used by other commands and unit tested.
+
+ * Scripts/webkitpy/commands/queries.py:
+ * Scripts/webkitpy/commitinfo.py: Added.
+ * Scripts/webkitpy/commitinfo_unittest.py: Added.
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-18 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix LayoutTests/http/tests/appcache/max-size.html
+ https://bugs.webkit.org/show_bug.cgi?id=36207
+
+ Implement setAppCacheMaximumSize() for Qt.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setAppCacheMaximumSize):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-03-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ QueueStatusServer should be able to log broken bots
+ https://bugs.webkit.org/show_bug.cgi?id=36341
+
+ We need to add a new table to the QueueStatusServer to store persistent
+ information for the SheriffBot. The new table will keep track of which
+ bots each SVN revision broke.
+
+ * QueueStatusServer/handlers/__init__.py:
+ * QueueStatusServer/handlers/svnrevision.py: Added.
+ * QueueStatusServer/handlers/updatebase.py: Added.
+ * QueueStatusServer/handlers/updatestatus.py:
+ * QueueStatusServer/handlers/updatesvnrevision.py: Added.
+ * QueueStatusServer/index.yaml:
+ * QueueStatusServer/main.py:
+ * QueueStatusServer/model/__init__.py:
+ * QueueStatusServer/model/svnrevision.py: Added.
+ * QueueStatusServer/templates/updatesvnrevision.html: Added.
+
+2010-03-18 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Add a new method to the Qt LayoutTestController for
+ changing media type and make the DRT support dry-run printing.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::dryRunPrint):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setMediaType):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-03-18 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Add upstream LayoutTests/platform/chromium* directories to the
+ baseline search path for new-run-webkit-tests in preparation for
+ upstreaming all of the Chromium baselines. Note that this does
+ not actually create the directories themselves, but that's okay.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36324
+
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+
+2010-03-18 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36327
+ Test that a plug-in can override Node methods of its element
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (normalizeOverride):
+ (pluginInvoke):
+ Override "normalize", and call back to let a test know that the plug-in was called.
+
+2010-03-17 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Add the concept of an "overrides" file for expectations so that we
+ can store test_expectations both upstream and downstream for a port
+ that runs both in webkit.org and in a separate repository (like
+ Chromium). Also add some unit tests for the expectations module.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36249
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations_test.py: Added.
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-18 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add an overlay QGraphicsTextItem to QtLauncher so we can display FPS info
+ on the launcher and not on the terminal anymore.
+
+ [Qt] QtLauncher's FPS info should be displayed on an overlay text item
+ https://bugs.webkit.org/show_bug.cgi?id=36244
+
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+ (WebViewGraphicsBased::updateFrameRate):
+ * QtLauncher/webview.h:
+
+2010-03-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ First cut at SheriffBot
+ https://bugs.webkit.org/show_bug.cgi?id=36253
+
+ This patch contains a first attempt at writing a sheriff bot.
+ Currently, we're missing the logic that actually finds the SVN revision
+ numbers to complain about, but once we have that, we'll have the rest
+ of the infrustructure to ping IRC and to file bugs.
+
+ There's a lot to fill in for the SheriffBot, but this patch give us the
+ framework in which to do it.
+
+ This patch required a bit of refactoring of AbstractQueue because
+ SheriffBot is the first bot that doesn't process patches (it processes
+ SVN revisions). Accordingly, I've factored out AbstractPatchQueue to
+ hold the parts of AbstractQueue that are specific to dealing with
+ patches. Some of the choices here might not be obvious yet, but we can
+ tweak them as our needs become clearer.
+
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/commands/queues_unittest.py:
+ * Scripts/webkitpy/commands/sheriffbot.py: Added.
+ * Scripts/webkitpy/commands/sheriffbot_unittest.py: Added.
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ Added a MockIRC object to the mock tool.
+ * Scripts/webkitpy/multicommandtool.py:
+ Added a finalize method so the tool can disconnect from IRC
+ cleanly instead of just droping the socket.
+ * Scripts/webkitpy/multicommandtool_unittest.py:
+ * Scripts/webkitpy/patch/patcher.py:
+ Added support for talking to IRC.
+ * Scripts/webkitpy/unittests.py:
+ We should add a commands/unittests.py file at some point to make
+ the commands module more self-contained.
+
+2010-03-18 Antti Koivisto <koivisto@iki.fi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36102
+ [Qt] Scaling control API for tiled backing store
+
+ Add animated smooth zooming to Qt launcher when in tiled mode.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::zoomAnimationFinished):
+ (LauncherWindow::applyZoom):
+ (LauncherWindow::zoomIn):
+ (LauncherWindow::zoomOut):
+ * QtLauncher/webview.h:
+ (WebViewGraphicsBased::graphicsWebView):
+
+2010-03-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Support using IRC accounts with a password
+ https://bugs.webkit.org/show_bug.cgi?id=36287
+
+ Add a global option to specify an IRC password so we can use the
+ sheriffbot account (which needs a password).
+
+ * Scripts/webkitpy/irc/ircbot.py:
+ * Scripts/webkitpy/irc/ircproxy.py:
+ * Scripts/webkitpy/patch/patcher.py:
+
+2010-03-18 Eric Seidel <eric@webkit.org>
+
+ Just fixing missing parenthesis typo, no review.
+
+ * Scripts/webkitpy/commands/queries.py: '%' has higher precedence than 'or', use parentheses.
+
+2010-03-18 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Adam Roben and Anders Carlsson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36210
+ plugins/resize-from-plugin.html fails on some platforms
+
+ Turns out that most platforms don't use "cross-platform" main.cpp. Copied code added for
+ the test to their versions of the file.
+
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_set_window):
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_SetWindow):
+
+2010-03-18 Leandro Pereira <leandro@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add support to run-launcher to open the EFL example browser.
+ http://webkit.org/b/36181
+
+ * Scripts/webkitdirs.pm:
+ * Scripts/run-launcher:
+
+2010-03-18 Sergio Villar Senin <svillar@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Failing tests http/tests/misc/image-blocked-src-change.html
+ & http/tests/misc/image-blocked-src-no-change.html
+ https://bugs.webkit.org/show_bug.cgi?id=36227
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewConsoleMessage): print only the file name instead of the
+ whole URI when printing messages with local URI's
+
+2010-03-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Teach what-broke how to look up reviewer and author Committer objects by name
+ https://bugs.webkit.org/show_bug.cgi?id=36264
+
+ * Scripts/webkitpy/commands/queries.py:
+ - Add committer_by_name lookups for both reviewer and author
+ - Improve printing in the cases where lookups fail.
+ * Scripts/webkitpy/committers.py:
+ - Add committer_by_name
+ * Scripts/webkitpy/committers_unittest.py:
+ - Test committer_by_name
+
+2010-03-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ create-rollout should actually fill out the description
+ https://bugs.webkit.org/show_bug.cgi?id=36261
+
+ * Scripts/webkitpy/commands/download.py:
+ The % operator was applied to the wrong string.
+ * Scripts/webkitpy/commands/download_unittest.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ Add support for seeing what we actually do with create_bug.
+
+2010-03-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Accelerated Compositing is now default on QtWebKit so the option
+ in QtLauncher must be true as default.
+
+ [Qt] QtLauncher's Accelerated Compositing option must be true as default
+ https://bugs.webkit.org/show_bug.cgi?id=36234
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::applyPrefs):
+ (LauncherWindow::toggleAcceleratedCompositing):
+ (LauncherApplication::handleUserOptions):
+
+2010-03-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Commit queue should ignore (probably red) builders when landing rollouts
+ https://bugs.webkit.org/show_bug.cgi?id=36169
+
+ When landing a rollout, the builders are probably red, so we need to
+ ignore them in the subprocess too. Also, we might as well update the
+ working copy because we haven't validated anything about the current
+ revision prior to trying to land.
+
+ This change is testable, but it requires changing the mock executive to
+ log its arguments. That will generate a lot of expectation changes, so
+ I'd like to do that in a separate patch.
+
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-03-17 Chang Shu <chang.shu@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36139
+ [Qt] Clean up cache each time DumpRenderTree starts. This behavior
+ matches other platforms, such as mac and gtk.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+
+2010-03-17 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Turns out this needs to be a string.
+
+ * Scripts/webkitpy/bugzilla.py:
+
+2010-03-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add more infrastructure for sheriff-bot, including making what-broke more awesome
+ https://bugs.webkit.org/show_bug.cgi?id=36254
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Made the various URL methods return None when passed None.
+ * Scripts/webkitpy/bugzilla_unittest.py:
+ - Test that the url methods work as expected.
+ * Scripts/webkitpy/buildbot.py:
+ - Add a static Build.build_url so that its possible to generate a build url without a Build object.
+ - Give users a URL in _fetch_xmlrpc_build_dictionary error message.
+ * Scripts/webkitpy/changelogs.py:
+ - Add a new ChangeLogEntry class to encapsulate entry-parsing logic.
+ - Add is_path_to_changelog to greatly simplify SCM.modified_changelogs code.
+ - Make ChangeLog.parse_latest_entry_from_file a public method.
+ * Scripts/webkitpy/changelogs_unittest.py:
+ - Add tests for new ChangeLog entry parsing.
+ * Scripts/webkitpy/commands/queries.py:
+ - Make "what-broke" not print "ok" builders, only failing ones.
+ - Print much more information on failing builders, including links and authorship/reviewer information.
+ * Scripts/webkitpy/commands/queues_unittest.py:
+ - Use a fake_checkout path since fixing the cwd (as part of fixing scm_unittests.py) was breaking tests.
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ - Move MockSCM away from using os.getcwd() as that was fragile (and wrong).
+ * Scripts/webkitpy/patch/patcher.py:
+ - Remove code which was broken now that this file has moved.
+ - Code was also redundant now that SCM.find_checkout_root() exists.
+ * Scripts/webkitpy/scm.py:
+ - Greatly simplify modified_changelogs now that I understand list comprehensions.
+ - Expect ChangeLogEntry objects instead of raw strings.
+ - Add changed_files_for_revision, committer_email_for_revision and contents_at_revision
+ - Add commit_with_message argument to all sites since someone half-added it before. :(
+ - Get rid of copy/paste code using _status_regexp()
+ * Scripts/webkitpy/scm_unittest.py:
+ - Fix these tests!
+ - Add new tests for new scm code.
+ - Fix spelling of "awsome" to "awesome".
+
+2010-03-17 Daniel Bates <dbates@rim.com>
+
+ Rubber-stamped by David Levin.
+
+ Add myself to the list of reviewers.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-03-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Change post-rollout to create-rollout and have it make a new bug
+ instead of posting the rollout to the old bug.
+ https://bugs.webkit.org/show_bug.cgi?id=36250
+
+ The new bug blocks the old bug instead of adding more complexity to the
+ old bug. One tricky question is whether to create the bug if we're
+ unable to create a rollout patch. In this patch, we do create the bug,
+ but we might revist this question in the future.
+
+ * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/download_unittest.py:
+ * Scripts/webkitpy/steps/createbug.py:
+
+2010-03-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a way for the bots to send messages to IRC
+ https://bugs.webkit.org/show_bug.cgi?id=36235
+
+ We'll use these classes to notify #webkit about bad SVN revisions.
+ This patch just has some skeleton code for us to play with.
+
+ * Scripts/webkitpy/irc/__init__.py: Added.
+ * Scripts/webkitpy/irc/ircbot.py: Added.
+ A bot that knows how to talk to IRC.
+ * Scripts/webkitpy/irc/ircproxy.py: Added.
+ We need to run the bot on its own thread because the irclib needs
+ its own mainloop. This class provides an abstraction of the
+ threading.
+ * Scripts/webkitpy/irc/messagepump.py: Added.
+ * Scripts/webkitpy/irc/messagepump_unittest.py: Added.
+ * Scripts/webkitpy/irc/threadedmessagequeue.py: Added.
+ A thread-safe message queue for sending messages from the main
+ thread to the IRC thread.
+ * Scripts/webkitpy/irc/threadedmessagequeue_unittest.py: Added.
+ * Scripts/webkitpy/irc/unittests.py: Added.
+ * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py:
+ Autoinstall irclib
+ * Scripts/webkitpy/unittests.py:
+
+2010-03-17 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Fix image_diff syntax in webkitpy/port/base.py.
+ The syntax is wrong if diff_filename is specified.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36230
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+
+2010-03-16 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ Provide to QtLauncher a way to change the ViewportUpdateMode
+ when it's in graphics based mode.
+
+ [Qt] Make QtLaucher able to select the ViewportUpdateMode
+ https://bugs.webkit.org/show_bug.cgi?id=36175
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::selectViewportUpdateMode):
+ (LauncherWindow::createChrome):
+
+2010-03-17 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Ambiguous error message when building for unspecified platform
+ https://bugs.webkit.org/show_bug.cgi?id=30203
+
+ Add an extra line information to the error message.
+
+ * Scripts/webkitdirs.pm:
+
+2010-03-16 Adam Barth <abarth@webkit.org>
+
+ No review, rolling out r56044.
+ http://trac.webkit.org/changeset/56044
+ https://bugs.webkit.org/show_bug.cgi?id=36048
+
+ This patch broke Windows Debug (Tests)
+
+ * Scripts/webkitdirs.pm:
+
+2010-03-16 John Abd-El-Malek <jam@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Give keyboard focus to PluginDocuments by default
+ https://bugs.webkit.org/show_bug.cgi?id=36147
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginAllocate):
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New):
+ (NPP_SetWindow):
+ (handleEventCarbon):
+ (handleEventCocoa):
+
+2010-03-16 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Fix run-webkit-httpd on Windows.
+
+ * Scripts/webkitperl/httpd.pm:
+
+2010-03-16 Alexey Proskuryakov <ap@apple.com>
+
+ Tiger build fix.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (pluginGetProperty):
+ Added more type casts to shut down warnings.
+
+2010-03-16 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36184
+ YouTube video resizing doesn't work with OOP plug-ins
+
+ Added a resizeTo() method, which calls resizePlugin() in JS with the same arguments,
+ and a lastSetWindowArguments property, which returns a string describing the last NPWindow
+ passed to NPN_SetWindow.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginGetProperty):
+ (testResizeTo):
+ (pluginInvoke):
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_SetWindow):
+
+2010-03-16 Joanmarie Diggs <joanmarie.diggs@gmail.com>
+
+ Reviewed by Xan Lopez.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35504
+ [Gtk] Evaluate and fix AtkTable for layout tables
+
+ Implements rowCount and columnCount for Gtk in DRT.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::rowCount):
+ (AccessibilityUIElement::columnCount):
+
+2010-03-15 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add "what-broke" command for debugging when the tree broke
+ https://bugs.webkit.org/show_bug.cgi?id=36157
+
+ This is another step towards automated sheriffing of the webkit tree.
+ With this logic our scripts are able to determine what revision broke the
+ tree. Buildbot should do this for us, but unfortunately buildbot doesn't
+ expose this kind of aggregate information.
+
+ * Scripts/webkitpy/buildbot.py:
+ - Add new Builder and Build classes (which will eventually replace the custom dictionaries previously used).
+ - Split out more network logic into _fetch methods which will eventually be their own class for mocking.
+ - Use XMLRPC to communicate with the buildbot master instead of scraping build pages.
+ * Scripts/webkitpy/buildbot_unittest.py:
+ - Test the newly added buildbot classes.
+ * Scripts/webkitpy/commands/queries.py:
+ - Add an experimental what-broke command.
+
+2010-03-15 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36048
+
+ Detect if the Windows Platform SDK is missing when building with
+ Visual C++ Express Edition and inform the user to download it.
+
+ * Scripts/webkitdirs.pm:
+
+2010-03-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Let commit-queue land rollout patches even when the tree is red
+ https://bugs.webkit.org/show_bug.cgi?id=36155
+
+ Now the commit-queue will land patches whose name begins with "ROLLOUT "
+ even if the tree is red. The patches still go through the usual build
+ and test process, but they can be landed while the tree is on fire.
+
+ * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/commands/queues_unittest.py:
+ * Scripts/webkitpy/commands/queuestest.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+
+2010-03-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add webkit-patch post-rollout to upload rollouts to bugs.webkit.org for easy committing
+ https://bugs.webkit.org/show_bug.cgi?id=36154
+
+ This new command is a mashup of prepare-rollout and post. This command
+ will be used by an experimental bot to post rollouts of patches that
+ break things to bugs.webkit.org where they can be landed with the
+ greatest of ease.
+
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/download_unittest.py:
+ * Scripts/webkitpy/steps/__init__.py:
+ * Scripts/webkitpy/steps/postdiffforrevert.py: Added.
+
+2010-03-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch rollout should error out on conflicts
+ https://bugs.webkit.org/show_bug.cgi?id=36151
+
+ Instead of blindingly plowing ahead, we now throw an exception if there
+ are conflicts after applying a reverse diff.
+
+ * Scripts/webkitpy/scm.py:
+
+2010-03-15 Chris Fleizach <cfleizach@apple.com>
+
+ Unreviewed layout test fix.
+
+ VO not able to perform a VO-spacebar on facebook links
+ https://bugs.webkit.org/show_bug.cgi?id=36132
+
+ GTK needs to implement press for this test to work.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::press):
+
+2010-03-15 Chris Fleizach <cfleizach@apple.com>
+
+ Unreviewed layout test fix.
+
+ VO not able to perform a VO-spacebar on facebook links
+ https://bugs.webkit.org/show_bug.cgi?id=36132
+
+ Windows needs to implement press in DRT.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::press):
+
+2010-03-15 Chris Fleizach <cfleizach@apple.com>
+
+ Unreviewed. Fix break of layout tests on win and gtk.
+
+ VO not able to perform a VO-spacebar on facebook links
+ https://bugs.webkit.org/show_bug.cgi?id=36132
+
+ Attempting to implement press action for windows and gtk.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::press):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::press):
+
+2010-03-15 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ VO not able to perform a VO-spacebar on facebook links
+ https://bugs.webkit.org/show_bug.cgi?id=36132
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (pressCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::press):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::press):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::press):
+
+2010-03-15 Mark Rowe <mrowe@apple.com>
+
+ Add a new build slave to replace the existing SnowLeopard Leaks build slave which
+ appears to be suffering a slow and painful death at the hands of its graphics hardware.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2010-03-15 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fix a minor case where we'd deference a null pointer if we tried
+ to run new-run-webkit-tests on an unsupported platform (e.g.
+ Cygwin's python version).
+
+ https://bugs.webkit.org/show_bug.cgi?id=36076
+
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+
+2010-03-15 Darin Adler <darin@apple.com>
+
+ Tell Subversion about more directories that expect to have .pyc files.
+
+ * Scripts/webkitpy/layout_tests: Added property svn:ignore.
+ * Scripts/webkitpy/layout_tests/port: Added property svn:ignore.
+
+2010-03-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Operational scripts from running the EWS
+ https://bugs.webkit.org/show_bug.cgi?id=36097
+
+ These are the scripts I use to manage the EWS on EC2. If someone other
+ than me wants to run the EWS, these scripts might be helpful.
+
+ * EWSTools/boot.sh: Added.
+ * EWSTools/create-webkit-git: Added.
+ * EWSTools/screen-config: Added.
+ * EWSTools/start-queue.sh: Added.
+
+2010-03-14 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Fix the webkit-patch bots. Turns out they need the path of the main
+ script to run properly.
+
+ * Scripts/webkit-patch:
+ * Scripts/webkitpy/patch/patcher.py:
+
+2010-03-14 Darin Adler <darin@apple.com>
+
+ Tell Subversion about more directories that expect to have .pyc files.
+
+ * Scripts/webkitpy/init: Added property svn:ignore.
+ * Scripts/webkitpy/patch: Added property svn:ignore.
+ * Scripts/webkitpy/thirdparty: Added property svn:ignore.
+ * Scripts/webkitpy/thirdparty/autoinstalled: Added property svn:ignore.
+
+2010-03-14 Antti Koivisto <koivisto@iki.fi>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35146
+ Support tiled backing store
+
+ QtLauncher support and build flag in build-webkit.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::applyPrefs):
+ (LauncherWindow::toggleTiledBackingStore):
+ (LauncherWindow::toggleResizesToContents):
+ (LauncherWindow::createChrome):
+ (LauncherApplication::handleUserOptions):
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebViewGraphicsBased::setResizesToContents):
+ (WebViewGraphicsBased::resizeEvent):
+ * QtLauncher/webview.h:
+ * Scripts/build-webkit:
+
+2010-03-13 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ The webkit-patch script now displays a warning if run using
+ a version of Python less than 2.5. This will help users
+ understand why webkit-patch is erroring out if they are
+ using Python 2.4, for example.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31533
+
+ * Scripts/webkit-patch:
+ - Moved most of the file contents to webkitpy/patch/patcher.py
+ so the Python version can be checked before interpreting
+ any code that can cause the script to error out.
+ - Added a configure_logging() method to enable any version
+ warnings to show up.
+ - Added a main() method with calls to configure_logging(),
+ check_version(), and the main webkit patch method.
+
+ * Scripts/webkitpy/patch/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+ - This file is required to make a folder a package.
+
+ * Scripts/webkitpy/patch/patcher.py: Added.
+ - Moved code from Scripts/webkit-patch.
+
+2010-03-13 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Changed test-webkitpy so that messages logged as a side-effect
+ of unit-testing code do not get displayed to the screen. These
+ messages clutter up the unit test results if not filtered out.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35835
+
+ * Scripts/test-webkitpy:
+ - Adjusted the configure_logging() method to filter out any
+ log messages from webkitpy.
+ - Also added an INFO message stating that most console logging
+ is getting suppressed.
+
+ * Scripts/webkitpy/init/versioning.py:
+ - Added a log parameter to the check_version() method.
+
+ * Scripts/webkitpy/init/versioning_unittest.py:
+ - Qualified a call to check_version() with the parameter names.
+
+2010-03-13 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ The test-webkitpy script now warns the user if the script is
+ being run using a Python version different from the minimum
+ version the webkitpy package was meant to support.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35788
+
+ Warning developers if their Python version is too low will help
+ them understand why test-webkitpy is failing. Secondly, warning
+ developers if their Python version is higher than the minimum will
+ help them understand that their changes may not be okay for the
+ minimum supported version, even if test-webkitpy is passing.
+
+ * Scripts/test-webkitpy:
+ - Moved the "from ..._unittest import *" lines to the new
+ file Scripts/webkitpy/unittests.py. This will allow the
+ version-check warning to be displayed even if an error occurs
+ while interpreting (i.e. importing) the unit test code.
+ - Added configure_logging() to configur logging for test-webkitpy.
+ - Added an init() method to configure logging and check the
+ current Python version.
+
+ * Scripts/webkitpy/init/unittests.py: Added.
+ - Added a file to import all unit test modules in the
+ webkitpy.init package.
+
+ * Scripts/webkitpy/init/versioning.py: Added.
+ - Added a _MINIMUM_SUPPORTED_PYTHON_VERSION variable and set
+ it equal to 2.5.
+ - Added a compare_version() method to compare the current Python
+ version against a target version.
+ - Added a check_version() method to check the current Python
+ version against the current minimum supported version, and to
+ log a warning message if the check fails.
+
+ * Scripts/webkitpy/init/versioning_unittest.py: Added.
+ - Added unit tests for the functions in versioning.py.
+
+ * Scripts/webkitpy/style/unittests.py:
+ - Fixed/updated a code comment.
+
+ * Scripts/webkitpy/unittests.py: Added.
+ - Moved the "from ..._unittest import *" lines from test-webkitpy.
+
+2010-03-13 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Moved all code in webkitpy/__init__.py to another location.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35828
+
+ Keeping webkitpy/__init__.py free of non-trivial code allows
+ calling code to import initialization code from webkitpy
+ before any errors or log messages occur due to code in
+ __init__.py. Such initialization code can include things like
+ version checking code and logging configuration code. This
+ also lets us move the autoinstall initialization code to a
+ location where it only executes if it is needed -- something
+ we have done in this patch.
+
+ * Scripts/webkitpy/__init__.py:
+ - Moved all executable code to the following location:
+ webkitpy/thirdparty/autoinstalled/__init__.py
+ - Added a code comment to keep this file free of non-trivial
+ code.
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/networktransaction.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/networktransaction_unittest.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/statusserver.py:
+ - Updated mechanize import statement.
+
+ * Scripts/webkitpy/thirdparty/autoinstalled/__init__.py: Added.
+ - Copied the code from webkitpy/__init__.py and updated it
+ as necessary.
+
+2010-03-13 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Moved webkitpy/mock.py into webkitpy/thirdparty since it is
+ third-party code.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35499
+
+ Updated the import statement in all of the below except where noted.
+
+ * Scripts/webkitpy/bugzilla_unittest.py:
+ * Scripts/webkitpy/commands/commandtest.py:
+ * Scripts/webkitpy/commands/download_unittest.py:
+ * Scripts/webkitpy/commands/early_warning_system_unittest.py:
+ * Scripts/webkitpy/commands/queries_unittest.py:
+ * Scripts/webkitpy/commands/queues_unittest.py:
+ * Scripts/webkitpy/commands/queuestest.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+ * Scripts/webkitpy/commands_references.py: Added.
+ - Added a file containing an absolute import of Mock so that
+ the imports in the commands folder can import from this file
+ (similar to style_references.py). This helps limit the
+ number of affected files in future refactorings.
+
+ * Scripts/webkitpy/credentials_unittest.py:
+ * Scripts/webkitpy/mock.py: Removed.
+ - Moved to Scripts/webkitpy/thirdparty.
+
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ * Scripts/webkitpy/patchcollection_unittest.py:
+ * Scripts/webkitpy/steps/closebugforlanddiff_unittest.py:
+ * Scripts/webkitpy/steps/steps_unittest.py:
+ * Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py:
+ * Scripts/webkitpy/steps_references.py: Added.
+ - Added a file containing an absolute import of Mock so that
+ the imports in the steps folder can import from this file
+ (similar to style_references.py). This helps limit the
+ number of affected files in future refactorings.
+
+ * Scripts/webkitpy/thirdparty/mock.py: Copied from WebKitTools/Scripts/webkitpy/mock.py.
+ - Also eliminated trailing white space and carriage returns.
+
+2010-03-12 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Amend incorrect typo patch for QtLauncher.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35877
+
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+
+2010-03-13 Victor Wang <victorw@chromium.org>
+
+ Add appengine app to host and serve webkit layout test results.
+
+ The app allows you post test result files (json) and serve them up.
+ Chromium flakiness dashboard will first use this app to host results.json
+ and expectations.json, but the files hosted by this app are not limited
+ to chromium results or json files. It can be used to host other files if needed.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35944
+
+ * TestResultServer: Added.
+ * TestResultServer/app.yaml: Added.
+ * TestResultServer/handlers: Added.
+ * TestResultServer/handlers/__init__.py: Added.
+ * TestResultServer/handlers/menu.py: Added.
+ * TestResultServer/handlers/testfilehandler.py: Added.
+ * TestResultServer/index.yaml: Added.
+ * TestResultServer/main.py: Added.
+ * TestResultServer/model: Added.
+ * TestResultServer/model/__init__.py: Added.
+ * TestResultServer/model/testfile.py: Added.
+ * TestResultServer/stylesheets: Added.
+ * TestResultServer/stylesheets/form.css: Added.
+ * TestResultServer/stylesheets/menu.css: Added.
+ * TestResultServer/stylesheets/testfile.css: Added.
+ * TestResultServer/templates: Added.
+ * TestResultServer/templates/menu.html: Added.
+ * TestResultServer/templates/showfilelist.html: Added.
+ * TestResultServer/templates/uploadform.html: Added.
+
+2010-03-13 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by David Levin.
+
+ new-run-webkit-tests fails with --debug option.
+ https://bugs.webkit.org/show_bug.cgi?id=36067
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-13 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add "Show FPS" menu option to QtLauncher.
+
+ [Qt] QtLauncher need a menu option to show/hide FPS
+ https://bugs.webkit.org/show_bug.cgi?id=35794
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::showFPS):
+ (LauncherWindow::createChrome):
+
+2010-03-13 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add a "Toggle FullScreen" option to QtLauncher Menu.
+
+ [Qt] QtLauncher needs an option to toggle FullScreen Mode
+ https://bugs.webkit.org/show_bug.cgi?id=35755
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::init):
+ (LauncherWindow::eventFilter):
+ (LauncherWindow::initializeView):
+ (LauncherWindow::toggleFullScreenMode):
+ (LauncherWindow::createChrome):
+
+2010-03-12 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Fix typo in websocket_server (path_from_base instead of
+ path_from_chromium_base).
+
+ https://bugs.webkit.org/show_bug.cgi?id=36074
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-03-12 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ new-run-webkit-tests --new-baseline doesn't work at all.
+
+ It attempts to call a method that isn't defined. To fix it, I
+ removed the unnecessary and unnecessarily confusing 'platform'
+ argument to the test_type constructor and use the Port object that
+ is passed in instead, since we are only ever generating a baseline
+ from the port that is currently executing.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36046
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+
+2010-03-12 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Fix new-run-webkit-tests --run-singly
+
+ This script option is currently broken - the script attempts to
+ dereference methods and variables that don't exist, which causes
+ the Chromium Linux valgrind bot to be quite unhappy. This has been
+ broken since r54449 when I renamed Port.start_test_driver to
+ Port.start_driver.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36042
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+
+2010-03-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Fix critical being printed to stderr on every test. This is
+ because the jar is only being created when soup hits the HTTP
+ path. We should reconsider the time of its creation.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2010-03-12 Adam Roben <aroben@apple.com>
+
+ Teach prepare-ChangeLog to find modified selectors in CSS files
+
+ Reviewed by Tim Hatcher.
+
+ Fixes <http://webkit.org/b/36064> prepare-ChangeLog should extract
+ modified selectors from CSS files
+
+ * Scripts/prepare-ChangeLog:
+ (get_function_line_ranges): Call get_selector_line_ranges_for_css for
+ .css files.
+ (get_selector_line_ranges_for_css): Added. Finds selectors and their
+ line ranges and returns them.
+
+2010-03-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Build fix (for EWS). Make sure the new code builds on older soup.
+
+ Thanks to Dan Winship.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setAlwaysAcceptCookies):
+
+2010-03-12 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Eric Carlson.
+
+ [GTK] DRT does not handle cookie policy setting
+ https://bugs.webkit.org/show_bug.cgi?id=36056
+
+ Implement cookie accept policy setting for GTK+'s LayoutTestController.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setAlwaysAcceptCookies):
+
+2010-03-12 Adam Langley <agl@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium]: update Linux layout test scripts for RedHat like systems.
+
+ (Tested on Fedora 12.)
+
+ https://bugs.webkit.org/show_bug.cgi?id=35867
+
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+
+2010-03-12 Adam Roben <aroben@apple.com>
+
+ Make svn-create-patch's diffs of ObjC header files more readable
+
+ Fixes <http://webkit.org/b/36055>.
+
+ Reviewed by John Sullivan.
+
+ * Scripts/svn-create-patch:
+ (diffOptionsForFile): Added. Returns the options that should be passed
+ to diff for the given file. All the options are the same for all
+ files, except for the option to specify which lines should be used as
+ hunk headers.
+ (generateDiff): Use diffOptionsForFile to get the options to pass to
+ diff.
+ (hunkHeaderLineRegExForFile): Added. Returns the regular expression
+ that should be used by diff to identify lines that should be included
+ after the "@@" in the hunk header lines of the diff. For ObjC[++]
+ source files, we use any lines starting with -, +, or
+ @implementation/@interface/@protocol. For ObjC[++] header files (which
+ we assume to be any .h files in a mac/ or objc/ directory), we use any
+ lines starting with @implementation/@interface/@protocol.
+
+2010-03-12 Jochen Eisinger <jochen@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Introduce setWillSendRequestClearHeader to LayoutTestController to selectively remove headers in willSendRequest. Used in http/tests/security/no-referrer.html
+ https://bugs.webkit.org/show_bug.cgi?id=35920
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setWillSendRequestClearHeaderCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::willSendRequestClearHeaders):
+ (LayoutTestController::setWillSendRequestClearHeader):
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::willSendRequest):
+
+2010-03-11 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed.
+
+ Fix typo in websocket_server.py
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-03-11 Garret Kelly <gdk@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Fixing minor typo in the commit queue status page.
+ https://bugs.webkit.org/show_bug.cgi?id=35979
+
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-03-11 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed.
+
+ Fix for WebSocket layout test runner on chromium/win port.
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: register_cygwin and set CYGWIN_PATH
+
+2010-03-11 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by David Kilzer.
+
+ <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+ Default to using the appropriate SDK if the target Mac OS X version is not the current Mac OS X version.
+
+ * DumpRenderTree/mac/Configurations/Base.xcconfig:
+
+2010-03-11 Victor Wang <victorw@chromium.org>
+
+ Reviewed by dglazkov@chromium.org.
+
+ rebaseline_chromium_webkit_tests can generate new baselines for
+ all platforms so it needs to know two ports in order to work correctly:
+ the port that the script is running on and the port that it generates
+ new baselines for. Update rebaselining tool to handle both port correctly.
+
+ https://bugs.webkit.org/show_bug.cgi?id=36032
+
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-03-11 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Tim Hatcher.
+
+ <rdar://problem/7745082> Make it possible to build WebKit for older Mac OS X versions from the current Mac OS X version
+
+ Introduce TARGET_MAC_OS_X_VERSION_MAJOR to represent the Mac OS X version that is being targeted. It defaults to the
+ current Mac OS X version unless otherwise specified.
+
+ Key off TARGET_MAC_OS_X_VERSION_MAJOR where we'd previously been keying off MAC_OS_X_VERSION_MAJOR.
+
+ Explicitly map from the target Mac OS X version to the preferred compiler since Xcode's default compiler choice
+ may not be usable when targetting a different Mac OS X version.
+
+ Key off TARGET_GCC_VERSION rather than MAC_OS_X_VERSION_MAJOR in locations where we'd previously been keying off
+ MAC_OS_X_VERSION_MAJOR but the decision is really related to the compiler version being used.
+
+ * DumpRenderTree/mac/Configurations/Base.xcconfig:
+ * DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
+ * DumpRenderTree/mac/DumpRenderTree.mm: Wrap the include of mach-o/getsect.h in 'extern "C"' as some versions of the
+ header in older SDKs do not do this inside the header.
+
+2010-03-11 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35965
+ <rdar://problem/7742771> Crash when passing an object returned from plug-in back to the plug-in
+
+ Made rememberedObject a member of PluginObject. A plug-in must not use its references
+ to browser NPObjects after being destroyed, but this wasn't the case with static variable.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginInvoke):
+ (pluginInvalidate):
+ (pluginAllocate):
+ (pluginDeallocate):
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+
+2010-03-11 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35905
+ REGRESSION(55699?): media/video-no-autoplay.html times out on Leopard Commit Bot
+
+ Make sure we reset the WebGL preference, so that WebGL doesn't get left
+ on after being enabled via layoutTestController.overridePreference(),
+ which in turn causes accelerated compositing to be enabled on Leopard
+ when we don't want it to be.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+
+2010-03-10 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ rebaseline_chromium_webkit_tests doesn't handle other plaforms
+ correctly (e.g., if you run on the Mac platform and try to
+ rebaseline the WIN results, the result gets written into
+ platform/mac instead of platform/chromium-win). Also, this script
+ doesn't work on non-Chromium ports, so we need to fix that at some
+ point.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35982
+
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-03-10 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35840
+
+ Updates the subroutine builtDylibPathForName() so that it adds the "d" suffix to
+ the QtWebKit library name on Windows. This change makes run-launcher work again
+ under Windows. Moreover, this change corresponds to the change made in change-
+ set 53924 <http://trac.webkit.org/changeset/53924>.
+
+ * Scripts/webkitdirs.pm:
+
+2010-03-10 Adam Roben <aroben@apple.com>
+
+ Roll out the prepare-ChangeLog part of r55870
+
+ This change wasn't needed (prepare-ChangeLog calls svn-create-patch
+ when it's asked to print out diffs for the user) and was screwing up
+ its ability to find changed function names.
+
+ * Scripts/prepare-ChangeLog:
+ (diffCommand): Change the options we pass to svn-diff back to their
+ pre-r55870 form.
+
+2010-03-10 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Add Support for WebKitEnableCaretBrowsing to Qt DRT
+
+ Unskip test fast/events/multiline-link-arrow-navigation.html
+
+ https://bugs.webkit.org/show_bug.cgi?id=35593
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::overridePreference):
+ (LayoutTestController::setCaretBrowsingEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-03-10 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ QtLauncher: Fix typo in conditional statement in
+ WebViewGraphicsBased::setFrameRateMeasurementEnabled.
+
+ '=' should be '=='!
+
+ https://bugs.webkit.org/show_bug.cgi?id=35877
+
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+
+2010-03-10 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Refactored and cleaned up the code for unit-testing logging.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35845
+
+ * Scripts/webkitpy/init/logtesting.py:
+ - Added more information to the module docstring.
+ - Added an assertMessages() method to the UnitTestLogStream
+ class. This simplifies the calling code.
+ - Renamed the UnitTestLog class to LogTesting, and reformulated
+ it as follows:
+ - Moved the logging configuration code from the __init__
+ method to a new static setUp() method.
+ - Documented the __init__ method to be private.
+ - Improved the code so that the root logger does not have
+ its logging level changed. Instead we set the handler's
+ level. This makes the unit testing more unintrusive.
+ - Updated the assertMessages() method to call the
+ UnitTestLogStream class's assertMessages() method.
+ - More fully documented the class.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added a logger parameter to the configure_logging() method.
+ This allows us to prevent test messages from being sent
+ to the root logger during unit testing, which may be
+ rendering to the screen, etc.
+ - Simplified the code by removing the _LevelLoggingFilter class.
+ - Replaced the _LevelLoggingFilter class with a one-line lambda
+ expression in configure_logging().
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Changed relative imports to absolute to comply more with PEP8.
+ - In the ConfigureLoggingTest class:
+ - Changed the setUp() method to prevent test messages from
+ being propagated to the root logger.
+ - Changed the _log() method to a data attribute.
+ - Updated to accommodate changes to logtesting.py.
+
+ * Scripts/webkitpy/style_references.py:
+ - Updated an import statement.
+
+2010-03-10 Evan Martin <evan@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Python code for GDB 7 to support native printing of some WebCore types.
+
+ * gdb/webcore.py: Added.
+
+2010-03-10 Adam Roben <aroben@apple.com>
+
+ Make svn-create-patch and prepare-ChangeLog show better section
+ headings for ObjC files
+
+ This makes the text at the end of each "@@" line in a diff actually
+ show the ObjC method or interface that contains the change, rather
+ than whatever the most-recently-defined C function was.
+
+ Fixes <http://webkit.org/b/35970>.
+
+ Reviewed by John Sullivan.
+
+ * Scripts/svn-create-patch: Pass -F'^[-+@]' to diff so that it will
+ treat any lines starting with -, +, or @ as section heading lines.
+ This works well for ObjC files, and shouldn't affect other types of
+ files.
+
+ * Scripts/prepare-ChangeLog: Changed the options passed to diff to
+ match those used in svn-create-patch.
+
+2010-03-10 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Link QtLauncher against the WebKit library using a relative rpath.
+
+ This makes the launcher and the lib relocatable.
+
+ * QtLauncher/QtLauncher.pro:
+
+2010-03-10 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [iExploder] Add new CSS Properties and HTML Attributes
+
+ The update-iexploder-cssproperties script was used to update
+ the various input files. The autobuffer HTML Attribute was removed
+ from WebKit and I manually added it back to the htmlattrs.in like
+ we have done it for other attributes in the past.
+
+ * iExploder/htdocs/cssproperties.in:
+ * iExploder/htdocs/htmlattrs.in:
+ * iExploder/htdocs/htmltags.in:
+
+2010-03-09 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed.
+
+ Obvious fix for --cgi-paths of pywebsocket.
+
+ * Scripts/run-webkit-websocketserver:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-03-09 Jakub Wieczorek <jwieczorek@webkit.org>
+
+ Unreviewed.
+
+ Adding myself to committers.py.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-03-09 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Nate Chapin.
+
+ Fix --clobber-old-results in new-run-webkit-tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35778
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-09 Andy Estes <aestes@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ Add the ability to dispatch scroll wheel events in DRT. This was
+ necessary in order to write a test for
+ https://bugs.webkit.org/show_bug.cgi?id=34700.
+
+ * DumpRenderTree/mac/EventSendingController.mm: Add support for two
+ new methods to EventSender: mouseScrollBy(x, y) and
+ continuousMouseScrollBy(x, y). The API to generate scroll events on
+ the mac was added in 10.5, so these methods are NOOPs on Tiger.
+ (+[EventSendingController isSelectorExcludedFromWebScript:]):
+ Regiester mouseScrollByX:andY: and continuousMouseScrollByX:andY:
+ (+[EventSendingController webScriptNameForSelector:]): Map JavaScript
+ method names to ObjC selectors.
+ (-[EventSendingController mouseScrollByX:andY:continuously:]): Generate
+ a scroll wheel event using CGEventCreateScrollWheelEvent() and dispatch
+ it to WebKit.
+ (-[EventSendingController continuousMouseScrollByX:andY:]): Generate a
+ continuous scrolling event by x and y pixels.
+ (-[EventSendingController mouseScrollByX:andY:]): Generate a notchy
+ scrolling event by x and y lines.
+
+2010-03-09 Chris Fleizach <cfleizach@apple.com>
+
+ DRT build fix for Tiger. No review.
+
+ AX: hit testing a list box doesn't work anymore
+ https://bugs.webkit.org/show_bug.cgi?id=35893
+
+ * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+ (AccessibilityController::elementAtPoint):
+
+2010-03-09 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: hit testing a list box doesn't work anymore
+ https://bugs.webkit.org/show_bug.cgi?id=35893
+
+ * DumpRenderTree/AccessibilityController.cpp:
+ (getElementAtPointCallback):
+ (AccessibilityController::getJSClass):
+ * DumpRenderTree/AccessibilityController.h:
+ * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+ (AccessibilityController::elementAtPoint):
+ * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+ (AccessibilityController::elementAtPoint):
+ * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+ (AccessibilityController::elementAtPoint):
+
+2010-03-03 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ pywebsocket should support html and cgi in the same directory.
+ https://bugs.webkit.org/show_bug.cgi?id=34879
+
+ Import pywebsocket 0.4.9.2
+ Specify --server-host 127.0.0.1, so that it only binds listening socket
+ to 127.0.0.1 to prevent access from non-localhost.
+ Change --cgi-paths from /websocket/tests/cookies to /websocket/tests,
+ because pywebsocket 0.4.9.2 supports html and cgi in the same directory
+ and only executable (httponly-cookies.pl) will be handled as cgi
+ script.
+
+ * Scripts/run-webkit-tests:
+ * Scripts/run-webkit-websocketserver:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/thirdparty/pywebsocket/README.webkit:
+ * Scripts/webkitpy/thirdparty/pywebsocket/example/echo_client.py:
+ * Scripts/webkitpy/thirdparty/pywebsocket/example/handler_map.txt: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/standalone.py:
+ * Scripts/webkitpy/thirdparty/pywebsocket/mod_pywebsocket/util.py:
+ * Scripts/webkitpy/thirdparty/pywebsocket/setup.py:
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/test_util.py:
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/README: Added.
+ * Scripts/webkitpy/thirdparty/pywebsocket/test/testdata/hello.pl: Added.
+
+2010-03-09 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Simplified check-webkit-style's argument parsing code by removing
+ support for the vestigial "extra flag values" parameter.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34677
+
+ The "extra flag values" parameter was needed before WebKit
+ forked check-webkit-style from Google. It was used to pass
+ through the option parser those command-line flags that WebKit
+ required but that Google's parser did not support (the --git-commit
+ flag in particular).
+ We can remove the parameter now because it is no longer
+ needed and unnecessarily clutters the argument-parsing code.
+
+ * Scripts/webkitpy/style/optparser.py:
+ - Removed the extra_flag_values parameter from the
+ CommandOptionValues class's constructor.
+ - Removed the extra_flags parameter from the ArgumentParser
+ class's parse() method.
+
+ * Scripts/webkitpy/style/optparser_unittest.py:
+ - Removed from the unit tests all references to the
+ extra_flag_values variable.
+
+2010-03-08 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add EventSender
+ https://bugs.webkit.org/show_bug.cgi?id=35859
+
+ Add EventSender classes, which are going to be used by
+ DumpRenderTree Chromium port. These files are based on:
+ - src/webkit/tools/test_shell/event_sending_controller.cc
+ - src/webkit/tools/test_shell/event_sending_controller.h
+ of Chromium rev.40492.
+
+ * DumpRenderTree/chromium/EventSender.cpp: Added.
+ * DumpRenderTree/chromium/EventSender.h: Added.
+
+2010-03-08 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add PlainTextController and TextInputController
+ https://bugs.webkit.org/show_bug.cgi?id=35852
+
+ Add PlainTextController and TextInputController classes, which are going
+ to be used by DumpRenderTree Chromium port. These files are based on:
+ - src/webkit/tools/test_shell/plain_text_controller.{cc,h} and
+ - src/webkit/tools/test_shell/text_input_controller.{cc,h}
+ of Chromium rev.40492.
+
+ * DumpRenderTree/chromium/PlainTextController.cpp: Added.
+ * DumpRenderTree/chromium/PlainTextController.h: Added.
+ * DumpRenderTree/chromium/TextInputController.cpp: Added.
+ * DumpRenderTree/chromium/TextInputController.h: Added.
+
+2010-03-08 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, Chromium build fix.
+
+ Reverting r55689.
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-08 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Fix webkit-patch post and land to work well with security bug
+ https://bugs.webkit.org/show_bug.cgi?id=35733
+
+ Bugzilla requires authentication to access security bug page,
+ so call authenticate() if it failed to fetch bug page.
+
+ * Scripts/webkitpy/bugzilla.py:
+
+2010-03-04 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitry Glazkov.
+
+ Fix --clobber-old-results in new-run-webkit-tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35778
+
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-03-08 Brady Eidson <beidson@apple.com>
+
+ Reviewed by NOBODY (but suggested by Steve Falkenburg and fixing a boneheaded mistake on my part last week)
+
+ Followup to https://bugs.webkit.org/show_bug.cgi?id=35532
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::apiTestGoToCurrentBackForwardItem): Can't pass in a null BOOL to WebKit APIs.
+
+2010-03-08 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Fixed incorrect import statement in validate-committer-lists:
+ webkitpy.BeautifulSoup -> webkitpy.thirdparty.BeautifulSoup.
+
+ * Scripts/validate-committer-lists:
+
+2010-03-08 Jian Li <jianli@chromium.org>
+
+ Reviewed by Dmitry Titov.
+
+ Blob.slice support.
+ https://bugs.webkit.org/show_bug.cgi?id=32993
+
+ Add ENABLE_BLOB_SLICE feature define and flag for build-webkit. It is
+ currently only turned on for Mac.
+
+ * Scripts/build-webkit:
+
+2010-03-08 Gustavo Noronha Silva <gns@gnome.org>
+
+ No review, rolling out r55662.
+ http://trac.webkit.org/changeset/55662
+ https://bugs.webkit.org/show_bug.cgi?id=35863
+
+ Need to be coordinated with bots setup
+
+ * Scripts/run-webkit-tests:
+
+2010-03-08 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Holger Freyther.
+
+ [GTK] Tests fail when running with ipv6 addresses available, on Debian systems
+ https://bugs.webkit.org/show_bug.cgi?id=35863
+
+ If running on a Debian-based system, also listen on the ipv6 address.
+
+ * Scripts/run-webkit-tests:
+
+2010-03-08 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Darin Adler.
+
+ [iexploder] Automatically update htmltags.in and htmlattrs.in too
+ https://bugs.webkit.org/show_bug.cgi?id=33755
+
+ Change the update-iexploder-cssproperites script to update
+ the htmlattrs.in and htmltags.in of WebKitTools/iExploder/htdocs
+ automatically as well.
+
+ Change the reading and writing code to work with parameters
+ and extend the method that is parsing the .in files to handle
+ the HTMLTagNames.in and the HTMLAttributeNames.in files.
+
+ Remove custom code to determine the revision of files with a
+ utility of VCUtils.pm to determine the revision of the directory
+ these files are located in. This will also work with git checkout.
+
+ * Scripts/update-iexploder-cssproperties:
+
+2010-03-07 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ check-webkit-style: false positive for empty loop
+ https://bugs.webkit.org/show_bug.cgi?id=35717
+
+ * Scripts/webkitpy/style/processors/cpp.py:
+ * Scripts/webkitpy/style/processors/cpp_unittest.py:
+
+2010-03-07 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add AccessibilityController and AccessibilityUIElement
+ https://bugs.webkit.org/show_bug.cgi?id=35774
+
+ Add AccessibilityController and AccessibilityUIElement classes,
+ which are going to be used by DumpRenderTree Chromium port. These
+ files are based on:
+ - src/webkit/tools/test_shell/accessibility_controller.{cc,h} and
+ - src/webkit/tools/test_shell/accessibility_ui_element.{cc,h}
+ of Chromium rev.40492.
+
+ * DumpRenderTree/chromium/AccessibilityController.cpp: Added.
+ * DumpRenderTree/chromium/AccessibilityController.h: Added.
+ * DumpRenderTree/chromium/AccessibilityUIElement.cpp: Added.
+ * DumpRenderTree/chromium/AccessibilityUIElement.h: Added.
+
+2010-03-06 Hironori Bono <hbono@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [Chromium] Typing into Flash with wmode = opaque|transparent and
+ non-latin language active outputs as if US keyboard layout active
+
+ https://bugs.webkit.org/show_bug.cgi?id=34936
+
+ To test keyboard events on the test plugin, this change implements
+ NPCocoaEventKeyDown and NPCocoaEventKeyUp handlers so the plugin
+ can write log messages.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (handleEventCocoa): Implemented the event handlers for NPCocoaKeyDown
+ and NPCocoaEventKeyUp.
+
+2010-03-05 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix Print option on QtLauncher by calling print directly from QWebFrame.
+
+ [Qt] QtLauncher Print option is not working on QGraphicsView mode
+ https://bugs.webkit.org/show_bug.cgi?id=35769
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::print):
+
+2010-03-05 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Changed the logging code for new-run-webkit-tests to use
+ module-specific loggers rather than the root logger. This is
+ a standard practice that allows logging specific to a package
+ to be configured independently of other modules.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35194
+
+ Added a line of the form "_log = logging.getLogger(<module>)"
+ to each module below, where <module> is the fully-qualified
+ name of the module, and updated the log lines to use the new
+ _log logger.
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ * Scripts/webkitpy/layout_tests/port/http_server_base.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+2010-03-05 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Siedel.
+
+ Split the command-line invocation of the Chromium/python LigHTTPd
+ server implementation out into its own top level script to make it
+ a more "public" interface and to resolve some awkward layering
+ issues. This script will be called directly by other test scripts in
+ the Chromium tree.
+
+ At some point this script should be made to work with Apache-based
+ implementations and on other ports. I have filed
+ https://bugs.webkit.org/show_bug.cgi?id=35820 for this.
+
+ Also fix a bug in port/factory where options.chromium could be
+ dereferenced even if it wasn't set, raising an exception.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35812
+
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ * Scripts/new-run-webkit-httpd: Added
+
+2010-03-02 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Holger Freyther
+ Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+ [Gtk] Implement setSpatialNavigationEnabled in DRT.
+ https://bugs.webkit.org/show_bug.cgi?id=35705
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setSpatialNavigationEnabled):
+
+2010-02-23 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+ Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+ Add toggle on/off stub methods for Spatial Navigation in win, gtk and mac LayoutTestController class implementations.
+ https://bugs.webkit.org/show_bug.cgi?id=35699
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setSpatialNavigationEnabledCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setSpatialNavigationEnabled):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setSpatialNavigationEnabled):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setSpatialNavigationEnabled):
+
+2010-02-18 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+ Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+ Add toggle on/off mechanism for Spatial Navigation in QtLauncher.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::toggleSpatialNavigation):
+ (LauncherWindow::setupUI):
+
+2010-03-02 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Hausmann.
+ Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+ [Qt] Add setSpatialNavigationEnabled method DRT
+ https://bugs.webkit.org/show_bug.cgi?id=33715
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setSpatialNavigationEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+ Unskipped fast/events/spatialnavigation/
+
+2010-03-04 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Alice Liu.
+
+ Find the framework relative to TARGET_BUILD_DIR as that has a more obvious value during production builds.
+
+ * Scripts/check-for-webkit-framework-include-consistency:
+
+2010-03-04 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add CppVariant and CppBoundClass
+ https://bugs.webkit.org/show_bug.cgi?id=35634
+
+ Add CppVariant and CppBoundClass classes, which are going to be
+ used by DumpRenderTree Chromium port. These files are based on:
+ - src/webkit/glue/cpp_variant.{cc,h} and
+ - src/webkit/glue/cpp_bound_class.{cc,h}
+ of Chromium rev.40492.
+
+ * DumpRenderTree/chromium/CppBoundClass.cpp: Added.
+ * DumpRenderTree/chromium/CppBoundClass.h: Added.
+ * DumpRenderTree/chromium/CppVariant.cpp: Added.
+ * DumpRenderTree/chromium/CppVariant.h: Added.
+
+2010-03-04 Mark Rowe <mrowe@apple.com>
+
+ Build fix for older versions of Ruby.
+
+ * Scripts/check-for-webkit-framework-include-consistency:
+
+2010-03-04 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add a script to verify that WebKit framework headers are internally consistent.
+
+ This script detects the following problematic situations:
+ * An exported WebKit header that includes a header from WebCore.
+ * An exported WebKit header that includes a header that does not exist in the WebKit framework.
+ * A public WebKit header that includes a private WebKit header.
+
+ * Scripts/check-for-webkit-framework-include-consistency: Added.
+
+2010-03-04 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Roben.
+
+ Making sure that the correct path is set before invoking
+ DumpRenderTree on cygwin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35768
+
+ * Scripts/run-webkit-tests:
+
+2010-03-04 Simon Fraser <simon.fraser@apple.com>
+
+ Revert the exceptions I just added, and make the error clearer.
+
+ * Scripts/check-for-global-initializers:
+
+2010-03-04 Simon Fraser <simon.fraser@apple.com>
+
+ Build fix: add exceptions to the check-for-global-initializers script
+ for FocusController and SpatialNavigation, and improve the script
+ to actually print out the globals found.
+
+ * Scripts/check-for-global-initializers:
+
+2010-03-04 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Fix dangling reference to "port" instead of "self._port_obj" that
+ was preventing the http_server from starting on Windows.
+
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+
+2010-03-04 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Make Qt DumpRenderTree EventSender able to send double click events
+
+ LayoutTests:
+ fast/events/dblclick-addEventListener.html
+
+ [Qt] DRT: Send double click event from EventSender
+ https://bugs.webkit.org/show_bug.cgi?id=35255
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::EventSender):
+ (EventSender::mouseDown):
+ * DumpRenderTree/qt/EventSenderQt.h:
+ (EventSender::resetClickCount):
+
+2010-03-04 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Make the OUTPUT_DIR variable in qmake projects independent of build-webkit's logic.
+
+ This also allows shadow builds relying only on qmake to work properly.
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/ImageDiff.pro:
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * QtLauncher/QtLauncher.pro:
+
+2010-03-04 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Enable to use built-product-archive on Qt platform.
+
+ * BuildSlaveSupport/built-product-archive:
+
+2010-03-03 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Add a missing 'm_' to class variables names.
+
+ [Qt] QtLauncher is not respecting class variable names
+ https://bugs.webkit.org/show_bug.cgi?id=35542
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::init):
+ (LauncherWindow::sendTouchEvent):
+ (LauncherWindow::eventFilter):
+ (LauncherWindow::zoomIn):
+ (LauncherWindow::zoomOut):
+ (LauncherWindow::resetZoom):
+ (LauncherWindow::setEditable):
+ (LauncherWindow::setTouchMocking):
+ (LauncherWindow::initializeView):
+ (LauncherWindow::createChrome):
+
+2010-03-03 Alexey Proskuryakov <ap@apple.com>
+
+ Rubber-stamped by Mark Rowe.
+
+ Exclude leaks in Java that build bot complains about.
+
+ * Scripts/run-webkit-tests:
+
+2010-03-03 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Additional change to separate Accelerated Compositing test from 3D Rendering test
+ https://bugs.webkit.org/show_bug.cgi?id=35610
+
+ I am now using #if ENABLED(3D_RENDERING) to emit the 3DRendering string from
+ DRT or not. This allows these flags to set independently. I also improved
+ the code flow in run-webkit-tests a bit.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+ * Scripts/run-webkit-tests:
+
+2010-03-03 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Added ability to print supported features to console to DRT
+ https://bugs.webkit.org/show_bug.cgi?id=35610
+
+ This currently only prints whether or not Accelerated Compositing
+ and 3D Rendering are supported, which is the only way to tell if you
+ can run the compositing LayoutTests on Windows. But it can be expanded
+ to give more information as needed. Currently it prints that both
+ AcceleratedCompositing and 3DRendering are available if accelerated compositing
+ is enabled since both have to be turned on together. This allows me to maintain
+ separate checks for them.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:Added --print-supported-features flag
+ (main):
+ * Scripts/run-webkit-tests:Runs DRT and enabled compositing tests if HW comp is available on Windows
+
+2010-03-03 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Refactor QtLauncher so it respects command line arguments
+ and inherits settings when you clone or create a new window.
+
+ Implemented with help of Kenneth Rohde Christiansen.
+
+ [Qt] QtLauncher must be refactored to fix command line arguments usage
+ https://bugs.webkit.org/show_bug.cgi?id=35536
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::init):
+ (LauncherWindow::isGraphicsBased):
+ (applySetting):
+ (LauncherWindow::applyPrefs):
+ (LauncherWindow::initializeView):
+ (LauncherWindow::newWindow):
+ (LauncherWindow::cloneWindow):
+ (LauncherWindow::createChrome):
+ (main):
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebViewGraphicsBased::setFrameRateMeasurementEnabled):
+ * QtLauncher/webview.h:
+ (WebViewGraphicsBased::itemCacheMode):
+ (WebViewGraphicsBased::frameRateMeasurementEnabled):
+
+2010-03-02 Arno Renevier <arno@renevier.net>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [Gtk] implements ChromeClient::requestGeolocationPermissionForFrame
+ https://bugs.webkit.org/show_bug.cgi?id=35210
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (geolocationPolicyDecisionRequested):
+ (createWebView):
+
+2010-03-02 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ Revert r55339 - the Chromium codebase downstream had a temporary
+ need for WebKitTools/pywebsocket to still exist after Chris Jerdonek
+ had moved it (scripts still referenced the old location). Those
+ scripts have been updated to the new location, so it should be safe
+ to delete this now.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35614
+
+ * pywebsocket/mod_pywebsocket/standalone.py: Removed.
+
+2010-03-02 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ new-run-webkit-tests on chromium-linux tests to see if
+ layout_test_helper exists, but we don't use layout_test_helper on
+ linux. The test derefences a None object, and we crash. This fixes
+ that.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35602
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+ 2010-03-02 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ r55388 (bug 35553) worked around a bug in Python's subprocess.Popen()
+ that was causing DRT to hang on exit in new-run-webkit-tests.
+ Unfortunately, that workaround doesn't work on chromium-win
+ (and the script fails completely). The good news is that the check
+ isn't actually necessary, and so this change makes it conditional.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35601
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-02 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Bug 35576: WebKit should tell plug-in instances when private browsing state changes
+ <http://webkit.org/b/35576>
+
+ TestNetscapePlugin is another bit of plug-in code where copy-paste was heavily used
+ when porting. Update the Windows and UNIX implementations of NPP_New and NPP_SetValue
+ to provide the expected behavior related to NPNVprivateModeBool. Hopefully this code
+ duplication can be cleaned up in the future.
+
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_instance):
+ (webkit_test_plugin_set_value):
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_New):
+ (NPP_SetValue):
+
+2010-03-02 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Test plugin still has issues with releasing objects, and variants
+ https://bugs.webkit.org/show_bug.cgi?id=35587
+
+ Fix the conditions for releasing the variants after calling
+ invoke, and avoid having a number of objects leak.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (testDocumentOpen):
+ (testWindowOpen):
+
+2010-03-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Refactored the StyleChecker class's file-processing method
+ _process_file(). This will make it easier to add new
+ file-processing capabilities to check-webkit-style.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35490
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added a _read_lines() method to the StyleChecker class
+ that extracts the lines from a file.
+ - Replaced part of _process_file() with a call to the new
+ _read_lines() method.
+ - Replaced another part of _process_file() with a call
+ to the new CarriageReturnProcessor.process() method.
+
+ * Scripts/webkitpy/style/processors/common.py:
+ - Replaced the check_no_carriage_return() function with a
+ new CarriageReturnProcessor class.
+
+ * Scripts/webkitpy/style/processors/common_unittest.py:
+ - Renamed the CarriageReturnTest class to
+ CarriageReturnProcessorTest and updated it as necessary.
+
+2010-03-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Started using the logging module in check-webkit-style.
+ This provides more options for debugging and a more flexible,
+ uniform way to report messages to the end-user.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35484
+
+ Also included classes in a central location to facilitate
+ the unit testing of logging code (setUp and tearDown of unit
+ test logging configurations, etc).
+
+ * Scripts/check-webkit-style:
+ - Added a call to configure_logging() in the beginning of main().
+ - Replaced two calls to sys.stderr.write() with appropriate
+ logging calls.
+
+ * Scripts/webkitpy/init/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+
+ * Scripts/webkitpy/init/logtesting.py: Added.
+ - Added a UnitTestLogStream class to capture log output
+ during unit tests.
+ - Added a UnitTestLog class that provides convenience methods
+ for unit-testing logging code.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added a configure_logging() method.
+ - Added a _LevelLoggingFilter class to filter out log messages
+ above a certain logging level.
+ - Removed the _stderr_write() method from the StyleChecker class
+ and replaced its use with appropriate logging calls.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Added a ConfigureLoggingTest class to unit test the
+ configure_logging() method.
+ - Updated the StyleCheckerCheckFileTest class as necessary.
+
+ * Scripts/webkitpy/style_references.py:
+ - Added references to logtesting.UnitTestLog and
+ logtesting.UnitTestLogStream.
+
+2010-03-01 Chris Fleizach <cfleizach@apple.com>
+
+ Fixing broken DRT on Leopard/Tiger. Second try.
+
+ AX: changes to WAI-ARIA grid aren't perceived correctly by VoiceOver
+ https://bugs.webkit.org/show_bug.cgi?id=35514
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+
+2010-03-01 Chris Fleizach <cfleizach@apple.com>
+
+ Fixing broken DRT on Leopard/Tiger.
+
+ AX: changes to WAI-ARIA grid aren't perceived correctly by VoiceOver
+ https://bugs.webkit.org/show_bug.cgi?id=35514
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+
+2010-03-01 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Eric Seidel.
+
+ [GTK] plugins/setProperty.html fails on 64bit Release
+ https://bugs.webkit.org/show_bug.cgi?id=35425
+
+ Check invoke's return code before releasing the variant, since
+ there's a chance it won't be properly initialized, leading to
+ memory corruption, in some cases.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (testCallback):
+ (testEnumerate):
+ (testDocumentOpen):
+ (testWindowOpen):
+ (handleCallback):
+
+2010-03-01 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by nobody. Build bustage :(
+
+ Fix stupid typo that I committed even after David Levin pointed
+ it out to me :(
+
+ https://bugs.webkit.org/show_bug.cgi?id=35553
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-01 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: changes to WAI-ARIA grid aren't perceived correctly by VoiceOver
+ https://bugs.webkit.org/show_bug.cgi?id=35514
+
+ Add rowCount, columnCount for tables.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (rowCountCallback):
+ (columnCountCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::rowCount):
+ (AccessibilityUIElement::columnCount):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::rowCount):
+ (AccessibilityUIElement::columnCount):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::rowCount):
+ (AccessibilityUIElement::columnCount):
+
+2010-03-01 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Work around a bug in Python's subprocess.Popen() that keeps us from
+ cleaning up DumpRenderTree / test_shell properly when we finish the
+ tests in new-run-webkit-tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35553
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-03-01 Arno Renevier <arno@renevier.net>
+
+ Reviewed by Xan Lopez.
+
+ webkit-build could pass unknown arguments to autogen.sh
+ https://bugs.webkit.org/show_bug.cgi?id=35454
+
+ * Scripts/build-webkit:
+
+2010-03-01 Dirk Pranke <dpranke@chromium.org>
+
+ Rubber-stamped by Dimitri Glazkov.
+
+ Fix breakage from r55372.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35549
+
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+
+2010-03-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ EWS can hang for five hours when compile output is too big
+ https://bugs.webkit.org/show_bug.cgi?id=35545
+
+ * Scripts/webkitpy/commands/queues.py: Limit uploads to 1MB instead of
+ 5MB. AppEngine seems to not like 5MB uploads. I'm not sure what the
+ limit is. Let's try 1MB for a while and see how it goes.
+ * Scripts/webkitpy/networktransaction.py: Tune the default parameters
+ to our exponential backoff. I'm not sure why I picked five hours as
+ the retry limit. That seems way too large.
+
+2010-03-01 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ REGRESSION: Telling a WebView to go to its current WebHistoryItem is broken.
+ <rdar://problem/7699371> and https://bugs.webkit.org/show_bug.cgi?id=35532
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (apiTestGoToCurrentBackForwardItemCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::apiTestGoToCurrentBackForwardItem):
+
+ Stubs for now:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::apiTestGoToCurrentBackForwardItem):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::apiTestGoToCurrentBackForwardItem):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::apiTestGoToCurrentBackForwardItem):
+
+2010-03-01 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ General cleanup of error handling in new-run-webkit-tests.
+
+ Add Port.check_build() call that is separate from Port.check_sys_deps()
+ (and add a --nocheck-build flag to skip). This breaks a circular
+ dependency where you would start the layout test helper before
+ checking sys deps, but checking sys deps was the thing that told
+ you if your binaries where there.
+
+ Also, made Port.check_sys_deps(), start_helper() and stop_helper()
+ optional by providing default implementations in the base class
+ rather than requiring ports to implement the routines regardless
+ of whether or not they were needed.
+
+ Lastly, tweak a bunch of log messages to be cleaner, including
+ changing messages in thirdparty/autoinstall.py to be silent at
+ the default log level.
+
+ http://bugs.webkit.org/show_bug.cgi?id=35416
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/passing.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+ * Scripts/webkitpy/thirdparty/autoinstall.py
+
+2010-03-01 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ new-chromium-webkit-tests --platform=mac-leopard diffs are backwards
+ https://bugs.webkit.org/show_bug.cgi?id=35265
+
+ Some parts of the code passed arguments as
+ "actual, expected" and some passed as "expected, actual".
+ As you might imagine, this lead to great confusion and wrongness.
+ Standardize on "expected, actual" as that's the order which is
+ passed to the underlying diff tool.
+
+ Based on a patch by Eric Siedel <eric@webkit.org>.
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py
+
+2010-03-01 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Rolling out: http://trac.webkit.org/changeset/55348
+
+ https://bugs.webkit.org/show_bug.cgi?id=35163
+
+ Rolling out since the changes to autoinstall do not work
+ with Python 2.4. In particular, ZipFile.extractall() was
+ added in Python 2.6.
+
+ * Scripts/webkitpy/__init__.py:
+ * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/init/__init__.py: Removed.
+ * Scripts/webkitpy/init/autoinstall.py: Removed.
+ * Scripts/webkitpy/networktransaction.py:
+ * Scripts/webkitpy/networktransaction_unittest.py:
+ * Scripts/webkitpy/statusserver.py:
+ * Scripts/webkitpy/thirdparty/autoinstall.py: Added.
+
+2010-03-01 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Unreviewed.
+
+ Rolling out r55350: http://trac.webkit.org/changeset/55350
+
+ https://bugs.webkit.org/show_bug.cgi?id=33639
+
+ Need to roll out because this patch (pep8) depends on the newly
+ rewritten autoinstall.py (r55348), which is breaking for people
+ with Python 2.4:
+
+ https://bugs.webkit.org/show_bug.cgi?id=35163#c21
+
+ That revision also needs to be rolled out and will be rolled out next.
+
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checker_unittest.py:
+ * Scripts/webkitpy/style/processors/python.py: Removed.
+ * Scripts/webkitpy/style/processors/python_unittest.py: Removed.
+ * Scripts/webkitpy/style/processors/python_unittest_input.py: Removed.
+ * Scripts/webkitpy/style/unittests.py:
+ * Scripts/webkitpy/style_references.py:
+
+2010-02-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Exempted WebKitTools/Scripts/webkitpy/thirdparty from all
+ style checks except for the whitespace/carriage_return check
+ and the pep8 tab and trailing white space checks.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35497
+
+ * Scripts/webkitpy/style/checker.py:
+ - Adjusted the _PATH_RULES_SPECIFIER configuration as necessary.
+ - Added enough pep8 categories to _all_categories() for the
+ unit tests to pass.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated the test_path_rules_specifier() unit test.
+
+2010-02-27 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by David Levin.
+
+ Added Python style checking to check-webkit-style using
+ the third-party pep8 module (via autoinstall).
+
+ https://bugs.webkit.org/show_bug.cgi?id=33639
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added PYTHON to FileType.
+ - Updated ProcessorDispatcher to return a PythonProcessor
+ for *.py files.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated the ProcessorDispatcher unit tests for *.py files.
+
+ * Scripts/webkitpy/style/processors/python.py: Added.
+ - Added PythonProcessor class.
+
+ * Scripts/webkitpy/style/processors/python_unittest.py: Added.
+ - Added PythonProcessor unit tests.
+
+ * Scripts/webkitpy/style/processors/python_unittest_input.py: Added.
+ - Added a sample Python file to test the PythonProcessor.process()
+ code path (since pep8 accepts a file path).
+
+ * Scripts/webkitpy/style/unittests.py:
+ - Updated the style unit test file to import python_unittest.py.
+
+ * Scripts/webkitpy/style_references.py:
+ - Adjusted style references to import pep8.
+
+2010-02-26 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by David Levin.
+
+ Rewrote autoinstall.py to support unzipping *.zip files after
+ download, unzipping and extracting *.tar.gz files after download,
+ and copying installed files to a destination directory.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35163
+
+ These changes will allow us to autoinstall pep8.py from the web
+ and to put our third-party autoinstalled code in an explicit
+ directory like webkitpy/thirdparty/autoinstalled. They should
+ also speed up imports from autoinstalled *.zip packages slightly
+ since *.pyc files cannot be generated when importing from
+ zipped packages.
+
+ * Scripts/webkitpy/__init__.py:
+ - Updated the autoinstall lines to use the new autoinstall methods.
+ - Added pep8.py to the list of auto-installed packages.
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Updated mechanize import path.
+
+ * Scripts/webkitpy/init/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+
+ * Scripts/webkitpy/init/autoinstall.py: Added.
+ - Added AutoInstaller class.
+ - Added sample testing usage to __main__.
+
+ * Scripts/webkitpy/networktransaction.py:
+ - Updated mechanize import path.
+
+ * Scripts/webkitpy/networktransaction_unittest.py:
+ - Updated mechanize import path.
+
+ * Scripts/webkitpy/statusserver.py:
+ - Updated mechanize import path.
+
+ * Scripts/webkitpy/thirdparty/autoinstall.py: Removed.
+ - Replaced with rewritten autoinstall in init/autoinstall.py.
+
+2010-02-26 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Change the default port for new-run-webkit-tests when running on
+ a Mac from 'chromium-mac' to 'mac'. Add a '--chromium' switch to
+ pick up the default platform-specific version of chromium instead.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35462
+
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py:
+
+2010-02-26 Dirk Pranke <dpranke@chromium.org>
+
+ Unreviewed, build fix
+
+ third time's the charm getting this path right?
+
+ * pywebsocket/mod_pywebsocket/standalone.py:
+
+2010-02-26 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, build fix.
+
+ * pywebsocket/mod_pywebsocket/standalone.py:
+
+2010-02-26 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Moving the script to the right location.
+
+ * pywebsocket/mod_pywebsocket: Added.
+ * pywebsocket/mod_pywebsocket/standalone.py: Copied from WebKitTools/pywebsocket/standalone.py.
+ * pywebsocket/standalone.py: Removed.
+
+2010-02-26 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, fixing the license.
+
+ * pywebsocket/standalone.py:
+
+2010-02-26 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Adding pywebsocket/standalone.py back to fix the Chromium webkit
+ canaries. Once all layout tests pass, we can get in the patch that
+ moves this directorty to WebKitTools/Scripts, update all Chromium
+ scripts, and revert this patch.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35464
+
+ * pywebsocket: Added.
+ * pywebsocket/standalone.py: Added.
+
+2010-02-26 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Needs proper reporting of frame loader callbacks, in DRT
+ https://bugs.webkit.org/show_bug.cgi?id=32170
+
+ Fix reporting of unload handlers, so that it is emitted where
+ needed, not after it.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewLoadFinished):
+ (webViewDocumentLoadFinished):
+ (createWebView):
+
+2010-02-26 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Gustavo Noronha.
+ Patch by Antonio Gomes <tonikitoo@webkit.org>
+
+ [Gtk] Make DRT EventSender::keyDown to consider 'hardware_keycode' field when synthesizing an event.
+ https://bugs.webkit.org/show_bug.cgi?id=35432
+
+ When a directional key-press event (arrow keys, End, Home, PageUp,
+ PageDown, etc) is synthesized by DRT's EventSender and it targets
+ an editor (e.g. <input type=text>, <textare>, etc), event is processed
+ by WebCore::EventHandler. On the other hand, if event target is not
+ an editor, event is bubbled up to Gtk+ for processing. In such cases,
+ if 'hardware_keycode' is not provided at event synthesize time
+ its processing fails (at some point in gtk_bindings_activate_event),
+ and no scroll action is performed.
+
+ Unskip fast/events/node-event-anchor-lock.html
+
+ * DumpRenderTree/win/EventSender.cpp:
+ (keyDownCallback):
+ * platform/gtk/Skipped:
+
+2010-02-26 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by David Levin.
+
+ new-webkit-run-tests: Extraneous parenthesis in websocket_server.py
+ https://bugs.webkit.org/show_bug.cgi?id=35436
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: Removed extra paren.
+
+2010-02-26 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by David Levin.
+
+ Moved pywebsocket into the webkitpy/thirdparty directory and added
+ an associated README.webkit file to the pywebsocket directory.
+ This makes pywebsocket more consistent with the other third-party
+ Python code in our repository.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35198
+
+ * Scripts/run-webkit-tests:
+ - Updated paths to pywebsocket.
+
+ * Scripts/run-webkit-websocketserver:
+ - Updated paths to pywebsocket.
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ - Updated paths to pywebsocket.
+
+ * Scripts/webkitpy/thirdparty/pywebsocket: Copied from WebKitTools/pywebsocket.
+ * Scripts/webkitpy/thirdparty/pywebsocket/README.webkit: Added.
+ - Added a file containing information about the contents
+ of the pywebsocket directory. This will make it easier to
+ understand where the third-party code came from and what
+ local changes have been made.
+
+ * pywebsocket: Removed.
+ * pywebsocket/COPYING: Removed.
+ * pywebsocket/MANIFEST.in: Removed.
+ * pywebsocket/README: Removed.
+ * pywebsocket/example: Removed.
+ * pywebsocket/example/echo_client.py: Removed.
+ * pywebsocket/example/echo_wsh.py: Removed.
+ * pywebsocket/mod_pywebsocket: Removed.
+ * pywebsocket/mod_pywebsocket/__init__.py: Removed.
+ * pywebsocket/mod_pywebsocket/dispatch.py: Removed.
+ * pywebsocket/mod_pywebsocket/handshake.py: Removed.
+ * pywebsocket/mod_pywebsocket/headerparserhandler.py: Removed.
+ * pywebsocket/mod_pywebsocket/memorizingfile.py: Removed.
+ * pywebsocket/mod_pywebsocket/msgutil.py: Removed.
+ * pywebsocket/mod_pywebsocket/standalone.py: Removed.
+ * pywebsocket/mod_pywebsocket/util.py: Removed.
+ * pywebsocket/setup.py: Removed.
+ * pywebsocket/test: Removed.
+ * pywebsocket/test/config.py: Removed.
+ * pywebsocket/test/mock.py: Removed.
+ * pywebsocket/test/run_all.py: Removed.
+ * pywebsocket/test/test_dispatch.py: Removed.
+ * pywebsocket/test/test_handshake.py: Removed.
+ * pywebsocket/test/test_memorizingfile.py: Removed.
+ * pywebsocket/test/test_mock.py: Removed.
+ * pywebsocket/test/test_msgutil.py: Removed.
+ * pywebsocket/test/test_util.py: Removed.
+ * pywebsocket/test/testdata: Removed.
+ * pywebsocket/test/testdata/handlers: Removed.
+ * pywebsocket/test/testdata/handlers/blank_wsh.py: Removed.
+ * pywebsocket/test/testdata/handlers/origin_check_wsh.py: Removed.
+ * pywebsocket/test/testdata/handlers/sub: Removed.
+ * pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py: Removed.
+ * pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py: Removed.
+ * pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py: Removed.
+ * pywebsocket/test/testdata/handlers/sub/plain_wsh.py: Removed.
+ * pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py: Removed.
+ * pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py: Removed.
+
+2010-02-26 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Changed the diff_parser module to log to a module-specific
+ logging.logger rather than the root logger.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35391
+
+ * Scripts/webkitpy/diff_parser.py:
+
+2010-02-26 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] LayoutTestController.numberOfPages() should have default parameters
+ https://bugs.webkit.org/show_bug.cgi?id=35428
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp: maxViewWidth and maxViewHeight moved to
+ LayoutTestController to converge to platform independent implementation.
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::open):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp: Initialization of maxViewWidth and maxViewHeight added.
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ - Default parameters for LayoutTestController.numberOfPages() added.
+ - maxViewWidth and maxViewHeight members added.
+
+2010-02-26 Jamey Hicks <jamey.hicks@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] added QWebSettings::setInspectorUrl() and QWebSettings::inspectorUrl()
+
+ Enables the use of alternate Web Inspector frontends by changing
+ the location of the frontend. The location is specified by providing
+ -inspector-url url
+ as an argument to QtLauncher.
+
+ This is required so that the Web Inspector may be run from an
+ external process or an external tool such as Eclipse or Aptana may
+ be used instead of the in-process Web Inspector UI.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35340
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::init):
+ (LauncherApplication::handleUserOptions):
+
+2010-02-25 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a 'passing' port implementation to new-run-webkit-tests that
+ acts as a wrapper around an existing implementation but stubs out
+ the actual test invocations (instead, the expected results are echoed
+ back to the harness). This is useful for coverage and perf testing
+ of the harness (especially perf testing as it essentially provides
+ a lower bound on how fast the harness can run).
+
+ Also added a --nostart-helper flag to new-run-webkit-tests so that
+ you can skip starting the layout_test_helper and actually run the
+ harness even if you don't have a build of that port.
+
+ Also fix a bug in the 'test' port implementation to actually
+ create the results directory under /tmp instead of /.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35370
+
+ * Scripts/webkitpy/layout_tests/port/factory.py: Modified.
+ * Scripts/webkitpy/layout_tests/port/passing.py: Added.
+ * Scripts/webkitpy/layout_tests/port/test.py: Added.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py: Modified.
+
+2010-02-25 Eric Seidel <eric@webkit.org>
+
+ Fix typo in my last change. No review.
+
+ Rename run-chromium-webkit-tests to new-run-webkit-tests to stop confusion
+ https://bugs.webkit.org/show_bug.cgi?id=35408
+
+ * Scripts/new-run-webkit-tests:
+
+2010-02-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Rename run-chromium-webkit-tests to new-run-webkit-tests to stop confusion
+ https://bugs.webkit.org/show_bug.cgi?id=35408
+
+ * Scripts/new-run-webkit-tests: Added.
+ * Scripts/run-chromium-webkit-tests: Removed.
+ * Scripts/webkitpy/layout_tests/run_webkit_tests.py: Renamed from WebKitTools/Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py.
+
+2010-02-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by David Levin.
+
+ EWS leaks memory slowly
+ https://bugs.webkit.org/show_bug.cgi?id=35395
+
+ The EWS bots leak memory very slowly. If you run them for about a
+ month, each one will take up around 1 GB of virutal memory. If you run
+ several of them on one machine, you'll eventually exhaust all available
+ memory and grind the bots to a halt.
+
+ This patch introduces a --exit-after-iteration option to the queues so
+ that we run them for a finite amount of time. Once they exit and
+ restart, they'll reclaim the leaked memory. I'm not sure how many
+ iterations I'll end up running them for. I'll need to sort that out
+ operationally, but my initial guess is around 1000.
+
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/commands/queues_unittest.py:
+
+2010-02-25 Jarkko Sakkinen <jarkko.sakkinen@tieto.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Qt WebGL support
+
+ Adds toggling of WebGL support to QtLauncher.
+ https://bugs.webkit.org/show_bug.cgi?id=35153
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::toggleWebGL):
+ (LauncherWindow::setupUI):
+
+2010-02-25 Ben Murdoch <benm@google.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The target element of a Touch should be the target where that touch originated, not where it is now.
+ https://bugs.webkit.org/show_bug.cgi?id=34585
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::addTouchPoint): Fix a bug where touch points were not being given unique ids.
+
+2010-02-24 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QtLauncher has a border when running on QGraphicsView mode
+ https://bugs.webkit.org/show_bug.cgi?id=35352
+
+ Fix 2-pixels frame on each border of QtLauncher when running on QGraphicsView mode.
+
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+
+2010-02-23 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ When the run-chromium-webkit-tests code was landed and the code was
+ refactored into the 'port' package, I accidentally broke using
+ http_server.py or websocket_server.py as command-line scripts
+ (the constructors needed a port object they weren't getting). This
+ change fixes them so that --server start|stop actually works.
+
+ As a part of this, the two files need to be able to call port.get(),
+ but doing that is awkward from a file inside the package, so I moved
+ get() into factory.py and imported that into __init__.py so that
+ http_server.py and websocket_server.py can just import factory.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35316
+
+ * Scripts/webkitpy/layout_tests/port/__init__.py:
+ * Scripts/webkitpy/layout_tests/port/factory.py:
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-02-24 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by David Levin.
+
+ Fix the function signature for check_sys_deps on the mac port, and
+ fix the ordering of port_obj.check_sys_deps() and
+ port_obj.start_helper() (helper needs to be started before we check
+ the system configuration).
+
+ http://bugs.webkit.org/show_bug.cgi?id=35367
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
+
+2010-02-24 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Provide default username parameter to SVN.commit_with_message().
+
+ * Scripts/webkitpy/scm.py:
+
+2010-02-24 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Siedel.
+
+ Check the proper directory for a WebKit SVN version (Chromium does
+ not check out the entire WebKit tree directly, but rather pulls
+ individual subdirectories. So, checking for the SVN version in
+ WebKit/WebCore rather than just in WebKit works more reliably across
+ different ports).
+
+ http://bugs.webkit.org/show_bug.cgi?id=35321
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+
+2010-02-24 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35357
+ Two editing tests fail after DumpRenderTree run loop changes
+
+ AppKit decided that it wanted to group all editing commands for some reason (and thus undo
+ reverted them all at once).
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (dump): Reverted the change that made DumpRenderTree use -[NSApplication run].
+ (runTest): Ditto.
+ (-[DumpRenderTreeApplication isRunning]): Override isRunning with a function that always
+ returns YES. This is another way to make the Java plug-in work.
+
+2010-02-23 Adam Roben <aroben@apple.com>
+
+ Make commit-log-editor find just-added ChangeLog files
+
+ Fixes <http://webkit.org/b/35294> commit-log-editor doesn't find
+ just-added ChangeLog files
+
+ Reviewed by Dave Levin.
+
+ * Scripts/commit-log-editor:
+ (top level): Modified the regular expression that's used to find
+ modified ChangeLog files to also look for just-added ChangeLog files.
+
+2010-02-24 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ check-webkit-style false positive for WebCore forwarding header
+ https://bugs.webkit.org/show_bug.cgi?id=34604
+
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checker_unittest.py:
+
+2010-02-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ https://bugs.webkit.org/show_bug.cgi?id=22602
+ Enable Java in DumpRenderTree (on Mac)
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (exitApplicationRunLoop):
+ (dump):
+ (runTest):
+ DumpRenderTree now runs an NSApplication, not just an event loop. This way, the Java plug-in
+ can start without freezing.
+
+ * Scripts/run-webkit-tests: Compile java sources in LayputTests/java.
+
+2010-02-23 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Need a final integration between QtLauncher and QGVLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=35292
+
+ WebKit coding style fixes.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::resetZoom):
+
+2010-02-23 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Need a final integration between QtLauncher and QGVLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=35292
+
+ Add cloneWindow feature to QtLauncher, when running on QGraphicsView mode.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::~LauncherWindow):
+ (LauncherWindow::init):
+ (LauncherWindow::cloneWindow):
+ (LauncherWindow::setupUI):
+
+2010-02-23 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Fix handling of check_wdiff_install when wdiff isn't installed.
+
+ http://bugs.webkit.org/show_bug.cgi?id=35304
+
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+
+2010-02-23 Leandro Pereira <leandro@profusion.mobi>
+
+ Reviewed by NOBODY.
+
+ Fix false positives for 'delete *pointer' statements.
+ http://webkit.org/b/35235
+
+ * WebKitTools/Scripts/webkitpy/style/processors/cpp.py:
+
+2010-02-23 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [Gtk] Implement layoutTestController.numberOfPages
+ https://bugs.webkit.org/show_bug.cgi?id=35228
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::numberOfPages):
+
+2010-02-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] QtLauncher should not use internal JavaScriptCore and WebCore interfaces
+ https://bugs.webkit.org/show_bug.cgi?id=35248
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/utils.h:
+
+2010-02-23 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34439
+
+ Prompts a person for their SVN username if not already cached (by Subversion).
+
+ Currently, webkit-patch is unable to commit to the SVN repo. unless the
+ WebKit SVN username is already cached (from of a prior commit by hand)
+ because "svn commit" (called by webkit-patch) defaults to using the system
+ login name unless the username is already cached or specified on the
+ command line.
+
+ * Scripts/webkitpy/scm.py: Added methods SVN.has_authorization_for_realm and
+ modified SVN.commit_with_message to call it. Added optional username parameter
+ to method SVN.commit_with_message.
+ * Scripts/webkitpy/scm_unittest.py: Added unit test methods: SVNTest.test_commit_with_username,
+ SVNTest.test_has_authorization_for_realm, and SVNTest.test_not_have_authorization_for_realm.
+
+2010-02-22 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Siedel.
+
+ Add more checking for missing binaries and packages to check_sys_deps()
+
+ https://bugs.webkit.org/show_bug.cgi?id=35062
+
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
+
+2010-02-22 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ [Gtk] check-webkit-style: GTK style should be allowed in WebKitTools/DumpRenderTree/gtk
+ https://bugs.webkit.org/show_bug.cgi?id=35229
+
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checker_unittest.py:
+
+2010-02-22 James Robinson <jamesr@chromium.org>
+
+ Unreviewed. Adding myself to committers list.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-02-22 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Remove DRT hack that turns off hardware acceleration with older QuickTimes
+ https://bugs.webkit.org/show_bug.cgi?id=35275
+
+ Now that WebKit does a version check to avoid a QuickTime-related
+ crash (r55100), DumpRenderTree does not need to.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+
+2010-02-22 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Build the DRT in debug on Mac OS X
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+
+2010-02-22 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add support for layout tests on Symbian
+ https://bugs.webkit.org/show_bug.cgi?id=31589
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2010-02-20 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Moved simplejson into webkitpy/thirdparty directory.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35196
+
+ * Scripts/run-chromium-webkit-tests:
+ - Added webkitpy/thirdparty to the script's search path.
+
+ * Scripts/webkitpy/thirdparty/simplejson: Copied from WebKitTools/simplejson.
+ - Copied simplejson directory.
+
+ * simplejson: Removed.
+ * simplejson/LICENSE.txt: Removed.
+ * simplejson/README.txt: Removed.
+ * simplejson/__init__.py: Removed.
+ * simplejson/_speedups.c: Removed.
+ * simplejson/decoder.py: Removed.
+ * simplejson/encoder.py: Removed.
+ * simplejson/jsonfilter.py: Removed.
+ * simplejson/scanner.py: Removed.
+
+2010-02-20 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Moved BeautifulSoup to webkitpy/thirdparty directory.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35195
+
+ * Scripts/webkitpy/BeautifulSoup.py: Removed.
+ - Moved to webkitpy/thirdparty.
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Updated import statement.
+
+ * Scripts/webkitpy/bugzilla_unittest.py:
+ - Updated import statement.
+
+ * Scripts/webkitpy/buildbot.py:
+ - Updated import statement.
+
+ * Scripts/webkitpy/buildbot_unittest.py:
+ - Updated import statement.
+
+ * Scripts/webkitpy/statusserver.py:
+ - Updated import statement.
+
+ * Scripts/webkitpy/thirdparty/BeautifulSoup.py: Copied from WebKitTools/Scripts/webkitpy/BeautifulSoup.py.
+
+2010-02-20 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Created a directory for third-party Python code, and moved
+ autoinstall.py into it.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34540
+
+ * Scripts/webkitpy/__init__.py:
+ - Updated "import autoinstall" statement.
+
+ * Scripts/webkitpy/autoinstall.py: Removed.
+ - Moved to thirdparty/autoinstall.py.
+
+ * Scripts/webkitpy/thirdparty: Added.
+ * Scripts/webkitpy/thirdparty/__init__.py: Added.
+ * Scripts/webkitpy/thirdparty/autoinstall.py: Copied from WebKitTools/Scripts/webkitpy/autoinstall.py.
+
+2010-02-20 Gustavo Noronha Silva <gns@gnome.org>
+
+ Unreviewed, obvious fix for the python failure in our new buildbot
+ step:
+
+ http://build.webkit.org/builders/GTK Linux 32-bit Release/builds/9075/steps/API tests/logs/err.text
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2010-02-19 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by David Levin.
+
+ Add an ENABLE flag for sandboxed iframes to make it possible to disable it in releases
+ https://bugs.webkit.org/show_bug.cgi?id=35147
+
+ * Scripts/build-webkit: Handle new flag.
+
+2010-02-19 Leandro Pereira <leandro@profusion.mobi>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [style-queue] should not complain about identifier names with underscores under WebKit/efl/ewk/
+ https://bugs.webkit.org/show_bug.cgi?id=35091
+
+ White list unix_hacker_style names in WebKit/efl/ewk because these
+ are used in the EFL API.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Filter out readability/naming on WebKit/efl/ewk.
+
+2010-02-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Split out "prepare-rollout" from "rollout" and make --complete-rollout default
+ https://bugs.webkit.org/show_bug.cgi?id=33745
+
+ * Scripts/webkitpy/commands/download.py:
+ - Add a new AbstractRolloutPrepCommand to share code between PrepareRollout and Rollout
+ - Add PrepareRollout
+ * Scripts/webkitpy/commands/download_unittest.py: Test PrepareRollout, remove CompleteRollout tests.
+ * Scripts/webkitpy/steps/__init__.py: include ReopenBugAfterRollout step.
+ * Scripts/webkitpy/steps/completerollout.py: Removed.
+ * Scripts/webkitpy/steps/options.py: remove complete_rollout
+ * Scripts/webkitpy/steps/reopenbugafterrollout.py: Added.
+
+2010-02-19 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Need a final integration between QtLauncher and QGVLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=35161
+
+ Add animated flip support to QtLauncher when running on QGraphicsView mode.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::initializeView):
+ (LauncherWindow::setupUI):
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebViewGraphicsBased::animatedFlip):
+ (WebViewGraphicsBased::animatedYFlip):
+ * QtLauncher/webview.h:
+ (WebViewGraphicsBased::setYRotation):
+ (WebViewGraphicsBased::yRotation):
+
+2010-02-19 Andras Becsi <abecsi@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Implement textZoomIn() and textZoomOut() in DRT's EventSender, add results
+ for passing new tests and unskip the passing ones from the Skipped list.
+ https://bugs.webkit.org/show_bug.cgi?id=35159
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::textZoomIn):
+ (EventSender::textZoomOut):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2010-02-19 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Clean-up the handling of HTML5 persistent data for LayoutTests
+ https://bugs.webkit.org/show_bug.cgi?id=35004
+
+ DumpRenderTreeQt.cpp calls QWebSettings::enablePersistentStorage which sets up
+ and enables all HTML5 persistent data. All the other calls for setting the
+ persistent path or enabling the persistent feature are redundant.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage): No need to enable AppCache again.
+ * DumpRenderTree/qt/main.cpp:
+ (main): No need to setup and enable HTML5 LocalStorage again.
+
+2010-02-19 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Send the context menu event from contextClick() of EventSender
+ and do not show context menu in DRT.
+
+ LayoutTests:
+ fast/events/contextmenu-scrolled-page-with-frame.html
+
+ [Qt] DRT: Send context menu event from EventSender
+ https://bugs.webkit.org/show_bug.cgi?id=35131
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::contextClick):
+
+2010-02-18 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Moved parsing-related code to a separate file. Also increased
+ the unit test coverage in some affected areas.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34675
+
+ This revision contains no new functionality.
+
+ * Scripts/check-webkit-style:
+ - Adjusted to call check_webkit_style_parser().
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added check_webkit_style_parser() to pass checker.py
+ configuration settings to optparser.py.
+ - Moved _create_usage() and the CommandOptionValues,
+ DefaultCommandOptionValues, ArgumentPrinter, and
+ ArgumentParser classes to optparser.py.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Moved the ProcessorOptionsTest, ArgumentPrinterTest, and
+ ArgumentParserTest classes to optparser.py.
+ - Added the CheckWebKitStyleFunctionTest class to check
+ the check_webkit_style_configuration() and
+ check_webkit_style_parser() code paths.
+
+ * Scripts/webkitpy/style/optparser.py: Added.
+ - From checker.py, added _create_usage() and the
+ CommandOptionValues, DefaultCommandOptionValues,
+ ArgumentPrinter, and ArgumentParser classes.
+ - In the ArgumentParser constructor--
+ - Added all_categories as a required parameter.
+ - Removed the default value from the default_options parameter.
+
+ * Scripts/webkitpy/style/optparser_unittest.py: Added.
+ - From checker_unittest.py, added the ProcessorOptionsTest,
+ ArgumentPrinterTest, and ArgumentParserTest classes.
+ - Added the CreateUsageTest class to test _create_usage().
+
+ * Scripts/webkitpy/style/unittests.py:
+ - Added optparser_unittest import.
+
+2010-02-18 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=35134
+ <rdar://problem/7246280> Crash when a plugin calls NPN_SetStatus(0)
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (testSetStatus):
+ (pluginInvoke):
+ Added a setStatus() method.
+
+2010-02-18 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Particularly constructed WebFrames can try to access a null HistoryItem
+ <rdar://problem/7638892> and https://bugs.webkit.org/show_bug.cgi?id=35063
+
+ Add the specific ability to test this API pattern.
+
+ For now only on Mac, perhaps on the main Windows port later, probably not relevant for other ports.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (apiTestNewWindowDataLoadBaseURLCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (-[APITestDelegate initWithCompletionCondition:]):
+ (-[APITestDelegate webView:didFailLoadWithError:forFrame:]):
+ (-[APITestDelegate webView:didFailProvisionalLoadWithError:forFrame:]):
+ (-[APITestDelegate webView:didFinishLoadForFrame:]):
+ (LayoutTestController::apiTestNewWindowDataLoadBaseURL): Create a WebView, do a loadData: in its
+ mainFrame, and synchronously wait for main load completion.
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::apiTestNewWindowDataLoadBaseURL):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::apiTestNewWindowDataLoadBaseURL):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::apiTestNewWindowDataLoadBaseURL):
+
+2010-02-18 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Teach resolve-ChangeLogs to act as a merge-driver for Git
+
+ https://bugs.webkit.org/show_bug.cgi?id=28721
+
+ To enable automatic merging of ChangeLog files, use the following command:
+
+ git config merge.changelog.driver "resolve-ChangeLogs --merge-driver %O %A %B"
+
+ The driver always works in "downstream" merge mode, meaning
+ it will always put the user's changelog entries on top.
+
+ * Scripts/resolve-ChangeLogs:
+
+2009-12-05 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Eric Seidel.
+
+ Enable running of GTK+ API tests.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ * Scripts/run-gtk-tests: Added.
+
+2010-02-18 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ debug-safari doesn't pass --debug option to gdb-safari on MacOSX
+ https://bugs.webkit.org/show_bug.cgi?id=34411
+
+ * Scripts/webkitdirs.pm:
+
+2010-02-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ run-chromium-webkit-tests --platform=mac-leopard needs to run build-dumprendertree
+ https://bugs.webkit.org/show_bug.cgi?id=35053
+
+ * Scripts/webkitpy/layout_tests/port/base.py: Add script_path() function for finding scripts.
+ * Scripts/webkitpy/layout_tests/port/chromium.py: Remove unused argument.
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ - Make sure that calling webkit-build-directory works even if Scripts/ is not in the user's path.
+ - Call build-dumprendertree (and make sure it succeeds) before running the tests.
+
+2010-02-16 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Refactored check-webkit-style's ProcessorOptions class into two
+ classes. This revision contains no new functionality.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34674
+
+ Divided the ProcessorOptions class into a CommandOptionValues
+ class (the result of parsing the command-line options) and
+ a StyleCheckerConfiguration class (which configures the main
+ StyleChecker).
+
+ * Scripts/check-webkit-style:
+ - Updated main() to convert the parsed command option values
+ to a StyleCheckConfiguration instance prior to constructing
+ a StyleChecker.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added check_webkit_style_configuration() to convert a
+ CommandOptionValues instance into a StyleCheckerConfiguration
+ instance.
+ - Renamed the ProcessorOptions class to CommandOptionValues.
+ - In the CommandOptionValues class--
+ - Replaced the filter_configuration attribute with the
+ simpler filter_rules attribute.
+ - Removed the max_reports_per_error attribute.
+ - Moved the is_reportable() method to the new
+ StyleCheckerConfiguration class.
+ - Removed the base_filter_rules attribute from the
+ DefaultCommandOptionValues class.
+ - In the ArgumentParser class--
+ - Added base_filter_rules to the constructor.
+ - Changed the parse() method to return a CommandOptionValues
+ instance instead of a ProcessorOptions instance.
+ - Created a StyleCheckerConfiguration class.
+ - Added the data attributes max_reports_per_category,
+ stderr_write, and verbosity.
+ - Added is_reportable() (moved from the ProcessorOptions
+ class) and write_style_error() (moved from the
+ DefaultStyleErrorHandler class).
+ - In the StyleChecker class--
+ - Replaced the ProcessorOptions options attribute with the
+ StyleCheckerConfiguration _configuration attribute.
+ - Removed the _stderr_write attribute.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated the existing unit test classes as necessary.
+ - Added a StyleCheckerConfigurationTest class.
+
+ * Scripts/webkitpy/style/error_handlers.py:
+ - Updated the DefaultStyleErrorHandler class to accept a
+ StyleCheckerConfiguration instance instead of a ProcessorOptions
+ instance and an stderr_write method.
+
+ * Scripts/webkitpy/style/error_handlers_unittest.py:
+ - Updated the unit test classes as necessary.
+
+ * Scripts/webkitpy/style/filter.py:
+ - Addressed the FIXME in the FilterConfiguration class to change
+ the user_rules attribute to _user_rules (since it is now
+ accessed only internally).
+
+ * Scripts/webkitpy/style/filter_unittest.py:
+ - Updated to reflect the change from user_rules to _user_rules.
+
+2010-02-17 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Share the DRT values maxViewWidth/Height among ports
+ https://bugs.webkit.org/show_bug.cgi?id=34474
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (pageNumberForElementByIdCallback):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::maxViewWidth):
+ (LayoutTestController::maxViewHeight):
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (runTest):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (createWebViewAndOffscreenWindow):
+ (sizeWebViewForCurrentTest):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (dump):
+ (createWebViewAndOffscreenWindow):
+
+2010-02-17 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [Win] Implement test functions for printing
+ https://bugs.webkit.org/show_bug.cgi?id=34570
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::pageNumberForElementById):
+ (LayoutTestController::numberOfPages):
+
+2010-02-17 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ websocket/tests/cookies/httponly-cookie.pl fails every time under run-chromium-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=35001
+
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: add -x flag to run pywebsocket.
+
+2010-02-17 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ check-webkit-style: Misses variables that contain underscores.
+ https://bugs.webkit.org/show_bug.cgi?id=33724
+
+ - Check identifiers whose types are unsigned.
+ - Check bitfields properly.
+
+ * Scripts/webkitpy/style/processors/cpp.py:
+ * Scripts/webkitpy/style/processors/cpp_unittest.py:
+
+2010-02-17 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ check-webkit-style should report the number of files checked
+ https://bugs.webkit.org/show_bug.cgi?id=34971
+
+ * Scripts/check-webkit-style:
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checker_unittest.py:
+
+2010-02-17 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Make possible Qt DRT to get total number of pages to be printed
+
+ LayoutTests:
+ printing/numberOfPages.html
+
+ [Qt] DRT: Get total number of pages to be printed
+ https://bugs.webkit.org/show_bug.cgi?id=34955
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::numberOfPages):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-02-17 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Update to use new property name.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2010-02-17 Julien Chaffraix <jchaffraix@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Remove some warnings seen when building Qt
+ https://bugs.webkit.org/show_bug.cgi?id=35017
+
+ Using a machine without the needed tools to build WebKit leads to
+ several errors and warnings.
+
+ * Scripts/webkitdirs.pm: Refactored the code testing the command's
+ presence into a commandExists routine. While doing so removed, stderr
+ output as it usually does not give anything more than our message. Also
+ added a Qt check for qmake that was missing.
+
+2010-02-17 Xan Lopez <xlopez@igalia.com>
+
+ Rubber-stamped by Gustavo Noronha.
+
+ Disable Java by default in DRT.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2010-02-15 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Some minor check-webkit-style code clean-ups. This revision
+ contains no new functionality.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34932
+
+ * Scripts/check-webkit-style:
+ - Replaced the call to webkit_argument_defaults() with a
+ default parameter in the ArgumentParser constructor.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Removed the WEBKIT prefix from the default global variables.
+ - Prefixed several of the global variables with an underscore
+ to reflect that they are used internally.
+ - Renamed _DEFAULT_FILTER_RULES to _BASE_FILTER_RULES.
+ - Addressed a FIXME by changing the _PATH_RULES_SPECIFIER
+ configuration from list-tuple pairs to list-list pairs.
+ - Renamed style_categories() to _all_categories().
+ - Renamed webkit_argument_defaults() to _check_webkit_style_defaults().
+ - Renamed the ArgumentDefaults class to DefaultCommandOptionValues.
+ - In the ArgumentParser class--
+ - Renamed the doc_print attribute to stderr_write.
+ - Other minor updates.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated the import statements and unit test classes as necessary.
+ - Added assertions to test _PATH_RULES_SPECIFIER more fully.
+
+ * Scripts/webkitpy/style/error_handlers_unittest.py:
+ - Updated the unit test classes as necessary.
+ - Changed StyleErrorHandlerTestBase to store a list of error
+ messages rather than just the last one.
+
+ * Scripts/webkitpy/style/filter.py:
+ - Altered FilterConfiguration._path_rules_from_path()
+ to convert the path_rules list to a tuple.
+
+ * Scripts/webkitpy/style/filter_unittest.py:
+ - Updated the unit tests to reflect the change from tuples to
+ lists in the _PATH_RULES_SPECIFIER configuration variable.
+
+2010-02-16 Mark Rowe <mrowe@apple.com>
+
+ Let's not check garbage in to common build scripts and hose the world now eh guys?
+
+ * Scripts/webkitdirs.pm:
+
+2010-02-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ re-factor Skipped list parsing code into multiple functions and unit test it
+ https://bugs.webkit.org/show_bug.cgi?id=34986
+
+ * Scripts/test-webkitpy: Add new unit test.
+ * Scripts/webkitpy/layout_tests/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+ * Scripts/webkitpy/layout_tests/port/mac.py: Split parsing function into multiple functions for testing.
+ * Scripts/webkitpy/layout_tests/port/mac_unittest.py: Added.
+
+2010-02-16 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Enable 'auto-resize-window' in our DRT.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2010-02-15 Martin Robinson <mrobinson@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ check-webkit-style should not complain about NULL sentinel in calls to g_strconcat and g_strjoin
+ https://bugs.webkit.org/show_bug.cgi?id=34834
+
+ * Scripts/webkitpy/style/processors/cpp.py:
+ * Scripts/webkitpy/style/processors/cpp_unittest.py:
+
+2010-02-12 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Kevin Decker.
+
+ <rdar://problem/7130641> Browser objects identity is not preserved by Safari
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginInvoke): Added methods for checking object identity (via refcount).
+
+2010-02-15 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] DRT: Support evaluateInWebInspector(), setTimelineProfilingEnabled().
+
+ Support LayoutTestController.evaluateInWebInspector(), setTimelineProfilingEnabled() in Qt DRT.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33096
+
+ This allows the following tests to pass:
+
+ inspector/console-format-collections.html
+ inspector/styles-iframe.html
+ inspector/syntax-highlight-css.html
+ inspector/syntax-highlight-javascript.html
+ inspector/timeline-enum-stability.html
+ inspector/timeline-layout.html
+ inspector/timeline-mark-timeline.html
+ inspector/timeline-paint.html
+ inspector/timeline-parse-html.html
+ inspector/timeline-recalculate-styles.html
+ inspector/timeline-script-tag-1.html
+ inspector/timeline-script-tag-2.html
+ inspector/timeline-trivial.html
+ inspector/cookie-resource-match.html
+ inspector/elements-img-tooltip.html
+ inspector/elements-panel-selection-on-refresh.html
+ inspector/inspected-objects-not-overriden.html
+ inspector/timeline-event-dispatch.html
+ inspector/timeline-network-resource.html
+ inspector/elements-panel-rewrite-href.html
+ inspector/console-dir.html
+ inspector/console-dirxml.html
+ inspector/console-format.html
+ inspector/console-tests.html
+ inspector/elements-panel-structure.html
+ inspector/evaluate-in-frontend.html
+ inspector/console-clear.html
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ (WebCore::isWebInspectorTest):
+ (WebCore::DumpRenderTree::open):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ (WebCore::DumpRenderTree::display):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::evaluateInWebInspector):
+ (LayoutTestController::setTimelineProfilingEnabled):
+ (LayoutTestController::display):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-02-14 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Update rebaseline-chromium-webkit-tests to work with the new code
+ structure (port objects instead of path_utils and platform_utils).
+
+ Added a path_to_test_expectations_file() to the Port interface.
+
+ Fixed a bug in the chromium_* platform implementations where the
+ 'target' option was assumed to be set.
+
+ * Scripts/rebaseline-chromium-webkit-tests:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/test.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+
+2010-02-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ webkit-build-directory misuses terms
+ https://bugs.webkit.org/show_bug.cgi?id=34822
+
+ * Scripts/webkit-build-directory:
+ - Add --top-level and --configuration options and make using one of them required.
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ - Use --top-level instead of --base.
+
+2010-02-14 Chang Shu <Chang.Shu@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Enable appcache feature.
+ https://bugs.webkit.org/show_bug.cgi?id=34713
+
+ Re-land r54543 without the change in DumpRenderTree/qt/main.cpp.
+ Persistent storage for AppCache is already initialized in
+ DumpRenderTreeQt.cpp.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+
+2010-02-12 Chang Shu <Chang.Shu@nokia.com>
+
+ Not Reviewed.
+
+ Change case of my email address as a work-around for the following bug.
+ https://bugs.webkit.org/show_bug.cgi?id=34717
+
+ * Scripts/webkitpy/committers.py:
+
+2010-02-12 Darin Adler <darin@apple.com>
+
+ Ignore compiled Python in more of webkitpy.
+
+ * Scripts/webkitpy/style/processors: Added property svn:ignore.
+
+2010-02-12 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Qt DRT now dump the frame loader callbacks when LayoutTestController()
+ method is called.
+
+ LayoutTests:
+ http/tests/security/mixedContent/data-url-script-in-iframe.html
+ http/tests/security/mixedContent/empty-url-plugin-in-frame.html
+ http/tests/security/mixedContent/insecure-css-in-iframe.html
+ http/tests/security/mixedContent/insecure-iframe-in-iframe.html
+ http/tests/security/mixedContent/insecure-image-in-iframe.html
+ http/tests/security/mixedContent/insecure-plugin-in-iframe.html
+ http/tests/security/mixedContent/insecure-script-in-iframe.html
+ http/tests/security/mixedContent/redirect-http-to-https-script-in-iframe.html
+ http/tests/security/mixedContent/redirect-https-to-http-script-in-iframe.html
+
+ [Qt] Make possible Qt DRT dump frame load callbacks
+ https://bugs.webkit.org/show_bug.cgi?id=34702
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::dumpFrameLoadCallbacks):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-02-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Antti Koivisto.
+
+ Make QtLauncher somewhat useable on S60.
+
+ Show the window fullscreen to make scrollbars appear, resize
+ the toolbar buttons to 16x16 to give more screen space to
+ web content and moved the location lineedit into a separate
+ line.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ * QtLauncher/mainwindow.cpp:
+ (MainWindow::buildUI):
+
+2010-02-12 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Support frameset flattening
+ https://bugs.webkit.org/show_bug.cgi?id=32717
+
+ Add FrameSet Flattening support to Mac DRT.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setFrameSetFlatteningEnabled):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setXSSAuditorEnabled):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setFrameSetFlatteningEnabled):
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setFrameSetFlatteningEnabledCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setFrameSetFlatteningEnabled):
+
+2010-02-12 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix typos in driver_test.py
+
+ https://bugs.webkit.org/show_bug.cgi?id=34810
+
+ * Scripts/webkitpy/layout_tests/driver_test.py:
+
+2010-02-12 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Make it possible to toggle the use of QGraphicsView in QtLauncher at run-time
+ https://bugs.webkit.org/show_bug.cgi?id=34844
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::initializeView):
+ (LauncherWindow::setupUI):
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+
+2010-02-11 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ WebSocket ignores HttpOnly cookies, but should use in Handshake.
+ https://bugs.webkit.org/show_bug.cgi?id=34289
+
+ Update pywebsocket to 0.4.8, which supports cgi directories.
+ run-webkit-tests and run-webkit-websocketserver will run
+ pywebsocket, specifying /websocket/test/cookies as cgi directory.
+
+ * Scripts/run-webkit-tests:
+ * Scripts/run-webkit-websocketserver:
+ * pywebsocket/mod_pywebsocket/standalone.py:
+ * pywebsocket/setup.py:
+
+2010-02-11 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Dan Bernstein.
+
+ [Mac] Duplicated setXSSAuditorEnabled preference at Mac DRT
+ https://bugs.webkit.org/show_bug.cgi?id=34798
+
+ Remove duplicated setXSSAuditorEnabled preference at Mac DRT
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+
+2010-02-11 Eric Seidel <eric@webkit.org>
+
+ No review, build fix only.
+
+ webkitdirs.pm has a crazy amount of duplicated feature detection code
+ https://bugs.webkit.org/show_bug.cgi?id=34869
+
+ * Scripts/build-webkit: Fix typo which broke bots.
+
+2010-02-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkitdirs.pm has a crazy amount of duplicated feature detection code
+ https://bugs.webkit.org/show_bug.cgi?id=34869
+
+ * Scripts/build-webkit: Use the new hotness.
+ * Scripts/run-webkit-tests: ditto
+ * Scripts/webkitdirs.pm: Remove a bunch of bad duplicate code.
+ * Scripts/webkitperl/features.pm: Added.
+ - Simplified the 10 methods in webkitdirs.pm into 2 exported methods in this new file.
+
+2010-02-11 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34830
+
+ Makes method User.prompt static and adds the parameter repeat
+ to prompt the user up to repeat times.
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/bugzilla.py: Substituted method User.prompt for method raw_input.
+ * Scripts/webkitpy/commands/upload.py: Ditto
+ * Scripts/webkitpy/credentials.py: Ditto
+ * Scripts/mock_bugzillatool.py: Updated prototype of MockUser.prompt to match User.prompt.
+ * Scripts/webkitpy/user.py: Made method prompt static and added parameter repeat.
+ * Scripts/webkitpy/user_unittest.py: Added.
+
+2010-02-10 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Darin Adler.
+
+ Allow underscored identifiers in CSSParser.cpp
+
+ Flex (http://flex.sourceforge.net/) uses identifiers named as yy_*.
+ WebCore/css/CSSParser.cpp needs to handle some such identifiers.
+ We should relax the style rule for the file to allow underscored identifiers.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34787
+
+ * Scripts/webkitpy/style/checker.py:
+
+2010-02-11 Eric Seidel <eric@webkit.org>
+
+ Rubber-stamped by Adam Barth.
+
+ Remove DrawTest, the application I used when bringing up SVG support on the Mac.
+ The code hasn't been touched (or used) in years. No sense in keeping it in trunk.
+
+ * Scripts/build-drawtest: Removed.
+ * Scripts/run-drawtest: Removed.
+ * DrawTest: Removed.
+
+2010-02-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Need a command to clear r+ on obsolete patches in the pending-commit queue.
+ https://bugs.webkit.org/show_bug.cgi?id=34863
+
+ Unfortunately our http://webkit.org/pending-commit bugzilla query is not
+ smart enough to ignore obsolete patches, so bugs show up there which are
+ still open, but do not have patches ready for landing on them.
+ This new command "clean-pending-commit" will remove r+ from obsolete patches
+ in the pending-commit list.
+
+ * Scripts/test-webkitpy: Add grammar_unittest
+ * Scripts/webkitpy/commands/upload.py: Add clean-pending-commit and make assign-to-committer ignore cq+'d patches.
+ * Scripts/webkitpy/grammar.py: Add join_with_separators
+ * Scripts/webkitpy/grammar_unittest.py: Added.
+
+2010-02-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ run-chromium-webkit-tests fails random pixel tests on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=34862
+
+ This is due to the fact that the Mac port has an
+ invalid path to the image diff tool. Currently it points
+ to image_diff even though ImageDiff would be correct. We
+ can't change it to the right path yet without causing the
+ script to hang. ImageDiff expects to be long-running and
+ be passed image data over stdin. image_diff (chromium's fork)
+ expects to be passed command line arguments.
+ This fix works around the random failures by disabling pixel
+ tests on mac and logging if the user was trying to run with pixel
+ tests enabled.
+
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+
+2010-02-11 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Adam Roben.
+ Try to fix build breakage from r54665.
+
+ * Scripts/check-for-global-initializers:
+
+2010-02-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Make it possible to toggle accelerated compositing from the menu
+ at run-time.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::toggleAcceleratedCompositing):
+ (LauncherWindow::setupUI):
+
+2010-02-08 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ Restore ENABLE_RUBY flag so vendors can ship with Ruby disabled if they choose.
+ https://bugs.webkit.org/show_bug.cgi?id=34698
+
+ * Scripts/build-webkit:
+
+2010-02-10 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix various minor bugs keeping run-chromium-webkit-tests from actually
+ working on the linux and win ports of Chromium.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34739
+
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+ * Scripts/webkitpy/layout_tests/port/__init__.py:
+ * Scripts/webkitpy/layout_tests/port/base.py:
+ * Scripts/webkitpy/layout_tests/port/chromium.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
+2010-02-10 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ run-chromium-webkit-tests --platform=mac-leopard crashes when using a custom build directory
+ https://bugs.webkit.org/show_bug.cgi?id=34817
+
+ This doesn't fix the root cause of us not
+ correctly failing when support binaries are missing.
+ This only causes the DumpRenderTree binary not to be
+ missing in the custom build directory case.
+ Later patches will make us correctly fail fast when
+ support binaries (like DumpRenderTree or ImageDiff) are missing.
+
+ * Scripts/webkit-build-directory: Added.
+ - Need a way to re-use the perl logic for finding build directories in non-perl scripts.
+ * Scripts/webkitpy/layout_tests/port/base.py: Add a FIXME.
+ * Scripts/webkitpy/layout_tests/port/mac.py:
+ - Call webkit-build-directory to find the build directory instead of assuming "WebKitBuild"
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py: Add FIXMEs.
+
+2010-02-10 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ [wx] Add Windows complex text support.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34759
+
+ * wx/build/settings.py:
+
+2010-02-10 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix. Add stub for new LayoutTestController method.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::numberOfPages):
+
+2010-02-10 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed. Roll out r54626, because it broke GTK and Win build.
+ https://bugs.webkit.org/show_bug.cgi?id=32717
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+
+2010-02-10 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Support frameset flattening
+ https://bugs.webkit.org/show_bug.cgi?id=32717
+
+ Add FrameSet Flattening support to Mac DRT.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setFrameSetFlatteningEnabledCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setFrameSetFlatteningEnabled):
+
+2010-02-08 Jon Honeycutt <jhoneycutt@apple.com>
+
+ <rdar://problem/7436875> Crash in Flash when visiting
+ http://www.cctv.com/default.shtml (WER ID 819298200) [watson 2502260]
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (executeScript):
+ Moved to an earlier point in the file.
+ (NPP_New):
+ If the plug-in has an onDestroy attribute, store its value.
+ (NPP_Destroy):
+ If the plug-in has code to run on destruction, run it and free it.
+
+2010-02-10 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Implement pageNumberForElementById() method in Qt DRT LayoutTestController,
+ to make Qt DRT able to get page number.
+
+ LayoutTests:
+ printing/page-break-always.html
+ printing/pageNumerForElementById.html
+ printing/css2.1/page-break-before-000.html
+ printing/css2.1/page-break-after-000.html
+ printing/css2.1/page-break-after-004.html
+ printing/css2.1/page-break-before-001.html
+ printing/css2.1/page-break-after-001.html
+ printing/css2.1/page-break-after-002.html
+ printing/css2.1/page-break-before-002.html
+ printing/css2.1/page-break-inside-000.html
+
+ [Qt] Make possible Qt DRT get a page number for element by ID
+ https://bugs.webkit.org/show_bug.cgi?id=34777
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::pageNumberForElementById):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-02-10 Andras Becsi <abecsi@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make run-iexploder-tests work on Linux.
+ https://bugs.webkit.org/show_bug.cgi?id=34748
+
+ Extract the platform dependant Apache configuration checking code in httpd.pm to a separate function
+ called getHTTPDConfigPathForTestDirectory and use run-launcher instead of run-safari if run on Linux.
+
+ * Scripts/run-iexploder-tests:
+ * Scripts/webkitperl/httpd.pm:
+
+2010-02-09 Csaba Osztrogonác <ossy@webkit.org>
+
+ [Qt] Unreviewed. Roll-out r54543, because layout tests crash in debug mode.
+ https://bugs.webkit.org/show_bug.cgi?id=34713
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2010-02-09 Alejandro G. Castro <alex@igalia.com>
+
+ Unreviewed; added myself to committers
+
+ * Scripts/webkitpy/committers.py:
+
+2010-02-09 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Webkit in Qt does not have window.showModalDialog
+ https://bugs.webkit.org/show_bug.cgi?id=25585
+
+ Set the modality flag when createWindow is called with window type WebWindowDialog.
+
+ * QtLauncher/main.cpp:
+ (WebPage::createWindow):
+
+2010-02-09 Andras Becsi <abecsi@webkit.org>
+
+ Unreviewed trivial warning fix.
+
+ * Scripts/build-webkit:
+
+2010-02-09 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Add possibility of passing parameters to build-webkit by environment variable,
+ because the buildbot slaves can't control the arguments.
+
+ * Scripts/build-webkit:
+
+2010-02-09 Chang Shu <Chang.Shu@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Enable appcache feature.
+ https://bugs.webkit.org/show_bug.cgi?id=34713
+
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2010-02-09 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Provide a way to get total number of pages to be printed
+ https://bugs.webkit.org/show_bug.cgi?id=34699
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (parsePageParameters):
+ (pageNumberForElementByIdCallback):
+ (numberOfPagesCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::numberOfPages):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::numberOfPages):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::numberOfPages):
+
+2010-02-08 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34727
+ Assertion crashes and freezes when plug-in property access results in an exception
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginGetProperty): Raise an exception when accessing a particular property.
+ (pluginSetProperty): Ditto.
+ (pluginInvoke): Added methods to get and set host object properties.
+
+2010-02-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Backport No'am Rosenthal's frame rate measurement
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherApplication::handleUserOptions):
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebViewGraphicsBased::enableFrameRateMeasurement):
+ (WebViewGraphicsBased::updateFrameRate):
+ (WebViewGraphicsBased::paintEvent):
+ * QtLauncher/webview.h:
+
+2010-02-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Make overridePreference complain when it does not
+ support the preference given.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::overridePreference):
+
+2010-02-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Set stdout/stderr to binary mode for DRT on Windows
+
+ This makes sure we don't end up with lots of CRLFs in the
+ DRT output, which breaks tons of results. Matches what
+ the Windows DRT does.
+
+ * DumpRenderTree/qt/main.cpp:
+
+2010-02-08 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Build fix for Qt on Windows.
+
+ Don't use noreturn directly since it's a gcc attribute.
+ Instead use the NO_RETURN macro from AlwaysInline.h
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/utils.h:
+
+2010-02-05 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Suppressed check-webkit-style's underscore check in Qt's autotests.
+ Also made the path-specific filter check case-insensitive.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34574
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added a list element to _PATH_RULES_SPECIFIER for
+ directories that should be excluded from the
+ "readability/naming" category (the category that relates to
+ underscores in identifiers, for example).
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Added an "end-to-end" test for "WebKit/qt/tests/".
+
+ * Scripts/webkitpy/style/filter.py:
+ - Altered FilterConfiguration's should_check() method to
+ check for path substring matches case-insensitively.
+
+ * Scripts/webkitpy/style/filter_unittest.py:
+ - Added a test to check case-insensitive path substring matching.
+
+ * Scripts/webkitpy/style/processors/cpp.py:
+ - Removed the hard-coded "WebKit/gtk/webkit/" path reference
+ since this is now taken care of by the _PATH_RULES_SPECIFIER
+ configuration variable.
+
+ * Scripts/webkitpy/style/processors/cpp_unittest.py:
+ - Removed the unit test for the GTK directory since this
+ is now taken care of by the checker._PATH_RULES_SPECIFIER
+ end-to-end tests.
+
+2010-02-08 Leith Bade <leith@leithalweapon.geek.nz>
+
+ Reviewed by Darin Adler.
+
+ Fixes: https://bugs.webkit.org/show_bug.cgi?id=34637
+ Corrects the newline inserted into WebKitOutputDir, and WebKitLibrariesDir Windows
+ environemnt variables when there is a space in the user's /home path.
+
+ * Scripts/webkitdirs.pm:
+ - Added missing quotes around $sourceDir in argument list of cygpath in determineWindowsSourceDir().
+
+2010-02-05 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34670
+ TestNetscapePlugin should work with Firefox
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp: (NPP_New): Default to Carbon if
+ browser doesn't tell what it supports.
+
+2010-02-05 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [Gtk] Implement layoutTestController.pageNumberForElementById
+ https://bugs.webkit.org/show_bug.cgi?id=34572
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::pageNumberForElementById):
+
+2010-02-03 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a simple test implementation and the WebKit Mac implementation
+ for the layout_tests/port package. Also add a simple test driver of
+ that interface.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34511
+
+ * Scripts/webkitpy/layout_tests/driver_test.py: Added.
+ * Scripts/webkitpy/layout_tests/port/__init__.py:
+ * Scripts/webkitpy/layout_tests/port/mac.py: Added.
+ * Scripts/webkitpy/layout_tests/port/test.py: Added.
+
+2010-02-03 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Siedel.
+
+ Refactor the port package into an object-oriented style and merge
+ path_utils into it. We add a 'base' and a 'chromium' object to the
+ port package; this will allow us to easily add new ports (like
+ WebKit Mac).
+
+ https://bugs.webkit.org/show_bug.cgi?id=34511
+
+ * Scripts/rebaseline-chromium-webkit-tests:
+ * Scripts/run-chromium-webkit-tests:
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+ * Scripts/webkitpy/layout_tests/port/__init__.py:
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+ * Scripts/webkitpy/layout_tests/port/base.py: Added.
+ * Scripts/webkitpy/layout_tests/port/chromium.py: Added.
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ * Scripts/webkitpy/layout_tests/port/http_server_base.py:
+ * Scripts/webkitpy/layout_tests/port/path_utils.py: Removed.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+2010-01-19 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Dave Hyatt.
+
+ Implement flattening of framesets
+ https://bugs.webkit.org/show_bug.cgi?id=32717
+
+ Add support for testing frame flattening with the Qt DRT
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setFrameSetFlatteningEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-02-03 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Provided a way in check-webkit-style to specify filter rules
+ on a per file or folder basis, via a configuration variable.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33684
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added _PATH_RULES_SPECIFIER configuration variable.
+ - In ProcessorOptions class--
+ - Changed the CategoryFilter attribute to FilterConfiguration.
+ - Added path parameter to is_reportable().
+ - Renamed ArgumentDefaults filter_rules attribute to
+ base_filter_rules.
+ - Updated ArgumentPrinter class.
+ - Added filter rule validation to ArgumentParser (instead of
+ in CategoryFilter constructor).
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated unit tests as necessary.
+ - Added unit tests for PATH_RULES_SPECIFIER.
+
+ * Scripts/webkitpy/style/error_handlers.py:
+ - Updated DefaultStyleErrorHandler to use file path when
+ calling is_reportable().
+
+ * Scripts/webkitpy/style/error_handlers_unittest.py:
+ - Updated unit tests as necessary.
+
+ * Scripts/webkitpy/style/filter.py:
+ - Marked CategoryFilter internal with an underscore.
+ - Removed argument validation from CategoryFilter.
+ - Added FilterConfiguration class.
+
+ * Scripts/webkitpy/style/filter_unittest.py:
+ - Updated CategoryFilterTest class.
+ - Added FilterConfigurationTest unit tests.
+
+ * Scripts/webkitpy/style/processors/cpp.py:
+ - Removed _is_test_filename() code.
+ - Removed hard-coded path checks from check_include_line().
+
+ * Scripts/webkitpy/style/processors/cpp_unittest.py:
+ - Removed three unit tests related to exempted files.
+
+2010-02-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Apply the command line options as settings to the
+ graphics system.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (requiresGraphicsView):
+ (LauncherApplication::handleUserOptions):
+ * QtLauncher/webview.h:
+ (WebViewGraphicsBased::setItemCacheMode):
+
+2010-02-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Notify user that run-webkit-tests has to be run under Cygwin
+
+ The script will bail out if run under Windows shell or Msys.
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+
+2010-02-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Generate convenience headers (QWebView, etc) using qmake
+
+ In Qt this is done using syncqt, but we use a pro-file instead
+ that generates makefile-rules for each of the extra headers.
+
+ These extra headers are installed alongside the normal headers.
+
+ * Scripts/webkitdirs.pm: Run qmake and make on new API-DerivedSources
+
+2010-02-05 Andras Becsi <abecsi@webkit.org>
+
+ Unreviewed typo fix.
+
+ Fix wrong whitespace alignment introduced in r54342.
+
+ * Scripts/run-webkit-tests:
+
+2010-02-04 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Timothy Hatcher.
+
+ Build fix. Remove a symbol corresponding to an inline function from the linker export
+ file to prevent a weak external failure.
+
+ * Scripts/check-for-weak-vtables-and-externals: Renamed from WebKitTools/Scripts/check-for-weak-vtables.
+ Teach the script how to detect weak external symbols so that these errors can be caught immediately
+ in the future.
+
+2010-02-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Oliver Hunt.
+
+ [Qt] Make it possible to choose whether the launcher should
+ use the traditional QWidget based QWebView or the newer
+ QGraphics based QGraphicsWebView on a QGraphicsView.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::eventFilter):
+ (LauncherWindow::loadStarted):
+ (LauncherWindow::print):
+ (LauncherWindow::screenshot):
+ (LauncherWindow::setEditable):
+ (LauncherWindow::setupUI):
+ (main):
+ * QtLauncher/webview.cpp:
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebViewGraphicsBased::resizeEvent):
+ (GraphicsWebView::mousePressEvent):
+ (GraphicsWebView::contextMenuEvent):
+ * QtLauncher/webview.h:
+ (WebViewTraditional::WebViewTraditional):
+ (GraphicsWebView::GraphicsWebView):
+ (WebViewGraphicsBased::setPage):
+
+2010-02-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Oliver Hunt.
+
+ [Qt] QtLauncher cleanup.
+
+ Refactor option handling out in utility functions and make the
+ arguments more Qt compatible.
+
+ * QtLauncher/main.cpp:
+ (requiresGraphicsView):
+ (LauncherApplication::handleUserOptions):
+ * QtLauncher/utils.cpp:
+ (takeOptionValue):
+ (formatKeys):
+ (enumToKeys):
+ (appQuit):
+ * QtLauncher/utils.h:
+
+2010-02-04 Andras Becsi <abecsi@inf.u-szeged.hu>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Implement a locking and scheduling mechanism for http testing sessions to be able
+ to run multiple instances of run-webkit-tests parallel on the same machine.
+ If a test session wants to run http tests and this feature is enabled, the pending
+ sessions create lockfiles with sequential lock numbers. These locks are used to schedule
+ the running test sessions in first come first served order. An exclusive lock ensures
+ that the lock numbers are sequential to avoid deadlocks and starvation.
+ Because the buildbot master specifies the flags used by slaves we need an environment
+ variable too to be able to use the feature per-slave.
+ Exporting WEBKIT_WAIT_FOR_HTTPD=1 before testing or using the --wait-for-httpd
+ flag enables this feature, otherwise this patch has no effect on the testing whatsoever.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33153
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitperl/httpd.pm:
+
+2010-01-22 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Make run-webkit-tests work under Cygwin for the Qt port
+
+ setPathForRunningWebKitApp() is implemented for the Qt port
+ by using qmake to query for the location of the Qt libraries.
+
+ This requires the original environment (%ENV) to be untouched,
+ so launchWithCurrentEnv() was refactored to launchWithEnv(),
+ and the code in openDumpTool() to not use %ENV but a %CLEAN_ENV
+ instead. This has the added benefit of getting rid of the temp
+ variables used for storing the current env.
+
+ openDumpTool() is also refactored a bit into platform-spesific,
+ port-spesific, and generic environment variables.
+
+ Checks for undef was added a few places to fix Perl concat
+ warnings when run-webkit-tests is aborted.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33895
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+
+2010-02-04 Yuzo Fujishima <yuzo@google.com>
+
+ Unreviewed.
+
+ Add Yuzo to the committers list.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-02-03 Dirk Pranke <dpranke@chromium.org>
+
+ Rubber-stamped by Eric Seidel.
+
+ Change "the Chromium name" to "the name of Google Inc." in the licenses
+
+ https://bugs.webkit.org/show_bug.cgi?id=34511
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+ * Scripts/webkitpy/layout_tests/port/__init__.py:
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py:
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py:
+ * Scripts/webkitpy/layout_tests/port/http_server.py:
+ * Scripts/webkitpy/layout_tests/port/http_server_base.py:
+ * Scripts/webkitpy/layout_tests/port/path_utils.py:
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+2010-02-03 Dirk Pranke <dpranke@chromium.org>
+
+ Rubber-stamped by Eric Siedel.
+
+ Rename files as part of refactoring the layout_tests package. All
+ the platform_utils* module, the path_utils.py module, and
+ the http server and web socket server modules are moved into a new
+ port/ package.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34511
+
+ * Scripts/webkitpy/layout_tests/layout_package/apache_http_server.py: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/http_server.py: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/http_server_base.py: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/httpd2.pem: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/lighttpd.conf: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/path_utils.py: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils.py: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils_linux.py: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils_mac.py: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils_win.py: Removed.
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/websocket_server.py: Removed.
+ * Scripts/webkitpy/layout_tests/port: Added.
+ * Scripts/webkitpy/layout_tests/port/__init__.py: Copied from Scripts/webkitpy/layout_tests/layout_package/platform_utils.py.
+ * Scripts/webkitpy/layout_tests/port/apache_http_server.py: Copied from Scripts/webkitpy/layout_tests/layout_package/apache_http_server.py.
+ * Scripts/webkitpy/layout_tests/port/chromium_linux.py: Copied from Scripts/webkitpy/layout_tests/layout_package/platform_utils_linux.py.
+ * Scripts/webkitpy/layout_tests/port/chromium_mac.py: Copied from Scripts/webkitpy/layout_tests/layout_package/platform_utils_mac.py.
+ * Scripts/webkitpy/layout_tests/port/chromium_win.py: Copied from Scripts/webkitpy/layout_tests/layout_package/platform_utils_win.py.
+ * Scripts/webkitpy/layout_tests/port/http_server.py: Copied from Scripts/webkitpy/layout_tests/layout_package/http_server.py.
+ * Scripts/webkitpy/layout_tests/port/http_server_base.py: Copied from Scripts/webkitpy/layout_tests/layout_package/http_server_base.py.
+ * Scripts/webkitpy/layout_tests/port/httpd2.pem: Copied from Scripts/webkitpy/layout_tests/layout_package/httpd2.pem.
+ * Scripts/webkitpy/layout_tests/port/lighttpd.conf: Copied from Scripts/webkitpy/layout_tests/layout_package/lighttpd.conf.
+ * Scripts/webkitpy/layout_tests/port/path_utils.py: Copied from Scripts/webkitpy/layout_tests/layout_package/path_utils.py.
+ * Scripts/webkitpy/layout_tests/port/websocket_server.py: Copied from Scripts/webkitpy/layout_tests/layout_package/websocket_server.py.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+
+2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+
+ Rubber-stamped by Eric Seidel.
+
+ Roll back r53559 and r54084 again, because roll out didn't solve flakeyness on the Windows Test bots
+ https://bugs.webkit.org/show_bug.cgi?id=34399
+
+ * Scripts/run-iexploder-tests:
+ * Scripts/run-webkit-httpd:
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitperl/httpd.pm: Added.
+
+2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+
+ Rubber-stamped by Eric Seidel.
+
+ Roll out r53559 and r54084, because it might caused flakeyness on the Windows Test bots
+
+ * Scripts/run-iexploder-tests:
+ * Scripts/run-webkit-httpd:
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitperl/httpd.pm: Removed.
+
+2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+
+ Rubber-stamped by Ariya Hidayat.
+
+ Roll back r53889 again, because roll out didn't solve flakeyness on the Windows Test bots
+ https://bugs.webkit.org/show_bug.cgi?id=34399
+
+ * DumpRenderTree/win/EventSender.cpp:
+ (buildModifierFlags):
+ (mouseDownCallback):
+ (mouseUpCallback):
+ (keyDownCallback):
+
+2010-02-03 Eric Seidel <eric@webkit.org>
+
+ No review, just fixing copyrights.
+
+ Concerns were expressed about "The Chromium Authors" being
+ a valid legal entity for copyright assignment in the WebKit repository,
+ so this change removes all "The Chromium Authors".
+
+ I looked at the svn logs in src.chromium.org and failed to find any
+ non-google contributions to these files, so they are all now
+ marked as copyright "Google Inc" as all Google contributers assign
+ copyright to "Google Inc" as part of their employment agreement.
+
+ * Scripts/rebaseline-chromium-webkit-tests:
+ * Scripts/run-chromium-webkit-tests:
+ * Scripts/webkitpy/layout_tests/layout_package/apache_http_server.py:
+ * Scripts/webkitpy/layout_tests/layout_package/http_server.py:
+ * Scripts/webkitpy/layout_tests/layout_package/http_server_base.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py:
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py:
+ * Scripts/webkitpy/layout_tests/layout_package/path_utils.py:
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils.py:
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils_linux.py:
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils_mac.py:
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils_win.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_files.py:
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py:
+ * Scripts/webkitpy/layout_tests/layout_package/websocket_server.py:
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py:
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py:
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py:
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py:
+
+2010-02-03 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] QtLauncher, refactor argument handling in preparation of merge
+ with QGVLauncher
+
+ * QtLauncher/main.cpp:
+ (LauncherApplication::urls):
+ (LauncherApplication::isRobotized):
+ (LauncherApplication::applyDefaultSettings):
+ (LauncherApplication::LauncherApplication):
+ (LauncherApplication::formatKeys):
+ (LauncherApplication::enumToKeys):
+ (fail):
+ (LauncherApplication::handleUserOptions):
+ (main):
+
+2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+
+ Rubber-stamped by Ariya Hidayat.
+
+ Rolling out r53889, because it might caused flakeyness on the Windows Test bots
+ https://bugs.webkit.org/show_bug.cgi?id=34399
+
+ * DumpRenderTree/win/EventSender.cpp:
+ (mouseDownCallback):
+ (mouseUpCallback):
+ (keyDownCallback):
+
+2010-02-03 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Fix pixel tests support.
+ https://bugs.webkit.org/show_bug.cgi?id=27813
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::open):
+ (WebCore::DumpRenderTree::processLine):
+ - Hash processing mechanism moved from DumpRenderTree::open to DumpRenderTree::processLine.
+ (WebCore::DumpRenderTree::dump): Fixed and renamed variables.
+
+2010-02-03 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ [wx] Enable JIT compilation for wx.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34536
+
+ * wx/build/settings.py:
+
+2010-02-02 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after introduction of pageNumberForElementById.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::pageNumberForElementById):
+
+2010-02-02 Shu Chang <Chang.Shu@nokia.com>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-02-02 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Moved filter-related check-webkit-style code into a separate
+ filter module.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34408
+
+ This is preparatory refactoring for Bug 33684, which will allow
+ file and folder-specific filter rules.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Removed CategoryFilter class (moved to filter.py).
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Removed CategoryFilter unit tests (moved to filter_unittest.py).
+
+ * Scripts/webkitpy/style/filter.py: Added.
+ - Added CategoryFilter class (moved from checker.py).
+
+ * Scripts/webkitpy/style/filter_unittest.py: Added.
+ - Added CategoryFilter unit tests (moved from checker_unittest.py).
+
+ * Scripts/webkitpy/style/unittests.py:
+ - Added reference to filter_unittest.py.
+
+2010-02-01 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Addressed FIXME in check-webkit-style so that the carriage-return
+ check will work for patches.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34260
+
+ Also added support for limiting the number of errors reported
+ per category, per file.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added new "whitespace/carriage_return" category from common.py.
+ - Added MAX_REPORTS_PER_CATEGORY dictionary.
+ - Added max_reports_per_category attribute to ProcessorOptions class.
+ - Refactored StyleChecker._process_file().
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Updated ProcessorOptionsTest tests.
+ - Added test to check MAX_REPORTS_PER_CATEGORY.
+
+ * Scripts/webkitpy/style/error_handlers.py:
+ - Added support for suppressing the display of errors after
+ reaching a per-category maximum (from max_reports_per_category).
+
+ * Scripts/webkitpy/style/error_handlers_unittest.py:
+ - Added test for suppressing error display.
+
+ * Scripts/webkitpy/style/processors/common.py: Added.
+ - Moved carriage-return check to new file.
+
+ * Scripts/webkitpy/style/processors/common_unittest.py: Added.
+ - Added unit tests for carriage-return check.
+
+ * Scripts/webkitpy/style/unittests.py:
+ - Added reference to common_unittest.py.
+
+2010-02-01 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Provide a way to get page number with layoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=33840
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (pageNumberForElementByIdCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::pageNumberForElementById):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::pageNumberForElementById):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::pageNumberForElementById):
+
+2010-02-01 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Unreviewed fix for an invalid function call.
+
+ check-webkit-style: Remove filename parameter from all functions where no longer used
+ https://bugs.webkit.org/show_bug.cgi?id=34249
+
+ * Scripts/webkitpy/style/checker.py:
+
+2010-02-01 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] DRT Provide global flag ability
+ https://bugs.webkit.org/show_bug.cgi?id=34418
+
+ Add the globalFlag property to the Qt LayoutTestController to allow
+ cross-domain indications.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::globalFlag):
+ (LayoutTestController::setGlobalFlag):
+
+2010-02-01 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ Crash in Safari opening new tabs to "same page"
+ <rdar://problem/7593857> and https://bugs.webkit.org/show_bug.cgi?id=34444
+
+ Add a mode (Mac-only for now) that exercises the WebView SPI _loadBackForwardListFromOtherView:
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (setNewWindowsCopyBackForwardListCallback):
+ (LayoutTestController::staticFunctions):
+
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::newWindowsCopyBackForwardList):
+ (LayoutTestController::setNewWindowsCopyBackForwardList):
+
+ * DumpRenderTree/mac/UIDelegate.mm:
+ (-[UIDelegate webView:createWebViewWithRequest:]):
+
+2010-02-01 Carol Szabo <carol.szabo@nokia.com>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-02-01 Nate Chapin <japhet@chromium.org>
+
+ Rubber-stamped by David Levin.
+
+ Add myself to reviewer list.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-31 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Moved style error handler code to their own classes, and
+ related refactoring. Increased unit test code coverage of
+ style error handling.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34379
+
+ * Scripts/check-webkit-style:
+ - Minor change: added error_count variable.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Renamed ProcessorOptions.should_report_error() to is_reportable().
+ - In the StyleChecker class--
+ - Removed _default_style_error_handler().
+ - Added _increment_error_count().
+ - Refactored to use DefaultStyleErrorHandler and
+ PatchStyleErrorHandler constructors.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - In the StyleStyleCheckerTest class--
+ - Removed write_sample_error().
+ - Removed test_default_style_error_handler().
+
+ * Scripts/webkitpy/style/error_handlers.py: Added.
+ - Added DefaultStyleErrorHandler class.
+ - Added PatchStyleErrorHandler class.
+
+ * Scripts/webkitpy/style/error_handlers_unittest.py: Added.
+ - Added unit tests for DefaultStyleErrorHandler and
+ PatchStyleErrorHandler.
+
+ * Scripts/webkitpy/style/unittests.py:
+ - Added error_handlers unit tests.
+
+2010-01-29 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Stephanie Lewis.
+
+ Fix run-leaks with newer versions of the leaks tool.
+
+ * Scripts/run-leaks:
+
+2010-01-29 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Siedel.
+
+ Top-level test drivers for running the Chromium port of run-webkit-tests
+ and being able to rebaseline test results from the test bots. The
+ files in the Scripts directory are simply wrappers around the files
+ in webkitpy/layout_tests for convenience.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31498
+
+ * Scripts/rebaseline-chromium-webkit-tests: Added.
+ * Scripts/run-chromium-webkit-tests: Added.
+ * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py: Added.
+ * Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py: Added.
+
+2010-01-29 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Siedel.
+
+ Add in the second block of python code for the Chromium port
+ of run-webkit-tests. These files execute different diffs to classify
+ the various types of failures from a test.
+
+ * Scripts/webkitpy/layout_tests/test_types: Added.
+ * Scripts/webkitpy/layout_tests/test_types/__init__.py: Added.
+ * Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py: Added.
+ * Scripts/webkitpy/layout_tests/test_types/image_diff.py: Added.
+ * Scripts/webkitpy/layout_tests/test_types/test_type_base.py: Added.
+ * Scripts/webkitpy/layout_tests/test_types/text_diff.py: Added.
+
+2010-01-29 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Siedel.
+
+ Check in the first part of the Chromium Python port of the
+ run-webkit-tests test driver. The files under
+ layout_tests/layout_layout constitute most of the implementation;
+ they can be roughly divided into code that parses the
+ "test_expectations.txt" file that describes how we expect tests to
+ pass or fail, platform-specific hooks for the different Chromium
+ ports (in platform_utils*), code for parsing the output of the
+ tests and generating results files and HTML and JSON for the
+ dashboards, auxiliary scripts for starting and stopping HTTP and
+ Web Socket servers, and then one of the actual driver files
+ (test_shell_thread). Code for actually parsing test output for
+ failures and the top-level driver scripts will follow shortly.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31498
+
+ * Scripts/webkitpy/layout_tests: Added.
+ * Scripts/webkitpy/layout_tests/layout_package: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/__init__.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/apache_http_server.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/http_server.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/http_server_base.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/httpd2.pem: Added.
+ - scripts to start and stop apache. Note that the apache file
+ generates a conf file dynamically, and we should switch to
+ using the same static conf file that the regular run-webkit-tests
+ uses, and we can also use the same httpd2.pem file.
+
+ * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py: Added.
+ - scripts to generate the JSON layout test dashboard and the
+ flakiness dashboard
+ * Scripts/webkitpy/layout_tests/layout_package/lighttpd.conf: Added.
+ - default configuration for LigHTTPd (used on Windows)
+ * Scripts/webkitpy/layout_tests/layout_package/metered_stream.py: Added.
+ - utility class that implements progress bars on the console to
+ be displayed while the tests are running
+ * Scripts/webkitpy/layout_tests/layout_package/path_utils.py: Added.
+ - various routines for manipulating paths and URIs
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils_linux.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils_mac.py: Added.
+ * Scripts/webkitpy/layout_tests/layout_package/platform_utils_win.py: Added.
+ - platform-specific aspects of the drivers (binary names, paths,
+ process control, etc.)
+ * Scripts/webkitpy/layout_tests/layout_package/test_expectations.py: Added.
+ - code for parsing the 'test_expectations.txt' file to determine
+ which tests are expected to fail (and how) on which platforms
+ * Scripts/webkitpy/layout_tests/layout_package/test_failures.py: Added.
+ - code for handling different kinds of failures (generating output
+ in the results, etc.)
+ * Scripts/webkitpy/layout_tests/layout_package/test_files.py: Added.
+ - code to gather the lists of tests
+ * Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py: Added.
+ - code to actually execute tests via TestShell and process
+ the output
+ * Scripts/webkitpy/layout_tests/layout_package/websocket_server.py: Added.
+ - scripts to start and stop the pywebsocket server
+
+2010-01-29 Dirk Pranke <dpranke@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Check in a copy of the simplejson library; it will be used by
+ the Chromium port of run-webkit-tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31498
+
+ * simplejson: Added.
+ * simplejson/LICENSE.txt: Added.
+ * simplejson/README.txt: Added.
+ * simplejson/__init__.py: Added.
+ * simplejson/_speedups.c: Added.
+ (ascii_escape_char):
+ (ascii_escape_unicode):
+ (ascii_escape_str):
+ (py_encode_basestring_ascii):
+ (init_speedups):
+ * simplejson/decoder.py: Added.
+ * simplejson/encoder.py: Added.
+ * simplejson/jsonfilter.py: Added.
+ * simplejson/scanner.py: Added.
+
+2010-01-29 Dirk Pranke <dpranke@chromium.org>
+
+ No review
+
+ Add myself to the committers list
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-29 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ A first step towards the Indexed Database API
+ https://bugs.webkit.org/show_bug.cgi?id=34342
+
+ Add indexed database API.
+
+ * Scripts/build-webkit:
+
+2010-01-29 Andras Becsi <abecsi@webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Correct openHTTPD() to print requests to stdout if run-webkit-httpd is used.
+ This fixes a regression introduced in r53559.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34336
+
+ * Scripts/webkitperl/httpd.pm:
+
+2010-01-28 Jon Honeycutt <jhoneycutt@apple.com>
+
+ MSAA: Crash when posting a notification for a detached object
+
+ https://bugs.webkit.org/show_bug.cgi?id=34309
+ <rdar://problem/7409759>
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/AccessibilityController.h:
+ Declare new functions. Add new members to store the event hook and the
+ mapping of accessibility elements to their JS callbacks.
+
+ * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+ (AccessibilityController::notificationReceived):
+ Stubbed.
+ (AccessibilityController::addNotificationListener):
+ Stubbed.
+
+ * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+ (AccessibilityController::notificationReceived):
+ Stubbed.
+ (AccessibilityController::addNotificationListener):
+ Stubbed.
+
+ * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+ (AccessibilityController::AccessibilityController):
+ Initialize the event hook.
+ (AccessibilityController::~AccessibilityController):
+ Remove the event hook. Unprotect all of the JS functions that are stored
+ in the map.
+ (logEventProc):
+ Clean-up a variable.
+ (stringEvent):
+ Return a string description of the MSAA event code.
+ (notificationListenerProc):
+ Get the accessible object from the event, and query it for IAccessible.
+ Call the AccessibilityController's notificationReceived().
+ (comparableObject):
+ Use QueryService to obtain the IAccessibleComparable for the
+ IServiceProvider.
+ (AccessibilityController::notificationReceived):
+ Iterate the map of objects that have registered for notification
+ callbacks. Query each for IServiceProvider, then use comparableObject()
+ to get an IAccessibleComparable. If we find an object matching the
+ notified object, call its callback, passing the event that was received.
+ (AccessibilityController::addNotificationListener):
+ If we have not created the event hook, create it. Protect the JS
+ callback function object, and add the object and its callback to our
+ map.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::addNotificationListener):
+ Call through to the AccessibilityController's addNotificationListener().
+
+ * DumpRenderTree/win/DumpRenderTreeWin.h:
+ Add an extern declaration for the shared FrameLoadDelegate extern, so we
+ can access it from AccessibilityController.
+
+ * DumpRenderTree/win/FrameLoadDelegate.h:
+ (FrameLoadDelegate::accessibilityController):
+ Return the AccessibilityController.
+
+2010-01-29 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ prepare-ChangeLog outputs useless messages for a nonexistent bug ID
+ https://bugs.webkit.org/show_bug.cgi?id=34313
+
+ * Scripts/prepare-ChangeLog:
+
+2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann.
+
+ [Qt] Separate implementation from class definition.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::webView):
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::~LauncherWindow):
+ (LauncherWindow::keyPressEvent):
+ (LauncherWindow::grabZoomKeys):
+ (LauncherWindow::sendTouchEvent):
+ (LauncherWindow::eventFilter):
+ (LauncherWindow::loadStarted):
+ (LauncherWindow::loadFinished):
+ (LauncherWindow::showLinkHover):
+ (LauncherWindow::zoomIn):
+ (LauncherWindow::zoomOut):
+ (LauncherWindow::resetZoom):
+ (LauncherWindow::toggleZoomTextOnly):
+ (LauncherWindow::print):
+ (LauncherWindow::screenshot):
+ (LauncherWindow::setEditable):
+ (LauncherWindow::dumpHtml):
+ (LauncherWindow::selectElements):
+ (LauncherWindow::setTouchMocking):
+ (LauncherWindow::newWindow):
+ (LauncherWindow::setupUI):
+
+2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] On Maemo5, a click/touch in the location bar (when unfocused)
+ should result in all text selected.
+
+ * QtLauncher/locationedit.cpp:
+ (LocationEdit::focusInEvent):
+ * QtLauncher/locationedit.h:
+
+2010-01-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Show progress reaching 100% for loads.
+
+ * QtLauncher/locationedit.cpp:
+ (LocationEdit::LocationEdit):
+ (LocationEdit::setProgress):
+ (LocationEdit::reset):
+ (LocationEdit::paintEvent):
+ * QtLauncher/locationedit.h:
+
+2010-01-29 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Disable the QtLauncher statusbar on Maemo
+
+ https://bugs.webkit.org/show_bug.cgi?id=34330
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::showLinkHover):
+ (LauncherWindow::selectElements):
+
+2010-01-29 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Display page loading progress inside the QtLauncher location bar
+
+ https://bugs.webkit.org/show_bug.cgi?id=34210
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/locationedit.cpp: Added.
+ (LocationEdit::LocationEdit):
+ (LocationEdit::setProgress):
+ (LocationEdit::paintEvent):
+ * QtLauncher/locationedit.h: Added.
+ * QtLauncher/mainwindow.cpp:
+ (MainWindow::buildUI):
+ * QtLauncher/mainwindow.h:
+
+2010-01-29 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add support for Maemo zoom keys in QtLauncher
+
+ https://bugs.webkit.org/show_bug.cgi?id=34160
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::~LauncherWindow):
+ (LauncherWindow::keyPressEvent):
+ (LauncherWindow::grabZoomKeys):
+
+2010-01-29 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Implement the display() method of the layout test controller
+ https://bugs.webkit.org/show_bug.cgi?id=34258
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::showPage):
+ (WebCore::DumpRenderTree::hidePage):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::display):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-28 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix for MSW, use ThreadingWin.cpp as the Windows pthreads implementation
+ implements pthread_t in a way that makes it impossible to check its validity,
+ which is needed by ThreadingPthreads.cpp.
+
+ * DumpRenderTree/wscript:
+ * wx/build/settings.py:
+
+2010-01-28 Andras Becsi <abecsi@webkit.org>
+
+ Adding myself to the committer list. No review needed.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-28 Hayato Ito <hayato@chromium.org>
+
+ Reviewed by David Levin.
+
+ Remove NULL char from input JS file because 'grep' fails if the file contains NULL char.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34252
+
+ * Scripts/make-script-test-wrappers:
+
+2010-01-28 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after removal of the zlib image decoder.
+
+ * wx/build/settings.py:
+
+2010-01-28 Csaba Osztrogonác <ossy@webkit.org>
+
+ [Qt] Unreviewed, roll out r54000.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::display):
+
+2010-01-28 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Implement the display() method of the layout test controller
+ https://bugs.webkit.org/show_bug.cgi?id=34258
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::showPage):
+ (WebCore::DumpRenderTree::hidePage):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::display):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Eliminated the filename parameter from functions in
+ check-webkit-style's cpp.py where it is no longer used.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34249
+
+ * Scripts/webkitpy/style/processors/cpp.py:
+ - Reduced number of occurrences of "filename" variable from
+ approximately 200 to 120.
+
+ * Scripts/webkitpy/style/processors/cpp_unittest.py:
+ - Refactored unit tests as necessary to accommodate changes to cpp.py.
+ - Fixed bug in CppStyleTestBase.perform_include_what_you_use()
+ where the incorrect file extension was getting passed to
+ cpp_style.check_language().
+
+2010-01-28 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ In check-webkit-style, eliminated the dependency of
+ processors/cpp_unittest.py on checker.py.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34205
+
+ * Scripts/webkitpy/style/checker.py:
+ - Addressed FIXME by removing STYLE_CATEGORIES data.
+ - Added style_categories().
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Minor changes.
+
+ * Scripts/webkitpy/style/processors/cpp.py:
+ - Added categories attribute to CppProcessor class (data
+ was originally checker.STYLE_CATEGORIES).
+
+ * Scripts/webkitpy/style/processors/cpp_unittest.py:
+ - Addressed FIXME by eliminating "import" from checker.py.
+
+2010-01-28 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Improve treatment of conditions and rest of the line for if, else, switch and alikes
+ https://bugs.webkit.org/show_bug.cgi?id=34173
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-28 Joe Mason <jmason@rim.com>
+
+ Reviewed by Adam Barth.
+
+ Limit login retries to 5
+ https://bugs.webkit.org/show_bug.cgi?id=34193
+
+ * Scripts/webkitpy/bugzilla.py:
+
+2010-01-27 Martin Robinson <mrobinson@webkit.org>
+
+ Adding myself to the committer list. No review necessary.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-27 George Wright <gwright@rim.com>
+
+ Reviewed by Adam Treat.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34216
+
+ Add missing include for wtf/Platform.h
+
+ * DumpRenderTree/AccessibilityController.h:
+
+2010-01-27 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] DRT Provide worker thread ability to track counters
+ https://bugs.webkit.org/show_bug.cgi?id=34221
+
+ Implement workerThreadCount() in LayoutTestController of Qt DRT
+
+ Tests:
+ fast/workers/dedicated-worker-lifecycle.html
+ fast/workers/shared-worker-frame-lifecycle.html
+ fast/workers/shared-worker-lifecycle.html
+ fast/workers/worker-lifecycle.html
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::workerThreadCount):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann.
+
+ [Qt] QtLauncher refactoring:
+
+ Make the LauncherWindow depend less on the view, so that more
+ code can be shared in near future.
+
+ * QtLauncher/main.cpp:
+ (LauncherWindow::sendTouchEvent):
+ (LauncherWindow::loadFinished):
+ (LauncherWindow::zoomIn):
+ (LauncherWindow::zoomOut):
+ (LauncherWindow::resetZoom):
+ (LauncherWindow::toggleZoomTextOnly):
+ (LauncherWindow::dumpHtml):
+ (LauncherWindow::selectElements):
+ (LauncherWindow::setupUI):
+
+2010-01-27 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Correctly handle the KeyLocation argument that has been introduced
+ recently to test location-dependent key events in EventSender.keyDown.
+ http://bugs.webkit.org/show_bug.cgi?id=28247
+
+ Test: fast/events/keydown-numpad-keys.html
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (keyDownCallback):
+
+2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann.
+
+ [Qt] QtLauncher refactoring:
+
+ Move out code from the MainWindow (renamed to LauncherWindow)
+ that is not depending on the view, and add it to a new class
+ called MainWindow.
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/main.cpp:
+ (LauncherWindow::LauncherWindow):
+ (LauncherWindow::eventFilter):
+ (LauncherWindow::loadStarted):
+ (LauncherWindow::loadFinished):
+ (LauncherWindow::newWindow):
+ (LauncherWindow::setupUI):
+ (WebPage::createWindow):
+ (main):
+ * QtLauncher/mainwindow.cpp: Added.
+ (MainWindow::MainWindow):
+ (MainWindow::buildUI):
+ (MainWindow::page):
+ (MainWindow::setAddressUrl):
+ (MainWindow::addCompleterEntry):
+ (MainWindow::load):
+ (MainWindow::changeLocation):
+ (MainWindow::openFile):
+ * QtLauncher/mainwindow.h: Added.
+
+2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann.
+
+ [Qt] QtLauncher, coding style fixes.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ (MainWindow::sendTouchEvent):
+ (MainWindow::eventFilter):
+ (MainWindow::loadURL):
+ (MainWindow::setupUI):
+ (WebPage::createPlugin):
+
+2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann.
+
+ [Qt] QtLauncher refactoring, separating the webview and
+ adding a QGraphicsWebView based version.
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ * QtLauncher/webpage.h:
+ * QtLauncher/webview.cpp: Added.
+ (createContextMenu):
+ (WebViewGraphicsBased::mousePressEvent):
+ (WebViewTraditional::mousePressEvent):
+ (WebViewGraphicsBased::contextMenuEvent):
+ (WebViewTraditional::contextMenuEvent):
+ * QtLauncher/webview.h: Added.
+ (WebViewGraphicsBased::WebViewGraphicsBased):
+ (WebViewTraditional::WebViewTraditional):
+
+2010-01-27 Alexander Pavlov <apavlov@chromium.org>
+
+ Adding myself as committer. No review necessary.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ webkit-patch needs an open-bugs command
+ https://bugs.webkit.org/show_bug.cgi?id=30793
+
+ * Scripts/test-webkitpy: import OpenBugsTest
+ * Scripts/webkit-patch: import OpenBugs
+ * Scripts/webkitpy/commands/download_unittest.py: don't import unittest
+ * Scripts/webkitpy/commands/early_warning_system_unittest.py: ditto
+ * Scripts/webkitpy/commands/queries_unittest.py: ditto
+ * Scripts/webkitpy/commands/queues_unittest.py: ditto
+ * Scripts/webkitpy/commands/upload_unittest.py: ditto
+ * Scripts/webkitpy/mock_bugzillatool.py: log when user.open_url is called.
+
+2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann
+
+ [Qt] QtLauncher refactoring, separating utility methods.
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/main.cpp:
+ * QtLauncher/utils.cpp: Added.
+ (urlFromUserInput):
+ * QtLauncher/utils.h: Added.
+
+2010-01-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann
+
+ [Qt] Refactor the code in the QtLauncher dealing with HTTP proxy.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow):
+ * QtLauncher/webpage.cpp:
+ (WebPage::WebPage):
+ (WebPage::applyProxy):
+ * QtLauncher/webpage.h:
+
+2010-01-26 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Corrects debug build of DumpRenderTree on Windows.
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+
+2010-01-26 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34070
+
+ Moves the try/catch for OSError exceptions in Executive.run_command
+ to Credentials.read_credentials() so that the unit test
+ webkitpy.scm_unittest.SCMClassTests.test_error_handlers can
+ assert that Executive.run_command throws an OSError exception.
+
+ * Scripts/webkitpy/credentials.py:
+ * Scripts/webkitpy/executive.py: Moved try/catch for OSError to
+ method Credentials.read_credentials().
+ * Scripts/webkitpy/executive_unittest.py: Removed tests that no longer
+ apply: test_run_command_with_bad_command_check_return_code and
+ test_run_command_with_bad_command_check_calls_error_handler. Added new
+ test to assert that run_command throws OSError exceptions.
+
+2010-01-26 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] DRT WebHistory support
+ https://bugs.webkit.org/show_bug.cgi?id=34167
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::webHistoryItemCount):
+ (LayoutTestController::keepWebHistory):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-26 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [Win] Add modifiers parameter support to Windows DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=34068
+
+ Add support for functional name modifiers; "addSelectionKey" and
+ "rangeSelectionKey", and modifiers parameter to eventSender.mouseDown()
+ and eventSender.mouseUp().
+ This change is similar to r53498 for Mac.
+
+ * DumpRenderTree/win/EventSender.cpp:
+ (buildModifierFlags): New function to set MK_CONTROL or MK_SHIFT to WPARAM.
+ (mouseDownCallback): Call buidlModifiersFlags().
+ (mouseUpCallback): ditto.
+ (keyDownCallback): Add support for "addSelectionkey" and "rangeSelectionKey".
+
+2010-01-26 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ The Python autoinstall cache directory now only gets created
+ in the directory containing autoinstall.py.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33365
+
+ * Scripts/webkitpy/autoinstall.py:
+ - Also added a README file to the cache directory saying
+ where it came from.
+
+2010-01-26 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Moved the check-webkit-style processors into a new
+ webkitpy/style/processors directory.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34060
+
+ * Scripts/webkitpy/style/checker.py:
+ * Scripts/webkitpy/style/checker_unittest.py:
+ * Scripts/webkitpy/style/cpp_style.py: Removed.
+ * Scripts/webkitpy/style/cpp_style_unittest.py: Removed.
+ * Scripts/webkitpy/style/processors: Added.
+ * Scripts/webkitpy/style/processors/__init__.py: Added.
+ * Scripts/webkitpy/style/processors/cpp.py: Copied from WebKitTools/Scripts/webkitpy/style/cpp_style.py.
+ * Scripts/webkitpy/style/processors/cpp_unittest.py: Copied from WebKitTools/Scripts/webkitpy/style/cpp_style_unittest.py.
+ * Scripts/webkitpy/style/processors/text.py: Copied from WebKitTools/Scripts/webkitpy/style/text_style.py.
+ * Scripts/webkitpy/style/processors/text_unittest.py: Copied from WebKitTools/Scripts/webkitpy/style/text_style_unittest.py.
+ * Scripts/webkitpy/style/text_style.py: Removed.
+ * Scripts/webkitpy/style/text_style_unittest.py: Removed.
+ * Scripts/webkitpy/style/unittests.py:
+
+2010-01-26 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, make sure stub function returns a value.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::counterValueForElementById):
+
+2010-01-26 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Windows build references non-existent include paths
+ https://bugs.webkit.org/show_bug.cgi?id=34175
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/ImageDiff.vcproj:
+ * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+
+2010-01-26 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Separating out the UrlLoader from the QtLauncher in it's
+ own implementation and header file.
+
+ * QtLauncher/main.cpp:
+ (main):
+ * QtLauncher/urlloader.cpp: Added.
+ (UrlLoader::UrlLoader):
+ (UrlLoader::loadNext):
+ (UrlLoader::init):
+ (UrlLoader::getUrl):
+ * QtLauncher/urlloader.h: Added.
+
+2010-01-25 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Refactored check-webkit-style by removing the file path
+ parameter from the style error handler functions.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34031
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added _default_style_error_handler() to StyleChecker class.
+ - Moved handle_style_error() to inside _default_style_error_handler().
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Removed file path from calls to error handler.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ - Removed file path from calls to error handler.
+
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+ - Removed file path from calls to error handler.
+
+ * Scripts/webkitpy/style/text_style.py:
+ - Removed file path from calls to error handler.
+
+ * Scripts/webkitpy/style/text_style_unittest.py:
+ - Removed file path from calls to error handler.
+
+2010-01-25 Jeremy Orlow <jorlow@chromium.org>
+
+ Adding myself as reviewer. No review necessary.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-25 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Improved prepare-ChangeLog so that it preserves the relative
+ indentation of a git commit message.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34058
+
+ * Scripts/prepare-ChangeLog:
+ - Also adjusted the script so that it does not add white
+ space characters to empty lines.
+
+2010-01-24 Eric Seidel <eric@webkit.org>
+
+ No review, rolling out r53763.
+ http://trac.webkit.org/changeset/53763
+ https://bugs.webkit.org/show_bug.cgi?id=33895
+
+ Broke 20+ tests on Windows.
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+
+2010-01-24 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ More pep8 compliance.
+
+ * Scripts/webkitpy/mock_bugzillatool.py:
+
+2010-01-24 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ More pep8 compliance.
+
+ * Scripts/webkitpy/executive.py:
+ * Scripts/webkitpy/grammar.py:
+
+2010-01-24 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ More pep8 compliance.
+
+ * Scripts/webkitpy/comments.py:
+ * Scripts/webkitpy/committers.py:
+ * Scripts/webkitpy/credentials.py:
+
+2010-01-24 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ Make changelogs.py pass pep8.
+
+ * Scripts/webkitpy/changelogs.py:
+
+2010-01-23 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ [Qt] Unreviewed build fix
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/webinspector.h:
+
+2010-01-23 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann.
+
+ [Qt] Move the WebInspector class to it's own header file.
+
+ * QtLauncher/main.cpp:
+ * QtLauncher/webinspector.h: Added.
+ (WebInspector::WebInspector):
+ (WebInspector::showEvent):
+ (WebInspector::hideEvent):
+
+2010-01-23 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Qt DRT: respect window.close() and window.closed()
+
+ Qt DRT needs to maintain a correct count of open windows
+ for windowCount(). It also needs to delete windows that
+ have been closed by window.close().
+
+ This fixes the following tests:
+
+ plugins/destroy-during-npp-new.html
+ fast/dom/Document/early-document-access.html
+ fast/dom/Window/window-early-properties.html
+ fast/events/open-window-from-another-frame.html
+ fast/events/popup-blocking-click-in-iframe.html
+
+ https://bugs.webkit.org/show_bug.cgi?id=32953
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::createWindow):
+ (WebCore::DumpRenderTree::windowCloseRequested):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::maybeDump):
+
+2010-01-23 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Added a user default for specifying a fallback frameworks path in case
+ the bundle does not contain frameworks for the current Mac OS X version.
+
+ * WebKitLauncher/main.m:
+ (fallbackMacOSXVersion): Added. Looks up the fallback version in a dictionary
+ keyed by the FallbackSystemVersions user default and returns it.
+ (main): If a frameworks directory for the current system version is not found,
+ try the fallback.
+
+2010-01-22 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Make run-webkit-tests work under Cygwin for the Qt port
+
+ setPathForRunningWebKitApp() is implemented for the Qt port
+ by using qmake to query for the location of the Qt libraries.
+
+ This requires the original environment (%ENV) to be untouched,
+ so launchWithCurrentEnv() was refactored to launchWithEnv(),
+ and the code in openDumpTool() to not use %ENV but a %CLEAN_ENV
+ instead. This has the added benefit of getting rid of the temp
+ variables used for storing the current env.
+
+ openDumpTool() is also refactored a bit into platform-spesific,
+ port-spesific, and generic environment variables.
+
+ Checks for undef was added a few places to fix Perl concat
+ warnings when run-webkit-tests is aborted.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33895
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+
+2010-01-22 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ [wx] Remove the Bakefile build system, which is no longer being used.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34022
+
+ * DumpRenderTree/wx/DumpRenderTree.bkl: Removed.
+ * wx/browser/browser.bkl: Removed.
+ * wx/build-wxwebkit: Removed.
+
+2010-01-22 Gustavo Noronha Silva <gns@gnome.org>
+
+ Reviewed by Simon Fraser.
+
+ Reset zoom level to 1.0 when resetting view state. This is causing
+ many tests to fail after svg/custom/text-zoom.xhtml changes the
+ zoom level.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2010-01-22 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=34025
+ Enable client-based Geolocation abstraction for Mac, Windows AppleWebKit targets.
+
+ * Scripts/build-webkit:
+
+2010-01-22 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Arg. Someone renamed limit to output_limit on me.
+
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-01-22 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ Make __init__.py and buildbot.py pass pep8 style checker.
+
+ * Scripts/webkitpy/__init__.py:
+ * Scripts/webkitpy/buildbot.py:
+
+2010-01-21 Joe Mason <jmason@rim.com>
+
+ Reviewed by Adam Barth.
+
+ webkit-patch should retry on invalid password
+ https://bugs.webkit.org/show_bug.cgi?id=33955
+
+ Ask for bugs.webkit.org authentication in a loop.
+
+ * Scripts/webkitpy/bugzilla.py:
+
+2010-01-22 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Don't call seek on a NoneType.
+
+ * Scripts/webkitpy/statusserver.py:
+
+2010-01-22 Petri Latvala <petri.latvala@nomovok.com>
+
+ Reviewed by David Levin.
+
+ check-webkit-style breaks on files with unknown types
+ https://bugs.webkit.org/show_bug.cgi?id=34001
+
+ For files with type FileType.NONE, dispatch_processor returns None.
+
+ * Scripts/webkitpy/style/checker.py: Don't call process_file with a processor of value None.
+
+2010-01-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Make bugzilla.py and webkitport.py conform to pep8
+ https://bugs.webkit.org/show_bug.cgi?id=34015
+
+ This patch makes webkitport.py and bugzilla.py mostly conform to PEP8
+ style as enforced by pep8.py. I wasn't able to get rid of all the
+ errors because I'm not sure how to wrap some lines properly. Also,
+ there are a few deprication errors that I couldn't resolve easily.
+ However, this is a massive improvement in compliance.
+
+ * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/webkitport.py:
+
+2010-01-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Limit length of EWS results to 5MB
+ https://bugs.webkit.org/show_bug.cgi?id=34016
+
+ Hopefully this will fix the bug where the results link doesn't appear.
+ Our current theory is that the results blob is too big and the server
+ is rejecting the request with a 500 error. That causes us to re-try
+ the post, but when we re-try the StringIO buffer has its seek pointer
+ at the end.
+
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/statusserver.py:
+
+2010-01-22 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Made check-webkit-style able to check patches when script not
+ run from source root. Also consolidated external references
+ to a single file.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33791
+
+ * Scripts/check-webkit-style:
+ - Changed to import style_references.py.
+
+ * Scripts/webkitpy/style/__init__.py:
+ - Removed __path__ hack that allowed searching Scripts/ directory.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Changed to import style_references.py.
+
+ * Scripts/webkitpy/style_references.py: Added.
+
+2010-01-22 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Fix the leak of ThreadIdentifiers in threadMap across threads.
+ https://bugs.webkit.org/show_bug.cgi?id=32689
+
+ Add a new test to verify the ThreadIdentifiers are not reused across threads.
+ The test runs in the beginning of DumpRenderTree and spawns 2 non-WTF treads sequentially,
+ waiting for the previous thread to terminate before starting the next.
+ The treads use WTF::currentThread() in their thread function. Without a fix, this
+ causes both threads to have the same ThreadIdentifier which triggers ASSERT in thread function.
+ It also starts another thread using WTF. Without the fix, this finds pthread handle from previous
+ threads in the WTF threadMap and asserts in WTF::establishIdentifierForPthreadHandle().
+ The test practically does not affect the DRT run time because the threads end immediately.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (runThread): Test thread function.
+ (testThreadIdentifierMap):
+ (dumpRenderTree):
+
+2010-01-22 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Fix a bug that mouseDown:withModifiers: is never called.
+ https://bugs.webkit.org/show_bug.cgi?id=33989
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (+[EventSendingController isSelectorExcludedFromWebScript:]):
+ (+[EventSendingController webScriptNameForSelector:]):
+
+2010-01-22 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Antti Koivisto.
+
+ [Qt] Separate out the WebPage class into it's own
+ cpp/header files. Also, removed the assumption that
+ the view is a QWebView, in preparation of a merger
+ of the two Qt WebKit launchers.
+
+ * QtLauncher/QtLauncher.pro:
+ * QtLauncher/main.cpp:
+ (WebView::mousePressEvent):
+ * QtLauncher/webpage.cpp: Added.
+ (WebPage::supportsExtension):
+ (WebPage::extension):
+ (WebPage::acceptNavigationRequest):
+ (WebPage::openUrlInDefaultBrowser):
+ * QtLauncher/webpage.h: Added.
+ (WebPage::WebPage):
+
+2010-01-21 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Refactored to move file name and file-reading related code
+ from cpp_style.py and text_style.py to checker.py.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33775
+
+ * Scripts/check-webkit-style:
+ - Updates caused by changes to checker.py.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added SKIPPED_FILES_WITH_WARNING list.
+ - Added SKIPPED_FILES_WITHOUT_WARNING list.
+ - Added FileType class.
+ - Added ProcessorDispatcher class.
+ - In StyleChecker class:
+ - Renamed process_patch() to check_patch().
+ - Renamed process_file() to check_file().
+ - Added _process_file().
+ - Related refactoring.
+ - Addressed check_patch() FIXME to share code with process_file().
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Added ProcessorDispatcherSkipTest class.
+ - Added ProcessorDispatcherDispatchTest class.
+ - Added StyleCheckerCheckFileTest class.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ - Renamed process_file_data() to _process_lines.
+ - Removed process_file() (moved logic to checker.py).
+ - Removed can_handle() (moved logic to checker.py).
+ - Added CppProcessor class.
+ - Removed is_exempt() (moved logic to checker.py).
+ - Added process_file_data() back as a wrapper function.
+
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+ - Removed test_can_handle().
+ - Removed test_is_exempt().
+ - Added CppProcessorTest class.
+
+ * Scripts/webkitpy/style/text_style.py:
+ - Added TextProcessor class.
+ - Removed process_file().
+ - Removed can_handle().
+
+ * Scripts/webkitpy/style/text_style_unittest.py:
+ - Removed test_can_handle().
+ - Added TextProcessorTest class.
+
+2010-01-21 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ Create a unit-tested subroutine to parse patch files created
+ by svn-create-patch.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33475
+
+ * Scripts/VCSUtils.pm:
+ - Added parseDiff().
+ - Added parsePatch().
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl: Added.
+ - Added unit tests for parseDiff().
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
+ - Total number of tests now computed dynamically.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl: Added.
+ - Added unit tests for parsePatch().
+
+2010-01-21 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, add new directory to dir list.
+
+ * wx/build/settings.py:
+
+2010-01-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Make the EWS transactional
+ https://bugs.webkit.org/show_bug.cgi?id=33978
+
+ Now if the EWS gets interrupted in the middle of processing a patch,
+ the bots will re-process the patch.
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/commands/queues_unittest.py:
+ * Scripts/webkitpy/patchcollection.py:
+ * Scripts/webkitpy/patchcollection_unittest.py: Added.
+
+2010-01-21 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Add missing "ago" for style in the status bubble.
+
+ * QueueStatusServer/templates/statusbubble.html:
+
+2010-01-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by David Levin.
+
+ [style-queue] should not complain about identifier names with underscores under WebKit/gtk/webkit/
+ https://bugs.webkit.org/show_bug.cgi?id=33356
+
+ White list unix_hacker_style names in WebKit/gtk/webkit because these
+ are used in the GTK+ API.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-21 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] add setDomainRelaxationForbiddenForURLScheme in Qt DRT
+ https://bugs.webkit.org/show_bug.cgi?id=33945
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-21 Simon Hausmann <simon.hausmann@nokia.com>
+
+ No review, rolling out 53615 as it causes two
+ crashes on the bot.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::createWindow):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::maybeDump):
+
+2010-01-21 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Simon Hausmann.
+
+ Qt DRT: respect window.close() and window.closed()
+
+ Qt DRT needs to maintain a correct count of open windows
+ for windowCount(). It also needs to delete windows that
+ have been closed by window.close().
+
+ This fixes the following tests:
+
+ plugins/destroy-during-npp-new.html
+ fast/dom/Document/early-document-access.html
+ fast/dom/Window/window-early-properties.html
+ fast/events/open-window-from-another-frame.html
+ fast/events/popup-blocking-click-in-iframe.html
+
+ https://bugs.webkit.org/show_bug.cgi?id=32953
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::createWindow):
+ (WebCore::DumpRenderTree::windowCloseRequested):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::maybeDump):
+
+2010-01-20 Eric Seidel <eric@webkit.org>
+
+ No review, rolling out r53593.
+ http://trac.webkit.org/changeset/53593
+ https://bugs.webkit.org/show_bug.cgi?id=33496
+
+ Re-rollout this patch, the commit-queue should not have landed
+ it again, but it did due to land-diff and rollout both not
+ clearing flags.
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/queueengine.py:
+ * Scripts/webkitpy/scm.py:
+ * Scripts/webkitpy/scm_unittest.py:
+
+2010-01-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-commit-queue status page is confusing
+ https://bugs.webkit.org/show_bug.cgi?id=33496
+
+ This should improve the status page by removing more Fail messages.
+ To do this, I re-factored the CommitQueue and the AbstractReviewQueues
+ to behave more like one another. This meant moving where the failure reporting was done.
+ Previously the AbstractReviewQueue always used the parent process to report the error,
+ while CommitQueue used the subprocess when possible, and the parent only reported errors
+ that we didn't know how to handle (bugs in the commit-queue itself).
+ Now the AbstractReviewQueue follow's the commit-queue's model. This got rid of a try-block
+ in both implementations and required teaching handle_script_error in each to post Fail messages
+ to the status server instead of calling exit(1).
+
+ This will also make the style-queue share more bug posting logic with other queues:
+ https://bugs.webkit.org/show_bug.cgi?id=33871
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ - Don't exit(1) as that will cause the calling queue to also report Fail to the status server.
+ Implementors of handle_script_error are expected to update the status server if needed, but only exit if the error could not be handled.
+ So we instead pass patch_has_failed_this_queue=True to _update_status_for_script_error in the case that this was a real failure.
+ _update_status_for_script_error knows how to post the Fail message to the status server.
+ - Teach _update_status_for_script_error how to post Fail messages to the status server.
+ * Scripts/webkitpy/commands/queues.py:
+ - Remove the try block from process_work_item since the caller already has one.
+ - Only CC watchers on failure to cut down on commit-queue generated mail.
+ - handle_unexpected_error needs to mark _did_fail now that the try block is gone from process_work_item.
+ - Abstract _format_script_error_output_for_bug to share code between all queues.
+ - The new _format_script_error_output_for_bug allows the style-queue to share the posting limit with other queues, as well as support linking to the full output.
+ - Rename _can_build_and_test to _current_checkout_builds_and_passes_tests to better explain what revision it's testing.
+ - Move logging out of _can_build_and_test and make the logs explain what revision we're testing.
+ - handle_script_error now posts Fail instead of the try block in process_work_item handling it.
+ * Scripts/webkitpy/queueengine.py:
+ - QueueEngine is no longer used just by the commit-queue, update the logging to say "processing" instead of landing.
+ * Scripts/webkitpy/scm.py:
+ - Add new checkout_revision function.
+ * Scripts/webkitpy/scm_unittest.py:
+ - Test our new checkout_revision function.
+
+2010-01-20 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ WebSocket: Missing Request-URI, when no tralling slash in host
+ https://bugs.webkit.org/show_bug.cgi?id=33689
+
+ Update pywebsocket to 0.4.7.1, which supports alias for resource
+ name, so that we could test for ws://127.0.0.1:8880
+
+ * Scripts/run-webkit-tests:
+ * Scripts/run-webkit-websocketserver:
+ * pywebsocket/mod_pywebsocket/dispatch.py:
+ * pywebsocket/mod_pywebsocket/handshake.py:
+ * pywebsocket/mod_pywebsocket/standalone.py:
+ * pywebsocket/setup.py:
+ * pywebsocket/test/test_dispatch.py:
+ * pywebsocket/test/test_handshake.py:
+
+2010-01-20 Eric Seidel <eric@webkit.org>
+
+ No review, rolling out r53537.
+ http://trac.webkit.org/changeset/53537
+ https://bugs.webkit.org/show_bug.cgi?id=33496
+
+ Added a failure condition to the commit-queue and looks to
+ have broken the EWS bots
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/queueengine.py:
+ * Scripts/webkitpy/scm.py:
+ * Scripts/webkitpy/scm_unittest.py:
+
+2010-01-20 Jon Honeycutt <jhoneycutt@apple.com>
+
+ MSAA: accSelect() is not implemented
+
+ https://bugs.webkit.org/show_bug.cgi?id=33918
+ <rdar://problem/7436861>
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (takeFocusCallback):
+ Call the object's takeFocus() function.
+ (takeSelectionCallback):
+ Call its takeSelection() function.
+ (addSelectionCallback):
+ Call its addSelection() function.
+ (removeSelectionCallback):
+ Call its removeSelection() function.
+ (AccessibilityUIElement::getJSClass):
+ Add new functions to the JS class definition.
+
+ * DumpRenderTree/AccessibilityUIElement.h:
+ Declare new functions.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::takeFocus):
+ Stubbed.
+ (AccessibilityUIElement::takeSelection):
+ Stubbed.
+ (AccessibilityUIElement::addSelection):
+ Stubbed.
+ (AccessibilityUIElement::removeSelection):
+ Stubbed.
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::takeFocus):
+ Stubbed.
+ (AccessibilityUIElement::takeSelection):
+ Stubbed.
+ (AccessibilityUIElement::addSelection):
+ Stubbed.
+ (AccessibilityUIElement::removeSelection):
+ Stubbed.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::takeFocus):
+ Call the object's accSelect() function, passing the appropriate flag.
+ (AccessibilityUIElement::takeSelection):
+ Ditto.
+ (AccessibilityUIElement::addSelection):
+ Ditto.
+ (AccessibilityUIElement::removeSelection):
+ Ditto.
+
+2010-01-20 Andras Becsi <abecsi@inf.u-szeged.hu>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Extract Apache handling to httpd.pm module and use the provided functionality
+ in scripts where Apache is needed.
+ The module httpd.pm stores the PID of Apache in a variable and cleans up
+ the PID directory after Apache properly shut down. Catching INT and TERM
+ signals allows the scripts to close Apache and clean up its PID directory
+ even if the testing was interrupted.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33153
+
+ * Scripts/webkitperl/httpd.pm: Added.
+ * Scripts/run-iexploder-tests:
+ * Scripts/run-webkit-httpd:
+ * Scripts/run-webkit-tests:
+
+2010-01-20 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Make DumpRenderTree build on Windows
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/main.cpp:
+
+2010-01-20 Steve Block <steveblock@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Fix commit bot to land patches in order of the bug last modification date.
+ https://bugs.webkit.org/show_bug.cgi?id=33395
+
+ * Scripts/webkitpy/bugzilla.py: Modified. Added 'order=Last+Changed' to bugzilla commit queue URL.
+
+2010-01-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Teach check-webkit-style about WebKit/gtk/tests
+ https://bugs.webkit.org/show_bug.cgi?id=33892
+
+ Removes false positives found in
+ https://bugs.webkit.org/show_bug.cgi?id=30883
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Teach check-webkit-style about QGVLauncher
+ https://bugs.webkit.org/show_bug.cgi?id=33890
+
+ Remove false positives found in
+ https://bugs.webkit.org/show_bug.cgi?id=33708
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ webkit-commit-queue status page is confusing
+ https://bugs.webkit.org/show_bug.cgi?id=33496
+
+ This should improve the status page by removing more Fail messages.
+ To do this, I re-factored the CommitQueue and the AbstractReviewQueues
+ to behave more like one another. This meant moving where the failure reporting was done.
+ Previously the AbstractReviewQueue always used the parent process to report the error,
+ while CommitQueue used the subprocess when possible, and the parent only reported errors
+ that we didn't know how to handle (bugs in the commit-queue itself).
+ Now the AbstractReviewQueue follow's the commit-queue's model. This got rid of a try-block
+ in both implementations and required teaching handle_script_error in each to post Fail messages
+ to the status server instead of calling exit(1).
+
+ This will also make the style-queue share more bug posting logic with other queues:
+ https://bugs.webkit.org/show_bug.cgi?id=33871
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ - Don't exit(1) as that will cause the calling queue to also report Fail to the status server.
+ Implementors of handle_script_error are expected to update the status server if needed, but only exit if the error could not be handled.
+ So we instead pass patch_has_failed_this_queue=True to _update_status_for_script_error in the case that this was a real failure.
+ _update_status_for_script_error knows how to post the Fail message to the status server.
+ - Teach _update_status_for_script_error how to post Fail messages to the status server.
+ * Scripts/webkitpy/commands/queues.py:
+ - Remove the try block from process_work_item since the caller already has one.
+ - Only CC watchers on failure to cut down on commit-queue generated mail.
+ - handle_unexpected_error needs to mark _did_fail now that the try block is gone from process_work_item.
+ - Abstract _format_script_error_output_for_bug to share code between all queues.
+ - The new _format_script_error_output_for_bug allows the style-queue to share the posting limit with other queues, as well as support linking to the full output.
+ - Rename _can_build_and_test to _current_checkout_builds_and_passes_tests to better explain what revision it's testing.
+ - Move logging out of _can_build_and_test and make the logs explain what revision we're testing.
+ - handle_script_error now posts Fail instead of the try block in process_work_item handling it.
+ * Scripts/webkitpy/queueengine.py:
+ - QueueEngine is no longer used just by the commit-queue, update the logging to say "processing" instead of landing.
+ * Scripts/webkitpy/scm.py:
+ - Add new checkout_revision function.
+ * Scripts/webkitpy/scm_unittest.py:
+ - Test our new checkout_revision function.
+
+2010-01-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Exempt JavaScriptCore/qt/api from style checks
+ https://bugs.webkit.org/show_bug.cgi?id=33879
+
+ Apparently there is a JavaScriptCore API for Qt as well as a WebKit
+ API.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-19 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Don't use QSocketNotifier in the DRT for reading stdin
+
+ QSocketNotifier is not available on Windows. Instead we read
+ stdin synchronously after each test using signals and slots.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/main.cpp:
+
+2010-01-19 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ Move chromium-ews back to building release only to make the EWS faster.
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+
+2010-01-17 Jon Honeycutt <jhoneycutt@apple.com>
+
+ MSAA: The child <option> elements of a non-multiple <select> are not
+ exposed
+
+ https://bugs.webkit.org/show_bug.cgi?id=33773
+ <rdar://problem/7550556>
+
+ Reviewed by Alice Liu.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getIsVisibleCallback):
+ Call the object's isVisible() function.
+ (getIsOffScreenCallback):
+ Ditto, for isOffScreen().
+ (getIsCollapsedCallback):
+ Ditto, for isCollapsed().
+ (getHasPopupCallback):
+ Ditto, for hasPopup().
+ (AccessibilityUIElement::getJSClass):
+ Add isVisible and isOffScreen attributes.
+
+ * DumpRenderTree/AccessibilityUIElement.h:
+ Declare new functions.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isVisible):
+ Stubbed.
+ (AccessibilityUIElement::isOffScreen):
+ Stubbed.
+ (AccessibilityUIElement::isCollapsed):
+ Stubbed.
+ (AccessibilityUIElement::hasPopup):
+ Stubbed.
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isVisible):
+ Stubbed.
+ (AccessibilityUIElement::isOffScreen):
+ Stubbed.
+ (AccessibilityUIElement::isCollapsed):
+ Stubbed.
+ (AccessibilityUIElement::hasPopup):
+ Stubbed.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::showMenu):
+ Call the object's accDoDefaultAction() to show its popup menu.
+ (AccessibilityUIElement::isEnabled):
+ Check that the object does not have the "unavailable" state.
+ (AccessibilityUIElement::isVisible):
+ Check that the object does not have the "invisible" state.
+ (AccessibilityUIElement::isOffScreen):
+ Check whether the object has the "offscreen" state.
+ (AccessibilityUIElement::isCollapsed):
+ Check whether the object has the "collapsed" state.
+ (AccessibilityUIElement::hasPopup):
+ Check whether the object has the "has popup" state.
+
+2010-01-19 Victor Wang <victorw@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Correct committer name.
+ https://bugs.webkit.org/show_bug.cgi?id=33868
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-19 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ [DRT][Mac] Add modifiers parameter to eventSender.mouseDown() and eventSender.mouseUp()
+ https://bugs.webkit.org/show_bug.cgi?id=33783
+
+ Some listbox tests check selection behavior by click events with
+ "meta" or "shift" keys. Behaviors for such modifier keys are
+ platform-dependent. The new parameter of mouseDown() and mouseUp()
+ allows to specify not only concrete modifier keys such as
+ "shiftKey" "metaKey", but also functional names like
+ "addSelectionKey" "rangeSelectionKey".
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (+[EventSendingController isSelectorExcludedFromWebScript:]):
+ (+[EventSendingController webScriptNameForSelector:]):
+ (buildModifierFlags):
+ (-[EventSendingController mouseDown:withModifiers:]):
+ (-[EventSendingController mouseDown:]):
+ (-[EventSendingController mouseUp:withModifiers:]):
+ (-[EventSendingController mouseUp:]):
+ (-[EventSendingController keyDown:withModifiers:withLocation:]):
+
+2010-01-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Unbreak --request-commit
+ https://bugs.webkit.org/show_bug.cgi?id=33832
+
+ * Scripts/webkitpy/bugzilla.py:
+
+2010-01-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ validate-committer-lists throws exception and committers.py needs a refresh
+ https://bugs.webkit.org/show_bug.cgi?id=33831
+
+ * Scripts/validate-committer-lists: use webkit_logging
+ * Scripts/webkitpy/committers.py: Add recently minted committers. Fix Simon Hausmanns email address list to include his webkit-committers@lists address.
+
+2010-01-18 Adam Roben <aroben@apple.com>
+
+ Add LayoutTestController support for calling new WebKit SPI to
+ disallow setting document.domain
+
+ DRT part of fixing <http://webkit.org/b/33806>
+ <rdar://problem/7552837> Would like API to disallow setting of
+ document.domain for pages with certain URL schemes
+
+ Reviewed by Sam Weinig.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setDomainRelaxationForbiddenForURLSchemeCallback): Added. Calls
+ through to LayoutTestController.
+ (LayoutTestController::staticFunctions): Added
+ setDomainRelaxationForbiddenForURLScheme.
+
+ * DumpRenderTree/LayoutTestController.h: Added
+ setDomainRelaxationForbiddenForURLScheme.
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
+ Added. Calls through to WebKit.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setDomainRelaxationForbiddenForURLScheme):
+ Stubbed out.
+
+2010-01-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Rename patches-to-commit to patches-in-commit-queue
+ https://bugs.webkit.org/show_bug.cgi?id=33789
+
+ The command really lists the patches in the commit-queue not all the
+ patches that are pending-commit (as the FIXME commands).
+
+ * Scripts/webkitpy/commands/queries.py:
+ * Scripts/webkitpy/commands/queries_unittest.py:
+
+2010-01-18 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Force qmake to generate a single makefile for DerivedSources.pro
+
+ * Scripts/webkitdirs.pm:
+
+2010-01-18 Adam Roben <aroben@apple.com>
+
+ Clean up use of /useenv when invoking Visual C++
+
+ This change reverts things to their pre-r49485 state. That revision
+ (and, subsequently, r49664 and r51788) started passing /useenv to
+ Visual C++, even in cases where we don't want to do so (such as when
+ invoking Visual C++ Express), in the name of making the Chromium build
+ work. Now that Chromium isn't using buildVisualStudioProject or
+ pdevenv, we can put things back they way they were.
+
+ Fixes <http://webkit.org/b/33797> build-webkit fails with VC++ Express
+ (due to /useenv flag)
+
+ Reviewed by Sam Weinig.
+
+ * Scripts/pdevenv: Always pass /useenv. Chromium doesn't use this
+ script anymore.
+ * Scripts/webkitdirs.pm:
+ (buildVisualStudioProject): Never pass /useenv anymore. pdevenv takes
+ care of this itself, and we don't want to pass /useenv when not using
+ pdevenv (e.g., when using VC++ Express, because that will cause it to
+ ignore the Platform SDK).
+
+2010-01-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch land-safely should obsolete old patches
+ https://bugs.webkit.org/show_bug.cgi?id=33788
+
+ When posting a commit-queue+ patch with land-safely, we should
+ obsolete the old patches on the bug. They're really confusing
+ because the main use case is to address reviewer feedback on a
+ previous patch.
+
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+
+2010-01-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by David Levin.
+
+ webkit-patch should authenticate more often
+ https://bugs.webkit.org/show_bug.cgi?id=33701
+
+ This makes it easier to work with security patches.
+
+ * Scripts/webkitpy/bugzilla.py:
+
+2010-01-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ style checker needs to know about GObject-specific requirements
+ inside WebCore/bindings/gobject/
+ https://bugs.webkit.org/show_bug.cgi?id=33606
+
+ Add an exception to the underscore rule for certain
+ GObject-specific names.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [check-webkit-style] does understand ResourceHandleWin.h
+ https://bugs.webkit.org/show_bug.cgi?id=32975
+
+ I'm not 100% convinced this fix is correct, but without more examples,
+ it's hard to generalize. We can always generalize the fix in the
+ future.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-18 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix.
+
+ * Scripts/webkitpy/bugzilla.py:
+
+2010-01-18 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Actually make land-safely mark commit-queue+ as
+ discussed with Eric.
+
+ * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/steps/postdiffforcommit.py:
+
+2010-01-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ style-queue complains about one-line macros that include multiple statements
+ https://bugs.webkit.org/show_bug.cgi?id=33173
+
+ Add an exception for multiple statements on a line that starts a macro.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ [check-webkit-style] qt unit testing false positives
+ https://bugs.webkit.org/show_bug.cgi?id=32833
+
+ Exempt the Qt API and unit tests from the style checker.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ style-check script reports loads of errors on gtk2drawing.c
+ https://bugs.webkit.org/show_bug.cgi?id=33771
+
+ Exempt WebCore/platform/gtk/gtk2drawing.c and
+ WebCore/platform/gtk/gtk2drawing.h from style checks.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-17 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Finished eliminating _cpp_style_state global state variable from
+ check-webkit-style code and eliminating _CppStyleState class.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33764
+
+ * Scripts/webkitpy/style/checker.py:
+ - Minor updates caused by changes to cpp_style.py.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ - Removed _CppStyleState class.
+ - Removed verbose_level functions.
+ - Added verbosity as a parameter to _FunctionState constructor.
+ - Added verbosity as a parameter to process_file().
+ - Added verbosity as a parameter to process_file_data().
+
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+ - Added helper functions to set verbosity while running tests.
+
+2010-01-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ check-webkit-style underscore check should be disabled for Qt methods starting with qt_
+ https://bugs.webkit.org/show_bug.cgi?id=33663
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ style-queue complains about missing #include of config.h for non-WebCore projects
+ https://bugs.webkit.org/show_bug.cgi?id=33170
+
+ WebKitAPITests are consumers of the WebKit API and therefore do not
+ need to follow the same include discipline as the rest of WebKit. This
+ patch exempts them from the include checks.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+
+2010-01-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ EWS (Early Warning Systems) should build both debug and release
+ https://bugs.webkit.org/show_bug.cgi?id=33681
+
+ Build both debug and release for chromium-ews.
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+
+2010-01-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ style-queue should include instructions for how to file bugs against check-webkit-style
+ https://bugs.webkit.org/show_bug.cgi?id=32345
+
+ Added some text to the error message asking folks to file bugs against
+ false positives.
+
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-01-17 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Eliminated the error_count global variable and related
+ check-webkit-style refactoring.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33678
+
+ * Scripts/check-webkit-style:
+ - Updated to use webkit_argument_defaults().
+ - Renamed styleChecker to style_checker.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Prefixed the three default arguments with WEBKIT_DEFAULT.
+ - Added webkit_argument_defaults().
+ - Added default filter_rules parameter to CategoryFilter constructor.
+ - Added __ne__() to CategoryFilter class.
+ - Added __eq__() and __ne__() to ProcessorOptions class.
+ - Added error_count and _write_error attributes to StyleChecker class.
+ - Made StyleChecker._handle_error() increment the error count.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Improved CategoryFilterTest.test_eq().
+ - Added CategoryFilterTest.test_ne().
+ - Added test_eq() and test_ne() to ProcessorOptionsTest class.
+ - Updated unit tests to use webkit_argument_defaults().
+ - Added StyleCheckerTest class.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ - Removed references to global error_count.
+
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+ - Removed CppStyleStateTest class.
+
+2010-01-15 Jon Honeycutt <jhoneycutt@apple.com>
+
+ get_accParent should try to retrieve parent AccessibilityObject, before
+ calling upon window
+
+ https://bugs.webkit.org/show_bug.cgi?id=22893
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::parentElement):
+ Get the object's parent. Query it for IAccessible, and return it.
+
+2010-01-16 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ <rdar://problem/7529519> DumpRenderTree crashes in makeLargeMallocFailSilently()
+
+ * DumpRenderTree/mac/CheckedMalloc.cpp:
+ (makeLargeMallocFailSilently): Temporarily allow writing to the default
+ malloc zone structure while modifying it.
+
+2010-01-16 David Kilzer <ddkilzer@apple.com>
+
+ Added back removed properties to iExploder input files
+
+ While the update-iexploder-cssproperties script works great to
+ add new properties, it has the side-effect of removing old
+ properties that once were parsed.
+
+ * iExploder/htdocs/cssproperties.in: Added back removed
+ properties into their own section.
+ * iExploder/htdocs/htmlattrs.in: Ditto.
+
+2010-01-16 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by David Kilzer.
+
+ Update iExploder/htdocs/*.in by running update-iexploder-cssproperties
+ https://bugs.webkit.org/show_bug.cgi?id=33756
+
+ * iExploder/htdocs/cssproperties.in: New CSS attributes
+ * iExploder/htdocs/htmlattrs.in: New HTML attributes
+ * iExploder/htdocs/htmltags.in: New HTML tags
+
+2010-01-15 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Kilzer.
+
+ Altered parseDiffHeader() to skip unrecognized lines and
+ other minor clean-ups.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33476
+
+ * Scripts/VCSUtils.pm:
+ - Changed parseDiffHeader() as follows:
+ - Skips over unrecognized lines.
+ - Addressed FIXME to remove substitution for "diff" line.
+ - Renamed "version" header hash key to "sourceRevision".
+ - Eliminated "copiedFromVersion" header hash key.
+ - Included "sourceRevision" also for copied files.
+ - Checks that copy revision number matches "sourceRevision".
+ - No longer returns $foundHeaderEnding.
+ - Dies if header ending not found.
+ - Diff header dividing line now always added.
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl:
+ - Made necessary changes in parseDiffHeader() unit tests.
+ - Shortened the file paths in some test cases.
+
+2010-01-14 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Update pywebsocket to 0.4.6
+ https://bugs.webkit.org/show_bug.cgi?id=32299
+ The newer pywebsocket can handle more simultaneous connections.
+
+ * pywebsocket/mod_pywebsocket/handshake.py:
+ * pywebsocket/mod_pywebsocket/standalone.py:
+ * pywebsocket/setup.py:
+ * pywebsocket/test/test_handshake.py:
+
+2010-01-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION(53133): commit-queue no longer rejects patches with invalid committers, instead it hangs
+ https://bugs.webkit.org/show_bug.cgi?id=33638
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Add Bug.id() to match Attachment.id()
+ - Give Bug.reviewed_patches and commit_queued_patches the option to return patches with invalid committers/reviewers.
+ - Add back a missing variable to _validate_setter_email found by the new unit tests!
+ * Scripts/webkitpy/commands/queries.py:
+ - Add FIXMEs about the commands being confusingly named.
+ * Scripts/webkitpy/commands/queries_unittest.py:
+ - Update results to reflect the newly restructured mock bug cache.
+ * Scripts/webkitpy/commands/queues.py:
+ - Add a new _validate_patches_in_commit_queue method (this is what fixes the regression).
+ - Add a FIXME about eventually sorting the patches into some order.
+ * Scripts/webkitpy/commands/queues_unittest.py:
+ - Update results now that with the newly restructure mock bug cache we're testing cq+'d patches with an invalid committer.
+ * Scripts/webkitpy/commands/upload_unittest.py:
+ - Update results to match the newly restructured mock bug cache.
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ - Restructure fetch_ methods to not use a manual list of ids, but rather use Bug and Attachment classes to make real queries from all of the Bugs.
+ - Add a few more attachments and bug dictionaries for use by the tests.
+
+2010-01-13 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] DRT missing setUserStyleSheetLocation and setUserStyleSheetEnabled in LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=33617
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setUserStyleSheetLocation):
+ (LayoutTestController::setUserStyleSheetEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-14 Adam Roben <aroben@apple.com>
+
+ Add LayoutTestController API to force
+ -webView:resource:willSendRequest:: to return null
+
+ Enables tests for <rdar://problem/7533333> <http://webkit.org/b/33533>
+ window.onload never fires if page contains an <iframe> with a bad
+ scheme or whose load is cancelled by returning null from resource load
+ delegate's willSendRequest
+
+ Reviewed by Brady Eidson.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController): Initialize new member.
+ (setWillSendRequestReturnsNullCallback): Call through to
+ LayoutTestController.
+ (LayoutTestController::staticFunctions): Added new function.
+
+ * DumpRenderTree/LayoutTestController.h: Added
+ m_willSendRequestReturnsNull.
+ (LayoutTestController::willSendRequestReturnsNull):
+ (LayoutTestController::setWillSendRequestReturnsNull):
+ Added standard accessors.
+
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::willSendRequest):
+ Return null if LayoutTestController says to.
+
+2010-01-14 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after removal of XBM support.
+
+ * wx/build/settings.py:
+
+2010-01-14 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Add support for partial building on Symbian.
+
+ The build happens in the source directory as out of source builds are
+ not supported by qmake for Symbian.
+
+ Also the actual build isn't started but it is left to the developer
+ to choose the architecture/configuration.
+
+ * Scripts/webkitdirs.pm:
+
+2010-01-14 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add support for "detecting" Symbian environments by either
+ looking for the EPOCROOT environment variable or via --symbian
+ being passed on the commandline.
+
+ * Scripts/webkitdirs.pm:
+
+2010-01-14 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Unreviewed.
+
+ [Qt] Use a different Makefile names for sources generation and compilation.
+ This prevents Makefile overwriting when running build-webkit twice.
+
+ * Scripts/webkitdirs.pm:
+
+2010-01-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add an "alien_QLabel" classId for manual testing of alien widgets.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33373
+
+ * QtLauncher/main.cpp:
+ (WebPage::createPlugin):
+
+2010-01-14 Eric Seidel <eric@webkit.org>
+
+ No review, rolling out r53249.
+ http://trac.webkit.org/changeset/53249
+ https://bugs.webkit.org/show_bug.cgi?id=33617
+
+ This caused http/tests/security/local-user-CSS-from-
+ remote.html to fail on the Qt Release Build Bot.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-14 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Moved error() from cpp_style.py to checker.py.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33620
+
+ * Scripts/check-webkit-style:
+ - Addressed FIXME to not set global state.
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added argument validation to ProcessorOptions constructor.
+ - Added should_report_error() to ProcessorOptions class.
+ - Removed set_options().
+ - Added StyleChecker class.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Added unit test class for ProcessorOptions class.
+ - Added unit test to check that parse() strips white space.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ - Removed "filter" and "output_format" methods.
+ - Removed should_print_error() and error() functions.
+ - Removed default parameter value from process_file().
+
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+ - Removed call to cpp_style._should_print_error().
+ - Removed test_filter() and test_filter_appending().
+
+ * Scripts/webkitpy/style/text_style.py:
+ - Removed default parameter value from process_file().
+
+2010-01-14 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] DRT missing setUserStyleSheetLocation and setUserStyleSheetEnabled in LayoutTestController
+ https://bugs.webkit.org/show_bug.cgi?id=33617
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setUserStyleSheetLocation):
+ (LayoutTestController::setUserStyleSheetEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix CloseBugForLandDiff unittest to actually run
+ https://bugs.webkit.org/show_bug.cgi?id=33640
+
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ * Scripts/webkitpy/steps/closebugforlanddiff_unittest.py:
+
+2010-01-12 Jon Honeycutt <jhoneycutt@apple.com>
+
+ MSAA: selected, selectable, extended selectable, and multiple
+ selectable states are not reported
+
+ https://bugs.webkit.org/show_bug.cgi?id=33574
+ <rdar://problem/7536826>
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getIsSelectableCallback):
+ Return the result of calling isSelectable().
+ (getIsMultiSelectableCallback):
+ Return the result of calling isMultiSelectable().
+ (AccessibilityUIElement::getJSClass):
+ Add isSelected and isMultiSelectable properties to the JSClass
+ definition.
+
+ * DumpRenderTree/AccessibilityUIElement.h:
+ Declare isSelectable() and isMultiSelectable().
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isSelectable):
+ Stubbed.
+ (AccessibilityUIElement::isMultiSelectable):
+ Stubbed.
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isSelectable):
+ Stubbed.
+ (AccessibilityUIElement::isMultiSelectable):
+ Stubbed.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (accessibilityState):
+ Get the object's state, and return it.
+ (AccessibilityUIElement::isSelected):
+ Check the object's selected state.
+ (AccessibilityUIElement::isSelectable):
+ Check the object's selectable state.
+ (AccessibilityUIElement::isMultiSelectable):
+ Check the object's extended/multiple selectable state.
+
+2010-01-13 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Repeat the below for CloseBugForLandDiff.
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/steps/closebugforlanddiff.py:
+ * Scripts/webkitpy/steps/closebugforlanddiff_unittest.py: Added.
+
+2010-01-13 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Turn the mac-ews status bubbles back on now that this bot
+ is running again.
+
+ * QueueStatusServer/templates/statusbubble.html:
+
+2010-01-13 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION(53133): webkit-patch land dies if it can't find a bug id.
+ https://bugs.webkit.org/show_bug.cgi?id=33634
+
+ Deal with the case of no bug patch object in the state.
+
+ * Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py:
+ * Scripts/webkitpy/steps/updatechangelogswithreviewer.py:
+
+2010-01-13 Kenneth Russell <kbr@google.com>
+
+ Unreviewed; added myself to the committers list.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-13 Darin Adler <darin@apple.com>
+
+ Ignore compiled Python in more of webkitpy.
+
+ * Scripts/webkitpy/commands: Added property svn:ignore.
+ * Scripts/webkitpy/steps: Added property svn:ignore.
+ * Scripts/webkitpy/style: Added property svn:ignore.
+
+2010-01-13 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix build problem related to the pushd command
+
+ * Scripts/webkitdirs.pm:
+
+2010-01-13 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Split the build process in two different .pro files.
+ This allows qmake to be run once all source files are available.
+
+ * Scripts/webkitdirs.pm: Add calls to make DerivedSources.pro in JSC and WC.
+
+2010-01-13 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Unreviewed tiny typo fix in docstrings.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+
+2010-01-13 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Created a CategoryFilter class to encapsulate the logic of
+ filter rules.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33454
+
+ * Scripts/webkitpy/style/checker.py:
+ - Added CategoryFilter class.
+
+ * Scripts/webkitpy/style/checker_unittest.py:
+ - Added CategoryFilter unit tests.
+
+ * Scripts/webkitpy/style/cpp_style.py:
+ - Updated filter methods to use CategoryFilter.
+
+ * Scripts/webkitpy/style/cpp_style_unittest.py:
+ - Updated references to filters.
+
+2010-01-12 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Unreviewed. Now I can review :)
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-12 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Extend WinLauncher example with better printing features.
+
+ * WinLauncher/PrintWebUIDelegate.cpp:
+ (PrintWebUIDelegate::webViewPrintingMarginRect): Provide slightly
+ larger margins.
+ (PrintWebUIDelegate::webViewHeaderHeight): Compute header height based
+ on text metrics.
+ (PrintWebUIDelegate::webViewFooterHeight): Compute footer height based
+ on text metrics.
+ (PrintWebUIDelegate::drawHeaderInRect): Write useful header, along
+ with separating line.
+ (PrintWebUIDelegate::drawFooterInRect):
+ * WinLauncher/PrintWebUIDelegate.h: Remove stubs.
+ * WinLauncher/WinLauncher.cpp:
+ (PrintView): Correct loop used to print individual pages.
+ Previously it started at 0, which is a wild-card to print all
+ pages at once.
+
+2010-01-12 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33540
+ Make it possible to build in debug mode with assertions disabled
+
+ * DumpRenderTree/mac/ObjCController.m: (-[ObjCController accessStoredWebScriptObject]):
+
+2010-01-11 Darin Fisher <darin@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] "build-webkit --chromium" should run "make all" on Linux
+ https://bugs.webkit.org/show_bug.cgi?id=33500
+
+ * Scripts/webkitdirs.pm:
+
+2010-01-12 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ AssignToCommitter does not need to fetch bugs twice
+ https://bugs.webkit.org/show_bug.cgi?id=33530
+
+ This is a no-brainer patch now that we've added Bug.reviewed_patches
+
+ * Scripts/webkitpy/commands/upload.py:
+
+2010-01-12 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla.py should have an Attachment object instead of passing around dictionaries
+ https://bugs.webkit.org/show_bug.cgi?id=31594
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Add a new Attachment class, with accessor methods for all the necessary properties.
+ - Update Bug to carry a pointer back to bugzilla (attachments need to access Bugzilla for committer validation and url())
+ - Move reviewed_patches and commit_queued_patches out of Bugzilla custom methods and onto Bug
+ - Move committer validation logic into its own class.
+ - Committer rejection is only used in one place. Make the new Bug reviewed_patches and commit_queued_patches
+ handle the common case (of returning "reviewer" or "committer" as None), and let CommitterValidation handle
+ the case where we want to reject patches in bugzilla.
+ - Simplify fetch_patches_from_commit_queue now that committer validation is simpler.
+ - Make all self.bugzilla.fetch_bug access go through BugzillaQueries._fetch_bug.
+ - Mark set_flag_on_attachment as non-private to denote that CommitterValidation depends on it.
+ - Move fetch_reviewed_patches_from_bug and fetch_commit_queue_patches_from_bug logic onto the Bug class.
+ * Scripts/webkitpy/bugzilla_unittest.py:
+ - Move test_flag_permission_rejection_message into a new CommitterValidationTest class.
+ * Scripts/webkitpy/commands/download.py:
+ - Store "bug_id" in state instead of making a fake patch object.
+ - Update to use Attachment and Bug objects.
+ * Scripts/webkitpy/commands/download_unittest.py:
+ - Update expected results now that our testing framework covers more code.
+ * Scripts/webkitpy/commands/early_warning_system.py: Update to use new Attachment class.
+ * Scripts/webkitpy/commands/queries.py: Remove unused ReviewedPatches class.
+ * Scripts/webkitpy/commands/queries_unittest.py: ditto.
+ * Scripts/webkitpy/commands/queues.py: Update to use new Attachment and CommitterValidator classes.
+ * Scripts/webkitpy/commands/queuestest.py: ditto.
+ * Scripts/webkitpy/commands/upload.py: ditto.
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ - Now that more logic has moved into Attachment and Bug, we have to actually
+ provide real reviewer emails as well as real reviewer flags.
+ - Update mock methods to return Attachment objects.
+ * Scripts/webkitpy/scm.py: Update to use Attachment class.
+ * Scripts/webkitpy/scm_unittest.py: Update to use Attachment class.
+ * Scripts/webkitpy/statusserver.py: ditto.
+ * Scripts/webkitpy/steps/applypatch.py: ditto.
+ * Scripts/webkitpy/steps/applypatchwithlocalcommit.py: ditto.
+ * Scripts/webkitpy/steps/closebug.py: ditto.
+ * Scripts/webkitpy/steps/closebugforlanddiff.py: Handle either state["bug_id"] or state["patch"].bug_id()
+ * Scripts/webkitpy/steps/closepatch.py: Update to use Attachment class.
+ * Scripts/webkitpy/steps/obsoletepatches.py: ditto.
+ * Scripts/webkitpy/steps/updatechangelogswithreviewer.py: ditto.
+
+2010-01-12 Adam Barth <abarth@webkit.org>
+
+ Unreviewed typo fix. :(
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-01-12 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Add "error" to the right part of the message.
+
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-01-12 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ EWS should show purple when svn-apply fails
+ https://bugs.webkit.org/show_bug.cgi?id=33527
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-01-12 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove copy/paste code from subclasses of AbstractReviewQueue
+ https://bugs.webkit.org/show_bug.cgi?id=33525
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-01-12 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add Gustavo and Xan as gtk-ews watchers
+ https://bugs.webkit.org/show_bug.cgi?id=33519
+
+ * Scripts/webkitpy/commands/early_warning_system.py:
+
+2010-01-12 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch shouldn't waste my time for with a component prompt
+ https://bugs.webkit.org/show_bug.cgi?id=33521
+
+ The component field isn't very useful for bugs created with
+ webkit-patch because they're likely to be resolved quickly. Instead of
+ always prompting for a component, we should just default to the "New
+ Bugs" component. If the bug stays around for more than five minutes,
+ we can assign it a proper component.
+
+ * Scripts/webkitpy/bugzilla.py:
+
+2010-01-12 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add experimental "land-safely" command to webkit-patch
+ https://bugs.webkit.org/show_bug.cgi?id=33518
+
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+ * Scripts/webkitpy/steps/__init__.py:
+ * Scripts/webkitpy/steps/postdiffforcommit.py: Added.
+
+2010-01-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after introduction of JS_NO_EXPORT
+
+ * wx/build/settings.py:
+
+2010-01-11 Eric Seidel <eric@webkit.org>
+
+ No review, rolling out r53079.
+ http://trac.webkit.org/changeset/53079
+ https://bugs.webkit.org/show_bug.cgi?id=33197
+
+ Adam doens't think this actually works, and believe it caused
+ a regression https://bugs.webkit.org/show_bug.cgi?id=33488 so
+ rolling this out.
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/commands/abstractdiffcommand.py: Removed.
+ * Scripts/webkitpy/commands/abstractdiffcommand_unittest.py: Removed.
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+
+2010-01-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ bugzilla-tool submit-patch mistakenly picks up bug URLs in non-ChangeLog files
+ https://bugs.webkit.org/show_bug.cgi?id=33197
+
+ We should just search for bug numbers in the ChangeLogs instead of in
+ the whole diff.
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/commands/abstractdiffcommand.py: Added.
+ * Scripts/webkitpy/commands/abstractdiffcommand_unittest.py: Added.
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+
+2010-01-11 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Kilzer.
+
+ Created a unit-tested function to parse the header block of
+ a Git or SVN diff -- for future refactoring of svn-apply and
+ svn-unapply.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33447
+
+ * Scripts/VCSUtils.pm:
+ - Added parseDiffHeader().
+ - Removed irrelevant comment from gitdiff2svndiff().
+
+ * Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl: Added.
+ - Added 48 unit tests for parseDiffHeader().
+
+2010-01-10 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by David Kilzer.
+
+ bugzilla-tool submit-patch mistakenly picks up bug URLs in non-ChangeLog files
+ https://bugs.webkit.org/show_bug.cgi?id=33197
+
+ Fix a typo: Commmand -> Command.
+
+ * Scripts/webkitpy/commands/abstractsequencedcommand.py:
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/queries.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/multicommandtool.py:
+
+2010-01-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Let webkit-patch work with options in $EDITOR
+ https://bugs.webkit.org/show_bug.cgi?id=33414
+
+ The $EDITOR evironment variable might have command line options like
+ bbedit -w. This patch lets us run those $EDITORs.
+
+ * Scripts/webkitpy/user.py:
+
+2010-01-10 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Adam Barth.
+
+ [Qt] Add enableXSSAuditor support to QWebSettings and DRT.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33419
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ (WebCore::DumpRenderTree::createWindow):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setXSSAuditorEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-10 Adam Barth <abarth@webkit.org>
+
+ Unreviewed cosmetic change. Remove the status bubble for mac-ews
+ because we don't have hardware for it at the moment.
+
+ * QueueStatusServer/templates/statusbubble.html:
+
+2010-01-09 Daniel Bates <dbates@webkit.org>
+
+ No review, rolling out r53044.
+ http://trac.webkit.org/changeset/53044
+ https://bugs.webkit.org/show_bug.cgi?id=33419
+
+ We need to look into this some more because the Qt
+ bot is failing the XSSAuditor tests. See bug #33419
+ for more details.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-09 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33419
+
+ Adds support for the XSSAuditor to the Qt DRT.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setXSSAuditorEnabled):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-01-09 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Retry writes to QueueStatusServer when we get 500 errors
+ https://bugs.webkit.org/show_bug.cgi?id=33412
+
+ This prevents the queues from failing to mark a patch as "pass" or
+ "fail" when AppEngine throws 500 errors.
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/networktransaction.py: Added.
+ * Scripts/webkitpy/networktransaction_unittest.py: Added.
+ * Scripts/webkitpy/statusserver.py:
+ * Scripts/webkitpy/steps/closebugformarkbugfixed.py: Added.
+ * Scripts/webkitpy/steps/closebugregardlessofpatches.py: Added.
+ * Scripts/webkitpy/steps/findbugidfromsvnrevision.py: Added.
+
+2010-01-09 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/33430> Fix rounded borders in queue status on older Firefox and Safari browsers
+
+ Reviewed by Eric Seidel.
+
+ * QueueStatusServer/templates/statusbubble.html: Added
+ -moz-border-radius and -webkit-border-radius to provide rounded
+ borders in older Firefox and Safari browsers.
+
+2010-01-09 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Kilzer.
+
+ Modified VCSUtils::gitdiff2svndiff() to accept strings that
+ end in vertical white space.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33415
+
+ * Scripts/VCSUtils.pm:
+ * Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl:
+
+2010-01-08 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ run-javascriptcore-tests needs a --quiet flag
+ https://bugs.webkit.org/show_bug.cgi?id=33399
+
+ Until run-javascriptcore-tests has a --quiet flag, lets just stiffle the output in webkit-patch.
+
+ * Scripts/webkitpy/steps/runtests.py:
+
+2010-01-08 Andras Becsi <abecsi@inf.u-szeged.hu>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Only run http and websocket tests as last if no argument is given to be able to explicitly control the test order.
+
+ To be able to run multiple instances of run-webkit-tests besides each other on the same machine we need to minimize
+ the time when Apache and WebSocketServer is locked by tests.
+ Because closeHTTPD() and closeWebSocketServer() is only called at the end of the testing,
+ we need to run http and websocket tests after all other tests.
+ If one however explicitly specifies the tests to run in the argument list of run-webkit-tests
+ we need to preserve the given order.
+
+ * Scripts/run-webkit-tests:
+
+2010-01-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Don't post style-queue pass messages to bugs
+ https://bugs.webkit.org/show_bug.cgi?id=33404
+
+ These messages aren't needed any more now that we have the status
+ bubble reporting pass events passively.
+
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-01-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Optimize the number of CPUs used for building Qt and Gtk
+ https://bugs.webkit.org/show_bug.cgi?id=33394
+
+ Instead of hardcoding the number 8, we should read the number of CPUs
+ from the environment.
+
+ * Scripts/webkitpy/executive.py:
+ * Scripts/webkitpy/webkitport.py:
+ * Scripts/webkitpy/webkitport_unittest.py:
+
+2010-01-08 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ REGRESSION(52819?): AXLoadComplete and AXLayoutComplete causes 4 tests fail on Snow Leopard Debug bot
+ https://bugs.webkit.org/show_bug.cgi?id=33300
+
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::AccessibilityUIElement):
+ (AccessibilityUIElement::~AccessibilityUIElement):
+ (_accessibilityNotificationCallback):
+ (AccessibilityUIElement::addNotificationListener):
+
+2010-01-08 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ commit-queue should run run-javascriptcore-tests
+ https://bugs.webkit.org/show_bug.cgi?id=33376
+
+ I also made it run the python and perl unit tests.
+
+ * Scripts/webkitpy/steps/runtests.py:
+ * Scripts/webkitpy/webkitport.py:
+
+2010-01-07 Andras Becsi <abecsi@inf.u-szeged.hu>
+
+ Reviewed by Darin Adler.
+
+ Run the http and websocket tests after all other tests.
+ https://bugs.webkit.org/show_bug.cgi?id=33153
+
+ * Scripts/run-webkit-tests:
+
+2010-01-07 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix some test-webkitpy expectations
+ https://bugs.webkit.org/show_bug.cgi?id=33345
+
+ I forgot to change these when I added the CheckStyle step.
+
+ * Scripts/webkitpy/commands/upload_unittest.py:
+
+2010-01-07 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ webkit-patch edit-changelogs (or upload) will open blank files if run outside the root
+ https://bugs.webkit.org/show_bug.cgi?id=33341
+
+ Fix this by moving to the root directory before editing ChangeLogs.
+ There is a related bug with CheckStyle.
+
+ * Scripts/webkitpy/steps/checkstyle.py:
+ * Scripts/webkitpy/steps/editchangelog.py:
+
+2010-01-07 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ media/unsupported-tracks.html is failing on Snow Leopard Release bot
+ https://bugs.webkit.org/show_bug.cgi?id=32339
+
+ This is a speculative fix. I do not have a Snow Leopard machine to test on
+ and I've not seen mention of someone being able to reproduce this locally.
+
+ Prevent watchdog timer from firing after a test completes but before
+ the next one starts, causing the error to appear in the next test.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (dump): Stop the watchdog before printing #EOF for the test content.
+ We only need to care about the JavaScript of the test running too long
+ or some hang in WebCore. Any other failures will be covered by the calling
+ script's own watchdog timer.
+
+2010-01-07 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue is stuck spinning due to exception
+ https://bugs.webkit.org/show_bug.cgi?id=33358
+
+ * Scripts/webkitpy/commands/queues.py:
+ - Don't try to stringify the exception.
+
+2010-01-07 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Jon Honeycutt.
+
+ Don't leak a JSStringRef within _accessibilityNotificationCallback.
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (_accessibilityNotificationCallback): Have a JSRetainPtr adopt the JSStringRef so that it will be cleaned up
+ when it goes out of scope.
+
+2010-01-07 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Add proposed rename of HTMLPlugInImageElement to HTMLEmbeddedObjectElement.
+
+ * Scripts/do-webcore-rename:
+
+2010-01-07 Kim Grönholm <kim.gronholm@nomovok.com>
+
+ Reviewed by Antti Koivisto.
+
+ Wrong state and TouchLists in TouchEvents
+ https://bugs.webkit.org/show_bug.cgi?id=32878
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::touchStart):
+ (EventSender::touchEnd):
+ (EventSender::clearTouchPoints):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2010-01-07 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ Created a module that runs the style package unit tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32973
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/style/unittests.py: Added.
+
+2010-01-07 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Don't print a redundant message when confirming a diff
+ https://bugs.webkit.org/show_bug.cgi?id=33315
+
+ Instead of saying "ERROR: User declined" we should just exit because
+ the use knows they just declined!
+
+ * Scripts/webkitpy/steps/confirmdiff.py:
+
+2010-01-07 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Check style before uploading a patch
+ https://bugs.webkit.org/show_bug.cgi?id=33314
+
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/steps/checkstyle.py:
+ * Scripts/webkitpy/steps/options.py:
+
+2010-01-07 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Add prepare and post to webkit-patch main help
+ https://bugs.webkit.org/show_bug.cgi?id=33313
+
+ * Scripts/webkitpy/commands/upload.py:
+
+2010-01-07 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add Chromium bots to the list of "core builders" (builders which stop the commit-queue when they turn red)
+ https://bugs.webkit.org/show_bug.cgi?id=33290
+
+ Add the Chromium builders to our list of core builders and test that our regexps work.
+ I also updated our regexp testing to make sure we cover all known builders at build.webkit.org.
+
+ * Scripts/webkitpy/buildbot.py:
+ * Scripts/webkitpy/buildbot_unittest.py:
+
+2010-01-07 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool needs a new name
+ https://bugs.webkit.org/show_bug.cgi?id=28459
+
+ Rename bugzilla-tool to webkit-patch. Also, rename some commands to
+ make more sense with the new name.
+
+ * Scripts/bugzilla-tool: Removed.
+ * Scripts/webkit-patch: Added.
+ * Scripts/webkit-tools-completion.sh:
+ * Scripts/webkitpy/bugzilla_unittest.py:
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/download_unittest.py:
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/webkitpy/commands/queries.py:
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/commands/queues_unittest.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+ * Scripts/webkitpy/queueengine.py:
+ * Scripts/webkitpy/steps/completerollout.py:
+
+2010-01-07 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ Moved style-related modules to webkitpy.style sub-package.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32971
+
+ * Scripts/check-webkit-style:
+ - Updated import statement.
+
+ * Scripts/test-webkitpy:
+ - Updated import statements.
+
+ * Scripts/webkitpy/cpp_style.py: Removed.
+ - Moved to webkitpy/style.
+
+ * Scripts/webkitpy/cpp_style_unittest.py: Removed.
+ - Moved to webkitpy/style.
+
+ * Scripts/webkitpy/style.py: Removed.
+ - Moved to webkitpy/style/checker.py.
+
+ * Scripts/webkitpy/style/__init__.py: Added.
+ - Added containing webkitpy directory to package search path.
+
+ * Scripts/webkitpy/style/checker.py: Copied from Scripts/webkitpy/style.py.
+ * Scripts/webkitpy/style/checker_unittest.py: Copied from Scripts/webkitpy/style_unittest.py.
+ - Updated import statement.
+
+ * Scripts/webkitpy/style/cpp_style.py: Copied from Scripts/webkitpy/cpp_style.py.
+ * Scripts/webkitpy/style/cpp_style_unittest.py: Copied from Scripts/webkitpy/cpp_style_unittest.py.
+ - Update import statement.
+
+ * Scripts/webkitpy/style/text_style.py: Copied from Scripts/webkitpy/text_style.py.
+ * Scripts/webkitpy/style/text_style_unittest.py: Copied from Scripts/webkitpy/text_style_unittest.py.
+ * Scripts/webkitpy/style_unittest.py: Removed.
+ - Moved to webkitpy/style/checker_unittest.py.
+
+ * Scripts/webkitpy/text_style.py: Removed.
+ - Moved to webkitpy/style.
+
+ * Scripts/webkitpy/text_style_unittest.py: Removed.
+ - Moved to webkitpy/style.
+
+2010-01-06 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Support the 3rd argument of EventSender.keyDown that
+ has been recently added to report keyLocation
+ (see also: https://bugs.webkit.org/show_bug.cgi?id=28247).
+ https://bugs.webkit.org/show_bug.cgi?id=33250
+
+ Test: fast/events/keydown-numpad-keys.html
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::keyDown):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2010-01-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add long_help for all common commands.
+ https://bugs.webkit.org/show_bug.cgi?id=33261
+
+ For now these long_helps are pretty basic.
+ These were all written to just explain the steps
+ that each command runs. This style long_help could
+ be made easier by using:
+ https://bugs.webkit.org/show_bug.cgi?id=33257
+
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/queries.py:
+
+2010-01-06 Diego Gonzalez <diego.gonzalez@openbossa.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Add page zooming support to Qt DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=32898
+
+ Patch by Kim Grönholm <kim.gronholm@nomovok.com>,
+ Diego Gonzalez <diego.gonzalez@openbossa.org> and
+ Afonso Costa <afonso.costa@openbossa.org>
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::zoomPageIn):
+ (EventSender::zoomPageOut):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2010-01-06 Eric Seidel <eric@webkit.org>
+
+ No review, just adding Mike Belshe's new bugzilla email at his request.
+
+ * Scripts/webkitpy/committers.py:
+
+2010-01-06 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Rolling out r52869 and r52853 due to bot
+ and local run-webkit-test failures
+
+ REGRESSION(52854?) fast/workers/shared-worker-constructor.html failed on Leopard Build Bot
+ https://bugs.webkit.org/show_bug.cgi?id=33256
+
+ The original bug was https://bugs.webkit.org/show_bug.cgi?id=33153
+
+ * Scripts/run-webkit-tests:
+
+2010-01-06 Eric Seidel <eric@webkit.org>
+
+ Unreviewed "build" fix. Just adding missing include.
+
+ bugzilla-tool rollout --complete-rollout should make a nicer bug comment
+ https://bugs.webkit.org/show_bug.cgi?id=29212
+
+ * Scripts/webkitpy/steps/completerollout.py:
+
+2010-01-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool rollout --complete-rollout should make a nicer bug comment
+ https://bugs.webkit.org/show_bug.cgi?id=29212
+
+ * Scripts/webkitpy/bugzilla.py:
+ - Make reopen_bug robust against the bug already being open.
+ * Scripts/webkitpy/commands/download.py:
+ - Remove dead code from Rollout.
+ * Scripts/webkitpy/steps/completerollout.py:
+ - Improve the rollout comment.
+
+2010-01-06 Andras Becsi <abecsi@inf.u-szeged.hu>
+
+ Reviewed by Darin Adler.
+
+ Set isHttpdOpen to 0 if pidfile does not exist for some reason.
+ Speculative fix for https://bugs.webkit.org/show_bug.cgi?id=33256.
+
+ * Scripts/run-webkit-tests:
+
+2010-01-06 Andras Becsi <abecsi@inf.u-szeged.hu>
+
+ Reviewed by Darin Adler.
+
+ Change hardcoded /tmp in run-webkit-tests to File::Spec->tmpdir(),
+ and remove the httpd's pidfile directory if httpd terminated.
+
+ * Scripts/run-webkit-tests:
+
+2010-01-05 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Levin.
+
+ Refactored check-webkit-style's argument parser to not rely
+ on global state, and improved its error handling and unit
+ test coverage.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32966
+
+ * Scripts/check-webkit-style:
+ - Adjusted to use new argument parser.
+
+ * Scripts/webkitpy/cpp_style.py:
+ - Changed _CppStyleState to accept an array of filter rules
+ instead of a comma-delimited string.
+ - Eliminated cpp_style._DEFAULT_FILTER_RULES.
+ - Eliminated cpp_style._USAGE.
+
+ * Scripts/webkitpy/cpp_style_unittest.py:
+ - Updated test_filter() and test_default_filter().
+
+ * Scripts/webkitpy/style.py:
+ - Converted style._USAGE to create_usage().
+ - Corrected usage instructions by removing 0 as a valid
+ --verbose flag value.
+ - Removed use_webkit_styles().
+ - Added ProcessorOptions class.
+ - Added ArgumentDefaults class.
+ - Added ArgumentPrinter class.
+ - Removed parse_arguments and added ArgumentParser class.
+ - Moved exit_with_usage() and exit_with_categories() into
+ ArgumentParser.
+ - Refactored parse_arguments() as ArgumentParser.parse().
+ - Improved parser error handling.
+
+ * Scripts/webkitpy/style_unittest.py:
+ - Added DefaultArgumentsTest class.
+ - Addressed FIXME to check style.WEBKIT_FILTER_RULES
+ against style.STYLE_CATEGORIES.
+ - Added ArgumentPrinterTest class.
+ - Added ArgumentParserTest class and rewrote parser unit tests.
+
+2010-01-05 Adam Roben <aroben@apple.com>
+
+ Test that it's safe to call IWebView::close when
+ IWebView::initWithFrame hasn't been called
+
+ Part of <http://webkit.org/b/32827> Crash when calling
+ IWebView::close, then releasing the WebView, without calling
+ DestroyWindow
+
+ Reviewed by Steve Falkenburg.
+
+ * WebKitAPITest/tests/WebViewDestruction.cpp:
+ (WebKitAPITest::CloseWithoutInitWithFrame): Calls IWebView::close
+ without ever calling IWebView::initWithFrame and tests that we don't
+ crash or leak.
+
+2010-01-05 Adam Roben <aroben@apple.com>
+
+ Add more WebViewDestruction tests
+
+ Fixes <http://webkit.org/b/33216>.
+
+ Reviewed by Eric Seidel.
+
+ * WebKitAPITest/tests/WebViewDestruction.cpp:
+ (WebKitAPITest::NoInitWithFrame):
+ (WebKitAPITest::CloseThenDestroyViewWindow):
+ (WebKitAPITest::DestroyViewWindowThenClose):
+ (WebKitAPITest::DestroyHostWindow):
+ (WebKitAPITest::DestroyHostWindowThenClose):
+ (WebKitAPITest::CloseThenDestroyHostWindow):
+ Added these tests that exercise tearing down a WebView in various
+ ways, all of which we eventually want to have work. Some of them
+ currently crash or leak.
+
+2010-01-05 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] fix DRT link failures on --no-svg builds when only making changes to DRT
+
+ If you're working from a --minimal or --no-svg build and make changes to the
+ DRT, then recompile, the build will fail.
+
+ This is because the current behavior at build time is to assume that the
+ previous Qt build supported SVG and consequently delete libQtWebKit.so.
+ Unfortunately, just deleting libQtWebKit.so will not cause the library to
+ re-link. Instead the build will see libQtWebKit.so.4 and co., pass over the
+ linking phase, and attempt to link the DRT with libQtWebKit.so absent. This
+ results in a link failure on the DRT.
+
+ Since re-linking libQtWebKit can take up to ten minutes and should be avoided
+ in cases where not actually required, remove the assumption that
+ the previous Qt build supported SVG, and amend the symbol detection to look for
+ a symbol name that is not present in SVG builds. Currently webkitdirs.pm looks
+ for 'SVGElement' but even non-SVG builds contain the symbol 'isSVGElement'.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32992
+
+ * Scripts/webkitdirs.pm:
+
+2010-01-05 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Kilzer.
+
+ Switched to generating list of Perl unit test files dynamically,
+ instead of explicitly.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33200
+
+ * Scripts/test-webkitperl:
+
+2010-01-05 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Reimplement EventSender::leapForward
+ https://bugs.webkit.org/show_bug.cgi?id=33114
+
+ Follow Windows implementation of leapForward. When leapForward is called,
+ messages are queued and posted after the timeout. A new event loop is created to
+ handle those messages and the additional messages that are created as a result.
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::EventSender):
+ (EventSender::mouseDown):
+ (EventSender::mouseUp):
+ (EventSender::mouseMoveTo):
+ (EventSender::leapForward):
+ (EventSender::sendOrQueueEvent):
+ (EventSender::replaySavedEvents):
+ (EventSender::eventFilter):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2010-01-05 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Fix obscure queue crash in queueengine
+ https://bugs.webkit.org/show_bug.cgi?id=33196
+
+ Sometimes we get an exception that can't be stringified. For example:
+
+ AttributeError: 'ParseError' object has no attribute 'msg'
+
+ In these cases, the whole queue dies because we're in the global
+ exception handler. Instead of dieing here, we should just print a less
+ informative message to the console. We're already printing the whole
+ backtrace anyway, so there's not much point to stringifying the
+ exception anyway.
+
+ * Scripts/webkitpy/queueengine.py:
+
+2010-01-05 Dominic Mazzoni <dmazzoni@google.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32571
+
+ For an object with an aria role of "checkbox" or "radiobutton",
+ use the "aria-checked" attribute to determine if it's checked.
+ These changes add an isChecked() method to AccessibilityUIElement
+ so that we can check for this property from a layout test.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getIsCheckedCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isChecked):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isChecked):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isChecked):
+
+2010-01-05 David Levin <levin@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Having a comment for the #endif for a header guard is not required WebKit style.
+ https://bugs.webkit.org/show_bug.cgi?id=33214
+
+ * Scripts/webkitpy/cpp_style.py: removed the check and made the loop exit
+ early when it has all the needed information to continue.
+ * Scripts/webkitpy/cpp_style_unittest.py: removed the corresponding tests.
+
+2010-01-05 Adam Roben <aroben@apple.com>
+
+ Share more code in the WebViewDestruction tests
+
+ Part of <http://webkit.org/b/33212> Small fixes/improvements to
+ WebKitAPITest
+
+ Reviewed by Sam Weinig.
+
+ * WebKitAPITest/tests/WebViewDestruction.cpp:
+ (WebKitAPITest::createAndInitializeWebView): Renamed from
+ createWebView. Now initializes the HostWindow and returns the
+ WebView's HWND via an out-parameter.
+ (WebKitAPITest::finishWebViewDestructionTest): Added. Code came from
+ the CloseWithoutDestroyWindow test.
+ (WebKitAPITest::CloseWithoutDestroyViewWindow): Renamed from
+ CloseWithoutDestroyWindow and changed to use the new functions.
+ (WebKitAPITest::MainFrameAfterClose): Changed to use the new
+ functions.
+ (WebKitAPITest::NoCloseOrDestroyViewWindow): Renamed from
+ NoCloseOrDestroyWindow and changed to use the new functions.
+
+2010-01-05 Adam Roben <aroben@apple.com>
+
+ Don't show HostWindows by default
+
+ This was making WebKitAPITest very flashy as windows appeared and
+ disappeared.
+
+ Part of <http://webkit.org/b/33212> Small fixes/improvements to
+ WebKitAPITest
+
+ Reviewed by Sam Weinig.
+
+ * WebKitAPITest/HostWindow.cpp:
+ (WebKitAPITest::HostWindow::initialize): Removed the WS_VISIBLE style
+ from the window.
+
+2010-01-05 Adam Roben <aroben@apple.com>
+
+ Don't hang in WebKitAPITest if no messages have been posted
+
+ Part of <http://webkit.org/b/33212> Small fixes/improvements to
+ WebKitAPITest
+
+ Reviewed by Sam Weinig.
+
+ * WebKitAPITest/tests/WebViewDestruction.cpp:
+ (WebKitAPITest::runMessagePump): Use PeekMessage instead of GetMessage
+ to avoid hanging if no messages have been posted.
+
+2010-01-05 Adam Roben <aroben@apple.com>
+
+ Fix WebKitCreateInstance helper
+
+ Part of <http://webkit.org/b/33212> Small fixes/improvements to
+ WebKitAPITest
+
+ Reviewed by Sam Weinig.
+
+ * WebKitAPITest/tests/WebViewDestruction.cpp:
+ (WebKitAPITest::WebKitCreateInstance): Pass the pointer straight
+ through, instead of taking its address.
+
+2010-01-04 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Darin Fisher.
+
+ Reorganize, document and rename OS() platform macros.
+ https://bugs.webkit.org/show_bug.cgi?id=33198
+
+ Adapt to name changes.
+
+ * DumpRenderTree/DumpRenderTree.h:
+ * DumpRenderTree/config.h:
+
+2010-01-05 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ Minor improvements to test-webkit-scripts, as suggested
+ by an earlier review.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33125
+
+ * Scripts/test-webkit-scripts:
+ - Used OptionParser class instead of getopt.getopt().
+ - Created main() method for __main__ block.
+ - Enclosed functions in a class.
+
+2010-01-05 Chris Fleizach <cfleizach@apple.com>
+
+ No review. Fix DRT breakage on Tiger/Leopard.
+
+ Add ARIA "Live Region" support
+ https://bugs.webkit.org/show_bug.cgi?id=33117
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+
+2010-01-04 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Add ARIA "Live Region" support
+ https://bugs.webkit.org/show_bug.cgi?id=33117
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (indexOfChildCallback):
+ (boolAttributeValueCallback):
+ (stringAttributeValueCallback):
+ (addNotificationListenerCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::indexOfChild):
+ (AccessibilityUIElement::stringAttributeValue):
+ (AccessibilityUIElement::boolAttributeValue):
+ (AccessibilityUIElement::addNotificationListener):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::indexOfChild):
+ (AccessibilityUIElement::stringAttributeValue):
+ (AccessibilityUIElement::boolAttributeValue):
+ (_accessibilityNotificationCallback):
+ (AccessibilityUIElement::addNotificationListener):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::indexOfChild):
+ (AccessibilityUIElement::stringAttributeValue):
+ (AccessibilityUIElement::boolAttributeValue):
+ (AccessibilityUIElement::addNotificationListener):
+
+2010-01-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool rollout should require a reason
+ https://bugs.webkit.org/show_bug.cgi?id=30810
+
+ * Scripts/webkitpy/changelogs.py: Add support for a reason, add auto-wrapping logic.
+ * Scripts/webkitpy/changelogs_unittest.py: Test reason support.
+ * Scripts/webkitpy/commands/download.py: rollout now requires a reason, remove unused BUGID argument
+ * Scripts/webkitpy/commands/download_unittest.py: pass required reason
+ * Scripts/webkitpy/steps/preparechangelogforrevert.py: pass reason to update_for_revert
+
+2010-01-04 Jon Honeycutt <jhoneycutt@apple.com>
+
+ MSAA: <select> elements should broadcast value change events
+
+ https://bugs.webkit.org/show_bug.cgi?id=33088
+
+ <rdar://problem/7332364>
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/AccessibilityController.cpp:
+ (logValueChangeEventsCallback):
+ Start logging value change events.
+ (AccessibilityController::getJSClass):
+ Add a "logValueChangeEvents" to the AccessibilityController's JS class
+ definition.
+ (AccessibilityController::resetToConsistentState):
+ Disable logging of value change events.
+
+ * DumpRenderTree/AccessibilityController.h:
+ Declare setLogValueChangeEvents(), and add a member variable for the
+ value change event hook.
+
+ * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+ (AccessibilityController::setLogValueChangeEvents):
+ Stubbed.
+
+ * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+ (AccessibilityController::setLogValueChangeEvents):
+ Stubbed.
+
+ * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+ (AccessibilityController::AccessibilityController):
+ Initialize new member var.
+ (AccessibilityController::~AccessibilityController):
+ Disable logging of value change events.
+ (logEventProc):
+ When we receive an EVENT_OBJECT_VALUECHANGE, log the name of the object
+ and its value.
+ (AccessibilityController::setLogValueChangeEvents):
+ If disabling logging, unhook the event, and clear the event hook
+ member var. Otherwise, query for the root element to enable
+ accessibility, and hook EVENT_OBJECT_VALUECHANGE.
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ long_help for submit-patch
+ https://bugs.webkit.org/show_bug.cgi?id=33184
+
+ * Scripts/webkitpy/commands/upload.py:
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ commit-queue can wrongly reject patches if the buildbots are behind
+ https://bugs.webkit.org/show_bug.cgi?id=30098
+
+ Check to make sure we can currently build and test before trying to
+ land a patch.
+
+ * Scripts/webkitpy/commands/queues.py:
+
+2010-01-04 Adam Roben <aroben@apple.com>
+
+ Add a test harness for the Windows WebKit API, and a few tests
+
+ We currently only have tests for a handful of bugs regarding WebView
+ destruction, but more tests can easily be added later. Eventually
+ we'll run these tests as part of run-webkit-tests.
+
+ Fixes <http://webkit.org/b/33167>.
+
+ Reviewed by Sam Weinig.
+
+ * WebKitAPITest/HostWindow.cpp: Added.
+ (WebKitAPITest::HostWindow::HostWindow): Initialize m_window.
+ (WebKitAPITest::HostWindow::~HostWindow): Destroy our window if
+ needed.
+ (WebKitAPITest::HostWindow::initialize): Create our window.
+ (WebKitAPITest::HostWindow::clientRect): Return our window's client
+ rect.
+ (WebKitAPITest::HostWindow::registerWindowClass): Does what it says.
+ (WebKitAPITest::HostWindow::wndProc): Just call through to
+ DefWindowProcW.
+
+ * WebKitAPITest/HostWindow.h: Added.
+ (WebKitAPITest::HostWindow::window): Simple getter.
+
+ * WebKitAPITest/Test.h: Added. This file defines some macros useful
+ for writing tests.
+
+ * WebKitAPITest/TestsController.cpp: Added.
+ (WebKitAPITest::TestsController::TestsController): Initialize our
+ members.
+ (WebKitAPITest::TestsController::shared): Return the shared instance.
+ (WebKitAPITest::TestsController::runAllTests): Run a message pump
+ until a WM_QUIT message is received, then return whether all tests
+ succeeded.
+ (WebKitAPITest::TestsController::addTest): Add the test to m_tests and
+ start running tests soon.
+ (WebKitAPITest::TestsController::testFailed): Record the failure and
+ print a message about it to stdout.
+ (WebKitAPITest::TestsController::runNextTest): If we don't have any
+ tests to run, post a WM_QUIT message to stop the message pump.
+ Otherwise, run the test and print whether it passed, then schedule the
+ next test.
+ (WebKitAPITest::TestsController::runNextTestSoon): Set a 0-delay timer
+ to run the next test.
+ (WebKitAPITest::TestsController::registerWindowClass): Does what it
+ says.
+ (WebKitAPITest::TestsController::wndProc): If the runNextTestTimer
+ fired, call runNextTest(). Pass everything else through to
+ DefWindowProcW.
+
+ * WebKitAPITest/TestsController.h: Added.
+
+ * WebKitAPITest/WebKitAPITest.vcproj: Added.
+
+ * WebKitAPITest/WebKitAPITestCommon.vsprops: Added.
+
+ * WebKitAPITest/main.cpp: Added.
+ (main): (Mostly) just calls TestsController::runAllTests.
+
+ * WebKitAPITest/tests/WebViewDestruction.cpp: Added.
+ (WebKitAPITest::WebKitCreateInstance): Helper function template to
+ call through to the real WebKitCreateInstance.
+ (WebKitAPITest::webViewCount): Helper function to call through to
+ IWebKitStatistics::webViewCount.
+ (WebKitAPITest::createWebView): Helper function to create a WebView
+ and put it inside a HostWindow.
+ (WebKitAPITest::runMessagePump): Helper function to run a message pump
+ for a specified number of milliseconds, or until a WM_QUIT message is
+ received.
+ (WebKitAPITest::CloseWithoutDestroyWindow): Test for
+ <http://webkit.org/b/32827>.
+ (WebKitAPITest::MainFrameAfterClose): Test for
+ <http://webkit.org/b/32868>.
+ (WebKitAPITest::NoCloseOrDestroyWindow): Test for
+ <http://webkit.org/b/33162>.
+
+2010-01-04 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by David Kilzer.
+
+ Add support for Git's "diff.mnemonicprefix" config option to WebKitTools
+
+ https://bugs.webkit.org/show_bug.cgi?id=32820
+
+ * Scripts/VCSUtils.pm:
+ * Scripts/svn-apply:
+ * Scripts/svn-unapply:
+ * Scripts/test-webkitperl: Run gitdiff2svndiff test
+ * Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl: Added.
+ * Scripts/webkitpy/diff_parser.py:
+ * Scripts/webkitpy/diff_parser_unittest.py:
+
+2010-01-04 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Kilzer.
+
+ Divided the Perl unit tests into separate files and put
+ them in a separate directory, and renamed test-webkit-perl
+ to test-webkitperl.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33124
+
+ * Scripts/VCSUtils.pm:
+ - Renamed generateRunPatchCommand() to generatePatchCommand().
+
+ * Scripts/VCSUtils_unittest.pl: Removed.
+ - Divided into three files in Scripts/webkitperl/VCSUtils_unittest.
+
+ * Scripts/test-webkit-perl: Removed.
+ - Renamed to test-webkitperl.
+
+ * Scripts/test-webkit-scripts:
+ - Updated paths to test-webkitpy and test-webkitperl.
+
+ * Scripts/test-webkitperl: Copied from Scripts/test-webkit-perl.
+ - Added paths to new test files.
+
+ * Scripts/webkitperl: Added.
+ * Scripts/webkitperl/VCSUtils_unittest: Added.
+ * Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl: Added.
+ * Scripts/webkitperl/VCSUtils_unittest/generatePatchCommand.pl: Added.
+ * Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl: Copied from Scripts/VCSUtils_unittest.pl.
+
+2010-01-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make bugzilla-tool rollout include a bug link in the ChangeLog entry
+ https://bugs.webkit.org/show_bug.cgi?id=33146
+
+ One more step towards better rollouts.
+
+ * Scripts/webkitpy/changelogs.py:
+ * Scripts/webkitpy/changelogs_unittest.py:
+ * Scripts/webkitpy/steps/preparechangelogforrevert.py:
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Sort the step options
+ https://bugs.webkit.org/show_bug.cgi?id=33144
+
+ * Scripts/webkitpy/steps/options.py:
+
+2010-01-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Need support for longer text in per-command help
+ https://bugs.webkit.org/show_bug.cgi?id=33143
+
+ Add some minimal additional help to land-diff and
+ pave the way for adding better help to all commands.
+
+ * Scripts/webkitpy/commands/download.py: Add small amount of additional help to land-diff
+ * Scripts/webkitpy/multicommandtool.py: support long_help
+ * Scripts/webkitpy/multicommandtool_unittest.py: test long_help
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add unit test for MarkBugFixed
+ https://bugs.webkit.org/show_bug.cgi?id=33142
+
+ MarkBugFixed is way behind in command technology, but it still needs a
+ unit test, as the FIXME commands.
+
+ Also, remove mark-bug-fixed and create-bug from main help since we have
+ more modern commands to replace them.
+
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add missing unit test for CommitMessageForCurrentDiff
+ https://bugs.webkit.org/show_bug.cgi?id=33141
+
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove raw_input from queues in favor of user.prompt
+ https://bugs.webkit.org/show_bug.cgi?id=33140
+
+ This lets up properly mock out the user interaction instead of hacking
+ around it with the options.
+
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/commands/queuestest.py:
+
+2010-01-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool should not require users to install mechanize
+ https://bugs.webkit.org/show_bug.cgi?id=32635
+
+ * Scripts/webkitpy/__init__.py: Add missing declaration for ClientForm (which mechanize requires).
+
+2010-01-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool should not require users to install mechanize
+ https://bugs.webkit.org/show_bug.cgi?id=32635
+
+ Use the nifty "autoinstall" module from Daniel Krech:
+ http://pypi.python.org/pypi/autoinstall/0.2
+ http://code.google.com/p/pyautoinstall/
+ It's available under a WebKit-compatible BSD license.
+
+ * Scripts/webkitpy/__init__.py:
+ - bind "mechanize" to an autoinstall importer which will
+ auto-download mechanize if necessary.
+ * Scripts/webkitpy/autoinstall.py: Added.
+ * Scripts/webkitpy/bugzilla.py: use "mechanize" instead of webkit_mechanize
+ * Scripts/webkitpy/statusbot.py: ditto.
+ * Scripts/webkitpy/webkit_mechanize.py: Removed.
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Move AbstractSequencedCommand to a more general location
+ https://bugs.webkit.org/show_bug.cgi?id=33137
+
+ I do what the FIXME tell me to do.
+
+ * Scripts/webkitpy/commands/abstractsequencedcommand.py: Added.
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/upload.py:
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename StatusBot to StatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=33139
+
+ It's not a bot. It's a server.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ * Scripts/webkitpy/queueengine.py:
+ * Scripts/webkitpy/statusbot.py: Removed.
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] submit-pach should have a -o/--open option to open the bug after submit
+ https://bugs.webkit.org/show_bug.cgi?id=33136
+
+ Python makes this very easy.
+
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ * Scripts/webkitpy/steps/options.py:
+ * Scripts/webkitpy/steps/postdiff.py:
+ * Scripts/webkitpy/user.py:
+
+2010-01-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Move steps to a submodule
+ https://bugs.webkit.org/show_bug.cgi?id=33135
+
+ For great victory. This will probably introduce some regressions
+ because our test coverage isn't perfect, but I've tried to be careful.
+
+ * Scripts/test-webkitpy:
+ * Scripts/webkitpy/buildsteps.py: Removed.
+ * Scripts/webkitpy/buildsteps_unittest.py: Removed.
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/steps/__init__.py: Added.
+ * Scripts/webkitpy/steps/abstractstep.py: Added.
+ * Scripts/webkitpy/steps/applypatch.py: Added.
+ * Scripts/webkitpy/steps/applypatchwithlocalcommit.py: Added.
+ * Scripts/webkitpy/steps/build.py: Added.
+ * Scripts/webkitpy/steps/checkstyle.py: Added.
+ * Scripts/webkitpy/steps/cleanworkingdirectory.py: Added.
+ * Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py: Added.
+ * Scripts/webkitpy/steps/closebug.py: Added.
+ * Scripts/webkitpy/steps/closebugforlanddiff.py: Added.
+ * Scripts/webkitpy/steps/closepatch.py: Added.
+ * Scripts/webkitpy/steps/commit.py: Added.
+ * Scripts/webkitpy/steps/completerollout.py: Added.
+ * Scripts/webkitpy/steps/confirmdiff.py: Added.
+ * Scripts/webkitpy/steps/createbug.py: Added.
+ * Scripts/webkitpy/steps/editchangelog.py: Added.
+ * Scripts/webkitpy/steps/ensurebuildersaregreen.py: Added.
+ * Scripts/webkitpy/steps/ensurelocalcommitifneeded.py: Added.
+ * Scripts/webkitpy/steps/metastep.py: Added.
+ * Scripts/webkitpy/steps/obsoletepatches.py: Added.
+ * Scripts/webkitpy/steps/options.py: Added.
+ * Scripts/webkitpy/steps/postdiff.py: Added.
+ * Scripts/webkitpy/steps/preparechangelog.py: Added.
+ * Scripts/webkitpy/steps/preparechangelogforrevert.py: Added.
+ * Scripts/webkitpy/steps/promptforbugortitle.py: Added.
+ * Scripts/webkitpy/steps/revertrevision.py: Added.
+ * Scripts/webkitpy/steps/runtests.py: Added.
+ * Scripts/webkitpy/steps/steps_unittest.py: Added.
+ * Scripts/webkitpy/steps/update.py: Added.
+ * Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py: Added.
+ * Scripts/webkitpy/steps/updatechangelogswithreviewer.py: Added.
+ * Scripts/webkitpy/stepsequence.py:
+
+2010-01-04 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33097
+
+ Cleans up the File menu to better conform to the File menu in Safari
+ both in terms of options and keyboard shortcuts. Adds a "Quit" menu
+ options to close all open windows. Also, renames the Tools menu to
+ Develop.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::setupUI):
+
+2010-01-04 Daniel Bates <dbates@webkit.org>
+
+ https://bugs.webkit.org/show_bug.cgi?id=33039
+
+ Unreviewed fix.
+
+ * Scripts/webkitpy/credentials.py:
+ * Scripts/webkitpy/credentials_unittest.py:
+
+2010-01-04 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33039
+
+ [bzt] Second attempt to fix an issue where bugzilla-tool dies
+ when the keychain lookup fails to find an entry for bugs.webkit.org.
+
+ * Scripts/webkitpy/credentials.py:
+ * Scripts/webkitpy/credentials_unittest.py:
+
+2010-01-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make Rollout an AbstractSequencedCommmand
+ https://bugs.webkit.org/show_bug.cgi?id=33133
+
+ As suggested by Adam in:
+ https://bugs.webkit.org/show_bug.cgi?id=33131#c2
+
+ * Scripts/webkitpy/commands/download.py:
+
+2010-01-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make all commands AbstractDeclarativeCommmands instead of direct Command subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=33131
+
+ Evenetually we'll probably roll AbstractDeclarativeCommmand directly into Command
+ but for now we just deploy it everywhere and don't try to fix up the few valid uses
+ of Command.
+
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/queries.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/multicommandtool.py:
+
+2010-01-03 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix. Need to import ScriptError.
+
+ * Scripts/webkitpy/buildsteps.py:
+
+2010-01-03 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Make it easier to run submit-patch when previous run cancelled
+ https://bugs.webkit.org/show_bug.cgi?id=33070
+
+ This patch renames create-review to submit-patch (as requested by
+ Maciej).
+
+ This patch makes it easier to run submit-patch after the user has
+ already cancelled a previous run of submit-patch by detecting when we
+ already have ChangeLogs and reading the bug number from them (and not
+ attempting to recreate them). Aside from performance and the extra
+ edit step, this command should not subsume post-dif.
+
+ Also, added a --email command line argument so that the output of
+ prepare-ChangeLog makes sense when it can't find the user's email
+ address.
+
+ * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/buildsteps.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ * Scripts/webkitpy/user.py:
+
+2010-01-03 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Rename Scripts/modules to Scripts/webkitpy
+ https://bugs.webkit.org/show_bug.cgi?id=33128
+
+ Just search-replace and svn mv commands.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/check-webkit-style:
+ * Scripts/modules: Removed.
+ * Scripts/modules/BeautifulSoup.py: Removed.
+ * Scripts/modules/__init__.py: Removed.
+ * Scripts/modules/bugzilla.py: Removed.
+ * Scripts/modules/bugzilla_unittest.py: Removed.
+ * Scripts/modules/buildbot.py: Removed.
+ * Scripts/modules/buildbot_unittest.py: Removed.
+ * Scripts/modules/buildsteps.py: Removed.
+ * Scripts/modules/buildsteps_unittest.py: Removed.
+ * Scripts/modules/changelogs.py: Removed.
+ * Scripts/modules/changelogs_unittest.py: Removed.
+ * Scripts/modules/commands: Removed.
+ * Scripts/modules/commands/__init__.py: Removed.
+ * Scripts/modules/commands/commandtest.py: Removed.
+ * Scripts/modules/commands/download.py: Removed.
+ * Scripts/modules/commands/download_unittest.py: Removed.
+ * Scripts/modules/commands/early_warning_system.py: Removed.
+ * Scripts/modules/commands/early_warning_system_unittest.py: Removed.
+ * Scripts/modules/commands/queries.py: Removed.
+ * Scripts/modules/commands/queries_unittest.py: Removed.
+ * Scripts/modules/commands/queues.py: Removed.
+ * Scripts/modules/commands/queues_unittest.py: Removed.
+ * Scripts/modules/commands/queuestest.py: Removed.
+ * Scripts/modules/commands/upload.py: Removed.
+ * Scripts/modules/commands/upload_unittest.py: Removed.
+ * Scripts/modules/comments.py: Removed.
+ * Scripts/modules/committers.py: Removed.
+ * Scripts/modules/committers_unittest.py: Removed.
+ * Scripts/modules/cpp_style.py: Removed.
+ * Scripts/modules/cpp_style_unittest.py: Removed.
+ * Scripts/modules/credentials.py: Removed.
+ * Scripts/modules/credentials_unittest.py: Removed.
+ * Scripts/modules/diff_parser.py: Removed.
+ * Scripts/modules/diff_parser_unittest.py: Removed.
+ * Scripts/modules/executive.py: Removed.
+ * Scripts/modules/executive_unittest.py: Removed.
+ * Scripts/modules/grammar.py: Removed.
+ * Scripts/modules/mock.py: Removed.
+ * Scripts/modules/mock_bugzillatool.py: Removed.
+ * Scripts/modules/multicommandtool.py: Removed.
+ * Scripts/modules/multicommandtool_unittest.py: Removed.
+ * Scripts/modules/outputcapture.py: Removed.
+ * Scripts/modules/patchcollection.py: Removed.
+ * Scripts/modules/queueengine.py: Removed.
+ * Scripts/modules/queueengine_unittest.py: Removed.
+ * Scripts/modules/scm.py: Removed.
+ * Scripts/modules/scm_unittest.py: Removed.
+ * Scripts/modules/statusbot.py: Removed.
+ * Scripts/modules/stepsequence.py: Removed.
+ * Scripts/modules/style: Removed.
+ * Scripts/modules/style.py: Removed.
+ * Scripts/modules/style_unittest.py: Removed.
+ * Scripts/modules/text_style.py: Removed.
+ * Scripts/modules/text_style_unittest.py: Removed.
+ * Scripts/modules/user.py: Removed.
+ * Scripts/modules/webkit_logging.py: Removed.
+ * Scripts/modules/webkit_logging_unittest.py: Removed.
+ * Scripts/modules/webkit_mechanize.py: Removed.
+ * Scripts/modules/webkitport.py: Removed.
+ * Scripts/modules/webkitport_unittest.py: Removed.
+ * Scripts/test-webkit-python: Removed.
+ * Scripts/test-webkitpy: Copied from WebKitTools/Scripts/test-webkit-python.
+ * Scripts/validate-committer-lists:
+ * Scripts/webkitpy: Copied from WebKitTools/Scripts/modules.
+ * Scripts/webkitpy/bugzilla.py:
+ * Scripts/webkitpy/bugzilla_unittest.py:
+ * Scripts/webkitpy/buildbot.py:
+ * Scripts/webkitpy/buildbot_unittest.py:
+ * Scripts/webkitpy/buildsteps.py:
+ * Scripts/webkitpy/buildsteps_unittest.py:
+ * Scripts/webkitpy/commands/commandtest.py:
+ * Scripts/webkitpy/commands/download.py:
+ * Scripts/webkitpy/commands/download_unittest.py:
+ * Scripts/webkitpy/commands/early_warning_system.py:
+ * Scripts/webkitpy/commands/early_warning_system_unittest.py:
+ * Scripts/webkitpy/commands/queries.py:
+ * Scripts/webkitpy/commands/queries_unittest.py:
+ * Scripts/webkitpy/commands/queues.py:
+ * Scripts/webkitpy/commands/queues_unittest.py:
+ * Scripts/webkitpy/commands/queuestest.py:
+ * Scripts/webkitpy/commands/upload.py:
+ * Scripts/webkitpy/commands/upload_unittest.py:
+ * Scripts/webkitpy/comments.py:
+ * Scripts/webkitpy/credentials.py:
+ * Scripts/webkitpy/credentials_unittest.py:
+ * Scripts/webkitpy/executive.py:
+ * Scripts/webkitpy/executive_unittest.py:
+ * Scripts/webkitpy/mock_bugzillatool.py:
+ * Scripts/webkitpy/multicommandtool.py:
+ * Scripts/webkitpy/multicommandtool_unittest.py:
+ * Scripts/webkitpy/queueengine.py:
+ * Scripts/webkitpy/queueengine_unittest.py:
+ * Scripts/webkitpy/scm.py:
+ * Scripts/webkitpy/scm_unittest.py:
+ * Scripts/webkitpy/statusbot.py:
+ * Scripts/webkitpy/stepsequence.py:
+ * Scripts/webkitpy/webkit_logging_unittest.py:
+ * Scripts/webkitpy/webkitport_unittest.py:
+
+2010-01-03 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ Added script to test both Perl and Python, and renamed
+ run-webkit-unittests to test-webkit-python.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33045
+
+ * Scripts/VCSUtils_unittest.pl:
+ - Tweaked so it can be run from outside Scripts directory.
+
+ * Scripts/run-webkit-unittests: Removed.
+ - Renamed to test-webkit-python.
+
+ * Scripts/test-webkit-perl:
+ - Tweaked so it can be run from outside Scripts directory.
+
+ * Scripts/test-webkit-python: Copied from Scripts/run-webkit-unittests.
+
+ * Scripts/test-webkit-scripts: Added.
+ - Runs both test-webkit-perl and test-webkit-python.
+
+2010-01-03 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ commit-queue/bugzilla-tool should build both Debug and Release
+ https://bugs.webkit.org/show_bug.cgi?id=28450
+
+ Add a --build-style command that lets the master process tell the child
+ process to build both debug and release. Eventually we want to teach
+ the test step to understand this option too, but that's a patch for
+ another day.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/webkitport.py:
+ * Scripts/modules/webkitport_unittest.py:
+
+2010-01-03 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] EventSender: add support for Enter key events
+ https://bugs.webkit.org/show_bug.cgi?id=33064
+
+ Unskip 5 tests that are fixed now.
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::keyDown):
+
+2010-01-03 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Add test for previous typo fix
+ https://bugs.webkit.org/show_bug.cgi?id=33083
+
+ A trivial test for a trivial fix, as requested by Eric.
+
+ * Scripts/modules/bugzilla_unittest.py:
+
+2010-01-03 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement mac-ews
+ https://bugs.webkit.org/show_bug.cgi?id=33072
+
+ The mac-ews is slightly different than the other early warning systems
+ because we can't run Mac OS X inside a VM. For that reason, we only
+ process patches that were uploaded by committers. This isn't as much
+ coverage as the other EWS bots, but it's better than nothing.
+
+ * Scripts/modules/commands/early_warning_system.py:
+ * Scripts/modules/commands/early_warning_system_unittest.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/commands/queuestest.py:
+ * Scripts/modules/mock_bugzillatool.py:
+
+2010-01-03 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Kilzer.
+
+ Refactored svn-apply and svn-unapply to use a common "patch"
+ command method, and added unit tests for this new method.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33098
+
+ * Scripts/VCSUtils.pm:
+ - Added generateRunPatchCommand().
+ - Added runPatchCommand().
+ - Added exitStatus() from webkitdirs.pm to address FIXME.
+
+ * Scripts/VCSUtils_unittest.pl:
+ - Added 10 unit tests for generateRunPatchCommand().
+ - Added 4 unit tests for runPatchCommand().
+ - Added callSilently() method.
+
+ * Scripts/svn-apply:
+ - Refactored applyPatch().
+ - Removed $pathScriptWasRunFrom global variable.
+ - Addressed issue where "--force" option was getting added twice.
+
+ * Scripts/svn-unapply:
+ - Refactored applyPatch().
+ - Removed $pathScriptWasRunFrom global variable.
+ - Added support for --force option.
+ - Enhanced to return meaningful exit status.
+
+ * Scripts/webkitdirs.pm:
+ - Moved exitStatus() implementation to VCSUtils.pm.
+
+2009-12-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Implement build-and-test
+ https://bugs.webkit.org/show_bug.cgi?id=33073
+
+ Some of the early warning system bots want to use build-and-test so
+ they can cover LayoutTests in addition to just compilation.
+
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/download_unittest.py:
+
+2009-12-31 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Show mac-ews status on QueueStatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=33076
+
+ Also make error status purple.
+
+ * QueueStatusServer/model/attachment.py:
+ * QueueStatusServer/model/queues.py:
+ * QueueStatusServer/templates/dashboard.html:
+ * QueueStatusServer/templates/statusbubble.html:
+
+2009-12-31 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ [bzt] REGRESSION: Bugzila is a typo
+ https://bugs.webkit.org/show_bug.cgi?id=33074
+
+ Eric should test his code before landing! :)
+
+ * Scripts/modules/bugzilla.py:
+
+2009-12-31 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Fix the unit tests!
+
+ * Scripts/run-webkit-unittests:
+
+2009-12-30 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ [wx] Alter a couple of default settings in the test app.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32956
+
+ * wx/browser/browser.cpp:
+ (MyApp::OnInit):
+
+2009-12-30 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ logging.py should be renamed to webkit_logging.py and eventually die
+ https://bugs.webkit.org/show_bug.cgi?id=33058
+
+ Change all imports of "logging" to webkit_logging,
+ except the ones which came from Google's cpp_lint.py and diff_parser.py
+ which clearly are assuming python's logging.py.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/buildbot.py:
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/queries.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/credentials.py:
+ * Scripts/modules/executive.py:
+ * Scripts/modules/multicommandtool.py:
+ * Scripts/modules/queueengine.py:
+ * Scripts/modules/scm.py:
+ * Scripts/modules/statusbot.py:
+ * Scripts/modules/stepsequence.py:
+ * Scripts/modules/webkit_logging.py: Renamed from WebKitTools/Scripts/modules/logging.py.
+ * Scripts/modules/webkit_logging_unittest.py: Renamed from WebKitTools/Scripts/modules/logging_unittest.py.
+
+2009-12-30 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] layoutTestController.pathToLocalResource() should return a path, not an URL
+ https://bugs.webkit.org/show_bug.cgi?id=33051
+
+ Moreover, its primary function is to normalize the path in regard of platform
+ specific directory separators. Therefore, it can simply make use of the
+ QDir::toNativeSeparators function.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::pathToLocalResource):
+
+2009-12-30 David D. Kilzer <ddkilzer@webkit.org>
+
+ Fix executable bits for r52646
+
+ * Scripts/VCSUtils_unittest.pl: Added property svn:executable.
+ * Scripts/test-webkit-perl: Ditto.
+
+2009-12-29 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Kilzer.
+
+ Fixed a bug in fixChangeLogPatch, made it work correctly in
+ more circumstances, and added unit tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32919
+
+ * Scripts/VCSUtils.pm:
+ Rewrote fixChangeLogPatch.
+
+ * Scripts/VCSUtils_unittest.pl: Added.
+ Added 7 unit tests for fixChangeLogPatch.
+
+ * Scripts/test-webkit-perl: Added.
+ Added test harness for unit tests of Perl code.
+
+2009-12-29 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Split out BugzillaQueries class from Bugzilla
+ https://bugs.webkit.org/show_bug.cgi?id=33042
+
+ * Scripts/modules/bugzilla.py:
+ - Split out BugzillaQueries from Bugzilla.
+ - Try to isolate self.bugzilla usage into helper functions whenever possible.
+ - Add a bunch of FIXMEs.
+ - Rename fetch_bug_ids_from_needs_commit_list to fetch_bug_ids_from_pending_commit_list
+ * Scripts/modules/bugzilla_unittest.py:
+ - Create a new BugzillaQueriesTest testcase and move logic there.
+ * Scripts/modules/buildsteps_unittest.py:
+ - Use Bug 75 instead of 1 since bug 1 doesn't actually exist.
+ * Scripts/modules/commands/queries.py:
+ - Update to use bugzilla.queries
+ * Scripts/modules/commands/queues.py:
+ - Ditto.
+ * Scripts/modules/commands/upload.py:
+ - Ditto.
+ * Scripts/modules/mock_bugzillatool.py:
+ - Add a MockBugzillaQueries.
+ - Make patches and bugs global privates.
+ - Let _id_to_object_dictionary take a variable argument list instead of an array.
+
+2009-12-29 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33041
+
+ Speed up the test method test_read_credentials_with_SVN by not actually
+ creating an SVN repository to test against (by default). Instead, it is
+ sufficient to create a temporary directory that does not contain a Git
+ repository.
+
+ Also, renamed method test_read_credentials_with_SVN to
+ test_read_credentials_without_git_repo, to better reflect what it is
+ testing.
+
+ * Scripts/modules/credentials_unittest.py:
+
+2009-12-29 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33039
+
+ [bzt] Fixes an issue where bugzilla-tool dies when the keychain lookup
+ fails to find an entry for bugs.webkit.org.
+
+ Under Mac OS X, bugzilla-tool tries to query the keychain and Security
+ framework (via /usr/sbin/security) for an internet-password entry for
+ bugs.webkit.org so that it can use it to login to bugs.webkit.org.
+ However, if no such entry exists then bugzilla-tool dies with an error.
+
+ * Scripts/modules/credentials.py: Modified method _parse_security_tool_output to return
+ [None, None] if /usr/sbin/security cannot find keychain entry for bugs.webkit.org.
+ * Scripts/modules/credentials_unittest.py: Added method test_security_output_parse_entry_not_found.
+
+2009-12-29 Eric Seidel <eric@webkit.org>
+
+ Rubber-stamped by Adam Barth.
+
+ Remove unused BugzillaException.
+
+ * Scripts/modules/bugzilla.py:
+
+2009-12-29 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Need a script to assign bugs with r+ patches to committers for landing
+ https://bugs.webkit.org/show_bug.cgi?id=33009
+
+ This is just one more small tool to help in the fight against our
+ ever-growing list of to-be-committed patches.
+
+ * Scripts/modules/bugzilla.py:
+ - Rename assign_to_email to assigned_to_email (typo).
+ - Add assigned_to_email() method on Bug.
+ - Add reassign_bug method.
+ - Add Bugzilla.unassigned_email, eventually should move to some webkit_config.py module.
+ * Scripts/modules/bugzilla_unittest.py:
+ - Update test after assigned_to_email rename.
+ * Scripts/modules/commands/commandtest.py:
+ - Call bind_to_tool to that self.tool works in Command testing.
+ * Scripts/modules/commands/download.py:
+ - Move AbstractDeclarativeCommmand multicommandtool.py, it should be part of Command.
+ * Scripts/modules/commands/queries_unittest.py:
+ - One of the test patches is now posted by "eric@webkit.org" which is a committer.
+ - Eventually we'll mock out CommitterList and be able to better control what's a committer and what's not.
+ * Scripts/modules/commands/upload.py:
+ - Add new assign-to-committer command.
+ * Scripts/modules/commands/upload_unittest.py:
+ - Add basic assign-to-committer test.
+ * Scripts/modules/committers.py:
+ - Add bugzilla_email() accessor.
+ * Scripts/modules/committers_unittest.py:
+ - Test our assumption that bugzilla_email is the first email.
+ * Scripts/modules/mock_bugzillatool.py:
+ - Add _id_to_object_dictionary for generating bug_cache from list of bugs.
+ - Remove unused fetch_attachments_from_bug.
+ - Add fetch_bug support and a bug_cache.
+ * Scripts/modules/multicommandtool.py:
+ - Move AbstractDeclarativeCommmand here from download.py
+
+2009-12-29 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Don't crash if user types a number during PromptForBugOrTitleStep
+ https://bugs.webkit.org/show_bug.cgi?id=33038
+
+ Simple fix with test.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/buildsteps_unittest.py:
+
+2009-12-29 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] post-diff requires reading to the end
+ https://bugs.webkit.org/show_bug.cgi?id=33036
+
+ Catch the IOError caused by not reading to the end of the diff. We
+ don't have a good way to test this currently.
+
+ * Scripts/modules/user.py:
+
+2009-12-29 Chang Shu <Chang.Shu@nokia.com>
+
+ Reviewed by Adam Barth.
+
+ [Qt] Move logic that handles Qt headers before primary headers
+ so that Qt headers won't be treated as primary headers by mistake.
+ https://bugs.webkit.org/show_bug.cgi?id=32991
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-12-29 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add the start of a Bug object for bugzilla.py
+ https://bugs.webkit.org/show_bug.cgi?id=32995
+
+ This allowed us to get rid of some duplicated "is_obsolete" checks.
+
+ * Scripts/modules/bugzilla.py:
+ - Add a new Bug class, and move patches/unreviewed_patches filtering logic there.
+ - Add _fetch_bug_page for possible future mocking.
+ (I did not try to test fetch_*_from_bug now due to difficulties with our current validate_reviewer logic.)
+ - Rename fetch_bug to fetch_bug_dictionary and add a new fetch_bug which returns a Bug object.
+ - Use fetch_bug and attachments(), patches(), etc. instead of custom fetch_*_from_bug methods.
+ - Reduce code in fetch_patches_from_pending_commit_list and fetch_patches_from_review_queue
+ using list comprehensions. Use a sum(list, []) trick to flatten a list of lists into a single list.
+ * Scripts/modules/bugzilla_unittest.py:
+ - Remove an unneeded unicode string marker.
+ * Scripts/modules/buildsteps.py:
+ - define __all__ to include just the BuildSteps
+ * Scripts/modules/commands/download.py:
+ - import * now that we have an __all__ defined.
+ * Scripts/modules/commands/upload.py:
+ - Use fetch_bug_dictionary instead of fetch_bug.
+
+2009-12-29 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32925
+
+ Adds an Open File dialog to make it convenient to open a file
+ to view in the browser.
+
+ Currently a person must either specify the path to a file as a
+ command-line argument or type a file URL. Instead, we should
+ have a file dialog to allow a person to open a file without
+ memorizing its path.
+
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow): Changed urlEdit->setText(qurl.toEncoded())
+ to urlEdit->setText(qurl.toString()).
+ (MainWindow::openFile): Added.
+ (MainWindow::changeLocation): Moved code to load URL into method
+ MainWindow::loadURL.
+ (MainWindow::loadURL): Added.
+ (MainWindow::setupUI): Added menu item Open File.
+
+2009-12-29 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Holger Freyther.
+
+ [GTK] fails fast/harness/use-page-cache.html
+ https://bugs.webkit.org/show_bug.cgi?id=33013
+
+ Make sure settings are forwarded to child WebViews.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (createWebView):
+
+2009-12-29 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32778
+
+ Changes $diffPercentage to be a number to resolve Perl
+ warning about comparing a string to a number.
+
+ * Scripts/run-webkit-tests:
+
+2009-12-29 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] DRT: Frame loader callbacks differ from the Mac port
+ https://bugs.webkit.org/show_bug.cgi?id=32989
+
+ Remove messages from the callbacks that should not dump them to match
+ the expected results for the http/loading tests.
+
+ Unskip some http/loading tests which succeed now.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::dump):
+
+2009-12-29 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] fix fast/dom/Window/window-onFocus.html
+
+ Add support for layouttestcontroller.windowIsKey to Qt DRT and fix issue where
+ window.onblur was getting dispatched twice from QtWebKit.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32990
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::switchFocus):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setWindowIsKey):
+ (LayoutTestController::setMainFrameIsFirstResponder):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2009-12-28 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Extended EventSender.keyDown method to take another (3rd) argument
+ for indicating the keyLocation to make numeric pad key events testable.
+ Expected values for the argument is one of the KeyLocationCode
+ specified in DOM Level 3
+ (http://www.w3.org/TR/DOM-Level-3-Events/#events-keyboardevents).
+ https://bugs.webkit.org/show_bug.cgi?id=28247
+
+ Test: fast/events/keydown-numpad-keys.html
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (+[EventSendingController isSelectorExcludedFromWebScript:]):
+ (+[EventSendingController webScriptNameForSelector:]):
+ (-[EventSendingController keyDown:withModifiers:withLocation:]):
+
+2009-12-28 Ariya Hidayat <ariya.hidayat@gmail.com>
+
+ Unreviewed, update my email address.
+
+ * Scripts/modules/committers.py:
+
+2009-12-28 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Adam Barth.
+
+ [Qt] Fix build break for Qt 4.4
+ https://bugs.webkit.org/show_bug.cgi?id=30327
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp: Include QLocale
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp: Ditto.
+ * QtLauncher/main.cpp:
+ (MainWindow::MainWindow): Qt::WA_TranslucentBackground was
+ introduced in Qt version 4.5
+
+2009-12-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Add an edit-changelog command
+ https://bugs.webkit.org/show_bug.cgi?id=32986
+
+ This command makes it easier to edit ChangeLogs. It's similar to
+ prepare-ChangeLog -o, except it works with already existing ChangeLogs.
+
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/commands/upload_unittest.py:
+
+2009-12-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Create an ASAD command for uploading a patch
+ https://bugs.webkit.org/show_bug.cgi?id=32979
+
+ The create-review command goes through the whole process of preparing a
+ code review, including creating a bug, editing the ChangeLogs, and
+ uploading the patch. It is indeed the All Sing, All Dance upload
+ command.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/commands/upload_unittest.py:
+ * Scripts/modules/mock_bugzillatool.py:
+ * Scripts/modules/user.py:
+
+2009-12-28 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix (with test!).
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/bugzilla_unittest.py:
+
+2009-12-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add more awesome bug-parsing logic to bugzilla.py in preparation for assign-to-committer command
+ https://bugs.webkit.org/show_bug.cgi?id=32980
+
+ * Scripts/modules/bugzilla.py:
+ - Add a new _parse_bug_page function and use it in fetch_attachments_from_bug
+ - Replace fetch_title_from_bug with a new fetch_bug call instead.
+ - Use list comprehensions where possible to reduce code duplication.
+ * Scripts/modules/bugzilla_unittest.py:
+ - Add a minimal bug parsing test.
+ - Share code between bug parsing and attachment parsing tests with _assert_dictionaries_equal
+ * Scripts/modules/commands/upload.py:
+ - Use fetch_bug(bug_id)["title"] instead of fetch_title_from_bug
+
+2009-12-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Status bubble shouldn't be transparent for bots that haven't run yet
+ https://bugs.webkit.org/show_bug.cgi?id=32977
+
+ * QueueStatusServer/templates/statusbubble.html:
+
+2009-12-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [QueueStatusServer] Run gc cron job less often
+ https://bugs.webkit.org/show_bug.cgi?id=32958
+
+ Now that we've cleaned out the backlog of idle messages, we don't need
+ to run the gc job every half hour. We could also stop logging the idle
+ messages, but this seems easier for the time being.
+
+ * QueueStatusServer/cron.yaml:
+
+2009-12-27 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32896
+
+ Fixes an issue where bugzilla-tool tries to read the username and password from
+ Git regardless of whether Git is installed. In particular, if Git is not
+ installed then bugzilla-tool dies (with a trace) when it attempts to query Git
+ for the authentication credentials to log into bugs.webkit.org.
+
+ Moreover, modifies Executive.run_command to catch and pass OSError exceptions to
+ the specified error handler. For instance, the specified error handler will now
+ be called when the command does not exist (i.e. OSError errno 2).
+
+ * Scripts/modules/credentials.py: Added check for Git.
+ * Scripts/modules/credentials_unittest.py: Added test method
+ test_read_credentials_with_SVN.
+ * Scripts/modules/executive.py: Modified method run_command to catch
+ OSError exceptions (i.e [Errno 2] No such file or directory) and call
+ the specified error handler.
+ * Scripts/modules/executive_unittest.py: Added.
+ * Scripts/run-webkit-unittests: Added import executive_unittest.py.
+
+2009-12-27 Daniel Bates <dbates@webkit.org>
+
+ Unreviewed. Added missing file style_unittest.py that wasn't committed
+ in change set 52541 (http://trac.webkit.org/changeset/52541) as part of
+ the patch for bug #32592.
+
+ * Scripts/modules/style_unittest.py: Added.
+
+2009-12-27 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32964
+
+ [bzt] Updated the unit test based on the change made in bug #32951.
+
+ The change made in bug #32951 added the command-line argument:
+ --makeargs="-j8" to the build-webkit command. However, the associated
+ unit test was not updated.
+
+ * Scripts/modules/webkitport_unittest.py:
+
+2009-12-27 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ check-webkit-style should not mark moc files inclusion as errors
+ https://bugs.webkit.org/show_bug.cgi?id=32669
+
+ Add a new header type for moc files, and skip them when checking the order of header files.
+
+ * Scripts/modules/cpp_style.py:
+
+2009-12-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Make the qt build go fast
+ https://bugs.webkit.org/show_bug.cgi?id=32951
+
+ Make use of multiple cores, if available.
+
+ * Scripts/modules/webkitport.py:
+
+2009-12-25 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32682
+
+ Fixes an issue where checkFrameworks always dies with an error under Windows
+ since the clause "unless (-x $path)" is always satisfied because files under
+ Windows do not have an explict executable bit.
+
+ * Scripts/webkitdirs.pm:
+
+2009-12-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool should accept global options anywhere
+ https://bugs.webkit.org/show_bug.cgi?id=26912
+
+ * Scripts/bugzilla-tool:
+ - Use the new global_options class property.
+ - Add a handle_global_options callback to avoid needing callbacks for each global option.
+ * Scripts/modules/multicommandtool.py:
+ - Make the code use one combined option parser.
+ This allows us to accept global options anywhere and
+ individual command options before commands.
+ - Add a handle_global_options callback to avoid needing callbacks for each global option.
+ - Make the Command hold the option parser, but allow the tool to override it.
+ - The default option parser is used for help printing and when Commands are run stand alone,
+ but are otherwise not used.
+ - Add Command.main to codify the idea that Commands should support being run stand-alone.
+ - Change _split_args to _split_command_name_from_args now that args are unified.
+ * Scripts/modules/multicommandtool_unittest.py:
+ - Test that "tool" and "tool help" show the same help.
+ - Test that args are accepted before commands
+
+2009-12-20 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Levin.
+
+ Moved some sections of code in preparation to refactor
+ check-webkit-style's argument parser to avoid setting
+ global variables.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32592
+
+ * Scripts/check-webkit-style:
+ - Moved _USAGE string to style.py.
+ - Addressed FIXME by eliminating dependencies on cpp_style.py.
+
+ * Scripts/modules/cpp_style.py:
+ - Moved default arguments and style categories to style.py.
+ - Moved exit_with_usage(), exit_with_categories(), and
+ parse_arguments() to style.py.
+ - Removed references in _CppStyleState to the global
+ variables now in style.py.
+
+ * Scripts/modules/cpp_style_unittest.py:
+ - Moved parse_arguments() unit tests to style_unittest.py.
+
+ * Scripts/modules/style.py:
+ - Added _USAGE string from check-webkit-style.
+ - Added default arguments and style categories from cpp_style.py.
+ - Added exit_with_usage(), exit_with_categories(), and
+ parse_arguments() from cpp_sstyle.py.
+
+ * Scripts/modules/style_unittest.py: Added.
+ - Added parse_arguments() unit tests from cpp_style_unittest.py.
+
+ * Scripts/run-webkit-unittests:
+ - Added unit tests from style_unittest.py.
+
+2009-12-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue should mention bug 30084 when rejecting patches until it can be fixed
+ https://bugs.webkit.org/show_bug.cgi?id=32911
+
+ * Scripts/modules/bugzilla.py: Make the message even more fancy.
+ * Scripts/modules/bugzilla_unittest.py: Test our new fancy message.
+
+2009-12-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Not reviewed, adding myself to the reviewers list.
+
+ * Scripts/modules/committers.py:
+
+2009-12-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Create a prepare-diff command that creates a bug and a ChangeLog
+ https://bugs.webkit.org/show_bug.cgi?id=32895
+
+ The workflow Maciej and I discussed is as follows:
+
+ 1) Write code.
+ 2) bugzilla-tool prepare-diff
+ 3) Edit ChangeLogs
+ 4) bugzilla-tool post-diff
+
+ We might want to experimenting with combining 2-4 into a single
+ command, but that might be stressful to edit the ChangeLogs modally.
+
+ Removed submit-patch since it has the modal ChangeLog editing but none
+ oof the bug creating fun.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/commands/upload_unittest.py:
+
+2009-12-23 Gabor Loki <loki@webkit.org>
+
+ Unreviewed; added myself to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-12-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ [bzt] Don't call create-patch twice during post-diff
+ https://bugs.webkit.org/show_bug.cgi?id=32893
+
+ If we call create-patch to get the bug number, cache the diff in the
+ state so we don't need to call it again.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/upload.py:
+
+2009-12-22 Daniel Bates <dbates@rim.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32680
+
+ Fixes an issue in builtDylibPathForName so that it returns the correct
+ path to the built QtWebKit library on the Qt Windows port. Currently,
+ it returns the path to the file named QtWebKit.dll but this file does
+ not exist on the Qt Windows build. Instead, the file is named
+ QtWebKit4.dll.
+
+ * Scripts/webkitdirs.pm:
+
+2009-12-22 Marc-Antoine Ruel <maruel@chromium.org>
+
+ Reviewed by Adam Roben.
+
+ Remove the only dependency on perl-libwin32 in cygwin
+
+ * Scripts/num-cpus:
+
+2009-12-22 Darin Adler <darin@apple.com>
+
+ * pywebsocket/mod_pywebsocket: Added property svn:ignore to ignore
+ generated ".pyc" files.
+
+2009-12-22 Darin Adler <darin@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Turn off datagrid by default, at least for all platforms Apple ships.
+ The datagrid implementation isn't ready for general web use yet.
+
+ * Scripts/build-webkit: Turn off datagrid by default.
+
+2009-12-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ validate-committer-lists fails when run from an SVN checkout
+ https://bugs.webkit.org/show_bug.cgi?id=31974
+
+ * Scripts/validate-committer-lists:
+ - Make it print a warning message instead of throwing
+ an exception when running from an SVN checkout.
+
+2009-12-22 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Adam Barth.
+
+ check-webkit-style should not warn about NULL usage in g_object_{get,set}
+ https://bugs.webkit.org/show_bug.cgi?id=32858
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-12-22 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Holger Freyther.
+
+ Moved QtLauncher from WebKit/qt.
+
+ * QtLauncher: Copied from WebKit/qt/QtLauncher.
+ * QtLauncher/QtLauncher.pro:
+
+2009-12-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Automate the process of calling prepare-ChangeLog
+ https://bugs.webkit.org/show_bug.cgi?id=32816
+
+ This patch automates the process of creating a bug and patch and
+ uploading it to bugzilla. The first cut just calls
+ prepare-ChangeLog.
+
+ This patch required some refactoring of upload.py to the Step
+ model, but that's worth doing anyway.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/commands/upload_unittest.py:
+ * Scripts/modules/mock_bugzillatool.py:
+
+2009-12-21 Darin Adler <darin@apple.com>
+
+ * Scripts/do-webcore-rename: Did a rename, so checking in the
+ version of the script I used.
+
+2009-12-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Update status-bubble to show all the queues
+ https://bugs.webkit.org/show_bug.cgi?id=32838
+
+ Also, move statusbubble over to use memcache.
+
+ * QueueStatusServer/handlers/statusbubble.py:
+ * QueueStatusServer/templates/statusbubble.html:
+
+2009-12-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Delete the boring "Empty queue" status messages in QueueStatusServer
+ https://bugs.webkit.org/show_bug.cgi?id=32818
+
+ * QueueStatusServer/app.yaml:
+ * QueueStatusServer/cron.yaml:
+ * QueueStatusServer/handlers/gc.py:
+ * QueueStatusServer/main.py:
+
+2009-12-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Exception on queue status server
+ https://bugs.webkit.org/show_bug.cgi?id=32812
+
+ Turns out we need to pass the id to the filter.
+
+ * QueueStatusServer/filters/webkit_extras.py:
+ * QueueStatusServer/templates/patch.html:
+ * QueueStatusServer/templates/recentstatus.html:
+
+2009-12-20 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ Created "style" folder for code supporting check-webkit-style.
+
+ * Scripts/modules/style: Added.
+
+2009-12-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ REGRESSION: error when running commit-queue
+ https://bugs.webkit.org/show_bug.cgi?id=32806
+
+ Fix typo and add test!
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/bugzilla_unittest.py:
+
+2009-12-20 Adam Barth <abarth@webkit.org>
+
+ [bzt] Optimize status updates for new dashboard
+ https://bugs.webkit.org/show_bug.cgi?id=32797
+
+ This patch makes the queues slightly more chatty with the web service.
+ Also, this patch introduces some testing for the queues!
+
+ * Scripts/modules/commands/early_warning_system.py:
+ * Scripts/modules/commands/early_warning_system_unittest.py: Added.
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/commands/queues_unittest.py:
+ * Scripts/modules/commands/queuestest.py: Added.
+ * Scripts/modules/mock_bugzillatool.py:
+ * Scripts/modules/patchcollection.py:
+ * Scripts/modules/queueengine.py:
+ * Scripts/run-webkit-unittests:
+
+2009-12-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Prepare QueueStatusServer for new status messages
+ https://bugs.webkit.org/show_bug.cgi?id=32805
+
+ * QueueStatusServer/handlers/recentstatus.py:
+ * QueueStatusServer/index.html: Removed.
+ * QueueStatusServer/model/attachment.py:
+ * QueueStatusServer/model/queues.py: Added.
+ * QueueStatusServer/templates/recentstatus.html: Added.
+
+2009-12-20 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [check-webkit-style] static_cast is not misnamed!
+ https://bugs.webkit.org/show_bug.cgi?id=32796
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-12-20 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Failing test platform/gtk/editing/pasteboard/middle-button-paste.html
+ https://bugs.webkit.org/show_bug.cgi?id=32788
+
+ Do not increase the click count if we are using a different button.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+
+2009-12-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [QueueStatusServer] Add a per-patch details page
+ https://bugs.webkit.org/show_bug.cgi?id=32784
+
+ This is a first cut at a per-patch details page. I'm sure we'll have
+ to iterate.
+
+ * QueueStatusServer/filters/webkit_extras.py:
+ * QueueStatusServer/handlers/patch.py: Added.
+ * QueueStatusServer/index.yaml:
+ * QueueStatusServer/main.py:
+ * QueueStatusServer/model/attachment.py:
+ * QueueStatusServer/stylesheets/dashboard.css:
+ * QueueStatusServer/templates/dashboard.html:
+ * QueueStatusServer/templates/patch.html: Added.
+
+2009-12-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Use memcache to make dashboard to fast
+ https://bugs.webkit.org/show_bug.cgi?id=32780
+
+ * QueueStatusServer/app.yaml:
+ * QueueStatusServer/handlers/dashboard.py:
+ * QueueStatusServer/handlers/updatestatus.py:
+ * QueueStatusServer/model/attachment.py: Added.
+
+2009-12-19 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Provide an example implementation for printing under Windows.
+ http://bugs.webkit.org/show_bug.cgi?id=32504.`
+
+ * WinLauncher/PrintWebUIDelegate.cpp: Added.
+ (PrintWebUIDelegate::QueryInterface):
+ (PrintWebUIDelegate::AddRef):
+ (PrintWebUIDelegate::Release):
+ (PrintWebUIDelegate::webViewPrintingMarginRect):
+ * WinLauncher/PrintWebUIDelegate.h: Added.
+ (PrintWebUIDelegate::PrintWebUIDelegate):
+ (PrintWebUIDelegate::createWebViewWithRequest):
+ (PrintWebUIDelegate::webViewShow):
+ (PrintWebUIDelegate::webViewClose):
+ (PrintWebUIDelegate::webViewFocus):
+ (PrintWebUIDelegate::webViewUnfocus):
+ (PrintWebUIDelegate::webViewFirstResponder):
+ (PrintWebUIDelegate::makeFirstResponder):
+ (PrintWebUIDelegate::setStatusText):
+ (PrintWebUIDelegate::webViewStatusText):
+ (PrintWebUIDelegate::webViewAreToolbarsVisible):
+ (PrintWebUIDelegate::setToolbarsVisible):
+ (PrintWebUIDelegate::webViewIsStatusBarVisible):
+ (PrintWebUIDelegate::setStatusBarVisible):
+ (PrintWebUIDelegate::webViewIsResizable):
+ (PrintWebUIDelegate::setResizable):
+ (PrintWebUIDelegate::setFrame):
+ (PrintWebUIDelegate::webViewFrame):
+ (PrintWebUIDelegate::setContentRect):
+ (PrintWebUIDelegate::webViewContentRect):
+ (PrintWebUIDelegate::runJavaScriptAlertPanelWithMessage):
+ (PrintWebUIDelegate::runJavaScriptConfirmPanelWithMessage):
+ (PrintWebUIDelegate::runJavaScriptTextInputPanelWithPrompt):
+ (PrintWebUIDelegate::runBeforeUnloadConfirmPanelWithMessage):
+ (PrintWebUIDelegate::runOpenPanelForFileButtonWithResultListener):
+ (PrintWebUIDelegate::mouseDidMoveOverElement):
+ (PrintWebUIDelegate::contextMenuItemsForElement):
+ (PrintWebUIDelegate::validateUserInterfaceItem):
+ (PrintWebUIDelegate::shouldPerformAction):
+ (PrintWebUIDelegate::dragDestinationActionMaskForDraggingInfo):
+ (PrintWebUIDelegate::willPerformDragDestinationAction):
+ (PrintWebUIDelegate::dragSourceActionMaskForPoint):
+ (PrintWebUIDelegate::willPerformDragSourceAction):
+ (PrintWebUIDelegate::contextMenuItemSelected):
+ (PrintWebUIDelegate::hasCustomMenuImplementation):
+ (PrintWebUIDelegate::trackCustomPopupMenu):
+ (PrintWebUIDelegate::measureCustomMenuItem):
+ (PrintWebUIDelegate::drawCustomMenuItem):
+ (PrintWebUIDelegate::addCustomMenuDrawingData):
+ (PrintWebUIDelegate::cleanUpCustomMenuDrawingData):
+ (PrintWebUIDelegate::canTakeFocus):
+ (PrintWebUIDelegate::takeFocus):
+ (PrintWebUIDelegate::registerUndoWithTarget):
+ (PrintWebUIDelegate::removeAllActionsWithTarget):
+ (PrintWebUIDelegate::setActionTitle):
+ (PrintWebUIDelegate::undo):
+ (PrintWebUIDelegate::redo):
+ (PrintWebUIDelegate::canUndo):
+ (PrintWebUIDelegate::canRedo):
+ (PrintWebUIDelegate::printFrame):
+ (PrintWebUIDelegate::ftpDirectoryTemplatePath):
+ (PrintWebUIDelegate::webViewHeaderHeight):
+ (PrintWebUIDelegate::webViewFooterHeight):
+ (PrintWebUIDelegate::drawHeaderInRect):
+ (PrintWebUIDelegate::drawFooterInRect):
+ (PrintWebUIDelegate::canRunModal):
+ (PrintWebUIDelegate::createModalDialog):
+ (PrintWebUIDelegate::runModal):
+ (PrintWebUIDelegate::isMenuBarVisible):
+ (PrintWebUIDelegate::setMenuBarVisible):
+ (PrintWebUIDelegate::runDatabaseSizeLimitPrompt):
+ (PrintWebUIDelegate::paintCustomScrollbar):
+ (PrintWebUIDelegate::paintCustomScrollCorner):
+ * WinLauncher/WinLauncher.cpp: Add new UI delegate for print support.
+ (WinLauncherWebHost::updateAddressBar): check-webkit-style fixes.
+ (WinLauncherWebHost::QueryInterface): check-webkit-style fixes.
+ (WinLauncherWebHost::AddRef): check-webkit-style fixes.
+ (WinLauncherWebHost::Release): check-webkit-style fixes.
+ (resizeSubViews): check-webkit-style fixes.
+ (_tWinMain): check-webkit-style fixes.
+ (MyRegisterClass): check-webkit-style fixes.
+ (InitInstance): check-webkit-style fixes.
+ (AbortProc): New print support function.
+ (getPrinterDC): New print support function.
+ (initDocStruct): New print support function.
+ (PrintView): New printing implementation.
+ (WndProc): Add support for printing.
+ (MyEditProc): check-webkit-style fixes.
+ (About): check-webkit-style fixes.
+ (loadURL): check-webkit-style fixes.
+ * WinLauncher/WinLauncher.h:
+ (WinLauncherWebHost::WinLauncherWebHost):
+ (WinLauncherWebHost::didStartProvisionalLoadForFrame):
+ (WinLauncherWebHost::didReceiveServerRedirectForProvisionalLoadForFrame):
+ (WinLauncherWebHost::didFailProvisionalLoadWithError):
+ (WinLauncherWebHost::didCommitLoadForFrame):
+ (WinLauncherWebHost::didReceiveTitle):
+ (WinLauncherWebHost::didReceiveIcon):
+ (WinLauncherWebHost::didFinishLoadForFrame):
+ (WinLauncherWebHost::didFailLoadWithError):
+ (WinLauncherWebHost::didChangeLocationWithinPageForFrame):
+ (WinLauncherWebHost::willPerformClientRedirectToURL):
+ (WinLauncherWebHost::didCancelClientRedirectForFrame):
+ (WinLauncherWebHost::willCloseFrame):
+ (WinLauncherWebHost::windowScriptObjectAvailable):
+ * WinLauncher/WinLauncher.rc: Add menu entry for printing.
+ * WinLauncher/WinLauncher.vcproj: Add new files.
+ * WinLauncher/resource.h: Add menu entry for printing.
+
+2009-12-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Tweak the CSS to make the dashboard prettier.
+
+ * QueueStatusServer/stylesheets/dashboard.css:
+ * QueueStatusServer/templates/dashboard.html:
+
+2009-12-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ QueueStatusServer needs a human readable dashboard
+ https://bugs.webkit.org/show_bug.cgi?id=32769
+
+ Here is a first cut at the dashboard. There's a lot left to do.
+
+ * QueueStatusServer/filters/webkit_extras.py:
+ * QueueStatusServer/handlers/dashboard.py: Added.
+ * QueueStatusServer/handlers/patchstatus.py:
+ * QueueStatusServer/handlers/recentstatus.py:
+ * QueueStatusServer/handlers/showresults.py:
+ * QueueStatusServer/handlers/statusbubble.py:
+ * QueueStatusServer/handlers/updatestatus.py:
+ * QueueStatusServer/main.py:
+ * QueueStatusServer/model/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+ * QueueStatusServer/model/queuestatus.py: Renamed from WebKitTools/QueueStatusServer/model.py.
+ * QueueStatusServer/stylesheets/dashboard.css: Added.
+ * QueueStatusServer/templates/dashboard.html: Added.
+ * QueueStatusServer/templates/statusbubble.html: Renamed from WebKitTools/QueueStatusServer/status_bubble.html.
+ * QueueStatusServer/templates/updatestatus.html: Renamed from WebKitTools/QueueStatusServer/update_status.html.
+
+2009-12-19 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Timothy Hatcher.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32462
+
+ Added --inspector-frontend flag to build-webkit to copy any changes
+ to the inspector front-end files to the built WebCore framework. This
+ will make inspector development more consistent with the rest of
+ WebKit development.
+
+ * Scripts/build-webkit:
+ * Scripts/webkitdirs.pm:
+
+2009-12-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed fixes for me being terrible at python.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/run-webkit-unittests:
+
+2009-12-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Split QueueStatus server into modules
+ https://bugs.webkit.org/show_bug.cgi?id=32768
+
+ One monolithic file is no good.
+
+ * QueueStatusServer/app.yaml:
+ * QueueStatusServer/handlers/__init__.py: Copied from WebKitTools/QueueStatusServer/filters/__init__.py.
+ * QueueStatusServer/handlers/patchstatus.py: Added.
+ * QueueStatusServer/handlers/recentstatus.py: Added.
+ * QueueStatusServer/handlers/showresults.py: Added.
+ * QueueStatusServer/handlers/statusbubble.py: Added.
+ * QueueStatusServer/handlers/updatestatus.py: Added.
+ * QueueStatusServer/main.py: Added.
+ * QueueStatusServer/model.py: Added.
+ * QueueStatusServer/queue_status.py: Removed.
+
+2009-12-18 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ Renamed WorkQueue to QueueEngine. WorkQueue is not a queue.
+
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/queueengine.py: Added.
+ * Scripts/modules/queueengine_unittest.py: Added.
+ * Scripts/modules/stepsequence.py:
+ * Scripts/modules/workqueue.py: Removed.
+ * Scripts/modules/workqueue_unittest.py: Removed.
+
+2009-12-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add watches for EWS
+ https://bugs.webkit.org/show_bug.cgi?id=32767
+
+ dglazkov wanted to be added.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/commands/early_warning_system.py:
+ * Scripts/modules/commands/queues.py:
+
+2009-12-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ move bugzilla.py off of urllib2
+ https://bugs.webkit.org/show_bug.cgi?id=32729
+
+ * Scripts/modules/bugzilla.py: use mechanize for all url fetching.
+
+2009-12-18 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Rubber-stamped by Xan Lopez.
+
+ [GTK] New events (pageshow and pagehide) tests failing
+ https://bugs.webkit.org/show_bug.cgi?id=28823
+
+ Original patch by Jan Michael Alonzo.
+
+ Disable page cache for tests.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (copyWebSettingKey):
+ (LayoutTestController::overridePreference):
+
+2009-12-18 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by David Levin.
+
+ Check one space before end of line comments.
+ https://bugs.webkit.org/show_bug.cgi?id=32597
+
+ Fix to check one space before end of line comments in whitespace and build/header_guard.
+ Also fix build/header_guard to use WebKit header guard defines.
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-12-17 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Add BUILDING_ON_SNOW_LEOPARD #define.
+
+ * DumpRenderTree/mac/DumpRenderTreeMac.h:
+
+2009-12-17 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Update pywebsocket to 0.4.5 and make handshake checking stricter
+ https://bugs.webkit.org/show_bug.cgi?id=32249
+
+ * Scripts/run-webkit-tests:
+ * pywebsocket/mod_pywebsocket/handshake.py:
+ * pywebsocket/mod_pywebsocket/memorizingfile.py: Added.
+ * pywebsocket/mod_pywebsocket/standalone.py:
+ * pywebsocket/setup.py:
+ * pywebsocket/test/test_handshake.py:
+ * pywebsocket/test/test_memorizingfile.py: Added.
+
+2009-12-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Command.show_in_main_help should default to False
+ https://bugs.webkit.org/show_bug.cgi?id=32686
+
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/queries.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/multicommandtool.py:
+
+2009-12-17 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Eric Seidel.
+
+ Added the key WebKitEnableCaretBrowsing to the
+ layoutTestController.overridePreference in order to activate caret
+ browsing.
+ https://bugs.webkit.org/show_bug.cgi?id=32612
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp: Added the reset value of
+ the setting.
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Inserted the new
+ key in the keytable.
+
+2009-12-17 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by David Kilzer.
+
+ AX: DRT needs to support URL for accessibility
+ https://bugs.webkit.org/show_bug.cgi?id=32666
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getURLCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::url):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::url):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::url):
+
+2009-12-17 Philippe Normand <pnormand@igalia.com>
+
+ Unreviewed; added myself to committers
+
+ * Scripts/modules/committers.py:
+
+2009-12-17 Benjamin Otte <otte@gnome.org>
+
+ Unreviewed; added myself to committers
+
+ * Scripts/modules/committers.py:
+
+2009-12-17 Adam Barth <abarth@webkit.org>
+
+ Rubber stamp by Seidel.
+
+ Clean up exception handling in WorkQueue. Basically, a bunch of the
+ delegate messages can throw exceptions because of network errors. We
+ want the queues to keep on ticking instead of erroring out. That means
+ we want to catch generic exceptions and continue looping.
+
+ Also, cleaned up the exception handling in the EWS to properly log
+ failures.
+
+ * Scripts/modules/commands/early_warning_system.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/workqueue.py:
+
+2009-12-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Make UpdateStep quiet
+ https://bugs.webkit.org/show_bug.cgi?id=32599
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/buildsteps_unittest.py:
+
+2009-12-16 Evan Martin <evan@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add Gtk to the early warning system WebKit port list.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32629
+
+ * Scripts/modules/commands/early_warning_system.py:
+ * Scripts/modules/webkitport.py:
+ * Scripts/modules/webkitport_unittest.py:
+
+2009-12-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ post-diff is failing with exception under guess_reviewer_from_bug
+ https://bugs.webkit.org/show_bug.cgi?id=32642
+
+ Also refactor output capturing code into
+ OutputCapture.assert_outputs to share more code between tests.
+
+ * Scripts/modules/buildsteps.py:
+ - Add the missing include.
+ - Give guess_reviewer_from_bug a private underscore.
+ * Scripts/modules/buildsteps_unittest.py: Added.
+ - Test to make sure _guess_reviewer_from_bug works as expected.
+ * Scripts/modules/commands/commandtest.py:
+ - Custom code is now obsoleted by OutputCapture.assert_outputs
+ * Scripts/modules/commands/queues_unittest.py:
+ - ditto
+ * Scripts/modules/credentials_unittest.py:
+ - ditto
+ * Scripts/modules/mock_bugzillatool.py:
+ - fetch_reviewed_patches_from_bug can never return None
+ * Scripts/modules/multicommandtool_unittest.py:
+ - Custom code is now obsoleted by OutputCapture.assert_outputs
+ * Scripts/modules/outputcapture.py:
+ - Add assert_outputs to share more code between tests.
+ * Scripts/run-webkit-unittests:
+ - Add buildsteps_unittest.py
+
+2009-12-16 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Added a default argument to _update_status so that callers
+ don't have to explictly pass None when they don't have a patch object.
+
+ * Scripts/modules/commands/queues.py:
+
+2009-12-16 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by David Levin.
+
+ check-webkit-style supports for TAB check against text files.
+ https://bugs.webkit.org/show_bug.cgi?id=32538
+
+ * Scripts/check-webkit-style:
+ Move process_patch() to style.py.
+ * Scripts/modules/cpp_style.py:
+ Add can_handle().
+ * Scripts/modules/cpp_style_unittest.py:
+ Add tests for can_handle().
+ * Scripts/modules/style.py:
+ Added. This is a front-end of cpp_style and text_style. It dispatches
+ files to an appropriate linter.
+ * Scripts/modules/text_style.py:
+ Added. This is a linter module for generic text files. It supports
+ only for TAB checking at this moment.
+ * Scripts/modules/text_style_unittest.py:
+ Added. Tests for text_style.py.
+ * Scripts/run-webkit-unittests:
+ Add text_style_unittest.
+
+2009-12-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ bugzilla-tool should not require users to install mechanize
+ https://bugs.webkit.org/show_bug.cgi?id=32635
+
+ Centralize our import logic.
+
+ * Scripts/modules/bugzilla.py: use webkit_mechanize
+ * Scripts/modules/statusbot.py: use webkit_mechanize
+ * Scripts/modules/webkit_mechanize.py: Added.
+
+2009-12-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Generalize commit-queue recent status page for all queues
+ https://bugs.webkit.org/show_bug.cgi?id=32633
+
+ * QueueStatusServer/index.html:
+ - Generalize to support other queues.
+ * QueueStatusServer/queue_status.py:
+ - Generalize MainPage to support other queues.
+
+2009-12-16 Evan Martin <evan@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Early warning system server should display output as UTF-8.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32625
+
+ * QueueStatusServer/queue_status.py:
+
+2009-12-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Add error handling to the early warning system
+ https://bugs.webkit.org/show_bug.cgi?id=32594
+
+ This should be the last step in making the EWS operational. When we
+ have a build error, we post the log to QueueStatusServer and add a link
+ to the bug.
+
+ * Scripts/modules/commands/early_warning_system.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/executive.py:
+
+2009-12-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Holger Freyther.
+
+ Fix crash with tests that use custom font faces.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32600
+
+ In the DRT we call QApplication::removeAllApplicationFonts(), to make sure
+ that custom font faces between tests don't influence each other. Calling this
+ function in Qt however also invalidates all existing handles with QFontDatabase.
+
+ In order to make sure that WebCore also drops these handles we call QWebSettings::clearMemoryCaches(),
+ which implies a call to WebCore::FontCache::fontCache()->invalidate().
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::open):
+
+2009-12-16 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Maintain button state between mouse events.
+
+ This allows eventSender to generate drag events.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32601
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::mouseDown):
+ (EventSender::mouseUp):
+ (EventSender::mouseMoveTo):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2009-12-15 Chris Jerdonek <chris.jerdonek@gmail.com>
+
+ Reviewed by David Levin.
+
+ Code clean-up in check-webkit-style as described below.
+ The only functional changes are minor improvements to the
+ script's help output.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32487
+
+ * Scripts/check-webkit-style:
+ - Added the module docstring from cpp_style.py.
+ - Improved wording of the --help output and added some of the
+ default values as substitution strings.
+ - Called cpp_style.exit_with_usage instead of sys.stderr.write
+ in main function.
+ - Made changes caused by changes to cpp_style.py.
+
+ * Scripts/modules/cpp_style.py:
+ - Removed module docstring, as well as redundant _USAGE string
+ and main() function obsoleted by check-webkit-style.
+ - Moved specification of default script values from within a
+ function definition to global variables.
+ - Moved the default webkit filter rules to be near the other
+ global variables.
+ - Renamed "FILTER" global variables to "FILTER_RULES" to
+ establish unambiguous terminology.
+ - Renamed _ERROR_CATEGORIES to _STYLE_CATEGORIES.
+ - Changed _STYLE_CATEGORIES from a string to a list.
+ - Added default webkit filter rules to --filter= output.
+ - Renamed "print_" methods to "exit_with_" since they exist
+ and added a temporary display_help parameter.
+ - Added a temporary display_help parameter to parse_arguments.
+
+ * Scripts/modules/cpp_style_unittest.py:
+ - Made changes caused by changes to cpp_style.py.
+ - Lower-cased ErrorCollector's ERROR_CATEGORIES instance
+ variables since they are not global.
+
+2009-12-15 Adam Barth <abarth@webkit.org>
+
+ Unreviewed fix for the style-queue.
+ Typo: _updates_status -> _update_status
+
+ We need to improve our testing infrastructure for the queues.
+
+ * Scripts/modules/commands/queues.py:
+
+2009-12-15 Adam Barth <abarth@webkit.org>
+
+ Unreviewed fix for the style-queue. I suspect this is a recent
+ regression from Eric's change below.
+
+ * Scripts/modules/commands/queues.py:
+
+2009-12-15 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ update-webkit-chromium to auto-install gclient
+
+ https://bugs.webkit.org/show_bug.cgi?id=32587
+
+ * Scripts/update-webkit-chromium:
+
+2009-12-15 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool / commit-queue should add results links to bugs when more results are available on the status bot
+ https://bugs.webkit.org/show_bug.cgi?id=32546
+
+ You can see an example of this working in:
+ https://bugs.webkit.org/show_bug.cgi?id=32585#c3
+
+ * QueueStatusServer/queue_status.py:
+ - Output the id of the newly created status.
+ * Scripts/modules/commands/queues.py:
+ - Tweak the commit-queue logging to include a full status link.
+ * Scripts/modules/statusbot.py:
+ - update_status should return the newly created status id.
+
+2009-12-15 Andras Becsi <abecsi@inf.u-szeged.hu>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Rename Qt DRT components to match other ports' naming convention and to be more understandable.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp: Removed.
+ * DumpRenderTree/qt/DumpRenderTree.h: Removed.
+ * DumpRenderTree/qt/DumpRenderTree.pro: Updated.
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp: Copied from WebKitTools/DumpRenderTree/qt/DumpRenderTree.cpp.
+ * DumpRenderTree/qt/DumpRenderTreeQt.h: Copied from WebKitTools/DumpRenderTree/qt/DumpRenderTree.h.
+ * DumpRenderTree/qt/GCControllerQt.cpp: Copied from WebKitTools/DumpRenderTree/qt/jsobjects.cpp.
+ (GCController::GCController):
+ * DumpRenderTree/qt/GCControllerQt.h: Copied from WebKitTools/DumpRenderTree/qt/jsobjects.h.
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ * DumpRenderTree/qt/WorkQueueItem.h: Removed.
+ * DumpRenderTree/qt/WorkQueueItemQt.cpp: Updated includes.
+ * DumpRenderTree/qt/WorkQueueItemQt.h: Copied from WebKitTools/DumpRenderTree/qt/WorkQueueItem.h.
+ * DumpRenderTree/qt/jsobjects.cpp: Removed.
+ * DumpRenderTree/qt/jsobjects.h: Removed.
+ * DumpRenderTree/qt/main.cpp: Updated includes.
+
+2009-12-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ We have two mark-fixed commands
+ https://bugs.webkit.org/show_bug.cgi?id=32073
+
+ * Scripts/mark-bug-fixed: Removed.
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/commands/upload_unittest.py:
+
+2009-12-15 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool/commit-queue needs to upload failure logs when patches are rejected
+ https://bugs.webkit.org/show_bug.cgi?id=28286
+
+ * QueueStatusServer/index.html:
+ - Show [results] links if a results log was uploaded.
+ * QueueStatusServer/queue_status.py:
+ - Empty file uploads appear as u"" and Blob does not handle unicode, so convert to str().
+ * Scripts/modules/commands/queues.py:
+ - Post to the status bot when a patch fails and include the failure log as a results file.
+
+2009-12-15 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ queue sub-commands need --status-host so they can report status
+ https://bugs.webkit.org/show_bug.cgi?id=32313
+
+ Make --status-bot a global option and make
+ run_bugzilla_tool pass --status-bot to sub-commands.
+
+ * Scripts/bugzilla-tool:
+ - Rename _status to status_bot and make it non-lazy.
+ * Scripts/modules/commands/queues.py:
+ - Move status updates out of WorkQueue and into individual queues.
+ * Scripts/modules/commands/queues_unittest.py:
+ - Test that --status-host is passed to bugzilla-tool when run as subcommand.
+ * Scripts/modules/mock_bugzillatool.py:
+ - Add a MockStatusBot
+ * Scripts/modules/workqueue.py:
+ - Remove status_host and work_work_logs_directory callbacks.
+ - Add new work_item_log_path callback so that WorkQueue doesn't need to know about patches!
+ * Scripts/modules/workqueue_unittest.py:
+ - Update unit tests to reflect new callbacks.
+
+2009-12-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ scm_unittest.py is too slow
+ https://bugs.webkit.org/show_bug.cgi?id=31818
+
+ Now we don't run the SCM unit tests unless we get the --all flag on the
+ command line. Eric and I were commenting out this test because it was
+ too painful to run.
+
+ * Scripts/run-webkit-unittests:
+
+2009-12-14 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Fix failing unittest.
+
+ * Scripts/modules/bugzilla_unittest.py:
+
+2009-12-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Move Credential handling out into a separate module
+ https://bugs.webkit.org/show_bug.cgi?id=32531
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/credentials.py: Added.
+ * Scripts/modules/credentials_unittest.py: Added.
+ * Scripts/run-webkit-unittests:
+
+2009-12-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Kill _create_step_sequence
+ https://bugs.webkit.org/show_bug.cgi?id=32539
+
+ It's cleaner to represent not having these sequences as an empty
+ sequence instead of None.
+
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/stepsequence.py:
+
+2009-12-14 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Address reviewer comments from an earlier patch. I didn't
+ do this earlier because I was worried about conflicts in dependent
+ patches.
+
+ * Scripts/modules/commands/download.py:
+
+2009-12-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Make download commands declarative
+ https://bugs.webkit.org/show_bug.cgi?id=32469
+
+ This patch "properly" factors most of the download commands. These
+ commands are now largely declarative, which is the final step of this
+ grand refactoring.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+
+2009-12-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Add AbstractPatchSequencingCommand to remove redundant code
+ https://bugs.webkit.org/show_bug.cgi?id=32468
+
+ Redundant code is bad. This patch moves us towards more declarative
+ commands.
+
+ * Scripts/modules/commands/download.py:
+
+2009-12-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Kill WebKitApplyingScripts
+ https://bugs.webkit.org/show_bug.cgi?id=32467
+
+ Ah! I've been wanting to do this for a long time. This patch brings
+ the applying commands into the patch processing fold.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/download_unittest.py:
+ * Scripts/modules/mock_bugzillatool.py:
+
+2009-12-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Convert rollout to StepSequence
+ https://bugs.webkit.org/show_bug.cgi?id=32406
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/download_unittest.py:
+ * Scripts/modules/mock_bugzillatool.py:
+
+2009-12-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Kill LandingSequence
+ https://bugs.webkit.org/show_bug.cgi?id=32464
+
+ Removes LandingSequence in favor of StepSequence. This required
+ changing the Step API slightly to carry a general notion of state
+ instead of carrying patches specifically.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/landingsequence.py: Removed.
+ * Scripts/modules/stepsequence.py:
+
+2009-12-14 Robert Hogan <robert@roberthogan.net>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Fix https://bugs.webkit.org/show_bug.cgi?id=32437
+
+ Amend the behaviour of DRT::notifyDone to dump only when
+ the page has finished loading.
+
+ This fix permits removal of the following tests from the Qt skipped list:
+ fast/forms/textarea-linewrap-dynamic.html
+ fast/forms/textarea-setvalue-submit.html
+ fast/forms/textarea-hard-linewrap-empty.html
+ fast/forms/submit-to-url-fragment.html
+ http/tests/misc/percent-sign-in-form-field-name.html
+ http/tests/security/escape-form-data-field-names.html
+
+ However it also requires the following two to be added to the skipped list:
+
+ http/tests/xmlhttprequest/access-control-basic-denied-preflight-cache.html
+ svg/custom/use-instanceRoot-as-event-target.xhtml
+
+ It appears the behaviour of notifyDone was masking problems with these two
+ tests.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::processWork):
+ (LayoutTestController::maybeDump):
+ (LayoutTestController::notifyDone):
+ (LayoutTestController::provisionalLoad):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::resetLoadFinished):
+
+2009-12-14 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] Add support for keyboard modifiers to Qt DRT's EventSender for touch events
+
+ https://bugs.webkit.org/show_bug.cgi?id=32482
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::setTouchModifier):
+ (EventSender::clearTouchPoints):
+ (EventSender::sendTouchEvent):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2009-12-13 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Gavin Barraclaugh.
+
+ Fix minor problem in sunspider-compare-results which left it broken.
+
+ * Scripts/sunspider-compare-results: Declare $parseonly
+
+2009-12-12 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Give command-line sunspider the ability to handle multiple suites and versions
+ https://bugs.webkit.org/show_bug.cgi?id=32477
+
+ * Scripts/run-sunspider: Updated for changes to command-line parameters.
+ * Scripts/sunspider-compare-results: ditto
+
+2009-12-12 Maciej Stachowiak <mjs@apple.com>
+
+ Not reviewed, fixing previous comment.
+
+ Remove accidental change to sunspider-compare-results
+
+ * Scripts/sunspider-compare-results:
+
+2009-12-11 Yael Aharon <yael.aharon@nokia.com>
+
+ Unreviewed build fix for Qt versions < 4.6.
+ Guard every slot individually with #ifdef.
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::addTouchPoint):
+ (EventSender::updateTouchPoint):
+ (EventSender::touchStart):
+ (EventSender::touchMove):
+ (EventSender::touchEnd):
+ (EventSender::clearTouchPoints):
+ (EventSender::releaseTouchPoint):
+ (EventSender::sendTouchEvent):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2009-12-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ CommandsTest.assert_execute_outputs doesn't check stderr
+ https://bugs.webkit.org/show_bug.cgi?id=32352
+
+ Fix assert_execute_outputs to check stderr
+ and then fix all the unit tests which needed to
+ pass stderr output.
+
+ * Scripts/modules/commands/commandtest.py:
+ * Scripts/modules/commands/download_unittest.py:
+ * Scripts/modules/commands/upload_unittest.py:
+
+2009-12-11 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [check-webkit-style] False positive for tst_QWebFrame
+ https://bugs.webkit.org/show_bug.cgi?id=32436
+
+ Add an exception for function names that start with "tst_". These are
+ used by the Qt unit testing framework.
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-12-11 Simon Hausmann <hausmann@webkit.org>, Kim Grönholm <kim.gronholm@nomovok.com>
+
+ Reviewed by Antti Koivisto.
+
+ Added support for creating synthetic touch events with EventSender
+ in Qt's DumpRenderTree.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32114
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::addTouchPoint):
+ (EventSender::updateTouchPoint):
+ (EventSender::touchStart):
+ (EventSender::touchMove):
+ (EventSender::touchEnd):
+ (EventSender::clearTouchPoints):
+ (EventSender::releaseTouchPoint):
+ (EventSender::sendTouchEvent):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2009-12-11 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ The values of RuntimeArray are not enumerable
+ https://bugs.webkit.org/show_bug.cgi?id=29005
+
+ * DumpRenderTree/mac/ObjCController.m:
+ (+[ObjCController isSelectorExcludedFromWebScript:]):
+ (+[ObjCController webScriptNameForSelector:]):
+ (-[ObjCController arrayOfString]):
+
+2009-12-10 Eric Seidel <eric@webkit.org>
+
+ No review, just updating unit tests to match recent checkins.
+
+ * Scripts/modules/mock_bugzillatool.py:
+ - Add missing red_core_builders_names method causing exception.
+ * Scripts/modules/workqueue_unittest.py:
+ - processutils is dead, use executive.py instead.
+
+2009-12-10 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Move run_command onto Executive to make code which uses run_command testable
+ https://bugs.webkit.org/show_bug.cgi?id=32396
+
+ * Scripts/modules/executive.py:
+ - Move run_command and error handlers onto Executive.
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+
+2009-12-09 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool needs a command to list patches needing cq+
+ https://bugs.webkit.org/show_bug.cgi?id=32351
+
+ * Scripts/modules/bugzilla.py:
+ - Parse attacher_email from attachment xml.
+ * Scripts/modules/bugzilla_unittest.py:
+ - Test new attacher_email parsing.
+ * Scripts/modules/commands/queries.py:
+ - Add PatchesToCommitQueue
+ * Scripts/modules/commands/queries_unittest.py:
+ - Tests for PatchesToCommitQueue
+ * Scripts/modules/mock_bugzillatool.py:
+ - Add necessary mock methods for running PatchesToCommitQueue
+
+2009-12-10 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Turns out every StepSequence command needs a --quiet
+ option.
+
+ * Scripts/modules/stepsequence.py:
+
+2009-12-10 Eric Z. Ayers <zundel@google.com>
+
+ Reviewed by Pavel Feldman.
+
+ Implements displayWebView() to force an invalidation and repaint.
+ This fixes a problem running the timeline-paint.html unit test.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31729
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (displayWebView):
+
+2009-12-10 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Convert more commands to StepSequences
+ https://bugs.webkit.org/show_bug.cgi?id=32362
+
+ We should eventually convert all the commands, but I'm starting with
+ the easy ones.
+
+ * Scripts/modules/commands/download.py:
+
+2009-12-10 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Jan Alonzo.
+
+ [GTK] editing/selection/shrink-selection-after-shift-pagedown.html failing
+ https://bugs.webkit.org/show_bug.cgi?id=31103
+
+ Give focus to the webviews when we create them, since some tests expect this.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (main):
+
+2009-12-10 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool "builders are red" error should tell you which builders
+ https://bugs.webkit.org/show_bug.cgi?id=32211
+
+ * Scripts/modules/buildsteps.py:
+
+2009-12-09 Marwan Al Jubeh <marwan.aljubeh@gmail.com>
+
+ Reviewed by Adam Roben.
+
+ Fixes: https://bugs.webkit.org/show_bug.cgi?id=31228
+ Set the WebKitOutputDir, WebKitLibrariesDir and Cygwin environment variables automatically
+ in Windows as part of running update_webkit.
+
+ * Scripts/update-webkit:
+ - Run setupAppleWinEnv() on Apple's Windows port.
+ * Scripts/webkitdirs.pm:
+ - Added functions that return the source directory, libraries directory and default build directory on Windows.
+ - Added isWindowsNT() which tests if the current Windows version is from the Windows NT family.
+ - Implemented setupAppleWinEnv() which sets the environment variables WebKitOutputDir, WebKitLibrariesDir
+ and Cygwin to their desired values.
+
+2009-12-09 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ exception thrown when running apply-patches
+ https://bugs.webkit.org/show_bug.cgi?id=32344
+
+ The update step now takes a port option. Once we finish the Steps
+ refactoring, we won't have to worry about this kind of bug again.
+
+ * Scripts/modules/commands/download.py:
+
+2009-12-09 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Fix ScriptError includes. I don't understand why these
+ didn't throw during unit testing...
+
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/logging_unittest.py:
+ * Scripts/modules/workqueue.py:
+
+2009-12-09 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Remove unused PatchCollection class
+ https://bugs.webkit.org/show_bug.cgi?id=32312
+
+ It's dead code.
+
+ * Scripts/modules/patchcollection.py:
+ * Scripts/modules/patchcollection_unittest.py: Removed.
+
+2009-12-09 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix. CheckStyle needs a --no-upate option.
+
+ * Scripts/modules/commands/download.py:
+
+2009-12-09 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Convert Build to use Sequence
+ https://bugs.webkit.org/show_bug.cgi?id=32310
+
+ So much prettier.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/stepsequence.py: Added.
+
+2009-12-09 Adam Barth <abarth@webkit.org>
+
+ Add missing file.
+
+ * Scripts/modules/executive.py: Added.
+
+2009-12-09 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix.
+
+ * Scripts/modules/landingsequence.py:
+
+2009-12-09 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Implement abstract Steps
+ https://bugs.webkit.org/show_bug.cgi?id=32212
+
+ This is a fairly disruptive change that refactors how we build
+ commands. Instead of using a landing sequence, we can now assemble a
+ sequence of steps directly. We still use the landing sequence in the
+ interim, but this will be removed soon.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/early_warning_system.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/commands/queues_unittest.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/mock_bugzillatool.py:
+ * Scripts/modules/processutils.py: Removed.
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+ * Scripts/modules/webkitport.py:
+
+2009-12-08 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ run_command and ScriptError should move into processutils.py
+ https://bugs.webkit.org/show_bug.cgi?id=32305
+
+ Turns out there are a zillion callers to run_command.
+
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/early_warning_system.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/logging_unittest.py:
+ * Scripts/modules/processutils.py:
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+ * Scripts/modules/workqueue.py:
+ * Scripts/modules/workqueue_unittest.py:
+
+2009-12-08 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ [wx] Mac plugins support.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32236
+
+ * wx/browser/wscript:
+
+2009-12-08 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [check-webkit-style] False positive for DEFINE_OPCODE(op_jtrue) {
+ https://bugs.webkit.org/show_bug.cgi?id=32193
+
+ * Scripts/modules/cpp_style.py: For the function { rule, if there is space
+ at the beginning of line, ignore lines which then have a macro.
+ * Scripts/modules/cpp_style_unittest.py: Add tests to verify the
+ new behavior.
+
+2009-12-08 Dmitry Titov <dimich@chromium.org>
+
+ Rubber-stamped by David Levin.
+
+ Revert and reopen "Add asserts to RefCounted to make sure ref/deref happens on the right thread."
+ It may have caused massive increase of reported leaks on the bots.
+ https://bugs.webkit.org/show_bug.cgi?id=31639
+
+ * DumpRenderTree/ForwardingHeaders/wtf/ThreadVerifier.h: Removed.
+
+2009-12-08 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Add asserts to RefCounted to make sure ref/deref happens on the right thread.
+ https://bugs.webkit.org/show_bug.cgi?id=31639
+
+ * DumpRenderTree/ForwardingHeaders/wtf/ThreadVerifier.h: Added.
+
+2009-12-08 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [check-webkit-style] False positive for camel case of JSC op codes
+ https://bugs.webkit.org/show_bug.cgi?id=32192
+
+ * Scripts/modules/cpp_style.py: Added an exception for the JSC op
+ code functions and const_iterator as well since I noticed a false
+ positive there when testing the fix.
+ * Scripts/modules/cpp_style_unittest.py: Added tests for these
+ changes.
+
+2009-12-08 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Turn on (SVG) Filters for Win.
+ https://bugs.webkit.org/show_bug.cgi?id=32224
+
+ * Scripts/webkitdirs.pm:
+
+2009-12-08 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Turn on (SVG) Filters for Gtk.
+ https://bugs.webkit.org/show_bug.cgi?id=32224
+
+ * Scripts/build-webkit:
+
+2009-12-07 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ [check-webkit-style] S_OK is a fine identifier
+ https://bugs.webkit.org/show_bug.cgi?id=32225
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-12-07 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Turn on (SVG) Filters for Qt.
+ https://bugs.webkit.org/show_bug.cgi?id=32224
+
+ * Scripts/build-webkit:
+
+2009-12-07 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Make run-webkit-websocketserver log to stderr rather than to a file.
+ https://bugs.webkit.org/show_bug.cgi?id=32234
+
+ * Scripts/run-webkit-websocketserver:
+
+2009-12-07 Dmitry Titov <dimich@chromium.org>
+
+ Rubber-stamped by Darin Adler.
+
+ Remove ENABLE_SHARED_SCRIPT flags
+ https://bugs.webkit.org/show_bug.cgi?id=32245
+ This patch was obtained by "git revert" command and then un-reverting of ChangeLog files.
+
+ * Scripts/build-webkit:
+
+2009-12-07 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/7450481> One compositing test keeps DRT in "compositing mode", breaks repaint tests
+
+ The counter that WebView used to keep track of the number of enclosed WebHTMLViews using
+ accelerated compositing was hard to manage, and maintained incorrectly in a number of cases.
+ This caused one compositing test make DumpRenderTree think that all subsequent tests
+ were compositing too.
+
+ Replace this counter with notifications, which are only fired if a client (DRT) requests them. The
+ notification informs the client that a WebHTMLView entered compositing mode (or an already-
+ compositing WebHTML was added); it does not say when a view becomes uncomposited, or all
+ compositing subviews were removed, since this is tricky to get right.
+
+ DumpRenderTreeWindow listens for this notification, and uses it to turn on window
+ autodisplay, which is necessary to kick-start Core Animation rendering and animations.
+ We ensure that window autodisplay is turned off before every test.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (createWebViewAndOffscreenWindow):
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/mac/DumpRenderTreeWindow.h:
+ * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+ (-[DumpRenderTreeWindow close]):
+ (-[DumpRenderTreeWindow startListeningForAcceleratedCompositingChanges]):
+ (-[DumpRenderTreeWindow webViewStartedAcceleratedCompositing:]):
+
+2009-12-07 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Holger Hans Peter Freyther.
+
+ Turn on (SVG) Filters support, by default.
+ https://bugs.webkit.org/show_bug.cgi?id=32224
+
+ For now only enable FILTERS build flag on WebKit/mac. Other platforms will follow soon.
+
+ * Scripts/build-webkit:
+
+2009-12-07 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Chromium buildbots are not red when they fail
+ https://bugs.webkit.org/show_bug.cgi?id=32235
+
+ * Scripts/build-webkit:
+
+2009-12-07 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Typo in chromium linux builder
+ https://bugs.webkit.org/show_bug.cgi?id=32238
+
+ * Scripts/webkitdirs.pm:
+
+2009-12-07 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ fixes to build-webkit --chromium
+ https://bugs.webkit.org/show_bug.cgi?id=32179
+
+ * Scripts/webkitdirs.pm:
+
+2009-12-07 Eric Seidel <eric@webkit.org>
+
+ No review, just adding two recently approved committers.
+
+ * Scripts/modules/committers.py:
+
+2009-12-07 Alexey Proskuryakov <ap@apple.com>
+
+ * Scripts/run-webkit-websocketserver: Added property svn:executable.
+
+2009-12-07 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Add run-webkit-websocketserver
+
+ https://bugs.webkit.org/show_bug.cgi?id=31390
+
+ * Scripts/run-webkit-websocketserver: Added.
+
+2009-12-07 Steve Falkenburg <sfalken@apple.com>
+
+ Build fix. Be flexible about which version of ICU is used on Windows.
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Add optional xcopy commands to copy ICU 4.2.
+
+2009-12-07 Dirk Schulze <krit@webkit.org>
+
+ Not reviewed, adding myself to the reviewers list.
+
+ * Scripts/modules/committers.py:
+
+2009-12-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add an API for uploading results files to StatusBot
+ https://bugs.webkit.org/show_bug.cgi?id=32210
+
+ Add Content-Type: plain/text which was forgotten
+ from the previous commit when I landed with land-patches
+ instead of land-diff.
+
+ * QueueStatusServer/queue_status.py:
+
+2009-12-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Status Server needs a way to handle uploaded results
+ https://bugs.webkit.org/show_bug.cgi?id=32209
+
+ * QueueStatusServer/queue_status.py: Add a ShowResults (results/*) command
+ * QueueStatusServer/update_status.html: Add file upload.
+
+2009-12-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add an API for uploading results files to StatusBot
+ https://bugs.webkit.org/show_bug.cgi?id=32210
+
+ * Scripts/modules/statusbot.py:
+
+2009-12-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Status Server needs a way to handle uploaded results
+ https://bugs.webkit.org/show_bug.cgi?id=32209
+
+ * QueueStatusServer/queue_status.py: Add a ShowResults (results/*) command
+ * QueueStatusServer/update_status.html: Add file upload.
+
+2009-12-06 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] BuildAttachment should not check the builders
+ https://bugs.webkit.org/show_bug.cgi?id=32207
+
+ This is code that got copied here by accident when the class was created.
+
+ * Scripts/modules/commands/download.py:
+
+2009-12-06 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Make LandingSequence.update aware of ports
+ https://bugs.webkit.org/show_bug.cgi?id=32208
+
+ This is required to make build work on the Chromium port because
+ Chromium has a custom update-webkit.
+
+ * Scripts/modules/landingsequence.py:
+
+2009-12-06 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add early warning system commands to bugzilla-tool.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/webkitport.py:
+
+2009-12-06 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Implement Qt EarlyWarningSystem and Chromium EarlyWarningSystem
+ https://bugs.webkit.org/show_bug.cgi?id=32205
+
+ * Scripts/modules/commands/early_warning_system.py: Added.
+ * Scripts/modules/commands/queues.py:
+
+2009-12-06 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ REGRESSION (r51728): update-webkit fails when the current directory is
+ not inside a Subversion working copy
+ https://bugs.webkit.org/show_bug.cgi?id=32204
+
+ * Scripts/update-webkit: Invoke isSVN() in the correct working
+ directory.
+
+2009-12-06 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Rename AbstractTryQueue to AbstractReviewQueue
+ https://bugs.webkit.org/show_bug.cgi?id=32202
+
+ * Scripts/modules/commands/queues.py:
+
+2009-12-05 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Implement ChromiumPort
+ https://bugs.webkit.org/show_bug.cgi?id=32182
+
+ * Scripts/modules/webkitport.py:
+ * Scripts/modules/webkitport_unittest.py:
+
+2009-12-05 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move update-webkit into BuildSteps
+ https://bugs.webkit.org/show_bug.cgi?id=32181
+
+ We need to move update-webkit out of SCM.py because SCM isn't supposed to know
+ that WebKit exists. The proper place for the knowledge of the existence of
+ update-webkit is in WebKitPort because some ports have specialized update
+ scripts (analogous to build-webkit).
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/scm.py:
+ * Scripts/modules/webkitport.py:
+
+2009-12-05 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ update-webkit should call git svn rebase and resolve-ChangeLogs -f
+ https://bugs.webkit.org/show_bug.cgi?id=27162
+
+ Teach update-webkit about Git. I didn't add the call to
+ resolve-ChangeLogs -f because sometimes that script goes bananas. We
+ can iterate from here, however.
+
+ * Scripts/update-webkit:
+
+2009-12-04 Yael Aharon <yael.aharon@nokia.com>
+
+ Unreviewed build fix.
+
+ [Qt] build fix after r51634 removed unused QBoxLayout include which included limits.h.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+
+2009-12-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Add some missing methods for showing and hiding the
+ Web Inspector.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::~WebPage):
+ (WebCore::WebPage::webInspector):
+ * DumpRenderTree/qt/DumpRenderTree.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::hideWebInspector):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2009-12-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Implement the setAllowUniversalAccessFromFileURLs method
+ for the Qt LayoutTestController.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2009-12-04 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION: AX: buttons now extremely repetitive
+ https://bugs.webkit.org/show_bug.cgi?id=32164
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (isAttributeSupportedCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isAttributeSupported):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isAttributeSupported):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isAttributeSupported):
+
+2009-12-03 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ check-webkit-style should check for camelCase variable names
+ https://bugs.webkit.org/show_bug.cgi?id=32051
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-12-03 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ AX: VO just says "term" on many web sites
+ https://bugs.webkit.org/show_bug.cgi?id=32139
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getRoleDescriptionCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::roleDescription):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::roleDescription):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::roleDescription):
+
+2009-12-03 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ Implement WAI-ARIA scrollbar role and related property aria-orientation
+ https://bugs.webkit.org/show_bug.cgi?id=32126
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getOrientationCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::orientation):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::orientation):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::orientation):
+
+2009-12-03 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Minor correction to r51663.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (addQTDirToPATH):
+ GetEnvironmentVariable -> GetEnvironmentVariableW.
+
+2009-12-03 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Adam Roben.
+
+ ~96 regression tests fail when using QuickTime 7.6 (they pass with QuickTime 7.3)
+ https://bugs.webkit.org/show_bug.cgi?id=30256
+
+ Add the QuickTime dll directory to the PATH environment variable so
+ inialization can succeed.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (addQTDirToPATH):
+ (initialize):
+
+2009-12-03 Shu Chang <Chang.Shu@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] After revision 32643, sender() is of type QWebPage instead of QWebFrame.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::maybeDump):
+
+2009-12-03 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Update pywebsocket to 0.4.3
+ This version logs friendlier and higher-level messages in WARN level, which is used for LayoutTests.
+ Stack trace is logged now in INFO level.
+ https://bugs.webkit.org/show_bug.cgi?id=32097
+
+ * pywebsocket/mod_pywebsocket/dispatch.py:
+ * pywebsocket/mod_pywebsocket/msgutil.py:
+ * pywebsocket/mod_pywebsocket/standalone.py:
+ * pywebsocket/mod_pywebsocket/util.py:
+ * pywebsocket/setup.py:
+ * pywebsocket/test/test_dispatch.py:
+ * pywebsocket/test/test_util.py:
+
+2009-12-03 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Gavin Barraclough.
+
+ Fix JSClassRef leak.
+
+ * DumpRenderTree/AccessibilityController.cpp:
+ (AccessibilityController::makeWindowObject):
+ * DumpRenderTree/GCController.cpp:
+ (GCController::makeWindowObject):
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::makeWindowObject):
+
+2009-12-03 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <rdar://problem/7214236> and http://webkit.org/b/32052 - Implement HTML5 state object history API
+
+ Keep DRT-win building...
+
+ * DumpRenderTree/win/FrameLoadDelegate.h:
+ (FrameLoadDelegate::didPushStateWithinPageForFrame):
+ (FrameLoadDelegate::didReplaceStateWithinPageForFrame):
+ (FrameLoadDelegate::didPopStateWithinPageForFrame):
+
+2009-12-03 Andras Becsi <abecsi@inf.u-szeged.hu>
+
+ Unreviewed build fix.
+
+ [Qt] ARM-Linux build fix after r51634 removed unused QBoxLayout include which included limits.h on ARM.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+
+2009-12-03 Andras Becsi <abecsi@inf.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Refactor DRT to not crash on tests which open child windows from javascript.
+ Prevent DRT from showing the main view if these childs get deleted.
+ This fixes https://bugs.webkit.org/show_bug.cgi?id=31591.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::~DumpRenderTree):
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ (WebCore::DumpRenderTree::open):
+ (WebCore::DumpRenderTree::closeRemainingWindows):
+ (WebCore::DumpRenderTree::createWindow):
+ (WebCore::DumpRenderTree::windowCount):
+ * DumpRenderTree/qt/DumpRenderTree.h:
+
+2009-12-02 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION(51595): commit-queue is throwing exceptions
+ https://bugs.webkit.org/show_bug.cgi?id=32083
+
+ * Scripts/modules/commands/queues.py:
+ - Don't use default value of [] as it ends up getting shared.
+ - Make log_progress accept arrays of ints as well as strings.
+ - Return an exit code from execute()
+ * Scripts/modules/commands/queues_unittest.py: Added.
+ - Test to make sure log_progress will accept ints.
+ - Test to make sure run_bugzilla_tool will accept ints.
+ * Scripts/modules/workqueue.py:
+ - Print the stack trace on unexpected exceptions for easier debugging.
+ * Scripts/run-webkit-unittests:
+ - Add queues_unittest.
+
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/commands/queues_unittest.py: Copied from WebKitTools/Scripts/modules/commands/commandtest.py.
+ * Scripts/modules/mock_bugzillatool.py:
+ * Scripts/modules/workqueue.py:
+ * Scripts/run-webkit-unittests:
+
+2009-12-02 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ check-webkit-style is too noisy about namespace indenting issues.
+ https://bugs.webkit.org/show_bug.cgi?id=32096
+
+ * Scripts/modules/cpp_style.py:
+ Added a _FileState object to be able to track file level information. In this
+ case, it simply tracks whether the error has already been given, so that it isn't
+ done again.
+ * Scripts/modules/cpp_style_unittest.py:
+ Modified test cases to pass in the _FileState object and fix a test that expected
+ to see the namespace error twice (now it only occurs once). No new tests because
+ existing tests cover the change in functionality.
+
+2009-12-01 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Eric Seidel.
+
+ [wx] Get DumpRenderTree building after waf switch.
+
+ https://bugs.webkit.org/show_bug.cgi?id=32041
+
+ * DumpRenderTree/wscript: Added.
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setTimelineProfilingEnabled):
+ (LayoutTestController::evaluateScriptInIsolatedWorld):
+ (LayoutTestController::disableImageLoading):
+ (LayoutTestController::whiteListAccessFromOrigin):
+ (LayoutTestController::counterValueForElementById):
+ * Scripts/build-webkit:
+
+2009-12-02 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] build-attachment shouldn't check whether the builders are red
+ https://bugs.webkit.org/show_bug.cgi?id=32062
+
+ build-attachment doesn't touch the remote repository, so there isn't a
+ need to hold off when the builders are red.
+
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/landingsequence.py:
+
+2009-12-02 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION(51590): style-queue and build-queue think their empty when they are not
+ https://bugs.webkit.org/show_bug.cgi?id=32061
+
+ * Scripts/modules/bugzilla.py: make all id lookups return ints instead of strings.
+ * Scripts/modules/bugzilla_unittest.py: Add and update unit tests to use ints.
+
+2009-12-02 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ build-queue is throwing exceptions and complaining about
+ lack of --no-update on build-attachment. Make it stop.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+
+2009-12-02 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix. Forgot to declare my variables. :(
+
+ * QueueStatusServer/queue_status.py:
+
+2009-12-02 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Implement status bubble view
+ https://bugs.webkit.org/show_bug.cgi?id=32057
+
+ The status bubble is a compact representation of the queue status for a
+ given patch. This will eventually help us reduce the comment spam from
+ the queues.
+
+ * QueueStatusServer/index.html: Added HTML5 doctype for sanity.
+ * QueueStatusServer/queue_status.py:
+ * QueueStatusServer/status_bubble.html: Added.
+
+2009-12-02 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ trim commands/*.py includes now that commands are unit tested
+ https://bugs.webkit.org/show_bug.cgi?id=32056
+
+ In the course of ensuring that the unit tests still
+ passed after this change, I had to actually make them
+ pass in the first place.
+
+ * Scripts/modules/bugzilla.py:
+ - Fix _parse_attachment_ids_request_query to return ints instead of strings.
+ * Scripts/modules/commands/download.py: Remove unneeded imports.
+ * Scripts/modules/commands/queries.py: Ditto.
+ * Scripts/modules/commands/queues.py: Ditto.
+ * Scripts/modules/commands/upload.py: Ditto.
+ * Scripts/modules/scm_unittest.py:
+ - Fix to expect the \n after the path since echo adds an \n.
+
+2009-12-01 Yaar Schnitman <yaar@chromium.org>
+
+ build-webkit: Remove flex,bison,gperf check for chromium
+ https://bugs.webkit.org/show_bug.cgi?id=32043
+
+ * Scripts/webkitdirs.pm:
+
+2009-12-01 Chris Fleizach <cfleizach@apple.com>
+
+ Build fixage for Windows/GTK for DumpRenderTree.
+
+ WAI-ARIA: implement support for ARIA drag and drop
+ https://bugs.webkit.org/show_bug.cgi?id=32007
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::ariaIsGrabbed):
+ (AccessibilityUIElement::ariaDropEffects):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::ariaIsGrabbed):
+ (AccessibilityUIElement::ariaDropEffects):
+
+2009-12-01 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ WAI-ARIA: implement support for ARIA drag and drop
+ https://bugs.webkit.org/show_bug.cgi?id=32007
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getARIADropEffectsCallback):
+ (getARIAIsGrabbedCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::ariaIsGrabbed):
+ (AccessibilityUIElement::ariaDropEffects):
+
+2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Not reviewed. GTK DRT try 2.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::sampleSVGAnimationForElementAtTime):
+
+2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Not reviewed. Try to fix gtk DRT build.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+
+2009-12-01 David Levin <levin@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ check-webkit-style does not understand (Prefix)Foo(Custom|Gtk|CG|Mac).cpp including Foo.h
+ https://bugs.webkit.org/show_bug.cgi?id=32033
+
+ * Scripts/modules/cpp_style.py: Changed check for a possible primary header to use find
+ instead of startswith.
+ * Scripts/modules/cpp_style_unittest.py: Added a unit test for the new behavior.
+
+2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Not reviewed. Qt build almost fixed, DumpRenderTree should compile now as well.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.h: Update old function signature.
+
+2009-12-01 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Simon Fraser.
+
+ Add SVG animation test framework with 'snapshot' functionality
+ https://bugs.webkit.org/show_bug.cgi?id=31897
+
+ Add new 'sampleSVGAnimationForElementAtTime' DRT method,
+ used by the new SVG animation testing framework, implemented
+ for qt/gtk/win/mac.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (sampleSVGAnimationForElementAtTimeCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::sampleSVGAnimationForElementAtTime):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::sampleSVGAnimationForElementAtTime):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::sampleSVGAnimationForElementAtTime):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::sampleSVGAnimationForElementAtTime):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::sampleSVGAnimationForElementAtTime):
+
+2009-12-01 Adam Roben <aroben@apple.com>
+
+ Remove user content before running each test on Windows
+
+ Fixes <http://webkit.org/b/31479> Make websocket tests work on Windows
+
+ Reviewed by Alexey Proskuryakov.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting): Remove all user content
+ before each test, which matches Mac.
+
+2009-12-01 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Make pywebsocket log errors to a file
+ https://bugs.webkit.org/show_bug.cgi?id=31604
+
+ * Scripts/run-webkit-tests: Log output to a pywebsocket_log.txt file in results directory
+ (by passing the path to the server via a recently added -l option).
+
+2009-12-01 Adam Roben <aroben@apple.com>
+
+ Fix tests that use the TestNetscapePlugin in Debug_Internal builds
+
+ Reviewed by Ada Chan.
+
+ Fixes <http://webkit.org/b/32027> REGRESSION (r49705): Tests that use
+ TestNetscapePlugin fail in Debug_Internal builds
+
+ * DumpRenderTree/win/DumpRenderTree.cpp: Use the "_Debug" plugin
+ directory in Debug and Debug_All builds, but not in Debug_Internal
+ builds.
+
+2009-12-01 Adam Roben <aroben@apple.com>
+
+ Re-enable DRT's watchdog timer on Windows
+
+ It was accidentally disabled in r50907.
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setWaitToDump): Remove a "false &&" that snuck
+ into an if condition.
+
+2009-12-01 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ check-webkit-style complains about #imports with / in them
+ https://bugs.webkit.org/show_bug.cgi?id=32022
+
+ We need to exclude #import directives in addition to #include from the
+ binary operator whitespace checks.
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-11-30 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ check-webkit-style is slightly too verbose
+ https://bugs.webkit.org/show_bug.cgi?id=32010
+
+ check-webkit-style prints out a bunch of "done" lines that seem redundant,
+ especially for the style-queue.
+
+ * Scripts/modules/cpp_style.py:
+
+2009-11-30 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Eric Seidel.
+
+ [GTK] Moved the functions that are closing the result log of the
+ tests to the last line of the runTest function, this avoids
+ reporting crashes in the wrong test if there is a problem when
+ reseting the state after the test.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (dump):
+ (runTest):
+
+2009-11-30 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Geoffrey Garen.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=31286
+ fast/js/date-proto-generic-invocation breaks another test
+
+ Don't cache JSClassRefs, a change to the prototype chain will
+ last between tests.
+
+ * DumpRenderTree/AccessibilityController.cpp:
+ (AccessibilityController::getJSClass):
+ * DumpRenderTree/GCController.cpp:
+ (GCController::getJSClass):
+ * DumpRenderTree/GCController.h:
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::getJSClass):
+
+2009-11-30 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Update pywebsocket to 0.4.2.1.
+ This is to fix a bug that some messages are logged to stderr even when the log file is specified.
+ https://bugs.webkit.org/show_bug.cgi?id=31976
+
+ * pywebsocket/mod_pywebsocket/standalone.py:
+ * pywebsocket/setup.py:
+
+2009-11-30 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Generate pass messages for style-queue
+ https://bugs.webkit.org/show_bug.cgi?id=31995
+
+ With this change, the style-queue posts "pass" messages to bugs as
+ well. Also, added more information to the state store w.r.t. passing
+ and failing.
+
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/patchcollection.py:
+
+2009-11-30 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Simon Fraser.
+
+ Check for WEBKIT_TESTFONTS environment variable in
+ run-webkit-tests, for GTK+, to have a more prominent error
+ message.
+
+ * Scripts/run-webkit-tests:
+
+2009-11-30 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ update-webkit --chromium forces gclient sync
+
+ https://bugs.webkit.org/show_bug.cgi?id=31967
+
+ * Scripts/update-webkit-chromium:
+
+2009-11-29 Eric Seidel <eric@webkit.org>
+
+ Add Erik Arvidsson to committers.py since by r51326 he clear has commit rights.
+
+ * Scripts/modules/committers.py:
+
+2009-11-29 Eric Seidel <eric@webkit.org>
+
+ No review, just adding missing svn property.
+
+ Set svn:executable property on new scripts.
+ These were added by commit-queue commits, but the executable
+ property was lost due to a bug in svn-apply:
+ https://bugs.webkit.org/show_bug.cgi?id=27204
+
+ * Scripts/update-webkit-chromium: Added property svn:executable.
+ * Scripts/validate-committer-lists: Added property svn:executable.
+
+2009-11-29 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Need a way to validate that committers.py includes all committers/reviewers
+ https://bugs.webkit.org/show_bug.cgi?id=30970
+
+ Add a script which knows how to compare our public committer/reviewer
+ lists and show discrepancies between them.
+
+ Validates mailing lists vs. committers.py:
+ - committers.py committers missing from webkit-committers@lists
+ - webkit-committers@lists members missing from committers.py
+ - committers.py reviewers missing from webkit-reviewers@lists
+ - webkit-reviewers@lists members missing from committers.py
+ - webkit-reviewers@lists members missing from committers.py reviewer list
+
+ Validates committers.py vs. trunk/ SVN history:
+ - committers who have not committed in over a year
+ - SVN committers missing from committers.py
+ - committers.py members who have no record in SVN.
+
+ All of these lists still show "false positives" until a few more committers.py updates are made, like:
+ https://bugs.webkit.org/show_bug.cgi?id=31366
+
+ * Scripts/validate-committer-lists: Added.
+
+2009-11-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] style-queue sends ~100 requests to QueueStatusServer every 5 minutes
+ https://bugs.webkit.org/show_bug.cgi?id=31950
+
+ Now we cache the last status that we get back from QueueStatusServer.
+ Eventually we'll have to do something more fancy if we want to support
+ a "try again" button on QueueStatusServer, but we can cross that bridge
+ when we come to it.
+
+ * Scripts/modules/patchcollection.py:
+
+2009-11-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ StyleQueue scans ~100 bug pages every 5 minutes
+ https://bugs.webkit.org/show_bug.cgi?id=31947
+
+ Instead of getting the pending-review attachment ids by scanning each
+ bug (which results in a network request), we should just get them all
+ from webkit.org/pending-review in one shot.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/bugzilla_unittest.py:
+ * Scripts/modules/commands/queries.py:
+ * Scripts/modules/commands/queries_unittest.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/mock_bugzillatool.py:
+ * Scripts/modules/patchcollection.py:
+
+2009-11-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] CC webkit-bot-watchers whenever the bots touch bugs
+ https://bugs.webkit.org/show_bug.cgi?id=31952
+
+ The mailing list is open for anyone to subscribe.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/commands/queues.py:
+
+2009-11-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] style-queue should report style errors to bugzilla
+ https://bugs.webkit.org/show_bug.cgi?id=31945
+
+ Currently, we're just logging the style errors locally. With this
+ patch we'll actually log the errors to bugzilla. Note: I plan to run
+ with the "local-only" logging during development.
+
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/scm.py:
+
+2009-11-28 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] style-queue shouldn't reject patches from the commit-queue
+ https://bugs.webkit.org/show_bug.cgi?id=31944
+
+ Currently the style-queue subprocess gets confused and thinks its the
+ commit-queue. If the patch has an error, it rejects it from the
+ commit-queue. Instead, we should have style-queue specific logic.
+ This patch doesn't add that logic, but it gives us a callback we can
+ use to add that logic.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/landingsequence.py:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ Rename CommitQueueStatus to QueueStatusServer to allow for more queues.
+
+ * CommitQueueStatus: Removed.
+ * CommitQueueStatus/app.yaml: Removed.
+ * CommitQueueStatus/filters: Removed.
+ * CommitQueueStatus/filters/__init__.py: Removed.
+ * CommitQueueStatus/filters/webkit_extras.py: Removed.
+ * CommitQueueStatus/index.html: Removed.
+ * CommitQueueStatus/index.yaml: Removed.
+ * CommitQueueStatus/queue_status.py: Removed.
+ * CommitQueueStatus/stylesheets: Removed.
+ * CommitQueueStatus/stylesheets/main.css: Removed.
+ * CommitQueueStatus/update_status.html: Removed.
+ * QueueStatusServer: Copied from WebKitTools/CommitQueueStatus.
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ style-queue should only process each patch once
+ https://bugs.webkit.org/show_bug.cgi?id=31939
+
+ Actually address reviewer comments!
+
+ * Scripts/bugzilla-tool:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] style-queue fails to apply a bunch of patches for no reason
+ https://bugs.webkit.org/show_bug.cgi?id=31942
+
+ By passing --non-interactive to check-style, we convince check-style
+ to pass --force to svn-apply, which lets it apply more patches.
+
+ * Scripts/modules/commands/queues.py:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Support --status-host in style-queue
+ https://bugs.webkit.org/show_bug.cgi?id=31941
+
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/statusbot.py:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ style-queue should only process each patch once
+ https://bugs.webkit.org/show_bug.cgi?id=31939
+
+ Before processing a patch, the try-queues now ask the web service
+ whether they have already processed the patch. This is an initial cut
+ of this functionality. I expect we're make it richer over time.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/commands/queues.py:
+ * Scripts/modules/patchcollection.py:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ PatchStatus does not return status
+ https://bugs.webkit.org/show_bug.cgi?id=31938
+
+ We need to parse attachment_id as an int. Otherwise, we can't find
+ anything in the datastore.
+
+ * CommitQueueStatus/queue_status.py:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Make commit-queue status not throw an exception where there is not
+ status
+ https://bugs.webkit.org/show_bug.cgi?id=31936
+
+ We need to actually fetch the results of the query to see what's in the
+ datastore.
+
+ * CommitQueueStatus/queue_status.py:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] unit test ApplyPatches and ApplyAttachment
+ https://bugs.webkit.org/show_bug.cgi?id=31935
+
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/download_unittest.py:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Unit test download commands
+ https://bugs.webkit.org/show_bug.cgi?id=31923
+
+ Adds download_unittest and fixes a bug found while testing.
+
+ * Scripts/modules/commands/commandtest.py:
+ * Scripts/modules/commands/download.py:
+ Fixed a bug where we'd throw an error because [].append returns
+ None.
+ * Scripts/modules/commands/download_unittest.py: Added.
+ * Scripts/modules/mock_bugzillatool.py:
+ * Scripts/run-webkit-unittests:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix found while writing unit tests.
+
+ * Scripts/modules/commands/download.py:
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Kill WebKitLandingScripts
+ https://bugs.webkit.org/show_bug.cgi?id=31904
+
+ Step 6: Kill the rest.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/commands/queries.py:
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/scm.py:
+ * Scripts/modules/webkitlandingscripts.py: Removed.
+
+2009-11-27 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Unit test upload commands
+ https://bugs.webkit.org/show_bug.cgi?id=31903
+
+ Adds unit tests for all but two of the upload commands. The two
+ remaining ones are more difficult. I'll return to them later. The
+ goal of these tests is just to run the commands. We can test more
+ detailed behavior later.
+
+ * Scripts/modules/commands/commandtest.py:
+ * Scripts/modules/commands/upload.py:
+ * Scripts/modules/commands/upload_unittest.py:
+ * Scripts/modules/mock.py: Added.
+ * Scripts/modules/mock_bugzillatool.py:
+
+2009-11-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Kill WebKitLandingScripts
+ https://bugs.webkit.org/show_bug.cgi?id=31904
+
+ Step 5: Kill run_and_throw_if_fail.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/processutils.py: Added.
+ * Scripts/modules/webkitlandingscripts.py:
+
+2009-11-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Kill WebKitLandingScripts
+ https://bugs.webkit.org/show_bug.cgi?id=31904
+
+ Step 4: Kill run_webkit_script.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/webkitlandingscripts.py:
+
+2009-11-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Kill WebKitLandingScripts
+ https://bugs.webkit.org/show_bug.cgi?id=31904
+
+ Step 3: Kill build_webkit.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/webkitlandingscripts.py:
+
+2009-11-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Kill WebKitLandingScripts
+ https://bugs.webkit.org/show_bug.cgi?id=31904
+
+ Step 2: Kill ensure_builders_are_green.
+
+ * Scripts/modules/buildsteps.py:
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/webkitlandingscripts.py:
+
+2009-11-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [bzt] Kill WebKitLandingScripts
+ https://bugs.webkit.org/show_bug.cgi?id=31904
+
+ Step 1: Kill prepare_clean_working_directory and run_webkit_tests.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/buildsteps.py: Added.
+ * Scripts/modules/commands/download.py:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/webkitlandingscripts.py:
+
+2009-11-26 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Remove directory prefixes from linux commands
+
+ SCM unittests can cause errors on some systems if we use absolute reference to
+ the commands, so directory prefixes have been removed.
+
+ * Scripts/modules/scm_unittest.py:
+
+2009-11-21 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Link DumpRenderTree to the Qt Ui Tools
+ https://bugs.webkit.org/show_bug.cgi?id=31203
+
+ Implement QWebPage::createPlugin using the Qt Ui Tools
+ to be able to create classes like QProgressBar from within
+ the <object></object> tags This is required for the
+ new automatic test of Qt Plugins.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::createPlugin):
+ * DumpRenderTree/qt/DumpRenderTree.h:
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+
+2009-11-25 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Update pywebsocket to 0.4.2
+
+ Update pywebsocket to 0.4.2
+ https://bugs.webkit.org/show_bug.cgi?id=31861
+
+ * pywebsocket/example/echo_client.py:
+ * pywebsocket/example/echo_wsh.py:
+ * pywebsocket/mod_pywebsocket/__init__.py:
+ * pywebsocket/mod_pywebsocket/dispatch.py:
+ * pywebsocket/mod_pywebsocket/msgutil.py:
+ * pywebsocket/mod_pywebsocket/standalone.py:
+ * pywebsocket/setup.py:
+ * pywebsocket/test/test_dispatch.py:
+ * pywebsocket/test/test_msgutil.py:
+
+2009-11-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add unit test for mark-fixed
+ https://bugs.webkit.org/show_bug.cgi?id=31896
+
+ * Scripts/modules/commands/commandtest.py: Added.
+ * Scripts/modules/commands/queries_unittest.py:
+ * Scripts/modules/commands/upload_unittest.py: Added.
+ * Scripts/modules/mock_bugzillatool.py:
+ * Scripts/run-webkit-unittests:
+
+2009-11-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool should have a mark-fixed command
+ https://bugs.webkit.org/show_bug.cgi?id=31853
+
+ Pretty simple stuff.
+
+ * Scripts/modules/commands/upload.py:
+
+2009-11-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ 'bugzilla-tool help' should only show common commands like how 'git help' does
+ https://bugs.webkit.org/show_bug.cgi?id=31772
+
+ I also took this opportunity to make 'help' a real Command.
+ Making 'help' a real command required adding Command.tool (which we've wanted to do for a while).
+
+ * Scripts/bugzilla-tool:
+ - change should_show_command_help to should_show_in_main_help
+ * Scripts/modules/commands/download.py:
+ - Mark commands as being shown in main help or not.
+ - show_in_main_help = False is not required (default is false),
+ but it seemed to make the commands more self-documenting.
+ * Scripts/modules/commands/queries.py: ditto
+ * Scripts/modules/commands/queues.py: ditto
+ * Scripts/modules/commands/upload.py: ditto
+ * Scripts/modules/multicommandtool.py:
+ - Make Command hold a pointer to tool in self.tool. Most Command
+ subclasses do not take advantage of this yet, but it was required
+ for HelpCommand to be able to reach the tool from _help_epilog().
+ - Move MultiCommandTool._standalone_help_for_command to Command.standalone_help
+ - Move MultiCommandTool._help_epilog to Command._help_epilog
+ - Move "help" logic into HelpCommand.execute()
+ - Change should_show_command_help to should_show_in_main_help and add a default implementation.
+ * Scripts/modules/multicommandtool_unittest.py:
+ - Test hiding of Commands in --help, and that all commands are shown in 'help --all-commands'
+
+2009-11-25 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Patch by Mark Rowe.
+
+ The buildbots are failing on Windows because when they were upgraded
+ to 4.0.4, Apple Application Support was not in their path. Add it to
+ the path to fix the buildots.
+
+ * Scripts/webkitdirs.pm:
+
+2009-11-25 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ run-webkit-tests doesn't accept directories/files with --skipped=only parameter
+ https://bugs.webkit.org/show_bug.cgi?id=31799
+
+ * Scripts/run-webkit-tests: Fixed.
+
+2009-11-25 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Change run_command to give back stderr by default
+ https://bugs.webkit.org/show_bug.cgi?id=31734
+
+ Change run_command to give back stderr by default.
+ Set run_commands's 'svn-create-patch' calling to put only the stdout into the patches.
+ Change the related unittest call.
+
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+
+2009-11-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Centralize required argument parsing in Command
+ https://bugs.webkit.org/show_bug.cgi?id=31872
+
+ * Scripts/modules/commands/download.py: remove custom required arg message.
+ * Scripts/modules/commands/upload.py: ditto.
+ * Scripts/modules/multicommandtool.py:
+ - Add _parse_required_arguments.
+ - Pass program name off to OptionParser.
+ - Add name() for access to tool name.
+ - Add check_arguments_and_execute and make it return a return code.
+ - Replace a couple uses of + with %.
+ * Scripts/modules/multicommandtool_unittest.py: test _parse_required_arguments
+
+2009-11-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Abstract out capturing stdout/stderr into a new OutputCapture class for re-use among the various unit tests.
+ https://bugs.webkit.org/show_bug.cgi?id=31870
+
+ * Scripts/modules/commands/queries_unittest.py: Use the new class.
+ * Scripts/modules/multicommandtool_unittest.py: Ditto.
+ * Scripts/modules/outputcapture.py: Added.
+
+2009-11-24 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Add ENABLE_SHARED_SCRIPT feature define and flag for build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=31444
+
+ * Scripts/build-webkit:
+
+2009-11-24 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Changes the way 3D_RENDERING and ACCELERATED_COMPOSITING related tests are excluded
+ https://bugs.webkit.org/show_bug.cgi?id=27314
+
+ Now the script allows the directories with these tests to be included on all
+ platforms but Mac, where they behave the same as always. For all other platforms
+ the tests need to be excluded using the Skipped files, which is currently done
+ for all platforms (including win since we're not turned on yet)
+
+ * Scripts/webkitdirs.pm:
+
+2009-11-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ queries_unittest.py should test command output
+ https://bugs.webkit.org/show_bug.cgi?id=31845
+
+ * Scripts/modules/commands/queries_unittest.py:
+ - Capture stdout and stderr and compare with expected strings.
+
+2009-11-24 Simon Fraser <simon.fraser@apple.com>
+
+ No Review.
+
+ Fix spelling error ("depenedencies").
+
+ * Scripts/build-webkit:
+
+2009-11-24 Mark Rowe <mrowe@apple.com>
+
+ Land the configuration that includes the two debug GTK Linux builders.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2009-11-24 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/31840> bisect-builds broke after r50080
+
+ Reviewed by Dan Bernstein.
+
+ * Scripts/bisect-builds:
+ (mountAndRunNightly): Switched back to using backticks to run
+ the hdiutil command since exec() will terminate the existing
+ script, which is not what we want. Store the output of
+ File::Spec->devnull() in a variable for use in the hdiutil
+ detach commands.
+
+2009-11-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Include "config.h" to meet Coding Style Guidelines
+ https://bugs.webkit.org/show_bug.cgi?id=31792
+
+ * DumpRenderTree/pthreads/JavaScriptThreadingPthreads.cpp:
+ * DumpRenderTree/qt/jsobjects.cpp:
+ * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
+
+2009-11-23 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Oliver Hunt.
+
+ Implement new required function to pass test we used to pass. This
+ change is required since r51294.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+
+2009-11-23 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] DRT: dumpBackForwardList() does not work properly with non-file URLs.
+ https://bugs.webkit.org/show_bug.cgi?id=31775
+
+ LayoutTestController::dumpBackForwardList() should work with local URLs
+ as well as with normal URLs (in http tests for instance).
+ Currently it does not output the latter properly.
+
+ Unskip a bunch of passing http/navigation tests.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::dumpHistoryItem):
+
+2009-11-22 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ ARIA: support aria-flowto
+ https://bugs.webkit.org/show_bug.cgi?id=31762
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (ariaFlowToElementAtIndexCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::ariaFlowToElementAtIndex):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::ariaFlowToElementAtIndex):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::ariaFlowToElementAtIndex):
+
+2009-11-22 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] fast/history/back-forward-reset-after-error-handling.html failing due to WorkQueue not being un-frozen
+ https://bugs.webkit.org/show_bug.cgi?id=31638
+
+ Unfreeze WorkQueue after each test execution.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+
+2009-11-22 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Adam Barth.
+
+ [Qt] DumpRenderTree should explicitly ignore any SSL certificate errors
+ for localhost and 127.0.0.1.
+ https://bugs.webkit.org/show_bug.cgi?id=31783
+
+ Unskip the http/tests/ssl/verify-ssl-enabled.php test, which is passing now.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::NetworkAccessManager::NetworkAccessManager):
+ (WebCore::NetworkAccessManager::sslErrorsEncountered):
+ (WebCore::WebPage::WebPage):
+ * DumpRenderTree/qt/DumpRenderTree.h:
+
+2009-11-22 Chris Evans <cevans@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Disable access to file:/// directory listings
+ https://bugs.webkit.org/show_bug.cgi?id=31329
+
+ Implemented setAllowUniversalAccessFromFileURLs to support testing of
+ file URL security.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setAllowUniversalAccessFromFileURLsCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setAllowUniversalAccessFromFileURLs):
+
+2009-11-22 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix the timeout of fast/frames/frame-navigation.html
+ https://bugs.webkit.org/show_bug.cgi?id=31638
+
+ The test is timeouting, because it uses the WorkQueue to load a document in one
+ of the child frames and once the loading is finished, the DRT does not dump the
+ tree. This is because it waits for the QWebFrame::loadFinished() signal from
+ the main frame, while it should connect to QWebPage::loadFinished().
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+
+2009-11-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool --help spews way too much text
+ https://bugs.webkit.org/show_bug.cgi?id=31771
+
+ * Scripts/bugzilla-tool:
+ - Remove self.cached_scm initialization hack.
+ * Scripts/modules/buildbot.py:
+ - Make default_host accessible to callers.
+ * Scripts/modules/commands/download.py:
+ - Phrase help for all commands consistently and remove spurious help text punctuation.
+ * Scripts/modules/commands/queries.py: Ditto.
+ * Scripts/modules/commands/queues.py: Ditto.
+ * Scripts/modules/commands/upload.py: Ditto.
+ * Scripts/modules/multicommandtool.py:
+ - Add HelpPrintingOptionParser.format_epilog to replace
+ NonWrappingEpilogIndentedHelpFormatter and allow us to lazily initialize
+ per-command help (thus removing the need for the cached_scm hack in BugzillaTool).
+ - Make --help only show a list of commands like "svn help" and "git help" do --
+ previously --help was listing all commands and options.
+ - Sort list of commands alphabetically.
+
+2009-11-21 Eric Seidel <eric@webkit.org>
+
+ No review. Fixing a typo from the previous patch for bug 31767.
+
+ AbstractQueue.run_bugzilla_tool throws an exception
+ https://bugs.webkit.org/show_bug.cgi?id=31769
+
+ * Scripts/modules/commands/queues.py:
+
+2009-11-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue fails to run with "permissions error" due to bad bugzilla-tool path
+ https://bugs.webkit.org/show_bug.cgi?id=31767
+
+ What we really want to test is BugzillaTool.path() instead of TrivialTool.path().
+ Since we don't have a good way to test BugzillaTool pieces, I've
+ left out a test for now.
+
+ * Scripts/bugzilla-tool:
+ - Add a path() implementation to expose bugzilla-tool's __file__ path to commit-queue.
+ * Scripts/modules/commands/queues.py:
+ - Use tool.path() instead of __file__.
+ * Scripts/modules/multicommandtool.py:
+ - Add a new path() method to MultiComandTool.
+ * Scripts/modules/multicommandtool_unittest.py:
+ - Provide a path() method. Little point in testing this mock implementation.
+
+2009-11-21 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix. Turns out I was testing the wrong copy of
+ WebKitTools.
+
+ * Scripts/modules/commands/download.py:
+
+2009-11-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Convert check-style to use LandingSequence
+ https://bugs.webkit.org/show_bug.cgi?id=31763
+
+ Instead of manipulating the working copy by hand, we should use the
+ LandingSequence in CheckStyle. This will make this code eaiser to
+ test.
+
+ * Scripts/modules/commands/download.py:
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Unit test query commands
+ https://bugs.webkit.org/show_bug.cgi?id=31755
+
+ These tests are pretty rough, but hopefully they'll grow.
+
+ * Scripts/modules/commands/queries_unittest.py: Added.
+ * Scripts/modules/mock_bugzillatool.py: Added.
+ * Scripts/run-webkit-unittests:
+
+2009-11-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Fix a bunch of unit test regressions from our recent bugzilla-toll hacking
+ https://bugs.webkit.org/show_bug.cgi?id=31758
+
+ * Scripts/modules/multicommandtool.py:
+ - Allow passing of explicit commands to MultiCommandTool.__init__
+ * Scripts/modules/multicommandtool_unittest.py:
+ - Use new Command.name naming system.
+ - Test Command auto-discovery.
+ * Scripts/modules/workqueue.py:
+ - bug_id no longer exists, use patch['bug_id'] instead.
+ * Scripts/modules/workqueue_unittest.py:
+ - WorkQueues require names now.
+ - should_proceed_with_work_item must return a patch object.
+
+2009-11-20 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ WAI-ARIA: add support for aria-owns
+ https://bugs.webkit.org/show_bug.cgi?id=31702
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (ariaOwnsElementAtIndexCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::ariaOwnsElementAtIndex):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::ariaOwnsElementAtIndex):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::ariaOwnsElementAtIndex):
+
+2009-11-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Fix exception thrown when running the commit-queue.
+
+ * Scripts/modules/statusbot.py: patch is optional.
+ * Scripts/modules/workqueue.py: WorkQUeue requires a name.
+
+2009-11-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Teach the StatusBot how to support more than just the commit-queue
+ https://bugs.webkit.org/show_bug.cgi?id=31754
+
+ * Scripts/modules/workqueue.py: Another typo.
+
+2009-11-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Teach the StatusBot how to support more than just the commit-queue
+ https://bugs.webkit.org/show_bug.cgi?id=31754
+
+ * Scripts/modules/commands/queues.py: Fix silly typo.
+
+2009-11-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Teach the StatusBot how to support more than just the commit-queue
+ https://bugs.webkit.org/show_bug.cgi?id=31754
+
+ * CommitQueueStatus/index.yaml:
+ - Add indices required for the new queries.
+ * CommitQueueStatus/queue_status.py:
+ - Add a patch-status page and move update_status to update-status.
+ - Only display "commit-queue" status records for the commit-queue.
+ - Add support for a queue_name property on status records.
+ - Fix _int_from_request to actually work.
+ * CommitQueueStatus/update_status.html:
+ - Add support for a queue_name on status records.
+ - Remove unused list of bug ids.
+ * Scripts/modules/commands/queues.py
+ - Make the queues pass the patch instead of the bug_id to StatusBot.
+ * Scripts/modules/statusbot.py:
+ - Support passing the queue_name to the status updates.
+ - Support fetching patch status with patch_status().
+ * Scripts/modules/workqueue.py:
+ - Pass the patch to the StatusBot instead of the bug_id.
+ - Let WorkQueues have a name.
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move bugzilla-tool commands into their own file
+ https://bugs.webkit.org/show_bug.cgi?id=31752
+
+ This will let us write unit tests.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/commands/__init__.py: Added.
+ * Scripts/modules/commands/download.py: Added.
+ * Scripts/modules/commands/queries.py: Added.
+ * Scripts/modules/commands/queues.py: Added.
+ * Scripts/modules/commands/upload.py: Added.
+ * Scripts/modules/grammar.py: Added.
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ BuildQueue should check if the tree is currently buildable
+ https://bugs.webkit.org/show_bug.cgi?id=31744
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/webkitlandingscripts.py:
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move prepare_clean_working_directory into the LandingSequence
+ https://bugs.webkit.org/show_bug.cgi?id=31743
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/landingsequence.py:
+
+2009-11-20 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ NPN_ReloadPlugins does not reload the page even if reloadPages is true.
+ https://bugs.webkit.org/show_bug.cgi?id=30460
+
+ Added code for calling NPN_ReloadPlugins with reloadPages true and false.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginInvoke):
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Pass the port information to the child process
+ https://bugs.webkit.org/show_bug.cgi?id=31736
+
+ We need to do this so the child process knows what to build!
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/webkitport.py:
+ * Scripts/modules/webkitport_unittest.py:
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Support Qt port in build-queue
+ https://bugs.webkit.org/show_bug.cgi?id=31733
+
+ * Scripts/bugzilla-tool:
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement a build-queue
+ https://bugs.webkit.org/show_bug.cgi?id=31725
+
+ Currently this just builds the first 10 patches in the review queue.
+ We'll want to do something smarter soon.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Make commit-queue and style-queue show up in help
+ https://bugs.webkit.org/show_bug.cgi?id=31724
+
+ We need to store their names on their class to make these commands
+ properly register themselves with MultiCommandTool.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement bugzilla-tool build-attachment
+ https://bugs.webkit.org/show_bug.cgi?id=31722
+
+ This command builds an attachment from bugzilla. It leaves the built
+ patch in the working copy.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/landingsequence.py:
+ * Scripts/modules/webkitlandingscripts.py:
+
+2009-11-20 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] DRT release event does not create the state correctly
+ https://bugs.webkit.org/show_bug.cgi?id=31717
+
+ * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+
+2009-11-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ MultiCommandTool should find Command objects automatically instead of with a manual list
+ https://bugs.webkit.org/show_bug.cgi?id=31710
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/multicommandtool.py:
+ - Use some wild python-fu to crawl all the known subclasses of Command.
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix. Added missing import.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Unreviewed "build" fix. I failed to update LandingSequence.test
+ properly.
+
+ * Scripts/modules/landingsequence.py:
+
+2009-11-20 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Create LandingSequence as the all-sing, all-dance landing class
+ https://bugs.webkit.org/show_bug.cgi?id=31709
+
+ Client can inherit from this class to carefully control exactly which
+ steps they wish to have happen in the landing sequence.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/landingsequence.py: Added.
+ * Scripts/modules/webkitlandingscripts.py: Added.
+
+2009-11-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Abstract AbstractPatchProcessingCommand from AbstractPatchLandingCommand
+ https://bugs.webkit.org/show_bug.cgi?id=31707
+
+ This is to help when we implement build-attachment.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Support Qt port in bugzilla-tool
+ https://bugs.webkit.org/show_bug.cgi?id=31701
+
+ Now we support building with Qt!
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/webkitport.py: Added.
+ * Scripts/modules/webkitport_unittest.py: Added.
+ * Scripts/run-webkit-unittests:
+
+2009-11-19 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Remove inserting stderr into patch in bugzilla-tool
+ https://bugs.webkit.org/show_bug.cgi?id=29914
+
+ Modify SCM python module's run_command function to avoid return of stderr
+ by default, so stderr won't be inserted into the patches.
+ Modify the related unit test.
+
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+
+2009-11-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool needs per-command help
+ https://bugs.webkit.org/show_bug.cgi?id=31697
+
+ Added support for "bugzilla-tool help command-name"
+ and a unit test to make sure it works.
+
+ * Scripts/modules/multicommandtool.py:
+ * Scripts/modules/multicommandtool_unittest.py:
+
+2009-11-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Move MultiCommandTool and Command into a separate file and add some basic unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=31695
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/multicommandtool.py: Added.
+ * Scripts/modules/multicommandtool_unittest.py: Added.
+ * Scripts/run-webkit-unittests:
+
+2009-11-19 Eric Seidel <eric@webkit.org>
+
+ No review, just adding a FIXME.
+
+ Split out command parsing and help printing from BugzillaTool
+ https://bugs.webkit.org/show_bug.cgi?id=31688
+
+ * Scripts/bugzilla-tool: Add an extra comment about current design failures.
+
+2009-11-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Split out command parsing and help printing from BugzillaTool
+ https://bugs.webkit.org/show_bug.cgi?id=31688
+
+ * Scripts/bugzilla-tool:
+ - Add new MultiCommandTool class to contain option parsing and help printing logic.
+ - Rename private methods to use _ pattern.
+ - MultiCommandTool has two abstract methods should_show_command_help and should_execute_command.
+ -
+
+2009-11-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Re-factor help printing to use modern python idioms
+ https://bugs.webkit.org/show_bug.cgi?id=31685
+
+ * Scripts/bugzilla-tool:
+
+2009-11-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ commit-queue empty queue logs twice
+ https://bugs.webkit.org/show_bug.cgi?id=31679
+
+ * Scripts/bugzilla-tool:
+
+2009-11-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ bugzilla-tool's reviewer/committer rejection message should be clearer
+ https://bugs.webkit.org/show_bug.cgi?id=31126
+
+ Add more explanatory prose to bugzilla-tool's flag permission rejection message.
+
+ * Scripts/modules/bugzilla.py:
+
+2009-11-19 Eric Z. Ayers <zundel@google.com>
+
+ Reviewed by Pavel Feldman.
+
+ Forces a WM_PAINT event on calling layoutTestController.display()
+ in order to enable the timeline-paint.html test on Windows.
+ ::UpdateWindow() does not force an event becaue the window is
+ not visible.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31402
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (displayWebView):
+
+2009-11-19 Michelangelo De Simone <michelangelo@webkit.org>
+
+ No review needed.
+
+ Added myself to committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-11-19 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Bugzilla-tool command classes should match command names
+ https://bugs.webkit.org/show_bug.cgi?id=31666
+
+ I renamed all the commands except CommitMessageForCurrentDiff because
+ the new name would conflict with an existing class.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-19 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Web Inspector: Implement "show inspector" in WebKit GTK
+ API and enable console tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31669
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::showWebInspector):
+
+2009-11-19 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Minor refactoring + more documentation.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::clearHistory):
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+
+2009-11-19 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Ignore websocket tests when --no-http is specified.
+ https://bugs.webkit.org/show_bug.cgi?id=31662
+
+ * Scripts/run-webkit-tests:
+
+2009-11-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Normalize ' and " in bugzilla-tool
+ https://bugs.webkit.org/show_bug.cgi?id=31655
+
+ We decided " is better than ' and we should be consistent.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Remove support for Qt v4.3 or older versions
+ https://bugs.webkit.org/show_bug.cgi?id=29469
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/ImageDiff.pro:
+
+2009-11-18 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ GitTest.test_create_binary_patch fails if /tmp is symlink
+ https://bugs.webkit.org/show_bug.cgi?id=31536
+
+ * Scripts/modules/scm_unittest.py:
+
+2009-11-18 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Configuration for Chromium Build Slaves.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31442
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2009-11-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ workqueue.py results in totally broken commit-queue UI
+ https://bugs.webkit.org/show_bug.cgi?id=31645
+
+ * Scripts/bugzilla-tool:
+ - Remove unneeded use of PatchCollection.
+ - Grab a new copy of the cq'd patches every run of the queue.
+
+2009-11-18 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Make the Mac Geolocation API async.
+
+ Update DRT to use the new async Mac Geolocation API.
+
+ * DumpRenderTree/mac/UIDelegate.mm:
+ (-[UIDelegate webView:decidePolicyForGeolocationRequestFromOrigin:frame:listener:]):
+
+2009-11-18 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add and option to toggle HTML5 datalist support to build-webkit
+ https://bugs.webkit.org/show_bug.cgi?id=31599
+
+ * Scripts/build-webkit:
+
+2009-11-18 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Enable wx plugin support using the Windows implementation as a base.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31636
+
+ * wx/build/settings.py:
+
+2009-11-18 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Change the initialization order so that the controllers
+ will be created before exporting them to the JS DOM window.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+
+2009-11-18 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Fix a code copy and paste error. m_page should be page.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::createWindow):
+
+2009-11-17 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ <http://webkit.org/b/31603> WebSocket server is confused if WebKit tests run from within /tmp on Mac OS X
+
+ * pywebsocket/mod_pywebsocket/dispatch.py: Use os.path.realpath as it returns the canonical path of a file.
+ This prevents symlinks from confusing the descendant check.
+
+2009-11-17 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ <http://webkit.org/b/31602> Failing to start the WebSocket server shouldn’t terminate entire test run
+
+ If the WebSocket server fails to start have DRT load an error page in place of tests that require the
+ server to be up rather than having run-webkit-tests abort immediately.
+
+ * Scripts/run-webkit-tests:
+
+2009-11-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ commit-queue is failing to set reviewer in ChangeLogs
+ https://bugs.webkit.org/show_bug.cgi?id=31592
+
+ * Scripts/bugzilla-tool: Clarify the "applying" log message.
+ * Scripts/modules/bugzilla.py:
+ - Add a new _validate_committer_and_reviewer function as a
+ temporary solution until we can make a real Attachment object
+ which knows how to fill in its committer/reviewer fields automatically.
+
+2009-11-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed buildbot fix.
+
+ Revert part of earlier patch and add comment, as it
+ was causing timeouts on the buildbot.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::notifyDone):
+
+2009-11-17 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Make the timeout 15 sec as for the other DRT's and make
+ it print out the same output when a test timeout.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::waitUntilDone):
+ (LayoutTestController::notifyDone):
+ (LayoutTestController::timerEvent):
+
+2009-11-17 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Fixed typos in comments.
+
+ * Scripts/modules/committers.py:
+
+2009-11-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: Make DRT show web inspector for tests in inspector/ folder.
+ - Updated DRT to show/close inspector for all tests under /inspector
+ - Introduced LayoutTestController::setTimelineProfilingEnabled and
+ WebInspector::setTimelineProfilingEnabled beside setJavaScriptProfilingEnabled
+ - Removed reload on each inspector test
+ - Renamed fast/inspector to fast/inspector-support in order not to trigger
+ inspector for those.
+ - Reimplemented timeline tests in order to get rid of reload there.
+ - Moved tests that don't require harness into the fast group.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31472
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setTimelineProfilingEnabledCallback):
+ (closeWebInspectorCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (shouldOpenWebInspector):
+ (runTest):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setTimelineProfilingEnabled):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (shouldOpenWebInspector):
+ (runTest):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setTimelineProfilingEnabled):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (shouldOpenWebInspector):
+ (runTest):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setTimelineProfilingEnabled):
+
+2009-11-17 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Incorrect use of JavaScriptCore API in DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=31577
+
+ Return undefined rather than a literal null.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (setSelectedTextRangeCallback):
+ (incrementCallback):
+ (decrementCallback):
+ (showMenuCallback):
+
+2009-11-16 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ AX: aria-labelledby duplicates some of its WAI-ARIA label
+ https://bugs.webkit.org/show_bug.cgi?id=31565
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (titleUIElementCallback):
+ (getIsValidCallback):
+ (AccessibilityUIElement::getJSClass):
+
+2009-11-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ r50942 broke output from created windows. Make the
+ m_enableTextOutput a member of the DRT and not the
+ WebPage.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::javaScriptAlert):
+ (WebCore::WebPage::javaScriptConsoleMessage):
+ (WebCore::WebPage::javaScriptConfirm):
+ (WebCore::WebPage::javaScriptPrompt):
+ (WebCore::WebPage::acceptNavigationRequest):
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::open):
+ (WebCore::DumpRenderTree::createWindow):
+ * DumpRenderTree/qt/DumpRenderTree.h:
+ (WebCore::DumpRenderTree::setTextOutputEnabled):
+ (WebCore::DumpRenderTree::isTextOutputEnabled):
+ (WebCore::WebPage::shouldInterruptJavaScript):
+ (WebCore::WebPage::isTextOutputEnabled):
+ (WebCore::WebPage::setViewGeometry):
+
+2009-11-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Moved DumpRenderTree/gtk/TestNetscapePlugin to DumpRenderTree/unix/TestNetscapePlugin
+ as the implementation is being used by at least Qt and Gtk+.
+
+ Update buildsystems as well.
+
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npapi.h:
+ * DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npfunctions.h:
+ * DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npruntime.h:
+ * DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ * GNUmakefile.am:
+
+2009-11-16 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Disable wss until all platforms support pyOpenSSL
+
+ https://bugs.webkit.org/show_bug.cgi?id=31479
+
+ * Scripts/run-webkit-tests:
+
+2009-11-14 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Implement load error pages support for Qt's DRT.
+ https://bugs.webkit.org/show_bug.cgi?id=31509
+
+ For now, it will not be a default feature, and layout tests
+ that want to make use of this have to explicitily call
+ 'handleErrorPages();' for the test source.
+
+ Any of the other DumpRenderTree's (mac, win and gtk)
+ support handling error pages. Qt's will be the first.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::supportsExtension):
+ (WebCore::WebPage::extension):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::reset):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::shouldHandleErrorPages):
+ (LayoutTestController::handleErrorPages):
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Rename the --commit-queue flag on land-* now that the commit-queue needs no special treatment
+ https://bugs.webkit.org/show_bug.cgi?id=31549
+
+ Renamed --commit-queue to --non-interactive in most places
+ and remove the code in land-patches which is no longer needed.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ The commit-queue should use land-attachment
+ https://bugs.webkit.org/show_bug.cgi?id=31548
+
+ * Scripts/bugzilla-tool:
+
+2009-11-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Convert CommitQueue over to PatchCollection
+ https://bugs.webkit.org/show_bug.cgi?id=31547
+
+ Also fixes a bug in workqueue and adds a test!
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/workqueue.py:
+ * Scripts/modules/workqueue_unittest.py:
+
+2009-11-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move StyleQueue over to using PatchCollection
+ https://bugs.webkit.org/show_bug.cgi?id=31544
+
+ That's what the class it's for.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/patchcollection.py:
+ * Scripts/modules/patchcollection_unittest.py:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool needs a land-attachment command
+ https://bugs.webkit.org/show_bug.cgi?id=31546
+
+ * Scripts/bugzilla-tool:
+ - Move all the logic into AbstractLandingCommand and
+ add a new LandAttachment command subclass.
+ - Split out _collect_patches_by_bug logging from _fetch_list_of_patches_to_land.
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Move more patch-landing code into WebKitLandingScripts in preparation for land-attachment
+ https://bugs.webkit.org/show_bug.cgi?id=31543
+
+ Just moving code and updating the one caller to use WebKitLandingScripts instead of 'self'.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Disable the style queue from posting to the commit queue status page.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement PatchCollection
+ https://bugs.webkit.org/show_bug.cgi?id=31541
+
+ This class holds a set of patches and lets clients iterate through
+ them. Optionally, clients can install a filter.
+
+ * Scripts/modules/patchcollection.py: Added.
+ * Scripts/modules/patchcollection_unittest.py: Added.
+ * Scripts/run-webkit-unittests:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool land-patches will close bugs with patches r=?
+ https://bugs.webkit.org/show_bug.cgi?id=28230
+
+ The commit-queue shouldn't close patches with outstanding reviews on them,
+ even if many reviewers seem to be against multi-patch bugs.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool check-style should work with attachment ids instead of bug ids
+ https://bugs.webkit.org/show_bug.cgi?id=31540
+
+ * Scripts/bugzilla-tool:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ WorkQueue is the only place that should know about special exit codes
+ https://bugs.webkit.org/show_bug.cgi?id=31534
+
+ Move LandPatchesFromBugs.handled_error to WorkQueue.exit_after_handled_error
+ and add tests for handling exit codes.
+ I also cleaned up workqueue_unittest.py more.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/workqueue.py:
+ * Scripts/modules/workqueue_unittest.py:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Re-factor workqueue_unittest to allow for more than one test.
+ https://bugs.webkit.org/show_bug.cgi?id=31535
+
+ * Scripts/modules/workqueue_unittest.py:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ land-patches needs to be re-factored into smaller chunks
+ https://bugs.webkit.org/show_bug.cgi?id=31532
+
+ * Scripts/bugzilla-tool: fix a couple obvious typos.
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ land-patches needs to be re-factored into smaller chunks
+ https://bugs.webkit.org/show_bug.cgi?id=31532
+
+ The next patch will move these methods into WebKitLandingScripts.
+
+ * Scripts/bugzilla-tool:
+ - Split out _land_patch and _close_bug_if_no_active_patches.
+
+2009-11-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix silly copy-and-paste code. I am a terrible coder.
+
+ * Scripts/modules/bugzilla.py:
+
+2009-11-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Implement a StyleQueue
+ https://bugs.webkit.org/show_bug.cgi?id=31537
+
+ The first iteration of the style queue only produces output locally.
+ There is also a limit of 10 patches because it's not that useful to
+ iterate through the entire review queue at this point. We can remove
+ the limit later.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/bugzilla.py:
+
+2009-11-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Unit test WorkQueue
+ https://bugs.webkit.org/show_bug.cgi?id=31531
+
+ Adds basic unit testing for WorkQueue. Just runs through one cycle.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/statusbot.py:
+ * Scripts/modules/workqueue.py:
+ * Scripts/modules/workqueue_unittest.py: Added.
+ * Scripts/run-webkit-unittests:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool land-diff should know how to parse bug ids out of ChangeLogs
+ https://bugs.webkit.org/show_bug.cgi?id=31530
+
+ * Scripts/bugzilla-tool:
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool needs apply-attachment
+ https://bugs.webkit.org/show_bug.cgi?id=31528
+
+ * Scripts/bugzilla-tool:
+ - Add ApplyAttachment command.
+ - Abstract applying code into WebKitApplyingScripts.
+ - Rename setup_for_landing to prepare_clean_working_directory and make local_commit checking optional.
+ * Scripts/modules/bugzilla.py:
+ - Add fetch_attachment and bug_id_for_attachment_id.
+ * Scripts/modules/bugzilla_unittest.py:
+ - Add test for new parsing.
+ - Fix previous parsing test which broke with Adam's check-style patch (bug 31515).
+
+2009-11-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Document check-style's use of force_clean.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/scm.py:
+
+2009-11-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move WorkQueue to its own file
+ https://bugs.webkit.org/show_bug.cgi?id=31529
+
+ WorkQueue and WorkQueueDelegate are separate concerns from
+ bugzilla-tool. Also added a missing include to logging.py.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/logging.py:
+ * Scripts/modules/workqueue.py:
+
+2009-11-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move OutputTee to logging.py.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/logging.py:
+
+2009-11-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Refactor bugzilla-tool to allow for multiple queues
+ https://bugs.webkit.org/show_bug.cgi?id=31513
+
+ Divide the commit queue class into three class to make creating
+ additional queues easier.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-15 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ svn-apply may not handle git patches created by bugzilla-tool
+ https://bugs.webkit.org/show_bug.cgi?id=31457
+
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+
+2009-11-15 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool should post git binary diff
+ https://bugs.webkit.org/show_bug.cgi?id=31458
+
+ Add --binary option to Git.create_patch.
+
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+
+2009-11-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Add bugzilla-tool check-style
+ https://bugs.webkit.org/show_bug.cgi?id=31515
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/bugzilla.py:
+
+2009-11-13 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Make the Qt Linux only --valgrind feature, suppress errors
+ defined in the SuppressedValgrindErrors file.
+
+ * Scripts/run-webkit-tests:
+
+2009-11-13 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Set the locale to C and not to the current one in use on the system.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+
+2009-11-13 Adam Roben <aroben@apple.com>
+
+ Add support for
+ http/tests/security/isolatedWorld/didClearWindowObject.html
+
+ Fixes <http://webkit.org/b/31124> Tell the WebFrameLoadDelegate when
+ window objects in isolated worlds are cleared
+
+ Reviewed by Dave Hyatt.
+
+ * DumpRenderTree/mac/DumpRenderTreeMac.h: Declared worldIDForWorld.
+
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ (-[FrameLoadDelegate didClearWindowObjectInStandardWorldForFrame:]):
+ Added. Moved code here from -webView:didClearWindowObject:forFrame:.
+ (-[FrameLoadDelegate didClearWindowObjectForFrame:inIsolatedWorld:]):
+ Added. Sets a __worldID property on the global object whose value is
+ the ID of this world.
+ (-[FrameLoadDelegate webView:didClearWindowObjectForFrame:inScriptWorld:]):
+ Respond to this new delegate callback by calling through to one of the
+ above new methods.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (worldMap): Added. Returns a HashMap containing all the worlds we've
+ created.
+ (worldIDForWorld): Added. Returns the ID for this world, or 0 if we
+ haven't kept track of this world.
+ (LayoutTestController::evaluateScriptInIsolatedWorld): Use worldMap()
+ instead of declaring our own.
+
+ * DumpRenderTree/win/DumpRenderTreeWin.h: Declared worldIDForWorld.
+
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ (FrameLoadDelegate::didClearWindowObject): Moved code from hear to
+ didClearWindowObjectForFrameInStandardWorld.
+ (FrameLoadDelegate::didClearWindowObjectForFrameInScriptWorld):
+ Respond to this new delegate callback by calling through to one of the
+ below new methods.
+ (FrameLoadDelegate::didClearWindowObjectForFrameInIsolatedWorld):
+ Added. Sets a __worldID property on the gobal object whose value is
+ the ID of this world.
+ (FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld):
+ Added. Moved code here from didClearWindowObject.
+
+ * DumpRenderTree/win/FrameLoadDelegate.h: Added the
+ didClearWindowObjectForFrame* functions.
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (worldMap): Added. Returns a HashMap containing all the worlds we've
+ created.
+ (worldIDForWorld): Added. Returns the ID of this world, or 0 if we
+ haven't kept track of this world.
+ (LayoutTestController::evaluateScriptInIsolatedWorld): Use worldMap()
+ instead of declaring our own.
+
+2009-11-13 Adam Roben <aroben@apple.com>
+
+ Finish replacing worldIDs with world objects
+
+ The only remaining use of worldIDs was in a method only used by DRT
+ for the isolated worlds tests.
+
+ Fixes <http://webkit.org/b/31414> Replace worldIDs with world objects
+
+ Reviewed by Mark Rowe.
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::evaluateScriptInIsolatedWorld):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::evaluateScriptInIsolatedWorld):
+ Updated for changes to WebFrame. Now holds the map of worldID -> world
+ at this level instead of making WebKit do it.
+
+2009-11-13 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Ensure the DRT does not output anything until first test is run
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ * DumpRenderTree/qt/DumpRenderTree.h:
+
+2009-11-13 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Clear the undo stack in before each new test run.
+
+ Locally fixes 3 incorrect layouts, 9 timeouts and 7 crashes.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+
+2009-11-13 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Add WebKitUsesPageCachePreferenceKey overriding support to DRT's LayoutTestController.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::resetSettings):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::overridePreference):
+
+2009-11-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Update committers.py based on svn records
+ https://bugs.webkit.org/show_bug.cgi?id=31366
+
+ This list was generated using validate-committer-lists from
+ https://bugs.webkit.org/show_bug.cgi?id=30970
+ and makes committers.py current for committers who have
+ committed in the last 3 years.
+
+ * Scripts/modules/committers.py:
+
+2009-11-12 Anantanarayanan G Iyengar <ananta@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ The document-open.html test was flaky at times. The test invokes the layout test plugin
+ which in its destroy stream handler opens a new document. This basically tears down the
+ stream and the associated plugin instance. The pluginLog function in the layout test
+ plugin attempts to retrieve the window script object on a torn down plugin instance
+ which crashed consistently on windows in the debugger. The functions which issue
+ these logs already have a valid window script object. We now have variants of the pluginLog
+ function which take in a window script object with and without variable arguments.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31067
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginLogWithWindowObject):
+ (pluginLogWithWindowObjectVariableArgs):
+ (pluginLog):
+ (notifyTestCompletion):
+ (testDocumentOpen):
+ (testWindowOpen):
+
+2009-11-12 Joanmarie Diggs <joanmarie.diggs@gmail.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30997
+ [Gtk] Implemment AtkDocument
+
+ Added testing support.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ * DumpRenderTree/AccessibilityUIElement.h:
+ (getDocumentEncodingCallback):
+ (getDocumentURICallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::documentEncoding):
+ (AccessibilityUIElement::documentURI):
+
+2009-11-12 Adam Roben <aroben@apple.com>
+
+ Replace worldIDs with world objects
+
+ Part of <http://webkit.org/b/31414> Implement new SPI for dealing with
+ user scripts/stylesheets and isolated worlds
+
+ Reviewed by Sam Weinig.
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::addUserScript):
+ (LayoutTestController::addUserStyleSheet):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::addUserScript):
+ (LayoutTestController::addUserStyleSheet):
+ Changed these functions to create a new WebJSWorld each time they're
+ called and to pass that world to WebKit.
+
+2009-11-11 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ need to implement aria tree roles
+ https://bugs.webkit.org/show_bug.cgi?id=31284
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (disclosedRowAtIndexCallback):
+ (selectedRowAtIndexCallback):
+ (isEqualCallback):
+ (isAttributeSettableCallback):
+ (isActionSupportedCallback):
+ (disclosedByRowCallback):
+ (hierarchicalLevelCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ (AccessibilityUIElement::isEqual):
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::hierarchicalLevel):
+ (AccessibilityUIElement::disclosedRowAtIndex):
+ (AccessibilityUIElement::selectedRowAtIndex):
+ (AccessibilityUIElement::disclosedByRow):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::getChildAtIndex):
+ (AccessibilityUIElement::disclosedRowAtIndex):
+ (AccessibilityUIElement::selectedRowAtIndex):
+ (AccessibilityUIElement::titleUIElement):
+ (AccessibilityUIElement::parentElement):
+ (AccessibilityUIElement::disclosedByRow):
+ (AccessibilityUIElement::hierarchicalLevel):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::hierarchicalLevel):
+ (AccessibilityUIElement::disclosedRowAtIndex):
+ (AccessibilityUIElement::selectedRowAtIndex):
+ (AccessibilityUIElement::disclosedByRow):
+
+2009-11-11 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ svn-apply can not handle git binary diffs
+ https://bugs.webkit.org/show_bug.cgi?id=26830
+
+ Support "literal" type git binary diffs.
+
+ * Scripts/VCSUtils.pm:
+ * Scripts/modules/scm_unittest.py:
+ * Scripts/svn-apply:
+
+2009-11-11 Dmitry Titov <dimich@chromium.org>
+
+ Not reviewed, removing duplicate entry for myself in committers.py.
+
+ * Scripts/modules/committers.py:
+
+2009-11-11 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler and Mark Rowe.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31200
+ Tests in http/tests/security/mixedContent start to fail when new tests are added
+
+ * DumpRenderTree/mac/DumpRenderTree.mm: (dumpRenderTree): Added a workaround for Tiger bug.
+
+2009-11-11 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Jan Alonzo.
+
+ Create, and display a window for the inspector, for inspector
+ tests.
+
+ Need to also show/hide the inspector window to avoid having
+ problems with code assuming it is realized
+ https://bugs.webkit.org/show_bug.cgi?id=31347
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webInspectorShowWindow):
+ (webInspectorCloseWindow):
+ (webInspectorInspectWebView):
+ (createWebView):
+
+2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed Qt buildbot fix.
+
+ My previous fix was wrong, so revert that change and fix it by
+ returning when the document of the frame has no document element.
+ Idea is borrowed from mac and win DRT.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::dumpFramesAsText):
+
+2009-11-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed byg Kenneth Rohde Christiansen.
+
+ Update Kenneth's committer record to include the email he
+ uses on lists.webkit.org.
+
+ * Scripts/modules/committers.py:
+
+2009-11-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Several committers use separate email addresses for bugzilla and svn.webkit.org
+ https://bugs.webkit.org/show_bug.cgi?id=31364
+
+ Update records for existing committers to include email addresses
+ used in svn.webkit.org and lists.webkit.org.
+ Most committers use the same email address in all 3 places, but some use
+ separate addresses. committers.py needs record of each of these addresses.
+
+ * Scripts/modules/committers.py:
+
+2009-11-11 Eric Seidel <eric@webkit.org>
+
+ No review, adding second email address for an existing committer.
+
+ Add Yong Li's second bugzilla account to his committer record.
+ See: https://bugs.webkit.org/show_bug.cgi?id=27371#c27
+
+ * Scripts/modules/committers.py:
+
+2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ If the frame has no innerText don't append it, and
+ do not add a newline which breaks some cross platform
+ results.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::dumpFramesAsText):
+
+2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Implement missing functionality in the Gtk/Qt TestNetscapePlugin.
+
+ * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_instance):
+ (webkit_test_plugin_destroy_instance):
+ (webkit_test_plugin_destroy_stream):
+
+2009-11-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Implement the functionality needed by plugins/window-open.html
+
+ * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_instance):
+ (webkit_test_plugin_set_window):
+
+2009-11-11 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Force -graphicssystem raster and -style windows when running DRT
+
+ * DumpRenderTree/qt/main.cpp:
+ * Scripts/run-webkit-tests:
+
+2009-11-11 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Compute correct library paths for Qt
+
+ * Scripts/webkitdirs.pm:
+
+2009-11-10 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <http://webkit.org/b/31200> Tests in http/tests/security/mixedContent start to fail when new tests are added
+
+ The first request to an HTTPS URL results in didFailProvisionalLoadWithError being called with an error
+ about the validity of the self-signed certificates used in the regression tests. We would then add the
+ host to the ignore list for SSL certificate errors and retry the request. If this happened during a test
+ that had enabled frame load delegate logging this would result in extra log messages being generated,
+ causing the test to fail.
+
+ We address this by explicitly ignoring SSL certificate errors for localhost and 127.0.0.1 before running any
+ tests.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (dumpRenderTree):
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ (-[FrameLoadDelegate webView:didFailProvisionalLoadWithError:forFrame:]):
+
+2009-11-10 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Remove obsolete scrollbar policy settings from DRT constructor.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+
+2009-11-10 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Jan Alonzo.
+
+ [GTK] Remove WebSocket configuration from WebKitWebSettings
+ https://bugs.webkit.org/show_bug.cgi?id=31244
+
+ Follow-up of r50724. Don't set the enable-web-socket property
+ anymore.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2009-11-10 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Rename 3D Canvas related classes to use WebGL prefix
+ https://bugs.webkit.org/show_bug.cgi?id=29095
+
+ Checkin new version of do-webcore-rename used to do the WebGL type rename,
+ and upate webkitdirs script to new method of testing for WebGL.
+
+ * Scripts/do-webcore-rename:
+ * Scripts/webkitdirs.pm:
+
+2009-11-09 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ Make do-webcore-rename work with git.
+
+ * Scripts/do-webcore-rename:
+
+2009-11-09 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Adding Kenneth to the reviewers list.
+
+ * Scripts/modules/committers.py:
+
+2009-11-09 Martin Robinson <martin.james.robinson@gmail.com>
+
+ Reviewed by Jan Alonzo.
+
+ [GTK] Expose Page::tabKeyCyclesThroughElements in the API
+ https://bugs.webkit.org/show_bug.cgi?id=30482
+
+ LayoutTestControllerGtk now uses the exposed
+ Page::tabKeyCyclesThroughElements API
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setTabKeyCyclesThroughElements):
+
+2009-11-08 Shu Chang <Chang.Shu@nokia.com>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] Added support for key code 8 (backspace) in EventSenderQt.
+ This helps to pass the test case below. Also replaced hardcoded
+ code numbers with defined constants.
+ https://bugs.webkit.org/show_bug.cgi?id=31185
+
+ Test: editing/undo/undo-deleteWord.html
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::keyDown):
+
+2009-11-07 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] [DRT] Fix wrong logic in LayoutTestController processWork
+ https://bugs.webkit.org/show_bug.cgi?id=31164
+
+ Fixed wrong logic to assume WorkQueue is done in QT's DRT.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::processWork):
+
+2009-11-05 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [Qt][DRT] Replace queueScript by queueNonLoadingScript and queueLoadingScript method
+ https://bugs.webkit.org/show_bug.cgi?id=31158
+
+ By invoking a script queue'd by queueScript(), 'true' was beeing returned
+ always, which from WorkQueue prospective means that a load has been started
+ and the queue processing should stop and wait for the load to finish.
+ Spinning it off into a loading and a non-loading variants was the solution
+ adopted by Mac's DRT to work around this problem. The former keeps returning
+ 'true' while the later executes the script synchronously and returns 'false'
+ making it possible to the WorkQueue to proceed right away.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::processWork):
+ (LayoutTestController::queueLoadingScript):
+ (LayoutTestController::queueNonLoadingScript):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ * DumpRenderTree/qt/WorkQueueItem.h:
+ (LoadingScriptItem::LoadingScriptItem):
+ (LoadingScriptItem::invoke):
+ (NonLoadingScriptItem::NonLoadingScriptItem):
+ (NonLoadingScriptItem::invoke):
+
+2009-11-07 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Cameron Zwarich.
+
+ Invoke prepare-ChangeLog via an absolute path rather than assuming it can be found in PATH.
+
+ * Scripts/commit-log-editor:
+
+2009-11-07 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix <https://bugs.webkit.org/show_bug.cgi?id=28168>.
+ commit-log-editor does not support all the email address configurations that prepare-Changelog supports
+
+ Move logic for determining the name and email address to use in a ChangeLog entry from
+ prepare-ChangeLog to VCSUtils so that commit-log-editor can use it. It wants to check
+ whether the author of the patch matches committer, and therefore needs access to the
+ email address that would be used in a ChangeLog entry.
+
+ Based on a patch by Pierre d'Herbemont.
+
+ * Scripts/VCSUtils.pm:
+ * Scripts/commit-log-editor:
+ * Scripts/prepare-ChangeLog:
+ * Scripts/webkitdirs.pm:
+
+2009-11-06 Anantanarayanan G Iyengar <ananta@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Added functionality to the layout test plugin to invoke document.open and
+ window.open with default arguments. The associated webkit bug is
+ https://bugs.webkit.org/show_bug.cgi?id=31067, which affects Chromium. Basically
+ window.open and document.open calls issued by NPAPI plugins via NPN_Invoke don't
+ work in Chromium (V8) if there is no calling javascript context. To achieve this
+ effect we invoke these functions in the layout test plugin in the NPP_SetWindow
+ for the window.open test case and in NPP_DestroyStream for the document.open test case.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (testDocumentOpen):
+ (testWindowOpen):
+ (pluginAllocate):
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New):
+ (NPP_SetWindow):
+ (NPP_DestroyStream):
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_New):
+ (NPP_SetWindow):
+ (NPP_NewStream):
+ (NPP_DestroyStream):
+
+2009-11-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool crashed with exception
+ https://bugs.webkit.org/show_bug.cgi?id=31092
+
+ * Scripts/modules/bugzilla.py: Change a ',' to a '%' to fix the error.
+
+2009-11-04 Eric Seidel <eric@webkit.org>
+
+ No review, just add a line which got left out of the patch uploaded for commit.
+
+ commit-queue is crashing when trying to reject patches after unknown failures
+ https://bugs.webkit.org/show_bug.cgi?id=31091
+
+ * Scripts/bugzilla-tool: Set bug_log = None after closing to we don't re-close and crash.
+
+2009-11-04 Adam Roben <aroben@apple.com>
+
+ Remove bogus else clause in bugzilla-tool
+
+ Fixes <http://webkit.org/b/31125> REGRESSION (r47121): bugzilla-tool
+ create-bug raises exception after entering bug description
+
+ Reviewed by David Kilzer.
+
+ * Scripts/bugzilla-tool:
+ (CreateBug): else clauses are only hit if no exception is raised, so
+ it makes no sense to try to re-raise the exception in an else clause.
+ The exception will automatically be re-raised if it doesn't match any
+ of the except clauses, so we don't have to do anything special here at
+ all to get the desired behavior.
+
+2009-11-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ svn-apply's fixChangeLogPatch function seems broken
+ https://bugs.webkit.org/show_bug.cgi?id=30683
+
+ Update fixChangeLogPatch to be able to handle patches which
+ don't start at line 1.
+ Add unit tests for svn-apply to scm_unittest.py.
+
+ * Scripts/VCSUtils.pm:
+ * Scripts/modules/scm_unittest.py:
+
+2009-11-04 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ Need to implement ARIA role="combobox"
+ https://bugs.webkit.org/show_bug.cgi?id=31096
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (showMenuCallback):
+ (getIsExpandedCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::isExpanded):
+ (AccessibilityUIElement::showMenu):
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isExpanded):
+ (AccessibilityUIElement::showMenu):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isSelected):
+ (AccessibilityUIElement::isExpanded):
+ (AccessibilityUIElement::showMenu):
+
+2009-11-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue is crashing when trying to reject patches after unknown failures
+ https://bugs.webkit.org/show_bug.cgi?id=31091
+
+ * Scripts/bugzilla-tool:
+ - patch['id'] was a copy/paste mistake. This code has no 'patch' variable
+ so we have to find out what the current patch is by asking bugzilla again.
+ - Discovered that this code was also leaking file descriptors, so fixed that.
+
+2009-11-04 Adam Roben <aroben@apple.com>
+
+ Make run-webkit-tests work for the Debug_Internal Windows
+ configuration
+
+ In Debug_Internal, DumpRenderTree.exe and ImageDiff.exe have no _debug
+ suffix.
+
+ Fixes <http://webkit.org/b/31123>.
+
+ Reviewed by Sam Weinig.
+
+ * Scripts/run-webkit-tests: Don't add the _debug suffix in
+ Debug_Internal, either.
+
+2009-11-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ committers.py needs a way to store non-bugzilla email addresses
+ https://bugs.webkit.org/show_bug.cgi?id=31037
+
+ Make Committer and Reviewer constructors take a single email or a list of emails.
+ Change committer_by_bugzilla_email functions to committer_by_email to support lookup by any email.
+ Expose reviewers(), used by validate-committer-lists on bug 30970.
+
+ * Scripts/modules/committers.py:
+ * Scripts/modules/committers_unittest.py: Added tests for the new code.
+
+2009-11-03 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by David Levin.
+
+ Start/Stop Web Socket and Web Socket Secure servers for layout tests.
+ https://bugs.webkit.org/show_bug.cgi?id=27491
+
+ The test path determination logic is changed to handle websocket and websocket/ssl cases.
+ The logic for non-http (and now also non-websocket) tests is moved toward the end of the if-elsif statement.
+
+ Functions to start or stop Web Socket servers are added.
+
+ * Scripts/run-webkit-tests:
+
+2009-11-03 Eric Seidel <eric@webkit.org>
+
+ No review, just changing wording of log message.
+
+ Change log string to say "failed" instead of "rejected"
+ when a commit fails due to an out of date checkout.
+ This makes grepping the commit-queue log for rejected patches easier.
+
+ * Scripts/bugzilla-tool:
+
+2009-11-03 Eric Seidel <eric@webkit.org>
+
+ No review, adding commonly known committers missing from the file.
+
+ * Scripts/modules/committers.py: Add committers found by looking at SVN records.
+
+2009-11-03 Eric Seidel <eric@webkit.org>
+
+ No review, just sort-order cleanup.
+
+ * Scripts/modules/committers.py: Sort committers/reviewers alphabetically.
+
+2009-11-03 Stephen White <senorblanco@chromium.org>
+
+ (Unreviewed).
+
+ Add myself to committers.py.
+
+ * Scripts/modules/committers.py:
+
+2009-11-03 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollviier.
+
+ Add packaging scripts for Debian-based Linux distros.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31075
+
+ * wx/packaging/build-debian-installer.py: Added.
+ * wx/packaging/debian: Added.
+
+2009-11-03 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson and Beth Dakin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31070
+
+ Added an 'ondestroy' parameter to the test plug-in. When the plug-in is
+ destroyed, it executes the value of the 'ondestroy' parameter as a
+ script.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginAllocate): Initialize onDestroy.
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h: Define
+ onDestroy.
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New): Set onDestroy to the value of the 'ondestroy' parameter, if
+ specified.
+ (NPP_Destroy): Execute the value of 'ondestroy' as a script.
+
+2009-11-02 Joanmarie Diggs <joanmarie.diggs@gmail.com>
+
+ Reviewed by Xan Lopez.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31035
+ [GTK] some accessibility tests hitting assertion in debug builds
+
+ Get the correct Gtk+ object before attempting to turn it into an AtkObject.
+
+ * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+ (AccessibilityController::rootElement):
+
+2009-11-02 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ Support ARIA "tab" roles
+ https://bugs.webkit.org/show_bug.cgi?id=30842
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+
+2009-11-01 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ buildbots should use --exit-after-N-failures
+ https://bugs.webkit.org/show_bug.cgi?id=30809
+
+ Make the bots exit after 20 failures to prevent never-ending
+ test runs where every test spends a minute crashing.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2009-11-01 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Turn on warnings for QtWebKit for gcc
+ https://bugs.webkit.org/show_bug.cgi?id=30958
+
+ * DumpRenderTree/qt/main.cpp:
+ (crashHandler): Mark function NO_RETURN
+
+2009-11-01 Jessie Berlin <jberlin@webkit.org>
+
+ Adding myself to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-10-30 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Fix an issue that Adam noticed in DRT.
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::role):
+ Get the length of the role text, and create a buffer dynamically.
+
+2009-10-30 Eric Seidel <eric@webkit.org>
+
+ No review, rolling out r50105.
+ http://trac.webkit.org/changeset/50105
+
+ This commit was causing:
+ https://bugs.webkit.org/show_bug.cgi?id=30869
+ We'll re-implement the feature a different way.
+
+ * Scripts/bugzilla-tool:
+
+2009-10-29 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Test for MSAA: Accessibility of headings is not correct
+
+ https://bugs.webkit.org/show_bug.cgi?id=30937
+
+ Reviewed by Adam Roben.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::role):
+ Allow the role returned to be a BSTR.
+ (AccessibilityUIElement::description):
+ Fix a copy/paste error.
+
+2009-10-29 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Test for MSAA: Accessibility of links is wrong
+
+ https://bugs.webkit.org/show_bug.cgi?id=30928
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getAccessibilityValueCallback):
+ Return the accessibility value.
+ (AccessibilityUIElement::getJSClass):
+ Added "accessibilityValue" value.
+
+ * DumpRenderTree/AccessibilityUIElement.h:
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::accessibilityValue):
+ Stubbed.
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::accessibilityValue):
+ Stubbed.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::accessibilityValue):
+ Get the object's value, and return it as a JS string.
+
+2009-10-30 Kevin Ollivier <kevino@theolliviers.com>
+
+ Fix typo in command name used by wx build system.
+
+ * wx/build/build_utils.py:
+
+2009-10-30 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Patch v1 is a dumb default name for patches
+ https://bugs.webkit.org/show_bug.cgi?id=30952
+
+ Let's use "Patch" instead.
+
+ * Scripts/bugzilla-tool:
+
+2009-10-30 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Unreviewed trivial buildfix.
+
+ [Qt] Buildfix for r50333.
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+
+2009-10-30 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ [Qt] Remove qt/WorkQueue.cpp|h in favor of platform independent WorkQueue
+ https://bugs.webkit.org/show_bug.cgi?id=30953
+
+ DumpRenderTree/WorkQueue and DumpRenderTree/qt/WorkQueue share mostly the
+ same implementation. Some Q_ASSERTs differ from ASSERTs basically. Patch
+ makes qt DRT to share this implementation (as gtk and mac ports do).
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/WorkQueue.cpp: Removed.
+ * DumpRenderTree/qt/WorkQueue.h: Removed.
+
+2009-10-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed potential buildbot fix.
+
+ Second try: Reset page history before running each test.
+
+ Apparently the QWebHistory::clear() keeps the current page
+ in history which is not what we want, so we not additionally
+ sets the history capacity to 0 (forces removing everything)
+ and then sets it back to its original value.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+
+2009-10-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed potential buildbot fix.
+
+ Reset page history before running each test.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+
+2009-10-30 Roland Steiner <rolandsteiner@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Remove ENABLE_RUBY guards as discussed with Dave Hyatt and Maciej Stachowiak.
+
+ Bug 28420 - Implement HTML5 <ruby> rendering
+ (https://bugs.webkit.org/show_bug.cgi?id=28420)
+
+ No new tests (no functional change).
+
+ * Scripts/build-webkit:
+
+2009-10-29 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Fix “Undefined subroutine†errors in svn-*apply by moving the removeEOL subroutine
+ from the two scripts that define it but don’t use it to the script that uses it but doesn’t
+ define it.
+
+ * Scripts/VCSUtils.pm:
+ * Scripts/svn-apply:
+ * Scripts/svn-unapply:
+
+2009-10-29 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Use the GTK+ main loop instead of rolling our own mini-version of
+ it.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (dump):
+ (runTest):
+ (webViewLoadFinished):
+
+2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Implement the Qt version of DRT dumpBackForwardList().
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::dumpHistoryItem):
+ (WebCore::DumpRenderTree::dumpBackForwardList):
+
+2009-10-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Implement DRT functionality for Qt introduced in
+ r28690 and r28705.
+
+ - Implemented pathToLocalResource which exposes the functionality of
+ converting a given unix path to the correct location on Windows.
+ - Implemented a way to remove machine-dependent information from paths
+ in layout test results.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::urlSuitableForTestResult):
+ (WebCore::WebPage::javaScriptConsoleMessage):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::pathToLocalResource):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2009-10-28 Roland Steiner <rolandsteiner@chromium.org>
+
+ Adding myself to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-10-28 Chris Fleizach <cfleizach@apple.com>
+
+ Adding myself to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-10-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Jan Alonzo.
+
+ [GTK] API to start inspector for a WebView
+ https://bugs.webkit.org/show_bug.cgi?id=22551
+
+ Use the new inspector API to implement the LayoutTestController
+ interfaces used to test the inspector.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webInspectorInspectWebView):
+ (createWebView):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::evaluateInWebInspector):
+
+2009-10-28 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] WebFrame::counterValueForElementById must not be exposed
+ https://bugs.webkit.org/show_bug.cgi?id=30882
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::counterValueForElementById):
+
+2009-10-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Oliver Hunt.
+
+ Fix the warning:
+
+ "warning: ignoring return value of 'char* getcwd(char*, size_t)',
+ declared with attribute warn_unused_result".
+
+ by actually checking the result. In the case it is null, an
+ error has occoured, so treat it as the other fatal errors.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::initializeFonts):
+
+2009-10-27 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Provide a way to get counter values with layoutTestContoller
+ https://bugs.webkit.org/show_bug.cgi?id=30555
+
+ Define layoutTestContoller.counterValueForElementById.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (counterValueForElementByIdCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::counterValueForElementById):
+
+2009-10-27 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Oliver Hunt.
+
+ Change two methods to be internal for DRT use only.
+
+ Part of [Qt] Review all new API in Qt 4.6
+ https://bugs.webkit.org/show_bug.cgi?id=29843#c11
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::whiteListAccessFromOrigin):
+
+2009-10-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION: svn-apply exits(1) when applying a patch with a file add
+ https://bugs.webkit.org/show_bug.cgi?id=30826
+
+ * Scripts/svn-apply:
+ - Add () around all system() calls.
+ - Use the correct system() == 0 or die instead of system() or die
+ - Add descriptive messages to all die statements.
+
+2009-10-27 Steve Block <steveblock@google.com>
+
+ Reviewed by NOBODY.
+
+ Adds steveblock@google.com to list of committers.
+
+ * Scripts/modules/committers.py: Adds steveblock@google.com to list of committers.
+
+2009-10-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ svn-apply can exit(0) even on patch failure
+ https://bugs.webkit.org/show_bug.cgi?id=29622
+
+ * Scripts/svn-apply:
+ - Add a bunch of "or die" statements, hopefully catching all
+ possible cases where failure could still exit(0).
+
+2009-10-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ svn-* scripts should share code through VCSUtils.pm
+ https://bugs.webkit.org/show_bug.cgi?id=30791
+
+ Just moving code into a shared location.
+
+ * Scripts/VCSUtils.pm:
+ * Scripts/prepare-ChangeLog:
+ * Scripts/resolve-ChangeLogs:
+ * Scripts/svn-apply:
+ * Scripts/svn-create-patch:
+ * Scripts/svn-unapply:
+ * Scripts/update-webkit:
+
+2009-10-27 Vadim Zeitlin <vadim@wxwidgets.org>
+
+ Suppress a huge number of MSVC warnings when building wxWebKit.
+
+ * wx/build/settings.py:
+
+2009-10-26 Eric Seidel <eric@webkit.org>
+
+ No review, just adding Mike Belshe to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-10-26 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Darin Adler.
+
+ Make .rc files compile on Windows without depending on MFC headers
+ https://bugs.webkit.org/show_bug.cgi?id=30750
+
+ * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.rc: Use
+ windows.h instead of afxres.h because it exists even when MFC is not
+ installed, and is all that's needed here.
+
+ * FindSafari/FindSafari.rc: Ditto
+
+2009-10-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool post-diff should know how to mark commit-queue=?
+ https://bugs.webkit.org/show_bug.cgi?id=29202
+
+ * Scripts/bugzilla-tool:
+ - Add --commit-queue option to post-diff, post-commits and create-bug.
+ * Scripts/modules/bugzilla.py:
+ - Added support for --commit-queue to add_patch_to_bug and create_bug_with_patch.
+ - Added _fill_attachment_form to share code between add_patch_to_bug and create_bug_with_patch.
+
+2009-10-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool commit-queue does not notice modifications to committers.py
+ https://bugs.webkit.org/show_bug.cgi?id=30084
+
+ * Scripts/bugzilla-tool:
+ - Make commit-queue re-exec itself instead of using while(1).
+ - Add a --is-relaunch parameter to commit-queue to bypass initialization on re-launch.
+ - Add a _next_patch() method which calls exec() (and could eventually call update-webkit too).
+
+2009-10-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue will get stuck on patches if land-patches terminates unexpectedly
+ https://bugs.webkit.org/show_bug.cgi?id=30634
+
+ * Scripts/bugzilla-tool:
+ - Add a way for land-patches to exit(2) to indicate an error, but one it has handled.
+ - Make commit-queue auto cq- any patch where land-patches exited anything other than '0' or '2'.
+
+2009-10-26 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Upgrade pywebsocket to 0.4.1. This will make reusing LayoutTests/fast/js/resources easier, for example.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30763
+
+ * pywebsocket/mod_pywebsocket/__init__.py:
+ * pywebsocket/mod_pywebsocket/dispatch.py:
+ * pywebsocket/mod_pywebsocket/headerparserhandler.py:
+ * pywebsocket/mod_pywebsocket/standalone.py:
+ * pywebsocket/setup.py:
+ * pywebsocket/test/test_dispatch.py:
+
+2009-10-26 Carol Szabo <carol.szabo@nokia.com>
+
+ Reviewed by David Levin.
+
+ REGRESSION: 2 failures in run-webkit-unittests
+ https://bugs.webkit.org/show_bug.cgi?id=30645
+
+ * Scripts/modules/cpp_style_unittest.py:
+ Fixed a few test scenarios which apparently lost some spaces from
+ text literals.
+
+2009-10-26 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Make sure isQt() doesn't return true if --wx was passed to build-webkit.
+
+ * Scripts/webkitdirs.pm:
+
+2009-10-26 Csaba Osztrogonác <ossy@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Unification of using null device in perl scripts.
+ https://bugs.webkit.org/show_bug.cgi?id=30572
+
+ * Scripts/VCSUtils.pm:
+ * Scripts/bisect-builds:
+ * Scripts/resolve-ChangeLogs:
+ * Scripts/run-iexploder-tests:
+ * Scripts/run-jsc:
+ * Scripts/run-mangleme-tests:
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+ Using File::Spec->devnull() instead of hard coded /dev/null.
+
+2009-10-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ Reviewers are missing from committers.py
+ https://bugs.webkit.org/show_bug.cgi?id=30733
+
+ * Scripts/modules/committers.py:
+
+2009-10-23 Eric Seidel <eric@webkit.org>
+
+ No review, only adding Alice to the list of reviewers.
+
+ * Scripts/modules/committers.py:
+
+2009-10-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Eric Carlson.
+
+ fast/media/mq-transform-02.html failed on Leopard Commit Bot
+ https://bugs.webkit.org/show_bug.cgi?id=30700
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues): Update QuickTime version check.
+
+2009-10-23 Kevin Ollivier <kevino@theolliviers.com>
+
+ wxMac 10.4 build fix, needs to link against WebKitSystemInterfaceTiger to get
+ character measurement APIs that are private on Tiger.
+
+ * wx/build/settings.py:
+
+2009-10-22 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by NOBODY (build fix).
+ Build fix following bug #30696.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::evaluateScriptInIsolatedWorld):
+
+2009-10-22 Gavin Barraclough <barraclough@apple.com>
+
+ Reviewed by Sam Weinig & Geoff Garen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30696
+ Enable isolated-worlds tests on mac.
+
+ Add private interface for DRT to invoke execution in a given world.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (evaluateScriptInIsolatedWorldCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::evaluateScriptInIsolatedWorld):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::evaluateScriptInIsolatedWorld):
+
+2009-10-21 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool's "patch failed to download an apply" error should give more information
+ https://bugs.webkit.org/show_bug.cgi?id=30632
+
+ * Scripts/modules/scm.py:
+ - Use the common run_command method instead of custom POpen code.
+ - Make run_command know how to take pipes as input.
+ * Scripts/modules/scm_unittest.py:
+ - Add new tests to cover change.
+ - Also move test_error_handlers into new SCMClassTests so we don't run it 3 times.
+
+2009-10-21 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed. Adding myself to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-10-21 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Update the Windows installer builder to work with Vista / Win 7 and with git.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30649
+
+ * wx/build/build_utils.py:
+ * wx/packaging/build-mac-installer.py:
+ * wx/packaging/build-win-installer.py:
+ * wx/packaging/wxWebKitInstaller.iss.in:
+
+2009-10-21 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ [GTK] Added conditional code to avoid using
+ gdk_window_get_root_coords if we do not have a gtk+ release newer
+ than 2.17.3.
+ https://bugs.webkit.org/show_bug.cgi?id=30636
+
+ * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+
+2009-10-21 Shu Chang <Chang.Shu@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] Added dummy implementation for keepWebHistory()
+ https://bugs.webkit.org/show_bug.cgi?id=30592
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::keepWebHistory):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2009-10-21 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Fixed the double click condition, it is not double click if
+ we move in just in one direction.
+ https://bugs.webkit.org/show_bug.cgi?id=30636
+
+ * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+
+2009-10-21 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Initialize the events completly before emitting them.
+ https://bugs.webkit.org/show_bug.cgi?id=30633
+
+ * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+
+2009-10-21 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Fix for when linking using --as-needed with gcc.
+
+ * wx/browser/wscript:
+
+2009-10-21 Kevin Ollivier <kevino@theolliviers.com>
+
+ wxMac 10.4 build fix. Build and link against a version of libcurl new enough
+ to support all the features used by CURL backend.
+
+ * wx/build/settings.py:
+ * wx/install-unix-extras:
+
+2009-10-20 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add {ager,antonm,yurys}@chromium.org into committers.py
+ https://bugs.webkit.org/show_bug.cgi?id=30560
+
+ * Scripts/modules/committers.py:
+
+2009-10-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Make the Netscape Test plugin available to the Qt launcher.
+
+ * Scripts/run-launcher:
+
+2009-10-20 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by David Levin.
+
+ Removed WebSocket runtime settings.
+ https://bugs.webkit.org/show_bug.cgi?id=29896
+
+ WebSocket runtime configuration is supported by chromium/v8 only.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2009-10-19 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add testFail() to test plugin so we can test our handling of a
+ plugin invoke call returning false.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30239
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: Add testFail().
+ (pluginInvoke):
+ (testIdentifierToString): Always return true, since returning false will now cause an exception to be thrown.
+
+2009-10-19 Zan Dobersek <zandobersek@gmail.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Enable DOM pasting when running layout tests.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2009-10-18 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Use the setPreferredContentsSize method instead
+ of setFixedContentsSize, as the method has been renamed.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::open):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setFixedContentsSize):
+
+2009-10-16 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30456
+ Fixes for new Debug_All Windows build configuration.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (sharedCFURLCache): Use new DEBUG_ALL preprocessor define for library naming.
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Remove unused DEBUG_WEBKIT_HAS_SUFFIX.
+
+2009-10-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue status bot should list which buildbot is blocking the queue
+ https://bugs.webkit.org/show_bug.cgi?id=30452
+
+ Add new methods and testing.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/buildbot.py:
+ * Scripts/modules/buildbot_unittest.py:
+
+2009-10-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ run-webkit-tests fails when CWD is not inside a WebKit checkout
+ https://bugs.webkit.org/show_bug.cgi?id=30451
+
+ * Scripts/modules/scm.py: in_working_directory shouldn't throw exceptions on failure.
+ * Scripts/modules/scm_unittest.py:
+ - Remove use of original_path (we don't need to restore the CWD).
+ - Don't use '.' to find the webkit checkout, use __file__ instead.
+
+2009-10-16 Steve Falkenburg <sfalken@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Add a Debug_All configuration to build entire stack as debug.
+ Change Debug_Internal to:
+ - stop using _debug suffix for all WebKit/Safari binaries
+ - not use _debug as a DLL naming suffix
+ - use non-debug C runtime lib.
+
+ * DumpRenderTree/DumpRenderTree.sln: Add Debug_All configuration.
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Add Debug_All configuration.
+ * DumpRenderTree/win/ImageDiff.vcproj: Add Debug_All configuration.
+ * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+ Add missing debug.vsprops inherited property sheet.
+ Add Debug_All configuration.
+ * FindSafari/FindSafari.vcproj: Renamed single configuration from "Release" to "all".
+ * WinLauncher/WinLauncher.vcproj:
+ Removed extraneous definitions inherited from vsprops.
+ Add Debug_All configuration.
+
+2009-10-16 Carol Szabo <carol.szabo@nokia.com>
+
+ Reviewed by David Levin.
+
+ check-webkit-style is wrong about indent checking in namespaces
+ in header files and a few other things
+ https://bugs.webkit.org/show_bug.cgi?id=30362
+
+ The few other things include:
+ + check-webkit-style does not require spaces around the equal sign
+ inside 'if' statements and around binary operators that take
+ numeric literals.
+ + check-webkit-style reports false errors for the / operator
+ when part of a filename in the #include directive.
+
+ * Scripts/modules/cpp_style.py:
+ Improved indentation checking and space checking around
+ binary operators. While the checks are still not perfect,
+ they are clearly better than before.
+ * Scripts/modules/cpp_style_unittest.py:
+ Added test cases for the newly supported checks and modified old
+ test cases to match the new guidelines
+
+2009-10-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ wxMSW build fix. Link to MSW library needed by PluginPackageWin.cpp.
+
+ * wx/build/settings.py:
+
+2009-10-15 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by David Levin.
+
+ Add mod_pywebsocket to test Web Sockets.
+ http://code.google.com/p/pywebsocket/
+ https://bugs.webkit.org/show_bug.cgi?id=27490
+
+ * pywebsocket/COPYING: Added.
+ * pywebsocket/MANIFEST.in: Added.
+ * pywebsocket/README: Added.
+ * pywebsocket/example/echo_client.py: Added.
+ * pywebsocket/example/echo_wsh.py: Added.
+ * pywebsocket/mod_pywebsocket/__init__.py: Added.
+ * pywebsocket/mod_pywebsocket/dispatch.py: Added.
+ * pywebsocket/mod_pywebsocket/handshake.py: Added.
+ * pywebsocket/mod_pywebsocket/headerparserhandler.py: Added.
+ * pywebsocket/mod_pywebsocket/msgutil.py: Added.
+ * pywebsocket/mod_pywebsocket/standalone.py: Added.
+ * pywebsocket/mod_pywebsocket/util.py: Added.
+ * pywebsocket/setup.py: Added.
+ * pywebsocket/test/config.py: Added.
+ * pywebsocket/test/mock.py: Added.
+ * pywebsocket/test/run_all.py: Added.
+ * pywebsocket/test/test_dispatch.py: Added.
+ * pywebsocket/test/test_handshake.py: Added.
+ * pywebsocket/test/test_mock.py: Added.
+ * pywebsocket/test/test_msgutil.py: Added.
+ * pywebsocket/test/test_util.py: Added.
+ * pywebsocket/test/testdata/handlers/blank_wsh.py: Added.
+ * pywebsocket/test/testdata/handlers/origin_check_wsh.py: Added.
+ * pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py: Added.
+ * pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py: Added.
+ * pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py: Added.
+ * pywebsocket/test/testdata/handlers/sub/plain_wsh.py: Added.
+ * pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py: Added.
+ * pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py: Added.
+
+2009-10-15 James Robinson <jamesr@google.com>
+
+ Reviewed by David Levin.
+
+ Updates check-webkit-style to reflect that code inside a namespace should not be indented, even in a header file.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30426
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-10-15 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Fixes <http://webkit.org/b/30411>.
+ REGRESSION(49485): pdevenv doesn't compile in parallel for non-chromium builds on Windows.
+
+ Added a check for isChromium() in pdevenv, and pass /useenv if we are not
+ building Chromium.
+
+ * Scripts/pdevenv:
+
+2009-10-15 Robin Dunn <robin@alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Add Mac package building scripts for wx.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30405
+
+ * wx/build/build_utils.py:
+ * wx/build/settings.py:
+ * wx/packaging/build-mac-installer.py: Added.
+
+2009-10-15 Zan Dobersek <zandobersek@gmail.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Enable Web Sockets support when running layout tests.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2009-10-15 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Need to initialize event.button.button, since in most cases a
+ button number is not passed as an argument.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (mouseDownCallback):
+ (mouseUpCallback):
+
+2009-10-15 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. More SDK fixes for Mac, make sure we use the SDK corresponding to
+ the OS if none was explicitly set.
+
+ * wx/build/settings.py:
+
+2009-10-14 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: enable developers extras within inspector layout tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30014
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+
+2009-10-14 José Millán Soto <jmillan@igalia.com>
+
+ Reviewed by Jan Alonzo.
+
+ GtkLauncher is using a deprecated signal
+ https://bugs.webkit.org/show_bug.cgi?id=30364
+
+ Modified GtkLauncher to use notify::title signal instead of
+ deprecated title-changed signal
+
+ * GtkLauncher/main.c:
+ (notify_title_cb):
+ (create_browser):
+
+2009-10-14 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Don't set the history delegate on new windows that are opened during a test, as the history delegate:
+ 1 - Disables WebHistory
+ 2 - Doesn't make sense in that context anyway.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (createWebViewAndOffscreenWindow):
+
+2009-10-14 Kevin Ollivier <kevino@theolliviers.com>
+
+ wxMac build fix. Ensure 10.4 compatibility for deps, and allow the user to specify
+ the SDK to use since Python overrides any user-set value of MACOSX_DEPLOYMENT_TARGET.
+
+ * wx/build/settings.py:
+ * wx/install-unix-extras:
+
+2009-10-14 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ WebKit Win API should provide a delegate interface for global history.
+ https://bugs.webkit.org/show_bug.cgi?id=29905
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::dumpHistoryDelegateCallbacks):
+ (LayoutTestController::setDumpHistoryDelegateCallbacks):
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (shouldLogHistoryDelegates):
+ (runTest):
+ (createWebViewAndOffscreenWindow):
+ (main):
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+
+ Add the IWebHistoryDelegate to DRT Windows:
+ * DumpRenderTree/win/HistoryDelegate.cpp: Added.
+ (wstringFromBSTR):
+ (HistoryDelegate::HistoryDelegate):
+ (HistoryDelegate::~HistoryDelegate):
+ (HistoryDelegate::QueryInterface):
+ (HistoryDelegate::AddRef):
+ (HistoryDelegate::Release):
+ (HistoryDelegate::didNavigateWithNavigationData):
+ (HistoryDelegate::didPerformClientRedirectFromURL):
+ (HistoryDelegate::didPerformServerRedirectFromURL):
+ (HistoryDelegate::updateHistoryTitle):
+ (HistoryDelegate::populateVisitedLinksForWebView):
+ * DumpRenderTree/win/HistoryDelegate.h: Added.
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::removeAllVisitedLinks):
+
+2009-10-14 Shu Chang <Chang.Shu@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Implement support for setPOSIXLocale on Qt.
+ https://bugs.webkit.org/show_bug.cgi?id=30268
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::setPOSIXLocale):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2009-10-13 Stephanie Lewis <slewis@apple.com>
+
+ Unreviewed, adding myself to reviewers list.
+
+ * Scripts/modules/committers.py:
+
+2009-10-13 Stephanie Lewis <slewis@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Fix null assignment so root tests work again.
+
+ * Scripts/webkitdirs.pm:
+
+2009-10-13 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Refactor LayoutTestController, EventSender, TextInputController and WorkQueueItem classes
+ out of jsobjects into separate files to get a more structured DumpRenderTree implementation.
+ This is done in preparation of implementing missing features in DRT.
+ No functionality changes made yet.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/EventSenderQt.cpp: Added.
+ (EventSender::EventSender):
+ (EventSender::mouseDown):
+ (EventSender::mouseUp):
+ (EventSender::mouseMoveTo):
+ (EventSender::leapForward):
+ (EventSender::keyDown):
+ (EventSender::contextClick):
+ (EventSender::scheduleAsynchronousClick):
+ (EventSender::frameUnderMouse):
+ * DumpRenderTree/qt/EventSenderQt.h: Added.
+ (EventSender::clearKillRing):
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp: Added.
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::reset):
+ (LayoutTestController::processWork):
+ (LayoutTestController::maybeDump):
+ (LayoutTestController::waitUntilDone):
+ (LayoutTestController::notifyDone):
+ (LayoutTestController::windowCount):
+ (LayoutTestController::clearBackForwardList):
+ (LayoutTestController::dumpEditingCallbacks):
+ (LayoutTestController::dumpResourceLoadCallbacks):
+ (LayoutTestController::queueBackNavigation):
+ (LayoutTestController::queueForwardNavigation):
+ (LayoutTestController::queueLoad):
+ (LayoutTestController::queueReload):
+ (LayoutTestController::queueScript):
+ (LayoutTestController::provisionalLoad):
+ (LayoutTestController::timerEvent):
+ (LayoutTestController::encodeHostName):
+ (LayoutTestController::decodeHostName):
+ (LayoutTestController::setJavaScriptProfilingEnabled):
+ (LayoutTestController::setFixedContentsSize):
+ (LayoutTestController::setPrivateBrowsingEnabled):
+ (LayoutTestController::setPopupBlockingEnabled):
+ (LayoutTestController::pauseAnimationAtTimeOnElementWithId):
+ (LayoutTestController::pauseTransitionAtTimeOnElementWithId):
+ (LayoutTestController::numberOfActiveAnimations):
+ (LayoutTestController::disableImageLoading):
+ (LayoutTestController::dispatchPendingLoadRequests):
+ (LayoutTestController::setDatabaseQuota):
+ (LayoutTestController::clearAllDatabases):
+ (LayoutTestController::whiteListAccessFromOrigin):
+ (LayoutTestController::waitForPolicyDelegate):
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h: Added.
+ (LayoutTestController::isLoading):
+ (LayoutTestController::setLoading):
+ (LayoutTestController::shouldDumpAsText):
+ (LayoutTestController::shouldDumpBackForwardList):
+ (LayoutTestController::shouldDumpChildrenAsText):
+ (LayoutTestController::shouldDumpDatabaseCallbacks):
+ (LayoutTestController::shouldDumpStatusCallbacks):
+ (LayoutTestController::shouldWaitUntilDone):
+ (LayoutTestController::canOpenWindows):
+ (LayoutTestController::shouldDumpTitleChanges):
+ (LayoutTestController::waitForPolicy):
+ (LayoutTestController::dumpAsText):
+ (LayoutTestController::dumpChildFramesAsText):
+ (LayoutTestController::dumpDatabaseCallbacks):
+ (LayoutTestController::dumpStatusCallbacks):
+ (LayoutTestController::setCanOpenWindows):
+ (LayoutTestController::dumpBackForwardList):
+ (LayoutTestController::setCloseRemainingWindowsWhenComplete):
+ (LayoutTestController::display):
+ (LayoutTestController::dumpTitleChanges):
+ (LayoutTestController::dumpSelectionRect):
+ * DumpRenderTree/qt/TextInputControllerQt.cpp: Added.
+ (TextInputController::TextInputController):
+ (TextInputController::doCommand):
+ * DumpRenderTree/qt/TextInputControllerQt.h: Added.
+ * DumpRenderTree/qt/WorkQueue.cpp:
+ * DumpRenderTree/qt/WorkQueue.h:
+ * DumpRenderTree/qt/WorkQueueItem.h:
+ * DumpRenderTree/qt/WorkQueueItemQt.cpp: Added.
+ (findFrameNamed):
+ (LoadItem::invoke):
+ (ReloadItem::invoke):
+ (ScriptItem::invoke):
+ (BackForwardItem::invoke):
+ * DumpRenderTree/qt/jsobjects.cpp: Move all the above classes into separate files
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-10-13 Dmitry Titov <dimich@chromium.org>
+
+ Not reviewed, adding myself to the list of reviewers.
+
+ * Scripts/modules/committers.py:
+
+2009-10-13 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <rdar://problem/6660507> Add "privacy mode" to Netscape Plug-in API
+
+ Make the private browsing mode testable by the test plug-in.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginGetProperty):
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New):
+ (NPP_SetValue):
+
+2009-10-13 Pavel Feldman <pfeldman@chromium.org>
+
+ No review, just adding self to the list of reviewers.
+
+ * Scripts/modules/committers.py:
+
+2009-10-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Adam Roben.
+
+ Web Inspector: Use proper web view in inspector layout
+ tests for windows.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30298
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::evaluateInWebInspector):
+
+2009-10-12 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Sam Weinig.
+
+ Enable experimentalWebSocket in DumpRenderTree for LayoutTest.
+ https://bugs.webkit.org/show_bug.cgi?id=29841
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2009-10-12 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Chromium Port - Windows
+ https://bugs.webkit.org/show_bug.cgi?id=29969
+
+ * Scripts/pdevenv: removed msvc's /useenv for chromium builds
+ * Scripts/webkitdirs.pm:
+
+2009-10-12 Csaba Osztrogonac <ossy@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ jsc scripts cleanup and Qt/GTK fix
+ https://bugs.webkit.org/show_bug.cgi?id=30288
+
+ Duplicated jscPath() moved to webkitdirs.pm.
+ New jscProductDir() added to webkitdirs.pm instead of duplicated codes.
+ Configuration added (release/debug) to path for Qt-port on Windows.
+
+ * Scripts/run-javascriptcore-tests:
+ * Scripts/run-jsc:
+ * Scripts/run-sunspider:
+ * Scripts/sunspider-compare-results:
+ * Scripts/webkitdirs.pm:
+
+2009-10-11 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Add Collin to committers.py.
+
+ * Scripts/modules/committers.py:
+
+2009-10-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix, add bindings to source/include dirs now that there are sources there.
+
+ * wx/build/settings.py:
+
+2009-10-09 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ Enable plug-in halting in DumpRenderTree.
+
+ We drop the plug-in halting delay to 1 second and opt in the delegate method to never halt plug-ins.
+ This is sufficient to ensure that the crash covered by <rdar://problem/7290671> no longer occurs.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/mac/UIDelegate.mm:
+ (-[UIDelegate webView:shouldHaltPlugin:]):
+
+2009-10-08 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Ask the History Delegate to populate the visited links hash.
+ <rdar://problem/7285293> and https://webkit.org/b/29904
+
+ Add the ability for LayoutTestController to clear all visited links.
+ Also lets the History Delegate dump visited links, but only if this test specifically cleared them.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (removeAllVisitedLinksCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::removeAllVisitedLinks):
+
+ * DumpRenderTree/mac/HistoryDelegate.mm:
+ (-[HistoryDelegate populateVisitedLinksForWebView:]):
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::removeAllVisitedLinks):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::removeAllVisitedLinks):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::removeAllVisitedLinks):
+
+
+2009-10-08 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30175
+
+ The Windows DRT equivalent of DoDragDrop (i.e. UIDelegate::doDragDrop) does not return
+ the OLE drag-and-drop return value like the function it emulates. Currently,
+ UIDelegate::doDragDrop returns a hard-coded S_OK. Hence, the caller cannot determine
+ whether the drag-and-drop operation was successful or was cancelled.
+
+ This patch fixes this issue by having UIDelegate::doDragDrop return the OLE drag-and-drop
+ return value according to whether the drop operation was successful or not.
+
+ * DumpRenderTree/win/EventSender.cpp:
+ (doMouseUp): Added parameter oleDragAndDropReturnValue.
+ (replaySavedEvents): Ditto.
+ * DumpRenderTree/win/EventSender.h:
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::doDragDrop): Modified to return OLE drag-and-drop return value.
+
+2009-10-08 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Added support for a parameter setting the button that was
+ pressed in the mouseDown function.
+ https://bugs.webkit.org/show_bug.cgi?id=30220
+
+ * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+
+2009-10-08 Alejandro G. Castro <alex@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Added a line to the bottom of the expected result to match
+ the output of the test.
+ https://bugs.webkit.org/show_bug.cgi?id=30220
+
+ * LayoutTests/platform/gtk/editing/pasteboard/middle-click-onpaste-
+ expected.txt:
+
+2009-10-08 Adam Roben <aroben@apple.com>
+
+ Use QueryInterface to get IWebInspectorPrivate
+
+ Fixes <http://webkit.org/b/30215> Make IWebInspectorPrivate be
+ accessed in a more standard way
+
+ Reviewed by John Sullivan and Tim Hatcher.
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::evaluateInWebInspector): Get the IWebInspector
+ by calling IWebViewPrivate::inspector, then use QueryInterface to get
+ to the IWebInspectorPrivate interface.
+
+2009-10-07 Adam Roben <aroben@apple.com>
+
+ Implement DRT support for origin whitelisting
+
+ Fixes <http://webkit.org/b/30185>.
+
+ Reviewed by Eric Seidel.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting): Reset any origin
+ whitelist, to match Mac DRT.
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::whiteListAccessFromOrigin): Call through to
+ IWebViewPrivate::whiteListAccessFromOrigin.
+
+2009-10-07 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Send title changes to the global history delegate.
+ <rdar://problem/7285293> and https://webkit.org/b/29904
+
+ * DumpRenderTree/mac/HistoryDelegate.mm:
+ (-[HistoryDelegate webView:updateHistoryTitle:forURL:]):
+
+2009-10-07 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Remove some folks from committers.py who were listed on
+ the WebKit Team wiki page but who weren't actually listed as commit+.
+ At some point, we should coorelate this list with the committers
+ mailing list.
+
+ * Scripts/modules/committers.py:
+
+2009-10-07 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Import a bunch of committers from the WebKit Team page on
+ the wiki into committers.py.
+
+ * Scripts/modules/committers.py:
+
+2009-10-07 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Added Aaron Boodman to committers.py.
+
+ * Scripts/modules/committers.py:
+
+2009-10-07 Evan Martin <evan@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Add API to LayoutTestController for re/setting the system locale.
+ https://bugs.webkit.org/show_bug.cgi?id=18994
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setLocaleCallback):
+ (LayoutTestController::staticFunctions):
+ (LayoutTestController::setLocale):
+ * DumpRenderTree/LayoutTestController.h:
+
+2009-10-06 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Jan Alonzo.
+
+ [Layout tests] [Gtk] Gtk DumpRenderTree should use WebKit test fonts
+ https://bugs.webkit.org/show_bug.cgi?id=29689
+
+ Build fix by adding -lfontconfig for DumpRenderTree.
+
+ * GNUmakefile.am:
+
+2009-10-07 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Re-enable use-remote-links-to-tests for Qt. Disabled in r46416.
+
+ * Scripts/run-webkit-tests:
+
+2009-10-07 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ "delete" in EventSender is the backspace key, not the delete one.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (keyDownCallback):
+
+2009-10-07 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ getChildrenWithRange expects as last parameter the end index, not
+ the length of the range. Correct this and clarify the variable
+ names to reflect how the code works.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::getChildrenWithRange):
+ (AccessibilityUIElement::getChildAtIndex):
+
+2009-10-06 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ <http://webkit.org/b/30138> update-webkit-localizable-strings assumes that WebKitTools/Scripts is in the PATH
+
+ * Scripts/update-webkit-localizable-strings: Use an explicit path to extract-localizable-strings based on the
+ the fact we have already changed the working directory to the top of the open source tree.
+
+2009-10-06 Julie Parent <jparent@chromium.org>
+
+ Unreviewed. Fixing the entry for myself in committers.py to use my bugzilla email,
+ rather than my committer email.
+
+ * Scripts/modules/committers.py:
+
+2009-10-06 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Eric Seidel.
+
+ [Qt] LayoutTestController: Reset m_dumpStatusCallbacks to false in reset().
+
+ r49189 added support for the 'dumpStatusCallbacks' setting but didn't reset
+ it after each layout test as it should do, making the DRT dump additional output
+ for all of the subsequent layout tests.
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::reset):
+
+2009-10-06 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Implement layoutTestController.dumpStatusCallbacks() and unskip the
+ fast/dom/assign-to-window-status.html test, which is passing as a result.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30127
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::statusBarMessage):
+ * DumpRenderTree/qt/DumpRenderTree.h:
+ * DumpRenderTree/qt/jsobjects.h:
+ (LayoutTestController::shouldDumpStatusCallbacks):
+ (LayoutTestController::dumpStatusCallbacks):
+
+2009-10-06 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] The implementation of EventSender::mouseUp() and EventSender::mouseDown()
+ ignores the argument indicating which mouse button to trigger.
+ https://bugs.webkit.org/show_bug.cgi?id=30048
+
+ This affects the fast/events/mouse-click-events.html layout test.
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (EventSender::mouseDown):
+ (EventSender::mouseUp):
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-10-06 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix the EventSender::keyDown() implementation
+ https://bugs.webkit.org/show_bug.cgi?id=30043
+
+ It should post both a key press event and a key release event,
+ just like other ports do.
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (EventSender::keyDown):
+
+2009-10-05 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Add jpeg to the list of libs to link against.
+
+ * wx/build/settings.py:
+
+2009-10-05 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] EventSender::keyDown() cannot send function-key events.
+ https://bugs.webkit.org/show_bug.cgi?id=30044
+
+ This affects the fast/events/keydown-function-keys.html layout test.
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (EventSender::keyDown):
+
+2009-10-05 Vadim Zeitlin <vadim@wxwidgets.org>
+
+ Added --wx-compiler-prefix waf option to allow building wxWebKit with
+ wxWidgets built using "nmake COMPILER_PREFIX=something-non-default".
+
+ * wx/build/settings.py:
+ * wx/build/wxpresets.py:
+
+2009-10-05 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: add testing harness for Web Inspector.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30010
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (showWebInspectorCallback):
+ (closeWebInspectorCallback):
+ (evaluateInWebInspectorCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::evaluateInWebInspector):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::evaluateInWebInspector):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::evaluateInWebInspector):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::showWebInspector):
+ (LayoutTestController::closeWebInspector):
+ (LayoutTestController::evaluateInWebInspector):
+
+2009-10-05 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Ariyha Hidayat.
+
+ Pass arguments to system() as a string instead of array
+
+ When passed as an array entries with a space fail to translate
+ to two arguments to the child process, so instead of manually
+ splitting all the entries in @buildArgs we pass the whole thing
+ as a string instead.
+
+ * Scripts/webkitdirs.pm:
+
+2009-10-04 Carol Szabo <carol.szabo@nokia.com>
+
+ Reviewed by David Levin.
+
+ check-webkit-style misses whitespace errors for operators:
+ <<, >>, <<=, >>=, &=, |=, +=, -=, *=, /=, /, |, &&, ||.
+ https://bugs.webkit.org/show_bug.cgi?id=30021
+
+ * Scripts/modules/cpp_style.py:
+ Added the operators mentioned above to the same list as == and !=.
+
+2009-10-02 Julie Parent <jparent@chromium.org>
+
+ Unreviewed.
+
+ Adding myself and Ojan Vafai as committers, because we are committers.
+
+ * Scripts/modules/committers.py:
+
+2009-10-02 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Adam Roben.
+
+ svn-create-patch should have an --ignore-changelogs to not add ChangeLogs to the diff,
+ this will help the patch merging process when TryBots are used.
+
+ * Scripts/svn-create-patch:
+
+2009-10-02 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Implement layoutTestController.overridePreference().
+ https://bugs.webkit.org/show_bug.cgi?id=29970
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::resetSettings):
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::setPrivateBrowsingEnabled):
+ (LayoutTestController::setPopupBlockingEnabled):
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-10-01 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Turn on ENABLE_3D_CANVAS in TOT
+ https://bugs.webkit.org/show_bug.cgi?id=29906
+
+ * Scripts/build-webkit:
+
+2009-10-01 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Rubberstamped by Simon Hausmann.
+
+ Enable HTTP tests for Qt
+
+ * Scripts/run-webkit-tests:
+
+2009-10-01 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ build-webkit --chromium now also works on cygwin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29973
+
+ * Scripts/webkitdirs.pm:
+
+2009-10-01 Zoltan Horvath <zoltan@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Don't use TCmalloc in DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=27029
+
+ Add USE_SYSTEM_MALLOC macro to the DRT's profile to avoid using TCmalloc in Qt's DRT.
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+
+2009-10-01 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Implement eventSender.scheduleAsynchronousClick().
+
+ https://bugs.webkit.org/show_bug.cgi?id=29931
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (EventSender::scheduleAsynchronousClick):
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-10-01 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Implement setPopupBlockingEnabled() in the LayoutTestController and remove
+ fast/events/open-window-from-another-frame.html from the Skipped list.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29930
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::setPopupBlockingEnabled):
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-09-30 Cameron McCormack <cam@mcc.id.au>
+
+ Unreviewed.
+
+ Added myself to the list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-09-30 Eric Seidel <eric@webkit.org>
+
+ No review, just adding Geoff to the list of reviewers.
+
+ * Scripts/modules/committers.py:
+
+2009-09-30 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Added the WebKit Layout Tests fonts that are referenced in
+ LayoutTests/platform/win/css2.1/resources/Mac-compatible-font-fallback.css
+
+ * DumpRenderTree/fonts/WebKit Layout Tests 2.ttf: Added.
+ * DumpRenderTree/fonts/WebKit Layout Tests.ttf: Added.
+
+2009-09-30 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+
+ Reviewed by David Kilzer.
+
+ Make sunspider scripts work on Windows platform.
+ https://bugs.webkit.org/show_bug.cgi?id=29656
+
+ * Scripts/run-sunspider: Perl scripts invoked with same Perl interpreter.
+ * Scripts/sunspider-compare-results: Perl scripts invoked with same Perl interpreter.
+ * Scripts/webkitdirs.pm: currentPerlPath() added.
+
+2009-09-29 Brady Eidson <beidson@apple.com>
+
+ Rubberstamped by Dan Bernstein.
+
+ Fix license and some sorting in new files.
+
+ * DumpRenderTree/mac/HistoryDelegate.h:
+ * DumpRenderTree/mac/HistoryDelegate.mm:
+
+2009-09-29 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by David Kilzer.
+
+ Fixed how error codes are handled.
+ https://bugs.webkit.org/show_bug.cgi?id=29898
+
+ * Scripts/update-webkit:
+ * Scripts/update-webkit-chromium:
+
+2009-09-29 Brady Eidson <beidson@apple.com>
+
+ Reviewed by John Sullivan.
+
+ Updated way-out-of-date sorting throughout the dump methods/flags.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (dumpAsPDFCallback):
+ (dumpAsTextCallback):
+ (dumpFrameLoadCallbacksCallback):
+ (dumpResourceLoadCallbacksCallback):
+ (LayoutTestController::staticFunctions):
+
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::dumpAsText):
+ (LayoutTestController::setDumpAsText):
+ (LayoutTestController::dumpFrameLoadCallbacks):
+ (LayoutTestController::setDumpFrameLoadCallbacks):
+ (LayoutTestController::dumpSelectionRect):
+ (LayoutTestController::setDumpSelectionRect):
+ (LayoutTestController::dumpSourceAsWebArchive):
+ (LayoutTestController::setDumpSourceAsWebArchive):
+ (LayoutTestController::dumpStatusCallbacks):
+ (LayoutTestController::setDumpStatusCallbacks):
+ (LayoutTestController::dumpTitleChanges):
+ (LayoutTestController::setDumpTitleChanges):
+ (LayoutTestController::dumpWillCacheResponse):
+ (LayoutTestController::setDumpWillCacheResponse):
+
+2009-09-29 Brady Eidson <beidson@apple.com>
+
+ Reviewed by John Sullivan.
+
+ WebKit Mac API should provide a delegate interface for global history.
+ <rdar://problem/7042773> and https://webkit.org/b/29904
+
+ Adding the dumping of global history delegate callbacks.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+
+ Automatically dump history delegate callbacks for tests with "globalhistory/" in their URL:
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (createWebViewAndOffscreenWindow):
+ (allocateGlobalControllers):
+ (shouldLogFrameLoadDelegates):
+ (shouldLogHistoryDelegates):
+ (runTest):
+
+ Dump history delegate callbacks:
+ * DumpRenderTree/mac/HistoryDelegate.h: Added.
+ * DumpRenderTree/mac/HistoryDelegate.mm: Added.
+ (-[HistoryDelegate webView:didNavigateWithNavigationData:inFrame:]):
+ (-[HistoryDelegate webView:didPerformClientRedirectFromURL:toURL:inFrame:]):
+ (-[HistoryDelegate webView:didPerformServerRedirectFromURL:toURL:inFrame:]):
+
+2009-09-29 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28902
+
+ Fixes an issue where the drop effect returned by Window Dump Render Tree
+ was always DROPEFFECT_NONE (since it was hard coded to do so).
+
+ This patch corrects this issue by determining the actual drop effect
+ performed by the corresponding drag-and-drop operation so that we can
+ return it.
+
+ * DumpRenderTree/win/DraggingInfo.h: Added field m_dropEffect to store performed drop effect.
+ (DraggingInfo::DraggingInfo):
+ (DraggingInfo::performedDropEffect): Added method.
+ (DraggingInfo::setPerformedDropEffect): Added method.
+ * DumpRenderTree/win/EventSender.cpp:
+ (doMouseUp): Calls method DraggingInfo::setPerformedDropEffect with performed drop effect.
+ Moved delete draggingInfo to UIDelegate::doDragDrop.
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::doDragDrop): Sets performedDropEffect to DraggingInfo::performedDropEffect().
+
+2009-09-29 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Adam Roben.
+
+ Remove copying of unnecessary or nonexistent files from the ImageDiff
+ post-build event.
+
+ * DumpRenderTree/win/ImageDiff.vcproj:
+
+2009-09-29 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+
+ Reviewed by David Kilzer.
+
+ [Qt] Make build-webkit script work on Windows
+ https://bugs.webkit.org/show_bug.cgi?id=29802
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+ - Removed unnecessary -p switch for mkdir on Windows.
+ - Use canonical path, which uses slashes or backslashes depends on platform.
+ - isWindows() only test for Windows and not for Cyqwin.
+
+2009-09-29 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Fix time measurement in build-webkit after refactoring done in r48853.
+
+ * Scripts/build-webkit:
+
+2009-09-29 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Default font size reconciliation to 16px/13px to match other platform's de-facto standard.
+ This fixes https://bugs.webkit.org/show_bug.cgi?id=19674.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+
+2009-09-29 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Implement eventSender.contextClick().
+ https://bugs.webkit.org/show_bug.cgi?id=29821
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (EventSender::contextClick):
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-09-28 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Add experimentalWebSocketsEnabled in WebPreferences.
+ https://bugs.webkit.org/show_bug.cgi?id=28941
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2009-09-28 Yaar Schnitman <yaar@chromium.org>
+
+ Reviewed by David Kilzer.
+
+ Integrated chromium port building into webkit tools update-webkit and
+ build-webkit.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29749
+
+ * Scripts/build-webkit: When --chromium is specified, will build
+ the chromium port (currently only Mac is supported).
+ * Scripts/update-webkit: When --chromium is specified, delegates to
+ update-webkit-chromium.
+ * Scripts/webkitdirs.pm: Added chromium specific defs.
+ * Scripts/update-webkit-chromium: Uses gclient and gyp to fetch
+ chromium port's dependencies and update its project files.
+
+2009-09-28 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-09-27 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Darin Adler.
+
+ run-webkit-tests: Do not strip the metrics when there is no expected result for a test.
+ https://bugs.webkit.org/show_bug.cgi?id=29771
+
+ * Scripts/run-webkit-tests:
+
+2009-09-27 Jakub Wieczorek <faw217@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Implement layoutTestController.waitForPolicyDelegate.
+ https://bugs.webkit.org/show_bug.cgi?id=25037
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::acceptNavigationRequest):
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::notifyDone):
+ (LayoutTestController::waitForPolicyDelegate):
+ * DumpRenderTree/qt/jsobjects.h:
+ (LayoutTestController::waitForPolicy):
+
+2009-09-26 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/29764> mark-bug-fixed: add -o|--open switch
+
+ Reviewed by Eric Seidel.
+
+ The -o|--open switch uses the open(1) command on Mac OS X to
+ open the bug URL in the default web browser. If there are
+ similar mechanisms on other platforms, they may be added later.
+
+ * Scripts/mark-bug-fixed:
+ (MarkBugFixed.__init__): Added -o|--open switch to list of parse
+ options.
+ (MarkBugFixed._determine_bug_id_and_svn_revision): Moved logging
+ code into main() and extracted prompting code into
+ _prompt_user_for_correctness().
+ (MarkBugFixed._open_bug_in_web_browser): Added.
+ (MarkBugFixed._prompt_user_for_correctness): Added.
+ (MarkBugFixed.main): Added logging code from
+ _determine_bug_id_and_svn_revision(). Added code to call
+ _open_bug_in_web_browser() if the switch is set. Added code to
+ call _prompt_user_for_correctness() when needed.
+ * Scripts/modules/bugzilla.py:
+ (Bugzilla.short_bug_url_for_bug_id): Added.
+
+2009-09-26 David Kilzer <ddkilzer@apple.com>
+
+ svn-unapply and svn-apply don't work when used outside multiple svn working directories
+
+ <http://webkit.org/b/29744>
+ <rdar://problem/7252905>
+
+ Reviewed by Eric Seidel.
+
+ Some users have a workflow where svn-create-patch, svn-apply and
+ svn-unapply are used outside of multiple svn working
+ directories. Instead of aborting the scripts in these cases,
+ print a warning and assume that Subversion is being used.
+
+ * Scripts/VCSUtils.pm:
+ (determineVCSRoot): Call warn() instead of die() if both isGit()
+ and isSVN() initially return false. Set $VCSUtils::isSVN to 1
+ to enforce the assumption about Subversion, then return
+ determineSVNRoot().
+ * Scripts/svn-apply: Switch to using isGit() and isSVN() from
+ VCSUtils.pm. They both already cache their values and checking
+ here is redundant since determineVCSRoot() is called later.
+
+2009-09-26 Zan Dobersek <zandobersek@gmail.com>
+
+ Reviewed by Gustavo Noronha.
+
+ [Layout tests] [Gtk] Gtk DumpRenderTree should use WebKit test fonts
+ https://bugs.webkit.org/show_bug.cgi?id=29689
+
+ Load test fonts through FontConfig before each test.
+ This ensures a more proper rendering of the tests.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (initializeFonts):
+ (runTest):
+ (main):
+ * DumpRenderTree/gtk/fonts.conf: Copied from WebKitTools/DumpRenderTree/qt/fonts.conf.
+ * GNUmakefile.am:
+
+2009-09-25 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/29718> mark-bug-fixed: add -u|--update-only switch
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/mark-bug-fixed:
+ (MarkBugFixed.__init__): Added -u|--update-only switch to list
+ of parse options.
+ (MarkBugFixed.main): When -u|--update-only is specified, add a
+ comment to the bug without marking it Resolved/Fixed.
+
+2009-09-25 Darin Adler <darin@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ * Scripts/prepare-ChangeLog: Leave files from the script-tests directory
+ out, just as we do for the resources directory.
+
+2009-09-25 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. Added Tony to committers.py because he's a
+ committer now.
+
+ * Scripts/modules/committers.py:
+
+2009-09-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Simon Fraser.
+
+ REGRESSION: media/video-pause-empty-events.html is occasionally timing out on bots
+ https://bugs.webkit.org/show_bug.cgi?id=28624
+
+ Disable hardware compositing on Leopard for versions of QuickTime 7.6.4 and older.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+
+2009-09-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue should auto-retry patches which fail to commit due to out of date files
+ https://bugs.webkit.org/show_bug.cgi?id=28316
+
+ * Scripts/bugzilla-tool:
+ - Handle new CheckoutNeedsUpdate exception.
+ * Scripts/modules/logging_unittest.py:
+ - Call the ScriptError constructor correctly (this test had regressed).
+ * Scripts/modules/scm.py:
+ - Added the ability to define custom error handlers for run_command
+ and added a commit_error_handler which throws CheckoutNeedsUpdate
+ instead of ScriptError.
+ - Re-ordered ScriptError constructor arguments to make ScriptError("message text") usage possible.
+ * Scripts/modules/scm_unittest.py:
+ - Added tests of new error handlers.
+
+2009-09-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue should give better feedback when failing a patch
+ https://bugs.webkit.org/show_bug.cgi?id=29316
+
+ * Scripts/bugzilla-tool:
+ - Update ScriptError uses to the new constructor format.
+ - Move CommitQueue._run_command to WebKitLandingScripts.run_command_with_teed_output
+ so that we can print to both stdout as well as an output buffer for error reporting.
+ - Update run_and_throw_if_fail to use teed output so that it can report the "output" as part of ScriptError.
+ - Use e.message_with_output() when failing a patch (this is the real fix here).
+ I also removed use of "This patch will require manual commit." as that's not always true.
+ - Add missing word "bug" from log message.
+ * Scripts/modules/scm.py:
+ - Make ScriptError save a bunch more data so that error messages can be nicer.
+ - Update ScriptError callers.
+
+2009-09-24 John Gregg <johnnyg@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Enable switch for notifications (experimental) in Page Settings
+ https://bugs.webkit.org/show_bug.cgi?id=28930
+
+ Now that desktop notifications are controlled by run-time switch,
+ set that switch to true for DumpRenderTree.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::QueryInterface):
+
+2009-09-24 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. SnowLeopard fixes for Mac dependencies.
+
+ * wx/build/build_utils.py:
+ * wx/build/settings.py:
+ * wx/install-unix-extras:
+
+2009-09-24 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Oliver Hunt.
+
+ Add support for DRT to send mouse wheel events.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29348
+ [Gtk] Scrollwheel on horizontal scrollbars should slide horizontally
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (mouseWheelToCallback):
+
+2009-09-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ commit-queue needs web-based status reporting
+ https://bugs.webkit.org/show_bug.cgi?id=29307
+
+ Add a first-pass web-based status for the commit-queue.
+ The bot is currently reachable at:
+ http://webkit-commit-queue.appspot.com/
+
+ * CommitQueueStatus/app.yaml: Added.
+ - Application description file required by App Engine.
+ * CommitQueueStatus/filters/__init__.py: Added.
+ - Required by python to treat 'filters' as a module.
+ * CommitQueueStatus/filters/webkit_extras.py: Added.
+ - Support for turning 'bug 123' and 'patch 123' into links.
+ This lets us use plain text strings in our logs yet display nice HTML (help prevent XSS attacks on the page).
+ * CommitQueueStatus/index.html: Added.
+ * CommitQueueStatus/index.yaml: Added.
+ - Some auto-generated file from app engine.
+ * CommitQueueStatus/queue_status.py: Added.
+ - The core logic of this bot. We could eventually split this file out into pieces.
+ * CommitQueueStatus/stylesheets/main.css: Added.
+ - Some basic lame-o CSS to make the page look less awful.
+ * CommitQueueStatus/update_status.html: Added.
+ - The form that the commit-queue (or a human) can use to update the status.
+ * Scripts/bugzilla-tool:
+ - Add some very basic update_status calls.
+ * Scripts/modules/statusbot.py: Added.
+ - Knows how to post to the CommitQueueStatus web application.
+
+2009-09-24 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/29712> mark-bug-fixed: add -m|--comment switch
+
+ Reviewed by Adam Roben.
+
+ * Scripts/mark-bug-fixed:
+ (MarkBugFixed.__init__): Added -m|--comment switch to list of
+ parse options.
+ (MarkBugFixed.main): When specified, prepend comment from
+ -m|--comment command-line switch to the bug comment.
+
+2009-09-24 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Jan Alonzo.
+
+ [GTK] DRT must display window instead of just realizing, to enable synthesizing events correctly
+ https://bugs.webkit.org/show_bug.cgi?id=29693
+
+ Show the window, to be able to synthesize events correctly.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (runTest):
+ (main):
+
+2009-09-24 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by NOBODY(rollout)
+
+ Roll out r48712 as it is incorrect.
+
+ * DumpRenderTree/mac/ObjCController.m:
+ (+[ObjCController isSelectorExcludedFromWebScript:]):
+ (+[ObjCController webScriptNameForSelector:]):
+
+2009-09-24 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=29005
+ The indices of RuntimeArray should be enumerated like for a regular array.
+
+ * DumpRenderTree/mac/ObjCController.m:
+ (+[ObjCController isSelectorExcludedFromWebScript:]):
+ (+[ObjCController webScriptNameForSelector:]):
+ (-[ObjCController arrayOfString]):
+
+2009-09-23 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28910> Move bugzilla-tool mark-fixed to standalone mark-bug-fixed tool
+
+ Reviewed by Darin Adler.
+
+ Also fixed a bug where specifying a revision on the command-line
+ as 'r12345' would fail. See <http://webkit.org/b/29699>.
+
+ * Scripts/bugzilla-tool: Updated module import statements.
+ (parse_bug_id): Removed. Moved to bugzilla.py.
+ (bug_comment_from_svn_revision): Removed. Moved to comments.py.
+ (bug_comment_from_commit_text): Removed. Moved to comments.py.
+ (MarkBugFixed): Removed. Code moved to mark-bug-fixed.
+ (BugzillaTool.__init__): Removed mark-fixed subcommand.
+ * Scripts/mark-bug-fixed: Added.
+ * Scripts/modules/bugzilla.py:
+ (parse_bug_id): Added. Moved from bugzilla-tool.
+ * Scripts/modules/comments.py: Added.
+ (bug_comment_from_svn_revision): Added. Moved from bugzilla-tool.
+ (bug_comment_from_commit_text): Added. Moved from bugzilla-tool.
+
+2009-09-23 Marshall Culpepper <mculpepper@appcelerator.com>
+
+ Reviewed by Eric Seidel.
+
+ jpeg.lib is now libjpeg.lib in DRT Cairo dependencies. return
+ "false" in non-implemented stub for setAlwaysAcceptCookies.
+ https://bugs.webkit.org/show_bug.cgi?id=29661
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+
+2009-09-23 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] need to dump number of pending unload handlers
+ https://bugs.webkit.org/show_bug.cgi?id=29685
+
+ Implement dumping of the number of pending unload handlers.
+
+ The following tests will pass:
+
+ fast/loader/unload-form-about-blank.html
+ fast/loader/unload-form-post-about-blank.html
+ fast/loader/unload-form-post.html
+ fast/loader/unload-form.html
+ fast/loader/unload-hyperlink.html
+ fast/loader/unload-javascript-url.html
+ fast/loader/unload-reload.html
+ fast/loader/unload-window-location.html
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (getFrameNameSuitableForTestResult):
+ (webViewLoadFinished):
+
+2009-09-22 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ js tests should move into jstests subdirectory instead of resources/
+ https://bugs.webkit.org/show_bug.cgi?id=25880
+
+ Remove support of resources directory.
+
+ * Scripts/make-script-test-wrappers:
+
+2009-09-22 Eric Seidel <eric@webkit.org>
+
+ No review, only fixing typo (missing space character).
+
+ Fix typo from https://bugs.webkit.org/show_bug.cgi?id=29220
+
+ * Scripts/run-webkit-tests:
+
+2009-09-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ run-webkit-tests needs a --repeat-each=N option (AAABBBCCC instead of ABCABCABC)
+ https://bugs.webkit.org/show_bug.cgi?id=29220
+
+ * Scripts/run-webkit-tests:
+
+2009-09-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ svn-apply can't handle single-line binary file additions
+ https://bugs.webkit.org/show_bug.cgi?id=29100
+
+ Fixed the regexp and added a unit test.
+
+ * Scripts/modules/scm_unittest.py:
+ * Scripts/svn-apply:
+
+2009-09-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ post-diff and post-commits should be able to find bug urls in ChangeLogs.
+ https://bugs.webkit.org/show_bug.cgi?id=29206
+
+ * Scripts/bugzilla-tool:
+ - Share common options by adding a PostDiffAsPatchToBug.posting_options() method.
+ - Rename --no-comment to --add-log-as-comment and reverse behavior.
+ Comments tend to just be noise. I'll eventually remove this argument if no one uses it.
+ - Split out code into helper functions to try and make execute() more legible.
+ - Make post-diff find the bug url in the ChangeLogs if not passed as an argument.
+ - Fallback to bug urls in commit diffs, instead of just in commit messages,
+ meaning post-commits will now find bug urls in ChangeLogs.
+
+2009-09-21 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+
+ Reviewed by Maciej Stachowiak.
+
+ --parse-only parameter wasn't passed to SunSpider/sunspider script.
+ https://bugs.webkit.org/show_bug.cgi?id=29611
+
+ * Scripts/run-sunspider: Missing parameter passing added.
+
+2009-09-20 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/29521> run-webkit-tests: use require instead eval to load DumpRenderTreeSupport module
+
+ Reviewed by Mark Rowe.
+
+ The require statement is like the use statement, except that it
+ is run during script execution instead of during the 'BEGIN'
+ phase. This makes it possible to change @INC before the require
+ statement is run. See 'require' and 'use' in the perlfunc(1)
+ manpage and 'BEGIN' in perlmod(1) manpage.
+
+ * Scripts/run-webkit-tests: Replace eval statement with require
+ statement.
+
+2009-09-18 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fixes. Fix the config name under git and allow users to specify
+ their own waf install for experimenting with new versions.
+
+ * Scripts/webkitdirs.pm:
+ * wx/build/settings.py:
+
+2009-09-18 Alex Milowski <alex@milowski.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Added checkWebCoreMathMLSupport and hasMathMLSupport to support
+ checking for whether MathML tests should be run
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+
+2009-08-28 Darin Adler <darin@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Break more of run-webkit-tests into separate functions
+ https://bugs.webkit.org/show_bug.cgi?id=29497
+
+ Some small steps toward improving run-webkit-tests. My goal is to
+ refactor much more of the script into functions. Later we can add
+ parallel test running to the tool. But better structure may help
+ even if someone decides to translate this into another scripting
+ language instead.
+
+ * Scripts/run-webkit-tests: Break more pieces of the script into
+ seprate functions. Added readSkippedFiles, findTestsToRun, and
+ printResults functions. Removed custom code to skip results.html
+ and instead just put it into the ignoredFiles hash. Fixed some
+ indentation. Sorted function declarations, global variables,
+ and options at the top of the file alphabetically so they're not
+ in a semi-random order.
+
+2009-09-17 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix, add missing dependency.
+
+ * wx/browser/wscript:
+
+2009-09-16 Mark Rowe <mrowe@apple.com>
+
+ Split the SnowLeopard build across a few machines.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2009-09-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix to support monolithic builds on Windows.
+
+ * wx/build/wxpresets.py:
+
+2009-09-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix, improve debug support and 2.9 support on MSW.
+
+ * wx/build/settings.py:
+ * wx/build/wxpresets.py:
+
+2009-09-16 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Blind try at fixing new test failure on Windows.
+
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ (FrameLoadDelegate::didReceiveTitle):
+
+2009-09-15 Alex Milowski <alex@milowski.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Added mathml toggle
+
+ * Scripts/build-webkit:
+
+2009-09-15 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Allow waf build to support Python < 2.6.
+
+ * wx/build/waf_extensions.py:
+
+2009-09-14 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add LayoutTests infrastructure to enable and disable webgl tests.
+ https://bugs.webkit.org/show_bug.cgi?id=29254
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+
+2009-09-14 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Add --iterations option to run-webkit-tests to repeat the tests N times
+ https://bugs.webkit.org/show_bug.cgi?id=29263
+
+ When run with --iterations N, run-webkit-tests will repeat the tests N times.
+
+ * Scripts/run-webkit-tests:
+
+2009-09-14 Brady Eidson <beidson@apple.com>
+
+ Not reviewed, maybe should've been:
+
+ Cleaning up more Windows-specific fallout from the fix for:
+ <rdar://problem/7174050> and https://bugs.webkit.org/show_bug.cgi?id=29160
+
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::didReceiveAuthenticationChallenge): Correct printf() formatter,
+ and call the correct method to get the Sender.
+
+2009-09-14 Jon Honeycutt <jhoneycutt@apple.com>
+
+ GTK build fix.
+
+ Unreviewed.
+
+ * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+ (AccessibilityController::setLogScrollingStartEvents):
+
+2009-09-11 Jon Honeycutt <jhoneycutt@apple.com>
+
+ DRT/test part of
+ <rdar://problem/7197644> WebKit should broadcast an MSAA event when
+ jumping to a named anchor
+
+ https://bugs.webkit.org/show_bug.cgi?id=28899
+
+ Reviewed by Adam Roben.
+
+ * DumpRenderTree/AccessibilityController.cpp:
+ (logScrollingStartEventsCallback):
+ Turn on logging of scrolling start events.
+ (AccessibilityController::getJSClass):
+ Add a "logScrollingStartEvents" to the AccessibilityController's JS
+ class definition.
+ (AccessibilityController::resetToConsistentState):
+ Turn off logging of scrolling start events.
+
+ * DumpRenderTree/AccessibilityController.h:
+ Declare setLogScrollingStartEvents(). Add a member for the scrolling
+ start event hook.
+
+ * DumpRenderTree/mac/AccessibilityControllerMac.cpp:
+ (AccessibilityController::setLogScrollingStartEvents):
+ Stubbed.
+
+ * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+ (AccessibilityController::AccessibilityController):
+ Initialize the handle to 0.
+ (logEventProc):
+ Renamed from logFocusEventProc; now logs scrolling start events, too.
+ Removed the assertion that the event is a focus event. Added a switch
+ to print a message for focus, scrolling start, and other, unknown
+ events.
+ (AccessibilityController::setLogFocusEvents):
+ Changed to use logEventProc.
+ (AccessibilityController::setLogScrollingStartEvents):
+ If turning logging off, unhook the scrolling start event hook, and clear
+ the member holding the handle. If turning on, query for the root
+ accessible, so that accessibility is enabled for the WebView, and call
+ SetWinEventHook to setup an event hook using logEventProc as the
+ callback function.
+
+2009-09-14 Brady Eidson <beidson@apple.com>
+
+ Windows build fix.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setAuthenticationPasswordCallback):
+ (setAuthenticationUsernameCallback):
+
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::didReceiveAuthenticationChallenge):
+
+2009-09-14 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Safari 4 cannot be used to update firmware on Linksys routers.
+ <rdar://problem/7174050> and https://bugs.webkit.org/show_bug.cgi?id=29160
+
+ Add the ability for DRT to handle authentication challenges.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setAuthenticationPasswordCallback):
+ (setAuthenticationUsernameCallback):
+ (setHandlesAuthenticationChallengesCallback):
+ (LayoutTestController::staticFunctions):
+
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::handlesAuthenticationChallenges):
+ (LayoutTestController::setHandlesAuthenticationChallenges):
+ (LayoutTestController::authenticationUsername):
+ (LayoutTestController::setAuthenticationUsername):
+ (LayoutTestController::authenticationPassword):
+ (LayoutTestController::setAuthenticationPassword):
+
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:resource:didReceiveAuthenticationChallenge:fromDataSource:]):
+
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::didReceiveAuthenticationChallenge):
+ * DumpRenderTree/win/ResourceLoadDelegate.h:
+
+2009-09-12 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Test for <rdar://problem/6954546> and <rdar://problem/7090444>.
+
+ Add a flag on the test plug-in that asks it to clear the document during the call to NPP_New.
+ This is the trigger for both <rdar://problem/6954546> and <rdar://problem/7090444>.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New):
+
+2009-09-14 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix for non-wxPython builds and a fix for errors when updating swig.py.
+
+ * wx/build/build_utils.py:
+ * wx/build/settings.py:
+
+2009-09-14 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Build fix for windows build.
+
+ * Scripts/bisect-builds: Add missing paranthesis for tmpdir function.
+
+2009-09-13 Kevin Ollivier <kevino@theolliviers.com>
+
+ Fix typo accidently landed in last commit.
+
+ * wx/build/settings.py:
+
+2009-09-13 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix, error out if using the wrong Python.
+
+ * wx/build/settings.py:
+
+2009-09-13 Xan Lopez <xlopez@igalia.com>
+
+ Build fix for GTK+ < 2.14.
+
+ Do not use gtk_widget_get_window, access the window directly
+ through the struct.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (contextClickCallback):
+ (mouseDownCallback):
+ (mouseUpCallback):
+ (mouseMoveToCallback):
+ (keyDownCallback):
+
+2009-09-13 Martin Robinson <martin.james.robinson@gmail.com>
+
+ Reviewed by Xan Lopez and Jan Alonzo.
+
+ [GTK] EventSender does not set 'window' property on synthesized GDK events
+ https://bugs.webkit.org/show_bug.cgi?id=29169
+
+ Set the window property on synthesized GDK events in the GTK+ EventSender.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (contextClickCallback):
+ (mouseDownCallback):
+ (mouseUpCallback):
+ (mouseMoveToCallback):
+ (keyDownCallback):
+
+2009-09-12 Drew Wilson <atwilson@google.com>
+
+ Reviewed by Mark Rowe.
+
+ run-webkit-tests has a timeout value that is too low
+ https://bugs.webkit.org/show_bug.cgi?id=29223
+
+ * Scripts/run-webkit-tests:
+ Changed timeout value to 20 seconds to avoid timing out too early.
+
+2009-09-11 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Mark dependencies as mandatory and declare which MSVC versions and
+ architectures are supported for building wxWebKit.
+
+ * wx/build/settings.py:
+
+2009-09-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ bugzilla-tool rollout threw exception under svn
+ https://bugs.webkit.org/show_bug.cgi?id=29211
+
+ * Scripts/modules/scm.py: add missing return, and convert number arguments to strings.
+ * Scripts/modules/scm_unittest.py: add testing for this fix.
+
+2009-09-11 Brian Weinstein <bweinstein@apple.com>
+
+ Add myself to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-09-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool land-patches should only fail-fast in --commit-queue mode
+ https://bugs.webkit.org/show_bug.cgi?id=29201
+
+ * Scripts/bugzilla-tool:
+
+2009-09-11 Adam Roben <aroben@apple.com>
+
+ Make commit-log-editor move common prefixes to the top of the log
+
+ Fies <http://webkit.org/b/29190> commit-log-editor should move common
+ prefixes to the top of the commit log
+
+ Reviewed by Darin Adler.
+
+ * Scripts/commit-log-editor: Find and remove the longest common prefix
+ ending in a double newline from each ChangeLog entry, then put that
+ common prefix at the top of the commit log.
+ (removeLongestCommonPrefixEndingInDoubleNewline): Added. Finds,
+ removes, and returns the longest common prefix ending in a double
+ newline from a hash of strings
+
+2009-09-11 Eric Seidel <eric@webkit.org>
+
+ Fix obvious typo in previous commit, no review.
+
+ bugzilla-tool should automate rollouts
+ https://bugs.webkit.org/show_bug.cgi?id=26715
+
+ * Scripts/bugzilla-tool: add back missing "scm" argument.
+
+2009-09-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool should automate rollouts
+ https://bugs.webkit.org/show_bug.cgi?id=26715
+
+ bugzilla-tool rollout will do the rollout locally and leave the diff for you to verify and commit.
+ The --complete-rollout option will automatically land and update the bug.
+ Eventually --complete-rollout will be default, but that will require more testing.
+
+ This first pass is good enough for others to try and file bugs about.
+
+ * Scripts/bugzilla-tool:
+ - Move modified_changelogs into scm.py.
+ - Move svn_revision_from_commit_text logic into scm.py.
+ - Add RolloutCommit command.
+ * Scripts/modules/bugzilla.py:
+ - Add reopen_bug command used by RolloutCommit.
+ * Scripts/modules/scm.py:
+ - Add functions to support RolloutCommit.
+ - Abstract find_uuid into value_from_svn_info so it can be re-used for _repository_url (needed by svn merge).
+ - Add a str() call so that svn_commit_log can take a numeric argument.
+ - Remove a bunch of very slow code from last_svn_commit_log and used the built-in 'BASE' alias instead.
+ - Made dry_run commits return something that svn_revision_from_commit_text can parse.
+ * Scripts/modules/scm_unittest.py:
+ - Add read_from_path for easy file reading.
+ - Put test4 on a new line to make reverts work w/o conflict.
+ - Add an "svn update" call so that the checkout revision matches the server revision.
+ - Add tests for svn_revision_from_commit_text.
+ - Add a simple test for apply_reverse_diff.
+ - Add a new self.scm member and use it in the new tests (eventually other tests can use it too).
+ - Add test for svn_commit_log to make sure my 'BASE' change above worked as expected.
+
+2009-09-11 Adam Roben <aroben@apple.com>
+
+ Get user script/stylesheet tests running on Windows
+
+ Fixes <http://webkit.org/b/29181> User script/stylesheet tests are
+ skipped on Windows
+
+ Reviewed by John Sullivan.
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Link all configurations
+ against comsuppw.lib so we can use _bstr_t.
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp: Fixed #include
+ order, added #include of comutil.h for _bstr_t.
+
+ (bstrT): Helper function to convert a JSStringRef to a _bstr_t.
+ (LayoutTestController::addUserScript):
+ (LayoutTestController::addUserStyleSheet):
+ Implemented. Implementations were based on those in
+ LayoutTestControllerMac.mm.
+
+2009-09-10 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/29147> run-webkit-tests: make -h show help
+
+ Reviewed by Mark Rowe.
+
+ * Scripts/run-webkit-tests: Updated to make -h switch show help.
+
+2009-09-10 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Add WebCore/websockets directory in wx build system.
+ https://bugs.webkit.org/show_bug.cgi?id=28038
+
+ * wx/build/settings.py:
+
+2009-09-10 Martin Robinson <martin.james.robinson@gmail.com>
+
+ [GTK] EventSender does not properly convert some keyDown strings
+ https://bugs.webkit.org/show_bug.cgi?id=29119
+
+ Add more keyDown string to character code conversions for GTK+ EventSender.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (keyDownCallback):
+
+2009-09-09 Steve Block <steveblock@google.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Geolocation Coordinates::toString() prints bogus values for unspecified properties.
+ https://bugs.webkit.org/show_bug.cgi?id=29080
+
+ * Scripts/make-script-test-wrappers: Modified. Adds asynchronous Geolocation tests to exclusion list.
+
+2009-09-09 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Eric Carlson.
+
+ reviewer/committer lookups are backwards
+ https://bugs.webkit.org/show_bug.cgi?id=29113
+
+ I also moved Eric Carlson from the committer list to the reviewer list now that he is one.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/committers.py:
+
+2009-09-09 Cameron McCormack <cam@mcc.id.au>
+
+ Reviewed by Eric Seidel.
+
+ svn-unapply doesn't revert directories correctly
+ https://bugs.webkit.org/show_bug.cgi?id=29065
+
+ * Scripts/svn-unapply: Make svnStatus consistently return status
+ lines including a newline.
+ * Scripts/svn-apply: Keep svnStatus in sync with the one in
+ svn-unapply, in lieu of moving it to a common file.
+
+2009-09-09 Cameron McCormack <cam@mcc.id.au>
+
+ Reviewed by Eric Seidel.
+
+ svn-apply doesn't handle changes to files copied to new directories properly
+ https://bugs.webkit.org/show_bug.cgi?id=29059
+
+ * Scripts/svn-apply: Don't treat "--- revision 0" patches as being
+ additions if we know that we've just copied a file to this name.
+
+2009-09-09 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ commit-queue hangs if a builder has never built
+ https://bugs.webkit.org/show_bug.cgi?id=29091
+
+ * Scripts/modules/buildbot.py:
+ * Scripts/modules/buildbot_unittest.py:
+
+2009-09-09 Zan Dobersek <zandobersek@gmail.com>
+
+ Reviewed by Gustavo Noronha.
+
+ [GTK] DumpRenderTree needs eventSender object and implementation
+ https://bugs.webkit.org/show_bug.cgi?id=25990
+
+ Implements most of the EventSender object's functionality for
+ the DumpRenderTree tool. Implementation still lacks support
+ for drag and drop tests and forward leaps.
+
+ Based on work by Holger Hans Peter Freyther.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (runTest): Focus on the view before loading a new test.
+ (webViewWindowObjectCleared):
+ * DumpRenderTree/gtk/EventSender.cpp: Added.
+ (getDragModeCallback):
+ (setDragModeCallback):
+ (leapForwardCallback):
+ (contextClickCallback):
+ (updateClickCount):
+ (mouseDownCallback):
+ (mouseUpCallback):
+ (mouseMoveToCallback):
+ (beginDragWithFilesCallback):
+ (replaySavedEvents):
+ (keyDownCallback):
+ (textZoomInCallback):
+ (textZoomOutCallback):
+ (zoomPageInCallback):
+ (zoomPageOutCallback):
+ (getClass):
+ (makeEventSender):
+ * DumpRenderTree/gtk/EventSender.h: Added.
+ * GNUmakefile.am: Add build rules for EventSender.
+
+2009-09-09 Daniel Bates <dbates@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28953
+
+ Added pre- and post- build events so that on build failure, the file
+ buildfailed is written to the directory $(WebKitOutputDir).
+
+ * WinLauncher/WinLauncher.vcproj:
+
+2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-09-08 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ commit-queue gets stuck if a non-committer sets commit-queue+ or review+
+ https://bugs.webkit.org/show_bug.cgi?id=28605
+ https://bugs.webkit.org/show_bug.cgi?id=28916
+
+ * Scripts/bugzilla-tool:
+ - Fix comment and adjust reject_patch_from_commit_queue call to pass "manual commit"
+ comment now that it's used for rejecting patches for invalid committers too.
+ - Pass reject_invalid_patches=True for commit-queue calls, normally we just ignore patches with invalid reviewers, the commit-queue rejects them.
+ - Make the commit queue print patches count instead of bugs count, this also fixes https://bugs.webkit.org/show_bug.cgi?id=28916.
+ * Scripts/modules/bugzilla.py:
+ - Make _parse_attachment_element not validate reviewer/committer.
+ - Share flag parsing code in _parse_attachment_flag.
+ - Add _validate* methods for validating reviewers and committers and updating bugs when validation fails.
+ - Add reject_invalid_patches argument so the commit-queue can update bugs on failed validation and other "read only" commands will not.
+ - Add reject_patch_from_review_queue using a new _set_flag_on_attachment abstraction.
+ * Scripts/modules/bugzilla_unittest.py:
+ - Update this test to no longer expect committer/reviewer validation.
+ * Scripts/modules/committers.py:
+ - Return None on failed lookups instead of raising Exceptions.
+ * Scripts/modules/committers_unittest.py:
+ - Update tests to expect None returns instead of exceptions.
+
+2009-09-09 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/29061> Fix obvious copy-paste error in AccessibilityUIElement::clickPointY()
+
+ Reviewed by Mark Rowe.
+
+ No change to layout test results.
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::clickPointY): Changed to return y value
+ instead of x value.
+
+2009-09-08 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Mark Rowe.
+
+ Reduce dglazkov's boboiness by properly concatenating revision value.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Used substitution
+ rather than "+".
+
+2009-09-08 Kevin Ollivier <kevino@theolliviers.com>
+
+ wxWebKit Python extension build fix - get swig.py if it doesn't exist.
+
+ * wx/build/build_utils.py:
+
+2009-09-08 Mark Rowe <mrowe@apple.com>
+
+ Fix an incorrect variable name in UpdateChromiumSource.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2009-09-08 Mark Rowe <mrowe@apple.com>
+
+ Don't check for leaks on the release SnowLeopard builder.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2009-09-08 Mark Rowe <mrowe@apple.com>
+
+ Add a SnowLeopard release builder.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2009-09-08 David Levin <levin@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Remove end of line whitespace check from check-webkit-style.
+ https://bugs.webkit.org/show_bug.cgi?id=29053
+
+ * Scripts/modules/cpp_style.py:
+
+2009-09-08 Cameron McCormack <cam@mcc.id.au>
+
+ Reviewed by Darin Adler.
+
+ Fix DumpRenderTree build from clean tree on Tiger
+ https://bugs.webkit.org/show_bug.cgi?id=28927
+
+ * DumpRenderTree/mac/PerlSupport/Makefile: Ensure the
+ DerivedSources/DumpRenderTree directory exists when
+ building on Tiger.
+
+2009-09-08 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix after introduction of platform/mock directory.
+
+ * wx/build/settings.py:
+
+2009-09-08 Yael Aharon <yael.aharon@nokia.com>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-09-08 Cameron McCormack <cam@mcc.id.au>
+
+ Reviewed by Darin Adler.
+
+ prepare-ChangeLog too chatty on file additions
+ https://bugs.webkit.org/show_bug.cgi?id=29019
+
+ * Scripts/prepare-ChangeLog: Omit description of added properties
+ on newly added files.
+
+2009-09-08 Steve Block <steveblock@google.com>
+
+ Reviewed by Adam Barth.
+
+ Adds a LayoutTestController method to set the permission state for Geolocation.
+ This is required to use the mock Geolocation service for testing.
+ https://bugs.webkit.org/show_bug.cgi?id=29027
+
+ * DumpRenderTree/LayoutTestController.cpp: Modified.
+ (setDatabaseQuotaCallback): Modified. Style fix.
+ (setGeolocationPermissionCallback): Added. Sets the Geolocation permission state.
+ (LayoutTestController::staticFunctions): Modified. Registers the above function on the LayoutTestController.
+ * DumpRenderTree/LayoutTestController.h: Modified.
+ (LayoutTestController::setGeolocationPermission): Added. Sets the Geolocation permission state.
+ (LayoutTestController::isGeolocationPermissionSet): Added. Returns whether the Geolocation permission has been set.
+ (LayoutTestController::geolocationPermission): Added. Returns the Geolocation permission state.
+ * DumpRenderTree/mac/UIDelegate.mm: Modified.
+ (-[UIDelegate webView:frame:requestGeolocationPermission:securityOrigin:]): Added. Implement chrome method to respond to request for Geolocation permission state. Response is made using above methods to access permission state.
+
+2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QtWebKit single API to enable persistency
+ https://bugs.webkit.org/show_bug.cgi?id=28682
+
+ Use the new enablePersistentStorage API instead
+ of enabling all persistent features one-by-one.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::DumpRenderTree::DumpRenderTree):
+
+2009-09-07 Andras Becsi <becsi.andras@stud.u-szeged.hu>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Refactor --strict switch to --ignore-metrics and correct the
+ implementation to make the feature usable on all platforms.
+ https://bugs.webkit.org/show_bug.cgi?id=28907
+
+ run-webkit-tests --ignore-metrics strips the font related metrics from
+ the actual and expected data before comparing them.
+ In this way the render trees can be checked for obvious differences but
+ a successful test implies by no means that the layout is actually correct.
+
+ * Scripts/run-webkit-tests:
+
+2009-09-07 Steve Block <steveblock@google.com>
+
+ Reviewed by Adam Barth.
+
+ Adds a mock Geolocation service. This will be used to provide predictable behavior of the
+ Geolocation API for use in LayoutTests. Later changes will integrate the the mock
+ Geolocation service with DumpRenderTree.
+ https://bugs.webkit.org/show_bug.cgi?id=28264
+
+ * DumpRenderTree/LayoutTestController.cpp: Modified.
+ (setMockGeolocationPositionCallback): Added. Configures the mock Geolocation service.
+ (setMockGeolocationErrorCallback): Added. Configures the mock Geolocation service.
+ (LayoutTestController::staticFunctions): Added. Registers the above functions on the LayoutTestController.
+ * DumpRenderTree/LayoutTestController.h: Modified.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm: Modified.
+ (LayoutTestController::setMockGeolocationPosition): Added. Configures the mock Geolocation service.
+ (LayoutTestController::setMockGeolocationError): Added. Configures the mock Geolocation service.
+
+2009-09-07 Drew Wilson <atwilson@google.com>
+
+ Reviewed by David Levin.
+
+ Enable SHARED_WORKERS by default
+ https://bugs.webkit.org/show_bug.cgi?id=28959
+
+ * Scripts/build-webkit:
+
+2009-09-07 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fixes for wx SVN trunk.
+
+ * wx/build/settings.py:
+
+2009-09-04 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx build fix. Switch USE_ defines over to the compiler so that they can be
+ checked by files not including config.h (like WebCorePrefix.h).
+
+ * wx/build/settings.py:
+
+2009-09-04 Adam Barth <abarth@webkit.org>
+
+ Unreviewed build fix.
+
+ Update declaration of FrameLoadDelegate to reflect that
+ IWebFrameLoadDelegatePrivate2 inherits from
+ IWebFrameLoadDelegatePrivate.
+
+ * DumpRenderTree/win/FrameLoadDelegate.h:
+
+2009-09-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24696
+
+ Add testing instrumentation for mixed content.
+
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ (-[FrameLoadDelegate webView:]):
+ (-[FrameLoadDelegate webView:didRunInsecureContent:]):
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ (descriptionSuitableForTestResult):
+ (FrameLoadDelegate::QueryInterface):
+ (FrameLoadDelegate::didDisplayInsecureContent):
+ (FrameLoadDelegate::didRunInsecureContent):
+ * DumpRenderTree/win/FrameLoadDelegate.h:
+
+2009-09-03 Kevin Watters <kevinwatters@gmail.com>
+
+ Reviewed by Kevin Ollivier.
+
+ [wx] Frames support
+ https://bugs.webkit.org/show_bug.cgi?id=19041
+
+ * wx/build-wxwebkit:
+
+2009-09-02 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28880> svn-apply --force doesn't actually work
+
+ Reviewed by Eric Seidel.
+
+ This fixes "svn-apply --force" and adds unit tests for the
+ scm.apply_patch() method which uses this script.
+
+ * Scripts/svn-apply: Created $globalExitCode variable that
+ defaults to 0. Exit with a value of $globalExitCode when the
+ script is finished.
+ (applyPatch): Ignore a non-zero $exitCode if $force is true, but
+ set $globalExitCode to $exitCode so that svn-apply exits with a
+ non-zero status if any patches did not apply cleanly. Also
+ print out the actual patch command if $force was not true.
+
+ * Scripts/modules/scm.py:
+ (scripts_directory): Added. Extracted from script_path().
+ (script_path): Extracted scripts_directory().
+ * Scripts/modules/scm_unittest.py: Import urllib.
+ (SVNTestRepository.setup): Save the original working directory
+ in test_object since this represents the WebKit repository from
+ where the unit tests are run.
+ (SCMTest): Created new super class to hold utility methods.
+ (SCMTest._create_patch): Creates a patch file on disk and a
+ dictionary for use with scm.svn_apply().
+ (SCMTest._setup_webkittools_scripts_symlink): Sets up a symlink
+ back to WebKitTools/Scripts in the test repository so that
+ scm.apply_patch() is able to find the svn-apply script.
+ (SVNTest): Inherit from SCMTest instead of unittest.TestCase.
+ (SVNTest.tearDown): Make sure to change directories back to the
+ original_path before the next test.
+ (SVNTest.test_apply_svn_patch): New test case for applying an
+ svn patch with scm.apply_patch().
+ (SVNTest.test_apply_svn_patch_force): New test case for applying
+ an svn patch with scm.apply_patch() that conflicts.
+ (GitTest): Inherit from SCMTest instead of unittest.TestCase.
+ (GitTest.tearDown): Make sure to change directories back to the
+ original_path before the next test.
+ (GitTest.test_apply_git_patch): New test case for applying a git
+ patch with scm.apply_patch().
+ (GitTest.test_apply_git_patch_force): New test case for applying
+ a git patch with scm.apply_patch() that conflicts.
+
+2009-09-02 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Mark Rowe.
+
+ [Qt] Add support for platform-spesific layout-test results
+
+ For the Qt port we use the qt-[mac|linux|win] directories and then fall
+ back to the generic qt directory for both test results and skipped list.
+
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+
+2009-09-02 Laurent Cerveau <lcerveau@me.com>
+
+ Reviewed by David Kilzer.
+
+ <http://webkit.org/b/25517> build-webkit script should print build time at end
+
+ * Scripts/build-webkit:
+ Added startTime and endTime variable so that the build time is computed and printed as
+ part of the build message; display formatting has been separated in a dedicated subroutine.
+
+2009-09-02 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28881> svn-create-patch should check if the repo path is the same when trying to find the root
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/VCSUtils.pm:
+ (determineSvnRoot): Added back check for repository root that
+ was removed in r46134 when this code lived in svn-create-patch.
+ It's necessary to check both the repository root and the
+ repository UUID in case two different working directories are
+ checked out from the same repository.
+
+2009-09-02 Timothy Hatcher <timothy@apple.com>
+
+ Use new 512x512 icons for nightly builds.
+
+ Rubber-stamped by Mark Rowe.
+
+ * WebKitLauncher/webkit.icns:
+
+2009-09-02 Kevin Ollivier <kevino@theolliviers.com>
+
+ waf build fix. Remove local variable shadowing global.
+
+ * wx/build/settings.py:
+
+2009-09-02 Zan Dobersek <zandobersek@gmail.com>
+
+ Reviewed by David Kilzer.
+
+ Calls exitStatus function from the main package where it is also defined.
+
+ * Scripts/VCSUtils.pm:
+
+2009-09-02 Kevin Ollivier <kevino@theolliviers.com>
+
+ waf build fixes for Windows/MSVC and Mac/Snow Leopard.
+
+ * wx/browser/wscript:
+ * wx/build/build_utils.py:
+ * wx/build/settings.py:
+
+2009-08-10 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Eric Seidel.
+
+ Changes needed for build-webkit to support the waf build system for the wx port.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27619
+
+ * Scripts/build-webkit:
+ * Scripts/run-launcher:
+ * Scripts/webkitdirs.pm:
+
+2009-09-02 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27168> With Subversion 1.6, update-webkit prompts on conflicts
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/update-webkit: Added "--accept postpone" to
+ @svnOptions when running with svn-1.6 or newer.
+
+2009-09-02 David Kilzer <ddkilzer@apple.com>
+
+ Moved svn 1.6 version check into VCSUtils::isSVNVersion16OrNewer()
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/VCSUtils.pm:
+ (@EXPORT): Added &isSVNVersion16OrNewer.
+ (svnVersion): Added. Internal method that gets the SVN version
+ and caches it.
+ (isSVNVersion16OrNewer): Added. Method that does the SVN 1.6
+ version check.
+ * Scripts/prepare-ChangeLog: Switched to use new
+ isSVNVersion16OrNewer() method.
+ * Scripts/resolve-ChangeLogs: Ditto.
+ * Scripts/svn-create-patch: Ditto.
+
+2009-09-02 David Kilzer <ddkilzer@apple.com>
+
+ Clean up VCSUtils.pm
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/VCSUtils.pm: Added proper package statement. Fixed
+ indentation of BEGIN block. Listed each exported method on a
+ line by itself. Added methods to the export list after adding
+ the package statement. Sorted module variables. Moved
+ definiton of $gitRoot next to other module variables.
+
+2009-09-01 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ [Qt] Fix layout-test plugins/plugin-javascript-access.html
+
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+
+2009-09-02 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ js tests should move into jstests subdirectory instead of resources/
+ https://bugs.webkit.org/show_bug.cgi?id=25880
+
+ make-script-wrappers supports both resources and script-tests directories.
+ run-webkit-tests ignores files in script-tests.
+ Move script tests of animations to check the new script is working.
+
+ * Scripts/make-script-test-wrappers:
+ * Scripts/run-webkit-tests:
+
+2009-09-02 Szabo Carol <carol.szabo@nokia.com>
+
+ Reviewed by David Levin.
+
+ check-webkit-style uses python from /usr/bin instead of the PATH
+ https://bugs.webkit.org/show_bug.cgi?id=28225
+
+ * Scripts/bugzilla-tool:
+ * Scripts/check-webkit-style:
+ * Scripts/run-webkit-unittests:
+ * Scripts/update-sources-list.py:
+ Changed the first line from
+ #!/usr/bin/python
+ to
+ #!/usr/bin/env python
+ which causes python to be invoked from the path location returned
+ by "which python" when any of these scripts are launched.
+ these are currently all the python scripts in WebKitTools/Scripts.
+
+2009-09-01 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28601> bugzilla-tool post-commits posts commits backwards
+
+ Reviewed by Adam Barth.
+
+ * Scripts/modules/scm.py:
+ (Git.commit_ids_from_commitish_arguments): Reverse the list of
+ commits returned from git-rev-list since we always want to post
+ the oldest patches first to bugs.webkit.org.
+ * Scripts/modules/scm_unittest.py:
+ (run): Added return statement to return the output now that we
+ want it sometimes.
+ (SVNTestRepository._setup_test_commits): Added a fourth commit
+ so the GitTest.test_commitish_order() test has more commits to
+ work with.
+ (GitTest.test_commitish_order): Added unit test for change to
+ Git.commit_ids_from_commitish_arguments() in scm.py.
+
+2009-09-01 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28877> Implement bugzilla-tool mark-fixed
+
+ Reviewed by David Levin.
+
+ The mark-fixed subcommand is for those times when you don't use
+ bugzilla-tool to commit a patch, but you want to use it to close
+ the bug with a committed-revision message.
+
+ * Scripts/bugzilla-tool:
+ (bug_comment_from_svn_revision): Added. Extracted from
+ bug_comment_from_commit_text().
+ (bug_comment_from_commit_text): Extracted
+ bug_comment_from_svn_revision() from this method.
+ (MarkBugFixed.__init__): Added.
+ (MarkBugFixed._fetch_commit_log): Added. Retrieves the commit
+ log from the last commit if no svn revision is specified, else
+ the commit log for the specified svn revision.
+ (MarkBugFixed._determine_bug_id_and_svn_revision): Added.
+ Attempts to determine the bug id and svn revision if one or both
+ were not defined on the command line.
+ (MarkBugFixed.execute): Added. Adds a comment about the
+ revision that fixed the bug and closes the bug.
+ (BugzillaTool.__init__): Added mark-fixed subcommand.
+ * Scripts/modules/bugzilla.py:
+ (Bugzilla.fetch_title_from_bug): Added. Returns the title of a
+ bug given a bug id.
+ * Scripts/modules/scm.py:
+ (SCM.strip_r_from_svn_revision): Added. Utility method to strip
+ the leading 'r' from an svn revision.
+ (SCM.svn_commit_log): Added. Subclasses must override.
+ (SCM.last_svn_commit_log): Added. Subclasses must override.
+ (SVN.svn_commit_log): Added. Returns svn log for a given
+ revision.
+ (SVN.last_svn_commit_log): Added. Uses svnversion to find the
+ last commit in an svn working directory and then runs svn log.
+ (Git.svn_commit_log): Added. Returns svn log for a given
+ revision.
+ (Git.last_svn_commit_log): Added. Runs git-svn-log with a limit
+ of one log message.
+
+2009-09-01 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28880> svn-apply --force doesn't actually work
+
+ Reviewed by Brady Eidson.
+
+ * Scripts/svn-apply:
+ (applyPatch): Add "--force" to $options arrayref if $force is
+ set.
+
+2009-09-01 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28725> resolve-ChangeLogs: determineVCSRoot() returns incorrect repository root during git filter-branch
+
+ Reviewed by Adam Roben.
+
+ When git-filter-branch has been invoked to rewrite ChangeLog
+ files on series of git commits, it changes directories into
+ .git-rewrite/t before re-running resolve-ChangeLogs. This
+ causes determineVCSRoot() in VCSUtils.pm to return
+ ".git-rewrite/t", which causes that path to be prepended to all
+ ChangeLog paths, which results in an error like this:
+
+ error: pathspec '.git-rewrite/t/ChangeLog' did not match any file(s) known to git.
+ Died at WebKitTools/Scripts/resolve-ChangeLogs line 376.
+
+ The correct way to fix this is not to try to find the repository
+ root when invoked by git-filter-branch.
+
+ * Scripts/resolve-ChangeLogs: If isInGitFilterBranch() is true,
+ set $relativePath to '.' instead of calling
+ chdirReturningRelativePath(determineVCSRoot()).
+ (isInGitFilterBranch): Added. Checks for the existence of the
+ MAPPED_PREVIOUS_COMMIT environment variable.
+
+2009-09-01 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Add support for Fedora distros in the http tests
+ https://bugs.webkit.org/show_bug.cgi?id=28263
+
+ Add detection code for Fedora distribution, and use the proper
+ httpd conf file when needed.
+
+ * Scripts/run-webkit-httpd:
+ * Scripts/run-webkit-tests:
+ * Scripts/webkitdirs.pm:
+
+2009-09-01 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [Gtk] DRT needs implementation of overridePreference
+ https://bugs.webkit.org/show_bug.cgi?id=28830
+
+ Implement overridePreference.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+ (setDefaultsToConsistentStateValuesForTesting):
+ (runTest):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (toWebSettingKey):
+ (LayoutTestController::overridePreference):
+
+2009-09-01 Joseph Pecoraro <joepeck@webkit.org>
+
+ <http://webkit.org/b/28623> svn-[un]apply should change directories to the repository root before [un]applying
+
+ Reviewed by Eric Seidel.
+
+ Jump back and forth between the repository root directory (to apply) and the
+ directory the script was run from (to find the patch).
+
+ * Scripts/svn-apply:
+ * Scripts/svn-unapply:
+
+2009-08-31 Adam Roben <aroben@apple.com>
+
+ Fall back to a Release version of Safari if a Debug one doesn't exist
+
+ <http://webkit.org/b/28849>
+
+ Reviewed by Sam Weinig.
+
+ * Scripts/webkitdirs.pm:
+ (safariPath): If the user is working with a Debug build, but there's
+ no Debug version of Safari present, fall back to using a Release
+ version of Safari.
+
+2009-08-31 Adam Roben <aroben@apple.com>
+
+ Make safariPath() work for Debug builds of Safari on Windows
+
+ <http://webkit.org/b/28849>
+
+ Reviewed by Sam Weinig.
+
+ * Scripts/webkitdirs.pm:
+ (safariPath): If the user is working with a Debug build, add the
+ _debug suffix to Safari.exe.
+
+2009-08-28 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue needs a master process
+ https://bugs.webkit.org/show_bug.cgi?id=28040
+
+ Add a bugzilla-tool commit-queue command
+ Keeps per-bug logs, but doesn't yet upload them anywhere.
+
+ * Scripts/bugzilla-tool: Add LandPatchesFromCommitQueue to handle 'commit-queue'
+ * Scripts/modules/buildbot.py: remove noisy log message
+ * Scripts/modules/logging.py: add a 'tee()' call for splitting outputs in python
+
+2009-08-28 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Gustavo Noronha.
+
+ [GTK] Geolocation needs permission API before being enabled by default
+
+ Build the Gtk port with geolocation enabled. This option is only
+ enabled for the buildbot. The autotools option will be enabled by
+ default once the permissions API is implemented.
+
+ * Scripts/build-webkit:
+
+2009-08-26 Cameron McCormack <cam@mcc.id.au>
+
+ Reviewed by David Kilzer.
+
+ Make prepare-ChangeLog notice property changes
+ https://bugs.webkit.org/show_bug.cgi?id=28675
+
+ Make the generated ChangeLog entry include a short description of
+ property changes if there were such changes. Also make
+ prepare-ChangeLog not bail if the only changes are property changes.
+
+ * Scripts/prepare-ChangeLog:
+
+2009-08-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Oliver Hunt.
+
+ Don't let local files access web URLs
+ https://bugs.webkit.org/show_bug.cgi?id=28480
+
+ A bunch of our LayoutTests rely on our old behavior, so we explicitly
+ grant local files universal access during testing. Mainly, these tests
+ involve making XMLHttpRequests for data URLs.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2009-08-26 John Gregg <johnnyg@google.com>
+
+ Reviewed by David Levin.
+
+ Minor style correction and include fix for notifications
+ https://bugs.webkit.org/show_bug.cgi?id=28745
+
+ * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp:
+ change to correct EnumStyle
+ (DRTDesktopNotificationPresenter::checkNotificationPermission):
+
+2009-08-26 David Levin <levin@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ XMLHttpRequest.withCredentials=false shouldn't save cookies.
+ https://bugs.webkit.org/show_bug.cgi?id=28743
+
+ Added the support to the layout test controller on OSX and
+ Windows (for CFNETWORK) to allow for changing the accept cookie
+ policy.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController): Added a bool
+ to track the state of accepting cookies.
+ (setAlwaysAcceptCookiesCallback): Standard wrapper method
+ to go from js to a C++ method.
+ (LayoutTestController::staticFunctions): Added the
+ setAlwaysAcceptCookies method to the js layoutTestController.
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::alwaysAcceptCookies): Returns the value.
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setAlwaysAcceptCookies): Stub out method.
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues): Reset the accept cookie to
+ its default.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setAlwaysAcceptCookies): Does the work for
+ OSX to change the cookie accept policy.
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (setAlwaysAcceptCookies): Method to handle all the calls necessary
+ to change the accept cookie policy on Windows.
+ (resetDefaultsToConsistentValues): Reset the accept cookie to
+ its default.
+ * DumpRenderTree/win/DumpRenderTreeWin.h:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setAlwaysAcceptCookies): Stub out method.
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setAlwaysAcceptCookies): Stub out method.
+
+2009-08-26 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed.
+
+ Remove accidentally left in clobber option.
+ https://bugs.webkit.org/show_bug.cgi?id=28400
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Removed clobber option.
+
+2009-08-26 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Mark Rowe.
+
+ Add canary-style Chromium WebKit build slave to the waterfall.
+ https://bugs.webkit.org/show_bug.cgi?id=28400
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Added one Chromium/Windows slave
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added support for Chromium slave commands.
+
+2009-08-25 Cameron McCormack <cam@mcc.id.au>
+
+ Reviewed by Darin Adler.
+
+ make-script-test-wrappers should be executable
+ https://bugs.webkit.org/show_bug.cgi?id=28669
+
+ Make make-script-test-wrappers and update-sources-list.py both be
+ executable.
+
+ * Scripts/update-sources-list.py:
+ * Scripts/make-script-test-wrappers:
+
+2009-08-25 Brent Fulgham <bfulgham@webkit.org>
+
+ Build fix
+
+ Revise Debug_Cairo targets to point inherit from the
+ debug_wincairo.vsprops property sheet so that they link
+ against the proper libraries in Debug build.
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+ * WinLauncher/WinLauncher.vcproj:
+
+2009-08-25 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Roben.
+
+ PLATFORM(CFNETWORK) should be USE(CFNETWORK).
+ https://bugs.webkit.org/show_bug.cgi?id=28713
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+
+2009-08-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt/Mac] Use CONFIG+=build_all only when building libraries
+
+ If no configuration is specified when building WebKit we pass the
+ debug_and_release option to QMake which results in Makefiles for
+ both configurations being generated.
+
+ Previously we built both of these configurations by default, for
+ all targets (both the QtWebKit framework/dyldlib and the various
+ executables such as QtLauncher and tests). This makes sense for
+ the libraries, which get the _debug suffix and can be loaded on
+ demand by setting the DYLD_IMAGE_SUFFIX, but for executables we
+ ended up building the same executable twice.
+
+ We now only build one instance of each executable, and since this
+ is a developer build we build the debug-version. Passing either
+ --debug or --release to build-webkit will override this, and
+ even in the default case the release version can still be built
+ by running 'make release' in the the build directory of each
+ target.
+
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+ * Scripts/webkitdirs.pm:
+
+2009-08-24 Hironori Bono <hbono@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Fix Bug 27827 "[Chromium] Functions Keys don't work in google spreadsheet".
+ <https://bugs.webkit.org/show_bug.cgi?id=27827>.
+
+ Because of the lack of mappings from GDK key-codes to WebKit key-codes,
+ Chromium cannot send valid key-codes to JavaScript when a user types
+ function keys. This change just copies the mappings from 'KeyEventGtk.cpp'.
+
+ To write layout tests for this issue, added mappings from function-key
+ names to platform-specific key-codes to EventSendingController objects
+ so that eventSender.keyDown() can send function-key events without using
+ platform-specific key codes. (Unfortunately, this eventSender.keyDown() change
+ is only for Mac. So this change adds this new test to Skipped tests for other
+ platforms to prevent this change from crashing the build trees.)
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (-[EventSendingController keyDown:withModifiers:]):
+
+2009-08-23 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Xan Lopez.
+
+ [Gtk] API for disabling local file access to web URLs
+ https://bugs.webkit.org/show_bug.cgi?id=28663
+
+ Enable this setting for DRT.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+
+2009-08-22 Adam Barth <abarth@webkit.org>
+
+ Revert 47684. We're going to do this later once clients have had a
+ chance to opt into the setting they like.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2009-08-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Don't let local files access web URLs
+ https://bugs.webkit.org/show_bug.cgi?id=28480
+
+ A bunch of our LayoutTests rely on our old behavior, so we explicitly
+ grant local files universal access during testing. Mainly, these tests
+ involve making XMLHttpRequests for data URLs.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetDefaultsToConsistentValues):
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues):
+
+2009-08-22 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Anders Carlsson.
+
+ Bring signed updates to the Mac nightly builds.
+
+ * WebKitLauncher/Info.plist:
+ * WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj:
+ * WebKitLauncher/WebKitNightlyEnablerSparkle.m:
+ (initializeSparkle):
+ * WebKitLauncher/nightly.webkit.org.public.pem: Added.
+
+2009-08-21 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Rubberstamped by Simon Fraser.
+
+ Remove GNOME keyring support in build-webkit. This dependency's
+ already been removed in the Gtk port.
+
+ * Scripts/build-webkit:
+
+2009-08-20 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Adam Roben.
+ Based on original patch by Stephanie Lewis.
+
+ Added support of the Windows malloc history format to parse-malloc history, so we can
+ read and parse it.
+
+ * Scripts/parse-malloc-history:
+
+2009-08-20 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Enable various "grouping" ARIA roles
+ https://bugs.webkit.org/show_bug.cgi?id=28486
+
+ Expose the ability to retrieve the subrole through accessibility for DRT.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+
+2009-08-20 Joseph Pecoraro <joepeck@webkit.org>
+
+ Unreviewed.
+
+ Added myself as a committer.
+
+ * Scripts/modules/committers.py:
+
+2009-08-20 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Fix memory leaks.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::whiteListAccessFromOrigin):
+ (LayoutTestController::pauseAnimationAtTimeOnElementWithId):
+ (LayoutTestController::pauseTransitionAtTimeOnElementWithId):
+
+2009-08-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool post-diff can post partial diffs from SVN checkouts.
+ https://bugs.webkit.org/show_bug.cgi?id=28445
+
+ Pass the checkout root as the cwd. Also wrote a test to ensure this.
+
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+
+2009-08-20 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Adele Peterson.
+
+ Don't leak the JSStringRef returned by AccessibilityUIElement::attributeValue.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (attributeValueCallback):
+
+2009-08-20 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Unreviewed, build fix.
+
+ [Qt] The template-based qMax() compares two qreals.
+
+ * DumpRenderTree/qt/ImageDiff.cpp:
+ (main):
+
+2009-08-20 David Levin <levin@chromium.org>
+
+ Reviewed by David Kilzer.
+
+ bugzilla-tool patch retrieval should handle 302 redirects.
+ https://bugs.webkit.org/show_bug.cgi?id=28485
+
+ * Scripts/modules/scm.py: Pass the --location parameter to curl
+ so that 302's are followed.
+
+2009-08-20 Aaron Boodman <aa@chromium.org>
+
+ One more speculative build for gtk.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+
+2009-08-20 Aaron Boodman <aa@chromium.org>
+
+ Speculative build for gtk.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::whiteListAccessFromOrigin):
+
+2009-08-20 Mark Rowe <mrowe@apple.com>
+
+ Ignore some leaks that are known to originate from ImageIO.
+
+ * Scripts/run-webkit-tests:
+
+2009-08-20 Aaron Boodman <aa@chromium.org>
+
+ With David Levin.
+
+ Speculative build fix for qt.
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::whiteListAccessFromOrigin):
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-08-19 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix <http://webkit.org/b/28484> Plug-in-related leaks seen on the build bot
+
+ Update check-for-global-initializers to accommodate the new uses of RefCountedLeakCounter in WebKit.
+
+ * Scripts/check-for-global-initializers:
+
+2009-08-19 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by David Levin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
+ specify a more granular policy for cross-origin XHR access.
+
+ * DumpRenderTree/LayoutTestController.cpp: Expose whiteListAccessFromOrigin() to layout tests.
+ (whiteListAccessFromOriginCallback): Ditto.
+ (LayoutTestController::staticFunctions): Ditto.
+ * DumpRenderTree/LayoutTestController.h: Ditto.
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: Ditto.
+ (LayoutTestController::whiteListAccessToOrigin): Ditto.
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm: Ditto.
+ (LayoutTestController::whiteListAccessFromOrigin): Ditto.
+ * DumpRenderTree/qt/jsobjects.cpp: Ditto.
+ (LayoutTestController::whiteListAccessFromOrigin): Ditto.
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp: Stub out whiteListAccessFromOrigin().
+ (LayoutTestController::whiteListAccessFromOrigin): Ditto.
+ * DumpRenderTree/gtk/DumpRenderTree.cpp: Reset origin access lists before each test.
+ (resetWebViewToConsistentStateBeforeTesting): Ditto.
+ * DumpRenderTree/mac/DumpRenderTree.mm: Ditto.
+ (resetWebViewToConsistentStateBeforeTesting): Ditto.
+ * DumpRenderTree/qt/DumpRenderTree.cpp: Ditto.
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting): Ditto.
+
+2009-08-19 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Dan Bernstein.
+
+ Ignore some leaks that are known to originate from QTKit.
+
+ * Scripts/run-webkit-tests:
+
+2009-08-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ commit-queue/bugzilla-tool can get wedged if git is mid-rebase
+ https://bugs.webkit.org/show_bug.cgi?id=28436
+
+ Make clean_working_directory cancel rebases too (even though that's a bit of a hack).
+ This code will only ever be run when --force-clean is passed.
+
+ I also added a new unit test to make sure this code actually works. :)
+
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py:
+
+2009-08-19 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ WebKit needs a changelogs.py to hold changelog-related code
+ https://bugs.webkit.org/show_bug.cgi?id=28477
+
+ This is moving code and adding tests. There was only one functional
+ change (which was removing a trailing newline from the last_entry() result).
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/changelogs.py: Added.
+ * Scripts/modules/changelogs_unittest.py: Added.
+ * Scripts/run-webkit-unittests:
+
+2009-08-20 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool needs a way to ask build.webkit.org if the bots are passing
+ https://bugs.webkit.org/show_bug.cgi?id=28222
+
+ Basic support for now. This has been in testing for 24 hours now and worked great!
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/buildbot.py: Added.
+ * Scripts/modules/buildbot_unittest.py: Added.
+ * Scripts/run-webkit-unittests:
+
+2009-08-19 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Gustavo Noronha.
+
+ [Gtk] Bump waitToDumpWatchdog interval to 15 seconds to match the
+ default timeout used by run-webkit-tests. Mac and Win ports were
+ recently bumped in http://trac.webkit.org/changeset/r47465.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setWaitToDump):
+
+2009-08-19 David D. Kilzer <ddkilzer@webkit.org>
+
+ DumpRenderTreeSupport.pm: provide pre-generated swig source for Tiger
+
+ Reviewed by Mark Rowe.
+
+ Provide pre-generated swig source files for Tiger so it may
+ benefit from the faster run-webkit-tests.
+
+ * DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportTiger.pm:
+ Generated by swig.
+ * DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport_wrapTiger.c: Added.
+ Generated by swig.
+ (swig_type_info::SWIG_TypeNameComp):
+ (swig_type_info::SWIG_TypeEquiv):
+ (swig_type_info::SWIG_TypeRegisterTL):
+ (swig_type_info::SWIG_TypeCheck):
+ (swig_type_info::SWIG_TypeCast):
+ (swig_type_info::SWIG_TypeDynamicCast):
+ (swig_type_info::SWIG_TypeName):
+ (swig_type_info::SWIG_TypePrettyName):
+ (swig_type_info::SWIG_TypeQueryTL):
+ (swig_type_info::SWIG_TypeClientDataTL):
+ (swig_type_info::SWIG_PackData):
+ (swig_type_info::SWIG_UnpackData):
+ (swig_type_info::SWIG_PropagateClientDataTL):
+ (swig_type_info::SWIG_PackVoidPtr):
+ (swig_type_info::SWIG_UnpackVoidPtr):
+ (swig_type_info::SWIG_PackDataName):
+ (swig_type_info::SWIG_UnpackDataName):
+ * DumpRenderTree/mac/PerlSupport/Makefile: Updated to build on
+ Tiger using pre-generated files.
+
+2009-08-18 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Kilzer.
+
+ run-webkit-tests hangs when WebCore tries to log too much
+ https://bugs.webkit.org/show_bug.cgi?id=15743
+
+ Read stdout and stderr in parallel.
+
+ * Scripts/run-webkit-tests:
+
+2009-08-18 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Oliver Hunt.
+
+ Add a new build configuration that checks for leaks during the layout tests,
+ and hook a new machine up to it.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2009-08-18 Aaron Boodman <aa@chromium.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28412: Leak of WebCore::XMLHttpRequest object during layout tests.
+
+ No new tests: Already covered by existing tests.
+
+ * Scripts/check-for-global-initializers: Allow global initialization of WTF::RefCountedLeakCounter for XMLHttpRequest.
+
+2009-08-18 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Geoff Garen.
+
+ Bump waitToDumpWatchdogInterval to 15 seconds to match the time-out used by run-webkit-tests.
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+
+2009-08-18 Brian Weinstein <bweinstein@apple.com>
+
+ Rubber-stamped by Adam Roben.
+
+ Changed use of CComBSTR in exceededDatabaseQuota to BSTRs, and free them,
+ and removed include to fix building on VC++ Express.
+
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::exceededDatabaseQuota):
+
+2009-08-18 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Fix of <https://bugs.webkit.org/show_bug.cgi?id=28326> DRT on Windows doesn't support
+ LayoutTestController::setQuota or print a callback on UIDelegate::exceededDatabaseQuota.
+
+ Implemenent setDatabaseQuota and added a new function to the IWebDatabaseManager interface.
+ Also added a console output on UIDelegate::exceededDatabaseQuota to match the mac.
+
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setDatabaseQuota):
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::exceededDatabaseQuota):
+
+2009-08-18 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28415
+ Set svn:eol-style CRLF on all .sln and .vcproj files that don't already
+ have it.
+
+ * record-memory-win/record-memory-win.vcproj:
+ * WinLauncher/WinLauncher.vcproj:
+ * WebKitLauncherWin/WebKitLauncherWin.vcproj:
+ * DumpRenderTree/win/ImageDiff.vcproj:
+ * FindSafari/FindSafari.vcproj:
+
+2009-08-18 Drew Wilson <atwilson@google.com>
+
+ Reviewed by Eric Seidel.
+
+ Need to extend DumpRenderTree to expose number of worker threads
+ https://bugs.webkit.org/show_bug.cgi?id=28292
+
+ Added layoutTestController.workerThreadCount, and implementations on various platforms that call into WebKit.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (getWorkerThreadCountCallback):
+ (LayoutTestController::staticValues):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::workerThreadCount):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::workerThreadCount):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::workerThreadCount):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::workerThreadCount):
+
+2009-08-18 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Jan Alonzo.
+
+ Initialize x and y in the GtkAllocation structure to shut up
+ valgrind.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (runTest):
+
+2009-08-17 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Some HTMLs are modified by make-script-test-wrappers
+ https://bugs.webkit.org/show_bug.cgi?id=28213
+
+ Add fast/js/const.js and fast/canvas/canvas-2d-imageData-create-nonfinite.js into
+ the exclude list, modified fast/dom/Geolocation/resources/TEMPLATE.html, and
+ re-generated wml/* and Geolocation/* .
+
+ * Scripts/make-script-test-wrappers:
+
+2009-08-17 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ -webkit-box-orient:horizontal doesn't work on <button> tag
+ https://bugs.webkit.org/show_bug.cgi?id=34445
+
+ Make a flexible button's anonymous child flexible and pass the
+ parent's box-orient to the anonymous child.
+
+ Also, added a renderName for anonymous flexible boxes.
+
+ * Scripts/make-script-test-wrappers:
+
+2009-08-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Can no longer --reset-results of a layout test directory
+ https://bugs.webkit.org/show_bug.cgi?id=28336
+
+ --reset-results and --exit-after-n-failures are incompatible.
+
+ * Scripts/run-webkit-tests:
+
+2009-08-17 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/26920> bugzilla-tool dumps too much junk the the commit comment from git
+
+ Reviewed by Adam Roben.
+
+ New commit message:
+ Committed r12345: <http://trac.webkit.org/changeset/12345>
+
+ * Scripts/bugzilla-tool:
+ (bug_comment_from_commit_text): Print out a compact,
+ standardized commit message for both git and svn.
+
+2009-08-17 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Steve Falkenburg.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Only add Cygwin to the path when it isn't already there. This avoids
+ causing problems for people who purposefully have non-Cygwin versions of
+ executables like svn in front of the Cygwin ones in their paths.
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/ImageDiff.vcproj:
+ * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+
+2009-08-17 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28393> check-webkit-style: add check for use of std::max()/std::min() instead of MAX()/MIN()
+
+ Reviewed by David Levin.
+
+ * Scripts/modules/cpp_style.py:
+ (_ERROR_CATEGORIES): Added 'runtime/max_min_macros'.
+ (check_max_min_macros): Added. Returns level 4 error when MAX()
+ and MIN() macros are used in header files and C++ source files.
+ (check_style): Added call to check_max_min_macros().
+ * Scripts/modules/cpp_style_unittest.py: Added unit tests.
+ (test_max_macro): Added.
+ (test_min_macro): Added.
+
+2009-08-13 Mike Fenton <mike.fenton@torchmobile.com>
+
+ Reviewed by Eric Seidel.
+
+ Move adjustLineToPixelBoundaries overlapping function to GraphicsContext.cpp
+ and remove from GraphicsContextCairo.cpp and GraphicsContextQt.cpp.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28268
+
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::adjustLineToPixelBoundaries):
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+
+2009-08-10 Mike Fenton <mike.fenton@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Style fixes for DumpRenderTree/qt/jsobjects.cpp based on cpp_style.py and
+ WebKit style guide.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28161
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (findFrameNamed):
+ (LoadItem::invoke):
+ (LayoutTestController::provisionalLoad):
+ (LayoutTestController::timerEvent):
+ (LayoutTestController::pauseAnimationAtTimeOnElementWithId):
+ (LayoutTestController::pauseTransitionAtTimeOnElementWithId):
+ (LayoutTestController::numberOfActiveAnimations):
+ (EventSender::keyDown):
+ (EventSender::frameUnderMouse):
+ (TextInputController::doCommand):
+
+2009-08-16 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28370> check-webkit-style: add check for 'using std::foo;' statements
+
+ Reviewed by David Levin.
+
+ In <http://webkit.org/b/28355#c1>, it was noted that new source
+ files use 'using namespace std;' instead of individual
+ 'using std::foo;' statements. This adds a level 4 check for
+ such statements.
+
+ * Scripts/modules/cpp_style.py:
+ (_ERROR_CATEGORIES): Added 'build/using_std'.
+ (check_using_std): Added.
+ (check_style): Added call to check_using_std().
+ * Scripts/modules/cpp_style_unittest.py:
+ (WebKitStyleTest.test_using_std): Added unit test.
+
+2009-08-16 David Kilzer <ddkilzer@apple.com>
+
+ Backed out r47343 which was mistakenly committed
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/scm.py:
+
+2009-08-16 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28367> bugzilla.py: replace ScriptError class with BugzillaError class
+
+ Reviewed by David Levin.
+
+ The ScriptError class doesn't exist in bugzilla.py, so any
+ errors print error messages about ScriptError instead of the
+ actual error:
+
+ NameError: global name 'ScriptError' is not defined
+
+ * Scripts/modules/bugzilla.py:
+ (BugzillaError): Added class. Modeled after ScriptError class
+ in scm.py.
+ (Bugzilla.authenticate): Changed to use BugzillaError instead of
+ ScriptError.
+ (Bugzilla._check_create_bug_response): Ditto.
+
+2009-08-14 Adam Bergkvist <adam.bergkvist@ericsson.com>
+
+ Reviewed by Sam Weinig.
+
+ Added EventSource to the build script (default on).
+ https://bugs.webkit.org/show_bug.cgi?id=14997
+
+ * Scripts/build-webkit:
+
+2009-08-15 Ryosuke Niwa <rniwa@webkit.org>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-08-15 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Fix layout test failures after r47312.
+
+ Reviewed by Cameron Zwarich.
+
+ * DumpRenderTree/AccessibilityController.h:
+ Replaced logFocusEvents() with setLogFocusEvents(), which takes a
+ boolean argument to turn logging of focus events on or off.
+ Added a function to reset the AccessibilityController to a consistent
+ state.
+
+ * DumpRenderTree/AccessibilityController.cpp:
+ (logFocusEventsCallback):
+ Call setLogFocusEvents() to enable logging.
+ (AccessibilityController::resetToConsistentState):
+ Call setLogFocusEvents() to disable logging.
+
+ * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+ (AccessibilityController::setLogFocusEvents):
+ Update stub.
+
+ * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+ (AccessibilityController::setLogFocusEvents):
+ Update stub.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebViewToConsistentStateBeforeTesting):
+ Call the FrameLoadDelegate's resetToConsistentState method.
+
+ * DumpRenderTree/mac/FrameLoadDelegate.h:
+ Declare the resetToConsistentState method.
+
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ (-[FrameLoadDelegate resetToConsistentState]):
+ Call the AccessibilityController's resetToConsistentState() function.
+
+ * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+ (AccessibilityController::~AccessibilityController):
+ Turn off focus event logging when the controller is destroyed.
+ (AccessibilityController::setLogFocusEvents):
+ If the caller passes false, unhook the focus event, and clear
+ m_focusEventHook.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+ Call the FrameLoadDelegate's resetToConsistentState function.
+
+ * DumpRenderTree/win/FrameLoadDelegate.h:
+ Declare the resetToConsistentState() function.
+
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ (FrameLoadDelegate::resetToConsistentState):
+ Call the AccessibilityController's resetToConsistentState() function.
+
+
+2009-08-14 Jon Honeycutt <jhoneycutt@apple.com>
+
+ Add a mechanism for logging MSAA focus events.
+
+ Part of <rdar://problem/6218721> No MSAA focus events fired for Webkit
+ nightly (20866)
+
+ https://bugs.webkit.org/show_bug.cgi?id=20866
+
+ Reviewed by Oliver Hunt.
+
+ * DumpRenderTree/AccessibilityController.cpp:
+ (logFocusEventsCallback):
+ Call the AccessibilityController's logFocusEvents() function.
+ (AccessibilityController::getJSClass):
+ Add a "logFocusEvents" function to the AccessibilityController's JS
+ class definition.
+
+ * DumpRenderTree/AccessibilityController.h:
+ On Windows, include windows.h, and add a member variable to hold the
+ handle to the event hook for focus events. Add a declaration for a
+ function that enables logging of focus events.
+
+ * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp:
+ (AccessibilityController::logFocusEvents):
+ Stubbed.
+
+ * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+ (AccessibilityController::logFocusEvents):
+ Stubbed.
+
+ * DumpRenderTree/win/AccessibilityControllerWin.cpp:
+ (AccessibilityController::AccessibilityController):
+ (AccessibilityController::~AccessibilityController):
+ If we hooked the focus event, unhook it.
+ (logFocusEventProc):
+ When we receive a focus event, get the accessible object for the event,
+ and log its name to stdout.
+ (AccessibilityController::logFocusEvents):
+ Setup the focus event hook to listen for events in the current process.
+
+2009-08-14 Eric Seidel <eric@webkit.org>
+
+ No review. Fix 5-space indent to be 4-spaces.
+
+ * Scripts/bugzilla-tool:
+
+2009-08-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Public API to configure the storage path for HTML5 localStorage
+ https://bugs.webkit.org/show_bug.cgi?id=28036
+
+ Turn on LocalStorage support for Qt DumpRenderTree since
+ LocalStorage is now disabled by defult for QtWebkit.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+
+2009-08-14 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Jan Alonzo.
+
+ Do not unref the main webview, it's owned by its parent
+ container. Instead destroy the container, which should take care
+ of everything (not terribly important since we exit right after
+ that, but still).
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (main):
+
+2009-08-13 Eric Seidel <eric@webkit.org>
+
+ No review, correcting obvious python error seen in the commit queue.
+
+ args can be a string or an array. Assuming args is always an array results in
+ double-spaced text in error logs.
+
+ * Scripts/bugzilla-tool:
+
+2009-08-13 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Unreviewed build fix. Include stdio.h for using stdout, stderr,
+ and fprintf.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+
+2009-08-13 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ rename make-js-test-wrappers to make-script-test-wrappers
+ https://bugs.webkit.org/show_bug.cgi?id=28212
+
+ * Scripts/make-script-test-wrappers: Renamed from WebKitTools/Scripts/make-js-test-wrappers.
+
+2009-08-13 Drew Wilson <atwilson@chromium.org>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-08-13 John Sullivan <sullivan@apple.com>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-08-13 Eric Seidel <eric@webkit.org>
+
+ Correct spelling error in file name. No review.
+
+ * Scripts/modules/committers_unittest.py: Renamed from WebKitTools/Scripts/modules/commiters_unittest.py.
+ * Scripts/run-webkit-unittests:
+
+2009-08-13 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Simon Fraser.
+
+ REGRESSION(r47175): error running run-webkit-tests
+ https://bugs.webkit.org/show_bug.cgi?id=28261
+
+ Fix "Use of uninitialized value in concatenation (.) or string at
+ WebKitTools/Scripts/run-webkit-tests line 191." by setting
+ $testsPerDumpTool to 1000 by default.
+
+ * Scripts/run-webkit-tests:
+
+2009-08-13 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed.
+
+ Add myself to list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-08-13 Brent Fulgham <bfulgham@webkit.org>
+
+ Unreviewed.
+
+ Add 'Brent Fulgham' to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-08-13 Adam Langley <agl@chromium.org>
+
+ Review not required.
+
+ * Scripts/modules/committers.py:
+ Adding myself to this list because Eric told me to.
+
+2009-08-13 Greg Bolsinga <bolsinga@apple.com>
+
+ Unreviewed.
+
+ Add 'Greg Bolsinga' to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-08-13 Adam Roben <aroben@apple.com>
+
+ Fix off-by-one result comparisons in media tests on Windows Debug
+ builds
+
+ media/video-played.html seems always to time out in Windows Debug
+ builds. A race condition between media/video-test.js's "hang" timer and
+ DumpRenderTree's built-in "watchdog" timer was causing results for
+ media/video-played.html to be printed twice, causing all future media
+ tests to be compared to the previous test's results.
+
+ The fix is to make the watchdog timer got through the same code path
+ as calling notifyDone manually, so that the results will only get
+ printed once. A subsequent patch will remove video-test.js's hang
+ timer entirely, since it is redundant.
+
+ Fixes <http://webkit.org/b/28265>.
+
+ Reviewed by Mark Rowe.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::waitToDumpWatchdogTimerFired): Added. Code came
+ from Gtk/Mac/Win's watchdog timer handlers, but we now call
+ notifyDone() instead of dump() so that a subsequent call to
+ notifyDone() won't print the results out again.
+
+ * DumpRenderTree/LayoutTestController.h: Added
+ waitToDumpWatchdogTimerFired.
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (waitToDumpWatchdogFired):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (waitUntilDoneWatchdogFired):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (waitUntilDoneWatchdogFired):
+ Changed to call waitToDumpWatchdogTimerFired.
+
+2009-08-13 Eric Carlson <eric.carlson@apple.com>
+
+ Unreviewed.
+
+ Added 'Eric Carlson' to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-08-13 Dirk Schulze <krit@webkit.org>
+
+ Unreviewed.
+ Added 'Dirk Schulze' to the committers list.
+
+ * Scripts/modules/committers.py:
+
+2009-08-13 Adam Roben <aroben@apple.com>
+
+ Enable running testapi in run-javascriptcore-tests on Windows
+
+ Fixes <http://webkit.org/b/24856> run-javascriptcore-tests should run
+ testapi on Windows
+
+ Reviewed by Mark Rowe.
+
+ * Scripts/run-javascriptcore-tests: Allow testapi to run if we're in
+ the AppleWinWebKit configuration.
+
+2009-08-13 Adam Roben <aroben@apple.com>
+
+ Re-enable testapi in run-javascriptcore-tests on Mac
+
+ This seems to have been mistakenly disabled in r47089.
+
+ Rubber-stamped by Mark Rowe.
+
+ * Scripts/run-javascriptcore-tests: Removed comment markers that were
+ preventing running testapi.
+
+2009-08-12 George Staikos <george.staikos@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Enable WCSS and XHTML-MP flags for build-webkit.
+
+ * Scripts/build-webkit:
+
+2009-08-12 David Kilzer <ddkilzer@apple.com>
+
+ run-webkit-tests: document --nthly flag in help message
+
+ Reviewed by Simon Fraser.
+
+ * Scripts/run-webkit-tests: Added --nthly flag to $usage string.
+ Also noted that -1|--singly implies --nthly 1.
+
+2009-08-12 Eric Seidel <eric@webkit.org>
+
+ No review, just fixing mismerged ChangeLogs.
+
+2009-08-12 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ run-webkit-tests needs a --exit-after-failures=N option
+ https://bugs.webkit.org/show_bug.cgi?id=28192
+
+ Added the option and deployed it to bugzilla-tool.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/run-webkit-tests:
+
+2009-08-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ bugzilla-tool : various improvements for running the commit-queue
+ https://bugs.webkit.org/show_bug.cgi?id=28199
+
+ Make run_and_throw_if_fail silence STDERR as well as STDIN.
+ I also changed run_and_throw_if_fail to use the /dev/null trick instead of .communicate() to avoid ever buffering the output (per abarth's suggestion).
+ Change a few "print" statements to "log" so they appear in the output.
+ Changed all string + uses to use string formatting instead (this is less error prone as it will automatically convert non-string objects).
+ Added a little more logging so that --quiet mode is easier to understand.
+ Changed clear_attachment_review_flag to clear_attachment_flags and made it clear the commit-queue flag as well.
+ Added the ability for bugzilla-tool to reject patches from the commit-queue when they fail to compile/apply/etc.
+ Added _find_select_element_for_flag to make the code for finding flag <select> elements clearer.
+ Made curl call (downloading patch files) quieter.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/scm.py:
+
+2009-08-12 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Change pattern that strips all trailing whitespace to just remove EOL
+ chars (\r, \n), to make it clear that varying EOL chars is the primary
+ problem being solved.
+
+ * Scripts/prepare-ChangeLog:
+ * Scripts/resolve-ChangeLogs:
+ * Scripts/svn-create-patch:
+ * Scripts/update-webkit:
+
+2009-08-12 Kevin Ollivier <kevino@theolliviers.com>
+
+ wx waf build fix, add new directories to the build.
+
+ * wx/build/settings.py:
+
+2009-08-11 Adam Roben <aroben@apple.com>
+
+ Update DumpRenderTree for IWebUIDelegatePrivate changes
+
+ Reviewed by Dave Hyatt.
+
+ * DumpRenderTree/win/UIDelegate.h: Updated to match
+ IWebUIDelegatePrivate.
+
+2009-08-12 Adam Roben <aroben@apple.com>
+
+ Don't try to seek to the end of stdin on Cygwin
+
+ Doing so seems to always cause an exception (for unknown reasons).
+
+ Fixes <http://webkit.org/b/28159> create-bug throws an exception in
+ Cygwin
+
+ Reviewed by Dave Kilzer.
+
+ * Scripts/bugzilla-tool:
+ (CreateBug.prompt_for_bug_title_and_comments): Ignore IOErrors
+ generated by calling sys.stdin.seek, since these seem to be generated
+ for no good reason on Cygwin.
+
+2009-08-12 Adam Roben <aroben@apple.com>
+
+ Don't raise an exception when --cc is not passed to create-bug
+
+ Fixes <http://webkit.org/b/28158> create-bug throws an exception if
+ --cc is not specified
+
+ Reviewed by Dave Kilzer.
+
+ * Scripts/modules/bugzilla.py:
+ (Bugzilla.create_bug_with_patch): Only set the "cc" field if a CC
+ string was specified. Otherwise we'll generate an exception about the
+ "cc" variable not being a string.
+
+2009-08-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool : various improvements for running the commit-queue
+ https://bugs.webkit.org/show_bug.cgi?id=28199
+
+ Make run_and_throw_if_fail silence STDERR as well as STDIN.
+ I also changed run_and_throw_if_fail to use the /dev/null trick instead of .communicate() to avoid ever buffering the out
+ Change a few "print" statements to "log" so they appear in the output.
+ Changed all string + uses to use string formatting instead (this is less error prone as it will automatically convert non
+ Added a little more logging so that --quiet mode is easier to understand.
+ Changed clear_attachment_review_flag to clear_attachment_flags and made it clear the commit-queue flag as well.
+ Added the ability for bugzilla-tool to reject patches from the commit-queue when they fail to compile/apply/etc.
+ Added _find_select_element_for_flag to make the code for finding flag <select> elements clearer.
+ Made curl call (downloading patch files) quieter.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/scm.py:
+
+2009-08-11 Eric Seidel <eric@webkit.org>
+
+ No review, script regression fix only.
+
+ run-webkit-tests --quiet hangs
+ https://bugs.webkit.org/show_bug.cgi?id=28202
+
+ Do a huge dance to get open3 to pipe to /dev/null w/o blocking.
+ This was what I came up with after discussions in #perl.
+
+ * Scripts/run-webkit-tests:
+
+2009-08-11 John Gregg <johnnyg@google.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Switch DumpRenderTree to contain a WebUIDelegate2, which extends
+ WebUIDelegate, so that the notifications tests will still work.
+ https://bugs.webkit.org/show_bug.cgi?id=28198
+
+ * DumpRenderTree/win/UIDelegate.h:
+
+2009-08-11 Darin Adler <darin@apple.com>
+
+ Try to fix GTK build.
+
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
+ (AccessibilityUIElement::stringForRange): Added.
+
+2009-08-10 Mike Fenton <mike.fenton@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Add processing for string constants used by the tests to trigger
+ common actions like up, down, left, right, etc. for the Qt
+ implementation of DumpRenderTree.
+
+ Note this allows fast/forms/textarea-arrow-navigation.html to pass
+ correctly.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28161
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (EventSender::keyDown):
+
+2009-08-11 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Bug 28200 - ListMarker should be included as part of the text value to parse
+ https://bugs.webkit.org/show_bug.cgi?id=28200
+
+ Add the ability to retrieve a string given a plain NSRange.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (stringForRangeCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::valueDescription):
+ (AccessibilityUIElement::stringForRange):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::stringForRange):
+
+2009-08-11 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by NOBODY (Speculative fix for the layout test failure).
+
+ Fix fast/dom/prototype-inheritance.html
+ and fast/dom/prototype-inheritance-2.html
+ broken on Windows by http://trac.webkit.org/changeset/47018
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues): enable app cache in Windows DRT.
+
+2009-08-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool: Re-factor shared landing logic into helper class to share more code
+ https://bugs.webkit.org/show_bug.cgi?id=28193
+
+ Added new WebKitLandingScripts class to hold this shared logic.
+ Also added a view_source_url function to move more webkit-specific urls out of bugzilla-tool core.
+
+ * Scripts/bugzilla-tool:
+
+2009-08-11 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Fix the current failures on the buildbot.
+
+ As Qt hooks up the maybeDump to loadFinished, we need to make
+ sure that calling dump() will not call maybeDump on loadFinished.
+
+ As dump is called my emitting done() which calls dump() and then
+ setting m_isLoading to false. So in the case m_isLoading is false,
+ do not dump again.
+
+ The current code is confusing, and should be made more clear
+ in another commit.
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::maybeDump):
+ (LayoutTestController::notifyDone):
+
+2009-08-11 John Gregg <johnnyg@google.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Add support for desktop notifications API to DumpRenderTree,
+ and support for ENABLE_NOTIFICATIONS flag to build-webkit.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (grantDesktopNotificationPermissionCallback):
+ (LayoutTestController::staticFunctions):
+ (LayoutTestController::grantDesktopNotificationPermission):
+ (LayoutTestController::checkDesktopNotificationPermission):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp: Added.
+ (DRTDesktopNotificationPresenter::DRTDesktopNotificationPresenter):
+ (DRTDesktopNotificationPresenter::QueryInterface):
+ (DRTDesktopNotificationPresenter::AddRef):
+ (DRTDesktopNotificationPresenter::Release):
+ (DRTDesktopNotificationPresenter::showDesktopNotification):
+ (DRTDesktopNotificationPresenter::cancelDesktopNotification):
+ (DRTDesktopNotificationPresenter::notificationDestroyed):
+ (DRTDesktopNotificationPresenter::checkNotificationPermission):
+ (DRTDesktopNotificationPresenter::requestNotificationPermission):
+ * DumpRenderTree/win/DRTDesktopNotificationPresenter.h: Added.
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::UIDelegate):
+ (UIDelegate::desktopNotificationsDelegate):
+ * DumpRenderTree/win/UIDelegate.h:
+ * Scripts/build-webkit:
+
+2009-08-11 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Handle arbitrary line endings when manufacturing patches for additions
+ with history.
+
+ * Scripts/svn-create-patch:
+
+2009-08-11 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28183
+ Support VS2008 as well as VS2005 in a few scripts.
+
+ * Scripts/pdevenv: Check both $VS80COMNTOOLS and $VS90COMNTOOLS.
+ * Scripts/webkitdirs.pm: Use $VSINSTALLDIR if available instead of hardcoding the VS2005 dir.
+
+2009-08-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ run-webkit-tests --quiet should not output build-dumprendertree output
+ https://bugs.webkit.org/show_bug.cgi?id=28189
+
+ * Scripts/run-webkit-tests:
+
+2009-08-11 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Exception in land-patches
+ https://bugs.webkit.org/show_bug.cgi?id=27962
+
+ Use ("%s" % object) instead of ("" + object).
+ Added unit tests for logging.py.
+
+ * Scripts/modules/logging.py:
+ * Scripts/modules/logging_unittest.py: Added.
+ * Scripts/run-webkit-unittests:
+
+2009-08-11 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by NOBODY (Windows layout tests fix).
+
+ Fix for layout tests failures. Need to initialize some preferences early
+ because WebView on Windows uses them during create time.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+
+2009-08-11 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by Adam Roben.
+
+ Originally implemented by Glenn Wilson <gwilson@chromium.org>.
+
+ Added support for overriding default preferences per-test.
+ See https://bugs.webkit.org/show_bug.cgi?id=20534
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (overridePreferenceCallback): add wiring for layoutTestController.overridePreference.
+ (LayoutTestController::staticFunctions): same.
+ * DumpRenderTree/LayoutTestController.h: same.
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::overridePreference): added empty overridePreference method.
+ * DumpRenderTree/mac/DumpRenderTree.mm: implemented preference override.
+ (resetDefaultsToConsistentValues): new method, resets preferences to same set of value before every test.
+ (setDefaultsToConsistentValuesForTesting): new method, sets other details of testing environment, every time DRT starts.
+ (resetWebViewToConsistentStateBeforeTesting): move some preference setting from here to new resetDefaultsToConsistentValues().
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetDefaultsToConsistentValues): new method, resets preferences to same set of value before every test.
+ (resetWebViewToConsistentStateBeforeTesting): move some preference setting from here to new resetDefaultsToConsistentValues().
+ (createWebViewAndOffscreenWindow): same.
+ (main): same.
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::overridePreference):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::overridePreference):
+
+2009-08-11 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Added support for DRT to support arguments for eventSender.mouseDown and eventSender.mouseUp for Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=28166.
+
+ This is a step towards fixing fast/events/mouse-click-events.html on Windows.
+
+ * DumpRenderTree/win/EventSender.cpp:
+ (mouseDownCallback):
+ (mouseUpCallback):
+ (replaySavedEvents):
+
+2009-08-11 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Build the TestNetscapePlugin on Qt/Mac
+
+ * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
+
+2009-08-11 Dmitry Titov <dimich@chromium.org>
+
+ Reviewed by NOBODY (build fix).
+
+ Attempt to fix the Windows test bot. Reverted r47015 caused one of the Windows
+ bots that runs Layout Tests to save "JS disabled" and "default font 24pt"
+ preferences permanently. Since these preferences are not initialized explicitly in DRT,
+ almost all Layout tests are failing. Attempt to fix by explicit
+ initialization of these into defaults (enabled, 16pt) at the beginning of the DRT.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main): see above.
+
+2009-08-10 Steve Falkenburg <sfalken@apple.com>
+
+ Windows nightly fix.
+
+ Reviewed by Ada Chan.
+
+ * FindSafari/FindSafari.cpp:
+ (_tmain): Copy Safari.dll if it exists.
+
+2009-08-10 David Levin <levin@chromium.org>
+
+ Reviewed by David Kilzer.
+
+ check-webkit-style doesn't catch braces around single line statements when followed by else.
+ https://bugs.webkit.org/show_bug.cgi?id=28164
+
+ * Scripts/modules/cpp_style.py: Added else to the regex that finds ending }'s when
+ checking the no braces for "single lines" rule.
+ * Scripts/modules/cpp_style_unittest.py: Added test case.
+
+2009-08-10 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/28163> bugzilla-tool: scm module should not import bugzilla module
+
+ Reviewed by David Levin.
+
+ * Scripts/bugzilla-tool:
+ (parse_bug_id): Added. Moved from CommitMessage.parse_bug_id()
+ in scm module.
+ * Scripts/modules/scm.py: Removed import of bugzilla module.
+ (CommitMessage.parse_bug_id): Deleted.
+
+2009-08-10 Peter Kasting <pkasting@google.com>
+
+ Reviewed by David Kilzer.
+
+ https://bugs.webkit.org/show_bug.cgi?id=18599
+ Work around apparent bug in abs2rel() with symlinked directories.
+
+ * Scripts/resolve-ChangeLogs:
+
+2009-08-10 Dan Bernstein <mitz@apple.com>
+
+ Build fix
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New):
+
+2009-08-10 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix a bunch of build warnings in TestNetscapePlugin
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp:
+ * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
+
+2009-08-10 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Adam Roben.
+
+ Allow TestNetscapePlugIn to fall back to the Carbon event model
+
+ Previously the plugin would fail, even though the Carbon event
+ model was available. The only way to get the Carbon event model
+ was to pass the "forcecarbon" argument in the test markup, but no
+ tests were using this.
+
+ Now the plugin uses carbon either if it's forced, or if the Cocoa
+ event model is not supported.
+
+ This helps us run most of the plugin tests on Qt/Mac, which still
+ does not support the Cocoa event model.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New):
+
+2009-08-08 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool needs a --quiet option
+ https://bugs.webkit.org/show_bug.cgi?id=28060
+
+ A first pass at a --quiet option. This doesn't do all the excting
+ things we might want, but it addresses 80% of the use case.
+
+ * Scripts/bugzilla-tool:
+
+2009-08-08 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Xan Lopez.
+
+ [Gtk] Enable accessibility in Gtk DRT
+ https://bugs.webkit.org/show_bug.cgi?id=25989
+
+ Add Accessibility support to the GTK DRT.
+
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/gtk/AccessibilityControllerGtk.cpp: Added.
+ (AccessibilityController::AccessibilityController):
+ (AccessibilityController::~AccessibilityController):
+ (AccessibilityController::focusedElement):
+ (AccessibilityController::rootElement):
+ * DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp: Added.
+ (AccessibilityUIElement::AccessibilityUIElement):
+ (AccessibilityUIElement::~AccessibilityUIElement):
+ (AccessibilityUIElement::getLinkedUIElements):
+ (AccessibilityUIElement::getDocumentLinks):
+ (AccessibilityUIElement::getChildren):
+ (AccessibilityUIElement::getChildrenWithRange):
+ (AccessibilityUIElement::childrenCount):
+ (AccessibilityUIElement::elementAtPoint):
+ (AccessibilityUIElement::getChildAtIndex):
+ (AccessibilityUIElement::allAttributes):
+ (AccessibilityUIElement::attributesOfLinkedUIElements):
+ (AccessibilityUIElement::attributesOfDocumentLinks):
+ (AccessibilityUIElement::titleUIElement):
+ (AccessibilityUIElement::parentElement):
+ (AccessibilityUIElement::attributesOfChildren):
+ (AccessibilityUIElement::parameterizedAttributeNames):
+ (AccessibilityUIElement::role):
+ (AccessibilityUIElement::title):
+ (AccessibilityUIElement::description):
+ (AccessibilityUIElement::language):
+ (AccessibilityUIElement::x):
+ (AccessibilityUIElement::y):
+ (AccessibilityUIElement::width):
+ (AccessibilityUIElement::height):
+ (AccessibilityUIElement::clickPointX):
+ (AccessibilityUIElement::clickPointY):
+ (AccessibilityUIElement::intValue):
+ (AccessibilityUIElement::minValue):
+ (AccessibilityUIElement::maxValue):
+ (AccessibilityUIElement::valueDescription):
+ (AccessibilityUIElement::isEnabled):
+ (AccessibilityUIElement::insertionPointLineNumber):
+ (AccessibilityUIElement::isActionSupported):
+ (AccessibilityUIElement::isRequired):
+ (AccessibilityUIElement::attributesOfColumnHeaders):
+ (AccessibilityUIElement::attributesOfRowHeaders):
+ (AccessibilityUIElement::attributesOfColumns):
+ (AccessibilityUIElement::attributesOfRows):
+ (AccessibilityUIElement::attributesOfVisibleCells):
+ (AccessibilityUIElement::attributesOfHeader):
+ (AccessibilityUIElement::indexInTable):
+ (AccessibilityUIElement::rowIndexRange):
+ (AccessibilityUIElement::columnIndexRange):
+ (AccessibilityUIElement::lineForIndex):
+ (AccessibilityUIElement::boundsForRange):
+ (AccessibilityUIElement::cellForColumnAndRow):
+ (AccessibilityUIElement::selectedTextRange):
+ (AccessibilityUIElement::setSelectedTextRange):
+ (AccessibilityUIElement::attributeValue):
+ (AccessibilityUIElement::isAttributeSettable):
+ (AccessibilityUIElement::increment):
+ (AccessibilityUIElement::decrement):
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewWindowObjectCleared):
+ (main):
+ * GNUmakefile.am:
+
+2009-08-07 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Unreviewed Gtk build fix.
+
+ DRT needs internal WTF symbols so we link to libJavaScriptCore.la
+ too. Also don't force Gtk to use USE_SYSTEM_MALLOC.
+
+ * GNUmakefile.am:
+
+2009-08-07 Darin Adler <darin@apple.com>
+
+ * Scripts/commit-log-editor: Fix unchecked access to environment
+ variable that may not be there.
+
+2009-08-07 Mark Rowe <mrowe@apple.com>
+
+ Handle the case where only a single test is missing results.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2009-08-07 George Wright <george.wright@torchmobile.com>
+
+ Reviewed by Adam Treat
+
+ Fix DumpRenderTree for the Qt port to always dump the PNG data unless
+ the expected and actual hashes match.
+
+ https://bugs.webkit.org/show_bug.cgi?id=28077
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::dump):
+
+2009-08-07 Pierre d'Herbemont <pdherbemont@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ commit-log-editor does not produce a git commit log that is git friendly.
+ https://bugs.webkit.org/show_bug.cgi?id=27754
+
+ We make sure we end up with:
+ - A first paragraph describing the bug. It is eventually prefixed by
+ "WebKit: <line>" or "WebCore: <line>". This used to be
+ "WebCore:\n\n<line>".
+ - The Reviewed By line.
+ - An eventual Patch By line if author and committer doesn't match.
+ - The rest of the commit.
+
+ * Scripts/commit-log-editor:
+
+2009-08-07 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. (Darin Adler indicated he'd prefer if we landed these
+ kinds of changes unreviewed, like editing the WebKit Team wiki page.)
+
+ Added Pierre d'Herbemont to list of committers.
+
+ * Scripts/modules/committers.py:
+
+2009-08-07 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Adele Peterson.
+
+ Cannot scroll for box-reflect:right
+ https://bugs.webkit.org/show_bug.cgi?id=27979
+
+ Update m_overflowLeft an m_overflowWidth for reflection just like
+ m_overflowTop and m_overflowHeight.
+
+ * Scripts/make-js-test-wrappers: Added regexp to skip box-shadow-overflo
+w-scroll.js
+
+2009-08-06 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ box-shadow's spread is ignored with <table>
+ https://bugs.webkit.org/show_bug.cgi?id=28017
+
+ Use RenderStyle::getBoxShadowExtent just like RenderBlock.
+
+ * Scripts/make-js-test-wrappers: Added regexp to skip box-shadow-overflow-scroll.js
+
+2009-08-06 Eric Seidel <eric@webkit.org>
+
+ No review, only changing make-js-test-wrappers.
+
+ Fix make-js-test-wrappers to ignore a few more js tests
+ with custom templates.
+
+ * Scripts/make-js-test-wrappers:
+
+2009-08-06 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by David Hyatt.
+
+ Added ENABLE_3D_CANVAS flag to build, default to off
+
+ * Scripts/build-webkit:
+
+2009-08-05 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Win DRT's resource load delegate is missing didReceiveResponse
+ https://bugs.webkit.org/show_bug.cgi?id=28033
+
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ Added:
+ (FrameLoadDelegate::didReceiveServerRedirectForProvisionalLoadForFrame):
+ (FrameLoadDelegate::willPerformClientRedirectToURL):
+ (FrameLoadDelegate::didCancelClientRedirectForFrame):
+
+ Minor style cleanup:
+ (FrameLoadDelegate::didStartProvisionalLoadForFrame):
+ (FrameLoadDelegate::didReceiveTitle):
+ (FrameLoadDelegate::didFinishLoadForFrame):
+ (FrameLoadDelegate::willCloseFrame):
+ (FrameLoadDelegate::didClearWindowObject):
+ * DumpRenderTree/win/FrameLoadDelegate.h:
+
+2009-08-05 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Win DRT's resource load delegate is missing didReceiveResponse
+ https://bugs.webkit.org/show_bug.cgi?id=28033
+
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::didReceiveResponse):
+ * DumpRenderTree/win/ResourceLoadDelegate.h:
+
+2009-08-05 Darin Fisher <darin@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Add layoutTestController.dumpWillCacheResponse
+ https://bugs.webkit.org/show_bug.cgi?id=28010
+
+ willCacheResponse is only interesting for embedders of mainline WebKit on Mac.
+ Splitting off a new dumpWillCacheResponse allows a number of existings tests
+ to run across platforms.
+
+ The test that was specifically verifying willCacheResponse now calls
+ dumpWillCacheResponse.
+
+ * DumpRenderTree/LayoutTestController.cpp: Add dumpWillCacheResponse
+ (LayoutTestController::LayoutTestController):
+ (dumpWillCacheResponseCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::dumpWillCacheResponse):
+ (LayoutTestController::setDumpWillCacheResponse):
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm: Inspect dumpWillCacheResponse
+ instead of dumpResourceLoadCallbacks.
+ (-[ResourceLoadDelegate webView:resource:willCacheResponse:fromDataSource:]):
+
+2009-08-05 Jeremy Orlow <jorlow@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add my name to committers.py
+ https://bugs.webkit.org/show_bug.cgi?id=28013
+
+ Add my name to committers.py.
+
+ * Scripts/modules/committers.py:
+
+2009-08-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ A minor refactoring of the Qt DRT to be a bit more similar to
+ the other DRTs, as well as more understandable.
+
+ Splitting up resetJSObjects into a LayoutTestController->reset()
+ plus a new closeRemainingWindows() method.
+
+ Added a resetToConsistentStateBeforeTesting() method to keep
+ the code in one place, making it easier to verify that we are
+ doing things properly.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::resetToConsistentStateBeforeTesting):
+ (WebCore::DumpRenderTree::open):
+ (WebCore::DumpRenderTree::closeRemainingWindows):
+ * DumpRenderTree/qt/DumpRenderTree.h:
+
+2009-08-05 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Make the Qt DRT WorkQueue work similarily to the cross platform
+ one. This means that all items return true if they started
+ loading.
+
+ This change paves the way for unforking the WorkQueue, if we [Qt]
+ would like that.
+
+ * DumpRenderTree/qt/WorkQueue.cpp:
+ (WorkQueue::processWork):
+ * DumpRenderTree/qt/WorkQueue.h:
+ * DumpRenderTree/qt/WorkQueueItem.h:
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LoadItem::invoke):
+ (ReloadItem::invoke):
+ (ScriptItem::invoke):
+ (BackForwardItem::invoke):
+ (LayoutTestController::processWork):
+ (LayoutTestController::maybeDump):
+
+2009-08-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ If load of a test fails, don't dump as it will be dumped
+ in the preceding test, resulting in a invalid incorrect layout.
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::maybeDump):
+
+2009-08-04 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Make the Qt DumpRenderTree more similar to the mac one.
+
+ Changes include:
+ 1) Reset zoom factor before each test
+ 2) Only dump the backforward list when we got other dump result
+ 3) When we dump the render tree, and got zero result print out:
+ [mainFrame renderTreeAsExternalRepresentation]
+ and not:
+ [frame renderTreeAsExternalRepresentation]
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::open):
+ (WebCore::methodNameStringForFailedTest):
+ (WebCore::DumpRenderTree::dump):
+
+2009-08-05 chris fleizach <cfleizach@apple.com>
+
+ Fix Tiger build breakage.
+
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+
+2009-08-04 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Bug 27994 - WAI-ARIA: aria-valuetext needs to be implemented
+ https://bugs.webkit.org/show_bug.cgi?id=27994
+
+ Expose valueDescription for accessibility.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getValueDescriptionCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::valueDescription):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::valueDescription):
+
+2009-08-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ REGRESSION: run-webkit-tests crashes if you have non-system perl in PATH
+ https://bugs.webkit.org/show_bug.cgi?id=28006
+
+ Hard-code perl to /usr/bin/perl and swig to /usr/bin/swig
+
+ * DumpRenderTree/mac/PerlSupport/Makefile:
+
+2009-08-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Add pkasting to bugzilla-tool as a committer
+ https://bugs.webkit.org/show_bug.cgi?id=28002
+
+ * Scripts/modules/committers.py:
+
+2009-08-04 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Bug 27993 - AXSliders are missing required attributes and actions
+ https://bugs.webkit.org/show_bug.cgi?id=27993
+
+ Add ability to check if any arbitrary action is supported.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (isActionSupportedCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isActionSupported):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isActionSupported):
+
+2009-08-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool unit tests need a test harness
+ https://bugs.webkit.org/show_bug.cgi?id=27977
+
+ * Scripts/run-webkit-unittests: Added.
+
+2009-08-04 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Gavin "Gavvy" Barraclough.
+
+ Ensure that DumpRenderTreeSupport is regenerated when switching between OS versions
+ by listing the DumpRenderTree binary as a dependency. Xcode has the smarts to rebuild
+ DumpRenderTree itself when switching OS versions so this dependency removes the need
+ for any smarts in the Makefile.
+
+ * DumpRenderTree/mac/PerlSupport/Makefile:
+
+2009-08-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool needs unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=26916
+
+ Add some basic unit testing for scm.py.
+
+ * Scripts/modules/scm.py:
+ * Scripts/modules/scm_unittest.py: Added.
+
+2009-08-04 Mike Fenton <mike.fenton@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Fix --skipped=only mode to honor flags such as --no-http and platform ignored directories by checking
+ to make sure the Skipped entries are not in the $ignoredDirectories array. Directories commonly included
+ are (http, media, compositing, wml, wcss).
+
+ https://bugs.webkit.org/show_bug.cgi?id=27893
+
+ * Scripts/run-webkit-tests:
+
+2009-08-03 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Jon Honeycutt.
+
+ Bug 27958 - WAI-ARIA: Implement 'aria-required' attribute.
+ https://bugs.webkit.org/show_bug.cgi?id=27958
+
+ Exposed isRequired to DumpRenderTree for accessibility.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getIsRequiredCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isRequired):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isRequired):
+
+2009-08-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool --commit-queue should validate commit-queue setter is a committer
+ https://bugs.webkit.org/show_bug.cgi?id=27974
+
+ With a test!
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/bugzilla_unittest.py:
+
+2009-08-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION(r46700): bugzilla-tool land-diff double-spaces ChangeLogs
+ https://bugs.webkit.org/show_bug.cgi?id=27973
+
+ The trailing comma (suppresses newlines) was lost in r46700.
+
+ * Scripts/bugzilla-tool:
+
+2009-08-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool has too many fatal errors
+ https://bugs.webkit.org/show_bug.cgi?id=27969
+
+ Replace several fatal errors with ScriptError exceptions.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/scm.py:
+
+2009-08-04 Eric Seidel <eric@webkit.org>
+
+ No review, ChangeLog fix only.
+
+ Fix a ChangeLog line-spacing disaster caused by:
+ https://bugs.webkit.org/show_bug.cgi?id=27973
+
+ Still unsure what the fix for bugzilla-tool will be.
+
+2009-08-04 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool --commit-queue should only land commit-queue+ patches
+ https://bugs.webkit.org/show_bug.cgi?id=27970
+
+ commit-queue mode for bugzilla-tool
+ https://bugs.webkit.org/show_bug.cgi?id=27918
+
+ Make bugzilla tool smart enough to find the commit-queue+ flags and
+ land those patches.
+ When we call land-patches with --commit-queue, we should filter the
+ patches we land to only those that have the commit-queue+ flag set.
+ That way, when we call bugzilla-tool from a main commit queue process,
+ we won't land the wrong patches.
+
+ * Scripts/bugzilla-tool:
+
+2009-08-04 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ committer logic should be split out of bugzilla.py into its own module
+
+ https://bugs.webkit.org/show_bug.cgi?id=27972
+
+ I also added unit tests for the functionality I added.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/bugzilla_unittest.py: Added.
+ * Scripts/modules/commiters_unittest.py: Added.
+ * Scripts/modules/committers.py: Added.
+
+2009-08-03 Peter Kasting <pkasting@google.com>
+
+ Reviewed by David Kilzer.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Handle any kind of line endings in svn-apply and svn-unapply, instead
+ of assuming LF.
+
+ * Scripts/svn-apply:
+ * Scripts/svn-unapply:
+
+2009-08-03 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool land-patches needs --queue mode
+ https://bugs.webkit.org/show_bug.cgi?id=27961
+
+ Add a --commit-queue command line option to suppress user interaction.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/scm.py:
+
+2009-08-03 Mark Rowe <mrowe@apple.com>
+
+ Build fix. Add installsrc, installhdrs and install targets.
+
+ * DumpRenderTree/mac/PerlSupport/Makefile:
+
+2009-08-03 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ HTMLInputElement is not controllable by assistive technologies
+ https://bugs.webkit.org/show_bug.cgi?id=27941
+
+ Accessibility control of a slider required adding increment() and decrement()
+ methods to AccessibilityObject, so expose thos methods on AccessibilityUIElement.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (incrementCallback): New, call UI element increment method.
+ (decrementCallback): New, call UI element decrement method.
+ (AccessibilityUIElement::getJSClass): Expose increment and decrement methods.
+
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::increment): New, send NSAccessibilityIncrementAction to Mac wrapper.
+ (AccessibilityUIElement::decrement): New, send NSAccessibilityDecrementAction to Mac wrapper.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::increment): New, do nothing.
+ (AccessibilityUIElement::decrement): New, do nothing.
+
+2009-08-02 David D. Kilzer <ddkilzer@webkit.org>
+
+ <http://webkit.org/b/27930> bugzilla-tool hates Tor Arne Vestbø
+
+ Reviewed by Tor Arne Vestbø.
+
+ * Scripts/bugzilla-tool:
+ (set_reviewer_in_changelog): Made sure reviewer is properly
+ encoded when calling replace().
+
+2009-08-02 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by David Levin.
+
+ Script for building the wxBrowser sample app for wx.
+ https://bugs.webkit.org/show_bug.cgi?id=27619
+
+ * wx/browser/wscript: Added.
+
+2009-08-02 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Jan Alonzo.
+
+ Scripts needed for the waf build.
+ https://bugs.webkit.org/show_bug.cgi?id=27619
+
+ * wx/build: Added.
+ * wx/build/build_utils.py: Added.
+ * wx/build/settings.py: Added.
+ * wx/build/waf_extensions.py: Added.
+ * wx/build/wxpresets.py: Added.
+
+2009-08-01 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Make pixel test results more consistent across Mac OS X versions
+
+ * DumpRenderTree/cg/ImageDiffCG.cpp:
+ (createDifferenceImage): Avoid color correction when rendering the
+ images into graphics contexts, so that the actual color values are
+ compared, regardless of how the images are tagged.
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (createWebViewAndOffscreenWindow): Set the window’s color space to the
+ main screen’s color space, even though the window is off-screen.
+
+2009-08-01 Mark Rowe <mrowe@apple.com>
+
+ Try again to make the Qt build bot happy.
+
+ * BuildSlaveSupport/test-result-archive: Create a placeholder file inside the newly-created
+ directory to prevent 'zip' from failing due to the directory containing no files.
+
+2009-08-01 Mark Rowe <mrowe@apple.com>
+
+ Try and make the Qt build bot happy.
+
+ * BuildSlaveSupport/test-result-archive: Handle the case where run-webkit-tests generates
+ no output files at all and thus does not create the layout-test-results directory.
+
+2009-08-01 Mark Rowe <mrowe@apple.com>
+
+ Move the include of DumpRenderTreeSupport to after DumpRenderTree has been built.
+
+ * Scripts/run-webkit-tests:
+
+2009-08-01 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig and David D. Kilzer.
+
+ Fix <https://bugs.webkit.org/show_bug.cgi?id=27923>.
+ Bug 27923: run-webkit-tests should not invoke "ps" repeatedly on Mac OS X
+
+ run-webkit-tests invokes "ps" after each test on Mac OS X to determine whether DumpRenderTree is
+ in the process of crashing. We can do the same test more efficiently with a simple call to sysctl.
+ I couldn't find any built-in way of doing this directly from perl, so we do it from a simple C module
+ instead. This speeds up run-webkit-tests by around 8%.
+
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupport.c: Added.
+ (processIsCrashing):
+ * DumpRenderTree/mac/PerlSupport/DumpRenderTreeSupportTiger.pm: Added. Tiger does not have the SWIG tool
+ that is used to generate the Perl binding to the C code, so we fall back to the old implementation on Tiger.
+ * DumpRenderTree/mac/PerlSupport/Makefile: Added.
+ * Scripts/run-webkit-tests:
+
+2009-08-01 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by David D. Kilzer.
+
+ Display the reminder once rather than once per ChangeLog.
+
+ * Scripts/prepare-ChangeLog:
+
+2009-08-01 David Kilzer <ddkilzer@apple.com>
+
+ resolve-ChangeLogs: add error checking to git ls-files command on close()
+
+ Reviewed by Eric Seidel.
+
+ Item 2 of <https://bugs.webkit.org/show_bug.cgi?id=18599#c0>.
+
+ * Scripts/resolve-ChangeLogs: Added error checking to close()
+ after running git ls-files. Added error checking to all
+ system() calls by checking for a non-zero WEXITSTATUS($?).
+ Changed "|| die;" expressions to "or die $!;".
+
+2009-08-01 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/resolve-ChangeLogs: Used chdirReturningRelativePath()
+ and determineVCSRoot() to change directories to the root of the
+ project before running the command and to provide a path for
+ removeChangeLogArguments() to make sure any ChangeLog arguments
+ on the command line are still found.
+ (canonicalRelativePath): Added. Returns a canonical path (e.g.,
+ stripping 'dir/../' from the path) relative to the current
+ directory.
+ (removeChangeLogArguments): Added argument which contains a
+ relative path that must be prepended to any ChangeLog arguments.
+ Used canonicalRelativePath() and File::Spec->catfile() to
+ construct a normalized, relative path to each file.
+
+2009-08-01 David Kilzer <ddkilzer@apple.com>
+
+ Implement VCSUtils::chdirReturningRelativePath()
+
+ Reviewed by Eric Seidel.
+
+ Step 2 to fix:
+ <http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths
+
+ * Scripts/VCSUtils.pm:
+ (VCSUtils::chdirReturningRelativePath): Moved here from
+ chdirAndGetDifference() in svn-create-patch.
+ * Scripts/svn-create-patch: Switched to use
+ chdirReturningRelativePath() instead of chdirAndGetDifference().
+ (chdirAndGetDifference): Removed.
+
+2009-08-01 David Kilzer <ddkilzer@apple.com>
+
+ Implement VCSUtils::determineVCSRoot()
+
+ Reviewed by Eric Seidel.
+
+ Step 1 to fix:
+ <http://webkit.org/b/18599> resolve-ChangeLogs doesn't work with relative paths
+
+ * Scripts/VCSUtils.pm: Removed reference to webkitdirs module.
+ (VCSUtils::EXPORT): Added &determineVCSRoot. Realphabetized.
+ (VCSUtils::determineGitRoot): Added. Based on code in
+ commit-log-editor.
+ (VCSUtils::determineVCSRoot): Implemented using
+ determineGitRoot() and determineSVNRoot().
+ * Scripts/commit-log-editor: Replaced use of
+ topLevelSourceDirectory() with determineVCSRoot(). Resorted
+ use statements.
+ (topLevelSourceDirectory): Removed.
+
+2009-07-31 Daniel Bates <dbates@intudata.com>
+
+ Reviewed by Eric Seidel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27757
+
+ Resolves Perl redefinition warnings about functions tmpfile and tmpnam which are
+ defined in both File::Temp and POSIX.
+
+ This stops the warnings by preventing the "import" method of File::Temp from being called,
+ which would otherwise add these functions into the primary namespace. Note, "use POSIX"
+ will import these functions into the primary namespace anyway. We only need one instance
+ of these functions in our namespace (or we get redefinition warnings), so lets use the
+ one's in the POSIX package.
+
+ * Scripts/update-webkit-auxiliary-libs: Changed "use File::Temp" to "use File::Temp ()".
+ * Scripts/update-webkit-support-libs: ditto
+
+2009-07-31 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ Add a top level build option to control datagrid support
+ https://bugs.webkit.org/show_bug.cgi?id=27915
+
+ * Scripts/build-webkit:
+
+2009-07-31 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Treat.
+
+ check-webkit-style --git-commit has bugs if you select a commit in the past
+ https://bugs.webkit.org/show_bug.cgi?id=27908
+
+ * Scripts/check-webkit-style:
+ (main): Made the git-commit command only select the first commit
+ if a range is given (and print a warning).
+ * Scripts/modules/scm.py:
+ (SCM::create_patch_from_local_commit):
+ (SCM::create_patch_since_local_commit):
+ (SCM::commit_locally_with_message):
+ (SCM::discard_local_commits):
+ Added an error messages in case these aren't overriden.
+
+ (Git::create_patch_since_local_commit):
+ Added this command to allow doing a diff of everything after a given commit.
+
+2009-07-31 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Speculative Qt build fix. Not reviewed.
+
+ Add LayoutTestController::disableImageLoading() in jsobjects.h.
+
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-07-31 Brady Eidson <beidson@apple.com>
+
+ Reviewed by John Sullivan.
+
+ <rdar://problem/6973106> and https://bugs.webkit.org/show_bug.cgi?id=27896
+ Favicons are still loaded when automatic image loading is disabled.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (disableImageLoadingCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::disableImageLoading):
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::disableImageLoading):
+
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::disableImageLoading): Stubbed for now.
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::disableImageLoading): Ditto.
+
+2009-07-30 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ bugzilla-tool post-commits trunk..head errors out
+ https://bugs.webkit.org/show_bug.cgi?id=27847
+
+ Rename commit_ids_from_range_arguments to commit_ids_from_commitish_arguments
+ and make it handle the new arguments format proposed in the bug.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/scm.py:
+
+2009-07-30 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ clean up build-webkit to use less copy/paste code and remove unneeded SVG warning
+ https://bugs.webkit.org/show_bug.cgi?id=27857
+
+ * Scripts/build-webkit:
+
+2009-07-31 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27894> bugzilla-tool: Bugzilla.clear_attachment_review_flag() fails with ClientForm-0.2.10 and python-2.5
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/modules/bugzilla.py:
+ (Bugzilla.clear_attachment_review_flag): Specify which 'comment'
+ form field to use when setting its value.
+
+2009-07-31 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Kilzer.
+
+ bugzilla-tool post-commits obsoletes its own work :(
+ https://bugs.webkit.org/show_bug.cgi?id=27849
+
+ Simple fix. Use .add() instead of .update()
+
+ * Scripts/bugzilla-tool:
+
+2009-07-31 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Anders Carlsson.
+
+ Improve platform-detection in run-webkit-tests
+
+ This prevents miss-detection of mac-* over Qt/Mac.
+
+ * Scripts/run-webkit-tests:
+
+2009-07-30 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ Teach buildbot to detect test cases that are missing results.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+
+2009-07-30 Mark Rowe <mrowe@apple.com>
+
+ Things work better when you create the correct directories.
+
+ * Scripts/run-webkit-tests:
+
+2009-07-30 Mark Rowe <mrowe@apple.com>
+
+ Include some information about the error when we die.
+
+ * Scripts/run-webkit-tests:
+
+2009-07-30 Mark Rowe <mrowe@apple.com>
+
+ Ensure that the path exists before writing results to it.
+ Hopefully this will make the Windows build bot happy.
+
+ * Scripts/run-webkit-tests:
+
+2009-07-30 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Adam Treat and Jon Honeycutt.
+
+ Teach run-webkit-tests to always store the actual results in the results directory for new tests.
+ This allows us to give a working link to the results from the result summary page, even if we're
+ not generating new results in to the tree.
+
+ * Scripts/run-webkit-tests:
+
+2009-07-30 Mark Rowe <mrowe@apple.com>
+
+ Add a Qt Linux build bot.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2009-07-30 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Roben.
+
+ Add --minimal option to webkit-build.
+ https://bugs.webkit.org/show_bug.cgi?id=27852
+
+ This option disables all optional build features unless
+ they are explicitly enabled.
+
+ * Scripts/build-webkit:
+
+2009-07-30 Jakub Wieczorek <faw217@gmail.com>
+
+ [Qt] Fix build with GCC 4.4.
+
+ * DumpRenderTree/qt/ImageDiff.cpp:
+
+2009-07-29 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27813
+
+ [Qt] Support pixel tests in DumpRenderTree for the Qt port.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::open):
+ (WebCore::DumpRenderTree::setDumpPixels):
+ (WebCore::DumpRenderTree::dump):
+ * DumpRenderTree/qt/DumpRenderTree.h:
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2009-07-29 Ariya Hidayat <ariya.hidayat@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27813
+
+ [Qt] Implement ImageDiff.
+
+ * DumpRenderTree/qt/ImageDiff.cpp: Added.
+ * DumpRenderTree/qt/ImageDiff.pro: Added.
+
+2009-07-30 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Eric Seidel.
+
+ build-webkit: Reorder logic for determining the baseProductDir
+
+ https://bugs.webkit.org/show_bug.cgi?id=27699
+
+ We now do port-spesific probing for the product dir first, and then
+ fall back to either the generic WEBKITOUTPUTDIR (which now also works
+ on Mac), or WebKitBuild.
+
+ Then we add the git branch if the git branch build option is enabled.
+
+ Finally we massage the product dir based on the port. For example the
+ Mac port will now always set the SYMROOT and OBJROOT configuration for
+ XCode.
+
+ Note that isAppleWinWebkit() and isCygwin() is not mutually exclusive,
+ hence the normal if and not elsif in the last two blocks.
+
+ * Scripts/webkitdirs.pm:
+
+2009-07-29 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27082> bugzilla-tool: Add --no-close switch to land-patches
+
+ Reviewed by David Levin.
+
+ * Scripts/bugzilla-tool:
+ (LandPatchesFromBugs.__init__): Added --no-close switch.
+ (LandPatchesFromBugs.land_patches): Don't close the bug if the
+ --no-close switch was used. Always clear the review+ flag on
+ every landed patch using the commit_text message when cleared.
+ This prevents patches from showing up in the commit queue if
+ reopened and provides consistency with all landed patches.
+ * Scripts/modules/bugzilla.py:
+ (Bugzilla.clear_attachment_review_flag): Added.
+
+2009-07-29 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27815> bugzilla-tool: add -m/--description to post-commits command
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/bugzilla-tool:
+ (PostDiffAsPatchToBug.execute): Changed default patch name from
+ "patch" to "Patch v1".
+ (PostCommitsAsPatchesToBug.__init__): Added -m/--description
+ switch.
+ (PostCommitsAsPatchesToBug.execute): Use description provided by
+ -m/--description switch first, else fall back to the commit
+ message.
+
+2009-07-29 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Dave Levin.
+
+ Make check-webkit-style support files as arguments.
+ https://bugs.webkit.org/show_bug.cgi?id=27549
+
+ * Scripts/check-webkit-style:
+ Support files as argument. Change documentation and use basename
+ on the binary name when used in the documentation. Also do not
+ die when printing something containing non-ASCII characters.
+
+2009-08-06 Mike Fenton <mike.fenton@torchmobile.com>
+
+ Reviewed by David Levin.
+
+ Add validation for pointer and reference declaration as defined by webkit style guidelines to cpp_style.py.
+ Add unit tests for validation and update existing c style cast test to be run explicitly as c validation.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27984
+
+ * Scripts/modules/cpp_style.py:
+ * Scripts/modules/cpp_style_unittest.py:
+
+2009-07-29 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27119> bugzilla-tool: Add create-bug command
+
+ Reviewed by David Levin.
+
+ Implement "create-bug" command for bugzilla-tool.
+
+ * Scripts/bugzilla-tool: Added CreateBug class.
+ (CreateBug.__init__): Added.
+ (CreateBug.create_bug_from_commit): Added.
+ (CreateBug.create_bug_from_patch): Added.
+ (CreateBug.prompt_for_bug_title_and_comment): Added.
+ (CreateBug.execute): Added.
+ (BugzillaTool.__init__): Added create-bug command.
+ * Scripts/modules/bugzilla.py:
+ (Bugzilla.prompt_for_component): Added.
+ (Bugzilla.check_create_bug_response_returning_bug_id_on_success): Added.
+ (Bugzilla.create_bug_with_patch): Added.
+
+2009-07-29 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Eric Seidel and Xan Lopez.
+
+ [Gtk] Enable http/tests/appcache tests
+ https://bugs.webkit.org/show_bug.cgi?id=27674
+
+ Add support for testing http/tests/appcache tests.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setAppCacheMaximumSize):
+
+2009-07-28 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Prevent nightly builds of WebKit from launching against old Safari versions that we no longer work with.
+
+ * WebKitLauncher/main.m:
+ (checkSafariVersion): Add a minimum required Safari version of 4.0. This matches the requirement on Windows.
+ (main): If the minimum version requirement is not met, display an alert and bail out.
+
+2009-07-28 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Treat.
+
+ cpplint* should be named cpp_style*
+ https://bugs.webkit.org/show_bug.cgi?id=27752
+
+ The files were renamed. A few renames were done:
+ CppLint -> CppStyle
+ cpplint -> cpp_style
+
+ * Scripts/check-webkit-style:
+ * Scripts/modules/cpp_style.py: Copied from cpplint.py and
+ did name fix ups.
+ * Scripts/modules/cpp_style_unittest.py: Copied from cpplint_unittest.py and
+ did name fix ups.
+ * Scripts/modules/cpplint.py: Removed.
+ * Scripts/modules/cpplint_unittest.py: Removed.
+
+2009-07-28 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Rubber-stamped by Holger Freyther.
+
+ Add Steve Falkenburg to bugzilla-tools' reviewers list
+
+ * Scripts/modules/bugzilla.py:
+
+2009-07-28 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Implement test result archive support for the Qt port.
+
+ * BuildSlaveSupport/test-result-archive:
+
+2009-07-27 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27755
+ Layout tests that dump resource load delegate calls should dump the request method and the response status code.
+
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[NSURLResponse _drt_descriptionSuitableForTestResult]):
+ (-[NSURLRequest _drt_descriptionSuitableForTestResult]):
+
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (descriptionSuitableForTestResult):
+
+2009-07-27 Pierre d'Herbemont <pdherbemont@apple.com>
+
+ Reviewed by David Levin.
+
+ "bugzilla-tool post-commit head" doesn't work because it can't find the bug id from the commit load.
+ https://bugs.webkit.org/show_bug.cgi?id=27747
+
+ modules.bugzilla is not found because not included.
+
+ * Scripts/modules/scm.py: Properly import modules.bugzilla.
+
+2009-07-24 Pierre d'Herbemont <pdherbemont@apple.com>
+
+ Reviewed by David Kilzer.
+
+ commit-log-editor should allow git commit --amend to regenerate the commit log based on the modifed ChangeLog
+ https://bugs.webkit.org/show_bug.cgi?id=27664
+
+ * Scripts/commit-log-editor: Add --regenerate-log option.
+ The user is asked if he wants to suppress previous ChangeLog and regenerate it,
+ if this option is enabled.
+
+2009-07-27 Gabor Rapcsanyi <rapcsanyi.gabor@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Generating remote links causes a lot of unnecessary spew on Qt build bot too
+
+ * Scripts/run-webkit-tests:
+
+2009-07-25 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Darin Adler.
+
+ Windows build break due to warning C4819
+ https://bugs.webkit.org/show_bug.cgi?id=27416
+
+ Disable C4819 warning to fix build.
+
+ * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+
+2009-07-24 Nikolas Zimmermann <nikolas.zimmermann@torchmobile.com>
+
+ Not reviewed. Add Kevin McCullough as reviewer in bugzilla.py
+
+ * Scripts/modules/bugzilla.py:
+
+2009-07-24 Eli Fidler <eli.fidler@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Improve git workflow by populating commit messages with ChangeLog entries.
+ https://bugs.webkit.org/show_bug.cgi?id=27605
+
+ If the user doesn't manually modify the ChangeLog files, use
+ prepare-ChangeLog to populate the git commit message. This behaviour
+ can be disabled by the 'webkitGenerateCommitMessage' git configuration option.
+
+ * Scripts/commit-log-editor:
+
+2009-07-24 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Treat.
+
+ cpplint crash when there is a duplicate header followed by another header.
+ https://bugs.webkit.org/show_bug.cgi?id=27625
+
+ * Scripts/modules/cpplint.py: Ensure that include_state.header_types is updated even
+ there is a duplicate header, which resulted in some code rearrangement. Also,
+ changed some if's in this function to return early. This avoids having nearly the
+ whole function content being indented.
+ * Scripts/modules/cpplint_unittest.py: Added a test which would have exposed the crash.
+
+2009-07-24 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Filetype support changes for cpplint and check_webkit_style
+ https://bugs.webkit.org/show_bug.cgi?id=27653
+
+ Introduce .c support for check_webkit_style, and remove support for
+ .cc files in favor of .cpp.
+
+ * Scripts/check-webkit-style:
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-24 Eli Fidler <eli.fidler@torchmobile.com>
+
+ Reviewed by David Levin.
+
+ Improve git workflow by populating commit messages with ChangeLog entries.
+ https://bugs.webkit.org/show_bug.cgi?id=27605
+
+ add --[no-]write prepare-ChangeLog options to bash completion
+
+ * Scripts/webkit-tools-completion.sh:
+
+2009-07-24 Andrei Popescu <andreip@google.com>
+
+ Reviewed by Anders Carlsson.
+
+ ApplicationCache should have size limit
+ https://bugs.webkit.org/show_bug.cgi?id=22700
+
+ Adds a new method on the LayoutTestController that
+ allows a JS unit test to configure the maximum size
+ of the Application Cache.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setAppCacheMaximumSizeCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setAppCacheMaximumSize):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setAppCacheMaximumSize):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setAppCacheMaximumSize):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setAppCacheMaximumSize):
+
+2009-07-24 Adam Barth <abarth@webkit.org>
+
+ Rubber stamped by Eric Seidel.
+
+ Added andersca to list of reviewers.
+
+ * Scripts/modules/bugzilla.py:
+
+2009-07-24 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Xan Lopez.
+
+ Fix dozens of "Deallocation of a pointer not malloced" messages seen while running
+ layout tests on the build bot.
+
+ Memory allocated via FastMalloc was being deleted via the system memory allocator
+ due to an inconsistent including of FastMalloc.h. We address this by including it
+ from config.h and including config.h from every implementation file, as in our other
+ projects.
+
+ * DumpRenderTree/ForwardingHeaders/wtf/FastMalloc.h: Copied from JavaScriptGlue/ForwardingHeaders/wtf/FastMalloc.h.
+ * DumpRenderTree/config.h:
+ * DumpRenderTree/mac/AccessibilityControllerMac.mm:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ * DumpRenderTree/mac/AppleScriptController.m:
+ * DumpRenderTree/mac/CheckedMalloc.cpp:
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ * DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
+ * DumpRenderTree/mac/DumpRenderTreePasteboard.m:
+ * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+ * DumpRenderTree/mac/EditingDelegate.mm:
+ * DumpRenderTree/mac/EventSendingController.mm:
+ * DumpRenderTree/mac/FrameLoadDelegate.mm:
+ * DumpRenderTree/mac/GCControllerMac.mm:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ * DumpRenderTree/mac/NavigationController.m:
+ * DumpRenderTree/mac/ObjCController.m:
+ * DumpRenderTree/mac/ObjCPlugin.m:
+ * DumpRenderTree/mac/ObjCPluginFunction.m:
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ * DumpRenderTree/mac/PlainTextController.mm:
+ * DumpRenderTree/mac/PolicyDelegate.mm:
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ * DumpRenderTree/mac/TextInputController.m:
+ * DumpRenderTree/mac/UIDelegate.mm:
+ * DumpRenderTree/mac/WorkQueueItemMac.mm:
+
+2009-07-24 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Simon Hausmann.
+
+ Add a command line option to run-javascriptcore-tests to explicitly opt out of attempting to rebuild JavaScriptCore.
+ This is primarily useful to speed up the build bots where one machine builds JavaScriptCore and a second runs the tests,
+ leading to situations where the build system unnecessarily feels that the need to recompile.
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ * Scripts/run-javascriptcore-tests:
+
+2009-07-23 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ [Gtk] Add implementation of GCController for DRT
+ https://bugs.webkit.org/show_bug.cgi?id=27636
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (webViewWindowObjectCleared):
+ (main):
+ * DumpRenderTree/gtk/GCControllerGtk.cpp:
+ (GCController::collect):
+ (GCController::collectOnAlternateThread):
+ (GCController::getJSObjectCount):
+
+2009-07-23 Mark Rowe <mrowe@apple.com>
+
+ Update build.webkit.org config for new machine.
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json:
+
+2009-07-23 Brady Eidson <beidson@apple.com>
+
+ Remove accidentally checked in code.
+
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (waitUntilDoneWatchdogFired):
+ (LayoutTestController::setWaitToDump):
+
+2009-07-23 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ WebCore has a few places that don't gracefully handle a null request returned from willSendRequest.
+ https://bugs.webkit.org/show_bug.cgi?id=27595
+
+ Add the ability to tell the LayoutTestController to return a null request for willSendRequest
+ redirect callbacks.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (setWillSendRequestReturnsNullOnRedirectCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::willSendRequestReturnsNullOnRedirect):
+ (LayoutTestController::setWillSendRequestReturnsNullOnRedirect):
+
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
+ * DumpRenderTree/win/ResourceLoadDelegate.cpp:
+ (ResourceLoadDelegate::willSendRequest):
+
+2009-07-23 Mark Rowe <mrowe@apple.com>
+
+ Reviewed Oliver Hunt.
+
+ Fix DumpRenderTree to not fail an assertion on launch on a new machine.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (setDefaultsToConsistentValuesForTesting): Disable the XSS auditor. It being enabled
+ breaks all of the JavaScript tests within testStringByEvaluatingJavaScriptFromString,
+ which causes us to exit due to an assertion failure. It's not clear why the XSS auditor
+ decides to interfere with these tests.
+
+2009-07-23 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Update default state of the XSS auditor in GTK DumpRenderTree to match Mac and Windows
+ in hopes of fixing some layout test failures seen on the build bot.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+
+2009-07-23 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Fix false positives for switch statement indentation check in cpplint.
+ https://bugs.webkit.org/show_bug.cgi?id=27615
+
+ Makes one-line case statements (e.g. "case foo: bar();") work.
+ Also a few general improvements to the robustness and readability of
+ the check, and more test cases.
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-23 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Add check for line-breaking rule #3 to cpplint.
+ https://bugs.webkit.org/show_bug.cgi?id=27610
+
+ "An else if statement should be written as an if statement when
+ the prior if concludes with a return statement."
+
+ Implemented by a multi-line (kind of back-tracking) algorithm.
+ Comes with loads of unit tests. Fixes the check for label indentation
+ to be not so overzealous, as it didn't allow for completely unindented
+ goto labels (at the very start of a line).
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-23 Eli Fidler <eli.fidler@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Improve git workflow by populating commit messages with ChangeLog entries.
+ https://bugs.webkit.org/show_bug.cgi?id=27605
+
+ add --[no-]write option to optionally output new ChangeLog entries to
+ stdout instead of modifying ChangeLog files
+
+ fix Torch Mobile copyright
+
+ * Scripts/prepare-ChangeLog:
+
+2009-07-23 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Enable cpplint for .c files.
+ https://bugs.webkit.org/show_bug.cgi?id=27604
+
+ Also make sure that the check for NULL does not apply to .c files.
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-22 Steve Falkenburg <sfalken@apple.com>
+
+ Checkpoint new Windows nightly launcher.
+
+ Reviewed by Mark Rowe.
+
+ * WebKitLauncherWin: Added.
+ * WebKitLauncherWin/Resource.h: Added.
+ * WebKitLauncherWin/WebKitLauncherWin.cpp: Added.
+ (getStringValue): Retrieve a string registry value.
+ (applePathFromRegistry): Get an Apple-related path out of the registry.
+ (copyEnvironmentVariable): Copy an environment variable.
+ (safariInstallDir): Helper function to get the install directory for Safari.
+ (safariBrowserExe): Helper function to get the full path of the Safari executable.
+ (_tWinMain): Locate Safari and launch it after setting up an environment variable.
+ * WebKitLauncherWin/WebKitLauncherWin.h: Added.
+ * WebKitLauncherWin/WebKitLauncherWin.rc: Added.
+ * WebKitLauncherWin/WebKitLauncherWin.vcproj: Added.
+ * WebKitLauncherWin/webkit.ico: Added.
+
+2009-07-22 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Treat.
+
+ run-webkit-lint should be named check-webkit-style
+ https://bugs.webkit.org/show_bug.cgi?id=27568
+
+ This name better reflects the fact that it is about checking the style of files.
+
+ * Scripts/check-webkit-style: Renamed from WebKitTools/Scripts/run-webkit-lint.
+
+2009-07-22 Takeshi Yoshino <tyoshino@google.com>
+
+ Reviewed by Darin Adler.
+
+ VC++ 2005 Express failed to build WebKit due to raw UTF-8 string in WebKit/win/WebCoreLocalizedStrings.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=26375
+
+ Make it able to use hexadecimal escape sequences in .*UI_STRING(_KEY)? macros. Now,
+ the extract-localizable-strings script unescapes hexadecimal escape sequences in string literals
+ in the macros before writing out them into the file to update.
+
+ By this fix, we can eliminate raw UTF-8 strings in source code while using raw UTF-16 big endian
+ strings in the Localizable.strings file.
+
+ Bonus: There's no longer extract-webkit-localizable-strings script. Fix usage message to guide
+ users to update-webkit-localizable-strings.
+
+ * Scripts/extract-localizable-strings:
+
+2009-07-22 Shinichiro Hamaji <hamaji@google.com>
+
+ Reviewed by David Levin.
+
+ Tiny typo fixes for cpplint.py
+ https://bugs.webkit.org/show_bug.cgi?id=27530
+
+ * Scripts/modules/cpplint.py:
+
+2009-07-22 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ run-webkit-lint checks code which are not changed
+ https://bugs.webkit.org/show_bug.cgi?id=27529
+
+ Add check if the line is newly added.
+
+ * Scripts/run-webkit-lint:
+
+2009-07-22 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ run-webkit-lint should have --git-commit option
+ https://bugs.webkit.org/show_bug.cgi?id=27528
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/run-webkit-lint:
+
+2009-07-22 Peter Kasting <pkasting@google.com>
+
+ Reviewed by David Kilzer.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Factor svn-create-patch's "determineSvnRoot()" into a function in
+ VCSUtils.pm so commit-log-editor can use it too.
+
+ * Scripts/VCSUtils.pm: Add determineSVNRoot().
+ * Scripts/commit-log-editor: Use determineSVNRoot() instead of old
+ code (which didn't work as well).
+ * Scripts/svn-create-patch: Remove determineSvnRoot() (moved).
+
+2009-07-22 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Fix false positives in namespace indentation checks.
+ https://bugs.webkit.org/show_bug.cgi?id=27567
+
+ The regular expression detecting goto labels (in order
+ to skip those) was too permissive, which caused other
+ code like "Foo::Bar()" to be treated as a label too,
+ thereby not stopping the processing loop as expected.
+
+ Now comes with a stricter regexp, and more demanding
+ test cases to check for these issues.
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-22 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Fix cpplint generating false positives for
+ "primary" includes in headers.
+ https://bugs.webkit.org/show_bug.cgi?id=27553
+
+ Doing so by only flagging includes in header files
+ as primary when the include filename exactly matches
+ the header filename.
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-22 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ cpplint generates false positives for primary includes
+ https://bugs.webkit.org/show_bug.cgi?id=27544
+
+ Fix false positives for instances when cpplint would
+ normally classify multiple includes as primary: After
+ the first primary include, classify subsequent ones as
+ "other" includes even if they look like primary ones.
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-22 Gabor Rapcsanyi <rapcsanyi.gabor@stud.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ Pass XAUTHORITY environment variable to $dumpTool as well.
+
+ * Scripts/run-webkit-tests:
+
+2009-07-21 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ Add check for correct wtf includes to cpplint.
+ https://bugs.webkit.org/show_bug.cgi?id=27524
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-21 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by David Levin.
+
+ Add checks for multi-line boolean operator placement.
+ https://bugs.webkit.org/show_bug.cgi?id=27496
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-21 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by David Levin.
+
+ We can't match implementation file and primary header exactly
+ since we have so many files in WebKit where the port suffix
+ is appended to the filename.
+
+ Example: FooQt.cpp and the primary header is Foo.h.
+
+ * Scripts/modules/cpplint.py:
+
+2009-07-21 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by David Levin.
+
+ Add checks for switch statement indentation to cpplint.
+ https://bugs.webkit.org/show_bug.cgi?id=27508
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-21 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Adam Treat.
+
+ Feature request: cpplint should check for braces - rule 2
+ https://bugs.webkit.org/show_bug.cgi?id=27497
+
+ Add the requested feature: Make sure { is on the same line
+ as the foreach "keyword".
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-20 Jakob Petsovits <jakob.petsovits@torchmobile.com>
+
+ Reviewed by David Levin.
+
+ Add checks for namespace indentation to cpplint.
+ https://bugs.webkit.org/show_bug.cgi?id=27461
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-20 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by David Levin.
+
+ Add cpplint check for proper include order
+ https://bugs.webkit.org/show_bug.cgi?id=27462
+
+ Add a new check to cpplint to flag cases where the include section of a file
+ does not match the mandated include order and style of the Webkit coding style
+ guidelines.
+
+ Add associated tests.
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ Support lint for patches
+ https://bugs.webkit.org/show_bug.cgi?id=27291
+
+ Add run-webkit-lint script, which lints recent changes in local
+ repository. Also, modified cpplint.py so that we don't need to
+ specify verbose level for process_file().
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/run-webkit-lint: Added.
+
+2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ diff_parser should accept lines without trailing \n
+ https://bugs.webkit.org/show_bug.cgi?id=27483
+
+ Normalize the input lines by removing a trailing newline.
+ Also, add a case for unittest for newly added files.
+
+ * Scripts/modules/diff_parser.py:
+ * Scripts/modules/diff_parser_unittest.py:
+
+2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ cpplint.py's process_file() should accept customized error function
+ https://bugs.webkit.org/show_bug.cgi?id=27487
+
+ * Scripts/modules/cpplint.py:
+
+2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ cpplint.py should have an interface to get global error count
+ https://bugs.webkit.org/show_bug.cgi?id=27486
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ cpplint's parse_argument should not exit even if no files are specified
+ https://bugs.webkit.org/show_bug.cgi?id=27489
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-21 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ diff_parser: s/add_deleted_line/add_old_line/g
+ https://bugs.webkit.org/show_bug.cgi?id=27484
+
+ * Scripts/modules/diff_parser.py:
+
+2009-07-21 Roland Steiner <rolandsteiner@google.com>
+
+ Reviewed by David Levin.
+
+ Add ENABLE_RUBY to list of build options
+ https://bugs.webkit.org/show_bug.cgi?id=27324
+
+ * Scripts/build-webkit: Added flag ENABLE_RUBY.
+
+2009-07-20 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by David D. Kilzer.
+
+ Fix <https://bugs.webkit.org/show_bug.cgi?id=27482>.
+ Bug 27482: svn-apply cannot apply patch generated by Windows SVN
+
+ A regexp in svn-apply was treating everything prior to a \n as part of the
+ file name. The native Windows SVN client uses \r\n for line endings which
+ meant that the \r was being included in the file name. This defeated the
+ special-case logic for ChangeLogs to apply them with an increased fuzz factor,
+ meaning that the ChangeLog portions of such patches would fail to apply.
+
+ Also updated two other regexps that look like they would hit similar problems
+ with line-endings so that they will correctly handle patches from Windows SVN.
+
+ * Scripts/svn-apply:
+
+2009-07-20 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Mark Rowe.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27468
+ Back out r46060, which caused problems for some Apple developers.
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/ImageDiff.vcproj:
+ * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+
+2009-07-20 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Use shorter, more correct code for determining the current directory,
+ which works better with symbolic links on some systems. Also switch
+ from checking repository root to checking UUID, to match scm.py.
+
+ * Scripts/svn-create-patch:
+
+2009-07-20 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by Dan Bernstein.
+
+ Work around <rdar://problem/7075373> by ensuring that the URL is absolute before handing it off to CoreText.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (activateFonts):
+
+2009-07-20 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Treat.
+
+ Enable filename completion for run-webkit-test (added "-o default").
+
+ * Scripts/webkit-tools-completion.sh:
+
+2009-07-20 Simon Hausmann <simon.hausmann@nokia.com>
+
+ No review, just adding Gavin Barraclough as reviewer.
+
+ * Scripts/modules/bugzilla.py:
+
+2009-07-20 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by David Levin.
+
+ Add support for Qt's foreach to cpplint
+ https://bugs.webkit.org/show_bug.cgi?id=27386
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-18 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ https://bugs.webkit.org/show_bug.cgi?id=27145
+ [Gtk][REGRESSION] subframe-navigate-during-main-frame-load.html fails after r45615
+
+ Reviewed by Gustavo Noronha.
+
+ Normalize file URLs.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (dumpHistoryItem):
+
+2009-07-17 Peter Kasting <pkasting@google.com>
+
+ Reviewed by David Kilzer.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Further improve non-Cygwin SVN support.
+
+ * Scripts/prepare-ChangeLog: Harmless change to be consistent with other
+ places that consume whitespace at the end of svn output.
+ * Scripts/resolve-ChangeLogs: Add support for SVN 1.6. Slightly
+ optimize svn info parsing based on technique in svn-create-patch.
+ Normalize paths and consume whitespace in the same way as
+ prepare-ChangeLog, for Windows systems with a non-Cygwin SVN. Force
+ diff and patch to run in binary mode so that they won't
+ "intelligently" screw up line endings.
+
+2009-07-18 Simon Fraser <simon.fraser@apple.com>
+
+ Fix Tiger DRT build.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (createWebViewAndOffscreenWindow):
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+
+2009-07-17 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ DRT doesn't reliably snapshot composited layers
+ https://bugs.webkit.org/show_bug.cgi?id=27399
+
+ If we're doing an "onscreen" pixel capture, it means that we're snapshotting a view
+ with composited content. In that case we need to force the view to display so that
+ the composited layers are rendered to the screen.
+
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ (createBitmapContextFromWebView):
+
+2009-07-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by David Levin.
+
+ bugzilla-tool does not understand nested SVN repos
+ https://bugs.webkit.org/show_bug.cgi?id=27404
+
+ Determine the root of the working copy by looking at SVN's UUIDs.
+
+ * Scripts/modules/scm.py:
+
+2009-07-17 David Levin <levin@chromium.org>
+
+ Reviewed by Mark Rowe.
+
+ webkit-tools-completion.sh has two typos and sorting issues.
+ https://bugs.webkit.org/show_bug.cgi?id=27401
+
+ * Scripts/webkit-tools-completion.sh: Fix two typos "--dif" and "-clean".
+ Also, sort all lists including items in the case statement and flags for
+ the commands.
+
+2009-07-17 Peter Kasting <pkasting@google.com>
+
+ Reviewed by David Kilzer.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Tweak some regexes for correctness.
+
+ * Scripts/prepare-ChangeLog: Allow 1-character filenames (my previous
+ change here didn't quite get things right).
+ * Scripts/update-webkit: Detect conflicting ChangeLogs correctly by not
+ including any trailing whitespace in the name "ChangeLog", and by
+ normalizing paths before calling basename() to avoid confusing it.
+ (normalizePath() copied from prepare-ChangeLog.)
+
+2009-07-17 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Steve Falkenburg.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Only add Cygwin to the path when it isn't already there. This avoids
+ causing problems for people who purposefully have non-Cygwin versions of
+ executables like svn in front of the Cygwin ones in their paths.
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/ImageDiff.vcproj:
+ * DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj:
+
+2009-07-17 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Treat.
+
+ WebKit should have a bash completion script to aid with common commands.
+ https://bugs.webkit.org/show_bug.cgi?id=27374
+
+ * Scripts/webkit-tools-completion.sh: The script which enables option completion
+ for several WebKit command line scripts.
+
+2009-07-17 Peter Kasting <pkasting@google.com>
+
+ Reviewed by David Kilzer.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Avoid error spew on Macs, and fix a few other tiny details.
+
+ * Scripts/svn-create-patch:
+
+2009-07-17 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Dave Levin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27377
+ This makes cpplint complain about this for instance:
+
+ if (true)
+ {
+ int foo;
+ }
+
+ Add the appropriate unit tests.
+
+ * Scripts/modules/cpplint.py:
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-17 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Dave Levin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27377
+ Don't filter whitespace at the end of the line. This is not
+ explicitly a rule of webkit coding style, but there is no reason
+ not to warn of this common style problem.
+
+ Don't filter whitespace newline. Now, cpplint will complain
+ about the following situation:
+
+ if (true) {
+ doSomething();
+ doSomethingAgain();
+ }
+ else
+ doSomething();
+
+ Which is a webkit coding style rule violation.
+
+ * Scripts/modules/cpplint.py:
+
+2009-07-17 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Dave Levin.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27377
+ Move this comment to where it belongs.
+
+ * Scripts/modules/cpplint_unittest.py:
+
+2009-07-17 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Correct crash in WinLauncher due to improper mixing of BSTR
+ and TCHAR types.
+ https://bugs.webkit.org/show_bug.cgi?id=27381
+
+ * WinLauncher/WinLauncher.cpp:
+ (loadURL): Perform SysReAllocString to update the BSTR with
+ the contents of the TCHAR string.
+
+2009-07-17 David Levin <levin@chromium.org>
+
+ Reviewed by Adam Treat.
+
+ cpplint should flag usages of NULL.
+ https://bugs.webkit.org/show_bug.cgi?id=27341
+
+ * Scripts/modules/cpplint.py: Add the check for NULL test and call it.
+ Make the collapse_strings method public.
+ * Scripts/modules/cpplint_unittest.py: Add several tests to verify
+ the check for NULL behavior. Adjust existing tests due to the
+ new NULL check:
+ 1. Several had NULL removed (or were just removed completely).
+ 2. Two tests now do an assert that allows the caller to check
+ that a particular error is one of several that was returned.
+
+2009-07-17 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add a parser of patches for linter.
+ https://bugs.webkit.org/show_bug.cgi?id=27363
+
+ Adds a simple parser for unified diff format.
+
+ * Scripts/modules/diff_parser.py: Added.
+ * Scripts/modules/diff_parser_unittest.py: Added.
+
+2009-06-30 Holger Hans Peter Freyther <zecke@selfish.org>
+
+ Reviewed by Simon Hausmann.
+
+ [GTK+] Remove check to be loadable in firefox
+ https://bugs.webkit.org/show_bug.cgi?id=27345
+
+ if (aMozillaVTable->size < sizeof (NPNetscapeFuncs))
+ fails in firefox but no other example in the mozilla tree is
+ doing that check. Remove and be happy.
+
+ * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (NP_Initialize):
+
+2009-07-17 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Simon Hausmann.
+
+ Something about having a single TAB in a style checking tool like this
+ is equivalent to nails on a chalk board to me...
+
+ * Scripts/modules/cpplint.py:
+
+2009-07-17 Kenneth Rohde Christiansen <kenneth.christiansen@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ Overwrite the plugin directories for the DRT.
+ Part of https://bugs.webkit.org/show_bug.cgi?id=27215
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+
+2009-07-16 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add --web-sockets flag and ENABLE_WEB_SOCKETS define.
+ https://bugs.webkit.org/show_bug.cgi?id=27206
+
+ Add --web-sockets flag.
+
+ * Scripts/build-webkit: add --web-sockets flag.
+
+2009-07-16 Adam Treat <adam.treat@torchmobile.com>
+
+ Reviewed by Dave Levin.
+
+ cpplint should check for one line control clauses that are surrounded
+ by braces
+ https://bugs.webkit.org/show_bug.cgi?id=27354
+
+ * Scripts/modules/cpplint.py: Added the new lint check.
+ * Scripts/modules/cpplint_unittest.py: Add tests for the new lint check
+ and fix the other tests as they were not passing this new lint check.
+
+2009-07-16 Peter Kasting <pkasting@google.com>
+
+ Reviewed by David Kilzer.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Improve support for WebKit checkouts hosted inside other checkouts
+ (possible for some ports, e.g. Chromium).
+
+ * Scripts/svn-create-patch: Determine SVN root by looking for Repository
+ Root string and aborting when it's missing or different than what
+ we've already seen.
+
+2009-07-16 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Adam Roben.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27323
+ Improve support for non-Cygwin SVNs on Windows.
+
+ * Scripts/commit-log-editor: Modify regex so that trailing whitespace
+ (e.g. \r) isn't included in filenames.
+ * Scripts/prepare-ChangeLog: Fix a case of adding "\n" to the ChangeLog
+ without normalizing. Normalize file paths early instead of late so
+ all stages of the script work. Modify regexes so that trailing
+ whitespace (e.g. \r) isn't included in filenames.
+ * Scripts/svn-create-patch: Use a regex instead of chomp so we cut off
+ line endings even if they don't match Perl's.
+
+2009-07-16 Joseph Pecoraro <joepeck02@gmail.com>
+
+ Reviewed by Darin Adler.
+
+ WebKitTools/Scripts/svn-create-patch is broken
+ https://bugs.webkit.org/show_bug.cgi?id=27328
+
+ * Scripts/svn-create-patch: one line fix for unusual perl behavior
+
+2009-07-16 David Levin <levin@chromium.org>
+
+ Reviewed by David Kilzer.
+
+ cpplint should check for equality comparisons to 0/true/false
+ https://bugs.webkit.org/show_bug.cgi?id=27333
+
+ * Scripts/modules/cpplint.py: Added the new lint check.
+ * Scripts/modules/cpplint_unittest.py: Add tests for the new lint check
+ and fix a regex that in another unit test that caused it to fail when
+ you have a directory with a number in it (like WebKit-2)
+
+2009-07-16 David D. Kilzer <ddkilzer@webkit.org>
+
+ <http://webkit.org/b/27241> bugzilla-tool post-commits silently fails with bad args
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/bugzilla-tool:
+ (PostCommitsAsPatchesToBug.execute): Added more error checking
+ when consuming arguments.
+
+2009-07-16 David D. Kilzer <ddkilzer@webkit.org>
+
+ TOOL FIX: scm.py: CommitMessage.message is ambiguous
+
+ Fixes this error when running bugzilla-tool apply-patches
+ --local-commit:
+
+ File "bugzilla-tool", line 188, in apply_patches
+ scm.commit_locally_with_message(commit_message.message() or patch['name'])
+ TypeError: 'list' object is not callable
+
+ * Scripts/modules/scm.py: After r45940 (and r45971), rename
+ CommitMessage.message attribute to CommitMessage.message_lines.
+ (CommitMessage.__init__):
+ (CommitMessage.body):
+ (CommitMessage.description):
+ (CommitMessage.message):
+ (CommitMessage.parse_bug_id):
+
+2009-07-16 David D. Kilzer <ddkilzer@webkit.org>
+
+ TOOL FIX: bugzilla-tool: import CommitMessage class
+
+ * Scripts/bugzilla-tool: After r45940, the CommitMessage class
+ needs to be imported for commit_message_for_this_commit().
+
+2009-07-16 David Levin <levin@chromium.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ prepare-ChangeLog should display the --bug option in its help text.
+ https://bugs.webkit.org/show_bug.cgi?id=27334
+
+ * Scripts/prepare-ChangeLog: Added the help text.
+
+2009-07-15 Darin Adler <darin@apple.com>
+
+ * Scripts/do-webcore-rename: Check in the version used to
+ rename parseURL to deprecatedParseURL.
+
+2009-07-10 David Kilzer <ddkilzer@apple.com>
+
+ bugzilla-tool: create CommitMessage class
+
+ Reviewed by Eric Seidel.
+
+ Create a CommitMessage class to encapsulate related code.
+
+ * Scripts/bugzilla-tool:
+ (bug_id_from_commit_message): Moved to
+ CommitMessage.parse_bug_id().
+ (commit_message_for_this_commit): Return a CommitMessage.
+ (ApplyPatchesFromBug.apply_patches): Use CommitMessage.message().
+ (LandPatchesFromBugs.build_and_commit): Ditto.
+ (CommitMessageForCurrentDiff.execute): Ditto.
+ (PostCommitsAsPatchesToBug.execute): Switched from
+ Git.commit_message_for_commit() to
+ Git.commit_message_for_local_commit(). Switched from
+ bug_id_from_commit_message() to CommitMessage.parse_bug_id().
+
+ * Scripts/modules/scm.py:
+ (first_non_empty_line_after_index): Added.
+ (CommitMessage.__init__): Added.
+ (CommitMessage.body): Added.
+ (CommitMessage.description): Added.
+ (CommitMessage.message): Added.
+ (CommitMessage.parse_bug_id): Added. Moved from
+ bug_id_from_commit_message() in bugzilla-tool.
+ (Git.commit_message_for_local_commit): Renamed from
+ commit_message_for_commit(). Return a CommitMessage.
+
+2009-07-15 Joseph Pecoraro <joepeck02@gmail.com>
+
+ Reviewed by David Kilzer.
+
+ bugzilla-tool/svn-apply can't handle patches made from a non-root directory
+ https://bugs.webkit.org/show_bug.cgi?id=26999
+
+ * Scripts/svn-create-patch:
+
+2009-07-15 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ Move cpplint.py to module directory
+ https://bugs.webkit.org/show_bug.cgi?id=27302
+
+ * Scripts/modules/cpplint.py: Renamed from WebKitTools/Scripts/cpplint.py.
+ * Scripts/modules/cpplint_unittest.py: Renamed from WebKitTools/Scripts/cpplint_unittest.py.
+
+2009-07-15 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Adam Treat.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27295
+
+ Re-implement QWebPage::shouldInterruptJavaScript to disable
+ js interruption and avoid showing a messagebox during Qt DRT
+ runs when script execution takes a bit longer.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::shouldInterruptJavaScript): Return false
+ in re-implemented slot.
+
+2009-07-15 Zoltan Horvath <hzoltan@inf.u-szeged.hu>
+
+ Reviewed by Jan Alonzo.
+
+ Fix the DumpRenderTree GTK+ build
+ https://bugs.webkit.org/show_bug.cgi?id=27290
+
+ Set USE_SYSTEM_MALLOC macro for the DumpRenderTree build to
+ disable using TCmalloc in DumpRenderTree.
+
+ * GNUmakefile.am:
+
+2009-07-14 Steve Falkenburg <sfalken@apple.com>
+
+ Reorganize JavaScriptCore headers into:
+ API: include/JavaScriptCore/
+ Private: include/private/JavaScriptCore/
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/ImageDiff.vcproj:
+
+2009-07-14 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by David Levin.
+
+ WebKit needs a style linting tool
+ https://bugs.webkit.org/show_bug.cgi?id=25884
+
+ Modifies cpplint (http://google-styleguide.googlecode.com/svn/trunk/cpplint/)
+ based on WebKit's style guide.
+
+ * Scripts/cpplint.py: Added.
+ * Scripts/cpplint_unittest.py: Added.
+
+2009-07-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] DumpRenderTree no longer builds with Qt4.4
+ https://bugs.webkit.org/show_bug.cgi?id=27257
+
+ Flag Qt 4.5 dependency to allow building with Qt 4.4.
+
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2009-07-13 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add new configuration flag for redistributable Windows build.
+ https://bugs.webkit.org/show_bug.cgi=27087
+
+ * DumpRenderTree/config.h: Check for presence of WIN_CAIRO and
+ select appropriate configuration. Defaults to standard Apple build.
+ * DumpRenderTree/win/DumpRenderTree.vcproj: Add new WinCairo.vsprops
+ to Debug_Cairo and Release_Cairo targets.
+
+2009-07-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ Always run the Qt DRT with the raster graphicssystem on X11, for
+ increased stability in the image based tests, in particular canvas.
+
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2009-07-13 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ Fix test netscape plugin usage with the Qt DRT.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage): Enable plugins in the settings.
+ * Scripts/run-webkit-tests: Set the QT_WEBKIT_PLUGIN path to the correct build
+ directory to make Qt DRT find the test netscape plugin.
+
+2009-07-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Make sure to disable the fixed contents size when resetting the page/view
+ state between test runs, to avoid side-effects.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::open): Call setFixedContentsSize() with an invalid
+ QSize to disable the fixed layout.
+
+2009-07-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ When creating new windows, don't forget to connect the new
+ page's main frame. This ensures that for example the layoutTestController
+ is also available there.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::createWindow):
+
+2009-07-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Added support for LayoutTestController.setPrivateBrowsingEnabled.
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::setPrivateBrowsingEnabled):
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-07-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Added support for database callbacks, storage quota setting,
+ and clearing of all databases.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+ (WebCore::DumpRenderTree::dumpDatabaseQuota):
+ * DumpRenderTree/qt/DumpRenderTree.h:
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::reset):
+ (LayoutTestController::setDatabaseQuota):
+ (LayoutTestController::clearAllDatabases):
+ * DumpRenderTree/qt/jsobjects.h:
+ (LayoutTestController::shouldDumpDatabaseCallbacks):
+ (LayoutTestController::dumpDatabaseCallbacks):
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2009-07-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Setup the path in the Qt DRT for HTML 5 Databases, to enable some of
+ the storage layout tests.
+
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2009-07-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Make the test output more robust by dumping only when the main
+ frame finishes loading, instead of when _any_ frame finishes.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree): Connect to the
+ main frame's loadFinished() signal instead of the page's one.
+
+2009-07-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Implement the GCController DRT interface.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree): Allocate the GCController.
+ (WebCore::DumpRenderTree::initJSObjects): Register the interface with the JS engine.
+ * DumpRenderTree/qt/DumpRenderTree.h: Declare m_gcController.
+ * DumpRenderTree/qt/jsobjects.cpp: Implement GCController.
+ (GCController::GCController):
+ (GCController::collect):
+ (GCController::collectOnAlternateThread):
+ (GCController::getJSObjectCount):
+ * DumpRenderTree/qt/jsobjects.h: Declare GCController.
+
+2009-07-13 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Implement the GCController DRT interface in the Qt DRT.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree): Allocate the GCController.
+ (WebCore::DumpRenderTree::initJSObjects): Register the interface with the JS engine.
+ * DumpRenderTree/qt/DumpRenderTree.h: Declare m_gcController.
+ * DumpRenderTree/qt/jsobjects.cpp: Implement GCController.
+ (GCController::GCController):
+ (GCController::collect):
+ (GCController::collectOnAlternateThread):
+ (GCController::getJSObjectCount):
+ * DumpRenderTree/qt/jsobjects.h: Declare GCController.
+
+2009-07-13 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ https://bugs.webkit.org/show_bug.cgi?id=26718 [Gtk] Add support for javascript windows for DRT
+
+ Reviewed by Gustavo Noronha and Xan Lopez.
+
+ Support running of tests that open and close JS windows automatically.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (dumpFramesAsText):
+ (dumpBackForwardListForAllWebViews):
+ (resetWebViewToConsistentStateBeforeTesting):
+ (dump):
+ (runTest):
+ (webViewClose):
+ (createWebView):
+ (webViewCreate):
+ (main):
+ * DumpRenderTree/gtk/DumpRenderTreeGtk.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::windowCount):
+ (LayoutTestController::setPopupBlockingEnabled):
+
+2009-07-13 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ prepare-ChangeLog should decode HTML entities in short description
+ https://bugs.webkit.org/show_bug.cgi?id=27122
+
+ Decode the short description by adding a function which decodes HTML
+ entities. It can decode &, <, >, ", and ' . They may be sufficient
+ as the description seems to be encoded by xml_quote in
+ http://mxr.mozilla.org/bugzilla/source/Bugzilla/Util.pm
+
+ * Scripts/prepare-ChangeLog:
+
+2009-07-13 Drew Wilson <atwilson@google.com>
+
+ Reviewed by David Levin.
+
+ Add ENABLE(SHARED_WORKERS) flag and define SharedWorker APIs
+ https://bugs.webkit.org/show_bug.cgi?id=26932
+
+ Added support for --shared-workers (turned off by default)
+
+ * Scripts/build-webkit:
+
+2009-07-12 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27196
+ Update check-for-global-initializers for the renaming for bidi.cpp to
+ RenderBlockLineLayout.cpp
+
+ * Scripts/check-for-global-initializers:
+
+2009-07-11 Simon Fraser <simon.fraser@apple.com>
+
+ Enable support for accelerated compositing and 3d transforms on Leopard.
+ <https://bugs.webkit.org/show_bug.cgi?id=20166>
+ <rdar://problem/6120614>
+
+ Reviewed by Oliver Hunt.
+
+ * Configurations/FeatureDefines.xcconfig:
+ * wtf/Platform.h:
+
+2009-07-10 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27173> svn-apply: Fix typo in git command used to find deleted files
+
+ Reviewed by Eric Seidel.
+
+ * Scripts/svn-apply:
+ (scmWillDeleteFile): Changed 'head' to 'HEAD'.
+
+2009-07-10 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27167> bugzilla-tool: hide help for unsupported commands
+
+ Reviewed by Eric Seidel.
+
+ When bugzilla-tool -h|--help is invoked in an svn working
+ directory, don't print help for commands that are only supported
+ on git working directories.
+
+ * Scripts/bugzilla-tool:
+ (Command.__init__): Added requires_local_commits argument with a
+ default of False. Set self.requires_local_commits attribute.
+ (PostCommitsAsPatchesToBug.execute): Removed
+ SCM.supports_local_commits() check since this is now handled by
+ BugzillaTool.main().
+ (PostCommitsAsPatchesToBug.__init__): Added
+ requires_local_commits=True argument to Command.__init__().
+ (BugzillaTool.commands_usage): Don't print help for commands if
+ they require local commits and the current SCM doesn't support
+ them.
+ (BugzillaTool.main): If command_object requires local commits
+ and the current SCM doesn't, exit with an error message.
+
+2009-07-10 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27117> bugzilla-tool: use Mac OS X keychain for authentication
+
+ Reviewed by Eric Seidel.
+
+ Try reading credentials from git config first, then keychain if
+ running on Mac OS X, else prompt at the command-line.
+
+ * Scripts/modules/bugzilla.py: Added "import platform".
+ (credentials_from_git): Added.
+ (credentials_from_keychain): Added.
+ (is_mac_os_x): Added.
+ (read_credentials): Added.
+ (Bugzilla.__init__): Moved instance attribute bug_server to a
+ static attribute named bug-server_url.
+ (Bugzilla.bug_server_host): Added. Extracted host name from
+ bug_server_url.
+ (Bugzilla.bug_server_regex): Updated to be created using
+ bug_server_host.
+ (Bugzilla.bug_server_url): Renamed from bug_server.
+ (Bugzilla.bug_url_for_bug_id): Updated for renaming of
+ bug_server to bug_server_url.
+ (Bugzilla.attachment_url_for_id): Ditto.
+ (Bugzilla.fetch_bug_ids_from_commit_queue): Ditto.
+ (Bugzilla.authenticate): Ditto. Updated to use
+ read_credentials().
+ (Bugzilla.add_patch_to_bug): Ditto.
+
+2009-07-10 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27115> bugzilla-tool: extract duplicate logging methods into a module
+
+ Reviewed by Adam Roben.
+
+ * Scripts/bugzilla-tool: Removed error() and log() methods and
+ added import of new logging module.
+ * Scripts/modules/bugzilla.py: Ditto. Removed "import sys".
+ * Scripts/modules/scm.py: Ditto.
+
+ * Scripts/modules/logging.py: Added.
+ (log): Added.
+ (error): Added. Prefix error messages with "ERROR: ".
+
+2009-07-10 Adam Roben <aroben@apple.com>
+
+ Sort all our Xcode projects
+
+ Accomplished using sort-Xcode-project-file.
+
+ Requested by Dave Kilzer.
+
+ * DrawTest/DrawTest.xcodeproj/project.pbxproj:
+ * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+ * WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj:
+
+2009-07-10 Adam Roben <aroben@apple.com>
+
+ Print prepare-ChangeLog's reminders to STDERR so they don't end up in
+ the diff output
+
+ Fixes REGRESSION (r45647): prepare-ChangeLog -d puts non-diff lines
+ into the diff
+ <https://bugs.webkit.org/show_bug.cgi?id=27150>
+
+ Reviewed by Maciej Stachowiak.
+
+ * Scripts/prepare-ChangeLog:
+
+2009-07-08 Adam Roben <aroben@apple.com>
+
+ Use case-insensitive comparisons when sorting Xcode project files
+
+ This matches the sorting used in Xcode's files list.
+
+ Fixes Bug 27079: sort-Xcode-project-file should sort
+ case-insensitively, to match Xcode's files list
+ <https://bugs.webkit.org/show_bug.cgi?id=27079>
+
+ Reviewed by Dave Kilzer.
+
+ * Scripts/sort-Xcode-project-file:
+ (sortChildrenByFileName):
+ (sortFilesByFileName):
+ Lowercase the strings before comparing them so that the comparison
+ will be case-insensitive.
+
+2009-07-08 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27109
+
+ Fix side-effects in the Qt DRT with tests using application fonts.
+
+ Detect if a test used application fonts and re-initialize the fontconfig
+ application fontset accordingly.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::open): call initializeFonts and remove all application fonts
+ after running a testcase.
+ (WebCore::DumpRenderTree::initializeFonts): Moved fontconfig initialization code
+ here from main.
+ * DumpRenderTree/qt/DumpRenderTree.h: Declare initializeFonts.
+ * DumpRenderTree/qt/main.cpp:
+ (main): Moved fontconfig initialization code to DRT::initializeFonts.
+
+2009-07-10 Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ [QT] [ARM] Add pkg-config entry for FontConfig on DRT.pro
+ https://bugs.webkit.org/show_bug.cgi?id=26990
+
+ Missing pkg-config entry for FontConfig in DRT.pro causes some compilers to
+ not link fine against FontConfig bits.
+
+ * DumpRenderTree/qt/DumpRenderTree.pro:
+
+2009-07-09 Drew Wilson <atwilson@google.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26903
+
+ Turned on CHANNEL_MESSAGING by default because the MessageChannel API
+ can now be implemented for Web Workers and is reasonably stable.
+
+ * Scripts/build-webkit:
+
+2009-07-09 David Kilzer <ddkilzer@apple.com>
+
+ <http://webkit.org/b/27114> bugzilla-tool: Parse short bug URL from commit log messages
+
+ Reviewed by Adam Roben.
+
+ * Scripts/bugzilla-tool:
+ (bug_id_from_commit_message): Check for the short bug URL before
+ checking for the longer bugs.webkit.org URL.
+
+2009-07-08 David Kilzer <ddkilzer@apple.com>
+
+ Bug 27062: bugzilla-tool: post-commits should read bug id from commit log and actually work
+
+ <https://bugs.webkit.org/show_bug.cgi?id=27062>
+
+ Reviewed by Eric Seidel.
+
+ Removed the required BUGID argument from the "post-commits"
+ command and replaced it with a -b|--bug-id switch or parsing the
+ commit log message for the bug URL. Fixed a bug in the
+ "post-commits" that would ignore the COMMITISH used and post a
+ patch of local changes against HEAD. Added --no-commit switch
+ to disable using the bulk of the ChangeLog entry as the comment
+ for the new patch.
+
+ * Scripts/bugzilla-tool:
+ (bug_id_from_commit_message): Added. Returns a bug id from the
+ commit log message, thus enforcing the need for a bug URL in the
+ message.
+ (PostCommitsAsPatchesToBug.__init__): Updated help description
+ to match new behavior of pulling bug ids from commit log
+ messages instead of from the command line. Added -b|--bug-id
+ switch and --no-comment switch.
+ (PostCommitsAsPatchesToBug.execute): Updated to use
+ bug_id_from_commit_message() to pull bug ids from commit log
+ messages. Also switched from SCM.create_patch() to use
+ SCM.create_patch_from_local_commit() to fix a bug where local
+ repository changes were posted as a patch instead of the
+ specific COMMITISH. Fall back to -b|--bug-id if no URL is found
+ in the commit log message. Don't specify a comment for the
+ patch if --no-comment is used. Set cherry_pick argument to True
+ for Git.commit_ids_from_range_arguments() since we don't want
+ implicit commit range behavior for this command.
+
+ * Scripts/modules/bugzilla.py: Import datetime module.
+ (timestamp): Added. Returns a timestamp in the form of
+ "YYYYMMDDhhmmss".
+ (Bugzilla.bug_server_regex): Added static attribute.
+ (Bugzilla.add_patch_to_bug): Construct a more meaningful patch
+ file name using the bug_id and timestamp().
+
+ * Scripts/modules/scm.py:
+ (SCM.create_patch_from_local_commit): Added.
+ (Git.create_patch_from_local_commit): Added. Runs "git diff" to
+ return a patch for the given commit_id.
+
+2009-07-08 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ Make prepare-ChangeLog less shouty
+ https://bugs.webkit.org/show_bug.cgi?id=27098
+
+ * Scripts/prepare-ChangeLog:
+
+2009-07-08 David Kilzer <ddkilzer@apple.com>
+
+ Bug 27083: bugzilla.py: Clean up bug_server use
+
+ <https://bugs.webkit.org/show_bug.cgi?id=27083>
+
+ Reviewed by Darin Adler.
+
+ * Scripts/modules/bugzilla.py:
+ (Bugzilla.fetch_bug_ids_from_commit_queue): Use bug_server
+ instead of hard-coding the URL.
+ (Bugzilla.authenticate): Remove extra '/' before URL path.
+ (Bugzilla.add_patch_to_bug): Ditto.
+
+2009-07-08 Brent Fulgham <bfulgham@webkit.org>
+
+ Build fix for Windows Cairo.
+
+ Cairo build was incorrectly #including the PixelDumpSupportCG.h
+ instead of PixelDumpSupportCairo.h
+
+ * DumpRenderTree/win/PixelDumpSupportWin.cpp: Correct #include
+
+2009-07-08 David Faure <faure@kde.org>
+
+ Reviewed by Ariya Hidayat.
+
+ Small documentation improvement for build-webkit --help
+
+ * Scripts/build-webkit: mention --debug option
+
+2009-07-07 Brady Eidson <beidson@apple.com>
+
+ Tiger build fix, work around missing NSString API.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (dumpHistoryItem):
+
+2009-07-07 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ https://bugs.webkit.org/show_bug.cgi?id=27049 - In dumpBackForwardList() mode, DRT should normalize file urls.
+
+ Make the dump of a history item agnostic to the layout of filesystem on the testing machine.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (dumpHistoryItem):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (dumpHistoryItem):
+
+2009-07-07 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Rubber-stamped by Simon Hausmann.
+
+ Correct git url of the Qt test-fonts.
+
+ * DumpRenderTree/qt/main.cpp:
+ (main):
+
+2009-07-07 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ Clear the main frame's name between loading pages, like in r36652. This
+ reduces the side-effects between test cases.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::open):
+
+2009-07-06 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Holger Freyther.
+
+ Fix various layout tests with Qt's DRT.
+
+ Remember to set the focus on the web page before
+ loading.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::DumpRenderTree::open):
+
+2009-07-07 Simon Hausmann <hausmann@webkit.org>
+
+ Reviewed by Tor Arne Vestbø and Holger Freyther.
+
+ Fix timeout timer handling in Qt DRT.
+
+ Use QBasicTimer instead of startTimer/killTimer, to fix the
+ problem that starting the timeout timer did not stop a
+ previously started timer, causing multiple emissions of timeout.
+ The timerEvent() implementation now also checks the timer id, to
+ protect against double timeouts.
+
+ * DumpRenderTree/qt/jsobjects.cpp:
+ (LayoutTestController::LayoutTestController):
+ (LayoutTestController::reset):
+ (LayoutTestController::waitUntilDone):
+ (LayoutTestController::notifyDone):
+ (LayoutTestController::timerEvent):
+ * DumpRenderTree/qt/jsobjects.h:
+
+2009-07-06 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ bugzilla-tool fails to close bugs with bugzilla 3.0
+ https://bugs.webkit.org/show_bug.cgi?id=27008
+
+ Update bugzilla.py to match changes in the bug page "changeform"
+ Update scm.py to add bug_ids to attachments to make error reporting nicer.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/scm.py:
+
+2009-07-03 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Eric Seidel.
+
+ bugzilla-tool forgot how to obsolete patches
+ https://bugs.webkit.org/show_bug.cgi?id=26951
+
+ * Scripts/modules/bugzilla.py:
+
+2009-07-02 Brent Fulgham <bfulgham@webkit.org>
+
+ Unreviewed build fix (Cairo this time) for DumpRenderTree.
+ Put Cairo code back in, but use original include order
+ for the CG stuff to avoid compile issues.
+
+ * DumpRenderTree/win/PixelDumpSupportWin.cpp:
+ (createBitmapContextFromWebView):
+
+2009-07-02 Eric Seidel <eric@webkit.org>
+
+ Correct blatant typo (missing []), no review.
+
+ * Scripts/modules/scm.py:
+
+2009-07-02 Brent Fulgham <bfulgham@webkit.org>
+
+ Windows build fix, no review.
+
+
+ Reverting PixelDumpSupportWin.cpp change to avoid strange
+ error on the build-bot.
+
+ * DumpRenderTree/win/PixelDumpSupportWin.cpp:
+ (createBitmapContextFromWebView):
+
+2009-07-02 Brent Fulgham <bfulgham@webkit.org>
+
+ Build fix, no review.
+
+ * DumpRenderTree/config.h:
+
+2009-07-02 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ bugzilla-tool needs to handle login failure
+ https://bugs.webkit.org/show_bug.cgi?id=26913
+
+ We now exit(1) on login failure.
+
+ * Scripts/modules/bugzilla.py:
+
+2009-06-30 Brent Fulgham <bfulgham@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ Add build support for a Windows Cairo version of
+ DumpRenderTree. Share as much logic between the
+ CG and Cairo builds as possible.
+ https://bugs.webkit.org/show_bug.cgi?id=26457
+
+ * DumpRenderTree/PixelDumpSupport.cpp: Added.
+ (dumpWebViewAsPixelsAndCompareWithExpected): Moved common logic
+ from CG-specific file.
+ (printPNG): Moved common logic from CG-specific file.
+ * DumpRenderTree/PixelDumpSupport.h: Add declaration for new
+ common printPNG function.
+ * DumpRenderTree/cairo: Added.
+ * DumpRenderTree/cairo/PixelDumpSupportCairo.cpp: Added.
+ Implement cairo-specific logic for dealing with Cairo surfaces.
+ (writeFunction):
+ (printPNG): Cairo-specific PNG handling logic.
+ (computeMD5HashStringForBitmapContext): New Cairo routine using
+ the generic BitmapContext signature.
+ (dumpBitmap): New function containing Cairo-specific portions of
+ the dumping routine.
+ * DumpRenderTree/cairo/PixelDumpSupportCairo.h: Added.
+ Provide Cairo version of the BitmapContext structure so that
+ dumping routines can work on an abstract type.
+ (BitmapContext::createByAdoptingBitmapAndContext):
+ (BitmapContext::~BitmapContext):
+ (BitmapContext::cairoContext):
+ (BitmapContext::BitmapContext):
+ * DumpRenderTree/cg/PixelDumpSupportCG.cpp:
+ (printPNG): CG-specific PNG handling logic.
+ (computeMD5HashStringForBitmapContext): Revised to use generic
+ BitmapContext signature.
+ (dumpBitmap): New function containing CG-specific portions of
+ the dumping routine.
+ * DumpRenderTree/cg/PixelDumpSupportCG.h: Add new signatures.
+ * DumpRenderTree/win/DumpRenderTree.cpp: Disable CFNetwork logic
+ when building the non-CFNetwork version.
+ (main):
+ * DumpRenderTree/win/DumpRenderTree.vcproj:
+ * DumpRenderTree/win/PixelDumpSupportWin.cpp:
+ (createBitmapContextFromWebView): Provide parallel Cairo implementation
+ of CG bitmap/context setup.
+
+2009-07-02 Eric Seidel <eric@webkit.org>
+
+ No review, just adding Antti as a reviewer.
+
+ * Scripts/modules/bugzilla.py:
+
+2009-07-02 Antonio Gomes <antonio.gomes@openbossa.org>
+
+ Reviewed by Simon Hausmann.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26896
+
+ [Qt] Set DRT's default fontsize to 13.
+
+ * DumpRenderTree/qt/DumpRenderTree.cpp:
+ (WebCore::WebPage::WebPage):
+
+2009-07-01 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ bugzilla-tool fails for SVN users
+ https://bugs.webkit.org/show_bug.cgi?id=26914
+
+ To fix this I moved svn from -F - to using -m
+ In order for -m to work I had to move us off of shell=True
+ To move off of shell=True all call sites for run_command
+ which take args, need to pass their args as an list instead of a string.
+
+ In order for the final bug update to work correctly, I had to
+ abstract the way that we parse out revision numbers from the commit text.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/scm.py:
+
+2009-07-01 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ prepare-ChangeLog should have a --bug= argument and use it for url autofill
+ https://bugs.webkit.org/show_bug.cgi?id=26383
+
+ prepare-ChangeLog now knows how to grab the bug title from bugs.webkit.org
+ I also added a bit more template text in an effort to get better ChangeLogs
+ from casual contributers.
+
+ * Scripts/prepare-ChangeLog:
+
+2009-07-01 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Roben.
+
+ prepare-ChangeLog should fail when EMAIL_ADDRESS or REAL_NAME are missing:
+ https://bugs.webkit.org/show_bug.cgi?id=26692
+
+ I also made prepare-ChangeLog sanity-check names and email addresses a little.
+ Names must contain a space, and email addresses must contain '@'
+
+ Also "fixed" $email_address to $emailAddress. This script uses mixed variable name styles.
+
+ * Scripts/prepare-ChangeLog:
+
+2009-07-01 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ Bug 26900: AX: Manual spell check with Command-; does not bring up suggestions
+ https://bugs.webkit.org/show_bug.cgi?id=26900
+
+ Expose the ability to get the click point of an element through accessibility.
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getClickPointXCallback):
+ (getClickPointYCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::clickPointX):
+ (AccessibilityUIElement::clickPointY):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::clickPointX):
+ (AccessibilityUIElement::clickPointY):
+
+2009-07-01 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Change how WebKitNightlyEnabler.dylib lies about Safari's identity to LaunchServices.
+ This makes WebKit.app behave as expected when set as the default web browser on a wider
+ range of OS versions.
+
+ * WebKitLauncher/WebKitNightlyEnabler.m:
+ (poseAsWebKitApp):
+ (enableWebKitNightlyBehaviour):
+
+2009-07-01 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Shuffle some code around in preparation for a change to how poseAsWebKitApp works.
+
+ * WebKitLauncher/WebKitNightlyEnabler.m:
+ (systemVersion):
+ (webKitLauncherBundle):
+ (insideSafari4OnTigerTrampoline):
+
+2009-06-30 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Jan Alonzo.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26877
+ [GTK] DRT fixes to pass new plugin test
+
+ Silence compiler warnings.
+
+ Newer GCC don't like using or returning a static string where a
+ 'char*' is expected. Ideally we'd change the function signatures
+ to return or take 'const char*' I suppose, but since we can't do
+ that just cast the strings to 'char*'.
+
+ * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_get_value):
+
+2009-06-30 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Jan Alonzo.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26877
+ [GTK] DRT fixes to pass new plugin test
+
+ Use the common pluginLog function instead of a local copy.
+
+ * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_instance):
+ (webkit_test_plugin_destroy_instance):
+ (webkit_test_plugin_set_window):
+ (webkit_test_plugin_handle_event):
+
+2009-06-30 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Jan Alonzo.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26877
+ [GTK] DRT fixes to pass new plugin test
+
+ Modify our DRT as done in bug #15457 to log logSrc as src in order
+ to pass test plugins/netscape-plugin-map-data-to-src.html.
+
+ * DumpRenderTree/gtk/TestNetscapePlugin/TestNetscapePlugin.cpp:
+ (webkit_test_plugin_new_instance):
+
+2009-06-30 Adrien Nader <camaradetux@gmail.com>
+
+ Reviewed by Jan Alonzo.
+
+ [GTK] GtkLauncher depends on gtk+2-2.15 because of gtk_orientable_set_orientation()
+ https://bugs.webkit.org/show_bug.cgi?id=26835
+
+ * GtkLauncher/main.c:
+ (create_toolbar):
+
+2009-06-30 Eric Seidel <eric@webkit.org>
+
+ Typo fix only, no review.
+
+ Fix typo causing failure during land-diff
+
+ * Scripts/bugzilla-tool:
+
+2009-06-30 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix drawing of view background in pixel snapshots when using compositing.
+ We still need to call -displayIfNeeded to ensure that the NSView drawing
+ has happened.
+
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ (createBitmapContextFromWebView):
+
+2009-06-30 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Mark Rowe.
+
+ createBitmapContextFromWebView() incorrectly used #ifdef BUILDING_ON_LEOPARD,
+ and thus failed on SnowLeopard.
+
+ * DumpRenderTree/mac/PixelDumpSupportMac.mm:
+ (createBitmapContextFromWebView):
+
+2009-06-30 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Make bugzilla tool print a message explaining how to get help on failure:
+ https://bugs.webkit.org/show_bug.cgi?id=26861
+
+ % bugzilla-tool
+ Usage: bugzilla-tool [options] command [command-options] [command-arguments]
+
+ bugzilla-tool: error: No command specified
+
+ Type 'bugzilla-tool --help' to see usage.
+
+ * Scripts/bugzilla-tool:
+
+2009-06-30 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Include a built copy of BeautifulSoup 3.1.0.1 so that
+ bugzilla-tool users do not need to install it manually.
+ https://bugs.webkit.org/show_bug.cgi?id=26833
+
+ BeautifulSoup is BSD-licensed (thus WebKit compatible) and available from:
+ http://www.crummy.com/software/BeautifulSoup
+
+ * Scripts/bugzilla-tool: fixed a typo in a log message.
+ * Scripts/modules/BeautifulSoup.py: Added.
+ * Scripts/modules/bugzilla.py:
+
+2009-06-30 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ Fix our create_patch handling to not
+ hang when creating large patches.
+ https://bugs.webkit.org/show_bug.cgi?id=26834
+
+ We're now using StringIO to make an in-memory buffer for the patch
+ instead of piping from the patch command directly to the upload.
+ The previous hang was caused by calling wait() when the process had already
+ filed the stdout buffer.
+
+ * Scripts/modules/scm.py:
+
+2009-06-29 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Remove more unused scons support.
+
+ * Scripts/build-jsc:
+ * Scripts/build-webkit:
+ * Scripts/webkitdirs.pm:
+
+2009-06-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by David Levin.
+
+ Rename land-and-update to land-diff and make it awesome.
+ https://bugs.webkit.org/show_bug.cgi?id=26734
+
+ Renamed land-and-update to land-diff
+ Made the BUGID argument optional.
+ Added optional support for building and testing before landing.
+
+ land-diff [options] [BUGID] Lands the current working directory diff and updates the bug if provided.
+ Options:
+ -r REVIEWER, --reviewer=REVIEWER
+ Update ChangeLogs to say Reviewed by REVIEWER.
+ --no-close Leave bug open after landing.
+ --no-build Commit without building first, implies --no-test.
+ --no-test Commit without running run-webkit-tests.
+
+ * Scripts/bugzilla-tool:
+
+2009-06-28 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Gtk build fix - include stdarg.h for va_start/va_end.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+
+2009-06-28 John Abd-El-Malek <jam@chromium.org>
+
+ https://bugs.webkit.org/show_bug.cgi?id=15457
+
+ Modify NPAPI test plugin to verify that "src" paramater is added when
+ it's missing but "data" is present.
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp:
+ (pluginLog):
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h:
+ * DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp:
+ (NPP_New):
+ (NPP_Destroy):
+ (NPP_SetWindow):
+ (handleEventCarbon):
+ (handleEventCocoa):
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_New):
+
+2009-06-27 Emilio Pozuelo Monfort <pochu27@gmail.com>
+
+ Reviewed by Jan Alonzo.
+
+ [GTK] Don't use deprecated GTK+ symbols.
+ https://bugs.webkit.org/show_bug.cgi?id=26583
+
+ * GtkLauncher/main.c:
+ (create_toolbar):
+
+2009-06-26 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Make SVN work (again?).
+
+ * Scripts/modules/scm.py:
+
+2009-06-26 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Add ability to query isEnabled
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getIsEnabledCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::isEnabled):
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::isEnabled):
+
+2009-06-26 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig
+
+ <rdar://problem/6961578> REGRESSION (r43511): Opening .fdf files from Acrobat Professional fails
+
+ Add a dumpResourceResponseMIMETypes() mode so the ResourceLoadDelegate will dump the mime type from
+ the NSURLResponse. Needed for the test for this bug fix.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::LayoutTestController):
+ (dumpResourceResponseMIMETypesCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ (LayoutTestController::dumpResourceResponseMIMETypes):
+ (LayoutTestController::setDumpResourceResponseMIMETypes):
+
+ * DumpRenderTree/mac/ResourceLoadDelegate.mm:
+ (-[ResourceLoadDelegate webView:resource:didReceiveResponse:fromDataSource:]):
+
+2009-06-26 David Kilzer <ddkilzer@apple.com>
+
+ Update build-dumprendertree to use buildXCodeProject()
+
+ Reviewed by Adam Roben.
+
+ * Scripts/build-dumprendertree: Updated to use
+ buildXCodeProject() when building for isAppleMacWebKit(). This
+ provides additional command-line switch parsing for free. Also
+ added --clean and --help switches. Updated copyright.
+
+2009-06-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Remove non-sense --update option to land-patches
+ and make land-patches update before every patch application.
+ This makes it slightly less likely that multi-patch landings will fail.
+
+ Also updated git diff command to include staged modifications.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/scm.py:
+
+2009-06-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Jan Alonzo.
+
+ Fix obsolete_attachment to work when passed a comment.
+ https://bugs.webkit.org/show_bug.cgi?id=26745
+
+ * Scripts/modules/bugzilla.py:
+
+2009-06-25 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ bugzilla-tool apply-patch throws exception in Linux
+ https://bugs.webkit.org/show_bug.cgi?id=26738
+
+ HEAD is case-sensitive in Linux. Convert uses of head to HEAD in
+ the scm module.
+
+ * Scripts/modules/scm.py:
+
+2009-06-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Jan Alonzo.
+
+ bugzilla-tool post-diff needs to obsolete old patches before posting
+ https://bugs.webkit.org/show_bug.cgi?id=26740
+
+ I've also added a --no-obsolete to disable this behavior.
+
+ I also finally updated the bug page parsing to use XML. So much less code!
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/bugzilla.py:
+
+2009-06-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ Call WebKitTools/Scripts scripts by their absolute paths
+ https://bugs.webkit.org/show_bug.cgi?id=26704
+
+ bugzilla-tool used to use whatever build-webkit was in your path.
+ That could end up building the wrong copy of WebKit.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/scm.py:
+
+2009-06-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Dave Levin.
+
+ Use unicode() instead of str when reading from bugzilla.
+ Also add Simon Fraser as a reviewer.
+ https://bugs.webkit.org/show_bug.cgi?id=26719
+
+ * Scripts/modules/bugzilla.py:
+
+2009-06-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Use Q_ASSERT in Qt's DumpRenderTree instead of JSC's ASSERT
+
+ The WTFReportAssertionFailure function in JSC is not exported when
+ building QtWebKit in both debug and release on Mac, so DRT fails to
+ link.
+
+ We can revert this patch once the Qt port builds JSC as a separate
+ library, and we add the proper export macros to Assertions.cpp
+
+ * DumpRenderTree/qt/WorkQueue.cpp:
+ (WorkQueue::queue):
+ (WorkQueue::dequeue):
+
+2009-06-25 Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
+
+ Reviewed by Jan Alonzo.
+
+ bugzilla-tool: Add Simon Hausmann as reviewer
+
+ * Scripts/modules/bugzilla.py:
+
+2009-06-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Dave Levin.
+
+ Support local commits during apply-patches
+ and let land-patches take multiple bug ids.
+ https://bugs.webkit.org/show_bug.cgi?id=26703
+
+ I also restructured parts of land-patches into
+ class methods and static methods in preparation
+ for future code sharing with other commands.
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/scm.py:
+
+2009-06-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Make svn-apply work with Git too
+ https://bugs.webkit.org/show_bug.cgi?id=26299
+
+ Add an --force option to svn-apply and otherwise make svn-apply
+ exit non-zero when patch application fails.
+ https://bugs.webkit.org/show_bug.cgi?id=26300
+
+ I did not update svn-unapply, because it makes no sense in a Git world.
+ You don't roll in and out patch files. You make commits and deal with those.
+ Git users can just git reset --hard to get the same functionality.
+
+ * Scripts/svn-apply:
+
+2009-06-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Remove use of os.system to fix reviewers with unicode chars in their names
+ https://bugs.webkit.org/show_bug.cgi?id=26713
+
+ Also change to latin1 encoding of ø to make python happy.
+
+ * Scripts/modules/bugzilla.py:
+ * Scripts/modules/scm.py:
+
+2009-06-25 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Add Adam Roben and Tor Arne Vestbø to the reviewers list.
+
+ * Scripts/modules/bugzilla.py:
+
+2009-06-24 Chris Fleizach <cfleizach@apple.com>
+
+ Windows build fix.
+
+ * DumpRenderTree/win/AccessibilityUIElementWin.cpp:
+ (AccessibilityUIElement::language):
+
+2009-06-24 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Bug 26668: AX: need a way to retrieve the language for an element
+ Support ability to retrieve AXLanguage for testing
+
+ * DumpRenderTree/AccessibilityUIElement.cpp:
+ (getLanguageCallback):
+ (AccessibilityUIElement::getJSClass):
+ * DumpRenderTree/AccessibilityUIElement.h:
+ * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+ (AccessibilityUIElement::language):
+
+2009-06-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Maciej Stachowiak.
+
+ Spell Maciej's name right and add Brady Eidson.
+
+ * Scripts/modules/bugzilla.py:
+
+2009-06-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Dave Levin.
+
+ Fix missing comment message during land-patches and SVN.commit_with_message respecting --dry-run
+ https://bugs.webkit.org/show_bug.cgi?id=26669
+
+ * Scripts/bugzilla-tool:
+ * Scripts/modules/scm.py:
+
+2009-06-23 Takeshi Yoshino <tyoshino@google.com>
+
+ Reviewed by Mark Rowe.
+
+ Bug 26537: Builds from command-line fail if custom build product directory is set and ~/Library/Preferences/xcodebuild.plist exists
+ https://bugs.webkit.org/show_bug.cgi?id=26537
+
+ Let determineBaseProductDir subroutine remove
+ ~/Library/Preferences/xcodebuild.plist. It can prevent xcodebuild from
+ respecting global settings such as a custom build products directory
+ (<rdar://problem/5585899>).
+
+ * Scripts/webkitdirs.pm:
+
+2009-06-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Dave Levin.
+
+ Make SCM.run_command smarter, and make all previous
+ os.system and subprocess.popen use SCM.run_command instead.
+ https://bugs.webkit.org/show_bug.cgi?id=26666
+
+ This makes it easier to handle errors in a standard way throughout all the code.
+ Since this new code raises by default when the exit_code != 0,
+ we should prevent future problems of bugzilla-tool continuing after
+ a git or svn command failed.
+
+ * Scripts/modules/scm.py:
+
+2009-06-23 Joe Mason <joe.mason@torchmobile.com>
+
+ Reviewed by Adam Treat.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26664
+ * Scripts/prepare-ChangeLog: Added --git-index mode to list only the
+ changes which are already staged in the index. Useful to create an
+ entry for what you're about to commit while ignoring unstaged changes.
+
+2009-06-23 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Update for WebKit changes.
+
+ * DumpRenderTree/win/UIDelegate.h:
+ (UIDelegate::willPerformDragSourceAction):
+
+2009-06-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ * Scripts/modules/scm.py: Fix commit_with_message to return the commit output.
+
+2009-06-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Mark Rowe.
+
+ * Scripts/modules/scm.py: Fix error seen when commiting r44979.
+
+2009-06-18 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Dave Levin.
+
+ WebKit needs a script to interact with bugzilla and automate
+ parts of the patch posting and commit processes.
+ https://bugs.webkit.org/show_bug.cgi?id=26283
+
+ This is really a first-draft tool.
+ It's to the point where it's useful to more people than just me now though.
+ Git support works. SVN support is written, but mostly untested.
+
+ This tool requires BeautifulSoup and mechanize python modules to run:
+ sudo easy_install BeautifulSoup
+ sudo easy_install mechanize
+
+ More important than the tool itself are the Bugzilla, Git and SVN class abstractions
+ which I hope will allow easy writing of future tools.
+
+ The tool currently implements 10 commands, described below.
+
+ Helpers for scripting dealing with the commit queue:
+ bugs-to-commit Bugs in the commit queue
+ patches-to-commit Patches attached to bugs in the commit queue
+
+ Dealing with bugzilla:
+ reviewed-patches BUGID r+'d patches on a bug
+ apply-patches BUGID Applies all patches on a bug to the local working directory without committing.
+ land-and-update BUGID Lands the current working directory diff and updates the bug.
+ land-patches [options] BUGID Lands all patches on a bug optionally testing them first
+ obsolete-attachments BUGID Marks all attachments on a bug as obsolete.
+ commit-message Prints a commit message suitable for the uncommitted changes.
+
+ These effectively replace git-send-bugzilla:
+ post-diff BUGID Attaches the current working directory diff to a bug as a patch file.
+ post-commits BUGID COMMITISH Attaches a range of local commits to a bug as patch files.
+
+ post-diff works for SVN and Git, post-commits only works for SCMs with local-commit support (like Git)
+
+ land-* commands in a Git environment only work with simple patches due to svn-apply bugs:
+ https://bugs.webkit.org/show_bug.cgi?id=26299
+ https://bugs.webkit.org/show_bug.cgi?id=26300
+
+ This script follows python style (similar to how for Obj-C we follow AppKit style)
+ http://www.python.org/doc/essays/styleguide.html
+ The Python community has a strong style culture and the WebKit style guide is silent re: Python.
+
+ I've filed a bug to update the WebKit style guide to mention python:
+ https://bugs.webkit.org/show_bug.cgi?id=26524
+
+ * Scripts/bugzilla-tool: Added.
+
+2009-06-22 Steve Falkenburg <sfalken@apple.com>
+
+ Remove errant line of code mistakenly checked in.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+
+2009-06-22 Steve Falkenburg <sfalken@apple.com>
+
+ Pass correct value to setShouldPaintNativeControls.
+
+ Rubber stamped by Mark Rowe.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+
+2009-06-22 Steve Falkenburg <sfalken@apple.com>
+
+ Fix last DumpRenderTree change to correctly set preferences flag without crashing.
+
+ Reviewed by Mark Rowe.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+
+2009-06-21 Steve Falkenburg <sfalken@apple.com>
+
+ Set up global native controls flag before creating the first WebView.
+
+ Reviewed by Darin Adler.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (main):
+
+2009-06-21 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Set a sensible user agent string for the HTTP requests that Sparkle makes (checking for and downloading updates).
+
+ * WebKitLauncher/WebKitNightlyEnablerSparkle.m:
+ (userAgentStringForSparkle):
+ (initializeSparkle):
+
+2009-06-21 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add a hook to the WebKit launcher application to allow a link on the nightly build start page to
+ trigger an update via the built-in software update mechanism.
+
+ * WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj:
+ * WebKitLauncher/WebKitLauncherURLProtocol.h: Added.
+ * WebKitLauncher/WebKitLauncherURLProtocol.m: Added.
+ (+[WebKitLauncherURLProtocol load]):
+ (+[WebKitLauncherURLProtocol canInitWithRequest:]): Only allow use of the x-webkit-launcher scheme from .webkit.org subdomains.
+ (+[WebKitLauncherURLProtocol canonicalRequestForRequest:]):
+ (-[WebKitLauncherURLProtocol startLoading]):
+ (-[WebKitLauncherURLProtocol stopLoading]):
+ (-[WebKitLauncherURLProtocol handleIsWebKitLauncherAvailableJS]): Return a brief JavaScript snippet that can be used to programatically
+ determine whether the x-webkit-launcher is available and working.
+ (-[WebKitLauncherURLProtocol handleCheckForUpdates]): Trigger a software update on the main thread.
+ (-[WebKitLauncherURLProtocol resourceNotFound]): Fail with a generic "File does not exist" error.
+
+2009-06-20 Jan Michael Alonzo <jmalonzo@webkit.org>
+
+ Reviewed by Gustavo Noronha and Xan Lopez.
+
+ [Gtk] Implement DRT XSS auditor support
+ https://bugs.webkit.org/show_bug.cgi?id=26571
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setXSSAuditorEnabled):
+
+2009-06-19 Darin Adler <darin@apple.com>
+
+ * Scripts/do-webcore-rename: More renaming ideas.
+
+2009-06-15 Andre Pedralho <andre.pedralho@openbossa.org>
+
+ Reviewed by Tor Arne Vestbø.
+
+ Only pass --makeargs along if an argument is given.
+
+ * Scripts/build-webkit:
+
+2009-06-19 Adam Barth <abarth@webkit.org>
+
+ Unreviewed attempt to fix Windows build.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setXSSAuditorEnabled):
+
+2009-06-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Sam Weinig.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26199
+
+ Add support for testing the XSSAuditor.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (setXSSAuditorEnabledCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::setXSSAuditorEnabled):
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setXSSAuditorEnabled):
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (resetWebViewToConsistentStateBeforeTesting):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::setXSSAuditorEnabled):
+ (LayoutTestController::setPopupBlockingEnabled):
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::setXSSAuditorEnabled):
+
+2009-06-18 Darin Adler <darin@apple.com>
+
+ Rubber stamped by Mark Rowe.
+
+ * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+ (-[DumpRenderTreeWindow close]): Resolved crashes seen during regression
+ tests. The close method can be called on a window that's already closed
+ so we can't assert here.
+
+2009-06-17 Steve Falkenburg <sfalken@apple.com>
+
+ Updated for consolidated WebKit COM interfaces.
+
+ Reviewed by Adam Roben.
+
+ * DumpRenderTree/win/FrameLoadDelegate.cpp:
+ * DumpRenderTree/win/FrameLoadDelegate.h:
+ * DumpRenderTree/win/UIDelegate.cpp:
+ * DumpRenderTree/win/UIDelegate.h:
+ * WinLauncher/WinLauncher.h:
+
+2009-06-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26437
+
+ Make the commit-log-editor match the ambient line endings in commit
+ messages.
+
+ * Scripts/commit-log-editor:
+
+2009-06-16 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ Update GtkLauncher to recent API changes in the progress property,
+ which now goes from 0.0 to 1.0.
+
+ * GtkLauncher/main.c:
+
+2009-06-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=26000
+
+ Teach prepare-ChangeLog to match the line ends that are already present
+ in ChangeLog files. This helps folks whose use cygwin perl with CR LF
+ line endings on Windows.
+
+ Also, teach prepare-ChangeLog to normalize backslashes in paths. This
+ helps folks who use Windows SVN prepare correct ChangeLogs.
+
+ * Scripts/prepare-ChangeLog:
+
+== Rolled over to ChangeLog-2009-06-16 ==
diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.cpp b/WebKitTools/DumpRenderTree/AccessibilityController.cpp
index 045bc80..798389f 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityController.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityController.cpp
@@ -77,12 +77,26 @@ static JSValueRef logScrollingStartEventsCallback(JSContextRef ctx, JSObjectRef,
return JSValueMakeUndefined(ctx);
}
+static JSValueRef getElementAtPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int x = 0;
+ int y = 0;
+ if (argumentCount == 2) {
+ x = JSValueToNumber(context, arguments[0], exception);
+ y = JSValueToNumber(context, arguments[1], exception);
+ }
+
+ AccessibilityController* controller = static_cast<AccessibilityController*>(JSObjectGetPrivate(thisObject));
+ return AccessibilityUIElement::makeJSAccessibilityUIElement(context, controller->elementAtPoint(x, y));
+}
+
JSClassRef AccessibilityController::getJSClass()
{
static JSStaticFunction staticFunctions[] = {
{ "logFocusEvents", logFocusEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "logValueChangeEvents", logValueChangeEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "logScrollingStartEvents", logScrollingStartEventsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "elementAtPoint", getElementAtPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0 }
};
diff --git a/WebKitTools/DumpRenderTree/AccessibilityController.h b/WebKitTools/DumpRenderTree/AccessibilityController.h
index de58f84..5a6ca13 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityController.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityController.h
@@ -45,6 +45,7 @@ public:
// Controller Methods - platform-independent implementations
AccessibilityUIElement rootElement();
AccessibilityUIElement focusedElement();
+ AccessibilityUIElement elementAtPoint(int x, int y);
void setLogFocusEvents(bool);
void setLogValueChangeEvents(bool);
diff --git a/WebKitTools/DumpRenderTree/AccessibilityTextMarker.cpp b/WebKitTools/DumpRenderTree/AccessibilityTextMarker.cpp
new file mode 100644
index 0000000..d84ee80
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/AccessibilityTextMarker.cpp
@@ -0,0 +1,134 @@
+/*
+ * 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 "config.h"
+#include "AccessibilityTextMarker.h"
+
+#include "AccessibilityUIElement.h"
+#include <JavaScriptCore/JSRetainPtr.h>
+
+#pragma mark AccessibilityTextMarker
+
+// Callback methods
+
+AccessibilityTextMarker* toTextMarker(JSObjectRef object)
+{
+ return static_cast<AccessibilityTextMarker*>(JSObjectGetPrivate(object));
+}
+
+static JSValueRef isMarkerEqualCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount != 1)
+ return JSValueMakeBoolean(context, false);
+
+ JSObjectRef otherMarker = JSValueToObject(context, arguments[0], exception);
+ return JSValueMakeBoolean(context, toTextMarker(thisObject)->isEqual(toTextMarker(otherMarker)));
+}
+
+// Destruction
+
+static void markerFinalize(JSObjectRef thisObject)
+{
+ delete toTextMarker(thisObject);
+}
+
+// Object Creation
+
+JSObjectRef AccessibilityTextMarker::makeJSAccessibilityTextMarker(JSContextRef context, const AccessibilityTextMarker& element)
+{
+ return JSObjectMake(context, AccessibilityTextMarker::getJSClass(), new AccessibilityTextMarker(element));
+}
+
+JSClassRef AccessibilityTextMarker::getJSClass()
+{
+ static JSStaticValue staticValues[] = {
+ { 0, 0, 0, 0 }
+ };
+
+ static JSStaticFunction staticFunctions[] = {
+ { "isEqual", isMarkerEqualCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { 0, 0, 0 }
+ };
+
+ static JSClassDefinition classDefinition = {
+ 0, kJSClassAttributeNone, "AccessibilityTextMarker", 0, staticValues, staticFunctions,
+ 0, markerFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static JSClassRef accessibilityTextMarkerClass = JSClassCreate(&classDefinition);
+ return accessibilityTextMarkerClass;
+}
+
+#pragma mark AccessibilityTextMarkerRange
+
+// Callback methods
+
+AccessibilityTextMarkerRange* toTextMarkerRange(JSObjectRef object)
+{
+ return static_cast<AccessibilityTextMarkerRange*>(JSObjectGetPrivate(object));
+}
+
+static JSValueRef isMarkerRangeEqualCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount != 1)
+ return JSValueMakeBoolean(context, false);
+
+ JSObjectRef otherMarker = JSValueToObject(context, arguments[0], exception);
+ return JSValueMakeBoolean(context, toTextMarkerRange(thisObject)->isEqual(toTextMarkerRange(otherMarker)));
+}
+
+// Destruction
+
+static void markerRangeFinalize(JSObjectRef thisObject)
+{
+ delete toTextMarkerRange(thisObject);
+}
+
+// Object Creation
+
+JSObjectRef AccessibilityTextMarkerRange::makeJSAccessibilityTextMarkerRange(JSContextRef context, const AccessibilityTextMarkerRange& element)
+{
+ return JSObjectMake(context, AccessibilityTextMarkerRange::getJSClass(), new AccessibilityTextMarkerRange(element));
+}
+
+JSClassRef AccessibilityTextMarkerRange::getJSClass()
+{
+ static JSStaticValue staticValues[] = {
+ { 0, 0, 0, 0 }
+ };
+
+ static JSStaticFunction staticFunctions[] = {
+ { "isEqual", isMarkerRangeEqualCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { 0, 0, 0 }
+ };
+
+ static JSClassDefinition classDefinition = {
+ 0, kJSClassAttributeNone, "AccessibilityTextMarkerRange", 0, staticValues, staticFunctions,
+ 0, markerRangeFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+
+ static JSClassRef accessibilityTextMarkerRangeClass = JSClassCreate(&classDefinition);
+ return accessibilityTextMarkerRangeClass;
+}
diff --git a/WebKitTools/DumpRenderTree/AccessibilityTextMarker.h b/WebKitTools/DumpRenderTree/AccessibilityTextMarker.h
new file mode 100644
index 0000000..aeb078d
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/AccessibilityTextMarker.h
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+#ifndef AccessibilityTextMarker_h
+#define AccessibilityTextMarker_h
+
+#include <JavaScriptCore/JSObjectRef.h>
+
+#if PLATFORM(MAC)
+#define SUPPORTS_AX_TEXTMARKERS 1
+#else
+#define SUPPORTS_AX_TEXTMARKERS 0
+#endif
+
+#if PLATFORM(MAC)
+#include <wtf/RetainPtr.h>
+typedef CFTypeRef PlatformTextMarker;
+typedef CFTypeRef PlatformTextMarkerRange;
+#else
+typedef void* PlatformTextMarker;
+typedef void* PlatformTextMarkerRange;
+#endif
+
+class AccessibilityUIElement;
+
+class AccessibilityTextMarker {
+public:
+ AccessibilityTextMarker(PlatformTextMarker);
+ AccessibilityTextMarker(const AccessibilityTextMarker&);
+ ~AccessibilityTextMarker();
+
+ PlatformTextMarker platformTextMarker() const;
+
+ static JSObjectRef makeJSAccessibilityTextMarker(JSContextRef, const AccessibilityTextMarker&);
+ bool isEqual(AccessibilityTextMarker*);
+
+private:
+ static JSClassRef getJSClass();
+#if PLATFORM(MAC)
+ RetainPtr<PlatformTextMarker> m_textMarker;
+#else
+ PlatformTextMarker m_textMarker;
+#endif
+};
+
+class AccessibilityTextMarkerRange {
+public:
+ AccessibilityTextMarkerRange(PlatformTextMarkerRange);
+ AccessibilityTextMarkerRange(const AccessibilityTextMarkerRange&);
+ ~AccessibilityTextMarkerRange();
+
+ PlatformTextMarkerRange platformTextMarkerRange() const;
+
+ static JSObjectRef makeJSAccessibilityTextMarkerRange(JSContextRef, const AccessibilityTextMarkerRange&);
+ bool isEqual(AccessibilityTextMarkerRange*);
+
+private:
+ static JSClassRef getJSClass();
+#if PLATFORM(MAC)
+ RetainPtr<PlatformTextMarkerRange> m_textMarkerRange;
+#else
+ PlatformTextMarkerRange m_textMarkerRange;
+#endif
+};
+
+AccessibilityTextMarker* toTextMarker(JSObjectRef object);
+AccessibilityTextMarkerRange* toTextMarkerRange(JSObjectRef object);
+
+#if !SUPPORTS_AX_TEXTMARKERS
+inline AccessibilityTextMarker::AccessibilityTextMarker(PlatformTextMarker) { }
+inline AccessibilityTextMarker::AccessibilityTextMarker(const AccessibilityTextMarker&) { }
+inline AccessibilityTextMarker::~AccessibilityTextMarker() { }
+inline bool AccessibilityTextMarker::isEqual(AccessibilityTextMarker*) { return false; }
+inline PlatformTextMarker AccessibilityTextMarker::platformTextMarker() const { return m_textMarker; }
+
+inline AccessibilityTextMarkerRange::AccessibilityTextMarkerRange(PlatformTextMarkerRange) { }
+inline AccessibilityTextMarkerRange::AccessibilityTextMarkerRange(const AccessibilityTextMarkerRange&) { }
+inline AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange() { }
+inline bool AccessibilityTextMarkerRange::isEqual(AccessibilityTextMarkerRange*) { return false; }
+inline PlatformTextMarkerRange AccessibilityTextMarkerRange::platformTextMarkerRange() const { return m_textMarkerRange; }
+#endif
+
+#endif // AccessibilityUIElement_h
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
index 87fe05c..4d0bfa8 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp
@@ -128,6 +128,16 @@ static JSValueRef lineForIndexCallback(JSContextRef context, JSObjectRef functio
return JSValueMakeNumber(context, toAXElement(thisObject)->lineForIndex(indexNumber));
}
+static JSValueRef rangeForLineCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int indexNumber = -1;
+ if (argumentCount == 1)
+ indexNumber = JSValueToNumber(context, arguments[0], exception);
+
+ JSRetainPtr<JSStringRef> rangeLine(Adopt, toAXElement(thisObject)->rangeForLine(indexNumber));
+ return JSValueMakeString(context, rangeLine.get());
+}
+
static JSValueRef boundsForRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
unsigned location = UINT_MAX, length = 0;
@@ -152,6 +162,29 @@ static JSValueRef stringForRangeCallback(JSContextRef context, JSObjectRef funct
return JSValueMakeString(context, stringDescription.get());
}
+static JSValueRef attributedStringForRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ unsigned location = UINT_MAX, length = 0;
+ if (argumentCount == 2) {
+ location = JSValueToNumber(context, arguments[0], exception);
+ length = JSValueToNumber(context, arguments[1], exception);
+ }
+
+ JSRetainPtr<JSStringRef> stringDescription(Adopt, toAXElement(thisObject)->attributedStringForRange(location, length));
+ return JSValueMakeString(context, stringDescription.get());
+}
+
+static JSValueRef attributedStringRangeIsMisspelledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ unsigned location = UINT_MAX, length = 0;
+ if (argumentCount == 2) {
+ location = JSValueToNumber(context, arguments[0], exception);
+ length = JSValueToNumber(context, arguments[1], exception);
+ }
+
+ return JSValueMakeBoolean(context, toAXElement(thisObject)->attributedStringRangeIsMisspelled(location, length));
+}
+
static JSValueRef indexOfChildCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
if (argumentCount != 1)
@@ -171,6 +204,24 @@ static JSValueRef childAtIndexCallback(JSContextRef context, JSObjectRef functio
return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->getChildAtIndex(indexNumber));
}
+static JSValueRef selectedChildAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int indexNumber = -1;
+ if (argumentCount == 1)
+ indexNumber = JSValueToNumber(context, arguments[0], exception);
+
+ return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->selectedChildAtIndex(indexNumber));
+}
+
+static JSValueRef linkedUIElementAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int indexNumber = -1;
+ if (argumentCount == 1)
+ indexNumber = JSValueToNumber(context, arguments[0], exception);
+
+ return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->linkedUIElementAtIndex(indexNumber));
+}
+
static JSValueRef disclosedRowAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
int indexNumber = 0;
@@ -218,6 +269,17 @@ static JSValueRef isEqualCallback(JSContextRef context, JSObjectRef function, JS
return JSValueMakeBoolean(context, toAXElement(thisObject)->isEqual(toAXElement(otherElement)));
}
+static JSValueRef setSelectedChildCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ JSObjectRef element = 0;
+ if (argumentCount == 1)
+ element = JSValueToObject(context, arguments[0], exception);
+
+ toAXElement(thisObject)->setSelectedChild(toAXElement(element));
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef elementAtPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
int x = 0;
@@ -344,6 +406,12 @@ static JSValueRef showMenuCallback(JSContextRef context, JSObjectRef function, J
return JSValueMakeUndefined(context);
}
+static JSValueRef pressCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ toAXElement(thisObject)->press();
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef takeFocusCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
toAXElement(thisObject)->takeFocus();
@@ -368,6 +436,74 @@ static JSValueRef removeSelectionCallback(JSContextRef context, JSObjectRef func
return JSValueMakeUndefined(context);
}
+static JSValueRef textMarkerRangeForElementCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ AccessibilityUIElement* uiElement = 0;
+ if (argumentCount == 1)
+ uiElement = toAXElement(JSValueToObject(context, arguments[0], exception));
+
+ return AccessibilityTextMarkerRange::makeJSAccessibilityTextMarkerRange(context, toAXElement(thisObject)->textMarkerRangeForElement(uiElement));
+}
+
+static JSValueRef textMarkerRangeLengthCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ AccessibilityTextMarkerRange* range = 0;
+ if (argumentCount == 1)
+ range = toTextMarkerRange(JSValueToObject(context, arguments[0], exception));
+
+ return JSValueMakeNumber(context, (int)toAXElement(thisObject)->textMarkerRangeLength(range));
+}
+
+static JSValueRef textMarkerForPointCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int x = 0;
+ int y = 0;
+ if (argumentCount == 2) {
+ x = JSValueToNumber(context, arguments[0], exception);
+ y = JSValueToNumber(context, arguments[1], exception);
+ }
+
+ return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->textMarkerForPoint(x, y));
+}
+
+static JSValueRef textMarkerRangeForMarkersCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ AccessibilityTextMarker* startMarker = 0;
+ AccessibilityTextMarker* endMarker = 0;
+ if (argumentCount == 2) {
+ startMarker = toTextMarker(JSValueToObject(context, arguments[0], exception));
+ endMarker = toTextMarker(JSValueToObject(context, arguments[1], exception));
+ }
+
+ return AccessibilityTextMarkerRange::makeJSAccessibilityTextMarkerRange(context, toAXElement(thisObject)->textMarkerRangeForMarkers(startMarker, endMarker));
+}
+
+static JSValueRef startTextMarkerForTextMarkerRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ AccessibilityTextMarkerRange* markerRange = 0;
+ if (argumentCount == 1)
+ markerRange = toTextMarkerRange(JSValueToObject(context, arguments[0], exception));
+
+ return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->startTextMarkerForTextMarkerRange(markerRange));
+}
+
+static JSValueRef endTextMarkerForTextMarkerRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ AccessibilityTextMarkerRange* markerRange = 0;
+ if (argumentCount == 1)
+ markerRange = toTextMarkerRange(JSValueToObject(context, arguments[0], exception));
+
+ return AccessibilityTextMarker::makeJSAccessibilityTextMarker(context, toAXElement(thisObject)->endTextMarkerForTextMarkerRange(markerRange));
+}
+
+static JSValueRef accessibilityElementForTextMarkerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ AccessibilityTextMarker* marker = 0;
+ if (argumentCount == 1)
+ marker = toTextMarker(JSValueToObject(context, arguments[0], exception));
+
+ return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->accessibilityElementForTextMarker(marker));
+}
// Static Value Getters
@@ -435,6 +571,12 @@ static JSValueRef getLanguageCallback(JSContextRef context, JSObjectRef thisObje
return JSValueMakeString(context, language.get());
}
+static JSValueRef getHelpTextCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+ JSRetainPtr<JSStringRef> language(Adopt, toAXElement(thisObject)->helpText());
+ return JSValueMakeString(context, language.get());
+}
+
static JSValueRef getOrientationCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
JSRetainPtr<JSStringRef> orientation(Adopt, toAXElement(thisObject)->orientation());
@@ -446,6 +588,16 @@ static JSValueRef getChildrenCountCallback(JSContextRef context, JSObjectRef thi
return JSValueMakeNumber(context, toAXElement(thisObject)->childrenCount());
}
+static JSValueRef rowCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+ return JSValueMakeNumber(context, toAXElement(thisObject)->rowCount());
+}
+
+static JSValueRef columnCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+ return JSValueMakeNumber(context, toAXElement(thisObject)->columnCount());
+}
+
static JSValueRef getXCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
{
return JSValueMakeNumber(context, toAXElement(thisObject)->x());
@@ -552,6 +704,22 @@ static JSValueRef getIsCollapsedCallback(JSContextRef context, JSObjectRef thisO
return JSValueMakeBoolean(context, toAXElement(thisObject)->isCollapsed());
}
+static JSValueRef isIgnoredCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
+{
+ return JSValueMakeBoolean(context, toAXElement(thisObject)->isIgnored());
+}
+
+static JSValueRef speakCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
+{
+ JSRetainPtr<JSStringRef> speakString(Adopt, toAXElement(thisObject)->speak());
+ return JSValueMakeString(context, speakString.get());
+}
+
+static JSValueRef selectedChildrenCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+ return JSValueMakeNumber(context, toAXElement(thisObject)->selectedChildrenCount());
+}
+
static JSValueRef getHasPopupCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
{
return JSValueMakeBoolean(context, toAXElement(thisObject)->hasPopup());
@@ -602,6 +770,69 @@ static JSValueRef addNotificationListenerCallback(JSContextRef context, JSObject
return JSValueMakeBoolean(context, succeeded);
}
+static JSValueRef removeNotificationListenerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ toAXElement(thisObject)->removeNotificationListener();
+ return JSValueMakeUndefined(context);
+}
+
+// Implementation
+
+// Unsupported methods on various platforms.
+#if !PLATFORM(MAC)
+JSStringRef AccessibilityUIElement::speak() { return 0; }
+JSStringRef AccessibilityUIElement::rangeForLine(int line) { return 0; }
+void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement*) const { }
+unsigned AccessibilityUIElement::selectedChildrenCount() const { return 0; }
+AccessibilityUIElement AccessibilityUIElement::selectedChildAtIndex(unsigned) const { return 0; }
+#endif
+
+#if !PLATFORM(WIN)
+bool AccessibilityUIElement::isEqual(AccessibilityUIElement* otherElement)
+{
+ return platformUIElement() == otherElement->platformUIElement();
+}
+#endif
+
+#if !SUPPORTS_AX_TEXTMARKERS
+
+AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement*)
+{
+ return 0;
+}
+
+int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange*)
+{
+ return 0;
+}
+
+AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker*, AccessibilityTextMarker*)
+{
+ return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*)
+{
+ return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*)
+{
+ return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker*)
+{
+ return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
+{
+ return 0;
+}
+
+#endif
+
// Destruction
static void finalize(JSObjectRef thisObject)
@@ -626,6 +857,7 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "title", getTitleCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "description", getDescriptionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "language", getLanguageCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "helpText", getHelpTextCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "stringValue", getStringValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "x", getXCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "y", getYCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -637,6 +869,8 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "minValue", getMinValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "maxValue", getMaxValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "childrenCount", getChildrenCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "rowCount", rowCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "columnCount", columnCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "insertionPointLineNumber", getInsertionPointLineNumberCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "selectedTextRange", getSelectedTextRangeCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isEnabled", getIsEnabledCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -659,6 +893,9 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "orientation", getOrientationCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "ariaIsGrabbed", getARIAIsGrabbedCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "ariaDropEffects", getARIADropEffectsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "isIgnored", isIgnoredCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "speak", speakCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "selectedChildrenCount", selectedChildrenCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0, 0 }
};
@@ -669,9 +906,13 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "attributesOfChildren", attributesOfChildrenCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "parameterizedAttributeNames", parameterizedAttributeNamesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "lineForIndex", lineForIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "rangeForLine", rangeForLineCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "boundsForRange", boundsForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "stringForRange", stringForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "attributedStringForRange", attributedStringForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "attributedStringRangeIsMisspelled", attributedStringRangeIsMisspelledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "childAtIndex", childAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "linkedUIElementAtIndex", linkedUIElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "indexOfChild", indexOfChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "elementAtPoint", elementAtPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "attributesOfColumnHeaders", attributesOfColumnHeadersCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -696,16 +937,27 @@ JSClassRef AccessibilityUIElement::getJSClass()
{ "increment", incrementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "decrement", decrementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "showMenu", showMenuCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "press", pressCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "disclosedRowAtIndex", disclosedRowAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "ariaOwnsElementAtIndex", ariaOwnsElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "ariaFlowToElementAtIndex", ariaFlowToElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "selectedRowAtIndex", selectedRowAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isEqual", isEqualCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "addNotificationListener", addNotificationListenerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "removeNotificationListener", removeNotificationListenerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "takeFocus", takeFocusCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "takeSelection", takeSelectionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "addSelection", addSelectionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "removeSelection", removeSelectionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "textMarkerRangeForElement", textMarkerRangeForElementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "textMarkerRangeForMarkers", textMarkerRangeForMarkersCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "startTextMarkerForTextMarkerRange", startTextMarkerForTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "endTextMarkerForTextMarkerRange", endTextMarkerForTextMarkerRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "accessibilityElementForTextMarker", accessibilityElementForTextMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "textMarkerRangeLength", textMarkerRangeLengthCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "textMarkerForPoint", textMarkerForPointCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setSelectedChild", setSelectedChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "selectedChildAtIndex", selectedChildAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0 }
};
diff --git a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
index e7d3bc7..3eb396d 100644
--- a/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
+++ b/WebKitTools/DumpRenderTree/AccessibilityUIElement.h
@@ -26,6 +26,7 @@
#ifndef AccessibilityUIElement_h
#define AccessibilityUIElement_h
+#include "AccessibilityTextMarker.h"
#include <JavaScriptCore/JSObjectRef.h>
#include <wtf/Platform.h>
#include <wtf/Vector.h>
@@ -40,8 +41,8 @@ typedef struct objc_object* PlatformUIElement;
#undef _WINSOCKAPI_
#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
-#include <oleacc.h>
#include <WebCore/COMPtr.h>
+#include <oleacc.h>
typedef COMPtr<IAccessible> PlatformUIElement;
#elif PLATFORM(GTK)
@@ -51,6 +52,14 @@ typedef AtkObject* PlatformUIElement;
typedef void* PlatformUIElement;
#endif
+#if PLATFORM(MAC)
+#ifdef __OBJC__
+typedef id NotificationHandler;
+#else
+typedef struct objc_object* NotificationHandler;
+#endif
+#endif
+
class AccessibilityUIElement {
public:
AccessibilityUIElement(PlatformUIElement);
@@ -61,8 +70,8 @@ public:
static JSObjectRef makeJSAccessibilityUIElement(JSContextRef, const AccessibilityUIElement&);
- bool isEqual(AccessibilityUIElement* otherElement) { return platformUIElement() == otherElement->platformUIElement(); }
-
+ bool isEqual(AccessibilityUIElement* otherElement);
+
void getLinkedUIElements(Vector<AccessibilityUIElement>&);
void getDocumentLinks(Vector<AccessibilityUIElement>&);
void getChildren(Vector<AccessibilityUIElement>&);
@@ -83,12 +92,15 @@ public:
// Methods - platform-independent implementations
JSStringRef allAttributes();
JSStringRef attributesOfLinkedUIElements();
+ AccessibilityUIElement linkedUIElementAtIndex(unsigned);
+
JSStringRef attributesOfDocumentLinks();
JSStringRef attributesOfChildren();
JSStringRef parameterizedAttributeNames();
void increment();
void decrement();
void showMenu();
+ void press();
// Attributes - platform-independent implementations
JSStringRef stringAttributeValue(JSStringRef attribute);
@@ -104,6 +116,7 @@ public:
JSStringRef language();
JSStringRef stringValue();
JSStringRef accessibilityValue() const;
+ JSStringRef helpText() const;
JSStringRef orientation() const;
double x();
double y();
@@ -117,14 +130,20 @@ public:
JSStringRef selectedTextRange();
bool isEnabled();
bool isRequired() const;
+
bool isSelected() const;
bool isSelectable() const;
bool isMultiSelectable() const;
+ void setSelectedChild(AccessibilityUIElement*) const;
+ unsigned selectedChildrenCount() const;
+ AccessibilityUIElement selectedChildAtIndex(unsigned) const;
+
bool isExpanded() const;
bool isChecked() const;
bool isVisible() const;
bool isOffScreen() const;
bool isCollapsed() const;
+ bool isIgnored() const;
bool hasPopup() const;
int hierarchicalLevel() const;
double clickPointX();
@@ -133,6 +152,9 @@ public:
JSStringRef documentURI();
JSStringRef url();
+ // CSS3-speech properties.
+ JSStringRef speak();
+
// Table-specific attributes
JSStringRef attributesOfColumnHeaders();
JSStringRef attributesOfRowHeaders();
@@ -143,6 +165,8 @@ public:
int indexInTable();
JSStringRef rowIndexRange();
JSStringRef columnIndexRange();
+ int rowCount();
+ int columnCount();
// Tree/Outline specific attributes
AccessibilityUIElement selectedRowAtIndex(unsigned);
@@ -160,22 +184,39 @@ public:
// Parameterized attributes
int lineForIndex(int);
+ JSStringRef rangeForLine(int);
JSStringRef boundsForRange(unsigned location, unsigned length);
void setSelectedTextRange(unsigned location, unsigned length);
JSStringRef stringForRange(unsigned location, unsigned length);
+ JSStringRef attributedStringForRange(unsigned location, unsigned length);
+ bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
// Table-specific
AccessibilityUIElement cellForColumnAndRow(unsigned column, unsigned row);
+ // Text markers.
+ AccessibilityTextMarkerRange textMarkerRangeForElement(AccessibilityUIElement*);
+ AccessibilityTextMarkerRange textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
+ AccessibilityTextMarker startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
+ AccessibilityTextMarker endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
+ AccessibilityTextMarker textMarkerForPoint(int x, int y);
+ AccessibilityUIElement accessibilityElementForTextMarker(AccessibilityTextMarker*);
+ int textMarkerRangeLength(AccessibilityTextMarkerRange*);
+
// Notifications
// Function callback should take one argument, the name of the notification.
bool addNotificationListener(JSObjectRef functionCallback);
+ // Make sure you call remove, because you can't rely on objects being deallocated in a timely fashion.
+ void removeNotificationListener();
private:
static JSClassRef getJSClass();
-
PlatformUIElement m_element;
- JSObjectRef m_notificationFunctionCallback;
+
+ // A retained, platform specific object used to help manage notifications for this object.
+#if PLATFORM(MAC)
+ NotificationHandler m_notificationHandler;
+#endif
};
#endif // AccessibilityUIElement_h
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.gypi b/WebKitTools/DumpRenderTree/DumpRenderTree.gypi
new file mode 100644
index 0000000..b437eaf
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.gypi
@@ -0,0 +1,72 @@
+{
+ 'variables': {
+ 'drt_files': [
+ 'chromium/AccessibilityController.cpp',
+ 'chromium/AccessibilityController.h',
+ 'chromium/AccessibilityUIElement.cpp',
+ 'chromium/AccessibilityUIElement.h',
+ 'chromium/CppBoundClass.cpp',
+ 'chromium/CppBoundClass.h',
+ 'chromium/CppVariant.cpp',
+ 'chromium/CppVariant.h',
+ 'chromium/DRTDevToolsAgent.cpp',
+ 'chromium/DRTDevToolsAgent.h',
+ 'chromium/DRTDevToolsCallArgs.cpp',
+ 'chromium/DRTDevToolsCallArgs.h',
+ 'chromium/DRTDevToolsClient.cpp',
+ 'chromium/DRTDevToolsClient.h',
+ 'chromium/DumpRenderTree.cpp',
+ 'chromium/EventSender.cpp',
+ 'chromium/EventSender.h',
+ 'chromium/LayoutTestController.cpp',
+ 'chromium/LayoutTestController.h',
+ 'chromium/MockSpellCheck.cpp',
+ 'chromium/MockSpellCheck.h',
+ 'chromium/NotificationPresenter.h',
+ 'chromium/NotificationPresenter.cpp',
+ 'chromium/PlainTextController.cpp',
+ 'chromium/PlainTextController.h',
+ 'chromium/Task.h',
+ 'chromium/Task.cpp',
+ 'chromium/TestEventPrinter.h',
+ 'chromium/TestEventPrinter.cpp',
+ 'chromium/TestNavigationController.cpp',
+ 'chromium/TestNavigationController.h',
+ 'chromium/TestShell.cpp',
+ 'chromium/TestShell.h',
+ 'chromium/TestShellGtk.cpp',
+ 'chromium/TestShellMac.mm',
+ 'chromium/TestShellWin.cpp',
+ 'chromium/TextInputController.cpp',
+ 'chromium/TextInputController.h',
+ 'chromium/WebPreferences.cpp',
+ 'chromium/WebPreferences.h',
+ 'chromium/WebViewHost.cpp',
+ 'chromium/WebViewHost.h',
+ ],
+ 'test_plugin_files': [
+ 'TestNetscapePlugIn/PluginObject.cpp',
+ 'TestNetscapePlugIn/PluginObject.h',
+ 'TestNetscapePlugIn/PluginObjectMac.mm',
+ 'TestNetscapePlugIn/PluginTest.cpp',
+ 'TestNetscapePlugIn/PluginTest.h',
+ 'TestNetscapePlugIn/TestObject.cpp',
+ 'TestNetscapePlugIn/TestObject.h',
+ 'TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp',
+ 'TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp',
+ 'TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp',
+ 'TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp',
+ 'TestNetscapePlugIn/main.cpp',
+ ],
+ 'conditions': [
+ ['OS=="win"', {
+ 'drt_files': [
+ 'chromium/WebThemeControlDRT.cpp',
+ 'chromium/WebThemeControlDRT.h',
+ 'chromium/WebThemeEngineDRT.cpp',
+ 'chromium/WebThemeEngineDRT.h',
+ ],
+ }],
+ ],
+ }
+}
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/DumpRenderTree.sln b/WebKitTools/DumpRenderTree/DumpRenderTree.sln
index 399c002..196f872 100644
--- a/WebKitTools/DumpRenderTree/DumpRenderTree.sln
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.sln
@@ -2,12 +2,21 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DumpRenderTree", "win\DumpRenderTree.vcproj", "{6567DFD4-D6DE-4CD5-825D-17E353D160E1}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C} = {C0737398-3565-439E-A2B8-AB2BE4D5430C}
+ EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestNetscapePlugin", "win\TestNetscapePlugin\TestNetscapePlugin.vcproj", "{C0737398-3565-439E-A2B8-AB2BE4D5430C}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestNetscapePlugin", "TestNetscapePlugin\win\TestNetscapePlugin.vcproj", "{C0737398-3565-439E-A2B8-AB2BE4D5430C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59CC0547-70AC-499C-9B19-EC01C6F61137} = {59CC0547-70AC-499C-9B19-EC01C6F61137}
+ EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FindSafari", "..\FindSafari\FindSafari.vcproj", "{DA31DA52-6675-48D4-89E0-333A7144397C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageDiff", "win\ImageDiff.vcproj", "{59CC0547-70AC-499C-9B19-EC01C6F61137}"
+ ProjectSection(ProjectDependencies) = postProject
+ {DA31DA52-6675-48D4-89E0-333A7144397C} = {DA31DA52-6675-48D4-89E0-333A7144397C}
+ EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
index 06f0599..b2eb8e9 100644
--- a/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
@@ -24,17 +24,33 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 0F37A4A711E6628700275F54 /* PluginObjectMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F37A4A611E6628700275F54 /* PluginObjectMac.mm */; };
+ 0F37A4AA11E6629100275F54 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A752A108AF5D1F00138E45 /* QuartzCore.framework */; };
141BF435096A455900E0753C /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9335435F03D75502008635CE /* WebKit.framework */; };
141BF436096A455900E0753C /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A84F608908B136DA00E9745F /* Cocoa.framework */; };
141BF438096A455900E0753C /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A817090308B164D300CCB9FB /* JavaScriptCore.framework */; };
141BF439096A455900E0753C /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; };
141BF453096A45EB00E0753C /* PluginObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 141BF447096A45C800E0753C /* PluginObject.h */; };
14770FE20A22ADF7009342EE /* GCController.h in Headers */ = {isa = PBXBuildFile; fileRef = 14770FE00A22ADF7009342EE /* GCController.h */; };
+ 1A215A8111F2609C008AD0F5 /* PluginTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A215A7F11F2609C008AD0F5 /* PluginTest.cpp */; };
+ 1A215A8211F2609C008AD0F5 /* PluginTest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A215A8011F2609C008AD0F5 /* PluginTest.h */; };
+ 1A215BE711F27658008AD0F5 /* DocumentOpenInDestroyStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */; };
+ 1A24BAA9120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */; };
1A8F02E80BB9B4EC008CFA34 /* TestObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8F024C0BB9B056008CFA34 /* TestObject.h */; };
1AC6C8490D07638600CD3161 /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C77F0D07589B00CD3161 /* main.cpp */; };
1AC6C84A0D07638600CD3161 /* PluginObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7800D07589B00CD3161 /* PluginObject.cpp */; };
1AC6C84B0D07638600CD3161 /* TestObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC6C7810D07589B00CD3161 /* TestObject.cpp */; };
+ 1AC77DCF120605B6005C19EF /* NPRuntimeRemoveProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */; };
+ 1AD9D2FE12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */; };
23BCB8900EA57623003C6289 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 23BCB88F0EA57623003C6289 /* OpenGL.framework */; };
+ 29CFBA10122736E600BC30C0 /* AccessibilityTextMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = 29CFBA0E122736E600BC30C0 /* AccessibilityTextMarker.h */; };
+ 29CFBA11122736E600BC30C0 /* AccessibilityTextMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29CFBA0F122736E600BC30C0 /* AccessibilityTextMarker.cpp */; };
+ 29CFBA2E12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29CFBA2D12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm */; };
+ 3713EDE2115BE19300705720 /* ColorBits-A.png in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 3713EDDF115BE16F00705720 /* ColorBits-A.png */; };
+ 3713EDE3115BE19300705720 /* ColorBits.ttf in Copy Font Files */ = {isa = PBXBuildFile; fileRef = 3713EDE0115BE16F00705720 /* ColorBits.ttf */; };
+ 440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */; };
+ 4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */; };
+ 4437730F125CBC4D00AAE02C /* WebArchiveDumpSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */; };
5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5185F69F10714A57007AA393 /* HistoryDelegate.mm */; };
5185F6B310714E12007AA393 /* HistoryDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185F69E10714A57007AA393 /* HistoryDelegate.h */; };
5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */ = {isa = PBXBuildFile; fileRef = AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */; };
@@ -115,6 +131,11 @@
BCD08B3A0E1057EF00A7D0C1 /* AccessibilityController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */; };
BCD08B710E1059D200A7D0C1 /* AccessibilityControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */; };
BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF6C64F0C98E9C000AC063E /* GCController.cpp */; };
+ C06F9ABC1267A7060058E1F6 /* PassDifferentNPPStruct.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */; };
+ C0E720751281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0E720741281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp */; };
+ C0EC3C9C12787F0500939164 /* NullNPPGetValuePointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0EC3C9B12787F0500939164 /* NullNPPGetValuePointer.cpp */; };
+ E1B7816511AF31B7007E1BC2 /* MockGeolocationProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */; };
+ E1B7816711AF31C3007E1BC2 /* MockGeolocationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -156,6 +177,8 @@
dstSubfolderSpec = 7;
files = (
5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */,
+ 3713EDE2115BE19300705720 /* ColorBits-A.png in Copy Font Files */,
+ 3713EDE3115BE19300705720 /* ColorBits.ttf in Copy Font Files */,
5DB9AC980F722C3600684641 /* WebKitWeightWatcher100.ttf in Copy Font Files */,
5DB9AC990F722C3600684641 /* WebKitWeightWatcher200.ttf in Copy Font Files */,
5DB9AC9A0F722C3600684641 /* WebKitWeightWatcher300.ttf in Copy Font Files */,
@@ -172,16 +195,28 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 0F37A4A611E6628700275F54 /* PluginObjectMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginObjectMac.mm; sourceTree = "<group>"; };
141BF233096A44CF00E0753C /* TestNetscapePlugIn.plugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TestNetscapePlugIn.plugin; sourceTree = BUILT_PRODUCTS_DIR; };
141BF447096A45C800E0753C /* PluginObject.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginObject.h; sourceTree = "<group>"; };
- 141BF448096A45C800E0753C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ 141BF448096A45C800E0753C /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; name = Info.plist; path = mac/Info.plist; sourceTree = "<group>"; };
14770FE00A22ADF7009342EE /* GCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCController.h; sourceTree = "<group>"; };
+ 1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentOpenInDestroyStream.cpp; sourceTree = "<group>"; };
+ 1A215A7F11F2609C008AD0F5 /* PluginTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginTest.cpp; sourceTree = "<group>"; };
+ 1A215A8011F2609C008AD0F5 /* PluginTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginTest.h; sourceTree = "<group>"; };
+ 1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeObjectFromDestroyedPlugin.cpp; sourceTree = "<group>"; };
1A8F024C0BB9B056008CFA34 /* TestObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestObject.h; sourceTree = "<group>"; };
1AC6C77F0D07589B00CD3161 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
1AC6C7800D07589B00CD3161 /* PluginObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginObject.cpp; sourceTree = "<group>"; };
1AC6C7810D07589B00CD3161 /* TestObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestObject.cpp; sourceTree = "<group>"; };
+ 1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeRemoveProperty.cpp; sourceTree = "<group>"; };
+ 1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableNPObjectInvokeDefault.cpp; sourceTree = "<group>"; };
23BCB88F0EA57623003C6289 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
+ 29CFBA0E122736E600BC30C0 /* AccessibilityTextMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTextMarker.h; sourceTree = "<group>"; };
+ 29CFBA0F122736E600BC30C0 /* AccessibilityTextMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTextMarker.cpp; sourceTree = "<group>"; };
+ 29CFBA2D12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityTextMarkerMac.mm; path = mac/AccessibilityTextMarkerMac.mm; sourceTree = "<group>"; };
32A70AAB03705E1F00C91783 /* DumpRenderTreePrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreePrefix.h; sourceTree = "<group>"; };
+ 3713EDDF115BE16F00705720 /* ColorBits-A.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "ColorBits-A.png"; path = "fonts/ColorBits-A.png"; sourceTree = "<group>"; };
+ 3713EDE0115BE16F00705720 /* ColorBits.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ColorBits.ttf; path = fonts/ColorBits.ttf; sourceTree = "<group>"; };
375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher100.ttf; path = fonts/WebKitWeightWatcher100.ttf; sourceTree = "<group>"; };
375F09720DAC3CB600C8B4E5 /* WebKitWeightWatcher200.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher200.ttf; path = fonts/WebKitWeightWatcher200.ttf; sourceTree = "<group>"; };
375F09730DAC3CB600C8B4E5 /* WebKitWeightWatcher300.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher300.ttf; path = fonts/WebKitWeightWatcher300.ttf; sourceTree = "<group>"; };
@@ -191,9 +226,12 @@
375F09770DAC3CB600C8B4E5 /* WebKitWeightWatcher700.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher700.ttf; path = fonts/WebKitWeightWatcher700.ttf; sourceTree = "<group>"; };
375F09780DAC3CB600C8B4E5 /* WebKitWeightWatcher800.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher800.ttf; path = fonts/WebKitWeightWatcher800.ttf; sourceTree = "<group>"; };
375F09790DAC3CB600C8B4E5 /* WebKitWeightWatcher900.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher900.ttf; path = fonts/WebKitWeightWatcher900.ttf; sourceTree = "<group>"; };
+ 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WebArchiveDumpSupportMac.mm; path = mac/WebArchiveDumpSupportMac.mm; sourceTree = "<group>"; };
+ 44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebArchiveDumpSupport.h; path = cf/WebArchiveDumpSupport.h; sourceTree = "<group>"; };
+ 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebArchiveDumpSupport.cpp; path = cf/WebArchiveDumpSupport.cpp; sourceTree = "<group>"; };
5185F69E10714A57007AA393 /* HistoryDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HistoryDelegate.h; path = mac/HistoryDelegate.h; sourceTree = "<group>"; };
5185F69F10714A57007AA393 /* HistoryDelegate.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = HistoryDelegate.mm; path = mac/HistoryDelegate.mm; sourceTree = "<group>"; };
- 8465E2C60FFA8DF2003B8342 /* PixelDumpSupport.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = PixelDumpSupport.cpp; sourceTree = "<group>"; };
+ 8465E2C60FFA8DF2003B8342 /* PixelDumpSupport.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PixelDumpSupport.cpp; sourceTree = "<group>"; };
9335435F03D75502008635CE /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
933BF5A90F93FA5C000F0441 /* PlainTextController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlainTextController.h; path = mac/PlainTextController.h; sourceTree = "<group>"; };
933BF5AA0F93FA5C000F0441 /* PlainTextController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlainTextController.mm; path = mac/PlainTextController.mm; sourceTree = "<group>"; };
@@ -213,14 +251,14 @@
AE8257EF08D22389000507AB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
B5A7526708AF4A4A00138E45 /* ImageDiff */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ImageDiff; sourceTree = BUILT_PRODUCTS_DIR; };
B5A752A108AF5D1F00138E45 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
- BC0131D80C9772010087317D /* LayoutTestController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = LayoutTestController.cpp; sourceTree = "<group>"; };
+ BC0131D80C9772010087317D /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; sourceTree = "<group>"; };
BC0131D90C9772010087317D /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; };
BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityUIElement.h; sourceTree = "<group>"; };
BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityUIElement.cpp; sourceTree = "<group>"; };
BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityUIElementMac.mm; path = mac/AccessibilityUIElementMac.mm; sourceTree = "<group>"; };
BC4741290D038A4C0072B006 /* JavaScriptThreading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavaScriptThreading.h; sourceTree = "<group>"; };
BC4741400D038A570072B006 /* JavaScriptThreadingPthreads.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaScriptThreadingPthreads.cpp; path = pthreads/JavaScriptThreadingPthreads.cpp; sourceTree = "<group>"; };
- BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = WorkQueue.cpp; sourceTree = "<group>"; };
+ BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = WorkQueue.cpp; sourceTree = "<group>"; };
BC9D90220C97472E0099A4A3 /* WorkQueue.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueue.h; sourceTree = "<group>"; };
BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WorkQueueItem.h; sourceTree = "<group>"; };
BCA18B210C9B014B00114369 /* GCControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = GCControllerMac.mm; path = mac/GCControllerMac.mm; sourceTree = "<group>"; };
@@ -259,7 +297,7 @@
BCB282F40CFA7450007E533E /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = DebugRelease.xcconfig; path = mac/Configurations/DebugRelease.xcconfig; sourceTree = "<group>"; };
BCB283D80CFA7AFD007E533E /* ImageDiff.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = ImageDiff.xcconfig; path = mac/Configurations/ImageDiff.xcconfig; sourceTree = "<group>"; };
BCB283DE0CFA7C20007E533E /* TestNetscapePlugIn.xcconfig */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.xcconfig; name = TestNetscapePlugIn.xcconfig; path = mac/Configurations/TestNetscapePlugIn.xcconfig; sourceTree = "<group>"; };
- BCB284880CFA8202007E533E /* PixelDumpSupportCG.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; name = PixelDumpSupportCG.cpp; path = cg/PixelDumpSupportCG.cpp; sourceTree = "<group>"; };
+ BCB284880CFA8202007E533E /* PixelDumpSupportCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = PixelDumpSupportCG.cpp; path = cg/PixelDumpSupportCG.cpp; sourceTree = "<group>"; };
BCB284890CFA8202007E533E /* PixelDumpSupportCG.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PixelDumpSupportCG.h; path = cg/PixelDumpSupportCG.h; sourceTree = "<group>"; };
BCB2848A0CFA820F007E533E /* PixelDumpSupport.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PixelDumpSupport.h; sourceTree = "<group>"; };
BCB2848C0CFA8221007E533E /* PixelDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = PixelDumpSupportMac.mm; path = mac/PixelDumpSupportMac.mm; sourceTree = "<group>"; };
@@ -268,7 +306,12 @@
BCD08A580E10496B00A7D0C1 /* AccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityController.h; sourceTree = "<group>"; };
BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityController.cpp; sourceTree = "<group>"; };
BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityControllerMac.mm; path = mac/AccessibilityControllerMac.mm; sourceTree = "<group>"; };
- BCF6C64F0C98E9C000AC063E /* GCController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; path = GCController.cpp; sourceTree = "<group>"; };
+ BCF6C64F0C98E9C000AC063E /* GCController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GCController.cpp; sourceTree = "<group>"; };
+ C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PassDifferentNPPStruct.cpp; sourceTree = "<group>"; };
+ C0E720741281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EvaluateJSAfterRemovingPluginElement.cpp; sourceTree = "<group>"; };
+ C0EC3C9B12787F0500939164 /* NullNPPGetValuePointer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NullNPPGetValuePointer.cpp; sourceTree = "<group>"; };
+ E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockGeolocationProvider.h; path = mac/MockGeolocationProvider.h; sourceTree = "<group>"; };
+ E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MockGeolocationProvider.mm; path = mac/MockGeolocationProvider.mm; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -280,6 +323,7 @@
141BF436096A455900E0753C /* Cocoa.framework in Frameworks */,
141BF438096A455900E0753C /* JavaScriptCore.framework in Frameworks */,
141BF435096A455900E0753C /* WebKit.framework in Frameworks */,
+ 0F37A4AA11E6629100275F54 /* QuartzCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -326,12 +370,15 @@
BCA18B740C9B08F100114369 /* DumpRenderTreeDraggingInfo.mm */,
A8D79CE80FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h */,
A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */,
+ 44A997820FCDE86400580F10 /* WebArchiveDumpSupport.h */,
+ 44A997830FCDE86400580F10 /* WebArchiveDumpSupport.cpp */,
+ 440590701268453800CFD48D /* WebArchiveDumpSupportMac.mm */,
BC9D90210C97472D0099A4A3 /* WorkQueue.cpp */,
BC9D90220C97472E0099A4A3 /* WorkQueue.h */,
BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */,
A8B91AD20CF3B305008F91FF /* AppKit Overrides */,
A8B91AC40CF3B170008F91FF /* ObjCPlugin */,
- 141BF1F5096A439800E0753C /* TestNetscapePlugIn.subproj */,
+ 141BF1F5096A439800E0753C /* TestNetscapePlugIn */,
9345229B0BD12B2C0086EDA0 /* Resources */,
A803FF6409CAACC1009B2A37 /* Frameworks */,
9340995508540CAF007F3BC8 /* Products */,
@@ -340,17 +387,21 @@
name = DumpRenderTree;
sourceTree = "<group>";
};
- 141BF1F5096A439800E0753C /* TestNetscapePlugIn.subproj */ = {
+ 141BF1F5096A439800E0753C /* TestNetscapePlugIn */ = {
isa = PBXGroup;
children = (
+ 1A215A6E11F25FF1008AD0F5 /* Tests */,
141BF448096A45C800E0753C /* Info.plist */,
1AC6C77F0D07589B00CD3161 /* main.cpp */,
1AC6C7800D07589B00CD3161 /* PluginObject.cpp */,
+ 0F37A4A611E6628700275F54 /* PluginObjectMac.mm */,
141BF447096A45C800E0753C /* PluginObject.h */,
+ 1A215A7F11F2609C008AD0F5 /* PluginTest.cpp */,
+ 1A215A8011F2609C008AD0F5 /* PluginTest.h */,
1AC6C7810D07589B00CD3161 /* TestObject.cpp */,
1A8F024C0BB9B056008CFA34 /* TestObject.h */,
);
- path = TestNetscapePlugIn.subproj;
+ path = TestNetscapePlugIn;
sourceTree = "<group>";
};
1422A2690AF6F45200E1A883 /* Controllers */ = {
@@ -359,6 +410,9 @@
BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */,
BCD08A580E10496B00A7D0C1 /* AccessibilityController.h */,
BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */,
+ 29CFBA0F122736E600BC30C0 /* AccessibilityTextMarker.cpp */,
+ 29CFBA0E122736E600BC30C0 /* AccessibilityTextMarker.h */,
+ 29CFBA2D12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm */,
BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */,
BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */,
BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */,
@@ -372,6 +426,8 @@
BC0131D80C9772010087317D /* LayoutTestController.cpp */,
BC0131D90C9772010087317D /* LayoutTestController.h */,
BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */,
+ E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */,
+ E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */,
BCA18B6D0C9B08DB00114369 /* NavigationController.h */,
BCA18B6E0C9B08DB00114369 /* NavigationController.m */,
BCA18B2F0C9B01B400114369 /* ObjCController.h */,
@@ -404,6 +460,20 @@
name = Delegates;
sourceTree = "<group>";
};
+ 1A215A6E11F25FF1008AD0F5 /* Tests */ = {
+ isa = PBXGroup;
+ children = (
+ 1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */,
+ C0E720741281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp */,
+ 1A24BAA8120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp */,
+ 1AC77DCE120605B6005C19EF /* NPRuntimeRemoveProperty.cpp */,
+ C0EC3C9B12787F0500939164 /* NullNPPGetValuePointer.cpp */,
+ C06F9ABB1267A7060058E1F6 /* PassDifferentNPPStruct.cpp */,
+ 1AD9D2FD12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp */,
+ );
+ path = Tests;
+ sourceTree = "<group>";
+ };
9340995508540CAF007F3BC8 /* Products */ = {
isa = PBXGroup;
children = (
@@ -417,6 +487,8 @@
9345229B0BD12B2C0086EDA0 /* Resources */ = {
isa = PBXGroup;
children = (
+ 3713EDDF115BE16F00705720 /* ColorBits-A.png */,
+ 3713EDE0115BE16F00705720 /* ColorBits.ttf */,
AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */,
375F09710DAC3CB600C8B4E5 /* WebKitWeightWatcher100.ttf */,
375F09720DAC3CB600C8B4E5 /* WebKitWeightWatcher200.ttf */,
@@ -502,6 +574,7 @@
files = (
141BF453096A45EB00E0753C /* PluginObject.h in Headers */,
1A8F02E80BB9B4EC008CFA34 /* TestObject.h in Headers */,
+ 1A215A8211F2609C008AD0F5 /* PluginTest.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -535,9 +608,12 @@
BCA18B670C9B08C200114369 /* ResourceLoadDelegate.h in Headers */,
BCA18B3C0C9B024900114369 /* TextInputController.h in Headers */,
BCA18B690C9B08C200114369 /* UIDelegate.h in Headers */,
+ 4437730F125CBC4D00AAE02C /* WebArchiveDumpSupport.h in Headers */,
BC9D90250C97472E0099A4A3 /* WorkQueue.h in Headers */,
BC9D90260C97472E0099A4A3 /* WorkQueueItem.h in Headers */,
5185F6B310714E12007AA393 /* HistoryDelegate.h in Headers */,
+ E1B7816711AF31C3007E1BC2 /* MockGeolocationProvider.h in Headers */,
+ 29CFBA10122736E600BC30C0 /* AccessibilityTextMarker.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -630,7 +706,14 @@
isa = PBXProject;
buildConfigurationList = 149C29C308902C6D008A9EFC /* Build configuration list for PBXProject "DumpRenderTree" */;
compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 08FB7794FE84155DC02AAC07 /* DumpRenderTree */;
productRefGroup = 9340995508540CAF007F3BC8 /* Products */;
projectDirPath = "";
@@ -663,6 +746,15 @@
1AC6C8490D07638600CD3161 /* main.cpp in Sources */,
1AC6C84A0D07638600CD3161 /* PluginObject.cpp in Sources */,
1AC6C84B0D07638600CD3161 /* TestObject.cpp in Sources */,
+ 0F37A4A711E6628700275F54 /* PluginObjectMac.mm in Sources */,
+ 1A215A8111F2609C008AD0F5 /* PluginTest.cpp in Sources */,
+ 1A215BE711F27658008AD0F5 /* DocumentOpenInDestroyStream.cpp in Sources */,
+ 1AD9D2FE12028409001A70D1 /* PluginScriptableNPObjectInvokeDefault.cpp in Sources */,
+ 1AC77DCF120605B6005C19EF /* NPRuntimeRemoveProperty.cpp in Sources */,
+ 1A24BAA9120734EE00FBB059 /* NPRuntimeObjectFromDestroyedPlugin.cpp in Sources */,
+ C06F9ABC1267A7060058E1F6 /* PassDifferentNPPStruct.cpp in Sources */,
+ C0EC3C9C12787F0500939164 /* NullNPPGetValuePointer.cpp in Sources */,
+ C0E720751281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -701,9 +793,14 @@
BCA18B680C9B08C200114369 /* ResourceLoadDelegate.mm in Sources */,
BCA18B490C9B02C400114369 /* TextInputController.m in Sources */,
BCA18B6A0C9B08C200114369 /* UIDelegate.mm in Sources */,
+ 4437730E125CBC3600AAE02C /* WebArchiveDumpSupport.cpp in Sources */,
+ 440590711268453800CFD48D /* WebArchiveDumpSupportMac.mm in Sources */,
BC9D90240C97472E0099A4A3 /* WorkQueue.cpp in Sources */,
BCA18B260C9B015C00114369 /* WorkQueueItemMac.mm in Sources */,
5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */,
+ E1B7816511AF31B7007E1BC2 /* MockGeolocationProvider.mm in Sources */,
+ 29CFBA11122736E600BC30C0 /* AccessibilityTextMarker.cpp in Sources */,
+ 29CFBA2E12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -745,6 +842,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BCB283DE0CFA7C20007E533E /* TestNetscapePlugIn.xcconfig */;
buildSettings = {
+ INFOPLIST_FILE = TestNetscapePlugIn/mac/Info.plist;
};
name = Debug;
};
@@ -752,6 +850,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BCB283DE0CFA7C20007E533E /* TestNetscapePlugIn.xcconfig */;
buildSettings = {
+ INFOPLIST_FILE = TestNetscapePlugIn/mac/Info.plist;
};
name = Release;
};
@@ -843,6 +942,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = BCB283DE0CFA7C20007E533E /* TestNetscapePlugIn.xcconfig */;
buildSettings = {
+ INFOPLIST_FILE = TestNetscapePlugIn/mac/Info.plist;
INSTALL_PATH = "$(SYSTEM_LIBRARY_DIR)/Frameworks/$(WEBKIT_FRAMEWORK_RESOURCES_PATH)";
SKIP_INSTALL = NO;
};
diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Atomics.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Atomics.h
new file mode 100644
index 0000000..37b1892
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/Atomics.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/Atomics.h>
diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/CurrentTime.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/CurrentTime.h
new file mode 100644
index 0000000..a31a23d
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/CurrentTime.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/CurrentTime.h>
diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/MainThread.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/MainThread.h
new file mode 100644
index 0000000..ff75971
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/MainThread.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/MainThread.h>
diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadSafeShared.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadSafeShared.h
new file mode 100644
index 0000000..4a7a77f
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadSafeShared.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/ThreadSafeShared.h>
diff --git a/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadingPrimitives.h b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadingPrimitives.h
new file mode 100644
index 0000000..a7ee117
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/ForwardingHeaders/wtf/ThreadingPrimitives.h
@@ -0,0 +1 @@
+#include <JavaScriptCore/ThreadingPrimitives.h>
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index c2393c3..9619389 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -31,6 +31,7 @@
#include "WorkQueue.h"
#include "WorkQueueItem.h"
+#include <cstring>
#include <JavaScriptCore/JSContextRef.h>
#include <JavaScriptCore/JSObjectRef.h>
#include <JavaScriptCore/JSRetainPtr.h>
@@ -40,7 +41,8 @@
#include <wtf/RefPtr.h>
LayoutTestController::LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash)
- : m_dumpAsPDF(false)
+ : m_dumpApplicationCacheDelegateCallbacks(false)
+ , m_dumpAsPDF(false)
, m_dumpAsText(false)
, m_dumpBackForwardList(false)
, m_dumpChildFrameScrollPositions(false)
@@ -49,6 +51,7 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con
, m_dumpDatabaseCallbacks(false)
, m_dumpEditingCallbacks(false)
, m_dumpFrameLoadCallbacks(false)
+ , m_dumpUserGestureInFrameLoadCallbacks(false)
, m_dumpHistoryDelegateCallbacks(false)
, m_dumpResourceLoadCallbacks(false)
, m_dumpResourceResponseMIMETypes(false)
@@ -56,8 +59,10 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con
, m_dumpSourceAsWebArchive(false)
, m_dumpStatusCallbacks(false)
, m_dumpTitleChanges(false)
+ , m_dumpIconChanges(false)
, m_dumpVisitedLinksCallback(false)
, m_dumpWillCacheResponse(false)
+ , m_generatePixelResults(true)
, m_callCloseOnWebViews(true)
, m_canOpenWindows(false)
, m_closeRemainingWindowsWhenComplete(true)
@@ -74,13 +79,28 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con
, m_globalFlag(false)
, m_isGeolocationPermissionSet(false)
, m_geolocationPermission(false)
+ , m_handlesAuthenticationChallenges(false)
+ , m_isPrinting(false)
+ , m_deferMainResourceDataLoad(true)
, m_testPathOrURL(testPathOrURL)
, m_expectedPixelHash(expectedPixelHash)
{
}
+PassRefPtr<LayoutTestController> LayoutTestController::create(const std::string& testPathOrURL, const std::string& expectedPixelHash)
+{
+ return adoptRef(new LayoutTestController(testPathOrURL, expectedPixelHash));
+}
+
// Static Functions
+static JSValueRef dumpApplicationCacheDelegateCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setDumpApplicationCacheDelegateCallbacks(true);
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef dumpAsPDFCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -92,6 +112,10 @@ static JSValueRef dumpAsTextCallback(JSContextRef context, JSObjectRef function,
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
controller->setDumpAsText(true);
+
+ // Optional paramater, describing whether it's allowed to dump pixel results in dumpAsText mode.
+ controller->setGeneratePixelResults(argumentCount > 0 ? JSValueToBoolean(context, arguments[0]) : false);
+
return JSValueMakeUndefined(context);
}
@@ -144,6 +168,13 @@ static JSValueRef dumpFrameLoadCallbacksCallback(JSContextRef context, JSObjectR
return JSValueMakeUndefined(context);
}
+static JSValueRef dumpUserGestureInFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setDumpUserGestureInFrameLoadCallbacks(true);
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef dumpResourceLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -186,6 +217,13 @@ static JSValueRef dumpTitleChangesCallback(JSContextRef context, JSObjectRef fun
return JSValueMakeUndefined(context);
}
+static JSValueRef dumpIconChangesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setDumpIconChanges(true);
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef dumpWillCacheResponseCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -280,6 +318,23 @@ static JSValueRef addDisallowedURLCallback(JSContextRef context, JSObjectRef fun
return JSValueMakeUndefined(context);
}
+static JSValueRef callShouldCloseOnWebViewCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac & windows implementation
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+
+ return JSValueMakeBoolean(context, controller->callShouldCloseOnWebView());
+}
+
+static JSValueRef clearAllApplicationCachesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac implementation
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->clearAllApplicationCaches();
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef clearAllDatabasesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
@@ -456,6 +511,41 @@ static JSValueRef keepWebHistoryCallback(JSContextRef context, JSObjectRef funct
return JSValueMakeUndefined(context);
}
+static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount != 1)
+ return JSValueMakeUndefined(context);
+
+ // Has mac implementation
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ return controller->computedStyleIncludingVisitedInfo(context, arguments[0]);
+}
+
+static JSValueRef nodesFromRectCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount != 8)
+ return JSValueMakeUndefined(context);
+
+ int x = JSValueToNumber(context, arguments[1], NULL);
+ int y = JSValueToNumber(context, arguments[2], NULL);
+ int top = static_cast<unsigned>(JSValueToNumber(context, arguments[3], NULL));
+ int right = static_cast<unsigned>(JSValueToNumber(context, arguments[4], NULL));
+ int bottom = static_cast<unsigned>(JSValueToNumber(context, arguments[5], NULL));
+ int left = static_cast<unsigned>(JSValueToNumber(context, arguments[6], NULL));
+ bool ignoreClipping = JSValueToBoolean(context, arguments[7]);
+
+ // Has mac implementation.
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ return controller->nodesFromRect(context, arguments[0], x, y, top, right, bottom, left, ignoreClipping);
+}
+
+static JSValueRef layerTreeAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac & windows implementation
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ return JSValueMakeString(context, controller->layerTreeAsText().get());
+}
+
static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
@@ -467,10 +557,8 @@ static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function,
static bool parsePageParameters(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, float& pageWidthInPixels, float& pageHeightInPixels)
{
- // FIXME: These values should sync with maxViewWidth/Height in
- // DumpRenderTree.mm. Factor these values out to somewhere.
- pageWidthInPixels = 800;
- pageHeightInPixels = 600;
+ pageWidthInPixels = LayoutTestController::maxViewWidth;
+ pageHeightInPixels = LayoutTestController::maxViewHeight;
switch (argumentCount) {
case 2:
pageWidthInPixels = static_cast<float>(JSValueToNumber(context, arguments[0], exception));
@@ -487,6 +575,96 @@ 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;
+ switch (argumentCount) {
+ case 1:
+ pageNumber = static_cast<int>(JSValueToNumber(context, arguments[0], exception));
+ if (*exception)
+ return false;
+ // Fall through.
+ case 0:
+ return true;
+ default:
+ return false;
+ }
+}
+
+static bool parsePageNumberSizeMarings(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, int& pageNumber, int& width, int& height, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft)
+{
+ pageNumber = 0;
+ width = height = 0;
+ marginTop = marginRight = marginBottom = marginLeft = 0;
+
+ switch (argumentCount) {
+ case 7:
+ marginLeft = static_cast<int>(JSValueToNumber(context, arguments[6], exception));
+ if (*exception)
+ return false;
+ // Fall through.
+ case 6:
+ marginBottom = static_cast<int>(JSValueToNumber(context, arguments[5], exception));
+ if (*exception)
+ return false;
+ // Fall through.
+ case 5:
+ marginRight = static_cast<int>(JSValueToNumber(context, arguments[4], exception));
+ if (*exception)
+ return false;
+ // Fall through.
+ case 4:
+ marginTop = static_cast<int>(JSValueToNumber(context, arguments[3], exception));
+ if (*exception)
+ return false;
+ // Fall through.
+ case 3:
+ height = static_cast<int>(JSValueToNumber(context, arguments[2], exception));
+ if (*exception)
+ return false;
+ // Fall through.
+ case 2:
+ width = static_cast<int>(JSValueToNumber(context, arguments[1], exception));
+ if (*exception)
+ return false;
+ // Fall through.
+ case 1:
+ pageNumber = static_cast<int>(JSValueToNumber(context, arguments[0], exception));
+ if (*exception)
+ return false;
+ // Fall through.
+ return true;
+ default:
+ return false;
+ }
+}
+
static JSValueRef pageNumberForElementByIdCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
float pageWidthInPixels = 0;
@@ -514,6 +692,42 @@ 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 pageSizeAndMarginsInPixelsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int pageNumber = 0;
+ int width = 0, height = 0;
+ int marginTop = 0, marginRight = 0, marginBottom = 0, marginLeft = 0;
+ if (!parsePageNumberSizeMarings(context, argumentCount, arguments, exception, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft))
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ return JSValueMakeString(context, controller->pageSizeAndMarginsInPixels(pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).get());
+}
+
static JSValueRef queueBackNavigationCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
@@ -569,6 +783,28 @@ static JSValueRef queueLoadCallback(JSContextRef context, JSObjectRef function,
return JSValueMakeUndefined(context);
}
+static JSValueRef queueLoadHTMLStringCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has Mac & Windows implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> content(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+
+ JSRetainPtr<JSStringRef> baseURL;
+ if (argumentCount >= 2) {
+ baseURL.adopt(JSValueToStringCopy(context, arguments[1], exception));
+ ASSERT(!*exception);
+ } else
+ baseURL.adopt(JSStringCreateWithUTF8CString(""));
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->queueLoadHTMLString(content.get(), baseURL.get());
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef queueReloadCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
@@ -649,7 +885,21 @@ static JSValueRef setAppCacheMaximumSizeCallback(JSContextRef context, JSObjectR
controller->setAppCacheMaximumSize(static_cast<unsigned long long>(size));
return JSValueMakeUndefined(context);
+}
+
+static JSValueRef setApplicationCacheOriginQuotaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+
+ double size = JSValueToNumber(context, arguments[0], NULL);
+ if (!isnan(size))
+ controller->setApplicationCacheOriginQuota(static_cast<unsigned long long>(size));
+ return JSValueMakeUndefined(context);
}
static JSValueRef setAuthenticationPasswordCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
@@ -750,6 +1000,18 @@ static JSValueRef setDatabaseQuotaCallback(JSContextRef context, JSObjectRef fun
return JSValueMakeUndefined(context);
}
+static JSValueRef setDeferMainResourceDataLoadCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has Mac and Windows implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setDeferMainResourceDataLoad(JSValueToBoolean(context, arguments[0]));
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setDomainRelaxationForbiddenForURLSchemeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has Mac and Windows implementation
@@ -765,6 +1027,27 @@ static JSValueRef setDomainRelaxationForbiddenForURLSchemeCallback(JSContextRef
return JSValueMakeUndefined(context);
}
+static JSValueRef setMockDeviceOrientationCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount < 6)
+ return JSValueMakeUndefined(context);
+
+ bool canProvideAlpha = JSValueToBoolean(context, arguments[0]);
+ double alpha = JSValueToNumber(context, arguments[1], exception);
+ ASSERT(!*exception);
+ bool canProvideBeta = JSValueToBoolean(context, arguments[2]);
+ double beta = JSValueToNumber(context, arguments[3], exception);
+ ASSERT(!*exception);
+ bool canProvideGamma = JSValueToBoolean(context, arguments[4]);
+ double gamma = JSValueToNumber(context, arguments[5], exception);
+ ASSERT(!*exception);
+
+ LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setMockDeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setMockGeolocationPositionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
if (argumentCount < 3)
@@ -793,6 +1076,23 @@ static JSValueRef setMockGeolocationErrorCallback(JSContextRef context, JSObject
return JSValueMakeUndefined(context);
}
+static JSValueRef setMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount < 2)
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> result(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+
+ JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+ ASSERT(!*exception);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setMockSpeechInputResult(result.get(), language.get());
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setNewWindowsCopyBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac implementation
@@ -904,6 +1204,18 @@ static JSValueRef setPrivateBrowsingEnabledCallback(JSContextRef context, JSObje
return JSValueMakeUndefined(context);
}
+static JSValueRef setJavaScriptCanAccessClipboardCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac & windows implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setJavaScriptCanAccessClipboard(JSValueToBoolean(context, arguments[0]));
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setXSSAuditorEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
@@ -916,14 +1228,34 @@ static JSValueRef setXSSAuditorEnabledCallback(JSContextRef context, JSObjectRef
return JSValueMakeUndefined(context);
}
-static JSValueRef setFrameSetFlatteningEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef setSpatialNavigationEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac implementation.
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setSpatialNavigationEnabled(JSValueToBoolean(context, arguments[0]));
+
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef setPrintingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setIsPrinting(true);
+ return JSValueMakeUndefined(context);
+}
+
+
+static JSValueRef setFrameFlatteningEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
if (argumentCount < 1)
return JSValueMakeUndefined(context);
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
- controller->setFrameSetFlatteningEnabled(JSValueToBoolean(context, arguments[0]));
+ controller->setFrameFlatteningEnabled(JSValueToBoolean(context, arguments[0]));
return JSValueMakeUndefined(context);
}
@@ -940,6 +1272,18 @@ static JSValueRef setAllowUniversalAccessFromFileURLsCallback(JSContextRef conte
return JSValueMakeUndefined(context);
}
+static JSValueRef setAllowFileAccessFromFileURLsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac & windows implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setAllowFileAccessFromFileURLs(JSValueToBoolean(context, arguments[0]));
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setTabKeyCyclesThroughElementsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
@@ -1001,6 +1345,40 @@ static JSValueRef setUserStyleSheetLocationCallback(JSContextRef context, JSObje
return JSValueMakeUndefined(context);
}
+static JSValueRef setViewModeMediaFeatureCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> mode(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setViewModeMediaFeature(mode.get());
+
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef setWillSendRequestClearHeaderCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac & windows implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> header(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+
+ size_t maxLength = JSStringGetMaximumUTF8CStringSize(header.get());
+ char* headerBuffer = new char[maxLength + 1];
+ JSStringGetUTF8CString(header.get(), headerBuffer, maxLength + 1);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setWillSendRequestClearHeader(headerBuffer);
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setWillSendRequestReturnsNullCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has cross-platform implementation
@@ -1066,6 +1444,18 @@ static JSValueRef setPopupBlockingEnabledCallback(JSContextRef context, JSObject
return JSValueMakeUndefined(context);
}
+static JSValueRef setPluginsEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has mac & windows implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setPluginsEnabled(JSValueToBoolean(context, arguments[0]));
+
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef setSmartInsertDeleteEnabledCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
if (argumentCount < 1)
@@ -1200,6 +1590,20 @@ static JSValueRef numberOfActiveAnimationsCallback(JSContextRef context, JSObjec
return JSValueMakeNumber(context, controller->numberOfActiveAnimations());
}
+static JSValueRef suspendAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->suspendAnimations();
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef resumeAnimationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->resumeAnimations();
+ return JSValueMakeUndefined(context);
+}
+
static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t, const JSValueRef[], JSValueRef*)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -1207,7 +1611,7 @@ static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRe
return JSValueMakeUndefined(context);
}
-static JSValueRef whiteListAccessFromOriginCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef addOriginAccessWhitelistEntryCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
if (argumentCount != 4)
return JSValueMakeUndefined(context);
@@ -1221,34 +1625,178 @@ static JSValueRef whiteListAccessFromOriginCallback(JSContextRef context, JSObje
bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]);
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
- controller->whiteListAccessFromOrigin(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains);
+ controller->addOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains);
return JSValueMakeUndefined(context);
}
-static JSValueRef addUserScriptCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef removeOriginAccessWhitelistEntryCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount != 4)
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> sourceOrigin(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+ JSRetainPtr<JSStringRef> destinationProtocol(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+ ASSERT(!*exception);
+ JSRetainPtr<JSStringRef> destinationHost(Adopt, JSValueToStringCopy(context, arguments[2], exception));
+ ASSERT(!*exception);
+ bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->removeOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains);
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef setScrollbarPolicyCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
if (argumentCount != 2)
return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> orientation(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+ JSRetainPtr<JSStringRef> policy(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+ ASSERT(!*exception);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setScrollbarPolicy(orientation.get(), policy.get());
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef addUserScriptCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount != 3)
+ return JSValueMakeUndefined(context);
JSRetainPtr<JSStringRef> source(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
bool runAtStart = JSValueToBoolean(context, arguments[1]);
+ bool allFrames = JSValueToBoolean(context, arguments[2]);
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
- controller->addUserScript(source.get(), runAtStart);
+ controller->addUserScript(source.get(), runAtStart, allFrames);
return JSValueMakeUndefined(context);
}
static JSValueRef addUserStyleSheetCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- if (argumentCount != 1)
+ if (argumentCount != 2)
return JSValueMakeUndefined(context);
JSRetainPtr<JSStringRef> source(Adopt, JSValueToStringCopy(context, arguments[0], exception));
ASSERT(!*exception);
+ bool allFrames = JSValueToBoolean(context, arguments[1]);
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
- controller->addUserStyleSheet(source.get());
+ controller->addUserStyleSheet(source.get(), allFrames);
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef apiTestNewWindowDataLoadBaseURLCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount != 2)
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> utf8Data(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+
+ JSRetainPtr<JSStringRef> baseURL(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+ ASSERT(!*exception);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->apiTestNewWindowDataLoadBaseURL(utf8Data.get(), baseURL.get());
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef apiTestGoToCurrentBackForwardItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->apiTestGoToCurrentBackForwardItem();
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef setWebViewEditableCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // Has Mac implementation
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setWebViewEditable(JSValueToBoolean(context, arguments[0]));
+
+ return JSValueMakeUndefined(context);
+}
+
+
+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);
+}
+
+static JSValueRef hasSpellingMarkerCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ if (argumentCount != 2)
+ return JSValueMakeUndefined(context);
+
+ int from = JSValueToNumber(context, arguments[0], 0);
+ int length = JSValueToNumber(context, arguments[1], 0);
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ bool ok = controller->hasSpellingMarker(from, length);
+
+ return JSValueMakeBoolean(context, ok);
+}
+
+static JSValueRef markerTextForListItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+ return JSValueMakeString(context, controller->markerTextForListItem(context, arguments[0]).get());
+}
+
+static JSValueRef authenticateSessionCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // authenticateSession(url, username, password)
+ if (argumentCount != 3)
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> url(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+ JSRetainPtr<JSStringRef> username(Adopt, JSValueToStringCopy(context, arguments[1], exception));
+ ASSERT(!*exception);
+ JSRetainPtr<JSStringRef> password(Adopt, JSValueToStringCopy(context, arguments[2], exception));
+ ASSERT(!*exception);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->authenticateSession(url.get(), username.get(), password.get());
+ return JSValueMakeUndefined(context);
+}
+
+static JSValueRef setEditingBehaviorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // The editing behavior string.
+ if (argumentCount < 1)
+ return JSValueMakeUndefined(context);
+
+ JSRetainPtr<JSStringRef> editingBehavior(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ ASSERT(!*exception);
+
+ size_t maxLength = JSStringGetMaximumUTF8CStringSize(editingBehavior.get());
+ char* behaviorBuffer = new char[maxLength + 1];
+ JSStringGetUTF8CString(editingBehavior.get(), behaviorBuffer, maxLength);
+
+ if (strcmp(behaviorBuffer, "mac") && strcmp(behaviorBuffer, "win")) {
+ JSRetainPtr<JSStringRef> invalidArgument(JSStringCreateWithUTF8CString("Passed invalid editing behavior. Must be 'mac' or 'win'."));
+ *exception = JSValueMakeString(context, invalidArgument.get());
+ return JSValueMakeUndefined(context);
+ }
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->setEditingBehavior(behaviorBuffer);
+
+ delete [] behaviorBuffer;
+
return JSValueMakeUndefined(context);
}
@@ -1325,17 +1873,25 @@ JSStaticValue* LayoutTestController::staticValues()
JSStaticFunction* LayoutTestController::staticFunctions()
{
static JSStaticFunction staticFunctions[] = {
+ { "abortModal", abortModalCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "addDisallowedURL", addDisallowedURLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "addUserScript", addUserScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "addUserStyleSheet", addUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "apiTestNewWindowDataLoadBaseURL", apiTestNewWindowDataLoadBaseURLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "apiTestGoToCurrentBackForwardItem", apiTestGoToCurrentBackForwardItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "callShouldCloseOnWebView", callShouldCloseOnWebViewCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "clearAllApplicationCaches", clearAllApplicationCachesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "clearAllDatabases", clearAllDatabasesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "clearBackForwardList", clearBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "clearPersistentUserStyleSheet", clearPersistentUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "closeWebInspector", closeWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "computedStyleIncludingVisitedInfo", computedStyleIncludingVisitedInfoCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "nodesFromRect", nodesFromRectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "decodeHostName", decodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "disableImageLoading", disableImageLoadingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dispatchPendingLoadRequests", dispatchPendingLoadRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "display", displayCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "dumpApplicationCacheDelegateCallbacks", dumpApplicationCacheDelegateCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpAsText", dumpAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpBackForwardList", dumpBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpChildFrameScrollPositions", dumpChildFrameScrollPositionsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -1344,12 +1900,14 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "dumpDatabaseCallbacks", dumpDatabaseCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpEditingCallbacks", dumpEditingCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpFrameLoadCallbacks", dumpFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "dumpUserGestureInFrameLoadCallbacks", dumpUserGestureInFrameLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpResourceLoadCallbacks", dumpResourceLoadCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpResourceResponseMIMETypes", dumpResourceResponseMIMETypesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpSelectionRect", dumpSelectionRectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpSourceAsWebArchive", dumpSourceAsWebArchiveCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpStatusCallbacks", dumpStatusCallbacksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpTitleChanges", dumpTitleChangesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "dumpIconChanges", dumpIconChangesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "dumpWillCacheResponse", dumpWillCacheResponseCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "elementDoesAutoCompleteForElementWithId", elementDoesAutoCompleteForElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "encodeHostName", encodeHostNameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -1358,13 +1916,21 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "execCommand", execCommandCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "counterValueForElementById", counterValueForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "grantDesktopNotificationPermission", grantDesktopNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "hasSpellingMarker", hasSpellingMarkerCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "isPageBoxVisible", isPageBoxVisibleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "layerTreeAsText", layerTreeAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "numberOfPages", numberOfPagesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "markerTextForListItem", markerTextForListItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "suspendAnimations", suspendAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "resumeAnimations", resumeAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pageNumberForElementById", pageNumberForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "pageSizeAndMarginsInPixels", pageSizeAndMarginsInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "pageProperty", pagePropertyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pathToLocalResource", pathToLocalResourceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pauseAnimationAtTimeOnElementWithId", pauseAnimationAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pauseTransitionAtTimeOnElementWithId", pauseTransitionAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -1373,63 +1939,85 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "queueBackNavigation", queueBackNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "queueForwardNavigation", queueForwardNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "queueLoad", queueLoadCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "queueLoadHTMLString", queueLoadHTMLStringCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "queueLoadingScript", queueLoadingScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "queueNonLoadingScript", queueNonLoadingScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "queueReload", queueReloadCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "removeAllVisitedLinks", removeAllVisitedLinksCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "removeOriginAccessWhitelistEntry", removeOriginAccessWhitelistEntryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "repaintSweepHorizontally", repaintSweepHorizontallyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAcceptsEditing", setAcceptsEditingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAllowUniversalAccessFromFileURLs", setAllowUniversalAccessFromFileURLsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setAllowFileAccessFromFileURLs", setAllowFileAccessFromFileURLsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAlwaysAcceptCookies", setAlwaysAcceptCookiesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "setAppCacheMaximumSize", setAppCacheMaximumSizeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setAppCacheMaximumSize", setAppCacheMaximumSizeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setApplicationCacheOriginQuota", setApplicationCacheOriginQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAuthenticationPassword", setAuthenticationPasswordCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAuthenticationUsername", setAuthenticationUsernameCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setAuthorAndUserStylesEnabled", setAuthorAndUserStylesEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setCacheModel", setCacheModelCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setCallCloseOnWebViews", setCallCloseOnWebViewsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setCanOpenWindows", setCanOpenWindowsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "setCacheModel", setCacheModelCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setCloseRemainingWindowsWhenComplete", setCloseRemainingWindowsWhenCompleteCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setCustomPolicyDelegate", setCustomPolicyDelegateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setDatabaseQuota", setDatabaseQuotaCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setDeferMainResourceDataLoad", setDeferMainResourceDataLoadCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setDomainRelaxationForbiddenForURLScheme", setDomainRelaxationForbiddenForURLSchemeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setEditingBehavior", setEditingBehaviorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setFrameFlatteningEnabled", setFrameFlatteningEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setGeolocationPermission", setGeolocationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setHandlesAuthenticationChallenges", setHandlesAuthenticationChallengesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "setPOSIXLocale", setPOSIXLocaleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setIconDatabaseEnabled", setIconDatabaseEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setJavaScriptProfilingEnabled", setJavaScriptProfilingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setMainFrameIsFirstResponder", setMainFrameIsFirstResponderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "setMockGeolocationPosition", setMockGeolocationPositionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setMockDeviceOrientation", setMockDeviceOrientationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setMockGeolocationError", setMockGeolocationErrorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setMockGeolocationPosition", setMockGeolocationPositionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setMockSpeechInputResult", setMockSpeechInputResultCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setNewWindowsCopyBackForwardList", setNewWindowsCopyBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setPOSIXLocale", setPOSIXLocaleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setPersistentUserStyleSheetLocation", setPersistentUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setPopupBlockingEnabled", setPopupBlockingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setPluginsEnabled", setPluginsEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setPrinting", setPrintingCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setPrivateBrowsingEnabled", setPrivateBrowsingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "setXSSAuditorEnabled", setXSSAuditorEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "setFrameSetFlatteningEnabled", setFrameSetFlatteningEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setSelectTrailingWhitespaceEnabled", setSelectTrailingWhitespaceEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setSmartInsertDeleteEnabled", setSmartInsertDeleteEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setSpatialNavigationEnabled", setSpatialNavigationEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setStopProvisionalFrameLoads", setStopProvisionalFrameLoadsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setTabKeyCyclesThroughElements", setTabKeyCyclesThroughElementsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setTimelineProfilingEnabled", setTimelineProfilingEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setUseDashboardCompatibilityMode", setUseDashboardCompatibilityModeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setUserStyleSheetEnabled", setUserStyleSheetEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setUserStyleSheetLocation", setUserStyleSheetLocationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setViewModeMediaFeature", setViewModeMediaFeatureCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setWebViewEditable", setWebViewEditableCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setWillSendRequestClearHeader", setWillSendRequestClearHeaderCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setWillSendRequestReturnsNull", setWillSendRequestReturnsNullCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setWillSendRequestReturnsNullOnRedirect", setWillSendRequestReturnsNullOnRedirectCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "setWindowIsKey", setWindowIsKeyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setJavaScriptCanAccessClipboard", setJavaScriptCanAccessClipboardCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setXSSAuditorEnabled", setXSSAuditorEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "showWebInspector", showWebInspectorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "testOnscreen", testOnscreenCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "testRepaint", testRepaintCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "waitForPolicyDelegate", waitForPolicyDelegateCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "waitUntilDone", waitUntilDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "windowCount", windowCountCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
- { "whiteListAccessFromOrigin", whiteListAccessFromOriginCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "addOriginAccessWhitelistEntry", addOriginAccessWhitelistEntryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "setScrollbarPolicy", setScrollbarPolicyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "authenticateSession", authenticateSessionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ 0, 0, 0 }
};
return staticFunctions;
}
+void LayoutTestController::queueLoadHTMLString(JSStringRef content, JSStringRef baseURL)
+{
+ WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL));
+}
+
void LayoutTestController::queueBackNavigation(int howFarBack)
{
WorkQueue::shared()->queue(new BackItem(howFarBack));
@@ -1480,7 +2068,7 @@ void LayoutTestController::waitToDumpWatchdogTimerFired()
notifyDone();
}
-void LayoutTestController::setGeolocationPermission(bool allow)
+void LayoutTestController::setGeolocationPermissionCommon(bool allow)
{
m_isGeolocationPermissionSet = true;
m_geolocationPermission = allow;
@@ -1492,3 +2080,6 @@ void LayoutTestController::setPOSIXLocale(JSStringRef locale)
JSStringGetUTF8CString(locale, localeBuf, sizeof(localeBuf));
setlocale(LC_ALL, localeBuf);
}
+
+const unsigned LayoutTestController::maxViewWidth = 800;
+const unsigned LayoutTestController::maxViewHeight = 600;
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index 5f9df50..b61860b 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -31,21 +31,25 @@
#include <JavaScriptCore/JSObjectRef.h>
#include <JavaScriptCore/JSRetainPtr.h>
-#include <wtf/RefCounted.h>
+#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);
void addDisallowedURL(JSStringRef url);
+ void clearAllApplicationCaches();
void clearAllDatabases();
void clearBackForwardList();
void clearPersistentUserStyleSheet();
+ bool callShouldCloseOnWebView();
JSStringRef copyDecodedHostName(JSStringRef name);
JSStringRef copyEncodedHostName(JSStringRef name);
void disableImageLoading();
@@ -55,21 +59,29 @@ public:
JSRetainPtr<JSStringRef> counterValueForElementById(JSStringRef id);
bool isCommandEnabled(JSStringRef name);
void keepWebHistory();
+ JSValueRef computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef);
+ JSValueRef nodesFromRect(JSContextRef, JSValueRef, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
void notifyDone();
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;
+ JSRetainPtr<JSStringRef> pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const;
+ bool isPageBoxVisible(int pageNumber) const;
JSStringRef pathToLocalResource(JSContextRef, JSStringRef url);
void queueBackNavigation(int howFarBackward);
void queueForwardNavigation(int howFarForward);
void queueLoad(JSStringRef url, JSStringRef target);
+ void queueLoadHTMLString(JSStringRef content, JSStringRef baseURL);
void queueLoadingScript(JSStringRef script);
void queueNonLoadingScript(JSStringRef script);
void queueReload();
void removeAllVisitedLinks();
void setAcceptsEditing(bool acceptsEditing);
void setAllowUniversalAccessFromFileURLs(bool);
+ void setAllowFileAccessFromFileURLs(bool);
void setAppCacheMaximumSize(unsigned long long quota);
+ void setApplicationCacheOriginQuota(unsigned long long quota);
void setAuthorAndUserStylesEnabled(bool);
void setCacheModel(int);
void setCustomPolicyDelegate(bool setDelegate, bool permissive);
@@ -77,10 +89,14 @@ public:
void setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme);
void setIconDatabaseEnabled(bool iconDatabaseEnabled);
void setJavaScriptProfilingEnabled(bool profilingEnabled);
+ void setJavaScriptCanAccessClipboard(bool flag);
void setMainFrameIsFirstResponder(bool flag);
+ void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
void setMockGeolocationError(int code, JSStringRef message);
void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
+ void setMockSpeechInputResult(JSStringRef result, JSStringRef language);
void setPersistentUserStyleSheetLocation(JSStringRef path);
+ void setPluginsEnabled(bool flag);
void setPopupBlockingEnabled(bool flag);
void setPrivateBrowsingEnabled(bool flag);
void setSelectTrailingWhitespaceEnabled(bool flag);
@@ -89,8 +105,12 @@ public:
void setUseDashboardCompatibilityMode(bool flag);
void setUserStyleSheetEnabled(bool flag);
void setUserStyleSheetLocation(JSStringRef path);
+ void setViewModeMediaFeature(JSStringRef mode);
void setXSSAuditorEnabled(bool flag);
- void setFrameSetFlatteningEnabled(bool enable);
+ void setFrameFlatteningEnabled(bool enable);
+ void setSpatialNavigationEnabled(bool enable);
+ void setScrollbarPolicy(JSStringRef orientation, JSStringRef policy);
+ void setEditingBehavior(const char* editingBehavior);
void waitForPolicyDelegate();
size_t webHistoryItemCount();
@@ -107,7 +127,13 @@ public:
bool dumpAsText() const { return m_dumpAsText; }
void setDumpAsText(bool dumpAsText) { m_dumpAsText = dumpAsText; }
-
+
+ bool generatePixelResults() const { return m_generatePixelResults; }
+ void setGeneratePixelResults(bool generatePixelResults) { m_generatePixelResults = generatePixelResults; }
+
+ bool dumpApplicationCacheDelegateCallbacks() const { return m_dumpApplicationCacheDelegateCallbacks; }
+ void setDumpApplicationCacheDelegateCallbacks(bool dumpCallbacks) { m_dumpApplicationCacheDelegateCallbacks = dumpCallbacks; }
+
bool dumpBackForwardList() const { return m_dumpBackForwardList; }
void setDumpBackForwardList(bool dumpBackForwardList) { m_dumpBackForwardList = dumpBackForwardList; }
@@ -128,6 +154,9 @@ public:
bool dumpFrameLoadCallbacks() const { return m_dumpFrameLoadCallbacks; }
void setDumpFrameLoadCallbacks(bool dumpFrameLoadCallbacks) { m_dumpFrameLoadCallbacks = dumpFrameLoadCallbacks; }
+
+ bool dumpUserGestureInFrameLoadCallbacks() const { return m_dumpUserGestureInFrameLoadCallbacks; }
+ void setDumpUserGestureInFrameLoadCallbacks(bool dumpUserGestureInFrameLoadCallbacks) { m_dumpUserGestureInFrameLoadCallbacks = dumpUserGestureInFrameLoadCallbacks; }
bool dumpHistoryDelegateCallbacks() const { return m_dumpHistoryDelegateCallbacks; }
void setDumpHistoryDelegateCallbacks(bool dumpHistoryDelegateCallbacks) { m_dumpHistoryDelegateCallbacks = dumpHistoryDelegateCallbacks; }
@@ -150,6 +179,9 @@ public:
bool dumpTitleChanges() const { return m_dumpTitleChanges; }
void setDumpTitleChanges(bool dumpTitleChanges) { m_dumpTitleChanges = dumpTitleChanges; }
+ bool dumpIconChanges() const { return m_dumpIconChanges; }
+ void setDumpIconChanges(bool dumpIconChanges) { m_dumpIconChanges = dumpIconChanges; }
+
bool dumpVisitedLinksCallback() const { return m_dumpVisitedLinksCallback; }
void setDumpVisitedLinksCallback(bool dumpVisitedLinksCallback) { m_dumpVisitedLinksCallback = dumpVisitedLinksCallback; }
@@ -184,6 +216,9 @@ public:
void setWaitToDump(bool waitToDump);
void waitToDumpWatchdogTimerFired();
+ const std::set<std::string>& willSendRequestClearHeaders() const { return m_willSendRequestClearHeaders; }
+ void setWillSendRequestClearHeader(std::string header) { m_willSendRequestClearHeaders.insert(header); }
+
bool willSendRequestReturnsNull() const { return m_willSendRequestReturnsNull; }
void setWillSendRequestReturnsNull(bool returnsNull) { m_willSendRequestReturnsNull = returnsNull; }
@@ -199,6 +234,9 @@ public:
bool handlesAuthenticationChallenges() const { return m_handlesAuthenticationChallenges; }
void setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges) { m_handlesAuthenticationChallenges = handlesAuthenticationChallenges; }
+ bool isPrinting() const { return m_isPrinting; }
+ void setIsPrinting(bool isPrinting) { m_isPrinting = isPrinting; }
+
const std::string& authenticationUsername() const { return m_authenticationUsername; }
void setAuthenticationUsername(std::string username) { m_authenticationUsername = username; }
@@ -208,6 +246,9 @@ public:
bool globalFlag() const { return m_globalFlag; }
void setGlobalFlag(bool globalFlag) { m_globalFlag = globalFlag; }
+ bool deferMainResourceDataLoad() const { return m_deferMainResourceDataLoad; }
+ void setDeferMainResourceDataLoad(bool flag) { m_deferMainResourceDataLoad = flag; }
+
const std::string& testPathOrURL() const { return m_testPathOrURL; }
const std::string& expectedPixelHash() const { return m_expectedPixelHash; }
@@ -215,16 +256,20 @@ public:
bool pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId);
bool sampleSVGAnimationForElementAtTime(JSStringRef animationId, double time, JSStringRef elementId);
unsigned numberOfActiveAnimations() const;
+ void suspendAnimations() const;
+ void resumeAnimations() const;
- void whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
+ void addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
+ void removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains);
- void addUserScript(JSStringRef source, bool runAtStart);
- void addUserStyleSheet(JSStringRef source);
+ void addUserScript(JSStringRef source, bool runAtStart, bool allFrames);
+ void addUserStyleSheet(JSStringRef source, bool allFrames);
void setGeolocationPermission(bool allow);
bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; }
bool geolocationPermission() const { return m_geolocationPermission; }
+ void setDeveloperExtrasEnabled(bool);
void showWebInspector();
void closeWebInspector();
void setTimelineProfilingEnabled(bool enabled);
@@ -233,7 +278,33 @@ public:
void setPOSIXLocale(JSStringRef locale);
+ void setWebViewEditable(bool);
+
+ void abortModal();
+
+ bool hasSpellingMarker(int from, int length);
+
+ // 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);
+ void apiTestGoToCurrentBackForwardItem();
+
+ // Simulate a request an embedding application could make, populating per-session credential storage.
+ void authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password);
+
+ JSRetainPtr<JSStringRef> layerTreeAsText() const;
+
+ JSRetainPtr<JSStringRef> markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const;
+
+ static const unsigned maxViewWidth;
+ static const unsigned maxViewHeight;
+
private:
+ LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash);
+
+ void setGeolocationPermissionCommon(bool allow);
+
+ bool m_dumpApplicationCacheDelegateCallbacks;
bool m_dumpAsPDF;
bool m_dumpAsText;
bool m_dumpBackForwardList;
@@ -243,6 +314,7 @@ private:
bool m_dumpDatabaseCallbacks;
bool m_dumpEditingCallbacks;
bool m_dumpFrameLoadCallbacks;
+ bool m_dumpUserGestureInFrameLoadCallbacks;
bool m_dumpHistoryDelegateCallbacks;
bool m_dumpResourceLoadCallbacks;
bool m_dumpResourceResponseMIMETypes;
@@ -250,8 +322,10 @@ private:
bool m_dumpSourceAsWebArchive;
bool m_dumpStatusCallbacks;
bool m_dumpTitleChanges;
+ bool m_dumpIconChanges;
bool m_dumpVisitedLinksCallback;
bool m_dumpWillCacheResponse;
+ bool m_generatePixelResults;
bool m_callCloseOnWebViews;
bool m_canOpenWindows;
bool m_closeRemainingWindowsWhenComplete;
@@ -269,11 +343,15 @@ private:
bool m_isGeolocationPermissionSet;
bool m_geolocationPermission;
bool m_handlesAuthenticationChallenges;
+ bool m_isPrinting;
+ bool m_deferMainResourceDataLoad;
std::string m_authenticationUsername;
std::string m_authenticationPassword;
std::string m_testPathOrURL;
std::string m_expectedPixelHash; // empty string if no hash
+
+ std::set<std::string> m_willSendRequestClearHeaders;
// origins which have been granted desktop notification access
std::vector<JSStringRef> m_desktopNotificationAllowedOrigins;
diff --git a/WebKitTools/DumpRenderTree/PixelDumpSupport.cpp b/WebKitTools/DumpRenderTree/PixelDumpSupport.cpp
index e38b2d4..352eaaa 100644
--- a/WebKitTools/DumpRenderTree/PixelDumpSupport.cpp
+++ b/WebKitTools/DumpRenderTree/PixelDumpSupport.cpp
@@ -27,12 +27,13 @@
*/
#include "config.h"
+#include "PixelDumpSupport.h"
+
#include "DumpRenderTree.h"
#include "LayoutTestController.h"
-#include "PixelDumpSupport.h"
+#include <cstdio>
#include <wtf/Assertions.h>
#include <wtf/RefPtr.h>
-#include <wtf/RetainPtr.h>
#if PLATFORM(CG)
#include "PixelDumpSupportCG.h"
@@ -42,7 +43,13 @@
void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash)
{
- RefPtr<BitmapContext> context = createBitmapContextFromWebView(gLayoutTestController->testOnscreen(), gLayoutTestController->testRepaint(), gLayoutTestController->testRepaintSweepHorizontally(), gLayoutTestController->dumpSelectionRect());
+ RefPtr<BitmapContext> context;
+#if PLATFORM(MAC)
+ if (gLayoutTestController->isPrinting())
+ context = createPagedBitmapContext();
+ else
+#endif
+ context = createBitmapContextFromWebView(gLayoutTestController->testOnscreen(), gLayoutTestController->testRepaint(), gLayoutTestController->testRepaintSweepHorizontally(), gLayoutTestController->dumpSelectionRect());
ASSERT(context);
// Compute the hash of the bitmap context pixels
diff --git a/WebKitTools/DumpRenderTree/PixelDumpSupport.h b/WebKitTools/DumpRenderTree/PixelDumpSupport.h
index 94c5312..e172a83 100644
--- a/WebKitTools/DumpRenderTree/PixelDumpSupport.h
+++ b/WebKitTools/DumpRenderTree/PixelDumpSupport.h
@@ -36,6 +36,7 @@
class BitmapContext;
void computeMD5HashStringForBitmapContext(BitmapContext*, char hashString[33]);
+PassRefPtr<BitmapContext> createPagedBitmapContext();
PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool incrementalRepaint, bool sweepHorizontally, bool drawSelectionRect);
void dumpBitmap(BitmapContext*);
void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash);
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
index e69da73..966ed2f 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2009 Holger Hans Peter Freyther
+ * Copyright (C) 2010 Collabora Ltd.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,13 +27,13 @@
#include "PluginObject.h"
+#include "PluginTest.h"
#include "TestObject.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
-
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
// Helper function which takes in the plugin window object for logging to the console object.
static void pluginLogWithWindowObject(NPObject* windowObject, NPP instance, const char* message)
@@ -98,11 +99,11 @@ static bool pluginHasMethod(NPObject*, NPIdentifier name);
static bool pluginGetProperty(NPObject*, NPIdentifier name, NPVariant*);
static bool pluginSetProperty(NPObject*, NPIdentifier name, const NPVariant*);
static bool pluginInvoke(NPObject*, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result);
-static bool pluginInvokeDefault(NPObject*, const NPVariant* args, uint32_t argCount, NPVariant* result);
static NPObject* pluginAllocate(NPP npp, NPClass*);
static void pluginDeallocate(NPObject*);
NPNetscapeFuncs* browser;
+NPPluginFuncs* pluginFunctions;
static NPClass pluginClass = {
NP_CLASS_STRUCT_VERSION,
@@ -111,13 +112,16 @@ static NPClass pluginClass = {
pluginInvalidate,
pluginHasMethod,
pluginInvoke,
- pluginInvokeDefault,
+ 0, // NPClass::invokeDefault,
pluginHasProperty,
pluginGetProperty,
pluginSetProperty,
+ 0, // NPClass::removeProperty
+ 0, // NPClass::enumerate
+ 0, // NPClass::construct
};
-NPClass *getPluginClass(void)
+NPClass* getPluginClass(void)
{
return &pluginClass;
}
@@ -131,9 +135,12 @@ enum {
ID_PROPERTY_TEST_OBJECT,
ID_PROPERTY_LOG_DESTROY,
ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM,
+ ID_PROPERTY_RETURN_NEGATIVE_ONE_FROM_WRITE,
ID_PROPERTY_PRIVATE_BROWSING_ENABLED,
ID_PROPERTY_CACHED_PRIVATE_BROWSING_ENABLED,
ID_PROPERTY_THROW_EXCEPTION_PROPERTY,
+ ID_LAST_SET_WINDOW_ARGUMENTS,
+ ID_PROPERTY_WINDOWED_PLUGIN,
NUM_PROPERTY_IDENTIFIERS
};
@@ -145,15 +152,18 @@ static const NPUTF8 *pluginPropertyIdentifierNames[NUM_PROPERTY_IDENTIFIERS] = {
"testObject",
"logDestroy",
"returnErrorFromNewStream",
+ "returnNegativeOneFromWrite",
"privateBrowsingEnabled",
"cachedPrivateBrowsingEnabled",
- "testThrowExceptionProperty"
+ "testThrowExceptionProperty",
+ "lastSetWindowArguments",
+ "windowedPlugin"
};
enum {
ID_TEST_CALLBACK_METHOD = 0,
+ ID_TEST_CALLBACK_METHOD_RETURN,
ID_TEST_GETURL,
- ID_REMOVE_DEFAULT_METHOD,
ID_TEST_DOM_ACCESS,
ID_TEST_GET_URL_NOTIFY,
ID_TEST_INVOKE_DEFAULT,
@@ -167,23 +177,33 @@ enum {
ID_TEST_GET_PROPERTY_RETURN_VALUE,
ID_TEST_IDENTIFIER_TO_STRING,
ID_TEST_IDENTIFIER_TO_INT,
+ ID_TEST_PASS_TEST_OBJECT,
ID_TEST_POSTURL_FILE,
ID_TEST_CONSTRUCT,
ID_TEST_THROW_EXCEPTION_METHOD,
ID_TEST_FAIL_METHOD,
+ ID_TEST_CLONE_OBJECT,
+ ID_TEST_SCRIPT_OBJECT_INVOKE,
ID_DESTROY_NULL_STREAM,
ID_TEST_RELOAD_PLUGINS_NO_PAGES,
ID_TEST_RELOAD_PLUGINS_AND_PAGES,
ID_TEST_GET_BROWSER_PROPERTY,
ID_TEST_SET_BROWSER_PROPERTY,
+ ID_REMEMBER,
+ ID_GET_REMEMBERED_OBJECT,
+ ID_GET_AND_FORGET_REMEMBERED_OBJECT,
+ ID_REF_COUNT,
+ ID_SET_STATUS,
+ ID_RESIZE_TO,
+ ID_NORMALIZE,
NUM_METHOD_IDENTIFIERS
};
static NPIdentifier pluginMethodIdentifiers[NUM_METHOD_IDENTIFIERS];
static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = {
"testCallback",
+ "testCallbackReturn",
"getURL",
- "removeDefaultMethod",
"testDOMAccess",
"getURLNotify",
"testInvokeDefault",
@@ -197,15 +217,25 @@ static const NPUTF8 *pluginMethodIdentifierNames[NUM_METHOD_IDENTIFIERS] = {
"testGetPropertyReturnValue",
"testIdentifierToString",
"testIdentifierToInt",
+ "testPassTestObject",
"testPostURLFile",
"testConstruct",
"testThrowException",
"testFail",
+ "testCloneObject",
+ "testScriptObjectInvoke",
"destroyNullStream",
"reloadPluginsNoPages",
"reloadPluginsAndPages",
"testGetBrowserProperty",
- "testSetBrowserProperty"
+ "testSetBrowserProperty",
+ "remember",
+ "getRememberedObject",
+ "getAndForgetRememberedObject",
+ "refCount",
+ "setStatus",
+ "resizeTo",
+ "normalize"
};
static NPUTF8* createCStringFromNPVariant(const NPVariant* variant)
@@ -243,37 +273,61 @@ 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]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_EVENT_LOGGING]) {
BOOLEAN_TO_NPVARIANT(plugin->eventLogging, *result);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_LOG_DESTROY]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_LOG_DESTROY]) {
BOOLEAN_TO_NPVARIANT(plugin->logDestroy, *result);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_HAS_STREAM]) {
- BOOLEAN_TO_NPVARIANT(plugin->stream != 0, *result);
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_HAS_STREAM]) {
+ BOOLEAN_TO_NPVARIANT(plugin->stream, *result);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_TEST_OBJECT]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_TEST_OBJECT]) {
NPObject* testObject = plugin->testObject;
browser->retainobject(testObject);
OBJECT_TO_NPVARIANT(testObject, *result);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) {
BOOLEAN_TO_NPVARIANT(plugin->returnErrorFromNewStream, *result);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_PRIVATE_BROWSING_ENABLED]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_NEGATIVE_ONE_FROM_WRITE]) {
+ BOOLEAN_TO_NPVARIANT(plugin->returnNegativeOneFromWrite, *result);
+ return true;
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_PRIVATE_BROWSING_ENABLED]) {
NPBool privateBrowsingEnabled = FALSE;
browser->getvalue(plugin->npp, NPNVprivateModeBool, &privateBrowsingEnabled);
BOOLEAN_TO_NPVARIANT(privateBrowsingEnabled, *result);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_CACHED_PRIVATE_BROWSING_ENABLED]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_CACHED_PRIVATE_BROWSING_ENABLED]) {
BOOLEAN_TO_NPVARIANT(plugin->cachedPrivateBrowsingMode, *result);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) {
browser->setexception(obj, "plugin object testThrowExceptionProperty SUCCESS");
return true;
}
+ if (name == pluginPropertyIdentifiers[ID_LAST_SET_WINDOW_ARGUMENTS]) {
+ char* buf = static_cast<char*>(browser->memalloc(256));
+ snprintf(buf, 256, "x: %d, y: %d, width: %u, height: %u, clipRect: (%u, %u, %u, %u)", (int)plugin->lastWindow.x, (int)plugin->lastWindow.y, (unsigned)plugin->lastWindow.width, (unsigned)plugin->lastWindow.height,
+ plugin->lastWindow.clipRect.left, plugin->lastWindow.clipRect.top, plugin->lastWindow.clipRect.right - plugin->lastWindow.clipRect.left, plugin->lastWindow.clipRect.bottom - plugin->lastWindow.clipRect.top);
+
+ STRINGZ_TO_NPVARIANT(buf, *result);
+ return true;
+ }
+
return false;
}
@@ -283,16 +337,27 @@ static bool pluginSetProperty(NPObject* obj, NPIdentifier name, const NPVariant*
if (name == pluginPropertyIdentifiers[ID_PROPERTY_EVENT_LOGGING]) {
plugin->eventLogging = NPVARIANT_TO_BOOLEAN(*variant);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_LOG_DESTROY]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_LOG_DESTROY]) {
plugin->logDestroy = NPVARIANT_TO_BOOLEAN(*variant);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_ERROR_FROM_NEWSTREAM]) {
plugin->returnErrorFromNewStream = NPVARIANT_TO_BOOLEAN(*variant);
return true;
- } else if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) {
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_RETURN_NEGATIVE_ONE_FROM_WRITE]) {
+ plugin->returnNegativeOneFromWrite = NPVARIANT_TO_BOOLEAN(*variant);
+ return true;
+ }
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_THROW_EXCEPTION_PROPERTY]) {
browser->setexception(obj, "plugin object testThrowExceptionProperty SUCCESS");
return true;
}
+ if (name == pluginPropertyIdentifiers[ID_PROPERTY_WINDOWED_PLUGIN]) {
+ browser->setvalue(plugin->npp, NPPVpluginWindowBool, (void *)NPVARIANT_TO_BOOLEAN(*variant));
+ return true;
+ }
return false;
}
@@ -332,7 +397,7 @@ static NPIdentifier stringVariantToIdentifier(NPVariant variant)
static NPIdentifier int32VariantToIdentifier(NPVariant variant)
{
assert(NPVARIANT_IS_INT32(variant));
- int32 integer = NPVARIANT_TO_INT32(variant);
+ int32_t integer = NPVARIANT_TO_INT32(variant);
return browser->getintidentifier(integer);
}
@@ -341,7 +406,7 @@ static NPIdentifier doubleVariantToIdentifier(NPVariant variant)
assert(NPVARIANT_IS_DOUBLE(variant));
double value = NPVARIANT_TO_DOUBLE(variant);
// Sadly there is no "getdoubleidentifier"
- int32 integer = static_cast<int32>(value);
+ int32_t integer = static_cast<int32_t>(value);
return browser->getintidentifier(integer);
}
@@ -349,9 +414,9 @@ static NPIdentifier variantToIdentifier(NPVariant variant)
{
if (NPVARIANT_IS_STRING(variant))
return stringVariantToIdentifier(variant);
- else if (NPVARIANT_IS_INT32(variant))
+ if (NPVARIANT_IS_INT32(variant))
return int32VariantToIdentifier(variant);
- else if (NPVARIANT_IS_DOUBLE(variant))
+ if (NPVARIANT_IS_DOUBLE(variant))
return doubleVariantToIdentifier(variant);
return 0;
}
@@ -377,14 +442,14 @@ static bool testIdentifierToInt(PluginObject*, const NPVariant* args, uint32_t a
NPIdentifier identifier = variantToIdentifier(args[0]);
if (!identifier)
return false;
- int32 integer = browser->intfromidentifier(identifier);
+ int32_t integer = browser->intfromidentifier(identifier);
INT32_TO_NPVARIANT(integer, *result);
return true;
}
-static bool testCallback(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+static bool testPassTestObject(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
{
- if (argCount == 0 || !NPVARIANT_IS_STRING(args[0]))
+ if (argCount != 2 || !NPVARIANT_IS_STRING(args[0]))
return false;
NPObject* windowScriptObject;
@@ -395,15 +460,64 @@ static bool testCallback(PluginObject* obj, const NPVariant* args, uint32_t argC
free(callbackString);
NPVariant browserResult;
- browser->invoke(obj->npp, windowScriptObject, callbackIdentifier, 0, 0, &browserResult);
+ browser->invoke(obj->npp, windowScriptObject, callbackIdentifier, &args[1], 1, &browserResult);
browser->releasevariantvalue(&browserResult);
+ VOID_TO_NPVARIANT(*result);
+ return true;
+}
+
+static bool testCallback(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+ if (!argCount || !NPVARIANT_IS_STRING(args[0]))
+ return false;
+
+ NPObject* windowScriptObject;
+ browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject);
+
+ NPUTF8* callbackString = createCStringFromNPVariant(&args[0]);
+ NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString);
+ free(callbackString);
+
+ NPVariant browserResult;
+ if (browser->invoke(obj->npp, windowScriptObject, callbackIdentifier, 0, 0, &browserResult))
+ browser->releasevariantvalue(&browserResult);
+
browser->releaseobject(windowScriptObject);
VOID_TO_NPVARIANT(*result);
return true;
}
+static bool testCallbackReturn(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+ if (argCount != 1 || !NPVARIANT_IS_STRING(args[0]))
+ return false;
+
+ NPObject* windowScriptObject;
+ browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject);
+
+ NPUTF8* callbackString = createCStringFromNPVariant(&args[0]);
+ NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString);
+ free(callbackString);
+
+ NPVariant callbackArgs[1];
+ OBJECT_TO_NPVARIANT(windowScriptObject, callbackArgs[0]);
+
+ NPVariant browserResult;
+ browser->invoke(obj->npp, windowScriptObject, callbackIdentifier,
+ callbackArgs, 1, &browserResult);
+
+ if (NPVARIANT_IS_OBJECT(browserResult))
+ OBJECT_TO_NPVARIANT(NPVARIANT_TO_OBJECT(browserResult), *result);
+ else {
+ browser->releasevariantvalue(&browserResult);
+ VOID_TO_NPVARIANT(*result);
+ }
+
+ return true;
+}
+
static bool getURL(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
{
if (argCount == 2 && NPVARIANT_IS_STRING(args[0]) && NPVARIANT_IS_STRING(args[1])) {
@@ -415,7 +529,8 @@ static bool getURL(PluginObject* obj, const NPVariant* args, uint32_t argCount,
INT32_TO_NPVARIANT(npErr, *result);
return true;
- } else if (argCount == 1 && NPVARIANT_IS_STRING(args[0])) {
+ }
+ if (argCount == 1 && NPVARIANT_IS_STRING(args[0])) {
NPUTF8* urlString = createCStringFromNPVariant(&args[0]);
NPError npErr = browser->geturl(obj->npp, urlString, 0);
free(urlString);
@@ -426,13 +541,6 @@ static bool getURL(PluginObject* obj, const NPVariant* args, uint32_t argCount,
return false;
}
-static bool removeDefaultMethod(PluginObject*, const NPVariant* args, uint32_t argCount, NPVariant* result)
-{
- pluginClass.invokeDefault = 0;
- VOID_TO_NPVARIANT(*result);
- return true;
-}
-
static bool getURLNotify(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
{
if (argCount != 3 || !NPVARIANT_IS_STRING(args[0])
@@ -441,7 +549,7 @@ static bool getURLNotify(PluginObject* obj, const NPVariant* args, uint32_t argC
return false;
NPUTF8* urlString = createCStringFromNPVariant(&args[0]);
- NPUTF8* targetString = (NPVARIANT_IS_STRING(args[1]) ? createCStringFromNPVariant(&args[1]) : NULL);
+ NPUTF8* targetString = (NPVARIANT_IS_STRING(args[1]) ? createCStringFromNPVariant(&args[1]) : 0);
NPUTF8* callbackString = createCStringFromNPVariant(&args[2]);
NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString);
@@ -460,7 +568,7 @@ static bool testInvokeDefault(PluginObject* obj, const NPVariant* args, uint32_t
if (!NPVARIANT_IS_OBJECT(args[0]))
return false;
- NPObject *callback = NPVARIANT_TO_OBJECT(args[0]);
+ NPObject* callback = NPVARIANT_TO_OBJECT(args[0]);
NPVariant invokeArgs[1];
NPVariant browserResult;
@@ -509,8 +617,8 @@ static bool testEnumerate(PluginObject* obj, const NPVariant* args, uint32_t arg
NPVariant args[1];
STRINGZ_TO_NPVARIANT(string, args[0]);
NPVariant browserResult;
- browser->invoke(obj->npp, outArray, pushIdentifier, args, 1, &browserResult);
- browser->releasevariantvalue(&browserResult);
+ if (browser->invoke(obj->npp, outArray, pushIdentifier, args, 1, &browserResult))
+ browser->releasevariantvalue(&browserResult);
browser->memfree(string);
}
@@ -527,16 +635,16 @@ static bool testGetIntIdentifier(PluginObject*, const NPVariant* args, uint32_t
return false;
NPIdentifier identifier = browser->getintidentifier((int)NPVARIANT_TO_DOUBLE(args[0]));
- INT32_TO_NPVARIANT((int32)(long long)identifier, *result);
+ INT32_TO_NPVARIANT((int32_t)(long long)identifier, *result);
return true;
}
static bool testGetProperty(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
{
- if (argCount == 0)
+ if (!argCount)
return false;
- NPObject *object;
+ NPObject* object;
browser->getvalue(obj->npp, NPNVWindowNPObject, &object);
for (uint32_t i = 0; i < argCount; i++) {
@@ -656,7 +764,9 @@ static bool testPostURLFile(PluginObject* obj, const NPVariant* args, uint32_t a
if (!tempFile)
return false;
- fwrite(contentsString.UTF8Characters, contentsString.UTF8Length, 1, tempFile);
+ if (!fwrite(contentsString.UTF8Characters, contentsString.UTF8Length, 1, tempFile))
+ return false;
+
fclose(tempFile);
NPError error = browser->posturl(obj->npp, url, target, pathString.UTF8Length, path, TRUE);
@@ -677,6 +787,58 @@ static bool testConstruct(PluginObject* obj, const NPVariant* args, uint32_t arg
return browser->construct(obj->npp, NPVARIANT_TO_OBJECT(args[0]), args + 1, argCount - 1, result);
}
+// Invoke a script callback to get a script NPObject. Then call a method on the
+// script NPObject passing it a freshly created NPObject.
+static bool testScriptObjectInvoke(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+ if (argCount != 2 || !NPVARIANT_IS_STRING(args[0]) || !NPVARIANT_IS_STRING(args[1]))
+ return false;
+ NPObject* windowScriptObject;
+ browser->getvalue(obj->npp, NPNVWindowNPObject, &windowScriptObject);
+
+ // Arg1 is the name of the callback
+ NPUTF8* callbackString = createCStringFromNPVariant(&args[0]);
+ NPIdentifier callbackIdentifier = browser->getstringidentifier(callbackString);
+ free(callbackString);
+
+ // Invoke a callback that returns a script object
+ NPVariant object_result;
+ browser->invoke(obj->npp, windowScriptObject, callbackIdentifier, &args[1], 1, &object_result);
+
+ // Script object returned
+ NPObject* script_object = object_result.value.objectValue;
+
+ // Arg2 is the name of the method to be called on the script object
+ NPUTF8* object_mehod_string = createCStringFromNPVariant(&args[1]);
+ NPIdentifier object_method = browser->getstringidentifier(object_mehod_string);
+ free(object_mehod_string);
+
+ // Create a fresh NPObject to be passed as an argument
+ NPObject* object_arg = browser->createobject(obj->npp, &pluginClass);
+ NPVariant invoke_args[1];
+ OBJECT_TO_NPVARIANT(object_arg, invoke_args[0]);
+
+ // Invoke the script method
+ NPVariant object_method_result;
+ browser->invoke(obj->npp, script_object, object_method, invoke_args, 1, &object_method_result);
+
+ browser->releasevariantvalue(&object_result);
+ VOID_TO_NPVARIANT(*result);
+ if (NPVARIANT_IS_OBJECT(object_method_result)) {
+ // Now return the callbacks return value back to our caller.
+ // BUG 897451: This should be the same as the
+ // windowScriptObject, but its not (in Chrome) - or at least, it
+ // has a different refcount. This means Chrome will delete the
+ // object before returning it and the calling JS gets a garbage
+ // value. Firefox handles it fine.
+ OBJECT_TO_NPVARIANT(NPVARIANT_TO_OBJECT(object_method_result), *result);
+ } else {
+ browser->releasevariantvalue(&object_method_result);
+ VOID_TO_NPVARIANT(*result);
+ }
+ return true;
+}
+
// Helper function to notify the layout test controller that the test completed.
void notifyTestCompletion(NPP npp, NPObject* object)
{
@@ -693,41 +855,51 @@ bool testDocumentOpen(NPP npp)
NPIdentifier documentId = browser->getstringidentifier("document");
NPIdentifier openId = browser->getstringidentifier("open");
- NPObject *windowObject = NULL;
+ NPObject* windowObject = 0;
browser->getvalue(npp, NPNVWindowNPObject, &windowObject);
if (!windowObject)
return false;
NPVariant docVariant;
browser->getproperty(npp, windowObject, documentId, &docVariant);
- if (docVariant.type != NPVariantType_Object)
+ if (docVariant.type != NPVariantType_Object) {
+ browser->releaseobject(windowObject);
return false;
+ }
- NPObject *documentObject = NPVARIANT_TO_OBJECT(docVariant);
+ NPObject* documentObject = NPVARIANT_TO_OBJECT(docVariant);
NPVariant openArgs[2];
STRINGZ_TO_NPVARIANT("text/html", openArgs[0]);
STRINGZ_TO_NPVARIANT("_blank", openArgs[1]);
NPVariant result;
- browser->invoke(npp, documentObject, openId, openArgs, 2, &result);
+ if (!browser->invoke(npp, documentObject, openId, openArgs, 2, &result)) {
+ browser->releaseobject(windowObject);
+ browser->releaseobject(documentObject);
+ return false;
+ }
+
browser->releaseobject(documentObject);
- if (result.type == NPVariantType_Object) {
- pluginLogWithWindowObjectVariableArgs(windowObject, npp, "DOCUMENT OPEN SUCCESS");
- notifyTestCompletion(npp, result.value.objectValue);
- browser->releaseobject(result.value.objectValue);
- return true;
+ if (result.type != NPVariantType_Object) {
+ browser->releaseobject(windowObject);
+ browser->releasevariantvalue(&result);
+ return false;
}
- return false;
+ pluginLogWithWindowObjectVariableArgs(windowObject, npp, "DOCUMENT OPEN SUCCESS");
+ notifyTestCompletion(npp, result.value.objectValue);
+ browser->releaseobject(result.value.objectValue);
+ browser->releaseobject(windowObject);
+ return true;
}
bool testWindowOpen(NPP npp)
{
NPIdentifier openId = browser->getstringidentifier("open");
- NPObject *windowObject = NULL;
+ NPObject* windowObject = 0;
browser->getvalue(npp, NPNVWindowNPObject, &windowObject);
if (!windowObject)
return false;
@@ -737,91 +909,190 @@ bool testWindowOpen(NPP npp)
STRINGZ_TO_NPVARIANT("_blank", openArgs[1]);
NPVariant result;
- browser->invoke(npp, windowObject, openId, openArgs, 2, &result);
- if (result.type == NPVariantType_Object) {
- pluginLogWithWindowObjectVariableArgs(windowObject, npp, "WINDOW OPEN SUCCESS");
- notifyTestCompletion(npp, result.value.objectValue);
- browser->releaseobject(result.value.objectValue);
- return true;
+ if (!browser->invoke(npp, windowObject, openId, openArgs, 2, &result)) {
+ browser->releaseobject(windowObject);
+ return false;
}
- return false;
+
+ if (result.type != NPVariantType_Object) {
+ browser->releaseobject(windowObject);
+ browser->releasevariantvalue(&result);
+ return false;
+ }
+
+ pluginLogWithWindowObjectVariableArgs(windowObject, npp, "WINDOW OPEN SUCCESS");
+ notifyTestCompletion(npp, result.value.objectValue);
+ browser->releaseobject(result.value.objectValue);
+ browser->releaseobject(windowObject);
+ return true;
}
+static bool testSetStatus(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+ char* message = 0;
+ if (argCount && NPVARIANT_IS_STRING(args[0])) {
+ NPString statusString = NPVARIANT_TO_STRING(args[0]);
+ message = toCString(statusString);
+ }
+
+ browser->status(obj->npp, message);
+
+ free(message);
+ return true;
+}
+
+static bool testResizeTo(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+ VOID_TO_NPVARIANT(*result);
+
+ NPObject* windowObject;
+ if (NPERR_NO_ERROR != browser->getvalue(obj->npp, NPNVWindowNPObject, &windowObject))
+ return false;
+
+ NPVariant callResult;
+ if (browser->invoke(obj->npp, windowObject, browser->getstringidentifier("resizePlugin"), args, argCount, &callResult))
+ browser->releasevariantvalue(&callResult);
+
+ // Force layout.
+ if (browser->getproperty(obj->npp, windowObject, browser->getstringidentifier("pageYOffset"), &callResult))
+ browser->releasevariantvalue(&callResult);
+
+ return true;
+}
+
+static bool normalizeOverride(PluginObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
+{
+ VOID_TO_NPVARIANT(*result);
+
+ NPObject* windowObject;
+ if (NPERR_NO_ERROR != browser->getvalue(obj->npp, NPNVWindowNPObject, &windowObject))
+ return false;
+
+ NPVariant callResult;
+ if (browser->invoke(obj->npp, windowObject, browser->getstringidentifier("pluginCallback"), args, argCount, &callResult))
+ browser->releasevariantvalue(&callResult);
+
+ return true;
+}
+
+
static bool pluginInvoke(NPObject* header, NPIdentifier name, const NPVariant* args, uint32_t argCount, NPVariant* result)
{
PluginObject* plugin = reinterpret_cast<PluginObject*>(header);
if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_METHOD])
return testCallback(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_GETURL])
+ if (name == pluginMethodIdentifiers[ID_TEST_CALLBACK_METHOD_RETURN])
+ return testCallbackReturn(plugin, args, argCount, result);
+ if (name == pluginMethodIdentifiers[ID_TEST_GETURL])
return getURL(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_REMOVE_DEFAULT_METHOD])
- return removeDefaultMethod(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_DOM_ACCESS])
+ if (name == pluginMethodIdentifiers[ID_TEST_DOM_ACCESS])
return testDOMAccess(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_GET_URL_NOTIFY])
+ if (name == pluginMethodIdentifiers[ID_TEST_GET_URL_NOTIFY])
return getURLNotify(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_INVOKE_DEFAULT])
+ if (name == pluginMethodIdentifiers[ID_TEST_INVOKE_DEFAULT])
return testInvokeDefault(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_ENUMERATE])
+ if (name == pluginMethodIdentifiers[ID_TEST_ENUMERATE])
return testEnumerate(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_DESTROY_STREAM])
+ if (name == pluginMethodIdentifiers[ID_DESTROY_STREAM])
return destroyStream(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_GETINTIDENTIFIER])
+ if (name == pluginMethodIdentifiers[ID_TEST_GETINTIDENTIFIER])
return testGetIntIdentifier(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_EVALUATE])
+ if (name == pluginMethodIdentifiers[ID_TEST_EVALUATE])
return testEvaluate(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY])
+ if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY])
return testGetProperty(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY_RETURN_VALUE])
+ if (name == pluginMethodIdentifiers[ID_TEST_GET_PROPERTY_RETURN_VALUE])
return testGetPropertyReturnValue(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_HAS_PROPERTY])
+ if (name == pluginMethodIdentifiers[ID_TEST_HAS_PROPERTY])
return testHasProperty(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_HAS_METHOD])
+ if (name == pluginMethodIdentifiers[ID_TEST_HAS_METHOD])
return testHasMethod(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_IDENTIFIER_TO_STRING])
+ if (name == pluginMethodIdentifiers[ID_TEST_IDENTIFIER_TO_STRING])
return testIdentifierToString(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_IDENTIFIER_TO_INT])
+ if (name == pluginMethodIdentifiers[ID_TEST_IDENTIFIER_TO_INT])
return testIdentifierToInt(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_POSTURL_FILE])
+ if (name == pluginMethodIdentifiers[ID_TEST_PASS_TEST_OBJECT])
+ return testPassTestObject(plugin, args, argCount, result);
+ if (name == pluginMethodIdentifiers[ID_TEST_POSTURL_FILE])
return testPostURLFile(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_CONSTRUCT])
+ if (name == pluginMethodIdentifiers[ID_TEST_CONSTRUCT])
return testConstruct(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_THROW_EXCEPTION_METHOD]) {
+ if (name == pluginMethodIdentifiers[ID_TEST_SCRIPT_OBJECT_INVOKE])
+ return testScriptObjectInvoke(plugin, args, argCount, result);
+ if (name == pluginMethodIdentifiers[ID_TEST_THROW_EXCEPTION_METHOD]) {
browser->setexception(header, "plugin object testThrowException SUCCESS");
return true;
- } else if (name == pluginMethodIdentifiers[ID_TEST_FAIL_METHOD]) {
+ }
+ if (name == pluginMethodIdentifiers[ID_TEST_FAIL_METHOD]) {
NPObject* windowScriptObject;
browser->getvalue(plugin->npp, NPNVWindowNPObject, &windowScriptObject);
browser->invoke(plugin->npp, windowScriptObject, name, args, argCount, result);
- } else if (name == pluginMethodIdentifiers[ID_DESTROY_NULL_STREAM])
+ return false;
+ }
+ if (name == pluginMethodIdentifiers[ID_TEST_CLONE_OBJECT]) {
+ NPObject* new_object = browser->createobject(plugin->npp, &pluginClass);
+ assert(new_object->referenceCount == 1);
+ OBJECT_TO_NPVARIANT(new_object, *result);
+ return true;
+ }
+ if (name == pluginMethodIdentifiers[ID_DESTROY_NULL_STREAM])
return destroyNullStream(plugin, args, argCount, result);
- else if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_NO_PAGES]) {
+ if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_NO_PAGES]) {
browser->reloadplugins(false);
return true;
- } else if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_AND_PAGES]) {
+ }
+ if (name == pluginMethodIdentifiers[ID_TEST_RELOAD_PLUGINS_AND_PAGES]) {
browser->reloadplugins(true);
return true;
- } else if (name == pluginMethodIdentifiers[ID_TEST_GET_BROWSER_PROPERTY]) {
+ }
+ if (name == pluginMethodIdentifiers[ID_TEST_GET_BROWSER_PROPERTY]) {
browser->getproperty(plugin->npp, NPVARIANT_TO_OBJECT(args[0]), stringVariantToIdentifier(args[1]), result);
return true;
- } else if (name == pluginMethodIdentifiers[ID_TEST_SET_BROWSER_PROPERTY]) {
+ }
+ if (name == pluginMethodIdentifiers[ID_TEST_SET_BROWSER_PROPERTY]) {
browser->setproperty(plugin->npp, NPVARIANT_TO_OBJECT(args[0]), stringVariantToIdentifier(args[1]), &args[2]);
return true;
}
-
- return false;
-}
+ if (name == pluginMethodIdentifiers[ID_REMEMBER]) {
+ if (plugin->rememberedObject)
+ browser->releaseobject(plugin->rememberedObject);
+ plugin->rememberedObject = NPVARIANT_TO_OBJECT(args[0]);
+ browser->retainobject(plugin->rememberedObject);
+ VOID_TO_NPVARIANT(*result);
+ return true;
+ }
+ if (name == pluginMethodIdentifiers[ID_GET_REMEMBERED_OBJECT]) {
+ assert(plugin->rememberedObject);
+ browser->retainobject(plugin->rememberedObject);
+ OBJECT_TO_NPVARIANT(plugin->rememberedObject, *result);
+ return true;
+ }
+ if (name == pluginMethodIdentifiers[ID_GET_AND_FORGET_REMEMBERED_OBJECT]) {
+ assert(plugin->rememberedObject);
+ OBJECT_TO_NPVARIANT(plugin->rememberedObject, *result);
+ plugin->rememberedObject = 0;
+ return true;
+ }
+ if (name == pluginMethodIdentifiers[ID_REF_COUNT]) {
+ uint32_t refCount = NPVARIANT_TO_OBJECT(args[0])->referenceCount;
+ INT32_TO_NPVARIANT(refCount, *result);
+ return true;
+ }
+ if (name == pluginMethodIdentifiers[ID_SET_STATUS])
+ return testSetStatus(plugin, args, argCount, result);
+ if (name == pluginMethodIdentifiers[ID_RESIZE_TO])
+ return testResizeTo(plugin, args, argCount, result);
+ if (name == pluginMethodIdentifiers[ID_NORMALIZE])
+ return normalizeOverride(plugin, args, argCount, result);
-static bool pluginInvokeDefault(NPObject* obj, const NPVariant* args, uint32_t argCount, NPVariant* result)
-{
- INT32_TO_NPVARIANT(1, *result);
- return true;
+ return false;
}
static void pluginInvalidate(NPObject* header)
{
PluginObject* plugin = reinterpret_cast<PluginObject*>(header);
plugin->testObject = 0;
+ plugin->rememberedObject = 0;
}
static NPObject *pluginAllocate(NPP npp, NPClass *theClass)
@@ -833,25 +1104,33 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass)
initializeIdentifiers();
}
+ newInstance->pluginTest = 0;
newInstance->npp = npp;
newInstance->testObject = browser->createobject(npp, getTestClass());
+ newInstance->rememberedObject = 0;
newInstance->eventLogging = FALSE;
newInstance->onStreamLoad = 0;
newInstance->onStreamDestroy = 0;
newInstance->onDestroy = 0;
newInstance->onURLNotify = 0;
+ newInstance->onSetWindow = 0;
newInstance->logDestroy = FALSE;
newInstance->logSetWindow = FALSE;
newInstance->returnErrorFromNewStream = FALSE;
+ newInstance->returnNegativeOneFromWrite = FALSE;
newInstance->stream = 0;
- newInstance->firstUrl = NULL;
- newInstance->firstHeaders = NULL;
- newInstance->lastUrl = NULL;
- newInstance->lastHeaders = NULL;
+ newInstance->firstUrl = 0;
+ newInstance->firstHeaders = 0;
+ newInstance->lastUrl = 0;
+ newInstance->lastHeaders = 0;
- newInstance->testDocumentOpenInDestroyStream = FALSE;
+ newInstance->testGetURLOnDestroy = FALSE;
newInstance->testWindowOpen = FALSE;
+ newInstance->testKeyboardFocusForPlugins = FALSE;
+
+ newInstance->mouseDownForEvaluateScript = FALSE;
+ newInstance->evaluateScriptOnMouseDownOrKeyDown = 0;
return (NPObject*)newInstance;
}
@@ -859,8 +1138,11 @@ static NPObject *pluginAllocate(NPP npp, NPClass *theClass)
static void pluginDeallocate(NPObject* header)
{
PluginObject* plugin = reinterpret_cast<PluginObject*>(header);
+ delete plugin->pluginTest;
if (plugin->testObject)
browser->releaseobject(plugin->testObject);
+ if (plugin->rememberedObject)
+ browser->releaseobject(plugin->rememberedObject);
free(plugin->firstUrl);
free(plugin->firstHeaders);
@@ -875,14 +1157,14 @@ void handleCallback(PluginObject* object, const char *url, NPReason reason, void
NPVariant args[2];
- NPObject *windowScriptObject;
+ NPObject* windowScriptObject;
browser->getvalue(object->npp, NPNVWindowNPObject, &windowScriptObject);
NPIdentifier callbackIdentifier = notifyData;
INT32_TO_NPVARIANT(reason, args[0]);
- char *strHdr = NULL;
+ char* strHdr = 0;
if (object->firstUrl && object->firstHeaders && object->lastUrl && object->lastHeaders) {
// Format expected by JavaScript validator: four fields separated by \n\n:
// First URL; first header block; last URL; last header block.
@@ -899,15 +1181,15 @@ void handleCallback(PluginObject* object, const char *url, NPReason reason, void
NULL_TO_NPVARIANT(args[1]);
NPVariant browserResult;
- browser->invoke(object->npp, windowScriptObject, callbackIdentifier, args, 2, &browserResult);
- browser->releasevariantvalue(&browserResult);
+ if (browser->invoke(object->npp, windowScriptObject, callbackIdentifier, args, 2, &browserResult))
+ browser->releasevariantvalue(&browserResult);
free(strHdr);
}
void notifyStream(PluginObject* object, const char *url, const char *headers)
{
- if (object->firstUrl == NULL) {
+ if (!object->firstUrl) {
if (url)
object->firstUrl = strdup(url);
if (headers)
@@ -915,8 +1197,8 @@ void notifyStream(PluginObject* object, const char *url, const char *headers)
} else {
free(object->lastUrl);
free(object->lastHeaders);
- object->lastUrl = (url ? strdup(url) : NULL);
- object->lastHeaders = (headers ? strdup(headers) : NULL);
+ object->lastUrl = (url ? strdup(url) : 0);
+ object->lastHeaders = (headers ? strdup(headers) : 0);
}
}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h
index 157a1d2..def8ad8 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h
@@ -23,34 +23,62 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#ifndef PluginObject_h
+#define PluginObject_h
+
#include <WebKit/npfunctions.h>
+#if defined(XP_MACOSX)
+#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
+#define BUILDING_ON_TIGER 1
+#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
+#define BUILDING_ON_LEOPARD 1
+#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+#define BUILDING_ON_SNOW_LEOPARD 1
+#endif
+#endif // XP_MACOSX
+
+class PluginTest;
+
extern NPNetscapeFuncs *browser;
+extern NPPluginFuncs* pluginFunctions;
typedef struct {
NPObject header;
+ PluginTest* pluginTest;
+
NPP npp;
NPBool eventLogging;
NPBool logSetWindow;
NPBool logDestroy;
+ NPBool returnNegativeOneFromWrite;
NPBool returnErrorFromNewStream;
NPBool cachedPrivateBrowsingMode;
NPObject* testObject;
+ NPObject* rememberedObject;
NPStream* stream;
- NPBool testDocumentOpenInDestroyStream;
+ NPBool testGetURLOnDestroy;
NPBool testWindowOpen;
+ NPBool testKeyboardFocusForPlugins;
+ NPBool mouseDownForEvaluateScript;
char* onStreamLoad;
char* onStreamDestroy;
char* onDestroy;
char* onURLNotify;
+ char* onSetWindow;
char* firstUrl;
char* firstHeaders;
char* lastUrl;
char* lastHeaders;
+ char* evaluateScriptOnMouseDownOrKeyDown;
#ifdef XP_MACOSX
NPEventModel eventModel;
#endif
+#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+ void* coreAnimationLayer;
+#endif
+ NPWindow lastWindow;
} PluginObject;
extern NPClass *getPluginClass(void);
@@ -60,3 +88,9 @@ extern void testNPRuntime(NPP npp);
extern void pluginLog(NPP instance, const char* format, ...);
extern bool testDocumentOpen(NPP npp);
extern bool testWindowOpen(NPP npp);
+
+#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+extern void* createCoreAnimationLayer();
+#endif
+
+#endif // PluginObject_h
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm
new file mode 100644
index 0000000..3aff46d
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObjectMac.mm
@@ -0,0 +1,102 @@
+/*
+ * 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 COMPUTER, 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 "PluginObject.h"
+
+#if !defined(BUILDING_ON_TIGER)
+
+#include <QuartzCore/QuartzCore.h>
+
+@interface TestPluginLayer : CALayer
+@end
+
+@implementation TestPluginLayer
+
+- (void)drawInContext:(CGContextRef)context
+{
+ CGRect bounds = [self bounds];
+ const char* text = "Test Plug-in";
+ CGContextSelectFont(context, "Helvetica", 24, kCGEncodingMacRoman);
+ CGContextShowTextAtPoint(context, bounds.origin.x + 3.0f, bounds.origin.y + bounds.size.height - 30.0f, text, strlen(text));
+}
+
+@end
+
+void* createCoreAnimationLayer()
+{
+ CALayer *caLayer = [[TestPluginLayer alloc] init];
+
+ NSNull *nullValue = [NSNull null];
+ NSDictionary *actions = [NSDictionary dictionaryWithObjectsAndKeys:
+ nullValue, @"anchorPoint",
+ nullValue, @"bounds",
+ nullValue, @"contents",
+ nullValue, @"contentsRect",
+ nullValue, @"opacity",
+ nullValue, @"position",
+ nullValue, @"shadowColor",
+ nullValue, @"sublayerTransform",
+ nullValue, @"sublayers",
+ nullValue, @"transform",
+ nullValue, @"zPosition",
+ nil];
+ // Turn off default animations.
+ [caLayer setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]];
+ [caLayer setNeedsDisplayOnBoundsChange:YES];
+
+ [caLayer setBounds:CGRectMake(0, 0, 200, 100)];
+ [caLayer setAnchorPoint:CGPointZero];
+
+ CGColorRef color = CGColorCreateGenericRGB(0.5, 0.5, 1, 1);
+ [caLayer setBackgroundColor:color];
+ CGColorRelease(color);
+
+ [caLayer setLayoutManager:[CAConstraintLayoutManager layoutManager]];
+
+ CALayer *sublayer = [CALayer layer];
+ // Turn off default animations.
+ [sublayer setStyle:[NSDictionary dictionaryWithObject:actions forKey:@"actions"]];
+
+ color = CGColorCreateGenericRGB(0, 0, 0, 0.75);
+ [sublayer setBackgroundColor:color];
+ CGColorRelease(color);
+ [sublayer setBounds:CGRectMake(0, 0, 180, 20)];
+
+ [sublayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinY
+ relativeTo:@"superlayer"
+ attribute:kCAConstraintMinY]];
+ [sublayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMinX
+ relativeTo:@"superlayer"
+ attribute:kCAConstraintMinX]];
+ [sublayer addConstraint:[CAConstraint constraintWithAttribute:kCAConstraintMaxX
+ relativeTo:@"superlayer"
+ attribute:kCAConstraintMaxX]];
+
+ [caLayer addSublayer:sublayer];
+ return caLayer;
+}
+
+#endif // !defined(BUILDING_ON_TIGER)
+
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
new file mode 100644
index 0000000..06c9953
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp
@@ -0,0 +1,140 @@
+/*
+ * 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 "PluginTest.h"
+
+#include <assert.h>
+#include <string.h>
+
+using namespace std;
+extern NPNetscapeFuncs *browser;
+
+PluginTest* PluginTest::create(NPP npp, const string& identifier)
+{
+ CreateTestFunction createTestFunction = createTestFunctions()[identifier];
+ if (createTestFunction)
+ return createTestFunction(npp, identifier);
+
+ return new PluginTest(npp, identifier);
+}
+
+PluginTest::PluginTest(NPP npp, const string& identifier)
+ : m_npp(npp)
+ , m_identifier(identifier)
+{
+}
+
+PluginTest::~PluginTest()
+{
+}
+
+NPError PluginTest::NPP_Destroy(NPSavedData**)
+{
+ return NPERR_NO_ERROR;
+}
+
+NPError PluginTest::NPP_DestroyStream(NPStream *stream, NPReason reason)
+{
+ return NPERR_NO_ERROR;
+}
+
+NPError PluginTest::NPP_GetValue(NPPVariable variable, void *value)
+{
+ // We don't know anything about plug-in values so just return NPERR_GENERIC_ERROR.
+ return NPERR_GENERIC_ERROR;
+}
+
+NPError PluginTest::NPP_SetWindow(NPP, NPWindow*)
+{
+ return NPERR_NO_ERROR;
+}
+
+void PluginTest::NPN_InvalidateRect(NPRect* invalidRect)
+{
+ browser->invalidaterect(m_npp, invalidRect);
+}
+
+NPIdentifier PluginTest::NPN_GetStringIdentifier(const NPUTF8 *name)
+{
+ return browser->getstringidentifier(name);
+}
+
+NPIdentifier PluginTest::NPN_GetIntIdentifier(int32_t intid)
+{
+ return browser->getintidentifier(intid);
+}
+
+NPError PluginTest::NPN_GetValue(NPNVariable variable, void* value)
+{
+ return browser->getvalue(m_npp, variable, value);
+}
+
+NPObject* PluginTest::NPN_CreateObject(NPClass* npClass)
+{
+ return browser->createobject(m_npp, npClass);
+}
+
+bool PluginTest::NPN_RemoveProperty(NPObject* npObject, NPIdentifier propertyName)
+{
+ return browser->removeproperty(m_npp, npObject, propertyName);
+}
+
+void PluginTest::executeScript(const char* script)
+{
+ NPObject* windowScriptObject;
+ browser->getvalue(m_npp, NPNVWindowNPObject, &windowScriptObject);
+
+ NPString npScript;
+ npScript.UTF8Characters = script;
+ npScript.UTF8Length = strlen(script);
+
+ NPVariant browserResult;
+ browser->evaluate(m_npp, windowScriptObject, &npScript, &browserResult);
+ browser->releasevariantvalue(&browserResult);
+}
+
+void PluginTest::waitUntilDone()
+{
+ executeScript("layoutTestController.waitUntilDone()");
+}
+
+void PluginTest::notifyDone()
+{
+ executeScript("layoutTestController.notifyDone()");
+}
+
+void PluginTest::registerCreateTestFunction(const string& identifier, CreateTestFunction createTestFunction)
+{
+ assert(!createTestFunctions().count(identifier));
+
+ createTestFunctions()[identifier] = createTestFunction;
+}
+
+std::map<std::string, PluginTest::CreateTestFunction>& PluginTest::createTestFunctions()
+{
+ static std::map<std::string, CreateTestFunction> testFunctions;
+
+ return testFunctions;
+}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
new file mode 100644
index 0000000..ae9bd82
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h
@@ -0,0 +1,221 @@
+/*
+ * 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 PluginTest_h
+#define PluginTest_h
+
+#include <WebKit/npfunctions.h>
+#include <assert.h>
+#include <map>
+#include <string>
+
+// Helper classes for implementing has_member
+typedef char (&no_tag)[1];
+typedef char (&yes_tag)[2];
+
+#define DEFINE_HAS_MEMBER_CHECK(member, returnType, argumentTypes) \
+template<typename T, returnType (T::*member) argumentTypes> struct pmf_##member##_helper {}; \
+template<typename T> no_tag has_member_##member##_helper(...); \
+template<typename T> yes_tag has_member_##member##_helper(pmf_##member##_helper<T, &T::member >*); \
+template<typename T> struct has_member_##member { \
+static const bool value = sizeof(has_member_##member##_helper<T>(0)) == sizeof(yes_tag); \
+};
+
+DEFINE_HAS_MEMBER_CHECK(hasMethod, bool, (NPIdentifier methodName));
+DEFINE_HAS_MEMBER_CHECK(invoke, bool, (NPIdentifier methodName, const NPVariant*, uint32_t, NPVariant* result));
+DEFINE_HAS_MEMBER_CHECK(invokeDefault, bool, (const NPVariant*, uint32_t, NPVariant* result));
+DEFINE_HAS_MEMBER_CHECK(hasProperty, bool, (NPIdentifier propertyName));
+DEFINE_HAS_MEMBER_CHECK(getProperty, bool, (NPIdentifier propertyName, NPVariant* result));
+
+class PluginTest {
+public:
+ static PluginTest* create(NPP, const std::string& identifier);
+ virtual ~PluginTest();
+
+ // NPP functions.
+ virtual NPError NPP_Destroy(NPSavedData**);
+ virtual NPError NPP_DestroyStream(NPStream* stream, NPReason reason);
+ virtual NPError NPP_GetValue(NPPVariable, void* value);
+ virtual NPError NPP_SetWindow(NPP, NPWindow*);
+
+ // NPN functions.
+ void NPN_InvalidateRect(NPRect* invalidRect);
+ NPIdentifier NPN_GetStringIdentifier(const NPUTF8* name);
+ NPIdentifier NPN_GetIntIdentifier(int32_t intid);
+ NPError NPN_GetValue(NPNVariable, void* value);
+ NPObject* NPN_CreateObject(NPClass*);
+ bool NPN_RemoveProperty(NPObject*, NPIdentifier propertyName);
+
+ void executeScript(const char*);
+
+ template<typename TestClassTy> class Register {
+ public:
+ Register(const std::string& identifier)
+ {
+ registerCreateTestFunction(identifier, Register::create);
+ }
+
+ private:
+ static PluginTest* create(NPP npp, const std::string& identifier)
+ {
+ return new TestClassTy(npp, identifier);
+ }
+ };
+
+protected:
+ PluginTest(NPP npp, const std::string& identifier);
+
+ // FIXME: A plug-in test shouldn't need to know about it's NPP. Make this private.
+ NPP m_npp;
+
+ const std::string& identifier() const { return m_identifier; }
+
+ void waitUntilDone();
+ void notifyDone();
+
+ // NPObject helper template.
+ template<typename T> struct Object : NPObject {
+ public:
+ static NPObject* create(PluginTest* pluginTest)
+ {
+ Object* object = static_cast<Object*>(pluginTest->NPN_CreateObject(npClass()));
+
+ object->m_pluginTest = pluginTest;
+ return object;
+ }
+
+ // These should never be called.
+ bool hasMethod(NPIdentifier methodName)
+ {
+ assert(false);
+ return false;
+ }
+
+ bool invoke(NPIdentifier methodName, const NPVariant*, uint32_t, NPVariant* result)
+ {
+ assert(false);
+ return false;
+ }
+
+ bool invokeDefault(const NPVariant*, uint32_t, NPVariant* result)
+ {
+ assert(false);
+ return false;
+ }
+
+ bool hasProperty(NPIdentifier propertyName)
+ {
+ assert(false);
+ return false;
+ }
+
+ bool getProperty(NPIdentifier propertyName, NPVariant* result)
+ {
+ assert(false);
+ return false;
+ }
+
+ protected:
+ Object()
+ : m_pluginTest(0)
+ {
+ }
+
+ virtual ~Object()
+ {
+ }
+
+ PluginTest* pluginTest() const { return m_pluginTest; }
+
+ private:
+ static NPObject* NP_Allocate(NPP npp, NPClass* aClass)
+ {
+ return new T;
+ }
+
+ static void NP_Deallocate(NPObject* npObject)
+ {
+ delete static_cast<T*>(npObject);
+ }
+
+ static bool NP_HasMethod(NPObject* npObject, NPIdentifier methodName)
+ {
+ return static_cast<T*>(npObject)->hasMethod(methodName);
+ }
+
+ static bool NP_Invoke(NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
+ {
+ return static_cast<T*>(npObject)->invoke(methodName, arguments, argumentCount, result);
+ }
+
+ static bool NP_InvokeDefault(NPObject* npObject, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
+ {
+ return static_cast<T*>(npObject)->invokeDefault(arguments, argumentCount, result);
+ }
+
+ static bool NP_HasProperty(NPObject* npObject, NPIdentifier propertyName)
+ {
+ return static_cast<T*>(npObject)->hasProperty(propertyName);
+ }
+
+ static bool NP_GetProperty(NPObject* npObject, NPIdentifier propertyName, NPVariant* result)
+ {
+ return static_cast<T*>(npObject)->getProperty(propertyName, result);
+ }
+
+ static NPClass* npClass()
+ {
+ static NPClass npClass = {
+ NP_CLASS_STRUCT_VERSION,
+ NP_Allocate,
+ NP_Deallocate,
+ 0, // NPClass::invalidate
+ has_member_hasMethod<T>::value ? NP_HasMethod : 0,
+ has_member_invoke<T>::value ? NP_Invoke : 0,
+ has_member_invokeDefault<T>::value ? NP_InvokeDefault : 0,
+ has_member_hasProperty<T>::value ? NP_HasProperty : 0,
+ has_member_getProperty<T>::value ? NP_GetProperty : 0,
+ 0, // NPClass::setProperty
+ 0, // NPClass::removeProperty
+ 0, // NPClass::enumerate
+ 0 // NPClass::construct
+ };
+
+ return &npClass;
+ };
+
+ PluginTest* m_pluginTest;
+ };
+
+private:
+ typedef PluginTest* (*CreateTestFunction)(NPP, const std::string&);
+
+ static void registerCreateTestFunction(const std::string&, CreateTestFunction);
+ static std::map<std::string, CreateTestFunction>& createTestFunctions();
+
+ std::string m_identifier;
+};
+
+#endif // PluginTest_h
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp
index 0b32191..8946c0e 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp
@@ -59,18 +59,29 @@ NPClass *getTestClass(void)
return &testClass;
}
-static bool identifiersInitialized = false;
+typedef struct {
+ NPObject header;
+ NPObject* testObject;
+} TestObject;
-#define ID_OBJECT_POINTER 2
+static bool identifiersInitialized = false;
#define NUM_ENUMERATABLE_TEST_IDENTIFIERS 2
-#define NUM_TEST_IDENTIFIERS 3
+
+enum {
+ ID_PROPERTY_FOO = 0,
+ ID_PROPERTY_BAR,
+ ID_PROPERTY_OBJECT_POINTER,
+ ID_PROPERTY_TEST_OBJECT,
+ NUM_TEST_IDENTIFIERS,
+};
static NPIdentifier testIdentifiers[NUM_TEST_IDENTIFIERS];
static const NPUTF8 *testIdentifierNames[NUM_TEST_IDENTIFIERS] = {
"foo",
"bar",
"objectPointer",
+ "testObject",
};
#define ID_THROW_EXCEPTION_METHOD 0
@@ -87,20 +98,24 @@ static void initializeIdentifiers(void)
browser->getstringidentifiers(testMethodIdentifierNames, NUM_METHOD_IDENTIFIERS, testMethodIdentifiers);
}
-static NPObject *testAllocate(NPP /*npp*/, NPClass* /*theClass*/)
+static NPObject* testAllocate(NPP /*npp*/, NPClass* /*theClass*/)
{
- NPObject *newInstance = static_cast<NPObject*>(malloc(sizeof(NPObject)));
-
+ TestObject* newInstance = static_cast<TestObject*>(malloc(sizeof(TestObject)));
+ newInstance->testObject = 0;
+
if (!identifiersInitialized) {
identifiersInitialized = true;
initializeIdentifiers();
}
-
- return newInstance;
+
+ return reinterpret_cast<NPObject*>(newInstance);
}
static void testDeallocate(NPObject *obj)
{
+ TestObject* testObject = reinterpret_cast<TestObject*>(obj);
+ if (testObject->testObject)
+ browser->releaseobject(testObject->testObject);
free(obj);
}
@@ -134,17 +149,30 @@ static bool testHasProperty(NPObject*, NPIdentifier name)
static bool testGetProperty(NPObject* npobj, NPIdentifier name, NPVariant* result)
{
- if (name == testIdentifiers[ID_OBJECT_POINTER]) {
+ if (name == testIdentifiers[ID_PROPERTY_FOO]) {
+ char* mem = static_cast<char*>(browser->memalloc(4));
+ strcpy(mem, "foo");
+ STRINGZ_TO_NPVARIANT(mem, *result);
+ return true;
+ }
+ if (name == testIdentifiers[ID_PROPERTY_OBJECT_POINTER]) {
int32_t objectPointer = static_cast<int32_t>(reinterpret_cast<long long>(npobj));
INT32_TO_NPVARIANT(objectPointer, *result);
return true;
}
+ if (name == testIdentifiers[ID_PROPERTY_TEST_OBJECT]) {
+ TestObject* testObject = reinterpret_cast<TestObject*>(npobj);
+ if (!testObject->testObject)
+ testObject->testObject = browser->createobject(0, &testClass);
+ browser->retainobject(testObject->testObject);
+ OBJECT_TO_NPVARIANT(testObject->testObject, *result);
+ return true;
+ }
return false;
}
-
static bool testEnumerate(NPObject* /*npobj*/, NPIdentifier **value, uint32_t *count)
{
*count = NUM_ENUMERATABLE_TEST_IDENTIFIERS;
@@ -163,5 +191,3 @@ static bool testConstruct(NPObject* npobj, const NPVariant* /*args*/, uint32_t /
OBJECT_TO_NPVARIANT(npobj, *result);
return true;
}
-
-
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.h
index 1295fb7..1295fb7 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.h
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp
new file mode 100644
index 0000000..69e706e
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp
@@ -0,0 +1,56 @@
+/*
+ * 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 "PluginTest.h"
+
+using namespace std;
+
+extern bool testDocumentOpen(NPP npp);
+
+// Call document.open from NPP_DestroyStream.
+
+class DocumentOpenInDestroyStream : public PluginTest {
+public:
+ DocumentOpenInDestroyStream(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_shouldOpen(true)
+ {
+ }
+
+private:
+ virtual NPError NPP_DestroyStream(NPStream*, NPReason)
+ {
+ if (m_shouldOpen) {
+ testDocumentOpen(m_npp);
+ m_shouldOpen = false;
+ }
+
+ return NPERR_NO_ERROR;
+ }
+
+ bool m_shouldOpen;
+};
+
+static PluginTest::Register<DocumentOpenInDestroyStream> documentOpenInDestroyStream("document-open-in-destroy-stream");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp
new file mode 100644
index 0000000..4b5d3e0
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp
@@ -0,0 +1,64 @@
+/*
+ * 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 "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Executing JS after removing the plugin element from the document should not crash.
+
+class EvaluateJSAfterRemovingPluginElement : public PluginTest {
+public:
+ EvaluateJSAfterRemovingPluginElement(NPP, const string& identifier);
+
+private:
+ virtual NPError NPP_DestroyStream(NPStream*, NPReason);
+
+ bool m_didExecuteScript;
+};
+
+static PluginTest::Register<EvaluateJSAfterRemovingPluginElement> registrar("evaluate-js-after-removing-plugin-element");
+
+EvaluateJSAfterRemovingPluginElement::EvaluateJSAfterRemovingPluginElement(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_didExecuteScript(false)
+{
+ waitUntilDone();
+}
+
+NPError EvaluateJSAfterRemovingPluginElement::NPP_DestroyStream(NPStream*, NPReason)
+{
+ if (m_didExecuteScript)
+ return NPERR_NO_ERROR;
+ m_didExecuteScript = true;
+
+ executeScript("var plugin = document.getElementsByTagName('embed')[0]; plugin.parentElement.removeChild(plugin);");
+ executeScript("document.body.appendChild(document.createTextNode('Executing script after removing the plugin element from the document succeeded.'));");
+ notifyDone();
+
+ return NPERR_NO_ERROR;
+}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp
new file mode 100644
index 0000000..38236e3
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp
@@ -0,0 +1,72 @@
+/*
+ * 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 "PluginTest.h"
+
+using namespace std;
+
+class NPRuntimeObjectFromDestroyedPlugin : public PluginTest {
+public:
+ NPRuntimeObjectFromDestroyedPlugin(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ {
+ }
+
+private:
+ // This is the test object.
+ class TestObject : public Object<TestObject> { };
+
+ // This is the scriptable object. It has a single "testObject" property.
+ class ScriptableObject : public Object<ScriptableObject> {
+ public:
+ bool hasProperty(NPIdentifier propertyName)
+ {
+ return propertyName == pluginTest()->NPN_GetStringIdentifier("testObject");
+ }
+
+ bool getProperty(NPIdentifier propertyName, NPVariant* result)
+ {
+ if (propertyName != pluginTest()->NPN_GetStringIdentifier("testObject"))
+ return false;
+
+ NPObject* testObject = TestObject::create(pluginTest());
+ OBJECT_TO_NPVARIANT(testObject, *result);
+ return true;
+ }
+ };
+
+ virtual NPError NPP_GetValue(NPPVariable variable, void *value)
+ {
+ if (variable != NPPVpluginScriptableNPObject)
+ return NPERR_GENERIC_ERROR;
+
+ *(NPObject**)value = ScriptableObject::create(this);
+
+ return NPERR_NO_ERROR;
+ }
+};
+
+static PluginTest::Register<NPRuntimeObjectFromDestroyedPlugin> npRuntimeObjectFromDestroyedPlugin("npruntime-object-from-destroyed-plugin");
+
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp
new file mode 100644
index 0000000..4d417d1
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp
@@ -0,0 +1,89 @@
+/*
+ * 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 "PluginTest.h"
+
+using namespace std;
+
+
+class NPRuntimeRemoveProperty : public PluginTest {
+public:
+ NPRuntimeRemoveProperty(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ {
+ }
+
+private:
+ struct TestObject : Object<TestObject> {
+ public:
+ bool hasMethod(NPIdentifier methodName)
+ {
+ return methodName == pluginTest()->NPN_GetStringIdentifier("testRemoveProperty");
+ }
+
+ bool invoke(NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, NPVariant* result)
+ {
+ assert(methodName == pluginTest()->NPN_GetStringIdentifier("testRemoveProperty"));
+
+ if (argumentCount != 2)
+ return false;
+
+ if (!NPVARIANT_IS_OBJECT(arguments[0]))
+ return false;
+
+ if (!NPVARIANT_IS_STRING(arguments[1]) && !NPVARIANT_IS_DOUBLE(arguments[1]))
+ return false;
+
+ NPIdentifier propertyName;
+ if (NPVARIANT_IS_STRING(arguments[1])) {
+ string propertyNameString(arguments[1].value.stringValue.UTF8Characters,
+ arguments[1].value.stringValue.UTF8Length);
+
+ propertyName = pluginTest()->NPN_GetStringIdentifier(propertyNameString.c_str());
+ } else {
+ int32_t number = arguments[1].value.doubleValue;
+ propertyName = pluginTest()->NPN_GetIntIdentifier(number);
+ }
+
+ pluginTest()->NPN_RemoveProperty(NPVARIANT_TO_OBJECT(arguments[0]), propertyName);
+
+ VOID_TO_NPVARIANT(*result);
+ return true;
+ }
+ };
+
+ virtual NPError NPP_GetValue(NPPVariable variable, void *value)
+ {
+ if (variable != NPPVpluginScriptableNPObject)
+ return NPERR_GENERIC_ERROR;
+
+ *(NPObject**)value = TestObject::create(this);
+
+ return NPERR_NO_ERROR;
+ }
+
+};
+
+static PluginTest::Register<NPRuntimeRemoveProperty> npRuntimeRemoveProperty("npruntime-remove-property");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp
new file mode 100644
index 0000000..9e4e976
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp
@@ -0,0 +1,70 @@
+/*
+ * 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 "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Passing null for our NPP_GetValue function pointer should not crash.
+
+class NullNPPGetValuePointer : public PluginTest {
+public:
+ NullNPPGetValuePointer(NPP, const string& identifier);
+
+private:
+ virtual NPError NPP_Destroy(NPSavedData**);
+ virtual NPError NPP_GetValue(NPPVariable, void* value);
+
+ NPP_GetValueProcPtr m_originalNPPGetValuePointer;
+};
+
+static PluginTest::Register<NullNPPGetValuePointer> registrar("null-npp-getvalue-pointer");
+
+NullNPPGetValuePointer::NullNPPGetValuePointer(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_originalNPPGetValuePointer(pluginFunctions->getvalue)
+{
+ // Be sneaky and null out the getvalue pointer the browser is holding. This simulates a plugin
+ // that doesn't implement NPP_GetValue (like Shockwave Director 10.3 on Windows). Note that if
+ // WebKit copies the NPPluginFuncs struct this technique will have no effect and WebKit will
+ // call into our NPP_GetValue implementation.
+ pluginFunctions->getvalue = 0;
+}
+
+NPError NullNPPGetValuePointer::NPP_Destroy(NPSavedData**)
+{
+ // Set the NPP_GetValue pointer back the way it was before we mucked with it so we don't mess
+ // up future uses of the plugin module.
+ pluginFunctions->getvalue = m_originalNPPGetValuePointer;
+ return NPERR_NO_ERROR;
+}
+
+NPError NullNPPGetValuePointer::NPP_GetValue(NPPVariable, void*)
+{
+ pluginLog(m_npp, "NPP_GetValue was called but should not have been. Maybe WebKit copied the NPPluginFuncs struct, which would invalidate this test.");
+ return NPERR_GENERIC_ERROR;
+}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp
new file mode 100644
index 0000000..e464996
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp
@@ -0,0 +1,70 @@
+/*
+ * 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 "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Passing a different NPP struct that has the same ndata value as the one passed to NPP_New should
+// not trigger an assertion failure.
+
+class PassDifferentNPPStruct : public PluginTest {
+public:
+ PassDifferentNPPStruct(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_didReceiveInitialSetWindowCall(false)
+ {
+ }
+
+private:
+ virtual NPError NPP_SetWindow(NPP instance, NPWindow* window)
+ {
+ if (m_didReceiveInitialSetWindowCall)
+ return NPERR_NO_ERROR;
+ m_didReceiveInitialSetWindowCall = true;
+
+ NPP oldNPP = m_npp;
+ NPP_t differentNPP = *m_npp;
+ m_npp = &differentNPP;
+
+ NPBool privateMode;
+ NPError error = NPN_GetValue(NPNVprivateModeBool, &privateMode);
+
+ m_npp = oldNPP;
+
+ if (error != NPERR_NO_ERROR) {
+ pluginLog(instance, "NPN_GetValue(NPNVprivateModeBool) with a different NPP struct failed with error %d", error);
+ return NPERR_GENERIC_ERROR;
+ }
+ pluginLog(instance, "NPN_GetValue(NPNVprivateModeBool) with a different NPP struct succeeded");
+ return NPERR_NO_ERROR;
+ }
+
+ bool m_didReceiveInitialSetWindowCall;
+};
+
+static PluginTest::Register<PassDifferentNPPStruct> getValueNetscapeWindow("pass-different-npp-struct");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp
new file mode 100644
index 0000000..959e182
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp
@@ -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. 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 "PluginTest.h"
+
+using namespace std;
+
+// A test where the plug-ins scriptable object either has or doesn't have an invokeDefault function.
+class PluginScriptableNPObjectInvokeDefault : public PluginTest {
+public:
+ PluginScriptableNPObjectInvokeDefault(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ {
+ }
+
+private:
+ struct NPObjectWithoutInvokeDefault : Object<NPObjectWithoutInvokeDefault> { };
+
+ struct NPObjectWithInvokeDefault : Object<NPObjectWithInvokeDefault> {
+ public:
+ bool invokeDefault(const NPVariant*, uint32_t, NPVariant* result)
+ {
+ INT32_TO_NPVARIANT(1, *result);
+ return true;
+ }
+ };
+
+ virtual NPError NPP_GetValue(NPPVariable variable, void *value)
+ {
+ if (variable != NPPVpluginScriptableNPObject)
+ return NPERR_GENERIC_ERROR;
+
+ NPObject* object;
+ if (identifier() == "plugin-scriptable-npobject-invoke-default")
+ object = NPObjectWithInvokeDefault::create(this);
+ else
+ object = NPObjectWithoutInvokeDefault::create(this);
+
+ *(NPObject**)value = object;
+
+ return NPERR_NO_ERROR;
+ }
+};
+
+static PluginTest::Register<PluginScriptableNPObjectInvokeDefault> pluginScriptableNPObjectInvokeDefault("plugin-scriptable-npobject-invoke-default");
+static PluginTest::Register<PluginScriptableNPObjectInvokeDefault> pluginScriptableNPObjectNoInvokeDefault("plugin-scriptable-npobject-no-invoke-default");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp
new file mode 100644
index 0000000..2b06198
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/DrawsGradient.cpp
@@ -0,0 +1,118 @@
+/* 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 "WindowedPluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Just fills its window with some gradients
+
+class DrawsGradient : public WindowedPluginTest {
+public:
+ DrawsGradient(NPP, const string& identifier);
+
+private:
+ void paint(HDC) const;
+
+ LRESULT onPaint(WPARAM, LPARAM, bool& handled);
+ LRESULT onPrintClient(WPARAM, LPARAM, bool& handled);
+
+ virtual LRESULT wndProc(UINT message, WPARAM, LPARAM, bool& handled);
+};
+
+static PluginTest::Register<DrawsGradient> registrar("draws-gradient");
+
+DrawsGradient::DrawsGradient(NPP npp, const string& identifier)
+ : WindowedPluginTest(npp, identifier)
+{
+}
+
+LRESULT DrawsGradient::wndProc(UINT message, WPARAM wParam, LPARAM lParam, bool& handled)
+{
+ LRESULT result = 0;
+
+ switch (message) {
+ case WM_PAINT:
+ result = onPaint(wParam, lParam, handled);
+ break;
+ case WM_PRINTCLIENT:
+ result = onPrintClient(wParam, lParam, handled);
+ break;
+ default:
+ handled = false;
+ }
+
+ return result;
+}
+
+LRESULT DrawsGradient::onPaint(WPARAM, LPARAM, bool& handled)
+{
+ PAINTSTRUCT paintStruct;
+ HDC dc = ::BeginPaint(window(), &paintStruct);
+ if (!dc)
+ return 0;
+
+ paint(dc);
+ ::EndPaint(window(), &paintStruct);
+
+ handled = true;
+ return 0;
+}
+
+LRESULT DrawsGradient::onPrintClient(WPARAM wParam, LPARAM, bool& handled)
+{
+ paint(reinterpret_cast<HDC>(wParam));
+
+ handled = true;
+ return 0;
+}
+
+void DrawsGradient::paint(HDC dc) const
+{
+ RECT clientRect;
+ if (!::GetClientRect(window(), &clientRect))
+ return;
+
+ TRIVERTEX vertices[] = {
+ // Upper-left: green
+ { clientRect.left, clientRect.top, 0, 0xff00, 0, 0 },
+ // Upper-right: blue
+ { clientRect.right, clientRect.top, 0, 0, 0xff00, 0 },
+ // Lower-left: yellow
+ { clientRect.left, clientRect.bottom, 0xff00, 0xff00, 0, 0 },
+ // Lower-right: red
+ { clientRect.right, clientRect.bottom, 0xff00, 0, 0, 0 },
+ };
+
+ GRADIENT_TRIANGLE mesh[] = {
+ // Upper-left triangle
+ { 0, 1, 2 },
+ // Lower-right triangle
+ { 1, 2, 3 },
+ };
+
+ ::GradientFill(dc, vertices, _countof(vertices), mesh, _countof(mesh), GRADIENT_FILL_TRIANGLE);
+}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp
new file mode 100644
index 0000000..32fd99b
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/GetValueNetscapeWindow.cpp
@@ -0,0 +1,73 @@
+/*
+ * 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 "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// NPN_GetValue(NPNVnetscapeWindow) should return a valid HWND.
+
+class GetValueNetscapeWindow : public PluginTest {
+public:
+ GetValueNetscapeWindow(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_didReceiveInitialSetWindowCall(false)
+ {
+ }
+
+private:
+ virtual NPError NPP_SetWindow(NPP instance, NPWindow* window)
+ {
+ if (m_didReceiveInitialSetWindowCall)
+ return NPERR_NO_ERROR;
+ m_didReceiveInitialSetWindowCall = true;
+
+ HWND hwnd;
+ NPError error = NPN_GetValue(NPNVnetscapeWindow, &hwnd);
+ if (error != NPERR_NO_ERROR) {
+ pluginLog(instance, "NPN_GetValue(NPNVnetscapeWindow) failed with error %d", error);
+ return NPERR_GENERIC_ERROR;
+ }
+
+ if (!::IsWindow(hwnd)) {
+ pluginLog(instance, "::IsWindow returned FALSE");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ if (hwnd == window->window) {
+ pluginLog(instance, "NPN_GetValue(NPNVnetscapeWindow) returned the same value as NPWindow::window");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ pluginLog(instance, "NPN_GetValue(NPNVnetscapeWindow) succeeded");
+ return NPERR_NO_ERROR;
+ }
+
+ bool m_didReceiveInitialSetWindowCall;
+};
+
+static PluginTest::Register<GetValueNetscapeWindow> getValueNetscapeWindow("get-value-netscape-window");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp
new file mode 100644
index 0000000..e598c49
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/NPNInvalidateRectInvalidatesWindow.cpp
@@ -0,0 +1,188 @@
+/*
+ * 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 "WindowedPluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// NPN_InvalidateRect should invalidate the plugin's HWND.
+
+static const wchar_t instancePointerProperty[] = L"org.webkit.TestNetscapePlugin.NPNInvalidateRectInvalidatesWindow.InstancePointer";
+
+class TemporaryWindowMover {
+public:
+ TemporaryWindowMover(HWND);
+ ~TemporaryWindowMover();
+
+ bool moveSucceeded() const { return m_moveSucceeded; }
+
+private:
+ static const UINT standardSetWindowPosFlags = SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER;
+ bool m_moveSucceeded;
+ HWND m_window;
+ RECT m_savedWindowRect;
+};
+
+TemporaryWindowMover::TemporaryWindowMover(HWND window)
+ : m_window(window)
+{
+ m_moveSucceeded = false;
+
+ if (!::GetWindowRect(m_window, &m_savedWindowRect))
+ return;
+
+ if (!::SetWindowPos(m_window, 0, 0, 0, 0, 0, SWP_SHOWWINDOW | standardSetWindowPosFlags))
+ return;
+
+ m_moveSucceeded = true;
+};
+
+TemporaryWindowMover::~TemporaryWindowMover()
+{
+ if (!m_moveSucceeded)
+ return;
+
+ ::SetWindowPos(m_window, 0, m_savedWindowRect.left, m_savedWindowRect.top, 0, 0, SWP_HIDEWINDOW | standardSetWindowPosFlags);
+}
+
+class NPNInvalidateRectInvalidatesWindow : public WindowedPluginTest {
+public:
+ NPNInvalidateRectInvalidatesWindow(NPP, const string& identifier);
+ ~NPNInvalidateRectInvalidatesWindow();
+
+private:
+ virtual LRESULT wndProc(UINT message, WPARAM, LPARAM, bool& handled);
+
+ void onPaint();
+ void testInvalidateRect();
+
+ virtual NPError NPP_SetWindow(NPP, NPWindow*);
+
+ TemporaryWindowMover* m_windowMover;
+};
+
+NPNInvalidateRectInvalidatesWindow::NPNInvalidateRectInvalidatesWindow(NPP npp, const string& identifier)
+ : WindowedPluginTest(npp, identifier)
+ , m_windowMover(0)
+{
+}
+
+NPNInvalidateRectInvalidatesWindow::~NPNInvalidateRectInvalidatesWindow()
+{
+ delete m_windowMover;
+}
+
+NPError NPNInvalidateRectInvalidatesWindow::NPP_SetWindow(NPP instance, NPWindow* npWindow)
+{
+ NPError error = WindowedPluginTest::NPP_SetWindow(instance, npWindow);
+ if (error != NPERR_NO_ERROR)
+ return error;
+
+ if (!window())
+ return NPERR_NO_ERROR;
+
+ // The test harness's window (the one that contains the WebView) is off-screen and hidden.
+ // We need to move it on-screen and make it visible in order for the plugin's window to
+ // accumulate an update region when the DWM is disabled.
+
+ HWND testHarnessWindow = ::GetAncestor(window(), GA_ROOT);
+ if (!testHarnessWindow) {
+ pluginLog(instance, "Failed to get test harness window");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ m_windowMover = new TemporaryWindowMover(testHarnessWindow);
+ if (!m_windowMover->moveSucceeded()) {
+ pluginLog(instance, "Failed to move test harness window on-screen");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ // Wait until we receive a WM_PAINT message to ensure that the window is on-screen before we do
+ // the NPN_InvalidateRect test.
+ waitUntilDone();
+ return NPERR_NO_ERROR;
+}
+
+LRESULT NPNInvalidateRectInvalidatesWindow::wndProc(UINT message, WPARAM wParam, LPARAM lParam, bool& handled)
+{
+ if (message == WM_PAINT)
+ onPaint();
+
+ handled = false;
+ return 0;
+}
+
+void NPNInvalidateRectInvalidatesWindow::onPaint()
+{
+ testInvalidateRect();
+ notifyDone();
+ delete m_windowMover;
+ m_windowMover = 0;
+}
+
+void NPNInvalidateRectInvalidatesWindow::testInvalidateRect()
+{
+ RECT clientRect;
+ if (!::GetClientRect(window(), &clientRect)) {
+ pluginLog(m_npp, "::GetClientRect failed");
+ return;
+ }
+
+ if (::IsRectEmpty(&clientRect)) {
+ pluginLog(m_npp, "Plugin's HWND has not been sized when NPP_SetWindow is called");
+ return;
+ }
+
+ // Clear the invalid region.
+ if (!::ValidateRect(window(), 0)) {
+ pluginLog(m_npp, "::ValidateRect failed");
+ return;
+ }
+
+ // Invalidate our lower-right quadrant.
+ NPRect rectToInvalidate;
+ rectToInvalidate.left = (clientRect.right - clientRect.left) / 2;
+ rectToInvalidate.top = (clientRect.bottom - clientRect.top) / 2;
+ rectToInvalidate.right = clientRect.right;
+ rectToInvalidate.bottom = clientRect.bottom;
+ NPN_InvalidateRect(&rectToInvalidate);
+
+ RECT invalidRect;
+ if (!::GetUpdateRect(window(), &invalidRect, FALSE)) {
+ pluginLog(m_npp, "::GetUpdateRect failed");
+ return;
+ }
+
+ if (invalidRect.left != rectToInvalidate.left || invalidRect.top != rectToInvalidate.top || invalidRect.right != rectToInvalidate.right || invalidRect.bottom != rectToInvalidate.bottom) {
+ pluginLog(m_npp, "Expected invalid rect {left=%u, top=%u, right=%u, bottom=%u}, but got {left=%d, top=%d, right=%d, bottom=%d}", rectToInvalidate.left, rectToInvalidate.top, rectToInvalidate.right, rectToInvalidate.bottom, invalidRect.left, invalidRect.top, invalidRect.right, invalidRect.bottom);
+ return;
+ }
+
+ pluginLog(m_npp, "Plugin's HWND has been invalidated as expected");
+}
+
+static PluginTest::Register<NPNInvalidateRectInvalidatesWindow> registrar("npn-invalidate-rect-invalidates-window");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp
new file mode 100644
index 0000000..8054497
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowGeometryInitializedBeforeSetWindow.cpp
@@ -0,0 +1,90 @@
+/*
+ * 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 "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// Plugin's HWND should be sized/positioned before NPP_SetWindow is called.
+
+class WindowGeometryInitializedBeforeSetWindow : public PluginTest {
+public:
+ WindowGeometryInitializedBeforeSetWindow(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_didReceiveInitialSetWindowCall(false)
+ {
+ }
+
+private:
+ virtual NPError NPP_SetWindow(NPP instance, NPWindow* window)
+ {
+ if (m_didReceiveInitialSetWindowCall)
+ return NPERR_NO_ERROR;
+ m_didReceiveInitialSetWindowCall = true;
+
+ if (window->type != NPWindowTypeWindow) {
+ pluginLog(instance, "window->type should be NPWindowTypeWindow but was %d", window->type);
+ return NPERR_GENERIC_ERROR;
+ }
+
+ HWND hwnd = reinterpret_cast<HWND>(window->window);
+ RECT rect;
+ if (!::GetClientRect(hwnd, &rect)) {
+ pluginLog(instance, "::GetClientRect failed");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ if (::IsRectEmpty(&rect)) {
+ pluginLog(instance, "Plugin's HWND has not been sized when NPP_SetWindow is called");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ HWND parent = ::GetParent(hwnd);
+ if (!parent) {
+ pluginLog(instance, "::GetParent failed");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ // MSDN says that calling ::MapWindowPoints this way will tell it we're passing a RECT rather than two POINTs.
+ if (!::MapWindowPoints(hwnd, parent, reinterpret_cast<POINT*>(&rect), 2)) {
+ pluginLog(instance, "::MapWindowPoints failed");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ if (rect.left != window->x || rect.top != window->y || (rect.right - rect.left) != window->width || (rect.bottom - rect.top) != window->height) {
+ pluginLog(instance, "HWND's rect and NPWindow's rect are not equal");
+ return NPERR_GENERIC_ERROR;
+ }
+
+ pluginLog(instance, "Plugin's HWND has been sized and positioned before NPP_SetWindow was called");
+ return NPERR_NO_ERROR;
+ }
+
+ bool m_didReceiveInitialSetWindowCall;
+};
+
+static PluginTest::Register<WindowGeometryInitializedBeforeSetWindow> windowGeometryInitializedBeforeSetWindow("window-geometry-initialized-before-set-window");
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowRegionIsSetToClipRect.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowRegionIsSetToClipRect.cpp
new file mode 100644
index 0000000..975a598
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/win/WindowRegionIsSetToClipRect.cpp
@@ -0,0 +1,114 @@
+/*
+ * 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 "PluginTest.h"
+
+#include "PluginObject.h"
+
+using namespace std;
+
+// The plugin's window's window region should be set to the plugin's clip rect.
+
+class WindowRegionIsSetToClipRect : public PluginTest {
+public:
+ WindowRegionIsSetToClipRect(NPP, const string& identifier);
+
+private:
+ virtual NPError NPP_SetWindow(NPP, NPWindow*);
+
+ bool m_didReceiveInitialSetWindowCall;
+};
+
+static PluginTest::Register<WindowRegionIsSetToClipRect> registrar("window-region-is-set-to-clip-rect");
+
+WindowRegionIsSetToClipRect::WindowRegionIsSetToClipRect(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_didReceiveInitialSetWindowCall(false)
+{
+}
+
+NPError WindowRegionIsSetToClipRect::NPP_SetWindow(NPP instance, NPWindow* window)
+{
+ if (m_didReceiveInitialSetWindowCall)
+ return NPERR_NO_ERROR;
+ m_didReceiveInitialSetWindowCall = true;
+
+ if (window->type != NPWindowTypeWindow) {
+ pluginLog(instance, "window->type should be NPWindowTypeWindow but was %d", window->type);
+ return NPERR_GENERIC_ERROR;
+ }
+
+ HWND hwnd = reinterpret_cast<HWND>(window->window);
+
+ RECT regionRect;
+ if (::GetWindowRgnBox(hwnd, &regionRect) == ERROR) {
+ pluginLog(instance, "::GetWindowRgnBox failed with error %u", ::GetLastError());
+ return NPERR_GENERIC_ERROR;
+ }
+
+ // This expected rect is based on the layout of window-region-is-set-to-clip-rect.html.
+ RECT expectedRect = { 50, 50, 100, 100 };
+ if (!::EqualRect(&regionRect, &expectedRect)) {
+ pluginLog(instance, "Expected region rect {left=%u, top=%u, right=%u, bottom=%u}, but got {left=%d, top=%d, right=%d, bottom=%d}", expectedRect.left, expectedRect.top, expectedRect.right, expectedRect.bottom, regionRect.left, regionRect.top, regionRect.right, regionRect.bottom);
+ return NPERR_GENERIC_ERROR;
+ }
+
+ pluginLog(instance, "PASS: Plugin's window's window region has been set as expected");
+
+ // While we're here, check that our window class doesn't have the CS_PARENTDC style, which
+ // defeats clipping by ignoring the window region and always clipping to the parent window.
+ // FIXME: It would be nice to have a pixel test that shows that we're
+ // getting clipped correctly, but unfortunately window regions are ignored
+ // during WM_PRINT (see <http://webkit.org/b/49034>).
+ wchar_t className[512];
+ if (!::GetClassNameW(hwnd, className, _countof(className))) {
+ pluginLog(instance, "::GetClassName failed with error %u", ::GetLastError());
+ return NPERR_GENERIC_ERROR;
+ }
+
+#ifdef DEBUG_ALL
+ const wchar_t webKitDLLName[] = L"WebKit_debug.dll";
+#else
+ const wchar_t webKitDLLName[] = L"WebKit.dll";
+#endif
+ HMODULE webKitModule = ::GetModuleHandleW(webKitDLLName);
+ if (!webKitModule) {
+ pluginLog(instance, "::GetModuleHandleW failed with error %u", ::GetLastError());
+ return NPERR_GENERIC_ERROR;
+ }
+
+ WNDCLASSW wndClass;
+ if (!::GetClassInfoW(webKitModule, className, &wndClass)) {
+ pluginLog(instance, "::GetClassInfoW failed with error %u", ::GetLastError());
+ return NPERR_GENERIC_ERROR;
+ }
+
+ if (wndClass.style & CS_PARENTDC)
+ pluginLog(instance, "FAIL: Plugin's window's class has the CS_PARENTDC style, which will defeat clipping");
+ else
+ pluginLog(instance, "PASS: Plugin's window's class does not have the CS_PARENTDC style");
+
+ return NPERR_NO_ERROR;
+}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/Info.plist b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/mac/Info.plist
index 7444b84..7444b84 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/Info.plist
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/mac/Info.plist
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
index 8ef228a..2110a8a 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/main.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
@@ -23,25 +23,85 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "PluginObject.h"
+#include "PluginObject.h"
+
+#include "PluginTest.h"
+#include <cstdlib>
+#include <string>
+
+#ifdef XP_UNIX
+#include <X11/Xlib.h>
+#endif
+
+#if !defined(NP_NO_CARBON) && defined(QD_HEADERS_ARE_PRIVATE) && QD_HEADERS_ARE_PRIVATE
+extern "C" void GlobalToLocal(Point*);
+#endif
+
+using namespace std;
+
+#define CRASH() do { \
+ *(int *)(uintptr_t)0xbbadbeef = 0; \
+ ((void(*)())0)(); /* More reliable, but doesn't say BBADBEEF */ \
+} while(false)
+
+static bool getEntryPointsWasCalled;
+static bool initializeWasCalled;
+
+#if XP_WIN
+#define STDCALL __stdcall
+
+static inline int strcasecmp(const char* s1, const char* s2)
+{
+ return _stricmp(s1, s2);
+}
+
+#else
+#define STDCALL
+#endif
-// Mach-o entry points
extern "C" {
- NPError NP_Initialize(NPNetscapeFuncs *browserFuncs);
- NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs);
- void NP_Shutdown(void);
+NPError STDCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs);
}
-// Mach-o entry points
-NPError NP_Initialize(NPNetscapeFuncs *browserFuncs)
+// Entry points
+extern "C"
+NPError STDCALL NP_Initialize(NPNetscapeFuncs *browserFuncs
+#ifdef XP_UNIX
+ , NPPluginFuncs *pluginFuncs
+#endif
+ )
{
+ initializeWasCalled = true;
+
+#if XP_WIN
+ // Simulate Flash and QuickTime's behavior of crashing when NP_Initialize is called before NP_GetEntryPoints.
+ if (!getEntryPointsWasCalled)
+ CRASH();
+#endif
+
browser = browserFuncs;
+
+#ifdef XP_UNIX
+ return NP_GetEntryPoints(pluginFuncs);
+#else
return NPERR_NO_ERROR;
+#endif
}
-NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
+extern "C"
+NPError STDCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
{
- pluginFuncs->version = 11;
+ getEntryPointsWasCalled = true;
+
+#ifdef XP_MACOSX
+ // Simulate Silverlight's behavior of crashing when NP_GetEntryPoints is called before NP_Initialize.
+ if (!initializeWasCalled)
+ CRASH();
+#endif
+
+ pluginFunctions = pluginFuncs;
+
+ pluginFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
pluginFuncs->size = sizeof(pluginFuncs);
pluginFuncs->newp = NPP_New;
pluginFuncs->destroy = NPP_Destroy;
@@ -60,16 +120,20 @@ NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
return NPERR_NO_ERROR;
}
-void NP_Shutdown(void)
+extern "C"
+void STDCALL NP_Shutdown(void)
{
}
static void executeScript(const PluginObject* obj, const char* script);
-NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved)
+NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *saved)
{
bool forceCarbon = false;
+#ifdef XP_MACOSX
+ NPEventModel eventModel;
+
// Always turn on the CG model
NPBool supportsCoreGraphics;
if (browser->getvalue(instance, NPNVsupportsCoreGraphicsBool, &supportsCoreGraphics) != NPERR_NO_ERROR)
@@ -77,13 +141,55 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch
if (!supportsCoreGraphics)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
-
- browser->setvalue(instance, NPPVpluginDrawingModel, (void *)NPDrawingModelCoreGraphics);
+
+ NPDrawingModel drawingModelToUse = NPDrawingModelCoreGraphics;
+
+ NPBool supportsCoreAnimation;
+ if (browser->getvalue(instance, NPNVsupportsCoreAnimationBool, &supportsCoreAnimation) != NPERR_NO_ERROR)
+ supportsCoreAnimation = false;
+
+#ifndef NP_NO_CARBON
+ NPBool supportsCarbon = false;
+#endif
+ NPBool supportsCocoa = false;
+
+#ifndef NP_NO_CARBON
+ // A browser that doesn't know about NPNVsupportsCarbonBool is one that only supports Carbon event model.
+ if (browser->getvalue(instance, NPNVsupportsCarbonBool, &supportsCarbon) != NPERR_NO_ERROR)
+ supportsCarbon = true;
+#endif
+
+ if (browser->getvalue(instance, NPNVsupportsCocoaBool, &supportsCocoa) != NPERR_NO_ERROR)
+ supportsCocoa = false;
+
+ if (supportsCocoa && !forceCarbon) {
+ eventModel = NPEventModelCocoa;
+#ifndef NP_NO_CARBON
+ } else if (supportsCarbon) {
+ eventModel = NPEventModelCarbon;
+#endif
+ } else {
+ return NPERR_INCOMPATIBLE_VERSION_ERROR;
+ }
+
+ browser->setvalue(instance, NPPVpluginEventModel, (void *)eventModel);
+#endif // XP_MACOSX
PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass());
instance->pdata = obj;
+#ifdef XP_MACOSX
+ obj->eventModel = eventModel;
+#if !defined(BUILDING_ON_TIGER)
+ obj->coreAnimationLayer = 0;
+#endif
+#endif // XP_MACOSX
+
+ string testIdentifier;
+
for (int i = 0; i < argc; i++) {
+ if (strcasecmp(argn[i], "test") == 0)
+ testIdentifier = argv[i];
if (strcasecmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad)
obj->onStreamLoad = strdup(argv[i]);
else if (strcasecmp(argn[i], "onStreamDestroy") == 0 && !obj->onStreamDestroy)
@@ -93,6 +199,8 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch
else if (strcasecmp(argn[i], "src") == 0 &&
strcasecmp(argv[i], "data:application/x-webkit-test-netscape,returnerrorfromnewstream") == 0)
obj->returnErrorFromNewStream = TRUE;
+ else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
+ obj->onSetWindow = strdup(argv[i]);
else if (strcasecmp(argn[i], "logfirstsetwindow") == 0)
obj->logSetWindow = TRUE;
else if (strcasecmp(argn[i], "testnpruntime") == 0)
@@ -107,46 +215,72 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch
executeScript(obj, "document.body.innerHTML = ''");
else if (!strcasecmp(argn[i], "ondestroy"))
obj->onDestroy = strdup(argv[i]);
- else if (strcasecmp(argn[i], "testdocumentopenindestroystream") == 0)
- obj->testDocumentOpenInDestroyStream = TRUE;
else if (strcasecmp(argn[i], "testwindowopen") == 0)
obj->testWindowOpen = TRUE;
- }
-
-#ifndef NP_NO_CARBON
- NPBool supportsCarbon = false;
+ else if (strcasecmp(argn[i], "drawingmodel") == 0) {
+#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+ const char* value = argv[i];
+ if (strcasecmp(value, "coreanimation") == 0) {
+ if (supportsCoreAnimation)
+ drawingModelToUse = NPDrawingModelCoreAnimation;
+ else
+ return NPERR_INCOMPATIBLE_VERSION_ERROR;
+ } else if (strcasecmp(value, "coregraphics") == 0) {
+ if (supportsCoreGraphics)
+ drawingModelToUse = NPDrawingModelCoreGraphics;
+ else
+ return NPERR_INCOMPATIBLE_VERSION_ERROR;
+ } else
+ return NPERR_INCOMPATIBLE_VERSION_ERROR;
#endif
- NPBool supportsCocoa = false;
-
-#ifndef NP_NO_CARBON
- // A browser that doesn't know about NPNVsupportsCarbonBool is one that only supports Carbon event model.
- if (browser->getvalue(instance, NPNVsupportsCarbonBool, &supportsCarbon) != NPERR_NO_ERROR)
- supportsCarbon = true;
+ } else if (strcasecmp(argn[i], "testGetURLOnDestroy") == 0) {
+#if XP_WIN
+ // FIXME: When https://bugs.webkit.org/show_bug.cgi?id=41831 is fixed, this #ifdef can be removed.
+ obj->testGetURLOnDestroy = TRUE;
#endif
+ } else if (!strcasecmp(argn[i], "src") && strstr(argv[i], "plugin-document-has-focus.pl"))
+ obj->testKeyboardFocusForPlugins = TRUE;
+ else if (!strcasecmp(argn[i], "evaluatescript")) {
+ char* script = argv[i];
+ if (script == strstr(script, "mouse::")) {
+ obj->mouseDownForEvaluateScript = true;
+ obj->evaluateScriptOnMouseDownOrKeyDown = strdup(script + sizeof("mouse::") - 1);
+ } else if (script == strstr(script, "key::")) {
+ obj->evaluateScriptOnMouseDownOrKeyDown = strdup(script + sizeof("key::") - 1);
+ }
+ // When testing evaluate script on mouse-down or key-down, allow event logging to handle events.
+ if (obj->evaluateScriptOnMouseDownOrKeyDown)
+ obj->eventLogging = true;
+ }
+ }
- if (browser->getvalue(instance, NPNVsupportsCocoaBool, &supportsCocoa) != NPERR_NO_ERROR)
- supportsCocoa = false;
-
- if (supportsCocoa && !forceCarbon) {
- obj->eventModel = NPEventModelCocoa;
-#ifndef NP_NO_CARBON
- } else if (supportsCarbon) {
- obj->eventModel = NPEventModelCarbon;
+#ifdef XP_MACOSX
+ browser->setvalue(instance, NPPVpluginDrawingModel, (void *)drawingModelToUse);
+#if !defined(BUILDING_ON_TIGER)
+ if (drawingModelToUse == NPDrawingModelCoreAnimation)
+ obj->coreAnimationLayer = createCoreAnimationLayer();
#endif
- } else {
- return NPERR_INCOMPATIBLE_VERSION_ERROR;
- }
-
+#endif
+
browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode);
- browser->setvalue(instance, NPPVpluginEventModel, (void *)obj->eventModel);
-
+
+ obj->pluginTest = PluginTest::create(instance, testIdentifier);
+
+#ifdef XP_UNIX
+ // On Unix, plugins only get events if they are windowless.
+ return browser->setvalue(instance, NPPVpluginWindowBool, 0);
+#else
return NPERR_NO_ERROR;
+#endif
}
NPError NPP_Destroy(NPP instance, NPSavedData **save)
{
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
if (obj) {
+ if (obj->testGetURLOnDestroy)
+ browser->geturlnotify(obj->npp, "about:blank", "", 0);
+
if (obj->onDestroy) {
executeScript(obj, obj->onDestroy);
free(obj->onDestroy);
@@ -160,10 +294,20 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save)
if (obj->onURLNotify)
free(obj->onURLNotify);
+
+ if (obj->onSetWindow)
+ free(obj->onSetWindow);
if (obj->logDestroy)
pluginLog(instance, "NPP_Destroy");
+#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+ if (obj->coreAnimationLayer)
+ CFRelease(obj->coreAnimationLayer);
+#endif
+
+ obj->pluginTest->NPP_Destroy(save);
+
browser->releaseobject(&obj->header);
}
return NPERR_NO_ERROR;
@@ -174,18 +318,28 @@ NPError NPP_SetWindow(NPP instance, NPWindow *window)
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
if (obj) {
+ obj->lastWindow = *window;
+
if (obj->logSetWindow) {
pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height);
- obj->logSetWindow = false;
+ obj->logSetWindow = FALSE;
}
+ if (obj->onSetWindow)
+ executeScript(obj, obj->onSetWindow);
+
if (obj->testWindowOpen) {
testWindowOpen(instance);
obj->testWindowOpen = FALSE;
}
+
+ if (obj->testKeyboardFocusForPlugins) {
+ obj->eventLogging = true;
+ executeScript(obj, "eventSender.keyDown('A');");
+ }
}
- return NPERR_NO_ERROR;
+ return obj->pluginTest->NPP_SetWindow(instance, window);
}
static void executeScript(const PluginObject* obj, const char* script)
@@ -202,11 +356,11 @@ static void executeScript(const PluginObject* obj, const char* script)
browser->releasevariantvalue(&browserResult);
}
-NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype)
+NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16_t *stype)
{
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
obj->stream = stream;
- *stype = NP_ASFILEONLY;
+ *stype = NP_NORMAL;
if (obj->returnErrorFromNewStream)
return NPERR_GENERIC_ERROR;
@@ -224,25 +378,45 @@ NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason)
{
PluginObject* obj = (PluginObject*)instance->pdata;
- if (obj->onStreamDestroy)
- executeScript(obj, obj->onStreamDestroy);
-
- if (obj->testDocumentOpenInDestroyStream) {
- testDocumentOpen(instance);
- obj->testDocumentOpenInDestroyStream = FALSE;
+ if (obj->onStreamDestroy) {
+ NPObject* windowObject = 0;
+ NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject);
+
+ if (error == NPERR_NO_ERROR) {
+ NPVariant onStreamDestroyVariant;
+ if (browser->getproperty(instance, windowObject, browser->getstringidentifier(obj->onStreamDestroy), &onStreamDestroyVariant)) {
+ if (NPVARIANT_IS_OBJECT(onStreamDestroyVariant)) {
+ NPObject* onStreamDestroyFunction = NPVARIANT_TO_OBJECT(onStreamDestroyVariant);
+
+ NPVariant reasonVariant;
+ INT32_TO_NPVARIANT(reason, reasonVariant);
+
+ NPVariant result;
+ browser->invokeDefault(instance, onStreamDestroyFunction, &reasonVariant, 1, &result);
+ browser->releasevariantvalue(&result);
+ }
+ browser->releasevariantvalue(&onStreamDestroyVariant);
+ }
+ browser->releaseobject(windowObject);
+ }
}
- return NPERR_NO_ERROR;
+ return obj->pluginTest->NPP_DestroyStream(stream, reason);
}
-int32 NPP_WriteReady(NPP instance, NPStream *stream)
+int32_t NPP_WriteReady(NPP instance, NPStream *stream)
{
- return 0;
+ return 4096;
}
-int32 NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer)
+int32_t NPP_Write(NPP instance, NPStream *stream, int32_t offset, int32_t len, void *buffer)
{
- return 0;
+ PluginObject* obj = (PluginObject*)instance->pdata;
+
+ if (obj->returnNegativeOneFromWrite)
+ return -1;
+
+ return len;
}
void NPP_StreamAsFile(NPP instance, NPStream *stream, const char *fname)
@@ -253,6 +427,7 @@ void NPP_Print(NPP instance, NPPrint *platformPrint)
{
}
+#ifdef XP_MACOSX
#ifndef NP_NO_CARBON
static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* event)
{
@@ -265,6 +440,8 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e
case mouseDown:
GlobalToLocal(&pt);
pluginLog(instance, "mouseDown at (%d, %d)", pt.h, pt.v);
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
break;
case mouseUp:
GlobalToLocal(&pt);
@@ -272,9 +449,16 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e
break;
case keyDown:
pluginLog(instance, "keyDown '%c'", (char)(event->message & 0xFF));
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
break;
case keyUp:
pluginLog(instance, "keyUp '%c'", (char)(event->message & 0xFF));
+ if (obj->testKeyboardFocusForPlugins) {
+ obj->eventLogging = false;
+ obj->testKeyboardFocusForPlugins = FALSE;
+ executeScript(obj, "layoutTestController.notifyDone();");
+ }
break;
case autoKey:
pluginLog(instance, "autoKey '%c'", (char)(event->message & 0xFF));
@@ -305,13 +489,13 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e
pluginLog(instance, "kHighLevelEvent");
break;
// NPAPI events
- case getFocusEvent:
+ case NPEventType_GetFocusEvent:
pluginLog(instance, "getFocusEvent");
break;
- case loseFocusEvent:
+ case NPEventType_LoseFocusEvent:
pluginLog(instance, "loseFocusEvent");
break;
- case adjustCursorEvent:
+ case NPEventType_AdjustCursorEvent:
pluginLog(instance, "adjustCursorEvent");
break;
default:
@@ -338,7 +522,23 @@ static int16_t handleEventCocoa(NPP instance, PluginObject* obj, NPCocoaEvent* e
return 1;
case NPCocoaEventKeyDown:
+ if (event->data.key.characters)
+ pluginLog(instance, "keyDown '%c'", CFStringGetCharacterAtIndex(reinterpret_cast<CFStringRef>(event->data.key.characters), 0));
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
+ return 1;
+
case NPCocoaEventKeyUp:
+ if (event->data.key.characters) {
+ pluginLog(instance, "keyUp '%c'", CFStringGetCharacterAtIndex(reinterpret_cast<CFStringRef>(event->data.key.characters), 0));
+ if (obj->testKeyboardFocusForPlugins) {
+ obj->eventLogging = false;
+ obj->testKeyboardFocusForPlugins = FALSE;
+ executeScript(obj, "layoutTestController.notifyDone();");
+ }
+ }
+ return 1;
+
case NPCocoaEventFlagsChanged:
return 1;
@@ -346,6 +546,8 @@ static int16_t handleEventCocoa(NPP instance, PluginObject* obj, NPCocoaEvent* e
pluginLog(instance, "mouseDown at (%d, %d)",
(int)event->data.mouse.pluginX,
(int)event->data.mouse.pluginY);
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
return 1;
case NPCocoaEventMouseUp:
pluginLog(instance, "mouseUp at (%d, %d)",
@@ -365,12 +567,63 @@ static int16_t handleEventCocoa(NPP instance, PluginObject* obj, NPCocoaEvent* e
return 0;
}
-int16 NPP_HandleEvent(NPP instance, void *event)
+#endif // XP_MACOSX
+
+#ifdef XP_UNIX
+static int16_t handleEventX11(NPP instance, PluginObject* obj, XEvent* event)
+{
+ XButtonPressedEvent* buttonPressEvent = reinterpret_cast<XButtonPressedEvent*>(event);
+ XButtonReleasedEvent* buttonReleaseEvent = reinterpret_cast<XButtonReleasedEvent*>(event);
+ switch (event->type) {
+ case ButtonPress:
+ pluginLog(instance, "mouseDown at (%d, %d)", buttonPressEvent->x, buttonPressEvent->y);
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
+ break;
+ case ButtonRelease:
+ pluginLog(instance, "mouseUp at (%d, %d)", buttonReleaseEvent->x, buttonReleaseEvent->y);
+ break;
+ case KeyPress:
+ // FIXME: extract key code
+ pluginLog(instance, "NOTIMPLEMENTED: keyDown '%c'", ' ');
+ if (obj->evaluateScriptOnMouseDownOrKeyDown && !obj->mouseDownForEvaluateScript)
+ executeScript(obj, obj->evaluateScriptOnMouseDownOrKeyDown);
+ break;
+ case KeyRelease:
+ // FIXME: extract key code
+ pluginLog(instance, "NOTIMPLEMENTED: keyUp '%c'", ' ');
+ break;
+ case GraphicsExpose:
+ pluginLog(instance, "updateEvt");
+ break;
+ // NPAPI events
+ case FocusIn:
+ pluginLog(instance, "getFocusEvent");
+ break;
+ case FocusOut:
+ pluginLog(instance, "loseFocusEvent");
+ break;
+ case EnterNotify:
+ case LeaveNotify:
+ case MotionNotify:
+ pluginLog(instance, "adjustCursorEvent");
+ break;
+ default:
+ pluginLog(instance, "event %d", event->type);
+ }
+
+ fflush(stdout);
+ return 0;
+}
+#endif // XP_UNIX
+
+int16_t NPP_HandleEvent(NPP instance, void *event)
{
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
if (!obj->eventLogging)
return 0;
+#ifdef XP_MACOSX
#ifndef NP_NO_CARBON
if (obj->eventModel == NPEventModelCarbon)
return handleEventCarbon(instance, obj, static_cast<EventRecord*>(event));
@@ -378,6 +631,12 @@ int16 NPP_HandleEvent(NPP instance, void *event)
assert(obj->eventModel == NPEventModelCocoa);
return handleEventCocoa(instance, obj, static_cast<NPCocoaEvent*>(event));
+#elif defined(XP_UNIX)
+ return handleEventX11(instance, obj, static_cast<XEvent*>(event));
+#else
+ // FIXME: Implement for other platforms.
+ return 0;
+#endif // XP_MACOSX
}
void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyData)
@@ -392,8 +651,23 @@ void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyD
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
{
+#ifdef XP_UNIX
+ if (variable == NPPVpluginNameString) {
+ *((char **)value) = const_cast<char*>("WebKit Test PlugIn");
+ return NPERR_NO_ERROR;
+ }
+ if (variable == NPPVpluginDescriptionString) {
+ *((char **)value) = const_cast<char*>("Simple Netscape plug-in that handles test content for WebKit");
+ return NPERR_NO_ERROR;
+ }
+#endif
+
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
+ // First, check if the PluginTest object supports getting this value.
+ if (obj->pluginTest->NPP_GetValue(variable, value) == NPERR_NO_ERROR)
+ return NPERR_NO_ERROR;
+
if (variable == NPPVpluginScriptableNPObject) {
void **v = (void **)value;
// Return value is expected to be retained
@@ -402,6 +676,17 @@ NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
return NPERR_NO_ERROR;
}
+#if defined(XP_MACOSX) && !defined(BUILDING_ON_TIGER)
+ if (variable == NPPVpluginCoreAnimationLayer) {
+ if (!obj->coreAnimationLayer)
+ return NPERR_GENERIC_ERROR;
+
+ void **v = (void **)value;
+ *v = (void*)CFRetain(obj->coreAnimationLayer);
+ return NPERR_NO_ERROR;
+ }
+#endif
+
return NPERR_GENERIC_ERROR;
}
@@ -417,3 +702,17 @@ NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
return NPERR_GENERIC_ERROR;
}
}
+
+#ifdef XP_UNIX
+extern "C"
+const char* NP_GetMIMEDescription(void)
+{
+ return "application/x-webkit-test-netscape:testnetscape:test netscape content";
+}
+
+extern "C"
+NPError NP_GetValue(NPP instance, NPPVariable variable, void* value)
+{
+ return NPP_GetValue(instance, variable, value);
+}
+#endif
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.def b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def
index ac41e7e..ac41e7e 100644
--- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.def
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.def
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.rc b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc
index a8fbbcd..a8fbbcd 100644
--- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.rc
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.rc
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
new file mode 100644
index 0000000..fb0a236
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
@@ -0,0 +1,517 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="TestNetscapePlugin"
+ ProjectGUID="{C0737398-3565-439E-A2B8-AB2BE4D5430C}"
+ RootNamespace="TestNetscapePlugin"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;.\TestNetscapePluginCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\TestNetscapePluginCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_Internal|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;.\TestNetscapePluginCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_Cairo|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;.\TestNetscapePluginCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_All|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;.\TestNetscapePluginCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ RuntimeLibrary="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\TestNetscapePluginCommon.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories=""
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Tests"
+ >
+ <File
+ RelativePath="..\Tests\DocumentOpenInDestroyStream.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\EvaluateJSAfterRemovingPluginElement.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\NPRuntimeObjectFromDestroyedPlugin.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\NPRuntimeRemoveProperty.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\NullNPPGetValuePointer.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\PassDifferentNPPStruct.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\PluginScriptableNPObjectInvokeDefault.cpp"
+ >
+ </File>
+ <Filter
+ Name="win"
+ >
+ <File
+ RelativePath="..\Tests\win\DrawsGradient.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\win\GetValueNetscapeWindow.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\win\NPNInvalidateRectInvalidatesWindow.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\win\WindowGeometryInitializedBeforeSetWindow.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\win\WindowRegionIsSetToClipRect.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="win"
+ >
+ <File
+ RelativePath=".\WindowedPluginTest.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WindowedPluginTest.h"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\main.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\PluginObject.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\PluginObject.h"
+ >
+ </File>
+ <File
+ RelativePath="..\PluginTest.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\PluginTest.h"
+ >
+ </File>
+ <File
+ RelativePath=".\resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\TestNetscapePlugin.def"
+ >
+ </File>
+ <File
+ RelativePath=".\TestNetscapePlugin.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\TestNetscapePlugin_debug.def"
+ >
+ </File>
+ <File
+ RelativePath="..\TestObject.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\TestObject.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePluginCommon.vsprops b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePluginCommon.vsprops
new file mode 100644
index 0000000..88aa183
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePluginCommon.vsprops
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="TestNetscapePluginCommon"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
+ PreprocessorDefinitions="_USRDLL;TESTNETSCAPEPLUGIN_EXPORTS;snprintf=_snprintf"
+ DisableSpecificWarnings="4819"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="Msimg32.lib"
+ OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
+ ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
+ />
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin_debug.def b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin_debug.def
index 158fb7c..158fb7c 100644
--- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin_debug.def
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin_debug.def
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.cpp
new file mode 100644
index 0000000..96b51f8
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.cpp
@@ -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.
+ */
+
+#include "WindowedPluginTest.h"
+
+using namespace std;
+
+static const wchar_t instancePointerProperty[] = L"org.webkit.TestNetscapePlugin.WindowedPluginTest.InstancePointer";
+
+WindowedPluginTest::WindowedPluginTest(NPP npp, const string& identifier)
+ : PluginTest(npp, identifier)
+ , m_window(0)
+ , m_originalWndProc(0)
+{
+}
+
+NPError WindowedPluginTest::NPP_SetWindow(NPP instance, NPWindow* window)
+{
+ HWND newWindow = reinterpret_cast<HWND>(window->window);
+ if (newWindow == m_window)
+ return NPERR_NO_ERROR;
+
+ if (m_window) {
+ ::RemovePropW(m_window, instancePointerProperty);
+ ::SetWindowLongPtr(m_window, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(m_originalWndProc));
+ m_originalWndProc = 0;
+ }
+
+ m_window = newWindow;
+ if (!m_window)
+ return NPERR_NO_ERROR;
+
+ m_originalWndProc = reinterpret_cast<WNDPROC>(::SetWindowLongPtrW(m_window, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(staticWndProc)));
+ ::SetPropW(m_window, instancePointerProperty, this);
+
+ return NPERR_NO_ERROR;
+}
+
+LRESULT WindowedPluginTest::staticWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ WindowedPluginTest* instance = reinterpret_cast<WindowedPluginTest*>(::GetPropW(hwnd, instancePointerProperty));
+
+ bool handled = false;
+ LRESULT result = instance->wndProc(message, wParam, lParam, handled);
+ if (handled)
+ return result;
+
+ return ::CallWindowProcW(instance->m_originalWndProc, hwnd, message, wParam, lParam);
+}
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.h
new file mode 100644
index 0000000..7abc734
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/WindowedPluginTest.h
@@ -0,0 +1,50 @@
+/*
+ * 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 WindowedPluginTest_h
+#define WindowedPluginTest_h
+
+#include "PluginTest.h"
+
+class WindowedPluginTest : public PluginTest {
+protected:
+ WindowedPluginTest(NPP, const std::string& identifier);
+
+ HWND window() const { return m_window; }
+
+ // For derived classes to override
+ virtual LRESULT wndProc(UINT message, WPARAM, LPARAM, bool& handled) = 0;
+
+ // PluginTest
+ virtual NPError NPP_SetWindow(NPP, NPWindow*);
+
+private:
+ static LRESULT CALLBACK staticWndProc(HWND, UINT message, WPARAM, LPARAM);
+
+ HWND m_window;
+ WNDPROC m_originalWndProc;
+};
+
+#endif // WindowedPluginTest_h
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/resource.h b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/resource.h
index b0ce340..b0ce340 100644
--- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/resource.h
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/resource.h
diff --git a/WebKitTools/DumpRenderTree/WorkQueueItem.h b/WebKitTools/DumpRenderTree/WorkQueueItem.h
index 56be377..34276c8 100644
--- a/WebKitTools/DumpRenderTree/WorkQueueItem.h
+++ b/WebKitTools/DumpRenderTree/WorkQueueItem.h
@@ -53,6 +53,21 @@ private:
JSRetainPtr<JSStringRef> m_target;
};
+class LoadHTMLStringItem : public WorkQueueItem {
+public:
+ LoadHTMLStringItem(const JSStringRef content, const JSStringRef baseURL)
+ : m_content(content)
+ , m_baseURL(baseURL)
+ {
+ }
+
+private:
+ virtual bool invoke() const;
+
+ JSRetainPtr<JSStringRef> m_content;
+ JSRetainPtr<JSStringRef> m_baseURL;
+};
+
class ReloadItem : public WorkQueueItem {
private:
virtual bool invoke() const;
diff --git a/WebKitTools/DumpRenderTree/android/get_layout_tests_dir_contents.php b/WebKitTools/DumpRenderTree/android/get_layout_tests_dir_contents.php
new file mode 100644
index 0000000..28a1a8a
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/android/get_layout_tests_dir_contents.php
@@ -0,0 +1,110 @@
+<?php
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+###############################################################################
+
+# Lists the content of the LayoutTests directory
+#
+# Usage:
+# get_layout_tests_dir_contents.php?path=PATH&recurse=RECURSE&separator=SEPARATOR&mode=MODE
+# where
+# PATH - relative path in the LayoutTests dir
+# RECURSE = [true|false] (defaults to true)
+# SEPARATOR = a string separating paths in result (defaults to \n)
+# MODE = [folders|files] (defaults to files) - if 'folders' then lists only folders,
+# if 'files' then only files
+
+ # The server document root is LayoutTests/http/tests. See run_apache2.py.
+ $rootDir = realpath($_SERVER['DOCUMENT_ROOT'] . '..' . DIRECTORY_SEPARATOR . '..');
+
+ function getAbsolutePath($relPath) {
+ global $rootDir;
+ return $rootDir . DIRECTORY_SEPARATOR . $relPath;
+ }
+
+ function getFilesAsArray($relPath) {
+ return array_slice(scandir(getAbsolutePath($relPath)), 2);
+ }
+
+ function isIgnored($basename) {
+ return substr($basename, 0, 1) == '.';
+ }
+
+ function getAllFilesUnderAsArray($relPath, $recurse, $mode) {
+ $files = getFilesAsArray($relPath);
+ $result = array();
+
+ foreach($files as $i => $value) {
+ if (isIgnored($value)) {
+ continue;
+ }
+ if ($relPath == '') {
+ $filePath = $value;
+ } else {
+ $filePath = $relPath . DIRECTORY_SEPARATOR . $value;
+ }
+
+ if (is_dir(getAbsolutePath($filePath))) {
+ if ($mode == 'folders') {
+ $result = array_merge($result, (array)$filePath);
+ }
+ if ($recurse) {
+ $result = array_merge($result, getAllFilesUnderAsArray($filePath, $recurse, $mode));
+ }
+ } else if ($mode == 'files') {
+ $result = array_merge($result, (array)$filePath);
+ }
+ }
+
+ return $result;
+ }
+
+ function main() {
+ global $rootDir;
+
+ $path = getAbsolutePath($_GET['path']);
+
+ if (!isset($_GET['separator'])) {
+ $separator = "\n";
+ } else {
+ $separator = $_GET['separator'];
+ }
+
+ $recurse = (strtolower($_GET['recurse']) != 'false');
+
+ if (strtolower($_GET['mode']) == 'folders') {
+ $mode = 'folders';
+ } else {
+ $mode = 'files';
+ }
+
+ # Very primitive check if path tries to go above DOCUMENT_ROOT or is absolute
+ if (strpos($_GET['path'], "..") !== False ||
+ substr($_GET['path'], 0, 1) == DIRECTORY_SEPARATOR) {
+ return;
+ }
+
+ # If we don't want realpath to append any prefixes we need to pass it an absolute path
+ $path = realpath(getAbsolutePath($_GET['path']));
+ $relPath = substr($path, strlen($rootDir) + 1);
+
+ # If there is an error of some sort it will be output as a part of the answer!
+ foreach (getAllFilesUnderAsArray($relPath, $recurse, $mode) as $i => $value) {
+ echo "$value$separator";
+ }
+ }
+
+ main();
+?>
diff --git a/WebKitTools/DumpRenderTree/android/view_source.php b/WebKitTools/DumpRenderTree/android/view_source.php
new file mode 100644
index 0000000..fc9ae31
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/android/view_source.php
@@ -0,0 +1,53 @@
+<?php
+# Copyright (C) 2010 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+###############################################################################
+
+# Show the source of the test.
+#
+# Usage:
+# view_source.php?src=PATH
+# where
+# PATH - relative path in the LayoutTests dir
+
+ # Global variables
+ # The server document root is LayoutTests/http/tests. See run_apache2.py.
+ $rootDir = realpath($_SERVER['DOCUMENT_ROOT'] . '..' . DIRECTORY_SEPARATOR . '..');
+
+ function getAbsolutePath($relPath) {
+ global $rootDir;
+ return $rootDir . DIRECTORY_SEPARATOR . $relPath;
+ }
+
+ function main() {
+ global $rootDir;
+
+ # Very primitive check if path tries to go above DOCUMENT_ROOT or is absolute
+ if (strpos($_GET['src'], "..") !== False ||
+ substr($_GET['src'], 0, 1) == DIRECTORY_SEPARATOR) {
+ return;
+ }
+
+ # If we don't want realpath to append any prefixes we need to pass it an absolute path
+ $src = realpath(getAbsolutePath($_GET['src']));
+
+ echo "<html><body>";
+ # TODO: Add link following and syntax highlighting for html and js.
+ highlight_string(file_get_contents($src));
+ echo "</body></html>";
+ }
+
+ main();
+?>
diff --git a/WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp b/WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp
index 889b7b3..7de019d 100644
--- a/WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp
+++ b/WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp
@@ -1,97 +1,93 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- * (C) 2009 Brent Fulgham <bfulgham@webkit.org>
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h"
-#include "PixelDumpSupportCairo.h"
-
-#include "DumpRenderTree.h"
-#include "PixelDumpSupport.h"
-#include <algorithm>
-#include <ctype.h>
-#include <wtf/Assertions.h>
-#include <wtf/RefPtr.h>
-#include <wtf/RetainPtr.h>
-#include <wtf/StringExtras.h>
-
-#if PLATFORM(WIN)
-#include "MD5.h"
-#endif
-
-using namespace std;
-
-static cairo_status_t writeFunction(void* closure, const unsigned char* data, unsigned int length)
-{
- Vector<unsigned char>* in = reinterpret_cast<Vector<unsigned char>*>(closure);
- in->append(data, length);
- return CAIRO_STATUS_SUCCESS;
-}
-
-static void printPNG(cairo_surface_t* image)
-{
- Vector<unsigned char> pixelData;
- // Only PNG output is supported for now.
- cairo_surface_write_to_png_stream(image, writeFunction, &pixelData);
-
- const size_t dataLength = pixelData.size();
- const unsigned char* data = pixelData.data();
-
- printPNG(data, dataLength);
-}
-
-void computeMD5HashStringForBitmapContext(BitmapContext* context, char hashString[33])
-{
- cairo_t* bitmapContext = context->cairoContext();
- cairo_surface_t* surface = cairo_get_target(bitmapContext);
-
- ASSERT(cairo_image_surface_get_format(surface) == CAIRO_FORMAT_ARGB32); // ImageDiff assumes 32 bit RGBA, we must as well.
-
- size_t pixelsHigh = cairo_image_surface_get_height(surface);
- size_t pixelsWide = cairo_image_surface_get_width(surface);
- size_t bytesPerRow = pixelsWide * cairo_image_surface_get_stride(surface);
-
- MD5_CTX md5Context;
- MD5_Init(&md5Context);
- unsigned char* bitmapData = static_cast<unsigned char*>(cairo_image_surface_get_data(surface));
- for (unsigned row = 0; row < pixelsHigh; row++) {
- MD5_Update(&md5Context, bitmapData, 4 * pixelsWide);
- bitmapData += bytesPerRow;
- }
- unsigned char hash[16];
- MD5_Final(hash, &md5Context);
-
- hashString[0] = '\0';
- for (int i = 0; i < 16; i++)
- snprintf(hashString, 33, "%s%02x", hashString, hash[i]);
-}
-
-void dumpBitmap(BitmapContext* context)
-{
- cairo_surface_t* surface = cairo_get_target(context->cairoContext());
- printPNG(surface);
-}
+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * (C) 2009 Brent Fulgham <bfulgham@webkit.org>
+ * (C) 2010 Igalia S.L
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h"
+#include "PixelDumpSupportCairo.h"
+
+#include "DumpRenderTree.h"
+#include "PixelDumpSupport.h"
+#include <algorithm>
+#include <ctype.h>
+#include <wtf/Assertions.h>
+#include <wtf/MD5.h>
+#include <wtf/RefPtr.h>
+#include <wtf/StringExtras.h>
+
+using namespace std;
+
+static cairo_status_t writeFunction(void* closure, const unsigned char* data, unsigned int length)
+{
+ Vector<unsigned char>* in = reinterpret_cast<Vector<unsigned char>*>(closure);
+ in->append(data, length);
+ return CAIRO_STATUS_SUCCESS;
+}
+
+static void printPNG(cairo_surface_t* image)
+{
+ Vector<unsigned char> pixelData;
+ // Only PNG output is supported for now.
+ cairo_surface_write_to_png_stream(image, writeFunction, &pixelData);
+
+ const size_t dataLength = pixelData.size();
+ const unsigned char* data = pixelData.data();
+
+ printPNG(data, dataLength);
+}
+
+void computeMD5HashStringForBitmapContext(BitmapContext* context, char hashString[33])
+{
+ cairo_t* bitmapContext = context->cairoContext();
+ cairo_surface_t* surface = cairo_get_target(bitmapContext);
+
+ ASSERT(cairo_image_surface_get_format(surface) == CAIRO_FORMAT_ARGB32); // ImageDiff assumes 32 bit RGBA, we must as well.
+
+ size_t pixelsHigh = cairo_image_surface_get_height(surface);
+ size_t pixelsWide = cairo_image_surface_get_width(surface);
+ size_t bytesPerRow = cairo_image_surface_get_stride(surface);
+
+ MD5 md5Context;
+ unsigned char* bitmapData = static_cast<unsigned char*>(cairo_image_surface_get_data(surface));
+ for (unsigned row = 0; row < pixelsHigh; row++) {
+ md5Context.addBytes(bitmapData, 4 * pixelsWide);
+ bitmapData += bytesPerRow;
+ }
+ Vector<uint8_t, 16> hash;
+ md5Context.checksum(hash);
+
+ snprintf(hashString, 33, "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
+ hash[0], hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7],
+ hash[8], hash[9], hash[10], hash[11], hash[12], hash[13], hash[14], hash[15]);
+}
+
+void dumpBitmap(BitmapContext* context)
+{
+ cairo_surface_t* surface = cairo_get_target(context->cairoContext());
+ printPNG(surface);
+}
diff --git a/WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.h b/WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.h
index d1a0c3f..fa1f48b 100644
--- a/WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.h
+++ b/WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.h
@@ -36,6 +36,8 @@
#if PLATFORM(WIN)
#include <windows.h>
#include <cairo-win32.h>
+#elif PLATFORM(GTK)
+#include <cairo.h>
#endif
#if PLATFORM(WIN)
@@ -68,16 +70,12 @@ private:
BitmapContext(PlatformBitmapBuffer buffer, cairo_t* context)
: m_buffer(buffer)
+ , m_context(context)
{
- if (m_context)
- cairo_destroy(m_context);
-
- m_context = context;
}
PlatformBitmapBuffer m_buffer;
cairo_t* m_context;
-
};
#endif // PixelDumpSupportCairo_h
diff --git a/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.cpp b/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.cpp
new file mode 100644
index 0000000..4d77454
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.cpp
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2007, 2008, 2009, 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 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 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 "WebArchiveDumpSupport.h"
+
+#import <CoreFoundation/CoreFoundation.h>
+#import <CFNetwork/CFNetwork.h>
+#import <wtf/RetainPtr.h>
+
+extern "C" {
+
+CFURLRef CFURLResponseGetURL(CFURLResponseRef response);
+CFStringRef CFURLResponseGetMIMEType(CFURLResponseRef response);
+CFStringRef CFURLResponseGetTextEncodingName(CFURLResponseRef response);
+SInt64 CFURLResponseGetExpectedContentLength(CFURLResponseRef response);
+CFHTTPMessageRef CFURLResponseGetHTTPResponse(CFURLResponseRef response);
+
+CFTypeID CFURLResponseGetTypeID(void);
+
+}
+
+static void convertMIMEType(CFMutableStringRef mimeType)
+{
+#ifdef BUILDING_ON_LEOPARD
+ // Workaround for <rdar://problem/5539824> on Leopard
+ if (CFStringCompare(mimeType, CFSTR("text/xml"), kCFCompareAnchored | kCFCompareCaseInsensitive) == kCFCompareEqualTo)
+ CFStringReplaceAll(mimeType, CFSTR("application/xml"));
+#endif
+ // Workaround for <rdar://problem/6234318> with Dashcode 2.0
+ if (CFStringCompare(mimeType, CFSTR("application/x-javascript"), kCFCompareAnchored | kCFCompareCaseInsensitive) == kCFCompareEqualTo)
+ CFStringReplaceAll(mimeType, CFSTR("text/javascript"));
+}
+
+static void convertWebResourceDataToString(CFMutableDictionaryRef resource)
+{
+ CFMutableStringRef mimeType = (CFMutableStringRef)CFDictionaryGetValue(resource, CFSTR("WebResourceMIMEType"));
+ CFStringLowercase(mimeType, CFLocaleGetSystem());
+ convertMIMEType(mimeType);
+
+ CFArrayRef supportedMIMETypes = supportedNonImageMIMETypes();
+ if (CFStringHasPrefix(mimeType, CFSTR("text/")) || CFArrayContainsValue(supportedMIMETypes, CFRangeMake(0, CFArrayGetCount(supportedMIMETypes)), mimeType)) {
+ CFStringRef textEncodingName = static_cast<CFStringRef>(CFDictionaryGetValue(resource, CFSTR("WebResourceTextEncodingName")));
+ CFStringEncoding stringEncoding;
+ if (textEncodingName && CFStringGetLength(textEncodingName))
+ stringEncoding = CFStringConvertIANACharSetNameToEncoding(textEncodingName);
+ else
+ stringEncoding = kCFStringEncodingUTF8;
+
+ CFDataRef data = static_cast<CFDataRef>(CFDictionaryGetValue(resource, CFSTR("WebResourceData")));
+ RetainPtr<CFStringRef> dataAsString(AdoptCF, CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, data, stringEncoding));
+ if (dataAsString)
+ CFDictionarySetValue(resource, CFSTR("WebResourceData"), dataAsString.get());
+ }
+}
+
+static void normalizeHTTPResponseHeaderFields(CFMutableDictionaryRef fields)
+{
+ // Normalize headers
+ if (CFDictionaryContainsKey(fields, CFSTR("Date")))
+ CFDictionarySetValue(fields, CFSTR("Date"), CFSTR("Sun, 16 Nov 2008 17:00:00 GMT"));
+ if (CFDictionaryContainsKey(fields, CFSTR("Last-Modified")))
+ CFDictionarySetValue(fields, CFSTR("Last-Modified"), CFSTR("Sun, 16 Nov 2008 16:55:00 GMT"));
+ if (CFDictionaryContainsKey(fields, CFSTR("Etag")))
+ CFDictionarySetValue(fields, CFSTR("Etag"), CFSTR("\"301925-21-45c7d72d3e780\""));
+ if (CFDictionaryContainsKey(fields, CFSTR("Server")))
+ CFDictionarySetValue(fields, CFSTR("Server"), CFSTR("Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l PHP/5.2.6"));
+
+ // Remove headers
+ CFDictionaryRemoveValue(fields, CFSTR("Connection"));
+ CFDictionaryRemoveValue(fields, CFSTR("Keep-Alive"));
+}
+
+static void normalizeWebResourceURL(CFMutableStringRef webResourceURL)
+{
+ static CFIndex fileUrlLength = CFStringGetLength(CFSTR("file://"));
+ CFRange layoutTestsWebArchivePathRange = CFStringFind(webResourceURL, CFSTR("/LayoutTests/"), kCFCompareBackwards);
+ if (layoutTestsWebArchivePathRange.location == kCFNotFound)
+ return;
+ CFRange currentWorkingDirectoryRange = CFRangeMake(fileUrlLength, layoutTestsWebArchivePathRange.location - fileUrlLength);
+ CFStringReplace(webResourceURL, currentWorkingDirectoryRange, CFSTR(""));
+}
+
+static void convertWebResourceResponseToDictionary(CFMutableDictionaryRef propertyList)
+{
+ CFDataRef responseData = static_cast<CFDataRef>(CFDictionaryGetValue(propertyList, CFSTR("WebResourceResponse"))); // WebResourceResponseKey in WebResource.m
+ if (CFGetTypeID(responseData) != CFDataGetTypeID())
+ return;
+
+ RetainPtr<CFURLResponseRef> response(AdoptCF, createCFURLResponseFromResponseData(responseData));
+ if (!response)
+ return;
+
+ RetainPtr<CFMutableDictionaryRef> responseDictionary(AdoptCF, CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+
+ RetainPtr<CFMutableStringRef> urlString(AdoptCF, CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFURLGetString(CFURLResponseGetURL(response.get()))));
+ normalizeWebResourceURL(urlString.get());
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("URL"), urlString.get());
+
+ RetainPtr<CFMutableStringRef> mimeTypeString(AdoptCF, CFStringCreateMutableCopy(kCFAllocatorDefault, 0, CFURLResponseGetMIMEType(response.get())));
+ convertMIMEType(mimeTypeString.get());
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("MIMEType"), mimeTypeString.get());
+
+ CFStringRef textEncodingName = CFURLResponseGetTextEncodingName(response.get());
+ if (textEncodingName)
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("textEncodingName"), textEncodingName);
+
+ SInt64 expectedContentLength = CFURLResponseGetExpectedContentLength(response.get());
+ RetainPtr<CFNumberRef> expectedContentLengthNumber(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &expectedContentLength));
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("expectedContentLength"), expectedContentLengthNumber.get());
+
+ if (CFHTTPMessageRef httpMessage = CFURLResponseGetHTTPResponse(response.get())) {
+ RetainPtr<CFDictionaryRef> allHeaders(AdoptCF, CFHTTPMessageCopyAllHeaderFields(httpMessage));
+ RetainPtr<CFMutableDictionaryRef> allHeaderFields(AdoptCF, CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, allHeaders.get()));
+ normalizeHTTPResponseHeaderFields(allHeaderFields.get());
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("allHeaderFields"), allHeaderFields.get());
+
+ CFIndex statusCode = CFHTTPMessageGetResponseStatusCode(httpMessage);
+ RetainPtr<CFNumberRef> statusCodeNumber(AdoptCF, CFNumberCreate(kCFAllocatorDefault, kCFNumberCFIndexType, &statusCode));
+ CFDictionarySetValue(responseDictionary.get(), CFSTR("statusCode"), statusCodeNumber.get());
+ }
+
+ CFDictionarySetValue(propertyList, CFSTR("WebResourceResponse"), responseDictionary.get());
+}
+
+static CFComparisonResult compareResourceURLs(const void *val1, const void *val2, void *context)
+{
+ CFStringRef url1 = static_cast<CFStringRef>(CFDictionaryGetValue(static_cast<CFDictionaryRef>(val1), CFSTR("WebResourceURL")));
+ CFStringRef url2 = static_cast<CFStringRef>(CFDictionaryGetValue(static_cast<CFDictionaryRef>(val2), CFSTR("WebResourceURL")));
+
+ return CFStringCompare(url1, url2, kCFCompareAnchored);
+}
+
+CFStringRef createXMLStringFromWebArchiveData(CFDataRef webArchiveData)
+{
+ CFErrorRef error = 0;
+ CFPropertyListFormat format = kCFPropertyListBinaryFormat_v1_0;
+
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+ CFIndex bytesCount = CFDataGetLength(webArchiveData);
+ RetainPtr<CFReadStreamRef> readStream(AdoptCF, CFReadStreamCreateWithBytesNoCopy(kCFAllocatorDefault, CFDataGetBytePtr(webArchiveData), bytesCount, kCFAllocatorNull));
+ CFReadStreamOpen(readStream.get());
+ RetainPtr<CFMutableDictionaryRef> propertyList(AdoptCF, (CFMutableDictionaryRef)CFPropertyListCreateFromStream(kCFAllocatorDefault, readStream.get(), bytesCount, kCFPropertyListMutableContainersAndLeaves, &format, 0));
+ CFReadStreamClose(readStream.get());
+#else
+ RetainPtr<CFMutableDictionaryRef> propertyList(AdoptCF, (CFMutableDictionaryRef)CFPropertyListCreateWithData(kCFAllocatorDefault, webArchiveData, kCFPropertyListMutableContainersAndLeaves, &format, &error));
+#endif
+
+ if (!propertyList) {
+ if (error)
+ return CFErrorCopyDescription(error);
+ return static_cast<CFStringRef>(CFRetain(CFSTR("An unknown error occurred converting data to property list.")));
+ }
+
+ RetainPtr<CFMutableArrayRef> resources(AdoptCF, CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks));
+ CFArrayAppendValue(resources.get(), propertyList.get());
+
+ while (CFArrayGetCount(resources.get())) {
+ RetainPtr<CFMutableDictionaryRef> resourcePropertyList = (CFMutableDictionaryRef)CFArrayGetValueAtIndex(resources.get(), 0);
+ CFArrayRemoveValueAtIndex(resources.get(), 0);
+
+ CFMutableDictionaryRef mainResource = (CFMutableDictionaryRef)CFDictionaryGetValue(resourcePropertyList.get(), CFSTR("WebMainResource"));
+ normalizeWebResourceURL((CFMutableStringRef)CFDictionaryGetValue(mainResource, CFSTR("WebResourceURL")));
+ convertWebResourceDataToString(mainResource);
+
+ // Add subframeArchives to list for processing
+ CFMutableArrayRef subframeArchives = (CFMutableArrayRef)CFDictionaryGetValue(resourcePropertyList.get(), CFSTR("WebSubframeArchives")); // WebSubframeArchivesKey in WebArchive.m
+ if (subframeArchives)
+ CFArrayAppendArray(resources.get(), subframeArchives, CFRangeMake(0, CFArrayGetCount(subframeArchives)));
+
+ CFMutableArrayRef subresources = (CFMutableArrayRef)CFDictionaryGetValue(resourcePropertyList.get(), CFSTR("WebSubresources")); // WebSubresourcesKey in WebArchive.m
+ if (!subresources)
+ continue;
+
+ CFIndex subresourcesCount = CFArrayGetCount(subresources);
+ for (CFIndex i = 0; i < subresourcesCount; ++i) {
+ CFMutableDictionaryRef subresourcePropertyList = (CFMutableDictionaryRef)CFArrayGetValueAtIndex(subresources, i);
+ normalizeWebResourceURL((CFMutableStringRef)CFDictionaryGetValue(subresourcePropertyList, CFSTR("WebResourceURL")));
+ convertWebResourceResponseToDictionary(subresourcePropertyList);
+ convertWebResourceDataToString(subresourcePropertyList);
+ }
+
+ // Sort the subresources so they're always in a predictable order for the dump
+ CFArraySortValues(subresources, CFRangeMake(0, CFArrayGetCount(subresources)), compareResourceURLs, 0);
+ }
+
+ error = 0;
+
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
+ RetainPtr<CFDataRef> xmlData(AdoptCF, CFPropertyListCreateXMLData(kCFAllocatorDefault, propertyList.get()));
+#else
+ RetainPtr<CFDataRef> xmlData(AdoptCF, CFPropertyListCreateData(kCFAllocatorDefault, propertyList.get(), kCFPropertyListXMLFormat_v1_0, 0, &error));
+#endif
+
+ if (!xmlData) {
+ if (error)
+ return CFErrorCopyDescription(error);
+ return static_cast<CFStringRef>(CFRetain(CFSTR("An unknown error occurred converting property list to data.")));
+ }
+
+ RetainPtr<CFStringRef> xmlString(AdoptCF, CFStringCreateFromExternalRepresentation(kCFAllocatorDefault, xmlData.get(), kCFStringEncodingUTF8));
+ RetainPtr<CFMutableStringRef> string(AdoptCF, CFStringCreateMutableCopy(kCFAllocatorDefault, 0, xmlString.get()));
+
+ // Replace "Apple Computer" with "Apple" in the DTD declaration.
+ CFStringFindAndReplace(string.get(), CFSTR("-//Apple Computer//"), CFSTR("-//Apple//"), CFRangeMake(0, CFStringGetLength(string.get())), 0);
+
+ return string.releaseRef();
+}
diff --git a/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.h b/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.h
new file mode 100644
index 0000000..08d9c45
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/cf/WebArchiveDumpSupport.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2007, 2008, 2009, 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 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 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 WebArchiveDumpSupport_h
+#define WebArchiveDumpSupport_h
+
+#include <CoreFoundation/CoreFoundation.h>
+
+typedef struct _CFURLResponse* CFURLResponseRef;
+
+CFStringRef createXMLStringFromWebArchiveData(CFDataRef webArchiveData);
+
+#pragma mark -
+#pragma mark Platform-specific methods
+
+CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseData);
+CFArrayRef supportedNonImageMIMETypes();
+
+#endif /* WebArchiveDumpSupport_h */
diff --git a/WebKitTools/DumpRenderTree/chromium/AccessibilityController.cpp b/WebKitTools/DumpRenderTree/chromium/AccessibilityController.cpp
new file mode 100644
index 0000000..5601d9d
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/AccessibilityController.cpp
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "AccessibilityController.h"
+
+#include "TestShell.h"
+#include "WebAccessibilityCache.h"
+#include "WebAccessibilityObject.h"
+#include "WebFrame.h"
+#include "WebString.h"
+#include "WebView.h"
+
+using namespace WebKit;
+
+AccessibilityController::AccessibilityController(TestShell* shell)
+ : m_shell(shell)
+{
+
+ bindMethod("dumpAccessibilityNotifications", &AccessibilityController::dumpAccessibilityNotifications);
+ bindMethod("logFocusEvents", &AccessibilityController::logFocusEventsCallback);
+ bindMethod("logScrollingStartEvents", &AccessibilityController::logScrollingStartEventsCallback);
+
+ bindProperty("focusedElement", &AccessibilityController::focusedElementGetterCallback);
+ bindProperty("rootElement", &AccessibilityController::rootElementGetterCallback);
+
+ bindFallbackMethod(&AccessibilityController::fallbackCallback);
+}
+
+void AccessibilityController::bindToJavascript(WebFrame* frame, const WebString& classname)
+{
+ WebAccessibilityCache::enableAccessibility();
+ CppBoundClass::bindToJavascript(frame, classname);
+}
+
+void AccessibilityController::reset()
+{
+ m_rootElement = WebAccessibilityObject();
+ m_focusedElement = WebAccessibilityObject();
+ m_elements.clear();
+
+ m_dumpAccessibilityNotifications = false;
+}
+
+void AccessibilityController::setFocusedElement(const WebAccessibilityObject& focusedElement)
+{
+ m_focusedElement = focusedElement;
+}
+
+AccessibilityUIElement* AccessibilityController::getFocusedElement()
+{
+ if (m_focusedElement.isNull())
+ m_focusedElement = m_shell->webView()->accessibilityObject();
+ return m_elements.create(m_focusedElement);
+}
+
+AccessibilityUIElement* AccessibilityController::getRootElement()
+{
+ if (m_rootElement.isNull())
+ m_rootElement = m_shell->webView()->accessibilityObject();
+ return m_elements.createRoot(m_rootElement);
+}
+
+void AccessibilityController::dumpAccessibilityNotifications(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpAccessibilityNotifications = true;
+ result->setNull();
+}
+
+void AccessibilityController::logFocusEventsCallback(const CppArgumentList&, CppVariant* result)
+{
+ // As of r49031, this is not being used upstream.
+ result->setNull();
+}
+
+void AccessibilityController::logScrollingStartEventsCallback(const CppArgumentList&, CppVariant* result)
+{
+ // As of r49031, this is not being used upstream.
+ result->setNull();
+}
+
+void AccessibilityController::focusedElementGetterCallback(CppVariant* result)
+{
+ result->set(*(getFocusedElement()->getAsCppVariant()));
+}
+
+void AccessibilityController::rootElementGetterCallback(CppVariant* result)
+{
+ result->set(*(getRootElement()->getAsCppVariant()));
+}
+
+void AccessibilityController::fallbackCallback(const CppArgumentList&, CppVariant* result)
+{
+ printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on "
+ "AccessibilityController\n");
+ result->setNull();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/AccessibilityController.h b/WebKitTools/DumpRenderTree/chromium/AccessibilityController.h
new file mode 100644
index 0000000..0817ec3
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/AccessibilityController.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AccessibilityController_h
+#define AccessibilityController_h
+
+#include "AccessibilityUIElement.h"
+#include "CppBoundClass.h"
+
+namespace WebKit {
+class WebAccessibilityObject;
+class WebFrame;
+}
+
+class TestShell;
+
+class AccessibilityController : public CppBoundClass {
+public:
+ explicit AccessibilityController(TestShell*);
+
+ // Shadow to include accessibility initialization.
+ void bindToJavascript(WebKit::WebFrame*, const WebKit::WebString& classname);
+ void reset();
+
+ void setFocusedElement(const WebKit::WebAccessibilityObject&);
+ AccessibilityUIElement* getFocusedElement();
+ AccessibilityUIElement* getRootElement();
+
+ // This function sets a flag that tells the test_shell to dump all
+ // accessibility notifications.
+ void dumpAccessibilityNotifications(const CppArgumentList&, CppVariant*);
+
+public:
+ // The following methods are not exposed to JavaScript.
+ bool shouldDumpAccessibilityNotifications() { return m_dumpAccessibilityNotifications; }
+
+private:
+ // If true, the test_shell will dump all accessibility notifications.
+ bool m_dumpAccessibilityNotifications;
+
+ // Bound methods and properties
+ void logFocusEventsCallback(const CppArgumentList&, CppVariant*);
+ void logScrollingStartEventsCallback(const CppArgumentList&, CppVariant*);
+ void fallbackCallback(const CppArgumentList&, CppVariant*);
+
+ void focusedElementGetterCallback(CppVariant*);
+ void rootElementGetterCallback(CppVariant*);
+
+ WebKit::WebAccessibilityObject m_focusedElement;
+ WebKit::WebAccessibilityObject m_rootElement;
+
+ AccessibilityUIElementList m_elements;
+
+ TestShell* m_shell;
+};
+
+#endif // AccessibilityController_h
diff --git a/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.cpp b/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.cpp
new file mode 100644
index 0000000..dbd025a
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.cpp
@@ -0,0 +1,585 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "AccessibilityUIElement.h"
+
+#include "WebAccessibilityObject.h"
+#include "WebCString.h"
+#include "WebString.h"
+#include <wtf/Assertions.h>
+
+using namespace WebKit;
+using namespace std;
+
+// Map role value to string, matching Safari/Mac platform implementation to
+// avoid rebaselining layout tests.
+static string roleToString(WebAccessibilityRole role)
+{
+ string result = "AXRole: AX";
+ switch (role) {
+ case WebAccessibilityRoleButton:
+ return result.append("Button");
+ case WebAccessibilityRoleRadioButton:
+ return result.append("RadioButton");
+ case WebAccessibilityRoleCheckBox:
+ return result.append("CheckBox");
+ case WebAccessibilityRoleSlider:
+ return result.append("Slider");
+ case WebAccessibilityRoleTabGroup:
+ return result.append("TabGroup");
+ case WebAccessibilityRoleTextField:
+ return result.append("TextField");
+ case WebAccessibilityRoleStaticText:
+ return result.append("StaticText");
+ case WebAccessibilityRoleTextArea:
+ return result.append("TextArea");
+ case WebAccessibilityRoleScrollArea:
+ return result.append("ScrollArea");
+ case WebAccessibilityRolePopUpButton:
+ return result.append("PopUpButton");
+ case WebAccessibilityRoleMenuButton:
+ return result.append("MenuButton");
+ case WebAccessibilityRoleTable:
+ return result.append("Table");
+ case WebAccessibilityRoleApplication:
+ return result.append("Application");
+ case WebAccessibilityRoleGroup:
+ return result.append("Group");
+ case WebAccessibilityRoleRadioGroup:
+ return result.append("RadioGroup");
+ case WebAccessibilityRoleList:
+ return result.append("List");
+ case WebAccessibilityRoleScrollBar:
+ return result.append("ScrollBar");
+ case WebAccessibilityRoleValueIndicator:
+ return result.append("ValueIndicator");
+ case WebAccessibilityRoleImage:
+ return result.append("Image");
+ case WebAccessibilityRoleMenuBar:
+ return result.append("MenuBar");
+ case WebAccessibilityRoleMenu:
+ return result.append("Menu");
+ case WebAccessibilityRoleMenuItem:
+ return result.append("MenuItem");
+ case WebAccessibilityRoleColumn:
+ return result.append("Column");
+ case WebAccessibilityRoleRow:
+ return result.append("Row");
+ case WebAccessibilityRoleToolbar:
+ return result.append("Toolbar");
+ case WebAccessibilityRoleBusyIndicator:
+ return result.append("BusyIndicator");
+ case WebAccessibilityRoleProgressIndicator:
+ return result.append("ProgressIndicator");
+ case WebAccessibilityRoleWindow:
+ return result.append("Window");
+ case WebAccessibilityRoleDrawer:
+ return result.append("Drawer");
+ case WebAccessibilityRoleSystemWide:
+ return result.append("SystemWide");
+ case WebAccessibilityRoleOutline:
+ return result.append("Outline");
+ case WebAccessibilityRoleIncrementor:
+ return result.append("Incrementor");
+ case WebAccessibilityRoleBrowser:
+ return result.append("Browser");
+ case WebAccessibilityRoleComboBox:
+ return result.append("ComboBox");
+ case WebAccessibilityRoleSplitGroup:
+ return result.append("SplitGroup");
+ case WebAccessibilityRoleSplitter:
+ return result.append("Splitter");
+ case WebAccessibilityRoleColorWell:
+ return result.append("ColorWell");
+ case WebAccessibilityRoleGrowArea:
+ return result.append("GrowArea");
+ case WebAccessibilityRoleSheet:
+ return result.append("Sheet");
+ case WebAccessibilityRoleHelpTag:
+ return result.append("HelpTag");
+ case WebAccessibilityRoleMatte:
+ return result.append("Matte");
+ case WebAccessibilityRoleRuler:
+ return result.append("Ruler");
+ case WebAccessibilityRoleRulerMarker:
+ return result.append("RulerMarker");
+ case WebAccessibilityRoleLink:
+ return result.append("Link");
+ case WebAccessibilityRoleDisclosureTriangle:
+ return result.append("DisclosureTriangle");
+ case WebAccessibilityRoleGrid:
+ return result.append("Grid");
+ case WebAccessibilityRoleCell:
+ return result.append("Cell");
+ case WebAccessibilityRoleColumnHeader:
+ return result.append("ColumnHeader");
+ case WebAccessibilityRoleRowHeader:
+ return result.append("RowHeader");
+ case WebAccessibilityRoleWebCoreLink:
+ // Maps to Link role.
+ return result.append("Link");
+ case WebAccessibilityRoleImageMapLink:
+ return result.append("ImageMapLink");
+ case WebAccessibilityRoleImageMap:
+ return result.append("ImageMap");
+ case WebAccessibilityRoleListMarker:
+ return result.append("ListMarker");
+ case WebAccessibilityRoleWebArea:
+ return result.append("WebArea");
+ case WebAccessibilityRoleHeading:
+ return result.append("Heading");
+ case WebAccessibilityRoleListBox:
+ return result.append("ListBox");
+ case WebAccessibilityRoleListBoxOption:
+ return result.append("ListBoxOption");
+ case WebAccessibilityRoleTableHeaderContainer:
+ return result.append("TableHeaderContainer");
+ case WebAccessibilityRoleDefinitionListTerm:
+ return result.append("DefinitionListTerm");
+ case WebAccessibilityRoleDefinitionListDefinition:
+ return result.append("DefinitionListDefinition");
+ case WebAccessibilityRoleAnnotation:
+ return result.append("Annotation");
+ case WebAccessibilityRoleSliderThumb:
+ return result.append("SliderThumb");
+ case WebAccessibilityRoleLandmarkApplication:
+ return result.append("LandmarkApplication");
+ case WebAccessibilityRoleLandmarkBanner:
+ return result.append("LandmarkBanner");
+ case WebAccessibilityRoleLandmarkComplementary:
+ return result.append("LandmarkComplementary");
+ case WebAccessibilityRoleLandmarkContentInfo:
+ return result.append("LandmarkContentInfo");
+ case WebAccessibilityRoleLandmarkMain:
+ return result.append("LandmarkMain");
+ case WebAccessibilityRoleLandmarkNavigation:
+ return result.append("LandmarkNavigation");
+ case WebAccessibilityRoleLandmarkSearch:
+ return result.append("LandmarkSearch");
+ case WebAccessibilityRoleApplicationLog:
+ return result.append("ApplicationLog");
+ case WebAccessibilityRoleApplicationMarquee:
+ return result.append("ApplicationMarquee");
+ case WebAccessibilityRoleApplicationStatus:
+ return result.append("ApplicationStatus");
+ case WebAccessibilityRoleApplicationTimer:
+ return result.append("ApplicationTimer");
+ case WebAccessibilityRoleDocument:
+ return result.append("Document");
+ case WebAccessibilityRoleDocumentArticle:
+ return result.append("DocumentArticle");
+ case WebAccessibilityRoleDocumentNote:
+ return result.append("DocumentNote");
+ case WebAccessibilityRoleDocumentRegion:
+ return result.append("DocumentRegion");
+ case WebAccessibilityRoleUserInterfaceTooltip:
+ return result.append("UserInterfaceTooltip");
+ default:
+ // Also matches WebAccessibilityRoleUnknown.
+ return result.append("Unknown");
+ }
+}
+
+string getDescription(const WebAccessibilityObject& object)
+{
+ string description = object.accessibilityDescription().utf8();
+ return description.insert(0, "AXDescription: ");
+}
+
+string getRole(const WebAccessibilityObject& object)
+{
+ return roleToString(object.roleValue());
+}
+
+string getTitle(const WebAccessibilityObject& object)
+{
+ string title = object.title().utf8();
+ return title.insert(0, "AXTitle: ");
+}
+
+string getAttributes(const WebAccessibilityObject& object)
+{
+ // FIXME: Concatenate all attributes of the AccessibilityObject.
+ string attributes(getTitle(object));
+ attributes.append("\n");
+ attributes.append(getRole(object));
+ attributes.append("\n");
+ attributes.append(getDescription(object));
+ return attributes;
+}
+
+
+// Collects attributes into a string, delimited by dashes. Used by all methods
+// that output lists of attributes: attributesOfLinkedUIElementsCallback,
+// AttributesOfChildrenCallback, etc.
+class AttributesCollector {
+public:
+ void collectAttributes(const WebAccessibilityObject& object)
+ {
+ m_attributes.append("\n------------\n");
+ m_attributes.append(getAttributes(object));
+ }
+
+ string attributes() const { return m_attributes; }
+
+private:
+ string m_attributes;
+};
+
+AccessibilityUIElement::AccessibilityUIElement(const WebAccessibilityObject& object, Factory* factory)
+ : m_accessibilityObject(object)
+ , m_factory(factory)
+{
+
+ ASSERT(factory);
+
+ bindMethod("allAttributes", &AccessibilityUIElement::allAttributesCallback);
+ bindMethod("attributesOfLinkedUIElements",
+ &AccessibilityUIElement::attributesOfLinkedUIElementsCallback);
+ bindMethod("attributesOfDocumentLinks",
+ &AccessibilityUIElement::attributesOfDocumentLinksCallback);
+ bindMethod("attributesOfChildren",
+ &AccessibilityUIElement::attributesOfChildrenCallback);
+ bindMethod("parameterizedAttributeNames",
+ &AccessibilityUIElement::parametrizedAttributeNamesCallback);
+ bindMethod("lineForIndex", &AccessibilityUIElement::lineForIndexCallback);
+ bindMethod("boundsForRange", &AccessibilityUIElement::boundsForRangeCallback);
+ bindMethod("stringForRange", &AccessibilityUIElement::stringForRangeCallback);
+ bindMethod("childAtIndex", &AccessibilityUIElement::childAtIndexCallback);
+ bindMethod("elementAtPoint", &AccessibilityUIElement::elementAtPointCallback);
+ bindMethod("attributesOfColumnHeaders",
+ &AccessibilityUIElement::attributesOfColumnHeadersCallback);
+ bindMethod("attributesOfRowHeaders",
+ &AccessibilityUIElement::attributesOfRowHeadersCallback);
+ bindMethod("attributesOfColumns",
+ &AccessibilityUIElement::attributesOfColumnsCallback);
+ bindMethod("attributesOfRows",
+ &AccessibilityUIElement::attributesOfRowsCallback);
+ bindMethod("attributesOfVisibleCells",
+ &AccessibilityUIElement::attributesOfVisibleCellsCallback);
+ bindMethod("attributesOfHeader",
+ &AccessibilityUIElement::attributesOfHeaderCallback);
+ bindMethod("indexInTable", &AccessibilityUIElement::indexInTableCallback);
+ bindMethod("rowIndexRange", &AccessibilityUIElement::rowIndexRangeCallback);
+ bindMethod("columnIndexRange",
+ &AccessibilityUIElement::columnIndexRangeCallback);
+ bindMethod("cellForColumnAndRow",
+ &AccessibilityUIElement::cellForColumnAndRowCallback);
+ bindMethod("titleUIElement", &AccessibilityUIElement::titleUIElementCallback);
+ bindMethod("setSelectedTextRange",
+ &AccessibilityUIElement::setSelectedTextRangeCallback);
+ bindMethod("attributeValue", &AccessibilityUIElement::attributeValueCallback);
+ bindMethod("isAttributeSettable",
+ &AccessibilityUIElement::isAttributeSettableCallback);
+ bindMethod("isActionSupported",
+ &AccessibilityUIElement::isActionSupportedCallback);
+ bindMethod("parentElement", &AccessibilityUIElement::parentElementCallback);
+ bindMethod("increment", &AccessibilityUIElement::incrementCallback);
+ bindMethod("decrement", &AccessibilityUIElement::decrementCallback);
+
+ bindProperty("role", &AccessibilityUIElement::roleGetterCallback);
+ bindProperty("subrole", &m_subrole);
+ bindProperty("title", &AccessibilityUIElement::titleGetterCallback);
+ bindProperty("description",
+ &AccessibilityUIElement::descriptionGetterCallback);
+ bindProperty("language", &m_language);
+ bindProperty("x", &m_x);
+ bindProperty("y", &m_y);
+ bindProperty("width", &m_width);
+ bindProperty("height", &m_height);
+ bindProperty("clickPointX", &m_clickPointX);
+ bindProperty("clickPointY", &m_clickPointY);
+ bindProperty("intValue", &m_intValue);
+ bindProperty("minValue", &m_minValue);
+ bindProperty("maxValue", &m_maxValue);
+ bindProperty("childrenCount",
+ &AccessibilityUIElement::childrenCountGetterCallback);
+ bindProperty("insertionPointLineNumber", &m_insertionPointLineNumber);
+ bindProperty("selectedTextRange", &m_selectedTextRange);
+ bindProperty("isEnabled", &AccessibilityUIElement::isEnabledGetterCallback);
+ bindProperty("isRequired", &m_isRequired);
+ bindProperty("isSelected", &AccessibilityUIElement::isSelectedGetterCallback);
+ bindProperty("valueDescription", &m_valueDescription);
+
+ bindFallbackMethod(&AccessibilityUIElement::fallbackCallback);
+}
+
+AccessibilityUIElement* AccessibilityUIElement::getChildAtIndex(unsigned index)
+{
+ return m_factory->create(accessibilityObject().childAt(index));
+}
+
+void AccessibilityUIElement::allAttributesCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->set(getAttributes(accessibilityObject()));
+}
+
+void AccessibilityUIElement::attributesOfLinkedUIElementsCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfDocumentLinksCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfChildrenCallback(const CppArgumentList& arguments, CppVariant* result)
+{
+ AttributesCollector collector;
+ unsigned size = accessibilityObject().childCount();
+ for (unsigned i = 0; i < size; ++i)
+ collector.collectAttributes(accessibilityObject().childAt(i));
+ result->set(collector.attributes());
+}
+
+void AccessibilityUIElement::parametrizedAttributeNamesCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::lineForIndexCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::boundsForRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::stringForRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::childAtIndexCallback(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (!arguments.size() || !arguments[0].isNumber()) {
+ result->setNull();
+ return;
+ }
+
+ AccessibilityUIElement* child = getChildAtIndex(arguments[0].toInt32());
+ if (!child) {
+ result->setNull();
+ return;
+ }
+
+ result->set(*(child->getAsCppVariant()));
+}
+
+void AccessibilityUIElement::elementAtPointCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfColumnHeadersCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfRowHeadersCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfColumnsCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfRowsCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfVisibleCellsCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::attributesOfHeaderCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::indexInTableCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::rowIndexRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::columnIndexRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::cellForColumnAndRowCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::titleUIElementCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::setSelectedTextRangeCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::attributeValueCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::isAttributeSettableCallback(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() < 1 && !arguments[0].isString()) {
+ result->setNull();
+ return;
+ }
+
+ string attribute = arguments[0].toString();
+ bool settable = false;
+ if (attribute == "AXValue")
+ settable = accessibilityObject().canSetValueAttribute();
+ result->set(settable);
+}
+
+void AccessibilityUIElement::isActionSupportedCallback(const CppArgumentList&, CppVariant* result)
+{
+ // This one may be really hard to implement.
+ // Not exposed by AccessibilityObject.
+ result->setNull();
+}
+
+void AccessibilityUIElement::parentElementCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::incrementCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::decrementCallback(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::fallbackCallback(const CppArgumentList &, CppVariant* result)
+{
+ // FIXME: Implement this.
+ result->setNull();
+}
+
+void AccessibilityUIElement::childrenCountGetterCallback(CppVariant* result)
+{
+ int count = 1; // Root object always has only one child, the WebView.
+ if (!isRoot())
+ count = accessibilityObject().childCount();
+ result->set(count);
+}
+
+void AccessibilityUIElement::descriptionGetterCallback(CppVariant* result)
+{
+ result->set(getDescription(accessibilityObject()));
+}
+
+void AccessibilityUIElement::isEnabledGetterCallback(CppVariant* result)
+{
+ result->set(accessibilityObject().isEnabled());
+}
+
+void AccessibilityUIElement::isSelectedGetterCallback(CppVariant* result)
+{
+ result->setNull();
+}
+
+void AccessibilityUIElement::roleGetterCallback(CppVariant* result)
+{
+ result->set(getRole(accessibilityObject()));
+}
+
+void AccessibilityUIElement::titleGetterCallback(CppVariant* result)
+{
+ result->set(getTitle(accessibilityObject()));
+}
+
+
+RootAccessibilityUIElement::RootAccessibilityUIElement(const WebAccessibilityObject &object, Factory *factory)
+ : AccessibilityUIElement(object, factory) { }
+
+AccessibilityUIElement* RootAccessibilityUIElement::getChildAtIndex(unsigned index)
+{
+ if (index)
+ return 0;
+
+ return factory()->create(accessibilityObject());
+}
+
+
+AccessibilityUIElementList ::~AccessibilityUIElementList()
+{
+ clear();
+}
+
+void AccessibilityUIElementList::clear()
+{
+ for (ElementList::iterator i = m_elements.begin(); i != m_elements.end(); ++i)
+ delete (*i);
+ m_elements.clear();
+}
+
+AccessibilityUIElement* AccessibilityUIElementList::create(const WebAccessibilityObject& object)
+{
+ if (object.isNull())
+ return 0;
+
+ AccessibilityUIElement* element = new AccessibilityUIElement(object, this);
+ m_elements.append(element);
+ return element;
+}
+
+AccessibilityUIElement* AccessibilityUIElementList::createRoot(const WebAccessibilityObject& object)
+{
+ AccessibilityUIElement* element = new RootAccessibilityUIElement(object, this);
+ m_elements.append(element);
+ return element;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.h b/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.h
new file mode 100644
index 0000000..366ed42
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/AccessibilityUIElement.h
@@ -0,0 +1,142 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AccessibilityUIElement_h
+#define AccessibilityUIElement_h
+
+#include "CppBoundClass.h"
+#include "WebAccessibilityObject.h"
+#include <wtf/Vector.h>
+
+class AccessibilityUIElement : public CppBoundClass {
+public:
+ class Factory {
+ public:
+ virtual ~Factory() { }
+ virtual AccessibilityUIElement* create(const WebKit::WebAccessibilityObject&) = 0;
+ };
+
+ AccessibilityUIElement(const WebKit::WebAccessibilityObject&, Factory*);
+
+ virtual AccessibilityUIElement* getChildAtIndex(unsigned);
+ virtual bool isRoot() const { return false; }
+
+protected:
+ const WebKit::WebAccessibilityObject& accessibilityObject() const { return m_accessibilityObject; }
+ Factory* factory() const { return m_factory; }
+
+private:
+ // Bound methods and properties.
+ void allAttributesCallback(const CppArgumentList&, CppVariant*);
+ void attributesOfLinkedUIElementsCallback(const CppArgumentList&, CppVariant*);
+ void attributesOfDocumentLinksCallback(const CppArgumentList&, CppVariant*);
+ void attributesOfChildrenCallback(const CppArgumentList&, CppVariant*);
+ void parametrizedAttributeNamesCallback(const CppArgumentList&, CppVariant*);
+ void lineForIndexCallback(const CppArgumentList&, CppVariant*);
+ void boundsForRangeCallback(const CppArgumentList&, CppVariant*);
+ void stringForRangeCallback(const CppArgumentList&, CppVariant*);
+ void childAtIndexCallback(const CppArgumentList&, CppVariant*);
+ void elementAtPointCallback(const CppArgumentList&, CppVariant*);
+ void attributesOfColumnHeadersCallback(const CppArgumentList&, CppVariant*);
+ void attributesOfRowHeadersCallback(const CppArgumentList&, CppVariant*);
+ void attributesOfColumnsCallback(const CppArgumentList&, CppVariant*);
+ void attributesOfRowsCallback(const CppArgumentList&, CppVariant*);
+ void attributesOfVisibleCellsCallback(const CppArgumentList&, CppVariant*);
+ void attributesOfHeaderCallback(const CppArgumentList&, CppVariant*);
+ void indexInTableCallback(const CppArgumentList&, CppVariant*);
+ void rowIndexRangeCallback(const CppArgumentList&, CppVariant*);
+ void columnIndexRangeCallback(const CppArgumentList&, CppVariant*);
+ void cellForColumnAndRowCallback(const CppArgumentList&, CppVariant*);
+ void titleUIElementCallback(const CppArgumentList&, CppVariant*);
+ void setSelectedTextRangeCallback(const CppArgumentList&, CppVariant*);
+ void attributeValueCallback(const CppArgumentList&, CppVariant*);
+ void isAttributeSettableCallback(const CppArgumentList&, CppVariant*);
+ void isActionSupportedCallback(const CppArgumentList&, CppVariant*);
+ void parentElementCallback(const CppArgumentList&, CppVariant*);
+ void incrementCallback(const CppArgumentList&, CppVariant*);
+ void decrementCallback(const CppArgumentList&, CppVariant*);
+ void fallbackCallback(const CppArgumentList&, CppVariant*);
+
+ void childrenCountGetterCallback(CppVariant*);
+ void descriptionGetterCallback(CppVariant*);
+ void isEnabledGetterCallback(CppVariant*);
+ void isSelectedGetterCallback(CppVariant*);
+ void roleGetterCallback(CppVariant*);
+ void titleGetterCallback(CppVariant*);
+
+ CppVariant m_subrole;
+ CppVariant m_language;
+ CppVariant m_x;
+ CppVariant m_y;
+ CppVariant m_width;
+ CppVariant m_height;
+ CppVariant m_clickPointX;
+ CppVariant m_clickPointY;
+ CppVariant m_intValue;
+ CppVariant m_minValue;
+ CppVariant m_maxValue;
+ CppVariant m_childrenCount;
+ CppVariant m_insertionPointLineNumber;
+ CppVariant m_selectedTextRange;
+ CppVariant m_isRequired;
+ CppVariant m_valueDescription;
+
+ WebKit::WebAccessibilityObject m_accessibilityObject;
+ Factory* m_factory;
+};
+
+
+class RootAccessibilityUIElement : public AccessibilityUIElement {
+public:
+ RootAccessibilityUIElement(const WebKit::WebAccessibilityObject&, Factory*);
+
+ virtual AccessibilityUIElement* getChildAtIndex(unsigned);
+ virtual bool isRoot() const { return true; }
+};
+
+
+// Provides simple lifetime management of the AccessibilityUIElement instances:
+// all AccessibilityUIElements ever created from the controller are stored in
+// a list and cleared explicitly.
+class AccessibilityUIElementList : public AccessibilityUIElement::Factory {
+public:
+ AccessibilityUIElementList() { }
+ virtual ~AccessibilityUIElementList();
+
+ void clear();
+ virtual AccessibilityUIElement* create(const WebKit::WebAccessibilityObject&);
+ AccessibilityUIElement* createRoot(const WebKit::WebAccessibilityObject&);
+
+private:
+ typedef Vector<AccessibilityUIElement*> ElementList;
+ ElementList m_elements;
+};
+
+#endif // AccessibilityUIElement_h
diff --git a/WebKitTools/DumpRenderTree/chromium/CppBoundClass.cpp b/WebKitTools/DumpRenderTree/chromium/CppBoundClass.cpp
new file mode 100644
index 0000000..1348bbf
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/CppBoundClass.cpp
@@ -0,0 +1,350 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This file contains definitions for CppBoundClass
+
+// Here's the control flow of a JS method getting forwarded to a class.
+// - Something calls our NPObject with a function like "Invoke".
+// - CppNPObject's static invoke() function forwards it to its attached
+// CppBoundClass's invoke() method.
+// - CppBoundClass has then overridden invoke() to look up the function
+// name in its internal map of methods, and then calls the appropriate
+// method.
+
+#include "config.h"
+#include "CppBoundClass.h"
+
+#include "WebBindings.h"
+#include "WebFrame.h"
+#include "WebString.h"
+#include <wtf/Assertions.h>
+#include <wtf/OwnPtr.h>
+
+using namespace WebKit;
+using namespace std;
+
+class CppVariantPropertyCallback : public CppBoundClass::PropertyCallback {
+public:
+ CppVariantPropertyCallback(CppVariant* value) : m_value(value) { }
+
+ virtual bool getValue(CppVariant* value)
+ {
+ value->set(*m_value);
+ return true;
+ }
+
+ virtual bool setValue(const CppVariant& value)
+ {
+ m_value->set(value);
+ return true;
+ }
+
+private:
+ CppVariant* m_value;
+};
+
+class GetterPropertyCallback : public CppBoundClass::PropertyCallback {
+public:
+ GetterPropertyCallback(CppBoundClass::GetterCallback* callback)
+ : m_callback(callback) { }
+
+ virtual bool getValue(CppVariant* value)
+ {
+ m_callback->run(value);
+ return true;
+ }
+
+ virtual bool setValue(const CppVariant& value) { return false; }
+
+private:
+ OwnPtr<CppBoundClass::GetterCallback> m_callback;
+};
+
+// Our special NPObject type. We extend an NPObject with a pointer to a
+// CppBoundClass, which is just a C++ interface that we forward all NPObject
+// callbacks to.
+struct CppNPObject {
+ NPObject parent; // This must be the first field in the struct.
+ CppBoundClass* boundClass;
+
+ //
+ // All following objects and functions are static, and just used to interface
+ // with NPObject/NPClass.
+ //
+
+ // An NPClass associates static functions of CppNPObject with the
+ // function pointers used by the JS runtime.
+ static NPClass npClass;
+
+ // Allocate a new NPObject with the specified class.
+ static NPObject* allocate(NPP, NPClass*);
+
+ // Free an object.
+ static void deallocate(NPObject*);
+
+ // Returns true if the C++ class associated with this NPObject exposes the
+ // given property. Called by the JS runtime.
+ static bool hasProperty(NPObject*, NPIdentifier);
+
+ // Returns true if the C++ class associated with this NPObject exposes the
+ // given method. Called by the JS runtime.
+ static bool hasMethod(NPObject*, NPIdentifier);
+
+ // If the given method is exposed by the C++ class associated with this
+ // NPObject, invokes it with the given arguments and returns a result. Otherwise,
+ // returns "undefined" (in the JavaScript sense). Called by the JS runtime.
+ static bool invoke(NPObject*, NPIdentifier,
+ const NPVariant* arguments, uint32_t argumentCount,
+ NPVariant* result);
+
+ // If the given property is exposed by the C++ class associated with this
+ // NPObject, returns its value. Otherwise, returns "undefined" (in the
+ // JavaScript sense). Called by the JS runtime.
+ static bool getProperty(NPObject*, NPIdentifier, NPVariant* result);
+
+ // If the given property is exposed by the C++ class associated with this
+ // NPObject, sets its value. Otherwise, does nothing. Called by the JS
+ // runtime.
+ static bool setProperty(NPObject*, NPIdentifier, const NPVariant* value);
+};
+
+// Build CppNPObject's static function pointers into an NPClass, for use
+// in constructing NPObjects for the C++ classes.
+NPClass CppNPObject::npClass = {
+ NP_CLASS_STRUCT_VERSION,
+ CppNPObject::allocate,
+ CppNPObject::deallocate,
+ /* NPInvalidateFunctionPtr */ 0,
+ CppNPObject::hasMethod,
+ CppNPObject::invoke,
+ /* NPInvokeDefaultFunctionPtr */ 0,
+ CppNPObject::hasProperty,
+ CppNPObject::getProperty,
+ CppNPObject::setProperty,
+ /* NPRemovePropertyFunctionPtr */ 0
+};
+
+NPObject* CppNPObject::allocate(NPP npp, NPClass* aClass)
+{
+ CppNPObject* obj = new CppNPObject;
+ // obj->parent will be initialized by the NPObject code calling this.
+ obj->boundClass = 0;
+ return &obj->parent;
+}
+
+void CppNPObject::deallocate(NPObject* npObj)
+{
+ CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+ delete obj;
+}
+
+bool CppNPObject::hasMethod(NPObject* npObj, NPIdentifier ident)
+{
+ CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+ return obj->boundClass->hasMethod(ident);
+}
+
+bool CppNPObject::hasProperty(NPObject* npObj, NPIdentifier ident)
+{
+ CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+ return obj->boundClass->hasProperty(ident);
+}
+
+bool CppNPObject::invoke(NPObject* npObj, NPIdentifier ident,
+ const NPVariant* arguments, uint32_t argumentCount,
+ NPVariant* result)
+{
+ CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+ return obj->boundClass->invoke(ident, arguments, argumentCount, result);
+}
+
+bool CppNPObject::getProperty(NPObject* npObj, NPIdentifier ident, NPVariant* result)
+{
+ CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+ return obj->boundClass->getProperty(ident, result);
+}
+
+bool CppNPObject::setProperty(NPObject* npObj, NPIdentifier ident, const NPVariant* value)
+{
+ CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+ return obj->boundClass->setProperty(ident, value);
+}
+
+CppBoundClass::~CppBoundClass()
+{
+ for (MethodList::iterator i = m_methods.begin(); i != m_methods.end(); ++i)
+ delete i->second;
+
+ for (PropertyList::iterator i = m_properties.begin(); i != m_properties.end(); ++i)
+ delete i->second;
+
+ // Unregister ourselves if we were bound to a frame.
+ if (m_boundToFrame)
+ WebBindings::unregisterObject(NPVARIANT_TO_OBJECT(m_selfVariant));
+}
+
+bool CppBoundClass::hasMethod(NPIdentifier ident) const
+{
+ return m_methods.find(ident) != m_methods.end();
+}
+
+bool CppBoundClass::hasProperty(NPIdentifier ident) const
+{
+ return m_properties.find(ident) != m_properties.end();
+}
+
+bool CppBoundClass::invoke(NPIdentifier ident,
+ const NPVariant* arguments,
+ size_t argumentCount,
+ NPVariant* result) {
+ MethodList::const_iterator end = m_methods.end();
+ MethodList::const_iterator method = m_methods.find(ident);
+ Callback* callback;
+ if (method == end) {
+ if (!m_fallbackCallback.get()) {
+ VOID_TO_NPVARIANT(*result);
+ return false;
+ }
+ callback = m_fallbackCallback.get();
+ } else
+ callback = (*method).second;
+
+ // Build a CppArgumentList argument vector from the NPVariants coming in.
+ CppArgumentList cppArguments(argumentCount);
+ for (size_t i = 0; i < argumentCount; i++)
+ cppArguments[i].set(arguments[i]);
+
+ CppVariant cppResult;
+ callback->run(cppArguments, &cppResult);
+
+ cppResult.copyToNPVariant(result);
+ return true;
+}
+
+bool CppBoundClass::getProperty(NPIdentifier ident, NPVariant* result) const
+{
+ PropertyList::const_iterator callback = m_properties.find(ident);
+ if (callback == m_properties.end()) {
+ VOID_TO_NPVARIANT(*result);
+ return false;
+ }
+
+ CppVariant cppValue;
+ if (!callback->second->getValue(&cppValue))
+ return false;
+ cppValue.copyToNPVariant(result);
+ return true;
+}
+
+bool CppBoundClass::setProperty(NPIdentifier ident, const NPVariant* value)
+{
+ PropertyList::iterator callback = m_properties.find(ident);
+ if (callback == m_properties.end())
+ return false;
+
+ CppVariant cppValue;
+ cppValue.set(*value);
+ return (*callback).second->setValue(cppValue);
+}
+
+void CppBoundClass::bindCallback(const string& name, Callback* callback)
+{
+ NPIdentifier ident = WebBindings::getStringIdentifier(name.c_str());
+ MethodList::iterator oldCallback = m_methods.find(ident);
+ if (oldCallback != m_methods.end()) {
+ delete oldCallback->second;
+ if (!callback) {
+ m_methods.remove(oldCallback);
+ return;
+ }
+ }
+
+ m_methods.set(ident, callback);
+}
+
+void CppBoundClass::bindGetterCallback(const string& name, GetterCallback* callback)
+{
+ PropertyCallback* propertyCallback = callback ? new GetterPropertyCallback(callback) : 0;
+ bindProperty(name, propertyCallback);
+}
+
+void CppBoundClass::bindProperty(const string& name, CppVariant* prop)
+{
+ PropertyCallback* propertyCallback = prop ? new CppVariantPropertyCallback(prop) : 0;
+ bindProperty(name, propertyCallback);
+}
+
+void CppBoundClass::bindProperty(const string& name, PropertyCallback* callback)
+{
+ NPIdentifier ident = WebBindings::getStringIdentifier(name.c_str());
+ PropertyList::iterator oldCallback = m_properties.find(ident);
+ if (oldCallback != m_properties.end()) {
+ delete oldCallback->second;
+ if (!callback) {
+ m_properties.remove(oldCallback);
+ return;
+ }
+ }
+
+ m_properties.set(ident, callback);
+}
+
+bool CppBoundClass::isMethodRegistered(const string& name) const
+{
+ NPIdentifier ident = WebBindings::getStringIdentifier(name.c_str());
+ MethodList::const_iterator callback = m_methods.find(ident);
+ return callback != m_methods.end();
+}
+
+CppVariant* CppBoundClass::getAsCppVariant()
+{
+ if (!m_selfVariant.isObject()) {
+ // Create an NPObject using our static NPClass. The first argument (a
+ // plugin's instance handle) is passed through to the allocate function
+ // directly, and we don't use it, so it's ok to be 0.
+ NPObject* npObj = WebBindings::createObject(0, &CppNPObject::npClass);
+ CppNPObject* obj = reinterpret_cast<CppNPObject*>(npObj);
+ obj->boundClass = this;
+ m_selfVariant.set(npObj);
+ WebBindings::releaseObject(npObj); // CppVariant takes the reference.
+ }
+ ASSERT(m_selfVariant.isObject());
+ return &m_selfVariant;
+}
+
+void CppBoundClass::bindToJavascript(WebFrame* frame, const WebString& classname)
+{
+ // BindToWindowObject will take its own reference to the NPObject, and clean
+ // up after itself. It will also (indirectly) register the object with V8,
+ // so we must remember this so we can unregister it when we're destroyed.
+ frame->bindToWindowObject(classname, NPVARIANT_TO_OBJECT(*getAsCppVariant()));
+ m_boundToFrame = true;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/CppBoundClass.h b/WebKitTools/DumpRenderTree/chromium/CppBoundClass.h
new file mode 100644
index 0000000..6cb638e
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/CppBoundClass.h
@@ -0,0 +1,241 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ CppBoundClass class:
+ This base class serves as a parent for C++ classes designed to be bound to
+ JavaScript objects.
+
+ Subclasses should define the constructor to build the property and method
+ lists needed to bind this class to a JS object. They should also declare
+ and define member variables and methods to be exposed to JS through
+ that object.
+*/
+
+#ifndef CppBoundClass_h
+#define CppBoundClass_h
+
+#include "CppVariant.h"
+#include <wtf/HashMap.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebKit {
+class WebFrame;
+class WebString;
+}
+
+typedef Vector<CppVariant> CppArgumentList;
+
+// CppBoundClass lets you map Javascript method calls and property accesses
+// directly to C++ method calls and CppVariant* variable access.
+class CppBoundClass : public Noncopyable {
+public:
+ class PropertyCallback {
+ public:
+ virtual ~PropertyCallback() { }
+
+ // Sets |value| to the value of the property. Returns false in case of
+ // failure. |value| is always non-0.
+ virtual bool getValue(CppVariant* result) = 0;
+
+ // sets the property value to |value|. Returns false in case of failure.
+ virtual bool setValue(const CppVariant&) = 0;
+ };
+
+ // Callback class for "void function(CppVariant*)"
+ class GetterCallback {
+ public:
+ virtual ~GetterCallback() {}
+ virtual void run(CppVariant*) = 0;
+ };
+
+ // The constructor should call BindMethod, BindProperty, and
+ // SetFallbackMethod as needed to set up the methods, properties, and
+ // fallback method.
+ CppBoundClass() : m_boundToFrame(false) {}
+ virtual ~CppBoundClass();
+
+ // Return a CppVariant representing this class, for use with BindProperty().
+ // The variant type is guaranteed to be NPVariantType_Object.
+ CppVariant* getAsCppVariant();
+
+ // Given a WebFrame, BindToJavascript builds the NPObject that will represent
+ // the class and binds it to the frame's window under the given name. This
+ // should generally be called from the WebView delegate's
+ // WindowObjectCleared(). A class so bound will be accessible to JavaScript
+ // as window.<classname>. The owner of the CppBoundObject is responsible for
+ // keeping the object around while the frame is alive, and for destroying it
+ // afterwards.
+ void bindToJavascript(WebKit::WebFrame*, const WebKit::WebString& classname);
+
+ // Used by a test. Returns true if a method with name |name| exists,
+ // regardless of whether a fallback is registered.
+ bool isMethodRegistered(const std::string&) const;
+
+protected:
+ // Callback for "void function(const CppArguemntList&, CppVariant*)"
+ class Callback {
+ public:
+ virtual ~Callback() {}
+ virtual void run(const CppArgumentList&, CppVariant*) = 0;
+ };
+
+ // Callback for "void T::method(const CppArguemntList&, CppVariant*)"
+ template <class T> class MemberCallback : public Callback {
+ public:
+ typedef void (T::*MethodType)(const CppArgumentList&, CppVariant*);
+ MemberCallback(T* object, MethodType method)
+ : m_object(object)
+ , m_method(method) {}
+ virtual ~MemberCallback() {}
+
+ virtual void run(const CppArgumentList& arguments, CppVariant* result)
+ {
+ (m_object->*m_method)(arguments, result);
+ }
+ private:
+ T* m_object;
+ MethodType m_method;
+ };
+
+ // Callback class for "void T::method(CppVariant*)"
+ template <class T> class MemberGetterCallback : public GetterCallback {
+ public:
+ typedef void (T::*MethodType)(CppVariant*);
+ MemberGetterCallback(T* object, MethodType method)
+ : m_object(object)
+ , m_method(method) {}
+ virtual ~MemberGetterCallback() {}
+
+ virtual void run(CppVariant* result) { (m_object->*m_method)(result); }
+ private:
+ T* m_object;
+ MethodType m_method;
+ };
+
+ // Bind the Javascript method called the string parameter to the C++ method.
+ void bindCallback(const std::string&, Callback*);
+
+ // A wrapper for bindCallback, to simplify the common case of binding a
+ // method on the current object. Though not verified here, |method|
+ // must be a method of this CppBoundClass subclass.
+ template<class T>
+ void bindMethod(const std::string& name, void (T::*method)(const CppArgumentList&, CppVariant*))
+ {
+ Callback* callback = new MemberCallback<T>(static_cast<T*>(this), method);
+ bindCallback(name, callback);
+ }
+
+ // Bind Javascript property |name| to the C++ getter callback |callback|.
+ // This can be used to create read-only properties.
+ void bindGetterCallback(const std::string&, GetterCallback*);
+
+ // A wrapper for BindGetterCallback, to simplify the common case of binding a
+ // property on the current object. Though not verified here, |method|
+ // must be a method of this CppBoundClass subclass.
+ template<class T>
+ void bindProperty(const std::string& name, void (T::*method)(CppVariant*))
+ {
+ GetterCallback* callback = new MemberGetterCallback<T>(static_cast<T*>(this), method);
+ bindGetterCallback(name, callback);
+ }
+
+ // Bind the Javascript property called |name| to a CppVariant.
+ void bindProperty(const std::string&, CppVariant*);
+
+ // Bind Javascript property called |name| to a PropertyCallback.
+ // CppBoundClass assumes control over the life time of the callback.
+ void bindProperty(const std::string&, PropertyCallback*);
+
+ // Set the fallback callback, which is called when when a callback is
+ // invoked that isn't bound.
+ // If it is 0 (its default value), a JavaScript exception is thrown in
+ // that case (as normally expected). If non 0, the fallback method is
+ // invoked and the script continues its execution.
+ // Passing 0 clears out any existing binding.
+ // It is used for tests and should probably only be used in such cases
+ // as it may cause unexpected behaviors (a JavaScript object with a
+ // fallback always returns true when checked for a method's
+ // existence).
+ void bindFallbackCallback(Callback* fallbackCallback)
+ {
+ m_fallbackCallback.set(fallbackCallback);
+ }
+
+ // A wrapper for BindFallbackCallback, to simplify the common case of
+ // binding a method on the current object. Though not verified here,
+ // |method| must be a method of this CppBoundClass subclass.
+ // Passing 0 for |method| clears out any existing binding.
+ template<class T>
+ void bindFallbackMethod(void (T::*method)(const CppArgumentList&, CppVariant*))
+ {
+ if (method) {
+ Callback* callback = new MemberCallback<T>(static_cast<T*>(this), method);
+ bindFallbackCallback(callback);
+ } else
+ bindFallbackCallback(0);
+ }
+
+ // Some fields are protected because some tests depend on accessing them,
+ // but otherwise they should be considered private.
+
+ typedef HashMap<NPIdentifier, PropertyCallback*> PropertyList;
+ typedef HashMap<NPIdentifier, Callback*> MethodList;
+ // These maps associate names with property and method pointers to be
+ // exposed to JavaScript.
+ PropertyList m_properties;
+ MethodList m_methods;
+
+ // The callback gets invoked when a call is made to an nonexistent method.
+ OwnPtr<Callback> m_fallbackCallback;
+
+private:
+ // NPObject callbacks.
+ friend struct CppNPObject;
+ bool hasMethod(NPIdentifier) const;
+ bool invoke(NPIdentifier, const NPVariant* args, size_t argCount,
+ NPVariant* result);
+ bool hasProperty(NPIdentifier) const;
+ bool getProperty(NPIdentifier, NPVariant* result) const;
+ bool setProperty(NPIdentifier, const NPVariant*);
+
+ // A lazily-initialized CppVariant representing this class. We retain 1
+ // reference to this object, and it is released on deletion.
+ CppVariant m_selfVariant;
+
+ // True if our np_object has been bound to a WebFrame, in which case it must
+ // be unregistered with V8 when we delete it.
+ bool m_boundToFrame;
+};
+
+#endif // CppBoundClass_h
diff --git a/WebKitTools/DumpRenderTree/chromium/CppVariant.cpp b/WebKitTools/DumpRenderTree/chromium/CppVariant.cpp
new file mode 100644
index 0000000..22e0013
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/CppVariant.cpp
@@ -0,0 +1,310 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CppVariant.h"
+
+#include "WebBindings.h"
+#include <limits>
+#include <wtf/Assertions.h>
+#include <wtf/StringExtras.h>
+
+using namespace WebKit;
+using namespace std;
+
+CppVariant::CppVariant()
+{
+ type = NPVariantType_Null;
+}
+
+// Note that Set() performs a deep copy, which is necessary to safely
+// call FreeData() on the value in the destructor.
+CppVariant::CppVariant(const CppVariant& original)
+{
+ type = NPVariantType_Null;
+ set(original);
+}
+
+// See comment for copy constructor, above.
+CppVariant& CppVariant::operator=(const CppVariant& original)
+{
+ if (&original != this)
+ set(original);
+ return *this;
+}
+
+CppVariant::~CppVariant()
+{
+ freeData();
+}
+
+void CppVariant::freeData()
+{
+ WebBindings::releaseVariantValue(this);
+}
+
+bool CppVariant::isEqual(const CppVariant& other) const
+{
+ if (type != other.type)
+ return false;
+
+ switch (type) {
+ case NPVariantType_Bool:
+ return (value.boolValue == other.value.boolValue);
+ case NPVariantType_Int32:
+ return (value.intValue == other.value.intValue);
+ case NPVariantType_Double:
+ return (value.doubleValue == other.value.doubleValue);
+ case NPVariantType_String: {
+ const NPString *this_value = &value.stringValue;
+ const NPString *other_value = &other.value.stringValue;
+ uint32_t len = this_value->UTF8Length;
+ return len == other_value->UTF8Length
+ && !strncmp(this_value->UTF8Characters,
+ other_value->UTF8Characters, len);
+ }
+ case NPVariantType_Null:
+ case NPVariantType_Void:
+ return true;
+ case NPVariantType_Object: {
+ NPObject* thisValue = value.objectValue;
+ NPObject* otherValue = other.value.objectValue;
+ return thisValue->_class == otherValue->_class
+ && thisValue->referenceCount == otherValue->referenceCount;
+ }
+ }
+ return false;
+}
+
+void CppVariant::copyToNPVariant(NPVariant* result) const
+{
+ result->type = type;
+ switch (type) {
+ case NPVariantType_Bool:
+ result->value.boolValue = value.boolValue;
+ break;
+ case NPVariantType_Int32:
+ result->value.intValue = value.intValue;
+ break;
+ case NPVariantType_Double:
+ result->value.doubleValue = value.doubleValue;
+ break;
+ case NPVariantType_String:
+ WebBindings::initializeVariantWithStringCopy(result, &value.stringValue);
+ break;
+ case NPVariantType_Null:
+ case NPVariantType_Void:
+ // Nothing to set.
+ break;
+ case NPVariantType_Object:
+ result->type = NPVariantType_Object;
+ result->value.objectValue = WebBindings::retainObject(value.objectValue);
+ break;
+ }
+}
+
+void CppVariant::set(const NPVariant& newValue)
+{
+ freeData();
+ switch (newValue.type) {
+ case NPVariantType_Bool:
+ set(newValue.value.boolValue);
+ break;
+ case NPVariantType_Int32:
+ set(newValue.value.intValue);
+ break;
+ case NPVariantType_Double:
+ set(newValue.value.doubleValue);
+ break;
+ case NPVariantType_String:
+ set(newValue.value.stringValue);
+ break;
+ case NPVariantType_Null:
+ case NPVariantType_Void:
+ type = newValue.type;
+ break;
+ case NPVariantType_Object:
+ set(newValue.value.objectValue);
+ break;
+ }
+}
+
+void CppVariant::setNull()
+{
+ freeData();
+ type = NPVariantType_Null;
+}
+
+void CppVariant::set(bool newValue)
+{
+ freeData();
+ type = NPVariantType_Bool;
+ value.boolValue = newValue;
+}
+
+void CppVariant::set(int32_t newValue)
+{
+ freeData();
+ type = NPVariantType_Int32;
+ value.intValue = newValue;
+}
+
+void CppVariant::set(double newValue)
+{
+ freeData();
+ type = NPVariantType_Double;
+ value.doubleValue = newValue;
+}
+
+// The newValue must be a null-terminated string.
+void CppVariant::set(const char* newValue)
+{
+ freeData();
+ type = NPVariantType_String;
+ NPString newString = {newValue,
+ static_cast<uint32_t>(strlen(newValue))};
+ WebBindings::initializeVariantWithStringCopy(this, &newString);
+}
+
+void CppVariant::set(const string& newValue)
+{
+ freeData();
+ type = NPVariantType_String;
+ NPString newString = {newValue.data(),
+ static_cast<uint32_t>(newValue.size())};
+ WebBindings::initializeVariantWithStringCopy(this, &newString);
+}
+
+void CppVariant::set(const NPString& newValue)
+{
+ freeData();
+ type = NPVariantType_String;
+ WebBindings::initializeVariantWithStringCopy(this, &newValue);
+}
+
+void CppVariant::set(NPObject* newValue)
+{
+ freeData();
+ type = NPVariantType_Object;
+ value.objectValue = WebBindings::retainObject(newValue);
+}
+
+string CppVariant::toString() const
+{
+ ASSERT(isString());
+ return string(value.stringValue.UTF8Characters,
+ value.stringValue.UTF8Length);
+}
+
+int32_t CppVariant::toInt32() const
+{
+ if (isInt32())
+ return value.intValue;
+ if (isDouble())
+ return static_cast<int32_t>(value.doubleValue);
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+double CppVariant::toDouble() const
+{
+ if (isInt32())
+ return static_cast<double>(value.intValue);
+ if (isDouble())
+ return value.doubleValue;
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+bool CppVariant::toBoolean() const
+{
+ ASSERT(isBool());
+ return value.boolValue;
+}
+
+Vector<string> CppVariant::toStringVector() const
+{
+
+ ASSERT(isObject());
+ Vector<string> stringVector;
+ NPObject* npValue = value.objectValue;
+ NPIdentifier lengthId = WebBindings::getStringIdentifier("length");
+
+ if (!WebBindings::hasProperty(0, npValue, lengthId))
+ return stringVector;
+
+ NPVariant lengthValue;
+ if (!WebBindings::getProperty(0, npValue, lengthId, &lengthValue))
+ return stringVector;
+
+ int length = 0;
+ // The length is a double in some cases.
+ if (NPVARIANT_IS_DOUBLE(lengthValue))
+ length = static_cast<int>(NPVARIANT_TO_DOUBLE(lengthValue));
+ else if (NPVARIANT_IS_INT32(lengthValue))
+ length = NPVARIANT_TO_INT32(lengthValue);
+ WebBindings::releaseVariantValue(&lengthValue);
+
+ // For sanity, only allow 100 items.
+ length = min(100, length);
+ for (int i = 0; i < length; ++i) {
+ // Get each of the items.
+ char indexInChar[20]; // Enough size to store 32-bit integer
+ snprintf(indexInChar, 20, "%d", i);
+ string index(indexInChar);
+ NPIdentifier indexId = WebBindings::getStringIdentifier(index.c_str());
+ if (!WebBindings::hasProperty(0, npValue, indexId))
+ continue;
+ NPVariant indexValue;
+ if (!WebBindings::getProperty(0, npValue, indexId, &indexValue))
+ continue;
+ if (NPVARIANT_IS_STRING(indexValue)) {
+ string item(NPVARIANT_TO_STRING(indexValue).UTF8Characters,
+ NPVARIANT_TO_STRING(indexValue).UTF8Length);
+ stringVector.append(item);
+ }
+ WebBindings::releaseVariantValue(&indexValue);
+ }
+ return stringVector;
+}
+
+bool CppVariant::invoke(const string& method, const CppVariant* arguments,
+ uint32_t argumentCount, CppVariant& result) const
+{
+ ASSERT(isObject());
+ NPIdentifier methodName = WebBindings::getStringIdentifier(method.c_str());
+ NPObject* npObject = value.objectValue;
+ if (!WebBindings::hasMethod(0, npObject, methodName))
+ return false;
+ NPVariant r;
+ bool status = WebBindings::invoke(0, npObject, methodName, arguments, argumentCount, &r);
+ result.set(r);
+ return status;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/CppVariant.h b/WebKitTools/DumpRenderTree/chromium/CppVariant.h
new file mode 100644
index 0000000..3032310
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/CppVariant.h
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ This file contains the declaration for CppVariant, a type used by C++ classes
+ that are to be bound to JavaScript objects.
+
+ CppVariant exists primarily as an interface between C++ callers and the
+ corresponding NPVariant type. CppVariant also provides a number of
+ convenience constructors and accessors, so that the NPVariantType values
+ don't need to be exposed, and a destructor to free any memory allocated for
+ string values.
+*/
+
+#ifndef CppVariant_h
+#define CppVariant_h
+
+#include "WebBindings.h"
+#include "webkit/support/webkit_support.h"
+#include <string>
+#include <wtf/Vector.h>
+
+class CppVariant : public NPVariant {
+public:
+ CppVariant();
+ ~CppVariant();
+ void setNull();
+ void set(bool);
+ void set(int32_t);
+ void set(double);
+
+ // Note that setting a CppVariant to a string value involves copying the
+ // string data, which must be freed with a call to freeData() when the
+ // CppVariant is set to a different value or is no longer needed. Normally
+ // this is handled by the other set() methods and by the destructor.
+ void set(const char*); // Must be a null-terminated string.
+ void set(const std::string&);
+ void set(const NPString&);
+ void set(const NPVariant&);
+
+ // Note that setting a CppVariant to an NPObject involves ref-counting
+ // the actual object. freeData() should only be called if the CppVariant
+ // is no longer needed. The other set() methods handle this internally.
+ // Also, the object's NPClass is expected to be a static object: neither
+ // the NP runtime nor CppVariant will ever free it.
+ void set(NPObject*_value);
+
+ // These three methods all perform deep copies of any string data. This
+ // allows local CppVariants to be released by the destructor without
+ // corrupting their sources. In performance-critical code, or when strings
+ // are very long, avoid creating new CppVariants.
+ // In case of NPObject as the data, the copying involves ref-counting
+ // as opposed to deep-copying. The ref-counting ensures that sources don't
+ // get corrupted when the copies get destroyed.
+ void copyToNPVariant(NPVariant* result) const;
+ CppVariant& operator=(const CppVariant& original);
+ CppVariant(const CppVariant& original);
+
+ // Calls NPN_ReleaseVariantValue, which frees any string data
+ // held by the object and sets its type to null.
+ // In case of NPObject, the NPN_ReleaseVariantValue decrements
+ // the ref-count (releases when ref-count becomes 0)
+ void freeData();
+
+ // Compares this CppVariant's type and value to another's. They must be
+ // identical in both type and value to be considered equal. For string and
+ // object types, a deep comparison is performed; that is, the contents of the
+ // strings, or the classes and refcounts of the objects, must be the same,
+ // but they need not be the same pointers.
+ bool isEqual(const CppVariant&) const;
+
+ // The value of a CppVariant may be read directly from its NPVariant (but
+ // should only be set using one of the set() methods above). Although the
+ // type of a CppVariant is likewise public, it can be accessed through these
+ // functions rather than directly if a caller wishes to avoid dependence on
+ // the NPVariantType values.
+ bool isBool() const { return (type == NPVariantType_Bool); }
+ bool isInt32() const { return (type == NPVariantType_Int32); }
+ bool isDouble() const { return (type == NPVariantType_Double); }
+ bool isNumber() const { return (isInt32() || isDouble()); }
+ bool isString() const { return (type == NPVariantType_String); }
+ bool isVoid() const { return (type == NPVariantType_Void); }
+ bool isNull() const { return (type == NPVariantType_Null); }
+ bool isEmpty() const { return (isVoid() || isNull()); }
+ bool isObject() const { return (type == NPVariantType_Object); }
+
+ // Converters. The CppVariant must be of a type convertible to these values.
+ // For example, toInt32() works only if isNumber() is true.
+ std::string toString() const;
+ int32_t toInt32() const;
+ double toDouble() const;
+ bool toBoolean() const;
+ // Returns a vector of strings for the specified argument. This is useful
+ // for converting a JavaScript array of strings into a vector of strings.
+ Vector<std::string> toStringVector() const;
+
+ // Invoke method of the given name on an object with the supplied arguments.
+ // The first argument should be the object on which the method is to be
+ // invoked. Returns whether the method was successfully invoked. If the
+ // method was invoked successfully, any return value is stored in the
+ // CppVariant specified by result.
+ bool invoke(const std::string&, const CppVariant* arguments,
+ uint32_t argumentCount, CppVariant& result) const;
+};
+
+#endif // CppVariant_h
diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp
new file mode 100644
index 0000000..78c86e7
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.cpp
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DRTDevToolsAgent.h"
+
+#include "DRTDevToolsCallArgs.h"
+#include "DRTDevToolsClient.h"
+
+#include "WebCString.h"
+#include "WebDevToolsAgent.h"
+#include "WebString.h"
+#include "WebView.h"
+#include "webkit/support/webkit_support.h"
+
+using namespace WebKit;
+
+DRTDevToolsAgent::DRTDevToolsAgent()
+ : m_drtDevToolsClient(0)
+ , m_webView(0)
+{
+ static int devToolsAgentCounter = 0;
+
+ m_routingID = ++devToolsAgentCounter;
+ if (m_routingID == 1)
+ WebDevToolsAgent::setMessageLoopDispatchHandler(&DRTDevToolsAgent::dispatchMessageLoop);
+}
+
+void DRTDevToolsAgent::reset()
+{
+ m_taskList.revokeAll();
+}
+
+void DRTDevToolsAgent::setWebView(WebView* webView)
+{
+ m_webView = webView;
+}
+
+void DRTDevToolsAgent::sendMessageToInspectorFrontend(const WebKit::WebString& data)
+{
+ if (m_drtDevToolsClient)
+ m_drtDevToolsClient->asyncCall(DRTDevToolsCallArgs(data));
+}
+
+void DRTDevToolsAgent::runtimePropertyChanged(const WebKit::WebString& name, const WebKit::WebString& value)
+{
+ // FIXME: Implement.
+}
+
+WebCString DRTDevToolsAgent::debuggerScriptSource()
+{
+ return webkit_support::GetDevToolsDebuggerScriptSource();
+}
+
+WebDevToolsAgentClient::WebKitClientMessageLoop* DRTDevToolsAgent::createClientMessageLoop()
+{
+ return webkit_support::CreateDevToolsMessageLoop();
+}
+
+void DRTDevToolsAgent::asyncCall(const DRTDevToolsCallArgs& args)
+{
+ postTask(new AsyncCallTask(this, args));
+}
+
+void DRTDevToolsAgent::call(const DRTDevToolsCallArgs &args)
+{
+ WebDevToolsAgent* agent = webDevToolsAgent();
+ if (agent)
+ agent->dispatchOnInspectorBackend(args.m_data);
+ if (DRTDevToolsCallArgs::callsCount() == 1 && m_drtDevToolsClient)
+ m_drtDevToolsClient->allMessagesProcessed();
+}
+
+void DRTDevToolsAgent::delayedFrontendLoaded()
+{
+ WebDevToolsAgent* agent = webDevToolsAgent();
+ if (agent)
+ agent->frontendLoaded();
+}
+
+
+WebDevToolsAgent* DRTDevToolsAgent::webDevToolsAgent()
+{
+ if (!m_webView)
+ return 0;
+ return m_webView->devToolsAgent();
+}
+
+void DRTDevToolsAgent::attach(DRTDevToolsClient* client)
+{
+ ASSERT(!m_drtDevToolsClient);
+ m_drtDevToolsClient = client;
+ WebDevToolsAgent* agent = webDevToolsAgent();
+ if (agent)
+ agent->attach();
+}
+
+void DRTDevToolsAgent::detach()
+{
+ ASSERT(m_drtDevToolsClient);
+ WebDevToolsAgent* agent = webDevToolsAgent();
+ if (agent)
+ agent->detach();
+ m_drtDevToolsClient = 0;
+}
+
+void DRTDevToolsAgent::frontendLoaded()
+{
+ postTask(new DelayedFrontendLoadedTask(this));
+}
+
+bool DRTDevToolsAgent::setTimelineProfilingEnabled(bool enabled)
+{
+ WebDevToolsAgent* agent = webDevToolsAgent();
+ if (!agent)
+ return false;
+ agent->setTimelineProfilingEnabled(enabled);
+ return true;
+}
+
+bool DRTDevToolsAgent::evaluateInWebInspector(long callID, const std::string& script)
+{
+ WebDevToolsAgent* agent = webDevToolsAgent();
+ if (!agent)
+ return false;
+ agent->evaluateInWebInspector(callID, WebString::fromUTF8(script));
+ return true;
+}
+
+// static method
+void DRTDevToolsAgent::dispatchMessageLoop()
+{
+ webkit_support::DispatchMessageLoop();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h
new file mode 100644
index 0000000..e1478d0
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsAgent.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DRTDevToolsAgent_h
+#define DRTDevToolsAgent_h
+
+#include "DRTDevToolsCallArgs.h"
+#include "Task.h"
+#include "WebDevToolsAgentClient.h"
+#include <wtf/HashMap.h>
+#include <wtf/Noncopyable.h>
+
+namespace WebKit {
+
+class WebCString;
+class WebDevToolsAgent;
+class WebString;
+class WebView;
+struct WebDevToolsMessageData;
+
+} // namespace WebKit
+
+class DRTDevToolsClient;
+
+class DRTDevToolsAgent : public WebKit::WebDevToolsAgentClient
+ , public Noncopyable {
+public:
+ DRTDevToolsAgent();
+ virtual ~DRTDevToolsAgent() {}
+ void reset();
+
+ void setWebView(WebKit::WebView*);
+
+ // WebDevToolsAgentClient implementation.
+ virtual void sendMessageToInspectorFrontend(const WebKit::WebString&);
+ virtual int hostIdentifier() { return m_routingID; }
+ virtual void runtimePropertyChanged(const WebKit::WebString& name, const WebKit::WebString& value);
+ virtual WebKit::WebCString debuggerScriptSource();
+ virtual WebKitClientMessageLoop* createClientMessageLoop();
+
+ void asyncCall(const DRTDevToolsCallArgs&);
+
+ void attach(DRTDevToolsClient*);
+ void detach();
+ void frontendLoaded();
+
+ bool evaluateInWebInspector(long callID, const std::string& script);
+ bool setTimelineProfilingEnabled(bool enable);
+ TaskList* taskList() { return &m_taskList; }
+
+private:
+ void call(const DRTDevToolsCallArgs&);
+ void delayedFrontendLoaded();
+ static void dispatchMessageLoop();
+ WebKit::WebDevToolsAgent* webDevToolsAgent();
+
+ class AsyncCallTask: public MethodTask<DRTDevToolsAgent> {
+ public:
+ AsyncCallTask(DRTDevToolsAgent* object, const DRTDevToolsCallArgs& args)
+ : MethodTask<DRTDevToolsAgent>(object), m_args(args) {}
+ virtual void runIfValid() { m_object->call(m_args); }
+ private:
+ DRTDevToolsCallArgs m_args;
+ };
+
+ struct DelayedFrontendLoadedTask: public MethodTask<DRTDevToolsAgent> {
+ DelayedFrontendLoadedTask(DRTDevToolsAgent* object) : MethodTask<DRTDevToolsAgent>(object) {}
+ virtual void runIfValid() { m_object->delayedFrontendLoaded(); }
+ };
+
+ TaskList m_taskList;
+ DRTDevToolsClient* m_drtDevToolsClient;
+ int m_routingID;
+ WebKit::WebDevToolsAgent* m_webDevToolsAgent;
+ WebKit::WebView* m_webView;
+};
+
+#endif // DRTDevToolsAgent_h
diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsCallArgs.cpp b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsCallArgs.cpp
new file mode 100644
index 0000000..dacd6f7
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsCallArgs.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DRTDevToolsCallArgs.h"
+
+// static
+int DRTDevToolsCallArgs::m_callsCount = 0;
+
diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsCallArgs.h b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsCallArgs.h
new file mode 100644
index 0000000..a548159
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsCallArgs.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DRTDevToolsCallArgs_h
+#define DRTDevToolsCallArgs_h
+
+#include "WebString.h"
+#include <wtf/Assertions.h>
+
+class DRTDevToolsCallArgs {
+public:
+ DRTDevToolsCallArgs(const WebKit::WebString& data)
+ : m_data(data)
+ {
+ ++m_callsCount;
+ }
+
+ DRTDevToolsCallArgs(const DRTDevToolsCallArgs& args)
+ : m_data(args.m_data)
+ {
+ ++m_callsCount;
+ }
+
+ ~DRTDevToolsCallArgs()
+ {
+ --m_callsCount;
+ ASSERT(m_callsCount >= 0);
+ }
+
+ static int callsCount() { return m_callsCount; }
+
+ WebKit::WebString m_data;
+
+private:
+ static int m_callsCount;
+};
+
+#endif // DRTDevToolsCallArgs_h
diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsClient.cpp b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsClient.cpp
new file mode 100644
index 0000000..acccf18
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsClient.cpp
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DRTDevToolsClient.h"
+
+#include "DRTDevToolsAgent.h"
+#include "DRTDevToolsCallArgs.h"
+
+#include "WebDevToolsAgent.h"
+#include "WebDevToolsFrontend.h"
+#include "WebFrame.h"
+#include "WebScriptSource.h"
+#include "WebString.h"
+#include "WebView.h"
+#include "webkit/support/webkit_support.h"
+
+using namespace WebKit;
+
+DRTDevToolsClient::DRTDevToolsClient(DRTDevToolsAgent* agent, WebView* webView)
+ : m_webView(webView)
+ , m_drtDevToolsAgent(agent)
+{
+ m_webDevToolsFrontend.set(WebDevToolsFrontend::create(m_webView,
+ this,
+ WebString::fromUTF8("en-US")));
+ m_drtDevToolsAgent->attach(this);
+}
+
+DRTDevToolsClient::~DRTDevToolsClient()
+{
+ // There is a chance that the page will be destroyed at detach step of
+ // m_drtDevToolsAgent and we should clean pending requests a bit earlier.
+ m_taskList.revokeAll();
+ if (m_drtDevToolsAgent)
+ m_drtDevToolsAgent->detach();
+}
+
+void DRTDevToolsClient::reset()
+{
+ m_taskList.revokeAll();
+}
+
+void DRTDevToolsClient::sendFrontendLoaded() {
+ if (m_drtDevToolsAgent)
+ m_drtDevToolsAgent->frontendLoaded();
+}
+
+void DRTDevToolsClient::sendMessageToBackend(const WebString& data)
+{
+ if (m_drtDevToolsAgent)
+ m_drtDevToolsAgent->asyncCall(DRTDevToolsCallArgs(data));
+}
+
+void DRTDevToolsClient::sendDebuggerCommandToAgent(const WebString& command)
+{
+ WebDevToolsAgent::executeDebuggerCommand(command, 1);
+}
+
+void DRTDevToolsClient::activateWindow()
+{
+ // Not implemented.
+}
+
+void DRTDevToolsClient::closeWindow()
+{
+ // Not implemented.
+}
+
+void DRTDevToolsClient::dockWindow()
+{
+ // Not implemented.
+}
+
+void DRTDevToolsClient::undockWindow()
+{
+ // Not implemented.
+}
+
+void DRTDevToolsClient::asyncCall(const DRTDevToolsCallArgs& args)
+{
+ postTask(new AsyncCallTask(this, args));
+}
+
+void DRTDevToolsClient::call(const DRTDevToolsCallArgs& args)
+{
+ m_webDevToolsFrontend->dispatchOnInspectorFrontend(args.m_data);
+ if (DRTDevToolsCallArgs::callsCount() == 1)
+ allMessagesProcessed();
+}
+
+void DRTDevToolsClient::allMessagesProcessed()
+{
+ m_webView->mainFrame()->executeScript(
+ WebKit::WebScriptSource(WebString::fromUTF8(
+ "if (window.WebInspector && WebInspector.queuesAreEmpty) WebInspector.queuesAreEmpty();")));
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/DRTDevToolsClient.h b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsClient.h
new file mode 100644
index 0000000..9ca1402
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/DRTDevToolsClient.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DRTDevToolsClient_h
+#define DRTDevToolsClient_h
+
+#include "DRTDevToolsCallArgs.h"
+#include "Task.h"
+#include "WebDevToolsFrontendClient.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/OwnPtr.h>
+
+namespace WebKit {
+
+class WebDevToolsFrontend;
+struct WebDevToolsMessageData;
+class WebString;
+class WebView;
+
+} // namespace WebKit
+
+class DRTDevToolsAgent;
+
+class DRTDevToolsClient : public WebKit::WebDevToolsFrontendClient
+ , public Noncopyable {
+public:
+ DRTDevToolsClient(DRTDevToolsAgent*, WebKit::WebView*);
+ virtual ~DRTDevToolsClient();
+ void reset();
+
+ // WebDevToolsFrontendClient implementation
+ virtual void sendFrontendLoaded();
+ virtual void sendMessageToBackend(const WebKit::WebString&);
+ virtual void sendDebuggerCommandToAgent(const WebKit::WebString& command);
+
+ virtual void activateWindow();
+ virtual void closeWindow();
+ virtual void dockWindow();
+ virtual void undockWindow();
+
+ void asyncCall(const DRTDevToolsCallArgs&);
+
+ void allMessagesProcessed();
+ TaskList* taskList() { return &m_taskList; }
+
+ private:
+ void call(const DRTDevToolsCallArgs&);
+ class AsyncCallTask: public MethodTask<DRTDevToolsClient> {
+ public:
+ AsyncCallTask(DRTDevToolsClient* object, const DRTDevToolsCallArgs& args)
+ : MethodTask<DRTDevToolsClient>(object), m_args(args) {}
+ virtual void runIfValid() { m_object->call(m_args); }
+ private:
+ DRTDevToolsCallArgs m_args;
+ };
+
+ TaskList m_taskList;
+ WebKit::WebView* m_webView;
+ DRTDevToolsAgent* m_drtDevToolsAgent;
+ WTF::OwnPtr<WebKit::WebDevToolsFrontend> m_webDevToolsFrontend;
+};
+
+#endif // DRTDevToolsClient_h
diff --git a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
new file mode 100644
index 0000000..3bbba98
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "TestShell.h"
+#include "webkit/support/webkit_support.h"
+#include <v8/include/v8.h>
+#include <wtf/Vector.h>
+
+using namespace std;
+
+static const char optionComplexText[] = "--complex-text";
+static const char optionDumpAllPixels[] = "--dump-all-pixels";
+static const char optionNotree[] = "--notree";
+static const char optionPixelTests[] = "--pixel-tests";
+static const char optionThreaded[] = "--threaded";
+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 const char optionStartupDialog[] = "--testshell-startup-dialog";
+static const char optionCheckLayoutTestSystemDeps[] = "--check-layout-test-sys-deps";
+static const char optionEnableAcceleratedCompositing[] = "--enable-accelerated-compositing";
+static const char optionEnableAccelerated2DCanvas[] = "--enable-accelerated-2d-canvas";
+
+static const char optionMultipleLoads[] = "--multiple-loads=";
+static const char optionJavaScriptFlags[] = "--js-flags=";
+
+static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode)
+{
+ int oldTimeoutMsec = shell.layoutTestTimeout();
+ params.pixelHash = "";
+ string pathOrURL = testName;
+ if (testShellMode) {
+ string timeOut;
+ string::size_type separatorPosition = pathOrURL.find(' ');
+ if (separatorPosition != string::npos) {
+ timeOut = pathOrURL.substr(separatorPosition + 1);
+ pathOrURL.erase(separatorPosition);
+ separatorPosition = timeOut.find_first_of(' ');
+ if (separatorPosition != string::npos) {
+ params.pixelHash = timeOut.substr(separatorPosition + 1);
+ timeOut.erase(separatorPosition);
+ }
+ shell.setLayoutTestTimeout(atoi(timeOut.c_str()));
+ }
+ } else {
+ string::size_type separatorPosition = pathOrURL.find("'");
+ if (separatorPosition != string::npos) {
+ params.pixelHash = pathOrURL.substr(separatorPosition + 1);
+ pathOrURL.erase(separatorPosition);
+ }
+ }
+ params.testUrl = webkit_support::CreateURLForPathOrURL(pathOrURL);
+ webkit_support::SetCurrentDirectoryForFileURL(params.testUrl);
+ for (int i = 0; i < shell.loadCount(); i++) {
+ string javaScriptFlags = shell.javaScriptFlagsForLoad(i);
+ v8::V8::SetFlagsFromString(javaScriptFlags.data(), static_cast<int>(javaScriptFlags.size()));
+ bool isLastLoad = (i == (shell.loadCount() - 1));
+ shell.setDumpWhenFinished(isLastLoad);
+ shell.resetTestController();
+ shell.runFileTest(params);
+ }
+ shell.setLayoutTestTimeout(oldTimeoutMsec);
+}
+
+int main(int argc, char* argv[])
+{
+ webkit_support::SetUpTestEnvironment();
+ platformInit(&argc, &argv);
+
+ TestParams params;
+ Vector<string> tests;
+ bool serverMode = false;
+ bool testShellMode = false;
+ bool allowExternalPages = false;
+ bool startupDialog = false;
+ bool acceleratedCompositingEnabled = false;
+ bool accelerated2DCanvasEnabled = false;
+ int loadCount = 1;
+ string javaScriptFlags;
+ for (int i = 1; i < argc; ++i) {
+ string argument(argv[i]);
+ if (argument == "-")
+ serverMode = true;
+ else if (argument == optionNotree)
+ params.dumpTree = false;
+ else if (argument == optionPixelTests)
+ params.dumpPixels = true;
+ else if (!argument.find(optionPixelTestsWithName)) {
+ params.dumpPixels = true;
+ params.pixelFileName = argument.substr(strlen(optionPixelTestsWithName));
+ } else if (argument == optionTestShell) {
+ testShellMode = true;
+ serverMode = true;
+ } else if (argument == optionAllowExternalPages)
+ allowExternalPages = true;
+ else if (argument == optionStartupDialog)
+ startupDialog = true;
+ else if (argument == optionCheckLayoutTestSystemDeps)
+ exit(checkLayoutTestSystemDependencies() ? EXIT_SUCCESS : EXIT_FAILURE);
+ else if (argument == optionEnableAcceleratedCompositing)
+ acceleratedCompositingEnabled = true;
+ else if (argument == optionEnableAccelerated2DCanvas)
+ accelerated2DCanvasEnabled = true;
+ else if (!argument.find(optionMultipleLoads)) {
+ string multipleLoadsStr = argument.substr(strlen(optionMultipleLoads));
+ loadCount = atoi(multipleLoadsStr.c_str());
+ } else if (!argument.find(optionJavaScriptFlags)) {
+ javaScriptFlags = argument.substr(strlen(optionJavaScriptFlags));
+ } else if (argument.size() && argument[0] == '-')
+ fprintf(stderr, "Unknown option: %s\n", argv[i]);
+ else
+ tests.append(argument);
+ }
+ if (testShellMode && params.dumpPixels && params.pixelFileName.empty()) {
+ fprintf(stderr, "--pixel-tests with --test-shell requires a file name.\n");
+ return EXIT_FAILURE;
+ }
+ if (loadCount < 1) {
+ fprintf(stderr, "--multiple-loads requires a positive numeric argument.\n");
+ return EXIT_FAILURE;
+ }
+
+ // The test runner might send a quoted string which needs to be unquoted before further processing.
+ if (javaScriptFlags.length() > 1 && javaScriptFlags[0] == '"' && javaScriptFlags[javaScriptFlags.length() - 1] == '"')
+ javaScriptFlags = javaScriptFlags.substr(1, javaScriptFlags.length() - 2);
+ // Split the JavaScript flags into a list.
+ Vector<string> flagsList;
+ size_t start = 0;
+ while (true) {
+ size_t commaPos = javaScriptFlags.find_first_of(',', start);
+ string flags;
+ if (commaPos == string::npos)
+ flags = javaScriptFlags.substr(start, javaScriptFlags.length() - start);
+ else {
+ flags = javaScriptFlags.substr(start, commaPos - start);
+ start = commaPos + 1;
+ }
+ flagsList.append(flags);
+ if (commaPos == string::npos)
+ break;
+ }
+
+ if (startupDialog)
+ openStartupDialog();
+
+ { // Explicit scope for the TestShell instance.
+ TestShell shell(testShellMode);
+ shell.setAllowExternalPages(allowExternalPages);
+ shell.setAcceleratedCompositingEnabled(acceleratedCompositingEnabled);
+ shell.setAccelerated2dCanvasEnabled(accelerated2DCanvasEnabled);
+ shell.setLoadCount(loadCount);
+ shell.setJavaScriptFlags(flagsList);
+ if (serverMode && !tests.size()) {
+ params.printSeparators = true;
+ char testString[2048]; // 2048 is the same as the sizes of other platforms.
+ while (fgets(testString, sizeof(testString), stdin)) {
+ char* newLinePosition = strchr(testString, '\n');
+ if (newLinePosition)
+ *newLinePosition = '\0';
+ if (testString[0] == '\0')
+ continue;
+ runTest(shell, params, testString, testShellMode);
+ }
+ } else if (!tests.size())
+ printf("#EOF\n");
+ else {
+ params.printSeparators = tests.size() > 1;
+ for (unsigned i = 0; i < tests.size(); i++)
+ runTest(shell, params, tests[i], testShellMode);
+ }
+
+ shell.callJSGC();
+ shell.callJSGC();
+
+ // When we finish the last test, cleanup the LayoutTestController.
+ // It may have references to not-yet-cleaned up windows. By
+ // cleaning up here we help purify reports.
+ shell.resetTestController();
+ }
+
+ webkit_support::TearDownTestEnvironment();
+ return EXIT_SUCCESS;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
new file mode 100644
index 0000000..6104a90
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
@@ -0,0 +1,1008 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This file contains the definition for EventSender.
+//
+// Some notes about drag and drop handling:
+// Windows drag and drop goes through a system call to doDragDrop. At that
+// point, program control is given to Windows which then periodically makes
+// callbacks into the webview. This won't work for layout tests, so instead,
+// we queue up all the mouse move and mouse up events. When the test tries to
+// start a drag (by calling EvenSendingController::doDragDrop), we take the
+// events in the queue and replay them.
+// The behavior of queuing events and replaying them can be disabled by a
+// layout test by setting eventSender.dragMode to false.
+
+#include "config.h"
+#include "EventSender.h"
+
+#include "TestShell.h"
+#include "WebContextMenuData.h"
+#include "WebDragData.h"
+#include "WebDragOperation.h"
+#include "WebPoint.h"
+#include "WebString.h"
+#include "WebTouchPoint.h"
+#include "WebView.h"
+#include "webkit/support/webkit_support.h"
+#include <wtf/Deque.h>
+#include <wtf/StringExtras.h>
+
+#if OS(WINDOWS)
+#include "win/WebInputEventFactory.h"
+#endif
+
+// FIXME: layout before each event?
+
+using namespace std;
+using namespace WebKit;
+
+WebPoint EventSender::lastMousePos;
+WebMouseEvent::Button EventSender::pressedButton = WebMouseEvent::ButtonNone;
+WebMouseEvent::Button EventSender::lastButtonType = WebMouseEvent::ButtonNone;
+
+struct SavedEvent {
+ enum SavedEventType {
+ Unspecified,
+ MouseUp,
+ MouseMove,
+ LeapForward
+ };
+
+ SavedEventType type;
+ WebMouseEvent::Button buttonType; // For MouseUp.
+ WebPoint pos; // For MouseMove.
+ int milliseconds; // For LeapForward.
+
+ SavedEvent()
+ : type(Unspecified)
+ , buttonType(WebMouseEvent::ButtonNone)
+ , milliseconds(0) {}
+};
+
+static WebDragData currentDragData;
+static WebDragOperation currentDragEffect;
+static WebDragOperationsMask currentDragEffectsAllowed;
+static bool replayingSavedEvents = false;
+static Deque<SavedEvent> mouseEventQueue;
+static int touchModifiers;
+static Vector<WebTouchPoint> touchPoints;
+
+// Time and place of the last mouse up event.
+static double lastClickTimeSec = 0;
+static WebPoint lastClickPos;
+static int clickCount = 0;
+
+// maximum distance (in space and time) for a mouse click
+// to register as a double or triple click
+static const double multipleClickTimeSec = 1;
+static const int multipleClickRadiusPixels = 5;
+
+// How much we should scroll per event - the value here is chosen to
+// match the WebKit impl and layout test results.
+static const float scrollbarPixelsPerTick = 40.0f;
+
+inline bool outsideMultiClickRadius(const WebPoint& a, const WebPoint& b)
+{
+ return ((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)) >
+ multipleClickRadiusPixels * multipleClickRadiusPixels;
+}
+
+// Used to offset the time the event hander things an event happened. This is
+// done so tests can run without a delay, but bypass checks that are time
+// dependent (e.g., dragging has a timeout vs selection).
+static uint32 timeOffsetMs = 0;
+
+static double getCurrentEventTimeSec()
+{
+ return (webkit_support::GetCurrentTimeInMillisecond() + timeOffsetMs) / 1000.0;
+}
+
+static void advanceEventTime(int32_t deltaMs)
+{
+ timeOffsetMs += deltaMs;
+}
+
+static void initMouseEvent(WebInputEvent::Type t, WebMouseEvent::Button b,
+ const gfx::Point& pos, WebMouseEvent* e)
+{
+ e->type = t;
+ e->button = b;
+ e->modifiers = 0;
+ e->x = pos.x();
+ e->y = pos.y();
+ e->globalX = pos.x();
+ e->globalY = pos.y();
+ e->timeStampSeconds = getCurrentEventTimeSec();
+ e->clickCount = clickCount;
+}
+
+// Returns true if the specified key is the system key.
+static bool applyKeyModifier(const string& modifierName, WebInputEvent* event)
+{
+ bool isSystemKey = false;
+ const char* characters = modifierName.c_str();
+ if (!strcmp(characters, "ctrlKey")
+#if !OS(MAC_OS_X)
+ || !strcmp(characters, "addSelectionKey")
+#endif
+ ) {
+ event->modifiers |= WebInputEvent::ControlKey;
+ } else if (!strcmp(characters, "shiftKey") || !strcmp(characters, "rangeSelectionKey"))
+ event->modifiers |= WebInputEvent::ShiftKey;
+ else if (!strcmp(characters, "altKey")) {
+ event->modifiers |= WebInputEvent::AltKey;
+#if !OS(MAC_OS_X)
+ // On Windows all keys with Alt modifier will be marked as system key.
+ // We keep the same behavior on Linux and everywhere non-Mac, see:
+ // WebKit/chromium/src/gtk/WebInputEventFactory.cpp
+ // If we want to change this behavior on Linux, this piece of code must be
+ // kept in sync with the related code in above file.
+ isSystemKey = true;
+#endif
+#if OS(MAC_OS_X)
+ } else if (!strcmp(characters, "metaKey") || !strcmp(characters, "addSelectionKey")) {
+ event->modifiers |= WebInputEvent::MetaKey;
+ // On Mac only command key presses are marked as system key.
+ // See the related code in: WebKit/chromium/src/mac/WebInputEventFactory.cpp
+ // It must be kept in sync with the related code in above file.
+ isSystemKey = true;
+#else
+ } else if (!strcmp(characters, "metaKey")) {
+ event->modifiers |= WebInputEvent::MetaKey;
+#endif
+ }
+ return isSystemKey;
+}
+
+static bool applyKeyModifiers(const CppVariant* argument, WebInputEvent* event)
+{
+ bool isSystemKey = false;
+ if (argument->isObject()) {
+ Vector<string> modifiers = argument->toStringVector();
+ for (Vector<string>::const_iterator i = modifiers.begin(); i != modifiers.end(); ++i)
+ isSystemKey |= applyKeyModifier(*i, event);
+ } else if (argument->isString())
+ isSystemKey = applyKeyModifier(argument->toString(), event);
+ return isSystemKey;
+}
+
+// Get the edit command corresponding to a keyboard event.
+// Returns true if the specified event corresponds to an edit command, the name
+// of the edit command will be stored in |*name|.
+bool getEditCommand(const WebKeyboardEvent& event, string* name)
+{
+#if OS(MAC_OS_X)
+ // We only cares about Left,Right,Up,Down keys with Command or Command+Shift
+ // modifiers. These key events correspond to some special movement and
+ // selection editor commands, and was supposed to be handled in
+ // WebKit/chromium/src/EditorClientImpl.cpp. But these keys will be marked
+ // as system key, which prevents them from being handled. Thus they must be
+ // handled specially.
+ if ((event.modifiers & ~WebKeyboardEvent::ShiftKey) != WebKeyboardEvent::MetaKey)
+ return false;
+
+ switch (event.windowsKeyCode) {
+ case webkit_support::VKEY_LEFT:
+ *name = "MoveToBeginningOfLine";
+ break;
+ case webkit_support::VKEY_RIGHT:
+ *name = "MoveToEndOfLine";
+ break;
+ case webkit_support::VKEY_UP:
+ *name = "MoveToBeginningOfDocument";
+ break;
+ case webkit_support::VKEY_DOWN:
+ *name = "MoveToEndOfDocument";
+ break;
+ default:
+ return false;
+ }
+
+ if (event.modifiers & WebKeyboardEvent::ShiftKey)
+ name->append("AndModifySelection");
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+// Key event location code introduced in DOM Level 3.
+// See also: http://www.w3.org/TR/DOM-Level-3-Events/#events-keyboardevents
+enum KeyLocationCode {
+ DOMKeyLocationStandard = 0x00,
+ DOMKeyLocationLeft = 0x01,
+ DOMKeyLocationRight = 0x02,
+ DOMKeyLocationNumpad = 0x03
+};
+
+EventSender::EventSender(TestShell* shell)
+ : m_shell(shell)
+{
+ // Initialize the map that associates methods of this class with the names
+ // they will use when called by JavaScript. The actual binding of those
+ // names to their methods will be done by calling bindToJavaScript() (defined
+ // by CppBoundClass, the parent to EventSender).
+ bindMethod("addTouchPoint", &EventSender::addTouchPoint);
+ bindMethod("beginDragWithFiles", &EventSender::beginDragWithFiles);
+ bindMethod("cancelTouchPoint", &EventSender::cancelTouchPoint);
+ bindMethod("clearKillRing", &EventSender::clearKillRing);
+ bindMethod("clearTouchPoints", &EventSender::clearTouchPoints);
+ bindMethod("contextClick", &EventSender::contextClick);
+ bindMethod("continuousMouseScrollBy", &EventSender::continuousMouseScrollBy);
+ bindMethod("dispatchMessage", &EventSender::dispatchMessage);
+ bindMethod("enableDOMUIEventLogging", &EventSender::enableDOMUIEventLogging);
+ bindMethod("fireKeyboardEventsToElement", &EventSender::fireKeyboardEventsToElement);
+ bindMethod("keyDown", &EventSender::keyDown);
+ bindMethod("leapForward", &EventSender::leapForward);
+ bindMethod("mouseDown", &EventSender::mouseDown);
+ bindMethod("mouseMoveTo", &EventSender::mouseMoveTo);
+ bindMethod("mouseScrollBy", &EventSender::mouseScrollBy);
+ bindMethod("mouseUp", &EventSender::mouseUp);
+ bindMethod("releaseTouchPoint", &EventSender::releaseTouchPoint);
+ bindMethod("scheduleAsynchronousClick", &EventSender::scheduleAsynchronousClick);
+ bindMethod("setTouchModifier", &EventSender::setTouchModifier);
+ bindMethod("textZoomIn", &EventSender::textZoomIn);
+ bindMethod("textZoomOut", &EventSender::textZoomOut);
+ bindMethod("touchCancel", &EventSender::touchCancel);
+ bindMethod("touchEnd", &EventSender::touchEnd);
+ bindMethod("touchMove", &EventSender::touchMove);
+ bindMethod("touchStart", &EventSender::touchStart);
+ bindMethod("updateTouchPoint", &EventSender::updateTouchPoint);
+ bindMethod("zoomPageIn", &EventSender::zoomPageIn);
+ bindMethod("zoomPageOut", &EventSender::zoomPageOut);
+
+ // When set to true (the default value), we batch mouse move and mouse up
+ // events so we can simulate drag & drop.
+ bindProperty("dragMode", &dragMode);
+#if OS(WINDOWS)
+ bindProperty("WM_KEYDOWN", &wmKeyDown);
+ bindProperty("WM_KEYUP", &wmKeyUp);
+ bindProperty("WM_CHAR", &wmChar);
+ bindProperty("WM_DEADCHAR", &wmDeadChar);
+ bindProperty("WM_SYSKEYDOWN", &wmSysKeyDown);
+ bindProperty("WM_SYSKEYUP", &wmSysKeyUp);
+ bindProperty("WM_SYSCHAR", &wmSysChar);
+ bindProperty("WM_SYSDEADCHAR", &wmSysDeadChar);
+#endif
+}
+
+void EventSender::reset()
+{
+ // The test should have finished a drag and the mouse button state.
+ ASSERT(currentDragData.isNull());
+ currentDragData.reset();
+ currentDragEffect = WebKit::WebDragOperationNone;
+ currentDragEffectsAllowed = WebKit::WebDragOperationNone;
+ pressedButton = WebMouseEvent::ButtonNone;
+ dragMode.set(true);
+#if OS(WINDOWS)
+ wmKeyDown.set(WM_KEYDOWN);
+ wmKeyUp.set(WM_KEYUP);
+ wmChar.set(WM_CHAR);
+ wmDeadChar.set(WM_DEADCHAR);
+ wmSysKeyDown.set(WM_SYSKEYDOWN);
+ wmSysKeyUp.set(WM_SYSKEYUP);
+ wmSysChar.set(WM_SYSCHAR);
+ wmSysDeadChar.set(WM_SYSDEADCHAR);
+#endif
+ lastMousePos = WebPoint(0, 0);
+ lastClickTimeSec = 0;
+ lastClickPos = WebPoint(0, 0);
+ clickCount = 0;
+ lastButtonType = WebMouseEvent::ButtonNone;
+ timeOffsetMs = 0;
+ touchModifiers = 0;
+ touchPoints.clear();
+ m_taskList.revokeAll();
+}
+
+WebView* EventSender::webview()
+{
+ return m_shell->webView();
+}
+
+void EventSender::doDragDrop(const WebDragData& dragData, WebDragOperationsMask mask)
+{
+ WebMouseEvent event;
+ initMouseEvent(WebInputEvent::MouseDown, pressedButton, lastMousePos, &event);
+ WebPoint clientPoint(event.x, event.y);
+ WebPoint screenPoint(event.globalX, event.globalY);
+ currentDragData = dragData;
+ currentDragEffectsAllowed = mask;
+ currentDragEffect = webview()->dragTargetDragEnter(dragData, 0, clientPoint, screenPoint, currentDragEffectsAllowed);
+
+ // Finish processing events.
+ replaySavedEvents();
+}
+
+WebMouseEvent::Button EventSender::getButtonTypeFromButtonNumber(int buttonCode)
+{
+ if (!buttonCode)
+ return WebMouseEvent::ButtonLeft;
+ if (buttonCode == 2)
+ return WebMouseEvent::ButtonRight;
+ return WebMouseEvent::ButtonMiddle;
+}
+
+int EventSender::getButtonNumberFromSingleArg(const CppArgumentList& arguments)
+{
+ int buttonCode = 0;
+ if (arguments.size() > 0 && arguments[0].isNumber())
+ buttonCode = arguments[0].toInt32();
+ return buttonCode;
+}
+
+void EventSender::updateClickCountForButton(WebMouseEvent::Button buttonType)
+{
+ if ((getCurrentEventTimeSec() - lastClickTimeSec < multipleClickTimeSec)
+ && (!outsideMultiClickRadius(lastMousePos, lastClickPos))
+ && (buttonType == lastButtonType))
+ ++clickCount;
+ else {
+ clickCount = 1;
+ lastButtonType = buttonType;
+ }
+}
+
+//
+// Implemented javascript methods.
+//
+
+void EventSender::mouseDown(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (result) // Could be 0 if invoked asynchronously.
+ result->setNull();
+
+ webview()->layout();
+
+ int buttonNumber = getButtonNumberFromSingleArg(arguments);
+ ASSERT(buttonNumber != -1);
+
+ WebMouseEvent::Button buttonType = getButtonTypeFromButtonNumber(buttonNumber);
+
+ updateClickCountForButton(buttonType);
+
+ WebMouseEvent event;
+ pressedButton = buttonType;
+ initMouseEvent(WebInputEvent::MouseDown, buttonType, lastMousePos, &event);
+ if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString()))
+ applyKeyModifiers(&(arguments[1]), &event);
+ webview()->handleInputEvent(event);
+}
+
+void EventSender::mouseUp(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (result) // Could be 0 if invoked asynchronously.
+ result->setNull();
+
+ webview()->layout();
+
+ int buttonNumber = getButtonNumberFromSingleArg(arguments);
+ ASSERT(buttonNumber != -1);
+
+ WebMouseEvent::Button buttonType = getButtonTypeFromButtonNumber(buttonNumber);
+
+ if (isDragMode() && !replayingSavedEvents) {
+ SavedEvent savedEvent;
+ savedEvent.type = SavedEvent::MouseUp;
+ savedEvent.buttonType = buttonType;
+ mouseEventQueue.append(savedEvent);
+ replaySavedEvents();
+ } else {
+ WebMouseEvent event;
+ initMouseEvent(WebInputEvent::MouseUp, buttonType, lastMousePos, &event);
+ if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString()))
+ applyKeyModifiers(&(arguments[1]), &event);
+ doMouseUp(event);
+ }
+}
+
+void EventSender::doMouseUp(const WebMouseEvent& e)
+{
+ webview()->handleInputEvent(e);
+
+ pressedButton = WebMouseEvent::ButtonNone;
+ lastClickTimeSec = e.timeStampSeconds;
+ lastClickPos = lastMousePos;
+
+ // If we're in a drag operation, complete it.
+ if (currentDragData.isNull())
+ return;
+ WebPoint clientPoint(e.x, e.y);
+ WebPoint screenPoint(e.globalX, e.globalY);
+
+ currentDragEffect = webview()->dragTargetDragOver(clientPoint, screenPoint, currentDragEffectsAllowed);
+ if (currentDragEffect)
+ webview()->dragTargetDrop(clientPoint, screenPoint);
+ else
+ webview()->dragTargetDragLeave();
+ webview()->dragSourceEndedAt(clientPoint, screenPoint, currentDragEffect);
+ webview()->dragSourceSystemDragEnded();
+
+ currentDragData.reset();
+}
+
+void EventSender::mouseMoveTo(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+ return;
+ webview()->layout();
+
+ WebPoint mousePos(arguments[0].toInt32(), arguments[1].toInt32());
+
+ if (isDragMode() && pressedButton == WebMouseEvent::ButtonLeft && !replayingSavedEvents) {
+ SavedEvent savedEvent;
+ savedEvent.type = SavedEvent::MouseMove;
+ savedEvent.pos = mousePos;
+ mouseEventQueue.append(savedEvent);
+ } else {
+ WebMouseEvent event;
+ initMouseEvent(WebInputEvent::MouseMove, pressedButton, mousePos, &event);
+ doMouseMove(event);
+ }
+}
+
+void EventSender::doMouseMove(const WebMouseEvent& e)
+{
+ lastMousePos = WebPoint(e.x, e.y);
+
+ webview()->handleInputEvent(e);
+
+ if (pressedButton == WebMouseEvent::ButtonNone || currentDragData.isNull())
+ return;
+ WebPoint clientPoint(e.x, e.y);
+ WebPoint screenPoint(e.globalX, e.globalY);
+ currentDragEffect = webview()->dragTargetDragOver(clientPoint, screenPoint, currentDragEffectsAllowed);
+}
+
+void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 1 || !arguments[0].isString())
+ return;
+ bool generateChar = false;
+
+ // FIXME: I'm not exactly sure how we should convert the string to a key
+ // event. This seems to work in the cases I tested.
+ // FIXME: Should we also generate a KEY_UP?
+ string codeStr = arguments[0].toString();
+
+ // Convert \n -> VK_RETURN. Some layout tests use \n to mean "Enter", when
+ // Windows uses \r for "Enter".
+ int code = 0;
+ int text = 0;
+ bool needsShiftKeyModifier = false;
+ if ("\n" == codeStr) {
+ generateChar = true;
+ text = code = webkit_support::VKEY_RETURN;
+ } else if ("rightArrow" == codeStr)
+ code = webkit_support::VKEY_RIGHT;
+ else if ("downArrow" == codeStr)
+ code = webkit_support::VKEY_DOWN;
+ else if ("leftArrow" == codeStr)
+ code = webkit_support::VKEY_LEFT;
+ else if ("upArrow" == codeStr)
+ code = webkit_support::VKEY_UP;
+ else if ("insert" == codeStr)
+ code = webkit_support::VKEY_INSERT;
+ else if ("delete" == codeStr)
+ code = webkit_support::VKEY_DELETE;
+ else if ("pageUp" == codeStr)
+ code = webkit_support::VKEY_PRIOR;
+ else if ("pageDown" == codeStr)
+ code = webkit_support::VKEY_NEXT;
+ else if ("home" == codeStr)
+ code = webkit_support::VKEY_HOME;
+ else if ("end" == codeStr)
+ code = webkit_support::VKEY_END;
+ else if ("printScreen" == codeStr)
+ code = webkit_support::VKEY_SNAPSHOT;
+ else {
+ // Compare the input string with the function-key names defined by the
+ // DOM spec (i.e. "F1",...,"F24"). If the input string is a function-key
+ // name, set its key code.
+ for (int i = 1; i <= 24; ++i) {
+ char functionChars[10];
+ snprintf(functionChars, 10, "F%d", i);
+ string functionKeyName(functionChars);
+ if (functionKeyName == codeStr) {
+ code = webkit_support::VKEY_F1 + (i - 1);
+ break;
+ }
+ }
+ if (!code) {
+ WebString webCodeStr = WebString::fromUTF8(codeStr.data(), codeStr.size());
+ ASSERT(webCodeStr.length() == 1);
+ text = code = webCodeStr.data()[0];
+ needsShiftKeyModifier = needsShiftModifier(code);
+ if ((code & 0xFF) >= 'a' && (code & 0xFF) <= 'z')
+ code -= 'a' - 'A';
+ generateChar = true;
+ }
+ }
+
+ // For one generated keyboard event, we need to generate a keyDown/keyUp
+ // pair; refer to EventSender.cpp in WebKit/WebKitTools/DumpRenderTree/win.
+ // On Windows, we might also need to generate a char event to mimic the
+ // Windows event flow; on other platforms we create a merged event and test
+ // the event flow that that platform provides.
+ WebKeyboardEvent eventDown, eventChar, eventUp;
+ eventDown.type = WebInputEvent::RawKeyDown;
+ eventDown.modifiers = 0;
+ eventDown.windowsKeyCode = code;
+ if (generateChar) {
+ eventDown.text[0] = text;
+ eventDown.unmodifiedText[0] = text;
+ }
+ eventDown.setKeyIdentifierFromWindowsKeyCode();
+
+ if (arguments.size() >= 2 && (arguments[1].isObject() || arguments[1].isString()))
+ eventDown.isSystemKey = applyKeyModifiers(&(arguments[1]), &eventDown);
+
+ if (needsShiftKeyModifier)
+ eventDown.modifiers |= WebInputEvent::ShiftKey;
+
+ // See if KeyLocation argument is given.
+ if (arguments.size() >= 3 && arguments[2].isNumber()) {
+ int location = arguments[2].toInt32();
+ if (location == DOMKeyLocationNumpad)
+ eventDown.modifiers |= WebInputEvent::IsKeyPad;
+ }
+
+ eventChar = eventUp = eventDown;
+ eventUp.type = WebInputEvent::KeyUp;
+ // EventSender.m forces a layout here, with at least one
+ // test (fast/forms/focus-control-to-page.html) relying on this.
+ webview()->layout();
+
+ // In the browser, if a keyboard event corresponds to an editor command,
+ // the command will be dispatched to the renderer just before dispatching
+ // the keyboard event, and then it will be executed in the
+ // RenderView::handleCurrentKeyboardEvent() method, which is called from
+ // third_party/WebKit/WebKit/chromium/src/EditorClientImpl.cpp.
+ // We just simulate the same behavior here.
+ string editCommand;
+ if (getEditCommand(eventDown, &editCommand))
+ m_shell->webViewHost()->setEditCommand(editCommand, "");
+
+ webview()->handleInputEvent(eventDown);
+
+ m_shell->webViewHost()->clearEditCommand();
+
+ if (generateChar) {
+ eventChar.type = WebInputEvent::Char;
+ eventChar.keyIdentifier[0] = '\0';
+ webview()->handleInputEvent(eventChar);
+ }
+
+ webview()->handleInputEvent(eventUp);
+}
+
+void EventSender::dispatchMessage(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+#if OS(WINDOWS)
+ if (arguments.size() == 3) {
+ // Grab the message id to see if we need to dispatch it.
+ int msg = arguments[0].toInt32();
+
+ // WebKit's version of this function stuffs a MSG struct and uses
+ // TranslateMessage and DispatchMessage. We use a WebKeyboardEvent, which
+ // doesn't need to receive the DeadChar and SysDeadChar messages.
+ if (msg == WM_DEADCHAR || msg == WM_SYSDEADCHAR)
+ return;
+
+ webview()->layout();
+
+ unsigned long lparam = static_cast<unsigned long>(arguments[2].toDouble());
+ webview()->handleInputEvent(WebInputEventFactory::keyboardEvent(0, msg, arguments[1].toInt32(), lparam));
+ } else
+ ASSERT_NOT_REACHED();
+#endif
+}
+
+bool EventSender::needsShiftModifier(int keyCode)
+{
+ // If code is an uppercase letter, assign a SHIFT key to
+ // eventDown.modifier, this logic comes from
+ // WebKit/WebKitTools/DumpRenderTree/Win/EventSender.cpp
+ return (keyCode & 0xFF) >= 'A' && (keyCode & 0xFF) <= 'Z';
+}
+
+void EventSender::leapForward(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ if (arguments.size() < 1 || !arguments[0].isNumber())
+ return;
+
+ int milliseconds = arguments[0].toInt32();
+ if (isDragMode() && pressedButton == WebMouseEvent::ButtonLeft && !replayingSavedEvents) {
+ SavedEvent savedEvent;
+ savedEvent.type = SavedEvent::LeapForward;
+ savedEvent.milliseconds = milliseconds;
+ mouseEventQueue.append(savedEvent);
+ } else
+ doLeapForward(milliseconds);
+}
+
+void EventSender::doLeapForward(int milliseconds)
+{
+ advanceEventTime(milliseconds);
+}
+
+// Apple's port of WebKit zooms by a factor of 1.2 (see
+// WebKit/WebView/WebView.mm)
+void EventSender::textZoomIn(const CppArgumentList&, CppVariant* result)
+{
+ webview()->setZoomLevel(true, webview()->zoomLevel() + 1);
+ result->setNull();
+}
+
+void EventSender::textZoomOut(const CppArgumentList&, CppVariant* result)
+{
+ webview()->setZoomLevel(true, webview()->zoomLevel() - 1);
+ result->setNull();
+}
+
+void EventSender::zoomPageIn(const CppArgumentList&, CppVariant* result)
+{
+ webview()->setZoomLevel(false, webview()->zoomLevel() + 1);
+ result->setNull();
+}
+
+void EventSender::zoomPageOut(const CppArgumentList&, CppVariant* result)
+{
+ webview()->setZoomLevel(false, webview()->zoomLevel() - 1);
+ result->setNull();
+}
+
+void EventSender::mouseScrollBy(const CppArgumentList& arguments, CppVariant* result)
+{
+ handleMouseWheel(arguments, result, false);
+}
+
+void EventSender::continuousMouseScrollBy(const CppArgumentList& arguments, CppVariant* result)
+{
+ handleMouseWheel(arguments, result, true);
+}
+
+void EventSender::replaySavedEvents()
+{
+ replayingSavedEvents = true;
+ while (!mouseEventQueue.isEmpty()) {
+ SavedEvent e = mouseEventQueue.takeFirst();
+
+ switch (e.type) {
+ case SavedEvent::MouseMove: {
+ WebMouseEvent event;
+ initMouseEvent(WebInputEvent::MouseMove, pressedButton, e.pos, &event);
+ doMouseMove(event);
+ break;
+ }
+ case SavedEvent::LeapForward:
+ doLeapForward(e.milliseconds);
+ break;
+ case SavedEvent::MouseUp: {
+ WebMouseEvent event;
+ initMouseEvent(WebInputEvent::MouseUp, e.buttonType, lastMousePos, &event);
+ doMouseUp(event);
+ break;
+ }
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ }
+
+ replayingSavedEvents = false;
+}
+
+// Because actual context menu is implemented by the browser side,
+// this function does only what LayoutTests are expecting:
+// - Many test checks the count of items. So returning non-zero value makes sense.
+// - Some test compares the count before and after some action. So changing the count based on flags
+// also makes sense. This function is doing such for some flags.
+// - Some test even checks actual string content. So providing it would be also helpful.
+//
+static Vector<WebString> makeMenuItemStringsFor(WebContextMenuData* contextMenu, MockSpellCheck* spellcheck)
+{
+ // These constants are based on Safari's context menu because tests are made for it.
+ static const char* nonEditableMenuStrings[] = { "Back", "Reload Page", "Open in Dashbaord", "<separator>", "View Source", "Save Page As", "Print Page", "Inspect Element", 0 };
+ static const char* editableMenuStrings[] = { "Cut", "Copy", "<separator>", "Paste", "Spelling and Grammar", "Substitutions, Transformations", "Font", "Speech", "Paragraph Direction", "<separator>", 0 };
+
+ // This is possible because mouse events are cancelleable.
+ if (!contextMenu)
+ return Vector<WebString>();
+
+ Vector<WebString> strings;
+
+ if (contextMenu->isEditable) {
+ for (const char** item = editableMenuStrings; *item; ++item)
+ strings.append(WebString::fromUTF8(*item));
+ Vector<WebString> suggestions;
+ spellcheck->fillSuggestionList(contextMenu->misspelledWord, &suggestions);
+ for (size_t i = 0; i < suggestions.size(); ++i)
+ strings.append(suggestions[i]);
+ } else {
+ for (const char** item = nonEditableMenuStrings; *item; ++item)
+ strings.append(WebString::fromUTF8(*item));
+ }
+
+ return strings;
+}
+
+
+void EventSender::contextClick(const CppArgumentList& arguments, CppVariant* result)
+{
+ webview()->layout();
+
+ updateClickCountForButton(WebMouseEvent::ButtonRight);
+
+ // Clears last context menu data because we need to know if the context menu be requested
+ // after following mouse events.
+ m_shell->webViewHost()->clearContextMenuData();
+
+ // Generate right mouse down and up.
+ WebMouseEvent event;
+ pressedButton = WebMouseEvent::ButtonRight;
+ initMouseEvent(WebInputEvent::MouseDown, WebMouseEvent::ButtonRight, lastMousePos, &event);
+ webview()->handleInputEvent(event);
+
+ initMouseEvent(WebInputEvent::MouseUp, WebMouseEvent::ButtonRight, lastMousePos, &event);
+ webview()->handleInputEvent(event);
+
+ pressedButton = WebMouseEvent::ButtonNone;
+
+ WebContextMenuData* lastContextMenu = m_shell->webViewHost()->lastContextMenuData();
+ result->set(WebBindings::makeStringArray(makeMenuItemStringsFor(lastContextMenu, m_shell->webViewHost()->mockSpellCheck())));
+}
+
+class MouseDownTask: public MethodTask<EventSender> {
+public:
+ MouseDownTask(EventSender* obj, const CppArgumentList& arg)
+ : MethodTask<EventSender>(obj), m_arguments(arg) {}
+ virtual void runIfValid() { m_object->mouseDown(m_arguments, 0); }
+private:
+ CppArgumentList m_arguments;
+};
+
+class MouseUpTask: public MethodTask<EventSender> {
+public:
+ MouseUpTask(EventSender* obj, const CppArgumentList& arg)
+ : MethodTask<EventSender>(obj), m_arguments(arg) {}
+ virtual void runIfValid() { m_object->mouseUp(m_arguments, 0); }
+private:
+ CppArgumentList m_arguments;
+};
+
+void EventSender::scheduleAsynchronousClick(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ postTask(new MouseDownTask(this, arguments));
+ postTask(new MouseUpTask(this, arguments));
+}
+
+void EventSender::beginDragWithFiles(const CppArgumentList& arguments, CppVariant* result)
+{
+ currentDragData.initialize();
+ Vector<string> files = arguments[0].toStringVector();
+ for (size_t i = 0; i < files.size(); ++i)
+ currentDragData.appendToFilenames(webkit_support::GetAbsoluteWebStringFromUTF8Path(files[i]));
+ currentDragEffectsAllowed = WebKit::WebDragOperationCopy;
+
+ // Provide a drag source.
+ webview()->dragTargetDragEnter(currentDragData, 0, lastMousePos, lastMousePos, currentDragEffectsAllowed);
+
+ // dragMode saves events and then replays them later. We don't need/want that.
+ dragMode.set(false);
+
+ // Make the rest of eventSender think a drag is in progress.
+ pressedButton = WebMouseEvent::ButtonLeft;
+
+ result->setNull();
+}
+
+void EventSender::addTouchPoint(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ WebTouchPoint touchPoint;
+ touchPoint.state = WebTouchPoint::StatePressed;
+ touchPoint.position = WebPoint(arguments[0].toInt32(), arguments[1].toInt32());
+ touchPoint.screenPosition = touchPoint.position;
+ touchPoint.id = touchPoints.size();
+ touchPoints.append(touchPoint);
+}
+
+void EventSender::clearTouchPoints(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+ touchPoints.clear();
+}
+
+void EventSender::releaseTouchPoint(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ const unsigned index = arguments[0].toInt32();
+ ASSERT(index < touchPoints.size());
+
+ WebTouchPoint* touchPoint = &touchPoints[index];
+ touchPoint->state = WebTouchPoint::StateReleased;
+}
+
+void EventSender::setTouchModifier(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ int mask = 0;
+ const string keyName = arguments[0].toString();
+ if (keyName == "shift")
+ mask = WebInputEvent::ShiftKey;
+ else if (keyName == "alt")
+ mask = WebInputEvent::AltKey;
+ else if (keyName == "ctrl")
+ mask = WebInputEvent::ControlKey;
+ else if (keyName == "meta")
+ mask = WebInputEvent::MetaKey;
+
+ if (arguments[1].toBoolean())
+ touchModifiers |= mask;
+ else
+ touchModifiers &= ~mask;
+}
+
+void EventSender::updateTouchPoint(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ const unsigned index = arguments[0].toInt32();
+ ASSERT(index < touchPoints.size());
+
+ WebPoint position(arguments[1].toInt32(), arguments[2].toInt32());
+ WebTouchPoint* touchPoint = &touchPoints[index];
+ touchPoint->state = WebTouchPoint::StateMoved;
+ touchPoint->position = position;
+ touchPoint->screenPosition = position;
+}
+
+void EventSender::cancelTouchPoint(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ const unsigned index = arguments[0].toInt32();
+ ASSERT(index < touchPoints.size());
+
+ WebTouchPoint* touchPoint = &touchPoints[index];
+ touchPoint->state = WebTouchPoint::StateCancelled;
+}
+
+void EventSender::sendCurrentTouchEvent(const WebInputEvent::Type type)
+{
+ ASSERT(static_cast<unsigned>(WebTouchEvent::touchPointsLengthCap) > touchPoints.size());
+ webview()->layout();
+
+ WebTouchEvent touchEvent;
+ touchEvent.type = type;
+ touchEvent.modifiers = touchModifiers;
+ touchEvent.timeStampSeconds = getCurrentEventTimeSec();
+ touchEvent.touchPointsLength = touchPoints.size();
+ for (unsigned i = 0; i < touchPoints.size(); ++i)
+ touchEvent.touchPoints[i] = touchPoints[i];
+ webview()->handleInputEvent(touchEvent);
+
+ for (unsigned i = 0; i < touchPoints.size(); ++i) {
+ WebTouchPoint* touchPoint = &touchPoints[i];
+ if (touchPoint->state == WebTouchPoint::StateReleased) {
+ touchPoints.remove(i);
+ --i;
+ } else
+ touchPoint->state = WebTouchPoint::StateStationary;
+ }
+}
+
+void EventSender::handleMouseWheel(const CppArgumentList& arguments, CppVariant* result, bool continuous)
+{
+ result->setNull();
+
+ if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+ return;
+
+ // Force a layout here just to make sure every position has been
+ // determined before we send events (as well as all the other methods
+ // that send an event do).
+ webview()->layout();
+
+ int horizontal = arguments[0].toInt32();
+ int vertical = arguments[1].toInt32();
+
+ WebMouseWheelEvent event;
+ initMouseEvent(WebInputEvent::MouseWheel, pressedButton, lastMousePos, &event);
+ event.wheelTicksX = static_cast<float>(horizontal);
+ event.wheelTicksY = static_cast<float>(vertical);
+ event.deltaX = event.wheelTicksX;
+ event.deltaY = event.wheelTicksY;
+ if (continuous) {
+ event.wheelTicksX /= scrollbarPixelsPerTick;
+ event.wheelTicksY /= scrollbarPixelsPerTick;
+ } else {
+ event.deltaX *= scrollbarPixelsPerTick;
+ event.deltaY *= scrollbarPixelsPerTick;
+ }
+ webview()->handleInputEvent(event);
+}
+
+void EventSender::touchEnd(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+ sendCurrentTouchEvent(WebInputEvent::TouchEnd);
+}
+
+void EventSender::touchMove(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+ sendCurrentTouchEvent(WebInputEvent::TouchMove);
+}
+
+void EventSender::touchStart(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+ sendCurrentTouchEvent(WebInputEvent::TouchStart);
+}
+
+void EventSender::touchCancel(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+ sendCurrentTouchEvent(WebInputEvent::TouchCancel);
+}
+
+//
+// Unimplemented stubs
+//
+
+void EventSender::enableDOMUIEventLogging(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void EventSender::fireKeyboardEventsToElement(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
+
+void EventSender::clearKillRing(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/EventSender.h b/WebKitTools/DumpRenderTree/chromium/EventSender.h
new file mode 100644
index 0000000..118509b
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/EventSender.h
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ EventSender class:
+ Bound to a JavaScript window.eventSender object using
+ CppBoundClass::bindToJavascript(), this allows layout tests to fire DOM events.
+*/
+
+#ifndef EventSender_h
+#define EventSender_h
+
+#include "CppBoundClass.h"
+#include "Task.h"
+#include "WebDragOperation.h"
+#include "WebInputEvent.h"
+#include "WebPoint.h"
+
+class TestShell;
+
+namespace WebKit {
+class WebDragData;
+class WebView;
+}
+
+class EventSender : public CppBoundClass {
+public:
+ // Builds the property and method lists needed to bind this class to a JS
+ // object.
+ EventSender(TestShell*);
+
+ // Resets some static variable state.
+ void reset();
+
+ // Simulate drag&drop system call.
+ void doDragDrop(const WebKit::WebDragData&, WebKit::WebDragOperationsMask);
+
+ // JS callback methods.
+ void mouseDown(const CppArgumentList&, CppVariant*);
+ void mouseUp(const CppArgumentList&, CppVariant*);
+ void mouseMoveTo(const CppArgumentList&, CppVariant*);
+ void leapForward(const CppArgumentList&, CppVariant*);
+ void keyDown(const CppArgumentList&, CppVariant*);
+ void dispatchMessage(const CppArgumentList&, CppVariant*);
+ void textZoomIn(const CppArgumentList&, CppVariant*);
+ void textZoomOut(const CppArgumentList&, CppVariant*);
+ void zoomPageIn(const CppArgumentList&, CppVariant*);
+ void zoomPageOut(const CppArgumentList&, CppVariant*);
+ void mouseScrollBy(const CppArgumentList&, CppVariant*);
+ void continuousMouseScrollBy(const CppArgumentList&, CppVariant*);
+ void scheduleAsynchronousClick(const CppArgumentList&, CppVariant*);
+ void beginDragWithFiles(const CppArgumentList&, CppVariant*);
+ CppVariant dragMode;
+
+ void addTouchPoint(const CppArgumentList&, CppVariant*);
+ void cancelTouchPoint(const CppArgumentList&, CppVariant*);
+ void clearTouchPoints(const CppArgumentList&, CppVariant*);
+ void releaseTouchPoint(const CppArgumentList&, CppVariant*);
+ void setTouchModifier(const CppArgumentList&, CppVariant*);
+ void touchCancel(const CppArgumentList&, CppVariant*);
+ void touchEnd(const CppArgumentList&, CppVariant*);
+ void touchMove(const CppArgumentList&, CppVariant*);
+ void touchStart(const CppArgumentList&, CppVariant*);
+ void updateTouchPoint(const CppArgumentList&, CppVariant*);
+
+ // Unimplemented stubs
+ void contextClick(const CppArgumentList&, CppVariant*);
+ void enableDOMUIEventLogging(const CppArgumentList&, CppVariant*);
+ void fireKeyboardEventsToElement(const CppArgumentList&, CppVariant*);
+ void clearKillRing(const CppArgumentList&, CppVariant*);
+
+ // Properties used in layout tests.
+#if defined(OS_WIN)
+ CppVariant wmKeyDown;
+ CppVariant wmKeyUp;
+ CppVariant wmChar;
+ CppVariant wmDeadChar;
+ CppVariant wmSysKeyDown;
+ CppVariant wmSysKeyUp;
+ CppVariant wmSysChar;
+ CppVariant wmSysDeadChar;
+#endif
+
+ TaskList* taskList() { return &m_taskList; }
+
+private:
+ // Returns the test shell's webview.
+ WebKit::WebView* webview();
+
+ // Returns true if dragMode is true.
+ bool isDragMode() { return dragMode.isBool() && dragMode.toBoolean(); }
+
+ // Sometimes we queue up mouse move and mouse up events for drag drop
+ // handling purposes. These methods dispatch the event.
+ void doMouseMove(const WebKit::WebMouseEvent&);
+ void doMouseUp(const WebKit::WebMouseEvent&);
+ static void doLeapForward(int milliseconds);
+ void replaySavedEvents();
+
+ // Helper to return the button type given a button code
+ static WebKit::WebMouseEvent::Button getButtonTypeFromButtonNumber(int);
+
+ // Helper to extract the button number from the optional argument in
+ // mouseDown and mouseUp
+ static int getButtonNumberFromSingleArg(const CppArgumentList&);
+
+ // Returns true if the specified key code passed in needs a shift key
+ // modifier to be passed into the generated event.
+ bool needsShiftModifier(int);
+
+ void updateClickCountForButton(WebKit::WebMouseEvent::Button);
+
+ // Compose a touch event from the current touch points and send it.
+ void sendCurrentTouchEvent(const WebKit::WebInputEvent::Type);
+
+ // Handle a request to send a wheel event.
+ void handleMouseWheel(const CppArgumentList&, CppVariant*, bool continuous);
+
+ TaskList m_taskList;
+
+ // Non-owning pointer. The EventSender is owned by the TestShell.
+ TestShell* m_shell;
+
+ // Location of last mouseMoveTo event.
+ static WebKit::WebPoint lastMousePos;
+
+ // Currently pressed mouse button (Left/Right/Middle or None)
+ static WebKit::WebMouseEvent::Button pressedButton;
+
+ // The last button number passed to mouseDown and mouseUp.
+ // Used to determine whether the click count continues to
+ // increment or not.
+ static WebKit::WebMouseEvent::Button lastButtonType;
+};
+
+#endif // EventSender_h
diff --git a/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp b/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp
new file mode 100644
index 0000000..f2875dd
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/ImageDiff.cpp
@@ -0,0 +1,408 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This file input format is based loosely on
+// WebKitTools/DumpRenderTree/ImageDiff.m
+
+// The exact format of this tool's output to stdout is important, to match
+// what the run-webkit-tests script expects.
+
+#include "config.h"
+
+#include "webkit/support/webkit_support_gfx.h"
+#include <algorithm>
+#include <stdio.h>
+#include <string.h>
+#include <vector>
+#include <wtf/OwnArrayPtr.h>
+#include <wtf/Vector.h>
+
+#if OS(WINDOWS)
+#include <windows.h>
+#define PATH_MAX MAX_PATH
+#endif
+
+using namespace std;
+
+// Causes the app to remain open, waiting for pairs of filenames on stdin.
+// The caller is then responsible for terminating this app.
+static const char optionPollStdin[] = "--use-stdin";
+static const char optionGenerateDiff[] = "--diff";
+
+// Return codes used by this utility.
+static const int statusSame = 0;
+static const int statusDifferent = 1;
+static const int statusError = 2;
+
+// Color codes.
+static const uint32_t rgbaRed = 0x000000ff;
+static const uint32_t rgbaAlpha = 0xff000000;
+
+class Image {
+public:
+ Image()
+ : m_width(0)
+ , m_height(0) {}
+
+ Image(const Image& image)
+ : m_width(image.m_width)
+ , m_height(image.m_height)
+ , m_data(image.m_data) {}
+
+ bool hasImage() const { return m_width > 0 && m_height > 0; }
+ int width() const { return m_width; }
+ int height() const { return m_height; }
+ const unsigned char* data() const { return &m_data.front(); }
+
+ // Creates the image from stdin with the given data length. On success, it
+ // will return true. On failure, no other methods should be accessed.
+ bool craeteFromStdin(size_t byteLength)
+ {
+ if (!byteLength)
+ return false;
+
+ OwnArrayPtr<unsigned char> source(new unsigned char[byteLength]);
+ if (fread(source.get(), 1, byteLength, stdin) != byteLength)
+ return false;
+
+ if (!webkit_support::DecodePNG(source.get(), byteLength, &m_data, &m_width, &m_height)) {
+ clear();
+ return false;
+ }
+ return true;
+ }
+
+ // Creates the image from the given filename on disk, and returns true on
+ // success.
+ bool createFromFilename(const char* filename)
+ {
+ FILE* f = fopen(filename, "rb");
+ if (!f)
+ return false;
+
+ vector<unsigned char> compressed;
+ const int bufSize = 1024;
+ unsigned char buf[bufSize];
+ size_t numRead = 0;
+ while ((numRead = fread(buf, 1, bufSize, f)) > 0)
+ std::copy(buf, &buf[numRead], std::back_inserter(compressed));
+
+ fclose(f);
+
+ if (!webkit_support::DecodePNG(&compressed[0], compressed.size(), &m_data, &m_width, &m_height)) {
+ clear();
+ return false;
+ }
+ return true;
+ }
+
+ void clear()
+ {
+ m_width = m_height = 0;
+ m_data.clear();
+ }
+
+ // Returns the RGBA value of the pixel at the given location
+ const uint32_t pixelAt(int x, int y) const
+ {
+ ASSERT(x >= 0 && x < m_width);
+ ASSERT(y >= 0 && y < m_height);
+ return *reinterpret_cast<const uint32_t*>(&(m_data[(y * m_width + x) * 4]));
+ }
+
+ void setPixelAt(int x, int y, uint32_t color) const
+ {
+ ASSERT(x >= 0 && x < m_width);
+ ASSERT(y >= 0 && y < m_height);
+ void* addr = &const_cast<unsigned char*>(&m_data.front())[(y * m_width + x) * 4];
+ *reinterpret_cast<uint32_t*>(addr) = color;
+ }
+
+private:
+ // pixel dimensions of the image
+ int m_width, m_height;
+
+ vector<unsigned char> m_data;
+};
+
+float percentageDifferent(const Image& baseline, const Image& actual)
+{
+ int w = min(baseline.width(), actual.width());
+ int h = min(baseline.height(), actual.height());
+
+ // Compute pixels different in the overlap
+ int pixelsDifferent = 0;
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++) {
+ if (baseline.pixelAt(x, y) != actual.pixelAt(x, y))
+ pixelsDifferent++;
+ }
+ }
+
+ // Count pixels that are a difference in size as also being different
+ int maxWidth = max(baseline.width(), actual.width());
+ int maxHeight = max(baseline.height(), actual.height());
+
+ // ...pixels off the right side, but not including the lower right corner
+ pixelsDifferent += (maxWidth - w) * h;
+
+ // ...pixels along the bottom, including the lower right corner
+ pixelsDifferent += (maxHeight - h) * maxWidth;
+
+ // Like the WebKit ImageDiff tool, we define percentage different in terms
+ // of the size of the 'actual' bitmap.
+ float totalPixels = static_cast<float>(actual.width()) * static_cast<float>(actual.height());
+ if (!totalPixels)
+ return 100.0f; // When the bitmap is empty, they are 100% different.
+ return static_cast<float>(pixelsDifferent) / totalPixels * 100;
+}
+
+void printHelp()
+{
+ fprintf(stderr,
+ "Usage:\n"
+ " ImageDiff <compare file> <reference file>\n"
+ " Compares two files on disk, returning 0 when they are the same\n"
+ " ImageDiff --use-stdin\n"
+ " Stays open reading pairs of filenames from stdin, comparing them,\n"
+ " and sending 0 to stdout when they are the same\n"
+ " ImageDiff --diff <compare file> <reference file> <output file>\n"
+ " Compares two files on disk, outputs an image that visualizes the"
+ " difference to <output file>\n");
+ /* For unfinished webkit-like-mode (see below)
+ "\n"
+ " ImageDiff -s\n"
+ " Reads stream input from stdin, should be EXACTLY of the format\n"
+ " \"Content-length: <byte length> <data>Content-length: ...\n"
+ " it will take as many file pairs as given, and will compare them as\n"
+ " (cmp_file, reference_file) pairs\n");
+ */
+}
+
+int compareImages(const char* file1, const char* file2)
+{
+ Image actualImage;
+ Image baselineImage;
+
+ if (!actualImage.createFromFilename(file1)) {
+ fprintf(stderr, "ImageDiff: Unable to open file \"%s\"\n", file1);
+ return statusError;
+ }
+ if (!baselineImage.createFromFilename(file2)) {
+ fprintf(stderr, "ImageDiff: Unable to open file \"%s\"\n", file2);
+ return statusError;
+ }
+
+ float percent = percentageDifferent(actualImage, baselineImage);
+ if (percent > 0.0) {
+ // failure: The WebKit version also writes the difference image to
+ // stdout, which seems excessive for our needs.
+ printf("diff: %01.2f%% failed\n", percent);
+ return statusDifferent;
+ }
+
+ // success
+ printf("diff: %01.2f%% passed\n", percent);
+ return statusSame;
+
+}
+
+// Untested mode that acts like WebKit's image comparator. I wrote this but
+// decided it's too complicated. We may use it in the future if it looks useful.
+int untestedCompareImages()
+{
+ Image actualImage;
+ Image baselineImage;
+ char buffer[2048];
+ while (fgets(buffer, sizeof(buffer), stdin)) {
+ if (!strncmp("Content-length: ", buffer, 16)) {
+ char* context;
+#if OS(WINDOWS)
+ strtok_s(buffer, " ", &context);
+ int imageSize = strtol(strtok_s(0, " ", &context), 0, 10);
+#else
+ strtok_r(buffer, " ", &context);
+ int imageSize = strtol(strtok_r(0, " ", &context), 0, 10);
+#endif
+
+ bool success = false;
+ if (imageSize > 0 && !actualImage.hasImage()) {
+ if (!actualImage.craeteFromStdin(imageSize)) {
+ fputs("Error, input image can't be decoded.\n", stderr);
+ return 1;
+ }
+ } else if (imageSize > 0 && !baselineImage.hasImage()) {
+ if (!baselineImage.craeteFromStdin(imageSize)) {
+ fputs("Error, baseline image can't be decoded.\n", stderr);
+ return 1;
+ }
+ } else {
+ fputs("Error, image size must be specified.\n", stderr);
+ return 1;
+ }
+ }
+
+ if (actualImage.hasImage() && baselineImage.hasImage()) {
+ float percent = percentageDifferent(actualImage, baselineImage);
+ if (percent > 0.0) {
+ // failure: The WebKit version also writes the difference image to
+ // stdout, which seems excessive for our needs.
+ printf("diff: %01.2f%% failed\n", percent);
+ } else {
+ // success
+ printf("diff: %01.2f%% passed\n", percent);
+ }
+ actualImage.clear();
+ baselineImage.clear();
+ }
+ fflush(stdout);
+ }
+ return 0;
+}
+
+bool createImageDiff(const Image& image1, const Image& image2, Image* out)
+{
+ int w = min(image1.width(), image2.width());
+ int h = min(image1.height(), image2.height());
+ *out = Image(image1);
+ bool same = (image1.width() == image2.width()) && (image1.height() == image2.height());
+
+ // FIXME: do something with the extra pixels if the image sizes are different.
+ for (int y = 0; y < h; y++) {
+ for (int x = 0; x < w; x++) {
+ uint32_t basePixel = image1.pixelAt(x, y);
+ if (basePixel != image2.pixelAt(x, y)) {
+ // Set differing pixels red.
+ out->setPixelAt(x, y, rgbaRed | rgbaAlpha);
+ same = false;
+ } else {
+ // Set same pixels as faded.
+ uint32_t alpha = basePixel & rgbaAlpha;
+ uint32_t newPixel = basePixel - ((alpha / 2) & rgbaAlpha);
+ out->setPixelAt(x, y, newPixel);
+ }
+ }
+ }
+
+ return same;
+}
+
+static bool writeFile(const char* outFile, const unsigned char* data, size_t dataSize)
+{
+ FILE* file = fopen(outFile, "wb");
+ if (!file) {
+ fprintf(stderr, "ImageDiff: Unable to create file \"%s\"\n", outFile);
+ return false;
+ }
+ if (dataSize != fwrite(data, 1, dataSize, file)) {
+ fclose(file);
+ fprintf(stderr, "ImageDiff: Unable to write data to file \"%s\"\n", outFile);
+ return false;
+ }
+ fclose(file);
+ return true;
+}
+
+int diffImages(const char* file1, const char* file2, const char* outFile)
+{
+ Image actualImage;
+ Image baselineImage;
+
+ if (!actualImage.createFromFilename(file1)) {
+ fprintf(stderr, "ImageDiff: Unable to open file \"%s\"\n", file1);
+ return statusError;
+ }
+ if (!baselineImage.createFromFilename(file2)) {
+ fprintf(stderr, "ImageDiff: Unable to open file \"%s\"\n", file2);
+ return statusError;
+ }
+
+ Image diffImage;
+ bool same = createImageDiff(baselineImage, actualImage, &diffImage);
+ if (same)
+ return statusSame;
+
+ vector<unsigned char> pngData;
+ webkit_support::EncodeRGBAPNG(diffImage.data(), diffImage.width(), diffImage.height(),
+ diffImage.width() * 4, &pngData);
+ if (!writeFile(outFile, &pngData.front(), pngData.size()))
+ return statusError;
+ return statusDifferent;
+}
+
+int main(int argc, const char* argv[])
+{
+ Vector<const char*> values;
+ bool pollStdin = false;
+ bool generateDiff = false;
+ for (int i = 1; i < argc; ++i) {
+ if (!strcmp(argv[i], optionPollStdin))
+ pollStdin = true;
+ else if (!strcmp(argv[i], optionGenerateDiff))
+ generateDiff = true;
+ else
+ values.append(argv[i]);
+ }
+
+ if (pollStdin) {
+ // Watch stdin for filenames.
+ const size_t bufferSize = PATH_MAX;
+ char stdinBuffer[bufferSize];
+ char firstName[bufferSize];
+ bool haveFirstName = false;
+ while (fgets(stdinBuffer, bufferSize, stdin)) {
+ if (!stdinBuffer[0])
+ continue;
+
+ if (haveFirstName) {
+ // compareImages writes results to stdout unless an error occurred.
+ if (compareImages(firstName, stdinBuffer) == statusError)
+ printf("error\n");
+ fflush(stdout);
+ haveFirstName = false;
+ } else {
+ // Save the first filename in another buffer and wait for the second
+ // filename to arrive via stdin.
+ strcpy(firstName, stdinBuffer);
+ haveFirstName = true;
+ }
+ }
+ return 0;
+ }
+
+ if (generateDiff) {
+ if (values.size() == 3)
+ return diffImages(values[0], values[1], values[2]);
+ } else if (values.size() == 2)
+ return compareImages(argv[1], argv[2]);
+
+ printHelp();
+ return statusError;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
new file mode 100644
index 0000000..85b2dce
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -0,0 +1,1568 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "LayoutTestController.h"
+
+#include "DRTDevToolsAgent.h"
+#include "TestShell.h"
+#include "WebAnimationController.h"
+#include "WebBindings.h"
+#include "WebConsoleMessage.h"
+#include "WebData.h"
+#include "WebDeviceOrientation.h"
+#include "WebDeviceOrientationClientMock.h"
+#include "WebDocument.h"
+#include "WebElement.h"
+#include "WebFrame.h"
+#include "WebGeolocationServiceMock.h"
+#include "WebInputElement.h"
+#include "WebKit.h"
+#include "WebNotificationPresenter.h"
+#include "WebScriptSource.h"
+#include "WebSecurityPolicy.h"
+#include "WebSettings.h"
+#include "WebSize.h"
+#include "WebSpeechInputControllerMock.h"
+#include "WebURL.h"
+#include "WebView.h"
+#include "WebViewHost.h"
+#include "webkit/support/webkit_support.h"
+#include <algorithm>
+#include <cstdlib>
+#include <limits>
+#include <wtf/text/WTFString.h>
+
+#if OS(WINDOWS)
+#include <wtf/OwnArrayPtr.h>
+#endif
+
+using namespace WebCore;
+using namespace WebKit;
+using namespace std;
+
+LayoutTestController::LayoutTestController(TestShell* shell)
+ : m_shell(shell)
+ , m_closeRemainingWindows(false)
+ , m_deferMainResourceDataLoad(false)
+ , m_workQueue(this)
+{
+
+ // Initialize the map that associates methods of this class with the names
+ // they will use when called by JavaScript. The actual binding of those
+ // names to their methods will be done by calling bindToJavaScript() (defined
+ // by CppBoundClass, the parent to LayoutTestController).
+ bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag);
+ bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry);
+ bindMethod("addUserScript", &LayoutTestController::addUserScript);
+ bindMethod("addUserStyleSheet", &LayoutTestController::addUserStyleSheet);
+ bindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases);
+ bindMethod("closeWebInspector", &LayoutTestController::closeWebInspector);
+ bindMethod("counterValueForElementById", &LayoutTestController::counterValueForElementById);
+ bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading);
+ bindMethod("display", &LayoutTestController::display);
+ bindMethod("dumpAsText", &LayoutTestController::dumpAsText);
+ bindMethod("dumpBackForwardList", &LayoutTestController::dumpBackForwardList);
+ bindMethod("dumpChildFramesAsText", &LayoutTestController::dumpChildFramesAsText);
+ bindMethod("dumpChildFrameScrollPositions", &LayoutTestController::dumpChildFrameScrollPositions);
+ bindMethod("dumpDatabaseCallbacks", &LayoutTestController::dumpDatabaseCallbacks);
+ bindMethod("dumpEditingCallbacks", &LayoutTestController::dumpEditingCallbacks);
+ bindMethod("dumpFrameLoadCallbacks", &LayoutTestController::dumpFrameLoadCallbacks);
+ bindMethod("dumpUserGestureInFrameLoadCallbacks", &LayoutTestController::dumpUserGestureInFrameLoadCallbacks);
+ bindMethod("dumpResourceLoadCallbacks", &LayoutTestController::dumpResourceLoadCallbacks);
+ bindMethod("dumpResourceResponseMIMETypes", &LayoutTestController::dumpResourceResponseMIMETypes);
+ bindMethod("dumpSelectionRect", &LayoutTestController::dumpSelectionRect);
+ bindMethod("dumpStatusCallbacks", &LayoutTestController::dumpWindowStatusChanges);
+ bindMethod("dumpTitleChanges", &LayoutTestController::dumpTitleChanges);
+ bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId);
+ bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector);
+ bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld);
+ bindMethod("execCommand", &LayoutTestController::execCommand);
+ bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors);
+ bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission);
+ bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled);
+ bindMethod("layerTreeAsText", &LayoutTestController::layerTreeAsText);
+ bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem);
+ bindMethod("hasSpellingMarker", &LayoutTestController::hasSpellingMarker);
+ bindMethod("notifyDone", &LayoutTestController::notifyDone);
+ bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations);
+ bindMethod("numberOfPages", &LayoutTestController::numberOfPages);
+ bindMethod("objCIdentityIsEqual", &LayoutTestController::objCIdentityIsEqual);
+ bindMethod("overridePreference", &LayoutTestController::overridePreference);
+ bindMethod("pageNumberForElementById", &LayoutTestController::pageNumberForElementById);
+ bindMethod("pathToLocalResource", &LayoutTestController::pathToLocalResource);
+ bindMethod("pauseAnimationAtTimeOnElementWithId", &LayoutTestController::pauseAnimationAtTimeOnElementWithId);
+ bindMethod("pauseTransitionAtTimeOnElementWithId", &LayoutTestController::pauseTransitionAtTimeOnElementWithId);
+ bindMethod("queueBackNavigation", &LayoutTestController::queueBackNavigation);
+ bindMethod("queueForwardNavigation", &LayoutTestController::queueForwardNavigation);
+ bindMethod("queueLoadingScript", &LayoutTestController::queueLoadingScript);
+ bindMethod("queueLoad", &LayoutTestController::queueLoad);
+ bindMethod("queueLoadHTMLString", &LayoutTestController::queueLoadHTMLString);
+ bindMethod("queueNonLoadingScript", &LayoutTestController::queueNonLoadingScript);
+ bindMethod("queueReload", &LayoutTestController::queueReload);
+ bindMethod("removeOriginAccessWhitelistEntry", &LayoutTestController::removeOriginAccessWhitelistEntry);
+ bindMethod("repaintSweepHorizontally", &LayoutTestController::repaintSweepHorizontally);
+ bindMethod("resumeAnimations", &LayoutTestController::resumeAnimations);
+ bindMethod("sampleSVGAnimationForElementAtTime", &LayoutTestController::sampleSVGAnimationForElementAtTime);
+ bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing);
+ bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs);
+ bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs);
+ bindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies);
+ bindMethod("setAuthorAndUserStylesEnabled", &LayoutTestController::setAuthorAndUserStylesEnabled);
+ bindMethod("setCanOpenWindows", &LayoutTestController::setCanOpenWindows);
+ bindMethod("setCloseRemainingWindowsWhenComplete", &LayoutTestController::setCloseRemainingWindowsWhenComplete);
+ bindMethod("setCustomPolicyDelegate", &LayoutTestController::setCustomPolicyDelegate);
+ bindMethod("setDatabaseQuota", &LayoutTestController::setDatabaseQuota);
+ bindMethod("setDeferMainResourceDataLoad", &LayoutTestController::setDeferMainResourceDataLoad);
+ bindMethod("setDomainRelaxationForbiddenForURLScheme", &LayoutTestController::setDomainRelaxationForbiddenForURLScheme);
+ bindMethod("setEditingBehavior", &LayoutTestController::setEditingBehavior);
+ bindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission);
+ bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled);
+ bindMethod("setJavaScriptCanAccessClipboard", &LayoutTestController::setJavaScriptCanAccessClipboard);
+ bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation);
+ bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
+ bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
+ bindMethod("setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult);
+ bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled);
+ bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale);
+ bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy);
+ bindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled);
+ bindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled);
+ bindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads);
+ bindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements);
+ bindMethod("setTimelineProfilingEnabled", &LayoutTestController::setTimelineProfilingEnabled);
+ bindMethod("setUserStyleSheetEnabled", &LayoutTestController::setUserStyleSheetEnabled);
+ bindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation);
+ bindMethod("setWillSendRequestClearHeader", &LayoutTestController::setWillSendRequestClearHeader);
+ bindMethod("setWillSendRequestReturnsNull", &LayoutTestController::setWillSendRequestReturnsNull);
+ bindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect);
+ bindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey);
+ bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled);
+ bindMethod("showWebInspector", &LayoutTestController::showWebInspector);
+ bindMethod("simulateDesktopNotificationClick", &LayoutTestController::simulateDesktopNotificationClick);
+ bindMethod("suspendAnimations", &LayoutTestController::suspendAnimations);
+ bindMethod("testRepaint", &LayoutTestController::testRepaint);
+ bindMethod("waitForPolicyDelegate", &LayoutTestController::waitForPolicyDelegate);
+ bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone);
+ bindMethod("windowCount", &LayoutTestController::windowCount);
+
+ // The following are stubs.
+ bindMethod("abortModal", &LayoutTestController::abortModal);
+ bindMethod("accessStoredWebScriptObject", &LayoutTestController::accessStoredWebScriptObject);
+ bindMethod("addDisallowedURL", &LayoutTestController::addDisallowedURL);
+ bindMethod("callShouldCloseOnWebView", &LayoutTestController::callShouldCloseOnWebView);
+ bindMethod("clearAllApplicationCaches", &LayoutTestController::clearAllApplicationCaches);
+ bindMethod("clearBackForwardList", &LayoutTestController::clearBackForwardList);
+ bindMethod("dumpAsWebArchive", &LayoutTestController::dumpAsWebArchive);
+ bindMethod("keepWebHistory", &LayoutTestController::keepWebHistory);
+ bindMethod("objCClassNameOf", &LayoutTestController::objCClassNameOf);
+ bindMethod("setApplicationCacheOriginQuota", &LayoutTestController::setApplicationCacheOriginQuota);
+ bindMethod("setCallCloseOnWebViews", &LayoutTestController::setCallCloseOnWebViews);
+ bindMethod("setMainFrameIsFirstResponder", &LayoutTestController::setMainFrameIsFirstResponder);
+ bindMethod("setPrivateBrowsingEnabled", &LayoutTestController::setPrivateBrowsingEnabled);
+ bindMethod("setUseDashboardCompatibilityMode", &LayoutTestController::setUseDashboardCompatibilityMode);
+ bindMethod("storeWebScriptObject", &LayoutTestController::storeWebScriptObject);
+
+ // The fallback method is called when an unknown method is invoked.
+ bindFallbackMethod(&LayoutTestController::fallbackMethod);
+
+ // Shared properties.
+ // globalFlag is used by a number of layout tests in
+ // LayoutTests\http\tests\security\dataURL.
+ bindProperty("globalFlag", &m_globalFlag);
+ // webHistoryItemCount is used by tests in LayoutTests\http\tests\history
+ bindProperty("webHistoryItemCount", &m_webHistoryItemCount);
+}
+
+LayoutTestController::~LayoutTestController()
+{
+}
+
+LayoutTestController::WorkQueue::~WorkQueue()
+{
+ reset();
+}
+
+void LayoutTestController::WorkQueue::processWorkSoon()
+{
+ if (m_controller->m_shell->webViewHost()->topLoadingFrame())
+ return;
+
+ if (!m_queue.isEmpty()) {
+ // We delay processing queued work to avoid recursion problems.
+ postTask(new WorkQueueTask(this));
+ } else if (!m_controller->m_waitUntilDone)
+ m_controller->m_shell->testFinished();
+}
+
+void LayoutTestController::WorkQueue::processWork()
+{
+ TestShell* shell = m_controller->m_shell;
+ // Quit doing work once a load is in progress.
+ while (!m_queue.isEmpty()) {
+ bool startedLoad = m_queue.first()->run(shell);
+ delete m_queue.takeFirst();
+ if (startedLoad)
+ return;
+ }
+
+ if (!m_controller->m_waitUntilDone && !shell->webViewHost()->topLoadingFrame())
+ shell->testFinished();
+}
+
+void LayoutTestController::WorkQueue::reset()
+{
+ m_frozen = false;
+ while (!m_queue.isEmpty()) {
+ delete m_queue.takeFirst();
+ }
+}
+
+void LayoutTestController::WorkQueue::addWork(WorkItem* work)
+{
+ if (m_frozen) {
+ delete work;
+ return;
+ }
+ m_queue.append(work);
+}
+
+void LayoutTestController::dumpAsText(const CppArgumentList& arguments, CppVariant* result)
+{
+ m_dumpAsText = true;
+ m_generatePixelResults = false;
+
+ // Optional paramater, describing whether it's allowed to dump pixel results in dumpAsText mode.
+ if (arguments.size() > 0 && arguments[0].isBool())
+ m_generatePixelResults = arguments[0].value.boolValue;
+
+ result->setNull();
+}
+
+void LayoutTestController::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result)
+{
+ // Do nothing; we don't use this flag anywhere for now
+ result->setNull();
+}
+
+void LayoutTestController::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpEditingCallbacks = true;
+ result->setNull();
+}
+
+void LayoutTestController::dumpBackForwardList(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpBackForwardList = true;
+ result->setNull();
+}
+
+void LayoutTestController::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpFrameLoadCallbacks = true;
+ result->setNull();
+}
+
+void LayoutTestController::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpUserGestureInFrameLoadCallbacks = true;
+ result->setNull();
+}
+
+void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpResourceLoadCallbacks = true;
+ result->setNull();
+}
+
+void LayoutTestController::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpResourceResponseMIMETypes = true;
+ result->setNull();
+}
+
+void LayoutTestController::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpChildFrameScrollPositions = true;
+ result->setNull();
+}
+
+void LayoutTestController::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpChildFramesAsText = true;
+ result->setNull();
+}
+
+void LayoutTestController::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpWindowStatusChanges = true;
+ result->setNull();
+}
+
+void LayoutTestController::dumpTitleChanges(const CppArgumentList&, CppVariant* result)
+{
+ m_dumpTitleChanges = true;
+ result->setNull();
+}
+
+void LayoutTestController::setAcceptsEditing(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool())
+ m_acceptsEditing = arguments[0].value.boolValue;
+ result->setNull();
+}
+
+void LayoutTestController::waitUntilDone(const CppArgumentList&, CppVariant* result)
+{
+ if (!webkit_support::BeingDebugged())
+ postDelayedTask(new NotifyDoneTimedOutTask(this), m_shell->layoutTestTimeout());
+ m_waitUntilDone = true;
+ result->setNull();
+}
+
+void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result)
+{
+ // Test didn't timeout. Kill the timeout timer.
+ m_taskList.revokeAll();
+
+ completeNotifyDone(false);
+ result->setNull();
+}
+
+void LayoutTestController::completeNotifyDone(bool isTimeout)
+{
+ if (m_waitUntilDone && !m_shell->webViewHost()->topLoadingFrame() && m_workQueue.isEmpty()) {
+ if (isTimeout)
+ m_shell->testTimedOut();
+ else
+ m_shell->testFinished();
+ }
+ m_waitUntilDone = false;
+}
+
+class WorkItemBackForward : public LayoutTestController::WorkItem {
+public:
+ WorkItemBackForward(int distance) : m_distance(distance) {}
+ bool run(TestShell* shell)
+ {
+ shell->goToOffset(m_distance);
+ return true; // FIXME: Did it really start a navigation?
+ }
+private:
+ int m_distance;
+};
+
+void LayoutTestController::queueBackNavigation(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isNumber())
+ m_workQueue.addWork(new WorkItemBackForward(-arguments[0].toInt32()));
+ result->setNull();
+}
+
+void LayoutTestController::queueForwardNavigation(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isNumber())
+ m_workQueue.addWork(new WorkItemBackForward(arguments[0].toInt32()));
+ result->setNull();
+}
+
+class WorkItemReload : public LayoutTestController::WorkItem {
+public:
+ bool run(TestShell* shell)
+ {
+ shell->reload();
+ return true;
+ }
+};
+
+void LayoutTestController::queueReload(const CppArgumentList&, CppVariant* result)
+{
+ m_workQueue.addWork(new WorkItemReload);
+ result->setNull();
+}
+
+class WorkItemLoadingScript : public LayoutTestController::WorkItem {
+public:
+ WorkItemLoadingScript(const string& script) : m_script(script) {}
+ bool run(TestShell* shell)
+ {
+ shell->webView()->mainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(m_script)));
+ return true; // FIXME: Did it really start a navigation?
+ }
+private:
+ string m_script;
+};
+
+class WorkItemNonLoadingScript : public LayoutTestController::WorkItem {
+public:
+ WorkItemNonLoadingScript(const string& script) : m_script(script) {}
+ bool run(TestShell* shell)
+ {
+ shell->webView()->mainFrame()->executeScript(WebScriptSource(WebString::fromUTF8(m_script)));
+ return false;
+ }
+private:
+ string m_script;
+};
+
+void LayoutTestController::queueLoadingScript(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isString())
+ m_workQueue.addWork(new WorkItemLoadingScript(arguments[0].toString()));
+ result->setNull();
+}
+
+void LayoutTestController::queueNonLoadingScript(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isString())
+ m_workQueue.addWork(new WorkItemNonLoadingScript(arguments[0].toString()));
+ result->setNull();
+}
+
+class WorkItemLoad : public LayoutTestController::WorkItem {
+public:
+ WorkItemLoad(const WebURL& url, const WebString& target)
+ : m_url(url)
+ , m_target(target) {}
+ bool run(TestShell* shell)
+ {
+ shell->webViewHost()->loadURLForFrame(m_url, m_target);
+ return true; // FIXME: Did it really start a navigation?
+ }
+private:
+ WebURL m_url;
+ WebString m_target;
+};
+
+void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isString()) {
+ // FIXME: Implement WebURL::resolve() and avoid GURL.
+ GURL currentURL = m_shell->webView()->mainFrame()->url();
+ GURL fullURL = currentURL.Resolve(arguments[0].toString());
+
+ string target = "";
+ if (arguments.size() > 1 && arguments[1].isString())
+ target = arguments[1].toString();
+
+ m_workQueue.addWork(new WorkItemLoad(fullURL, WebString::fromUTF8(target)));
+ }
+ result->setNull();
+}
+
+class WorkItemLoadHTMLString : public LayoutTestController::WorkItem {
+public:
+ WorkItemLoadHTMLString(const std::string& html, const WebURL& baseURL)
+ : m_html(html)
+ , m_baseURL(baseURL) {}
+ bool run(TestShell* shell)
+ {
+ shell->webView()->mainFrame()->loadHTMLString(
+ WebKit::WebData(m_html.data(), m_html.length()), m_baseURL);
+ return true;
+ }
+private:
+ std::string m_html;
+ WebURL m_baseURL;
+};
+
+void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isString()) {
+ string html = arguments[0].toString();
+ WebURL baseURL;
+ if (arguments.size() > 1 && arguments[1].isString())
+ baseURL = WebURL(GURL(arguments[1].toString()));
+ m_workQueue.addWork(new WorkItemLoadHTMLString(html, baseURL));
+ }
+ result->setNull();
+}
+
+void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() < 2) {
+ // This is the best we can do to return an error.
+ result->setNull();
+ return;
+ }
+ result->set(arguments[0].isEqual(arguments[1]));
+}
+
+void LayoutTestController::reset()
+{
+ if (m_shell) {
+ m_shell->webView()->setZoomLevel(false, 0);
+ m_shell->webView()->setTabKeyCyclesThroughElements(true);
+#if !OS(DARWIN) && !OS(WINDOWS) // Actually, TOOLKIT_GTK
+ // (Constants copied because we can't depend on the header that defined
+ // them from this file.)
+ m_shell->webView()->setSelectionColors(0xff1e90ff, 0xff000000, 0xffc8c8c8, 0xff323232);
+#endif
+ m_shell->webView()->removeAllUserContent();
+ }
+ m_dumpAsText = false;
+ m_dumpEditingCallbacks = false;
+ m_dumpFrameLoadCallbacks = false;
+ m_dumpUserGestureInFrameLoadCallbacks = false;
+ m_dumpResourceLoadCallbacks = false;
+ m_dumpResourceResponseMIMETypes = false;
+ m_dumpBackForwardList = false;
+ m_dumpChildFrameScrollPositions = false;
+ m_dumpChildFramesAsText = false;
+ m_dumpWindowStatusChanges = false;
+ m_dumpSelectionRect = false;
+ m_dumpTitleChanges = false;
+ m_generatePixelResults = true;
+ m_acceptsEditing = true;
+ m_waitUntilDone = false;
+ m_canOpenWindows = false;
+ m_testRepaint = false;
+ m_sweepHorizontally = false;
+ m_shouldAddFileToPasteboard = false;
+ m_stopProvisionalFrameLoads = false;
+ m_deferMainResourceDataLoad = true;
+ m_globalFlag.set(false);
+ m_webHistoryItemCount.set(0);
+ m_userStyleSheetLocation = WebURL();
+
+ webkit_support::SetAcceptAllCookies(false);
+ WebSecurityPolicy::resetOriginAccessWhitelists();
+
+ // Reset the default quota for each origin to 5MB
+ webkit_support::SetDatabaseQuota(5 * 1024 * 1024);
+
+ setlocale(LC_ALL, "");
+
+ if (m_closeRemainingWindows)
+ m_shell->closeRemainingWindows();
+ else
+ m_closeRemainingWindows = true;
+ m_workQueue.reset();
+ m_taskList.revokeAll();
+}
+
+void LayoutTestController::locationChangeDone()
+{
+ m_webHistoryItemCount.set(m_shell->navigationEntryCount());
+
+ // No more new work after the first complete load.
+ m_workQueue.setFrozen(true);
+
+ if (!m_waitUntilDone)
+ m_workQueue.processWorkSoon();
+}
+
+void LayoutTestController::policyDelegateDone()
+{
+ ASSERT(m_waitUntilDone);
+ m_shell->testFinished();
+ m_waitUntilDone = false;
+}
+
+void LayoutTestController::setCanOpenWindows(const CppArgumentList&, CppVariant* result)
+{
+ m_canOpenWindows = true;
+ result->setNull();
+}
+
+void LayoutTestController::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool())
+ m_shell->webView()->setTabKeyCyclesThroughElements(arguments[0].toBoolean());
+ result->setNull();
+}
+
+void LayoutTestController::windowCount(const CppArgumentList&, CppVariant* result)
+{
+ result->set(static_cast<int>(m_shell->windowCount()));
+}
+
+void LayoutTestController::setCloseRemainingWindowsWhenComplete(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool())
+ m_closeRemainingWindows = arguments[0].value.boolValue;
+ result->setNull();
+}
+
+void LayoutTestController::setAlwaysAcceptCookies(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0)
+ webkit_support::SetAcceptAllCookies(cppVariantToBool(arguments[0]));
+ result->setNull();
+}
+
+void LayoutTestController::showWebInspector(const CppArgumentList&, CppVariant* result)
+{
+ m_shell->showDevTools();
+ result->setNull();
+}
+
+void LayoutTestController::closeWebInspector(const CppArgumentList& args, CppVariant* result)
+{
+ m_shell->closeDevTools();
+ result->setNull();
+}
+
+void LayoutTestController::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool())
+ m_shell->setFocus(m_shell->webView(), arguments[0].value.boolValue);
+ result->setNull();
+}
+
+void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->userStyleSheetLocation = arguments[0].value.boolValue ? m_userStyleSheetLocation : WebURL();
+ m_shell->applyPreferences();
+ }
+ result->setNull();
+}
+
+void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isString()) {
+ m_userStyleSheetLocation = webkit_support::LocalFileToDataURL(
+ webkit_support::RewriteLayoutTestsURL(arguments[0].toString()));
+ m_shell->preferences()->userStyleSheetLocation = m_userStyleSheetLocation;
+ m_shell->applyPreferences();
+ }
+ result->setNull();
+}
+
+void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->authorAndUserStylesEnabled = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
+ result->setNull();
+}
+
+void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() <= 0 || !arguments[0].isString())
+ return;
+
+ std::string command = arguments[0].toString();
+ std::string value("");
+ // Ignore the second parameter (which is userInterface)
+ // since this command emulates a manual action.
+ if (arguments.size() >= 3 && arguments[2].isString())
+ value = arguments[2].toString();
+
+ // Note: webkit's version does not return the boolean, so neither do we.
+ m_shell->webView()->focusedFrame()->executeCommand(WebString::fromUTF8(command), WebString::fromUTF8(value));
+}
+
+void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() <= 0 || !arguments[0].isString()) {
+ result->setNull();
+ return;
+ }
+
+ std::string command = arguments[0].toString();
+ bool rv = m_shell->webView()->focusedFrame()->isCommandEnabled(WebString::fromUTF8(command));
+ result->set(rv);
+}
+
+void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ bool blockPopups = arguments[0].toBoolean();
+ m_shell->preferences()->javaScriptCanOpenWindowsAutomatically = !blockPopups;
+ m_shell->applyPreferences();
+ }
+ result->setNull();
+}
+
+void LayoutTestController::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result)
+{
+ // We have no need to support Dashboard Compatibility Mode (mac-only)
+ result->setNull();
+}
+
+void LayoutTestController::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: implement to support Application Cache Quotas.
+ result->setNull();
+}
+
+void LayoutTestController::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: implement to support Application Cache Quotas.
+ result->setNull();
+}
+
+void LayoutTestController::setScrollbarPolicy(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: implement.
+ // Currently only has a non-null implementation on QT.
+ result->setNull();
+}
+
+void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ bool enable = arguments[0].value.boolValue;
+ bool permissive = false;
+ if (arguments.size() > 1 && arguments[1].isBool())
+ permissive = arguments[1].value.boolValue;
+ m_shell->webViewHost()->setCustomPolicyDelegate(enable, permissive);
+ }
+ result->setNull();
+}
+
+void LayoutTestController::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result)
+{
+ m_shell->webViewHost()->waitForPolicyDelegate();
+ m_waitUntilDone = true;
+ result->setNull();
+}
+
+void LayoutTestController::setWillSendRequestClearHeader(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isString()) {
+ string header = arguments[0].toString();
+ if (!header.empty())
+ m_shell->webViewHost()->addClearHeader(String::fromUTF8(header.c_str()));
+ }
+ result->setNull();
+}
+
+void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool())
+ m_shell->webViewHost()->setBlockRedirects(arguments[0].value.boolValue);
+ result->setNull();
+}
+
+void LayoutTestController::setWillSendRequestReturnsNull(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool())
+ m_shell->webViewHost()->setRequestReturnNull(arguments[0].value.boolValue);
+ result->setNull();
+}
+
+void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() <= 0 || !arguments[0].isString())
+ return;
+
+ string url = arguments[0].toString();
+#if OS(WINDOWS)
+ if (!url.find("/tmp/")) {
+ // We want a temp file.
+ const unsigned tempPrefixLength = 5;
+ size_t bufferSize = MAX_PATH;
+ OwnArrayPtr<WCHAR> tempPath(new WCHAR[bufferSize]);
+ DWORD tempLength = ::GetTempPathW(bufferSize, tempPath.get());
+ if (tempLength + url.length() - tempPrefixLength + 1 > bufferSize) {
+ bufferSize = tempLength + url.length() - tempPrefixLength + 1;
+ tempPath.set(new WCHAR[bufferSize]);
+ tempLength = GetTempPathW(bufferSize, tempPath.get());
+ ASSERT(tempLength < bufferSize);
+ }
+ string resultPath(WebString(tempPath.get(), tempLength).utf8());
+ resultPath.append(url.substr(tempPrefixLength));
+ result->set(resultPath);
+ return;
+ }
+#endif
+
+ // Some layout tests use file://// which we resolve as a UNC path. Normalize
+ // them to just file:///.
+ string lowerUrl = url;
+ transform(lowerUrl.begin(), lowerUrl.end(), lowerUrl.begin(), ::tolower);
+ while (!lowerUrl.find("file:////")) {
+ url = url.substr(0, 8) + url.substr(9);
+ lowerUrl = lowerUrl.substr(0, 8) + lowerUrl.substr(9);
+ }
+ result->set(webkit_support::RewriteLayoutTestsURL(url).spec());
+}
+
+void LayoutTestController::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+ m_shouldAddFileToPasteboard = true;
+}
+
+void LayoutTestController::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+ m_stopProvisionalFrameLoads = true;
+}
+
+void LayoutTestController::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool())
+ m_shell->webViewHost()->setSmartInsertDeleteEnabled(arguments[0].value.boolValue);
+ result->setNull();
+}
+
+void LayoutTestController::setSelectTrailingWhitespaceEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool())
+ m_shell->webViewHost()->setSelectTrailingWhitespaceEnabled(arguments[0].value.boolValue);
+ result->setNull();
+}
+
+bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const WebString& animationName, double time, const WebString& elementId)
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return false;
+
+ WebAnimationController* controller = webFrame->animationController();
+ if (!controller)
+ return false;
+
+ WebElement element = webFrame->document().getElementById(elementId);
+ if (element.isNull())
+ return false;
+ return controller->pauseAnimationAtTime(element, animationName, time);
+}
+
+bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId)
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return false;
+
+ WebAnimationController* controller = webFrame->animationController();
+ if (!controller)
+ return false;
+
+ WebElement element = webFrame->document().getElementById(elementId);
+ if (element.isNull())
+ return false;
+ return controller->pauseTransitionAtTime(element, propertyName, time);
+}
+
+bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebString& elementId)
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return false;
+
+ WebElement element = webFrame->document().getElementById(elementId);
+ if (element.isNull() || !element.hasTagName("input"))
+ return false;
+
+ WebInputElement inputElement = element.to<WebInputElement>();
+ return inputElement.autoComplete();
+}
+
+int LayoutTestController::numberOfActiveAnimations()
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return -1;
+
+ WebAnimationController* controller = webFrame->animationController();
+ if (!controller)
+ return -1;
+
+ return controller->numberOfActiveAnimations();
+}
+
+void LayoutTestController::suspendAnimations()
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return;
+
+ WebAnimationController* controller = webFrame->animationController();
+ if (!controller)
+ return;
+
+ controller->suspendAnimations();
+}
+
+void LayoutTestController::resumeAnimations()
+{
+ WebFrame* webFrame = m_shell->webView()->mainFrame();
+ if (!webFrame)
+ return;
+
+ WebAnimationController* controller = webFrame->animationController();
+ if (!controller)
+ return;
+
+ controller->resumeAnimations();
+}
+
+void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->set(false);
+ if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) {
+ WebString animationName = cppVariantToWebString(arguments[0]);
+ double time = arguments[1].toDouble();
+ WebString elementId = cppVariantToWebString(arguments[2]);
+ result->set(pauseAnimationAtTimeOnElementWithId(animationName, time, elementId));
+ }
+}
+
+void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->set(false);
+ if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) {
+ WebString propertyName = cppVariantToWebString(arguments[0]);
+ double time = arguments[1].toDouble();
+ WebString elementId = cppVariantToWebString(arguments[2]);
+ result->set(pauseTransitionAtTimeOnElementWithId(propertyName, time, elementId));
+ }
+}
+
+void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() != 1 || !arguments[0].isString()) {
+ result->set(false);
+ return;
+ }
+ WebString elementId = cppVariantToWebString(arguments[0]);
+ result->set(elementDoesAutoCompleteForElementWithId(elementId));
+}
+
+void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result)
+{
+ result->set(numberOfActiveAnimations());
+}
+
+void LayoutTestController::suspendAnimations(const CppArgumentList&, CppVariant* result)
+{
+ suspendAnimations();
+ result->setNull();
+}
+
+void LayoutTestController::resumeAnimations(const CppArgumentList&, CppVariant* result)
+{
+ resumeAnimations();
+ result->setNull();
+}
+
+void LayoutTestController::sampleSVGAnimationForElementAtTime(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() != 3) {
+ result->setNull();
+ return;
+ }
+ WebString animationId = cppVariantToWebString(arguments[0]);
+ double time = arguments[1].toDouble();
+ WebString elementId = cppVariantToWebString(arguments[2]);
+ bool success = m_shell->webView()->mainFrame()->pauseSVGAnimation(animationId, time, elementId);
+ result->set(success);
+}
+
+void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result)
+{
+ m_shell->preferences()->loadsImagesAutomatically = false;
+ m_shell->applyPreferences();
+ result->setNull();
+}
+
+void LayoutTestController::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result)
+{
+ // We don't use the WebKit icon database.
+ result->setNull();
+}
+
+void LayoutTestController::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result)
+{
+ result->set(m_shell->webView()->dispatchBeforeUnloadEvent());
+}
+
+void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() != 1 || !arguments[0].isString()) {
+ result->set(false);
+ return;
+ }
+ m_shell->notificationPresenter()->grantPermission(cppVariantToWebString(arguments[0]));
+ result->set(true);
+}
+
+void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() != 1 || !arguments[0].isString()) {
+ result->set(false);
+ return;
+ }
+ if (m_shell->notificationPresenter()->simulateClick(cppVariantToWebString(arguments[0])))
+ result->set(true);
+ else
+ result->set(false);
+}
+
+void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() != 2 || !arguments[0].isBool() || !arguments[1].isString())
+ return;
+ m_shell->webView()->setDomainRelaxationForbidden(cppVariantToBool(arguments[0]), cppVariantToWebString(arguments[1]));
+}
+
+void LayoutTestController::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() == 1)
+ m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]);
+}
+
+//
+// Unimplemented stubs
+//
+
+void LayoutTestController::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result)
+{
+ m_dumpSelectionRect = true;
+ result->setNull();
+}
+
+void LayoutTestController::display(const CppArgumentList& arguments, CppVariant* result)
+{
+ WebViewHost* host = m_shell->webViewHost();
+ const WebKit::WebSize& size = m_shell->webView()->size();
+ WebRect rect(0, 0, size.width, size.height);
+ host->updatePaintRect(rect);
+ host->paintInvalidatedRegion();
+ host->displayRepaintMask();
+ result->setNull();
+}
+
+void LayoutTestController::testRepaint(const CppArgumentList&, CppVariant* result)
+{
+ m_testRepaint = true;
+ result->setNull();
+}
+
+void LayoutTestController::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result)
+{
+ m_sweepHorizontally = true;
+ result->setNull();
+}
+
+void LayoutTestController::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::keepWebHistory(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->javaScriptCanAccessClipboard = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
+ result->setNull();
+}
+
+void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->XSSAuditorEnabled = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
+ result->setNull();
+}
+
+void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() >= 2 && arguments[0].isNumber() && arguments[1].isString()) {
+ WebScriptSource source(cppVariantToWebString(arguments[1]));
+ // This relies on the iframe focusing itself when it loads. This is a bit
+ // sketchy, but it seems to be what other tests do.
+ m_shell->webView()->focusedFrame()->executeScriptInIsolatedWorld(arguments[0].toInt32(), &source, 1, 1);
+ }
+ result->setNull();
+}
+
+void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->allowUniversalAccessFromFileURLs = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
+ result->setNull();
+}
+
+void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() > 0 && arguments[0].isBool()) {
+ m_shell->preferences()->allowFileAccessFromFileURLs = arguments[0].value.boolValue;
+ m_shell->applyPreferences();
+ }
+ result->setNull();
+}
+
+// Need these conversions because the format of the value for booleans
+// may vary - for example, on mac "1" and "0" are used for boolean.
+bool LayoutTestController::cppVariantToBool(const CppVariant& value)
+{
+ if (value.isBool())
+ return value.toBoolean();
+ if (value.isInt32())
+ return value.toInt32();
+ if (value.isString()) {
+ string valueString = value.toString();
+ if (valueString == "true" || valueString == "1")
+ return true;
+ if (valueString == "false" || valueString == "0")
+ return false;
+ }
+ logErrorToConsole("Invalid value. Expected boolean value.");
+ return false;
+}
+
+int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value)
+{
+ if (value.isInt32())
+ return value.toInt32();
+ if (value.isString()) {
+ string stringSource = value.toString();
+ const char* source = stringSource.data();
+ char* end;
+ long number = strtol(source, &end, 10);
+ if (end == source + stringSource.length() && number >= numeric_limits<int32_t>::min() && number <= numeric_limits<int32_t>::max())
+ return static_cast<int32_t>(number);
+ }
+ logErrorToConsole("Invalid value for preference. Expected integer value.");
+ return 0;
+}
+
+WebString LayoutTestController::cppVariantToWebString(const CppVariant& value)
+{
+ if (!value.isString()) {
+ logErrorToConsole("Invalid value for preference. Expected string value.");
+ return WebString();
+ }
+ return WebString::fromUTF8(value.toString());
+}
+
+void LayoutTestController::overridePreference(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() != 2 || !arguments[0].isString())
+ return;
+
+ string key = arguments[0].toString();
+ CppVariant value = arguments[1];
+ WebPreferences* prefs = m_shell->preferences();
+ if (key == "WebKitStandardFont")
+ prefs->standardFontFamily = cppVariantToWebString(value);
+ else if (key == "WebKitFixedFont")
+ prefs->fixedFontFamily = cppVariantToWebString(value);
+ else if (key == "WebKitSerifFont")
+ prefs->serifFontFamily = cppVariantToWebString(value);
+ else if (key == "WebKitSansSerifFont")
+ prefs->sansSerifFontFamily = cppVariantToWebString(value);
+ else if (key == "WebKitCursiveFont")
+ prefs->cursiveFontFamily = cppVariantToWebString(value);
+ else if (key == "WebKitFantasyFont")
+ prefs->fantasyFontFamily = cppVariantToWebString(value);
+ else if (key == "WebKitDefaultFontSize")
+ prefs->defaultFontSize = cppVariantToInt32(value);
+ else if (key == "WebKitDefaultFixedFontSize")
+ prefs->defaultFixedFontSize = cppVariantToInt32(value);
+ else if (key == "WebKitMinimumFontSize")
+ prefs->minimumFontSize = cppVariantToInt32(value);
+ else if (key == "WebKitMinimumLogicalFontSize")
+ prefs->minimumLogicalFontSize = cppVariantToInt32(value);
+ else if (key == "WebKitDefaultTextEncodingName")
+ prefs->defaultTextEncodingName = cppVariantToWebString(value);
+ else if (key == "WebKitJavaScriptEnabled")
+ prefs->javaScriptEnabled = cppVariantToBool(value);
+ else if (key == "WebKitWebSecurityEnabled")
+ prefs->webSecurityEnabled = cppVariantToBool(value);
+ else if (key == "WebKitJavaScriptCanOpenWindowsAutomatically")
+ prefs->javaScriptCanOpenWindowsAutomatically = cppVariantToBool(value);
+ else if (key == "WebKitDisplayImagesKey")
+ prefs->loadsImagesAutomatically = cppVariantToBool(value);
+ else if (key == "WebKitPluginsEnabled")
+ prefs->pluginsEnabled = cppVariantToBool(value);
+ else if (key == "WebKitDOMPasteAllowedPreferenceKey")
+ prefs->DOMPasteAllowed = cppVariantToBool(value);
+ else if (key == "WebKitDeveloperExtrasEnabledPreferenceKey")
+ prefs->developerExtrasEnabled = cppVariantToBool(value);
+ else if (key == "WebKitShrinksStandaloneImagesToFit")
+ prefs->shrinksStandaloneImagesToFit = cppVariantToBool(value);
+ else if (key == "WebKitTextAreasAreResizable")
+ prefs->textAreasAreResizable = cppVariantToBool(value);
+ else if (key == "WebKitJavaEnabled")
+ prefs->javaEnabled = cppVariantToBool(value);
+ else if (key == "WebKitUsesPageCachePreferenceKey")
+ prefs->usesPageCache = cppVariantToBool(value);
+ else if (key == "WebKitJavaScriptCanAccessClipboard")
+ prefs->javaScriptCanAccessClipboard = cppVariantToBool(value);
+ else if (key == "WebKitXSSAuditorEnabled")
+ prefs->XSSAuditorEnabled = cppVariantToBool(value);
+ else if (key == "WebKitLocalStorageEnabledPreferenceKey")
+ prefs->localStorageEnabled = cppVariantToBool(value);
+ else if (key == "WebKitOfflineWebApplicationCacheEnabled")
+ prefs->offlineWebApplicationCacheEnabled = cppVariantToBool(value);
+ else if (key == "WebKitTabToLinksPreferenceKey")
+ prefs->tabsToLinks = cppVariantToBool(value);
+ else if (key == "WebKitWebGLEnabled")
+ prefs->experimentalWebGLEnabled = cppVariantToBool(value);
+ else if (key == "WebKitHyperlinkAuditingEnabled")
+ prefs->hyperlinkAuditingEnabled = cppVariantToBool(value);
+ else if (key == "WebKitEnableCaretBrowsing")
+ prefs->caretBrowsingEnabled = cppVariantToBool(value);
+ else {
+ string message("Invalid name for preference: ");
+ message.append(key);
+ logErrorToConsole(message);
+ }
+ m_shell->applyPreferences();
+}
+
+void LayoutTestController::fallbackMethod(const CppArgumentList&, CppVariant* result)
+{
+ printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on LayoutTestController\n");
+ result->setNull();
+}
+
+void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ if (arguments.size() != 4 || !arguments[0].isString() || !arguments[1].isString()
+ || !arguments[2].isString() || !arguments[3].isBool())
+ return;
+
+ WebKit::WebURL url(GURL(arguments[0].toString()));
+ if (!url.isValid())
+ return;
+
+ WebSecurityPolicy::addOriginAccessWhitelistEntry(
+ url,
+ cppVariantToWebString(arguments[1]),
+ cppVariantToWebString(arguments[2]),
+ arguments[3].toBoolean());
+}
+
+void LayoutTestController::removeOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ if (arguments.size() != 4 || !arguments[0].isString() || !arguments[1].isString()
+ || !arguments[2].isString() || !arguments[3].isBool())
+ return;
+
+ WebKit::WebURL url(GURL(arguments[0].toString()));
+ if (!url.isValid())
+ return;
+
+ WebSecurityPolicy::removeOriginAccessWhitelistEntry(
+ url,
+ cppVariantToWebString(arguments[1]),
+ cppVariantToWebString(arguments[2]),
+ arguments[3].toBoolean());
+}
+
+void LayoutTestController::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ webkit_support::ClearAllDatabases();
+}
+
+void LayoutTestController::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if ((arguments.size() >= 1) && arguments[0].isInt32())
+ webkit_support::SetDatabaseQuota(arguments[0].toInt32());
+}
+
+void LayoutTestController::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() == 1 && arguments[0].isString())
+ setlocale(LC_ALL, arguments[0].toString().c_str());
+}
+
+void LayoutTestController::counterValueForElementById(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 1 || !arguments[0].isString())
+ return;
+ WebFrame* frame = m_shell->webView()->mainFrame();
+ if (!frame)
+ return;
+ WebString counterValue = frame->counterValueForElementById(cppVariantToWebString(arguments[0]));
+ if (counterValue.isNull())
+ return;
+ result->set(counterValue.utf8());
+}
+
+static bool parsePageSizeParameters(const CppArgumentList& arguments,
+ int argOffset,
+ float* pageWidthInPixels,
+ float* pageHeightInPixels)
+{
+ // WebKit is using the window width/height of DumpRenderTree as the
+ // default value of the page size.
+ // FIXME: share these values with other ports.
+ *pageWidthInPixels = 800;
+ *pageHeightInPixels = 600;
+ switch (arguments.size() - argOffset) {
+ case 2:
+ if (!arguments[argOffset].isNumber() || !arguments[1 + argOffset].isNumber())
+ return false;
+ *pageWidthInPixels = static_cast<float>(arguments[argOffset].toInt32());
+ *pageHeightInPixels = static_cast<float>(arguments[1 + argOffset].toInt32());
+ // fall through.
+ case 0:
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+void LayoutTestController::pageNumberForElementById(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ float pageWidthInPixels = 0;
+ float pageHeightInPixels = 0;
+ if (!parsePageSizeParameters(arguments, 1,
+ &pageWidthInPixels, &pageHeightInPixels))
+ return;
+ if (!arguments[0].isString())
+ return;
+ WebFrame* frame = m_shell->webView()->mainFrame();
+ if (!frame)
+ return;
+ result->set(frame->pageNumberForElementById(cppVariantToWebString(arguments[0]),
+ pageWidthInPixels, pageHeightInPixels));
+}
+
+void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ float pageWidthInPixels = 0;
+ float pageHeightInPixels = 0;
+ if (!parsePageSizeParameters(arguments, 0, &pageWidthInPixels, &pageHeightInPixels))
+ return;
+
+ WebFrame* frame = m_shell->webView()->mainFrame();
+ if (!frame)
+ return;
+ WebSize size(pageWidthInPixels, pageHeightInPixels);
+ int numberOfPages = frame->printBegin(size);
+ frame->printEnd();
+ result->set(numberOfPages);
+}
+
+void LayoutTestController::logErrorToConsole(const std::string& text)
+{
+ m_shell->webViewHost()->didAddMessageToConsole(
+ WebConsoleMessage(WebConsoleMessage::LevelError, WebString::fromUTF8(text)),
+ WebString(), 0);
+}
+
+void LayoutTestController::setTimelineProfilingEnabled(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 1 || !arguments[0].isBool())
+ return;
+ m_shell->drtDevToolsAgent()->setTimelineProfilingEnabled(arguments[0].toBoolean());
+}
+
+void LayoutTestController::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 2 || !arguments[0].isInt32() || !arguments[1].isString())
+ return;
+ m_shell->drtDevToolsAgent()->evaluateInWebInspector(arguments[0].toInt32(), arguments[1].toString());
+}
+
+void LayoutTestController::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ m_shell->webView()->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, 0xffc0c0c0);
+}
+
+void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isBool() || !arguments[2].isBool())
+ return;
+ WebView::addUserScript(
+ cppVariantToWebString(arguments[0]), WebVector<WebString>(),
+ arguments[1].toBoolean() ? WebView::UserScriptInjectAtDocumentStart : WebView::UserScriptInjectAtDocumentEnd,
+ arguments[2].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly);
+}
+
+void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isBool())
+ return;
+ WebView::addUserStyleSheet(
+ cppVariantToWebString(arguments[0]), WebVector<WebString>(),
+ arguments[1].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly,
+ // Chromium defaults to InjectInSubsequentDocuments, but for compatibility
+ // with the other ports' DRTs, we use UserStyleInjectInExistingDocuments.
+ WebView::UserStyleInjectInExistingDocuments);
+}
+
+void LayoutTestController::setEditingBehavior(const CppArgumentList& arguments, CppVariant* results)
+{
+ string key = arguments[0].toString();
+ if (key == "mac") {
+ m_shell->preferences()->editingBehavior = WebSettings::EditingBehaviorMac;
+ m_shell->applyPreferences();
+ } else if (key == "win") {
+ m_shell->preferences()->editingBehavior = WebSettings::EditingBehaviorWin;
+ m_shell->applyPreferences();
+ } else if (key == "unix") {
+ m_shell->preferences()->editingBehavior = WebSettings::EditingBehaviorUnix;
+ m_shell->applyPreferences();
+ } else
+ logErrorToConsole("Passed invalid editing behavior. Should be 'mac' or 'win'.");
+}
+
+void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 6 || !arguments[0].isBool() || !arguments[1].isNumber() || !arguments[2].isBool() || !arguments[3].isNumber() || !arguments[4].isBool() || !arguments[5].isNumber())
+ return;
+
+ WebDeviceOrientation orientation(arguments[0].toBoolean(), arguments[1].toDouble(), arguments[2].toBoolean(), arguments[3].toDouble(), arguments[4].toBoolean(), arguments[5].toDouble());
+ // Note that we only call setOrientation on the main page's mock since this is all that the
+ // tests require. If necessary, we could get a list of WebViewHosts from the TestShell and
+ // call setOrientation on each DeviceOrientationClientMock.
+ m_shell->webViewHost()->deviceOrientationClientMock()->setOrientation(orientation);
+}
+
+void LayoutTestController::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 1 || !arguments[0].isBool())
+ return;
+ WebGeolocationServiceMock::setMockGeolocationPermission(arguments[0].toBoolean());
+}
+
+void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 3 || !arguments[0].isNumber() || !arguments[1].isNumber() || !arguments[2].isNumber())
+ return;
+ WebGeolocationServiceMock::setMockGeolocationPosition(arguments[0].toDouble(), arguments[1].toDouble(), arguments[2].toDouble());
+}
+
+void LayoutTestController::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 2 || !arguments[0].isInt32() || !arguments[1].isString())
+ return;
+ WebGeolocationServiceMock::setMockGeolocationError(arguments[0].toInt32(), cppVariantToWebString(arguments[1]));
+}
+
+void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+}
+
+void LayoutTestController::setMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+ if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isString())
+ return;
+
+ m_shell->webViewHost()->speechInputControllerMock()->setMockRecognitionResult(cppVariantToWebString(arguments[0]), cppVariantToWebString(arguments[1]));
+}
+
+void LayoutTestController::layerTreeAsText(const CppArgumentList& args, CppVariant* result)
+{
+ result->set(m_shell->webView()->mainFrame()->layerTreeAsText().utf8());
+}
+
+void LayoutTestController::markerTextForListItem(const CppArgumentList& args, CppVariant* result)
+{
+ WebElement element;
+ if (!WebBindings::getElement(args[0].value.objectValue, &element))
+ result->setNull();
+ else
+ result->set(element.document().frame()->markerTextForListItem(element).utf8());
+}
+
+void LayoutTestController::hasSpellingMarker(const CppArgumentList& arguments, CppVariant* result)
+{
+ if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+ return;
+ result->set(m_shell->webView()->mainFrame()->selectionStartHasSpellingMarkerFor(arguments[0].toInt32(), arguments[1].toInt32()));
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
new file mode 100644
index 0000000..62f473c
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -0,0 +1,547 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ LayoutTestController class:
+ Bound to a JavaScript window.layoutTestController object using the
+ CppBoundClass::bindToJavascript(), this allows layout tests that are run in
+ the test_shell (or, in principle, any web page loaded into a client app built
+ with this class) to control various aspects of how the tests are run and what
+ sort of output they produce.
+*/
+
+#ifndef LayoutTestController_h
+#define LayoutTestController_h
+
+#include "CppBoundClass.h"
+#include "Task.h"
+#include "WebString.h"
+#include "WebURL.h"
+#include <wtf/Deque.h>
+#include <wtf/OwnPtr.h>
+
+namespace WebKit {
+class WebSpeechInputController;
+class WebSpeechInputControllerMock;
+class WebSpeechInputListener;
+}
+
+class TestShell;
+
+class LayoutTestController : public CppBoundClass {
+public:
+ // Builds the property and method lists needed to bind this class to a JS
+ // object.
+ LayoutTestController(TestShell*);
+
+ ~LayoutTestController();
+
+ // This function sets a flag that tells the test_shell to dump pages as
+ // plain text, rather than as a text representation of the renderer's state.
+ // It takes an optional argument, whether to dump pixels results or not.
+ void dumpAsText(const CppArgumentList&, CppVariant*);
+
+ // This function should set a flag that tells the test_shell to print a line
+ // of descriptive text for each database command. It should take no
+ // arguments, and ignore any that may be present. However, at the moment, we
+ // don't have any DB function that prints messages, so for now this function
+ // doesn't do anything.
+ void dumpDatabaseCallbacks(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to print a line of
+ // descriptive text for each editing command. It takes no arguments, and
+ // ignores any that may be present.
+ void dumpEditingCallbacks(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to print a line of
+ // descriptive text for each frame load callback. It takes no arguments, and
+ // ignores any that may be present.
+ void dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to print a line of
+ // user gesture status text for some frame load callbacks. It takes no
+ // arguments, and ignores any that may be present.
+ void dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to print out a text
+ // representation of the back/forward list. It ignores all arguments.
+ void dumpBackForwardList(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to print out the
+ // scroll offsets of the child frames. It ignores all.
+ void dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to recursively
+ // dump all frames as plain text if the dumpAsText flag is set.
+ // It takes no arguments, and ignores any that may be present.
+ void dumpChildFramesAsText(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to dump a descriptive
+ // line for each resource load callback. It takes no arguments, and ignores
+ // any that may be present.
+ void dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to dump the MIME type
+ // for each resource that was loaded. It takes no arguments, and ignores any
+ // that may be present.
+ void dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant*);
+
+ // This function sets a flag that tells the test_shell to dump all calls
+ // to window.status().
+ // It takes no arguments, and ignores any that may be present.
+ void dumpWindowStatusChanges(const CppArgumentList&, CppVariant*);
+
+ // When called with a boolean argument, this sets a flag that controls
+ // whether content-editable elements accept editing focus when an editing
+ // attempt is made. It ignores any additional arguments.
+ void setAcceptsEditing(const CppArgumentList&, CppVariant*);
+
+ // Functions for dealing with windows. By default we block all new windows.
+ void windowCount(const CppArgumentList&, CppVariant*);
+ void setCanOpenWindows(const CppArgumentList&, CppVariant*);
+ void setCloseRemainingWindowsWhenComplete(const CppArgumentList&, CppVariant*);
+
+ // By default, tests end when page load is complete. These methods are used
+ // to delay the completion of the test until notifyDone is called.
+ void waitUntilDone(const CppArgumentList&, CppVariant*);
+ void notifyDone(const CppArgumentList&, CppVariant*);
+
+ // Methods for adding actions to the work queue. Used in conjunction with
+ // waitUntilDone/notifyDone above.
+ void queueBackNavigation(const CppArgumentList&, CppVariant*);
+ void queueForwardNavigation(const CppArgumentList&, CppVariant*);
+ void queueReload(const CppArgumentList&, CppVariant*);
+ void queueLoadingScript(const CppArgumentList&, CppVariant*);
+ void queueNonLoadingScript(const CppArgumentList&, CppVariant*);
+ void queueLoad(const CppArgumentList&, CppVariant*);
+ void queueLoadHTMLString(const CppArgumentList&, CppVariant*);
+
+ // Although this is named "objC" to match the Mac version, it actually tests
+ // the identity of its two arguments in C++.
+ void objCIdentityIsEqual(const CppArgumentList&, CppVariant*);
+
+ // Changes the cookie policy from the default to allow all cookies.
+ void setAlwaysAcceptCookies(const CppArgumentList&, CppVariant*);
+
+ // Shows DevTools window.
+ void showWebInspector(const CppArgumentList&, CppVariant*);
+ void closeWebInspector(const CppArgumentList&, CppVariant*);
+
+ // Gives focus to the window.
+ void setWindowIsKey(const CppArgumentList&, CppVariant*);
+
+ // Method that controls whether pressing Tab key cycles through page elements
+ // or inserts a '\t' char in text area
+ void setTabKeyCyclesThroughElements(const CppArgumentList&, CppVariant*);
+
+ // Passes through to WebPreferences which allows the user to have a custom
+ // style sheet.
+ void setUserStyleSheetEnabled(const CppArgumentList&, CppVariant*);
+ void setUserStyleSheetLocation(const CppArgumentList&, CppVariant*);
+
+ // Passes this preference through to WebSettings.
+ void setAuthorAndUserStylesEnabled(const CppArgumentList&, CppVariant*);
+
+ // Puts Webkit in "dashboard compatibility mode", which is used in obscure
+ // Mac-only circumstances. It's not really necessary, and will most likely
+ // never be used by Chrome, but some layout tests depend on its presence.
+ void setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant*);
+
+ void setScrollbarPolicy(const CppArgumentList&, CppVariant*);
+
+ // Causes navigation actions just printout the intended navigation instead
+ // of taking you to the page. This is used for cases like mailto, where you
+ // don't actually want to open the mail program.
+ void setCustomPolicyDelegate(const CppArgumentList&, CppVariant*);
+
+ // Delays completion of the test until the policy delegate runs.
+ void waitForPolicyDelegate(const CppArgumentList&, CppVariant*);
+
+ // Causes WillSendRequest to clear certain headers.
+ void setWillSendRequestClearHeader(const CppArgumentList&, CppVariant*);
+
+ // Causes WillSendRequest to block redirects.
+ void setWillSendRequestReturnsNullOnRedirect(const CppArgumentList&, CppVariant*);
+
+ // Causes WillSendRequest to return an empty request.
+ void setWillSendRequestReturnsNull(const CppArgumentList&, CppVariant*);
+
+ // Converts a URL starting with file:///tmp/ to the local mapping.
+ void pathToLocalResource(const CppArgumentList&, CppVariant*);
+
+ // Sets a bool such that when a drag is started, we fill the drag clipboard
+ // with a fake file object.
+ void addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant*);
+
+ // Executes an internal command (superset of document.execCommand() commands).
+ void execCommand(const CppArgumentList&, CppVariant*);
+
+ // Checks if an internal command is currently available.
+ void isCommandEnabled(const CppArgumentList&, CppVariant*);
+
+ // Set the WebPreference that controls webkit's popup blocking.
+ void setPopupBlockingEnabled(const CppArgumentList&, CppVariant*);
+
+ // If true, causes provisional frame loads to be stopped for the remainder of
+ // the test.
+ void setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant*);
+
+ // Enable or disable smart insert/delete. This is enabled by default.
+ void setSmartInsertDeleteEnabled(const CppArgumentList&, CppVariant*);
+
+ // Enable or disable trailing whitespace selection on double click.
+ void setSelectTrailingWhitespaceEnabled(const CppArgumentList&, CppVariant*);
+
+ void pauseAnimationAtTimeOnElementWithId(const CppArgumentList&, CppVariant*);
+ void pauseTransitionAtTimeOnElementWithId(const CppArgumentList&, CppVariant*);
+ void elementDoesAutoCompleteForElementWithId(const CppArgumentList&, CppVariant*);
+ void numberOfActiveAnimations(const CppArgumentList&, CppVariant*);
+ void suspendAnimations(const CppArgumentList&, CppVariant*);
+ void resumeAnimations(const CppArgumentList&, CppVariant*);
+ void sampleSVGAnimationForElementAtTime(const CppArgumentList&, CppVariant*);
+ void disableImageLoading(const CppArgumentList&, CppVariant*);
+ void setIconDatabaseEnabled(const CppArgumentList&, CppVariant*);
+ void dumpSelectionRect(const CppArgumentList&, CppVariant*);
+
+ // Grants permission for desktop notifications to an origin
+ void grantDesktopNotificationPermission(const CppArgumentList&, CppVariant*);
+ // Simulates a click on a desktop notification.
+ void simulateDesktopNotificationClick(const CppArgumentList&, CppVariant*);
+
+ void setDomainRelaxationForbiddenForURLScheme(const CppArgumentList&, CppVariant*);
+ void setDeferMainResourceDataLoad(const CppArgumentList&, CppVariant*);
+ void setEditingBehavior(const CppArgumentList&, CppVariant*);
+
+ // The following are only stubs. TODO(pamg): Implement any of these that
+ // are needed to pass the layout tests.
+ void dumpAsWebArchive(const CppArgumentList&, CppVariant*);
+ void dumpTitleChanges(const CppArgumentList&, CppVariant*);
+ void setMainFrameIsFirstResponder(const CppArgumentList&, CppVariant*);
+ void display(const CppArgumentList&, CppVariant*);
+ void testRepaint(const CppArgumentList&, CppVariant*);
+ void repaintSweepHorizontally(const CppArgumentList&, CppVariant*);
+ void clearBackForwardList(const CppArgumentList&, CppVariant*);
+ void keepWebHistory(const CppArgumentList&, CppVariant*);
+ void storeWebScriptObject(const CppArgumentList&, CppVariant*);
+ void accessStoredWebScriptObject(const CppArgumentList&, CppVariant*);
+ void objCClassNameOf(const CppArgumentList&, CppVariant*);
+ void addDisallowedURL(const CppArgumentList&, CppVariant*);
+ void callShouldCloseOnWebView(const CppArgumentList&, CppVariant*);
+ void setCallCloseOnWebViews(const CppArgumentList&, CppVariant*);
+ void setPrivateBrowsingEnabled(const CppArgumentList&, CppVariant*);
+
+ void setJavaScriptCanAccessClipboard(const CppArgumentList&, CppVariant*);
+ void setXSSAuditorEnabled(const CppArgumentList&, CppVariant*);
+ void evaluateScriptInIsolatedWorld(const CppArgumentList&, CppVariant*);
+ void overridePreference(const CppArgumentList&, CppVariant*);
+ void setAllowUniversalAccessFromFileURLs(const CppArgumentList&, CppVariant*);
+ void setAllowFileAccessFromFileURLs(const CppArgumentList&, CppVariant*);
+
+
+ // The fallback method is called when a nonexistent method is called on
+ // the layout test controller object.
+ // It is usefull to catch typos in the JavaScript code (a few layout tests
+ // do have typos in them) and it allows the script to continue running in
+ // that case (as the Mac does).
+ void fallbackMethod(const CppArgumentList&, CppVariant*);
+
+ // Allows layout tests to manage origins' whitelisting.
+ void addOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*);
+ void removeOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*);
+
+ // Clears all Application Caches.
+ void clearAllApplicationCaches(const CppArgumentList&, CppVariant*);
+ // Sets the Application Quota for the localhost origin.
+ void setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant*);
+
+ // Clears all databases.
+ void clearAllDatabases(const CppArgumentList&, CppVariant*);
+ // Sets the default quota for all origins
+ void setDatabaseQuota(const CppArgumentList&, CppVariant*);
+
+ // Calls setlocale(LC_ALL, ...) for a specified locale.
+ // Resets between tests.
+ void setPOSIXLocale(const CppArgumentList&, CppVariant*);
+
+ // Gets the value of the counter in the element specified by its ID.
+ void counterValueForElementById(const CppArgumentList&, CppVariant*);
+
+ // Gets the number of page where the specified element will be put.
+ void pageNumberForElementById(const CppArgumentList&, CppVariant*);
+
+ // Gets the number of pages to be printed.
+ void numberOfPages(const CppArgumentList&, CppVariant*);
+
+
+ // Allows layout tests to start Timeline profiling.
+ void setTimelineProfilingEnabled(const CppArgumentList&, CppVariant*);
+
+ // Allows layout tests to exec scripts at WebInspector side.
+ void evaluateInWebInspector(const CppArgumentList&, CppVariant*);
+
+ // Forces the selection colors for testing under Linux.
+ void forceRedSelectionColors(const CppArgumentList&, CppVariant*);
+
+ // Adds a user script or user style sheet to be injected into new documents.
+ void addUserScript(const CppArgumentList&, CppVariant*);
+ void addUserStyleSheet(const CppArgumentList&, CppVariant*);
+
+ // DeviceOrientation related functions
+ void setMockDeviceOrientation(const CppArgumentList&, CppVariant*);
+
+ // Geolocation related functions.
+ void setGeolocationPermission(const CppArgumentList&, CppVariant*);
+ void setMockGeolocationPosition(const CppArgumentList&, CppVariant*);
+ void setMockGeolocationError(const CppArgumentList&, CppVariant*);
+
+ // Empty stub method to keep parity with object model exposed by global LayoutTestController.
+ void abortModal(const CppArgumentList&, CppVariant*);
+
+ // Speech input related functions.
+ void setMockSpeechInputResult(const CppArgumentList&, CppVariant*);
+
+ void layerTreeAsText(const CppArgumentList& args, CppVariant* result);
+
+ void markerTextForListItem(const CppArgumentList&, CppVariant*);
+ void hasSpellingMarker(const CppArgumentList&, CppVariant*);
+
+public:
+ // The following methods are not exposed to JavaScript.
+ void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
+
+ WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
+ bool shouldDumpAsText() { return m_dumpAsText; }
+ bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
+ bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
+ void setShouldDumpFrameLoadCallbacks(bool value) { m_dumpFrameLoadCallbacks = value; }
+ bool shouldDumpUserGestureInFrameLoadCallbacks() { return m_dumpUserGestureInFrameLoadCallbacks; }
+ void setShouldDumpUserGestureInFrameLoadCallbacks(bool value) { m_dumpUserGestureInFrameLoadCallbacks = value; }
+ bool shouldDumpResourceLoadCallbacks() {return m_dumpResourceLoadCallbacks; }
+ void setShouldDumpResourceResponseMIMETypes(bool value) { m_dumpResourceResponseMIMETypes = value; }
+ bool shouldDumpResourceResponseMIMETypes() {return m_dumpResourceResponseMIMETypes; }
+ bool shouldDumpStatusCallbacks() { return m_dumpWindowStatusChanges; }
+ bool shouldDumpSelectionRect() { return m_dumpSelectionRect; }
+ bool shouldDumpBackForwardList() { return m_dumpBackForwardList; }
+ bool shouldDumpTitleChanges() { return m_dumpTitleChanges; }
+ bool shouldDumpChildFrameScrollPositions() { return m_dumpChildFrameScrollPositions; }
+ bool shouldDumpChildFramesAsText() { return m_dumpChildFramesAsText; }
+ bool shouldGeneratePixelResults() { return m_generatePixelResults; }
+ bool acceptsEditing() { return m_acceptsEditing; }
+ bool canOpenWindows() { return m_canOpenWindows; }
+ bool shouldAddFileToPasteboard() { return m_shouldAddFileToPasteboard; }
+ bool stopProvisionalFrameLoads() { return m_stopProvisionalFrameLoads; }
+ bool deferMainResourceDataLoad() { return m_deferMainResourceDataLoad; }
+
+ bool testRepaint() const { return m_testRepaint; }
+ bool sweepHorizontally() const { return m_sweepHorizontally; }
+
+ // Called by the webview delegate when the toplevel frame load is done.
+ void locationChangeDone();
+
+ // Called by the webview delegate when the policy delegate runs if the
+ // waitForPolicyDelegate was called.
+ void policyDelegateDone();
+
+ // Reinitializes all static values. The reset() method should be called
+ // before the start of each test (currently from
+ // TestShell::runFileTest).
+ void reset();
+
+ // A single item in the work queue.
+ class WorkItem {
+ public:
+ virtual ~WorkItem() {}
+
+ // Returns true if this started a load.
+ virtual bool run(TestShell* shell) = 0;
+ };
+
+ TaskList* taskList() { return &m_taskList; }
+
+private:
+ friend class WorkItem;
+ friend class WorkQueue;
+
+ // Helper class for managing events queued by methods like queueLoad or
+ // queueScript.
+ class WorkQueue {
+ public:
+ WorkQueue(LayoutTestController* controller) : m_frozen(false), m_controller(controller) {}
+ virtual ~WorkQueue();
+ void processWorkSoon();
+
+ // Reset the state of the class between tests.
+ void reset();
+
+ void addWork(WorkItem* work);
+
+ void setFrozen(bool frozen) { m_frozen = frozen; }
+ bool isEmpty() { return m_queue.isEmpty(); }
+ TaskList* taskList() { return &m_taskList; }
+
+ private:
+ void processWork();
+ class WorkQueueTask: public MethodTask<WorkQueue> {
+ public:
+ WorkQueueTask(WorkQueue* object): MethodTask<WorkQueue>(object) {}
+ virtual void runIfValid() { m_object->processWork(); }
+ };
+
+ TaskList m_taskList;
+ Deque<WorkItem*> m_queue;
+ bool m_frozen;
+ LayoutTestController* m_controller;
+ };
+
+ // Support for overridePreference.
+ bool cppVariantToBool(const CppVariant&);
+ int32_t cppVariantToInt32(const CppVariant&);
+ WebKit::WebString cppVariantToWebString(const CppVariant&);
+
+ void logErrorToConsole(const std::string&);
+ void completeNotifyDone(bool isTimeout);
+ class NotifyDoneTimedOutTask: public MethodTask<LayoutTestController> {
+ public:
+ NotifyDoneTimedOutTask(LayoutTestController* object): MethodTask<LayoutTestController>(object) {}
+ virtual void runIfValid() { m_object->completeNotifyDone(true); }
+ };
+
+
+ bool pauseAnimationAtTimeOnElementWithId(const WebKit::WebString& animationName, double time, const WebKit::WebString& elementId);
+ bool pauseTransitionAtTimeOnElementWithId(const WebKit::WebString& propertyName, double time, const WebKit::WebString& elementId);
+ bool elementDoesAutoCompleteForElementWithId(const WebKit::WebString&);
+ int numberOfActiveAnimations();
+ void suspendAnimations();
+ void resumeAnimations();
+
+ // Used for test timeouts.
+ TaskList m_taskList;
+
+ // Non-owning pointer. The LayoutTestController is owned by the host.
+ TestShell* m_shell;
+
+ // If true, the test_shell will produce a plain text dump rather than a
+ // text representation of the renderer.
+ bool m_dumpAsText;
+
+ // If true, the test_shell will write a descriptive line for each editing
+ // command.
+ bool m_dumpEditingCallbacks;
+
+ // If true, the test_shell will draw the bounds of the current selection rect
+ // taking possible transforms of the selection rect into account.
+ bool m_dumpSelectionRect;
+
+ // If true, the test_shell will output a descriptive line for each frame
+ // load callback.
+ bool m_dumpFrameLoadCallbacks;
+
+ // If true, the test_shell will output a line of the user gesture status
+ // text for some frame load callbacks.
+ bool m_dumpUserGestureInFrameLoadCallbacks;
+
+ // If true, the test_shell will output a descriptive line for each resource
+ // load callback.
+ bool m_dumpResourceLoadCallbacks;
+
+ // If true, the test_shell will output the MIME type for each resource that
+ // was loaded.
+ bool m_dumpResourceResponseMIMETypes;
+
+ // If true, the test_shell will produce a dump of the back forward list as
+ // well.
+ bool m_dumpBackForwardList;
+
+ // If true, the test_shell will print out the child frame scroll offsets as
+ // well.
+ bool m_dumpChildFrameScrollPositions;
+
+ // If true and if dump_as_text_ is true, the test_shell will recursively
+ // dump all frames as plain text.
+ bool m_dumpChildFramesAsText;
+
+ // If true, the test_shell will dump all changes to window.status.
+ bool m_dumpWindowStatusChanges;
+
+ // If true, output a message when the page title is changed.
+ bool m_dumpTitleChanges;
+
+ // If true, the test_shell will generate pixel results in dumpAsText mode
+ bool m_generatePixelResults;
+
+ // If true, the element will be treated as editable. This value is returned
+ // from various editing callbacks that are called just before edit operations
+ // are allowed.
+ bool m_acceptsEditing;
+
+ // If true, new windows can be opened via javascript or by plugins. By
+ // default, set to false and can be toggled to true using
+ // setCanOpenWindows().
+ bool m_canOpenWindows;
+
+ // When reset is called, go through and close all but the main test shell
+ // window. By default, set to true but toggled to false using
+ // setCloseRemainingWindowsWhenComplete().
+ bool m_closeRemainingWindows;
+
+ // If true, pixel dump will be produced as a series of 1px-tall, view-wide
+ // individual paints over the height of the view.
+ bool m_testRepaint;
+ // If true and test_repaint_ is true as well, pixel dump will be produced as
+ // a series of 1px-wide, view-tall paints across the width of the view.
+ bool m_sweepHorizontally;
+
+ // If true and a drag starts, adds a file to the drag&drop clipboard.
+ bool m_shouldAddFileToPasteboard;
+
+ // If true, stops provisional frame loads during the
+ // DidStartProvisionalLoadForFrame callback.
+ bool m_stopProvisionalFrameLoads;
+
+ // If true, don't dump output until notifyDone is called.
+ bool m_waitUntilDone;
+
+ // If false, all new requests will not defer the main resource data load.
+ bool m_deferMainResourceDataLoad;
+
+ WorkQueue m_workQueue;
+
+ CppVariant m_globalFlag;
+
+ // Bound variable counting the number of top URLs visited.
+ CppVariant m_webHistoryItemCount;
+
+ WebKit::WebURL m_userStyleSheetLocation;
+
+ OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
+};
+
+#endif // LayoutTestController_h
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestHelper.mm b/WebKitTools/DumpRenderTree/chromium/LayoutTestHelper.mm
new file mode 100644
index 0000000..e34cf5f
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestHelper.mm
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <AppKit/AppKit.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+// This is a simple helper app that changes the color sync profile to the
+// generic profile and back when done. This program is managed by the layout
+// test script, so it can do the job for multiple DumpRenderTree while they are
+// running layout tests.
+
+static CMProfileRef userColorProfile = 0;
+
+static void saveCurrentColorProfile()
+{
+ CGDirectDisplayID displayID = CGMainDisplayID();
+ CMProfileRef previousProfile;
+ CMError error = CMGetProfileByAVID((UInt32)displayID, &previousProfile);
+ if (error) {
+ NSLog(@"failed to get the current color profile, pixmaps won't match. "
+ @"Error: %d", (int)error);
+ } else {
+ userColorProfile = previousProfile;
+ }
+}
+
+static void installLayoutTestColorProfile()
+{
+ // To make sure we get consistent colors (not dependent on the Main display),
+ // we force the generic rgb color profile. This cases a change the user can
+ // see.
+
+ CGDirectDisplayID displayID = CGMainDisplayID();
+ NSColorSpace* genericSpace = [NSColorSpace genericRGBColorSpace];
+ CMProfileRef genericProfile = (CMProfileRef)[genericSpace colorSyncProfile];
+ CMError error = CMSetProfileByAVID((UInt32)displayID, genericProfile);
+ if (error) {
+ NSLog(@"failed install the generic color profile, pixmaps won't match. "
+ @"Error: %d", (int)error);
+ }
+}
+
+static void restoreUserColorProfile(void)
+{
+ if (!userColorProfile)
+ return;
+ CGDirectDisplayID displayID = CGMainDisplayID();
+ CMError error = CMSetProfileByAVID((UInt32)displayID, userColorProfile);
+ CMCloseProfile(userColorProfile);
+ if (error) {
+ NSLog(@"Failed to restore color profile, use System Preferences -> "
+ @"Displays -> Color to reset. Error: %d", (int)error);
+ }
+ userColorProfile = 0;
+}
+
+static void simpleSignalHandler(int sig)
+{
+ // Try to restore the color profile and try to go down cleanly
+ restoreUserColorProfile();
+ exit(128 + sig);
+}
+
+int main(int argc, char* argv[])
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ // Hooks the ways we might get told to clean up...
+ signal(SIGINT, simpleSignalHandler);
+ signal(SIGHUP, simpleSignalHandler);
+ signal(SIGTERM, simpleSignalHandler);
+
+ // Save off the current profile, and then install the layout test profile.
+ saveCurrentColorProfile();
+ installLayoutTestColorProfile();
+
+ // Let the script know we're ready
+ printf("ready\n");
+ fflush(stdout);
+
+ // Wait for any key (or signal)
+ getchar();
+
+ // Restore the profile
+ restoreUserColorProfile();
+
+ [pool release];
+ return 0;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp
new file mode 100644
index 0000000..25efdcd
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestHelperWin.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <windows.h>
+
+static BOOL fontSmoothingEnabled = FALSE;
+
+static void saveInitialSettings(void)
+{
+ ::SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &fontSmoothingEnabled, 0);
+}
+
+// Technically, all we need to do is disable ClearType. However,
+// for some reason, the call to SPI_SETFONTSMOOTHINGTYPE doesn't
+// seem to work, so we just disable font smoothing all together
+// (which works reliably)
+static void installLayoutTestSettings(void)
+{
+ ::SystemParametersInfo(SPI_SETFONTSMOOTHING, FALSE, 0, 0);
+}
+
+static void restoreInitialSettings(void)
+{
+ ::SystemParametersInfo(SPI_SETFONTSMOOTHING, static_cast<UINT>(fontSmoothingEnabled), 0, 0);
+}
+
+static void simpleSignalHandler(int signalNumber)
+{
+ // Try to restore the settings and then go down cleanly
+ restoreInitialSettings();
+ exit(128 + signalNumber);
+}
+
+int main(int, char*[])
+{
+ // Hooks the ways we might get told to clean up...
+ signal(SIGINT, simpleSignalHandler);
+ signal(SIGTERM, simpleSignalHandler);
+
+ saveInitialSettings();
+
+ installLayoutTestSettings();
+
+ // Let the script know we're ready
+ printf("ready\n");
+ fflush(stdout);
+
+ // Wait for any key (or signal)
+ getchar();
+
+ restoreInitialSettings();
+
+ return EXIT_SUCCESS;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
new file mode 100644
index 0000000..7243152
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.cpp
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MockSpellCheck.h"
+
+#include "WebString.h"
+#include <wtf/ASCIICType.h>
+#include <wtf/Assertions.h>
+#include <wtf/text/WTFString.h>
+
+using namespace WebKit;
+
+MockSpellCheck::MockSpellCheck()
+ : m_initialized(false) {}
+
+MockSpellCheck::~MockSpellCheck() {}
+
+static bool isNotASCIIAlpha(UChar ch) { return !isASCIIAlpha(ch); }
+
+bool MockSpellCheck::spellCheckWord(const WebString& text, int* misspelledOffset, int* misspelledLength)
+{
+ ASSERT(misspelledOffset);
+ ASSERT(misspelledLength);
+
+ // Initialize this spellchecker.
+ initializeIfNeeded();
+
+ // Reset the result values as our spellchecker does.
+ *misspelledOffset = 0;
+ *misspelledLength = 0;
+
+ // Convert to a String because we store String instances in
+ // m_misspelledWords and WebString has no find().
+ const WTF::String stringText(text.data(), text.length());
+
+ // Extract the first possible English word from the given string.
+ // The given string may include non-ASCII characters or numbers. So, we
+ // should filter out such characters before start looking up our
+ // misspelled-word table.
+ // (This is a simple version of our SpellCheckWordIterator class.)
+ // If the given string doesn't include any ASCII characters, we can treat the
+ // string as valid one.
+ // Unfortunately, This implementation splits a contraction, i.e. "isn't" is
+ // split into two pieces "isn" and "t". This is OK because webkit tests
+ // don't have misspelled contractions.
+ int wordOffset = stringText.find(isASCIIAlpha);
+ if (wordOffset == -1)
+ return true;
+ int wordEnd = stringText.find(isNotASCIIAlpha, wordOffset);
+ int wordLength = wordEnd == -1 ? stringText.length() - wordOffset : wordEnd - wordOffset;
+
+ // Look up our misspelled-word table to check if the extracted word is a
+ // known misspelled word, and return the offset and the length of the
+ // extracted word if this word is a known misspelled word.
+ // (See the comment in MockSpellCheck::initializeIfNeeded() why we use a
+ // misspelled-word table.)
+ WTF::String word = stringText.substring(wordOffset, wordLength);
+ if (!m_misspelledWords.contains(word))
+ return true;
+
+ *misspelledOffset = wordOffset;
+ *misspelledLength = wordLength;
+ return false;
+}
+
+void MockSpellCheck::fillSuggestionList(const WebString& word, Vector<WebString>* suggestions)
+{
+ if (word == WebString::fromUTF8("wellcome"))
+ suggestions->append(WebString::fromUTF8("welcome"));
+}
+
+bool MockSpellCheck::initializeIfNeeded()
+{
+ // Exit if we have already initialized this object.
+ if (m_initialized)
+ return false;
+
+ // Create a table that consists of misspelled words used in WebKit layout
+ // tests.
+ // Since WebKit layout tests don't have so many misspelled words as
+ // well-spelled words, it is easier to compare the given word with misspelled
+ // ones than to compare with well-spelled ones.
+ static const char* misspelledWords[] = {
+ // These words are known misspelled words in webkit tests.
+ // If there are other misspelled words in webkit tests, please add them in
+ // this array.
+ "foo",
+ "Foo",
+ "baz",
+ "fo",
+ "LibertyF",
+ "chello",
+ "xxxtestxxx",
+ "XXxxx",
+ "Textx",
+ "blockquoted",
+ "asd",
+ "Lorem",
+ "Nunc",
+ "Curabitur",
+ "eu",
+ "adlj",
+ "adaasj",
+ "sdklj",
+ "jlkds",
+ "jsaada",
+ "jlda",
+ "zz",
+ "contentEditable",
+ // The following words are used by unit tests.
+ "ifmmp",
+ "qwertyuiopasd",
+ "qwertyuiopasdf",
+ "wellcome"
+ };
+
+ m_misspelledWords.clear();
+ for (size_t i = 0; i < arraysize(misspelledWords); ++i)
+ m_misspelledWords.add(WTF::String::fromUTF8(misspelledWords[i]), false);
+
+ // Mark as initialized to prevent this object from being initialized twice
+ // or more.
+ m_initialized = true;
+
+ // Since this MockSpellCheck class doesn't download dictionaries, this
+ // function always returns false.
+ return false;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h
new file mode 100644
index 0000000..dcd37f3
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/MockSpellCheck.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MockSpellCheck_h
+#define MockSpellCheck_h
+
+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebKit {
+class WebString;
+}
+
+// A mock implementation of a spell-checker used for WebKit tests.
+// This class only implements the minimal functionarities required by WebKit
+// tests, i.e. this class just compares the given string with known misspelled
+// words in webkit tests and mark them as missspelled.
+// Even though this is sufficent for webkit tests, this class is not suitable
+// for any other usages.
+class MockSpellCheck {
+public:
+ MockSpellCheck();
+ ~MockSpellCheck();
+
+ // Checks the spellings of the specified text.
+ // This function returns true if the text consists of valid words, and
+ // returns false if it includes invalid words.
+ // When the given text includes invalid words, this function sets the
+ // position of the first invalid word to misspelledOffset, and the length of
+ // the first invalid word to misspelledLength, respectively.
+ // For example, when the given text is " zz zz", this function sets 3 to
+ // misspelledOffset and 2 to misspelledLength, respectively.
+ bool spellCheckWord(const WebKit::WebString& text,
+ int* misspelledOffset,
+ int* misspelledLength);
+
+ void fillSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions);
+private:
+ // Initialize the internal resources if we need to initialize it.
+ // Initializing this object may take long time. To prevent from hurting
+ // the performance of test_shell, we initialize this object when
+ // SpellCheckWord() is called for the first time.
+ // To be compliant with SpellCheck:InitializeIfNeeded(), this function
+ // returns true if this object is downloading a dictionary, otherwise
+ // it returns false.
+ bool initializeIfNeeded();
+
+ // A table that consists of misspelled words.
+ HashMap<WTF::String, bool> m_misspelledWords;
+
+ // A flag representing whether or not this object is initialized.
+ bool m_initialized;
+};
+
+#endif // MockSpellCheck_h
diff --git a/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp b/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp
new file mode 100644
index 0000000..7e7053b
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.cpp
@@ -0,0 +1,148 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NotificationPresenter.h"
+
+#include "WebKit.h"
+#include "WebKitClient.h"
+#include "WebNotification.h"
+#include "WebNotificationPermissionCallback.h"
+#include "WebSecurityOrigin.h"
+#include "WebString.h"
+#include "WebURL.h"
+#include "googleurl/src/gurl.h"
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+using namespace WebKit;
+
+static WebString identifierForNotification(const WebNotification& notification)
+{
+ if (notification.isHTML())
+ return notification.url().spec().utf16();
+ return notification.title();
+}
+
+static void deferredDisplayDispatch(void* context)
+{
+ WebNotification* notification = static_cast<WebNotification*>(context);
+ notification->dispatchDisplayEvent();
+ delete notification;
+}
+
+void NotificationPresenter::grantPermission(const WebString& origin)
+{
+ // Make sure it's in the form of an origin.
+ GURL url(origin);
+ m_allowedOrigins.add(WTF::String(url.GetOrigin().spec().c_str()));
+}
+
+bool NotificationPresenter::simulateClick(const WebString& title)
+{
+ WTF::String id(title.data(), title.length());
+ if (m_activeNotifications.find(id) == m_activeNotifications.end())
+ return false;
+
+ const WebNotification& notification = m_activeNotifications.find(id)->second;
+ WebNotification eventTarget(notification);
+ eventTarget.dispatchClickEvent();
+ return true;
+}
+
+// The output from all these methods matches what DumpRenderTree produces.
+bool NotificationPresenter::show(const WebNotification& notification)
+{
+ WebString identifier = identifierForNotification(notification);
+ if (!notification.replaceId().isEmpty()) {
+ WTF::String replaceId(notification.replaceId().data(), notification.replaceId().length());
+ if (m_replacements.find(replaceId) != m_replacements.end())
+ printf("REPLACING NOTIFICATION %s\n",
+ m_replacements.find(replaceId)->second.utf8().data());
+
+ m_replacements.set(replaceId, WTF::String(identifier.data(), identifier.length()));
+ }
+
+ if (notification.isHTML()) {
+ printf("DESKTOP NOTIFICATION: contents at %s\n",
+ notification.url().spec().data());
+ } else {
+ printf("DESKTOP NOTIFICATION:%s icon %s, title %s, text %s\n",
+ notification.dir() == "rtl" ? "(RTL)" : "",
+ notification.iconURL().isEmpty() ? "" :
+ notification.iconURL().spec().data(),
+ notification.title().isEmpty() ? "" :
+ notification.title().utf8().data(),
+ notification.body().isEmpty() ? "" :
+ notification.body().utf8().data());
+ }
+
+ WTF::String id(identifier.data(), identifier.length());
+ m_activeNotifications.set(id, notification);
+
+ webKitClient()->callOnMainThread(deferredDisplayDispatch, new WebNotification(notification));
+ return true;
+}
+
+void NotificationPresenter::cancel(const WebNotification& notification)
+{
+ WebString identifier = identifierForNotification(notification);
+ printf("DESKTOP NOTIFICATION CLOSED: %s\n", identifier.utf8().data());
+ WebNotification eventTarget(notification);
+ eventTarget.dispatchCloseEvent(false);
+
+ WTF::String id(identifier.data(), identifier.length());
+ m_activeNotifications.remove(id);
+}
+
+void NotificationPresenter::objectDestroyed(const WebKit::WebNotification& notification)
+{
+ WebString identifier = identifierForNotification(notification);
+ WTF::String id(identifier.data(), identifier.length());
+ m_activeNotifications.remove(id);
+}
+
+WebNotificationPresenter::Permission NotificationPresenter::checkPermission(const WebURL& url)
+{
+ // Check with the layout test controller
+ WTF::String origin = WTF::String(static_cast<GURL>(url).GetOrigin().spec().c_str());
+ bool allowed = m_allowedOrigins.find(origin) != m_allowedOrigins.end();
+ return allowed ? WebNotificationPresenter::PermissionAllowed
+ : WebNotificationPresenter::PermissionDenied;
+}
+
+void NotificationPresenter::requestPermission(
+ const WebSecurityOrigin& origin,
+ WebNotificationPermissionCallback* callback)
+{
+ printf("DESKTOP NOTIFICATION PERMISSION REQUESTED: %s\n",
+ origin.toString().utf8().data());
+ callback->permissionRequestComplete();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.h b/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.h
new file mode 100644
index 0000000..689a908
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/NotificationPresenter.h
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NotificationPresenter_h
+#define NotificationPresenter_h
+
+#include "WebNotification.h"
+#include "WebNotificationPresenter.h"
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/text/StringHash.h>
+#include <wtf/text/WTFString.h>
+
+class TestShell;
+
+// A class that implements WebNotificationPresenter for DRT.
+class NotificationPresenter : public WebKit::WebNotificationPresenter {
+public:
+ explicit NotificationPresenter(TestShell* shell) : m_shell(shell) {}
+
+ // Called by the LayoutTestController to simulate a user granting permission.
+ void grantPermission(const WebKit::WebString& origin);
+
+ // Called by the LayoutTestController to simulate a user clicking on a notification.
+ bool simulateClick(const WebKit::WebString& notificationIdentifier);
+
+ // WebKit::WebNotificationPresenter interface
+ virtual bool show(const WebKit::WebNotification&);
+ virtual void cancel(const WebKit::WebNotification&);
+ virtual void objectDestroyed(const WebKit::WebNotification&);
+ virtual Permission checkPermission(const WebKit::WebURL&);
+ virtual void requestPermission(const WebKit::WebSecurityOrigin&, WebKit::WebNotificationPermissionCallback*);
+
+ void reset() { m_allowedOrigins.clear(); }
+
+private:
+ // Non-owned pointer. The NotificationPresenter is owned by the test shell.
+ TestShell* m_shell;
+
+ // Set of allowed origins.
+ HashSet<WTF::String> m_allowedOrigins;
+
+ // Map of active notifications.
+ HashMap<WTF::String, WebKit::WebNotification> m_activeNotifications;
+
+ // Map of active replacement IDs to the titles of those notifications
+ HashMap<WTF::String, WTF::String> m_replacements;
+};
+
+#endif // NotificationPresenter_h
diff --git a/WebKitTools/DumpRenderTree/chromium/PlainTextController.cpp b/WebKitTools/DumpRenderTree/chromium/PlainTextController.cpp
new file mode 100644
index 0000000..c8bdabd
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/PlainTextController.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ * Copyright (C) 2009 Pawel Hajdan (phajdan.jr@chromium.org)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlainTextController.h"
+
+#include "TestShell.h"
+#include "WebBindings.h"
+#include "WebRange.h"
+#include "WebString.h"
+
+using namespace WebKit;
+
+PlainTextController::PlainTextController()
+{
+ // Initialize the map that associates methods of this class with the names
+ // they will use when called by JavaScript. The actual binding of those
+ // names to their methods will be done by calling bindToJavaScript() (defined
+ // by CppBoundClass, the parent to PlainTextController).
+ bindMethod("plainText", &PlainTextController::plainText);
+
+ // The fallback method is called when an unknown method is invoked.
+ bindFallbackMethod(&PlainTextController::fallbackMethod);
+}
+
+void PlainTextController::plainText(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ if (arguments.size() < 1 || !arguments[0].isObject())
+ return;
+
+ // Check that passed-in object is, in fact, a range.
+ NPObject* npobject = NPVARIANT_TO_OBJECT(arguments[0]);
+ if (!npobject)
+ return;
+ WebRange range;
+ if (!WebBindings::getRange(npobject, &range))
+ return;
+
+ // Extract the text using the Range's text() method
+ WebString text = range.toPlainText();
+ result->set(text.utf8());
+}
+
+void PlainTextController::fallbackMethod(const CppArgumentList&, CppVariant* result)
+{
+ printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on PlainTextController\n");
+ result->setNull();
+}
+
diff --git a/WebKitTools/DumpRenderTree/chromium/PlainTextController.h b/WebKitTools/DumpRenderTree/chromium/PlainTextController.h
new file mode 100644
index 0000000..3d3a04c
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/PlainTextController.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlainTextController_h
+#define PlainTextController_h
+
+#include "CppBoundClass.h"
+
+class TestShell;
+
+class PlainTextController : public CppBoundClass {
+public:
+ // Builds the property and method lists needed to bind this class to a JS
+ // object.
+ explicit PlainTextController();
+
+ // JS callback methods.
+ void plainText(const CppArgumentList&, CppVariant*);
+
+ // Fall-back method: called if an unknown method is invoked.
+ void fallbackMethod(const CppArgumentList&, CppVariant*);
+};
+
+#endif // PlainTextController_h
+
diff --git a/WebKitTools/DumpRenderTree/chromium/Task.cpp b/WebKitTools/DumpRenderTree/chromium/Task.cpp
new file mode 100644
index 0000000..5719bac
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/Task.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Task.h"
+
+#include "WebKit.h"
+#include "WebKitClient.h"
+#include "webkit/support/webkit_support.h"
+
+WebTask::WebTask(TaskList* list): m_taskList(list) { m_taskList->registerTask(this); }
+WebTask::~WebTask() { m_taskList->unregisterTask(this); }
+
+void TaskList::unregisterTask(WebTask* task)
+{
+ size_t index = m_tasks.find(task);
+ if (index != notFound)
+ m_tasks.remove(index);
+}
+
+void TaskList::revokeAll()
+{
+ for (unsigned i = 0; i < m_tasks.size(); ++i)
+ m_tasks[i]->cancel();
+ m_tasks.clear();
+}
+
+static void invokeTask(void* context)
+{
+ WebTask* task = static_cast<WebTask*>(context);
+ task->run();
+ delete task;
+}
+
+void postTask(WebTask* task)
+{
+ WebKit::webKitClient()->callOnMainThread(invokeTask, static_cast<void*>(task));
+}
+
+void postDelayedTask(WebTask* task, int64_t ms)
+{
+ webkit_support::PostDelayedTask(invokeTask, static_cast<void*>(task), ms);
+}
+
+
diff --git a/WebKitTools/DumpRenderTree/chromium/Task.h b/WebKitTools/DumpRenderTree/chromium/Task.h
new file mode 100644
index 0000000..39fb8f2
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/Task.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Task_h
+#define Task_h
+
+#include <wtf/Vector.h>
+
+class TaskList;
+
+// WebTask represents a task which can run by postTask() or postDelayedTask().
+// it is named "WebTask", not "Task", to avoid conflist with base/task.h.
+class WebTask {
+public:
+ WebTask(TaskList*);
+ // The main code of this task.
+ // An implementation of run() should return immediately if cancel() was called.
+ virtual void run() = 0;
+ virtual void cancel() = 0;
+ virtual ~WebTask();
+private:
+ TaskList* m_taskList;
+};
+
+class TaskList {
+public:
+ TaskList() {}
+ ~TaskList() { revokeAll(); }
+ void registerTask(WebTask* task) { m_tasks.append(task); }
+ void unregisterTask(WebTask* task);
+ void revokeAll();
+private:
+ Vector<WebTask*> m_tasks;
+};
+
+// A task containing an object pointer of class T. Is is supposed that
+// runifValid() calls a member function of the object pointer.
+// Class T must have "TaskList* taskList()".
+template<class T> class MethodTask: public WebTask {
+public:
+ MethodTask(T* object): WebTask(object->taskList()), m_object(object) {}
+ virtual void run()
+ {
+ if (m_object)
+ runIfValid();
+ }
+ virtual void cancel() { m_object = 0; }
+ virtual void runIfValid() = 0;
+protected:
+ T* m_object;
+};
+
+void postTask(WebTask* task);
+void postDelayedTask(WebTask* task, int64_t ms);
+
+#endif // Task_h
diff --git a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp
new file mode 100644
index 0000000..2130534
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TestEventPrinter.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <wtf/Assertions.h>
+
+class DRTPrinter : public TestEventPrinter {
+public:
+ DRTPrinter() {}
+ void handleTestHeader(const char* url) const;
+ void handleTimedOut() const;
+ void handleTextHeader() const;
+ void handleTextFooter() const;
+ void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const;
+ void handleImageFooter() const;
+ void handleTestFooter(bool dumpedAnything) const;
+};
+
+class TestShellPrinter : public TestEventPrinter {
+public:
+ TestShellPrinter() {}
+ void handleTestHeader(const char* url) const;
+ void handleTimedOut() const;
+ void handleTextHeader() const;
+ void handleTextFooter() const;
+ void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const;
+ void handleImageFooter() const;
+ void handleTestFooter(bool dumpedAnything) const;
+};
+
+TestEventPrinter* TestEventPrinter::createDRTPrinter()
+{
+ return new DRTPrinter;
+}
+
+TestEventPrinter* TestEventPrinter::createTestShellPrinter()
+{
+ return new TestShellPrinter;
+}
+
+// ----------------------------------------------------------------
+
+void DRTPrinter::handleTestHeader(const char*) const
+{
+}
+
+void DRTPrinter::handleTimedOut() const
+{
+ fprintf(stderr, "FAIL: Timed out waiting for notifyDone to be called\n");
+ fprintf(stdout, "FAIL: Timed out waiting for notifyDone to be called\n");
+}
+
+void DRTPrinter::handleTextHeader() const
+{
+ printf("Content-Type: text/plain\n");
+}
+
+void DRTPrinter::handleTextFooter() const
+{
+ printf("#EOF\n");
+}
+
+void DRTPrinter::handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char*) const
+{
+ ASSERT(actualHash);
+ printf("\nActualHash: %s\n", actualHash);
+ if (expectedHash && expectedHash[0])
+ printf("\nExpectedHash: %s\n", expectedHash);
+ if (imageData && imageSize) {
+ printf("Content-Type: image/png\n");
+ // Printf formatting for size_t on 32-bit, 64-bit, and on Windows is hard so just cast to an int.
+ printf("Content-Length: %d\n", static_cast<int>(imageSize));
+ if (fwrite(imageData, 1, imageSize, stdout) != imageSize) {
+ fprintf(stderr, "Short write to stdout.\n");
+ exit(1);
+ }
+ }
+}
+
+void DRTPrinter::handleImageFooter() const
+{
+ printf("#EOF\n");
+}
+
+void DRTPrinter::handleTestFooter(bool) const
+{
+}
+
+// ----------------------------------------------------------------
+
+void TestShellPrinter::handleTestHeader(const char* url) const
+{
+ printf("#URL:%s\n", url);
+}
+
+void TestShellPrinter::handleTimedOut() const
+{
+ puts("#TEST_TIMED_OUT\n");
+}
+
+void TestShellPrinter::handleTextHeader() const
+{
+}
+
+void TestShellPrinter::handleTextFooter() const
+{
+}
+
+void TestShellPrinter::handleImage(const char* actualHash, const char*, const unsigned char* imageData, size_t imageSize, const char* fileName) const
+{
+ ASSERT(actualHash);
+ if (imageData && imageSize) {
+ ASSERT(fileName);
+ FILE* fp = fopen(fileName, "wb");
+ if (!fp) {
+ perror(fileName);
+ exit(EXIT_FAILURE);
+ }
+ if (fwrite(imageData, 1, imageSize, fp) != imageSize) {
+ perror(fileName);
+ fclose(fp);
+ exit(EXIT_FAILURE);
+ }
+ fclose(fp);
+ }
+ printf("#MD5:%s\n", actualHash);
+}
+
+void TestShellPrinter::handleImageFooter() const
+{
+}
+
+void TestShellPrinter::handleTestFooter(bool dumpedAnything) const
+{
+ if (dumpedAnything)
+ printf("#EOF\n");
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.h b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.h
new file mode 100644
index 0000000..fdbfd02
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+class TestEventPrinter {
+public:
+ static TestEventPrinter* createDRTPrinter();
+ static TestEventPrinter* createTestShellPrinter();
+
+ virtual void handleTestHeader(const char* url) const = 0;
+ virtual void handleTimedOut() const = 0;
+ virtual void handleTextHeader() const = 0;
+ virtual void handleTextFooter() const = 0;
+ virtual void handleImage(const char* actualHash, const char* expectedHash, const unsigned char* imageData, size_t imageSize, const char* fileName) const = 0;
+ virtual void handleImageFooter() const = 0;
+ virtual void handleTestFooter(bool dumpedAnything) const = 0;
+};
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp
new file mode 100644
index 0000000..9653c07
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.cpp
@@ -0,0 +1,277 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TestNavigationController.h"
+
+#include "TestShell.h"
+#include <wtf/Assertions.h>
+
+using namespace WebKit;
+using namespace std;
+
+// ----------------------------------------------------------------------------
+// TestNavigationEntry
+
+PassRefPtr<TestNavigationEntry> TestNavigationEntry::create()
+{
+ return adoptRef(new TestNavigationEntry);
+}
+
+PassRefPtr<TestNavigationEntry> TestNavigationEntry::create(
+ int pageID, const WebURL& url, const WebString& title, const WebString& targetFrame)
+{
+ return adoptRef(new TestNavigationEntry(pageID, url, title, targetFrame));
+}
+
+TestNavigationEntry::TestNavigationEntry()
+ : m_pageID(-1) {}
+
+TestNavigationEntry::TestNavigationEntry(
+ int pageID, const WebURL& url, const WebString& title, const WebString& targetFrame)
+ : m_pageID(pageID)
+ , m_url(url)
+ , m_title(title)
+ , m_targetFrame(targetFrame) {}
+
+TestNavigationEntry::~TestNavigationEntry() {}
+
+void TestNavigationEntry::setContentState(const WebHistoryItem& state)
+{
+ m_state = state;
+}
+
+// ----------------------------------------------------------------------------
+// TestNavigationController
+
+TestNavigationController::TestNavigationController(NavigationHost* host)
+ : m_pendingEntry(0)
+ , m_lastCommittedEntryIndex(-1)
+ , m_pendingEntryIndex(-1)
+ , m_host(host)
+ , m_maxPageID(-1) {}
+
+TestNavigationController::~TestNavigationController()
+{
+ discardPendingEntry();
+}
+
+void TestNavigationController::reset()
+{
+ m_entries.clear();
+ discardPendingEntry();
+
+ m_lastCommittedEntryIndex = -1;
+}
+
+void TestNavigationController::reload()
+{
+ // Base the navigation on where we are now...
+ int currentIndex = currentEntryIndex();
+
+ // If we are no where, then we can't reload. TODO(darin): We should add a
+ // CanReload method.
+ if (currentIndex == -1)
+ return;
+
+ discardPendingEntry();
+
+ m_pendingEntryIndex = currentIndex;
+ navigateToPendingEntry(true);
+}
+
+void TestNavigationController::goToOffset(int offset)
+{
+ int index = m_lastCommittedEntryIndex + offset;
+ if (index < 0 || index >= entryCount())
+ return;
+
+ goToIndex(index);
+}
+
+void TestNavigationController::goToIndex(int index)
+{
+ ASSERT(index >= 0);
+ ASSERT(index < static_cast<int>(m_entries.size()));
+
+ discardPendingEntry();
+
+ m_pendingEntryIndex = index;
+ navigateToPendingEntry(false);
+}
+
+void TestNavigationController::loadEntry(TestNavigationEntry* entry)
+{
+ // When navigating to a new page, we don't know for sure if we will actually
+ // end up leaving the current page. The new page load could for example
+ // result in a download or a 'no content' response (e.g., a mailto: URL).
+ discardPendingEntry();
+ m_pendingEntry = entry;
+ navigateToPendingEntry(false);
+}
+
+
+TestNavigationEntry* TestNavigationController::lastCommittedEntry() const
+{
+ if (m_lastCommittedEntryIndex == -1)
+ return 0;
+ return m_entries[m_lastCommittedEntryIndex].get();
+}
+
+TestNavigationEntry* TestNavigationController::activeEntry() const
+{
+ TestNavigationEntry* entry = m_pendingEntry.get();
+ if (!entry)
+ entry = lastCommittedEntry();
+ return entry;
+}
+
+int TestNavigationController::currentEntryIndex() const
+{
+ if (m_pendingEntryIndex != -1)
+ return m_pendingEntryIndex;
+ return m_lastCommittedEntryIndex;
+}
+
+
+TestNavigationEntry* TestNavigationController::entryAtIndex(int index) const
+{
+ if (index < 0 || index >= entryCount())
+ return 0;
+ return m_entries[index].get();
+}
+
+TestNavigationEntry* TestNavigationController::entryWithPageID(int32_t pageID) const
+{
+ int index = entryIndexWithPageID(pageID);
+ return (index != -1) ? m_entries[index].get() : 0;
+}
+
+void TestNavigationController::didNavigateToEntry(TestNavigationEntry* entry)
+{
+ // If the entry is that of a page with PageID larger than any this Tab has
+ // seen before, then consider it a new navigation.
+ if (entry->pageID() > maxPageID()) {
+ insertEntry(entry);
+ return;
+ }
+
+ // Otherwise, we just need to update an existing entry with matching PageID.
+ // If the existing entry corresponds to the entry which is pending, then we
+ // must update the current entry index accordingly. When navigating to the
+ // same URL, a new PageID is not created.
+
+ int existingEntryIndex = entryIndexWithPageID(entry->pageID());
+ TestNavigationEntry* existingEntry = (existingEntryIndex != -1) ?
+ m_entries[existingEntryIndex].get() : 0;
+ if (!existingEntry) {
+ // No existing entry, then simply ignore this navigation!
+ } else if (existingEntry == m_pendingEntry.get()) {
+ // The given entry might provide a new URL... e.g., navigating back to a
+ // page in session history could have resulted in a new client redirect.
+ existingEntry->setURL(entry->URL());
+ existingEntry->setContentState(entry->contentState());
+ m_lastCommittedEntryIndex = m_pendingEntryIndex;
+ m_pendingEntryIndex = -1;
+ m_pendingEntry.clear();
+ } else if (m_pendingEntry && m_pendingEntry->pageID() == -1
+ && GURL(m_pendingEntry->URL()) == GURL(existingEntry->URL().spec())) {
+ // Not a new navigation
+ discardPendingEntry();
+ } else {
+ // The given entry might provide a new URL... e.g., navigating to a page
+ // might result in a client redirect, which should override the URL of the
+ // existing entry.
+ existingEntry->setURL(entry->URL());
+ existingEntry->setContentState(entry->contentState());
+
+ // The navigation could have been issued by the renderer, so be sure that
+ // we update our current index.
+ m_lastCommittedEntryIndex = existingEntryIndex;
+ }
+
+ updateMaxPageID();
+}
+
+void TestNavigationController::discardPendingEntry()
+{
+ m_pendingEntry.clear();
+ m_pendingEntryIndex = -1;
+}
+
+void TestNavigationController::insertEntry(TestNavigationEntry* entry)
+{
+ discardPendingEntry();
+
+ // Prune any entry which are in front of the current entry
+ int currentSize = static_cast<int>(m_entries.size());
+ if (currentSize > 0) {
+ while (m_lastCommittedEntryIndex < (currentSize - 1)) {
+ m_entries.removeLast();
+ currentSize--;
+ }
+ }
+
+ m_entries.append(RefPtr<TestNavigationEntry>(entry));
+ m_lastCommittedEntryIndex = static_cast<int>(m_entries.size()) - 1;
+ updateMaxPageID();
+}
+
+int TestNavigationController::entryIndexWithPageID(int32 pageID) const
+{
+ for (int i = static_cast<int>(m_entries.size()) - 1; i >= 0; --i) {
+ if (m_entries[i]->pageID() == pageID)
+ return i;
+ }
+ return -1;
+}
+
+void TestNavigationController::navigateToPendingEntry(bool reload)
+{
+ // For session history navigations only the pending_entry_index_ is set.
+ if (!m_pendingEntry) {
+ ASSERT(m_pendingEntryIndex != -1);
+ m_pendingEntry = m_entries[m_pendingEntryIndex];
+ }
+
+ if (m_host->navigate(*m_pendingEntry.get(), reload)) {
+ // Note: this is redundant if navigation completed synchronously because
+ // DidNavigateToEntry call this as well.
+ updateMaxPageID();
+ } else
+ discardPendingEntry();
+}
+
+void TestNavigationController::updateMaxPageID()
+{
+ TestNavigationEntry* entry = activeEntry();
+ if (entry)
+ m_maxPageID = max(m_maxPageID, entry->pageID());
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h
new file mode 100644
index 0000000..b671489
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestNavigationController.h
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TestNavigationController_h
+#define TestNavigationController_h
+
+#include "WebDataSource.h"
+#include "WebHistoryItem.h"
+#include "WebString.h"
+#include "WebURL.h"
+#include "webkit/support/webkit_support.h"
+#include <string>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+// Associated with browser-initated navigations to hold tracking data.
+class TestShellExtraData : public WebKit::WebDataSource::ExtraData {
+public:
+ TestShellExtraData(int32_t pendingPageID)
+ : pendingPageID(pendingPageID)
+ , requestCommitted(false) {}
+
+ // Contains the page_id for this navigation or -1 if there is none yet.
+ int32_t pendingPageID;
+
+ // True if we have already processed the "DidCommitLoad" event for this
+ // request. Used by session history.
+ bool requestCommitted;
+};
+
+// Stores one back/forward navigation state for the test shell.
+class TestNavigationEntry: public RefCounted<TestNavigationEntry> {
+public:
+ static PassRefPtr<TestNavigationEntry> create();
+ static PassRefPtr<TestNavigationEntry> create(
+ int pageID,
+ const WebKit::WebURL&,
+ const WebKit::WebString& title,
+ const WebKit::WebString& targetFrame);
+
+ // Virtual to allow test_shell to extend the class.
+ virtual ~TestNavigationEntry();
+
+ // Set / Get the URI
+ void setURL(const WebKit::WebURL& url) { m_url = url; }
+ const WebKit::WebURL& URL() const { return m_url; }
+
+ // Set / Get the title
+ void setTitle(const WebKit::WebString& title) { m_title = title; }
+ const WebKit::WebString& title() const { return m_title; }
+
+ // Set / Get a state.
+ void setContentState(const WebKit::WebHistoryItem&);
+ const WebKit::WebHistoryItem& contentState() const { return m_state; }
+
+ // Get the page id corresponding to the tab's state.
+ void setPageID(int pageID) { m_pageID = pageID; }
+ int32_t pageID() const { return m_pageID; }
+
+ const WebKit::WebString& targetFrame() const { return m_targetFrame; }
+
+private:
+ TestNavigationEntry();
+ TestNavigationEntry(int pageID,
+ const WebKit::WebURL&,
+ const WebKit::WebString& title,
+ const WebKit::WebString& targetFrame);
+
+ // Describes the current page that the tab represents. This is not relevant
+ // for all tab contents types.
+ int32_t m_pageID;
+
+ WebKit::WebURL m_url;
+ WebKit::WebString m_title;
+ WebKit::WebHistoryItem m_state;
+ WebKit::WebString m_targetFrame;
+};
+
+class NavigationHost {
+public:
+ virtual bool navigate(const TestNavigationEntry&, bool reload) = 0;
+};
+
+// Test shell's NavigationController. The goal is to be as close to the Chrome
+// version as possible.
+class TestNavigationController: public Noncopyable {
+public:
+ TestNavigationController(NavigationHost*);
+ ~TestNavigationController();
+
+ void reset();
+
+ // Causes the controller to reload the current (or pending) entry.
+ void reload();
+
+ // Causes the controller to go to the specified offset from current. Does
+ // nothing if out of bounds.
+ void goToOffset(int);
+
+ // Causes the controller to go to the specified index.
+ void goToIndex(int);
+
+ // Causes the controller to load the specified entry.
+ // NOTE: Do not pass an entry that the controller already owns!
+ void loadEntry(TestNavigationEntry*);
+
+ // Returns the last committed entry, which may be null if there are no
+ // committed entries.
+ TestNavigationEntry* lastCommittedEntry() const;
+
+ // Returns the number of entries in the NavigationControllerBase, excluding
+ // the pending entry if there is one.
+ int entryCount() const { return static_cast<int>(m_entries.size()); }
+
+ // Returns the active entry, which is the pending entry if a navigation is in
+ // progress or the last committed entry otherwise. NOTE: This can be 0!!
+ //
+ // If you are trying to get the current state of the NavigationControllerBase,
+ // this is the method you will typically want to call.
+ TestNavigationEntry* activeEntry() const;
+
+ // Returns the index from which we would go back/forward or reload. This is
+ // the m_lastCommittedEntryIndex if m_pendingEntryIndex is -1. Otherwise,
+ // it is the m_pendingEntryIndex.
+ int currentEntryIndex() const;
+
+ // Returns the entry at the specified index. Returns 0 if out of
+ // bounds.
+ TestNavigationEntry* entryAtIndex(int) const;
+
+ // Return the entry with the corresponding type and page ID, or 0 if
+ // not found.
+ TestNavigationEntry* entryWithPageID(int32_t) const;
+
+ // Returns the index of the last committed entry.
+ int lastCommittedEntryIndex() const { return m_lastCommittedEntryIndex; }
+
+ // Used to inform us of a navigation being committed for a tab. Any entry
+ // located forward to the current entry will be deleted. The new entry
+ // becomes the current entry.
+ void didNavigateToEntry(TestNavigationEntry*);
+
+ // Used to inform us to discard its pending entry.
+ void discardPendingEntry();
+
+private:
+ // Inserts an entry after the current position, removing all entries after it.
+ // The new entry will become the active one.
+ void insertEntry(TestNavigationEntry*);
+
+ int maxPageID() const { return m_maxPageID; }
+ void navigateToPendingEntry(bool reload);
+
+ // Return the index of the entry with the corresponding type and page ID,
+ // or -1 if not found.
+ int entryIndexWithPageID(int32_t) const;
+
+ // Updates the max page ID with that of the given entry, if is larger.
+ void updateMaxPageID();
+
+ // List of NavigationEntry for this tab
+ typedef Vector<RefPtr<TestNavigationEntry> > NavigationEntryList;
+ typedef NavigationEntryList::iterator NavigationEntryListIterator;
+ NavigationEntryList m_entries;
+
+ // An entry we haven't gotten a response for yet. This will be discarded
+ // when we navigate again. It's used only so we know what the currently
+ // displayed tab is.
+ RefPtr<TestNavigationEntry> m_pendingEntry;
+
+ // currently visible entry
+ int m_lastCommittedEntryIndex;
+
+ // index of pending entry if it is in entries_, or -1 if pending_entry_ is a
+ // new entry (created by LoadURL).
+ int m_pendingEntryIndex;
+
+ NavigationHost* m_host;
+ int m_maxPageID;
+};
+
+#endif // TestNavigationController_h
+
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h
new file mode 100644
index 0000000..9fa3fff
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npapi.h
@@ -0,0 +1,9 @@
+#include "bindings/npapi.h"
+
+// These are defined in WebCore/brdige/npapi.h and we need them on Linux/Win.
+#ifndef FALSE
+#define FALSE (0)
+#endif
+#ifndef TRUE
+#define TRUE (1)
+#endif
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h
new file mode 100644
index 0000000..59ae666
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npfunctions.h
@@ -0,0 +1,8 @@
+#include "npapi.h"
+#include "bindings/npfunctions.h"
+
+// Non-standard event types can be passed to HandleEvent.
+// npapi.h that comes with WebKit.framework adds these events.
+#define getFocusEvent (osEvt + 16)
+#define loseFocusEvent (osEvt + 17)
+#define adjustCursorEvent (osEvt + 18)
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h
new file mode 100644
index 0000000..597d4ad
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/ForwardingHeaders/WebKit/npruntime.h
@@ -0,0 +1 @@
+#include "bindings/npruntime.h"
diff --git a/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist
new file mode 100644
index 0000000..663f058
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestNetscapePlugIn/Info.plist
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//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>WebKitTestNetscapePlugIn</string>
+ <key>CFBundleGetInfoString</key>
+ <string>420+, Copyright 2006-2009 Apple Inc.</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.testnetscapeplugin</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BRPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>CFPlugInDynamicRegisterFunction</key>
+ <string></string>
+ <key>CFPlugInDynamicRegistration</key>
+ <string>NO</string>
+ <key>CFPlugInFactories</key>
+ <dict>
+ <key>00000000-0000-0000-0000-000000000000</key>
+ <string>MyFactoryFunction</string>
+ </dict>
+ <key>CFPlugInTypes</key>
+ <dict>
+ <key>00000000-0000-0000-0000-000000000000</key>
+ <array>
+ <string>00000000-0000-0000-0000-000000000000</string>
+ </array>
+ </dict>
+ <key>CFPlugInUnloadFunction</key>
+ <string></string>
+ <key>WebPluginDescription</key>
+ <string>Simple Netscape plug-in that handles test content for WebKit</string>
+ <key>WebPluginMIMETypes</key>
+ <dict>
+ <key>application/x-webkit-test-netscape</key>
+ <dict>
+ <key>WebPluginExtensions</key>
+ <array>
+ <string>testnetscape</string>
+ </array>
+ <key>WebPluginTypeDescription</key>
+ <string>test netscape content</string>
+ </dict>
+ </dict>
+ <key>WebPluginName</key>
+ <string>WebKit Test PlugIn</string>
+</dict>
+</plist>
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
new file mode 100644
index 0000000..5de351c
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
@@ -0,0 +1,618 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TestShell.h"
+
+#include "DRTDevToolsAgent.h"
+#include "DRTDevToolsClient.h"
+#include "LayoutTestController.h"
+#include "WebDataSource.h"
+#include "WebDocument.h"
+#include "WebElement.h"
+#include "WebFrame.h"
+#include "WebHistoryItem.h"
+#include "WebKit.h"
+#include "WebRuntimeFeatures.h"
+#include "WebScriptController.h"
+#include "WebSettings.h"
+#include "WebSize.h"
+#include "WebSpeechInputControllerMock.h"
+#include "WebString.h"
+#include "WebURLRequest.h"
+#include "WebURLResponse.h"
+#include "WebView.h"
+#include "WebViewHost.h"
+#include "skia/ext/bitmap_platform_device.h"
+#include "skia/ext/platform_canvas.h"
+#include "webkit/support/webkit_support.h"
+#include "webkit/support/webkit_support_gfx.h"
+#include <algorithm>
+#include <cctype>
+#include <vector>
+#include <wtf/MD5.h>
+
+using namespace WebKit;
+using namespace std;
+
+// Content area size for newly created windows.
+static const int testWindowWidth = 800;
+static const int testWindowHeight = 600;
+
+// The W3C SVG layout tests use a different size than the other layout tests.
+static const int SVGTestWindowWidth = 480;
+static const int SVGTestWindowHeight = 360;
+
+static const char layoutTestsPattern[] = "/LayoutTests/";
+static const string::size_type layoutTestsPatternSize = sizeof(layoutTestsPattern) - 1;
+static const char fileUrlPattern[] = "file:/";
+static const char fileTestPrefix[] = "(file test):";
+static const char dataUrlPattern[] = "data:";
+static const string::size_type dataUrlPatternSize = sizeof(dataUrlPattern) - 1;
+
+TestShell::TestShell(bool testShellMode)
+ : m_testIsPending(false)
+ , m_testIsPreparing(false)
+ , m_focusedWidget(0)
+ , m_testShellMode(testShellMode)
+ , m_devTools(0)
+ , m_allowExternalPages(false)
+ , m_acceleratedCompositingEnabled(false)
+ , m_accelerated2dCanvasEnabled(false)
+ , m_loadCount(1)
+ , m_dumpWhenFinished(true)
+{
+ WebRuntimeFeatures::enableGeolocation(true);
+ WebRuntimeFeatures::enableIndexedDatabase(true);
+ WebRuntimeFeatures::enableFileSystem(true);
+ m_accessibilityController.set(new AccessibilityController(this));
+ m_layoutTestController.set(new LayoutTestController(this));
+ m_eventSender.set(new EventSender(this));
+ m_plainTextController.set(new PlainTextController());
+ m_textInputController.set(new TextInputController(this));
+ m_notificationPresenter.set(new NotificationPresenter(this));
+ m_printer.set(m_testShellMode ? TestEventPrinter::createTestShellPrinter() : TestEventPrinter::createDRTPrinter());
+
+ // 30 second is the same as the value in Mac DRT.
+ // If we use a value smaller than the timeout value of
+ // (new-)run-webkit-tests, (new-)run-webkit-tests misunderstands that a
+ // timed-out DRT process was crashed.
+ m_timeout = 30 * 1000;
+
+ m_drtDevToolsAgent.set(new DRTDevToolsAgent);
+ m_webViewHost = createWebView();
+ m_webView = m_webViewHost->webView();
+ m_drtDevToolsAgent->setWebView(m_webView);
+}
+
+TestShell::~TestShell()
+{
+ // Note: DevTools are closed together with all the other windows in the
+ // windows list.
+
+ // Destroy the WebView before its WebViewHost.
+ m_drtDevToolsAgent->setWebView(0);
+}
+
+void TestShell::createDRTDevToolsClient(DRTDevToolsAgent* agent)
+{
+ m_drtDevToolsClient.set(new DRTDevToolsClient(agent, m_devTools->webView()));
+}
+
+void TestShell::showDevTools()
+{
+ if (!m_devTools) {
+ WebURL url = webkit_support::GetDevToolsPathAsURL();
+ if (!url.isValid()) {
+ ASSERT(false);
+ return;
+ }
+ m_devTools = createNewWindow(url);
+ ASSERT(m_devTools);
+ createDRTDevToolsClient(m_drtDevToolsAgent.get());
+ }
+ m_devTools->show(WebKit::WebNavigationPolicyNewWindow);
+}
+
+void TestShell::closeDevTools()
+{
+ if (m_devTools) {
+ m_drtDevToolsAgent->reset();
+ m_drtDevToolsClient.clear();
+ closeWindow(m_devTools);
+ m_devTools = 0;
+ }
+}
+
+void TestShell::resetWebSettings(WebView& webView)
+{
+ m_prefs.reset();
+ m_prefs.acceleratedCompositingEnabled = m_acceleratedCompositingEnabled;
+ m_prefs.accelerated2dCanvasEnabled = m_accelerated2dCanvasEnabled;
+ m_prefs.applyTo(&webView);
+}
+
+void TestShell::runFileTest(const TestParams& params)
+{
+ ASSERT(params.testUrl.isValid());
+ m_testIsPreparing = true;
+ m_params = params;
+ string testUrl = m_params.testUrl.spec();
+
+ bool inspectorTestMode = testUrl.find("/inspector/") != string::npos
+ || testUrl.find("\\inspector\\") != string::npos;
+ m_prefs.developerExtrasEnabled = inspectorTestMode;
+ applyPreferences();
+
+ if (testUrl.find("loading/") != string::npos
+ || testUrl.find("loading\\") != string::npos)
+ m_layoutTestController->setShouldDumpFrameLoadCallbacks(true);
+
+ if (inspectorTestMode)
+ showDevTools();
+
+ if (m_dumpWhenFinished)
+ m_printer->handleTestHeader(testUrl.c_str());
+ loadURL(m_params.testUrl);
+
+ m_testIsPreparing = false;
+ waitTestFinished();
+}
+
+static inline bool isSVGTestURL(const WebURL& url)
+{
+ return url.isValid() && string(url.spec()).find("W3C-SVG-1.1") != string::npos;
+}
+
+void TestShell::resizeWindowForTest(WebViewHost* window, const WebURL& url)
+{
+ int width, height;
+ if (isSVGTestURL(url)) {
+ width = SVGTestWindowWidth;
+ height = SVGTestWindowHeight;
+ } else {
+ width = testWindowWidth;
+ height = testWindowHeight;
+ }
+ window->setWindowRect(WebRect(0, 0, width + virtualWindowBorder * 2, height + virtualWindowBorder * 2));
+}
+
+void TestShell::resetTestController()
+{
+ resetWebSettings(*webView());
+ m_accessibilityController->reset();
+ m_layoutTestController->reset();
+ m_eventSender->reset();
+ m_webViewHost->reset();
+ m_notificationPresenter->reset();
+ m_drtDevToolsAgent->reset();
+ if (m_drtDevToolsClient)
+ m_drtDevToolsClient->reset();
+}
+
+void TestShell::loadURL(const WebURL& url)
+{
+ m_webViewHost->loadURLForFrame(url, WebString());
+}
+
+void TestShell::reload()
+{
+ m_webViewHost->navigationController()->reload();
+}
+
+void TestShell::goToOffset(int offset)
+{
+ m_webViewHost->navigationController()->goToOffset(offset);
+}
+
+int TestShell::navigationEntryCount() const
+{
+ return m_webViewHost->navigationController()->entryCount();
+}
+
+void TestShell::callJSGC()
+{
+ m_webView->mainFrame()->collectGarbage();
+}
+
+void TestShell::setFocus(WebWidget* widget, bool enable)
+{
+ // Simulate the effects of InteractiveSetFocus(), which includes calling
+ // both setFocus() and setIsActive().
+ if (enable) {
+ if (m_focusedWidget != widget) {
+ if (m_focusedWidget)
+ m_focusedWidget->setFocus(false);
+ webView()->setIsActive(enable);
+ widget->setFocus(enable);
+ m_focusedWidget = widget;
+ }
+ } else {
+ if (m_focusedWidget == widget) {
+ widget->setFocus(enable);
+ webView()->setIsActive(enable);
+ m_focusedWidget = 0;
+ }
+ }
+}
+
+void TestShell::testFinished()
+{
+ if (!m_testIsPending)
+ return;
+ m_testIsPending = false;
+ if (m_dumpWhenFinished)
+ dump();
+ webkit_support::QuitMessageLoop();
+}
+
+void TestShell::testTimedOut()
+{
+ m_printer->handleTimedOut();
+ testFinished();
+}
+
+static string dumpDocumentText(WebFrame* frame)
+{
+ // We use the document element's text instead of the body text here because
+ // not all documents have a body, such as XML documents.
+ WebElement documentElement = frame->document().documentElement();
+ if (documentElement.isNull())
+ return string();
+ return documentElement.innerText().utf8();
+}
+
+static string dumpFramesAsText(WebFrame* frame, bool recursive)
+{
+ string result;
+
+ // Add header for all but the main frame. Skip empty frames.
+ if (frame->parent() && !frame->document().documentElement().isNull()) {
+ result.append("\n--------\nFrame: '");
+ result.append(frame->name().utf8().data());
+ result.append("'\n--------\n");
+ }
+
+ result.append(dumpDocumentText(frame));
+ result.append("\n");
+
+ if (recursive) {
+ for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling())
+ result.append(dumpFramesAsText(child, recursive));
+ }
+
+ return result;
+}
+
+static void dumpFrameScrollPosition(WebFrame* frame, bool recursive)
+{
+ WebSize offset = frame->scrollOffset();
+ if (offset.width > 0 || offset.height > 0) {
+ if (frame->parent())
+ printf("frame '%s' ", frame->name().utf8().data());
+ printf("scrolled to %d,%d\n", offset.width, offset.height);
+ }
+
+ if (!recursive)
+ return;
+ for (WebFrame* child = frame->firstChild(); child; child = child->nextSibling())
+ dumpFrameScrollPosition(child, recursive);
+}
+
+struct ToLower {
+ char16 operator()(char16 c) { return tolower(c); }
+};
+
+// FIXME: Eliminate std::transform(), std::vector, and std::sort().
+
+// Returns True if item1 < item2.
+static bool HistoryItemCompareLess(const WebHistoryItem& item1, const WebHistoryItem& item2)
+{
+ string16 target1 = item1.target();
+ string16 target2 = item2.target();
+ std::transform(target1.begin(), target1.end(), target1.begin(), ToLower());
+ std::transform(target2.begin(), target2.end(), target2.begin(), ToLower());
+ return target1 < target2;
+}
+
+static string dumpHistoryItem(const WebHistoryItem& item, int indent, bool isCurrent)
+{
+ string result;
+
+ if (isCurrent) {
+ result.append("curr->");
+ result.append(indent - 6, ' '); // 6 == "curr->".length()
+ } else {
+ result.append(indent, ' ');
+ }
+
+ string url = item.urlString().utf8();
+ size_t pos;
+ if (!url.find(fileUrlPattern) && ((pos = url.find(layoutTestsPattern)) != string::npos)) {
+ // adjust file URLs to match upstream results.
+ url.replace(0, pos + layoutTestsPatternSize, fileTestPrefix);
+ } else if (!url.find(dataUrlPattern)) {
+ // URL-escape data URLs to match results upstream.
+ string path = webkit_support::EscapePath(url.substr(dataUrlPatternSize));
+ url.replace(dataUrlPatternSize, url.length(), path);
+ }
+
+ result.append(url);
+ if (!item.target().isEmpty()) {
+ result.append(" (in frame \"");
+ result.append(item.target().utf8());
+ result.append("\")");
+ }
+ if (item.isTargetItem())
+ result.append(" **nav target**");
+ result.append("\n");
+
+ const WebVector<WebHistoryItem>& children = item.children();
+ if (!children.isEmpty()) {
+ // Must sort to eliminate arbitrary result ordering which defeats
+ // reproducible testing.
+ // FIXME: WebVector should probably just be a std::vector!!
+ std::vector<WebHistoryItem> sortedChildren;
+ for (size_t i = 0; i < children.size(); ++i)
+ sortedChildren.push_back(children[i]);
+ std::sort(sortedChildren.begin(), sortedChildren.end(), HistoryItemCompareLess);
+ for (size_t i = 0; i < sortedChildren.size(); ++i)
+ result += dumpHistoryItem(sortedChildren[i], indent + 4, false);
+ }
+
+ return result;
+}
+
+static void dumpBackForwardList(const TestNavigationController& navigationController, string& result)
+{
+ result.append("\n============== Back Forward List ==============\n");
+ for (int index = 0; index < navigationController.entryCount(); ++index) {
+ int currentIndex = navigationController.lastCommittedEntryIndex();
+ WebHistoryItem historyItem = navigationController.entryAtIndex(index)->contentState();
+ if (historyItem.isNull()) {
+ historyItem.initialize();
+ historyItem.setURLString(navigationController.entryAtIndex(index)->URL().spec().utf16());
+ }
+ result.append(dumpHistoryItem(historyItem, 8, index == currentIndex));
+ }
+ result.append("===============================================\n");
+}
+
+string TestShell::dumpAllBackForwardLists()
+{
+ string result;
+ for (unsigned i = 0; i < m_windowList.size(); ++i)
+ dumpBackForwardList(*m_windowList[i]->navigationController(), result);
+ return result;
+}
+
+void TestShell::dump()
+{
+ WebScriptController::flushConsoleMessages();
+
+ // Dump the requested representation.
+ WebFrame* frame = m_webView->mainFrame();
+ if (!frame)
+ return;
+ bool shouldDumpAsText = m_layoutTestController->shouldDumpAsText();
+ bool shouldGeneratePixelResults = m_layoutTestController->shouldGeneratePixelResults();
+ bool dumpedAnything = false;
+ if (m_params.dumpTree) {
+ dumpedAnything = true;
+ m_printer->handleTextHeader();
+ // Text output: the test page can request different types of output
+ // which we handle here.
+ if (!shouldDumpAsText) {
+ // Plain text pages should be dumped as text
+ string mimeType = frame->dataSource()->response().mimeType().utf8();
+ if (mimeType == "text/plain") {
+ shouldDumpAsText = true;
+ shouldGeneratePixelResults = false;
+ }
+ }
+ if (shouldDumpAsText) {
+ bool recursive = m_layoutTestController->shouldDumpChildFramesAsText();
+ string dataUtf8 = dumpFramesAsText(frame, recursive);
+ if (fwrite(dataUtf8.c_str(), 1, dataUtf8.size(), stdout) != dataUtf8.size())
+ FATAL("Short write to stdout, disk full?\n");
+ } else {
+ printf("%s", frame->renderTreeAsText().utf8().data());
+ bool recursive = m_layoutTestController->shouldDumpChildFrameScrollPositions();
+ dumpFrameScrollPosition(frame, recursive);
+ }
+ if (m_layoutTestController->shouldDumpBackForwardList())
+ printf("%s", dumpAllBackForwardLists().c_str());
+ }
+ if (dumpedAnything && m_params.printSeparators)
+ m_printer->handleTextFooter();
+
+ if (m_params.dumpPixels && shouldGeneratePixelResults) {
+ // Image output: we write the image data to the file given on the
+ // command line (for the dump pixels argument), and the MD5 sum to
+ // stdout.
+ dumpedAnything = true;
+ m_webView->layout();
+ if (m_layoutTestController->testRepaint()) {
+ WebSize viewSize = m_webView->size();
+ int width = viewSize.width;
+ int height = viewSize.height;
+ if (m_layoutTestController->sweepHorizontally()) {
+ for (WebRect column(0, 0, 1, height); column.x < width; column.x++)
+ m_webViewHost->paintRect(column);
+ } else {
+ for (WebRect line(0, 0, width, 1); line.y < height; line.y++)
+ m_webViewHost->paintRect(line);
+ }
+ } else
+ m_webViewHost->paintInvalidatedRegion();
+
+ // See if we need to draw the selection bounds rect. Selection bounds
+ // rect is the rect enclosing the (possibly transformed) selection.
+ // The rect should be drawn after everything is laid out and painted.
+ if (m_layoutTestController->shouldDumpSelectionRect()) {
+ // If there is a selection rect - draw a red 1px border enclosing rect
+ WebRect wr = frame->selectionBoundsRect();
+ if (!wr.isEmpty()) {
+ // Render a red rectangle bounding selection rect
+ SkPaint paint;
+ paint.setColor(0xFFFF0000); // Fully opaque red
+ paint.setStyle(SkPaint::kStroke_Style);
+ paint.setFlags(SkPaint::kAntiAlias_Flag);
+ paint.setStrokeWidth(1.0f);
+ SkIRect rect; // Bounding rect
+ rect.set(wr.x, wr.y, wr.x + wr.width, wr.y + wr.height);
+ m_webViewHost->canvas()->drawIRect(rect, paint);
+ }
+ }
+
+ dumpImage(m_webViewHost->canvas());
+ }
+ m_printer->handleImageFooter();
+ m_printer->handleTestFooter(dumpedAnything);
+ fflush(stdout);
+ fflush(stderr);
+}
+
+void TestShell::dumpImage(skia::PlatformCanvas* canvas) const
+{
+ skia::BitmapPlatformDevice& device =
+ static_cast<skia::BitmapPlatformDevice&>(canvas->getTopPlatformDevice());
+ const SkBitmap& sourceBitmap = device.accessBitmap(false);
+
+ SkAutoLockPixels sourceBitmapLock(sourceBitmap);
+
+ // Fix the alpha. The expected PNGs on Mac have an alpha channel, so we want
+ // to keep it. On Windows, the alpha channel is wrong since text/form control
+ // drawing may have erased it in a few places. So on Windows we force it to
+ // opaque and also don't write the alpha channel for the reference. Linux
+ // doesn't have the wrong alpha like Windows, but we match Windows.
+#if OS(MAC_OS_X)
+ bool discardTransparency = false;
+#else
+ bool discardTransparency = true;
+ device.makeOpaque(0, 0, sourceBitmap.width(), sourceBitmap.height());
+#endif
+
+ // Compute MD5 sum.
+ MD5 digester;
+ Vector<uint8_t, 16> digestValue;
+ digester.addBytes(reinterpret_cast<const uint8_t*>(sourceBitmap.getPixels()), sourceBitmap.getSize());
+ digester.checksum(digestValue);
+ string md5hash;
+ md5hash.reserve(16 * 2);
+ for (unsigned i = 0; i < 16; ++i) {
+ char hex[3];
+ // Use "x", not "X". The string must be lowercased.
+ sprintf(hex, "%02x", digestValue[i]);
+ md5hash.append(hex);
+ }
+
+ // Only encode and dump the png if the hashes don't match. Encoding the image
+ // is really expensive.
+ if (md5hash.compare(m_params.pixelHash)) {
+ std::vector<unsigned char> png;
+ webkit_support::EncodeBGRAPNG(
+ reinterpret_cast<const unsigned char*>(sourceBitmap.getPixels()),
+ sourceBitmap.width(), sourceBitmap.height(),
+ static_cast<int>(sourceBitmap.rowBytes()), discardTransparency, &png);
+
+ m_printer->handleImage(md5hash.c_str(), m_params.pixelHash.c_str(), &png[0], png.size(), m_params.pixelFileName.c_str());
+ } else
+ m_printer->handleImage(md5hash.c_str(), m_params.pixelHash.c_str(), 0, 0, m_params.pixelFileName.c_str());
+}
+
+void TestShell::bindJSObjectsToWindow(WebFrame* frame)
+{
+ m_accessibilityController->bindToJavascript(frame, WebString::fromUTF8("accessibilityController"));
+ m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("layoutTestController"));
+ m_eventSender->bindToJavascript(frame, WebString::fromUTF8("eventSender"));
+ m_plainTextController->bindToJavascript(frame, WebString::fromUTF8("plainText"));
+ m_textInputController->bindToJavascript(frame, WebString::fromUTF8("textInputController"));
+}
+
+WebViewHost* TestShell::createWebView()
+{
+ return createNewWindow(WebURL());
+}
+
+WebViewHost* TestShell::createNewWindow(const WebURL& url)
+{
+ WebViewHost* host = new WebViewHost(this);
+ WebView* view = WebView::create(host, m_drtDevToolsAgent.get());
+ host->setWebWidget(view);
+ m_prefs.applyTo(view);
+ view->initializeMainFrame(host);
+ m_windowList.append(host);
+ host->loadURLForFrame(url, WebString());
+ return host;
+}
+
+void TestShell::closeWindow(WebViewHost* window)
+{
+ size_t i = m_windowList.find(window);
+ if (i == notFound) {
+ ASSERT_NOT_REACHED();
+ return;
+ }
+ m_windowList.remove(i);
+ WebWidget* focusedWidget = m_focusedWidget;
+ if (window->webWidget() == m_focusedWidget)
+ focusedWidget = 0;
+
+ delete window;
+ // We set the focused widget after deleting the web view host because it
+ // can change the focus.
+ m_focusedWidget = focusedWidget;
+ if (m_focusedWidget) {
+ webView()->setIsActive(true);
+ m_focusedWidget->setFocus(true);
+ }
+}
+
+void TestShell::closeRemainingWindows()
+{
+ // Iterate through the window list and close everything except the main
+ // window. We don't want to delete elements as we're iterating, so we copy
+ // to a temp vector first.
+ Vector<WebViewHost*> windowsToDelete;
+ for (unsigned i = 0; i < m_windowList.size(); ++i) {
+ if (m_windowList[i] != webViewHost())
+ windowsToDelete.append(m_windowList[i]);
+ }
+ ASSERT(windowsToDelete.size() + 1 == m_windowList.size());
+ for (unsigned i = 0; i < windowsToDelete.size(); ++i)
+ closeWindow(windowsToDelete[i]);
+ ASSERT(m_windowList.size() == 1);
+}
+
+int TestShell::windowCount()
+{
+ return m_windowList.size();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h
new file mode 100644
index 0000000..06e77cc
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h
@@ -0,0 +1,220 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TestShell_h
+#define TestShell_h
+
+#include "AccessibilityController.h"
+#include "EventSender.h"
+#include "LayoutTestController.h"
+#include "NotificationPresenter.h"
+#include "PlainTextController.h"
+#include "TestEventPrinter.h"
+#include "TextInputController.h"
+#include "WebPreferences.h"
+#include "WebViewHost.h"
+#include <string>
+#include <wtf/OwnPtr.h>
+#include <wtf/Vector.h>
+
+// TestShell is a container of global variables and has bridge functions between
+// various objects. Only one instance is created in one DRT process.
+
+namespace WebKit {
+class WebDevToolsAgentClient;
+class WebFrame;
+class WebNotificationPresenter;
+class WebView;
+class WebURL;
+}
+namespace skia {
+class PlatformCanvas;
+}
+
+class DRTDevToolsAgent;
+class DRTDevToolsCallArgs;
+class DRTDevToolsClient;
+
+struct TestParams {
+ bool dumpTree;
+ bool dumpPixels;
+ bool printSeparators;
+ WebKit::WebURL testUrl;
+ // Resultant image file name. Required only if the test_shell mode.
+ std::string pixelFileName;
+ std::string pixelHash;
+
+ TestParams()
+ : dumpTree(true)
+ , dumpPixels(false)
+ , printSeparators(false) {}
+};
+
+class TestShell {
+public:
+ TestShell(bool testShellMode);
+ ~TestShell();
+
+ // The main WebView.
+ WebKit::WebView* webView() const { return m_webView; }
+ // Returns the host for the main WebView.
+ WebViewHost* webViewHost() const { return m_webViewHost; }
+ LayoutTestController* layoutTestController() const { return m_layoutTestController.get(); }
+ EventSender* eventSender() const { return m_eventSender.get(); }
+ AccessibilityController* accessibilityController() const { return m_accessibilityController.get(); }
+ NotificationPresenter* notificationPresenter() const { return m_notificationPresenter.get(); }
+ TestEventPrinter* printer() const { return m_printer.get(); }
+
+ WebPreferences* preferences() { return &m_prefs; }
+ void applyPreferences() { m_prefs.applyTo(m_webView); }
+
+ void bindJSObjectsToWindow(WebKit::WebFrame*);
+ void runFileTest(const TestParams&);
+ void callJSGC();
+ void resetTestController();
+ void waitTestFinished();
+
+ // Operations to the main window.
+ void loadURL(const WebKit::WebURL& url);
+ void reload();
+ void goToOffset(int offset);
+ int navigationEntryCount() const;
+
+ void setFocus(WebKit::WebWidget*, bool enable);
+ bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpFrameLoadCallbacks(); }
+ bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpUserGestureInFrameLoadCallbacks(); }
+ bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceLoadCallbacks(); }
+ bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && layoutTestController()->shouldDumpResourceResponseMIMETypes(); }
+ void setIsLoading(bool flag) { m_isLoading = flag; }
+
+ // Called by the LayoutTestController to signal test completion.
+ void testFinished();
+ // Called by LayoutTestController when a test hits the timeout, but does not
+ // cause a hang. We can avoid killing TestShell in this case and still dump
+ // the test results.
+ void testTimedOut();
+
+ bool allowExternalPages() const { return m_allowExternalPages; }
+ void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; }
+
+ void setAcceleratedCompositingEnabled(bool enabled) { m_acceleratedCompositingEnabled = enabled; }
+ void setAccelerated2dCanvasEnabled(bool enabled) { m_accelerated2dCanvasEnabled = enabled; }
+
+#if defined(OS_WIN)
+ // Access to the finished event. Used by the static WatchDog thread.
+ HANDLE finishedEvent() { return m_finishedEvent; }
+#endif
+
+ // Get the timeout for running a test in milliseconds.
+ int layoutTestTimeout() { return m_timeout; }
+ int layoutTestTimeoutForWatchDog() { return layoutTestTimeout() + 1000; }
+ void setLayoutTestTimeout(int timeout) { m_timeout = timeout; }
+
+ // Number of times to load each URL.
+ int loadCount() { return m_loadCount; }
+ void setLoadCount(int loadCount) { m_loadCount = loadCount; }
+
+ // The JavaScript flags are specified as a vector of strings. Each element of the vector is full flags string
+ // which can contain multiple flags (e.g. "--xxx --yyy"). With multiple load testing it is possible to specify
+ // separate sets of flags to each load.
+ std::string javaScriptFlagsForLoad(size_t load) { return (load < m_javaScriptFlags.size()) ? m_javaScriptFlags[load] : ""; }
+ void setJavaScriptFlags(Vector<std::string> javaScriptFlags) { m_javaScriptFlags = javaScriptFlags; }
+
+ // Set whether to dump when the loaded page has finished processing. This is used with multiple load
+ // testing where we only want to have the output from the last load.
+ void setDumpWhenFinished(bool dumpWhenFinished) { m_dumpWhenFinished = dumpWhenFinished; }
+
+ WebViewHost* createWebView();
+ WebViewHost* createNewWindow(const WebKit::WebURL&);
+ void closeWindow(WebViewHost*);
+ void closeRemainingWindows();
+ int windowCount();
+ static void resizeWindowForTest(WebViewHost*, const WebKit::WebURL&);
+
+ void showDevTools();
+ void closeDevTools();
+
+ DRTDevToolsAgent* drtDevToolsAgent() { return m_drtDevToolsAgent.get(); }
+ DRTDevToolsClient* drtDevToolsClient() { return m_drtDevToolsClient.get(); }
+
+ static const int virtualWindowBorder = 3;
+
+private:
+ void createDRTDevToolsClient(DRTDevToolsAgent*);
+
+ void resetWebSettings(WebKit::WebView&);
+ void dump();
+ std::string dumpAllBackForwardLists();
+ void dumpImage(skia::PlatformCanvas*) const;
+
+ bool m_testIsPending;
+ bool m_testIsPreparing;
+ bool m_isLoading;
+ WebKit::WebView* m_webView;
+ WebKit::WebWidget* m_focusedWidget;
+ bool m_testShellMode;
+ WebViewHost* m_webViewHost;
+ WebViewHost* m_devTools;
+ OwnPtr<DRTDevToolsAgent> m_drtDevToolsAgent;
+ OwnPtr<DRTDevToolsClient> m_drtDevToolsClient;
+ 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;
+ bool m_acceleratedCompositingEnabled;
+ bool m_accelerated2dCanvasEnabled;
+ WebPreferences m_prefs;
+ int m_loadCount;
+ Vector<std::string> m_javaScriptFlags;
+ bool m_dumpWhenFinished;
+
+
+ // List of all windows in this process.
+ // The main window should be put into windowList[0].
+ typedef Vector<WebViewHost*> WindowList;
+ WindowList m_windowList;
+
+#if defined(OS_WIN)
+ // Used by the watchdog to know when it's finished.
+ HANDLE m_finishedEvent;
+#endif
+};
+
+void platformInit(int*, char***);
+void openStartupDialog();
+bool checkLayoutTestSystemDependencies();
+
+#endif // TestShell_h
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
new file mode 100644
index 0000000..1cf7c56
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellGtk.cpp
@@ -0,0 +1,211 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TestShell.h"
+
+#include "webkit/support/webkit_support.h"
+#include <fontconfig/fontconfig.h>
+#include <gtk/gtk.h>
+#include <signal.h>
+
+static void AlarmHandler(int signatl)
+{
+ // If the alarm alarmed, kill the process since we have a really bad hang.
+ puts("\n#TEST_TIMED_OUT\n");
+ puts("#EOF\n");
+ fflush(stdout);
+ exit(0);
+}
+
+static void setupFontconfig()
+{
+ // We wish to make the layout tests reproducable with respect to fonts. Skia
+ // uses fontconfig to resolve font family names from WebKit into actual font
+ // files found on the current system. This means that fonts vary based on the
+ // system and also on the fontconfig configuration.
+ //
+ // To avoid this we initialise fontconfig here and install a configuration
+ // which only knows about a few, select, fonts.
+
+ // We have fontconfig parse a config file from our resources file. This
+ // sets a number of aliases ("sans"->"Arial" etc), but doesn't include any
+ // font directories.
+ FcInit();
+
+ char drtPath[PATH_MAX + 1];
+ int drtPathSize = readlink("/proc/self/exe", drtPath, PATH_MAX);
+ if (drtPathSize < 0 || drtPathSize > PATH_MAX) {
+ fputs("Unable to resolve /proc/self/exe.", stderr);
+ exit(1);
+ }
+ drtPath[drtPathSize] = 0;
+ std::string drtDirPath(drtPath);
+ size_t lastPathPos = drtDirPath.rfind("/");
+ ASSERT(lastPathPos != std::string::npos);
+ drtDirPath.erase(lastPathPos + 1);
+
+ FcConfig* fontcfg = FcConfigCreate();
+ std::string fontconfigPath = drtDirPath + "fonts.conf";
+ if (!FcConfigParseAndLoad(fontcfg, reinterpret_cast<const FcChar8*>(fontconfigPath.c_str()), true)) {
+ fputs("Failed to parse fontconfig config file\n", stderr);
+ exit(1);
+ }
+
+ // This is the list of fonts that fontconfig will know about. It
+ // will try its best to match based only on the fonts here in. The
+ // paths are where these fonts are found on our Ubuntu boxes.
+ static const char *const fonts[] = {
+ "/usr/share/fonts/truetype/kochi/kochi-gothic.ttf",
+ "/usr/share/fonts/truetype/kochi/kochi-mincho.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Arial.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Arial_Bold.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Arial_Bold_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Arial_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS_Bold.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Courier_New.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Courier_New_Bold_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Courier_New_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Georgia.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Georgia_Bold.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Georgia_Bold_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Georgia_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Impact.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Bold.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Bold_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Trebuchet_MS_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Bold_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Verdana.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Verdana_Bold.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Verdana_Bold_Italic.ttf",
+ "/usr/share/fonts/truetype/msttcorefonts/Verdana_Italic.ttf",
+ // The DejaVuSans font is used by the css2.1 tests.
+ "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf",
+ "/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_ta.ttf",
+ "/usr/share/fonts/truetype/ttf-indic-fonts-core/MuktiNarrow.ttf",
+ };
+ for (size_t i = 0; i < arraysize(fonts); ++i) {
+ if (access(fonts[i], R_OK)) {
+ fprintf(stderr, "You are missing %s. Try installing msttcorefonts. Also see "
+ "http://code.google.com/p/chromium/wiki/LinuxBuildInstructions",
+ fonts[i]);
+ exit(1);
+ }
+ if (!FcConfigAppFontAddFile(fontcfg, (FcChar8 *) fonts[i])) {
+ fprintf(stderr, "Failed to load font %s\n", fonts[i]);
+ exit(1);
+ }
+ }
+
+ // We special case these fonts because they're only needed in a
+ // few layout tests.
+ static const char* const optionalFonts[] = {
+ "/usr/share/fonts/truetype/ttf-lucida/LucidaSansRegular.ttf",
+ "/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf",
+ };
+ for (size_t i = 0; i < arraysize(optionalFonts); ++i) {
+ const char* font = optionalFonts[i];
+
+ // This font changed paths across Ubuntu releases, so try checking in both locations.
+ if (!strcmp(font, "/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf")
+ && access(font, R_OK) < 0)
+ font = "/usr/share/fonts/truetype/ttf-punjabi-fonts/lohit_pa.ttf";
+
+ if (access(font, R_OK) < 0) {
+ fprintf(stderr, "You are missing %s. Without this, some layout tests may fail. "
+ "See http://code.google.com/p/chromium/wiki/LinuxBuildInstructionsPrerequisites "
+ "for more.\n", font);
+ } else if (!FcConfigAppFontAddFile(fontcfg, (FcChar8 *) font)) {
+ fprintf(stderr, "Failed to load font %s\n", font);
+ exit(1);
+ }
+ }
+
+ // Also load the layout-test-specific "Ahem" font.
+ std::string ahemPath = drtDirPath + "AHEM____.TTF";
+ if (!FcConfigAppFontAddFile(fontcfg, reinterpret_cast<const FcChar8*>(ahemPath.c_str()))) {
+ fprintf(stderr, "Failed to load font %s\n", ahemPath.c_str());
+ exit(1);
+ }
+
+ if (!FcConfigSetCurrent(fontcfg)) {
+ fputs("Failed to set the default font configuration\n", stderr);
+ exit(1);
+ }
+}
+
+void TestShell::waitTestFinished()
+{
+ ASSERT(!m_testIsPending);
+
+ m_testIsPending = true;
+
+ // Install an alarm signal handler that will kill us if we time out.
+ signal(SIGALRM, AlarmHandler);
+ alarm(layoutTestTimeoutForWatchDog() / 1000);
+
+ // TestFinished() will post a quit message to break this loop when the page
+ // finishes loading.
+ while (m_testIsPending)
+ webkit_support::RunMessageLoop();
+
+ // Remove the alarm.
+ alarm(0);
+ signal(SIGALRM, SIG_DFL);
+}
+
+void platformInit(int* argc, char*** argv)
+{
+ // FIXME: It's better call gtk_init() only when we run plugin tests.
+ // See http://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/633ea167cde196ca#
+ gtk_init(argc, argv);
+
+ setupFontconfig();
+}
+
+void openStartupDialog()
+{
+ GtkWidget* dialog = gtk_message_dialog_new(
+ 0, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_OK, "Attach to me?");
+ gtk_window_set_title(GTK_WINDOW(dialog), "DumpRenderTree");
+ gtk_dialog_run(GTK_DIALOG(dialog)); // Runs a nested message loop.
+ gtk_widget_destroy(dialog);
+}
+
+bool checkLayoutTestSystemDependencies()
+{
+ return true;
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm b/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm
new file mode 100644
index 0000000..53ede56
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellMac.mm
@@ -0,0 +1,145 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "TestShell.h"
+#include "webkit/support/webkit_support.h"
+#import <AppKit/AppKit.h>
+
+// A class to be the target/selector of the "watchdog" thread that ensures
+// pages timeout if they take too long and tells the test harness via stdout.
+@interface WatchDogTarget : NSObject {
+@private
+ NSTimeInterval _timeout;
+}
+// |timeout| is in seconds
+- (id)initWithTimeout:(NSTimeInterval)timeout;
+// serves as the "run" method of a NSThread.
+- (void)run:(id)sender;
+@end
+
+@implementation WatchDogTarget
+
+- (id)initWithTimeout:(NSTimeInterval)timeout
+{
+ if ((self = [super init]))
+ _timeout = timeout;
+ return self;
+}
+
+- (void)run:(id)ignore
+{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+ // check for debugger, just bail if so. We don't want the timeouts hitting
+ // when we're trying to track down an issue.
+ if (webkit_support::BeingDebugged())
+ return;
+
+ NSThread* currentThread = [NSThread currentThread];
+
+ // Wait to be cancelled. If we are that means the test finished. If it hasn't,
+ // then we need to tell the layout script we timed out and start again.
+ NSDate* limitDate = [NSDate dateWithTimeIntervalSinceNow:_timeout];
+ while ([(NSDate*)[NSDate date] compare:limitDate] == NSOrderedAscending &&
+ ![currentThread isCancelled]) {
+ // sleep for a small increment then check again
+ NSDate* incrementDate = [NSDate dateWithTimeIntervalSinceNow:1.0];
+ [NSThread sleepUntilDate:incrementDate];
+ }
+ if (![currentThread isCancelled]) {
+ // Print a warning to be caught by the layout-test script.
+ // Note: the layout test driver may or may not recognize
+ // this as a timeout.
+ puts("#TEST_TIMED_OUT\n");
+ puts("#EOF\n");
+ fflush(stdout);
+ exit(0);
+ }
+
+ [pool release];
+}
+
+@end
+
+void TestShell::waitTestFinished()
+{
+ ASSERT(!m_testIsPending);
+
+ m_testIsPending = true;
+
+ // Create a watchdog thread which just sets a timer and
+ // kills the process if it times out. This catches really
+ // bad hangs where the shell isn't coming back to the
+ // message loop. If the watchdog is what catches a
+ // timeout, it can't do anything except terminate the test
+ // shell, which is unfortunate.
+ // Windows multiplies by 2.5, but that causes us to run for far, far too
+ // long. We use the passed value and let the scripts flag override
+ // the value as needed.
+ NSTimeInterval timeoutSeconds = layoutTestTimeoutForWatchDog() / 1000;
+ WatchDogTarget* watchdog = [[[WatchDogTarget alloc]
+ initWithTimeout:timeoutSeconds] autorelease];
+ NSThread* thread = [[NSThread alloc] initWithTarget:watchdog
+ selector:@selector(run:)
+ object:nil];
+ [thread start];
+
+ // TestFinished() will post a quit message to break this loop when the page
+ // finishes loading.
+ while (m_testIsPending)
+ webkit_support::RunMessageLoop();
+
+ // Tell the watchdog that we're finished. No point waiting to re-join, it'll
+ // die on its own.
+ [thread cancel];
+ [thread release];
+}
+
+void platformInit(int*, char***)
+{
+}
+
+void openStartupDialog()
+{
+ // FIXME: This code doesn't work. Need NSApplication event loop?
+ NSAlert* alert = [[[NSAlert alloc] init] autorelease];
+ alert.messageText = @"Attach to me?";
+ alert.informativeText = @"This would probably be a good time to attach your debugger.";
+ [alert addButtonWithTitle:@"OK"];
+ [alert runModal];
+}
+
+bool checkLayoutTestSystemDependencies()
+{
+ return true;
+}
+
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp b/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp
new file mode 100644
index 0000000..9efcf5a
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestShellWin.cpp
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TestShell.h"
+
+#include "WebThemeEngineDRT.h"
+#include "webkit/support/webkit_support.h"
+#include <fcntl.h>
+#include <io.h>
+#include <list>
+#include <process.h>
+#include <shlwapi.h>
+#include <string>
+#include <sys/stat.h>
+#include <windows.h>
+
+#define SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(structName, member) \
+ offsetof(structName, member) + \
+ (sizeof static_cast<structName*>(0)->member)
+#define NONCLIENTMETRICS_SIZE_PRE_VISTA \
+ SIZEOF_STRUCT_WITH_SPECIFIED_LAST_MEMBER(NONCLIENTMETRICS, lfMessageFont)
+
+// Theme engine
+static WebThemeEngineDRT themeEngine;
+
+// Thread main to run for the thread which just tests for timeout.
+unsigned int __stdcall watchDogThread(void* arg)
+{
+ // If we're debugging a layout test, don't timeout.
+ if (::IsDebuggerPresent())
+ return 0;
+
+ TestShell* shell = static_cast<TestShell*>(arg);
+ // FIXME: Do we need user-specified time settings as with the original
+ // Chromium implementation?
+ DWORD timeout = static_cast<DWORD>(shell->layoutTestTimeoutForWatchDog());
+ DWORD rv = WaitForSingleObject(shell->finishedEvent(), timeout);
+ if (rv == WAIT_TIMEOUT) {
+ // Print a warning to be caught by the layout-test script.
+ // Note: the layout test driver may or may not recognize
+ // this as a timeout.
+ puts("\n#TEST_TIMED_OUT\n");
+ puts("#EOF\n");
+ fflush(stdout);
+ TerminateProcess(GetCurrentProcess(), 0);
+ }
+ // Finished normally.
+ return 0;
+}
+
+void TestShell::waitTestFinished()
+{
+ DCHECK(!m_testIsPending) << "cannot be used recursively";
+
+ m_testIsPending = true;
+
+ // Create a watchdog thread which just sets a timer and
+ // kills the process if it times out. This catches really
+ // bad hangs where the shell isn't coming back to the
+ // message loop. If the watchdog is what catches a
+ // timeout, it can't do anything except terminate the test
+ // shell, which is unfortunate.
+ m_finishedEvent = CreateEvent(0, TRUE, FALSE, 0);
+ DCHECK(m_finishedEvent);
+
+ HANDLE threadHandle = reinterpret_cast<HANDLE>(_beginthreadex(
+ 0,
+ 0,
+ &watchDogThread,
+ this,
+ 0,
+ 0));
+ DCHECK(threadHandle);
+
+ // TestFinished() will post a quit message to break this loop when the page
+ // finishes loading.
+ while (m_testIsPending)
+ webkit_support::RunMessageLoop();
+
+ // Tell the watchdog that we are finished.
+ SetEvent(m_finishedEvent);
+
+ // Wait to join the watchdog thread. (up to 1s, then quit)
+ WaitForSingleObject(threadHandle, 1000);
+}
+
+void platformInit(int*, char***)
+{
+ // Set stdout/stderr binary mode.
+ _setmode(_fileno(stdout), _O_BINARY);
+ _setmode(_fileno(stderr), _O_BINARY);
+
+ // Set theme engine.
+ webkit_support::SetThemeEngine(&themeEngine);
+
+ // Load Ahem font.
+ // AHEM____.TTF is copied to the directory of DumpRenderTree.exe by WebKit.gyp.
+ WCHAR path[_MAX_PATH];
+ if (!::GetModuleFileName(0, path, _MAX_PATH)) {
+ fprintf(stderr, "Can't get the module path.\n");
+ exit(1);
+ }
+ ::PathRemoveFileSpec(path);
+ wcscat_s(path, _MAX_PATH, L"/AHEM____.TTF");
+ struct _stat ahemStat;
+ if (_wstat(path, &ahemStat) == -1) {
+ fprintf(stderr, "Can't access: '%S'\n", path);
+ exit(1);
+ }
+
+ FILE* fp = _wfopen(path, L"rb");
+ if (!fp) {
+ _wperror(path);
+ exit(1);
+ }
+ size_t size = ahemStat.st_size;
+ char* fontBuffer = new char[size];
+ if (fread(fontBuffer, 1, size, fp) != size) {
+ fprintf(stderr, "Can't read the font: '%S'\n", path);
+ fclose(fp);
+ exit(1);
+ }
+ fclose(fp);
+ DWORD numFonts = 1;
+ HANDLE fontHandle = ::AddFontMemResourceEx(fontBuffer, size, 0, &numFonts);
+ delete[] fontBuffer; // OS owns a copy of the buffer.
+ if (!fontHandle) {
+ fprintf(stderr, "Failed to register Ahem font: '%S'\n", path);
+ exit(1);
+ }
+ // We don't need to release the font explicitly.
+}
+
+void openStartupDialog()
+{
+ ::MessageBox(0, L"Attach to me?", L"DumpRenderTree", MB_OK);
+}
+
+bool checkLayoutTestSystemDependencies()
+{
+ std::list<std::string> errors;
+
+ OSVERSIONINFOEX versionInfo;
+ ::ZeroMemory(&versionInfo, sizeof(OSVERSIONINFOEX));
+ versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
+ ::GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&versionInfo));
+
+ // Default to XP metrics, override if on Vista or win 7.
+ int requiredVScrollSize = 17;
+ int requiredFontSize = -11; // 8 pt
+ const wchar_t* requiredFont = L"Tahoma";
+ bool isVista = false;
+ bool isWin7 = false;
+ const DWORD major = versionInfo.dwMajorVersion;
+ const DWORD minor = versionInfo.dwMinorVersion;
+ const WORD type = versionInfo.wProductType;
+ if (major == 6 && minor == 1 && type == VER_NT_WORKSTATION) {
+ requiredFont = L"Segoe UI";
+ requiredFontSize = -12;
+ isWin7 = true;
+ } else if (major == 6 && !minor && type == VER_NT_WORKSTATION) {
+ requiredFont = L"Segoe UI";
+ requiredFontSize = -12; // 9 pt
+ isVista = true;
+ } else if (!(major == 5 && minor == 1 && type == VER_NT_WORKSTATION)) {
+ // The above check is for XP, so that means ...
+ errors.push_back("Unsupported Operating System version "
+ "(must use XP, Vista, or Windows 7).");
+ }
+
+ // This metric will be 17 when font size is "Normal".
+ // The size of drop-down menus depends on it.
+ int verticalScrollSize = ::GetSystemMetrics(SM_CXVSCROLL);
+ if (verticalScrollSize != requiredVScrollSize)
+ errors.push_back("Must use normal size fonts (96 dpi).");
+
+ // ClearType must be disabled, because the rendering is unpredictable.
+ BOOL fontSmoothingEnabled;
+ ::SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &fontSmoothingEnabled, 0);
+ int fontSmoothingType;
+ ::SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &fontSmoothingType, 0);
+ if (fontSmoothingEnabled && (fontSmoothingType == FE_FONTSMOOTHINGCLEARTYPE))
+ errors.push_back("ClearType must be disabled.");
+
+ // Check that we're using the default system fonts
+ NONCLIENTMETRICS metrics;
+ // Checks Vista or later.
+ metrics.cbSize = major >= 6 ? sizeof(NONCLIENTMETRICS) : NONCLIENTMETRICS_SIZE_PRE_VISTA;
+ const bool success = !!::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, &metrics, 0);
+ ASSERT(success);
+ LOGFONTW* systemFonts[] =
+ {&metrics.lfStatusFont, &metrics.lfMenuFont, &metrics.lfSmCaptionFont};
+
+ for (size_t i = 0; i < arraysize(systemFonts); ++i) {
+ if (systemFonts[i]->lfHeight != requiredFontSize || wcscmp(requiredFont, systemFonts[i]->lfFaceName)) {
+ if (isVista || isWin7)
+ errors.push_back("Must use either the Aero or Basic theme.");
+ else
+ errors.push_back("Must use the default XP theme (Luna).");
+ break;
+ }
+ }
+
+ if (!errors.empty()) {
+ fprintf(stderr, "%s",
+ "##################################################################\n"
+ "## Layout test system dependencies check failed.\n"
+ "##\n");
+ for (std::list<std::string>::iterator it = errors.begin(); it != errors.end(); ++it)
+ fprintf(stderr, "## %s\n", it->c_str());
+ fprintf(stderr, "%s",
+ "##\n"
+ "##################################################################\n");
+ }
+ return errors.empty();
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestWebWorker.h b/WebKitTools/DumpRenderTree/chromium/TestWebWorker.h
new file mode 100644
index 0000000..a29e45f
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TestWebWorker.h
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TestWebWorker_h
+#define TestWebWorker_h
+
+#include "WebMessagePortChannel.h"
+#include "WebWorker.h"
+#include "WebWorkerClient.h"
+#include <wtf/RefCounted.h>
+
+namespace WebKit {
+class WebNotificationPresenter;
+class WebString;
+class WebURL;
+}
+
+class TestWebWorker : public WebKit::WebWorker,
+ public WebKit::WebWorkerClient,
+ public WTF::RefCounted<TestWebWorker> {
+public:
+ TestWebWorker()
+ {
+ ref();
+ // The initial counter value should be 2. One for a worker object,
+ // another for a worker context object. We need to call ref() just once
+ // because the default counter value of RefCounted is 1.
+ }
+
+ // WebWorker methods:
+ virtual void startWorkerContext(const WebKit::WebURL&, const WebKit::WebString&, const WebKit::WebString&) {}
+ virtual void terminateWorkerContext() {}
+ virtual void postMessageToWorkerContext(const WebKit::WebString&, const WebKit::WebMessagePortChannelArray&) {}
+ virtual void workerObjectDestroyed()
+ {
+ // Releases the reference held for worker object.
+ deref();
+ }
+ virtual void clientDestroyed() {}
+
+ // WebWorkerClient methods:
+ virtual void postMessageToWorkerObject(const WebKit::WebString&, const WebKit::WebMessagePortChannelArray&) {}
+ virtual void postExceptionToWorkerObject(const WebKit::WebString&, int, const WebKit::WebString&) {}
+ virtual void postConsoleMessageToWorkerObject(int, int, int, int, const WebKit::WebString&, int, const WebKit::WebString&) {}
+ virtual void confirmMessageFromWorkerObject(bool) {}
+ virtual void reportPendingActivity(bool) {}
+ virtual void workerContextClosed() {}
+ virtual void workerContextDestroyed()
+ {
+ // Releases the reference held for worker context object.
+ deref();
+ }
+ virtual WebKit::WebWorker* createWorker(WebKit::WebWorkerClient*) { return 0; }
+ virtual WebKit::WebNotificationPresenter* notificationPresenter() { return 0; }
+ virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(WebKit::WebApplicationCacheHostClient*) { return 0; }
+ virtual bool allowDatabase(WebKit::WebFrame*, const WebKit::WebString&, const WebKit::WebString&, unsigned long) { return true; }
+
+private:
+ ~TestWebWorker() {}
+ friend class WTF::RefCounted<TestWebWorker>;
+};
+
+#endif // TestWebWorker_h
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
new file mode 100644
index 0000000..3603840
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.cpp
@@ -0,0 +1,262 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TextInputController.h"
+
+#include "TestShell.h"
+#include "WebBindings.h"
+#include "WebCompositionUnderline.h"
+#include "WebFrame.h"
+#include "WebRange.h"
+#include "WebString.h"
+#include "WebVector.h"
+#include "WebView.h"
+#include <wtf/StringExtras.h>
+#include <string>
+
+using namespace WebKit;
+
+TestShell* TextInputController::testShell = 0;
+
+TextInputController::TextInputController(TestShell* shell)
+{
+ // Set static testShell variable. Be careful not to assign testShell to new
+ // windows which are temporary.
+ if (!testShell)
+ testShell = shell;
+
+ bindMethod("attributedSubstringFromRange", &TextInputController::attributedSubstringFromRange);
+ bindMethod("characterIndexForPoint", &TextInputController::characterIndexForPoint);
+ bindMethod("conversationIdentifier", &TextInputController::conversationIdentifier);
+ bindMethod("doCommand", &TextInputController::doCommand);
+ bindMethod("firstRectForCharacterRange", &TextInputController::firstRectForCharacterRange);
+ bindMethod("hasMarkedText", &TextInputController::hasMarkedText);
+ bindMethod("insertText", &TextInputController::insertText);
+ bindMethod("makeAttributedString", &TextInputController::makeAttributedString);
+ bindMethod("markedRange", &TextInputController::markedRange);
+ bindMethod("selectedRange", &TextInputController::selectedRange);
+ bindMethod("setMarkedText", &TextInputController::setMarkedText);
+ bindMethod("substringFromRange", &TextInputController::substringFromRange);
+ bindMethod("unmarkText", &TextInputController::unmarkText);
+ bindMethod("validAttributesForMarkedText", &TextInputController::validAttributesForMarkedText);
+ bindMethod("setComposition", &TextInputController::setComposition);
+}
+
+WebFrame* TextInputController::getMainFrame()
+{
+ return testShell->webView()->mainFrame();
+}
+
+void TextInputController::insertText(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+ if (arguments.size() < 1 || !arguments[0].isString())
+ return;
+
+ if (mainFrame->hasMarkedText()) {
+ mainFrame->unmarkText();
+ mainFrame->replaceSelection(WebString());
+ }
+ mainFrame->insertText(WebString::fromUTF8(arguments[0].toString()));
+}
+
+void TextInputController::doCommand(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+
+ if (arguments.size() >= 1 && arguments[0].isString())
+ mainFrame->executeCommand(WebString::fromUTF8(arguments[0].toString()));
+}
+
+void TextInputController::setMarkedText(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+
+ if (arguments.size() >= 3 && arguments[0].isString()
+ && arguments[1].isNumber() && arguments[2].isNumber()) {
+ mainFrame->setMarkedText(WebString::fromUTF8(arguments[0].toString()),
+ arguments[1].toInt32(),
+ arguments[2].toInt32());
+ }
+}
+
+void TextInputController::unmarkText(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+
+ mainFrame->unmarkText();
+}
+
+void TextInputController::hasMarkedText(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+
+ result->set(mainFrame->hasMarkedText());
+}
+
+void TextInputController::conversationIdentifier(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: Implement this.
+ result->setNull();
+}
+
+void TextInputController::substringFromRange(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: Implement this.
+ result->setNull();
+}
+
+void TextInputController::attributedSubstringFromRange(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: Implement this.
+ result->setNull();
+}
+
+void TextInputController::markedRange(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+
+ WebRange range = mainFrame->markedRange();
+ Vector<int> intArray(2);
+ intArray[0] = range.startOffset();
+ intArray[1] = range.endOffset();
+ result->set(WebBindings::makeIntArray(intArray));
+}
+
+void TextInputController::selectedRange(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+
+ WebRange range = mainFrame->selectionRange();
+ Vector<int> intArray(2);
+ intArray[0] = range.startOffset();
+ intArray[1] = range.endOffset();
+ result->set(WebBindings::makeIntArray(intArray));
+}
+
+void TextInputController::firstRectForCharacterRange(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+
+ if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber())
+ return;
+
+ WebRect rect;
+ if (!mainFrame->firstRectForCharacterRange(arguments[0].toInt32(), arguments[1].toInt32(), rect))
+ return;
+
+ Vector<int> intArray(4);
+ intArray[0] = rect.x;
+ intArray[1] = rect.y;
+ intArray[2] = rect.width;
+ intArray[3] = rect.height;
+ result->set(WebBindings::makeIntArray(intArray));
+}
+
+void TextInputController::characterIndexForPoint(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: Implement this.
+ result->setNull();
+}
+
+void TextInputController::validAttributesForMarkedText(const CppArgumentList&, CppVariant* result)
+{
+ result->setNull();
+
+ WebFrame* mainFrame = getMainFrame();
+ if (!mainFrame)
+ return;
+
+ result->set("NSUnderline,NSUnderlineColor,NSMarkedClauseSegment,"
+ "NSTextInputReplacementRangeAttributeName");
+}
+
+void TextInputController::makeAttributedString(const CppArgumentList&, CppVariant* result)
+{
+ // FIXME: Implement this.
+ result->setNull();
+}
+
+void TextInputController::setComposition(const CppArgumentList& arguments, CppVariant* result)
+{
+ result->setNull();
+
+ WebView* view = getMainFrame() ? getMainFrame()->view() : 0;
+ if (!view)
+ return;
+
+ if (arguments.size() < 1)
+ return;
+
+ // Sends a keydown event with key code = 0xE5 to emulate input method behavior.
+ WebKeyboardEvent keyDown;
+ keyDown.type = WebInputEvent::RawKeyDown;
+ keyDown.modifiers = 0;
+ keyDown.windowsKeyCode = 0xE5; // VKEY_PROCESSKEY
+ keyDown.setKeyIdentifierFromWindowsKeyCode();
+ view->handleInputEvent(keyDown);
+
+ WebVector<WebCompositionUnderline> underlines;
+ WebString text(WebString::fromUTF8(arguments[0].toString()));
+ view->setComposition(text, underlines, 0, text.length());
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/TextInputController.h b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
new file mode 100644
index 0000000..3a3907f
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/TextInputController.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// TextInputController is bound to window.textInputController in Javascript
+// when DRT is running. Layout tests use it to exercise various corners of
+// text input.
+
+#ifndef TextInputController_h
+#define TextInputController_h
+
+#include "CppBoundClass.h"
+
+class TestShell;
+
+namespace WebKit {
+class WebFrame;
+}
+
+class TextInputController : public CppBoundClass {
+public:
+ TextInputController(TestShell*);
+
+ void insertText(const CppArgumentList&, CppVariant*);
+ void doCommand(const CppArgumentList&, CppVariant*);
+ void setMarkedText(const CppArgumentList&, CppVariant*);
+ void unmarkText(const CppArgumentList&, CppVariant*);
+ void hasMarkedText(const CppArgumentList&, CppVariant*);
+ void conversationIdentifier(const CppArgumentList&, CppVariant*);
+ void substringFromRange(const CppArgumentList&, CppVariant*);
+ void attributedSubstringFromRange(const CppArgumentList&, CppVariant*);
+ void markedRange(const CppArgumentList&, CppVariant*);
+ void selectedRange(const CppArgumentList&, CppVariant*);
+ void firstRectForCharacterRange(const CppArgumentList&, CppVariant*);
+ void characterIndexForPoint(const CppArgumentList&, CppVariant*);
+ void validAttributesForMarkedText(const CppArgumentList&, CppVariant*);
+ void makeAttributedString(const CppArgumentList&, CppVariant*);
+ void setComposition(const CppArgumentList&, CppVariant*);
+
+private:
+ // Returns the test shell's main WebFrame.
+ static WebKit::WebFrame* getMainFrame();
+
+ // Non-owning pointer. The TextInputController is owned by the TestShell.
+ static TestShell* testShell;
+};
+
+#endif // TextInputController_h
diff --git a/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp b/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp
new file mode 100644
index 0000000..7c274c3
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebPreferences.cpp
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebPreferences.h"
+
+#include "WebView.h"
+
+using namespace WebKit;
+
+void WebPreferences::reset()
+{
+#if OS(MAC_OS_X)
+ cursiveFontFamily = WebString::fromUTF8("Apple Chancery");
+ fantasyFontFamily = WebString::fromUTF8("Papyrus");
+ WebString serif = WebString::fromUTF8("Times");
+#else
+ // These two fonts are picked from the intersection of
+ // Win XP font list and Vista font list :
+ // http://www.microsoft.com/typography/fonts/winxp.htm
+ // http://blogs.msdn.com/michkap/archive/2006/04/04/567881.aspx
+ // Some of them are installed only with CJK and complex script
+ // support enabled on Windows XP and are out of consideration here.
+ // (although we enabled both on our buildbots.)
+ // They (especially Impact for fantasy) are not typical cursive
+ // and fantasy fonts, but it should not matter for layout tests
+ // as long as they're available.
+ cursiveFontFamily = WebString::fromUTF8("Comic Sans MS");
+ fantasyFontFamily = WebString::fromUTF8("Impact");
+ // NOTE: case matters here, this must be 'times new roman', else
+ // some layout tests fail.
+ WebString serif = WebString::fromUTF8("times new roman");
+#endif
+ serifFontFamily = serif;
+ standardFontFamily = serif;
+ fixedFontFamily = WebString::fromUTF8("Courier");
+ sansSerifFontFamily = WebString::fromUTF8("Helvetica");
+
+ defaultFontSize = 16;
+ defaultFixedFontSize = 13;
+ minimumFontSize = 0;
+ minimumLogicalFontSize = 9;
+
+ DOMPasteAllowed = true;
+ XSSAuditorEnabled = false;
+ allowFileAccessFromFileURLs = true;
+ authorAndUserStylesEnabled = true;
+ defaultTextEncodingName = WebString::fromUTF8("ISO-8859-1");
+ developerExtrasEnabled = false;
+ experimentalWebGLEnabled = false;
+ javaEnabled = false;
+ javaScriptCanAccessClipboard = true;
+ javaScriptCanOpenWindowsAutomatically = true;
+ javaScriptEnabled = true;
+ loadsImagesAutomatically = true;
+ localStorageEnabled = true;
+ offlineWebApplicationCacheEnabled = true;
+ pluginsEnabled = true;
+ shrinksStandaloneImagesToFit = false;
+ textAreasAreResizable = false;
+ userStyleSheetLocation = WebURL();
+ usesPageCache = false;
+ webSecurityEnabled = true;
+ caretBrowsingEnabled = false;
+
+ // Allow those layout tests running as local files, i.e. under
+ // LayoutTests/http/tests/local, to access http server.
+ allowUniversalAccessFromFileURLs = true;
+
+#if OS(DARWIN)
+ editingBehavior = WebSettings::EditingBehaviorMac;
+#else
+ editingBehavior = WebSettings::EditingBehaviorWin;
+#endif
+
+ tabsToLinks = false;
+ hyperlinkAuditingEnabled = false;
+ acceleratedCompositingEnabled = false;
+ accelerated2dCanvasEnabled = false;
+}
+
+void WebPreferences::applyTo(WebView* webView)
+{
+ WebSettings* settings = webView->settings();
+ settings->setCursiveFontFamily(cursiveFontFamily);
+ settings->setFantasyFontFamily(fantasyFontFamily);
+ settings->setSerifFontFamily(serifFontFamily);
+ settings->setStandardFontFamily(standardFontFamily);
+ settings->setFixedFontFamily(fixedFontFamily);
+ settings->setSansSerifFontFamily(sansSerifFontFamily);
+
+ settings->setDefaultFontSize(defaultFontSize);
+ settings->setDefaultFixedFontSize(defaultFixedFontSize);
+ settings->setMinimumFontSize(minimumFontSize);
+ settings->setMinimumLogicalFontSize(minimumLogicalFontSize);
+
+ settings->setDOMPasteAllowed(DOMPasteAllowed);
+ settings->setXSSAuditorEnabled(XSSAuditorEnabled);
+ settings->setAllowFileAccessFromFileURLs(allowFileAccessFromFileURLs);
+ settings->setAuthorAndUserStylesEnabled(authorAndUserStylesEnabled);
+ settings->setDefaultTextEncodingName(defaultTextEncodingName);
+ settings->setDeveloperExtrasEnabled(developerExtrasEnabled);
+ settings->setExperimentalWebGLEnabled(experimentalWebGLEnabled);
+ settings->setJavaEnabled(javaEnabled);
+ settings->setJavaScriptCanAccessClipboard(javaScriptCanAccessClipboard);
+ settings->setJavaScriptCanOpenWindowsAutomatically(javaScriptCanOpenWindowsAutomatically);
+ settings->setJavaScriptEnabled(javaScriptEnabled);
+ settings->setLoadsImagesAutomatically(loadsImagesAutomatically);
+ settings->setLocalStorageEnabled(localStorageEnabled);
+ settings->setOfflineWebApplicationCacheEnabled(offlineWebApplicationCacheEnabled);
+ settings->setPluginsEnabled(pluginsEnabled);
+ settings->setShrinksStandaloneImagesToFit(shrinksStandaloneImagesToFit);
+ settings->setTextAreasAreResizable(textAreasAreResizable);
+ settings->setUserStyleSheetLocation(userStyleSheetLocation);
+ settings->setUsesPageCache(usesPageCache);
+ settings->setWebSecurityEnabled(webSecurityEnabled);
+ settings->setAllowUniversalAccessFromFileURLs(allowUniversalAccessFromFileURLs);
+ settings->setEditingBehavior(editingBehavior);
+ settings->setHyperlinkAuditingEnabled(hyperlinkAuditingEnabled);
+ // LayoutTests were written with Safari Mac in mind which does not allow
+ // tabbing to links by default.
+ webView->setTabsToLinks(tabsToLinks);
+ settings->setCaretBrowsingEnabled(caretBrowsingEnabled);
+
+ // Fixed values.
+ settings->setShouldPaintCustomScrollbars(true);
+ settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded();
+ settings->setDownloadableBinaryFontsEnabled(true);
+ settings->setAllowScriptsToCloseWindows(false);
+ settings->setNeedsSiteSpecificQuirks(true);
+ settings->setEditableLinkBehaviorNeverLive();
+ settings->setFontRenderingModeNormal();
+ settings->setTextDirectionSubmenuInclusionBehaviorNeverIncluded();
+ settings->setUsesEncodingDetector(false);
+ settings->setImagesEnabled(true);
+ settings->setAcceleratedCompositingEnabled(acceleratedCompositingEnabled);
+ settings->setAccelerated2dCanvasEnabled(accelerated2dCanvasEnabled);
+}
+
diff --git a/WebKitTools/DumpRenderTree/chromium/WebPreferences.h b/WebKitTools/DumpRenderTree/chromium/WebPreferences.h
new file mode 100644
index 0000000..46877c0
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebPreferences.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebPreferences_h
+#define WebPerferences_h
+
+#include "WebSettings.h"
+#include "WebString.h"
+#include "WebURL.h"
+
+namespace WebKit {
+class WebView;
+}
+
+struct WebPreferences {
+ WebKit::WebString cursiveFontFamily;
+ WebKit::WebString fantasyFontFamily;
+ WebKit::WebString serifFontFamily;
+ WebKit::WebString standardFontFamily;
+ WebKit::WebString fixedFontFamily;
+ WebKit::WebString sansSerifFontFamily;
+
+ int defaultFontSize;
+ int defaultFixedFontSize;
+ int minimumFontSize;
+ int minimumLogicalFontSize;
+
+ bool DOMPasteAllowed;
+ bool XSSAuditorEnabled;
+ bool allowFileAccessFromFileURLs;
+ bool authorAndUserStylesEnabled;
+ WebKit::WebString defaultTextEncodingName;
+ bool developerExtrasEnabled;
+ bool experimentalWebGLEnabled;
+ bool javaEnabled;
+ bool javaScriptCanAccessClipboard;
+ bool javaScriptCanOpenWindowsAutomatically;
+ bool javaScriptEnabled;
+ bool loadsImagesAutomatically;
+ bool localStorageEnabled;
+ bool offlineWebApplicationCacheEnabled;
+ bool pluginsEnabled;
+ bool shrinksStandaloneImagesToFit;
+ bool textAreasAreResizable;
+ WebKit::WebURL userStyleSheetLocation;
+ bool usesPageCache;
+ bool webSecurityEnabled;
+ bool allowUniversalAccessFromFileURLs;
+ WebKit::WebSettings::EditingBehavior editingBehavior;
+ bool tabsToLinks;
+ bool hyperlinkAuditingEnabled;
+ bool caretBrowsingEnabled;
+ bool acceleratedCompositingEnabled;
+ bool accelerated2dCanvasEnabled;
+
+ WebPreferences() { reset(); }
+ void reset();
+ void applyTo(WebKit::WebView*);
+};
+
+#endif // WebPreferences_h
diff --git a/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.cpp b/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.cpp
new file mode 100755
index 0000000..202248a
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.cpp
@@ -0,0 +1,523 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This file implements a simple generic version of the WebThemeEngine,
+// which is used to draw all the native controls on a web page. We use this
+// file when running in layout test mode in order to remove any
+// platform-specific rendering differences due to themes, colors, etc.
+//
+
+#include "config.h"
+#include "WebThemeControlDRT.h"
+
+#include "skia/ext/platform_canvas.h"
+#include "skia/ext/skia_utils_win.h"
+#include "third_party/skia/include/core/SkPaint.h"
+#include "third_party/skia/include/core/SkPath.h"
+#include "third_party/skia/include/core/SkRect.h"
+
+#include <wtf/Assertions.h>
+
+using namespace std;
+using namespace skia;
+
+static const SkColor edgeColor = SK_ColorBLACK;
+static const SkColor readOnlyColor = SkColorSetRGB(0xe9, 0xc2, 0xa6);
+static const SkColor fgColor = SK_ColorBLACK;
+static const SkColor bgColors[] = {
+ SK_ColorBLACK, // Unknown
+ SkColorSetRGB(0xc9, 0xc9, 0xc9), // Disabled
+ SkColorSetRGB(0xf3, 0xe0, 0xd0), // Readonly
+ SkColorSetRGB(0x89, 0xc4, 0xff), // Normal
+ SkColorSetRGB(0x43, 0xf9, 0xff), // Hot
+ SkColorSetRGB(0x20, 0xf6, 0xcc), // Focused
+ SkColorSetRGB(0x00, 0xf3, 0xac), // Hover
+ SkColorSetRGB(0xa9, 0xff, 0x12), // Pressed
+ SkColorSetRGB(0xcc, 0xcc, 0xcc) // Indeterminate
+};
+
+static SkIRect validate(const SkIRect& rect, WebThemeControlDRT::Type ctype)
+{
+ switch (ctype) {
+ case WebThemeControlDRT::UncheckedBoxType:
+ case WebThemeControlDRT::CheckedBoxType:
+ case WebThemeControlDRT::UncheckedRadioType:
+ case WebThemeControlDRT::CheckedRadioType: {
+ SkIRect retval = rect;
+
+ // The maximum width and height is 13.
+ // Center the square in the passed rectangle.
+ const int maxControlSize = 13;
+ int controlSize = min(rect.width(), rect.height());
+ controlSize = min(controlSize, maxControlSize);
+
+ retval.fLeft = rect.fLeft + (rect.width() / 2) - (controlSize / 2);
+ retval.fRight = retval.fLeft + controlSize - 1;
+ retval.fTop = rect.fTop + (rect.height() / 2) - (controlSize / 2);
+ retval.fBottom = retval.fTop + controlSize - 1;
+
+ return retval;
+ }
+
+ default:
+ return rect;
+ }
+}
+
+// WebThemeControlDRT
+
+WebThemeControlDRT::WebThemeControlDRT(PlatformCanvas* canvas,
+ const SkIRect& irect,
+ Type ctype,
+ State cstate)
+ : m_canvas(canvas)
+ , m_irect(validate(irect, ctype))
+ , m_type(ctype)
+ , m_state(cstate)
+ , m_left(m_irect.fLeft)
+ , m_right(m_irect.fRight)
+ , m_top(m_irect.fTop)
+ , m_bottom(m_irect.fBottom)
+ , m_height(m_irect.height())
+ , m_width(m_irect.width())
+ , m_edgeColor(edgeColor)
+ , m_bgColor(bgColors[cstate])
+ , m_fgColor(fgColor)
+{
+}
+
+WebThemeControlDRT::~WebThemeControlDRT()
+{
+}
+
+void WebThemeControlDRT::box(const SkIRect& rect, SkColor fillColor)
+{
+ SkPaint paint;
+
+ paint.setStyle(SkPaint::kFill_Style);
+ paint.setColor(fillColor);
+ m_canvas->drawIRect(rect, paint);
+
+ paint.setColor(m_edgeColor);
+ paint.setStyle(SkPaint::kStroke_Style);
+ m_canvas->drawIRect(rect, paint);
+}
+
+void WebThemeControlDRT::line(int x0, int y0, int x1, int y1, SkColor color)
+{
+ SkPaint paint;
+ paint.setColor(color);
+ m_canvas->drawLine(SkIntToScalar(x0), SkIntToScalar(y0),
+ SkIntToScalar(x1), SkIntToScalar(y1),
+ paint);
+}
+
+void WebThemeControlDRT::triangle(int x0, int y0,
+ int x1, int y1,
+ int x2, int y2,
+ SkColor color)
+{
+ SkPath path;
+ SkPaint paint;
+
+ paint.setColor(color);
+ paint.setStyle(SkPaint::kFill_Style);
+ path.incReserve(4);
+ path.moveTo(SkIntToScalar(x0), SkIntToScalar(y0));
+ path.lineTo(SkIntToScalar(x1), SkIntToScalar(y1));
+ path.lineTo(SkIntToScalar(x2), SkIntToScalar(y2));
+ path.close();
+ m_canvas->drawPath(path, paint);
+
+ paint.setColor(m_edgeColor);
+ paint.setStyle(SkPaint::kStroke_Style);
+ m_canvas->drawPath(path, paint);
+}
+
+void WebThemeControlDRT::roundRect(SkColor color)
+{
+ SkRect rect;
+ SkScalar radius = SkIntToScalar(5);
+ SkPaint paint;
+
+ rect.set(m_irect);
+ paint.setColor(color);
+ paint.setStyle(SkPaint::kFill_Style);
+ m_canvas->drawRoundRect(rect, radius, radius, paint);
+
+ paint.setColor(m_edgeColor);
+ paint.setStyle(SkPaint::kStroke_Style);
+ m_canvas->drawRoundRect(rect, radius, radius, paint);
+}
+
+void WebThemeControlDRT::oval(SkColor color)
+{
+ SkRect rect;
+ SkPaint paint;
+
+ rect.set(m_irect);
+ paint.setColor(color);
+ paint.setStyle(SkPaint::kFill_Style);
+ m_canvas->drawOval(rect, paint);
+
+ paint.setColor(m_edgeColor);
+ paint.setStyle(SkPaint::kStroke_Style);
+ m_canvas->drawOval(rect, paint);
+}
+
+void WebThemeControlDRT::circle(SkScalar radius, SkColor color)
+{
+ SkScalar cy = SkIntToScalar(m_top + m_height / 2);
+ SkScalar cx = SkIntToScalar(m_left + m_width / 2);
+ SkPaint paint;
+
+ paint.setColor(color);
+ paint.setStyle(SkPaint::kFill_Style);
+ m_canvas->drawCircle(cx, cy, radius, paint);
+
+ paint.setColor(m_edgeColor);
+ paint.setStyle(SkPaint::kStroke_Style);
+ m_canvas->drawCircle(cx, cy, radius, paint);
+}
+
+void WebThemeControlDRT::nestedBoxes(int indentLeft,
+ int indentTop,
+ int indentRight,
+ int indentBottom,
+ SkColor outerColor,
+ SkColor innerColor)
+{
+ SkIRect lirect;
+ box(m_irect, outerColor);
+ lirect.set(m_irect.fLeft + indentLeft,
+ m_irect.fTop + indentTop,
+ m_irect.fRight - indentRight,
+ m_irect.fBottom - indentBottom);
+ box(lirect, innerColor);
+}
+
+void WebThemeControlDRT::markState()
+{
+ // The horizontal lines in a read only control are spaced by this amount.
+ const int readOnlyLineOffset = 5;
+
+ // The length of a triangle side for the corner marks.
+ const int triangleSize = 5;
+
+ switch (m_state) {
+ case UnknownState:
+ case DisabledState:
+ case NormalState:
+ // Don't visually mark these states (color is enough).
+ break;
+ case ReadOnlyState:
+ // Drawing lines across the control.
+ for (int i = m_top + readOnlyLineOffset; i < m_bottom; i += readOnlyLineOffset)
+ line(m_left + 1, i, m_right - 1, i, readOnlyColor);
+ break;
+
+ case HotState:
+ // Draw a triangle in the upper left corner of the control.
+ triangle(m_left, m_top,
+ m_left + triangleSize, m_top,
+ m_left, m_top + triangleSize, m_edgeColor);
+ break;
+
+ case HoverState:
+ // Draw a triangle in the upper right corner of the control.
+ triangle(m_right, m_top,
+ m_right, m_top + triangleSize,
+ m_right - triangleSize, m_top, m_edgeColor);
+ break;
+
+ case FocusedState:
+ // Draw a triangle in the bottom right corner of the control.
+ triangle(m_right, m_bottom,
+ m_right - triangleSize, m_bottom,
+ m_right, m_bottom - triangleSize, m_edgeColor);
+ break;
+
+ case PressedState:
+ // Draw a triangle in the bottom left corner of the control.
+ triangle(m_left, m_bottom,
+ m_left, m_bottom - triangleSize,
+ m_left + triangleSize, m_bottom, m_edgeColor);
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ CRASH();
+ break;
+ }
+}
+
+void WebThemeControlDRT::draw()
+{
+ int halfWidth = m_width / 2;
+ int halfHeight = m_height / 2;
+ int quarterWidth = m_width / 4;
+ int quarterHeight = m_height / 4;
+
+ // Indent amounts for the check in a checkbox or radio button.
+ const int checkIndent = 3;
+
+ // Indent amounts for short and long sides of the scrollbar notches.
+ const int notchLongOffset = 1;
+ const int notchShortOffset = 4;
+ const int noOffset = 0;
+
+ // Indent amounts for the short and long sides of a scroll thumb box.
+ const int thumbLongIndent = 0;
+ const int thumbShortIndent = 2;
+
+ // Indents for the crosshatch on a scroll grip.
+ const int gripLongIndent = 3;
+ const int gripShortIndent = 5;
+
+ // Indents for the the slider track.
+ const int sliderIndent = 2;
+
+ m_canvas->beginPlatformPaint();
+
+ switch (m_type) {
+ case UnknownType:
+ ASSERT_NOT_REACHED();
+ CRASH();
+ break;
+
+ case TextFieldType:
+ // We render this by hand outside of this function.
+ ASSERT_NOT_REACHED();
+ CRASH();
+ break;
+
+ case PushButtonType:
+ // push buttons render as a rounded rectangle
+ roundRect(m_bgColor);
+ break;
+
+ case UncheckedBoxType:
+ // Unchecked boxes are simply plain boxes.
+ box(m_irect, m_bgColor);
+ break;
+
+ case CheckedBoxType:
+ nestedBoxes(checkIndent, checkIndent, checkIndent, checkIndent, m_bgColor, m_fgColor);
+ break;
+
+ case IndeterminateCheckboxType:
+ // Indeterminate checkbox is a box containing '-'.
+ nestedBoxes(checkIndent, halfHeight, checkIndent, halfHeight, m_bgColor, m_fgColor);
+ break;
+
+ case UncheckedRadioType:
+ circle(SkIntToScalar(halfHeight), m_bgColor);
+ break;
+
+ case CheckedRadioType:
+ circle(SkIntToScalar(halfHeight), m_bgColor);
+ circle(SkIntToScalar(halfHeight - checkIndent), m_fgColor);
+ break;
+
+ case HorizontalScrollTrackBackType: {
+ // Draw a box with a notch at the left.
+ int longOffset = halfHeight - notchLongOffset;
+ int shortOffset = m_width - notchShortOffset;
+ nestedBoxes(noOffset, longOffset, shortOffset, longOffset, m_bgColor, m_edgeColor);
+ break;
+ }
+
+ case HorizontalScrollTrackForwardType: {
+ // Draw a box with a notch at the right.
+ int longOffset = halfHeight - notchLongOffset;
+ int shortOffset = m_width - notchShortOffset;
+ nestedBoxes(shortOffset, longOffset, noOffset, longOffset, m_bgColor, m_fgColor);
+ break;
+ }
+
+ case VerticalScrollTrackBackType: {
+ // Draw a box with a notch at the top.
+ int longOffset = halfWidth - notchLongOffset;
+ int shortOffset = m_height - notchShortOffset;
+ nestedBoxes(longOffset, noOffset, longOffset, shortOffset, m_bgColor, m_fgColor);
+ break;
+ }
+
+ case VerticalScrollTrackForwardType: {
+ // Draw a box with a notch at the bottom.
+ int longOffset = halfWidth - notchLongOffset;
+ int shortOffset = m_height - notchShortOffset;
+ nestedBoxes(longOffset, shortOffset, longOffset, noOffset, m_bgColor, m_fgColor);
+ break;
+ }
+
+ case HorizontalScrollThumbType:
+ // Draw a narrower box on top of the outside box.
+ nestedBoxes(thumbLongIndent, thumbShortIndent, thumbLongIndent, thumbShortIndent, m_bgColor, m_bgColor);
+ break;
+
+ case VerticalScrollThumbType:
+ // Draw a shorter box on top of the outside box.
+ nestedBoxes(thumbShortIndent, thumbLongIndent, thumbShortIndent, thumbLongIndent, m_bgColor, m_bgColor);
+ break;
+
+ case HorizontalSliderThumbType:
+ // Slider thumbs are ovals.
+ oval(m_bgColor);
+ break;
+
+ case HorizontalScrollGripType: {
+ // Draw a horizontal crosshatch for the grip.
+ int longOffset = halfWidth - gripLongIndent;
+ line(m_left + gripLongIndent, m_top + halfHeight,
+ m_right - gripLongIndent, m_top + halfHeight, m_fgColor);
+ line(m_left + longOffset, m_top + gripShortIndent,
+ m_left + longOffset, m_bottom - gripShortIndent, m_fgColor);
+ line(m_right - longOffset, m_top + gripShortIndent,
+ m_right - longOffset, m_bottom - gripShortIndent, m_fgColor);
+ break;
+ }
+
+ case VerticalScrollGripType: {
+ // Draw a vertical crosshatch for the grip.
+ int longOffset = halfHeight - gripLongIndent;
+ line(m_left + halfWidth, m_top + gripLongIndent,
+ m_left + halfWidth, m_bottom - gripLongIndent, m_fgColor);
+ line(m_left + gripShortIndent, m_top + longOffset,
+ m_right - gripShortIndent, m_top + longOffset, m_fgColor);
+ line(m_left + gripShortIndent, m_bottom - longOffset,
+ m_right - gripShortIndent, m_bottom - longOffset, m_fgColor);
+ break;
+ }
+
+ case LeftArrowType:
+ // Draw a left arrow inside a box.
+ box(m_irect, m_bgColor);
+ triangle(m_right - quarterWidth, m_top + quarterHeight,
+ m_right - quarterWidth, m_bottom - quarterHeight,
+ m_left + quarterWidth, m_top + halfHeight, m_fgColor);
+ break;
+
+ case RightArrowType:
+ // Draw a left arrow inside a box.
+ box(m_irect, m_bgColor);
+ triangle(m_left + quarterWidth, m_top + quarterHeight,
+ m_right - quarterWidth, m_top + halfHeight,
+ m_left + quarterWidth, m_bottom - quarterHeight, m_fgColor);
+ break;
+
+ case UpArrowType:
+ // Draw an up arrow inside a box.
+ box(m_irect, m_bgColor);
+ triangle(m_left + quarterWidth, m_bottom - quarterHeight,
+ m_left + halfWidth, m_top + quarterHeight,
+ m_right - quarterWidth, m_bottom - quarterHeight, m_fgColor);
+ break;
+
+ case DownArrowType:
+ // Draw a down arrow inside a box.
+ box(m_irect, m_bgColor);
+ triangle(m_left + quarterWidth, m_top + quarterHeight,
+ m_right - quarterWidth, m_top + quarterHeight,
+ m_left + halfWidth, m_bottom - quarterHeight, m_fgColor);
+ break;
+
+ case HorizontalSliderTrackType: {
+ // Draw a narrow rect for the track plus box hatches on the ends.
+ SkIRect lirect;
+ lirect = m_irect;
+ lirect.inset(noOffset, halfHeight - sliderIndent);
+ box(lirect, m_bgColor);
+ line(m_left, m_top, m_left, m_bottom, m_edgeColor);
+ line(m_right, m_top, m_right, m_bottom, m_edgeColor);
+ break;
+ }
+
+ case DropDownButtonType:
+ // Draw a box with a big down arrow on top.
+ box(m_irect, m_bgColor);
+ triangle(m_left + quarterWidth, m_top,
+ m_right - quarterWidth, m_top,
+ m_left + halfWidth, m_bottom, m_fgColor);
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ CRASH();
+ break;
+ }
+
+ markState();
+ m_canvas->endPlatformPaint();
+}
+
+// Because rendering a text field is dependent on input
+// parameters the other controls don't have, we render it directly
+// rather than trying to overcomplicate draw() further.
+void WebThemeControlDRT::drawTextField(bool drawEdges, bool fillContentArea, SkColor color)
+{
+ SkPaint paint;
+
+ m_canvas->beginPlatformPaint();
+ if (fillContentArea) {
+ paint.setColor(color);
+ paint.setStyle(SkPaint::kFill_Style);
+ m_canvas->drawIRect(m_irect, paint);
+ }
+ if (drawEdges) {
+ paint.setColor(m_edgeColor);
+ paint.setStyle(SkPaint::kStroke_Style);
+ m_canvas->drawIRect(m_irect, paint);
+ }
+
+ markState();
+ m_canvas->endPlatformPaint();
+}
+
+void WebThemeControlDRT::drawProgressBar(const SkIRect& fillRect)
+{
+ SkPaint paint;
+
+ m_canvas->beginPlatformPaint();
+ paint.setColor(m_bgColor);
+ paint.setStyle(SkPaint::kFill_Style);
+ m_canvas->drawIRect(m_irect, paint);
+
+ // Emulate clipping
+ SkIRect tofill;
+ tofill.intersect(m_irect, fillRect);
+ paint.setColor(m_fgColor);
+ paint.setStyle(SkPaint::kFill_Style);
+ m_canvas->drawIRect(tofill, paint);
+
+ markState();
+ m_canvas->endPlatformPaint();
+}
+
diff --git a/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h b/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h
new file mode 100644
index 0000000..38831d9
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h
@@ -0,0 +1,203 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// WebThemeControlDRT implements the generic rendering of controls
+// needed by WebThemeEngineDRT. See the comments in that class
+// header file for why this class is needed and used.
+//
+// This class implements a generic set of widgets using Skia. The widgets
+// are optimized for testability, not a pleasing appearance.
+//
+
+#ifndef WebThemeControlDRT_h
+#define WebThemeControlDRT_h
+
+#include "skia/ext/platform_canvas.h"
+#include "third_party/skia/include/core/SkColor.h"
+#include <wtf/Noncopyable.h>
+
+// Skia forward declarations
+struct SkIRect;
+
+class WebThemeControlDRT : public Noncopyable {
+public:
+ // This list of states mostly mirrors the list in WebCore/platform/ThemeTypes.h
+ // but is maintained separately since that isn't public and also to minimize
+ // dependencies.
+ // Note that the WebKit ThemeTypes seem to imply that a control can be
+ // in multiple states simultaneously but WebThemeEngine only allows for
+ // a single state at a time.
+ //
+ // Some definitions for the various states:
+ // Disabled - indicates that a control can't be modified or selected
+ // (corresponds to HTML 'disabled' attribute)
+ // ReadOnly - indicates that a control can't be modified but can be
+ // selected
+ // Normal - the normal state of control on the page when it isn't
+ // focused or otherwise active
+ // Hot - when the mouse is hovering over a part of the control,
+ // all the other parts are considered "hot"
+ // Hover - when the mouse is directly over a control (the CSS
+ // :hover pseudo-class)
+ // Focused - when the control has the keyboard focus
+ // Pressed - when the control is being triggered (by a mousedown or
+ // a key event).
+ // Indeterminate - when set to indeterminate (only for progress bar)
+ enum State {
+ UnknownState = 0,
+ DisabledState,
+ ReadOnlyState,
+ NormalState,
+ HotState,
+ HoverState,
+ FocusedState,
+ PressedState,
+ IndeterminateState
+ };
+
+ // This list of types mostly mirrors the list in
+ // WebCore/platform/ThemeTypes.h but is maintained
+ // separately since that isn't public and also to minimize dependencies.
+ //
+ // Note that what the user might think of as a single control can be
+ // made up of multiple parts. For example, a single scroll bar contains
+ // six clickable parts - two arrows, the "thumb" indicating the current
+ // position on the bar, the other two parts of the bar (before and after
+ // the thumb) and the "gripper" on the thumb itself.
+ //
+ enum Type {
+ UnknownType = 0,
+ TextFieldType,
+ PushButtonType,
+ UncheckedBoxType,
+ CheckedBoxType,
+ IndeterminateCheckboxType,
+ UncheckedRadioType,
+ CheckedRadioType,
+ HorizontalScrollTrackBackType,
+ HorizontalScrollTrackForwardType,
+ HorizontalScrollThumbType,
+ HorizontalScrollGripType,
+ VerticalScrollTrackBackType,
+ VerticalScrollTrackForwardType,
+ VerticalScrollThumbType,
+ VerticalScrollGripType,
+ LeftArrowType,
+ RightArrowType,
+ UpArrowType,
+ DownArrowType,
+ HorizontalSliderTrackType,
+ HorizontalSliderThumbType,
+ DropDownButtonType,
+ ProgressBarType
+ };
+
+ // canvas is the canvas to draw onto, and rect gives the size of the
+ // control. ctype and cstate specify the type and state of the control.
+ WebThemeControlDRT(skia::PlatformCanvas* canvas,
+ const SkIRect& rect,
+ Type ctype,
+ State cstate);
+ ~WebThemeControlDRT();
+
+ // Draws the control.
+ void draw();
+
+ // Use this for TextField controls instead, because the logic
+ // for drawing them is dependent on what WebKit tells us to do.
+ // If drawEdges is true, draw an edge around the control. If
+ // fillContentArea is true, fill the content area with the given color.
+ void drawTextField(bool drawEdges, bool fillContentArea, SkColor color);
+
+ // Use this for drawing ProgressBar controls instead, since we
+ // need to know the rect to fill inside the bar.
+ void drawProgressBar(const SkIRect& fillRect);
+
+private:
+ // Draws a box of size specified by irect, filled with the given color.
+ // The box will have a border drawn in the default edge color.
+ void box(const SkIRect& irect, SkColor color);
+
+
+ // Draws a triangle of size specified by the three pairs of coordinates,
+ // filled with the given color. The box will have an edge drawn in the
+ // default edge color.
+ void triangle(int x0, int y0, int x1, int y1, int x2, int y2, SkColor color);
+
+ // Draws a rectangle the size of the control with rounded corners, filled
+ // with the specified color (and with a border in the default edge color).
+ void roundRect(SkColor color);
+
+ // Draws an oval the size of the control, filled with the specified color
+ // and with a border in the default edge color.
+ void oval(SkColor color);
+
+ // Draws a circle centered in the control with the specified radius,
+ // filled with the specified color, and with a border draw in the
+ // default edge color.
+ void circle(SkScalar radius, SkColor color);
+
+ // Draws a box the size of the control, filled with the outerColor and
+ // with a border in the default edge color, and then draws another box
+ // indented on all four sides by the specified amounts, filled with the
+ // inner color and with a border in the default edge color.
+ void nestedBoxes(int indentLeft,
+ int indentTop,
+ int indentRight,
+ int indentBottom,
+ SkColor outerColor,
+ SkColor innerColor);
+
+ // Draws a line between the two points in the given color.
+ void line(int x0, int y0, int x1, int y1, SkColor color);
+
+ // Draws a distinctive mark on the control for each state, so that the
+ // state of the control can be determined without needing to know which
+ // color is which.
+ void markState();
+
+ skia::PlatformCanvas* m_canvas;
+ const SkIRect m_irect;
+ const Type m_type;
+ const State m_state;
+ const SkColor m_edgeColor;
+ const SkColor m_bgColor;
+ const SkColor m_fgColor;
+
+ // The following are convenience accessors for m_irect.
+ const int m_left;
+ const int m_right;
+ const int m_top;
+ const int m_bottom;
+ const int m_width;
+ const int m_height;
+};
+
+#endif // WebThemeControlDRT_h
diff --git a/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.cpp b/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.cpp
new file mode 100755
index 0000000..6a8af81
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.cpp
@@ -0,0 +1,758 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebThemeEngineDRT.h"
+
+#include "WebRect.h"
+#include "WebThemeControlDRT.h"
+#include "third_party/skia/include/core/SkRect.h"
+
+// Although all this code is generic, we include these headers
+// to pull in the Windows #defines for the parts and states of
+// the controls.
+#include <vsstyle.h>
+#include <windows.h>
+
+#include <wtf/Assertions.h>
+
+using namespace WebKit;
+
+// We define this for clarity, although there really should be a DFCS_NORMAL in winuser.h.
+static const int dfcsNormal = 0x0000;
+
+static SkIRect webRectToSkIRect(const WebRect& webRect)
+{
+ SkIRect irect;
+ irect.set(webRect.x, webRect.y, webRect.x + webRect.width, webRect.y + webRect.height);
+ return irect;
+}
+
+static void drawControl(WebCanvas* canvas,
+ const WebRect& rect,
+ WebThemeControlDRT::Type ctype,
+ WebThemeControlDRT::State cstate)
+{
+ WebThemeControlDRT control(canvas, webRectToSkIRect(rect), ctype, cstate);
+ control.draw();
+}
+
+static void drawTextField(WebCanvas* canvas,
+ const WebRect& rect,
+ WebThemeControlDRT::Type ctype,
+ WebThemeControlDRT::State cstate,
+ bool drawEdges,
+ bool fillContentArea,
+ WebColor color)
+{
+ WebThemeControlDRT control(canvas, webRectToSkIRect(rect), ctype, cstate);
+ control.drawTextField(drawEdges, fillContentArea, color);
+}
+
+static void drawProgressBar(WebCanvas* canvas,
+ WebThemeControlDRT::Type ctype,
+ WebThemeControlDRT::State cstate,
+ const WebRect& barRect,
+ const WebRect& fillRect)
+{
+ WebThemeControlDRT control(canvas, webRectToSkIRect(barRect), ctype, cstate);
+ control.drawProgressBar(webRectToSkIRect(fillRect));
+}
+
+// WebThemeEngineDRT
+
+void WebThemeEngineDRT::paintButton(WebCanvas* canvas,
+ int part,
+ int state,
+ int classicState,
+ const WebRect& rect)
+{
+ WebThemeControlDRT::Type ctype = WebThemeControlDRT::UnknownType;
+ WebThemeControlDRT::State cstate = WebThemeControlDRT::UnknownState;
+
+ if (part == BP_CHECKBOX) {
+ switch (state) {
+ case CBS_UNCHECKEDNORMAL:
+ ASSERT(classicState == dfcsNormal);
+ ctype = WebThemeControlDRT::UncheckedBoxType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case CBS_UNCHECKEDHOT:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_HOT));
+ ctype = WebThemeControlDRT::UncheckedBoxType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case CBS_UNCHECKEDPRESSED:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_PUSHED));
+ ctype = WebThemeControlDRT::UncheckedBoxType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case CBS_UNCHECKEDDISABLED:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::UncheckedBoxType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ case CBS_CHECKEDNORMAL:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_CHECKED));
+ ctype = WebThemeControlDRT::CheckedBoxType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case CBS_CHECKEDHOT:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_HOT));
+ ctype = WebThemeControlDRT::CheckedBoxType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case CBS_CHECKEDPRESSED:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_PUSHED));
+ ctype = WebThemeControlDRT::CheckedBoxType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case CBS_CHECKEDDISABLED:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::CheckedBoxType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ case CBS_MIXEDNORMAL:
+ // Classic theme can't represent mixed state checkbox. We assume
+ // it's equivalent to unchecked.
+ ASSERT(classicState == DFCS_BUTTONCHECK);
+ ctype = WebThemeControlDRT::IndeterminateCheckboxType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case CBS_MIXEDHOT:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_HOT));
+ ctype = WebThemeControlDRT::IndeterminateCheckboxType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case CBS_MIXEDPRESSED:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_PUSHED));
+ ctype = WebThemeControlDRT::IndeterminateCheckboxType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case CBS_MIXEDDISABLED:
+ ASSERT(classicState == (DFCS_BUTTONCHECK | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::IndeterminateCheckboxType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ } else if (BP_RADIOBUTTON == part) {
+ switch (state) {
+ case RBS_UNCHECKEDNORMAL:
+ ASSERT(classicState == DFCS_BUTTONRADIO);
+ ctype = WebThemeControlDRT::UncheckedRadioType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case RBS_UNCHECKEDHOT:
+ ASSERT(classicState == (DFCS_BUTTONRADIO | DFCS_HOT));
+ ctype = WebThemeControlDRT::UncheckedRadioType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case RBS_UNCHECKEDPRESSED:
+ ASSERT(classicState == (DFCS_BUTTONRADIO | DFCS_PUSHED));
+ ctype = WebThemeControlDRT::UncheckedRadioType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case RBS_UNCHECKEDDISABLED:
+ ASSERT(classicState == (DFCS_BUTTONRADIO | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::UncheckedRadioType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ case RBS_CHECKEDNORMAL:
+ ASSERT(classicState == (DFCS_BUTTONRADIO | DFCS_CHECKED));
+ ctype = WebThemeControlDRT::CheckedRadioType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case RBS_CHECKEDHOT:
+ ASSERT(classicState == (DFCS_BUTTONRADIO | DFCS_CHECKED | DFCS_HOT));
+ ctype = WebThemeControlDRT::CheckedRadioType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case RBS_CHECKEDPRESSED:
+ ASSERT(classicState == (DFCS_BUTTONRADIO | DFCS_CHECKED | DFCS_PUSHED));
+ ctype = WebThemeControlDRT::CheckedRadioType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case RBS_CHECKEDDISABLED:
+ ASSERT(classicState == (DFCS_BUTTONRADIO | DFCS_CHECKED | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::CheckedRadioType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ } else if (BP_PUSHBUTTON == part) {
+ switch (state) {
+ case PBS_NORMAL:
+ ASSERT(classicState == DFCS_BUTTONPUSH);
+ ctype = WebThemeControlDRT::PushButtonType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case PBS_HOT:
+ ASSERT(classicState == (DFCS_BUTTONPUSH | DFCS_HOT));
+ ctype = WebThemeControlDRT::PushButtonType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case PBS_PRESSED:
+ ASSERT(classicState == (DFCS_BUTTONPUSH | DFCS_PUSHED));
+ ctype = WebThemeControlDRT::PushButtonType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case PBS_DISABLED:
+ ASSERT(classicState == (DFCS_BUTTONPUSH | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::PushButtonType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ case PBS_DEFAULTED:
+ ASSERT(classicState == DFCS_BUTTONPUSH);
+ ctype = WebThemeControlDRT::PushButtonType;
+ cstate = WebThemeControlDRT::FocusedState;
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ } else {
+ ASSERT_NOT_REACHED();
+ }
+
+ drawControl(canvas, rect, ctype, cstate);
+}
+
+
+void WebThemeEngineDRT::paintMenuList(WebCanvas* canvas,
+ int part,
+ int state,
+ int classicState,
+ const WebRect& rect)
+{
+ WebThemeControlDRT::Type ctype = WebThemeControlDRT::UnknownType;
+ WebThemeControlDRT::State cstate = WebThemeControlDRT::UnknownState;
+
+ if (CP_DROPDOWNBUTTON == part) {
+ ctype = WebThemeControlDRT::DropDownButtonType;
+ switch (state) {
+ case CBXS_NORMAL:
+ ASSERT(classicState == DFCS_MENUARROW);
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case CBXS_HOT:
+ ASSERT(classicState == (DFCS_MENUARROW | DFCS_HOT));
+ cstate = WebThemeControlDRT::HoverState;
+ break;
+
+ case CBXS_PRESSED:
+ ASSERT(classicState == (DFCS_MENUARROW | DFCS_PUSHED));
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case CBXS_DISABLED:
+ ASSERT(classicState == (DFCS_MENUARROW | DFCS_INACTIVE));
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ default:
+ CRASH();
+ break;
+ }
+ } else {
+ CRASH();
+ }
+
+ drawControl(canvas, rect, ctype, cstate);
+}
+
+void WebThemeEngineDRT::paintScrollbarArrow(WebCanvas* canvas,
+ int state,
+ int classicState,
+ const WebRect& rect)
+{
+ WebThemeControlDRT::Type ctype = WebThemeControlDRT::UnknownType;
+ WebThemeControlDRT::State cstate = WebThemeControlDRT::UnknownState;
+
+ switch (state) {
+ case ABS_UPNORMAL:
+ ASSERT(classicState == DFCS_SCROLLUP);
+ ctype = WebThemeControlDRT::UpArrowType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case ABS_DOWNNORMAL:
+ ASSERT(classicState == DFCS_SCROLLDOWN);
+ ctype = WebThemeControlDRT::DownArrowType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case ABS_LEFTNORMAL:
+ ASSERT(classicState == DFCS_SCROLLLEFT);
+ ctype = WebThemeControlDRT::LeftArrowType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case ABS_RIGHTNORMAL:
+ ASSERT(classicState == DFCS_SCROLLRIGHT);
+ ctype = WebThemeControlDRT::RightArrowType;
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case ABS_UPHOT:
+ ASSERT(classicState == (DFCS_SCROLLUP | DFCS_HOT));
+ ctype = WebThemeControlDRT::UpArrowType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case ABS_DOWNHOT:
+ ASSERT(classicState == (DFCS_SCROLLDOWN | DFCS_HOT));
+ ctype = WebThemeControlDRT::DownArrowType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case ABS_LEFTHOT:
+ ASSERT(classicState == (DFCS_SCROLLLEFT | DFCS_HOT));
+ ctype = WebThemeControlDRT::LeftArrowType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case ABS_RIGHTHOT:
+ ASSERT(classicState == (DFCS_SCROLLRIGHT | DFCS_HOT));
+ ctype = WebThemeControlDRT::RightArrowType;
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case ABS_UPHOVER:
+ ASSERT(classicState == DFCS_SCROLLUP);
+ ctype = WebThemeControlDRT::UpArrowType;
+ cstate = WebThemeControlDRT::HoverState;
+ break;
+
+ case ABS_DOWNHOVER:
+ ASSERT(classicState == DFCS_SCROLLDOWN);
+ ctype = WebThemeControlDRT::DownArrowType;
+ cstate = WebThemeControlDRT::HoverState;
+ break;
+
+ case ABS_LEFTHOVER:
+ ASSERT(classicState == DFCS_SCROLLLEFT);
+ ctype = WebThemeControlDRT::LeftArrowType;
+ cstate = WebThemeControlDRT::HoverState;
+ break;
+
+ case ABS_RIGHTHOVER:
+ ASSERT(classicState == DFCS_SCROLLRIGHT);
+ ctype = WebThemeControlDRT::RightArrowType;
+ cstate = WebThemeControlDRT::HoverState;
+ break;
+
+ case ABS_UPPRESSED:
+ ASSERT(classicState == (DFCS_SCROLLUP | DFCS_PUSHED | DFCS_FLAT));
+ ctype = WebThemeControlDRT::UpArrowType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case ABS_DOWNPRESSED:
+ ASSERT(classicState == (DFCS_SCROLLDOWN | DFCS_PUSHED | DFCS_FLAT));
+ ctype = WebThemeControlDRT::DownArrowType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case ABS_LEFTPRESSED:
+ ASSERT(classicState == (DFCS_SCROLLLEFT | DFCS_PUSHED | DFCS_FLAT));
+ ctype = WebThemeControlDRT::LeftArrowType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case ABS_RIGHTPRESSED:
+ ASSERT(classicState == (DFCS_SCROLLRIGHT | DFCS_PUSHED | DFCS_FLAT));
+ ctype = WebThemeControlDRT::RightArrowType;
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case ABS_UPDISABLED:
+ ASSERT(classicState == (DFCS_SCROLLUP | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::UpArrowType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ case ABS_DOWNDISABLED:
+ ASSERT(classicState == (DFCS_SCROLLDOWN | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::DownArrowType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ case ABS_LEFTDISABLED:
+ ASSERT(classicState == (DFCS_SCROLLLEFT | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::LeftArrowType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ case ABS_RIGHTDISABLED:
+ ASSERT(classicState == (DFCS_SCROLLRIGHT | DFCS_INACTIVE));
+ ctype = WebThemeControlDRT::RightArrowType;
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ drawControl(canvas, rect, ctype, cstate);
+}
+
+void WebThemeEngineDRT::paintScrollbarThumb(WebCanvas* canvas,
+ int part,
+ int state,
+ int classicState,
+ const WebRect& rect)
+{
+ WebThemeControlDRT::Type ctype = WebThemeControlDRT::UnknownType;
+ WebThemeControlDRT::State cstate = WebThemeControlDRT::UnknownState;
+
+ switch (part) {
+ case SBP_THUMBBTNHORZ:
+ ctype = WebThemeControlDRT::HorizontalScrollThumbType;
+ break;
+
+ case SBP_THUMBBTNVERT:
+ ctype = WebThemeControlDRT::VerticalScrollThumbType;
+ break;
+
+ case SBP_GRIPPERHORZ:
+ ctype = WebThemeControlDRT::HorizontalScrollGripType;
+ break;
+
+ case SBP_GRIPPERVERT:
+ ctype = WebThemeControlDRT::VerticalScrollGripType;
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ switch (state) {
+ case SCRBS_NORMAL:
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case SCRBS_HOT:
+ ASSERT(classicState == DFCS_HOT);
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case SCRBS_HOVER:
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::HoverState;
+ break;
+
+ case SCRBS_PRESSED:
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case SCRBS_DISABLED:
+ ASSERT_NOT_REACHED(); // This should never happen in practice.
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ drawControl(canvas, rect, ctype, cstate);
+}
+
+void WebThemeEngineDRT::paintScrollbarTrack(WebCanvas* canvas,
+ int part,
+ int state,
+ int classicState,
+ const WebRect& rect,
+ const WebRect& alignRect)
+{
+ WebThemeControlDRT::Type ctype = WebThemeControlDRT::UnknownType;
+ WebThemeControlDRT::State cstate = WebThemeControlDRT::UnknownState;
+
+ switch (part) {
+ case SBP_UPPERTRACKHORZ:
+ ctype = WebThemeControlDRT::HorizontalScrollTrackBackType;
+ break;
+
+ case SBP_LOWERTRACKHORZ:
+ ctype = WebThemeControlDRT::HorizontalScrollTrackForwardType;
+ break;
+
+ case SBP_UPPERTRACKVERT:
+ ctype = WebThemeControlDRT::VerticalScrollTrackBackType;
+ break;
+
+ case SBP_LOWERTRACKVERT:
+ ctype = WebThemeControlDRT::VerticalScrollTrackForwardType;
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ switch (state) {
+ case SCRBS_NORMAL:
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case SCRBS_HOT:
+ ASSERT_NOT_REACHED(); // This should never happen in practice.
+ break;
+
+ case SCRBS_HOVER:
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::HoverState;
+ break;
+
+ case SCRBS_PRESSED:
+ ASSERT_NOT_REACHED(); // This should never happen in practice.
+ break;
+
+ case SCRBS_DISABLED:
+ ASSERT(classicState == DFCS_INACTIVE);
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ default:
+ CRASH();
+ break;
+ }
+
+ drawControl(canvas, rect, ctype, cstate);
+}
+
+void WebThemeEngineDRT::paintSpinButton(WebCanvas* canvas,
+ int part,
+ int state,
+ int classicState,
+ const WebRect& rect)
+{
+ WebThemeControlDRT::Type ctype = WebThemeControlDRT::UnknownType;
+ WebThemeControlDRT::State cstate = WebThemeControlDRT::UnknownState;
+
+ if (part == SPNP_UP) {
+ ctype = WebThemeControlDRT::UpArrowType;
+ switch (state) {
+ case UPS_NORMAL:
+ ASSERT(classicState == DFCS_SCROLLUP);
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+ case UPS_DISABLED:
+ ASSERT(classicState == (DFCS_SCROLLUP | DFCS_INACTIVE));
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+ case UPS_PRESSED:
+ ASSERT(classicState == (DFCS_SCROLLUP | DFCS_PUSHED));
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+ case UPS_HOT:
+ ASSERT(classicState == (DFCS_SCROLLUP | DFCS_HOT));
+ cstate = WebThemeControlDRT::HoverState;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ } else if (part == SPNP_DOWN) {
+ ctype = WebThemeControlDRT::DownArrowType;
+ switch (state) {
+ case DNS_NORMAL:
+ ASSERT(classicState == DFCS_SCROLLDOWN);
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+ case DNS_DISABLED:
+ ASSERT(classicState == (DFCS_SCROLLDOWN | DFCS_INACTIVE));
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+ case DNS_PRESSED:
+ ASSERT(classicState == (DFCS_SCROLLDOWN | DFCS_PUSHED));
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+ case DNS_HOT:
+ ASSERT(classicState == (DFCS_SCROLLDOWN | DFCS_HOT));
+ cstate = WebThemeControlDRT::HoverState;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ } else
+ ASSERT_NOT_REACHED();
+ drawControl(canvas, rect, ctype, cstate);
+}
+
+void WebThemeEngineDRT::paintTextField(WebCanvas* canvas,
+ int part,
+ int state,
+ int classicState,
+ const WebRect& rect,
+ WebColor color,
+ bool fillContentArea,
+ bool drawEdges)
+{
+ WebThemeControlDRT::Type ctype = WebThemeControlDRT::UnknownType;
+ WebThemeControlDRT::State cstate = WebThemeControlDRT::UnknownState;
+
+ ASSERT(EP_EDITTEXT == part);
+ ctype = WebThemeControlDRT::TextFieldType;
+
+ switch (state) {
+ case ETS_NORMAL:
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case ETS_HOT:
+ ASSERT(classicState == DFCS_HOT);
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case ETS_DISABLED:
+ ASSERT(classicState == DFCS_INACTIVE);
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ case ETS_SELECTED:
+ ASSERT(classicState == DFCS_PUSHED);
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ case ETS_FOCUSED:
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::FocusedState;
+ break;
+
+ case ETS_READONLY:
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::ReadOnlyState;
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+
+ drawTextField(canvas, rect, ctype, cstate, drawEdges, fillContentArea, color);
+}
+
+void WebThemeEngineDRT::paintTrackbar(WebCanvas* canvas,
+ int part,
+ int state,
+ int classicState,
+ const WebRect& rect)
+{
+ WebThemeControlDRT::Type ctype = WebThemeControlDRT::UnknownType;
+ WebThemeControlDRT::State cstate = WebThemeControlDRT::UnknownState;
+
+ if (TKP_THUMBBOTTOM == part) {
+ ctype = WebThemeControlDRT::HorizontalSliderThumbType;
+ switch (state) {
+ case TUS_NORMAL:
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::NormalState;
+ break;
+
+ case TUS_HOT:
+ ASSERT(classicState == DFCS_HOT);
+ cstate = WebThemeControlDRT::HotState;
+ break;
+
+ case TUS_DISABLED:
+ ASSERT(classicState == DFCS_INACTIVE);
+ cstate = WebThemeControlDRT::DisabledState;
+ break;
+
+ case TUS_PRESSED:
+ ASSERT(classicState == DFCS_PUSHED);
+ cstate = WebThemeControlDRT::PressedState;
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ } else if (TKP_TRACK == part) {
+ ctype = WebThemeControlDRT::HorizontalSliderTrackType;
+ ASSERT(part == TUS_NORMAL);
+ ASSERT(classicState == dfcsNormal);
+ cstate = WebThemeControlDRT::NormalState;
+ } else {
+ ASSERT_NOT_REACHED();
+ }
+
+ drawControl(canvas, rect, ctype, cstate);
+}
+
+
+void WebThemeEngineDRT::paintProgressBar(WebKit::WebCanvas* canvas,
+ const WebKit::WebRect& barRect,
+ const WebKit::WebRect& valueRect,
+ bool determinate,
+ double)
+{
+ WebThemeControlDRT::Type ctype = WebThemeControlDRT::ProgressBarType;
+ WebThemeControlDRT::State cstate = determinate ? WebThemeControlDRT::NormalState
+ : WebThemeControlDRT::IndeterminateState;
+ drawProgressBar(canvas, ctype, cstate, barRect, valueRect);
+}
+
diff --git a/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h b/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h
new file mode 100644
index 0000000..e50886b
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// This implements the WebThemeEngine API used by the Windows version of
+// Chromium to render native form controls like checkboxes, radio buttons,
+// and scroll bars.
+// The normal implementation (native_theme) renders the controls using either
+// the UXTheme theming engine present in XP, Vista, and Win 7, or the "classic"
+// theme used if that theme is selected in the Desktop settings.
+// Unfortunately, both of these themes render controls differently on the
+// different versions of Windows.
+//
+// In order to ensure maximum consistency of baselines across the different
+// Windows versions, we provide a simple implementation for DRT here
+// instead. These controls are actually platform-independent (they're rendered
+// using Skia) and could be used on Linux and the Mac as well, should we
+// choose to do so at some point.
+//
+
+#ifndef WebThemeEngineDRT_h
+#define WebThemeEngineDRT_h
+
+#include "win/WebThemeEngine.h"
+#include <wtf/Noncopyable.h>
+
+class WebThemeEngineDRT : public WebKit::WebThemeEngine, public Noncopyable {
+public:
+ WebThemeEngineDRT() {}
+
+ // WebThemeEngine methods:
+ virtual void paintButton(
+ WebKit::WebCanvas*, int part, int state, int classicState,
+ const WebKit::WebRect&);
+
+ virtual void paintMenuList(
+ WebKit::WebCanvas*, int part, int state, int classicState,
+ const WebKit::WebRect&);
+
+ virtual void paintScrollbarArrow(
+ WebKit::WebCanvas*, int state, int classicState,
+ const WebKit::WebRect&);
+
+ virtual void paintScrollbarThumb(
+ WebKit::WebCanvas*, int part, int state, int classicState,
+ const WebKit::WebRect&);
+
+ virtual void paintScrollbarTrack(
+ WebKit::WebCanvas*, int part, int state, int classicState,
+ const WebKit::WebRect&, const WebKit::WebRect& alignRect);
+
+ virtual void paintSpinButton(
+ WebKit::WebCanvas*, int part, int state, int classicState,
+ const WebKit::WebRect&);
+
+ virtual void paintTextField(
+ WebKit::WebCanvas*, int part, int state, int classicState,
+ const WebKit::WebRect&, WebKit::WebColor, bool fillContentArea,
+ bool drawEdges);
+
+ virtual void paintTrackbar(
+ WebKit::WebCanvas*, int part, int state, int classicState,
+ const WebKit::WebRect&);
+
+ virtual void paintProgressBar(
+ WebKit::WebCanvas*, const WebKit::WebRect& barRect,
+ const WebKit::WebRect& valueRect,
+ bool determinate, double time);
+};
+
+#endif // WebThemeEngineDRT_h
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
new file mode 100644
index 0000000..87fbaca
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -0,0 +1,1500 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebViewHost.h"
+
+#include "LayoutTestController.h"
+#include "TestNavigationController.h"
+#include "TestShell.h"
+#include "TestWebWorker.h"
+#include "WebCString.h"
+#include "WebConsoleMessage.h"
+#include "WebContextMenuData.h"
+#include "WebDataSource.h"
+#include "WebDeviceOrientationClientMock.h"
+#include "WebDragData.h"
+#include "WebElement.h"
+#include "WebFrame.h"
+#include "WebGeolocationServiceMock.h"
+#include "WebHistoryItem.h"
+#include "WebNode.h"
+#include "WebRange.h"
+#include "WebRect.h"
+#include "WebScreenInfo.h"
+#include "WebSize.h"
+#include "WebSpeechInputControllerMock.h"
+#include "WebStorageNamespace.h"
+#include "WebURLRequest.h"
+#include "WebURLResponse.h"
+#include "WebView.h"
+#include "WebWindowFeatures.h"
+#include "skia/ext/platform_canvas.h"
+#include "webkit/support/webkit_support.h"
+#include <wtf/Assertions.h>
+#include <wtf/PassOwnPtr.h>
+
+using namespace WebCore;
+using namespace WebKit;
+using namespace skia;
+using namespace std;
+
+static const int screenWidth = 1920;
+static const int screenHeight = 1080;
+static const int screenUnavailableBorder = 8;
+
+// WebNavigationType debugging strings taken from PolicyDelegate.mm.
+static const char* linkClickedString = "link clicked";
+static const char* formSubmittedString = "form submitted";
+static const char* backForwardString = "back/forward";
+static const char* reloadString = "reload";
+static const char* formResubmittedString = "form resubmitted";
+static const char* otherString = "other";
+static const char* illegalString = "illegal value";
+
+static int nextPageID = 1;
+
+// Used to write a platform neutral file:/// URL by only taking the filename
+// (e.g., converts "file:///tmp/foo.txt" to just "foo.txt").
+static string urlSuitableForTestResult(const string& url)
+{
+ if (url.empty() || string::npos == url.find("file://"))
+ return url;
+
+ size_t pos = url.rfind('/');
+ if (pos == string::npos) {
+#if OS(WINDOWS)
+ pos = url.rfind('\\');
+ if (pos == string::npos)
+ pos = 0;
+#else
+ pos = 0;
+#endif
+ }
+ string filename = url.substr(pos + 1);
+ if (filename.empty())
+ return "file:"; // A WebKit test has this in its expected output.
+ return filename;
+}
+
+// Used to write a platform neutral file:/// URL by taking the
+// filename and its directory. (e.g., converts
+// "file:///tmp/foo/bar.txt" to just "bar.txt").
+static string descriptionSuitableForTestResult(const string& url)
+{
+ if (url.empty() || string::npos == url.find("file://"))
+ return url;
+
+ size_t pos = url.rfind('/');
+ if (pos == string::npos || !pos)
+ return "ERROR:" + url;
+ pos = url.rfind('/', pos - 1);
+ if (pos == string::npos)
+ return "ERROR:" + url;
+
+ return url.substr(pos + 1);
+}
+
+// Adds a file called "DRTFakeFile" to |data_object| (CF_HDROP). Use to fake
+// dragging a file.
+static void addDRTFakeFileToDataObject(WebDragData* dragData)
+{
+ dragData->appendToFilenames(WebString::fromUTF8("DRTFakeFile"));
+}
+
+// Get a debugging string from a WebNavigationType.
+static const char* webNavigationTypeToString(WebNavigationType type)
+{
+ switch (type) {
+ case WebKit::WebNavigationTypeLinkClicked:
+ return linkClickedString;
+ case WebKit::WebNavigationTypeFormSubmitted:
+ return formSubmittedString;
+ case WebKit::WebNavigationTypeBackForward:
+ return backForwardString;
+ case WebKit::WebNavigationTypeReload:
+ return reloadString;
+ case WebKit::WebNavigationTypeFormResubmitted:
+ return formResubmittedString;
+ case WebKit::WebNavigationTypeOther:
+ return otherString;
+ }
+ return illegalString;
+}
+
+static string URLDescription(const GURL& url)
+{
+ if (url.SchemeIs("file"))
+ return url.ExtractFileName();
+ return url.possibly_invalid_spec();
+}
+
+static void printResponseDescription(const WebURLResponse& response)
+{
+ if (response.isNull()) {
+ fputs("(null)", stdout);
+ return;
+ }
+ string url = response.url().spec();
+ printf("<NSURLResponse %s, http status code %d>",
+ descriptionSuitableForTestResult(url).c_str(),
+ response.httpStatusCode());
+}
+
+static void printNodeDescription(const WebNode& node, int exception)
+{
+ if (exception) {
+ fputs("ERROR", stdout);
+ return;
+ }
+ if (node.isNull()) {
+ fputs("(null)", stdout);
+ return;
+ }
+ fputs(node.nodeName().utf8().data(), stdout);
+ const WebNode& parent = node.parentNode();
+ if (!parent.isNull()) {
+ fputs(" > ", stdout);
+ printNodeDescription(parent, 0);
+ }
+}
+
+static void printRangeDescription(const WebRange& range)
+{
+ if (range.isNull()) {
+ fputs("(null)", stdout);
+ return;
+ }
+ printf("range from %d of ", range.startOffset());
+ int exception = 0;
+ WebNode startNode = range.startContainer(exception);
+ printNodeDescription(startNode, exception);
+ printf(" to %d of ", range.endOffset());
+ WebNode endNode = range.endContainer(exception);
+ printNodeDescription(endNode, exception);
+}
+
+static string editingActionDescription(WebEditingAction action)
+{
+ switch (action) {
+ case WebKit::WebEditingActionTyped:
+ return "WebViewInsertActionTyped";
+ case WebKit::WebEditingActionPasted:
+ return "WebViewInsertActionPasted";
+ case WebKit::WebEditingActionDropped:
+ return "WebViewInsertActionDropped";
+ }
+ return "(UNKNOWN ACTION)";
+}
+
+static string textAffinityDescription(WebTextAffinity affinity)
+{
+ switch (affinity) {
+ case WebKit::WebTextAffinityUpstream:
+ return "NSSelectionAffinityUpstream";
+ case WebKit::WebTextAffinityDownstream:
+ return "NSSelectionAffinityDownstream";
+ }
+ return "(UNKNOWN AFFINITY)";
+}
+
+// WebViewClient -------------------------------------------------------------
+
+WebView* WebViewHost::createView(WebFrame*, const WebWindowFeatures&, const WebString&)
+{
+ if (!layoutTestController()->canOpenWindows())
+ return 0;
+ return m_shell->createWebView()->webView();
+}
+
+WebWidget* WebViewHost::createPopupMenu(WebPopupType)
+{
+ return 0;
+}
+
+WebWidget* WebViewHost::createPopupMenu(const WebPopupMenuInfo&)
+{
+ return 0;
+}
+
+WebStorageNamespace* WebViewHost::createSessionStorageNamespace(unsigned quota)
+{
+ return WebKit::WebStorageNamespace::createSessionStorageNamespace(quota);
+}
+
+void WebViewHost::didAddMessageToConsole(const WebConsoleMessage& message, const WebString& sourceName, unsigned sourceLine)
+{
+ // This matches win DumpRenderTree's UIDelegate.cpp.
+ string newMessage;
+ if (!message.text.isEmpty()) {
+ newMessage = message.text.utf8();
+ size_t fileProtocol = newMessage.find("file://");
+ if (fileProtocol != string::npos) {
+ newMessage = newMessage.substr(0, fileProtocol)
+ + urlSuitableForTestResult(newMessage.substr(fileProtocol));
+ }
+ }
+ printf("CONSOLE MESSAGE: line %d: %s\n", sourceLine, newMessage.data());
+}
+
+void WebViewHost::didStartLoading()
+{
+ m_shell->setIsLoading(true);
+}
+
+void WebViewHost::didStopLoading()
+{
+ m_shell->setIsLoading(false);
+}
+
+// The output from these methods in layout test mode should match that
+// expected by the layout tests. See EditingDelegate.m in DumpRenderTree.
+
+bool WebViewHost::shouldBeginEditing(const WebRange& range)
+{
+ if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ fputs("EDITING DELEGATE: shouldBeginEditingInDOMRange:", stdout);
+ printRangeDescription(range);
+ fputs("\n", stdout);
+ }
+ return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldEndEditing(const WebRange& range)
+{
+ if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ fputs("EDITING DELEGATE: shouldEndEditingInDOMRange:", stdout);
+ printRangeDescription(range);
+ fputs("\n", stdout);
+ }
+ return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldInsertNode(const WebNode& node, const WebRange& range, WebEditingAction action)
+{
+ if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ fputs("EDITING DELEGATE: shouldInsertNode:", stdout);
+ printNodeDescription(node, 0);
+ fputs(" replacingDOMRange:", stdout);
+ printRangeDescription(range);
+ printf(" givenAction:%s\n", editingActionDescription(action).c_str());
+ }
+ return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldInsertText(const WebString& text, const WebRange& range, WebEditingAction action)
+{
+ if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:", text.utf8().data());
+ printRangeDescription(range);
+ printf(" givenAction:%s\n", editingActionDescription(action).c_str());
+ }
+ return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldChangeSelectedRange(
+ const WebRange& fromRange, const WebRange& toRange, WebTextAffinity affinity, bool stillSelecting)
+{
+ if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ fputs("EDITING DELEGATE: shouldChangeSelectedDOMRange:", stdout);
+ printRangeDescription(fromRange);
+ fputs(" toDOMRange:", stdout);
+ printRangeDescription(toRange);
+ printf(" affinity:%s stillSelecting:%s\n",
+ textAffinityDescription(affinity).c_str(),
+ (stillSelecting ? "TRUE" : "FALSE"));
+ }
+ return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldDeleteRange(const WebRange& range)
+{
+ if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ fputs("EDITING DELEGATE: shouldDeleteDOMRange:", stdout);
+ printRangeDescription(range);
+ fputs("\n", stdout);
+ }
+ return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::shouldApplyStyle(const WebString& style, const WebRange& range)
+{
+ if (layoutTestController()->shouldDumpEditingCallbacks()) {
+ printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:", style.utf8().data());
+ printRangeDescription(range);
+ fputs("\n", stdout);
+ }
+ return layoutTestController()->acceptsEditing();
+}
+
+bool WebViewHost::isSmartInsertDeleteEnabled()
+{
+ return m_smartInsertDeleteEnabled;
+}
+
+bool WebViewHost::isSelectTrailingWhitespaceEnabled()
+{
+ return m_selectTrailingWhitespaceEnabled;
+}
+
+void WebViewHost::didBeginEditing()
+{
+ if (!layoutTestController()->shouldDumpEditingCallbacks())
+ return;
+ fputs("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n", stdout);
+}
+
+void WebViewHost::didChangeSelection(bool isEmptySelection)
+{
+ if (layoutTestController()->shouldDumpEditingCallbacks())
+ fputs("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n", stdout);
+ // No need to update clipboard with the selected text in DRT.
+}
+
+void WebViewHost::didChangeContents()
+{
+ if (!layoutTestController()->shouldDumpEditingCallbacks())
+ return;
+ fputs("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n", stdout);
+}
+
+void WebViewHost::didEndEditing()
+{
+ if (!layoutTestController()->shouldDumpEditingCallbacks())
+ return;
+ fputs("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n", stdout);
+}
+
+bool WebViewHost::handleCurrentKeyboardEvent()
+{
+ if (m_editCommandName.empty())
+ return false;
+ WebFrame* frame = webView()->focusedFrame();
+ if (!frame)
+ return false;
+
+ return frame->executeCommand(WebString::fromUTF8(m_editCommandName), WebString::fromUTF8(m_editCommandValue));
+}
+
+void WebViewHost::spellCheck(const WebString& text, int& misspelledOffset, int& misspelledLength)
+{
+ // Check the spelling of the given text.
+#if OS(MAC_OS_X)
+ // FIXME: rebaseline layout-test results of Windows and Linux so we
+ // can enable this mock spellchecker on them.
+ m_spellcheck.spellCheckWord(text, &misspelledOffset, &misspelledLength);
+#endif
+}
+
+WebString WebViewHost::autoCorrectWord(const WebString&)
+{
+ // Returns an empty string as Mac WebKit ('WebKitSupport/WebEditorClient.mm')
+ // does. (If this function returns a non-empty string, WebKit replaces the
+ // given misspelled string with the result one. This process executes some
+ // editor commands and causes layout-test failures.)
+ return WebString();
+}
+
+void WebViewHost::runModalAlertDialog(WebFrame*, const WebString& message)
+{
+ printf("ALERT: %s\n", message.utf8().data());
+}
+
+bool WebViewHost::runModalConfirmDialog(WebFrame*, const WebString& message)
+{
+ printf("CONFIRM: %s\n", message.utf8().data());
+ return true;
+}
+
+bool WebViewHost::runModalPromptDialog(WebFrame* frame, const WebString& message,
+ const WebString& defaultValue, WebString*)
+{
+ printf("PROMPT: %s, default text: %s\n", message.utf8().data(), defaultValue.utf8().data());
+ return true;
+}
+
+bool WebViewHost::runModalBeforeUnloadDialog(WebFrame*, const WebString&)
+{
+ return true; // Allow window closure.
+}
+
+void WebViewHost::showContextMenu(WebFrame*, const WebContextMenuData& contextMenuData)
+{
+ m_lastContextMenuData = adoptPtr(new WebContextMenuData(contextMenuData));
+}
+
+void WebViewHost::clearContextMenuData()
+{
+ m_lastContextMenuData.clear();
+}
+
+WebContextMenuData* WebViewHost::lastContextMenuData() const
+{
+ return m_lastContextMenuData.get();
+}
+
+void WebViewHost::setStatusText(const WebString& text)
+{
+ if (!layoutTestController()->shouldDumpStatusCallbacks())
+ return;
+ // When running tests, write to stdout.
+ printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text.utf8().data());
+}
+
+void WebViewHost::startDragging(const WebDragData& data, WebDragOperationsMask mask, const WebImage&, const WebPoint&)
+{
+ WebDragData mutableDragData = data;
+ if (layoutTestController()->shouldAddFileToPasteboard()) {
+ // Add a file called DRTFakeFile to the drag&drop clipboard.
+ addDRTFakeFileToDataObject(&mutableDragData);
+ }
+
+ // When running a test, we need to fake a drag drop operation otherwise
+ // Windows waits for real mouse events to know when the drag is over.
+ m_shell->eventSender()->doDragDrop(mutableDragData, mask);
+}
+
+void WebViewHost::navigateBackForwardSoon(int offset)
+{
+ navigationController()->goToOffset(offset);
+}
+
+int WebViewHost::historyBackListCount()
+{
+ return navigationController()->lastCommittedEntryIndex();
+}
+
+int WebViewHost::historyForwardListCount()
+{
+ int currentIndex =navigationController()->lastCommittedEntryIndex();
+ return navigationController()->entryCount() - currentIndex - 1;
+}
+
+void WebViewHost::postAccessibilityNotification(const WebAccessibilityObject& obj, WebAccessibilityNotification notification)
+{
+ if (notification == WebAccessibilityNotificationFocusedUIElementChanged)
+ m_shell->accessibilityController()->setFocusedElement(obj);
+
+ if (m_shell->accessibilityController()->shouldDumpAccessibilityNotifications()) {
+ printf("AccessibilityNotification - ");
+
+ switch (notification) {
+ case WebAccessibilityNotificationActiveDescendantChanged:
+ printf("ActiveDescendantChanged");
+ break;
+ case WebAccessibilityNotificationCheckedStateChanged:
+ printf("CheckedStateChanged");
+ break;
+ case WebAccessibilityNotificationChildrenChanged:
+ printf("ChildrenChanged");
+ break;
+ case WebAccessibilityNotificationFocusedUIElementChanged:
+ printf("FocusedUIElementChanged");
+ break;
+ case WebAccessibilityNotificationLayoutComplete:
+ printf("LayoutComplete");
+ break;
+ case WebAccessibilityNotificationLoadComplete:
+ printf("LoadComplete");
+ break;
+ case WebAccessibilityNotificationSelectedChildrenChanged:
+ printf("SelectedChildrenChanged");
+ break;
+ case WebAccessibilityNotificationSelectedTextChanged:
+ printf("SelectedTextChanged");
+ break;
+ case WebAccessibilityNotificationValueChanged:
+ printf("ValueChanged");
+ break;
+ case WebAccessibilityNotificationScrolledToAnchor:
+ printf("ScrolledToAnchor");
+ break;
+ case WebAccessibilityNotificationLiveRegionChanged:
+ printf("LiveRegionChanged");
+ break;
+ case WebAccessibilityNotificationMenuListValueChanged:
+ printf("MenuListValueChanged");
+ break;
+ case WebAccessibilityNotificationRowCountChanged:
+ printf("RowCountChanged");
+ break;
+ case WebAccessibilityNotificationRowCollapsed:
+ printf("RowCollapsed");
+ break;
+ case WebAccessibilityNotificationRowExpanded:
+ printf("RowExpanded");
+ break;
+ default:
+ break;
+ }
+
+ WebKit::WebNode node = obj.node();
+ if (!node.isNull() && node.isElementNode()) {
+ WebKit::WebElement element = node.to<WebKit::WebElement>();
+ if (element.hasAttribute("id"))
+ printf(" - id:%s", element.getAttribute("id").utf8().data());
+ }
+
+ printf("\n");
+ }
+}
+
+WebNotificationPresenter* WebViewHost::notificationPresenter()
+{
+ return m_shell->notificationPresenter();
+}
+
+#if !ENABLE(CLIENT_BASED_GEOLOCATION)
+WebKit::WebGeolocationService* WebViewHost::geolocationService()
+{
+ if (!m_geolocationServiceMock.get())
+ m_geolocationServiceMock.set(WebGeolocationServiceMock::createWebGeolocationServiceMock());
+ return m_geolocationServiceMock.get();
+}
+#endif
+
+WebSpeechInputController* WebViewHost::speechInputController(WebKit::WebSpeechInputListener* listener)
+{
+ if (!m_speechInputControllerMock)
+ m_speechInputControllerMock.set(WebSpeechInputControllerMock::create(listener));
+ return m_speechInputControllerMock.get();
+}
+
+WebDeviceOrientationClientMock* WebViewHost::deviceOrientationClientMock()
+{
+ if (!m_deviceOrientationClientMock.get())
+ m_deviceOrientationClientMock.set(WebDeviceOrientationClientMock::create());
+ return m_deviceOrientationClientMock.get();
+}
+
+MockSpellCheck* WebViewHost::mockSpellCheck()
+{
+ return &m_spellcheck;
+}
+
+WebDeviceOrientationClient* WebViewHost::deviceOrientationClient()
+{
+ return deviceOrientationClientMock();
+}
+
+// WebWidgetClient -----------------------------------------------------------
+
+void WebViewHost::didInvalidateRect(const WebRect& rect)
+{
+ if (m_isPainting)
+ LOG_ERROR("unexpected invalidation while painting");
+ updatePaintRect(rect);
+}
+
+void WebViewHost::didScrollRect(int, int, const WebRect& clipRect)
+{
+ // This is used for optimizing painting when the renderer is scrolled. We're
+ // currently not doing any optimizations so just invalidate the region.
+ didInvalidateRect(clipRect);
+}
+
+void WebViewHost::scheduleComposite()
+{
+ WebSize widgetSize = webWidget()->size();
+ WebRect clientRect(0, 0, widgetSize.width, widgetSize.height);
+ didInvalidateRect(clientRect);
+}
+
+void WebViewHost::didFocus()
+{
+ m_shell->setFocus(webWidget(), true);
+}
+
+void WebViewHost::didBlur()
+{
+ m_shell->setFocus(webWidget(), false);
+}
+
+WebScreenInfo WebViewHost::screenInfo()
+{
+ // We don't need to set actual values.
+ WebScreenInfo info;
+ info.depth = 24;
+ info.depthPerComponent = 8;
+ info.isMonochrome = false;
+ info.rect = WebRect(0, 0, screenWidth, screenHeight);
+ // Use values different from info.rect for testing.
+ info.availableRect = WebRect(screenUnavailableBorder, screenUnavailableBorder,
+ screenWidth - screenUnavailableBorder * 2,
+ screenHeight - screenUnavailableBorder * 2);
+ return info;
+}
+
+void WebViewHost::show(WebNavigationPolicy)
+{
+ m_hasWindow = true;
+ WebSize size = webWidget()->size();
+ updatePaintRect(WebRect(0, 0, size.width, size.height));
+}
+
+
+
+void WebViewHost::closeWidget()
+{
+ m_hasWindow = false;
+ m_shell->closeWindow(this);
+ // No more code here, we should be deleted at this point.
+}
+
+static void invokeCloseWidget(void* context)
+{
+ WebViewHost* wvh = static_cast<WebViewHost*>(context);
+ wvh->closeWidget();
+}
+
+void WebViewHost::closeWidgetSoon()
+{
+ webkit_support::PostDelayedTask(invokeCloseWidget, static_cast<void*>(this), 0);
+}
+
+void WebViewHost::didChangeCursor(const WebCursorInfo& cursorInfo)
+{
+ if (!hasWindow())
+ return;
+ m_currentCursor = cursorInfo;
+}
+
+WebRect WebViewHost::windowRect()
+{
+ return m_windowRect;
+}
+
+void WebViewHost::setWindowRect(const WebRect& rect)
+{
+ m_windowRect = rect;
+ const int border2 = TestShell::virtualWindowBorder * 2;
+ if (m_windowRect.width <= border2)
+ m_windowRect.width = 1 + border2;
+ if (m_windowRect.height <= border2)
+ m_windowRect.height = 1 + border2;
+ int width = m_windowRect.width - border2;
+ int height = m_windowRect.height - border2;
+ discardBackingStore();
+ webWidget()->resize(WebSize(width, height));
+ updatePaintRect(WebRect(0, 0, width, height));
+}
+
+WebRect WebViewHost::rootWindowRect()
+{
+ return windowRect();
+}
+
+WebRect WebViewHost::windowResizerRect()
+{
+ // Not necessary.
+ return WebRect();
+}
+
+void WebViewHost::runModal()
+{
+ bool oldState = webkit_support::MessageLoopNestableTasksAllowed();
+ webkit_support::MessageLoopSetNestableTasksAllowed(true);
+ m_inModalLoop = true;
+ webkit_support::RunMessageLoop();
+ webkit_support::MessageLoopSetNestableTasksAllowed(oldState);
+}
+
+// WebFrameClient ------------------------------------------------------------
+
+WebPlugin* WebViewHost::createPlugin(WebFrame* frame, const WebPluginParams& params)
+{
+ return webkit_support::CreateWebPlugin(frame, params);
+}
+
+WebWorker* WebViewHost::createWorker(WebFrame*, WebWorkerClient*)
+{
+ return new TestWebWorker();
+}
+
+WebMediaPlayer* WebViewHost::createMediaPlayer(WebFrame* frame, WebMediaPlayerClient* client)
+{
+ return webkit_support::CreateMediaPlayer(frame, client);
+}
+
+WebApplicationCacheHost* WebViewHost::createApplicationCacheHost(WebFrame* frame, WebApplicationCacheHostClient* client)
+{
+ return webkit_support::CreateApplicationCacheHost(frame, client);
+}
+
+bool WebViewHost::allowPlugins(WebFrame* frame, bool enabledPerSettings)
+{
+ return enabledPerSettings;
+}
+
+bool WebViewHost::allowImages(WebFrame* frame, bool enabledPerSettings)
+{
+ return enabledPerSettings;
+}
+
+void WebViewHost::loadURLExternally(WebFrame*, const WebURLRequest& request, WebNavigationPolicy policy)
+{
+ ASSERT(policy != WebKit::WebNavigationPolicyCurrentTab);
+ WebViewHost* another = m_shell->createNewWindow(request.url());
+ if (another)
+ another->show(policy);
+}
+
+WebNavigationPolicy WebViewHost::decidePolicyForNavigation(
+ WebFrame*, const WebURLRequest& request,
+ WebNavigationType type, const WebNode& originatingNode,
+ WebNavigationPolicy defaultPolicy, bool isRedirect)
+{
+ WebNavigationPolicy result;
+ if (!m_policyDelegateEnabled)
+ return defaultPolicy;
+
+ printf("Policy delegate: attempt to load %s with navigation type '%s'",
+ URLDescription(request.url()).c_str(), webNavigationTypeToString(type));
+ if (!originatingNode.isNull()) {
+ fputs(" originating from ", stdout);
+ printNodeDescription(originatingNode, 0);
+ }
+ fputs("\n", stdout);
+ if (m_policyDelegateIsPermissive)
+ result = WebKit::WebNavigationPolicyCurrentTab;
+ else
+ result = WebKit::WebNavigationPolicyIgnore;
+
+ if (m_policyDelegateShouldNotifyDone)
+ layoutTestController()->policyDelegateDone();
+ return result;
+}
+
+bool WebViewHost::canHandleRequest(WebFrame*, const WebURLRequest& request)
+{
+ GURL url = request.url();
+ // Just reject the scheme used in
+ // LayoutTests/http/tests/misc/redirect-to-external-url.html
+ return !url.SchemeIs("spaceballs");
+}
+
+WebURLError WebViewHost::cannotHandleRequestError(WebFrame*, const WebURLRequest& request)
+{
+ WebURLError error;
+ // A WebKit layout test expects the following values.
+ // unableToImplementPolicyWithError() below prints them.
+ error.domain = WebString::fromUTF8("WebKitErrorDomain");
+ error.reason = 101;
+ error.unreachableURL = request.url();
+ return error;
+}
+
+WebURLError WebViewHost::cancelledError(WebFrame*, const WebURLRequest& request)
+{
+ return webkit_support::CreateCancelledError(request);
+}
+
+void WebViewHost::unableToImplementPolicyWithError(WebFrame* frame, const WebURLError& error)
+{
+ printf("Policy delegate: unable to implement policy with error domain '%s', "
+ "error code %d, in frame '%s'\n",
+ error.domain.utf8().data(), error.reason, frame->name().utf8().data());
+}
+
+void WebViewHost::willPerformClientRedirect(WebFrame* frame, const WebURL& from, const WebURL& to,
+ double interval, double fire_time)
+{
+ if (!m_shell->shouldDumpFrameLoadCallbacks())
+ return;
+ printFrameDescription(frame);
+ printf(" - willPerformClientRedirectToURL: %s \n", to.spec().data());
+}
+
+void WebViewHost::didCancelClientRedirect(WebFrame* frame)
+{
+ if (!m_shell->shouldDumpFrameLoadCallbacks())
+ return;
+ printFrameDescription(frame);
+ fputs(" - didCancelClientRedirectForFrame\n", stdout);
+}
+
+void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds)
+{
+ ds->setExtraData(m_pendingExtraData.leakPtr());
+ if (!layoutTestController()->deferMainResourceDataLoad())
+ ds->setDeferMainResourceDataLoad(false);
+}
+
+void WebViewHost::didStartProvisionalLoad(WebFrame* frame)
+{
+ if (m_shell->shouldDumpUserGestureInFrameLoadCallbacks())
+ printFrameUserGestureStatus(frame, " - in didStartProvisionalLoadForFrame\n");
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ fputs(" - didStartProvisionalLoadForFrame\n", stdout);
+ }
+
+ if (!m_topLoadingFrame)
+ m_topLoadingFrame = frame;
+
+ if (layoutTestController()->stopProvisionalFrameLoads()) {
+ printFrameDescription(frame);
+ fputs(" - stopping load in didStartProvisionalLoadForFrame callback\n", stdout);
+ frame->stopLoading();
+ }
+ updateAddressBar(frame->view());
+}
+
+void WebViewHost::didReceiveServerRedirectForProvisionalLoad(WebFrame* frame)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ fputs(" - didReceiveServerRedirectForProvisionalLoadForFrame\n", stdout);
+ }
+ updateAddressBar(frame->view());
+}
+
+void WebViewHost::didFailProvisionalLoad(WebFrame* frame, const WebURLError& error)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ fputs(" - didFailProvisionalLoadWithError\n", stdout);
+ }
+
+ locationChangeDone(frame);
+
+ // Don't display an error page if we're running layout tests, because
+ // DumpRenderTree doesn't.
+}
+
+void WebViewHost::didCommitProvisionalLoad(WebFrame* frame, bool isNewNavigation)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ fputs(" - didCommitLoadForFrame\n", stdout);
+ }
+ updateForCommittedLoad(frame, isNewNavigation);
+}
+
+void WebViewHost::didClearWindowObject(WebFrame* frame)
+{
+ m_shell->bindJSObjectsToWindow(frame);
+}
+
+void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title)
+{
+ WebCString title8 = title.utf8();
+
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ printf(" - didReceiveTitle: %s\n", title8.data());
+ }
+
+ if (layoutTestController()->shouldDumpTitleChanges())
+ printf("TITLE CHANGED: %s\n", title8.data());
+
+ setPageTitle(title);
+}
+
+void WebViewHost::didFinishDocumentLoad(WebFrame* frame)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ fputs(" - didFinishDocumentLoadForFrame\n", stdout);
+ } else {
+ unsigned pendingUnloadEvents = frame->unloadListenerCount();
+ if (pendingUnloadEvents) {
+ printFrameDescription(frame);
+ printf(" - has %u onunload handler(s)\n", pendingUnloadEvents);
+ }
+ }
+}
+
+void WebViewHost::didHandleOnloadEvents(WebFrame* frame)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ fputs(" - didHandleOnloadEventsForFrame\n", stdout);
+ }
+}
+
+void WebViewHost::didFailLoad(WebFrame* frame, const WebURLError& error)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ fputs(" - didFailLoadWithError\n", stdout);
+ }
+ locationChangeDone(frame);
+}
+
+void WebViewHost::didFinishLoad(WebFrame* frame)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ fputs(" - didFinishLoadForFrame\n", stdout);
+ }
+ updateAddressBar(frame->view());
+ locationChangeDone(frame);
+}
+
+void WebViewHost::didNavigateWithinPage(WebFrame* frame, bool isNewNavigation)
+{
+ frame->dataSource()->setExtraData(m_pendingExtraData.leakPtr());
+
+ updateForCommittedLoad(frame, isNewNavigation);
+}
+
+void WebViewHost::didChangeLocationWithinPage(WebFrame* frame)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks()) {
+ printFrameDescription(frame);
+ fputs(" - didChangeLocationWithinPageForFrame\n", stdout);
+ }
+}
+
+void WebViewHost::assignIdentifierToRequest(WebFrame*, unsigned identifier, const WebURLRequest& request)
+{
+ if (!m_shell->shouldDumpResourceLoadCallbacks())
+ return;
+ ASSERT(!m_resourceIdentifierMap.contains(identifier));
+ m_resourceIdentifierMap.set(identifier, descriptionSuitableForTestResult(request.url().spec()));
+}
+
+void WebViewHost::removeIdentifierForRequest(unsigned identifier)
+{
+ m_resourceIdentifierMap.remove(identifier);
+}
+
+void WebViewHost::willSendRequest(WebFrame*, unsigned identifier, WebURLRequest& request, const WebURLResponse& redirectResponse)
+{
+ // Need to use GURL for host() and SchemeIs()
+ GURL url = request.url();
+ string requestURL = url.possibly_invalid_spec();
+
+ if (layoutTestController()->shouldDumpResourceLoadCallbacks()) {
+ GURL mainDocumentURL = request.firstPartyForCookies();
+ printResourceDescription(identifier);
+ printf(" - willSendRequest <NSURLRequest URL %s, main document URL %s,"
+ " http method %s> redirectResponse ",
+ descriptionSuitableForTestResult(requestURL).c_str(),
+ URLDescription(mainDocumentURL).c_str(),
+ request.httpMethod().utf8().data());
+ printResponseDescription(redirectResponse);
+ fputs("\n", stdout);
+ }
+
+ if (!redirectResponse.isNull() && m_blocksRedirects) {
+ fputs("Returning null for this redirect\n", stdout);
+ // To block the request, we set its URL to an empty one.
+ request.setURL(WebURL());
+ return;
+ }
+
+ if (m_requestReturnNull) {
+ // To block the request, we set its URL to an empty one.
+ request.setURL(WebURL());
+ return;
+ }
+
+ string host = url.host();
+ // 255.255.255.255 is used in some tests that expect to get back an error.
+ if (!host.empty() && (url.SchemeIs("http") || url.SchemeIs("https"))
+ && host != "127.0.0.1"
+ && host != "255.255.255.255"
+ && 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.
+ request.setURL(WebURL());
+ return;
+ }
+
+ HashSet<String>::const_iterator end = m_clearHeaders.end();
+ for (HashSet<String>::const_iterator header = m_clearHeaders.begin(); header != end; ++header)
+ request.clearHTTPHeaderField(WebString(header->characters(), header->length()));
+
+ // Set the new substituted URL.
+ request.setURL(webkit_support::RewriteLayoutTestsURL(request.url().spec()));
+}
+
+void WebViewHost::didReceiveResponse(WebFrame*, unsigned identifier, const WebURLResponse& response)
+{
+ if (m_shell->shouldDumpResourceLoadCallbacks()) {
+ printResourceDescription(identifier);
+ fputs(" - didReceiveResponse ", stdout);
+ printResponseDescription(response);
+ fputs("\n", stdout);
+ }
+ if (m_shell->shouldDumpResourceResponseMIMETypes()) {
+ GURL url = response.url();
+ WebString mimeType = response.mimeType();
+ printf("%s has MIME type %s\n",
+ url.ExtractFileName().c_str(),
+ // Simulate NSURLResponse's mapping of empty/unknown MIME types to application/octet-stream
+ mimeType.isEmpty() ? "application/octet-stream" : mimeType.utf8().data());
+ }
+}
+
+void WebViewHost::didFinishResourceLoad(WebFrame*, unsigned identifier)
+{
+ if (m_shell->shouldDumpResourceLoadCallbacks()) {
+ printResourceDescription(identifier);
+ fputs(" - didFinishLoading\n", stdout);
+ }
+ removeIdentifierForRequest(identifier);
+}
+
+void WebViewHost::didFailResourceLoad(WebFrame*, unsigned identifier, const WebURLError& error)
+{
+ if (m_shell->shouldDumpResourceLoadCallbacks()) {
+ printResourceDescription(identifier);
+ fputs(" - didFailLoadingWithError: ", stdout);
+ fputs(webkit_support::MakeURLErrorDescription(error).c_str(), stdout);
+ fputs("\n", stdout);
+ }
+ removeIdentifierForRequest(identifier);
+}
+
+void WebViewHost::didDisplayInsecureContent(WebFrame*)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks())
+ fputs("didDisplayInsecureContent\n", stdout);
+}
+
+void WebViewHost::didRunInsecureContent(WebFrame*, const WebSecurityOrigin& origin)
+{
+ if (m_shell->shouldDumpFrameLoadCallbacks())
+ fputs("didRunInsecureContent\n", stdout);
+}
+
+bool WebViewHost::allowScript(WebFrame*, bool enabledPerSettings)
+{
+ return enabledPerSettings;
+}
+
+void WebViewHost::openFileSystem(WebFrame* frame, WebFileSystem::Type type, long long size, bool create, WebFileSystemCallbacks* callbacks)
+{
+ webkit_support::OpenFileSystem(frame, type, size, create, callbacks);
+}
+
+// Public functions -----------------------------------------------------------
+
+WebViewHost::WebViewHost(TestShell* shell)
+ : m_shell(shell)
+ , m_webWidget(0)
+{
+ reset();
+}
+
+WebViewHost::~WebViewHost()
+{
+ // Navigate to an empty page to fire all the destruction logic for the
+ // current page.
+ loadURLForFrame(GURL("about:blank"), WebString());
+
+ // Call GC twice to clean up garbage.
+ m_shell->callJSGC();
+ m_shell->callJSGC();
+
+ webWidget()->close();
+
+ if (m_inModalLoop)
+ webkit_support::QuitMessageLoop();
+}
+
+WebView* WebViewHost::webView() const
+{
+ ASSERT(m_webWidget);
+ // DRT does not support popup widgets. So m_webWidget is always a WebView.
+ return static_cast<WebView*>(m_webWidget);
+}
+
+WebWidget* WebViewHost::webWidget() const
+{
+ ASSERT(m_webWidget);
+ return m_webWidget;
+}
+
+void WebViewHost::reset()
+{
+ m_policyDelegateEnabled = false;
+ m_policyDelegateIsPermissive = false;
+ m_policyDelegateShouldNotifyDone = false;
+ m_topLoadingFrame = 0;
+ m_pageId = -1;
+ m_lastPageIdUpdated = -1;
+ m_hasWindow = false;
+ m_inModalLoop = false;
+ m_smartInsertDeleteEnabled = true;
+#if OS(WINDOWS)
+ m_selectTrailingWhitespaceEnabled = true;
+#else
+ m_selectTrailingWhitespaceEnabled = false;
+#endif
+ m_blocksRedirects = false;
+ m_requestReturnNull = false;
+ m_isPainting = false;
+ m_canvas.clear();
+
+ m_navigationController.set(new TestNavigationController(this));
+
+ m_pendingExtraData.clear();
+ m_resourceIdentifierMap.clear();
+ m_clearHeaders.clear();
+ m_editCommandName.clear();
+ m_editCommandValue.clear();
+
+#if !ENABLE(CLIENT_BASED_GEOLOCATION)
+ m_geolocationServiceMock.clear();
+#endif
+
+ if (m_speechInputControllerMock.get())
+ m_speechInputControllerMock->clearResults();
+
+ m_currentCursor = WebCursorInfo();
+ m_windowRect = WebRect();
+ m_paintRect = WebRect();
+
+ if (m_webWidget)
+ webView()->mainFrame()->setName(WebString());
+}
+
+void WebViewHost::setSelectTrailingWhitespaceEnabled(bool enabled)
+{
+ m_selectTrailingWhitespaceEnabled = enabled;
+ // In upstream WebKit, smart insert/delete is mutually exclusive with select
+ // trailing whitespace, however, we allow both because Chromium on Windows
+ // allows both.
+}
+
+void WebViewHost::setSmartInsertDeleteEnabled(bool enabled)
+{
+ m_smartInsertDeleteEnabled = enabled;
+ // In upstream WebKit, smart insert/delete is mutually exclusive with select
+ // trailing whitespace, however, we allow both because Chromium on Windows
+ // allows both.
+}
+
+void WebViewHost::setCustomPolicyDelegate(bool isCustom, bool isPermissive)
+{
+ m_policyDelegateEnabled = isCustom;
+ m_policyDelegateIsPermissive = isPermissive;
+}
+
+void WebViewHost::waitForPolicyDelegate()
+{
+ m_policyDelegateEnabled = true;
+ m_policyDelegateShouldNotifyDone = true;
+}
+
+void WebViewHost::setEditCommand(const string& name, const string& value)
+{
+ m_editCommandName = name;
+ m_editCommandValue = value;
+}
+
+void WebViewHost::clearEditCommand()
+{
+ m_editCommandName.clear();
+ m_editCommandValue.clear();
+}
+
+void WebViewHost::loadURLForFrame(const WebURL& url, const WebString& frameName)
+{
+ if (!url.isValid())
+ return;
+ TestShell::resizeWindowForTest(this, url);
+ navigationController()->loadEntry(TestNavigationEntry::create(-1, url, WebString(), frameName).get());
+}
+
+bool WebViewHost::navigate(const TestNavigationEntry& entry, bool reload)
+{
+ // Get the right target frame for the entry.
+ WebFrame* frame = webView()->mainFrame();
+ if (!entry.targetFrame().isEmpty())
+ frame = webView()->findFrameByName(entry.targetFrame());
+
+ // TODO(mpcomplete): should we clear the target frame, or should
+ // back/forward navigations maintain the target frame?
+
+ // A navigation resulting from loading a javascript URL should not be
+ // treated as a browser initiated event. Instead, we want it to look as if
+ // the page initiated any load resulting from JS execution.
+ if (!GURL(entry.URL()).SchemeIs("javascript"))
+ setPendingExtraData(new TestShellExtraData(entry.pageID()));
+
+ // If we are reloading, then WebKit will use the state of the current page.
+ // Otherwise, we give it the state to navigate to.
+ if (reload) {
+ frame->reload(false);
+ } else if (!entry.contentState().isNull()) {
+ ASSERT(entry.pageID() != -1);
+ frame->loadHistoryItem(entry.contentState());
+ } else {
+ ASSERT(entry.pageID() == -1);
+ frame->loadRequest(WebURLRequest(entry.URL()));
+ }
+
+ // In case LoadRequest failed before DidCreateDataSource was called.
+ setPendingExtraData(0);
+
+ // Restore focus to the main frame prior to loading new request.
+ // This makes sure that we don't have a focused iframe. Otherwise, that
+ // iframe would keep focus when the SetFocus called immediately after
+ // LoadRequest, thus making some tests fail (see http://b/issue?id=845337
+ // for more details).
+ webView()->setFocusedFrame(frame);
+ m_shell->setFocus(webView(), true);
+
+ return true;
+}
+
+// Private functions ----------------------------------------------------------
+
+LayoutTestController* WebViewHost::layoutTestController() const
+{
+ return m_shell->layoutTestController();
+}
+
+void WebViewHost::updateAddressBar(WebView* webView)
+{
+ WebFrame* mainFrame = webView->mainFrame();
+ WebDataSource* dataSource = mainFrame->dataSource();
+ if (!dataSource)
+ dataSource = mainFrame->provisionalDataSource();
+ if (!dataSource)
+ return;
+
+ setAddressBarURL(dataSource->request().url());
+}
+
+void WebViewHost::locationChangeDone(WebFrame* frame)
+{
+ if (frame != m_topLoadingFrame)
+ return;
+ m_topLoadingFrame = 0;
+ layoutTestController()->locationChangeDone();
+}
+
+void WebViewHost::updateForCommittedLoad(WebFrame* frame, bool isNewNavigation)
+{
+ // Code duplicated from RenderView::DidCommitLoadForFrame.
+ TestShellExtraData* extraData = static_cast<TestShellExtraData*>(frame->dataSource()->extraData());
+
+ if (isNewNavigation) {
+ // New navigation.
+ updateSessionHistory(frame);
+ m_pageId = nextPageID++;
+ } else if (extraData && extraData->pendingPageID != -1 && !extraData->requestCommitted) {
+ // This is a successful session history navigation!
+ updateSessionHistory(frame);
+ m_pageId = extraData->pendingPageID;
+ }
+
+ // Don't update session history multiple times.
+ if (extraData)
+ extraData->requestCommitted = true;
+
+ updateURL(frame);
+}
+
+void WebViewHost::updateURL(WebFrame* frame)
+{
+ WebDataSource* ds = frame->dataSource();
+ ASSERT(ds);
+ const WebURLRequest& request = ds->request();
+ RefPtr<TestNavigationEntry> entry(TestNavigationEntry::create());
+
+ // The referrer will be empty on https->http transitions. It
+ // would be nice if we could get the real referrer from somewhere.
+ entry->setPageID(m_pageId);
+ if (ds->hasUnreachableURL())
+ entry->setURL(ds->unreachableURL());
+ else
+ entry->setURL(request.url());
+
+ const WebHistoryItem& historyItem = frame->currentHistoryItem();
+ if (!historyItem.isNull())
+ entry->setContentState(historyItem);
+
+ navigationController()->didNavigateToEntry(entry.get());
+ updateAddressBar(frame->view());
+ m_lastPageIdUpdated = max(m_lastPageIdUpdated, m_pageId);
+}
+
+void WebViewHost::updateSessionHistory(WebFrame* frame)
+{
+ // If we have a valid page ID at this point, then it corresponds to the page
+ // we are navigating away from. Otherwise, this is the first navigation, so
+ // there is no past session history to record.
+ if (m_pageId == -1)
+ return;
+
+ TestNavigationEntry* entry = navigationController()->entryWithPageID(m_pageId);
+ if (!entry)
+ return;
+
+ const WebHistoryItem& historyItem = webView()->mainFrame()->previousHistoryItem();
+ if (historyItem.isNull())
+ return;
+
+ entry->setContentState(historyItem);
+}
+
+void WebViewHost::printFrameDescription(WebFrame* webframe)
+{
+ string name8 = webframe->name().utf8();
+ if (webframe == webView()->mainFrame()) {
+ if (!name8.length()) {
+ fputs("main frame", stdout);
+ return;
+ }
+ printf("main frame \"%s\"", name8.c_str());
+ return;
+ }
+ if (!name8.length()) {
+ fputs("frame (anonymous)", stdout);
+ return;
+ }
+ printf("frame \"%s\"", name8.c_str());
+}
+
+void WebViewHost::printFrameUserGestureStatus(WebFrame* webframe, const char* msg)
+{
+ bool isUserGesture = webframe->isProcessingUserGesture();
+ printf("Frame with user gesture \"%s\"%s", isUserGesture ? "true" : "false", msg);
+}
+
+void WebViewHost::printResourceDescription(unsigned identifier)
+{
+ ResourceMap::iterator it = m_resourceIdentifierMap.find(identifier);
+ printf("%s", it != m_resourceIdentifierMap.end() ? it->second.c_str() : "<unknown>");
+}
+
+void WebViewHost::setPendingExtraData(TestShellExtraData* extraData)
+{
+ m_pendingExtraData.set(extraData);
+}
+
+void WebViewHost::setPageTitle(const WebString&)
+{
+ // Nothing to do in layout test.
+}
+
+void WebViewHost::setAddressBarURL(const WebURL&)
+{
+ // Nothing to do in layout test.
+}
+
+// Painting functions ---------------------------------------------------------
+
+void WebViewHost::updatePaintRect(const WebRect& rect)
+{
+ // m_paintRect = m_paintRect U rect
+ if (rect.isEmpty())
+ return;
+ if (m_paintRect.isEmpty()) {
+ m_paintRect = rect;
+ return;
+ }
+ int left = min(m_paintRect.x, rect.x);
+ int top = min(m_paintRect.y, rect.y);
+ int right = max(m_paintRect.x + m_paintRect.width, rect.x + rect.width);
+ int bottom = max(m_paintRect.y + m_paintRect.height, rect.y + rect.height);
+ m_paintRect = WebRect(left, top, right - left, bottom - top);
+}
+
+void WebViewHost::paintRect(const WebRect& rect)
+{
+ ASSERT(!m_isPainting);
+ ASSERT(canvas());
+ m_isPainting = true;
+#if PLATFORM(CG)
+ webWidget()->paint(canvas()->getTopPlatformDevice().GetBitmapContext(), rect);
+#else
+ webWidget()->paint(canvas(), rect);
+#endif
+ m_isPainting = false;
+}
+
+void WebViewHost::paintInvalidatedRegion()
+{
+ webWidget()->layout();
+ WebSize widgetSize = webWidget()->size();
+ WebRect clientRect(0, 0, widgetSize.width, widgetSize.height);
+
+ // Paint the canvas if necessary. Allow painting to generate extra rects
+ // for the first two calls. This is necessary because some WebCore rendering
+ // objects update their layout only when painted.
+ // Store the total area painted in total_paint. Then tell the gdk window
+ // to update that area after we're done painting it.
+ for (int i = 0; i < 3; ++i) {
+ // m_paintRect = intersect(m_paintRect , clientRect)
+ int left = max(m_paintRect.x, clientRect.x);
+ int top = max(m_paintRect.y, clientRect.y);
+ int right = min(m_paintRect.x + m_paintRect.width, clientRect.x + clientRect.width);
+ int bottom = min(m_paintRect.y + m_paintRect.height, clientRect.y + clientRect.height);
+ if (left >= right || top >= bottom)
+ m_paintRect = WebRect();
+ else
+ m_paintRect = WebRect(left, top, right - left, bottom - top);
+
+ if (m_paintRect.isEmpty())
+ continue;
+ WebRect rect(m_paintRect);
+ m_paintRect = WebRect();
+ paintRect(rect);
+ if (i >= 1)
+ LOG_ERROR("painting caused additional invalidations");
+ }
+ ASSERT(m_paintRect.isEmpty());
+}
+
+PlatformCanvas* WebViewHost::canvas()
+{
+ if (m_canvas)
+ return m_canvas.get();
+ WebSize widgetSize = webWidget()->size();
+ resetScrollRect();
+ m_canvas.set(new PlatformCanvas(widgetSize.width, widgetSize.height, true));
+ return m_canvas.get();
+}
+
+void WebViewHost::resetScrollRect()
+{
+}
+
+void WebViewHost::discardBackingStore()
+{
+ m_canvas.clear();
+}
+
+// Paints the entire canvas a semi-transparent black (grayish). This is used
+// by the layout tests in fast/repaint. The alpha value matches upstream.
+void WebViewHost::displayRepaintMask()
+{
+ canvas()->drawARGB(167, 0, 0, 0);
+}
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
new file mode 100644
index 0000000..c8595b3
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
@@ -0,0 +1,321 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebViewHost_h
+#define WebViewHost_h
+
+#include "MockSpellCheck.h"
+#include "TestNavigationController.h"
+#include "WebAccessibilityNotification.h"
+#include "WebCursorInfo.h"
+#include "WebFrameClient.h"
+#include "WebViewClient.h"
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+class LayoutTestController;
+class TestShell;
+namespace WebKit {
+class WebFrame;
+class WebDeviceOrientationClient;
+class WebDeviceOrientationClientMock;
+class WebGeolocationServiceMock;
+class WebSpeechInputController;
+class WebSpeechInputControllerMock;
+class WebSpeechInputListener;
+class WebURL;
+struct WebRect;
+struct WebURLError;
+struct WebWindowFeatures;
+}
+namespace skia {
+class PlatformCanvas;
+}
+
+class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, public NavigationHost {
+ public:
+ WebViewHost(TestShell* shell);
+ ~WebViewHost();
+ void setWebWidget(WebKit::WebWidget* widget) { m_webWidget = widget; }
+ WebKit::WebView* webView() const;
+ WebKit::WebWidget* webWidget() const;
+ void reset();
+ void setSelectTrailingWhitespaceEnabled(bool);
+ void setSmartInsertDeleteEnabled(bool);
+ void waitForPolicyDelegate();
+ void setCustomPolicyDelegate(bool, bool);
+ WebKit::WebFrame* topLoadingFrame() { return m_topLoadingFrame; }
+ void setBlockRedirects(bool block) { m_blocksRedirects = block; }
+ void setRequestReturnNull(bool returnNull) { m_requestReturnNull = returnNull; }
+ void setEditCommand(const std::string& name, const std::string& value);
+ void clearEditCommand();
+ void setPendingExtraData(TestShellExtraData*);
+
+ void paintRect(const WebKit::WebRect&);
+ void updatePaintRect(const WebKit::WebRect&);
+ void paintInvalidatedRegion();
+ skia::PlatformCanvas* canvas();
+ void displayRepaintMask();
+
+ void loadURLForFrame(const WebKit::WebURL&, const WebKit::WebString& frameName);
+ TestNavigationController* navigationController() { return m_navigationController.get(); }
+
+ void addClearHeader(const WTF::String& header) { m_clearHeaders.add(header); }
+ const HashSet<WTF::String>& clearHeaders() const { return m_clearHeaders; }
+ void closeWidget();
+
+ WebKit::WebContextMenuData* lastContextMenuData() const;
+ void clearContextMenuData();
+
+ WebKit::WebSpeechInputControllerMock* speechInputControllerMock() { return m_speechInputControllerMock.get(); }
+
+ // NavigationHost
+ virtual bool navigate(const TestNavigationEntry&, bool reload);
+
+ // WebKit::WebViewClient
+ 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);
+ virtual void didAddMessageToConsole(const WebKit::WebConsoleMessage&, const WebKit::WebString& sourceName, unsigned sourceLine);
+ virtual void didStartLoading();
+ virtual void didStopLoading();
+ virtual bool shouldBeginEditing(const WebKit::WebRange&);
+ virtual bool shouldEndEditing(const WebKit::WebRange&);
+ virtual bool shouldInsertNode(const WebKit::WebNode&, const WebKit::WebRange&, WebKit::WebEditingAction);
+ virtual bool shouldInsertText(const WebKit::WebString&, const WebKit::WebRange&, WebKit::WebEditingAction);
+ virtual bool shouldChangeSelectedRange(const WebKit::WebRange& from, const WebKit::WebRange& to, WebKit::WebTextAffinity, bool stillSelecting);
+ virtual bool shouldDeleteRange(const WebKit::WebRange&);
+ virtual bool shouldApplyStyle(const WebKit::WebString& style, const WebKit::WebRange&);
+ virtual bool isSmartInsertDeleteEnabled();
+ virtual bool isSelectTrailingWhitespaceEnabled();
+ virtual void didBeginEditing();
+ virtual void didChangeSelection(bool isSelectionEmpty);
+ virtual void didChangeContents();
+ virtual void didEndEditing();
+ virtual bool handleCurrentKeyboardEvent();
+ virtual void spellCheck(const WebKit::WebString&, int& offset, int& length);
+ virtual WebKit::WebString autoCorrectWord(const WebKit::WebString&);
+ virtual void runModalAlertDialog(WebKit::WebFrame*, const WebKit::WebString&);
+ virtual bool runModalConfirmDialog(WebKit::WebFrame*, const WebKit::WebString&);
+ virtual bool runModalPromptDialog(WebKit::WebFrame*, const WebKit::WebString& message, const WebKit::WebString& defaultValue, WebKit::WebString* actualValue);
+ virtual bool runModalBeforeUnloadDialog(WebKit::WebFrame*, const WebKit::WebString&);
+ virtual void showContextMenu(WebKit::WebFrame*, const WebKit::WebContextMenuData&);
+ virtual void setStatusText(const WebKit::WebString&);
+ virtual void startDragging(const WebKit::WebDragData&, WebKit::WebDragOperationsMask, const WebKit::WebImage&, const WebKit::WebPoint&);
+ virtual void navigateBackForwardSoon(int offset);
+ virtual int historyBackListCount();
+ virtual int historyForwardListCount();
+ virtual void postAccessibilityNotification(const WebKit::WebAccessibilityObject&, WebKit::WebAccessibilityNotification);
+ virtual WebKit::WebNotificationPresenter* notificationPresenter();
+#if !ENABLE(CLIENT_BASED_GEOLOCATION)
+ virtual WebKit::WebGeolocationService* geolocationService();
+#endif
+ virtual WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
+ virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient();
+
+ // WebKit::WebWidgetClient
+ virtual void didInvalidateRect(const WebKit::WebRect&);
+ virtual void didScrollRect(int dx, int dy, const WebKit::WebRect&);
+ virtual void scheduleComposite();
+ virtual void didFocus();
+ virtual void didBlur();
+ virtual void didChangeCursor(const WebKit::WebCursorInfo&);
+ virtual void closeWidgetSoon();
+ virtual void show(WebKit::WebNavigationPolicy);
+ virtual void runModal();
+ virtual WebKit::WebRect windowRect();
+ virtual void setWindowRect(const WebKit::WebRect&);
+ virtual WebKit::WebRect rootWindowRect();
+ virtual WebKit::WebRect windowResizerRect();
+ virtual WebKit::WebScreenInfo screenInfo();
+
+ // WebKit::WebFrameClient
+ virtual WebKit::WebPlugin* createPlugin(WebKit::WebFrame*, const WebKit::WebPluginParams&);
+ virtual WebKit::WebWorker* createWorker(WebKit::WebFrame*, WebKit::WebWorkerClient*);
+ virtual WebKit::WebMediaPlayer* createMediaPlayer(WebKit::WebFrame*, WebKit::WebMediaPlayerClient*);
+ virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost(WebKit::WebFrame*, WebKit::WebApplicationCacheHostClient*);
+ virtual bool allowPlugins(WebKit::WebFrame*, bool enabledPerSettings);
+ virtual bool allowImages(WebKit::WebFrame*, bool enabledPerSettings);
+ virtual void loadURLExternally(WebKit::WebFrame*, const WebKit::WebURLRequest&, WebKit::WebNavigationPolicy);
+ virtual WebKit::WebNavigationPolicy decidePolicyForNavigation(
+ WebKit::WebFrame*, const WebKit::WebURLRequest&,
+ WebKit::WebNavigationType, const WebKit::WebNode&,
+ WebKit::WebNavigationPolicy, bool isRedirect);
+ virtual bool canHandleRequest(WebKit::WebFrame*, const WebKit::WebURLRequest&);
+ virtual WebKit::WebURLError cannotHandleRequestError(WebKit::WebFrame*, const WebKit::WebURLRequest&);
+ virtual WebKit::WebURLError cancelledError(WebKit::WebFrame*, const WebKit::WebURLRequest&);
+ virtual void unableToImplementPolicyWithError(WebKit::WebFrame*, const WebKit::WebURLError&);
+ virtual void willPerformClientRedirect(
+ WebKit::WebFrame*, const WebKit::WebURL& from, const WebKit::WebURL& to,
+ double interval, double fireTime);
+ virtual void didCancelClientRedirect(WebKit::WebFrame*);
+ virtual void didCreateDataSource(WebKit::WebFrame*, WebKit::WebDataSource*);
+ virtual void didStartProvisionalLoad(WebKit::WebFrame*);
+ virtual void didReceiveServerRedirectForProvisionalLoad(WebKit::WebFrame*);
+ virtual void didFailProvisionalLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
+ virtual void didCommitProvisionalLoad(WebKit::WebFrame*, bool isNewNavigation);
+ virtual void didClearWindowObject(WebKit::WebFrame*);
+ virtual void didReceiveTitle(WebKit::WebFrame*, const WebKit::WebString&);
+ virtual void didFinishDocumentLoad(WebKit::WebFrame*);
+ virtual void didHandleOnloadEvents(WebKit::WebFrame*);
+ virtual void didFailLoad(WebKit::WebFrame*, const WebKit::WebURLError&);
+ virtual void didFinishLoad(WebKit::WebFrame*);
+ virtual void didNavigateWithinPage(WebKit::WebFrame*, bool isNewNavigation);
+ virtual void didChangeLocationWithinPage(WebKit::WebFrame*);
+ virtual void assignIdentifierToRequest(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLRequest&);
+ virtual void removeIdentifierForRequest(unsigned identifier);
+ virtual void willSendRequest(WebKit::WebFrame*, unsigned identifier, WebKit::WebURLRequest&, const WebKit::WebURLResponse&);
+ virtual void didReceiveResponse(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLResponse&);
+ virtual void didFinishResourceLoad(WebKit::WebFrame*, unsigned identifier);
+ virtual void didFailResourceLoad(WebKit::WebFrame*, unsigned identifier, const WebKit::WebURLError&);
+ virtual void didDisplayInsecureContent(WebKit::WebFrame*);
+ virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&);
+ virtual bool allowScript(WebKit::WebFrame*, bool enabledPerSettings);
+ virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*);
+
+ WebKit::WebDeviceOrientationClientMock* deviceOrientationClientMock();
+ MockSpellCheck* mockSpellCheck();
+
+private:
+ LayoutTestController* layoutTestController() const;
+
+ // Called the title of the page changes.
+ // Can be used to update the title of the window.
+ void setPageTitle(const WebKit::WebString&);
+
+ // Called when the URL of the page changes.
+ // Extracts the URL and forwards on to SetAddressBarURL().
+ void updateAddressBar(WebKit::WebView*);
+
+ // Called when the URL of the page changes.
+ // Should be used to update the text of the URL bar.
+ void setAddressBarURL(const WebKit::WebURL&);
+
+ // In the Mac code, this is called to trigger the end of a test after the
+ // page has finished loading. From here, we can generate the dump for the
+ // test.
+ void locationChangeDone(WebKit::WebFrame*);
+
+ void updateForCommittedLoad(WebKit::WebFrame*, bool isNewNavigation);
+ void updateURL(WebKit::WebFrame*);
+ void updateSessionHistory(WebKit::WebFrame*);
+
+ // Dumping a frame to the console.
+ void printFrameDescription(WebKit::WebFrame*);
+
+ // Dumping the user gesture status to the console.
+ void printFrameUserGestureStatus(WebKit::WebFrame*, const char*);
+
+ bool hasWindow() const { return m_hasWindow; }
+ void resetScrollRect();
+ void discardBackingStore();
+
+ // Causes navigation actions just printout the intended navigation instead
+ // of taking you to the page. This is used for cases like mailto, where you
+ // don't actually want to open the mail program.
+ bool m_policyDelegateEnabled;
+
+ // Toggles the behavior of the policy delegate. If true, then navigations
+ // will be allowed. Otherwise, they will be ignored (dropped).
+ bool m_policyDelegateIsPermissive;
+
+ // If true, the policy delegate will signal layout test completion.
+ bool m_policyDelegateShouldNotifyDone;
+
+ // Non-owning pointer. The WebViewHost instance is owned by this TestShell instance.
+ TestShell* m_shell;
+
+ // This delegate works for the following widget.
+ WebKit::WebWidget* m_webWidget;
+
+ // This is non-0 IFF a load is in progress.
+ WebKit::WebFrame* m_topLoadingFrame;
+
+ // For tracking session history. See RenderView.
+ int m_pageId;
+ int m_lastPageIdUpdated;
+
+ OwnPtr<TestShellExtraData> m_pendingExtraData;
+
+ // Maps resource identifiers to a descriptive string.
+ typedef HashMap<unsigned, std::string> ResourceMap;
+ ResourceMap m_resourceIdentifierMap;
+ void printResourceDescription(unsigned identifier);
+
+ WebKit::WebCursorInfo m_currentCursor;
+
+ bool m_hasWindow;
+ bool m_inModalLoop;
+ WebKit::WebRect m_windowRect;
+
+ // true if we want to enable smart insert/delete.
+ bool m_smartInsertDeleteEnabled;
+
+ // true if we want to enable selection of trailing whitespaces
+ bool m_selectTrailingWhitespaceEnabled;
+
+ // Set of headers to clear in willSendRequest.
+ HashSet<WTF::String> m_clearHeaders;
+
+ // true if we should block any redirects
+ bool m_blocksRedirects;
+
+ // true if we should block (set an empty request for) any requests
+ bool m_requestReturnNull;
+
+ // Edit command associated to the current keyboard event.
+ std::string m_editCommandName;
+ std::string m_editCommandValue;
+
+ // The mock spellchecker used in spellCheck().
+ MockSpellCheck m_spellcheck;
+
+ // Painting.
+ OwnPtr<skia::PlatformCanvas> m_canvas;
+ WebKit::WebRect m_paintRect;
+ bool m_isPainting;
+
+ OwnPtr<WebKit::WebContextMenuData> m_lastContextMenuData;
+
+#if !ENABLE(CLIENT_BASED_GEOLOCATION)
+ // Geolocation
+ OwnPtr<WebKit::WebGeolocationServiceMock> m_geolocationServiceMock;
+#endif
+
+ OwnPtr<WebKit::WebDeviceOrientationClientMock> m_deviceOrientationClientMock;
+ OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
+
+ OwnPtr<TestNavigationController*> m_navigationController;
+};
+
+#endif // WebViewHost_h
diff --git a/WebKitTools/DumpRenderTree/chromium/config.h b/WebKitTools/DumpRenderTree/chromium/config.h
new file mode 100644
index 0000000..7dfda18
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/config.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef config_h
+#define config_h
+
+// To avoid confict of LOG in wtf/Assertions.h and LOG in base/logging.h,
+// skip base/loggin.h by defining BASE_LOGGING_H_ and define some macros
+// provided by base/logging.h.
+// FIXME: Remove this hack!
+#include <iostream>
+#define BASE_LOGGING_H_
+#define CHECK(condition) while (false && (condition)) std::cerr
+#define DCHECK(condition) while (false && (condition)) std::cerr
+#define DCHECK_EQ(a, b) while (false && (a) == (b)) std::cerr
+#define DCHECK_NE(a, b) while (false && (a) != (b)) std::cerr
+
+#include <wtf/Platform.h>
+
+#if OS(WINDOWS) && !COMPILER(GCC)
+// Allow 'this' to be used in base member initializer list.
+#pragma warning(disable : 4355)
+// JS_EXPORTDATA is needed to inlucde wtf/WTFString.h.
+#define JS_EXPORTDATA __declspec(dllimport)
+#else
+#define JS_EXPORTDATA
+#endif
+
+#endif // config_h
diff --git a/WebKitTools/DumpRenderTree/chromium/fonts.conf b/WebKitTools/DumpRenderTree/chromium/fonts.conf
new file mode 100644
index 0000000..be214c6
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/chromium/fonts.conf
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- /etc/fonts/fonts.conf file to configure system font access -->
+<fontconfig>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Times</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Times New Roman</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Arial</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans serif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Arial</string>
+ </edit>
+ </match>
+
+ <!-- Some layout tests specify Helvetica as a family and we need to make sure
+ that we don't fallback to Times New Roman for them -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Helvetica</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Arial</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans-serif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Arial</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>serif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Times New Roman</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>mono</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Courier New</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>monospace</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Courier New</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Courier</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Courier New</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>cursive</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Comic Sans MS</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>fantasy</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Impact</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Monaco</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Times New Roman</string>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>NonAntiAliasedSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Arial</string>
+ </edit>
+ <edit name="antialias" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>SlightHintedGeorgia</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Georgia</string>
+ </edit>
+ <edit name="hintstyle" mode="assign">
+ <const>hintslight</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>NonHintedSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Verdana</string>
+ </edit>
+ <!-- These deliberately contradict each other. The 'hinting' preference
+ should take priority -->
+ <edit name="hintstyle" mode="assign">
+ <const>hintfull</const>
+ </edit>
+ <edit name="hinting" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+</fontconfig>
diff --git a/WebKitTools/DumpRenderTree/config.h b/WebKitTools/DumpRenderTree/config.h
index 33dee6d..55e2dc1 100644
--- a/WebKitTools/DumpRenderTree/config.h
+++ b/WebKitTools/DumpRenderTree/config.h
@@ -40,6 +40,18 @@
#define WEBKIT_EXPORTDATA
#endif
+#if PLATFORM(MAC)
+#define WTF_PLATFORM_CF 1
+
+#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
+#define BUILDING_ON_TIGER 1
+#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
+#define BUILDING_ON_LEOPARD 1
+#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
+#define BUILDING_ON_SNOW_LEOPARD 1
+#endif
+#endif // PLATFORM(MAC)
+
#if PLATFORM(WIN)
#define WTF_PLATFORM_CF 1
#if defined(WIN_CAIRO)
diff --git a/WebKitTools/DumpRenderTree/fonts/ColorBits-A.png b/WebKitTools/DumpRenderTree/fonts/ColorBits-A.png
new file mode 100644
index 0000000..8b9319c
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/fonts/ColorBits-A.png
Binary files differ
diff --git a/WebKitTools/DumpRenderTree/fonts/ColorBits.ttf b/WebKitTools/DumpRenderTree/fonts/ColorBits.ttf
new file mode 100644
index 0000000..cd919e8
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/fonts/ColorBits.ttf
Binary files differ
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
index 12653fc..ab9f021 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp
@@ -46,6 +46,12 @@ AccessibilityController::~AccessibilityController()
{
}
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+ // FIXME: implement
+ return 0;
+}
+
AccessibilityUIElement AccessibilityController::focusedElement()
{
AtkObject* accessible = webkit_web_frame_get_focused_accessible_element(mainFrame);
diff --git a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
index abfe115..8493f1a 100644
--- a/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp
@@ -26,6 +26,8 @@
#include "config.h"
#include "AccessibilityUIElement.h"
+#include "GOwnPtr.h"
+#include "GRefPtr.h"
#include <JavaScriptCore/JSStringRef.h>
#include <wtf/Assertions.h>
@@ -75,6 +77,26 @@ void AccessibilityUIElement::getChildrenWithRange(Vector<AccessibilityUIElement>
}
}
+int AccessibilityUIElement::rowCount()
+{
+ if (!m_element)
+ return 0;
+
+ ASSERT(ATK_IS_TABLE(m_element));
+
+ return atk_table_get_n_rows(ATK_TABLE(m_element));
+}
+
+int AccessibilityUIElement::columnCount()
+{
+ if (!m_element)
+ return 0;
+
+ ASSERT(ATK_IS_TABLE(m_element));
+
+ return atk_table_get_n_columns(ATK_TABLE(m_element));
+}
+
int AccessibilityUIElement::childrenCount()
{
if (!m_element)
@@ -91,6 +113,12 @@ AccessibilityUIElement AccessibilityUIElement::elementAtPoint(int x, int y)
return 0;
}
+AccessibilityUIElement AccessibilityUIElement::linkedUIElementAtIndex(unsigned index)
+{
+ // FIXME: implement
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index)
{
Vector<AccessibilityUIElement> children;
@@ -108,10 +136,22 @@ unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement* element)
return 0;
}
+gchar* attributeSetToString(AtkAttributeSet* attributeSet)
+{
+ GString* str = g_string_new(0);
+ for (GSList* attributes = attributeSet; attributes; attributes = attributes->next) {
+ AtkAttribute* attribute = static_cast<AtkAttribute*>(attributes->data);
+ g_string_append(str, g_strconcat(attribute->name, ":", attribute->value, NULL));
+ if (attributes->next)
+ g_string_append(str, ", ");
+ }
+
+ return g_string_free(str, FALSE);
+}
+
JSStringRef AccessibilityUIElement::allAttributes()
{
- // FIXME: implement
- return JSStringCreateWithCharacters(0, 0);
+ return JSStringCreateWithUTF8CString(attributeSetToString(atk_object_get_attributes(ATK_OBJECT(m_element))));
}
JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements()
@@ -134,9 +174,12 @@ AccessibilityUIElement AccessibilityUIElement::titleUIElement()
AccessibilityUIElement AccessibilityUIElement::parentElement()
{
- ASSERT(m_element);
- AtkObject* parent = atk_object_get_parent(ATK_OBJECT(m_element));
+ if (!m_element)
+ return 0;
+ ASSERT(ATK_IS_OBJECT(m_element));
+
+ AtkObject* parent = atk_object_get_parent(ATK_OBJECT(m_element));
return parent ? AccessibilityUIElement(parent) : 0;
}
@@ -159,7 +202,10 @@ JSStringRef AccessibilityUIElement::role()
if (!role)
return JSStringCreateWithCharacters(0, 0);
- return JSStringCreateWithUTF8CString(atk_role_get_name(role));
+ const gchar* roleName = atk_role_get_name(role);
+ GOwnPtr<gchar> axRole(g_strdup_printf("AXRole: %s", roleName));
+
+ return JSStringCreateWithUTF8CString(axRole.get());
}
JSStringRef AccessibilityUIElement::subrole()
@@ -179,7 +225,9 @@ JSStringRef AccessibilityUIElement::title()
if (!name)
return JSStringCreateWithCharacters(0, 0);
- return JSStringCreateWithUTF8CString(name);
+ GOwnPtr<gchar> axTitle(g_strdup_printf("AXTitle: %s", name));
+
+ return JSStringCreateWithUTF8CString(axTitle.get());
}
JSStringRef AccessibilityUIElement::description()
@@ -189,7 +237,9 @@ JSStringRef AccessibilityUIElement::description()
if (!description)
return JSStringCreateWithCharacters(0, 0);
- return JSStringCreateWithUTF8CString(description);
+ GOwnPtr<gchar> axDesc(g_strdup_printf("AXDescription: %s", description));
+
+ return JSStringCreateWithUTF8CString(axDesc.get());
}
JSStringRef AccessibilityUIElement::stringValue()
@@ -204,6 +254,11 @@ JSStringRef AccessibilityUIElement::language()
return JSStringCreateWithCharacters(0, 0);
}
+JSStringRef AccessibilityUIElement::helpText() const
+{
+ return 0;
+}
+
double AccessibilityUIElement::x()
{
int x, y;
@@ -339,8 +394,13 @@ bool AccessibilityUIElement::isRequired() const
bool AccessibilityUIElement::isSelected() const
{
- // FIXME: implement
- return false;
+ if (!ATK_IS_OBJECT(m_element))
+ return false;
+
+ PlatformRefPtr<AtkStateSet> stateSet = adoptPlatformRef(atk_object_ref_state_set(ATK_OBJECT(m_element)));
+ gboolean isSelected = atk_state_set_contains_state(stateSet.get(), ATK_STATE_SELECTED);
+
+ return isSelected;
}
int AccessibilityUIElement::hierarchicalLevel() const
@@ -442,6 +502,18 @@ JSStringRef AccessibilityUIElement::stringForRange(unsigned, unsigned)
return JSStringCreateWithCharacters(0, 0);
}
+JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
+{
+ // FIXME: implement
+ return JSStringCreateWithCharacters(0, 0);
+}
+
+bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length)
+{
+ // FIXME: implement
+ return false;
+}
+
AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row)
{
// FIXME: implement
@@ -492,6 +564,11 @@ void AccessibilityUIElement::decrement()
// FIXME: implement
}
+void AccessibilityUIElement::press()
+{
+ // FIXME: implement
+}
+
void AccessibilityUIElement::showMenu()
{
// FIXME: implement
@@ -558,6 +635,11 @@ bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallbac
return false;
}
+void AccessibilityUIElement::removeNotificationListener()
+{
+ // FIXME: implement
+}
+
bool AccessibilityUIElement::isSelectable() const
{
// FIXME: implement
@@ -588,6 +670,12 @@ bool AccessibilityUIElement::isCollapsed() const
return false;
}
+bool AccessibilityUIElement::isIgnored() const
+{
+ // FIXME: implement
+ return false;
+}
+
bool AccessibilityUIElement::hasPopup() const
{
// FIXME: implement
diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index 39430cf..5aa61e3 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
@@ -34,24 +35,25 @@
#include "AccessibilityController.h"
#include "EventSender.h"
#include "GCController.h"
+#include "GOwnPtr.h"
#include "LayoutTestController.h"
+#include "PixelDumpSupport.h"
+#include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
#include "WorkQueue.h"
#include "WorkQueueItem.h"
-
+#include <JavaScriptCore/JavaScript.h>
+#include <cassert>
+#include <cstdlib>
+#include <cstring>
+#include <getopt.h>
#include <gtk/gtk.h>
#include <webkit/webkit.h>
-#include <JavaScriptCore/JavaScript.h>
-
#include <wtf/Assertions.h>
#if PLATFORM(X11)
#include <fontconfig/fontconfig.h>
#endif
-#include <cassert>
-#include <getopt.h>
-#include <stdlib.h>
-#include <string.h>
using namespace std;
@@ -67,7 +69,6 @@ extern guint webkit_web_frame_get_pending_unload_event_count(WebKitWebFrame* fra
extern void webkit_web_settings_add_extra_plugin_directory(WebKitWebView* view, const gchar* directory);
extern gchar* webkit_web_frame_get_response_mime_type(WebKitWebFrame* frame);
extern void webkit_web_frame_clear_main_frame_name(WebKitWebFrame* frame);
-extern void webkit_web_view_set_group_name(WebKitWebView* view, const gchar* groupName);
extern void webkit_reset_origin_access_white_lists();
}
@@ -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;
@@ -94,29 +95,23 @@ GSList* webViewList = 0;
// current b/f item at the end of the previous test
static WebKitWebHistoryItem* prevTestBFItem = NULL;
-const unsigned maxViewHeight = 600;
-const unsigned maxViewWidth = 800;
const unsigned historyItemIndent = 8;
-static gchar* autocorrectURL(const gchar* url)
-{
- 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);
- }
+static void runTest(const string& testPathOrURL);
- return g_strdup(url);
+static bool shouldLogFrameLoadDelegates(const string& pathOrURL)
+{
+ return pathOrURL.find("loading/") != string::npos;
}
-static bool shouldLogFrameLoadDelegates(const char* pathOrURL)
+static bool shouldOpenWebInspector(const string& pathOrURL)
{
- return strstr(pathOrURL, "loading/");
+ return pathOrURL.find("inspector/") != string::npos;
}
-static bool shouldOpenWebInspector(const char* pathOrURL)
+static bool shouldEnableDeveloperExtras(const string& pathOrURL)
{
- return strstr(pathOrURL, "inspector/");
+ return shouldOpenWebInspector(pathOrURL) || pathOrURL.find("inspector-enabled/") != string::npos;
}
void dumpFrameScrollPosition(WebKitWebFrame* frame)
@@ -136,40 +131,117 @@ static void appendString(gchar*& target, gchar* string)
g_free(oldString);
}
-#if PLATFORM(X11)
-static void initializeFonts()
+static void initializeGtkFontSettings(const char* testURL)
{
- static int numFonts = -1;
+ GtkSettings* settings = gtk_settings_get_default();
+ if (!settings)
+ return;
+ g_object_set(settings, "gtk-xft-antialias", 1,
+ "gtk-xft-hinting", 0,
+ "gtk-font-name", "Liberation Sans 16", NULL);
+
+ // One test needs subpixel anti-aliasing turned on, but generally we
+ // want all text in other tests to use to grayscale anti-aliasing.
+ if (testURL && strstr(testURL, "xsettings_antialias_settings.html"))
+ g_object_set(settings, "gtk-xft-rgba", "rgb", NULL);
+ else
+ g_object_set(settings, "gtk-xft-rgba", "none", NULL);
+}
+
+static void initializeFonts(const char* testURL = 0)
+{
+#if PLATFORM(X11)
+ initializeGtkFontSettings(testURL);
- // Some tests may add or remove fonts via the @font-face rule.
- // If that happens, font config should be re-created to suppress any unwanted change.
+ FcInit();
+
+ // If a test resulted a font being added or removed via the @font-face rule, then
+ // we want to reset the FontConfig configuration to prevent it from affecting other tests.
+ static int numFonts = 0;
FcFontSet* appFontSet = FcConfigGetFonts(0, FcSetApplication);
- if (appFontSet && numFonts >= 0 && appFontSet->nfont == numFonts)
+ if (appFontSet && numFonts && appFontSet->nfont == numFonts)
return;
- const char* fontDirEnv = g_getenv("WEBKIT_TESTFONTS");
- if (!fontDirEnv)
- g_error("WEBKIT_TESTFONTS environment variable is not set, but it should point to the directory "
- "containing the fonts you can clone from git://gitorious.org/qtwebkit/testfonts.git\n");
+ // Load our configuration file, which sets up proper aliases for family
+ // names like sans, serif and monospace.
+ FcConfig* config = FcConfigCreate();
+ GOwnPtr<gchar> fontConfigFilename(g_build_filename(FONTS_CONF_DIR, "fonts.conf", NULL));
+ if (!FcConfigParseAndLoad(config, reinterpret_cast<FcChar8*>(fontConfigFilename.get()), true))
+ g_error("Couldn't load font configuration file from: %s", fontConfigFilename.get());
+
+ static const char *const fontPaths[][2] = {
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-BoldItalic.ttf",
+ "/usr/share/fonts/liberation/LiberationMono-BoldItalic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Bold.ttf",
+ "/usr/share/fonts/liberation/LiberationMono-Bold.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Italic.ttf",
+ "/usr/share/fonts/liberation/LiberationMono-Italic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationMono-Regular.ttf",
+ "/usr/share/fonts/liberation/LiberationMono-Regular.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-BoldItalic.ttf",
+ "/usr/share/fonts/liberation/LiberationSans-BoldItalic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Bold.ttf",
+ "/usr/share/fonts/liberation/LiberationSans-Bold.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Italic.ttf",
+ "/usr/share/fonts/liberation/LiberationSans-Italic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf",
+ "/usr/share/fonts/liberation/LiberationSans-Regular.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-BoldItalic.ttf",
+ "/usr/share/fonts/liberation/LiberationSerif-BoldItalic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-Bold.ttf",
+ "/usr/share/fonts/liberation/LiberationSerif-Bold.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-Italic.ttf",
+ "/usr/share/fonts/liberation/LiberationSerif-Italic.ttf", },
+ { "/usr/share/fonts/truetype/ttf-liberation/LiberationSerif-Regular.ttf",
+ "/usr/share/fonts/liberation/LiberationSerif-Regular.ttf", },
+ { "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf",
+ "/usr/share/fonts/dejavu/DejaVuSans.ttf", },
+ { "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf",
+ "/usr/share/fonts/dejavu/DejaVuSerif.ttf", },
+
+ // MathML tests require the STIX fonts.
+ { "/usr/share/fonts/opentype/stix/STIXGeneral.otf",
+ "/usr/share/fonts/stix/STIXGeneral.otf" },
+ { "/usr/share/fonts/opentype/stix/STIXGeneralBolIta.otf",
+ "/usr/share/fonts/stix/STIXGeneralBolIta.otf" },
+ { "/usr/share/fonts/opentype/stix/STIXGeneralBol.otf",
+ "/usr/share/fonts/stix/STIXGeneralBol.otf" },
+ { "/usr/share/fonts/opentype/stix/STIXGeneralItalic.otf",
+ "/usr/share/fonts/stix/STIXGeneralItalic.otf" }
+ };
- GFile* fontDir = g_file_new_for_path(fontDirEnv);
- if (!fontDir || !g_file_query_exists(fontDir, NULL))
- g_error("WEBKIT_TESTFONTS environment variable is not set correctly - it should point to the directory "
- "containing the fonts you can clone from git://gitorious.org/qtwebkit/testfonts.git\n");
+ // TODO: Some tests use Lucida. We should load these as well, once it becomes
+ // clear how to install these fonts easily on Fedora.
+ for (size_t font = 0; font < G_N_ELEMENTS(fontPaths); font++) {
+ bool found = false;
+ for (size_t path = 0; path < 2; path++) {
+
+ if (g_file_test(fontPaths[font][path], G_FILE_TEST_EXISTS)) {
+ found = true;
+ if (!FcConfigAppFontAddFile(config, reinterpret_cast<const FcChar8*>(fontPaths[font][path])))
+ g_error("Could not load font at %s!", fontPaths[font][path]);
+ else
+ break;
+ }
+ }
- FcConfig *config = FcConfigCreate();
- if (!FcConfigParseAndLoad (config, (FcChar8*) FONTS_CONF_FILE, true))
- g_error("Couldn't load font configuration file");
- if (!FcConfigAppFontAddDir (config, (FcChar8*) g_file_get_path(fontDir)))
- g_error("Couldn't add font dir!");
- FcConfigSetCurrent(config);
+ if (!found)
+ g_error("Could not find font at %s. Either install this font or file a bug "
+ "at http://bugs.webkit.org if it is installed in another location.",
+ fontPaths[font][0]);
+ }
- g_object_unref(fontDir);
+ // Ahem is used by many layout tests.
+ GOwnPtr<gchar> ahemFontFilename(g_build_filename(FONTS_CONF_DIR, "AHEM____.TTF", NULL));
+ if (!FcConfigAppFontAddFile(config, reinterpret_cast<FcChar8*>(ahemFontFilename.get())))
+ g_error("Could not load font at %s!", ahemFontFilename.get());
- appFontSet = FcConfigGetFonts(config, FcSetApplication);
- numFonts = appFontSet->nfont;
-}
+ if (!FcConfigSetCurrent(config))
+ g_error("Could not set the current font configuration!");
+
+ numFonts = FcConfigGetFonts(config, FcSetApplication)->nfont;
#endif
+}
static gchar* dumpFramesAsText(WebKitWebFrame* frame)
{
@@ -321,6 +393,9 @@ static void resetDefaultsToConsistentValues()
"enable-html5-database", TRUE,
"enable-html5-local-storage", TRUE,
"enable-xss-auditor", FALSE,
+ "enable-spatial-navigation", FALSE,
+ "enable-frame-flattening", FALSE,
+ "javascript-can-access-clipboard", TRUE,
"javascript-can-open-windows-automatically", TRUE,
"enable-offline-web-application-cache", TRUE,
"enable-universal-access-from-file-uris", TRUE,
@@ -330,11 +405,18 @@ static void resetDefaultsToConsistentValues()
"monospace-font-family", "Courier",
"serif-font-family", "Times",
"sans-serif-font-family", "Helvetica",
+ "cursive-font-family", "cursive",
+ "fantasy-font-family", "fantasy",
"default-font-size", 16,
"default-monospace-font-size", 13,
"minimum-font-size", 1,
"enable-caret-browsing", FALSE,
"enable-page-cache", FALSE,
+ "auto-resize-window", TRUE,
+ "enable-java-applet", FALSE,
+ "enable-plugins", TRUE,
+ "enable-hyperlink-auditing", FALSE,
+ "editing-behavior", WEBKIT_EDITING_BEHAVIOR_MAC,
NULL);
webkit_web_frame_clear_main_frame_name(mainFrame);
@@ -346,9 +428,68 @@ static void resetDefaultsToConsistentValues()
webkit_reset_origin_access_white_lists();
+ WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list(webView);
+ webkit_web_back_forward_list_clear(list);
+
+#ifdef HAVE_LIBSOUP_2_29_90
+ SoupSession* session = webkit_get_default_session();
+ SoupCookieJar* jar = reinterpret_cast<SoupCookieJar*>(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR));
+
+ // We only create the jar when the soup backend needs to do
+ // HTTP. Should we initialize it earlier, perhaps?
+ if (jar)
+ g_object_set(G_OBJECT(jar), SOUP_COOKIE_JAR_ACCEPT_POLICY, SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY, NULL);
+#endif
+
setlocale(LC_ALL, "");
+
+ DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain(true);
}
+static bool useLongRunningServerMode(int argc, char *argv[])
+{
+ // This assumes you've already called getopt_long
+ return (argc == optind+1 && !strcmp(argv[optind], "-"));
+}
+
+static void runTestingServerLoop()
+{
+ // When DumpRenderTree runs in server mode, we just wait around for file names
+ // to be passed to us and read each in turn, passing the results back to the client
+ char filenameBuffer[2048];
+ while (fgets(filenameBuffer, sizeof(filenameBuffer), stdin)) {
+ char* newLineCharacter = strchr(filenameBuffer, '\n');
+ if (newLineCharacter)
+ *newLineCharacter = '\0';
+
+ if (!strlen(filenameBuffer))
+ continue;
+
+ runTest(filenameBuffer);
+ }
+}
+
+static void initializeGlobalsFromCommandLineOptions(int argc, char *argv[])
+{
+ struct option options[] = {
+ {"notree", no_argument, &dumpTree, false},
+ {"pixel-tests", no_argument, &dumpPixels, true},
+ {"tree", no_argument, &dumpTree, true},
+ {NULL, 0, NULL, 0}
+ };
+
+ int option;
+ while ((option = getopt_long(argc, (char * const *)argv, "", options, NULL)) != -1) {
+ switch (option) {
+ case '?': // unknown or ambiguous option
+ case ':': // missing argument
+ exit(1);
+ break;
+ }
+ }
+}
+
+
void dump()
{
invalidateAnyPreviousWaitToDumpWatchdog();
@@ -369,8 +510,18 @@ void dump()
if (gLayoutTestController->dumpAsText())
result = dumpFramesAsText(mainFrame);
- else
+ else {
+ // Widget resizing is done asynchronously in GTK+. We pump the main
+ // loop here, to flush any pending resize requests. This prevents
+ // timing issues which affect the size of elements in the output.
+ // We only enable this workaround for tests that print the render tree
+ // because this seems to break some dumpAsText tests: see bug 39988
+ // After fixing that test, we should apply this approach to all dumps.
+ while (gtk_events_pending())
+ gtk_main_iteration();
+
result = webkit_web_frame_dump_render_tree(mainFrame);
+ }
if (!result) {
const char* errorMessage;
@@ -401,11 +552,11 @@ void dump()
}
}
- if (dumpPixels) {
- if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive()) {
- // FIXME: Add support for dumping pixels
- }
- }
+ if (dumpPixels
+ && gLayoutTestController->generatePixelResults()
+ && !gLayoutTestController->dumpDOMAsWebArchive()
+ && !gLayoutTestController->dumpSourceAsWebArchive())
+ dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash());
// FIXME: call displayWebView here when we support --paint
@@ -445,40 +596,49 @@ 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 (shouldOpenWebInspector(pathOrURL.c_str()))
- gLayoutTestController->showWebInspector();
+ if (shouldEnableDeveloperExtras(testURL)) {
+ gLayoutTestController->setDeveloperExtrasEnabled(true);
+ 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 : maxViewWidth;
- size.height = isSVGW3CTest ? 360 : maxViewHeight;
+ size.width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth;
+ size.height = isSVGW3CTest ? 360 : LayoutTestController::maxViewHeight;
gtk_window_resize(GTK_WINDOW(window), size.width, size.height);
gtk_widget_size_allocate(container, &size);
@@ -489,21 +649,19 @@ static void runTest(const string& testPathOrURL)
if (prevTestBFItem)
g_object_ref(prevTestBFItem);
-#if PLATFORM(X11)
- initializeFonts();
-#endif
+ initializeFonts(testURL.c_str());
// 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 (shouldOpenWebInspector(pathOrURL.c_str()))
+ // If developer extras enabled Web Inspector may have been open by the test.
+ if (shouldEnableDeveloperExtras(testURL)) {
gLayoutTestController->closeWebInspector();
+ gLayoutTestController->setDeveloperExtrasEnabled(false);
+ }
// Also check if we still have opened webViews and free them.
if (gLayoutTestController->closeRemainingWindowsWhenComplete() || webViewList) {
@@ -518,8 +676,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();
@@ -550,7 +707,7 @@ static char* getFrameNameSuitableForTestResult(WebKitWebView* view, WebKitWebFra
// This is a bit strange. Shouldn't web_frame_get_name return NULL?
if (frameName && (frameName[0] != '\0')) {
char* tmp = g_strdup_printf("main frame \"%s\"", frameName);
- g_free (frameName);
+ g_free(frameName);
frameName = tmp;
} else {
g_free(frameName);
@@ -559,6 +716,10 @@ static char* getFrameNameSuitableForTestResult(WebKitWebView* view, WebKitWebFra
} else if (!frameName || (frameName[0] == '\0')) {
g_free(frameName);
frameName = g_strdup("frame (anonymous)");
+ } else {
+ char* tmp = g_strdup_printf("frame \"%s\"", frameName);
+ g_free(frameName);
+ frameName = tmp;
}
return frameName;
@@ -566,15 +727,6 @@ static char* getFrameNameSuitableForTestResult(WebKitWebView* view, WebKitWebFra
static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*)
{
- if (!done && !gLayoutTestController->dumpFrameLoadCallbacks()) {
- guint pendingFrameUnloadEvents = webkit_web_frame_get_pending_unload_event_count(frame);
- if (pendingFrameUnloadEvents) {
- char* frameName = getFrameNameSuitableForTestResult(view, frame);
- printf("%s - has %u onunload handler(s)\n", frameName, pendingFrameUnloadEvents);
- g_free(frameName);
- }
- }
-
if (frame != topLoadingFrame)
return;
@@ -589,6 +741,31 @@ static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void
dump();
}
+static void webViewDocumentLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*)
+{
+ if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ char* frameName = getFrameNameSuitableForTestResult(view, frame);
+ printf("%s - didFinishDocumentLoadForFrame\n", frameName);
+ g_free(frameName);
+ } else if (!done) {
+ guint pendingFrameUnloadEvents = webkit_web_frame_get_pending_unload_event_count(frame);
+ if (pendingFrameUnloadEvents) {
+ char* frameName = getFrameNameSuitableForTestResult(view, frame);
+ printf("%s - has %u onunload handler(s)\n", frameName, pendingFrameUnloadEvents);
+ g_free(frameName);
+ }
+ }
+}
+
+static void webViewOnloadEvent(WebKitWebView* view, WebKitWebFrame* frame, void*)
+{
+ if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) {
+ char* frameName = getFrameNameSuitableForTestResult(view, frame);
+ printf("%s - didHandleOnloadEventsForFrame\n", frameName);
+ g_free(frameName);
+ }
+}
+
static void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* frame, JSGlobalContextRef context, JSObjectRef windowObject, gpointer data)
{
JSValueRef exception = 0;
@@ -604,14 +781,33 @@ static void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* fram
ASSERT(!exception);
JSStringRef eventSenderStr = JSStringCreateWithUTF8CString("eventSender");
- JSValueRef eventSender = makeEventSender(context);
+ JSValueRef eventSender = makeEventSender(context, !webkit_web_frame_get_parent(frame));
JSObjectSetProperty(context, windowObject, eventSenderStr, eventSender, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0);
JSStringRelease(eventSenderStr);
}
static gboolean webViewConsoleMessage(WebKitWebView* view, const gchar* message, unsigned int line, const gchar* sourceId, gpointer data)
{
- fprintf(stdout, "CONSOLE MESSAGE: line %d: %s\n", line, message);
+ gchar* testMessage = 0;
+ const gchar* uriScheme;
+
+ // Tests expect only the filename part of local URIs
+ uriScheme = g_strstr_len(message, -1, "file://");
+ if (uriScheme) {
+ GString* tempString = g_string_sized_new(strlen(message));
+ gchar* filename = g_strrstr(uriScheme, G_DIR_SEPARATOR_S);
+
+ if (filename) {
+ filename += strlen(G_DIR_SEPARATOR_S);
+ tempString = g_string_append_len(tempString, message, (uriScheme - message));
+ tempString = g_string_append_len(tempString, filename, strlen(filename));
+ testMessage = g_string_free(tempString, FALSE);
+ }
+ }
+
+ fprintf(stdout, "CONSOLE MESSAGE: line %d: %s\n", line, testMessage ? testMessage : message);
+ g_free(testMessage);
+
return TRUE;
}
@@ -725,6 +921,19 @@ static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, We
webkit_security_origin_set_web_database_quota(origin, 5 * 1024 * 1024);
}
+static bool
+geolocationPolicyDecisionRequested(WebKitWebView*, WebKitWebFrame*, WebKitGeolocationPolicyDecision* decision)
+{
+ if (!gLayoutTestController->isGeolocationPermissionSet())
+ return FALSE;
+ if (gLayoutTestController->geolocationPermission())
+ webkit_geolocation_policy_allow(decision);
+ else
+ webkit_geolocation_policy_deny(decision);
+
+ return TRUE;
+}
+
static WebKitWebView* webViewCreate(WebKitWebView*, WebKitWebFrame*);
@@ -753,13 +962,42 @@ static WebKitWebView* webInspectorInspectWebView(WebKitWebInspector*, gpointer d
return WEBKIT_WEB_VIEW(webView);
}
+static void webFrameLoadStatusNotified(WebKitWebFrame* frame, gpointer user_data)
+{
+ WebKitLoadStatus loadStatus = webkit_web_frame_get_load_status(frame);
+
+ if (gLayoutTestController->dumpFrameLoadCallbacks()) {
+ GOwnPtr<char> frameName(getFrameNameSuitableForTestResult(webkit_web_frame_get_web_view(frame), frame));
+
+ switch (loadStatus) {
+ case WEBKIT_LOAD_PROVISIONAL:
+ if (!done)
+ printf("%s - didStartProvisionalLoadForFrame\n", frameName.get());
+ break;
+ case WEBKIT_LOAD_COMMITTED:
+ if (!done)
+ printf("%s - didCommitLoadForFrame\n", frameName.get());
+ break;
+ case WEBKIT_LOAD_FINISHED:
+ if (frame != topLoadingFrame || !done)
+ printf("%s - didFinishLoadForFrame\n", frameName.get());
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+static void frameCreatedCallback(WebKitWebView* webView, WebKitWebFrame* webFrame, gpointer user_data)
+{
+ g_signal_connect(webFrame, "notify::load-status", G_CALLBACK(webFrameLoadStatusNotified), NULL);
+}
+
static WebKitWebView* createWebView()
{
WebKitWebView* view = WEBKIT_WEB_VIEW(webkit_web_view_new());
- // From bug 11756: Use a frame group name for all WebViews created by
- // DumpRenderTree to allow testing of cross-page frame lookup.
- webkit_web_view_set_group_name(view, "org.webkit.gtk.DumpRenderTree");
+ DumpRenderTreeSupportGtk::setDumpRenderTreeModeEnabled(true);
g_object_connect(G_OBJECT(view),
"signal::load-started", webViewLoadStarted, 0,
@@ -775,6 +1013,14 @@ static WebKitWebView* createWebView()
"signal::create-web-view", webViewCreate, 0,
"signal::close-web-view", webViewClose, 0,
"signal::database-quota-exceeded", databaseQuotaExceeded, 0,
+ "signal::document-load-finished", webViewDocumentLoadFinished, 0,
+ "signal::geolocation-policy-decision-requested", geolocationPolicyDecisionRequested, 0,
+ "signal::onload-event", webViewOnloadEvent, 0,
+ "signal::drag-begin", dragBeginCallback, 0,
+ "signal::drag-end", dragEndCallback, 0,
+ "signal::drag-failed", dragFailedCallback, 0,
+ "signal::frame-created", frameCreatedCallback, 0,
+
NULL);
WebKitWebInspector* inspector = webkit_web_view_get_inspector(view);
@@ -789,6 +1035,10 @@ static WebKitWebView* createWebView()
webkit_web_view_set_settings(view, settings);
}
+ // frame-created is not issued for main frame. That's why we must do this here
+ WebKitWebFrame* frame = webkit_web_view_get_main_frame(view);
+ g_signal_connect(frame, "notify::load-status", G_CALLBACK(webFrameLoadStatusNotified), NULL);
+
return view;
}
@@ -806,31 +1056,24 @@ static WebKitWebView* webViewCreate(WebKitWebView* view, WebKitWebFrame* frame)
return newWebView;
}
+static void logHandler(const gchar* domain, GLogLevelFlags level, const gchar* message, gpointer data)
+{
+ if (level < G_LOG_LEVEL_DEBUG)
+ fprintf(stderr, "%s\n", message);
+}
+
int main(int argc, char* argv[])
{
g_thread_init(NULL);
gtk_init(&argc, &argv);
-#if PLATFORM(X11)
- FcInit();
- initializeFonts();
-#endif
+ // Some plugins might try to use the GLib logger for printing debug
+ // messages. This will cause tests to fail because of unexpected output.
+ // We squelch all debug messages sent to the logger.
+ g_log_set_default_handler(logHandler, 0);
- struct option options[] = {
- {"notree", no_argument, &dumpTree, false},
- {"pixel-tests", no_argument, &dumpPixels, true},
- {"tree", no_argument, &dumpTree, true},
- {NULL, 0, NULL, 0}
- };
-
- int option;
- while ((option = getopt_long(argc, (char* const*)argv, "", options, NULL)) != -1)
- switch (option) {
- case '?': // unknown or ambiguous option
- case ':': // missing argument
- exit(1);
- break;
- }
+ initializeGlobalsFromCommandLineOptions(argc, argv);
+ initializeFonts();
window = gtk_window_new(GTK_WINDOW_POPUP);
container = GTK_WIDGET(gtk_scrolled_window_new(NULL, NULL));
@@ -850,19 +1093,9 @@ int main(int argc, char* argv[])
gcController = new GCController();
axController = new AccessibilityController();
- if (argc == optind+1 && strcmp(argv[optind], "-") == 0) {
- char filenameBuffer[2048];
+ if (useLongRunningServerMode(argc, argv)) {
printSeparators = true;
- while (fgets(filenameBuffer, sizeof(filenameBuffer), stdin)) {
- char* newLineCharacter = strchr(filenameBuffer, '\n');
- if (newLineCharacter)
- *newLineCharacter = '\0';
-
- if (strlen(filenameBuffer) == 0)
- continue;
-
- runTest(filenameBuffer);
- }
+ runTestingServerLoop();
} else {
printSeparators = (optind < argc-1 || (dumpPixels && dumpTree));
for (int i = optind; i != argc; ++i)
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
index 458e0ba..6e5fa5f 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
@@ -2,6 +2,7 @@
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2009 Zan Dobersek <zandobersek@gmail.com>
* Copyright (C) 2009 Holger Hans Peter Freyther
+ * 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
@@ -33,6 +34,7 @@
#include "DumpRenderTree.h"
+#include <GtkVersioning.h>
#include <JavaScriptCore/JSObjectRef.h>
#include <JavaScriptCore/JSRetainPtr.h>
#include <JavaScriptCore/JSStringRef.h>
@@ -40,33 +42,33 @@
#include <webkit/webkitwebview.h>
#include <wtf/ASCIICType.h>
#include <wtf/Platform.h>
+#include <wtf/text/CString.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
#include <string.h>
-// TODO: Currently drag and drop related code is left out and
-// should be merged once we have drag and drop support in WebCore.
-
extern "C" {
extern void webkit_web_frame_layout(WebKitWebFrame* frame);
+ extern GtkMenu* webkit_web_view_get_context_menu(WebKitWebView*);
}
-static bool down = false;
-static bool currentEventButton = 1;
-static bool dragMode = true;
-static bool replayingSavedEvents = false;
+static bool dragMode;
+static int timeOffset = 0;
+
static int lastMousePositionX;
static int lastMousePositionY;
-
static int lastClickPositionX;
static int lastClickPositionY;
-static int clickCount = 0;
+static int lastClickTimeOffset;
+static int lastClickButton;
+static int buttonCurrentlyDown;
+static int clickCount;
+GdkDragContext* currentDragSourceContext;
struct DelayedMessage {
- GdkEvent event;
+ GdkEvent* event;
gulong delay;
- gboolean isDragEvent;
};
static DelayedMessage msgQueue[1024];
@@ -84,6 +86,10 @@ enum KeyLocationCode {
DOM_KEY_LOCATION_NUMPAD = 0x03
};
+static void sendOrQueueEvent(GdkEvent*, bool = true);
+static void dispatchEvent(GdkEvent* event);
+static guint getStateFlags();
+
static JSValueRef getDragModeCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
return JSValueMakeBoolean(context, dragMode);
@@ -97,186 +103,237 @@ static bool setDragModeCallback(JSContextRef context, JSObjectRef object, JSStri
static JSValueRef leapForwardCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- // FIXME: Add proper support for forward leaps
+ if (argumentCount > 0) {
+ msgQueue[endOfQueue].delay = JSValueToNumber(context, arguments[0], exception);
+ timeOffset += msgQueue[endOfQueue].delay;
+ ASSERT(!exception || !*exception);
+ }
+
return JSValueMakeUndefined(context);
}
-static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber, guint modifiers)
{
- webkit_web_frame_layout(mainFrame);
-
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
if (!view)
- return JSValueMakeUndefined(context);
-
- GdkEvent event;
- memset(&event, 0, sizeof(event));
- event.button.button = 3;
- event.button.x = lastMousePositionX;
- event.button.y = lastMousePositionY;
- event.button.window = GTK_WIDGET(view)->window;
+ return false;
+
+ // The logic for mapping EventSender button numbers to GDK button
+ // numbers originates from the Windows EventSender.
+ int gdkButtonNumber = 3;
+ if (eventSenderButtonNumber >= 0 && eventSenderButtonNumber <= 2)
+ gdkButtonNumber = eventSenderButtonNumber + 1;
+
+ // fast/events/mouse-click-events expects the 4th button
+ // to be event->button = 1, so send a middle-button event.
+ else if (eventSenderButtonNumber == 3)
+ gdkButtonNumber = 2;
+
+ event->button.button = gdkButtonNumber;
+ event->button.x = lastMousePositionX;
+ event->button.y = lastMousePositionY;
+ event->button.window = gtk_widget_get_window(GTK_WIDGET(view));
+ g_object_ref(event->button.window);
+ event->button.device = getDefaultGDKPointerDevice(event->button.window);
+ event->button.state = modifiers | getStateFlags();
+ event->button.time = GDK_CURRENT_TIME;
+ event->button.axes = 0;
+
+ int xRoot, yRoot;
+ gdk_window_get_root_coords(gtk_widget_get_window(GTK_WIDGET(view)), lastMousePositionX, lastMousePositionY, &xRoot, &yRoot);
+ event->button.x_root = xRoot;
+ event->button.y_root = yRoot;
- gboolean return_val;
- down = true;
- event.type = GDK_BUTTON_PRESS;
- g_signal_emit_by_name(view, "button_press_event", &event, &return_val);
-
- down = false;
- event.type = GDK_BUTTON_RELEASE;
- g_signal_emit_by_name(view, "button_release_event", &event, &return_val);
-
- return JSValueMakeUndefined(context);
+ return true;
}
-static void updateClickCount(int button)
+static JSValueRef getMenuItemTitleCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
- // FIXME: take the last clicked button number and the time of last click into account.
- if (lastClickPositionX != lastMousePositionX || lastClickPositionY != lastMousePositionY || currentEventButton != button)
- clickCount = 1;
+ GtkWidget* widget = GTK_WIDGET(JSObjectGetPrivate(object));
+ CString label;
+ if (GTK_IS_SEPARATOR_MENU_ITEM(widget))
+ label = "<separator>";
else
- clickCount++;
+ label = gtk_menu_item_get_label(GTK_MENU_ITEM(widget));
+
+ return JSValueMakeString(context, JSStringCreateWithUTF8CString(label.data()));
}
-#if !GTK_CHECK_VERSION(2,17,3)
-static void getRootCoords(GtkWidget* view, int* rootX, int* rootY)
+static bool setMenuItemTitleCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef value, JSValueRef* exception)
{
- GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(view));
- int tmpX, tmpY;
+ return true;
+}
- gtk_widget_translate_coordinates(view, window, lastMousePositionX, lastMousePositionY, &tmpX, &tmpY);
+static JSValueRef menuItemClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ GtkMenuItem* item = GTK_MENU_ITEM(JSObjectGetPrivate(thisObject));
+ gtk_menu_item_activate(item);
+ return JSValueMakeUndefined(context);
+}
- gdk_window_get_origin(window->window, rootX, rootY);
+static JSStaticFunction staticMenuItemFunctions[] = {
+ { "click", menuItemClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { 0, 0, 0 }
+};
- *rootX += tmpX;
- *rootY += tmpY;
-}
-#endif
+static JSStaticValue staticMenuItemValues[] = {
+ { "title", getMenuItemTitleCallback, setMenuItemTitleCallback, kJSPropertyAttributeNone },
+ { 0, 0, 0, 0 }
+};
-static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSClassRef getMenuItemClass()
{
- WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
- if (!view)
- return JSValueMakeUndefined(context);
+ static JSClassRef menuItemClass = 0;
- down = true;
-
- GdkEvent event;
- memset(&event, 0, sizeof(event));
- event.type = GDK_BUTTON_PRESS;
- event.button.button = 1;
+ if (!menuItemClass) {
+ JSClassDefinition classDefinition = {
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ classDefinition.staticFunctions = staticMenuItemFunctions;
+ classDefinition.staticValues = staticMenuItemValues;
- if (argumentCount == 1) {
- event.button.button = (int)JSValueToNumber(context, arguments[0], exception) + 1;
- g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
+ menuItemClass = JSClassCreate(&classDefinition);
}
- currentEventButton = event.button.button;
-
- event.button.x = lastMousePositionX;
- event.button.y = lastMousePositionY;
- event.button.window = GTK_WIDGET(view)->window;
- event.button.time = GDK_CURRENT_TIME;
- event.button.device = gdk_device_get_core_pointer();
+ return menuItemClass;
+}
- int x_root, y_root;
-#if GTK_CHECK_VERSION(2,17,3)
- gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &x_root, &y_root);
-#else
- getRootCoords(GTK_WIDGET(view), &x_root, &y_root);
-#endif
- event.button.x_root = x_root;
- event.button.y_root = y_root;
+static JSValueRef contextClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ GdkEvent* pressEvent = gdk_event_new(GDK_BUTTON_PRESS);
- updateClickCount(event.button.button);
+ if (!prepareMouseButtonEvent(pressEvent, 2, 0))
+ return JSObjectMakeArray(context, 0, 0, 0);
- if (!msgQueue[endOfQueue].delay) {
- webkit_web_frame_layout(mainFrame);
+ GdkEvent* releaseEvent = gdk_event_copy(pressEvent);
+ sendOrQueueEvent(pressEvent);
- gboolean return_val;
- g_signal_emit_by_name(view, "button_press_event", &event, &return_val);
- if (clickCount == 2) {
- event.type = GDK_2BUTTON_PRESS;
- g_signal_emit_by_name(view, "button_press_event", &event, &return_val);
+ JSValueRef valueRef = JSObjectMakeArray(context, 0, 0, 0);
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ GtkMenu* gtkMenu = webkit_web_view_get_context_menu(view);
+ if (gtkMenu) {
+ GList* items = gtk_container_get_children(GTK_CONTAINER(gtkMenu));
+ JSValueRef arrayValues[g_list_length(items)];
+ int index = 0;
+ for (GList* item = g_list_first(items); item; item = g_list_next(item)) {
+ arrayValues[index] = JSObjectMake(context, getMenuItemClass(), item->data);
+ index++;
}
- } else {
- // replaySavedEvents should have the required logic to make leapForward delays work
- msgQueue[endOfQueue++].event = event;
- replaySavedEvents();
+ if (index)
+ valueRef = JSObjectMakeArray(context, index - 1, arrayValues, 0);
}
- return JSValueMakeUndefined(context);
+ releaseEvent->type = GDK_BUTTON_RELEASE;
+ sendOrQueueEvent(releaseEvent);
+ return valueRef;
}
-static guint getStateFlags()
+static void updateClickCount(int button)
{
- guint state = 0;
-
- if (down) {
- if (currentEventButton == 1)
- state = GDK_BUTTON1_MASK;
- else if (currentEventButton == 2)
- state = GDK_BUTTON2_MASK;
- else if (currentEventButton == 3)
- state = GDK_BUTTON3_MASK;
- } else
- state = 0;
-
- return state;
+ if (lastClickPositionX != lastMousePositionX
+ || lastClickPositionY != lastMousePositionY
+ || lastClickButton != button
+ || timeOffset - lastClickTimeOffset >= 1)
+ clickCount = 1;
+ else
+ clickCount++;
}
-static JSValueRef mouseUpCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static guint gdkModifersFromJSValue(JSContextRef context, const JSValueRef modifiers)
{
+ JSObjectRef modifiersArray = JSValueToObject(context, modifiers, 0);
+ if (!modifiersArray)
+ return 0;
+
+ guint gdkModifiers = 0;
+ int modifiersCount = JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, JSStringCreateWithUTF8CString("length"), 0), 0);
+ for (int i = 0; i < modifiersCount; ++i) {
+ JSValueRef value = JSObjectGetPropertyAtIndex(context, modifiersArray, i, 0);
+ JSStringRef string = JSValueToStringCopy(context, value, 0);
+ if (JSStringIsEqualToUTF8CString(string, "ctrlKey")
+ || JSStringIsEqualToUTF8CString(string, "addSelectionKey"))
+ gdkModifiers |= GDK_CONTROL_MASK;
+ else if (JSStringIsEqualToUTF8CString(string, "shiftKey")
+ || JSStringIsEqualToUTF8CString(string, "rangeSelectionKey"))
+ gdkModifiers |= GDK_SHIFT_MASK;
+ else if (JSStringIsEqualToUTF8CString(string, "altKey"))
+ gdkModifiers |= GDK_MOD1_MASK;
+
+ // Currently the metaKey as defined in WebCore/platform/gtk/MouseEventGtk.cpp
+ // is GDK_MOD2_MASK. This code must be kept in sync with that file.
+ else if (JSStringIsEqualToUTF8CString(string, "metaKey"))
+ gdkModifiers |= GDK_MOD2_MASK;
+
+ JSStringRelease(string);
+ }
+ return gdkModifiers;
+}
- WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
- if (!view)
- return JSValueMakeUndefined(context);
-
- GdkEvent event;
- memset(&event, 0, sizeof(event));
- event.type = GDK_BUTTON_RELEASE;
- event.button.button = 1;
-
+static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int button = 0;
if (argumentCount == 1) {
- event.button.button = (int)JSValueToNumber(context, arguments[0], exception) + 1;
+ button = static_cast<int>(JSValueToNumber(context, arguments[0], exception));
g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
}
+ guint modifiers = argumentCount >= 2 ? gdkModifersFromJSValue(context, arguments[1]) : 0;
- currentEventButton = event.button.button;
-
- event.button.x = lastMousePositionX;
- event.button.y = lastMousePositionY;
- event.button.window = GTK_WIDGET(view)->window;
- event.button.time = GDK_CURRENT_TIME;
- event.button.device = gdk_device_get_core_pointer();
- event.button.state = getStateFlags();
-
- down = false;
-
- int x_root, y_root;
-#if GTK_CHECK_VERSION(2,17,3)
- gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &x_root, &y_root);
-#else
- getRootCoords(GTK_WIDGET(view), &x_root, &y_root);
-#endif
+ GdkEvent* event = gdk_event_new(GDK_BUTTON_PRESS);
+ if (!prepareMouseButtonEvent(event, button, modifiers))
+ return JSValueMakeUndefined(context);
- event.button.x_root = x_root;
- event.button.y_root = y_root;
+ buttonCurrentlyDown = event->button.button;
+
+ // Normally GDK will send both GDK_BUTTON_PRESS and GDK_2BUTTON_PRESS for
+ // the second button press during double-clicks. WebKit GTK+ selectively
+ // ignores the first GDK_BUTTON_PRESS of that pair using gdk_event_peek.
+ // Since our events aren't ever going onto the GDK event queue, WebKit won't
+ // be able to filter out the first GDK_BUTTON_PRESS, so we just don't send
+ // it here. Eventually this code should probably figure out a way to get all
+ // appropriate events onto the event queue and this work-around should be
+ // removed.
+ updateClickCount(event->button.button);
+ if (clickCount == 2)
+ event->type = GDK_2BUTTON_PRESS;
+ else if (clickCount == 3)
+ event->type = GDK_3BUTTON_PRESS;
+
+ sendOrQueueEvent(event);
+ return JSValueMakeUndefined(context);
+}
- if ((dragMode && !replayingSavedEvents) || msgQueue[endOfQueue].delay) {
- msgQueue[endOfQueue].event = event;
- msgQueue[endOfQueue++].isDragEvent = true;
- replaySavedEvents();
- } else {
- webkit_web_frame_layout(mainFrame);
+static guint getStateFlags()
+{
+ if (buttonCurrentlyDown == 1)
+ return GDK_BUTTON1_MASK;
+ if (buttonCurrentlyDown == 2)
+ return GDK_BUTTON2_MASK;
+ if (buttonCurrentlyDown == 3)
+ return GDK_BUTTON3_MASK;
+ return 0;
+}
- gboolean return_val;
- g_signal_emit_by_name(view, "button_release_event", &event, &return_val);
+static JSValueRef mouseUpCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int button = 0;
+ if (argumentCount == 1) {
+ button = static_cast<int>(JSValueToNumber(context, arguments[0], exception));
+ g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
}
+ guint modifiers = argumentCount >= 2 ? gdkModifersFromJSValue(context, arguments[1]) : 0;
+
+ GdkEvent* event = gdk_event_new(GDK_BUTTON_RELEASE);
+ if (!prepareMouseButtonEvent(event, button, modifiers))
+ return JSValueMakeUndefined(context);
lastClickPositionX = lastMousePositionX;
lastClickPositionY = lastMousePositionY;
+ lastClickButton = buttonCurrentlyDown;
+ lastClickTimeOffset = timeOffset;
+ buttonCurrentlyDown = 0;
+ sendOrQueueEvent(event);
return JSValueMakeUndefined(context);
}
@@ -294,41 +351,27 @@ static JSValueRef mouseMoveToCallback(JSContextRef context, JSObjectRef function
lastMousePositionY = (int)JSValueToNumber(context, arguments[1], exception);
g_return_val_if_fail((!exception || !*exception), JSValueMakeUndefined(context));
- GdkEvent event;
- memset(&event, 0, sizeof(event));
- event.type = GDK_MOTION_NOTIFY;
- event.motion.x = lastMousePositionX;
- event.motion.y = lastMousePositionY;
- event.motion.time = GDK_CURRENT_TIME;
- event.motion.window = GTK_WIDGET(view)->window;
- event.motion.device = gdk_device_get_core_pointer();
-
- int x_root, y_root;
-#if GTK_CHECK_VERSION(2,17,3)
- gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &x_root, &y_root);
-#else
- getRootCoords(GTK_WIDGET(view), &x_root, &y_root);
-#endif
-
- event.motion.x_root = x_root;
- event.motion.y_root = y_root;
-
- event.motion.state = getStateFlags();
+ GdkEvent* event = gdk_event_new(GDK_MOTION_NOTIFY);
+ event->motion.x = lastMousePositionX;
+ event->motion.y = lastMousePositionY;
- if (dragMode && down && !replayingSavedEvents) {
- msgQueue[endOfQueue].event = event;
- msgQueue[endOfQueue++].isDragEvent = true;
- } else {
- webkit_web_frame_layout(mainFrame);
+ event->motion.time = GDK_CURRENT_TIME;
+ event->motion.window = gtk_widget_get_window(GTK_WIDGET(view));
+ g_object_ref(event->motion.window);
+ event->button.device = getDefaultGDKPointerDevice(event->motion.window);
+ event->motion.state = getStateFlags();
+ event->motion.axes = 0;
- gboolean return_val;
- g_signal_emit_by_name(view, "motion_notify_event", &event, &return_val);
- }
+ int xRoot, yRoot;
+ gdk_window_get_root_coords(gtk_widget_get_window(GTK_WIDGET(view)), lastMousePositionX, lastMousePositionY, &xRoot, &yRoot);
+ event->motion.x_root = xRoot;
+ event->motion.y_root = yRoot;
+ sendOrQueueEvent(event, false);
return JSValueMakeUndefined(context);
}
-static JSValueRef mouseWheelToCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef mouseScrollByCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
if (!view)
@@ -345,32 +388,31 @@ static JSValueRef mouseWheelToCallback(JSContextRef context, JSObjectRef functio
// GTK+ doesn't support multiple direction scrolls in the same event!
g_return_val_if_fail((!vertical || !horizontal), JSValueMakeUndefined(context));
- GdkEvent event;
- event.type = GDK_SCROLL;
- event.scroll.x = lastMousePositionX;
- event.scroll.y = lastMousePositionY;
- event.scroll.time = GDK_CURRENT_TIME;
- event.scroll.window = GTK_WIDGET(view)->window;
+ GdkEvent* event = gdk_event_new(GDK_SCROLL);
+ event->scroll.x = lastMousePositionX;
+ event->scroll.y = lastMousePositionY;
+ event->scroll.time = GDK_CURRENT_TIME;
+ event->scroll.window = gtk_widget_get_window(GTK_WIDGET(view));
+ g_object_ref(event->scroll.window);
if (horizontal < 0)
- event.scroll.direction = GDK_SCROLL_LEFT;
+ event->scroll.direction = GDK_SCROLL_RIGHT;
else if (horizontal > 0)
- event.scroll.direction = GDK_SCROLL_RIGHT;
+ event->scroll.direction = GDK_SCROLL_LEFT;
else if (vertical < 0)
- event.scroll.direction = GDK_SCROLL_UP;
+ event->scroll.direction = GDK_SCROLL_DOWN;
else if (vertical > 0)
- event.scroll.direction = GDK_SCROLL_DOWN;
+ event->scroll.direction = GDK_SCROLL_UP;
else
g_assert_not_reached();
- if (dragMode && down && !replayingSavedEvents) {
- msgQueue[endOfQueue].event = event;
- msgQueue[endOfQueue++].isDragEvent = true;
- } else {
- webkit_web_frame_layout(mainFrame);
- gtk_main_do_event(&event);
- }
+ sendOrQueueEvent(event);
+ return JSValueMakeUndefined(context);
+}
+static JSValueRef continuousMouseScrollByCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ // GTK doesn't support continuous scroll events.
return JSValueMakeUndefined(context);
}
@@ -383,79 +425,86 @@ static JSValueRef beginDragWithFilesCallback(JSContextRef context, JSObjectRef f
return JSValueMakeUndefined(context);
}
-void replaySavedEvents()
+static void sendOrQueueEvent(GdkEvent* event, bool shouldReplaySavedEvents)
{
- // FIXME: This doesn't deal with forward leaps, but it should.
+ // Mouse move events are queued if the previous event was queued or if a
+ // delay was set up by leapForward().
+ if ((dragMode && buttonCurrentlyDown) || endOfQueue != startOfQueue || msgQueue[endOfQueue].delay) {
+ msgQueue[endOfQueue++].event = event;
+
+ if (shouldReplaySavedEvents)
+ replaySavedEvents();
- WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
- if (!view)
return;
+ }
- replayingSavedEvents = true;
-
- for (unsigned queuePos = 0; queuePos < endOfQueue; queuePos++) {
- GdkEvent event = msgQueue[queuePos].event;
- gboolean return_val;
-
- switch (event.type) {
- case GDK_BUTTON_RELEASE:
- g_signal_emit_by_name(view, "button_release_event", &event, &return_val);
- break;
- case GDK_BUTTON_PRESS:
- g_signal_emit_by_name(view, "button_press_event", &event, &return_val);
- break;
- case GDK_MOTION_NOTIFY:
- g_signal_emit_by_name(view, "motion_notify_event", &event, &return_val);
- break;
- default:
- continue;
- }
+ dispatchEvent(event);
+}
- startOfQueue++;
+static void dispatchEvent(GdkEvent* event)
+{
+ webkit_web_frame_layout(mainFrame);
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ if (!view) {
+ gdk_event_free(event);
+ return;
}
- int numQueuedMessages = endOfQueue - startOfQueue;
- if (!numQueuedMessages) {
- startOfQueue = 0;
- endOfQueue = 0;
- replayingSavedEvents = false;
+ gtk_main_do_event(event);
+
+ if (!currentDragSourceContext) {
+ gdk_event_free(event);
return;
}
+ if (event->type == GDK_MOTION_NOTIFY) {
+ // WebKit has called gtk_drag_start(), but because the main loop isn't
+ // running GDK internals don't know that the drag has started yet. Pump
+ // the main loop a little bit so that GDK is in the correct state.
+ while (gtk_events_pending())
+ gtk_main_iteration();
+
+ // Simulate a drag motion on the top-level GDK window.
+ GtkWidget* parentWidget = gtk_widget_get_parent(GTK_WIDGET(view));
+ GdkWindow* parentWidgetWindow = gtk_widget_get_window(parentWidget);
+ gdk_drag_motion(currentDragSourceContext, parentWidgetWindow, GDK_DRAG_PROTO_XDND,
+ event->motion.x_root, event->motion.y_root,
+ gdk_drag_context_get_selected_action(currentDragSourceContext),
+ gdk_drag_context_get_actions(currentDragSourceContext),
+ GDK_CURRENT_TIME);
+
+ } else if (currentDragSourceContext && event->type == GDK_BUTTON_RELEASE) {
+ // We've released the mouse button, we should just be able to spin the
+ // event loop here and have GTK+ send the appropriate notifications for
+ // the end of the drag.
+ while (gtk_events_pending())
+ gtk_main_iteration();
+ }
+
+ gdk_event_free(event);
+}
+
+void replaySavedEvents()
+{
+ // First send all the events that are ready to be sent
+ while (startOfQueue < endOfQueue) {
+ if (msgQueue[startOfQueue].delay) {
+ g_usleep(msgQueue[startOfQueue].delay * 1000);
+ msgQueue[startOfQueue].delay = 0;
+ }
+
+ dispatchEvent(msgQueue[startOfQueue++].event);
+ }
+
startOfQueue = 0;
endOfQueue = 0;
-
- replayingSavedEvents = false;
}
static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
if (argumentCount < 1)
return JSValueMakeUndefined(context);
-
- static const JSStringRef lengthProperty = JSStringCreateWithUTF8CString("length");
-
- webkit_web_frame_layout(mainFrame);
-
- // handle modifier keys.
- int state = 0;
- if (argumentCount > 1) {
- JSObjectRef modifiersArray = JSValueToObject(context, arguments[1], exception);
- if (modifiersArray) {
- for (int i = 0; i < JSValueToNumber(context, JSObjectGetProperty(context, modifiersArray, lengthProperty, 0), 0); ++i) {
- JSValueRef value = JSObjectGetPropertyAtIndex(context, modifiersArray, i, 0);
- JSStringRef string = JSValueToStringCopy(context, value, 0);
- if (JSStringIsEqualToUTF8CString(string, "ctrlKey"))
- state |= GDK_CONTROL_MASK;
- else if (JSStringIsEqualToUTF8CString(string, "shiftKey"))
- state |= GDK_SHIFT_MASK;
- else if (JSStringIsEqualToUTF8CString(string, "altKey"))
- state |= GDK_MOD1_MASK;
-
- JSStringRelease(string);
- }
- }
- }
+ guint modifiers = argumentCount >= 2 ? gdkModifersFromJSValue(context, arguments[1]) : 0;
// handle location argument.
int location = DOM_KEY_LOCATION_STANDARD;
@@ -482,9 +531,13 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
gdkKeySym = GDK_KP_Home;
else if (JSStringIsEqualToUTF8CString(character, "end"))
gdkKeySym = GDK_KP_End;
+ else if (JSStringIsEqualToUTF8CString(character, "insert"))
+ gdkKeySym = GDK_KP_Insert;
+ else if (JSStringIsEqualToUTF8CString(character, "delete"))
+ gdkKeySym = GDK_KP_Delete;
else
- // Assume we only get arrow/pgUp/pgDn/home/end keys with
- // location=NUMPAD for now.
+ // If we get some other key specified with the numpad location,
+ // crash here, so we add it sooner rather than later.
g_assert_not_reached();
} else {
if (JSStringIsEqualToUTF8CString(character, "leftArrow"))
@@ -503,8 +556,12 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
gdkKeySym = GDK_Home;
else if (JSStringIsEqualToUTF8CString(character, "end"))
gdkKeySym = GDK_End;
+ else if (JSStringIsEqualToUTF8CString(character, "insert"))
+ gdkKeySym = GDK_Insert;
else if (JSStringIsEqualToUTF8CString(character, "delete"))
- gdkKeySym = GDK_BackSpace;
+ gdkKeySym = GDK_Delete;
+ else if (JSStringIsEqualToUTF8CString(character, "printScreen"))
+ gdkKeySym = GDK_Print;
else if (JSStringIsEqualToUTF8CString(character, "F1"))
gdkKeySym = GDK_F1;
else if (JSStringIsEqualToUTF8CString(character, "F2"))
@@ -540,7 +597,7 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
else {
gdkKeySym = gdk_unicode_to_keyval(charCode);
if (WTF::isASCIIUpper(charCode))
- state |= GDK_SHIFT_MASK;
+ modifiers |= GDK_SHIFT_MASK;
}
}
}
@@ -551,68 +608,81 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
return JSValueMakeUndefined(context);
// create and send the event
- GdkEvent event;
- memset(&event, 0, sizeof(event));
- event.key.keyval = gdkKeySym;
- event.key.state = state;
- event.key.window = GTK_WIDGET(view)->window;
+ GdkEvent* pressEvent = gdk_event_new(GDK_KEY_PRESS);
+ pressEvent->key.keyval = gdkKeySym;
+ pressEvent->key.state = modifiers;
+ pressEvent->key.window = gtk_widget_get_window(GTK_WIDGET(view));
+ g_object_ref(pressEvent->key.window);
+#ifndef GTK_API_VERSION_2
+ gdk_event_set_device(pressEvent, getDefaultGDKPointerDevice(pressEvent->key.window));
+#endif
- gboolean return_val;
- event.key.type = GDK_KEY_PRESS;
- g_signal_emit_by_name(view, "key-press-event", &event.key, &return_val);
+ // When synthesizing an event, an invalid hardware_keycode value
+ // can cause it to be badly processed by Gtk+.
+ GdkKeymapKey* keys;
+ gint n_keys;
+ if (gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), gdkKeySym, &keys, &n_keys)) {
+ pressEvent->key.hardware_keycode = keys[0].keycode;
+ g_free(keys);
+ }
- event.key.type = GDK_KEY_RELEASE;
- g_signal_emit_by_name(view, "key-release-event", &event.key, &return_val);
+ GdkEvent* releaseEvent = gdk_event_copy(pressEvent);
+ dispatchEvent(pressEvent);
+ releaseEvent->key.type = GDK_KEY_RELEASE;
+ dispatchEvent(releaseEvent);
return JSValueMakeUndefined(context);
}
-static JSValueRef textZoomInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static void zoomIn(gboolean fullContentsZoom)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
if (!view)
- return JSValueMakeUndefined(context);
+ return;
+ webkit_web_view_set_full_content_zoom(view, fullContentsZoom);
gfloat currentZoom = webkit_web_view_get_zoom_level(view);
webkit_web_view_set_zoom_level(view, currentZoom * zoomMultiplierRatio);
-
- return JSValueMakeUndefined(context);
}
-static JSValueRef textZoomOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static void zoomOut(gboolean fullContentsZoom)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
if (!view)
- return JSValueMakeUndefined(context);
+ return;
+ webkit_web_view_set_full_content_zoom(view, fullContentsZoom);
gfloat currentZoom = webkit_web_view_get_zoom_level(view);
webkit_web_view_set_zoom_level(view, currentZoom / zoomMultiplierRatio);
+}
+static JSValueRef textZoomInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ zoomIn(FALSE);
return JSValueMakeUndefined(context);
}
-static JSValueRef zoomPageInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef textZoomOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
- if (!view)
- return JSValueMakeUndefined(context);
+ zoomOut(FALSE);
+ return JSValueMakeUndefined(context);
+}
- webkit_web_view_zoom_in(view);
+static JSValueRef zoomPageInCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ zoomIn(TRUE);
return JSValueMakeUndefined(context);
}
static JSValueRef zoomPageOutCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
- WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
- if (!view)
- return JSValueMakeUndefined(context);
-
- webkit_web_view_zoom_out(view);
+ zoomOut(TRUE);
return JSValueMakeUndefined(context);
}
static JSStaticFunction staticFunctions[] = {
- { "mouseWheelTo", mouseWheelToCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "mouseScrollBy", mouseScrollByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "continuousMouseScrollBy", continuousMouseScrollByCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "contextClick", contextClickCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "mouseDown", mouseDownCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "mouseUp", mouseUpCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -649,20 +719,46 @@ static JSClassRef getClass(JSContextRef context)
return eventSenderClass;
}
-JSObjectRef makeEventSender(JSContextRef context)
+JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame)
{
- down = false;
- dragMode = true;
- lastMousePositionX = lastMousePositionY = 0;
- lastClickPositionX = lastClickPositionY = 0;
+ if (isTopFrame) {
+ dragMode = true;
+
+ // Fly forward in time one second when the main frame loads. This will
+ // ensure that when a test begins clicking in the same location as
+ // a previous test, those clicks won't be interpreted as continuations
+ // of the previous test's click sequences.
+ timeOffset += 1000;
+
+ lastMousePositionX = lastMousePositionY = 0;
+ lastClickPositionX = lastClickPositionY = 0;
+ lastClickTimeOffset = 0;
+ lastClickButton = 0;
+ buttonCurrentlyDown = 0;
+ clickCount = 0;
- if (!replayingSavedEvents) {
- // This function can be called in the middle of a test, even
- // while replaying saved events. Resetting these while doing that
- // can break things.
endOfQueue = 0;
startOfQueue = 0;
+
+ currentDragSourceContext = 0;
}
return JSObjectMake(context, getClass(context), 0);
}
+
+void dragBeginCallback(GtkWidget*, GdkDragContext* context, gpointer)
+{
+ currentDragSourceContext = context;
+}
+
+void dragEndCallback(GtkWidget*, GdkDragContext* context, gpointer)
+{
+ currentDragSourceContext = 0;
+}
+
+gboolean dragFailedCallback(GtkWidget*, GdkDragContext* context, gpointer)
+{
+ // Return TRUE here to disable the stupid GTK+ drag failed animation,
+ // which introduces asynchronous behavior into our drags.
+ return TRUE;
+}
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.h b/WebKitTools/DumpRenderTree/gtk/EventSender.h
index 272e8a9..f440f0d 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.h
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.h
@@ -33,7 +33,10 @@
typedef const struct OpaqueJSContext* JSContextRef;
typedef struct OpaqueJSValue* JSObjectRef;
-JSObjectRef makeEventSender(JSContextRef context);
+JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame);
void replaySavedEvents();
+void dragBeginCallback(GtkWidget*, GdkDragContext*, gpointer);
+void dragEndCallback(GtkWidget*, GdkDragContext*, gpointer);
+gboolean dragFailedCallback(GtkWidget*, GdkDragContext*, gpointer);
#endif
diff --git a/WebKitTools/DumpRenderTree/gtk/ImageDiff.cpp b/WebKitTools/DumpRenderTree/gtk/ImageDiff.cpp
new file mode 100644
index 0000000..7e2744a
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/gtk/ImageDiff.cpp
@@ -0,0 +1,239 @@
+/*
+ * Copyright (C) 2009 Zan Dobersek <zandobersek@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
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 <algorithm>
+#include <cmath>
+#include <cstdio>
+#include <cstring>
+#include <gdk/gdk.h>
+
+using namespace std;
+
+static double tolerance = 0;
+static GOptionEntry commandLineOptionEntries[] =
+{
+ { "tolerance", 0, 0, G_OPTION_ARG_DOUBLE, &tolerance, "Percentage difference between images before considering them different", "T" },
+ { 0, 0, 0, G_OPTION_ARG_NONE, 0, 0, 0 },
+};
+
+GdkPixbuf* readPixbufFromStdin(long imageSize)
+{
+ unsigned char imageBuffer[2048];
+ GdkPixbufLoader* loader = gdk_pixbuf_loader_new_with_type("png", 0);
+ GError* error = 0;
+
+ while (imageSize > 0) {
+ size_t bytesToRead = min<int>(imageSize, 2048);
+ size_t bytesRead = fread(imageBuffer, 1, bytesToRead, stdin);
+
+ if (!gdk_pixbuf_loader_write(loader, reinterpret_cast<const guchar*>(imageBuffer), bytesRead, &error)) {
+ g_error_free(error);
+ gdk_pixbuf_loader_close(loader, 0);
+ g_object_unref(loader);
+ return 0;
+ }
+
+ imageSize -= static_cast<int>(bytesRead);
+ }
+
+ gdk_pixbuf_loader_close(loader, 0);
+ GdkPixbuf* decodedImage = gdk_pixbuf_loader_get_pixbuf(loader);
+ g_object_ref(decodedImage);
+ return decodedImage;
+}
+
+GdkPixbuf* differenceImageFromDifferenceBuffer(unsigned char* buffer, int width, int height)
+{
+ GdkPixbuf* image = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, width, height);
+ if (!image)
+ return image;
+
+ int rowStride = gdk_pixbuf_get_rowstride(image);
+ unsigned char* diffPixels = gdk_pixbuf_get_pixels(image);
+ for (int x = 0; x < width; x++) {
+ for (int y = 0; y < height; y++) {
+ unsigned char* diffPixel = diffPixels + (y * rowStride) + (x * 3);
+ diffPixel[0] = diffPixel[1] = diffPixel[2] = *buffer++;
+ }
+ }
+
+ return image;
+}
+
+float calculateDifference(GdkPixbuf* baselineImage, GdkPixbuf* actualImage, GdkPixbuf** differenceImage)
+{
+ int width = gdk_pixbuf_get_width(actualImage);
+ int height = gdk_pixbuf_get_height(actualImage);
+ int numberOfChannels = gdk_pixbuf_get_n_channels(actualImage);
+ if ((width != gdk_pixbuf_get_width(baselineImage))
+ || (height != gdk_pixbuf_get_height(baselineImage))
+ || (numberOfChannels != gdk_pixbuf_get_n_channels(baselineImage))
+ || (gdk_pixbuf_get_has_alpha(actualImage) != gdk_pixbuf_get_has_alpha(baselineImage))) {
+ fprintf(stderr, "Error, test and reference image have different properties.\n");
+ return 100; // Completely different.
+ }
+
+ unsigned char* diffBuffer = static_cast<unsigned char*>(malloc(width * height));
+ float count = 0;
+ float sum = 0;
+ float maxDistance = 0;
+ int actualRowStride = gdk_pixbuf_get_rowstride(actualImage);
+ int baseRowStride = gdk_pixbuf_get_rowstride(baselineImage);
+ unsigned char* actualPixels = gdk_pixbuf_get_pixels(actualImage);
+ unsigned char* basePixels = gdk_pixbuf_get_pixels(baselineImage);
+ unsigned char* currentDiffPixel = diffBuffer;
+ for (int x = 0; x < width; x++) {
+ for (int y = 0; y < height; y++) {
+ unsigned char* actualPixel = actualPixels + (y * actualRowStride) + (x * numberOfChannels);
+ unsigned char* basePixel = basePixels + (y * baseRowStride) + (x * numberOfChannels);
+
+ float red = (actualPixel[0] - basePixel[0]) / max<float>(255 - basePixel[0], basePixel[0]);
+ float green = (actualPixel[1] - basePixel[1]) / max<float>(255 - basePixel[1], basePixel[1]);
+ float blue = (actualPixel[2] - basePixel[2]) / max<float>(255 - basePixel[2], basePixel[2]);
+ float alpha = (actualPixel[3] - basePixel[3]) / max<float>(255 - basePixel[3], basePixel[3]);
+ float distance = sqrtf(red * red + green * green + blue * blue + alpha * alpha) / 2.0f;
+
+ *currentDiffPixel++ = (unsigned char)(distance * 255.0f);
+
+ if (distance >= 1.0f / 255.0f) {
+ count += 1.0f;
+ sum += distance;
+ maxDistance = max<float>(maxDistance, distance);
+ }
+ }
+ }
+
+ // Compute the difference as a percentage combining both the number of
+ // different pixels and their difference amount i.e. the average distance
+ // over the entire image
+ float difference = 0;
+ if (count > 0.0f)
+ difference = 100.0f * sum / (height * width);
+ if (difference <= tolerance)
+ difference = 0;
+ else {
+ difference = roundf(difference * 100.0f) / 100.0f;
+ difference = max(difference, 0.01f); // round to 2 decimal places
+ *differenceImage = differenceImageFromDifferenceBuffer(diffBuffer, width, height);
+ }
+
+ free(diffBuffer);
+ return difference;
+}
+
+void printImage(GdkPixbuf* image)
+{
+ char* buffer;
+ gsize bufferSize;
+ GError* error = 0;
+ if (!gdk_pixbuf_save_to_buffer(image, &buffer, &bufferSize, "png", &error, NULL)) {
+ g_error_free(error);
+ return; // Don't bail out, as we can still use the percentage output.
+ }
+
+ printf("Content-Length: %"G_GSIZE_FORMAT"\n", bufferSize);
+ fwrite(buffer, 1, bufferSize, stdout);
+}
+
+void printImageDifferences(GdkPixbuf* baselineImage, GdkPixbuf* actualImage)
+{
+ GdkPixbuf* differenceImage = 0;
+ float difference = calculateDifference(baselineImage, actualImage, &differenceImage);
+ if (difference > 0.0f) {
+ if (differenceImage) {
+ printImage(differenceImage);
+ g_object_unref(differenceImage);
+ }
+ printf("diff: %01.2f%% failed\n", difference);
+ } else {
+ printf("diff: %01.2f%% passed\n", difference);
+ }
+}
+
+int main(int argc, char* argv[])
+{
+ gdk_init(&argc, &argv);
+
+ GError* error = 0;
+ GOptionContext* context = g_option_context_new("- compare two image files, printing their percentage difference and the difference image to stdout");
+ g_option_context_add_main_entries(context, commandLineOptionEntries, 0);
+ if (!g_option_context_parse(context, &argc, &argv, &error)) {
+ printf("Option parsing failed: %s\n", error->message);
+ g_error_free(error);
+ return 1;
+ }
+
+ GdkPixbuf* actualImage = 0;
+ GdkPixbuf* baselineImage = 0;
+ char buffer[2048];
+ while (fgets(buffer, sizeof(buffer), stdin)) {
+ // Convert the first newline into a NUL character so that strtok doesn't produce it.
+ char* newLineCharacter = strchr(buffer, '\n');
+ if (newLineCharacter)
+ *newLineCharacter = '\0';
+
+ if (!strncmp("Content-Length: ", buffer, 16)) {
+ gchar** tokens = g_strsplit(buffer, " ", 0);
+ if (!tokens[1]) {
+ g_strfreev(tokens);
+ printf("Error, image size must be specified..\n");
+ return 1;
+ }
+
+ long imageSize = strtol(tokens[1], 0, 10);
+ g_strfreev(tokens);
+ if (imageSize > 0 && !actualImage) {
+ if (!(actualImage = readPixbufFromStdin(imageSize))) {
+ printf("Error, could not read actual image.\n");
+ return 1;
+ }
+ } else if (imageSize > 0 && !baselineImage) {
+ if (!(baselineImage = readPixbufFromStdin(imageSize))) {
+ printf("Error, could not read baseline image.\n");
+ return 1;
+ }
+ } else {
+ printf("Error, image size must be specified..\n");
+ return 1;
+ }
+ }
+
+ if (actualImage && baselineImage) {
+ printImageDifferences(baselineImage, actualImage);
+ g_object_unref(actualImage);
+ g_object_unref(baselineImage);
+ actualImage = 0;
+ baselineImage = 0;
+ }
+
+ fflush(stdout);
+ }
+
+ return 0;
+}
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index 422e2c2..39fb116 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -34,46 +34,37 @@
#include "LayoutTestController.h"
#include "DumpRenderTree.h"
+#include "WebCoreSupport/DumpRenderTreeSupportGtk.h"
#include "WorkQueue.h"
#include "WorkQueueItem.h"
#include <JavaScriptCore/JSRetainPtr.h>
#include <JavaScriptCore/JSStringRef.h>
-
+#include <cstring>
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <glib.h>
#include <libsoup/soup.h>
#include <webkit/webkit.h>
+#include <wtf/gobject/GOwnPtr.h>
extern "C" {
bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
bool webkit_web_frame_pause_transition(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
bool webkit_web_frame_pause_svg_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element);
unsigned int webkit_web_frame_number_of_active_animations(WebKitWebFrame* frame);
+void webkit_web_frame_suspend_animations(WebKitWebFrame* frame);
+void webkit_web_frame_resume_animations(WebKitWebFrame* frame);
void webkit_application_cache_set_maximum_size(unsigned long long size);
unsigned int webkit_worker_thread_count(void);
void webkit_white_list_access_from_origin(const gchar* sourceOrigin, const gchar* destinationProtocol, const gchar* destinationHost, bool allowDestinationSubdomains);
gchar* webkit_web_frame_counter_value_for_element_by_id(WebKitWebFrame* frame, const gchar* id);
int webkit_web_frame_page_number_for_element_by_id(WebKitWebFrame* frame, const gchar* id, float pageWidth, float pageHeight);
+int webkit_web_frame_number_of_pages(WebKitWebFrame* frame, float pageWidth, float pageHeight);
void webkit_web_inspector_execute_script(WebKitWebInspector* inspector, long callId, const gchar* script);
-}
-
-static gchar* copyWebSettingKey(gchar* preferenceKey)
-{
- static GHashTable* keyTable;
-
- if (!keyTable) {
- // If you add a pref here, make sure you reset the value in
- // DumpRenderTree::resetWebViewToConsistentStateBeforeTesting.
- keyTable = g_hash_table_new(g_str_hash, g_str_equal);
- g_hash_table_insert(keyTable, g_strdup("WebKitJavaScriptEnabled"), g_strdup("enable-scripts"));
- g_hash_table_insert(keyTable, g_strdup("WebKitDefaultFontSize"), g_strdup("default-font-size"));
- g_hash_table_insert(keyTable, g_strdup("WebKitEnableCaretBrowsing"), g_strdup("enable-caret-browsing"));
- g_hash_table_insert(keyTable, g_strdup("WebKitUsesPageCachePreferenceKey"), g_strdup("enable-page-cache"));
- }
-
- return g_strdup(static_cast<gchar*>(g_hash_table_lookup(keyTable, preferenceKey)));
+gchar* webkit_web_frame_marker_text_for_list_item(WebKitWebFrame* frame, JSContextRef context, JSValueRef nodeObject);
+void webkit_web_view_execute_core_command_by_name(WebKitWebView* webView, const gchar* name, const gchar* value);
+gboolean webkit_web_view_is_command_enabled(WebKitWebView* webView, const gchar* name);
}
LayoutTestController::~LayoutTestController()
@@ -141,6 +132,24 @@ void LayoutTestController::keepWebHistory()
// FIXME: implement
}
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+{
+ // FIXME: Implement this.
+ return JSValueMakeUndefined(context);
+}
+
+JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ return DumpRenderTreeSupportGtk::nodesFromRect(context, value, x, y, top, right, bottom, left, ignoreClipping);
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+ // FIXME: implement
+ JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString(""));
+ return string;
+}
+
int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWidth, float pageHeight)
{
gchar* idGChar = JSStringCopyUTF8CString(id);
@@ -149,16 +158,41 @@ int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWid
return pageNumber;
}
-int LayoutTestController::numberOfPages(float, float)
+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 -1;
+ return JSRetainPtr<JSStringRef>();
}
-size_t LayoutTestController::webHistoryItemCount()
+bool LayoutTestController::isPageBoxVisible(int pageNumber) const
{
// FIXME: implement
- return 0;
+ return false;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
+{
+ // FIXME: implement
+ return JSRetainPtr<JSStringRef>();
+}
+
+size_t LayoutTestController::webHistoryItemCount()
+{
+ WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
+ WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list(webView);
+
+ if (!list)
+ return -1;
+
+ // We do not add the current page to the total count as it's not
+ // considered in DRT tests
+ return webkit_web_back_forward_list_get_back_length(list) +
+ webkit_web_back_forward_list_get_forward_length(list);
}
unsigned LayoutTestController::workerThreadCount() const
@@ -210,7 +244,28 @@ void LayoutTestController::setAcceptsEditing(bool acceptsEditing)
void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies)
{
- // FIXME: Implement this (and restore the default value before running each test in DumpRenderTree.cpp).
+#ifdef HAVE_LIBSOUP_2_29_90
+ SoupSession* session = webkit_get_default_session();
+ SoupCookieJar* jar = reinterpret_cast<SoupCookieJar*>(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR));
+
+ /* If the jar was not created - we create it on demand, i.e, just
+ in case we have HTTP requests - then we must create it here in
+ order to set the proper accept policy */
+ if (!jar) {
+ jar = soup_cookie_jar_new();
+ soup_session_add_feature(session, SOUP_SESSION_FEATURE(jar));
+ g_object_unref(jar);
+ }
+
+ SoupCookieJarAcceptPolicy policy;
+
+ if (alwaysAcceptCookies)
+ policy = SOUP_COOKIE_JAR_ACCEPT_ALWAYS;
+ else
+ policy = SOUP_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY;
+
+ g_object_set(G_OBJECT(jar), SOUP_COOKIE_JAR_ACCEPT_POLICY, policy, NULL);
+#endif
}
void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive)
@@ -224,7 +279,12 @@ void LayoutTestController::waitForPolicyDelegate()
setWaitToDump(true);
}
-void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
+void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
{
gchar* sourceOriginGChar = JSStringCopyUTF8CString(sourceOrigin);
gchar* protocolGChar = JSStringCopyUTF8CString(protocol);
@@ -235,6 +295,11 @@ void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, J
g_free(hostGChar);
}
+void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains)
+{
+ // FIXME: implement
+}
+
void LayoutTestController::setMainFrameIsFirstResponder(bool flag)
{
// FIXME: implement
@@ -284,6 +349,27 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
setUserStyleSheetEnabled(true);
}
+void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+{
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ ASSERT(view);
+
+ char* viewMode = JSStringCopyUTF8CString(mode);
+
+ if (!g_strcmp0(viewMode, "windowed"))
+ webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_WINDOWED);
+ else if (!g_strcmp0(viewMode, "floating"))
+ webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_FLOATING);
+ else if (!g_strcmp0(viewMode, "fullscreen"))
+ webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_FULLSCREEN);
+ else if (!g_strcmp0(viewMode, "maximized"))
+ webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_MAXIMIZED);
+ else if (!g_strcmp0(viewMode, "minimized"))
+ webkit_web_view_set_view_mode(view, WEBKIT_WEB_VIEW_VIEW_MODE_MINIMIZED);
+
+ g_free(viewMode);
+}
+
void LayoutTestController::setWindowIsKey(bool windowIsKey)
{
// FIXME: implement
@@ -303,7 +389,7 @@ static gboolean waitToDumpWatchdogFired(void*)
void LayoutTestController::setWaitToDump(bool waitUntilDone)
{
- static const int timeoutSeconds = 15;
+ static const int timeoutSeconds = 30;
m_waitToDump = waitUntilDone;
if (m_waitToDump && !waitToDumpWatchdog)
@@ -325,6 +411,15 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool flag)
g_object_set(G_OBJECT(settings), "enable-private-browsing", flag, NULL);
}
+void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag)
+{
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ ASSERT(view);
+
+ WebKitWebSettings* settings = webkit_web_view_get_settings(view);
+ g_object_set(G_OBJECT(settings), "javascript-can-access-clipboard", flag, NULL);
+}
+
void LayoutTestController::setXSSAuditorEnabled(bool flag)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
@@ -334,9 +429,22 @@ void LayoutTestController::setXSSAuditorEnabled(bool flag)
g_object_set(G_OBJECT(settings), "enable-xss-auditor", flag, NULL);
}
-void LayoutTestController::setFrameSetFlatteningEnabled(bool flag)
+void LayoutTestController::setFrameFlatteningEnabled(bool flag)
{
- // FIXME: implement
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ ASSERT(view);
+
+ WebKitWebSettings* settings = webkit_web_view_get_settings(view);
+ g_object_set(G_OBJECT(settings), "enable-frame-flattening", flag, NULL);
+}
+
+void LayoutTestController::setSpatialNavigationEnabled(bool flag)
+{
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ ASSERT(view);
+
+ WebKitWebSettings* settings = webkit_web_view_get_settings(view);
+ g_object_set(G_OBJECT(settings), "enable-spatial-navigation", flag, NULL);
}
void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag)
@@ -348,6 +456,15 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag)
g_object_set(G_OBJECT(settings), "enable-universal-access-from-file-uris", flag, NULL);
}
+void LayoutTestController::setAllowFileAccessFromFileURLs(bool flag)
+{
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ ASSERT(view);
+
+ WebKitWebSettings* settings = webkit_web_view_get_settings(view);
+ g_object_set(G_OBJECT(settings), "enable-file-access-from-file-uris", flag, NULL);
+}
+
void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
{
// FIXME: implement
@@ -359,6 +476,12 @@ void LayoutTestController::disableImageLoading()
// Also need to make sure image loading is re-enabled for each new test.
}
+void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+ // FIXME: Implement for DeviceOrientation layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=30335.
+}
+
void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
// FIXME: Implement for Geolocation layout tests.
@@ -371,6 +494,18 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message
// See https://bugs.webkit.org/show_bug.cgi?id=28264.
}
+void LayoutTestController::setGeolocationPermission(bool allow)
+{
+ // FIXME: Implement for Geolocation layout tests.
+ setGeolocationPermissionCommon(allow);
+}
+
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
void LayoutTestController::setIconDatabaseEnabled(bool flag)
{
// FIXME: implement
@@ -381,8 +516,7 @@ void LayoutTestController::setJavaScriptProfilingEnabled(bool flag)
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
- WebKitWebSettings* settings = webkit_web_view_get_settings(view);
- g_object_set(G_OBJECT(settings), "enable-developer-extras", flag, NULL);
+ setDeveloperExtrasEnabled(flag);
WebKitWebInspector* inspector = webkit_web_view_get_inspector(view);
g_object_set(G_OBJECT(inspector), "javascript-profiling-enabled", flag, NULL);
@@ -403,6 +537,11 @@ void LayoutTestController::setPopupBlockingEnabled(bool flag)
}
+void LayoutTestController::setPluginsEnabled(bool flag)
+{
+ // FIXME: Implement
+}
+
bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
{
// FIXME: implement
@@ -411,18 +550,30 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef i
void LayoutTestController::execCommand(JSStringRef name, JSStringRef value)
{
- // FIXME: implement
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ ASSERT(view);
+
+ gchar* cName = JSStringCopyUTF8CString(name);
+ gchar* cValue = JSStringCopyUTF8CString(value);
+ webkit_web_view_execute_core_command_by_name(view, cName, cValue);
+ g_free(cName);
+ g_free(cValue);
}
-void LayoutTestController::setCacheModel(int)
+bool LayoutTestController::isCommandEnabled(JSStringRef name)
{
- // FIXME: implement
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ ASSERT(view);
+
+ gchar* cName = JSStringCopyUTF8CString(name);
+ gboolean result = webkit_web_view_is_command_enabled(view, cName);
+ g_free(cName);
+ return result;
}
-bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/)
+void LayoutTestController::setCacheModel(int)
{
// FIXME: implement
- return false;
}
void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
@@ -435,6 +586,16 @@ void LayoutTestController::clearPersistentUserStyleSheet()
// FIXME: implement
}
+void LayoutTestController::clearAllApplicationCaches()
+{
+ // FIXME: implement to support Application Cache quotas.
+}
+
+void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+{
+ // FIXME: implement to support Application Cache quotas.
+}
+
void LayoutTestController::clearAllDatabases()
{
webkit_remove_all_web_databases();
@@ -491,80 +652,102 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return webkit_web_frame_number_of_active_animations(mainFrame);
}
+void LayoutTestController::suspendAnimations() const
+{
+ webkit_web_frame_suspend_animations(mainFrame);
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ webkit_web_frame_resume_animations(mainFrame);
+}
+
void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value)
{
- gchar* name = JSStringCopyUTF8CString(key);
- gchar* strValue = JSStringCopyUTF8CString(value);
+ GOwnPtr<gchar> originalName(JSStringCopyUTF8CString(key));
+ GOwnPtr<gchar> valueAsString(JSStringCopyUTF8CString(value));
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
ASSERT(view);
- WebKitWebSettings* settings = webkit_web_view_get_settings(view);
- gchar* webSettingKey = copyWebSettingKey(name);
-
- if (webSettingKey) {
- GValue stringValue = { 0, { { 0 } } };
- g_value_init(&stringValue, G_TYPE_STRING);
- g_value_set_string(&stringValue, const_cast<gchar*>(strValue));
-
- WebKitWebSettingsClass* klass = WEBKIT_WEB_SETTINGS_GET_CLASS(settings);
- GParamSpec* pspec = g_object_class_find_property(G_OBJECT_CLASS(klass), webSettingKey);
- GValue propValue = { 0, { { 0 } } };
- g_value_init(&propValue, pspec->value_type);
-
- if (g_value_type_transformable(G_TYPE_STRING, pspec->value_type)) {
- g_value_transform(const_cast<GValue*>(&stringValue), &propValue);
- g_object_set_property(G_OBJECT(settings), webSettingKey, const_cast<GValue*>(&propValue));
- } else if (G_VALUE_HOLDS_BOOLEAN(&propValue)) {
- char* lowered = g_utf8_strdown(strValue, -1);
- g_object_set(G_OBJECT(settings), webSettingKey,
- g_str_equal(lowered, "true")
- || g_str_equal(strValue, "1"),
- NULL);
- g_free(lowered);
- } else if (G_VALUE_HOLDS_INT(&propValue)) {
- std::string str(strValue);
- std::stringstream ss(str);
- int val = 0;
- if (!(ss >> val).fail())
- g_object_set(G_OBJECT(settings), webSettingKey, val, NULL);
- } else
- printf("LayoutTestController::overridePreference failed to override preference '%s'.\n", name);
+ // This transformation could be handled by a hash table (and it once was), but
+ // having it prominent, makes it easier for people from other ports to keep the
+ // list up to date.
+ const gchar* propertyName = 0;
+ if (g_str_equal(originalName.get(), "WebKitJavaScriptEnabled"))
+ propertyName = "enable-scripts";
+ else if (g_str_equal(originalName.get(), "WebKitDefaultFontSize"))
+ propertyName = "default-font-size";
+ else if (g_str_equal(originalName.get(), "WebKitEnableCaretBrowsing"))
+ propertyName = "enable-caret-browsing";
+ else if (g_str_equal(originalName.get(), "WebKitUsesPageCachePreferenceKey"))
+ propertyName = "enable-page-cache";
+ else if (g_str_equal(originalName.get(), "WebKitPluginsEnabled"))
+ propertyName = "enable-plugins";
+ else if (g_str_equal(originalName.get(), "WebKitHyperlinkAuditingEnabled"))
+ propertyName = "enable-hyperlink-auditing";
+ else if (g_str_equal(originalName.get(), "WebKitTabToLinksPreferenceKey")) {
+ DumpRenderTreeSupportGtk::setLinksIncludedInFocusChain(!g_ascii_strcasecmp(valueAsString.get(), "true") || !g_ascii_strcasecmp(valueAsString.get(), "1"));
+ return;
+ } else {
+ fprintf(stderr, "LayoutTestController::overridePreference tried to override "
+ "unknown preference '%s'.\n", originalName.get());
+ return;
}
- g_free(webSettingKey);
- g_free(name);
- g_free(strValue);
+ WebKitWebSettings* settings = webkit_web_view_get_settings(view);
+ GParamSpec* pspec = g_object_class_find_property(G_OBJECT_CLASS(
+ WEBKIT_WEB_SETTINGS_GET_CLASS(settings)), propertyName);
+ GValue currentPropertyValue = { 0, { { 0 } } };
+ g_value_init(&currentPropertyValue, pspec->value_type);
+
+ if (G_VALUE_HOLDS_STRING(&currentPropertyValue))
+ g_object_set(settings, propertyName, valueAsString.get(), NULL);
+ else if (G_VALUE_HOLDS_BOOLEAN(&currentPropertyValue))
+ g_object_set(G_OBJECT(settings), propertyName, !g_ascii_strcasecmp(valueAsString.get(), "true")
+ || !g_ascii_strcasecmp(valueAsString.get(), "1"), NULL);
+ else if (G_VALUE_HOLDS_INT(&currentPropertyValue))
+ g_object_set(G_OBJECT(settings), propertyName, atoi(valueAsString.get()), NULL);
+ else if (G_VALUE_HOLDS_FLOAT(&currentPropertyValue)) {
+ gfloat newValue = g_ascii_strtod(valueAsString.get(), 0);
+ g_object_set(G_OBJECT(settings), propertyName, newValue, NULL);
+ } else
+ fprintf(stderr, "LayoutTestController::overridePreference failed to override "
+ "preference '%s'.\n", originalName.get());
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart)
+void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
printf("LayoutTestController::addUserScript not implemented.\n");
}
-void LayoutTestController::addUserStyleSheet(JSStringRef source)
+void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
{
printf("LayoutTestController::addUserStyleSheet not implemented.\n");
}
-void LayoutTestController::showWebInspector()
+void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
WebKitWebSettings* webSettings = webkit_web_view_get_settings(webView);
+
+ g_object_set(webSettings, "enable-developer-extras", enabled, NULL);
+}
+
+void LayoutTestController::showWebInspector()
+{
+ WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView);
- g_object_set(webSettings, "enable-developer-extras", TRUE, NULL);
webkit_web_inspector_show(inspector);
}
void LayoutTestController::closeWebInspector()
{
WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
- WebKitWebSettings* webSettings = webkit_web_view_get_settings(webView);
WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView);
webkit_web_inspector_close(inspector);
- g_object_set(webSettings, "enable-developer-extras", FALSE, NULL);
}
void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
@@ -586,3 +769,61 @@ void LayoutTestController::removeAllVisitedLinks()
{
// FIXME: Implement this.
}
+
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+ // FIXME: Implement for testing fix for https://bugs.webkit.org/show_bug.cgi?id=27481
+ return false;
+}
+
+void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+{
+
+}
+
+void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+{
+
+}
+
+void LayoutTestController::setWebViewEditable(bool)
+{
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+{
+ gchar* markerTextGChar = webkit_web_frame_marker_text_for_list_item(mainFrame, context, nodeObject);
+ if (!markerTextGChar)
+ return 0;
+
+ JSRetainPtr<JSStringRef> markerText(Adopt, JSStringCreateWithUTF8CString(markerTextGChar));
+ g_free(markerTextGChar);
+ return markerText;
+}
+
+void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+{
+}
+
+void LayoutTestController::setEditingBehavior(const char* editingBehavior)
+{
+ WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame);
+ WebKitWebSettings* settings = webkit_web_view_get_settings(webView);
+
+ if (!strcmp(editingBehavior, "win"))
+ g_object_set(G_OBJECT(settings), "editing-behavior", WEBKIT_EDITING_BEHAVIOR_WINDOWS, NULL);
+ else if (!strcmp(editingBehavior, "mac"))
+ g_object_set(G_OBJECT(settings), "editing-behavior", WEBKIT_EDITING_BEHAVIOR_MAC, NULL);
+ else if (!strcmp(editingBehavior, "unix"))
+ g_object_set(G_OBJECT(settings), "editing-behavior", WEBKIT_EDITING_BEHAVIOR_UNIX, NULL);
+}
+
+void LayoutTestController::abortModal()
+{
+}
+
+bool LayoutTestController::hasSpellingMarker(int, int)
+{
+ // FIXME: Implement this.
+ return false;
+}
diff --git a/WebKitTools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp b/WebKitTools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp
new file mode 100644
index 0000000..4073403
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2009 Zan Dobersek <zandobersek@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
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h"
+
+#include "DumpRenderTree.h"
+#include "PixelDumpSupportCairo.h"
+#include <webkit/webkit.h>
+
+PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool, bool, bool, bool)
+{
+ WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
+ gint width, height;
+#ifdef GTK_API_VERSION_2
+ GdkPixmap* pixmap = gtk_widget_get_snapshot(GTK_WIDGET(view), 0);
+ gdk_drawable_get_size(GDK_DRAWABLE(pixmap), &width, &height);
+#else
+ width = gtk_widget_get_allocated_width(GTK_WIDGET(view));
+ height = gtk_widget_get_allocated_height(GTK_WIDGET(view));
+#endif
+
+ cairo_surface_t* imageSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
+ cairo_t* context = cairo_create(imageSurface);
+#ifdef GTK_API_VERSION_2
+ gdk_cairo_set_source_pixmap(context, pixmap, 0, 0);
+ cairo_paint(context);
+ g_object_unref(pixmap);
+#else
+ gtk_widget_draw(GTK_WIDGET(view), context);
+#endif
+
+ return BitmapContext::createByAdoptingBitmapAndContext(0, context);
+}
diff --git a/WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp b/WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp
index e0e0ffb..0f44f54 100644
--- a/WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp
@@ -22,6 +22,7 @@
#include "DumpRenderTree.h"
+#include <GOwnPtr.h>
#include <JavaScriptCore/JSStringRef.h>
#include <webkit/webkit.h>
#include <string.h>
@@ -56,6 +57,14 @@ bool LoadItem::invoke() const
return true;
}
+bool LoadHTMLStringItem::invoke() const
+{
+ GOwnPtr<gchar> content(JSStringCopyUTF8CString(m_content.get()));
+ GOwnPtr<gchar> baseURL(JSStringCopyUTF8CString(m_baseURL.get()));
+ webkit_web_frame_load_string(mainFrame, content.get(), 0, 0, baseURL.get());
+ return true;
+}
+
bool ReloadItem::invoke() const
{
webkit_web_frame_reload(mainFrame);
diff --git a/WebKitTools/DumpRenderTree/gtk/fonts.conf b/WebKitTools/DumpRenderTree/gtk/fonts.conf
deleted file mode 100644
index 3540c47..0000000
--- a/WebKitTools/DumpRenderTree/gtk/fonts.conf
+++ /dev/null
@@ -1,258 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
-<fontconfig>
-
-<!--
- Accept deprecated 'mono' alias, replacing it with 'monospace'
--->
- <match target="pattern">
- <test qual="any" name="family">
- <string>mono</string>
- </test>
- <edit name="family" mode="assign">
- <string>monospace</string>
- </edit>
- </match>
-
-<!--
- Accept alternate 'sans serif' spelling, replacing it with 'sans-serif'
--->
- <match target="pattern">
- <test qual="any" name="family">
- <string>sans serif</string>
- </test>
- <edit name="family" mode="assign">
- <string>sans-serif</string>
- </edit>
- </match>
-
-<!--
- Accept deprecated 'sans' alias, replacing it with 'sans-serif'
--->
- <match target="pattern">
- <test qual="any" name="family">
- <string>sans</string>
- </test>
- <edit name="family" mode="assign">
- <string>sans-serif</string>
- </edit>
- </match>
-
-
- <config>
-<!--
- These are the default Unicode chars that are expected to be blank
- in fonts. All other blank chars are assumed to be broken and
- won't appear in the resulting charsets
- -->
- <blank>
- <int>0x0020</int> <!-- SPACE -->
- <int>0x00A0</int> <!-- NO-BREAK SPACE -->
- <int>0x00AD</int> <!-- SOFT HYPHEN -->
- <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER -->
- <int>0x0600</int> <!-- ARABIC NUMBER SIGN -->
- <int>0x0601</int> <!-- ARABIC SIGN SANAH -->
- <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER -->
- <int>0x0603</int> <!-- ARABIC SIGN SAFHA -->
- <int>0x06DD</int> <!-- ARABIC END OF AYAH -->
- <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK -->
- <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER -->
- <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
- <int>0x1680</int> <!-- OGHAM SPACE MARK -->
- <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ -->
- <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA -->
- <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR -->
- <int>0x2000</int> <!-- EN QUAD -->
- <int>0x2001</int> <!-- EM QUAD -->
- <int>0x2002</int> <!-- EN SPACE -->
- <int>0x2003</int> <!-- EM SPACE -->
- <int>0x2004</int> <!-- THREE-PER-EM SPACE -->
- <int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
- <int>0x2006</int> <!-- SIX-PER-EM SPACE -->
- <int>0x2007</int> <!-- FIGURE SPACE -->
- <int>0x2008</int> <!-- PUNCTUATION SPACE -->
- <int>0x2009</int> <!-- THIN SPACE -->
- <int>0x200A</int> <!-- HAIR SPACE -->
- <int>0x200B</int> <!-- ZERO WIDTH SPACE -->
- <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER -->
- <int>0x200D</int> <!-- ZERO WIDTH JOINER -->
- <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK -->
- <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK -->
- <int>0x2028</int> <!-- LINE SEPARATOR -->
- <int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
- <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
- <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
- <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING -->
- <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
- <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
- <int>0x202F</int> <!-- NARROW NO-BREAK SPACE -->
- <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE -->
- <int>0x2060</int> <!-- WORD JOINER -->
- <int>0x2061</int> <!-- FUNCTION APPLICATION -->
- <int>0x2062</int> <!-- INVISIBLE TIMES -->
- <int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
- <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
- <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
- <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
- <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
- <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
- <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
- <int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
- <int>0x3164</int> <!-- HANGUL FILLER -->
- <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
- <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER -->
- <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
- <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
- <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
- </blank>
-<!--
- Rescan configuration every 30 seconds when FcFontSetList is called
- -->
- <rescan>
- <int>30</int>
- </rescan>
- </config>
-
-<!--
- URW provides metric and shape compatible fonts for these 10 Adobe families.
-
- However, these fonts are quite ugly and do not render well on-screen,
- so we avoid matching them if the application said `anymetrics'; in that
- case, a more generic font with different metrics but better appearance
- will be used.
- -->
- <match target="pattern">
- <test name="family">
- <string>Avant Garde</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>URW Gothic L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Bookman</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>URW Bookman L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Courier</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Nimbus Mono L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Helvetica</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Nimbus Sans L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>New Century Schoolbook</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Century Schoolbook L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Palatino</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>URW Palladio L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Times</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Nimbus Roman No9 L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Zapf Chancery</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>URW Chancery L</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Zapf Dingbats</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append">
- <string>Dingbats</string>
- </edit>
- </match>
- <match target="pattern">
- <test name="family">
- <string>Symbol</string>
- </test>
- <test name="anymetrics" qual="all" compare="not_eq">
- <bool>true</bool>
- </test>
- <edit name="family" mode="append" binding="same">
- <string>Standard Symbols L</string>
- </edit>
- </match>
-
-<!--
- Serif faces
- -->
- <alias>
- <family>Nimbus Roman No9 L</family>
- <default><family>serif</family></default>
- </alias>
-<!--
- Sans-serif faces
- -->
- <alias>
- <family>Nimbus Sans L</family>
- <default><family>sans-serif</family></default>
- </alias>
-<!--
- Monospace faces
- -->
- <alias>
- <family>Nimbus Mono L</family>
- <default><family>monospace</family></default>
- </alias>
-
-
-</fontconfig>
diff --git a/WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTF b/WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTF
new file mode 100644
index 0000000..ac81cb0
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/gtk/fonts/AHEM____.TTF
Binary files differ
diff --git a/WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf b/WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf
new file mode 100644
index 0000000..2d9af17
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/gtk/fonts/fonts.conf
@@ -0,0 +1,390 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<fontconfig>
+
+ <!-- Due to patent (http://freetype.sourceforge.net/patents.html)
+ issues hinting gives different results depending on the
+ freetype version of the linux distribution, avoiding hinting
+ gives more consistent results. When all the distributions
+ release freetype the 2.4, which enables by default the
+ hinting method that was patented, we could undo this change
+ and try the hinting again. -->
+ <match target="font">
+ <edit name="hinting" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+ <!-- The sans-serif font should be Liberation Serif -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>serif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Times</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Times New Roman</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ </match>
+
+ <!-- Until we find good fonts to use for cursive and fantasy
+ just use our serif font. -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>cursive</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>fantasy</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ </match>
+
+ <!-- The sans-serif font should be Liberation Sans -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans serif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>sans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ </match>
+ <!-- We need to ensure that layout tests that use "Helvetica" don't
+ fall back to the default serif font -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Helvetica</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Arial</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Lucida Grande</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ </match>
+
+ <!-- The Monospace font should be Liberation Mono -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>monospace</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>mono</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+ <!-- We need to ensure that layout tests that use "Courier", "Courier New",
+ and "Monaco" (all monospace fonts) don't fall back to the default
+ serif font -->
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Courier</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Courier New</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+ <match target="pattern">
+ <test qual="any" name="family">
+ <string>Monaco</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Mono</string>
+ </edit>
+ </match>
+
+ <!-- The following hinting specializations are adapted from those in the
+ Chromium test_shell. We try to duplicate their incredibly thorough
+ testing here -->
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>NonAntiAliasedSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ <edit name="antialias" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>SlightHintedSerif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ <edit name="hinting" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <edit name="hintstyle" mode="assign">
+ <const>hintslight</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>NonHintedSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ <!-- These deliberately contradict each other. The 'hinting' preference
+ should take priority -->
+ <edit name="hintstyle" mode="assign">
+ <const>hintfull</const>
+ </edit>
+ <edit name="hinting" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>AutohintedSerif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ <edit name="hinting" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <edit name="autohint" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <edit name="hintstyle" mode="assign">
+ <const>hintmedium</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>HintedSerif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ <edit name="hinting" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <edit name="autohint" mode="assign">
+ <bool>false</bool>
+ </edit>
+ <edit name="hintstyle" mode="assign">
+ <const>hintmedium</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>FullAndAutoHintedSerif</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Serif</string>
+ </edit>
+ <edit name="hinting" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <edit name="autohint" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <edit name="hintstyle" mode="assign">
+ <const>hintfull</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>SubpixelEnabledSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ <edit name="rgba" mode="assign">
+ <const>rgb</const>
+ </edit>
+ </match>
+
+ <match target="pattern">
+ <test name="family" compare="eq">
+ <string>SubpixelDisabledSans</string>
+ </test>
+ <edit name="family" mode="assign">
+ <string>Liberation Sans</string>
+ </edit>
+ <edit name="rgba" mode="assign">
+ <const>none</const>
+ </edit>
+ </match>
+
+ <!-- We need to enable simulated bold to for DejaVu Serif to ensure that we interpret
+ this property correctly in: platform/gtk/fonts/fontconfig-synthetic-bold.html -->
+ <match target="font">
+ <test qual="any" name="family">
+ <string>DejaVu Serif</string>
+ </test>
+ <test name="weight" compare="less_eq">
+ <const>medium</const>
+ </test>
+ <test target="pattern" name="weight" compare="more">
+ <const>medium</const>
+ </test>
+ <edit name="embolden" mode="assign">
+ <bool>true</bool>
+ </edit>
+ <edit name="weight" mode="assign">
+ <const>bold</const>
+ </edit>
+ </match>
+
+ <!-- We need to enable simulated oblique to for DejaVu Serif to ensure that we interpret
+ this property correctly in: platform/gtk/fonts/fontconfig-synthetic-oblique.html -->
+ <match target="font">
+ <test qual="any" name="family">
+ <string>DejaVu Serif</string>
+ </test>
+ <test name="slant">
+ <const>roman</const>
+ </test>
+ <test target="pattern" name="slant" compare="not_eq">
+ <const>roman</const>
+ </test>
+ <edit name="matrix" mode="assign">
+ <times>
+ <name>matrix</name>
+ <matrix><double>1</double><double>0.2</double>
+ <double>0</double><double>1</double>
+ </matrix>
+ </times>
+ </edit>
+ <edit name="slant" mode="assign">
+ <const>oblique</const>
+ </edit>
+ <edit name="embeddedbitmap" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+
+ <config>
+ <!-- These are the default Unicode chars that are expected to be blank
+ in fonts. All other blank chars are assumed to be broken and won't
+ appear in the resulting charsets -->
+ <blank>
+ <int>0x0020</int> <!-- SPACE -->
+ <int>0x00A0</int> <!-- NO-BREAK SPACE -->
+ <int>0x00AD</int> <!-- SOFT HYPHEN -->
+ <int>0x034F</int> <!-- COMBINING GRAPHEME JOINER -->
+ <int>0x0600</int> <!-- ARABIC NUMBER SIGN -->
+ <int>0x0601</int> <!-- ARABIC SIGN SANAH -->
+ <int>0x0602</int> <!-- ARABIC FOOTNOTE MARKER -->
+ <int>0x0603</int> <!-- ARABIC SIGN SAFHA -->
+ <int>0x06DD</int> <!-- ARABIC END OF AYAH -->
+ <int>0x070F</int> <!-- SYRIAC ABBREVIATION MARK -->
+ <int>0x115F</int> <!-- HANGUL CHOSEONG FILLER -->
+ <int>0x1160</int> <!-- HANGUL JUNGSEONG FILLER -->
+ <int>0x1680</int> <!-- OGHAM SPACE MARK -->
+ <int>0x17B4</int> <!-- KHMER VOWEL INHERENT AQ -->
+ <int>0x17B5</int> <!-- KHMER VOWEL INHERENT AA -->
+ <int>0x180E</int> <!-- MONGOLIAN VOWEL SEPARATOR -->
+ <int>0x2000</int> <!-- EN QUAD -->
+ <int>0x2001</int> <!-- EM QUAD -->
+ <int>0x2002</int> <!-- EN SPACE -->
+ <int>0x2003</int> <!-- EM SPACE -->
+ <int>0x2004</int> <!-- THREE-PER-EM SPACE -->
+ <int>0x2005</int> <!-- FOUR-PER-EM SPACE -->
+ <int>0x2006</int> <!-- SIX-PER-EM SPACE -->
+ <int>0x2007</int> <!-- FIGURE SPACE -->
+ <int>0x2008</int> <!-- PUNCTUATION SPACE -->
+ <int>0x2009</int> <!-- THIN SPACE -->
+ <int>0x200A</int> <!-- HAIR SPACE -->
+ <int>0x200B</int> <!-- ZERO WIDTH SPACE -->
+ <int>0x200C</int> <!-- ZERO WIDTH NON-JOINER -->
+ <int>0x200D</int> <!-- ZERO WIDTH JOINER -->
+ <int>0x200E</int> <!-- LEFT-TO-RIGHT MARK -->
+ <int>0x200F</int> <!-- RIGHT-TO-LEFT MARK -->
+ <int>0x2028</int> <!-- LINE SEPARATOR -->
+ <int>0x2029</int> <!-- PARAGRAPH SEPARATOR -->
+ <int>0x202A</int> <!-- LEFT-TO-RIGHT EMBEDDING -->
+ <int>0x202B</int> <!-- RIGHT-TO-LEFT EMBEDDING -->
+ <int>0x202C</int> <!-- POP DIRECTIONAL FORMATTING -->
+ <int>0x202D</int> <!-- LEFT-TO-RIGHT OVERRIDE -->
+ <int>0x202E</int> <!-- RIGHT-TO-LEFT OVERRIDE -->
+ <int>0x202F</int> <!-- NARROW NO-BREAK SPACE -->
+ <int>0x205F</int> <!-- MEDIUM MATHEMATICAL SPACE -->
+ <int>0x2060</int> <!-- WORD JOINER -->
+ <int>0x2061</int> <!-- FUNCTION APPLICATION -->
+ <int>0x2062</int> <!-- INVISIBLE TIMES -->
+ <int>0x2063</int> <!-- INVISIBLE SEPARATOR -->
+ <int>0x206A</int> <!-- INHIBIT SYMMETRIC SWAPPING -->
+ <int>0x206B</int> <!-- ACTIVATE SYMMETRIC SWAPPING -->
+ <int>0x206C</int> <!-- INHIBIT ARABIC FORM SHAPING -->
+ <int>0x206D</int> <!-- ACTIVATE ARABIC FORM SHAPING -->
+ <int>0x206E</int> <!-- NATIONAL DIGIT SHAPES -->
+ <int>0x206F</int> <!-- NOMINAL DIGIT SHAPES -->
+ <int>0x3000</int> <!-- IDEOGRAPHIC SPACE -->
+ <int>0x3164</int> <!-- HANGUL FILLER -->
+ <int>0xFEFF</int> <!-- ZERO WIDTH NO-BREAK SPACE -->
+ <int>0xFFA0</int> <!-- HALFWIDTH HANGUL FILLER -->
+ <int>0xFFF9</int> <!-- INTERLINEAR ANNOTATION ANCHOR -->
+ <int>0xFFFA</int> <!-- INTERLINEAR ANNOTATION SEPARATOR -->
+ <int>0xFFFB</int> <!-- INTERLINEAR ANNOTATION TERMINATOR -->
+ </blank>
+ </config>
+</fontconfig>
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
index 4d2da6e..9d7edef 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityControllerMac.mm
@@ -40,6 +40,12 @@ AccessibilityController::~AccessibilityController()
{
}
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+ id accessibilityObject = [[[mainFrame frameView] documentView] accessibilityHitTest:NSMakePoint(x, y)];
+ return AccessibilityUIElement(accessibilityObject);
+}
+
AccessibilityUIElement AccessibilityController::focusedElement()
{
// FIXME: we could do some caching here.
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm
new file mode 100644
index 0000000..9170ab6
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityTextMarkerMac.mm
@@ -0,0 +1,81 @@
+/*
+ * 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.
+ */
+
+#import "config.h"
+
+#import "AccessibilityTextMarker.h"
+#import "DumpRenderTree.h"
+
+#pragma mark AccessibilityTextMarker
+
+AccessibilityTextMarker::AccessibilityTextMarker(PlatformTextMarker marker)
+ : m_textMarker(marker)
+{
+}
+
+AccessibilityTextMarker::AccessibilityTextMarker(const AccessibilityTextMarker& marker)
+ : m_textMarker(marker.platformTextMarker())
+{
+}
+
+AccessibilityTextMarker::~AccessibilityTextMarker()
+{
+}
+
+bool AccessibilityTextMarker::isEqual(AccessibilityTextMarker* other)
+{
+ return [(id)platformTextMarker() isEqual:(id)other->platformTextMarker()];
+}
+
+PlatformTextMarker AccessibilityTextMarker::platformTextMarker() const
+{
+ return m_textMarker.get();
+}
+
+#pragma mark AccessibilityTextMarkerRange
+
+AccessibilityTextMarkerRange::AccessibilityTextMarkerRange(PlatformTextMarkerRange markerRange)
+ : m_textMarkerRange(markerRange)
+{
+}
+
+AccessibilityTextMarkerRange::AccessibilityTextMarkerRange(const AccessibilityTextMarkerRange& markerRange)
+ : m_textMarkerRange(markerRange.platformTextMarkerRange())
+{
+}
+
+AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange()
+{
+}
+
+bool AccessibilityTextMarkerRange::isEqual(AccessibilityTextMarkerRange* other)
+{
+ return [(id)platformTextMarkerRange() isEqual:(id)other->platformTextMarkerRange()];
+}
+
+PlatformTextMarkerRange AccessibilityTextMarkerRange::platformTextMarkerRange() const
+{
+ return m_textMarkerRange.get();
+}
diff --git a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
index e9361f2..e27ee0e 100644
--- a/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
@@ -53,36 +53,21 @@
#define NSAccessibilityDropEffectsAttribute @"AXDropEffects"
#endif
+// If an unsupported attribute is passed in, it will raise an accessibility exception. These are usually caught by the Accessibility Runtime to inform
+// the AX client app of the error. However, DRT is the AX client app, so it must catch these exceptions.
+#define BEGIN_AX_OBJC_EXCEPTIONS @try {
+#define END_AX_OBJC_EXCEPTIONS } @catch(NSException *e) { if (![[e name] isEqualToString:NSAccessibilityException]) @throw; }
+
+
typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
@interface NSObject (WebKitAccessibilityAdditions)
- (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
-- (void)accessibilitySetPostedNotificationCallback:(AXPostedNotificationCallback)function withContext:(void*)context;
+- (void)accessibilitySetShouldRepostNotifications:(BOOL)repost;
- (NSUInteger)accessibilityIndexOfChild:(id)child;
+- (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute;
@end
-AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
- : m_element(element)
- , m_notificationFunctionCallback(0)
-{
- [m_element retain];
-}
-
-AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
- : m_element(other.m_element)
- , m_notificationFunctionCallback(0)
-{
- [m_element retain];
-}
-
-AccessibilityUIElement::~AccessibilityUIElement()
-{
- // Make sure that our notification callback does not stick around.
- if (m_notificationFunctionCallback)
- [m_element accessibilitySetPostedNotificationCallback:0 withContext:0];
- [m_element release];
-}
-
@interface NSString (JSStringRefAdditions)
+ (NSString *)stringWithJSStringRef:(JSStringRef)jsStringRef;
- (JSStringRef)createJSStringRef;
@@ -106,6 +91,88 @@ AccessibilityUIElement::~AccessibilityUIElement()
@end
+@interface AccessibilityNotificationHandler : NSObject
+{
+ id m_platformElement;
+ JSObjectRef m_notificationFunctionCallback;
+}
+
+@end
+
+@implementation AccessibilityNotificationHandler
+
+- (id)initWithPlatformElement:(id)platformElement
+{
+ self = [super init];
+
+ m_platformElement = platformElement;
+
+ // Once an object starts requesting notifications, it's on for the duration of the program.
+ // This is to avoid any race conditions between tests turning this flag on and off. Instead
+ // AccessibilityNotificationHandler can just listen when they want to.
+ [m_platformElement accessibilitySetShouldRepostNotifications:YES];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_notificationReceived:) name:@"AXDRTNotification" object:nil];
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ JSValueUnprotect([mainFrame globalContext], m_notificationFunctionCallback);
+ m_notificationFunctionCallback = 0;
+
+ [super dealloc];
+}
+
+- (void)_notificationReceived:(NSNotification *)notification
+{
+ NSString *notificationName = [[notification userInfo] objectForKey:@"notificationName"];
+ if (!notificationName)
+ return;
+
+ JSRetainPtr<JSStringRef> jsNotification(Adopt, [notificationName createJSStringRef]);
+ JSValueRef argument = JSValueMakeString([mainFrame globalContext], jsNotification.get());
+ JSObjectCallAsFunction([mainFrame globalContext], m_notificationFunctionCallback, 0, 1, &argument, 0);
+}
+
+- (void)setCallback:(JSObjectRef)callback
+{
+ if (!callback)
+ return;
+
+ // Release the old callback.
+ if (m_notificationFunctionCallback)
+ JSValueUnprotect([mainFrame globalContext], m_notificationFunctionCallback);
+
+ m_notificationFunctionCallback = callback;
+ JSValueProtect([mainFrame globalContext], m_notificationFunctionCallback);
+}
+
+@end
+
+AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
+ : m_element(element)
+ , m_notificationHandler(0)
+{
+ // FIXME: ap@webkit.org says ObjC objects need to be CFRetained/CFRelease to be GC-compliant on the mac.
+ [m_element retain];
+}
+
+AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
+ : m_element(other.m_element)
+ , m_notificationHandler(0)
+{
+ [m_element retain];
+}
+
+AccessibilityUIElement::~AccessibilityUIElement()
+{
+ // The notification handler should be nil because removeNotificationListener() should have been called in the test.
+ ASSERT(!m_notificationHandler);
+ [m_element release];
+}
+
static NSString* descriptionOfValue(id valueObject, id focusedAccessibilityObject)
{
if (!valueObject)
@@ -163,11 +230,11 @@ static NSString* attributesOfElement(id accessibilityObject)
// accessibilityAttributeValue: can throw an if an attribute is not returned.
// For DumpRenderTree's purpose, we should ignore those exceptions
- @try {
- id valueObject = [accessibilityObject accessibilityAttributeValue:attribute];
- NSString* value = descriptionOfValue(valueObject, accessibilityObject);
- [attributesString appendFormat:@"%@: %@\n", attribute, value];
- } @catch (NSException* e) { }
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id valueObject = [accessibilityObject accessibilityAttributeValue:attribute];
+ NSString* value = descriptionOfValue(valueObject, accessibilityObject);
+ [attributesString appendFormat:@"%@: %@\n", attribute, value];
+ END_AX_OBJC_EXCEPTIONS
}
return attributesString;
@@ -208,26 +275,34 @@ static JSStringRef descriptionOfElements(Vector<AccessibilityUIElement>& element
void AccessibilityUIElement::getLinkedUIElements(Vector<AccessibilityUIElement>& elementVector)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* linkedElements = [m_element accessibilityAttributeValue:NSAccessibilityLinkedUIElementsAttribute];
convertNSArrayToVector(linkedElements, elementVector);
+ END_AX_OBJC_EXCEPTIONS
}
void AccessibilityUIElement::getDocumentLinks(Vector<AccessibilityUIElement>& elementVector)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* linkElements = [m_element accessibilityAttributeValue:@"AXLinkUIElements"];
convertNSArrayToVector(linkElements, elementVector);
+ END_AX_OBJC_EXCEPTIONS
}
void AccessibilityUIElement::getChildren(Vector<AccessibilityUIElement>& elementVector)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* children = [m_element accessibilityAttributeValue:NSAccessibilityChildrenAttribute];
convertNSArrayToVector(children, elementVector);
+ END_AX_OBJC_EXCEPTIONS
}
void AccessibilityUIElement::getChildrenWithRange(Vector<AccessibilityUIElement>& elementVector, unsigned location, unsigned length)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* children = [m_element accessibilityArrayAttributeValues:NSAccessibilityChildrenAttribute index:location maxCount:length];
convertNSArrayToVector(children, elementVector);
+ END_AX_OBJC_EXCEPTIONS
}
int AccessibilityUIElement::childrenCount()
@@ -262,65 +337,110 @@ AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index)
return 0;
}
+AccessibilityUIElement AccessibilityUIElement::linkedUIElementAtIndex(unsigned index)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSArray* objects = [m_element accessibilityAttributeValue:NSAccessibilityLinkedUIElementsAttribute];
+ if (index < [objects count])
+ return [objects objectAtIndex:index];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* objects = [m_element accessibilityAttributeValue:NSAccessibilityOwnsAttribute];
if (index < [objects count])
return [objects objectAtIndex:index];
+ END_AX_OBJC_EXCEPTIONS
return 0;
}
AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* objects = [m_element accessibilityAttributeValue:NSAccessibilityLinkedUIElementsAttribute];
if (index < [objects count])
return [objects objectAtIndex:index];
+ END_AX_OBJC_EXCEPTIONS
return 0;
}
AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* rows = [m_element accessibilityAttributeValue:NSAccessibilityDisclosedRowsAttribute];
if (index < [rows count])
return [rows objectAtIndex:index];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::selectedChildAtIndex(unsigned index) const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSArray* array = [m_element accessibilityAttributeValue:NSAccessibilitySelectedChildrenAttribute];
+ if (index < [array count])
+ return [array objectAtIndex:index];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+unsigned AccessibilityUIElement::selectedChildrenCount() const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ return [m_element accessibilityArrayAttributeCount:NSAccessibilitySelectedChildrenAttribute];
+ END_AX_OBJC_EXCEPTIONS
return 0;
}
AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* rows = [m_element accessibilityAttributeValue:NSAccessibilitySelectedRowsAttribute];
if (index < [rows count])
return [rows objectAtIndex:index];
+ END_AX_OBJC_EXCEPTIONS
return 0;
}
AccessibilityUIElement AccessibilityUIElement::titleUIElement()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id accessibilityObject = [m_element accessibilityAttributeValue:NSAccessibilityTitleUIElementAttribute];
if (accessibilityObject)
return AccessibilityUIElement(accessibilityObject);
+ END_AX_OBJC_EXCEPTIONS
return 0;
}
AccessibilityUIElement AccessibilityUIElement::parentElement()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id accessibilityObject = [m_element accessibilityAttributeValue:NSAccessibilityParentAttribute];
if (accessibilityObject)
return AccessibilityUIElement(accessibilityObject);
+ END_AX_OBJC_EXCEPTIONS
return 0;
}
AccessibilityUIElement AccessibilityUIElement::disclosedByRow()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id accessibilityObject = [m_element accessibilityAttributeValue:NSAccessibilityDisclosedByRowAttribute];
if (accessibilityObject)
return AccessibilityUIElement(accessibilityObject);
+ END_AX_OBJC_EXCEPTIONS
return 0;
}
@@ -354,29 +474,42 @@ JSStringRef AccessibilityUIElement::allAttributes()
JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]];
- if (![value isKindOfClass:[NSString class]])
- return NULL;
- return [value createJSStringRef];
+ if ([value isKindOfClass:[NSString class]])
+ return [value createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]];
- if (![value isKindOfClass:[NSNumber class]])
- return NULL;
+ if ([value isKindOfClass:[NSNumber class]])
+ return [value boolValue];
+ END_AX_OBJC_EXCEPTIONS
- return [value boolValue];
+ return false;
}
bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
return [m_element accessibilityIsAttributeSettable:[NSString stringWithJSStringRef:attribute]];
+ END_AX_OBJC_EXCEPTIONS
+
+ return false;
}
bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
return [[m_element accessibilityAttributeNames] containsObject:[NSString stringWithJSStringRef:attribute]];
+ END_AX_OBJC_EXCEPTIONS
+
+ return false;
}
JSStringRef AccessibilityUIElement::parameterizedAttributeNames()
@@ -393,163 +526,260 @@ JSStringRef AccessibilityUIElement::parameterizedAttributeNames()
JSStringRef AccessibilityUIElement::role()
{
- NSString* role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityRoleAttribute], m_element);
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSString *role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityRoleAttribute], m_element);
return concatenateAttributeAndValue(@"AXRole", role);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::subrole()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSString* role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilitySubroleAttribute], m_element);
return concatenateAttributeAndValue(@"AXSubrole", role);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::roleDescription()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSString* role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityRoleDescriptionAttribute], m_element);
return concatenateAttributeAndValue(@"AXRoleDescription", role);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::title()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSString* title = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityTitleAttribute], m_element);
return concatenateAttributeAndValue(@"AXTitle", title);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::description()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityDescriptionAttribute], m_element);
return concatenateAttributeAndValue(@"AXDescription", description);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::orientation() const
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityOrientationAttribute], m_element);
return concatenateAttributeAndValue(@"AXOrientation", description);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::stringValue()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityValueAttribute], m_element);
return concatenateAttributeAndValue(@"AXValue", description);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::language()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id description = descriptionOfValue([m_element accessibilityAttributeValue:@"AXLanguage"], m_element);
return concatenateAttributeAndValue(@"AXLanguage", description);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+JSStringRef AccessibilityUIElement::helpText() const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityHelpAttribute], m_element);
+ return concatenateAttributeAndValue(@"AXHelp", description);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
double AccessibilityUIElement::x()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSValue* positionValue = [m_element accessibilityAttributeValue:NSAccessibilityPositionAttribute];
return static_cast<double>([positionValue pointValue].x);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0.0f;
}
double AccessibilityUIElement::y()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSValue* positionValue = [m_element accessibilityAttributeValue:NSAccessibilityPositionAttribute];
return static_cast<double>([positionValue pointValue].y);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0.0f;
}
double AccessibilityUIElement::width()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSValue* sizeValue = [m_element accessibilityAttributeValue:NSAccessibilitySizeAttribute];
return static_cast<double>([sizeValue sizeValue].width);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0.0f;
}
double AccessibilityUIElement::height()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSValue* sizeValue = [m_element accessibilityAttributeValue:NSAccessibilitySizeAttribute];
return static_cast<double>([sizeValue sizeValue].height);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0.0f;
}
double AccessibilityUIElement::clickPointX()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSValue* positionValue = [m_element accessibilityAttributeValue:@"AXClickPoint"];
return static_cast<double>([positionValue pointValue].x);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0.0f;
}
double AccessibilityUIElement::clickPointY()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSValue* positionValue = [m_element accessibilityAttributeValue:@"AXClickPoint"];
return static_cast<double>([positionValue pointValue].y);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0.0f;
}
double AccessibilityUIElement::intValue() const
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityValueAttribute];
if ([value isKindOfClass:[NSNumber class]])
return [(NSNumber*)value doubleValue];
+ END_AX_OBJC_EXCEPTIONS
+
return 0.0f;
}
double AccessibilityUIElement::minValue()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityMinValueAttribute];
if ([value isKindOfClass:[NSNumber class]])
return [(NSNumber*)value doubleValue];
+ END_AX_OBJC_EXCEPTIONS
+
return 0.0f;
}
double AccessibilityUIElement::maxValue()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityMaxValueAttribute];
if ([value isKindOfClass:[NSNumber class]])
return [(NSNumber*)value doubleValue];
+ END_AX_OBJC_EXCEPTIONS
+
return 0.0;
}
JSStringRef AccessibilityUIElement::valueDescription()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSString* valueDescription = [m_element accessibilityAttributeValue:NSAccessibilityValueDescriptionAttribute];
if ([valueDescription isKindOfClass:[NSString class]])
return [valueDescription createJSStringRef];
+
+ END_AX_OBJC_EXCEPTIONS
return 0;
}
int AccessibilityUIElement::insertionPointLineNumber()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityInsertionPointLineNumberAttribute];
if ([value isKindOfClass:[NSNumber class]])
return [(NSNumber *)value intValue];
+ END_AX_OBJC_EXCEPTIONS
+
return -1;
}
bool AccessibilityUIElement::isActionSupported(JSStringRef action)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* actions = [m_element accessibilityActionNames];
return [actions containsObject:[NSString stringWithJSStringRef:action]];
+ END_AX_OBJC_EXCEPTIONS
+
+ return false;
}
bool AccessibilityUIElement::isEnabled()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityEnabledAttribute];
if ([value isKindOfClass:[NSNumber class]])
return [value boolValue];
+ END_AX_OBJC_EXCEPTIONS
+
return false;
}
bool AccessibilityUIElement::isRequired() const
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:@"AXRequired"];
if ([value isKindOfClass:[NSNumber class]])
return [value boolValue];
+ END_AX_OBJC_EXCEPTIONS
+
return false;
}
bool AccessibilityUIElement::isSelected() const
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilitySelectedAttribute];
if ([value isKindOfClass:[NSNumber class]])
return [value boolValue];
+ END_AX_OBJC_EXCEPTIONS
+
return false;
}
bool AccessibilityUIElement::isExpanded() const
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityExpandedAttribute];
if ([value isKindOfClass:[NSNumber class]])
return [value boolValue];
+ END_AX_OBJC_EXCEPTIONS
+
return false;
}
@@ -561,22 +791,40 @@ bool AccessibilityUIElement::isChecked() const
int AccessibilityUIElement::hierarchicalLevel() const
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityDisclosureLevelAttribute];
if ([value isKindOfClass:[NSNumber class]])
return [value intValue];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+JSStringRef AccessibilityUIElement::speak()
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id value = [m_element accessibilityAttributeValue:@"AXDRTSpeechAttribute"];
+ if ([value isKindOfClass:[NSString class]])
+ return [value createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
return 0;
}
bool AccessibilityUIElement::ariaIsGrabbed() const
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityGrabbedAttribute];
if ([value isKindOfClass:[NSNumber class]])
return [value boolValue];
+ END_AX_OBJC_EXCEPTIONS
+
return false;
}
JSStringRef AccessibilityUIElement::ariaDropEffects() const
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityDropEffectsAttribute];
if (![value isKindOfClass:[NSArray class]])
return 0;
@@ -590,20 +838,39 @@ JSStringRef AccessibilityUIElement::ariaDropEffects() const
}
return [dropEffects createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
// parameterized attributes
int AccessibilityUIElement::lineForIndex(int index)
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityLineForIndexParameterizedAttribute forParameter:[NSNumber numberWithInt:index]];
if ([value isKindOfClass:[NSNumber class]])
return [(NSNumber *)value intValue];
+ END_AX_OBJC_EXCEPTIONS
+
return -1;
}
+JSStringRef AccessibilityUIElement::rangeForLine(int line)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id value = [m_element accessibilityAttributeValue:NSAccessibilityRangeForLineParameterizedAttribute forParameter:[NSNumber numberWithInt:line]];
+ if ([value isKindOfClass:[NSValue class]]) {
+ return [NSStringFromRange([value rangeValue]) createJSStringRef];
+ }
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
{
NSRange range = NSMakeRange(location, length);
+ BEGIN_AX_OBJC_EXCEPTIONS
id value = [m_element accessibilityAttributeValue:NSAccessibilityBoundsForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
NSRect rect = NSMakeRect(0,0,0,0);
if ([value isKindOfClass:[NSValue class]])
@@ -612,61 +879,120 @@ JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned l
// don't return position information because it is platform dependent
NSMutableString* boundsDescription = [NSMutableString stringWithFormat:@"{{%f, %f}, {%f, %f}}",-1.0f,-1.0f,rect.size.width,rect.size.height];
return [boundsDescription createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::stringForRange(unsigned location, unsigned length)
{
NSRange range = NSMakeRange(location, length);
+ BEGIN_AX_OBJC_EXCEPTIONS
id string = [m_element accessibilityAttributeValue:NSAccessibilityStringForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
if (![string isKindOfClass:[NSString class]])
return 0;
return [string createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
+{
+ NSRange range = NSMakeRange(location, length);
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSAttributedString* string = [m_element accessibilityAttributeValue:NSAccessibilityAttributedStringForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
+ if (![string isKindOfClass:[NSAttributedString class]])
+ return 0;
+
+ NSString* stringWithAttrs = [string description];
+ return [stringWithAttrs createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length)
+{
+ NSRange range = NSMakeRange(location, length);
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSAttributedString* string = [m_element accessibilityAttributeValue:NSAccessibilityAttributedStringForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
+ if (![string isKindOfClass:[NSAttributedString class]])
+ return false;
+
+ NSDictionary* attrs = [string attributesAtIndex:0 effectiveRange:nil];
+ if([[attrs objectForKey:NSAccessibilityMisspelledTextAttribute] boolValue])
+ return true;
+ END_AX_OBJC_EXCEPTIONS
+
+ return false;
}
JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
{
// not yet defined in AppKit... odd
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* columnHeadersArray = [m_element accessibilityAttributeValue:@"AXColumnHeaderUIElements"];
Vector<AccessibilityUIElement> columnHeadersVector;
convertNSArrayToVector(columnHeadersArray, columnHeadersVector);
return descriptionOfElements(columnHeadersVector);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::attributesOfRowHeaders()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* rowHeadersArray = [m_element accessibilityAttributeValue:@"AXRowHeaderUIElements"];
Vector<AccessibilityUIElement> rowHeadersVector;
convertNSArrayToVector(rowHeadersArray, rowHeadersVector);
return descriptionOfElements(rowHeadersVector);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::attributesOfColumns()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* columnsArray = [m_element accessibilityAttributeValue:NSAccessibilityColumnsAttribute];
Vector<AccessibilityUIElement> columnsVector;
convertNSArrayToVector(columnsArray, columnsVector);
return descriptionOfElements(columnsVector);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::attributesOfRows()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* rowsArray = [m_element accessibilityAttributeValue:NSAccessibilityRowsAttribute];
Vector<AccessibilityUIElement> rowsVector;
convertNSArrayToVector(rowsArray, rowsVector);
return descriptionOfElements(rowsVector);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::attributesOfVisibleCells()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSArray* cellsArray = [m_element accessibilityAttributeValue:@"AXVisibleCells"];
Vector<AccessibilityUIElement> cellsVector;
convertNSArrayToVector(cellsArray, cellsVector);
return descriptionOfElements(cellsVector);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::attributesOfHeader()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
id headerObject = [m_element accessibilityAttributeValue:NSAccessibilityHeaderAttribute];
if (!headerObject)
return [@"" createJSStringRef];
@@ -674,66 +1000,135 @@ JSStringRef AccessibilityUIElement::attributesOfHeader()
Vector<AccessibilityUIElement> headerVector;
headerVector.append(headerObject);
return descriptionOfElements(headerVector);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+int AccessibilityUIElement::rowCount()
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ return [m_element accessibilityArrayAttributeCount:NSAccessibilityRowsAttribute];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+int AccessibilityUIElement::columnCount()
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ return [m_element accessibilityArrayAttributeCount:NSAccessibilityColumnsAttribute];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
int AccessibilityUIElement::indexInTable()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSNumber* indexNumber = [m_element accessibilityAttributeValue:NSAccessibilityIndexAttribute];
- if (!indexNumber)
- return -1;
- return [indexNumber intValue];
+ if (indexNumber)
+ return [indexNumber intValue];
+ END_AX_OBJC_EXCEPTIONS
+
+ return -1;
}
JSStringRef AccessibilityUIElement::rowIndexRange()
{
+ NSRange range = NSMakeRange(0,0);
+ BEGIN_AX_OBJC_EXCEPTIONS
NSValue* indexRange = [m_element accessibilityAttributeValue:@"AXRowIndexRange"];
- NSRange range = indexRange ? [indexRange rangeValue] : NSMakeRange(0,0);
+ if (indexRange)
+ range = [indexRange rangeValue];
NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length];
return [rangeDescription createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::columnIndexRange()
{
+ NSRange range = NSMakeRange(0,0);
+ BEGIN_AX_OBJC_EXCEPTIONS
NSNumber* indexRange = [m_element accessibilityAttributeValue:@"AXColumnIndexRange"];
- NSRange range = indexRange ? [indexRange rangeValue] : NSMakeRange(0,0);
+ if (indexRange)
+ range = [indexRange rangeValue];
NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length];
return [rangeDescription createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned col, unsigned row)
{
NSArray *colRowArray = [NSArray arrayWithObjects:[NSNumber numberWithUnsignedInt:col], [NSNumber numberWithUnsignedInt:row], nil];
+ BEGIN_AX_OBJC_EXCEPTIONS
return [m_element accessibilityAttributeValue:@"AXCellForColumnAndRow" forParameter:colRowArray];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
JSStringRef AccessibilityUIElement::selectedTextRange()
{
- NSNumber *indexRange = [m_element accessibilityAttributeValue:NSAccessibilitySelectedTextRangeAttribute];
- NSRange range = indexRange ? [indexRange rangeValue] : NSMakeRange(0,0);
+ NSRange range = NSMakeRange(NSNotFound, 0);
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSValue *indexRange = [m_element accessibilityAttributeValue:NSAccessibilitySelectedTextRangeAttribute];
+ if (indexRange)
+ range = [indexRange rangeValue];
NSMutableString *rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length];
return [rangeDescription createJSStringRef];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
}
void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
{
NSRange textRange = NSMakeRange(location, length);
NSValue *textRangeValue = [NSValue valueWithRange:textRange];
+ BEGIN_AX_OBJC_EXCEPTIONS
[m_element accessibilitySetValue:textRangeValue forAttribute:NSAccessibilitySelectedTextRangeAttribute];
+ END_AX_OBJC_EXCEPTIONS
}
void AccessibilityUIElement::increment()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
[m_element accessibilityPerformAction:NSAccessibilityIncrementAction];
+ END_AX_OBJC_EXCEPTIONS
}
void AccessibilityUIElement::decrement()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
[m_element accessibilityPerformAction:NSAccessibilityDecrementAction];
+ END_AX_OBJC_EXCEPTIONS
}
void AccessibilityUIElement::showMenu()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
[m_element accessibilityPerformAction:NSAccessibilityShowMenuAction];
+ END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::press()
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ [m_element accessibilityPerformAction:NSAccessibilityPressAction];
+ END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement* element) const
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSArray* array = [NSArray arrayWithObject:element->platformUIElement()];
+ [m_element accessibilitySetValue:array forAttribute:NSAccessibilitySelectedChildrenAttribute];
+ END_AX_OBJC_EXCEPTIONS
}
JSStringRef AccessibilityUIElement::accessibilityValue() const
@@ -754,20 +1149,12 @@ JSStringRef AccessibilityUIElement::documentURI()
JSStringRef AccessibilityUIElement::url()
{
+ BEGIN_AX_OBJC_EXCEPTIONS
NSURL *url = [m_element accessibilityAttributeValue:NSAccessibilityURLAttribute];
return [[url absoluteString] createJSStringRef];
-}
-
-static void _accessibilityNotificationCallback(id element, NSString* notification, void* context)
-{
- if (!context)
- return;
-
- JSObjectRef functionCallback = static_cast<JSObjectRef>(context);
-
- JSRetainPtr<JSStringRef> jsNotification(Adopt, [notification createJSStringRef]);
- JSValueRef argument = JSValueMakeString([mainFrame globalContext], jsNotification.get());
- JSObjectCallAsFunction([mainFrame globalContext], functionCallback, NULL, 1, &argument, NULL);
+ END_AX_OBJC_EXCEPTIONS
+
+ return nil;
}
bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallback)
@@ -775,11 +1162,25 @@ bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallbac
if (!functionCallback)
return false;
- m_notificationFunctionCallback = functionCallback;
- [platformUIElement() accessibilitySetPostedNotificationCallback:_accessibilityNotificationCallback withContext:reinterpret_cast<void*>(m_notificationFunctionCallback)];
+ // Mac programmers should not be adding more than one notification listener per element.
+ // Other platforms may be different.
+ if (m_notificationHandler)
+ return false;
+ m_notificationHandler = [[AccessibilityNotificationHandler alloc] initWithPlatformElement:platformUIElement()];
+ [m_notificationHandler setCallback:functionCallback];
+
return true;
}
+void AccessibilityUIElement::removeNotificationListener()
+{
+ // Mac programmers should not be trying to remove a listener that's already removed.
+ ASSERT(m_notificationHandler);
+
+ [m_notificationHandler release];
+ m_notificationHandler = nil;
+}
+
bool AccessibilityUIElement::isSelectable() const
{
// FIXME: implement
@@ -810,9 +1211,23 @@ bool AccessibilityUIElement::isCollapsed() const
return false;
}
+bool AccessibilityUIElement::isIgnored() const
+{
+ BOOL result = NO;
+ BEGIN_AX_OBJC_EXCEPTIONS
+ result = [m_element accessibilityIsIgnored];
+ END_AX_OBJC_EXCEPTIONS
+ return result;
+}
+
bool AccessibilityUIElement::hasPopup() const
{
- // FIXME: implement
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id value = [m_element accessibilityAttributeValue:@"AXHasPopup"];
+ if ([value isKindOfClass:[NSNumber class]])
+ return [value boolValue];
+ END_AX_OBJC_EXCEPTIONS
+
return false;
}
@@ -835,3 +1250,80 @@ void AccessibilityUIElement::removeSelection()
{
// FIXME: implement
}
+
+#if SUPPORTS_AX_TEXTMARKERS
+
+// Text markers
+AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement* element)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarkerRange = [m_element accessibilityAttributeValue:@"AXTextMarkerRangeForUIElement" forParameter:element->platformUIElement()];
+ return AccessibilityTextMarkerRange(textMarkerRange);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSNumber* lengthValue = [m_element accessibilityAttributeValue:@"AXLengthForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+ return [lengthValue intValue];
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+
+AccessibilityTextMarkerRange AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ NSArray* textMarkers = [NSArray arrayWithObjects:(id)startMarker->platformTextMarker(), (id)endMarker->platformTextMarker(), nil];
+ id textMarkerRange = [m_element accessibilityAttributeValue:@"AXTextMarkerRangeForUnorderedTextMarkers" forParameter:textMarkers];
+ return AccessibilityTextMarkerRange(textMarkerRange);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarkerForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+ return AccessibilityTextMarker(textMarker);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarkerForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+ return AccessibilityTextMarker(textMarker);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+AccessibilityTextMarker AccessibilityUIElement::textMarkerForPoint(int x, int y)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id textMarker = [m_element accessibilityAttributeValue:@"AXTextMarkerForPosition" forParameter:[NSValue valueWithPoint:NSMakePoint(x, y)]];
+ return AccessibilityTextMarker(textMarker);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker)
+{
+ BEGIN_AX_OBJC_EXCEPTIONS
+ id uiElement = [m_element accessibilityAttributeValue:@"AXUIElementForTextMarker" forParameter:(id)marker->platformTextMarker()];
+ return AccessibilityUIElement(uiElement);
+ END_AX_OBJC_EXCEPTIONS
+
+ return 0;
+}
+
+#endif // SUPPORTS_AX_TEXTMARKERS
diff --git a/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig b/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig
index a72dd7d..28a0518 100644
--- a/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig
+++ b/WebKitTools/DumpRenderTree/mac/Configurations/Base.xcconfig
@@ -27,6 +27,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ENABLE_DASHBOARD_SUPPORT WEBKIT_VERSION_MIN_REQUI
DEBUG_INFORMATION_FORMAT = dwarf
PREBINDING = NO
GCC_C_LANGUAGE_STANDARD = gnu99
+GCC_OBJC_CALL_CXX_CDTORS = YES
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_TREAT_WARNINGS_AS_ERRORS = YES
GCC_WARN_UNUSED_FUNCTION = YES
@@ -34,3 +35,35 @@ 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/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig b/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
index 96a39a9..ab3278e 100644
--- a/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
+++ b/WebKitTools/DumpRenderTree/mac/Configurations/DebugRelease.xcconfig
@@ -23,7 +23,7 @@
#include "Base.xcconfig"
-ARCHS = $(ARCHS_$(MAC_OS_X_VERSION_MAJOR));
+ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
ARCHS_ = $(ARCHS_1040);
ARCHS_1040 = $(NATIVE_ARCH);
ARCHS_1050 = $(NATIVE_ARCH);
@@ -32,7 +32,7 @@ ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT);
ONLY_ACTIVE_ARCH = YES;
-MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(MAC_OS_X_VERSION_MAJOR))
+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;
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index 7a4429b..e280fab 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -41,6 +41,7 @@
#import "HistoryDelegate.h"
#import "JavaScriptThreading.h"
#import "LayoutTestController.h"
+#import "MockGeolocationProvider.h"
#import "NavigationController.h"
#import "ObjCPlugin.h"
#import "ObjCPluginFunction.h"
@@ -48,22 +49,25 @@
#import "PolicyDelegate.h"
#import "ResourceLoadDelegate.h"
#import "UIDelegate.h"
+#import "WebArchiveDumpSupport.h"
#import "WorkQueue.h"
#import "WorkQueueItem.h"
#import <Carbon/Carbon.h>
#import <CoreFoundation/CoreFoundation.h>
+#import <WebCore/FoundationExtras.h>
#import <WebKit/DOMElement.h>
#import <WebKit/DOMExtensions.h>
#import <WebKit/DOMRange.h>
+#import <WebKit/WebArchive.h>
#import <WebKit/WebBackForwardList.h>
#import <WebKit/WebCache.h>
#import <WebKit/WebCoreStatistics.h>
#import <WebKit/WebDataSourcePrivate.h>
#import <WebKit/WebDatabaseManagerPrivate.h>
#import <WebKit/WebDocumentPrivate.h>
+#import <WebKit/WebDeviceOrientationProviderMock.h>
#import <WebKit/WebEditingDelegate.h>
#import <WebKit/WebFrameView.h>
-#import <WebKit/WebHTMLRepresentationInternal.h>
#import <WebKit/WebHistory.h>
#import <WebKit/WebHistoryItemPrivate.h>
#import <WebKit/WebInspector.h>
@@ -76,15 +80,21 @@
#import <WebKit/WebTypesInternal.h>
#import <WebKit/WebViewPrivate.h>
#import <getopt.h>
-#import <mach-o/getsect.h>
#import <objc/objc-runtime.h>
#import <wtf/Assertions.h>
#import <wtf/RetainPtr.h>
#import <wtf/Threading.h>
#import <wtf/OwnPtr.h>
+extern "C" {
+#import <mach-o/getsect.h>
+}
+
using namespace std;
+@interface DumpRenderTreeApplication : NSApplication
+@end
+
@interface DumpRenderTreeEvent : NSEvent
@end
@@ -104,7 +114,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
@@ -134,9 +144,6 @@ static RetainPtr<CFStringRef> persistentUserStyleSheetLocation;
static WebHistoryItem *prevTestBFItem = nil; // current b/f item at the end of the previous test
-const unsigned maxViewHeight = 600;
-const unsigned maxViewWidth = 800;
-
#if __OBJC2__
static void swizzleAllMethods(Class imposter, Class original)
{
@@ -249,6 +256,7 @@ static void activateFonts()
static const char* fontFileNames[] = {
"AHEM____.TTF",
+ "ColorBits.ttf",
"WebKitWeightWatcher100.ttf",
"WebKitWeightWatcher200.ttf",
"WebKitWeightWatcher300.ttf",
@@ -279,13 +287,15 @@ static void activateFonts()
WebView *createWebViewAndOffscreenWindow()
{
- NSRect rect = NSMakeRect(0, 0, maxViewWidth, maxViewHeight);
+ NSRect rect = NSMakeRect(0, 0, LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight);
WebView *webView = [[WebView alloc] initWithFrame:rect frameName:nil groupName:@"org.webkit.DumpRenderTree"];
[webView setUIDelegate:uiDelegate];
[webView setFrameLoadDelegate:frameLoadDelegate];
[webView setEditingDelegate:editingDelegate];
[webView setResourceLoadDelegate:resourceLoadDelegate];
+ [webView _setGeolocationProvider:[MockGeolocationProvider shared]];
+ [webView _setDeviceOrientationProvider:[WebDeviceOrientationProviderMock shared]];
// Register the same schemes that Safari does
[WebView registerURLSchemeAsLocal:@"feed"];
@@ -358,7 +368,14 @@ void testStringByEvaluatingJavaScriptFromString()
static NSString *libraryPathForDumpRenderTree()
{
- return [@"~/Library/Application Support/DumpRenderTree" stringByExpandingTildeInPath];
+ //FIXME: This may not be sufficient to prevent interactions/crashes
+ //when running more than one copy of DumpRenderTree.
+ //See https://bugs.webkit.org/show_bug.cgi?id=10906
+ char* dumpRenderTreeTemp = getenv("DUMPRENDERTREE_TEMP");
+ if (dumpRenderTreeTemp)
+ return [[NSFileManager defaultManager] stringWithFileSystemRepresentation:dumpRenderTreeTemp length:strlen(dumpRenderTreeTemp)];
+ else
+ return [@"~/Library/Application Support/DumpRenderTree" stringByExpandingTildeInPath];
}
// Called before each test.
@@ -376,6 +393,7 @@ static void resetDefaultsToConsistentValues()
[defaults setObject:@"0.500000 0.500000 0.500000" forKey:@"AppleOtherHighlightColor"];
[defaults setObject:[NSArray arrayWithObject:@"en"] forKey:@"AppleLanguages"];
[defaults setBool:YES forKey:WebKitEnableFullDocumentTeardownPreferenceKey];
+ [defaults setBool:YES forKey:WebKitFullScreenEnabledPreferenceKey];
// Scrollbars are drawn either using AppKit (which uses NSUserDefaults) or using HIToolbox (which uses CFPreferences / kCFPreferencesAnyApplication / kCFPreferencesCurrentUser / kCFPreferencesAnyHost)
[defaults setObject:@"DoubleMax" forKey:@"AppleScrollBarVariant"];
@@ -386,6 +404,10 @@ static void resetDefaultsToConsistentValues()
ThemeScrollBarArrowStyle style;
GetThemeScrollBarArrowStyle(&style); // Force HIToolbox to read from CFPreferences
#endif
+
+ [defaults setBool:NO forKey:@"AppleScrollAnimationEnabled"];
+ [defaults setBool:NO forKey:@"NSOverlayScrollersEnabled"];
+
if (initialValue)
CFPreferencesSetValue(CFSTR("AppleScrollBarVariant"), initialValue.get(), kCFPreferencesAnyApplication, kCFPreferencesCurrentUser, kCFPreferencesAnyHost);
@@ -396,6 +418,7 @@ static void resetDefaultsToConsistentValues()
WebPreferences *preferences = [WebPreferences standardPreferences];
[preferences setAllowUniversalAccessFromFileURLs:YES];
+ [preferences setAllowFileAccessFromFileURLs:YES];
[preferences setStandardFontFamily:@"Times"];
[preferences setFixedFontFamily:@"Courier"];
[preferences setSerifFontFamily:@"Times"];
@@ -404,7 +427,7 @@ static void resetDefaultsToConsistentValues()
[preferences setFantasyFontFamily:@"Papyrus"];
[preferences setDefaultFontSize:16];
[preferences setDefaultFixedFontSize:13];
- [preferences setMinimumFontSize:1];
+ [preferences setMinimumFontSize:0];
[preferences setJavaEnabled:NO];
[preferences setJavaScriptEnabled:YES];
[preferences setEditableLinkBehavior:WebKitEditableLinkOnlyLiveWithShiftKey];
@@ -415,14 +438,17 @@ static void resetDefaultsToConsistentValues()
[preferences setXSSAuditorEnabled:NO];
[preferences setExperimentalNotificationsEnabled:NO];
[preferences setPluginAllowedRunTime:1];
+ [preferences setPlugInsEnabled:YES];
[preferences setPrivateBrowsingEnabled:NO];
[preferences setAuthorAndUserStylesEnabled:YES];
[preferences setJavaScriptCanOpenWindowsAutomatically:YES];
+ [preferences setJavaScriptCanAccessClipboard:YES];
[preferences setOfflineWebApplicationCacheEnabled:YES];
[preferences setDeveloperExtrasEnabled:NO];
[preferences setLoadsImagesAutomatically:YES];
- [preferences setFrameSetFlatteningEnabled:NO];
+ [preferences setFrameFlatteningEnabled:NO];
+ [preferences setEditingBehavior:WebKitEditingMacBehavior];
if (persistentUserStyleSheetLocation) {
[preferences setUserStyleSheetLocation:[NSURL URLWithString:(NSString *)(persistentUserStyleSheetLocation.get())]];
[preferences setUserStyleSheetEnabled:YES];
@@ -432,20 +458,9 @@ static void resetDefaultsToConsistentValues()
// The back/forward cache is causing problems due to layouts during transition from one page to another.
// So, turn it off for now, but we might want to turn it back on some day.
[preferences setUsesPageCache:NO];
-
-#if defined(BUILDING_ON_LEOPARD)
- // Disable hardware composititing to avoid timeouts and crashes from buggy CoreVideo teardown code.
- // https://bugs.webkit.org/show_bug.cgi?id=28845 and rdar://problem/7228836
- SInt32 qtVersion;
- OSErr err = Gestalt(gestaltQuickTimeVersion, &qtVersion);
- assert(err == noErr);
- // Bug 7228836 exists in at least 7.6.3 through 7.6.4, hopefully it will be fixed in 7.6.5.
- // FIXME: Once we know the exact versions of QuickTime affected, we can update this check.
- if (qtVersion <= 0x07648000) // 7.6.4, final release (0x8). See http://developer.apple.com/mac/library/techn
- [preferences setAcceleratedCompositingEnabled:NO];
- else
-#endif
- [preferences setAcceleratedCompositingEnabled:YES];
+ [preferences setAcceleratedCompositingEnabled:YES];
+ [preferences setWebGLEnabled:NO];
+ [preferences setUsePreHTML5ParserQuirks:NO];
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain];
@@ -688,7 +703,7 @@ void dumpRenderTree(int argc, const char *argv[])
int main(int argc, const char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- [NSApplication sharedApplication]; // Force AppKit to init itself
+ [DumpRenderTreeApplication sharedApplication]; // Force AppKit to init itself
dumpRenderTree(argc, argv);
[WebCoreStatistics garbageCollectJavaScriptObjects];
[WebCoreStatistics emptyCache]; // Otherwise SVGImages trigger false positives for Frame/Node counts
@@ -810,176 +825,6 @@ static NSData *dumpFrameAsPDF(WebFrame *frame)
return pdfData;
}
-static void convertMIMEType(NSMutableString *mimeType)
-{
-#ifdef BUILDING_ON_LEOPARD
- // Workaround for <rdar://problem/5539824> on Leopard
- if ([mimeType isEqualToString:@"text/xml"])
- [mimeType setString:@"application/xml"];
-#endif
- // Workaround for <rdar://problem/6234318> with Dashcode 2.0
- if ([mimeType isEqualToString:@"application/x-javascript"])
- [mimeType setString:@"text/javascript"];
-}
-
-static void convertWebResourceDataToString(NSMutableDictionary *resource)
-{
- NSMutableString *mimeType = [resource objectForKey:@"WebResourceMIMEType"];
- convertMIMEType(mimeType);
-
- if ([mimeType hasPrefix:@"text/"] || [[WebHTMLRepresentation supportedNonImageMIMETypes] containsObject:mimeType]) {
- NSString *textEncodingName = [resource objectForKey:@"WebResourceTextEncodingName"];
- NSStringEncoding stringEncoding;
- if ([textEncodingName length] > 0)
- stringEncoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((CFStringRef)textEncodingName));
- else
- stringEncoding = NSUTF8StringEncoding;
-
- NSData *data = [resource objectForKey:@"WebResourceData"];
- NSString *dataAsString = [[NSString alloc] initWithData:data encoding:stringEncoding];
- if (dataAsString)
- [resource setObject:dataAsString forKey:@"WebResourceData"];
- [dataAsString release];
- }
-}
-
-static void normalizeHTTPResponseHeaderFields(NSMutableDictionary *fields)
-{
- // Normalize headers
- if ([fields objectForKey:@"Date"])
- [fields setObject:@"Sun, 16 Nov 2008 17:00:00 GMT" forKey:@"Date"];
- if ([fields objectForKey:@"Last-Modified"])
- [fields setObject:@"Sun, 16 Nov 2008 16:55:00 GMT" forKey:@"Last-Modified"];
- if ([fields objectForKey:@"Etag"])
- [fields setObject:@"\"301925-21-45c7d72d3e780\"" forKey:@"Etag"];
- if ([fields objectForKey:@"Server"])
- [fields setObject:@"Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l PHP/5.2.6" forKey:@"Server"];
-
- // Remove headers
- if ([fields objectForKey:@"Connection"])
- [fields removeObjectForKey:@"Connection"];
- if ([fields objectForKey:@"Keep-Alive"])
- [fields removeObjectForKey:@"Keep-Alive"];
-}
-
-static void normalizeWebResourceURL(NSMutableString *webResourceURL)
-{
- static int fileUrlLength = [(NSString *)@"file://" length];
- NSRange layoutTestsWebArchivePathRange = [webResourceURL rangeOfString:@"/LayoutTests/" options:NSBackwardsSearch];
- if (layoutTestsWebArchivePathRange.location == NSNotFound)
- return;
- NSRange currentWorkingDirectoryRange = NSMakeRange(fileUrlLength, layoutTestsWebArchivePathRange.location - fileUrlLength);
- [webResourceURL replaceCharactersInRange:currentWorkingDirectoryRange withString:@""];
-}
-
-static void convertWebResourceResponseToDictionary(NSMutableDictionary *propertyList)
-{
- NSURLResponse *response = nil;
- NSData *responseData = [propertyList objectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
- if ([responseData isKindOfClass:[NSData class]]) {
- // Decode NSURLResponse
- NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:responseData];
- response = [unarchiver decodeObjectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
- [unarchiver finishDecoding];
- [unarchiver release];
- }
-
- NSMutableDictionary *responseDictionary = [[NSMutableDictionary alloc] init];
-
- NSMutableString *urlString = [[[response URL] description] mutableCopy];
- normalizeWebResourceURL(urlString);
- [responseDictionary setObject:urlString forKey:@"URL"];
- [urlString release];
-
- NSMutableString *mimeTypeString = [[response MIMEType] mutableCopy];
- convertMIMEType(mimeTypeString);
- [responseDictionary setObject:mimeTypeString forKey:@"MIMEType"];
- [mimeTypeString release];
-
- NSString *textEncodingName = [response textEncodingName];
- if (textEncodingName)
- [responseDictionary setObject:textEncodingName forKey:@"textEncodingName"];
- [responseDictionary setObject:[NSNumber numberWithLongLong:[response expectedContentLength]] forKey:@"expectedContentLength"];
-
- if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
- NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
-
- NSMutableDictionary *allHeaderFields = [[httpResponse allHeaderFields] mutableCopy];
- normalizeHTTPResponseHeaderFields(allHeaderFields);
- [responseDictionary setObject:allHeaderFields forKey:@"allHeaderFields"];
- [allHeaderFields release];
-
- [responseDictionary setObject:[NSNumber numberWithInt:[httpResponse statusCode]] forKey:@"statusCode"];
- }
-
- [propertyList setObject:responseDictionary forKey:@"WebResourceResponse"];
- [responseDictionary release];
-}
-
-static NSInteger compareResourceURLs(id resource1, id resource2, void *context)
-{
- NSString *url1 = [resource1 objectForKey:@"WebResourceURL"];
- NSString *url2 = [resource2 objectForKey:@"WebResourceURL"];
-
- return [url1 compare:url2];
-}
-
-static NSString *serializeWebArchiveToXML(WebArchive *webArchive)
-{
- NSString *errorString;
- NSMutableDictionary *propertyList = [NSPropertyListSerialization propertyListFromData:[webArchive data]
- mutabilityOption:NSPropertyListMutableContainersAndLeaves
- format:NULL
- errorDescription:&errorString];
- if (!propertyList)
- return errorString;
-
- NSMutableArray *resources = [NSMutableArray arrayWithCapacity:1];
- [resources addObject:propertyList];
-
- while ([resources count]) {
- NSMutableDictionary *resourcePropertyList = [resources objectAtIndex:0];
- [resources removeObjectAtIndex:0];
-
- NSMutableDictionary *mainResource = [resourcePropertyList objectForKey:@"WebMainResource"];
- normalizeWebResourceURL([mainResource objectForKey:@"WebResourceURL"]);
- convertWebResourceDataToString(mainResource);
-
- // Add subframeArchives to list for processing
- NSMutableArray *subframeArchives = [resourcePropertyList objectForKey:@"WebSubframeArchives"]; // WebSubframeArchivesKey in WebArchive.m
- if (subframeArchives)
- [resources addObjectsFromArray:subframeArchives];
-
- NSMutableArray *subresources = [resourcePropertyList objectForKey:@"WebSubresources"]; // WebSubresourcesKey in WebArchive.m
- NSEnumerator *enumerator = [subresources objectEnumerator];
- NSMutableDictionary *subresourcePropertyList;
- while ((subresourcePropertyList = [enumerator nextObject])) {
- normalizeWebResourceURL([subresourcePropertyList objectForKey:@"WebResourceURL"]);
- convertWebResourceResponseToDictionary(subresourcePropertyList);
- convertWebResourceDataToString(subresourcePropertyList);
- }
-
- // Sort the subresources so they're always in a predictable order for the dump
- if (NSArray *sortedSubresources = [subresources sortedArrayUsingFunction:compareResourceURLs context:nil])
- [resourcePropertyList setObject:sortedSubresources forKey:@"WebSubresources"];
- }
-
- NSData *xmlData = [NSPropertyListSerialization dataFromPropertyList:propertyList
- format:NSPropertyListXMLFormat_v1_0
- errorDescription:&errorString];
- if (!xmlData)
- return errorString;
-
- NSMutableString *string = [[[NSMutableString alloc] initWithData:xmlData encoding:NSUTF8StringEncoding] autorelease];
-
- // Replace "Apple Computer" with "Apple" in the DTD declaration.
- NSRange range = [string rangeOfString:@"-//Apple Computer//"];
- if (range.location != NSNotFound)
- [string replaceCharactersInRange:range withString:@"-//Apple//"];
-
- return string;
-}
-
static void dumpBackForwardListForWebView(WebView *view)
{
printf("\n============== Back Forward List ==============\n");
@@ -1020,7 +865,7 @@ static void sizeWebViewForCurrentTest()
if (isSVGW3CTest)
[[mainFrame webView] setFrameSize:NSMakeSize(480, 360)];
else
- [[mainFrame webView] setFrameSize:NSMakeSize(maxViewWidth, maxViewHeight)];
+ [[mainFrame webView] setFrameSize:NSMakeSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight)];
}
static const char *methodNameStringForFailedTest()
@@ -1077,15 +922,15 @@ void dump()
resultMimeType = @"application/pdf";
} else if (gLayoutTestController->dumpDOMAsWebArchive()) {
WebArchive *webArchive = [[mainFrame DOMDocument] webArchive];
- resultString = serializeWebArchiveToXML(webArchive);
+ resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data]));
resultMimeType = @"application/x-webarchive";
} else if (gLayoutTestController->dumpSourceAsWebArchive()) {
WebArchive *webArchive = [[mainFrame dataSource] webArchive];
- resultString = serializeWebArchiveToXML(webArchive);
+ resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data]));
resultMimeType = @"application/x-webarchive";
} else {
sizeWebViewForCurrentTest();
- resultString = [mainFrame renderTreeAsExternalRepresentation];
+ resultString = [mainFrame renderTreeAsExternalRepresentationForPrinting:gLayoutTestController->isPrinting()];
}
if (resultString && !resultData)
@@ -1115,7 +960,8 @@ void dump()
}
}
- if (dumpPixels && !dumpAsText)
+ if (dumpPixels && gLayoutTestController->generatePixelResults())
+ // FIXME: when isPrinting is set, dump the image with page separators.
dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash());
puts("#EOF"); // terminate the (possibly empty) pixels block
@@ -1141,9 +987,15 @@ static bool shouldOpenWebInspector(const char* pathOrURL)
return strstr(pathOrURL, "inspector/");
}
+static bool shouldEnableDeveloperExtras(const char* pathOrURL)
+{
+ return shouldOpenWebInspector(pathOrURL) || strstr(pathOrURL, "inspector-enabled/");
+}
+
static void resetWebViewToConsistentStateBeforeTesting()
{
WebView *webView = [mainFrame webView];
+ [webView setEditable:NO];
[(EditingDelegate *)[webView editingDelegate] setAcceptsEditing:YES];
[webView makeTextStandardSize:nil];
[webView resetPageZoom:nil];
@@ -1164,7 +1016,12 @@ static void resetWebViewToConsistentStateBeforeTesting()
[[[mainFrame webView] inspector] setJavaScriptProfilingEnabled:NO];
[WebView _setUsesTestModeFocusRingColor:YES];
- [WebView _resetOriginAccessWhiteLists];
+ [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)
@@ -1201,7 +1058,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);
@@ -1219,8 +1076,11 @@ static void runTest(const string& testPathOrURL)
else
[[mainFrame webView] setHistoryDelegate:nil];
- if (shouldOpenWebInspector(pathOrURL.c_str()))
- gLayoutTestController->showWebInspector();
+ if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+ gLayoutTestController->setDeveloperExtrasEnabled(true);
+ if (shouldOpenWebInspector(pathOrURL.c_str()))
+ gLayoutTestController->showWebInspector();
+ }
if ([WebHistory optionalSharedHistory])
[WebHistory setOptionalSharedHistory:nil];
@@ -1240,9 +1100,10 @@ static void runTest(const string& testPathOrURL)
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[mainFrame loadRequest:[NSURLRequest requestWithURL:url]];
[pool release];
+
while (!done) {
pool = [[NSAutoreleasePool alloc] init];
- [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
[pool release];
}
@@ -1270,8 +1131,11 @@ static void runTest(const string& testPathOrURL)
}
}
- if (shouldOpenWebInspector(pathOrURL.c_str()))
+ // If developer extras enabled Web Inspector may have been open by the test.
+ if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
gLayoutTestController->closeWebInspector();
+ gLayoutTestController->setDeveloperExtrasEnabled(false);
+ }
resetWebViewToConsistentStateBeforeTesting();
@@ -1284,8 +1148,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];
@@ -1309,3 +1172,13 @@ void displayWebView()
}
@end
+
+@implementation DumpRenderTreeApplication
+
+- (BOOL)isRunning
+{
+ // <rdar://problem/7686123> Java plug-in freezes unless NSApplication is running
+ return YES;
+}
+
+@end
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm
index 02280a1..8eded66 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm
@@ -105,5 +105,42 @@
return nil;
}
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+- (NSDraggingFormation)draggingFormation
+{
+ return NSDraggingFormationDefault;
+}
+
+- (void)setDraggingFormation:(NSDraggingFormation)formation
+{
+ // Ignored.
+}
+
+- (BOOL)animatesToDestination
+{
+ return NO;
+}
+
+- (void)setAnimatesToDestination:(BOOL)flag
+{
+ // Ignored.
+}
+
+- (NSInteger)numberOfValidItemsForDrop
+{
+ return 1;
+}
+
+- (void)setNumberOfValidItemsForDrop:(NSInteger)number
+{
+ // Ignored.
+}
+
+- (void)enumerateDraggingItemsWithOptions:(NSEnumerationOptions)enumOpts forView:(NSView *)view classes:(NSArray *)classArray searchOptions:(NSDictionary *)searchOptions usingBlock:(void (^)(NSDraggingItem *draggingItem, NSInteger idx, BOOL *stop))block
+{
+ // Ignored.
+}
+#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+
@end
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h
index 5c93ee9..36c5eac 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeMac.h
@@ -29,25 +29,23 @@
#ifndef DumpRenderTreeMac_h
#define DumpRenderTreeMac_h
-// FIXME: we should add a config.h file for DumpRenderTree.
-#define WTF_PLATFORM_CF 1
-
-#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
-#define BUILDING_ON_TIGER 1
-#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
-#define BUILDING_ON_LEOPARD 1
-#elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
-#define BUILDING_ON_SNOW_LEOPARD 1
-#endif
+#include <CoreFoundation/CoreFoundation.h>
+#ifdef __OBJC__
@class DumpRenderTreeDraggingInfo;
@class NavigationController;
@class PolicyDelegate;
@class WebFrame;
@class WebScriptWorld;
@class WebView;
-
-typedef const struct __CFString* CFStringRef;
+#else
+class DumpRenderTreeDraggingInfo;
+class NavigationController;
+class PolicyDelegate;
+class WebFrame;
+class WebScriptWorld;
+class WebView;
+#endif
extern CFMutableArrayRef openWindowsRef;
extern CFMutableSetRef disallowedURLs;
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 feaeddc..9031c63 100644
--- a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
+++ b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
@@ -134,7 +134,9 @@ BOOL replayingSavedEvents;
|| aSelector == @selector(textZoomIn)
|| aSelector == @selector(textZoomOut)
|| aSelector == @selector(zoomPageIn)
- || aSelector == @selector(zoomPageOut))
+ || aSelector == @selector(zoomPageOut)
+ || aSelector == @selector(mouseScrollByX:andY:)
+ || aSelector == @selector(continuousMouseScrollByX:andY:))
return NO;
return YES;
}
@@ -150,6 +152,8 @@ BOOL replayingSavedEvents;
{
if (aSelector == @selector(beginDragWithFiles:))
return @"beginDragWithFiles";
+ if (aSelector == @selector(contextClick))
+ return @"contextClick";
if (aSelector == @selector(enableDOMUIEventLogging:))
return @"enableDOMUIEventLogging";
if (aSelector == @selector(fireKeyboardEventsToElement:))
@@ -166,6 +170,10 @@ BOOL replayingSavedEvents;
return @"mouseMoveTo";
if (aSelector == @selector(setDragMode:))
return @"setDragMode";
+ if (aSelector == @selector(mouseScrollByX:andY:))
+ return @"mouseScrollBy";
+ if (aSelector == @selector(continuousMouseScrollByX:andY:))
+ return @"continuousMouseScrollBy";
return nil;
}
@@ -441,19 +449,52 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
NSView *subView = [[mainFrame webView] hitTest:[event locationInWindow]];
if (subView) {
if (leftMouseButtonDown) {
- [subView mouseDragged:event];
if (draggingInfo) {
// Per NSDragging.h: draggingSources may not implement draggedImage:movedTo:
if ([[draggingInfo draggingSource] respondsToSelector:@selector(draggedImage:movedTo:)])
[[draggingInfo draggingSource] draggedImage:[draggingInfo draggedImage] movedTo:lastMousePosition];
[[mainFrame webView] draggingUpdated:draggingInfo];
- }
+ } else
+ [subView mouseDragged:event];
} else
[subView mouseMoved:event];
}
}
-- (void)contextClick
+- (void)mouseScrollByX:(int)x andY:(int)y continuously:(BOOL)c
+{
+ // CGEventCreateScrollWheelEvent() was introduced in 10.5
+#if !defined(BUILDING_ON_TIGER)
+ CGScrollEventUnit unit = c?kCGScrollEventUnitPixel:kCGScrollEventUnitLine;
+ CGEventRef cgScrollEvent = CGEventCreateScrollWheelEvent(NULL, unit, 2, y, x);
+
+ // CGEvent locations are in global display coordinates.
+ CGPoint lastGlobalMousePosition = {
+ lastMousePosition.x,
+ [[NSScreen mainScreen] frame].size.height - lastMousePosition.y
+ };
+ CGEventSetLocation(cgScrollEvent, lastGlobalMousePosition);
+
+ NSEvent *scrollEvent = [NSEvent eventWithCGEvent:cgScrollEvent];
+ CFRelease(cgScrollEvent);
+
+ NSView *subView = [[mainFrame webView] hitTest:[scrollEvent locationInWindow]];
+ if (subView)
+ [subView scrollWheel:scrollEvent];
+#endif
+}
+
+- (void)continuousMouseScrollByX:(int)x andY:(int)y
+{
+ [self mouseScrollByX:x andY:y continuously:YES];
+}
+
+- (void)mouseScrollByX:(int)x andY:(int)y
+{
+ [self mouseScrollByX:x andY:y continuously:NO];
+}
+
+- (NSArray *)contextClick
{
[[[mainFrame frameView] documentView] layout];
[self updateClickCountForButton:RightMouseButton];
@@ -469,8 +510,24 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
pressure:0.0];
NSView *subView = [[mainFrame webView] hitTest:[event locationInWindow]];
- if (subView)
- [subView menuForEvent:event];
+ NSMutableArray *menuItemStrings = [NSMutableArray array];
+
+ if (subView) {
+ NSMenu* menu = [subView menuForEvent:event];
+
+ for (int i = 0; i < [menu numberOfItems]; ++i) {
+ NSMenuItem* menuItem = [menu itemAtIndex:i];
+ if (!strcmp("Inspect Element", [[menuItem title] UTF8String]))
+ continue;
+
+ if ([menuItem isSeparatorItem])
+ [menuItemStrings addObject:@"<separator>"];
+ else
+ [menuItemStrings addObject:[menuItem title]];
+ }
+ }
+
+ return menuItemStrings;
}
- (void)scheduleAsynchronousClick
@@ -507,33 +564,51 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
- (void)keyDown:(NSString *)character withModifiers:(WebScriptObject *)modifiers withLocation:(unsigned long)keyLocation
{
NSString *eventCharacter = character;
+ unsigned short keyCode = 0;
if ([character isEqualToString:@"leftArrow"]) {
const unichar ch = NSLeftArrowFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x7B;
} else if ([character isEqualToString:@"rightArrow"]) {
const unichar ch = NSRightArrowFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x7C;
} else if ([character isEqualToString:@"upArrow"]) {
const unichar ch = NSUpArrowFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x7E;
} else if ([character isEqualToString:@"downArrow"]) {
const unichar ch = NSDownArrowFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x7D;
} else if ([character isEqualToString:@"pageUp"]) {
const unichar ch = NSPageUpFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x74;
} else if ([character isEqualToString:@"pageDown"]) {
const unichar ch = NSPageDownFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x79;
} else if ([character isEqualToString:@"home"]) {
const unichar ch = NSHomeFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x73;
} else if ([character isEqualToString:@"end"]) {
const unichar ch = NSEndFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x77;
+ } else if ([character isEqualToString:@"insert"]) {
+ const unichar ch = NSInsertFunctionKey;
+ eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x72;
} else if ([character isEqualToString:@"delete"]) {
- const unichar ch = 0x7f;
+ const unichar ch = NSDeleteFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x75;
+ } else if ([character isEqualToString:@"printScreen"]) {
+ const unichar ch = NSPrintScreenFunctionKey;
+ eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ keyCode = 0x0; // There is no known virtual key code for PrintScreen.
}
// Compare the input string with the function-key names defined by the DOM spec (i.e. "F1",...,"F24").
@@ -542,9 +617,59 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
if ([character isEqualToString:[NSString stringWithFormat:@"F%u", i]]) {
const unichar ch = NSF1FunctionKey + (i - 1);
eventCharacter = [NSString stringWithCharacters:&ch length:1];
+ switch (i) {
+ case 1: keyCode = 0x7A; break;
+ case 2: keyCode = 0x78; break;
+ case 3: keyCode = 0x63; break;
+ case 4: keyCode = 0x76; break;
+ case 5: keyCode = 0x60; break;
+ case 6: keyCode = 0x61; break;
+ case 7: keyCode = 0x62; break;
+ case 8: keyCode = 0x64; break;
+ case 9: keyCode = 0x65; break;
+ case 10: keyCode = 0x6D; break;
+ case 11: keyCode = 0x67; break;
+ case 12: keyCode = 0x6F; break;
+ case 13: keyCode = 0x69; break;
+ case 14: keyCode = 0x6B; break;
+ case 15: keyCode = 0x71; break;
+ case 16: keyCode = 0x6A; break;
+ case 17: keyCode = 0x40; break;
+ case 18: keyCode = 0x4F; break;
+ case 19: keyCode = 0x50; break;
+ case 20: keyCode = 0x5A; break;
+ }
}
}
+ // FIXME: No keyCode is set for most keys.
+ if ([character isEqualToString:@"\t"])
+ keyCode = 0x30;
+ else if ([character isEqualToString:@" "])
+ keyCode = 0x31;
+ else if ([character isEqualToString:@"\r"])
+ keyCode = 0x24;
+ else if ([character isEqualToString:@"\n"])
+ keyCode = 0x4C;
+ else if ([character isEqualToString:@"\x8"])
+ keyCode = 0x33;
+ else if ([character isEqualToString:@"7"])
+ keyCode = 0x1A;
+ else if ([character isEqualToString:@"5"])
+ keyCode = 0x17;
+ else if ([character isEqualToString:@"9"])
+ keyCode = 0x19;
+ else if ([character isEqualToString:@"0"])
+ keyCode = 0x1D;
+ else if ([character isEqualToString:@"a"])
+ keyCode = 0x00;
+ else if ([character isEqualToString:@"b"])
+ keyCode = 0x0B;
+ else if ([character isEqualToString:@"d"])
+ keyCode = 0x02;
+ else if ([character isEqualToString:@"e"])
+ keyCode = 0x0E;
+
NSString *charactersIgnoringModifiers = eventCharacter;
int modifierFlags = 0;
@@ -570,7 +695,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
characters:eventCharacter
charactersIgnoringModifiers:charactersIgnoringModifiers
isARepeat:NO
- keyCode:0];
+ keyCode:keyCode];
[[[[mainFrame webView] window] firstResponder] keyDown:event];
@@ -583,7 +708,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
characters:eventCharacter
charactersIgnoringModifiers:charactersIgnoringModifiers
isARepeat:NO
- keyCode:0];
+ keyCode:keyCode];
[[[[mainFrame webView] window] firstResponder] keyUp:event];
}
diff --git a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
index 963eae7..a36982c 100644
--- a/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
+++ b/WebKitTools/DumpRenderTree/mac/FrameLoadDelegate.mm
@@ -50,6 +50,7 @@
#import <WebKit/WebNSURLExtras.h>
#import <WebKit/WebScriptWorld.h>
#import <WebKit/WebSecurityOriginPrivate.h>
+#import <WebKit/WebViewPrivate.h>
#import <wtf/Assertions.h>
@interface NSURL (DRTExtras)
@@ -89,6 +90,12 @@
return @"frame (anonymous)";
}
}
+
+- (NSString *)_drt_printFrameUserGestureStatus
+{
+ BOOL isUserGesture = [[self webView] _isProcessingUserGesture];
+ return [NSString stringWithFormat:@"Frame with user gesture \"%@\"", isUserGesture ? @"true" : @"false"];
+}
@end
@implementation FrameLoadDelegate
@@ -146,7 +153,12 @@
NSString *string = [NSString stringWithFormat:@"%@ - didStartProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
-
+
+ if (!done && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) {
+ NSString *string = [NSString stringWithFormat:@"%@ - in didStartProvisionalLoadForFrame", [frame _drt_printFrameUserGestureStatus]];
+ printf ("%s\n", [string UTF8String]);
+ }
+
ASSERT([frame provisionalDataSource]);
// Make sure we only set this once per test. If it gets cleared, and then set again, we might
// end up doing two dumps for one test.
@@ -166,7 +178,7 @@
NSString *string = [NSString stringWithFormat:@"%@ - didCommitLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
-
+
ASSERT(![frame provisionalDataSource]);
ASSERT([frame dataSource]);
@@ -190,7 +202,7 @@
ASSERT_NOT_REACHED();
return;
}
-
+
ASSERT([frame provisionalDataSource]);
[self webView:sender locationChangeDone:error forDataSource:[frame provisionalDataSource]];
}
@@ -204,7 +216,7 @@
NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoadForFrame", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
-
+
// FIXME: This call to displayIfNeeded can be removed when <rdar://problem/5092361> is fixed.
// After that is fixed, we will reenable painting after WebCore is done loading the document,
// and this call will no longer be needed.
@@ -220,7 +232,7 @@
NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadWithError", [frame _drt_descriptionSuitableForTestResult]];
printf ("%s\n", [string UTF8String]);
}
-
+
ASSERT(![frame provisionalDataSource]);
ASSERT([frame dataSource]);
@@ -233,7 +245,7 @@
NSString *string = [NSString stringWithFormat:@"?? - windowScriptObjectAvailable"];
printf ("%s\n", [string UTF8String]);
}
-
+
ASSERT_NOT_REACHED();
}
@@ -314,7 +326,7 @@
NSString *string = [NSString stringWithFormat:@"%@ - didReceiveTitle: %@", [frame _drt_descriptionSuitableForTestResult], title];
printf ("%s\n", [string UTF8String]);
}
-
+
if (gLayoutTestController->dumpTitleChanges())
printf("TITLE CHANGED: %s\n", [title UTF8String]);
}
diff --git a/WebKitTools/DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h b/WebKitTools/DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h
deleted file mode 100644
index b3d421d..0000000
--- a/WebKitTools/DumpRenderTree/mac/InternalHeaders/WebKit/WebHTMLRepresentationInternal.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "../../../../WebKit/mac/WebView/WebHTMLRepresentationInternal.h"
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index b726e72..b19d6b5 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -31,7 +31,9 @@
#import "LayoutTestController.h"
#import "EditingDelegate.h"
+#import "MockGeolocationProvider.h"
#import "PolicyDelegate.h"
+#import "UIDelegate.h"
#import "WorkQueue.h"
#import "WorkQueueItem.h"
#import <Foundation/Foundation.h>
@@ -43,11 +45,14 @@
#import <WebKit/WebApplicationCache.h>
#import <WebKit/WebBackForwardList.h>
#import <WebKit/WebCoreStatistics.h>
+#import <WebKit/WebDOMOperationsPrivate.h>
#import <WebKit/WebDataSource.h>
#import <WebKit/WebDatabaseManagerPrivate.h>
+#import <WebKit/WebDeviceOrientation.h>
+#import <WebKit/WebDeviceOrientationProviderMock.h>
#import <WebKit/WebFrame.h>
#import <WebKit/WebFrameViewPrivate.h>
-#import <WebKit/WebGeolocationMockPrivate.h>
+#import <WebKit/WebGeolocationPosition.h>
#import <WebKit/WebHTMLRepresentation.h>
#import <WebKit/WebHTMLViewPrivate.h>
#import <WebKit/WebHistory.h>
@@ -55,14 +60,17 @@
#import <WebKit/WebIconDatabasePrivate.h>
#import <WebKit/WebInspectorPrivate.h>
#import <WebKit/WebNSURLExtras.h>
+#import <WebKit/WebKitErrors.h>
#import <WebKit/WebPreferences.h>
#import <WebKit/WebPreferencesPrivate.h>
+#import <WebKit/WebQuotaManager.h>
#import <WebKit/WebScriptWorld.h>
#import <WebKit/WebSecurityOriginPrivate.h>
#import <WebKit/WebTypesInternal.h>
#import <WebKit/WebView.h>
#import <WebKit/WebViewPrivate.h>
#import <WebKit/WebWorkersPrivate.h>
+#import <wtf/CurrentTime.h>
#import <wtf/HashMap.h>
#import <wtf/RetainPtr.h>
@@ -115,6 +123,16 @@ void LayoutTestController::addDisallowedURL(JSStringRef url)
CFSetAddValue(disallowedURLs, [request URL]);
}
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+ return [[mainFrame webView] shouldClose];
+}
+
+void LayoutTestController::clearAllApplicationCaches()
+{
+ [WebApplicationCache deleteAllApplicationCaches];
+}
+
void LayoutTestController::clearAllDatabases()
{
[[WebDatabaseManager sharedWebDatabaseManager] deleteAllDatabases];
@@ -176,6 +194,32 @@ void LayoutTestController::keepWebHistory()
}
}
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+{
+ return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value];
+}
+
+JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ return [[mainFrame webView] _nodesFromRect:context forDocument:value x:x y:y top:top right:right bottom:bottom left:left ignoreClipping:ignoreClipping];
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+ JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame _layerTreeAsText]));
+ return string;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+{
+ DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject];
+ if (!element)
+ return JSRetainPtr<JSStringRef>();
+
+ JSRetainPtr<JSStringRef> markerText(Adopt, JSStringCreateWithCFString((CFStringRef)[element _markerTextForListItem]));
+ return markerText;
+}
+
int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWidthInPixels, float pageHeightInPixels)
{
RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, id));
@@ -188,6 +232,23 @@ 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::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
+{
+ JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageSizeAndMarginsInPixels:pageNumber:width:height:marginTop:marginRight:marginBottom:marginLeft]));
+ return propertyValue;
+}
+
int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)
{
return [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels];
@@ -247,6 +308,13 @@ void LayoutTestController::setAppCacheMaximumSize(unsigned long long size)
[WebApplicationCache setMaximumSize:size];
}
+void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+{
+ WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"http://127.0.0.1:8000"]];
+ [[origin applicationCacheQuotaManager] setQuota:quota];
+ [origin release];
+}
+
void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
{
[[[mainFrame webView] preferences] setAuthorAndUserStylesEnabled:flag];
@@ -264,7 +332,7 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permis
void LayoutTestController::setDatabaseQuota(unsigned long long quota)
{
WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"file:///"]];
- [origin setQuota:quota];
+ [[origin databaseQuotaManager] setQuota:quota];
[origin release];
}
@@ -274,16 +342,41 @@ void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidd
[WebView _setDomainRelaxationForbidden:forbidden forURLScheme:(NSString *)schemeCFString.get()];
}
+void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+ // DumpRenderTree configured the WebView to use WebDeviceOrientationProviderMock.
+ id<WebDeviceOrientationProvider> provider = [[mainFrame webView] _deviceOrientationProvider];
+ WebDeviceOrientationProviderMock* mockProvider = static_cast<WebDeviceOrientationProviderMock*>(provider);
+ WebDeviceOrientation* orientation = [[WebDeviceOrientation alloc] initWithCanProvideAlpha:canProvideAlpha alpha:alpha canProvideBeta:canProvideBeta beta:beta canProvideGamma:canProvideGamma gamma:gamma];
+ [mockProvider setOrientation:orientation];
+ [orientation release];
+}
+
void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
- [WebGeolocationMock setPosition:latitude:longitude:accuracy];
+ WebGeolocationPosition *position = [[WebGeolocationPosition alloc] initWithTimestamp:currentTime() latitude:latitude longitude:longitude accuracy:accuracy];
+ [[MockGeolocationProvider shared] setPosition:position];
+ [position release];
}
void LayoutTestController::setMockGeolocationError(int code, JSStringRef message)
{
RetainPtr<CFStringRef> messageCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, message));
NSString *messageNS = (NSString *)messageCF.get();
- [WebGeolocationMock setError:code:messageNS];
+ NSError *error = [NSError errorWithDomain:WebKitErrorDomain code:code userInfo:[NSDictionary dictionaryWithObject:messageNS forKey:NSLocalizedDescriptionKey]];
+ [[MockGeolocationProvider shared] setError:error];
+}
+
+void LayoutTestController::setGeolocationPermission(bool allow)
+{
+ setGeolocationPermissionCommon(allow);
+ [[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission];
+}
+
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
@@ -302,7 +395,7 @@ void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
void LayoutTestController::setJavaScriptProfilingEnabled(bool profilingEnabled)
{
- [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:profilingEnabled];
+ setDeveloperExtrasEnabled(profilingEnabled);
[[[mainFrame webView] inspector] setJavaScriptProfilingEnabled:profilingEnabled];
}
@@ -324,9 +417,14 @@ void LayoutTestController::setXSSAuditorEnabled(bool enabled)
[[[mainFrame webView] preferences] setXSSAuditorEnabled:enabled];
}
-void LayoutTestController::setFrameSetFlatteningEnabled(bool enabled)
+void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
{
- [[[mainFrame webView] preferences] setFrameSetFlatteningEnabled:enabled];
+ [[[mainFrame webView] preferences] setFrameFlatteningEnabled:enabled];
+}
+
+void LayoutTestController::setSpatialNavigationEnabled(bool enabled)
+{
+ [[[mainFrame webView] preferences] setSpatialNavigationEnabled:enabled];
}
void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
@@ -334,11 +432,26 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
[[[mainFrame webView] preferences] setAllowUniversalAccessFromFileURLs:enabled];
}
+void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+{
+ [[[mainFrame webView] preferences] setAllowFileAccessFromFileURLs:enabled];
+}
+
void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled)
{
[[[mainFrame webView] preferences] setJavaScriptCanOpenWindowsAutomatically:!popupBlockingEnabled];
}
+void LayoutTestController::setPluginsEnabled(bool pluginsEnabled)
+{
+ [[[mainFrame webView] preferences] setPlugInsEnabled:pluginsEnabled];
+}
+
+void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
+{
+ [[[mainFrame webView] preferences] setJavaScriptCanAccessClipboard:enabled];
+}
+
void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles)
{
[[mainFrame webView] setTabKeyCyclesThroughElements:cycles];
@@ -366,6 +479,11 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
[[WebPreferences standardPreferences] setUserStyleSheetLocation:url];
}
+void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+{
+ // FIXME: implement
+}
+
void LayoutTestController::disableImageLoading()
{
[[WebPreferences standardPreferences] setLoadsImagesAutomatically:NO];
@@ -419,7 +537,7 @@ void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
[[mainFrame webView] setSelectTrailingWhitespaceEnabled:flag];
}
-static const CFTimeInterval waitToDumpWatchdogInterval = 15.0;
+static const CFTimeInterval waitToDumpWatchdogInterval = 30.0;
static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info)
{
@@ -440,9 +558,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];
@@ -473,7 +591,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]) {
@@ -529,6 +647,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return [mainFrame _numberOfActiveAnimations];
}
+void LayoutTestController::suspendAnimations() const
+{
+ return [mainFrame _suspendAnimations];
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ return [mainFrame _resumeAnimations];
+}
+
void LayoutTestController::waitForPolicyDelegate()
{
setWaitToDump(true);
@@ -536,7 +664,18 @@ void LayoutTestController::waitForPolicyDelegate()
[[mainFrame webView] setPolicyDelegate:policyDelegate];
}
-void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+ RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin));
+ NSString *sourceOriginNS = (NSString *)sourceOriginCF.get();
+ RetainPtr<CFStringRef> protocolCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, destinationProtocol));
+ NSString *destinationProtocolNS = (NSString *)protocolCF.get();
+ RetainPtr<CFStringRef> hostCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, destinationHost));
+ NSString *destinationHostNS = (NSString *)hostCF.get();
+ [WebView _addOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains];
+}
+
+void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin));
NSString *sourceOriginNS = (NSString *)sourceOriginCF.get();
@@ -544,33 +683,41 @@ void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, J
NSString *destinationProtocolNS = (NSString *)protocolCF.get();
RetainPtr<CFStringRef> hostCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, destinationHost));
NSString *destinationHostNS = (NSString *)hostCF.get();
- [WebView _whiteListAccessFromOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains];
+ [WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains];
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart)
+void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
RetainPtr<CFStringRef> sourceCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, source));
NSString *sourceNS = (NSString *)sourceCF.get();
- [WebView _addUserScriptToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectionTime:(runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd)];
+ [WebView _addUserScriptToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectionTime:(runAtStart ? WebInjectAtDocumentStart : WebInjectAtDocumentEnd) injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)];
}
-void LayoutTestController::addUserStyleSheet(JSStringRef source)
+void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
{
RetainPtr<CFStringRef> sourceCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, source));
NSString *sourceNS = (NSString *)sourceCF.get();
- [WebView _addUserStyleSheetToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil];
+ [WebView _addUserStyleSheetToGroup:@"org.webkit.DumpRenderTree" world:[WebScriptWorld world] source:sourceNS url:nil whitelist:nil blacklist:nil injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)];
+}
+
+void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
+{
+ [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:enabled];
}
void LayoutTestController::showWebInspector()
{
- [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:true];
[[[mainFrame webView] inspector] show:nil];
}
void LayoutTestController::closeWebInspector()
{
[[[mainFrame webView] inspector] close:nil];
- [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:false];
}
void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
@@ -617,3 +764,192 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj
[mainFrame _stringByEvaluatingJavaScriptFromString:scriptNS withGlobalObject:globalObject inScriptWorld:world];
}
+
+@interface APITestDelegate : NSObject
+{
+ bool* m_condition;
+}
+@end
+
+@implementation APITestDelegate
+
+- (id)initWithCompletionCondition:(bool*)condition
+{
+ [super init];
+ ASSERT(condition);
+ m_condition = condition;
+ *m_condition = false;
+ return self;
+}
+
+- (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
+{
+ printf("API Test load failed\n");
+ *m_condition = true;
+}
+
+- (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame
+{
+ printf("API Test load failed provisional\n");
+ *m_condition = true;
+}
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+ printf("API Test load succeeded\n");
+ *m_condition = true;
+}
+
+@end
+
+void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ RetainPtr<CFStringRef> utf8DataCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, utf8Data));
+ RetainPtr<CFStringRef> baseURLCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, baseURL));
+
+ WebView *webView = [[WebView alloc] initWithFrame:NSZeroRect frameName:@"" groupName:@""];
+
+ bool done = false;
+ APITestDelegate *delegate = [[APITestDelegate alloc] initWithCompletionCondition:&done];
+ [webView setFrameLoadDelegate:delegate];
+
+ [[webView mainFrame] loadData:[(NSString *)utf8DataCF.get() dataUsingEncoding:NSUTF8StringEncoding] MIMEType:@"text/html" textEncodingName:@"utf-8" baseURL:[NSURL URLWithString:(NSString *)baseURLCF.get()]];
+
+ while (!done) {
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+ [pool release];
+ }
+
+ [webView close];
+ [webView release];
+ [delegate release];
+ [pool release];
+}
+
+void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+{
+ WebView *view = [mainFrame webView];
+ [view goToBackForwardItem:[[view backForwardList] currentItem]];
+}
+
+void LayoutTestController::setWebViewEditable(bool editable)
+{
+ WebView *view = [mainFrame webView];
+ [view setEditable:editable];
+}
+
+#ifndef BUILDING_ON_TIGER
+static NSString *SynchronousLoaderRunLoopMode = @"DumpRenderTreeSynchronousLoaderRunLoopMode";
+
+#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+@protocol NSURLConnectionDelegate <NSObject>
+@end
+#endif
+
+@interface SynchronousLoader : NSObject <NSURLConnectionDelegate>
+{
+ NSString *m_username;
+ NSString *m_password;
+ BOOL m_isDone;
+}
++ (void)makeRequest:(NSURLRequest *)request withUsername:(NSString *)username password:(NSString *)password;
+@end
+
+@implementation SynchronousLoader : NSObject
+- (void)dealloc
+{
+ [m_username release];
+ [m_password release];
+
+ [super dealloc];
+}
+
+- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection
+{
+ return YES;
+}
+
+- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
+{
+ if ([challenge previousFailureCount] == 0) {
+ NSURLCredential *credential = [[NSURLCredential alloc] initWithUser:m_username password:m_password persistence:NSURLCredentialPersistenceForSession];
+ [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
+ return;
+ }
+ [[challenge sender] cancelAuthenticationChallenge:challenge];
+}
+
+- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
+{
+ printf("SynchronousLoader failed: %s\n", [[error description] UTF8String]);
+ m_isDone = YES;
+}
+
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection
+{
+ m_isDone = YES;
+}
+
++ (void)makeRequest:(NSURLRequest *)request withUsername:(NSString *)username password:(NSString *)password
+{
+ ASSERT(![[request URL] user]);
+ ASSERT(![[request URL] password]);
+
+ SynchronousLoader *delegate = [[SynchronousLoader alloc] init];
+ delegate->m_username = [username copy];
+ delegate->m_password = [password copy];
+
+ NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:delegate startImmediately:NO];
+ [connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:SynchronousLoaderRunLoopMode];
+ [connection start];
+
+ while (!delegate->m_isDone)
+ [[NSRunLoop currentRunLoop] runMode:SynchronousLoaderRunLoopMode beforeDate:[NSDate distantFuture]];
+
+ [connection cancel];
+
+ [connection release];
+ [delegate release];
+}
+
+@end
+#endif
+
+void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password)
+{
+ // See <rdar://problem/7880699>.
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ RetainPtr<CFStringRef> urlStringCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url));
+ RetainPtr<CFStringRef> usernameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, username));
+ RetainPtr<CFStringRef> passwordCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, password));
+
+ NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:(NSString *)urlStringCF.get()]];
+
+ [SynchronousLoader makeRequest:request withUsername:(NSString *)usernameCF.get() password:(NSString *)passwordCF.get()];
+#endif
+}
+
+void LayoutTestController::setEditingBehavior(const char* editingBehavior)
+{
+ NSString* editingBehaviorNS = [[NSString alloc] initWithUTF8String:editingBehavior];
+ if ([editingBehaviorNS isEqualToString:@"mac"])
+ [[WebPreferences standardPreferences] setEditingBehavior:WebKitEditingMacBehavior];
+ else if ([editingBehaviorNS isEqualToString:@"win"])
+ [[WebPreferences standardPreferences] setEditingBehavior:WebKitEditingWinBehavior];
+ else if ([editingBehaviorNS isEqualToString:@"unix"])
+ [[WebPreferences standardPreferences] setEditingBehavior:WebKitEditingUnixBehavior];
+ [editingBehaviorNS release];
+}
+
+void LayoutTestController::abortModal()
+{
+ [NSApp abortModal];
+}
+
+bool LayoutTestController::hasSpellingMarker(int from, int length)
+{
+ return [mainFrame hasSpellingMarker:from length:length];
+}
diff --git a/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.h b/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.h
new file mode 100644
index 0000000..311d1e9
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.h
@@ -0,0 +1,47 @@
+/*
+ * 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.
+ */
+
+#ifndef MockGeolocationProvider_h
+#define MockGeolocationProvider_h
+
+#import <WebKit/WebViewPrivate.h>
+#import <wtf/HashSet.h>
+
+@interface MockGeolocationProvider : NSObject<WebGeolocationProvider> {
+ WebGeolocationPosition *_lastPosition;
+ NSError *_error;
+ NSTimer *_timer;
+ HashSet<WebView *> _registeredViews;
+}
+
++ (MockGeolocationProvider *)shared;
+
+- (void)setPosition:(WebGeolocationPosition *)position;
+- (void)setError:(NSError *)error;
+
+- (void)stopTimer;
+
+@end
+#endif
diff --git a/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.mm b/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.mm
new file mode 100644
index 0000000..e03cae2
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/mac/MockGeolocationProvider.mm
@@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+
+#import "MockGeolocationProvider.h"
+
+
+@implementation MockGeolocationProvider
+
++ (MockGeolocationProvider *)shared
+{
+ static MockGeolocationProvider *provider = [[MockGeolocationProvider alloc] init];
+ return provider;
+}
+
+- (void)dealloc
+{
+ ASSERT(_registeredViews.isEmpty());
+
+ [_lastPosition release];
+ [_error release];
+ [super dealloc];
+}
+
+- (void)setPosition:(WebGeolocationPosition *)position
+{
+ if (_lastPosition != position) {
+ [_lastPosition release];
+ _lastPosition = [position retain];
+ }
+
+ [_error release];
+ _error = 0;
+
+ if (!_timer)
+ _timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO];
+}
+
+- (void)setError:(NSError *)error
+{
+ if (_error != error) {
+ [_error release];
+ _error = [error retain];
+ }
+
+ [_lastPosition release];
+ _lastPosition = 0;
+
+ if (!_timer)
+ _timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO];
+}
+
+- (void)registerWebView:(WebView *)webView
+{
+ _registeredViews.add(webView);
+
+ if (!_timer)
+ _timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO];
+}
+
+- (void)unregisterWebView:(WebView *)webView
+{
+ _registeredViews.remove(webView);
+}
+
+- (WebGeolocationPosition *)lastPosition
+{
+ return _lastPosition;
+}
+
+- (void)stopTimer
+{
+ [_timer invalidate];
+ _timer = 0;
+}
+
+- (void)timerFired
+{
+ _timer = 0;
+
+ // Expect that views won't be (un)registered while iterating.
+ HashSet<WebView*> views = _registeredViews;
+ for (HashSet<WebView*>::iterator iter = views.begin(); iter != views.end(); ++iter) {
+ if (_error)
+ [*iter _geolocationDidFailWithError:_error];
+ else
+ [*iter _geolocationDidChangePosition:_lastPosition];
+ }
+}
+
+@end
diff --git a/WebKitTools/DumpRenderTree/mac/ObjCController.m b/WebKitTools/DumpRenderTree/mac/ObjCController.m
index aa9ee49..f1d1c10 100644
--- a/WebKitTools/DumpRenderTree/mac/ObjCController.m
+++ b/WebKitTools/DumpRenderTree/mac/ObjCController.m
@@ -29,13 +29,22 @@
#import "config.h"
#import "ObjCController.h"
+// Avoid compile error in DOMPrivate.h.
+@class NSFont;
+
#import <JavaScriptCore/JavaScriptCore.h>
#import <WebKit/DOMAbstractView.h>
+#import <WebKit/DOMPrivate.h>
#import <WebKit/WebScriptObject.h>
#import <WebKit/WebView.h>
#import <pthread.h>
#import <wtf/Assertions.h>
+// Remove this once hasWebScriptKey has been made public.
+@interface WebScriptObject (StagedForPublic)
+- (BOOL)hasWebScriptKey:(NSString *)name;
+@end
+
static void* runJavaScriptThread(void* arg)
{
JSGlobalContextRef ctx = JSGlobalContextCreate(0);
@@ -66,7 +75,9 @@ static void* runJavaScriptThread(void* arg)
|| aSelector == @selector(accessStoredWebScriptObject)
|| aSelector == @selector(storeWebScriptObject:)
|| aSelector == @selector(testValueForKey)
+ || aSelector == @selector(testHasWebScriptKey:)
|| aSelector == @selector(testArray)
+ || aSelector == @selector(setSelectElement:selectedIndex:allowingMultiple:)
)
return NO;
return YES;
@@ -92,8 +103,12 @@ static void* runJavaScriptThread(void* arg)
return @"storeWebScriptObject";
if (aSelector == @selector(testValueForKey))
return @"testValueForKey";
+ if (aSelector == @selector(testHasWebScriptKey:))
+ return @"testHasWebScriptKey";
if (aSelector == @selector(testArray))
return @"testArray";
+ if (aSelector == @selector(setSelectElement:selectedIndex:allowingMultiple:))
+ return @"setSelectElementSelectedIndexAllowingMultiple";
return nil;
}
@@ -166,6 +181,12 @@ static void* runJavaScriptThread(void* arg)
pthread_join(pthread, 0);
}
+- (BOOL)testHasWebScriptKey:(NSString *)key
+{
+ ASSERT(storedWebScriptObject);
+ return [storedWebScriptObject hasWebScriptKey:key];
+}
+
- (BOOL)testWrapperRoundTripping:(WebScriptObject *)webScriptObject
{
JSObjectRef jsObject = [webScriptObject JSObject];
@@ -249,4 +270,16 @@ static void* runJavaScriptThread(void* arg)
return nil;
}
+#pragma mark -
+#pragma mark Testing Objective-C DOM HTML Bindings
+
+- (void)setSelectElement:(WebScriptObject *)element selectedIndex:(int)index allowingMultiple:(BOOL)allowingMultiple
+{
+ if (![element isKindOfClass:[DOMHTMLSelectElement class]])
+ return;
+
+ DOMHTMLSelectElement *select = (DOMHTMLSelectElement*)element;
+ [select _activateItemAtIndex:index allowMultipleSelection:allowingMultiple];
+}
+
@end
diff --git a/WebKitTools/DumpRenderTree/mac/PixelDumpSupportMac.mm b/WebKitTools/DumpRenderTree/mac/PixelDumpSupportMac.mm
index 0059b69..3967186 100644
--- a/WebKitTools/DumpRenderTree/mac/PixelDumpSupportMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/PixelDumpSupportMac.mm
@@ -38,6 +38,7 @@
#include <wtf/Assertions.h>
#include <wtf/RefPtr.h>
+#import <WebKit/WebCoreStatistics.h>
#import <WebKit/WebDocumentPrivate.h>
#import <WebKit/WebHTMLViewPrivate.h>
#import <WebKit/WebKit.h>
@@ -104,21 +105,11 @@ void setupMainDisplayColorProfile()
signal(SIGTERM, restoreMainDisplayColorProfile);
}
-PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool incrementalRepaint, bool sweepHorizontally, bool drawSelectionRect)
+static PassRefPtr<BitmapContext> createBitmapContext(size_t pixelsWide, size_t pixelsHigh, size_t& rowBytes, void*& buffer)
{
- WebView* view = [mainFrame webView];
+ rowBytes = (4 * pixelsWide + 63) & ~63; // Use a multiple of 64 bytes to improve CG performance
- // If the WebHTMLView uses accelerated compositing, we need for force the on-screen capture path
- // and also force Core Animation to start its animations with -display since the DRT window has autodisplay disabled.
- if ([view _isUsingAcceleratedCompositing])
- onscreen = YES;
-
- NSSize webViewSize = [view frame].size;
- size_t pixelsWide = static_cast<size_t>(webViewSize.width);
- size_t pixelsHigh = static_cast<size_t>(webViewSize.height);
- size_t rowBytes = (4 * pixelsWide + 63) & ~63; // Use a multiple of 64 bytes to improve CG performance
-
- void *buffer = calloc(pixelsHigh, rowBytes);
+ buffer = calloc(pixelsHigh, rowBytes);
if (!buffer)
return 0;
@@ -140,9 +131,28 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool inc
return 0;
}
- // The BitmapContext keeps the CGContextRef and the pixel buffer alive
- RefPtr<BitmapContext> bitmapContext = BitmapContext::createByAdoptingBitmapAndContext(buffer, context);
-
+ return BitmapContext::createByAdoptingBitmapAndContext(buffer, context);
+}
+
+PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool incrementalRepaint, bool sweepHorizontally, bool drawSelectionRect)
+{
+ WebView* view = [mainFrame webView];
+
+ // If the WebHTMLView uses accelerated compositing, we need for force the on-screen capture path
+ // and also force Core Animation to start its animations with -display since the DRT window has autodisplay disabled.
+ if ([view _isUsingAcceleratedCompositing])
+ onscreen = YES;
+
+ NSSize webViewSize = [view frame].size;
+ size_t pixelsWide = static_cast<size_t>(webViewSize.width);
+ size_t pixelsHigh = static_cast<size_t>(webViewSize.height);
+ size_t rowBytes = 0;
+ void* buffer = 0;
+ RefPtr<BitmapContext> bitmapContext = createBitmapContext(pixelsWide, pixelsHigh, rowBytes, buffer);
+ if (!bitmapContext)
+ return 0;
+ CGContextRef context = bitmapContext->cgContext();
+
NSGraphicsContext *nsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:context flipped:NO];
ASSERT(nsContext);
@@ -254,3 +264,16 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool inc
return bitmapContext.release();
}
+
+PassRefPtr<BitmapContext> createPagedBitmapContext()
+{
+ int pageWidthInPixels = LayoutTestController::maxViewWidth;
+ int pageHeightInPixels = LayoutTestController::maxViewHeight;
+ int numberOfPages = [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels];
+ size_t rowBytes = 0;
+ void* buffer = 0;
+
+ RefPtr<BitmapContext> bitmapContext = createBitmapContext(pageWidthInPixels, numberOfPages * (pageHeightInPixels + 1) - 1, rowBytes, buffer);
+ [mainFrame printToCGContext:bitmapContext->cgContext():pageWidthInPixels:pageHeightInPixels];
+ return bitmapContext.release();
+}
diff --git a/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm b/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm
index 6f82e01..0855b83 100644
--- a/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm
+++ b/WebKitTools/DumpRenderTree/mac/ResourceLoadDelegate.mm
@@ -33,8 +33,11 @@
#import "LayoutTestController.h"
#import <WebKit/WebKit.h>
#import <WebKit/WebTypesInternal.h>
+#import <WebKit/WebDataSourcePrivate.h>
#import <wtf/Assertions.h>
+using namespace std;
+
@interface NSURL (DRTExtras)
- (NSString *)_drt_descriptionSuitableForTestResult;
@end
@@ -121,14 +124,18 @@
return @"<unknown>";
}
--(NSURLRequest *)webView: (WebView *)wv resource:identifier willSendRequest: (NSURLRequest *)newRequest redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource
+-(NSURLRequest *)webView: (WebView *)wv resource:identifier willSendRequest: (NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource
{
if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
- NSString *string = [NSString stringWithFormat:@"%@ - willSendRequest %@ redirectResponse %@", identifier, [newRequest _drt_descriptionSuitableForTestResult],
+ NSString *string = [NSString stringWithFormat:@"%@ - willSendRequest %@ redirectResponse %@", identifier, [request _drt_descriptionSuitableForTestResult],
[redirectResponse _drt_descriptionSuitableForTestResult]];
printf("%s\n", [string UTF8String]);
}
+ if (!done && !gLayoutTestController->deferMainResourceDataLoad()) {
+ [dataSource _setDeferMainResourceDataLoad:false];
+ }
+
if (!done && gLayoutTestController->willSendRequestReturnsNull())
return nil;
@@ -137,7 +144,7 @@
return nil;
}
- NSURL *url = [newRequest URL];
+ NSURL *url = [request URL];
NSString *host = [url host];
if (host
&& (NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"http"] || NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"https"])
@@ -151,13 +158,26 @@
if (disallowedURLs && CFSetContainsValue(disallowedURLs, url))
return nil;
- return newRequest;
+ NSMutableURLRequest *newRequest = [request mutableCopy];
+ const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders();
+ for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) {
+ NSString *nsHeader = [[NSString alloc] initWithUTF8String:header->c_str()];
+ [newRequest setValue:nil forHTTPHeaderField:nsHeader];
+ [nsHeader release];
+ }
+
+ return [newRequest autorelease];
}
- (void)webView:(WebView *)wv resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource
{
- if (!gLayoutTestController->handlesAuthenticationChallenges())
+ if (!gLayoutTestController->handlesAuthenticationChallenges()) {
+ NSString *string = [NSString stringWithFormat:@"%@ - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet", identifier];
+ printf("%s\n", [string UTF8String]);
+
+ [[challenge sender] continueWithoutCredentialForAuthenticationChallenge:challenge];
return;
+ }
const char* user = gLayoutTestController->authenticationUsername().c_str();
NSString *nsUser = [NSString stringWithFormat:@"%s", user ? user : ""];
diff --git a/WebKitTools/DumpRenderTree/mac/TextInputController.m b/WebKitTools/DumpRenderTree/mac/TextInputController.m
index 3ea9c22..f780794 100644
--- a/WebKitTools/DumpRenderTree/mac/TextInputController.m
+++ b/WebKitTools/DumpRenderTree/mac/TextInputController.m
@@ -33,6 +33,7 @@
#import <AppKit/NSInputManager.h>
#import <WebKit/WebDocument.h>
#import <WebKit/WebFrame.h>
+#import <WebKit/WebFramePrivate.h>
#import <WebKit/WebFrameView.h>
#import <WebKit/WebHTMLViewPrivate.h>
#import <WebKit/WebScriptObject.h>
diff --git a/WebKitTools/DumpRenderTree/mac/UIDelegate.h b/WebKitTools/DumpRenderTree/mac/UIDelegate.h
index da472d6..a8017ad 100644
--- a/WebKitTools/DumpRenderTree/mac/UIDelegate.h
+++ b/WebKitTools/DumpRenderTree/mac/UIDelegate.h
@@ -32,6 +32,10 @@
@private
NSRect m_frame;
+ NSMutableSet *m_pendingGeolocationPermissionListeners;
+ NSTimer *m_timer;
}
+- (void)didSetMockGeolocationPermission;
+
@end
diff --git a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm
index 19ceb95..6194c26 100644
--- a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm
+++ b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm
@@ -33,8 +33,10 @@
#import "DumpRenderTreeDraggingInfo.h"
#import "EventSendingController.h"
#import "LayoutTestController.h"
+#import <WebKit/WebApplicationCache.h>
#import <WebKit/WebFramePrivate.h>
#import <WebKit/WebHTMLViewPrivate.h>
+#import <WebKit/WebQuotaManager.h>
#import <WebKit/WebSecurityOriginPrivate.h>
#import <WebKit/WebUIDelegatePrivate.h>
#import <WebKit/WebView.h>
@@ -67,6 +69,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)
@@ -141,12 +157,24 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier
{
- if (!done && gLayoutTestController->dumpDatabaseCallbacks())
+ if (!done && gLayoutTestController->dumpDatabaseCallbacks()) {
printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", [[origin protocol] UTF8String], [[origin host] UTF8String],
[origin port], [databaseIdentifier UTF8String]);
+ }
static const unsigned long long defaultQuota = 5 * 1024 * 1024;
- [origin setQuota:defaultQuota];
+ [[origin databaseQuotaManager] setQuota:defaultQuota];
+}
+
+- (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin
+{
+ if (!done && gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) {
+ printf("UI DELEGATE APPLICATION CACHE CALLBACK: exceededApplicationCacheOriginQuotaForSecurityOrigin:{%s, %s, %i}\n",
+ [[origin protocol] UTF8String], [[origin host] UTF8String], [origin port]);
+ }
+
+ static const unsigned long long defaultOriginQuota = [WebApplicationCache defaultOriginQuota];
+ [[origin applicationCacheQuotaManager] setQuota:defaultOriginQuota];
}
- (void)webView:(WebView *)sender setStatusText:(NSString *)text
@@ -157,12 +185,41 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
- (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin frame:(WebFrame *)frame listener:(id<WebGeolocationPolicyListener>)listener
{
- if (gLayoutTestController->isGeolocationPermissionSet()) {
+ if (!gLayoutTestController->isGeolocationPermissionSet()) {
+ if (!m_pendingGeolocationPermissionListeners)
+ m_pendingGeolocationPermissionListeners = [[NSMutableSet set] retain];
+ [m_pendingGeolocationPermissionListeners addObject:listener];
+ return;
+ }
+
+ if (gLayoutTestController->geolocationPermission())
+ [listener allow];
+ else
+ [listener deny];
+}
+
+- (void)didSetMockGeolocationPermission
+{
+ ASSERT(gLayoutTestController->isGeolocationPermissionSet());
+ if (m_pendingGeolocationPermissionListeners && !m_timer)
+ m_timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO];
+}
+
+- (void)timerFired
+{
+ ASSERT(gLayoutTestController->isGeolocationPermissionSet());
+ m_timer = 0;
+ NSEnumerator* enumerator = [m_pendingGeolocationPermissionListeners objectEnumerator];
+ id<WebGeolocationPolicyListener> listener;
+ while ((listener = [enumerator nextObject])) {
if (gLayoutTestController->geolocationPermission())
[listener allow];
else
[listener deny];
}
+ [m_pendingGeolocationPermissionListeners removeAllObjects];
+ [m_pendingGeolocationPermissionListeners release];
+ m_pendingGeolocationPermissionListeners = nil;
}
- (BOOL)webView:(WebView *)sender shouldHaltPlugin:(DOMNode *)pluginNode
@@ -170,10 +227,35 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
return NO;
}
+- (BOOL)webView:(WebView *)webView supportsFullScreenForElement:(DOMElement*)element
+{
+ return YES;
+}
+
+- (void)webView:(WebView *)webView enterFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener
+{
+ [listener webkitWillEnterFullScreen];
+ [listener webkitDidEnterFullScreen];
+}
+
+- (void)webView:(WebView *)webView exitFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener
+{
+ [listener webkitWillExitFullScreen];
+ [listener webkitDidExitFullScreen];
+}
+
+- (BOOL)webView:(WebView *)webView didPressMissingPluginButton:(DOMElement *)element
+{
+ printf("MISSING PLUGIN BUTTON PRESSED\n");
+ return TRUE;
+}
+
- (void)dealloc
{
[draggingInfo release];
draggingInfo = nil;
+ [m_pendingGeolocationPermissionListeners release];
+ m_pendingGeolocationPermissionListeners = nil;
[super dealloc];
}
diff --git a/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm b/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm
new file mode 100644
index 0000000..c273087
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/mac/WebArchiveDumpSupportMac.mm
@@ -0,0 +1,76 @@
+/*
+ * 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 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 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 "WebArchiveDumpSupport.h"
+
+#import <CFNetwork/CFHTTPMessage.h>
+#import <Foundation/Foundation.h>
+#import <WebKit/WebHTMLRepresentation.h>
+#import <wtf/RetainPtr.h>
+
+extern "C" {
+
+enum CFURLCacheStoragePolicy {
+ kCFURLCacheStorageAllowed = 0,
+ kCFURLCacheStorageAllowedInMemoryOnly = 1,
+ kCFURLCacheStorageNotAllowed = 2
+};
+typedef enum CFURLCacheStoragePolicy CFURLCacheStoragePolicy;
+
+extern const CFStringRef kCFHTTPVersion1_1;
+
+CFURLResponseRef CFURLResponseCreate(CFAllocatorRef alloc, CFURLRef URL, CFStringRef mimeType, SInt64 expectedContentLength, CFStringRef textEncodingName, CFURLCacheStoragePolicy recommendedPolicy);
+CFURLResponseRef CFURLResponseCreateWithHTTPResponse(CFAllocatorRef alloc, CFURLRef URL, CFHTTPMessageRef httpResponse, CFURLCacheStoragePolicy recommendedPolicy);
+void CFURLResponseSetExpectedContentLength(CFURLResponseRef response, SInt64 length);
+void CFURLResponseSetMIMEType(CFURLResponseRef response, CFStringRef mimeType);
+
+}
+
+CFURLResponseRef createCFURLResponseFromResponseData(CFDataRef responseData)
+{
+ // Decode NSURLResponse
+ RetainPtr<NSKeyedUnarchiver> unarchiver(AdoptNS, [[NSKeyedUnarchiver alloc] initForReadingWithData:(NSData *)responseData]);
+ NSURLResponse *response = [unarchiver.get() decodeObjectForKey:@"WebResourceResponse"]; // WebResourceResponseKey in WebResource.m
+ [unarchiver.get() finishDecoding];
+
+ if (![response isKindOfClass:[NSHTTPURLResponse class]])
+ return CFURLResponseCreate(kCFAllocatorDefault, (CFURLRef)[response URL], (CFStringRef)[response MIMEType], [response expectedContentLength], (CFStringRef)[response textEncodingName], kCFURLCacheStorageAllowed);
+
+ NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
+
+ // NSURLResponse is not toll-free bridged to CFURLResponse.
+ RetainPtr<CFHTTPMessageRef> httpMessage(AdoptCF, CFHTTPMessageCreateResponse(kCFAllocatorDefault, [httpResponse statusCode], 0, kCFHTTPVersion1_1));
+
+ NSDictionary *headerFields = [httpResponse allHeaderFields];
+ for (NSString *headerField in [headerFields keyEnumerator])
+ CFHTTPMessageSetHeaderFieldValue(httpMessage.get(), (CFStringRef)headerField, (CFStringRef)[headerFields objectForKey:headerField]);
+
+ return CFURLResponseCreateWithHTTPResponse(kCFAllocatorDefault, (CFURLRef)[response URL], httpMessage.get(), kCFURLCacheStorageAllowed);
+}
+
+CFArrayRef supportedNonImageMIMETypes()
+{
+ return (CFArrayRef)[WebHTMLRepresentation supportedNonImageMIMETypes];
+}
diff --git a/WebKitTools/DumpRenderTree/mac/WorkQueueItemMac.mm b/WebKitTools/DumpRenderTree/mac/WorkQueueItemMac.mm
index 4e39a5a..797afb7 100644
--- a/WebKitTools/DumpRenderTree/mac/WorkQueueItemMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/WorkQueueItemMac.mm
@@ -54,6 +54,15 @@ bool LoadItem::invoke() const
return true;
}
+bool LoadHTMLStringItem::invoke() const
+{
+ RetainPtr<CFStringRef> contentCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, m_content.get()));
+ RetainPtr<CFStringRef> baseURLCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, m_baseURL.get()));
+
+ [mainFrame loadHTMLString:(NSString *)contentCF.get() baseURL:[NSURL URLWithString:(NSString *)baseURLCF.get()]];
+ return true;
+}
+
bool ReloadItem::invoke() const
{
[[mainFrame webView] reload:nil];
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
index ad42bdd..54d5af7 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTree.pro
@@ -2,22 +2,17 @@ TARGET = DumpRenderTree
CONFIG -= app_bundle
CONFIG += uitools
-mac:!static:contains(QT_CONFIG, qt_framework):!CONFIG(webkit_no_framework) {
- CONFIG -= debug
- CONFIG += release
-}
-
BASEDIR = $$PWD/../
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
include(../../../WebKit.pri)
-INCLUDEPATH += /usr/include/freetype2
INCLUDEPATH += ../../..
INCLUDEPATH += ../../../JavaScriptCore
INCLUDEPATH += ../../../JavaScriptCore/ForwardingHeaders
INCLUDEPATH += $$BASEDIR
DESTDIR = ../../../bin
-!win32 {
+unix:!mac {
CONFIG += link_pkgconfig
PKGCONFIG += fontconfig
}
@@ -32,12 +27,14 @@ HEADERS = $$BASEDIR/WorkQueue.h \
WorkQueueItemQt.h \
LayoutTestControllerQt.h \
GCControllerQt.h \
+ PlainTextControllerQt.h \
testplugin.h
SOURCES = ../../../JavaScriptCore/wtf/Assertions.cpp \
$$BASEDIR/WorkQueue.cpp \
DumpRenderTreeQt.cpp \
EventSenderQt.cpp \
TextInputControllerQt.cpp \
+ PlainTextControllerQt.cpp \
WorkQueueItemQt.cpp \
LayoutTestControllerQt.cpp \
GCControllerQt.cpp \
@@ -48,4 +45,9 @@ unix:!mac {
QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
}
+wince*: {
+ INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat $$WCECOMPAT/include
+ LIBS += $$WCECOMPAT/lib/wcecompat.lib
+}
+
DEFINES+=USE_SYSTEM_MALLOC
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index c16a786..eadcc43 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -32,19 +32,20 @@
#include "config.h"
#include "DumpRenderTreeQt.h"
+#include "../../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
#include "EventSenderQt.h"
#include "GCControllerQt.h"
#include "LayoutTestControllerQt.h"
#include "TextInputControllerQt.h"
+#include "PlainTextControllerQt.h"
#include "testplugin.h"
#include "WorkQueue.h"
+#include <QApplication>
#include <QBuffer>
#include <QCryptographicHash>
#include <QDir>
#include <QFile>
-#include <QApplication>
-#include <QUrl>
#include <QFileInfo>
#include <QFocusEvent>
#include <QFontDatabase>
@@ -52,7 +53,13 @@
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
+#include <QPaintDevice>
+#include <QPaintEngine>
+#ifndef QT_NO_PRINTER
+#include <QPrinter>
+#endif
#include <QUndoStack>
+#include <QUrl>
#include <qwebsettings.h>
#include <qwebsecurityorigin.h>
@@ -66,6 +73,7 @@
#endif
#include <limits.h>
+#include <locale.h>
#ifndef Q_OS_WIN
#include <unistd.h>
@@ -73,20 +81,8 @@
#include <qdebug.h>
-extern void qt_drt_run(bool b);
-extern void qt_dump_set_accepts_editing(bool b);
-extern void qt_dump_frame_loader(bool b);
-extern void qt_drt_clearFrameName(QWebFrame* qFrame);
-extern void qt_drt_overwritePluginDirectories();
-extern void qt_drt_resetOriginAccessWhiteLists();
-extern bool qt_drt_hasDocumentElement(QWebFrame* qFrame);
-
namespace WebCore {
-// Choose some default values.
-const unsigned int maxViewWidth = 800;
-const unsigned int maxViewHeight = 600;
-
NetworkAccessManager::NetworkAccessManager(QObject* parent)
: QNetworkAccessManager(parent)
{
@@ -116,6 +112,25 @@ void NetworkAccessManager::sslErrorsEncountered(QNetworkReply* reply, const QLis
}
#endif
+
+#ifndef QT_NO_PRINTER
+class NullPrinter : public QPrinter {
+public:
+ class NullPaintEngine : public QPaintEngine {
+ public:
+ virtual bool begin(QPaintDevice*) { return true; }
+ virtual bool end() { return true; }
+ virtual QPaintEngine::Type type() const { return QPaintEngine::User; }
+ virtual void drawPixmap(const QRectF& r, const QPixmap& pm, const QRectF& sr) { }
+ virtual void updateState(const QPaintEngineState& state) { }
+ };
+
+ virtual QPaintEngine* paintEngine() const { return const_cast<NullPaintEngine*>(&m_engine); }
+
+ NullPaintEngine m_engine;
+};
+#endif
+
WebPage::WebPage(QObject* parent, DumpRenderTree* drt)
: QWebPage(parent)
, m_webInspector(0)
@@ -135,13 +150,16 @@ WebPage::WebPage(QObject* parent, DumpRenderTree* drt)
globalSettings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
globalSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
globalSettings->setAttribute(QWebSettings::PrivateBrowsingEnabled, false);
- globalSettings->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, false);
+ globalSettings->setAttribute(QWebSettings::SpatialNavigationEnabled, false);
connect(this, SIGNAL(geometryChangeRequested(const QRect &)),
this, SLOT(setViewGeometry(const QRect & )));
- setNetworkAccessManager(new NetworkAccessManager(this));
+ setNetworkAccessManager(m_drt->networkAccessManager());
setPluginFactory(new TestPlugin(this));
+
+ connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain)));
+ connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(cancelPermission(QWebFrame*, QWebPage::PermissionDomain)));
}
WebPage::~WebPage()
@@ -166,15 +184,26 @@ void WebPage::resetSettings()
settings()->resetAttribute(QWebSettings::JavascriptCanOpenWindows);
settings()->resetAttribute(QWebSettings::JavascriptEnabled);
settings()->resetAttribute(QWebSettings::PrivateBrowsingEnabled);
+ settings()->resetAttribute(QWebSettings::SpatialNavigationEnabled);
settings()->resetAttribute(QWebSettings::LinksIncludedInFocusChain);
settings()->resetAttribute(QWebSettings::OfflineWebApplicationCacheEnabled);
settings()->resetAttribute(QWebSettings::LocalContentCanAccessRemoteUrls);
+ settings()->resetAttribute(QWebSettings::PluginsEnabled);
+ settings()->resetAttribute(QWebSettings::JavascriptCanAccessClipboard);
+ settings()->resetAttribute(QWebSettings::AutoLoadImages);
+
+ m_drt->layoutTestController()->setCaretBrowsingEnabled(false);
+ m_drt->layoutTestController()->setFrameFlatteningEnabled(false);
+ m_drt->layoutTestController()->setSmartInsertDeleteEnabled(true);
+ m_drt->layoutTestController()->setSelectTrailingWhitespaceEnabled(false);
// globalSettings must be reset explicitly.
m_drt->layoutTestController()->setXSSAuditorEnabled(false);
QWebSettings::setMaximumPagesInCache(0); // reset to default
settings()->setUserStyleSheetUrl(QUrl()); // reset to default
+
+ m_pendingGeolocationRequests.clear();
}
QWebPage *WebPage::createWindow(QWebPage::WebWindowType)
@@ -190,6 +219,58 @@ void WebPage::javaScriptAlert(QWebFrame*, const QString& message)
fprintf(stdout, "ALERT: %s\n", message.toUtf8().constData());
}
+void WebPage::requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain)
+{
+ switch (domain) {
+ case NotificationsPermissionDomain:
+ if (!m_drt->layoutTestController()->ignoreReqestForPermission())
+ setUserPermission(frame, domain, PermissionGranted);
+ break;
+ case GeolocationPermissionDomain:
+ if (m_drt->layoutTestController()->isGeolocationPermissionSet())
+ if (m_drt->layoutTestController()->geolocationPermission())
+ setUserPermission(frame, domain, PermissionGranted);
+ else
+ setUserPermission(frame, domain, PermissionDenied);
+ else
+ m_pendingGeolocationRequests.append(frame);
+ break;
+ default:
+ break;
+ }
+}
+
+void WebPage::cancelPermission(QWebFrame* frame, QWebPage::PermissionDomain domain)
+{
+ switch (domain) {
+ case GeolocationPermissionDomain:
+ m_pendingGeolocationRequests.removeOne(frame);
+ break;
+ default:
+ break;
+ }
+}
+
+void WebPage::permissionSet(QWebPage::PermissionDomain domain)
+{
+ switch (domain) {
+ case GeolocationPermissionDomain:
+ {
+ Q_ASSERT(m_drt->layoutTestController()->isGeolocationPermissionSet());
+ foreach (QWebFrame* frame, m_pendingGeolocationRequests)
+ if (m_drt->layoutTestController()->geolocationPermission())
+ setUserPermission(frame, domain, PermissionGranted);
+ else
+ setUserPermission(frame, domain, PermissionDenied);
+
+ m_pendingGeolocationRequests.clear();
+ break;
+ }
+ default:
+ break;
+ }
+}
+
static QString urlSuitableForTestResult(const QString& url)
{
if (url.isEmpty() || !url.startsWith(QLatin1String("file://")))
@@ -310,20 +391,61 @@ QObject* WebPage::createPlugin(const QString& classId, const QUrl& url, const QS
#endif
}
+void WebPage::setViewGeometry(const QRect& rect)
+{
+ if (WebViewGraphicsBased* v = qobject_cast<WebViewGraphicsBased*>(view()))
+ v->scene()->setSceneRect(QRectF(rect));
+ else if (QWidget *v = view())
+ v->setGeometry(rect);
+}
+
+WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent)
+ : m_item(new QGraphicsWebView)
+{
+ setScene(new QGraphicsScene(this));
+ scene()->addItem(m_item);
+}
+
DumpRenderTree::DumpRenderTree()
: m_dumpPixels(false)
, m_stdin(0)
, m_enableTextOutput(false)
- , m_singleFileMode(false)
+ , m_standAloneMode(false)
+ , m_graphicsBased(false)
+ , m_persistentStoragePath(QString(getenv("DUMPRENDERTREE_TEMP")))
{
- qt_drt_overwritePluginDirectories();
- QWebSettings::enablePersistentStorage();
+ QByteArray viewMode = getenv("QT_DRT_WEBVIEW_MODE");
+ if (viewMode == "graphics")
+ setGraphicsBased(true);
+
+ DumpRenderTreeSupportQt::overwritePluginDirectories();
+
+ QWebSettings::enablePersistentStorage(m_persistentStoragePath);
+
+ m_networkAccessManager = new NetworkAccessManager(this);
// create our primary testing page/view.
- m_mainView = new QWebView(0);
- m_mainView->resize(QSize(maxViewWidth, maxViewHeight));
- m_page = new WebPage(m_mainView, this);
- m_mainView->setPage(m_page);
+ if (isGraphicsBased()) {
+ WebViewGraphicsBased* view = new WebViewGraphicsBased(0);
+ m_page = new WebPage(view, this);
+ view->setPage(m_page);
+ m_mainView = view;
+ } else {
+ QWebView* view = new QWebView(0);
+ m_page = new WebPage(view, this);
+ view->setPage(m_page);
+ m_mainView = view;
+ }
+ // Use a frame group name for all pages created by DumpRenderTree to allow
+ // testing of cross-page frame lookup.
+ DumpRenderTreeSupportQt::webPageSetGroupName(m_page, "org.webkit.qt.DumpRenderTree");
+
+ m_mainView->setContextMenuPolicy(Qt::NoContextMenu);
+ m_mainView->resize(QSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight));
+
+ // clean up cache by resetting quota.
+ qint64 quota = webPage()->settings()->offlineWebApplicationCacheQuota();
+ webPage()->settings()->setOfflineWebApplicationCacheQuota(quota);
// create our controllers. This has to be done before connectFrame,
// as it exports there to the JavaScript DOM window.
@@ -331,9 +453,13 @@ DumpRenderTree::DumpRenderTree()
connect(m_controller, SIGNAL(showPage()), this, SLOT(showPage()));
connect(m_controller, SIGNAL(hidePage()), this, SLOT(hidePage()));
+ // async geolocation permission set by controller
+ connect(m_controller, SIGNAL(geolocationPermissionSet()), this, SLOT(geolocationPermissionSet()));
+
connect(m_controller, SIGNAL(done()), this, SLOT(dump()));
m_eventSender = new EventSender(m_page);
m_textInputController = new TextInputController(m_page);
+ m_plainTextController = new PlainTextController(m_page);
m_gcController = new GCController(m_page);
// now connect our different signals
@@ -348,6 +474,7 @@ DumpRenderTree::DumpRenderTree()
connect(m_page, SIGNAL(loadStarted()),
m_controller, SLOT(resetLoadFinished()));
connect(m_page, SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested()));
+ connect(m_page, SIGNAL(printRequested(QWebFrame*)), this, SLOT(dryRunPrint(QWebFrame*)));
connect(m_page->mainFrame(), SIGNAL(titleChanged(const QString&)),
SLOT(titleChanged(const QString&)));
@@ -357,7 +484,8 @@ DumpRenderTree::DumpRenderTree()
this, SLOT(statusBarMessage(const QString&)));
QObject::connect(this, SIGNAL(quit()), qApp, SLOT(quit()), Qt::QueuedConnection);
- qt_drt_run(true);
+
+ DumpRenderTreeSupportQt::setDumpRenderTreeModeEnabled(true);
QFocusEvent event(QEvent::FocusIn, Qt::ActiveWindowFocusReason);
QApplication::sendEvent(m_mainView, &event);
}
@@ -381,6 +509,14 @@ static void clearHistory(QWebPage* page)
history->setMaximumItemCount(itemCount);
}
+void DumpRenderTree::dryRunPrint(QWebFrame* frame)
+{
+#ifndef QT_NO_PRINTER
+ NullPrinter printer;
+ frame->print(&printer);
+#endif
+}
+
void DumpRenderTree::resetToConsistentStateBeforeTesting()
{
// reset so that any current loads are stopped
@@ -395,31 +531,77 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting()
// of the DRT.
m_controller->reset();
+ // reset mouse clicks counter
+ m_eventSender->resetClickCount();
+
closeRemainingWindows();
m_page->resetSettings();
m_page->undoStack()->clear();
m_page->mainFrame()->setZoomFactor(1.0);
clearHistory(m_page);
- qt_drt_clearFrameName(m_page->mainFrame());
+ DumpRenderTreeSupportQt::clearFrameName(m_page->mainFrame());
+
+ m_page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded);
+ m_page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAsNeeded);
WorkQueue::shared()->clear();
WorkQueue::shared()->setFrozen(false);
- qt_drt_resetOriginAccessWhiteLists();
+ DumpRenderTreeSupportQt::resetOriginAccessWhiteLists();
+
+ // Qt defaults to Windows editing behavior.
+ DumpRenderTreeSupportQt::setEditingBehavior(m_page, "win");
QLocale::setDefault(QLocale::c());
+
+#ifndef Q_OS_WINCE
setlocale(LC_ALL, "");
+#endif
+}
+
+static bool isGlobalHistoryTest(const QUrl& url)
+{
+ if (url.path().contains("globalhistory/"))
+ return true;
+ return false;
+}
+
+static bool isWebInspectorTest(const QUrl& url)
+{
+ if (url.path().contains("inspector/"))
+ return true;
+ return false;
+}
+
+static bool shouldEnableDeveloperExtras(const QUrl& url)
+{
+ return isWebInspectorTest(url) || url.path().contains("inspector-enabled/");
}
void DumpRenderTree::open(const QUrl& url)
{
+ DumpRenderTreeSupportQt::dumpResourceLoadCallbacksPath(QFileInfo(url.toString()).path());
resetToConsistentStateBeforeTesting();
+ if (shouldEnableDeveloperExtras(m_page->mainFrame()->url())) {
+ layoutTestController()->closeWebInspector();
+ layoutTestController()->setDeveloperExtrasEnabled(false);
+ }
+
+ if (shouldEnableDeveloperExtras(url)) {
+ layoutTestController()->setDeveloperExtrasEnabled(true);
+ if (isWebInspectorTest(url))
+ layoutTestController()->showWebInspector();
+ }
+
+ if (isGlobalHistoryTest(url))
+ layoutTestController()->dumpHistoryCallbacks();
+
// W3C SVG tests expect to be 480x360
bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1");
- int width = isW3CTest ? 480 : maxViewWidth;
- int height = isW3CTest ? 360 : maxViewHeight;
+ int width = isW3CTest ? 480 : LayoutTestController::maxViewWidth;
+ int height = isW3CTest ? 360 : LayoutTestController::maxViewHeight;
m_mainView->resize(QSize(width, height));
m_page->setPreferredContentsSize(QSize());
m_page->setViewportSize(QSize(width, height));
@@ -428,12 +610,14 @@ void DumpRenderTree::open(const QUrl& url)
m_page->event(&ev);
QWebSettings::clearMemoryCaches();
+#if !(defined(Q_OS_SYMBIAN) && QT_VERSION <= QT_VERSION_CHECK(4, 6, 2))
QFontDatabase::removeAllApplicationFonts();
+#endif
#if defined(Q_WS_X11)
initializeFonts();
#endif
- qt_dump_frame_loader(url.toString().contains("loading/"));
+ DumpRenderTreeSupportQt::dumpFrameLoader(url.toString().contains("loading/"));
setTextOutputEnabled(true);
m_page->mainFrame()->load(url);
}
@@ -460,6 +644,42 @@ void DumpRenderTree::readLine()
processLine(QString::fromLocal8Bit(line.constData(), line.length()));
}
+void DumpRenderTree::processArgsLine(const QStringList &args)
+{
+ setStandAloneMode(true);
+
+ for (int i = 1; i < args.size(); ++i)
+ if (!args.at(i).startsWith('-'))
+ m_standAloneModeTestList.append(args[i]);
+
+ QFileInfo firstEntry(m_standAloneModeTestList.first());
+ if (firstEntry.isDir()) {
+ QDir folderEntry(m_standAloneModeTestList.first());
+ QStringList supportedExt;
+ // Check for all supported extensions (from Scripts/webkitpy/layout_tests/layout_package/test_files.py).
+ supportedExt << "*.html" << "*.shtml" << "*.xml" << "*.xhtml" << "*.xhtmlmp" << "*.pl" << "*.php" << "*.svg";
+ m_standAloneModeTestList = folderEntry.entryList(supportedExt, QDir::Files);
+ for (int i = 0; i < m_standAloneModeTestList.size(); ++i)
+ m_standAloneModeTestList[i] = folderEntry.absoluteFilePath(m_standAloneModeTestList[i]);
+ }
+
+ processLine(m_standAloneModeTestList.first());
+ m_standAloneModeTestList.removeFirst();
+
+ connect(this, SIGNAL(ready()), this, SLOT(loadNextTestInStandAloneMode()));
+}
+
+void DumpRenderTree::loadNextTestInStandAloneMode()
+{
+ if (m_standAloneModeTestList.isEmpty()) {
+ emit quit();
+ return;
+ }
+
+ processLine(m_standAloneModeTestList.first());
+ m_standAloneModeTestList.removeFirst();
+}
+
void DumpRenderTree::processLine(const QString &input)
{
QString line = input;
@@ -491,14 +711,9 @@ void DumpRenderTree::processLine(const QString &input)
fi = QFileInfo(currentDir, line.prepend(QLatin1String("LayoutTests/")));
if (!fi.exists()) {
- if (isSingleFileMode())
- emit quit();
- else
- emit ready();
-
+ emit ready();
return;
}
-
}
open(QUrl::fromLocalFile(fi.absoluteFilePath()));
@@ -527,6 +742,7 @@ void DumpRenderTree::initJSObjects()
frame->addToJavaScriptWindowObject(QLatin1String("eventSender"), m_eventSender);
frame->addToJavaScriptWindowObject(QLatin1String("textInputController"), m_textInputController);
frame->addToJavaScriptWindowObject(QLatin1String("GCController"), m_gcController);
+ frame->addToJavaScriptWindowObject(QLatin1String("plainText"), m_plainTextController);
}
void DumpRenderTree::showPage()
@@ -542,13 +758,35 @@ void DumpRenderTree::hidePage()
m_mainView->hide();
}
+QString DumpRenderTree::dumpFrameScrollPosition(QWebFrame* frame)
+{
+ if (!frame || !DumpRenderTreeSupportQt::hasDocumentElement(frame))
+ return QString();
+
+ QString result;
+ QPoint pos = frame->scrollPosition();
+ if (pos.x() > 0 || pos.y() > 0) {
+ QWebFrame* parent = qobject_cast<QWebFrame *>(frame->parent());
+ if (parent)
+ result.append(QString("frame '%1' ").arg(frame->title()));
+ result.append(QString("scrolled to %1,%2\n").arg(pos.x()).arg(pos.y()));
+ }
+
+ if (m_controller->shouldDumpChildFrameScrollPositions()) {
+ QList<QWebFrame*> children = frame->childFrames();
+ for (int i = 0; i < children.size(); ++i)
+ result += dumpFrameScrollPosition(children.at(i));
+ }
+ return result;
+}
+
QString DumpRenderTree::dumpFramesAsText(QWebFrame* frame)
{
- if (!frame || !qt_drt_hasDocumentElement(frame))
+ if (!frame || !DumpRenderTreeSupportQt::hasDocumentElement(frame))
return QString();
QString result;
- QWebFrame *parent = qobject_cast<QWebFrame *>(frame->parent());
+ QWebFrame* parent = qobject_cast<QWebFrame*>(frame->parent());
if (parent) {
result.append(QLatin1String("\n--------\nFrame: '"));
result.append(frame->frameName());
@@ -580,7 +818,7 @@ static QString dumpHistoryItem(const QWebHistoryItem& item, int indent, bool cur
for (int i = start; i < indent; i++)
result.append(' ');
- QString url = item.url().toString();
+ QString url = item.url().toEncoded();
if (url.contains("file://")) {
static QString layoutTestsString("/LayoutTests/");
static QString fileTestString("(file test):");
@@ -595,16 +833,24 @@ static QString dumpHistoryItem(const QWebHistoryItem& item, int indent, bool cur
result.append(url);
}
- // FIXME: Wrong, need (private?) API for determining this.
- result.append(QLatin1String(" **nav target**"));
+ QString target = DumpRenderTreeSupportQt::historyItemTarget(item);
+ if (!target.isEmpty())
+ result.append(QString(QLatin1String(" (in frame \"%1\")")).arg(target));
+
+ if (DumpRenderTreeSupportQt::isTargetItem(item))
+ result.append(QLatin1String(" **nav target**"));
result.append(QLatin1String("\n"));
+ QMap<QString, QWebHistoryItem> children = DumpRenderTreeSupportQt::getChildHistoryItems(item);
+ foreach (QWebHistoryItem item, children)
+ result += dumpHistoryItem(item, 12, false);
+
return result;
}
-QString DumpRenderTree::dumpBackForwardList()
+QString DumpRenderTree::dumpBackForwardList(QWebPage* page)
{
- QWebHistory* history = webPage()->history();
+ QWebHistory* history = page->history();
QString result;
result.append(QLatin1String("\n============== Back Forward List ==============\n"));
@@ -653,12 +899,13 @@ static const char *methodNameStringForFailedTest(LayoutTestController *controlle
void DumpRenderTree::dump()
{
- // Prevent any further frame load callbacks from appearing after we dump the result.
- qt_dump_frame_loader(false);
+ // Prevent any further frame load or resource load callbacks from appearing after we dump the result.
+ DumpRenderTreeSupportQt::dumpFrameLoader(false);
+ DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(false);
QWebFrame *mainFrame = m_page->mainFrame();
- if (isSingleFileMode()) {
+ if (isStandAloneMode()) {
QString markup = mainFrame->toHtml();
fprintf(stdout, "Source:\n\n%s\n", markup.toUtf8().constData());
}
@@ -667,14 +914,21 @@ void DumpRenderTree::dump()
QString resultString;
if (m_controller->shouldDumpAsText())
resultString = dumpFramesAsText(mainFrame);
- else
+ else {
resultString = mainFrame->renderTreeDump();
-
+ resultString += dumpFrameScrollPosition(mainFrame);
+ }
if (!resultString.isEmpty()) {
+ fprintf(stdout, "Content-Type: text/plain\n");
fprintf(stdout, "%s", resultString.toUtf8().constData());
- if (m_controller->shouldDumpBackForwardList())
- fprintf(stdout, "%s", dumpBackForwardList().toUtf8().constData());
+ if (m_controller->shouldDumpBackForwardList()) {
+ fprintf(stdout, "%s", dumpBackForwardList(webPage()).toUtf8().constData());
+ foreach (QObject* widget, windows) {
+ QWebPage* page = qobject_cast<QWebPage*>(widget->findChild<QWebPage*>());
+ fprintf(stdout, "%s", dumpBackForwardList(page).toUtf8().constData());
+ }
+ }
} else
printf("ERROR: nil result from %s", methodNameStringForFailedTest(m_controller));
@@ -683,6 +937,7 @@ void DumpRenderTree::dump()
fputs("#EOF\n", stdout);
fputs("#EOF\n", stderr);
+ // FIXME: All other ports don't dump pixels, if generatePixelResults is false.
if (m_dumpPixels) {
QImage image(m_page->viewportSize(), QImage::Format_ARGB32);
image.fill(Qt::white);
@@ -738,10 +993,7 @@ void DumpRenderTree::dump()
fflush(stdout);
fflush(stderr);
- if (isSingleFileMode())
- emit quit();
- else
- emit ready();
+ emit ready();
}
void DumpRenderTree::titleChanged(const QString &s)
@@ -798,6 +1050,11 @@ QWebPage *DumpRenderTree::createWindow()
connectFrame(page->mainFrame());
connect(page, SIGNAL(loadFinished(bool)), m_controller, SLOT(maybeDump(bool)));
connect(page, SIGNAL(windowCloseRequested()), this, SLOT(windowCloseRequested()));
+
+ // Use a frame group name for all pages created by DumpRenderTree to allow
+ // testing of cross-page frame lookup.
+ DumpRenderTreeSupportQt::webPageSetGroupName(page, "org.webkit.qt.DumpRenderTree");
+
return page;
}
@@ -806,6 +1063,9 @@ void DumpRenderTree::windowCloseRequested()
QWebPage* page = qobject_cast<QWebPage*>(sender());
QObject* container = page->parent();
windows.removeAll(container);
+ // Our use of container->deleteLater() means we need to remove closed pages
+ // from the org.webkit.qt.DumpRenderTree group explicitly.
+ DumpRenderTreeSupportQt::webPageSetGroupName(page, "");
container->deleteLater();
}
@@ -815,10 +1075,21 @@ int DumpRenderTree::windowCount() const
return windows.count() + 1;
}
+void DumpRenderTree::geolocationPermissionSet()
+{
+ m_page->permissionSet(QWebPage::GeolocationPermissionDomain);
+}
+
void DumpRenderTree::switchFocus(bool focused)
{
QFocusEvent event((focused) ? QEvent::FocusIn : QEvent::FocusOut, Qt::ActiveWindowFocusReason);
- QApplication::sendEvent(m_mainView, &event);
+ if (!isGraphicsBased())
+ QApplication::sendEvent(m_mainView, &event);
+ else {
+ if (WebViewGraphicsBased* view = qobject_cast<WebViewGraphicsBased*>(m_mainView))
+ view->scene()->sendEvent(view->graphicsView(), &event);
+ }
+
}
#if defined(Q_WS_X11)
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
index 00d7ae4..0382f96 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
@@ -40,6 +40,9 @@
#include <QSslError>
#endif
+#include "../../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
+#include <qgraphicsview.h>
+#include <qgraphicswebview.h>
#include <qwebframe.h>
#include <qwebinspector.h>
#include <qwebpage.h>
@@ -53,13 +56,16 @@ QT_END_NAMESPACE
class QWebFrame;
class LayoutTestController;
+class DumpRenderTreeSupportQt;
class EventSender;
class TextInputController;
class GCController;
+class PlainTextController;
namespace WebCore {
class WebPage;
+class NetworkAccessManager;
class DumpRenderTree : public QObject {
Q_OBJECT
@@ -74,8 +80,8 @@ public:
void setTextOutputEnabled(bool enable) { m_enableTextOutput = enable; }
bool isTextOutputEnabled() { return m_enableTextOutput; }
- void setSingleFileMode(bool flag) { m_singleFileMode = flag; }
- bool isSingleFileMode() { return m_singleFileMode; }
+ void setGraphicsBased(bool flag) { m_graphicsBased = flag; }
+ bool isGraphicsBased() { return m_graphicsBased; }
void setDumpPixels(bool);
@@ -85,6 +91,8 @@ public:
LayoutTestController *layoutTestController() const { return m_controller; }
EventSender *eventSender() const { return m_eventSender; }
TextInputController *textInputController() const { return m_textInputController; }
+ QString persistentStoragePath() const { return m_persistentStoragePath; }
+ NetworkAccessManager *networkAccessManager() const { return m_networkAccessManager; }
QWebPage *createWindow();
int windowCount() const;
@@ -93,10 +101,10 @@ public:
WebPage *webPage() const { return m_page; }
-
#if defined(Q_WS_X11)
static void initializeFonts();
#endif
+ void processArgsLine(const QStringList&);
public Q_SLOTS:
void initJSObjects();
@@ -118,27 +126,39 @@ Q_SIGNALS:
private Q_SLOTS:
void showPage();
void hidePage();
+ void dryRunPrint(QWebFrame*);
+ void loadNextTestInStandAloneMode();
+ void geolocationPermissionSet();
private:
+ void setStandAloneMode(bool flag) { m_standAloneMode = flag; }
+ bool isStandAloneMode() { return m_standAloneMode; }
+
QString dumpFramesAsText(QWebFrame* frame);
- QString dumpBackForwardList();
+ QString dumpBackForwardList(QWebPage* page);
+ QString dumpFrameScrollPosition(QWebFrame* frame);
LayoutTestController *m_controller;
bool m_dumpPixels;
QString m_expectedHash;
+ QStringList m_standAloneModeTestList;
WebPage *m_page;
- QWebView* m_mainView;
+ QWidget* m_mainView;
EventSender *m_eventSender;
TextInputController *m_textInputController;
GCController* m_gcController;
+ PlainTextController* m_plainTextController;
+ NetworkAccessManager* m_networkAccessManager;
QFile *m_stdin;
QList<QObject*> windows;
bool m_enableTextOutput;
- bool m_singleFileMode;
+ bool m_standAloneMode;
+ bool m_graphicsBased;
+ QString m_persistentStoragePath;
};
class NetworkAccessManager : public QNetworkAccessManager {
@@ -158,6 +178,7 @@ public:
WebPage(QObject* parent, DumpRenderTree*);
virtual ~WebPage();
QWebInspector* webInspector();
+ void closeWebInspector();
QWebPage *createWindow(QWebPage::WebWindowType);
@@ -173,25 +194,38 @@ public:
QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&);
+ void permissionSet(QWebPage::PermissionDomain domain);
+
public slots:
bool shouldInterruptJavaScript() { return false; }
+ void requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
+ void cancelPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
protected:
bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type);
bool isTextOutputEnabled() { return m_drt->isTextOutputEnabled(); }
private slots:
- void setViewGeometry(const QRect &r)
- {
- QWidget *v = view();
- if (v)
- v->setGeometry(r);
- }
+ void setViewGeometry(const QRect&);
+
private:
QWebInspector* m_webInspector;
+ QList<QWebFrame*> m_pendingGeolocationRequests;
DumpRenderTree *m_drt;
};
+class WebViewGraphicsBased : public QGraphicsView {
+ Q_OBJECT
+
+public:
+ WebViewGraphicsBased(QWidget* parent);
+ QGraphicsWebView* graphicsView() const { return m_item; }
+ void setPage(QWebPage* page) { m_item->setPage(page); }
+
+private:
+ QGraphicsWebView* m_item;
+};
+
}
#endif
diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
index 73a9934..6fb75a5 100644
--- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
@@ -29,8 +29,7 @@
#include "config.h"
#include "EventSenderQt.h"
-//#include <QtDebug>
-
+#include <QGraphicsSceneMouseEvent>
#include <QtTest/QtTest>
#define KEYCODE_DEL 127
@@ -67,7 +66,12 @@ EventSender::EventSender(QWebPage* parent)
endOfQueue = 0;
startOfQueue = 0;
m_eventLoop = 0;
+ m_currentButton = 0;
+ resetClickCount();
m_page->view()->installEventFilter(this);
+ // So that we can match Scrollbar::pixelsPerLineStep() in WheelEventQt.cpp and
+ // pass fast/events/platform-wheelevent-in-scrolling-div.html
+ QApplication::setWheelScrollLines(2);
}
void EventSender::mouseDown(int button)
@@ -92,11 +96,34 @@ void EventSender::mouseDown(int button)
break;
}
+ // only consider a click to count, an event originated by the
+ // same previous button and at the same position.
+ if (m_currentButton == button
+ && m_mousePos == m_clickPos
+ && m_clickTimer.isActive())
+ m_clickCount++;
+ else
+ m_clickCount = 1;
+
+ m_currentButton = button;
+ m_clickPos = m_mousePos;
m_mouseButtons |= mouseButton;
// qDebug() << "EventSender::mouseDown" << frame;
- QMouseEvent* event = new QMouseEvent(QEvent::MouseButtonPress, m_mousePos, m_mousePos, mouseButton, m_mouseButtons, Qt::NoModifier);
+ QEvent* event;
+ if (isGraphicsBased()) {
+ event = createGraphicsSceneMouseEvent((m_clickCount == 2) ?
+ QEvent::GraphicsSceneMouseDoubleClick : QEvent::GraphicsSceneMousePress,
+ m_mousePos, m_mousePos, mouseButton, m_mouseButtons, Qt::NoModifier);
+ } else {
+ event = new QMouseEvent((m_clickCount == 2) ? QEvent::MouseButtonDblClick :
+ QEvent::MouseButtonPress, m_mousePos, m_mousePos,
+ mouseButton, m_mouseButtons, Qt::NoModifier);
+ }
+
sendOrQueueEvent(event);
+
+ m_clickTimer.start(QApplication::doubleClickInterval(), this);
}
void EventSender::mouseUp(int button)
@@ -124,7 +151,15 @@ void EventSender::mouseUp(int button)
m_mouseButtons &= ~mouseButton;
// qDebug() << "EventSender::mouseUp" << frame;
- QMouseEvent* event = new QMouseEvent(QEvent::MouseButtonRelease, m_mousePos, m_mousePos, mouseButton, m_mouseButtons, Qt::NoModifier);
+ QEvent* event;
+ if (isGraphicsBased()) {
+ event = createGraphicsSceneMouseEvent(QEvent::GraphicsSceneMouseRelease,
+ m_mousePos, m_mousePos, mouseButton, m_mouseButtons, Qt::NoModifier);
+ } else {
+ event = new QMouseEvent(QEvent::MouseButtonRelease,
+ m_mousePos, m_mousePos, mouseButton, m_mouseButtons, Qt::NoModifier);
+ }
+
sendOrQueueEvent(event);
}
@@ -132,10 +167,52 @@ void EventSender::mouseMoveTo(int x, int y)
{
// qDebug() << "EventSender::mouseMoveTo" << x << y;
m_mousePos = QPoint(x, y);
- QMouseEvent* event = new QMouseEvent(QEvent::MouseMove, m_mousePos, m_mousePos, Qt::NoButton, m_mouseButtons, Qt::NoModifier);
+
+ QEvent* event;
+ if (isGraphicsBased()) {
+ event = createGraphicsSceneMouseEvent(QEvent::GraphicsSceneMouseMove,
+ m_mousePos, m_mousePos, Qt::NoButton, m_mouseButtons, Qt::NoModifier);
+ } else {
+ event = new QMouseEvent(QEvent::MouseMove,
+ m_mousePos, m_mousePos, Qt::NoButton, m_mouseButtons, Qt::NoModifier);
+ }
+
sendOrQueueEvent(event);
}
+#ifndef QT_NO_WHEELEVENT
+void EventSender::mouseScrollBy(int x, int y)
+{
+ continuousMouseScrollBy((x*120), (y*120));
+}
+
+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) {
+ 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) {
+ 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);
+ }
+}
+#endif
+
void EventSender::leapForward(int ms)
{
eventQueue[endOfQueue].m_delay = ms;
@@ -177,9 +254,18 @@ void EventSender::keyDown(const QString& string, const QStringList& modifiers, u
modifs = Qt::ControlModifier;
s = QString();
} else if (code == 'o' && modifs == Qt::ControlModifier) {
+ // Mimic the emacs ctrl-o binding on Mac by inserting a paragraph
+ // separator and then putting the cursor back to its original
+ // position. Allows us to pass emacs-ctrl-o.html
s = QLatin1String("\n");
code = '\n';
modifs = 0;
+ QKeyEvent event(QEvent::KeyPress, code, modifs, s);
+ sendEvent(m_page, &event);
+ QKeyEvent event2(QEvent::KeyRelease, code, modifs, s);
+ sendEvent(m_page, &event2);
+ s = QString();
+ code = Qt::Key_Left;
} else if (code == 'y' && modifs == Qt::ControlModifier) {
s = QLatin1String("c");
code = 'c';
@@ -257,59 +343,76 @@ void EventSender::keyDown(const QString& string, const QStringList& modifiers, u
} else if (string == QLatin1String("end")) {
s = QString();
code = Qt::Key_End;
+ } else if (string == QLatin1String("insert")) {
+ s = QString();
+ code = Qt::Key_Insert;
} else if (string == QLatin1String("delete")) {
s = QString();
code = Qt::Key_Delete;
+ } else if (string == QLatin1String("printScreen")) {
+ s = QString();
+ code = Qt::Key_Print;
}
}
QKeyEvent event(QEvent::KeyPress, code, modifs, s);
- QApplication::sendEvent(m_page, &event);
+ sendEvent(m_page, &event);
QKeyEvent event2(QEvent::KeyRelease, code, modifs, s);
- QApplication::sendEvent(m_page, &event2);
+ sendEvent(m_page, &event2);
}
void EventSender::contextClick()
{
QMouseEvent event(QEvent::MouseButtonPress, m_mousePos, Qt::RightButton, Qt::RightButton, Qt::NoModifier);
- QApplication::sendEvent(m_page, &event);
+ sendEvent(m_page, &event);
QMouseEvent event2(QEvent::MouseButtonRelease, m_mousePos, Qt::RightButton, Qt::RightButton, Qt::NoModifier);
- QApplication::sendEvent(m_page, &event2);
+ sendEvent(m_page, &event2);
+
+ 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()
{
QMouseEvent* event = new QMouseEvent(QEvent::MouseButtonPress, m_mousePos, Qt::LeftButton, Qt::RightButton, Qt::NoModifier);
- QApplication::postEvent(m_page, event);
+ postEvent(m_page, event);
QMouseEvent* event2 = new QMouseEvent(QEvent::MouseButtonRelease, m_mousePos, Qt::LeftButton, Qt::RightButton, Qt::NoModifier);
- QApplication::postEvent(m_page, event2);
+ postEvent(m_page, event2);
}
void EventSender::addTouchPoint(int x, int y)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- int id = m_touchPoints.count();
+ // Use index to refer to the position in the vector that this touch
+ // is stored. We then create a unique id for the touch that will be
+ // passed into WebCore.
+ int index = m_touchPoints.count();
+ int id = m_touchPoints.isEmpty() ? 0 : m_touchPoints.last().id() + 1;
QTouchEvent::TouchPoint point(id);
m_touchPoints.append(point);
- updateTouchPoint(id, x, y);
- m_touchPoints[id].setState(Qt::TouchPointPressed);
-#endif
+ updateTouchPoint(index, x, y);
+ m_touchPoints[index].setState(Qt::TouchPointPressed);
}
void EventSender::updateTouchPoint(int index, int x, int y)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (index < 0 || index >= m_touchPoints.count())
return;
QTouchEvent::TouchPoint &p = m_touchPoints[index];
p.setPos(QPointF(x, y));
p.setState(Qt::TouchPointMoved);
-#endif
}
void EventSender::setTouchModifier(const QString &modifier, bool enable)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
Qt::KeyboardModifier mod = Qt::NoModifier;
if (!modifier.compare(QLatin1String("shift"), Qt::CaseInsensitive))
mod = Qt::ShiftModifier;
@@ -324,30 +427,24 @@ void EventSender::setTouchModifier(const QString &modifier, bool enable)
m_touchModifiers |= mod;
else
m_touchModifiers &= ~mod;
-#endif
}
void EventSender::touchStart()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (!m_touchActive) {
sendTouchEvent(QEvent::TouchBegin);
m_touchActive = true;
} else
sendTouchEvent(QEvent::TouchUpdate);
-#endif
}
void EventSender::touchMove()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
sendTouchEvent(QEvent::TouchUpdate);
-#endif
}
void EventSender::touchEnd()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
for (int i = 0; i < m_touchPoints.count(); ++i)
if (m_touchPoints[i].state() != Qt::TouchPointReleased) {
sendTouchEvent(QEvent::TouchUpdate);
@@ -355,34 +452,28 @@ void EventSender::touchEnd()
}
sendTouchEvent(QEvent::TouchEnd);
m_touchActive = false;
-#endif
}
void EventSender::clearTouchPoints()
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
m_touchPoints.clear();
m_touchModifiers = Qt::KeyboardModifiers();
m_touchActive = false;
-#endif
}
void EventSender::releaseTouchPoint(int index)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
if (index < 0 || index >= m_touchPoints.count())
return;
m_touchPoints[index].setState(Qt::TouchPointReleased);
-#endif
}
void EventSender::sendTouchEvent(QEvent::Type type)
{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
QTouchEvent event(type, QTouchEvent::TouchScreen, m_touchModifiers);
event.setTouchPoints(m_touchPoints);
- QApplication::sendEvent(m_page, &event);
+ sendEvent(m_page, &event);
QList<QTouchEvent::TouchPoint>::Iterator it = m_touchPoints.begin();
while (it != m_touchPoints.end()) {
if (it->state() == Qt::TouchPointReleased)
@@ -392,23 +483,32 @@ void EventSender::sendTouchEvent(QEvent::Type type)
++it;
}
}
-#endif
}
void EventSender::zoomPageIn()
{
- QWebFrame* frame = m_page->mainFrame();
- if (frame)
+ if (QWebFrame* frame = m_page->mainFrame())
frame->setZoomFactor(frame->zoomFactor() * ZOOM_STEP);
}
void EventSender::zoomPageOut()
{
- QWebFrame* frame = m_page->mainFrame();
- if (frame)
+ if (QWebFrame* frame = m_page->mainFrame())
frame->setZoomFactor(frame->zoomFactor() / ZOOM_STEP);
}
+void EventSender::textZoomIn()
+{
+ if (QWebFrame* frame = m_page->mainFrame())
+ frame->setTextSizeMultiplier(frame->textSizeMultiplier() * ZOOM_STEP);
+}
+
+void EventSender::textZoomOut()
+{
+ if (QWebFrame* frame = m_page->mainFrame())
+ frame->setTextSizeMultiplier(frame->textSizeMultiplier() / ZOOM_STEP);
+}
+
QWebFrame* EventSender::frameUnderMouse() const
{
QWebFrame* frame = m_page->mainFrame();
@@ -434,7 +534,7 @@ void EventSender::sendOrQueueEvent(QEvent* event)
// 3. A call to mouseMoveTo while the mouse button is pressed could initiate a drag operation, and that does not return until mouseUp is processed.
// To be safe and avoid a deadlock, this event is queued.
if (endOfQueue == startOfQueue && !eventQueue[endOfQueue].m_delay && (!(m_mouseButtonPressed && (m_eventLoop && event->type() == QEvent::MouseButtonRelease)))) {
- QApplication::sendEvent(m_page->view(), event);
+ sendEvent(m_page->view(), event);
delete event;
return;
}
@@ -449,7 +549,7 @@ void EventSender::replaySavedEvents(bool flush)
// First send all the events that are ready to be sent
while (!eventQueue[startOfQueue].m_delay && startOfQueue < endOfQueue) {
QEvent* ev = eventQueue[startOfQueue++].m_event;
- QApplication::postEvent(m_page->view(), ev); // ev deleted by the system
+ postEvent(m_page->view(), ev);
}
if (startOfQueue == endOfQueue) {
// Reset the queue
@@ -482,13 +582,16 @@ bool EventSender::eventFilter(QObject* watched, QEvent* event)
case QEvent::Leave:
return true;
case QEvent::MouseButtonPress:
+ case QEvent::GraphicsSceneMousePress:
m_mouseButtonPressed = true;
break;
case QEvent::MouseMove:
+ case QEvent::GraphicsSceneMouseMove:
if (m_mouseButtonPressed)
m_drag = true;
break;
case QEvent::MouseButtonRelease:
+ case QEvent::GraphicsSceneMouseRelease:
m_mouseButtonPressed = false;
m_drag = false;
break;
@@ -498,3 +601,53 @@ bool EventSender::eventFilter(QObject* watched, QEvent* event)
}
return false;
}
+
+void EventSender::timerEvent(QTimerEvent* ev)
+{
+ m_clickTimer.stop();
+}
+
+QGraphicsSceneMouseEvent* EventSender::createGraphicsSceneMouseEvent(QEvent::Type type, const QPoint& pos, const QPoint& screenPos, Qt::MouseButton button, Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers)
+{
+ QGraphicsSceneMouseEvent* event;
+ event = new QGraphicsSceneMouseEvent(type);
+ event->setPos(pos);
+ event->setScreenPos(screenPos);
+ event->setButton(button);
+ event->setButtons(buttons);
+ event->setModifiers(modifiers);
+
+ 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))
+ view->scene()->sendEvent(view->graphicsView(), event);
+ else
+ QApplication::sendEvent(receiver, event);
+}
+
+void EventSender::postEvent(QObject* receiver, QEvent* event)
+{
+ // QGraphicsScene does not have a postEvent method, so send the event in this case
+ // and delete it after that.
+ if (WebCore::WebViewGraphicsBased* view = qobject_cast<WebCore::WebViewGraphicsBased*>(receiver)) {
+ view->scene()->sendEvent(view->graphicsView(), event);
+ delete event;
+ } else
+ QApplication::postEvent(receiver, event); // event deleted by the system
+}
diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
index f6cfc7c..4ba8382 100644
--- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
+++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
@@ -29,7 +29,11 @@
#ifndef EventSenderQt_h
#define EventSenderQt_h
+
+#include "DumpRenderTreeQt.h"
+
#include <QApplication>
+#include <QBasicTimer>
#include <QEvent>
#include <QEventLoop>
#include <QMouseEvent>
@@ -37,24 +41,27 @@
#include <QPoint>
#include <QString>
#include <QStringList>
+#include <QTouchEvent>
#include <qwebpage.h>
#include <qwebframe.h>
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-#include <QTouchEvent>
-#endif
class EventSender : public QObject {
Q_OBJECT
public:
EventSender(QWebPage* parent);
virtual bool eventFilter(QObject* watched, QEvent* event);
+ void resetClickCount() { m_clickCount = 0; }
public slots:
void mouseDown(int button = 0);
void mouseUp(int button = 0);
void mouseMoveTo(int x, int y);
+#ifndef QT_NO_WHEELEVENT
+ void mouseScrollBy(int x, int y);
+ void continuousMouseScrollBy(int x, int y);
+#endif
void leapForward(int ms);
void keyDown(const QString& string, const QStringList& modifiers = QStringList(), unsigned int location = 0);
void clearKillRing() {}
@@ -68,25 +75,38 @@ public slots:
void touchEnd();
void zoomPageIn();
void zoomPageOut();
+ void textZoomIn();
+ void textZoomOut();
void clearTouchPoints();
void releaseTouchPoint(int index);
+protected:
+ void timerEvent(QTimerEvent*);
+
+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);
+ void postEvent(QObject* receiver, QEvent* event);
+
private:
void sendTouchEvent(QEvent::Type);
void sendOrQueueEvent(QEvent*);
void replaySavedEvents(bool flush);
QPoint m_mousePos;
+ QPoint m_clickPos;
Qt::MouseButtons m_mouseButtons;
QWebPage* m_page;
- int m_timeLeap;
+ int m_clickCount;
+ int m_currentButton;
bool m_mouseButtonPressed;
bool m_drag;
QEventLoop* m_eventLoop;
QWebFrame* frameUnderMouse() const;
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
+ QBasicTimer m_clickTimer;
QList<QTouchEvent::TouchPoint> m_touchPoints;
Qt::KeyboardModifiers m_touchModifiers;
bool m_touchActive;
-#endif
};
#endif // EventSenderQt_h
diff --git a/WebKitTools/DumpRenderTree/qt/GCControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/GCControllerQt.cpp
index 9cc3aa7..3aa507f 100644
--- a/WebKitTools/DumpRenderTree/qt/GCControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/GCControllerQt.cpp
@@ -29,14 +29,10 @@
#include "config.h"
#include "GCControllerQt.h"
+#include "../../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
#include <qwebpage.h>
-extern int qt_drt_javaScriptObjectsCount();
-extern void qt_drt_garbageCollector_collect();
-
-extern void qt_drt_garbageCollector_collectOnAlternateThread(bool waitUntilDone);
-
GCController::GCController(QWebPage* parent)
: QObject(parent)
{
@@ -44,15 +40,15 @@ GCController::GCController(QWebPage* parent)
void GCController::collect() const
{
- qt_drt_garbageCollector_collect();
+ DumpRenderTreeSupportQt::garbageCollectorCollect();
}
void GCController::collectOnAlternateThread(bool waitUntilDone) const
{
- qt_drt_garbageCollector_collectOnAlternateThread(waitUntilDone);
+ DumpRenderTreeSupportQt::garbageCollectorCollectOnAlternateThread(waitUntilDone);
}
-size_t GCController::getJSObjectCount() const
+unsigned int GCController::getJSObjectCount() const
{
- return qt_drt_javaScriptObjectsCount();
+ return DumpRenderTreeSupportQt::javaScriptObjectsCount();
}
diff --git a/WebKitTools/DumpRenderTree/qt/GCControllerQt.h b/WebKitTools/DumpRenderTree/qt/GCControllerQt.h
index 8f5b432..d3c83b9 100644
--- a/WebKitTools/DumpRenderTree/qt/GCControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/GCControllerQt.h
@@ -32,6 +32,7 @@
#include <QObject>
class QWebPage;
+class DumpRenderTreeSupportQt;
class GCController : public QObject
{
@@ -42,7 +43,8 @@ public:
public slots:
void collect() const;
void collectOnAlternateThread(bool waitUntilDone) const;
- size_t getJSObjectCount() const;
+ unsigned int getJSObjectCount() const;
+
};
#endif
diff --git a/WebKitTools/DumpRenderTree/qt/ImageDiff.cpp b/WebKitTools/DumpRenderTree/qt/ImageDiff.cpp
index 704ca13..9282e2f 100644
--- a/WebKitTools/DumpRenderTree/qt/ImageDiff.cpp
+++ b/WebKitTools/DumpRenderTree/qt/ImageDiff.cpp
@@ -17,13 +17,14 @@
Boston, MA 02110-1301, USA.
*/
+#include <QtCore/qmath.h>
+
#include <QApplication>
#include <QBuffer>
#include <QByteArray>
#include <QImage>
#include <QStringList>
-#include <math.h>
#include <stdio.h>
int main(int argc, char* argv[])
@@ -102,7 +103,7 @@ int main(int argc, char* argv[])
qreal green = (qGreen(pixel) - qGreen(basePixel)) / static_cast<float>(qMax(255 - qGreen(basePixel), qGreen(basePixel)));
qreal blue = (qBlue(pixel) - qBlue(basePixel)) / static_cast<float>(qMax(255 - qBlue(basePixel), qBlue(basePixel)));
qreal alpha = (qAlpha(pixel) - qAlpha(basePixel)) / static_cast<float>(qMax(255 - qAlpha(basePixel), qAlpha(basePixel)));
- qreal distance = sqrt(red * red + green * green + blue * blue + alpha * alpha) / 2.0f;
+ qreal distance = qSqrt(red * red + green * green + blue * blue + alpha * alpha) / 2.0f;
int gray = distance * qreal(255);
diffImage.setPixel(x, y, qRgb(gray, gray, gray));
if (distance >= 1 / qreal(255)) {
@@ -118,7 +119,7 @@ int main(int argc, char* argv[])
if (difference <= tolerance) {
difference = 0;
} else {
- difference = round(difference * 100) / 100;
+ difference = qRound(difference * 100) / 100;
difference = qMax(difference, qreal(0.01));
}
@@ -131,7 +132,10 @@ int main(int argc, char* argv[])
buffer.close();
const QByteArray &data = buffer.data();
printf("Content-Length: %lu\n", static_cast<unsigned long>(data.length()));
- fwrite(data.constData(), 1, data.length(), stdout);
+
+ // We have to use the return value of fwrite to avoid "ignoring return value" gcc warning
+ // See https://bugs.webkit.org/show_bug.cgi?id=45384 for details.
+ if (fwrite(data.constData(), 1, data.length(), stdout)) {}
fprintf(stdout, "diff: %01.2f%% failed\n", difference);
}
diff --git a/WebKitTools/DumpRenderTree/qt/ImageDiff.pro b/WebKitTools/DumpRenderTree/qt/ImageDiff.pro
index 636835a..74fabf8 100644
--- a/WebKitTools/DumpRenderTree/qt/ImageDiff.pro
+++ b/WebKitTools/DumpRenderTree/qt/ImageDiff.pro
@@ -1,9 +1,10 @@
TARGET = ImageDiff
CONFIG -= app_bundle
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
include(../../../WebKit.pri)
INCLUDEPATH += ../../../JavaScriptCore
-DESTDIR = ../../../bin
+DESTDIR = $$OUTPUT_DIR/bin
QT = core gui
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index 51c1181..7135a1a 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -28,6 +28,7 @@
*/
#include "config.h"
#include "LayoutTestControllerQt.h"
+#include "../../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
#include "DumpRenderTreeQt.h"
#include "WorkQueue.h"
@@ -36,27 +37,13 @@
#include <QLocale>
#include <qwebsettings.h>
-extern void qt_dump_editing_callbacks(bool b);
-extern void qt_dump_frame_loader(bool b);
-extern void qt_dump_resource_load_callbacks(bool b);
-extern void qt_drt_setFrameSetFlatteningEnabled(QWebPage*, bool);
-extern void qt_drt_setJavaScriptProfilingEnabled(QWebFrame*, bool enabled);
-extern bool qt_drt_pauseAnimation(QWebFrame*, const QString& name, double time, const QString& elementId);
-extern bool qt_drt_pauseTransitionOfProperty(QWebFrame*, const QString& name, double time, const QString& elementId);
-extern bool qt_drt_pauseSVGAnimation(QWebFrame*, const QString& animationId, double time, const QString& elementId);
-extern int qt_drt_numberOfActiveAnimations(QWebFrame*);
-extern void qt_drt_setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme);
-
-extern void qt_drt_whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
-extern QString qt_drt_counterValueForElementById(QWebFrame* qFrame, const QString& id);
-extern int qt_drt_workerThreadCount();
-extern int qt_drt_pageNumberForElementById(QWebFrame* qFrame, const QString& id, float width, float height);
-
LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt)
: QObject()
, m_drt(drt)
{
+ qRegisterMetaType<QWebElement>("QWebElement");
reset();
+ DumpRenderTreeSupportQt::dumpNotification(true);
}
void LayoutTestController::reset()
@@ -66,6 +53,7 @@ void LayoutTestController::reset()
m_textDump = false;
m_dumpBackForwardList = false;
m_dumpChildrenAsText = false;
+ m_dumpChildFrameScrollPositions = false;
m_canOpenWindows = false;
m_waitForDone = false;
m_dumpTitleChanges = false;
@@ -77,9 +65,28 @@ void LayoutTestController::reset()
m_handleErrorPages = false;
m_webHistory = 0;
m_globalFlag = false;
- qt_dump_editing_callbacks(false);
- qt_dump_frame_loader(false);
- qt_dump_resource_load_callbacks(false);
+ m_userStyleSheetEnabled = false;
+ m_desktopNotificationAllowedOrigins.clear();
+ m_ignoreDesktopNotification = false;
+ m_isGeolocationPermissionSet = false;
+ m_isPrinting = false;
+ m_geolocationPermission = false;
+
+ DumpRenderTreeSupportQt::dumpEditingCallbacks(false);
+ DumpRenderTreeSupportQt::dumpFrameLoader(false);
+ DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(false);
+ DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(false);
+ DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(false);
+ DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(true);
+ DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(false);
+ DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(false);
+ DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(QStringList());
+ DumpRenderTreeSupportQt::clearScriptWorlds();
+ DumpRenderTreeSupportQt::setCustomPolicyDelegate(false, false);
+ DumpRenderTreeSupportQt::dumpHistoryCallbacks(false);
+ DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(false);
+ setIconDatabaseEnabled(false);
+
emit hidePage();
}
@@ -131,12 +138,17 @@ void LayoutTestController::waitUntilDone()
{
//qDebug() << ">>>>waitForDone";
m_waitForDone = true;
- m_timeoutTimer.start(15000, this);
+ m_timeoutTimer.start(30000, this);
}
QString LayoutTestController::counterValueForElementById(const QString& id)
{
- return qt_drt_counterValueForElementById(m_drt->webPage()->mainFrame(), id);
+ return DumpRenderTreeSupportQt::counterValueForElementById(m_drt->webPage()->mainFrame(), id);
+}
+
+void LayoutTestController::setViewModeMediaFeature(const QString& mode)
+{
+ m_drt->webPage()->setProperty("_q_viewMode", mode);
}
int LayoutTestController::webHistoryItemCount()
@@ -183,6 +195,28 @@ int LayoutTestController::windowCount()
return m_drt->windowCount();
}
+void LayoutTestController::grantDesktopNotificationPermission(const QString& origin)
+{
+ QWebFrame* frame = m_drt->webPage()->mainFrame();
+ m_drt->webPage()->setUserPermission(frame, QWebPage::NotificationsPermissionDomain, QWebPage::PermissionGranted);
+ m_desktopNotificationAllowedOrigins.append(origin);
+}
+
+void LayoutTestController::ignoreDesktopNotificationPermissionRequests()
+{
+ m_ignoreDesktopNotification = true;
+}
+
+bool LayoutTestController::checkDesktopNotificationPermission(const QString& origin)
+{
+ return !m_ignoreDesktopNotification && m_desktopNotificationAllowedOrigins.contains(origin);
+}
+
+void LayoutTestController::simulateDesktopNotificationClick(const QString& title)
+{
+ DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title);
+}
+
void LayoutTestController::display()
{
emit showPage();
@@ -199,32 +233,75 @@ QString LayoutTestController::pathToLocalResource(const QString& url)
return QDir::toNativeSeparators(url);
}
+void LayoutTestController::dumpConfigurationForViewport(int availableWidth, int availableHeight)
+{
+ QString res = DumpRenderTreeSupportQt::viewportAsText(m_drt->webPage(), QSize(availableWidth, availableHeight));
+ fputs(qPrintable(res), stdout);
+}
+
void LayoutTestController::dumpEditingCallbacks()
{
qDebug() << ">>>dumpEditingCallbacks";
- qt_dump_editing_callbacks(true);
+ DumpRenderTreeSupportQt::dumpEditingCallbacks(true);
}
void LayoutTestController::dumpFrameLoadCallbacks()
{
- qt_dump_frame_loader(true);
+ DumpRenderTreeSupportQt::dumpFrameLoader(true);
+}
+
+void LayoutTestController::dumpUserGestureInFrameLoadCallbacks()
+{
+ DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(true);
}
void LayoutTestController::dumpResourceLoadCallbacks()
{
- qt_dump_resource_load_callbacks(true);
+ DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(true);
+}
+
+void LayoutTestController::dumpResourceResponseMIMETypes()
+{
+ DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(true);
+}
+
+void LayoutTestController::dumpHistoryCallbacks()
+{
+ DumpRenderTreeSupportQt::dumpHistoryCallbacks(true);
+}
+
+void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(bool enabled)
+{
+ DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(enabled);
+}
+
+void LayoutTestController::setWillSendRequestReturnsNull(bool enabled)
+{
+ DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(enabled);
+}
+
+void LayoutTestController::setWillSendRequestClearHeader(const QStringList& headers)
+{
+ DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(headers);
+}
+
+void LayoutTestController::setDeferMainResourceDataLoad(bool defer)
+{
+ DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(defer);
}
void LayoutTestController::queueBackNavigation(int howFarBackward)
{
//qDebug() << ">>>queueBackNavigation" << howFarBackward;
- WorkQueue::shared()->queue(new BackItem(howFarBackward, m_drt->webPage()));
+ for (int i = 0; i != howFarBackward; ++i)
+ WorkQueue::shared()->queue(new BackItem(1, m_drt->webPage()));
}
void LayoutTestController::queueForwardNavigation(int howFarForward)
{
//qDebug() << ">>>queueForwardNavigation" << howFarForward;
- WorkQueue::shared()->queue(new ForwardItem(howFarForward, m_drt->webPage()));
+ for (int i = 0; i != howFarForward; ++i)
+ WorkQueue::shared()->queue(new ForwardItem(1, m_drt->webPage()));
}
void LayoutTestController::queueLoad(const QString& url, const QString& target)
@@ -235,6 +312,11 @@ void LayoutTestController::queueLoad(const QString& url, const QString& target)
WorkQueue::shared()->queue(new LoadItem(absoluteUrl, target, m_drt->webPage()));
}
+void LayoutTestController::queueLoadHTMLString(const QString& content, const QString& baseURL)
+{
+ WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL, m_drt->webPage()));
+}
+
void LayoutTestController::queueReload()
{
//qDebug() << ">>>queueReload";
@@ -285,20 +367,36 @@ QString LayoutTestController::decodeHostName(const QString& host)
return decoded;
}
+void LayoutTestController::setMediaType(const QString& type)
+{
+ DumpRenderTreeSupportQt::setMediaType(m_drt->webPage()->mainFrame(), type);
+}
+
+void LayoutTestController::closeWebInspector()
+{
+ DumpRenderTreeSupportQt::webInspectorClose(m_drt->webPage());
+ m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false);
+}
+
+void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
+{
+ m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, enabled);
+}
+
void LayoutTestController::showWebInspector()
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
- m_drt->webPage()->webInspector()->show();
+ DumpRenderTreeSupportQt::webInspectorShow(m_drt->webPage());
}
-void LayoutTestController::hideWebInspector()
+void LayoutTestController::evaluateInWebInspector(long callId, const QString& script)
{
- m_drt->webPage()->webInspector()->hide();
+ DumpRenderTreeSupportQt::webInspectorExecuteScript(m_drt->webPage(), callId, script);
}
-void LayoutTestController::setFrameSetFlatteningEnabled(bool enabled)
+void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
{
- qt_drt_setFrameSetFlatteningEnabled(m_drt->webPage(), enabled);
+ DumpRenderTreeSupportQt::setFrameFlatteningEnabled(m_drt->webPage(), enabled);
}
void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
@@ -306,10 +404,25 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, enabled);
}
+void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+{
+ m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, enabled);
+}
+
+void LayoutTestController::setAppCacheMaximumSize(unsigned long long quota)
+{
+ m_drt->webPage()->settings()->setOfflineWebApplicationCacheQuota(quota);
+}
+
void LayoutTestController::setJavaScriptProfilingEnabled(bool enable)
{
- m_topLoadingFrame->page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
- qt_drt_setJavaScriptProfilingEnabled(m_topLoadingFrame, enable);
+ setDeveloperExtrasEnabled(enable);
+ DumpRenderTreeSupportQt::setJavaScriptProfilingEnabled(m_topLoadingFrame, enable);
+}
+
+void LayoutTestController::setTimelineProfilingEnabled(bool enable)
+{
+ DumpRenderTreeSupportQt::setTimelineProfilingEnabled(m_drt->webPage(), enable);
}
void LayoutTestController::setFixedContentsSize(int width, int height)
@@ -322,11 +435,21 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool enable)
m_drt->webPage()->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, enable);
}
+void LayoutTestController::setSpatialNavigationEnabled(bool enable)
+{
+ m_drt->webPage()->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, enable);
+}
+
void LayoutTestController::setPopupBlockingEnabled(bool enable)
{
m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, !enable);
}
+void LayoutTestController::setPluginsEnabled(bool flag)
+{
+ // FIXME: Implement
+}
+
void LayoutTestController::setPOSIXLocale(const QString& locale)
{
QLocale qlocale(locale);
@@ -343,14 +466,19 @@ void LayoutTestController::setMainFrameIsFirstResponder(bool isFirst)
//FIXME: only need this for the moment: https://bugs.webkit.org/show_bug.cgi?id=32990
}
+void LayoutTestController::setJavaScriptCanAccessClipboard(bool enable)
+{
+ m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, enable);
+}
+
void LayoutTestController::setXSSAuditorEnabled(bool enable)
{
- // Set XSSAuditorEnabled globally so that windows created by the test inherit it too.
+ // Set XSSAuditingEnabled globally so that windows created by the test inherit it too.
// resetSettings() will call this to reset the page and global setting to false again.
// Needed by http/tests/security/xssAuditor/link-opens-new-window.html
QWebSettings* globalSettings = QWebSettings::globalSettings();
- globalSettings->setAttribute(QWebSettings::XSSAuditorEnabled, enable);
- m_drt->webPage()->settings()->setAttribute(QWebSettings::XSSAuditorEnabled, enable);
+ globalSettings->setAttribute(QWebSettings::XSSAuditingEnabled, enable);
+ m_drt->webPage()->settings()->setAttribute(QWebSettings::XSSAuditingEnabled, enable);
}
bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& animationName,
@@ -359,7 +487,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& an
{
QWebFrame* frame = m_drt->webPage()->mainFrame();
Q_ASSERT(frame);
- return qt_drt_pauseAnimation(frame, animationName, time, elementId);
+ return DumpRenderTreeSupportQt::pauseAnimation(frame, animationName, time, elementId);
}
bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& propertyName,
@@ -368,7 +496,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& p
{
QWebFrame* frame = m_drt->webPage()->mainFrame();
Q_ASSERT(frame);
- return qt_drt_pauseTransitionOfProperty(frame, propertyName, time, elementId);
+ return DumpRenderTreeSupportQt::pauseTransitionOfProperty(frame, propertyName, time, elementId);
}
bool LayoutTestController::sampleSVGAnimationForElementAtTime(const QString& animationId,
@@ -377,20 +505,33 @@ bool LayoutTestController::sampleSVGAnimationForElementAtTime(const QString& ani
{
QWebFrame* frame = m_drt->webPage()->mainFrame();
Q_ASSERT(frame);
- return qt_drt_pauseSVGAnimation(frame, animationId, time, elementId);
+ return DumpRenderTreeSupportQt::pauseSVGAnimation(frame, animationId, time, elementId);
}
unsigned LayoutTestController::numberOfActiveAnimations() const
{
QWebFrame* frame = m_drt->webPage()->mainFrame();
Q_ASSERT(frame);
- return qt_drt_numberOfActiveAnimations(frame);
+ return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame);
+}
+
+void LayoutTestController::suspendAnimations() const
+{
+ QWebFrame* frame = m_drt->webPage()->mainFrame();
+ Q_ASSERT(frame);
+ DumpRenderTreeSupportQt::suspendAnimations(frame);
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ QWebFrame* frame = m_drt->webPage()->mainFrame();
+ Q_ASSERT(frame);
+ DumpRenderTreeSupportQt::resumeAnimations(frame);
}
void LayoutTestController::disableImageLoading()
{
- // FIXME: Implement for testing fix for https://bugs.webkit.org/show_bug.cgi?id=27896
- // Also need to make sure image loading is re-enabled for each new test.
+ m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false);
}
void LayoutTestController::dispatchPendingLoadRequests()
@@ -398,6 +539,16 @@ void LayoutTestController::dispatchPendingLoadRequests()
// FIXME: Implement for testing fix for 6727495
}
+void LayoutTestController::clearAllApplicationCaches()
+{
+ // FIXME: implement to support Application Cache quotas.
+}
+
+void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+{
+ // FIXME: implement to support Application Cache quotas.
+}
+
void LayoutTestController::setDatabaseQuota(int size)
{
if (!m_topLoadingFrame)
@@ -410,9 +561,19 @@ void LayoutTestController::clearAllDatabases()
QWebDatabase::removeAllDatabases();
}
-void LayoutTestController::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+void LayoutTestController::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
{
- qt_drt_whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
+ DumpRenderTreeSupportQt::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
+}
+
+void LayoutTestController::removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
+{
+ DumpRenderTreeSupportQt::removeWhiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains);
+}
+
+void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive)
+{
+ DumpRenderTreeSupportQt::setCustomPolicyDelegate(enabled, permissive);
}
void LayoutTestController::waitForPolicyDelegate()
@@ -435,6 +596,14 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian
settings->setFontSize(QWebSettings::DefaultFontSize, value.toInt());
else if (name == "WebKitUsesPageCachePreferenceKey")
QWebSettings::setMaximumPagesInCache(value.toInt());
+ else if (name == "WebKitEnableCaretBrowsing")
+ setCaretBrowsingEnabled(value.toBool());
+ else if (name == "WebKitPluginsEnabled")
+ settings->setAttribute(QWebSettings::PluginsEnabled, value.toBool());
+ else if (name == "WebKitWebGLEnabled")
+ settings->setAttribute(QWebSettings::WebGLEnabled, value.toBool());
+ else if (name == "WebKitHyperlinkAuditingEnabled")
+ settings->setAttribute(QWebSettings::HyperlinkAuditingEnabled, value.toBool());
else
printf("ERROR: LayoutTestController::overridePreference() does not support the '%s' preference\n",
name.toLatin1().data());
@@ -443,10 +612,20 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian
void LayoutTestController::setUserStyleSheetLocation(const QString& url)
{
m_userStyleSheetLocation = QUrl(url);
+
+ if (m_userStyleSheetEnabled)
+ setUserStyleSheetEnabled(true);
+}
+
+void LayoutTestController::setCaretBrowsingEnabled(bool value)
+{
+ DumpRenderTreeSupportQt::setCaretBrowsingEnabled(m_drt->webPage(), value);
}
void LayoutTestController::setUserStyleSheetEnabled(bool enabled)
{
+ m_userStyleSheetEnabled = enabled;
+
if (enabled)
m_drt->webPage()->settings()->setUserStyleSheetUrl(m_userStyleSheetLocation);
else
@@ -455,12 +634,12 @@ void LayoutTestController::setUserStyleSheetEnabled(bool enabled)
void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme)
{
- qt_drt_setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
+ DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme);
}
int LayoutTestController::workerThreadCount()
{
- return qt_drt_workerThreadCount();
+ return DumpRenderTreeSupportQt::workerThreadCount();
}
int LayoutTestController::pageNumberForElementById(const QString& id, float width, float height)
@@ -471,5 +650,173 @@ int LayoutTestController::pageNumberForElementById(const QString& id, float widt
height = m_drt->webPage()->viewportSize().height();
}
- return qt_drt_pageNumberForElementById(m_drt->webPage()->mainFrame(), id, width, height);
+ return DumpRenderTreeSupportQt::pageNumberForElementById(m_drt->webPage()->mainFrame(), id, width, height);
+}
+
+int LayoutTestController::numberOfPages(float width, float height)
+{
+ return DumpRenderTreeSupportQt::numberOfPages(m_drt->webPage()->mainFrame(), width, height);
+}
+
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+ return DumpRenderTreeSupportQt::shouldClose(m_drt->webPage()->mainFrame());
+}
+
+void LayoutTestController::setScrollbarPolicy(const QString& orientation, const QString& policy)
+{
+ Qt::Orientation o;
+ Qt::ScrollBarPolicy p;
+
+ if (orientation == "vertical")
+ o = Qt::Vertical;
+ else if (orientation == "horizontal")
+ o = Qt::Horizontal;
+ else
+ return;
+
+ if (policy == "on")
+ p = Qt::ScrollBarAlwaysOn;
+ else if (policy == "auto")
+ p = Qt::ScrollBarAsNeeded;
+ else if (policy == "off")
+ p = Qt::ScrollBarAlwaysOff;
+ else
+ return;
+
+ m_drt->webPage()->mainFrame()->setScrollBarPolicy(o, p);
+}
+
+void LayoutTestController::setSmartInsertDeleteEnabled(bool enable)
+{
+ DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled(m_drt->webPage(), enable);
+}
+
+void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool enable)
+{
+ DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled(m_drt->webPage(), enable);
+}
+
+void LayoutTestController::execCommand(const QString& name, const QString& value)
+{
+ DumpRenderTreeSupportQt::executeCoreCommandByName(m_drt->webPage(), name, value);
+}
+
+bool LayoutTestController::isCommandEnabled(const QString& name) const
+{
+ return DumpRenderTreeSupportQt::isCommandEnabled(m_drt->webPage(), name);
+}
+
+QString LayoutTestController::markerTextForListItem(const QWebElement& listItem)
+{
+ return DumpRenderTreeSupportQt::markerTextForListItem(listItem);
+}
+
+QVariantMap LayoutTestController::computedStyleIncludingVisitedInfo(const QWebElement& element) const
+{
+ return DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(element);
+}
+
+bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const QString& elementId)
+{
+ return DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(m_drt->webPage()->mainFrame(), elementId);
+}
+
+void LayoutTestController::authenticateSession(const QString&, const QString&, const QString&)
+{
+ // FIXME: If there is a concept per-session (per-process) credential storage, the credentials should be added to it for later use.
+}
+
+void LayoutTestController::setIconDatabaseEnabled(bool enable)
+{
+ if (enable && !m_drt->persistentStoragePath().isEmpty())
+ QWebSettings::setIconDatabasePath(m_drt->persistentStoragePath());
+ else
+ QWebSettings::setIconDatabasePath(QString());
+}
+
+void LayoutTestController::setEditingBehavior(const QString& editingBehavior)
+{
+ DumpRenderTreeSupportQt::setEditingBehavior(m_drt->webPage(), editingBehavior);
+}
+
+void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+ // FIXME: Implement for DeviceOrientation layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=30335.
+}
+
+void LayoutTestController::setGeolocationPermission(bool allow)
+{
+ setGeolocationPermissionCommon(allow);
+ emit geolocationPermissionSet();
+}
+
+void LayoutTestController::setGeolocationPermissionCommon(bool allow)
+{
+ m_isGeolocationPermissionSet = true;
+ m_geolocationPermission = allow;
+}
+
+void LayoutTestController::setMockGeolocationError(int code, const QString& message)
+{
+ DumpRenderTreeSupportQt::setMockGeolocationError(code, message);
+}
+
+void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
+{
+ DumpRenderTreeSupportQt::setMockGeolocationPosition(latitude, longitude, accuracy);
+}
+
+void LayoutTestController::setMockSpeechInputResult(const QString& result, const QString& language)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
}
+
+void LayoutTestController::evaluateScriptInIsolatedWorld(int worldID, const QString& script)
+{
+ DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(m_drt->webPage()->mainFrame(), worldID, script);
+}
+
+bool LayoutTestController::isPageBoxVisible(int pageIndex)
+{
+ return DumpRenderTreeSupportQt::isPageBoxVisible(m_drt->webPage()->mainFrame(), pageIndex);
+}
+
+QString LayoutTestController::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft)
+{
+ return DumpRenderTreeSupportQt::pageSizeAndMarginsInPixels(m_drt->webPage()->mainFrame(), pageIndex,
+ width, height, marginTop, marginRight, marginBottom, marginLeft);
+}
+
+QString LayoutTestController::pageProperty(const QString& propertyName, int pageNumber)
+{
+ return DumpRenderTreeSupportQt::pageProperty(m_drt->webPage()->mainFrame(), propertyName, pageNumber);
+}
+
+void LayoutTestController::addUserStyleSheet(const QString& sourceCode)
+{
+ DumpRenderTreeSupportQt::addUserStyleSheet(m_drt->webPage(), sourceCode);
+}
+
+void LayoutTestController::removeAllVisitedLinks()
+{
+ QWebHistory* history = m_drt->webPage()->history();
+ history->clear();
+ DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(true);
+}
+
+bool LayoutTestController::hasSpellingMarker(int, int)
+{
+ // FIXME: Implement.
+ return false;
+}
+
+QVariantList LayoutTestController::nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ return DumpRenderTreeSupportQt::nodesFromRect(document, x, y, top, right, bottom, left, ignoreClipping);
+}
+
+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 64cbcc9..5c17624 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -40,12 +40,14 @@
#include <QVariant>
#include <qwebdatabase.h>
+#include <qwebelement.h>
#include <qwebframe.h>
#include <qwebhistory.h>
#include <qwebpage.h>
#include <qwebsecurityorigin.h>
class QWebFrame;
+class DumpRenderTreeSupportQt;
namespace WebCore {
class DumpRenderTree;
}
@@ -60,6 +62,7 @@ public:
bool shouldDumpAsText() const { return m_textDump; }
bool shouldDumpBackForwardList() const { return m_dumpBackForwardList; }
bool shouldDumpChildrenAsText() const { return m_dumpChildrenAsText; }
+ bool shouldDumpChildFrameScrollPositions() const { return m_dumpChildFrameScrollPositions; }
bool shouldDumpDatabaseCallbacks() const { return m_dumpDatabaseCallbacks; }
bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
bool shouldWaitUntilDone() const { return m_waitForDone; }
@@ -67,9 +70,14 @@ public:
bool canOpenWindows() const { return m_canOpenWindows; }
bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; }
bool waitForPolicy() const { return m_waitForPolicy; }
+ bool ignoreReqestForPermission() const { return m_ignoreDesktopNotification; }
+ bool isPrinting() { return m_isPrinting; }
void reset();
+ static const unsigned int maxViewWidth;
+ static const unsigned int maxViewHeight;
+
protected:
void timerEvent(QTimerEvent*);
@@ -78,14 +86,17 @@ signals:
void showPage();
void hidePage();
+ void geolocationPermissionSet();
public slots:
void maybeDump(bool ok);
void dumpAsText() { m_textDump = true; }
void dumpChildFramesAsText() { m_dumpChildrenAsText = true; }
+ void dumpChildFrameScrollPositions() { m_dumpChildFrameScrollPositions = true; }
void dumpDatabaseCallbacks() { m_dumpDatabaseCallbacks = true; }
void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; }
void setCanOpenWindows() { m_canOpenWindows = true; }
+ void setPrinting() { m_isPrinting = true; }
void waitUntilDone();
QString counterValueForElementById(const QString& id);
int webHistoryItemCount();
@@ -97,16 +108,28 @@ public slots:
void handleErrorPages() { m_handleErrorPages = true; }
void dumpEditingCallbacks();
void dumpFrameLoadCallbacks();
+ void dumpUserGestureInFrameLoadCallbacks();
void dumpResourceLoadCallbacks();
+ void dumpResourceResponseMIMETypes();
+ void dumpHistoryCallbacks();
+ void dumpConfigurationForViewport(int availableWidth, int availableHeight);
+ void setWillSendRequestReturnsNullOnRedirect(bool enabled);
+ void setWillSendRequestReturnsNull(bool enabled);
+ void setWillSendRequestClearHeader(const QStringList& headers);
void queueBackNavigation(int howFarBackward);
void queueForwardNavigation(int howFarForward);
void queueLoad(const QString& url, const QString& target = QString());
+ void queueLoadHTMLString(const QString& content, const QString& baseURL = QString());
void queueReload();
void queueLoadingScript(const QString& script);
void queueNonLoadingScript(const QString& script);
void provisionalLoad();
void setCloseRemainingWindowsWhenComplete(bool = false) {}
int windowCount();
+ void grantDesktopNotificationPermission(const QString& origin);
+ void ignoreDesktopNotificationPermissionRequests();
+ bool checkDesktopNotificationPermission(const QString& origin);
+ void simulateDesktopNotificationClick(const QString& title);
void display();
void clearBackForwardList();
QString pathToLocalResource(const QString& url);
@@ -114,51 +137,127 @@ public slots:
QString encodeHostName(const QString& host);
QString decodeHostName(const QString& host);
void dumpSelectionRect() const {}
+ void setDeveloperExtrasEnabled(bool);
void showWebInspector();
- void hideWebInspector();
+ void closeWebInspector();
+ void evaluateInWebInspector(long callId, const QString& script);
+ void removeAllVisitedLinks();
- void setFrameSetFlatteningEnabled(bool enable);
+ void setMediaType(const QString& type);
+ void setFrameFlatteningEnabled(bool enable);
void setAllowUniversalAccessFromFileURLs(bool enable);
+ void setAllowFileAccessFromFileURLs(bool enable);
+ void setAppCacheMaximumSize(unsigned long long quota);
void setJavaScriptProfilingEnabled(bool enable);
+ void setTimelineProfilingEnabled(bool enable);
void setFixedContentsSize(int width, int height);
void setPrivateBrowsingEnabled(bool enable);
+ void setSpatialNavigationEnabled(bool enabled);
+ void setPluginsEnabled(bool flag);
void setPopupBlockingEnabled(bool enable);
void setPOSIXLocale(const QString& locale);
void resetLoadFinished() { m_loadFinished = false; }
void setWindowIsKey(bool isKey);
void setMainFrameIsFirstResponder(bool isFirst);
+ void setDeferMainResourceDataLoad(bool);
+ void setJavaScriptCanAccessClipboard(bool enable);
void setXSSAuditorEnabled(bool enable);
+ void setCaretBrowsingEnabled(bool enable);
+ void setViewModeMediaFeature(const QString& mode);
+ void setSmartInsertDeleteEnabled(bool enable);
+ void setSelectTrailingWhitespaceEnabled(bool enable);
+ void execCommand(const QString& name, const QString& value = QString());
+ bool isCommandEnabled(const QString& name) const;
bool pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId);
bool pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId);
bool sampleSVGAnimationForElementAtTime(const QString& animationId, double time, const QString& elementId);
+ bool elementDoesAutoCompleteForElementWithId(const QString& elementId);
unsigned numberOfActiveAnimations() const;
+ void suspendAnimations() const;
+ void resumeAnimations() const;
- void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
+ void addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
+ void removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
void dispatchPendingLoadRequests();
void disableImageLoading();
+ void clearAllApplicationCaches();
+ void setApplicationCacheOriginQuota(unsigned long long quota);
+
void setDatabaseQuota(int size);
void clearAllDatabases();
+ void setIconDatabaseEnabled(bool enable);
+ void setCustomPolicyDelegate(bool enabled, bool permissive = true);
void waitForPolicyDelegate();
+
void overridePreference(const QString& name, const QVariant& value);
void setUserStyleSheetLocation(const QString& url);
void setUserStyleSheetEnabled(bool enabled);
void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme);
int workerThreadCount();
int pageNumberForElementById(const QString& id, float width = 0, float height = 0);
+ int numberOfPages(float width = maxViewWidth, float height = maxViewHeight);
+ bool callShouldCloseOnWebView();
+ // 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 setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
+
+ void setMockGeolocationError(int code, const QString& message);
+ void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
+ void setGeolocationPermission(bool allow);
+ bool isGeolocationPermissionSet() const { return m_isGeolocationPermissionSet; }
+ bool geolocationPermission() const { return m_geolocationPermission; }
+
+ void setMockSpeechInputResult(const QString& result, const QString& language);
+
+ // Empty stub method to keep parity with object model exposed by global LayoutTestController.
+ void abortModal() {}
+ bool hasSpellingMarker(int from, int length);
+
+ QVariantList nodesFromRect(const QWebElement& document, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping);
+
+ /*
+ Policy values: 'on', 'auto' or 'off'.
+ Orientation values: 'vertical' or 'horizontal'.
+ */
+ void setScrollbarPolicy(const QString& orientation, const QString& policy);
+
+ QString markerTextForListItem(const QWebElement& listItem);
+ QVariantMap computedStyleIncludingVisitedInfo(const QWebElement& element) const;
+
+ // Simulate a request an embedding application could make, populating per-session credential storage.
+ void authenticateSession(const QString& url, const QString& username, const QString& password);
+
+ void setEditingBehavior(const QString& editingBehavior);
+
+ void evaluateScriptInIsolatedWorld(int worldID, const QString& script);
+ bool isPageBoxVisible(int pageIndex);
+ QString pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
+ QString pageProperty(const QString& propertyName, int pageNumber);
+ void addUserStyleSheet(const QString& sourceCode);
private slots:
void processWork();
private:
+ void setGeolocationPermissionCommon(bool allow);
+
+private:
bool m_hasDumped;
bool m_textDump;
bool m_dumpBackForwardList;
bool m_dumpChildrenAsText;
+ bool m_dumpChildFrameScrollPositions;
bool m_canOpenWindows;
bool m_waitForDone;
bool m_dumpTitleChanges;
@@ -168,12 +267,18 @@ private:
bool m_handleErrorPages;
bool m_loadFinished;
bool m_globalFlag;
+ bool m_userStyleSheetEnabled;
+ bool m_isGeolocationPermissionSet;
+ bool m_isPrinting;
+ bool m_geolocationPermission;
QUrl m_userStyleSheetLocation;
QBasicTimer m_timeoutTimer;
QWebFrame* m_topLoadingFrame;
WebCore::DumpRenderTree* m_drt;
QWebHistory* m_webHistory;
+ QStringList m_desktopNotificationAllowedOrigins;
+ bool m_ignoreDesktopNotification;
};
#endif // LayoutTestControllerQt_h
diff --git a/WebKitTools/DumpRenderTree/qt/PlainTextControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/PlainTextControllerQt.cpp
new file mode 100644
index 0000000..441a37c
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/qt/PlainTextControllerQt.cpp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h"
+#include "PlainTextControllerQt.h"
+
+#include "../../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
+#include <QApplication>
+#include <QInputMethodEvent>
+#include <QKeyEvent>
+
+PlainTextController::PlainTextController(QWebPage* parent)
+ : QObject(parent)
+{
+}
+
+QString PlainTextController::plainText(const QVariant& range)
+{
+ return DumpRenderTreeSupportQt::plainText(range);
+}
diff --git a/WebKitTools/DumpRenderTree/qt/PlainTextControllerQt.h b/WebKitTools/DumpRenderTree/qt/PlainTextControllerQt.h
new file mode 100644
index 0000000..e78e110
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/qt/PlainTextControllerQt.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 PlainTextControllerQt_h
+#define PlainTextControllerQt_h
+
+#include <QList>
+#include <QObject>
+#include <QString>
+#include <QVariant>
+
+#include "qwebpage.h"
+
+class PlainTextController : public QObject {
+ Q_OBJECT
+public:
+ PlainTextController(QWebPage* parent);
+
+public slots:
+ QString plainText(const QVariant& range);
+};
+
+#endif // PlainTextControllerQt_h
diff --git a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
index 7b8162b..1d460d7 100644
--- a/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
+++ b/WebKitTools/DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro
@@ -1,7 +1,8 @@
TEMPLATE = lib
TARGET = TestNetscapePlugIn
-VPATH = ../../unix/TestNetscapePlugin ../../TestNetscapePlugIn.subproj
+VPATH = ../../unix/TestNetscapePlugin ../../TestNetscapePlugIn
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
include(../../../../WebKit.pri)
DESTDIR = $$OUTPUT_DIR/lib/plugins
@@ -9,7 +10,7 @@ DESTDIR = $$OUTPUT_DIR/lib/plugins
mac {
CONFIG += plugin
CONFIG += plugin_bundle
- QMAKE_INFO_PLIST = ../../TestNetscapePlugIn.subproj/Info.plist
+ QMAKE_INFO_PLIST = ../../TestNetscapePlugIn/mac/Info.plist
QMAKE_PLUGIN_BUNDLE_NAME = $$TARGET
QMAKE_BUNDLE_LOCATION += "Contents/MacOS"
@@ -22,14 +23,23 @@ INCLUDEPATH += ../../../../JavaScriptCore \
../../unix/TestNetscapePlugin/ForwardingHeaders/WebKit \
../../../../WebCore \
../../../../WebCore/bridge \
- ../../TestNetscapePlugIn.subproj
+ ../../TestNetscapePlugIn
SOURCES = PluginObject.cpp \
- TestObject.cpp
+ PluginTest.cpp \
+ TestObject.cpp \
+ Tests/DocumentOpenInDestroyStream.cpp \
+ Tests/EvaluateJSAfterRemovingPluginElement.cpp \
+ Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \
+ Tests/NPRuntimeRemoveProperty.cpp \
+ Tests/NullNPPGetValuePointer.cpp \
+ Tests/PassDifferentNPPStruct.cpp \
+ Tests/PluginScriptableNPObjectInvokeDefault.cpp
mac {
- SOURCES += ../../TestNetscapePlugIn.subproj/main.cpp
- LIBS += -framework Carbon
+ SOURCES += ../../TestNetscapePlugIn/main.cpp
+ OBJECTIVE_SOURCES += PluginObjectMac.mm
+ LIBS += -framework Carbon -framework Cocoa -framework QuartzCore
} else {
SOURCES += ../../unix/TestNetscapePlugin/TestNetscapePlugin.cpp
}
diff --git a/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp
index 7b8f120..08d8850 100644
--- a/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.cpp
@@ -28,8 +28,10 @@
*/
#include "config.h"
#include "TextInputControllerQt.h"
+#include "../../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
#include <QApplication>
+#include <QInputMethodEvent>
#include <QKeyEvent>
TextInputController::TextInputController(QWebPage* parent)
@@ -127,3 +129,30 @@ void TextInputController::doCommand(const QString& command)
QKeyEvent event2(QEvent::KeyRelease, keycode, modifiers);
QApplication::sendEvent(parent(), &event2);
}
+
+void TextInputController::setMarkedText(const QString& string, int start, int end)
+{
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent::Attribute selection(QInputMethodEvent::Selection, start, end, QVariant());
+ attributes << selection;
+ QInputMethodEvent event(string, attributes);
+ QApplication::sendEvent(parent(), &event);
+}
+
+void TextInputController::insertText(const QString& string)
+{
+ QList<QInputMethodEvent::Attribute> attributes;
+ QInputMethodEvent event(string, attributes);
+ event.setCommitString(string);
+ QApplication::sendEvent(parent(), &event);
+}
+
+QVariantList TextInputController::selectedRange()
+{
+ return DumpRenderTreeSupportQt::selectedRange(qobject_cast<QWebPage*>(parent()));
+}
+
+QVariantList TextInputController::firstRectForCharacterRange(int location, int length)
+{
+ return DumpRenderTreeSupportQt::firstRectForCharacterRange(qobject_cast<QWebPage*>(parent()), location, length);
+}
diff --git a/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.h b/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.h
index 7c7433e..0210984 100644
--- a/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/TextInputControllerQt.h
@@ -31,6 +31,7 @@
#include <QList>
#include <QObject>
+#include <QVariant>
#include <QString>
#include "qwebpage.h"
@@ -41,14 +42,14 @@ public:
public slots:
void doCommand(const QString& command);
-// void setMarkedText(const QString& str, int from, int length);
+ void setMarkedText(const QString& string, int start, int end);
// bool hasMarkedText();
// void unmarkText();
// QList<int> markedRange();
-// QList<int> selectedRange();
+ QVariantList selectedRange();
// void validAttributesForMarkedText();
-// void inserText(const QString&);
-// void firstRectForCharacterRange();
+ void insertText(const QString& string);
+ QVariantList firstRectForCharacterRange(int location, int length);
// void characterIndexForPoint(int, int);
// void substringFromRange(int, int);
// void conversationIdentifier();
diff --git a/WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.cpp b/WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.cpp
index 067e6aa..d1baf08 100644
--- a/WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.cpp
@@ -60,6 +60,18 @@ bool LoadItem::invoke() const
return true;
}
+bool LoadHTMLStringItem::invoke() const
+{
+ Q_ASSERT(m_webPage);
+
+ QWebFrame* frame = m_webPage->mainFrame();
+ if (!frame)
+ return false;
+
+ frame->setHtml(m_content, QUrl(m_baseURL));
+ return true;
+}
+
bool ReloadItem::invoke() const
{
//qDebug() << ">>>ReloadItem::invoke";
diff --git a/WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.h b/WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.h
index 94da5e1..97c9b04 100644
--- a/WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.h
+++ b/WebKitTools/DumpRenderTree/qt/WorkQueueItemQt.h
@@ -64,6 +64,22 @@ private:
QString m_target;
};
+class LoadHTMLStringItem : public WorkQueueItem {
+public:
+ LoadHTMLStringItem(const QString& content, const QString &baseURL, QWebPage *page)
+ : WorkQueueItem(page)
+ , m_content(content)
+ , m_baseURL(baseURL)
+ {
+ }
+
+private:
+ virtual bool invoke() const;
+
+ QString m_content;
+ QString m_baseURL;
+};
+
class ReloadItem : public WorkQueueItem {
public:
ReloadItem(QWebPage *page)
diff --git a/WebKitTools/DumpRenderTree/qt/main.cpp b/WebKitTools/DumpRenderTree/qt/main.cpp
index efcda57..8349d73 100644
--- a/WebKitTools/DumpRenderTree/qt/main.cpp
+++ b/WebKitTools/DumpRenderTree/qt/main.cpp
@@ -37,9 +37,7 @@
#include <qdir.h>
#include <qdebug.h>
#include <qfont.h>
-#include <qwebsettings.h>
#include <qwebdatabase.h>
-#include <qdesktopservices.h>
#include <qtimer.h>
#include <qwindowsstyle.h>
@@ -95,7 +93,7 @@ QString get_backtrace() {
return s;
}
-#ifndef Q_OS_WIN
+#if HAVE(SIGNAL_H)
static NO_RETURN void crashHandler(int sig)
{
fprintf(stderr, "%s\n", strsignal(sig));
@@ -116,10 +114,7 @@ int main(int argc, char* argv[])
WebCore::DumpRenderTree::initializeFonts();
#endif
-#if QT_VERSION >= 0x040500
QApplication::setGraphicsSystem("raster");
-#endif
-
QApplication::setStyle(new QWindowsStyle);
QFont f("Sans Serif");
@@ -134,7 +129,7 @@ int main(int argc, char* argv[])
QX11Info::setAppDpiX(0, 96);
#endif
-#ifndef Q_OS_WIN
+#if HAVE(SIGNAL_H)
signal(SIGILL, crashHandler); /* 4: illegal instruction (not reset when caught) */
signal(SIGTRAP, crashHandler); /* 5: trace trap (not reset when caught) */
signal(SIGFPE, crashHandler); /* 8: floating point exception */
@@ -148,7 +143,8 @@ int main(int argc, char* argv[])
QStringList args = app.arguments();
if (args.count() < 2) {
- qDebug() << "Usage: DumpRenderTree [-v|--pixel-tests] filename";
+ qDebug() << "Usage: DumpRenderTree [-v|--pixel-tests] filename [filename2..n]";
+ qDebug() << "Or folder containing test files: DumpRenderTree [-v|--pixel-tests] dirpath";
exit(0);
}
@@ -161,22 +157,13 @@ int main(int argc, char* argv[])
if (args.contains(QLatin1String("--pixel-tests")))
dumper.setDumpPixels(true);
- QString dbDir = QDesktopServices::storageLocation(QDesktopServices::DataLocation) + QDir::separator() + "qtwebkitdrt";
- QWebSettings::setOfflineStoragePath(dbDir);
QWebDatabase::removeAllDatabases();
if (args.contains(QLatin1String("-"))) {
QObject::connect(&dumper, SIGNAL(ready()), &dumper, SLOT(readLine()), Qt::QueuedConnection);
QTimer::singleShot(0, &dumper, SLOT(readLine()));
- } else {
- dumper.setSingleFileMode(true);
- for (int i = 1; i < args.size(); ++i) {
- if (!args.at(i).startsWith('-')) {
- dumper.processLine(args.at(i));
- break;
- }
- }
- }
+ } else
+ dumper.processArgsLine(args);
return app.exec();
diff --git a/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
index cb01267..755fba0 100644
--- a/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
+++ b/WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "PluginObject.h"
+#include "PluginTest.h"
#include "npapi.h"
#include "npruntime.h"
@@ -37,7 +38,10 @@
#include <string.h>
#include <stdlib.h>
#include <X11/Xlib.h>
+#include <string>
+using namespace std;
+
extern "C" {
NPError NP_Initialize (NPNetscapeFuncs *aMozillaVTable, NPPluginFuncs *aPluginVTable);
NPError NP_Shutdown(void);
@@ -58,9 +62,14 @@ webkit_test_plugin_new_instance(NPMIMEType /*mimetype*/,
{
if (browser->version >= 14) {
PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass());
+ instance->pdata = obj;
+
+ string testIdentifier;
for (int i = 0; i < argc; i++) {
- if (strcasecmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad)
+ if (strcasecmp(argn[i], "test") == 0)
+ testIdentifier = argv[i];
+ else if (strcasecmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad)
obj->onStreamLoad = strdup(argv[i]);
else if (strcasecmp(argn[i], "onStreamDestroy") == 0 && !obj->onStreamDestroy)
obj->onStreamDestroy = strdup(argv[i]);
@@ -81,19 +90,22 @@ webkit_test_plugin_new_instance(NPMIMEType /*mimetype*/,
executeScript(obj, "document.body.innerHTML = ''");
else if (!strcasecmp(argn[i], "ondestroy"))
obj->onDestroy = strdup(argv[i]);
- else if (strcasecmp(argn[i], "testdocumentopenindestroystream") == 0)
- obj->testDocumentOpenInDestroyStream = TRUE;
else if (strcasecmp(argn[i], "testwindowopen") == 0)
obj->testWindowOpen = TRUE;
+ else if (strcasecmp(argn[i], "onSetWindow") == 0 && !obj->onSetWindow)
+ obj->onSetWindow = strdup(argv[i]);
}
- instance->pdata = obj;
+
+ browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode);
+
+ obj->pluginTest = PluginTest::create(instance, testIdentifier);
}
return NPERR_NO_ERROR;
}
static NPError
-webkit_test_plugin_destroy_instance(NPP instance, NPSavedData** /*save*/)
+webkit_test_plugin_destroy_instance(NPP instance, NPSavedData** save)
{
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
if (obj) {
@@ -114,6 +126,11 @@ webkit_test_plugin_destroy_instance(NPP instance, NPSavedData** /*save*/)
if (obj->logDestroy)
pluginLog(instance, "NPP_Destroy");
+ if (obj->onSetWindow)
+ free(obj->onSetWindow);
+
+ obj->pluginTest->NPP_Destroy(save);
+
browser->releaseobject(&obj->header);
}
@@ -126,10 +143,14 @@ webkit_test_plugin_set_window(NPP instance, NPWindow *window)
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
if (obj) {
+ obj->lastWindow = *window;
+
if (obj->logSetWindow) {
pluginLog(instance, "NPP_SetWindow: %d %d", (int)window->width, (int)window->height);
obj->logSetWindow = false;
}
+ if (obj->onSetWindow)
+ executeScript(obj, obj->onSetWindow);
if (obj->testWindowOpen) {
testWindowOpen(instance);
@@ -138,7 +159,7 @@ webkit_test_plugin_set_window(NPP instance, NPWindow *window)
}
- return NPERR_NO_ERROR;
+ return obj->pluginTest->NPP_SetWindow(instance, window);
}
static void executeScript(const PluginObject* obj, const char* script)
@@ -160,11 +181,11 @@ webkit_test_plugin_new_stream(NPP instance,
NPMIMEType /*type*/,
NPStream *stream,
NPBool /*seekable*/,
- uint16* stype)
+ uint16_t* stype)
{
PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
obj->stream = stream;
- *stype = NP_ASFILEONLY;
+ *stype = NP_NORMAL;
if (obj->returnErrorFromNewStream)
return NPERR_GENERIC_ERROR;
@@ -179,19 +200,34 @@ webkit_test_plugin_new_stream(NPP instance,
}
static NPError
-webkit_test_plugin_destroy_stream(NPP instance, NPStream* /*stream*/, NPError /*reason*/)
+webkit_test_plugin_destroy_stream(NPP instance, NPStream* stream, NPError reason)
{
PluginObject* obj = (PluginObject*)instance->pdata;
- if (obj->onStreamDestroy)
- executeScript(obj, obj->onStreamDestroy);
-
- if (obj->testDocumentOpenInDestroyStream) {
- testDocumentOpen(instance);
- obj->testDocumentOpenInDestroyStream = FALSE;
+ if (obj->onStreamDestroy) {
+ NPObject* windowObject = 0;
+ NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject);
+
+ if (error == NPERR_NO_ERROR) {
+ NPVariant onStreamDestroyVariant;
+ if (browser->getproperty(instance, windowObject, browser->getstringidentifier(obj->onStreamDestroy), &onStreamDestroyVariant)) {
+ if (NPVARIANT_IS_OBJECT(onStreamDestroyVariant)) {
+ NPObject* onStreamDestroyFunction = NPVARIANT_TO_OBJECT(onStreamDestroyVariant);
+
+ NPVariant reasonVariant;
+ INT32_TO_NPVARIANT(reason, reasonVariant);
+
+ NPVariant result;
+ browser->invokeDefault(instance, onStreamDestroyFunction, &reasonVariant, 1, &result);
+ browser->releasevariantvalue(&result);
+ }
+ browser->releasevariantvalue(&onStreamDestroyVariant);
+ }
+ browser->releaseobject(windowObject);
+ }
}
- return NPERR_NO_ERROR;
+ return obj->pluginTest->NPP_DestroyStream(stream, reason);
}
static void
@@ -199,20 +235,25 @@ webkit_test_plugin_stream_as_file(NPP /*instance*/, NPStream* /*stream*/, const
{
}
-static int32
+static int32_t
webkit_test_plugin_write_ready(NPP /*instance*/, NPStream* /*stream*/)
{
- return 0;
+ return 4096;
}
-static int32
-webkit_test_plugin_write(NPP /*instance*/,
+static int32_t
+webkit_test_plugin_write(NPP instance,
NPStream* /*stream*/,
int32_t /*offset*/,
- int32_t /*len*/,
+ int32_t len,
void* /*buffer*/)
{
- return 0;
+ PluginObject* obj = (PluginObject*)instance->pdata;
+
+ if (obj->returnNegativeOneFromWrite)
+ return -1;
+
+ return len;
}
static void
@@ -228,7 +269,33 @@ webkit_test_plugin_handle_event(NPP instance, void* event)
return 0;
XEvent* evt = static_cast<XEvent*>(event);
- pluginLog(instance, "event %d", evt->type);
+
+ switch (evt->type) {
+ case ButtonRelease:
+ pluginLog(instance, "mouseUp at (%d, %d)", evt->xbutton.x, evt->xbutton.y);
+ break;
+ case ButtonPress:
+ pluginLog(instance, "mouseDown at (%d, %d)", evt->xbutton.x, evt->xbutton.y);
+ break;
+ case KeyRelease:
+ pluginLog(instance, "keyUp '%c'", evt->xkey.keycode);
+ break;
+ case KeyPress:
+ pluginLog(instance, "keyDown '%c'", evt->xkey.keycode);
+ break;
+ case MotionNotify:
+ case EnterNotify:
+ case LeaveNotify:
+ break;
+ case FocusIn:
+ pluginLog(instance, "getFocusEvent");
+ break;
+ case FocusOut:
+ pluginLog(instance, "loseFocusEvent");
+ break;
+ default:
+ pluginLog(instance, "event %d", evt->type);
+ }
return 0;
}
@@ -247,6 +314,14 @@ webkit_test_plugin_url_notify(NPP instance, const char* url, NPReason reason, vo
static NPError
webkit_test_plugin_get_value(NPP instance, NPPVariable variable, void *value)
{
+ PluginObject* obj = 0;
+ if (instance)
+ obj = static_cast<PluginObject*>(instance->pdata);
+
+ // First, check if the PluginTest object supports getting this value.
+ if (obj && obj->pluginTest->NPP_GetValue(variable, value) == NPERR_NO_ERROR)
+ return NPERR_NO_ERROR;
+
NPError err = NPERR_NO_ERROR;
switch (variable) {
@@ -265,14 +340,12 @@ webkit_test_plugin_get_value(NPP instance, NPPVariable variable, void *value)
err = NPERR_GENERIC_ERROR;
break;
default:
- fprintf(stderr, "Unhandled variable\n");
err = NPERR_GENERIC_ERROR;
break;
}
if (variable == NPPVpluginScriptableNPObject) {
void **v = (void **)value;
- PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
browser->retainobject((NPObject *)obj);
*v = obj;
err = NPERR_NO_ERROR;
@@ -282,15 +355,25 @@ webkit_test_plugin_get_value(NPP instance, NPPVariable variable, void *value)
}
static NPError
-webkit_test_plugin_set_value(NPP /*instance*/, NPNVariable /*variable*/, void* /*value*/)
+webkit_test_plugin_set_value(NPP instance, NPNVariable variable, void* value)
{
- return NPERR_NO_ERROR;
+ PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
+
+ switch (variable) {
+ case NPNVprivateModeBool:
+ obj->cachedPrivateBrowsingMode = *(NPBool*)value;
+ return NPERR_NO_ERROR;
+ default:
+ return NPERR_GENERIC_ERROR;
+ }
}
char *
NP_GetMIMEDescription(void)
{
- return const_cast<char*>("application/x-webkit-test-netscape:testnetscape:test netscape content");
+ // We sentence-case the mime-type here to ensure that ports are not
+ // case-sensitive when loading plugins. See https://webkit.org/b/36815
+ return const_cast<char*>("application/x-Webkit-Test-Netscape:testnetscape:test netscape content");
}
NPError
@@ -306,6 +389,7 @@ NP_Initialize (NPNetscapeFuncs *aMozillaVTable, NPPluginFuncs *aPluginVTable)
return NPERR_INVALID_FUNCTABLE_ERROR;
browser = aMozillaVTable;
+ pluginFunctions = aPluginVTable;
aPluginVTable->size = sizeof (NPPluginFuncs);
aPluginVTable->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR;
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp
index 6b35948..f03c102 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityControllerWin.cpp
@@ -59,6 +59,12 @@ AccessibilityController::~AccessibilityController()
JSValueUnprotect(frame->globalContext(), it->second);
}
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+ // FIXME: implement
+ return 0;
+}
+
AccessibilityUIElement AccessibilityController::focusedElement()
{
COMPtr<IAccessible> rootAccessible = rootElement().platformUIElement();
@@ -226,7 +232,8 @@ static void CALLBACK notificationListenerProc(HWINEVENTHOOK, DWORD event, HWND h
VariantInit(&vChild);
HRESULT hr = AccessibleObjectFromEvent(hwnd, idObject, idChild, &parentObject, &vChild);
- ASSERT(SUCCEEDED(hr));
+ if (FAILED(hr) || !parentObject)
+ return;
COMPtr<IDispatch> childDispatch;
if (FAILED(parentObject->get_accChild(vChild, &childDispatch))) {
diff --git a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
index 301112f..5b771b2 100644
--- a/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
@@ -35,6 +35,16 @@
using std::wstring;
+static COMPtr<IAccessibleComparable> comparableObject(IAccessible* accessible)
+{
+ COMPtr<IServiceProvider> serviceProvider(Query, accessible);
+ if (!serviceProvider)
+ return 0;
+ COMPtr<IAccessibleComparable> comparable;
+ serviceProvider->QueryService(SID_AccessibleComparable, __uuidof(IAccessibleComparable), reinterpret_cast<void**>(&comparable));
+ return comparable;
+}
+
AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
: m_element(element)
{
@@ -49,6 +59,18 @@ AccessibilityUIElement::~AccessibilityUIElement()
{
}
+bool AccessibilityUIElement::isEqual(AccessibilityUIElement* otherElement)
+{
+ COMPtr<IAccessibleComparable> comparable = comparableObject(m_element.get());
+ COMPtr<IAccessibleComparable> otherComparable = comparableObject(otherElement->m_element.get());
+ if (!comparable || !otherComparable)
+ return false;
+ BOOL isSame = FALSE;
+ if (FAILED(comparable->isSameObject(otherComparable.get(), &isSame)))
+ return false;
+ return isSame;
+}
+
void AccessibilityUIElement::getLinkedUIElements(Vector<AccessibilityUIElement>&)
{
}
@@ -83,11 +105,29 @@ int AccessibilityUIElement::childrenCount()
return childCount;
}
+int AccessibilityUIElement::rowCount()
+{
+ // FIXME: implement
+ return 0;
+}
+
+int AccessibilityUIElement::columnCount()
+{
+ // FIXME: implement
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::elementAtPoint(int x, int y)
{
return 0;
}
+AccessibilityUIElement AccessibilityUIElement::linkedUIElementAtIndex(unsigned index)
+{
+ // FIXME: implement
+ return 0;
+}
+
AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index)
{
COMPtr<IDispatch> child;
@@ -224,6 +264,11 @@ JSStringRef AccessibilityUIElement::language()
return JSStringCreateWithCharacters(0, 0);
}
+JSStringRef AccessibilityUIElement::helpText() const
+{
+ return 0;
+}
+
double AccessibilityUIElement::x()
{
long x, y, width, height;
@@ -427,6 +472,16 @@ JSStringRef AccessibilityUIElement::stringForRange(unsigned, unsigned)
return JSStringCreateWithCharacters(0, 0);
}
+JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
+{
+ return JSStringCreateWithCharacters(0, 0);
+}
+
+bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned)
+{
+ return false;
+}
+
AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned column, unsigned row)
{
return 0;
@@ -477,6 +532,11 @@ void AccessibilityUIElement::showMenu()
m_element->accDoDefaultAction(self());
}
+void AccessibilityUIElement::press()
+{
+ // FIXME: implement
+}
+
AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
{
return 0;
@@ -540,6 +600,11 @@ bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallbac
return true;
}
+void AccessibilityUIElement::removeNotificationListener()
+{
+ // FIXME: implement
+}
+
bool AccessibilityUIElement::isSelectable() const
{
DWORD state = accessibilityState(m_element);
@@ -571,6 +636,12 @@ bool AccessibilityUIElement::isCollapsed() const
return (state & STATE_SYSTEM_COLLAPSED) == STATE_SYSTEM_COLLAPSED;
}
+bool AccessibilityUIElement::isIgnored() const
+{
+ // FIXME: implement
+ return false;
+}
+
bool AccessibilityUIElement::hasPopup() const
{
DWORD state = accessibilityState(m_element);
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
index 261b9e6..aca17fb 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -84,6 +84,7 @@ static bool printSeparators;
static bool leakChecking = false;
static bool threaded = false;
static bool forceComplexText = false;
+static bool printSupportedFeatures = false;
static RetainPtr<CFStringRef> persistentUserStyleSheetLocation;
volatile bool done;
@@ -97,19 +98,15 @@ PolicyDelegate* policyDelegate;
COMPtr<FrameLoadDelegate> sharedFrameLoadDelegate;
COMPtr<UIDelegate> sharedUIDelegate;
COMPtr<EditingDelegate> sharedEditingDelegate;
-COMPtr<ResourceLoadDelegate> sharedResourceLoadDelegate;
COMPtr<HistoryDelegate> sharedHistoryDelegate;
IWebFrame* frame;
HWND webViewWindow;
-LayoutTestController* gLayoutTestController = 0;
+RefPtr<LayoutTestController> gLayoutTestController;
UINT_PTR waitToDumpWatchdog = 0;
-const unsigned maxViewWidth = 800;
-const unsigned maxViewHeight = 600;
-
void setPersistentUserStyleSheetLocation(CFStringRef url)
{
persistentUserStyleSheetLocation = url;
@@ -136,12 +133,41 @@ bool setAlwaysAcceptCookies(bool alwaysAcceptCookies)
wstring urlSuitableForTestResult(const wstring& url)
{
- if (!url.c_str() || url.find(L"file://") == wstring::npos)
+ if (url.find(L"file://") == wstring::npos)
+ return url;
+
+ return lastPathComponent(url);
+}
+
+wstring lastPathComponent(const wstring& url)
+{
+ if (url.empty())
return url;
return PathFindFileNameW(url.c_str());
}
+static string toUTF8(const wchar_t* wideString, size_t length)
+{
+ int result = WideCharToMultiByte(CP_UTF8, 0, wideString, length + 1, 0, 0, 0, 0);
+ Vector<char> utf8Vector(result);
+ 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) {
@@ -667,8 +693,8 @@ void dump()
width = 480;
height = 360;
} else {
- width = maxViewWidth;
- height = maxViewHeight;
+ width = LayoutTestController::maxViewWidth;
+ height = LayoutTestController::maxViewHeight;
}
::SetWindowPos(webViewWindow, 0, 0, 0, width, height, SWP_NOMOVE);
@@ -678,7 +704,7 @@ void dump()
COMPtr<IWebFramePrivate> framePrivate;
if (FAILED(frame->QueryInterface(&framePrivate)))
goto fail;
- framePrivate->renderTreeAsExternalRepresentation(&resultString);
+ framePrivate->renderTreeAsExternalRepresentation(gLayoutTestController->isPrinting(), &resultString);
}
if (!resultString)
@@ -704,10 +730,11 @@ void dump()
fflush(stderr);
}
- if (dumpPixels) {
- if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive())
- dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash());
- }
+ if (dumpPixels
+ && gLayoutTestController->generatePixelResults()
+ && !gLayoutTestController->dumpDOMAsWebArchive()
+ && !gLayoutTestController->dumpSourceAsWebArchive())
+ dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash());
printf("#EOF\n"); // terminate the (possibly empty) pixels block
fflush(stdout);
@@ -734,6 +761,11 @@ static bool shouldOpenWebInspector(const char* pathOrURL)
return strstr(pathOrURL, "/inspector/") || strstr(pathOrURL, "\\inspector\\");
}
+static bool shouldEnableDeveloperExtras(const char* pathOrURL)
+{
+ return shouldOpenWebInspector(pathOrURL) || strstr(pathOrURL, "/inspector-enabled/") || strstr(pathOrURL, "\\inspector-enabled\\");
+}
+
static void resetDefaultsToConsistentValues(IWebPreferences* preferences)
{
#ifdef USE_MAC_FONTS
@@ -760,7 +792,7 @@ static void resetDefaultsToConsistentValues(IWebPreferences* preferences)
preferences->setAutosaves(FALSE);
preferences->setDefaultFontSize(16);
preferences->setDefaultFixedFontSize(13);
- preferences->setMinimumFontSize(1);
+ preferences->setMinimumFontSize(0);
preferences->setJavaEnabled(FALSE);
preferences->setPlugInsEnabled(TRUE);
preferences->setDOMPasteAllowed(TRUE);
@@ -773,6 +805,7 @@ static void resetDefaultsToConsistentValues(IWebPreferences* preferences)
preferences->setTabsToLinks(FALSE);
preferences->setShouldPrintBackgrounds(TRUE);
preferences->setLoadsImagesAutomatically(TRUE);
+ preferences->setEditingBehavior(WebKitEditingWinBehavior);
if (persistentUserStyleSheetLocation) {
Vector<wchar_t> urlCharacters(CFStringGetLength(persistentUserStyleSheetLocation.get()));
@@ -787,12 +820,14 @@ static void resetDefaultsToConsistentValues(IWebPreferences* preferences)
COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
if (prefsPrivate) {
prefsPrivate->setAllowUniversalAccessFromFileURLs(TRUE);
+ prefsPrivate->setAllowFileAccessFromFileURLs(TRUE);
prefsPrivate->setAuthorAndUserStylesEnabled(TRUE);
prefsPrivate->setDeveloperExtrasEnabled(FALSE);
prefsPrivate->setExperimentalNotificationsEnabled(TRUE);
prefsPrivate->setShouldPaintNativeControls(FALSE); // FIXME - need to make DRT pass with Windows native controls <http://bugs.webkit.org/show_bug.cgi?id=25592>
+ prefsPrivate->setJavaScriptCanAccessClipboard(TRUE);
prefsPrivate->setXSSAuditorEnabled(FALSE);
- prefsPrivate->setFrameSetFlatteningEnabled(FALSE);
+ prefsPrivate->setFrameFlatteningEnabled(FALSE);
prefsPrivate->setOfflineWebApplicationCacheEnabled(TRUE);
}
setAlwaysAcceptCookies(false);
@@ -838,7 +873,7 @@ static void resetWebViewToConsistentStateBeforeTesting()
SetFocus(viewWindow);
webViewPrivate->clearMainFrameName();
- webViewPrivate->resetOriginAccessWhiteLists();
+ webViewPrivate->resetOriginAccessWhitelists();
BSTR groupName;
if (SUCCEEDED(webView->groupName(&groupName))) {
@@ -886,7 +921,7 @@ static void runTest(const string& testPathOrURL)
CFRelease(url);
- ::gLayoutTestController = new LayoutTestController(pathOrURL, expectedPixelHash);
+ ::gLayoutTestController = LayoutTestController::create(pathOrURL, expectedPixelHash);
done = false;
topLoadingFrame = 0;
@@ -912,8 +947,11 @@ static void runTest(const string& testPathOrURL)
resetWebViewToConsistentStateBeforeTesting();
- if (shouldOpenWebInspector(pathOrURL.c_str()))
- gLayoutTestController->showWebInspector();
+ if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+ gLayoutTestController->setDeveloperExtrasEnabled(true);
+ if (shouldOpenWebInspector(pathOrURL.c_str()))
+ gLayoutTestController->showWebInspector();
+ }
prevTestBFItem = 0;
if (webView) {
@@ -949,8 +987,10 @@ static void runTest(const string& testPathOrURL)
DispatchMessage(&msg);
}
- if (shouldOpenWebInspector(pathOrURL.c_str()))
+ if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
gLayoutTestController->closeWebInspector();
+ gLayoutTestController->setDeveloperExtrasEnabled(false);
+ }
resetWebViewToConsistentStateBeforeTesting();
@@ -972,8 +1012,7 @@ static void runTest(const string& testPathOrURL)
exit:
SysFreeString(urlBStr);
- ::gLayoutTestController->deref();
- ::gLayoutTestController = 0;
+ ::gLayoutTestController.clear();
return;
}
@@ -1097,6 +1136,8 @@ WindowToWebViewMap& windowToWebViewMap()
IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow)
{
+ unsigned maxViewWidth = LayoutTestController::maxViewWidth;
+ unsigned maxViewHeight = LayoutTestController::maxViewHeight;
HWND hostWindow = CreateWindowEx(WS_EX_TOOLWINDOW, kDumpRenderTreeClassName, TEXT("DumpRenderTree"), WS_POPUP,
-maxViewWidth, -maxViewHeight, maxViewWidth, maxViewHeight, 0, 0, GetModuleHandle(0), 0);
@@ -1159,7 +1200,10 @@ IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow)
if (FAILED(viewEditing->setEditingDelegate(sharedEditingDelegate.get())))
return 0;
- if (FAILED(webView->setResourceLoadDelegate(sharedResourceLoadDelegate.get())))
+ ResourceLoadDelegate* resourceLoadDelegate = new ResourceLoadDelegate();
+ HRESULT result = webView->setResourceLoadDelegate(resourceLoadDelegate);
+ resourceLoadDelegate->Release(); // The delegate is owned by the WebView, so release our reference to it.
+ if (FAILED(result))
return 0;
openWindows().append(hostWindow);
@@ -1190,8 +1234,17 @@ RetainPtr<CFURLCacheRef> sharedCFURLCache()
}
#endif
+static LONG WINAPI exceptionFilter(EXCEPTION_POINTERS*)
+{
+ fputs("#CRASHED\n", stderr);
+ fflush(stderr);
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+
int main(int argc, char* argv[])
{
+ ::SetUnhandledExceptionFilter(exceptionFilter);
+
leakChecking = false;
_setmode(1, _O_BINARY);
@@ -1222,6 +1275,11 @@ int main(int argc, char* argv[])
continue;
}
+ if (!stricmp(argv[i], "--print-supported-features")) {
+ printSupportedFeatures = true;
+ continue;
+ }
+
tests.append(argv[i]);
}
@@ -1229,7 +1287,6 @@ int main(int argc, char* argv[])
sharedFrameLoadDelegate.adoptRef(new FrameLoadDelegate);
sharedUIDelegate.adoptRef(new UIDelegate);
sharedEditingDelegate.adoptRef(new EditingDelegate);
- sharedResourceLoadDelegate.adoptRef(new ResourceLoadDelegate);
sharedHistoryDelegate.adoptRef(new HistoryDelegate);
// FIXME - need to make DRT pass with Windows native controls <http://bugs.webkit.org/show_bug.cgi?id=25592>
@@ -1245,6 +1302,25 @@ int main(int argc, char* argv[])
standardPreferencesPrivate->setShouldPaintNativeControls(FALSE);
standardPreferences->setJavaScriptEnabled(TRUE);
standardPreferences->setDefaultFontSize(16);
+ standardPreferences->setAcceleratedCompositingEnabled(true);
+ standardPreferences->setContinuousSpellCheckingEnabled(TRUE);
+
+ if (printSupportedFeatures) {
+ BOOL acceleratedCompositingAvailable;
+ standardPreferences->acceleratedCompositingEnabled(&acceleratedCompositingAvailable);
+
+#if ENABLE(3D_RENDERING)
+ // In theory, we could have a software-based 3D rendering implementation that we use when
+ // hardware-acceleration is not available. But we don't have any such software
+ // implementation, so 3D rendering is only available when hardware-acceleration is.
+ BOOL threeDRenderingAvailable = acceleratedCompositingAvailable;
+#else
+ BOOL threeDRenderingAvailable = FALSE;
+#endif
+
+ printf("SupportedFeatures:%s %s\n", acceleratedCompositingAvailable ? "AcceleratedCompositing" : "", threeDRenderingAvailable ? "3DRendering" : "");
+ return 0;
+ }
COMPtr<IWebView> webView(AdoptCOM, createWebViewAndOffscreenWindow(&webViewWindow));
if (!webView)
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj
index 4d2dea8..fa0304a 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.vcproj
@@ -18,12 +18,11 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefines.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;.\DumpRenderTreeCommon.vsprops;.\DumpRenderTreeApple.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -39,10 +38,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)\.&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\cg&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;"
- PreprocessorDefinitions="_CONSOLE"
- DisableSpecificWarnings="4146"
- ForcedIncludeFiles="DumpRenderTreePrefix.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -55,11 +50,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib comsuppw.lib"
- AdditionalLibraryDirectories=""
- DelayLoadDLLs=""
- SubSystem="1"
- TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
@@ -84,19 +74,16 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefines.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\DumpRenderTreeCommon.vsprops;.\DumpRenderTreeApple.vsprops"
CharacterSet="1"
- WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -112,10 +99,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)\.&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\cg&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;"
- PreprocessorDefinitions="_CONSOLE"
- DisableSpecificWarnings="4146"
- ForcedIncludeFiles="DumpRenderTreePrefix.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -128,11 +111,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib comsuppw.lib"
- AdditionalLibraryDirectories=""
- DelayLoadDLLs=""
- SubSystem="1"
- TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
@@ -157,18 +135,16 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Debug_Internal|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefines.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;.\DumpRenderTreeCommon.vsprops;.\DumpRenderTreeApple.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -184,10 +160,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)\.&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\cg&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;"
- PreprocessorDefinitions="_CONSOLE"
- DisableSpecificWarnings="4146"
- ForcedIncludeFiles="DumpRenderTreePrefix.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -200,10 +172,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib comsuppw.lib"
- AdditionalLibraryDirectories=""
- DelayLoadDLLs=""
- SubSystem="1"
/>
<Tool
Name="VCALinkTool"
@@ -228,18 +196,16 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Debug_Cairo|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\cURL.vsprops;.\DumpRenderTreeCommon.vsprops;.\DumpRenderTreeCairo.vsprops;.\DumpRenderTreeCFLite.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -255,10 +221,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)\.&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\cairo&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;"
- PreprocessorDefinitions="_CONSOLE"
- DisableSpecificWarnings="4146"
- ForcedIncludeFiles="DumpRenderTreePrefix.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -271,11 +233,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CFLite_Debug.lib cairo.lib libjpeg.lib libpng.lib libcurl_imp.lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib comsuppw.lib"
- AdditionalLibraryDirectories=""
- DelayLoadDLLs=""
- SubSystem="1"
- TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
@@ -300,19 +257,17 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Release_Cairo|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefinesCairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;$(WebKitLibrariesDir)\tools\vsprops\WinCairo.vsprops;$(WebKitLibrariesDir)\tools\vsprops\cURL.vsprops;.\DumpRenderTreeCommon.vsprops;.\DumpRenderTreeCairo.vsprops;.\DumpRenderTreeCFLite.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -328,10 +283,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)\.&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\cairo&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;"
- PreprocessorDefinitions="_CONSOLE"
- DisableSpecificWarnings="4146"
- ForcedIncludeFiles="DumpRenderTreePrefix.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -344,11 +295,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CFLite.lib cairo.lib libjpeg.lib libpng.lib libcurl_imp.lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib comsuppw.lib"
- AdditionalLibraryDirectories=""
- DelayLoadDLLs=""
- SubSystem="1"
- TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
@@ -373,18 +319,16 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Debug_All|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefines.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;.\DumpRenderTreeCommon.vsprops;.\DumpRenderTreeApple.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -400,10 +344,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(ProjectDir)\.&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\cg&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;"
- PreprocessorDefinitions="_CONSOLE"
- DisableSpecificWarnings="4146"
- ForcedIncludeFiles="DumpRenderTreePrefix.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -416,10 +356,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib comsuppw.lib"
- AdditionalLibraryDirectories=""
- DelayLoadDLLs=""
- SubSystem="1"
/>
<Tool
Name="VCALinkTool"
@@ -444,7 +380,68 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\FeatureDefines.vsprops;$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\DumpRenderTreeCommon.vsprops;.\DumpRenderTreeApple.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
@@ -560,6 +557,14 @@
</File>
</Filter>
<File
+ RelativePath="..\AccessibilityTextMarker.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\AccessibilityTextMarker.h"
+ >
+ </File>
+ <File
RelativePath="..\AccessibilityUIElement.cpp"
>
</File>
@@ -594,10 +599,42 @@
<File
RelativePath=".\MD5.cpp"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\MD5.h"
>
+ <FileConfiguration
+ Name="Debug_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\PixelDumpSupport.cpp"
@@ -642,6 +679,14 @@
Name="VCCLCompilerTool"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release_LTCG|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\cairo\PixelDumpSupportCairo.h"
@@ -678,6 +723,14 @@
Name="VCCustomBuildTool"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release_LTCG|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath="..\cg\PixelDumpSupportCG.cpp"
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeApple.vsprops b/WebKitTools/DumpRenderTree/win/DumpRenderTreeApple.vsprops
new file mode 100644
index 0000000..a6db765
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeApple.vsprops
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="DumpRenderTreeApple"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\cg&quot;;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeCFLite.vsprops b/WebKitTools/DumpRenderTree/win/DumpRenderTreeCFLite.vsprops
new file mode 100644
index 0000000..7e47f38
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeCFLite.vsprops
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="DumpRenderTreeCFLite"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="CFLite$(LibraryConfigSuffix).lib"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeCairo.vsprops b/WebKitTools/DumpRenderTree/win/DumpRenderTreeCairo.vsprops
new file mode 100644
index 0000000..827bcd0
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeCairo.vsprops
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="DumpRenderTreeCairo"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\cairo&quot;;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeCommon.vsprops b/WebKitTools/DumpRenderTree/win/DumpRenderTreeCommon.vsprops
new file mode 100644
index 0000000..ff572a5
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeCommon.vsprops
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="DumpRenderTreeCommon"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\.&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\DumpRenderTree\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;"
+ PreprocessorDefinitions="_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="DumpRenderTreePrefix.h"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib pthreadVC2$(LibraryConfigSuffix).lib gdi32.lib ole32.lib oleaut32.lib user32.lib shlwapi.lib oleacc.lib comsuppw.lib"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreVideo$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreVideo$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForwardingHeaders\wtf\*.h&quot; &quot;$(WebKitOutputDir)\include\DumpRenderTree\ForwardingHeaders\wtf&quot;&#x0D;&#x0A;if &quot;$(ConfigurationName)&quot;==&quot;Debug_Cairo&quot; xcopy /y /d &quot;$(TargetDir)\..\include\WebCore\ForwardingHeaders\wtf\MD5.h&quot;&#x0D;&#x0A;if &quot;$(ConfigurationName)&quot;==&quot;Release_Cairo&quot; xcopy /y /d &quot;$(TargetDir)\..\include\WebCore\ForwardingHeaders\wtf\MD5.h&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
index 499c57b..27edaa6 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
@@ -12,7 +12,7 @@
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
+ * from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@@ -49,6 +49,9 @@ extern HWND webViewWindow;
#include <wtf/Vector.h>
std::wstring urlSuitableForTestResult(const std::wstring& url);
+std::wstring lastPathComponent(const std::wstring&);
+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/EditingDelegate.cpp b/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
index 32c02bd..71859cb 100644
--- a/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
+++ b/WebKitTools/DumpRenderTree/win/EditingDelegate.cpp
@@ -353,3 +353,72 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeSelection(
}
return S_OK;
}
+
+static int indexOfFirstWordCharacter(const TCHAR* text)
+{
+ const TCHAR* cursor = text;
+ while (*cursor && !isalpha(*cursor))
+ ++cursor;
+ return *cursor ? (cursor - text) : -1;
+};
+
+static int wordLength(const TCHAR* text)
+{
+ const TCHAR* cursor = text;
+ while (*cursor && isalpha(*cursor))
+ ++cursor;
+ return cursor - text;
+};
+
+HRESULT STDMETHODCALLTYPE EditingDelegate::checkSpellingOfString(
+ /* [in] */ IWebView* view,
+ /* [in] */ LPCTSTR text,
+ /* [in] */ int length,
+ /* [out] */ int* misspellingLocation,
+ /* [out] */ int* misspellingLength)
+{
+ static const TCHAR* misspelledWords[] = {
+ // These words are known misspelled words in webkit tests.
+ // If there are other misspelled words in webkit tests, please add them in
+ // this array.
+ TEXT("foo"),
+ TEXT("Foo"),
+ TEXT("baz"),
+ TEXT("fo"),
+ TEXT("LibertyF"),
+ TEXT("chello"),
+ TEXT("xxxtestxxx"),
+ TEXT("XXxxx"),
+ TEXT("Textx"),
+ TEXT("blockquoted"),
+ TEXT("asd"),
+ TEXT("Lorem"),
+ TEXT("Nunc"),
+ TEXT("Curabitur"),
+ TEXT("eu"),
+ TEXT("adlj"),
+ TEXT("adaasj"),
+ TEXT("sdklj"),
+ TEXT("jlkds"),
+ TEXT("jsaada"),
+ TEXT("jlda"),
+ TEXT("zz"),
+ TEXT("contentEditable"),
+ 0,
+ };
+
+ wstring textString(text, length);
+ int wordStart = indexOfFirstWordCharacter(textString.c_str());
+ if (-1 == wordStart)
+ return S_OK;
+ wstring word = textString.substr(wordStart, wordLength(textString.c_str() + wordStart));
+ for (size_t i = 0; misspelledWords[i]; ++i) {
+ if (word == misspelledWords[i]) {
+ *misspellingLocation = wordStart;
+ *misspellingLength = word.size();
+ break;
+ }
+ }
+
+ return S_OK;
+}
diff --git a/WebKitTools/DumpRenderTree/win/EditingDelegate.h b/WebKitTools/DumpRenderTree/win/EditingDelegate.h
index 6dba675..7b7f418 100644
--- a/WebKitTools/DumpRenderTree/win/EditingDelegate.h
+++ b/WebKitTools/DumpRenderTree/win/EditingDelegate.h
@@ -127,7 +127,7 @@ public:
/* [in] */ LPCTSTR text,
/* [in] */ int length,
/* [out] */ int *misspellingLocation,
- /* [out] */ int *misspellingLength) { return E_NOTIMPL; }
+ /* [out] */ int *misspellingLength);
virtual HRESULT STDMETHODCALLTYPE checkGrammarOfString(
/* [in] */ IWebView *view,
diff --git a/WebKitTools/DumpRenderTree/win/EventSender.cpp b/WebKitTools/DumpRenderTree/win/EventSender.cpp
index 5a42b00..94f0945 100644
--- a/WebKitTools/DumpRenderTree/win/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/win/EventSender.cpp
@@ -467,8 +467,12 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
virtualKeyCode = VK_HOME;
else if (JSStringIsEqualToUTF8CString(character, "end"))
virtualKeyCode = VK_END;
+ else if (JSStringIsEqualToUTF8CString(character, "insert"))
+ virtualKeyCode = VK_INSERT;
else if (JSStringIsEqualToUTF8CString(character, "delete"))
- virtualKeyCode = VK_BACK;
+ virtualKeyCode = VK_DELETE;
+ else if (JSStringIsEqualToUTF8CString(character, "printScreen"))
+ virtualKeyCode = VK_SNAPSHOT;
else {
charCode = JSStringGetCharactersPtr(character)[0];
virtualKeyCode = LOBYTE(VkKeyScan(charCode));
@@ -667,20 +671,21 @@ static JSClassRef getClass(JSContextRef context)
return eventSenderClass;
}
-JSObjectRef makeEventSender(JSContextRef context)
+JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame)
{
- down = false;
- dragMode = true;
- replayingSavedEvents = false;
- timeOffset = 0;
- lastMousePosition.x = 0;
- lastMousePosition.y = 0;
-
- endOfQueue = 0;
- startOfQueue = 0;
+ if (isTopFrame) {
+ down = false;
+ dragMode = true;
+ replayingSavedEvents = false;
+ timeOffset = 0;
+ lastMousePosition.x = 0;
+ lastMousePosition.y = 0;
- didDragEnter = false;
- draggingInfo = 0;
+ endOfQueue = 0;
+ startOfQueue = 0;
+ didDragEnter = false;
+ draggingInfo = 0;
+ }
return JSObjectMake(context, getClass(context), 0);
}
diff --git a/WebKitTools/DumpRenderTree/win/EventSender.h b/WebKitTools/DumpRenderTree/win/EventSender.h
index 79d7dab..a0add85 100644
--- a/WebKitTools/DumpRenderTree/win/EventSender.h
+++ b/WebKitTools/DumpRenderTree/win/EventSender.h
@@ -35,7 +35,7 @@ typedef long HRESULT;
typedef const struct OpaqueJSContext* JSContextRef;
typedef struct OpaqueJSValue* JSObjectRef;
-JSObjectRef makeEventSender(JSContextRef context);
+JSObjectRef makeEventSender(JSContextRef context, bool isTopFrame);
void replaySavedEvents(HRESULT* oleDragAndDropReturnValue = 0);
extern DraggingInfo* draggingInfo;
diff --git a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp
index 37d5e1c..a84e0f3 100644
--- a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp
+++ b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2005, 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -48,17 +49,6 @@ using std::string;
static FrameLoadDelegate* g_delegateWaitingOnTimer;
-string BSTRtoString(BSTR bstr)
-{
- int result = WideCharToMultiByte(CP_UTF8, 0, bstr, SysStringLen(bstr) + 1, 0, 0, 0, 0);
- Vector<char> utf8Vector(result);
- result = WideCharToMultiByte(CP_UTF8, 0, bstr, SysStringLen(bstr) + 1, utf8Vector.data(), result, 0, 0);
- if (!result)
- return string();
-
- return string(utf8Vector.data(), utf8Vector.size() - 1);
-}
-
string descriptionSuitableForTestResult(IWebFrame* webFrame)
{
COMPtr<IWebView> webView;
@@ -70,11 +60,11 @@ string descriptionSuitableForTestResult(IWebFrame* webFrame)
return string();
BSTR frameNameBSTR;
- if (FAILED(webFrame->name(&frameNameBSTR)) || BSTRtoString(frameNameBSTR).empty() )
+ if (FAILED(webFrame->name(&frameNameBSTR)) || toUTF8(frameNameBSTR).empty())
return (webFrame == mainFrame) ? "main frame" : string();
string frameName = (webFrame == mainFrame) ? "main frame" : "frame";
- frameName += " \"" + BSTRtoString(frameNameBSTR) + "\"";
+ frameName += " \"" + toUTF8(frameNameBSTR) + "\"";
SysFreeString(frameNameBSTR);
return frameName;
@@ -157,6 +147,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFailProvisionalLoadWithError(
if (!done && gLayoutTestController->dumpFrameLoadCallbacks())
printf("%s - didFailProvisionalLoadWithError\n", descriptionSuitableForTestResult(frame).c_str());
+ locationChangeDone(error, frame);
return S_OK;
}
@@ -189,6 +180,16 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didReceiveTitle(
return S_OK;
}
+HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didChangeIcons(
+ /* [in] */ IWebView* webView,
+ /* [in] */ IWebFrame* frame)
+{
+ if (!done && gLayoutTestController->dumpIconChanges())
+ printf("%s - didChangeIcons\n", descriptionSuitableForTestResult(frame).c_str());
+
+ return S_OK;
+}
+
void FrameLoadDelegate::processWork()
{
// if another load started, then wait for it to complete.
@@ -336,6 +337,9 @@ void FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld(IWebFrame* f
JSGlobalContextRef context = frame->globalContext();
JSObjectRef windowObject = JSContextGetGlobalObject(context);
+ IWebFrame* parentFrame = 0;
+ frame->parentFrame(&parentFrame);
+
JSValueRef exception = 0;
::gLayoutTestController->makeWindowObject(context, windowObject, &exception);
@@ -348,7 +352,7 @@ void FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld(IWebFrame* f
ASSERT(!exception);
JSStringRef eventSenderStr = JSStringCreateWithUTF8CString("eventSender");
- JSValueRef eventSender = makeEventSender(context);
+ JSValueRef eventSender = makeEventSender(context, !parentFrame);
JSObjectSetProperty(context, windowObject, eventSenderStr, eventSender, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, 0);
JSStringRelease(eventSenderStr);
}
diff --git a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h
index 329c17f..4cd5e11 100644
--- a/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h
+++ b/WebKitTools/DumpRenderTree/win/FrameLoadDelegate.h
@@ -74,6 +74,10 @@ public:
/* [in] */ BSTR title,
/* [in] */ IWebFrame *frame);
+ virtual HRESULT STDMETHODCALLTYPE didChangeIcons(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebFrame *frame);
+
virtual HRESULT STDMETHODCALLTYPE didReceiveIcon(
/* [in] */ IWebView *webView,
/* [in] */ OLE_HANDLE image,
diff --git a/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj b/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj
index 73d541b..dcc6dba 100644
--- a/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj
+++ b/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj
@@ -17,12 +17,11 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;.\ImageDiffCommon.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -38,7 +37,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -51,9 +49,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
- AdditionalLibraryDirectories=""
- SubSystem="1"
/>
<Tool
Name="VCALinkTool"
@@ -78,19 +73,16 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\ImageDiffCommon.vsprops"
CharacterSet="2"
- WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -106,7 +98,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -119,9 +110,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
- AdditionalLibraryDirectories=""
- SubSystem="1"
/>
<Tool
Name="VCALinkTool"
@@ -146,18 +134,16 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Debug_Internal|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;.\ImageDiffCommon.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -173,7 +159,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -186,9 +171,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
- AdditionalLibraryDirectories=""
- SubSystem="1"
/>
<Tool
Name="VCALinkTool"
@@ -213,18 +195,77 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
/>
</Configuration>
<Configuration
Name="Debug_All|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;.\ImageDiffCommon.vsprops"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_Cairo|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;..\..\..\WebKitLibraries\win\tools\vsprops\debug_wincairo.vsprops;.\ImageDiffCommon.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -240,7 +281,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -253,9 +293,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
- AdditionalLibraryDirectories=""
- SubSystem="1"
/>
<Tool
Name="VCALinkTool"
@@ -280,7 +317,68 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\ImageDiffCommon.vsprops"
+ CharacterSet="2"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
diff --git a/WebKitTools/DumpRenderTree/win/ImageDiffCommon.vsprops b/WebKitTools/DumpRenderTree/win/ImageDiffCommon.vsprops
new file mode 100644
index 0000000..bbb8da8
--- /dev/null
+++ b/WebKitTools/DumpRenderTree/win/ImageDiffCommon.vsprops
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ImageDiffCommon"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
+ />
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index 34fd2e6..386f118 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008, 2009, 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
@@ -110,6 +110,21 @@ void LayoutTestController::clearBackForwardList()
backForwardList->goToItem(item.get());
}
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+ COMPtr<IWebView> webView;
+ if (FAILED(frame->webView(&webView)))
+ return false;
+
+ COMPtr<IWebViewPrivate> viewPrivate;
+ if (FAILED(webView->QueryInterface(&viewPrivate)))
+ return false;
+
+ BOOL result;
+ viewPrivate->shouldClose(&result);
+ return result;
+}
+
JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name)
{
// FIXME: Implement!
@@ -158,6 +173,60 @@ void LayoutTestController::keepWebHistory()
history->setOptionalSharedHistory(sharedHistory.get());
}
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value)
+{
+ // FIXME: Implement this.
+ return JSValueMakeUndefined(context);
+}
+
+JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ // FIXME: Implement this.
+ return JSValueMakeUndefined(context);
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return false;
+
+ BSTR textBSTR = 0;
+ HRESULT hr = framePrivate->layerTreeAsText(&textBSTR);
+
+ wstring text(textBSTR, SysStringLen(textBSTR));
+ SysFreeString(textBSTR);
+ JSRetainPtr<JSStringRef> textValueJS(Adopt, JSStringCreateWithCharacters(text.data(), text.length()));
+ return textValueJS;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+{
+ COMPtr<IWebView> webView;
+ if (FAILED(frame->webView(&webView)))
+ return 0;
+
+ COMPtr<IWebViewPrivate> webViewPrivate(Query, webView);
+ if (!webViewPrivate)
+ return 0;
+
+ COMPtr<IDOMElement> element;
+ if (FAILED(webViewPrivate->elementFromJS(context, nodeObject, &element)))
+ return 0;
+
+ COMPtr<IDOMElementPrivate> elementPrivate(Query, element);
+ if (!elementPrivate)
+ return 0;
+
+ BSTR textBSTR = 0;
+ if (FAILED(elementPrivate->markerTextForListItem(&textBSTR)))
+ return 0;
+
+ JSRetainPtr<JSStringRef> markerText(Adopt, JSStringCreateWithBSTR(textBSTR));
+ SysFreeString(textBSTR);
+ return markerText;
+}
+
void LayoutTestController::waitForPolicyDelegate()
{
// FIXME: Implement this.
@@ -312,6 +381,12 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permis
webView->setPolicyDelegate(0);
}
+void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+ // FIXME: Implement for DeviceOrientation layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=30335.
+}
+
void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
// FIXME: Implement for Geolocation layout tests.
@@ -324,6 +399,18 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message
// See https://bugs.webkit.org/show_bug.cgi?id=28264.
}
+void LayoutTestController::setGeolocationPermission(bool allow)
+{
+ // FIXME: Implement for Geolocation layout tests.
+ setGeolocationPermissionCommon(allow);
+}
+
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
{
// See also <rdar://problem/6480108>
@@ -372,7 +459,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool enabled)
prefsPrivate->setXSSAuditorEnabled(enabled);
}
-void LayoutTestController::setFrameSetFlatteningEnabled(bool enabled)
+void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -386,7 +473,12 @@ void LayoutTestController::setFrameSetFlatteningEnabled(bool enabled)
if (!prefsPrivate)
return;
- prefsPrivate->setFrameSetFlatteningEnabled(enabled);
+ prefsPrivate->setFrameFlatteningEnabled(enabled);
+}
+
+void LayoutTestController::setSpatialNavigationEnabled(bool enabled)
+{
+ // FIXME: Implement for SpatialNavigation layout tests.
}
void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
@@ -406,6 +498,23 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
prefsPrivate->setAllowUniversalAccessFromFileURLs(enabled);
}
+void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+{
+ COMPtr<IWebView> webView;
+ if (FAILED(frame->webView(&webView)))
+ return;
+
+ COMPtr<IWebPreferences> preferences;
+ if (FAILED(webView->preferences(&preferences)))
+ return;
+
+ COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
+ if (!prefsPrivate)
+ return;
+
+ prefsPrivate->setAllowFileAccessFromFileURLs(enabled);
+}
+
void LayoutTestController::setPopupBlockingEnabled(bool enabled)
{
COMPtr<IWebView> webView;
@@ -419,6 +528,28 @@ void LayoutTestController::setPopupBlockingEnabled(bool enabled)
preferences->setJavaScriptCanOpenWindowsAutomatically(!enabled);
}
+void LayoutTestController::setPluginsEnabled(bool flag)
+{
+ // FIXME: Implement
+}
+
+void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
+{
+ COMPtr<IWebView> webView;
+ if (FAILED(frame->webView(&webView)))
+ return;
+
+ COMPtr<IWebPreferences> preferences;
+ if (FAILED(webView->preferences(&preferences)))
+ return;
+
+ COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
+ if (!prefsPrivate)
+ return;
+
+ prefsPrivate->setJavaScriptCanAccessClipboard(enabled);
+}
+
void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle)
{
COMPtr<IWebView> webView;
@@ -531,8 +662,14 @@ static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath)
DWORD keyType;
DWORD result = ::SHGetValueW(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/"), TEXT("native"), &keyType, &rootPath, &rootPathSize);
- if (result != ERROR_SUCCESS || keyType != REG_SZ)
- return false;
+ if (result != ERROR_SUCCESS || keyType != REG_SZ) {
+ // Cygwin 1.7 doesn't store Cygwin's root as a mount point anymore, because mount points are now stored in /etc/fstab.
+ // However, /etc/fstab doesn't contain any information about where / is located as a Windows path, so we need to use Cygwin's
+ // new registry key that has the root.
+ result = ::SHGetValueW(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Cygwin\\setup"), TEXT("rootdir"), &keyType, &rootPath, &rootPathSize);
+ if (result != ERROR_SUCCESS || keyType != REG_SZ)
+ return false;
+ }
windowsPath = wstring(rootPath, rootPathSize);
@@ -620,6 +757,11 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL)
SysFreeString(resultPathBSTR);
}
+void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+{
+ // FIXME: implement
+}
+
void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL)
{
RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL));
@@ -671,19 +813,11 @@ void LayoutTestController::setJavaScriptProfilingEnabled(bool flag)
if (FAILED(webView->QueryInterface(&viewPrivate)))
return;
- COMPtr<IWebPreferences> preferences;
- if (FAILED(webView->preferences(&preferences)))
- return;
-
- COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
- if (!prefsPrivate)
- return;
-
COMPtr<IWebInspector> inspector;
if (FAILED(viewPrivate->inspector(&inspector)))
return;
- prefsPrivate->setDeveloperExtrasEnabled(flag);
+ setDeveloperExtrasEnabled(flag);
inspector->setJavaScriptProfilingEnabled(flag);
}
@@ -700,7 +834,7 @@ void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag)
viewEditing->setSelectTrailingWhitespaceEnabled(flag ? TRUE : FALSE);
}
-static const CFTimeInterval waitToDumpWatchdogInterval = 15.0;
+static const CFTimeInterval waitToDumpWatchdogInterval = 30.0;
static void CALLBACK waitUntilDoneWatchdogFired(HWND, UINT, UINT_PTR, DWORD)
{
@@ -777,6 +911,16 @@ bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/)
return false;
}
+void LayoutTestController::clearAllApplicationCaches()
+{
+ // FIXME: implement to support Application Cache quotas.
+}
+
+void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+{
+ // FIXME: implement to support Application Cache quotas.
+}
+
void LayoutTestController::clearAllDatabases()
{
COMPtr<IWebDatabaseManager> databaseManager;
@@ -927,22 +1071,54 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return number;
}
+void LayoutTestController::suspendAnimations() const
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return;
+
+ framePrivate->suspendAnimations();
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return;
+
+ framePrivate->resumeAnimations();
+}
+
static _bstr_t bstrT(JSStringRef jsString)
{
// The false parameter tells the _bstr_t constructor to adopt the BSTR we pass it.
return _bstr_t(JSStringCopyBSTR(jsString), false);
}
-void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
COMPtr<IWebViewPrivate> webView;
if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
return;
- webView->whiteListAccessFromOrigin(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains);
+ webView->addOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains);
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart)
+void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+ COMPtr<IWebViewPrivate> webView;
+ if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
+ return;
+
+ webView->removeOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains);
+}
+
+void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
COMPtr<IWebViewPrivate> webView;
if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
@@ -956,7 +1132,7 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart)
}
-void LayoutTestController::addUserStyleSheet(JSStringRef source)
+void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
{
COMPtr<IWebViewPrivate> webView;
if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView))))
@@ -969,7 +1145,7 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source)
webView->addUserStyleSheetToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(), 0, 0, 0, 0, 0);
}
-void LayoutTestController::showWebInspector()
+void LayoutTestController::setDeveloperExtrasEnabled(bool enabled)
{
COMPtr<IWebView> webView;
if (FAILED(frame->webView(&webView)))
@@ -983,7 +1159,14 @@ void LayoutTestController::showWebInspector()
if (!prefsPrivate)
return;
- prefsPrivate->setDeveloperExtrasEnabled(true);
+ prefsPrivate->setDeveloperExtrasEnabled(enabled);
+}
+
+void LayoutTestController::showWebInspector()
+{
+ COMPtr<IWebView> webView;
+ if (FAILED(frame->webView(&webView)))
+ return;
COMPtr<IWebViewPrivate> viewPrivate(Query, webView);
if (!viewPrivate)
@@ -1009,16 +1192,6 @@ void LayoutTestController::closeWebInspector()
return;
inspector->close();
-
- COMPtr<IWebPreferences> preferences;
- if (FAILED(webView->preferences(&preferences)))
- return;
-
- COMPtr<IWebPreferencesPrivate> prefsPrivate(Query, preferences);
- if (!prefsPrivate)
- return;
-
- prefsPrivate->setDeveloperExtrasEnabled(false);
}
void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script)
@@ -1121,14 +1294,112 @@ JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStri
return counterValueJS;
}
-int LayoutTestController::pageNumberForElementById(JSStringRef, float, float)
+int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWidthInPixels, float pageHeightInPixels)
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return 0;
+
+ wstring idWstring = jsStringRefToWString(id);
+ BSTR idBSTR = SysAllocStringLen((OLECHAR*)idWstring.c_str(), idWstring.length());
+ int pageNumber = -1;
+ if (FAILED(framePrivate->pageNumberForElementById(idBSTR, pageWidthInPixels, pageHeightInPixels, &pageNumber)))
+ pageNumber = -1;
+ SysFreeString(idBSTR);
+ return pageNumber;
+}
+
+int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return 0;
+
+ int pageNumber = -1;
+ if (FAILED(framePrivate->numberOfPages(pageWidthInPixels, pageHeightInPixels, &pageNumber)))
+ pageNumber = -1;
+ 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 -1;
+ return false;
}
-int LayoutTestController::numberOfPages(float, float)
+JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
{
// FIXME: implement
- return -1;
+ return JSRetainPtr<JSStringRef>();
+}
+
+void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+{
+ COMPtr<IWebView> webView;
+ if (FAILED(frame->webView(&webView)))
+ return;
+
+ COMPtr<IWebBackForwardList> backForwardList;
+ if (FAILED(webView->backForwardList(&backForwardList)))
+ return;
+
+ COMPtr<IWebHistoryItem> item;
+ if (FAILED(backForwardList->currentItem(&item)))
+ return;
+
+ BOOL success;
+ webView->goToBackForwardItem(item.get(), &success);
+}
+
+void LayoutTestController::setWebViewEditable(bool)
+{
+}
+
+void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+{
+}
+
+void LayoutTestController::setEditingBehavior(const char* editingBehavior)
+{
+ COMPtr<IWebView> webView;
+ if (FAILED(frame->webView(&webView)))
+ return;
+
+ COMPtr<IWebPreferences> preferences;
+ if (FAILED(webView->preferences(&preferences)))
+ return;
+
+ string behaviorString(editingBehavior);
+ if (behaviorString == "mac")
+ preferences->setEditingBehavior(WebKitEditingMacBehavior);
+ else if (behaviorString == "win")
+ preferences->setEditingBehavior(WebKitEditingWinBehavior);
+ else if (behaviorString == "unix")
+ preferences->setEditingBehavior(WebKitEditingUnixBehavior);
+}
+
+void LayoutTestController::abortModal()
+{
+}
+
+bool LayoutTestController::hasSpellingMarker(int from, int length)
+{
+ COMPtr<IWebFramePrivate> framePrivate(Query, frame);
+ if (!framePrivate)
+ return false;
+ BOOL ret = FALSE;
+ if (FAILED(framePrivate->hasSpellingMarker(from, length, &ret)))
+ return false;
+ return ret;
}
diff --git a/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp b/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp
index b0c76d6..752cc39 100644
--- a/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/PixelDumpSupportWin.cpp
@@ -63,7 +63,7 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool inc
HDC memoryDC = CreateCompatibleDC(0);
SelectObject(memoryDC, bitmap);
- SendMessage(webViewWindow, WM_PRINTCLIENT, reinterpret_cast<WPARAM>(memoryDC), PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
+ SendMessage(webViewWindow, WM_PRINT, reinterpret_cast<WPARAM>(memoryDC), PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
DeleteDC(memoryDC);
BITMAP info = {0};
@@ -73,7 +73,7 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool inc
#if PLATFORM(CG)
RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
CGContextRef context = CGBitmapContextCreate(info.bmBits, info.bmWidth, info.bmHeight, 8,
- info.bmWidthBytes, colorSpace.get(), kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst);
+ info.bmWidthBytes, colorSpace.get(), kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst);
#elif PLATFORM(CAIRO)
cairo_surface_t* image = cairo_image_surface_create_for_data((unsigned char*)info.bmBits, CAIRO_FORMAT_ARGB32,
info.bmWidth, info.bmHeight, info.bmWidthBytes);
diff --git a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp
index 19bf84a..09b07d6 100644
--- a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp
+++ b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.cpp
@@ -31,48 +31,45 @@
#include "DumpRenderTree.h"
#include "LayoutTestController.h"
-#include <comutil.h>
#include <WebKit/WebKitCOMAPI.h>
-#include <wtf/HashMap.h>
-#include <wtf/Vector.h>
+#include <comutil.h>
#include <sstream>
+#include <tchar.h>
+#include <wtf/Vector.h>
-
-using std::wstring;
-using std::wiostream;
+using namespace std;
static inline wstring wstringFromBSTR(BSTR str)
{
return wstring(str, ::SysStringLen(str));
}
-wstring wstringFromInt(int i)
+static inline wstring wstringFromInt(int i)
{
- std::wostringstream ss;
+ wostringstream ss;
ss << i;
return ss.str();
}
-typedef HashMap<unsigned long, wstring> IdentifierMap;
-
-IdentifierMap& urlMap()
+static inline BSTR BSTRFromString(const string& str)
{
- static IdentifierMap urlMap;
-
- return urlMap;
+ int length = ::MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), 0, 0);
+ BSTR result = ::SysAllocStringLen(0, length);
+ ::MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), result, length);
+ return result;
}
-static wstring descriptionSuitableForTestResult(unsigned long identifier)
+wstring ResourceLoadDelegate::descriptionSuitableForTestResult(unsigned long identifier) const
{
- IdentifierMap::iterator it = urlMap().find(identifier);
+ IdentifierMap::const_iterator it = m_urlMap.find(identifier);
- if (it == urlMap().end())
+ if (it == m_urlMap.end())
return L"<unknown>";
return urlSuitableForTestResult(it->second);
}
-static wstring descriptionSuitableForTestResult(IWebURLRequest* request)
+wstring ResourceLoadDelegate::descriptionSuitableForTestResult(IWebURLRequest* request)
{
if (!request)
return L"(null)";
@@ -101,7 +98,7 @@ static wstring descriptionSuitableForTestResult(IWebURLRequest* request)
return L"<NSURLRequest URL " + url + L", main document URL " + mainDocumentURL + L", http method " + httpMethod + L">";
}
-static wstring descriptionSuitableForTestResult(IWebURLResponse* response)
+wstring ResourceLoadDelegate::descriptionSuitableForTestResult(IWebURLResponse* response)
{
if (!response)
return L"(null)";
@@ -121,7 +118,7 @@ static wstring descriptionSuitableForTestResult(IWebURLResponse* response)
return L"<NSURLResponse " + url + L", http status code " + wstringFromInt(statusCode) + L">";
}
-static wstring descriptionSuitableForTestResult(IWebError* error, unsigned long identifier)
+wstring ResourceLoadDelegate::descriptionSuitableForTestResult(IWebError* error, unsigned long identifier) const
{
wstring result = L"<NSError ";
@@ -190,6 +187,8 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::QueryInterface(REFIID riid, void
*ppvObject = static_cast<IWebResourceLoadDelegate*>(this);
else if (IsEqualGUID(riid, IID_IWebResourceLoadDelegate))
*ppvObject = static_cast<IWebResourceLoadDelegate*>(this);
+ else if (IsEqualGUID(riid, IID_IWebResourceLoadDelegatePrivate2))
+ *ppvObject = static_cast<IWebResourceLoadDelegatePrivate2*>(this);
else
return E_NOINTERFACE;
@@ -222,12 +221,22 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::identifierForInitialRequest(
if (FAILED(request->URL(&urlStr)))
return E_FAIL;
+ ASSERT(!urlMap().contains(identifier));
urlMap().set(identifier, wstringFromBSTR(urlStr));
}
return S_OK;
}
+HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::removeIdentifierForRequest(
+ /* [in] */ IWebView* webView,
+ /* [in] */ unsigned long identifier)
+{
+ urlMap().remove(identifier);
+
+ return S_OK;
+}
+
HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest(
/* [in] */ IWebView* webView,
/* [in] */ unsigned long identifier,
@@ -243,6 +252,13 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest(
descriptionSuitableForTestResult(redirectResponse).c_str());
}
+ if (!done && !gLayoutTestController->deferMainResourceDataLoad()) {
+ COMPtr<IWebDataSourcePrivate> dataSourcePrivate(Query, dataSource);
+ if (!dataSourcePrivate)
+ return E_FAIL;
+ dataSourcePrivate->setDeferMainResourceDataLoad(FALSE);
+ }
+
if (!done && gLayoutTestController->willSendRequestReturnsNull()) {
*newRequest = 0;
return S_OK;
@@ -254,8 +270,16 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest(
return S_OK;
}
- request->AddRef();
- *newRequest = request;
+ IWebMutableURLRequest* requestCopy = 0;
+ request->mutableCopy(&requestCopy);
+ const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders();
+ for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) {
+ BSTR bstrHeader = BSTRFromString(*header);
+ requestCopy->setValue(0, bstrHeader);
+ SysFreeString(bstrHeader);
+ }
+
+ *newRequest = requestCopy;
return S_OK;
}
@@ -265,18 +289,21 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didReceiveAuthenticationChalleng
/* [in] */ IWebURLAuthenticationChallenge *challenge,
/* [in] */ IWebDataSource *dataSource)
{
- if (!gLayoutTestController->handlesAuthenticationChallenges())
+ COMPtr<IWebURLAuthenticationChallengeSender> sender;
+ if (!challenge || FAILED(challenge->sender(&sender)))
return E_FAIL;
+
+ if (!gLayoutTestController->handlesAuthenticationChallenges()) {
+ printf("%S - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet\n", descriptionSuitableForTestResult(identifier).c_str());
+ sender->continueWithoutCredentialForAuthenticationChallenge(challenge);
+ return S_OK;
+ }
const char* user = gLayoutTestController->authenticationUsername().c_str();
const char* password = gLayoutTestController->authenticationPassword().c_str();
printf("%S - didReceiveAuthenticationChallenge - Responding with %s:%s\n", descriptionSuitableForTestResult(identifier).c_str(), user, password);
-
- COMPtr<IWebURLAuthenticationChallengeSender> sender;
- if (!challenge || FAILED(challenge->sender(&sender)))
- return E_FAIL;
-
+
COMPtr<IWebURLCredential> credential;
if (FAILED(WebKitCreateInstance(CLSID_WebURLCredential, 0, IID_IWebURLCredential, (void**)&credential)))
return E_FAIL;
@@ -309,10 +336,10 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didReceiveResponse(
if (FAILED(response->URL(&urlBSTR)))
E_FAIL;
- wstring url = urlSuitableForTestResult(wstringFromBSTR(urlBSTR));
+ wstring url = wstringFromBSTR(urlBSTR);
::SysFreeString(urlBSTR);
- printf("%S has MIME type %S\n", url.c_str(), mimeType.c_str());
+ printf("%S has MIME type %S\n", lastPathComponent(url).c_str(), mimeType.c_str());
}
return S_OK;
@@ -326,11 +353,12 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFinishLoadingFromDataSource(
{
if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) {
printf("%S - didFinishLoading\n",
- descriptionSuitableForTestResult(identifier).c_str()),
- urlMap().remove(identifier);
+ descriptionSuitableForTestResult(identifier).c_str());
}
- return S_OK;
+ removeIdentifierForRequest(webView, identifier);
+
+ return S_OK;
}
HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFailLoadingWithError(
@@ -343,8 +371,9 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFailLoadingWithError(
printf("%S - didFailLoadingWithError: %S\n",
descriptionSuitableForTestResult(identifier).c_str(),
descriptionSuitableForTestResult(error, identifier).c_str());
- urlMap().remove(identifier);
}
+ removeIdentifierForRequest(webView, identifier);
+
return S_OK;
}
diff --git a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h
index 924727b..3f20f47 100644
--- a/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h
+++ b/WebKitTools/DumpRenderTree/win/ResourceLoadDelegate.h
@@ -30,8 +30,10 @@
#define ResourceLoadDelegate_h
#include <WebKit/WebKit.h>
+#include <string>
+#include <wtf/HashMap.h>
-class ResourceLoadDelegate : public IWebResourceLoadDelegate {
+class ResourceLoadDelegate : public IWebResourceLoadDelegate, public IWebResourceLoadDelegatePrivate2 {
public:
ResourceLoadDelegate();
virtual ~ResourceLoadDelegate();
@@ -95,8 +97,22 @@ public:
/* [in] */ IWebView *webView,
/* [in] */ IWebError *error,
/* [in] */ IWebDataSource *dataSource) { return E_NOTIMPL; }
+
+ // IWebResourceLoadDelegatePrivate2
+ virtual HRESULT STDMETHODCALLTYPE removeIdentifierForRequest(
+ /* [in] */ IWebView *webView,
+ /* [in] */ unsigned long identifier);
-protected:
+private:
+ static std::wstring descriptionSuitableForTestResult(IWebURLRequest*);
+ static std::wstring descriptionSuitableForTestResult(IWebURLResponse*);
+ std::wstring descriptionSuitableForTestResult(unsigned long) const;
+ std::wstring descriptionSuitableForTestResult(IWebError*, unsigned long) const;
+
+ typedef HashMap<unsigned long, std::wstring> IdentifierMap;
+ IdentifierMap& urlMap() { return m_urlMap; }
+ IdentifierMap m_urlMap;
+
ULONG m_refCount;
};
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj
deleted file mode 100644
index 0177d99..0000000
--- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/TestNetscapePlugin.vcproj
+++ /dev/null
@@ -1,409 +0,0 @@
-<?xml version="1.0" encoding="windows-1251"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="TestNetscapePlugin"
- ProjectGUID="{C0737398-3565-439E-A2B8-AB2BE4D5430C}"
- RootNamespace="TestNetscapePlugin"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(ProjectDir)..\..\TestNetscapePlugin.subproj&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
- PreprocessorDefinitions="_USRDLL;TESTNETSCAPEPLUGIN_EXPORTS;snprintf=_snprintf"
- DisableSpecificWarnings="4819"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
- ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(ProjectDir)..\..\TestNetscapePlugin.subproj&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
- PreprocessorDefinitions="_USRDLL;TESTNETSCAPEPLUGIN_EXPORTS;snprintf=_snprintf"
- DisableSpecificWarnings="4819"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
- ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
- />
- </Configuration>
- <Configuration
- Name="Debug_Internal|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(ProjectDir)..\..\TestNetscapePlugin.subproj&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
- PreprocessorDefinitions="_USRDLL;TESTNETSCAPEPLUGIN_EXPORTS;snprintf=_snprintf"
- RuntimeLibrary="3"
- DisableSpecificWarnings="4819"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
- ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
- />
- </Configuration>
- <Configuration
- Name="Debug_Cairo|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(ProjectDir)..\..\TestNetscapePlugin.subproj&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
- PreprocessorDefinitions="_USRDLL;TESTNETSCAPEPLUGIN_EXPORTS;snprintf=_snprintf"
- DisableSpecificWarnings="4819"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
- ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
- />
- </Configuration>
- <Configuration
- Name="Debug_All|Win32"
- ConfigurationType="2"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(ProjectDir)..\..\TestNetscapePlugin.subproj&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
- PreprocessorDefinitions="_USRDLL;TESTNETSCAPEPLUGIN_EXPORTS;snprintf=_snprintf"
- RuntimeLibrary="3"
- DisableSpecificWarnings="4819"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- AdditionalIncludeDirectories=""
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix)\np$(ProjectName)$(WebKitConfigSuffix).dll"
- ModuleDefinitionFile="TestNetscapePlugin$(WebKitConfigSuffix).def"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath=".\main.cpp"
- >
- </File>
- <File
- RelativePath="..\..\TestNetscapePlugIn.subproj\PluginObject.cpp"
- >
- </File>
- <File
- RelativePath="..\..\TestNetscapePlugIn.subproj\PluginObject.h"
- >
- </File>
- <File
- RelativePath=".\resource.h"
- >
- </File>
- <File
- RelativePath=".\TestNetscapePlugin.def"
- >
- </File>
- <File
- RelativePath=".\TestNetscapePlugin.rc"
- >
- </File>
- <File
- RelativePath=".\TestNetscapePlugin_debug.def"
- >
- </File>
- <File
- RelativePath="..\..\TestNetscapePlugIn.subproj\TestObject.cpp"
- >
- </File>
- <File
- RelativePath="..\..\TestNetscapePlugIn.subproj\TestObject.h"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
deleted file mode 100644
index 08a2f6a..0000000
--- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in
- consideration of your agreement to the following terms, and your use, installation,
- modification or redistribution of this Apple software constitutes acceptance of these
- terms. If you do not agree with these terms, please do not use, install, modify or
- redistribute this Apple software.
-
- In consideration of your agreement to abide by the following terms, and subject to these
- terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in
- this original Apple software (the "Apple Software"), to use, reproduce, modify and
- redistribute the Apple Software, with or without modifications, in source and/or binary
- forms; provided that if you redistribute the Apple Software in its entirety and without
- modifications, you must retain this notice and the following text and disclaimers in all
- such redistributions of the Apple Software. Neither the name, trademarks, service marks
- or logos of Apple Computer, Inc. may be used to endorse or promote products derived from
- the Apple Software without specific prior written permission from Apple. Except as expressly
- stated in this notice, no other rights or licenses, express or implied, are granted by Apple
- herein, including but not limited to any patent rights that may be infringed by your
- derivative works or by other works in which the Apple Software may be incorporated.
-
- The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES,
- EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS
- USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
-
- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE,
- REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND
- WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
- OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "PluginObject.h"
-
-#include <stdio.h>
-
-extern "C"
-NPError __stdcall NP_Initialize(NPNetscapeFuncs* browserFuncs)
-{
- browser = browserFuncs;
- return NPERR_NO_ERROR;
-}
-
-extern "C"
-NPError __stdcall NP_GetEntryPoints(NPPluginFuncs* pluginFuncs)
-{
- pluginFuncs->version = 11;
- pluginFuncs->size = sizeof(pluginFuncs);
- pluginFuncs->newp = NPP_New;
- pluginFuncs->destroy = NPP_Destroy;
- pluginFuncs->setwindow = NPP_SetWindow;
- pluginFuncs->newstream = NPP_NewStream;
- pluginFuncs->destroystream = NPP_DestroyStream;
- pluginFuncs->asfile = NPP_StreamAsFile;
- pluginFuncs->writeready = NPP_WriteReady;
- pluginFuncs->write = (NPP_WriteProcPtr)NPP_Write;
- pluginFuncs->print = NPP_Print;
- pluginFuncs->event = NPP_HandleEvent;
- pluginFuncs->urlnotify = NPP_URLNotify;
- pluginFuncs->getvalue = NPP_GetValue;
- pluginFuncs->setvalue = NPP_SetValue;
-
- return NPERR_NO_ERROR;
-}
-
-
-extern "C"
-NPError __stdcall NP_Shutdown()
-{
- return NPERR_NO_ERROR;
-}
-
-static void executeScript(const PluginObject* object, const char* script)
-{
- NPObject *windowScriptObject;
- browser->getvalue(object->npp, NPNVWindowNPObject, &windowScriptObject);
-
- NPString npScript;
- npScript.UTF8Characters = script;
- npScript.UTF8Length = strlen(script);
-
- NPVariant browserResult;
- browser->evaluate(object->npp, windowScriptObject, &npScript, &browserResult);
- browser->releasevariantvalue(&browserResult);
-}
-
-NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char *argn[], char *argv[], NPSavedData *saved)
-{
- if (browser->version >= 14) {
- PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass());
-
- for (int16 i = 0; i < argc; i++) {
- if (_stricmp(argn[i], "onstreamload") == 0 && !obj->onStreamLoad)
- obj->onStreamLoad = _strdup(argv[i]);
- else if (_stricmp(argn[i], "onStreamDestroy") == 0 && !obj->onStreamDestroy)
- obj->onStreamDestroy = _strdup(argv[i]);
- else if (_stricmp(argn[i], "onURLNotify") == 0 && !obj->onURLNotify)
- obj->onURLNotify = _strdup(argv[i]);
- else if (_stricmp(argn[i], "onDestroy") == 0 && !obj->onDestroy)
- obj->onDestroy = _strdup(argv[i]);
- else if (_stricmp(argn[i], "logSrc") == 0) {
- for (int i = 0; i < argc; i++)
- if (_stricmp(argn[i], "src") == 0)
- pluginLog(instance, "src: %s", argv[i]);
- } else if (_stricmp(argn[i], "testdocumentopenindestroystream") == 0)
- obj->testDocumentOpenInDestroyStream = TRUE;
- else if (_stricmp(argn[i], "testwindowopen") == 0)
- obj->testWindowOpen = TRUE;
- }
-
- instance->pdata = obj;
- }
-
- return NPERR_NO_ERROR;
-}
-
-NPError NPP_Destroy(NPP instance, NPSavedData **save)
-{
- PluginObject *obj = (PluginObject*)instance->pdata;
- if (obj) {
- if (obj->onStreamLoad)
- free(obj->onStreamLoad);
-
- if (obj->onURLNotify)
- free(obj->onURLNotify);
-
- if (obj->onStreamDestroy)
- free(obj->onStreamDestroy);
-
- if (obj->onDestroy) {
- executeScript(obj, obj->onDestroy);
- free(obj->onDestroy);
- }
-
- if (obj->logDestroy)
- printf("PLUGIN: NPP_Destroy\n");
-
- browser->releaseobject(&obj->header);
- }
- return NPERR_NO_ERROR;
-}
-
-NPError NPP_SetWindow(NPP instance, NPWindow *window)
-{
- PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
-
- if (obj) {
- if (obj->testWindowOpen) {
- testWindowOpen(instance);
- obj->testWindowOpen = FALSE;
- }
- }
-
- return NPERR_NO_ERROR;
-}
-
-NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype)
-{
- PluginObject* obj = (PluginObject*)instance->pdata;
-
- if (obj->returnErrorFromNewStream)
- return NPERR_GENERIC_ERROR;
-
- obj->stream = stream;
- *stype = NP_ASFILEONLY;
-
- if (obj->onStreamLoad)
- executeScript(obj, obj->onStreamLoad);
-
- return NPERR_NO_ERROR;
-}
-
-NPError NPP_DestroyStream(NPP instance, NPStream *stream, NPReason reason)
-{
- PluginObject* obj = (PluginObject*)instance->pdata;
-
- if (obj->onStreamDestroy)
- executeScript(obj, obj->onStreamDestroy);
-
- if (obj->testDocumentOpenInDestroyStream) {
- testDocumentOpen(instance);
- }
-
- return NPERR_NO_ERROR;
-}
-
-int32 NPP_WriteReady(NPP instance, NPStream *stream)
-{
- return 0;
-}
-
-int32 NPP_Write(NPP instance, NPStream *stream, int32 offset, int32 len, void *buffer)
-{
- return 0;
-}
-
-void NPP_StreamAsFile(NPP instance, NPStream *stream, const char *fname)
-{
-}
-
-void NPP_Print(NPP instance, NPPrint *platformPrint)
-{
-}
-
-int16 NPP_HandleEvent(NPP instance, void *event)
-{
- PluginObject *obj = (PluginObject*)instance->pdata;
- if (!obj->eventLogging)
- return 0;
-
- // FIXME: Implement this
- return 0;
-}
-
-void NPP_URLNotify(NPP instance, const char *url, NPReason reason, void *notifyData)
-{
- PluginObject *obj = (PluginObject*)instance->pdata;
-
- if (obj->onURLNotify)
- executeScript(obj, obj->onURLNotify);
-
- handleCallback(obj, url, reason, notifyData);
-}
-
-NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
-{
- if (variable == NPPVpluginScriptableNPObject) {
- void **v = (void **)value;
- PluginObject *obj = (PluginObject*)instance->pdata;
- // Return value is expected to be retained
- browser->retainobject((NPObject *)obj);
- *v = obj;
- return NPERR_NO_ERROR;
- }
- return NPERR_GENERIC_ERROR;
-}
-
-NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
-{
- return NPERR_GENERIC_ERROR;
-}
diff --git a/WebKitTools/DumpRenderTree/win/UIDelegate.cpp b/WebKitTools/DumpRenderTree/win/UIDelegate.cpp
index 16724d7..1e7669f 100755
--- a/WebKitTools/DumpRenderTree/win/UIDelegate.cpp
+++ b/WebKitTools/DumpRenderTree/win/UIDelegate.cpp
@@ -180,6 +180,10 @@ HRESULT STDMETHODCALLTYPE UIDelegate::QueryInterface(REFIID riid, void** ppvObje
*ppvObject = static_cast<IWebUIDelegate2*>(this);
else if (IsEqualGUID(riid, IID_IWebUIDelegatePrivate))
*ppvObject = static_cast<IWebUIDelegatePrivate*>(this);
+ else if (IsEqualGUID(riid, IID_IWebUIDelegatePrivate2))
+ *ppvObject = static_cast<IWebUIDelegatePrivate2*>(this);
+ else if (IsEqualGUID(riid, IID_IWebUIDelegatePrivate3))
+ *ppvObject = static_cast<IWebUIDelegatePrivate3*>(this);
else
return E_NOINTERFACE;
@@ -485,7 +489,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;
}
@@ -625,7 +629,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::webViewDidInvalidate(
HRESULT STDMETHODCALLTYPE UIDelegate::setStatusText(IWebView*, BSTR text)
{
if (gLayoutTestController->dumpStatusCallbacks())
- printf("UI DELEGATE STATUS CALLBACK: setStatusText:%S\n", text ? text : L"");
+ printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text ? toUTF8(text).c_str() : "");
return S_OK;
}
@@ -634,3 +638,25 @@ HRESULT STDMETHODCALLTYPE UIDelegate::desktopNotificationsDelegate(IWebDesktopNo
m_desktopNotifications.copyRefTo(result);
return S_OK;
}
+
+HRESULT STDMETHODCALLTYPE UIDelegate::createWebViewWithRequest(IWebView* sender, IWebURLRequest* request, IPropertyBag* windowFeatures, IWebView** newWebView)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE UIDelegate::drawBackground(IWebView* sender, OLE_HANDLE hdc, const RECT* dirtyRect)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE UIDelegate::decidePolicyForGeolocationRequest(IWebView* sender, IWebFrame* frame, IWebSecurityOrigin* origin, IWebGeolocationPolicyListener* listener)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE UIDelegate::didPressMissingPluginButton(IDOMElement* element)
+{
+ printf("MISSING PLUGIN BUTTON PRESSED\n");
+ return S_OK;
+}
+
diff --git a/WebKitTools/DumpRenderTree/win/UIDelegate.h b/WebKitTools/DumpRenderTree/win/UIDelegate.h
index 436e31a..0c9fdaf 100755
--- a/WebKitTools/DumpRenderTree/win/UIDelegate.h
+++ b/WebKitTools/DumpRenderTree/win/UIDelegate.h
@@ -37,7 +37,7 @@
class DRTUndoManager;
class DRTDesktopNotificationPresenter;
-class UIDelegate : public IWebUIDelegate2, IWebUIDelegatePrivate {
+class UIDelegate : public IWebUIDelegate2, IWebUIDelegatePrivate3 {
public:
UIDelegate();
@@ -325,6 +325,14 @@ public:
/* [in] */ HDC hDC,
/* [in] */ RECT rect);
+ virtual HRESULT STDMETHODCALLTYPE createWebViewWithRequest(IWebView* sender, IWebURLRequest* request, IPropertyBag* windowFeatures, IWebView** newWebView);
+
+ virtual HRESULT STDMETHODCALLTYPE drawBackground(IWebView* sender, OLE_HANDLE hdc, const RECT* dirtyRect);
+
+ virtual HRESULT STDMETHODCALLTYPE decidePolicyForGeolocationRequest(IWebView* sender, IWebFrame* frame, IWebSecurityOrigin* origin, IWebGeolocationPolicyListener* listener);
+
+ virtual HRESULT STDMETHODCALLTYPE didPressMissingPluginButton(IDOMElement*);
+
protected:
// IWebUIDelegatePrivate
diff --git a/WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp b/WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp
index 7c60d3d..a24ca37 100644
--- a/WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/WorkQueueItemWin.cpp
@@ -81,6 +81,22 @@ bool LoadItem::invoke() const
return true;
}
+bool LoadHTMLStringItem::invoke() const
+{
+ wstring content = jsStringRefToWString(m_content.get());
+ wstring baseURL = jsStringRefToWString(m_baseURL.get());
+
+ BSTR contentBSTR = SysAllocString(content.c_str());
+ BSTR baseURLBSTR = SysAllocString(baseURL.c_str());
+
+ frame->loadHTMLString(contentBSTR, baseURLBSTR);
+
+ SysFreeString(contentBSTR);
+ SysFreeString(baseURLBSTR);
+
+ return true;
+}
+
bool ReloadItem::invoke() const
{
COMPtr<IWebView> webView;
diff --git a/WebKitTools/DumpRenderTree/wscript b/WebKitTools/DumpRenderTree/wscript
index 5e6c597..4aaedb4 100644
--- a/WebKitTools/DumpRenderTree/wscript
+++ b/WebKitTools/DumpRenderTree/wscript
@@ -33,6 +33,7 @@ include_paths = [
os.path.join(output_dir),
os.path.join(wk_root, 'JavaScriptCore'),
os.path.join(wk_root, 'WebCore'),
+ os.path.join(wk_root, 'WebCore', 'bindings', 'wx'),
os.path.join(wk_root, 'WebKit', 'wx'),
'.',
'wx'
@@ -57,8 +58,8 @@ def build(bld):
includes = ' '.join(include_paths),
source = sources,
target = 'DumpRenderTree',
- uselib = 'JSCORE ICU WXWEBKIT WX ' + get_config(),
+ uselib = 'ICU WX ' + get_config(),
libpath = [output_dir],
- uselib_local = '',
+ uselib_local = 'jscore wxwebkit',
install_path = output_dir)
diff --git a/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp b/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
index f905786..7142af2 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;
@@ -201,13 +201,11 @@ void dump()
}
}
- if (dumpPixels) {
- if (!gLayoutTestController->dumpAsText() &&
- !gLayoutTestController->dumpDOMAsWebArchive() &&
- !gLayoutTestController->dumpSourceAsWebArchive()) {
- // FIXME: Add support for dumping pixels
- }
-
+ if (dumpPixels
+ && gLayoutTestController->generatePixelResults()
+ && !gLayoutTestController->dumpDOMAsWebArchive()
+ && !gLayoutTestController->dumpSourceAsWebArchive()) {
+ // FIXME: Add support for dumping pixels
fflush(stdout);
}
@@ -215,8 +213,7 @@ void dump()
fflush(stdout);
fflush(stderr);
- gLayoutTestController->deref();
- gLayoutTestController = 0;
+ gLayoutTestController.clear();
}
static void runTest(const wxString testPathOrURL)
@@ -238,7 +235,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 +334,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 3bc84cd..32614c1 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -35,6 +35,8 @@
#include <JavaScriptCore/JSRetainPtr.h>
#include <JavaScriptCore/JSStringRef.h>
+#include <stdio.h>
+
LayoutTestController::~LayoutTestController()
@@ -133,6 +135,11 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path)
{
}
+void LayoutTestController::setViewModeMediaFeature(JSStringRef mode)
+{
+ // FIXME: implement
+}
+
void LayoutTestController::setWindowIsKey(bool windowIsKey)
{
// FIXME: implement
@@ -165,12 +172,17 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled
// FIXME: implement
}
+void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled)
+{
+ // FIXME: implement
+}
+
void LayoutTestController::setXSSAuditorEnabled(bool enabled)
{
// FIXME: implement
}
-void LayoutTestController::setFrameSetFlatteningEnabled(bool enabled)
+void LayoutTestController::setFrameFlatteningEnabled(bool enabled)
{
// FIXME: implement
}
@@ -180,6 +192,11 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled)
// FIXME: implement
}
+void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled)
+{
+ // FIXME: implement
+}
+
void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag)
{
// FIXME: implement
@@ -190,6 +207,11 @@ void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled)
// FIXME: implement
}
+void LayoutTestController::setPluginsEnabled(bool flag)
+{
+ // FIXME: Implement
+}
+
bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
{
// FIXME: implement
@@ -211,6 +233,16 @@ void LayoutTestController::clearPersistentUserStyleSheet()
// FIXME: implement
}
+void LayoutTestController::clearAllApplicationCaches()
+{
+ // FIXME: implement to support Application Cache quotas.
+}
+
+void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota)
+{
+ // FIXME: implement to support Application Cache quotas.
+}
+
void LayoutTestController::clearAllDatabases()
{
// FIXME: implement
@@ -237,6 +269,16 @@ unsigned LayoutTestController::numberOfActiveAnimations() const
return 0;
}
+void LayoutTestController::suspendAnimations() const
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::resumeAnimations() const
+{
+ // FIXME: implement
+}
+
unsigned LayoutTestController::workerThreadCount() const
{
// FIXME: implement
@@ -254,6 +296,12 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop
return false;
}
+void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+ // FIXME: Implement for DeviceOrientation layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=30335.
+}
+
void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
// FIXME: Implement for Geolocation layout tests.
@@ -266,6 +314,18 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message
// See https://bugs.webkit.org/show_bug.cgi?id=28264.
}
+void LayoutTestController::setGeolocationPermission(bool allow)
+{
+ // FIXME: Implement for Geolocation layout tests.
+ setGeolocationPermissionCommon(allow);
+}
+
+void LayoutTestController::setMockSpeechInputResult(JSStringRef result, JSStringRef language)
+{
+ // FIXME: Implement for speech input layout tests.
+ // See https://bugs.webkit.org/show_bug.cgi?id=39485.
+}
+
void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled)
{
// FIXME: implement
@@ -310,12 +370,12 @@ void LayoutTestController::overridePreference(JSStringRef /* key */, JSStringRef
// FIXME: implement
}
-void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart)
+void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
{
printf("LayoutTestController::addUserScript not implemented.\n");
}
-void LayoutTestController::addUserStyleSheet(JSStringRef source)
+void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
{
printf("LayoutTestController::addUserStyleSheet not implemented.\n");
}
@@ -355,9 +415,19 @@ void LayoutTestController::disableImageLoading()
}
-void LayoutTestController::whiteListAccessFromOrigin(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
{
+ // FIXME: implement
+}
+void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains)
+{
+ // FIXME: implement
+}
+
+void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy)
+{
+ // FIXME: implement
}
JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef id)
@@ -375,4 +445,86 @@ int LayoutTestController::numberOfPages(float, float)
{
// FIXME: implement
return -1;
-} \ No newline at end of file
+}
+
+void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
+{
+
+}
+
+void LayoutTestController::apiTestGoToCurrentBackForwardItem()
+{
+
+}
+
+void LayoutTestController::setSpatialNavigationEnabled(bool)
+{
+
+}
+
+void LayoutTestController::setWebViewEditable(bool)
+{
+}
+
+bool LayoutTestController::callShouldCloseOnWebView()
+{
+ return false;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+ return 0;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const
+{
+ return 0;
+}
+
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef)
+{
+ return 0;
+}
+
+JSValueRef LayoutTestController::nodesFromRect(JSContextRef context, JSValueRef value, int x, int y, unsigned top, unsigned right, unsigned bottom, unsigned left, bool ignoreClipping)
+{
+ // FIXME: Implement this.
+ return 0;
+}
+
+void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef)
+{
+}
+
+void LayoutTestController::setEditingBehavior(const char* editingBehavior)
+{
+ // FIXME: Implement
+}
+
+void LayoutTestController::abortModal()
+{
+}
+
+bool LayoutTestController::hasSpellingMarker(int, int)
+{
+ // FIXME: Implement
+ return false;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+{
+ // FIXME: Implement
+ return 0;
+}
+
+bool LayoutTestController::isPageBoxVisible(int pageNumber) const
+{
+ // FIXME: Implement
+ return true;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const
+{
+ // FIXME: Implement
+ return 0;
+}
diff --git a/WebKitTools/DumpRenderTree/wx/WorkQueueItemWx.cpp b/WebKitTools/DumpRenderTree/wx/WorkQueueItemWx.cpp
index 3e8da19..e6ecb75 100644
--- a/WebKitTools/DumpRenderTree/wx/WorkQueueItemWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/WorkQueueItemWx.cpp
@@ -36,6 +36,11 @@ bool LoadItem::invoke() const
return false;
}
+bool LoadHTMLStringItem::invoke() const
+{
+ return false;
+}
+
bool ReloadItem::invoke() const
{
return false;
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/blank_wsh.py b/WebKitTools/EWSTools/boot.sh
index 7f87c6a..733441e 100644
--- a/WebKitTools/pywebsocket/test/testdata/handlers/blank_wsh.py
+++ b/WebKitTools/EWSTools/boot.sh
@@ -1,5 +1,5 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
+#!/bin/sh
+# Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -27,5 +27,4 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# intentionally left blank
+screen -c ~/tools/screen-config
diff --git a/WebKitTools/EWSTools/create-webkit-git b/WebKitTools/EWSTools/create-webkit-git
new file mode 100755
index 0000000..0088a47
--- /dev/null
+++ b/WebKitTools/EWSTools/create-webkit-git
@@ -0,0 +1,36 @@
+#/bin/bash
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd /mnt/git
+git clone git://git.webkit.org/WebKit.git webkit
+cd webkit
+git svn init -T trunk http://svn.webkit.org/repository/webkit
+git update-ref refs/remotes/trunk origin/master
+git svn rebase
+
diff --git a/WebKitTools/EWSTools/screen-config b/WebKitTools/EWSTools/screen-config
new file mode 100644
index 0000000..5c003df
--- /dev/null
+++ b/WebKitTools/EWSTools/screen-config
@@ -0,0 +1,4 @@
+screen -t style ./start-queue.sh style-queue
+screen -t qt ./start-queue.sh qt-ews
+screen -t kr ./start-queue.sh chromium-ews
+screen -t gtk ./start-queue.sh gtk-ews
diff --git a/WebKitTools/EWSTools/start-commit-queue.sh b/WebKitTools/EWSTools/start-commit-queue.sh
new file mode 100755
index 0000000..c55029a
--- /dev/null
+++ b/WebKitTools/EWSTools/start-commit-queue.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd "$HOME/Projects/CommitQueue"
+while :
+do
+ git reset --hard trunk
+ git clean -f
+ git rebase --abort
+ git svn rebase
+ ./WebKitTools/Scripts/webkit-patch commit-queue --no-confirm --exit-after-iteration 10
+done
diff --git a/WebKitTools/EWSTools/start-queue.sh b/WebKitTools/EWSTools/start-queue.sh
new file mode 100755
index 0000000..7835e74
--- /dev/null
+++ b/WebKitTools/EWSTools/start-queue.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cd /mnt/git/webkit-$1
+while :
+do
+ git reset --hard
+ git clean -f
+ git svn rebase
+ ./WebKitTools/Scripts/webkit-patch $1 --no-confirm --exit-after-iteration 10
+done
diff --git a/WebKitTools/EWSTools/ubuntu-ews-packages b/WebKitTools/EWSTools/ubuntu-ews-packages
new file mode 100644
index 0000000..a7917a0
--- /dev/null
+++ b/WebKitTools/EWSTools/ubuntu-ews-packages
@@ -0,0 +1,61 @@
+subversion
+git-core
+git-svn
+binutils-gold
+python-mechanize
+libqt4-dev
+gperf
+bison
+fakeroot
+flex
+g++
+g++-multilib
+gperf
+autoconf
+automake
+libapache2-mod-php5
+libasound2-dev
+libbz2-dev
+libicu-dev
+libphonon-dev
+libsqlite3-dev
+libcairo2-dev
+libdbus-glib-1-dev
+libgconf2-dev
+libgl1-mesa-dev
+libglu1-mesa-dev
+libglib2.0-dev
+libjpeg62-dev
+libnspr4-dev
+libnss3-dev
+libpam0g-dev
+libtool
+libgtk2.0-dev
+libpango1.0-dev
+libicu-dev
+libxslt-dev
+libxslt1-dev
+libxss-dev
+libsoup2.4-dev
+libsqlite3-dev
+mesa-common-dev
+patch
+perl
+pkg-config
+python
+libcupsys2-dev
+libgnome-keyring-dev
+libcurl4-gnutls-dev
+libcupsys2-dev
+gperf
+bison
+flex
+libjpeg62-dev
+libpng12-dev
+libxt-dev
+autotools-dev
+libgstreamer-plugins-base0.10-dev
+libenchant-dev
+libgail-dev
+gtk-doc-tools
+libgeoclue-dev
diff --git a/WebKitTools/EWebLauncher/main.c b/WebKitTools/EWebLauncher/main.c
new file mode 100644
index 0000000..8ba58d8
--- /dev/null
+++ b/WebKitTools/EWebLauncher/main.c
@@ -0,0 +1,858 @@
+/*
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009, 2010 ProFUSION embedded systems
+ * Copyright (C) 2009, 2010 Samsung Electronics
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "EWebKit.h"
+
+#include <ctype.h>
+#include <Ecore.h>
+#include <Ecore_Evas.h>
+#include <Ecore_File.h>
+#include <Ecore_Getopt.h>
+#include <Ecore_X.h>
+#include <Edje.h>
+#include <Evas.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define DEFAULT_WIDTH 800
+#define DEFAULT_HEIGHT 600
+#define DEFAULT_ZOOM_INIT 1.0
+
+#define info(format, args...) \
+ do { \
+ if (verbose) \
+ printf(format, ##args); \
+ } while (0)
+
+#define MIN_ZOOM_LEVEL 0
+#define DEFAULT_ZOOM_LEVEL 5
+#define MAX_ZOOM_LEVEL 13
+
+static int currentZoomLevel = DEFAULT_ZOOM_LEVEL;
+
+// the zoom values are chosen to be like in Mozilla Firefox 3
+static int zoomLevels[] = {30, 50, 67, 80, 90,
+ 100,
+ 110, 120, 133, 150, 170, 200, 240, 300};
+
+static int verbose = 0;
+
+static Eina_List *windows = NULL;
+
+static char *themePath = NULL;
+
+typedef struct _Window_Properties {
+ Eina_Bool toolbarsVisible:1;
+ Eina_Bool statusbarVisible:1;
+ Eina_Bool scrollbarsVisible:1;
+ Eina_Bool menubarVisible:1;
+} Window_Properties;
+
+Window_Properties windowProperties = { /* Pretend we have them and they are initially visible */
+ EINA_TRUE,
+ EINA_TRUE,
+ EINA_TRUE,
+ EINA_TRUE
+};
+
+static const Ecore_Getopt options = {
+ "EWebLauncher",
+ "%prog [options] [url]",
+ "0.0.1",
+ "(C)2008 INdT (The Nokia Technology Institute)\n"
+ "(C)2009, 2010 ProFUSION embedded systems\n"
+ "(C)2009, 2010 Samsung Electronics",
+ "GPL",
+ "Test Web Browser using the Enlightenment Foundation Libraries of WebKit",
+ EINA_TRUE, {
+ ECORE_GETOPT_STORE_STR
+ ('e', "engine", "ecore-evas engine to use."),
+ ECORE_GETOPT_CALLBACK_NOARGS
+ ('E', "list-engines", "list ecore-evas engines.",
+ ecore_getopt_callback_ecore_evas_list_engines, NULL),
+ ECORE_GETOPT_STORE_DEF_BOOL
+ ('F', "fullscreen", "fullscreen mode.", 0),
+ ECORE_GETOPT_CALLBACK_ARGS
+ ('g', "geometry", "geometry to use in x:y:w:h form.", "X:Y:W:H",
+ ecore_getopt_callback_geometry_parse, NULL),
+ ECORE_GETOPT_STORE_STR
+ ('t', "theme", "path to read the theme file from."),
+ ECORE_GETOPT_STORE_STR
+ ('U', "user-agent", "custom user agent string to use."),
+ ECORE_GETOPT_STORE_DEF_BOOL
+ ('S', "sudo-workaround", "Workaround mode for making Flash work with sudo.", 0),
+ ECORE_GETOPT_COUNT
+ ('v', "verbose", "be more verbose."),
+ ECORE_GETOPT_VERSION
+ ('V', "version"),
+ ECORE_GETOPT_COPYRIGHT
+ ('R', "copyright"),
+ ECORE_GETOPT_LICENSE
+ ('L', "license"),
+ ECORE_GETOPT_HELP
+ ('h', "help"),
+ ECORE_GETOPT_SENTINEL
+ }
+};
+
+typedef struct _Viewport {
+ int w;
+ int h;
+ float initScale;
+ float minScale;
+ float maxScale;
+ float devicePixelRatio;
+ Eina_Bool userScalable;
+} Viewport;
+
+typedef struct _ELauncher {
+ Ecore_Evas *ee;
+ Evas *evas;
+ Evas_Object *bg;
+ Evas_Object *browser;
+ const char *theme;
+ const char *userAgent;
+ Viewport viewport;
+} ELauncher;
+
+static void browserDestroy(Ecore_Evas *ee);
+static void closeWindow(Ecore_Evas *ee);
+static int browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Rectangle geometry, const char *engine, unsigned char isFullscreen, const char *databasePath);
+
+static void
+print_history(Eina_List *list)
+{
+ Eina_List *l;
+ void *d;
+
+ if (!verbose)
+ return;
+
+ printf("Session history contains:\n");
+
+ EINA_LIST_FOREACH(list, l, d) {
+ Ewk_History_Item *item = (Ewk_History_Item*)d;
+ cairo_surface_t *cs = ewk_history_item_icon_surface_get(item);
+ char buf[PATH_MAX];
+ int s = snprintf(buf, sizeof(buf), "/tmp/favicon-%s.png", ewk_history_item_uri_original_get(item));
+ for (s--; s >= (int)sizeof("/tmp/favicon-"); s--) {
+ if (!isalnum(buf[s]) && buf[s] != '.')
+ buf[s] = '_';
+ }
+ cs = ewk_history_item_icon_surface_get(item);
+
+ if (cs && cairo_surface_status(cs) == CAIRO_STATUS_SUCCESS)
+ cairo_surface_write_to_png(cs, buf);
+ else
+ buf[0] = '\0';
+
+ printf("* '%s' title='%s' icon='%s'\n",
+ ewk_history_item_uri_original_get(item),
+ ewk_history_item_title_get(item), buf);
+ }
+}
+
+static void
+zoom_level_set(Evas_Object *webview, int level)
+{
+ float factor = ((float) zoomLevels[level]) / 100.0;
+ Evas_Coord ox, oy, mx, my, cx, cy;
+ evas_pointer_canvas_xy_get(evas_object_evas_get(webview), &mx, &my);
+ evas_object_geometry_get(webview, &ox, &oy, NULL, NULL);
+ cx = mx - ox;
+ cy = my - oy;
+ ewk_view_zoom_animated_set(webview, factor, 0.5, cx, cy);
+}
+
+static void
+on_ecore_evas_resize(Ecore_Evas *ee)
+{
+ Evas_Object *webview;
+ Evas_Object *bg;
+ int w, h;
+
+ ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
+
+ bg = evas_object_name_find(ecore_evas_get(ee), "bg");
+ evas_object_move(bg, 0, 0);
+ evas_object_resize(bg, w, h);
+
+ webview = evas_object_name_find(ecore_evas_get(ee), "browser");
+ evas_object_move(webview, 10, 10);
+ evas_object_resize(webview, w - 20, h - 20);
+}
+
+static void
+title_set(Ecore_Evas *ee, const char *title, int progress)
+{
+ const char *appname = "EFL Test Launcher";
+ const char *separator = " - ";
+ char label[4096];
+ int size;
+
+ if (!title || !strcmp(title, "")) {
+ ecore_evas_title_set(ee, appname);
+ return;
+ }
+
+ if (progress < 100)
+ size = snprintf(label, sizeof(label), "%s (%d%%)%s%s", title, progress, separator, appname);
+ else
+ size = snprintf(label, sizeof(label), "%s %s%s", title, separator, appname);
+
+ if (size >= (int)sizeof(label))
+ return;
+
+ ecore_evas_title_set(ee, label);
+}
+
+/**
+ * This is en example function to adjust viewport via viewport tag's arguments.
+ * Application can invoke this function in order to adjust viewport tag when it is required.
+ */
+static void
+viewport_set()
+{
+ ELauncher *app;
+ app = (ELauncher*) eina_list_data_get(windows);
+
+ ewk_view_fixed_layout_size_set(app->browser, app->viewport.w, app->viewport.h);
+ ewk_view_zoom_set(app->browser, app->viewport.initScale, 0, 0);
+ if (!ewk_view_zoom_range_set(app->browser, app->viewport.minScale, app->viewport.maxScale))
+ info(" Fail to set zoom range. minScale = %f, maxScale = %f\n", app->viewport.minScale, app->viewport.maxScale);
+ ewk_view_user_scalable_set(app->browser, app->viewport.userScalable);
+}
+
+static void
+on_title_changed(void *user_data, Evas_Object *webview, void *event_info)
+{
+ ELauncher *app = (ELauncher *)user_data;
+ const char *title = (const char *)event_info;
+
+ title_set(app->ee, title, 100);
+}
+
+static void
+on_progress(void *user_data, Evas_Object *webview, void *event_info)
+{
+ ELauncher *app = (ELauncher *)user_data;
+ double *progress = (double *)event_info;
+
+ title_set(app->ee, ewk_view_title_get(app->browser), *progress * 100);
+}
+
+static void
+on_load_finished(void *user_data, Evas_Object *webview, void *event_info)
+{
+ const Ewk_Frame_Load_Error *err = (const Ewk_Frame_Load_Error *)event_info;
+
+ if (!err)
+ info("Succeeded loading page.\n");
+ else if (err->is_cancellation)
+ info("Load was cancelled.\n");
+ else
+ info("Failed loading page: %d %s \"%s\", url=%s\n",
+ err->code, err->domain, err->description, err->failing_url);
+}
+
+static void
+on_toolbars_visible_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool *visible = (Eina_Bool *)event_info;
+ if (*visible) {
+ info("Toolbars visible changed: show");
+ windowProperties.toolbarsVisible = EINA_TRUE;
+ } else {
+ info("Toolbars visible changed: hide");
+ windowProperties.toolbarsVisible = EINA_FALSE;
+ }
+}
+
+static void
+on_toolbars_visible_get(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool *visible = (Eina_Bool *)event_info;
+ *visible = windowProperties.toolbarsVisible;
+}
+
+static void
+on_statusbar_visible_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool *visible = (Eina_Bool *)event_info;
+ if (*visible) {
+ info("Statusbar visible changed: show");
+ windowProperties.statusbarVisible = EINA_TRUE;
+ } else {
+ info("Statusbar visible changed: hide");
+ windowProperties.statusbarVisible = EINA_FALSE;
+ }
+}
+
+static void
+on_statusbar_visible_get(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool *visible = (Eina_Bool *)event_info;
+ *visible = windowProperties.statusbarVisible;
+}
+
+static void
+on_scrollbars_visible_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool *visible = (Eina_Bool *)event_info;
+ if (*visible) {
+ info("Scrollbars visible changed: show");
+ windowProperties.scrollbarsVisible = EINA_TRUE;
+ } else {
+ info("Scrollbars visible changed: hide");
+ windowProperties.scrollbarsVisible = EINA_FALSE;
+ }
+}
+
+static void
+on_scrollbars_visible_get(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool *visible = (Eina_Bool *)event_info;
+ *visible = windowProperties.scrollbarsVisible;
+}
+
+static void
+on_menubar_visible_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool *visible = (Eina_Bool *)event_info;
+ if (*visible) {
+ info("Menubar visible changed: show");
+ windowProperties.menubarVisible = EINA_TRUE;
+ } else {
+ info("Menubar visible changed: hide");
+ windowProperties.menubarVisible = EINA_FALSE;
+ }
+}
+
+static void
+on_menubar_visible_get(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool *visible = (Eina_Bool *)event_info;
+ *visible = windowProperties.menubarVisible;
+}
+
+static void
+on_tooltip_text_set(void* user_data, Evas_Object* webview, void* event_info)
+{
+ const char *text = (const char *)event_info;
+ if (text && *text != '\0')
+ info("%s\n", text);
+}
+
+static void
+on_inputmethod_changed(void* user_data, Evas_Object* webview, void* event_info)
+{
+ Eina_Bool active = (Eina_Bool)(long)event_info;
+ unsigned int imh;
+ info("Keyboard changed: %d\n", active);
+
+ if (!active)
+ return;
+
+ imh = ewk_view_imh_get(webview);
+ info(" Keyboard flags: %#.2x\n", imh);
+
+}
+
+/**
+ * "viewport,changed" signal will be always emitted regardless of the viewport existence.
+ *
+ * If you don't want to process the viewport tag, you can either do nothing in this callback
+ * or simply ignore the signal in your application.
+ *
+ * More information about this can be found at http://developer.apple.com/safari/library/docum
+ * entation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html
+ */
+static void
+on_viewport_changed(void* user_data, Evas_Object* webview, void* event_info)
+{
+ ELauncher *app = (ELauncher *)user_data;
+
+ float w, h, initScale, minScale, maxScale, devicePixelRatio;
+ Eina_Bool userScalable;
+
+ ewk_view_viewport_attributes_get(webview, &w, &h, &initScale, &maxScale, &minScale, &devicePixelRatio, &userScalable);
+
+ /**
+ * If there is no argument in viewport tag, argument's value is -1.
+ */
+ if ((int)w == -1)
+ w = DEFAULT_WIDTH;
+ if ((int)h == -1)
+ h = DEFAULT_HEIGHT;
+ if ((int)initScale == -1)
+ initScale = DEFAULT_ZOOM_INIT; // There's no scale separated from zooming in webkit-efl.
+ if ((int)minScale == -1)
+ minScale = ewk_view_zoom_range_min_get(webview);
+ if ((int)maxScale == -1)
+ maxScale = ewk_view_zoom_range_max_get(webview);
+ if ((int)devicePixelRatio == -1)
+ devicePixelRatio = ewk_view_device_pixel_ratio_get(webview);
+ if ((int)userScalable == -1)
+ userScalable = EINA_TRUE;
+
+ app->viewport.w = (int)w;
+ app->viewport.h = (int)h;
+ app->viewport.initScale = initScale;
+ app->viewport.minScale = minScale;
+ app->viewport.maxScale = maxScale;
+ app->viewport.devicePixelRatio = devicePixelRatio;
+ app->viewport.userScalable = userScalable;
+ viewport_set();
+}
+
+static void
+on_mouse_down(void* data, Evas* e, Evas_Object* webview, void* event_info)
+{
+ Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down*) event_info;
+ if (ev->button == 2)
+ evas_object_focus_set(webview, !evas_object_focus_get(webview));
+}
+
+static void
+on_focus_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ info("the webview lost keyboard focus\n");
+}
+
+static void
+on_focus_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ info("the webview gained keyboard focus\n");
+}
+
+static void
+on_resized(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Coord w, h;
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+ ewk_view_fixed_layout_size_set(obj, w, h);
+}
+
+static void
+on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Key_Down *ev = (Evas_Event_Key_Down*) event_info;
+ ELauncher *app = data;
+ static const char *encodings[] = {
+ "ISO-8859-1",
+ "UTF-8",
+ NULL
+ };
+ static int currentEncoding = -1;
+
+ if (!strcmp(ev->key, "Escape")) {
+ closeWindow(app->ee);
+ } else if (!strcmp(ev->key, "F1")) {
+ info("Back (F1) was pressed\n");
+ if (ewk_view_back_possible(obj)) {
+ Ewk_History *history = ewk_view_history_get(obj);
+ Eina_List *list = ewk_history_back_list_get(history);
+ print_history(list);
+ ewk_history_item_list_free(list);
+ ewk_view_back(obj);
+ } else
+ info("Back ignored: No back history\n");
+ } else if (!strcmp(ev->key, "F2")) {
+ info("Forward (F2) was pressed\n");
+ if (ewk_view_forward_possible(obj)) {
+ Ewk_History *history = ewk_view_history_get(obj);
+ Eina_List *list = ewk_history_forward_list_get(history);
+ print_history(list);
+ ewk_history_item_list_free(list);
+ ewk_view_forward(obj);
+ } else
+ info("Forward ignored: No forward history\n");
+ } else if (!strcmp(ev->key, "F3")) {
+ currentEncoding++;
+ currentEncoding %= (sizeof(encodings) / sizeof(encodings[0]));
+ info("Set encoding (F3) pressed. New encoding to %s", encodings[currentEncoding]);
+ ewk_view_setting_encoding_custom_set(obj, encodings[currentEncoding]);
+ } else if (!strcmp(ev->key, "F4")) {
+ Evas_Object *frame = ewk_view_frame_main_get(obj);
+ Evas_Coord x, y;
+ Ewk_Hit_Test *ht;
+
+ evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x, &y);
+ ht = ewk_frame_hit_test_new(frame, x, y);
+ if (!ht)
+ printf("No hit test returned for point %d,%d\n", x, y);
+ else {
+ printf("Hit test for point %d,%d\n"
+ " pos=%3d,%3d\n"
+ " bounding_box=%d,%d + %dx%d\n"
+ " title='%s'\n"
+ " alternate_text='%s'\n"
+ " frame=%p (%s)\n"
+ " link {\n"
+ " text='%s'\n"
+ " url='%s'\n"
+ " title='%s'\n"
+ " target frame=%p (%s)\n"
+ " }\n"
+ " flags {\n"
+ " editable=%hhu\n"
+ " selected=%hhu\n"
+ " }\n",
+ x, y,
+ ht->x, ht->y,
+ ht->bounding_box.x, ht->bounding_box.y, ht->bounding_box.w, ht->bounding_box.h,
+ ht->title,
+ ht->alternate_text,
+ ht->frame, evas_object_name_get(ht->frame),
+ ht->link.text,
+ ht->link.url,
+ ht->link.title,
+ ht->link.target_frame, evas_object_name_get(ht->link.target_frame),
+ ht->flags.editable,
+ ht->flags.selected);
+ ewk_frame_hit_test_free(ht);
+ }
+
+ } else if (!strcmp(ev->key, "F5")) {
+ info("Reload (F5) was pressed, reloading.\n");
+ ewk_view_reload(obj);
+ } else if (!strcmp(ev->key, "F6")) {
+ info("Stop (F6) was pressed, stop loading.\n");
+ ewk_view_stop(obj);
+ /* } FIXME: uncomment code below after Bug 18662 lands upstream.
+ else if (!strcmp(ev->key, "F12")) {
+ bool status = ewk_webframe_object_keyboard_navigation_get(page);
+ ewk_webframe_object_keyboard_navigation_set(page, !status);
+ info("Command::keyboard navigation toggle\n");*/
+ } else if (!strcmp(ev->key, "F7")) {
+ info("Zoom out (F7) was pressed.\n");
+ if (currentZoomLevel > MIN_ZOOM_LEVEL)
+ zoom_level_set(obj, --currentZoomLevel);
+ } else if (!strcmp(ev->key, "F8")) {
+ info("Zoom in (F8) was pressed.\n");
+ if (currentZoomLevel < MAX_ZOOM_LEVEL)
+ zoom_level_set(obj, ++currentZoomLevel);
+ } else if (!strcmp(ev->key, "F9")) {
+ info("Create new window (F9) was pressed.\n");
+ Eina_Rectangle geometry = {0, 0, 0, 0};
+ browserCreate("http://www.google.com",
+ app->theme, app->userAgent, geometry, NULL, 0, NULL);
+ } else if (!strcmp(ev->key, "F10")) {
+ Evas_Coord x, y, w, h;
+ Evas_Object *frame = ewk_view_frame_main_get(obj);
+ float zoom = zoomLevels[currentZoomLevel] / 100.0;
+
+ ewk_frame_visible_content_geometry_get(frame, EINA_FALSE, &x, &y, &w, &h);
+ x -= w;
+ y -= h;
+ w *= 4;
+ h *= 4;
+ info("Pre-render %d,%d + %dx%d\n", x, y, w, h);
+ ewk_view_pre_render_region(obj, x, y, w, h, zoom);
+ }
+}
+
+static void
+on_browser_del(void *data, Evas *evas, Evas_Object *browser, void *event)
+{
+ ELauncher *app = (ELauncher*) data;
+
+ evas_object_event_callback_del(app->browser, EVAS_CALLBACK_KEY_DOWN, on_key_down);
+ evas_object_event_callback_del(app->browser, EVAS_CALLBACK_MOUSE_DOWN, on_mouse_down);
+ evas_object_event_callback_del(app->browser, EVAS_CALLBACK_FOCUS_IN, on_focus_in);
+ evas_object_event_callback_del(app->browser, EVAS_CALLBACK_FOCUS_OUT, on_focus_out);
+ evas_object_event_callback_del(app->browser, EVAS_CALLBACK_DEL, on_browser_del);
+}
+
+static void
+on_closeWindow(Ecore_Evas *ee)
+{
+ browserDestroy(ee);
+}
+
+static int
+quit(Eina_Bool success, const char *msg)
+{
+ edje_shutdown();
+ ecore_evas_shutdown();
+
+ if (msg)
+ fputs(msg, (success) ? stdout : stderr);
+
+ if (themePath) {
+ free(themePath);
+ themePath = NULL;
+ }
+
+ if (!success)
+ return EXIT_FAILURE;
+
+ return EXIT_SUCCESS;
+}
+
+static int
+browserCreate(const char *url, const char *theme, const char *userAgent, Eina_Rectangle geometry, const char *engine, unsigned char isFullscreen, const char *databasePath)
+{
+ if ((geometry.w <= 0) && (geometry.h <= 0)) {
+ geometry.w = DEFAULT_WIDTH;
+ geometry.h = DEFAULT_HEIGHT;
+ }
+
+ ELauncher *app = (ELauncher*) malloc(sizeof(ELauncher));
+ if (!app)
+ return quit(EINA_FALSE, "ERROR: could not create EWebLauncher window\n");
+
+ app->ee = ecore_evas_new(engine, 0, 0, geometry.w, geometry.h, NULL);
+
+ if (!app->ee)
+ return quit(EINA_FALSE, "ERROR: could not construct evas-ecore\n");
+
+ if (isFullscreen)
+ ecore_evas_fullscreen_set(app->ee, EINA_TRUE);
+
+ ecore_evas_title_set(app->ee, "EFL Test Launcher");
+ ecore_evas_callback_resize_set(app->ee, on_ecore_evas_resize);
+ ecore_evas_callback_delete_request_set(app->ee, closeWindow);
+
+ app->evas = ecore_evas_get(app->ee);
+
+ if (!app->evas)
+ return quit(EINA_FALSE, "ERROR: could not get evas from evas-ecore\n");
+
+ app->theme = theme;
+ app->userAgent = userAgent;
+
+ app->bg = evas_object_rectangle_add(app->evas);
+ evas_object_name_set(app->bg, "bg");
+ evas_object_color_set(app->bg, 255, 0, 255, 255);
+ evas_object_move(app->bg, 0, 0);
+ evas_object_resize(app->bg, geometry.w, geometry.h);
+ evas_object_layer_set(app->bg, EVAS_LAYER_MIN);
+ evas_object_show(app->bg);
+ app->browser = ewk_view_single_add(app->evas);
+
+ ewk_view_theme_set(app->browser, theme);
+ if (userAgent)
+ ewk_view_setting_user_agent_set(app->browser, userAgent);
+ ewk_view_setting_local_storage_database_path_set(app->browser, databasePath);
+
+ evas_object_name_set(app->browser, "browser");
+
+ evas_object_smart_callback_add(app->browser, "title,changed", on_title_changed, app);
+ evas_object_smart_callback_add(app->browser, "load,progress", on_progress, app);
+ evas_object_smart_callback_add(app->browser, "load,finished", on_load_finished, app);
+ evas_object_smart_callback_add(app->browser, "viewport,changed", on_viewport_changed, app);
+
+ evas_object_smart_callback_add(app->browser, "toolbars,visible,set", on_toolbars_visible_set, app);
+ evas_object_smart_callback_add(app->browser, "toolbars,visible,get", on_toolbars_visible_get, app);
+ evas_object_smart_callback_add(app->browser, "statusbar,visible,set", on_statusbar_visible_set, app);
+ evas_object_smart_callback_add(app->browser, "statusbar,visible,get", on_statusbar_visible_get, app);
+ evas_object_smart_callback_add(app->browser, "scrollbars,visible,set", on_scrollbars_visible_set, app);
+ evas_object_smart_callback_add(app->browser, "scrollbars,visible,get", on_scrollbars_visible_get, app);
+ evas_object_smart_callback_add(app->browser, "menubar,visible,set", on_menubar_visible_set, app);
+ evas_object_smart_callback_add(app->browser, "menubar,visible,get", on_menubar_visible_get, app);
+ evas_object_smart_callback_add(app->browser, "tooltip,text,set", on_tooltip_text_set, app);
+ evas_object_smart_callback_add(app->browser, "inputmethod,changed", on_inputmethod_changed, app);
+
+/* ewk_callback_resize_requested_add(app->browser, on_resize_requested, app->ee); */
+
+ evas_object_event_callback_add(app->browser, EVAS_CALLBACK_RESIZE, on_resized, app);
+ evas_object_event_callback_add(app->browser, EVAS_CALLBACK_KEY_DOWN, on_key_down, app);
+ evas_object_event_callback_add(app->browser, EVAS_CALLBACK_MOUSE_DOWN, on_mouse_down, app);
+ evas_object_event_callback_add(app->browser, EVAS_CALLBACK_FOCUS_IN, on_focus_in, app);
+ evas_object_event_callback_add(app->browser, EVAS_CALLBACK_FOCUS_OUT, on_focus_out, app);
+ evas_object_event_callback_add(app->browser, EVAS_CALLBACK_DEL, on_browser_del, app);
+
+ evas_object_move(app->browser, 10, 10);
+ evas_object_resize(app->browser, geometry.w - 20, geometry.h - 20);
+
+ if (url && (url[0] != '\0'))
+ ewk_view_uri_set(app->browser, url);
+
+ evas_object_show(app->browser);
+ ecore_evas_show(app->ee);
+
+ evas_object_focus_set(app->browser, EINA_TRUE);
+
+ windows = eina_list_append(windows, app);
+
+ return 1;
+}
+
+static void
+browserDestroy(Ecore_Evas *ee)
+{
+ ecore_evas_free(ee);
+ if (!eina_list_count(windows))
+ ecore_main_loop_quit();
+}
+
+static void
+closeWindow(Ecore_Evas *ee)
+{
+ Eina_List *l;
+ void *app;
+ EINA_LIST_FOREACH(windows, l, app)
+ {
+ if (((ELauncher*) app)->ee == ee)
+ break;
+ }
+ windows = eina_list_remove(windows, app);
+ browserDestroy(ee);
+ free(app);
+}
+
+static Eina_Bool
+main_signal_exit(void *data, int ev_type, void *ev)
+{
+ ELauncher *app;
+ while (windows) {
+ app = (ELauncher*) eina_list_data_get(windows);
+ ecore_evas_free(app->ee);
+ windows = eina_list_remove(windows, app);
+ }
+ if (!eina_list_count(windows))
+ ecore_main_loop_quit();
+ return EINA_TRUE;
+}
+
+static char *
+findThemePath(const char *theme)
+{
+ const char *defaultTheme = DATA_DIR"/default.edj";
+ char *rpath;
+ struct stat st;
+
+ if (!theme)
+ theme = defaultTheme;
+
+ rpath = realpath(theme, NULL);
+ if (!rpath)
+ return NULL;
+
+ if (stat(rpath, &st)) {
+ free(rpath);
+ return NULL;
+ }
+
+ return rpath;
+}
+
+int
+main(int argc, char *argv[])
+{
+ const char *default_url = "http://www.google.com/";
+
+ Eina_Rectangle geometry = {0, 0, 0, 0};
+ char *url = NULL;
+ char *userAgent = NULL;
+ const char *tmp;
+ const char *proxyUri;
+ char path[PATH_MAX];
+
+ char *engine = NULL;
+ char *theme = NULL;
+
+ unsigned char quitOption = 0;
+ unsigned char isFullscreen = 0;
+ unsigned char sudoWorkaround = 0;
+ int args;
+
+ Ecore_Getopt_Value values[] = {
+ ECORE_GETOPT_VALUE_STR(engine),
+ ECORE_GETOPT_VALUE_BOOL(quitOption),
+ ECORE_GETOPT_VALUE_BOOL(isFullscreen),
+ ECORE_GETOPT_VALUE_PTR_CAST(geometry),
+ ECORE_GETOPT_VALUE_STR(theme),
+ ECORE_GETOPT_VALUE_STR(userAgent),
+ ECORE_GETOPT_VALUE_BOOL(sudoWorkaround),
+ ECORE_GETOPT_VALUE_INT(verbose),
+ ECORE_GETOPT_VALUE_BOOL(quitOption),
+ ECORE_GETOPT_VALUE_BOOL(quitOption),
+ ECORE_GETOPT_VALUE_BOOL(quitOption),
+ ECORE_GETOPT_VALUE_BOOL(quitOption),
+ ECORE_GETOPT_VALUE_NONE
+ };
+
+ if (!ecore_evas_init())
+ return EXIT_FAILURE;
+
+ if (!edje_init()) {
+ ecore_evas_shutdown();
+ return EXIT_FAILURE;
+ }
+
+ ecore_app_args_set(argc, (const char**) argv);
+ args = ecore_getopt_parse(&options, values, argc, argv);
+
+ if (args < 0)
+ return quit(EINA_FALSE, "ERROR: could not parse options.\n");
+
+ if (quitOption)
+ return quit(EINA_TRUE, NULL);
+
+ if (args < argc)
+ url = argv[args];
+ else
+ url = (char*) default_url;
+
+ if (sudoWorkaround)
+ strcat(getenv("HOME"), "blah");
+
+ themePath = findThemePath(theme);
+ if (!themePath)
+ return quit(EINA_FALSE, "ERROR: could not find theme.\n");
+
+ ewk_init();
+ tmp = getenv("TMPDIR");
+ if (!tmp)
+ tmp = "/tmp";
+ snprintf(path, sizeof(path), "%s/.ewebkit-%u", tmp, getuid());
+ ecore_file_mkpath(path);
+ ewk_settings_icon_database_path_set(path);
+ ewk_settings_web_database_path_set(path);
+
+ proxyUri = getenv("http_proxy");
+ if (proxyUri)
+ ewk_settings_proxy_uri_set(proxyUri);
+
+ browserCreate(url, themePath, userAgent, geometry, engine, isFullscreen, path);
+ ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, &windows);
+
+ ecore_main_loop_begin();
+
+ ewk_shutdown();
+
+ return quit(EINA_TRUE, NULL);
+}
diff --git a/WebKitTools/FindSafari/FindSafari.vcproj b/WebKitTools/FindSafari/FindSafari.vcproj
index 083fa4d..66f1454 100644
--- a/WebKitTools/FindSafari/FindSafari.vcproj
+++ b/WebKitTools/FindSafari/FindSafari.vcproj
@@ -17,7 +17,7 @@
<Configuration
Name="all|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\FindSafariCommon.vsprops"
CharacterSet="1"
>
<Tool
@@ -49,9 +49,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="shlwapi.lib advapi32.lib ole32.lib"
- OutputFile="$(OutDir)\$(ProjectName).exe"
- SubSystem="1"
/>
<Tool
Name="VCALinkTool"
diff --git a/WebKitTools/FindSafari/FindSafariCommon.vsprops b/WebKitTools/FindSafari/FindSafariCommon.vsprops
new file mode 100644
index 0000000..738b109
--- /dev/null
+++ b/WebKitTools/FindSafari/FindSafariCommon.vsprops
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="FindSafariCommon"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib advapi32.lib ole32.lib"
+ OutputFile="$(OutDir)\$(ProjectName).exe"
+ SubSystem="1"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/GNUmakefile.am b/WebKitTools/GNUmakefile.am
index 4425196..d20b3b5 100644
--- a/WebKitTools/GNUmakefile.am
+++ b/WebKitTools/GNUmakefile.am
@@ -1,11 +1,14 @@
noinst_PROGRAMS += \
+ Programs/DumpRenderTree \
Programs/GtkLauncher \
- Programs/DumpRenderTree
+ Programs/ImageDiff
# GtkLauncher
Programs_GtkLauncher_CPPFLAGS = \
-I$(srcdir)/WebKit/gtk \
+ -I$(srcdir)/WebCore/platform/network/soup/cache/ \
-I$(top_builddir)/WebKit/gtk \
+ -I$(top_builddir)/DerivedSources \
$(global_cppflags) \
$(javascriptcore_cppflags)
@@ -20,9 +23,10 @@ Programs_GtkLauncher_CFLAGS = \
$(LIBSOUP_CFLAGS)
Programs_GtkLauncher_LDADD = \
- libwebkit-1.0.la \
+ libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
$(GTK_LIBS) \
- $(GLIB_LIBS)
+ $(GLIB_LIBS) \
+ $(WINMM_LIBS)
Programs_GtkLauncher_LDFLAGS = \
-no-fast-install \
@@ -31,9 +35,13 @@ Programs_GtkLauncher_LDFLAGS = \
# DumpRenderTree
dumprendertree_cppflags := \
-I$(srcdir)/WebKitTools/DumpRenderTree \
+ -I$(srcdir)/WebKitTools/DumpRenderTree/cairo \
-I$(srcdir)/WebKitTools/DumpRenderTree/gtk \
-I$(srcdir)/WebKit/gtk \
+ -I$(srcdir)/WebCore/platform/gtk \
+ -I$(srcdir)/WebCore/platform/network/soup/cache/ \
-I$(top_builddir)/WebKit/gtk \
+ -I$(top_builddir)/DerivedSources \
$(global_cppflags) \
$(javascriptcore_cppflags)
@@ -44,6 +52,8 @@ Programs_DumpRenderTree_SOURCES = \
WebKitTools/DumpRenderTree/DumpRenderTreePrefix.h \
WebKitTools/DumpRenderTree/AccessibilityController.cpp \
WebKitTools/DumpRenderTree/AccessibilityController.h \
+ WebKitTools/DumpRenderTree/AccessibilityTextMarker.cpp \
+ WebKitTools/DumpRenderTree/AccessibilityTextMarker.h \
WebKitTools/DumpRenderTree/AccessibilityUIElement.cpp \
WebKitTools/DumpRenderTree/AccessibilityUIElement.h \
WebKitTools/DumpRenderTree/GCController.cpp \
@@ -51,11 +61,14 @@ Programs_DumpRenderTree_SOURCES = \
WebKitTools/DumpRenderTree/JavaScriptThreading.h \
WebKitTools/DumpRenderTree/LayoutTestController.cpp \
WebKitTools/DumpRenderTree/LayoutTestController.h \
+ WebKitTools/DumpRenderTree/PixelDumpSupport.cpp \
WebKitTools/DumpRenderTree/PixelDumpSupport.h \
WebKitTools/DumpRenderTree/WorkQueue.cpp \
WebKitTools/DumpRenderTree/WorkQueue.h \
WebKitTools/DumpRenderTree/WorkQueueItem.h \
WebKitTools/DumpRenderTree/config.h \
+ WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp \
+ WebKitTools/DumpRenderTree/cairo/PixelDumpSupportCairo.h \
WebKitTools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp \
WebKitTools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp \
WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp \
@@ -64,7 +77,9 @@ Programs_DumpRenderTree_SOURCES = \
WebKitTools/DumpRenderTree/gtk/EventSender.cpp \
WebKitTools/DumpRenderTree/gtk/GCControllerGtk.cpp \
WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp \
- WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp
+ WebKitTools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp \
+ WebKitTools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp \
+ WebCore/platform/gtk/GtkVersioning.c
Programs_DumpRenderTree_CXXFLAGS = \
$(global_cxxflags) \
@@ -81,24 +96,49 @@ Programs_DumpRenderTree_CFLAGS = \
$(LIBSOUP_CFLAGS)
Programs_DumpRenderTree_LDADD = \
- libwebkit-1.0.la \
+ libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
libJavaScriptCore.la \
$(GLOBALDEPS_LIBS) \
$(CAIRO_LIBS) \
$(GTK_LIBS) \
$(GLIB_LIBS) \
$(LIBSOUP_LIBS) \
- $(FREETYPE_LIBS)
+ $(FREETYPE_LIBS) \
+ $(WINMM_LIBS)
Programs_DumpRenderTree_LDFLAGS = \
-no-fast-install \
-no-install
+# ImageDiff
+Programs_ImageDiff_CPPFLAGS = $(global_cppflags)
+
+Programs_ImageDiff_SOURCES = \
+ WebKitTools/DumpRenderTree/gtk/ImageDiff.cpp
+
+Programs_ImageDiff_CXXFLAGS = \
+ $(global_cxxflags) \
+ $(global_cppflags) \
+ $(Programs_ImageDiff_CFLAGS)
+
+Programs_ImageDiff_CFLAGS = \
+ -fno-strict-aliasing \
+ $(global_cflags) \
+ $(GLOBALDEPS_CFLAGS) \
+ $(GTK_CFLAGS)
+
+Programs_ImageDiff_LDADD = \
+ $(GTK_LIBS)
+
+Programs_ImageDiff_LDFLAGS = \
+ -no-fast-install \
+ -no-install
+
# clean target
CLEANFILES += \
+ Programs/DumpRenderTree \
Programs/GtkLauncher \
- Programs/DumpRenderTree
-
+ Programs/ImageDiff
if TARGET_X11
@@ -109,7 +149,7 @@ noinst_LTLIBRARIES += \
dumprendertree_cppflags += \
-DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
- -DFONTS_CONF_FILE=\"${shell pwd}/${srcdir}/WebKitTools/DumpRenderTree/gtk/fonts.conf\"
+ -DFONTS_CONF_DIR=\"${shell pwd}/${srcdir}/WebKitTools/DumpRenderTree/gtk/fonts\"
TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS = \
-I$(srcdir)/WebKitTools/DumpRenderTree \
@@ -117,7 +157,7 @@ TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS = \
-I$(srcdir)/WebCore \
-I$(srcdir)/WebCore/bridge \
-I$(srcdir)/WebCore/plugins \
- -I$(srcdir)/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj \
+ -I$(srcdir)/WebKitTools/DumpRenderTree/TestNetscapePlugIn \
$(global_cppflags) \
$(javascriptcore_cppflags)
@@ -126,10 +166,19 @@ TestNetscapePlugin_libtestnetscapeplugin_la_SOURCES = \
WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npfunctions.h \
WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/ForwardingHeaders/WebKit/npruntime.h \
WebKitTools/DumpRenderTree/unix/TestNetscapePlugin/TestNetscapePlugin.cpp \
- WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp \
- WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.h \
- WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.cpp \
- WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/TestObject.h
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp \
+ WebKitTools/DumpRenderTree/TestNetscapePlugIn/TestObject.h
TestNetscapePlugin_libtestnetscapeplugin_la_LDFLAGS = \
-rpath ${shell pwd}/$(top_builddir)/../unix/TestNetscapePlugin/.libs \
diff --git a/WebKitTools/GtkLauncher/main.c b/WebKitTools/GtkLauncher/main.c
index 2f9350d..4abee08 100644
--- a/WebKitTools/GtkLauncher/main.c
+++ b/WebKitTools/GtkLauncher/main.c
@@ -27,26 +27,24 @@
#include <gtk/gtk.h>
#include <webkit/webkit.h>
-static GtkWidget* main_window;
-static GtkWidget* uri_entry;
-static GtkStatusbar* main_statusbar;
-static WebKitWebView* web_view;
-static gchar* main_title;
-static gdouble load_progress;
-static guint status_context_id;
+static gint window_count = 0;
+
+static GtkWidget* create_window (WebKitWebView** out_web_view);
static void
activate_uri_entry_cb (GtkWidget* entry, gpointer data)
{
+ WebKitWebView *web_view = g_object_get_data (G_OBJECT (entry), "web-view");
const gchar* uri = gtk_entry_get_text (GTK_ENTRY (entry));
g_assert (uri);
webkit_web_view_load_uri (web_view, uri);
}
static void
-update_title (GtkWindow* window)
+update_title (GtkWindow* window, WebKitWebView* web_view)
{
- GString* string = g_string_new (main_title);
+ GString *string = g_string_new (webkit_web_view_get_title(web_view));
+ gdouble load_progress = webkit_web_view_get_progress (web_view) * 100;
g_string_append (string, " - WebKit Launcher");
if (load_progress < 100)
g_string_append_printf (string, " (%f%%)", load_progress);
@@ -56,25 +54,24 @@ update_title (GtkWindow* window)
}
static void
-link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data)
+link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, GtkStatusbar* statusbar)
{
+ guint status_context_id =
+ GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (statusbar), "link-hover-context"));
/* underflow is allowed */
- gtk_statusbar_pop (main_statusbar, status_context_id);
+ gtk_statusbar_pop (statusbar, status_context_id);
if (link)
- gtk_statusbar_push (main_statusbar, status_context_id, link);
+ gtk_statusbar_push (statusbar, status_context_id, link);
}
static void
-notify_title_cb (WebKitWebView* web_view, GParamSpec* pspec, gpointer data)
+notify_title_cb (WebKitWebView* web_view, GParamSpec* pspec, GtkWidget* window)
{
- if (main_title)
- g_free (main_title);
- main_title = g_strdup (webkit_web_view_get_title(web_view));
- update_title (GTK_WINDOW (main_window));
+ update_title (GTK_WINDOW (window), web_view);
}
static void
-notify_load_status_cb (WebKitWebView* web_view, GParamSpec* pspec, gpointer data)
+notify_load_status_cb (WebKitWebView* web_view, GParamSpec* pspec, GtkWidget* uri_entry)
{
if (webkit_web_view_get_load_status (web_view) == WEBKIT_LOAD_COMMITTED) {
WebKitWebFrame* frame = webkit_web_view_get_main_frame (web_view);
@@ -85,43 +82,68 @@ notify_load_status_cb (WebKitWebView* web_view, GParamSpec* pspec, gpointer data
}
static void
-notify_progress_cb (WebKitWebView* web_view, GParamSpec* pspec, gpointer data)
+notify_progress_cb (WebKitWebView* web_view, GParamSpec* pspec, GtkWidget* window)
{
- load_progress = webkit_web_view_get_progress (web_view) * 100;
- update_title (GTK_WINDOW (main_window));
+ update_title (GTK_WINDOW (window), web_view);
}
static void
-destroy_cb (GtkWidget* widget, gpointer data)
+destroy_cb (GtkWidget* widget, GtkWidget* window)
{
- gtk_main_quit ();
+ if (g_atomic_int_dec_and_test (&window_count))
+ gtk_main_quit ();
}
static void
-go_back_cb (GtkWidget* widget, gpointer data)
+go_back_cb (GtkWidget* widget, WebKitWebView* web_view)
{
webkit_web_view_go_back (web_view);
}
static void
-go_forward_cb (GtkWidget* widget, gpointer data)
+go_forward_cb (GtkWidget* widget, WebKitWebView* web_view)
{
webkit_web_view_go_forward (web_view);
}
+static WebKitWebView*
+create_web_view_cb (WebKitWebView* web_view, WebKitWebFrame* web_frame, GtkWidget* window)
+{
+ WebKitWebView *new_web_view;
+ create_window (&new_web_view);
+ return new_web_view;
+}
+
+static gboolean
+web_view_ready_cb (WebKitWebView* web_view, GtkWidget* window)
+{
+ gtk_widget_grab_focus (GTK_WIDGET (web_view));
+ gtk_widget_show_all (window);
+ return FALSE;
+}
+
+static gboolean
+close_web_view_cb (WebKitWebView* web_view, GtkWidget* window)
+{
+ gtk_widget_destroy (window);
+ return TRUE;
+}
+
static GtkWidget*
-create_browser ()
+create_browser (GtkWidget* window, GtkWidget* uri_entry, GtkWidget* statusbar, WebKitWebView* web_view)
{
GtkWidget* scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- web_view = WEBKIT_WEB_VIEW (webkit_web_view_new ());
gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (web_view));
- g_signal_connect (web_view, "notify::title", G_CALLBACK (notify_title_cb), web_view);
- g_signal_connect (web_view, "notify::load-status", G_CALLBACK (notify_load_status_cb), web_view);
- g_signal_connect (web_view, "notify::progress", G_CALLBACK (notify_progress_cb), web_view);
- g_signal_connect (web_view, "hovering-over-link", G_CALLBACK (link_hover_cb), web_view);
+ g_signal_connect (web_view, "notify::title", G_CALLBACK (notify_title_cb), window);
+ g_signal_connect (web_view, "notify::load-status", G_CALLBACK (notify_load_status_cb), uri_entry);
+ g_signal_connect (web_view, "notify::progress", G_CALLBACK (notify_progress_cb), window);
+ g_signal_connect (web_view, "hovering-over-link", G_CALLBACK (link_hover_cb), statusbar);
+ g_signal_connect (web_view, "create-web-view", G_CALLBACK (create_web_view_cb), window);
+ g_signal_connect (web_view, "web-view-ready", G_CALLBACK (web_view_ready_cb), window);
+ g_signal_connect (web_view, "close-web-view", G_CALLBACK (close_web_view_cb), window);
return scrolled_window;
}
@@ -129,14 +151,16 @@ create_browser ()
static GtkWidget*
create_statusbar ()
{
- main_statusbar = GTK_STATUSBAR (gtk_statusbar_new ());
- status_context_id = gtk_statusbar_get_context_id (main_statusbar, "Link Hover");
+ GtkStatusbar *statusbar = GTK_STATUSBAR (gtk_statusbar_new ());
+ guint status_context_id = gtk_statusbar_get_context_id (statusbar, "Link Hover");
+ g_object_set_data (G_OBJECT (statusbar), "link-hover-context",
+ GUINT_TO_POINTER(status_context_id));
- return (GtkWidget*)main_statusbar;
+ return GTK_WIDGET (statusbar);
}
static GtkWidget*
-create_toolbar ()
+create_toolbar (GtkWidget* uri_entry, WebKitWebView* web_view)
{
GtkWidget* toolbar = gtk_toolbar_new ();
@@ -151,23 +175,23 @@ create_toolbar ()
/* the back button */
item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_BACK);
- g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_back_cb), NULL);
+ g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_back_cb), web_view);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
/* The forward button */
item = gtk_tool_button_new_from_stock (GTK_STOCK_GO_FORWARD);
- g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_forward_cb), NULL);
+ g_signal_connect (G_OBJECT (item), "clicked", G_CALLBACK (go_forward_cb), web_view);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
/* The URL entry */
item = gtk_tool_item_new ();
gtk_tool_item_set_expand (item, TRUE);
- uri_entry = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER (item), uri_entry);
g_signal_connect (G_OBJECT (uri_entry), "activate", G_CALLBACK (activate_uri_entry_cb), NULL);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
/* The go button */
+ g_object_set_data (G_OBJECT (uri_entry), "web-view", web_view);
item = gtk_tool_button_new_from_stock (GTK_STOCK_OK);
g_signal_connect_swapped (G_OBJECT (item), "clicked", G_CALLBACK (activate_uri_entry_cb), (gpointer)uri_entry);
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
@@ -176,33 +200,68 @@ create_toolbar ()
}
static GtkWidget*
-create_window ()
+create_window (WebKitWebView** out_web_view)
{
- GtkWidget* window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ WebKitWebView *web_view;
+ GtkWidget *vbox;
+ GtkWidget *window;
+ GtkWidget *uri_entry;
+ GtkWidget *statusbar;
+
+ g_atomic_int_inc (&window_count);
+
+ window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
gtk_widget_set_name (window, "GtkLauncher");
+
+ web_view = WEBKIT_WEB_VIEW (webkit_web_view_new ());
+ uri_entry = gtk_entry_new ();
+
+ vbox = gtk_vbox_new (FALSE, 0);
+ statusbar = create_statusbar (web_view);
+ gtk_box_pack_start (GTK_BOX (vbox), create_toolbar (uri_entry, web_view), FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), create_browser (window, uri_entry, statusbar, web_view), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 0);
+
+ gtk_container_add (GTK_CONTAINER (window), vbox);
+
g_signal_connect (window, "destroy", G_CALLBACK (destroy_cb), NULL);
+ if (out_web_view)
+ *out_web_view = web_view;
+
return window;
}
+static gchar* filenameToURL(const char* filename)
+{
+ if (!g_file_test(filename, G_FILE_TEST_EXISTS))
+ return 0;
+
+ GFile *gfile = g_file_new_for_path(filename);
+ gchar *fileURL = g_file_get_uri(gfile);
+ g_object_unref(gfile);
+
+ return fileURL;
+}
+
int
main (int argc, char* argv[])
{
+ WebKitWebView *web_view;
+ GtkWidget *main_window;
+
gtk_init (&argc, &argv);
if (!g_thread_supported ())
g_thread_init (NULL);
- GtkWidget* vbox = gtk_vbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), create_toolbar (), FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), create_browser (), TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), create_statusbar (), FALSE, FALSE, 0);
+ main_window = create_window (&web_view);
- main_window = create_window ();
- gtk_container_add (GTK_CONTAINER (main_window), vbox);
+ gchar *uri = (gchar*) (argc > 1 ? argv[1] : "http://www.google.com/");
+ gchar *fileURL = filenameToURL(uri);
- gchar* uri = (gchar*) (argc > 1 ? argv[1] : "http://www.google.com/");
- webkit_web_view_load_uri (web_view, uri);
+ webkit_web_view_load_uri(web_view, fileURL ? fileURL : uri);
+ g_free(fileURL);
gtk_widget_grab_focus (GTK_WIDGET (web_view));
gtk_widget_show_all (main_window);
diff --git a/WebKitTools/Makefile b/WebKitTools/Makefile
index 92f5b25..51ac703 100644
--- a/WebKitTools/Makefile
+++ b/WebKitTools/Makefile
@@ -1,4 +1,4 @@
-MODULES = DumpRenderTree
+MODULES = DumpRenderTree WebKitTestRunner MiniBrowser TestWebKitAPI
all:
@for dir in $(MODULES); do ${MAKE} $@ -C $$dir; exit_status=$$?; \
diff --git a/WebKitTools/MiniBrowser/Configurations/Base.xcconfig b/WebKitTools/MiniBrowser/Configurations/Base.xcconfig
new file mode 100644
index 0000000..23a0c75
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Configurations/Base.xcconfig
@@ -0,0 +1,65 @@
+// 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.
+
+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/MiniBrowser/Configurations/DebugRelease.xcconfig b/WebKitTools/MiniBrowser/Configurations/DebugRelease.xcconfig
new file mode 100644
index 0000000..8b156e8
--- /dev/null
+++ b/WebKitTools/MiniBrowser/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/MiniBrowser/Configurations/MiniBrowser.xcconfig b/WebKitTools/MiniBrowser/Configurations/MiniBrowser.xcconfig
new file mode 100644
index 0000000..cf5ad84
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Configurations/MiniBrowser.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 = MiniBrowser
+GCC_PREFIX_HEADER = mac/MiniBrowser_Prefix.pch
+INFOPLIST_FILE = mac/Info.plist
diff --git a/WebKitTools/MiniBrowser/Configurations/MiniBrowserCFLite.vsprops b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCFLite.vsprops
new file mode 100644
index 0000000..4e1e538
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCFLite.vsprops
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="MiniBrowserCFLite"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib WebKit$(WebKitDLLConfigSuffix).lib CFLite$(LibraryConfigSuffix).lib"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops
new file mode 100644
index 0000000..f64d6ca
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCommon.vsprops
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="MiniBrowserCommon"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ UsePrecompiledHeader="2"
+ />
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops
new file mode 100644
index 0000000..a34efd2
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Configurations/MiniBrowserCoreFoundation.vsprops
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="MiniBrowserCoreFoundation"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib CFNetwork$(LibraryConfigSuffix).lib"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\objc$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\QuartzCore$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/MiniBrowser/Configurations/WebBundle.xcconfig b/WebKitTools/MiniBrowser/Configurations/WebBundle.xcconfig
new file mode 100644
index 0000000..253fdf7
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Configurations/WebBundle.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 = WebBundle
+GCC_PREFIX_HEADER = mac/MiniBrowser_Prefix.pch
+INFOPLIST_FILE = mac/WebBundle/Info.plist
diff --git a/WebKitTools/MiniBrowser/MBToolbarItem.h b/WebKitTools/MiniBrowser/MBToolbarItem.h
new file mode 100644
index 0000000..cc5a4b4
--- /dev/null
+++ b/WebKitTools/MiniBrowser/MBToolbarItem.h
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+@interface MBToolbarItem : NSToolbarItem
+{ }
+@end
diff --git a/WebKitTools/MiniBrowser/MBToolbarItem.m b/WebKitTools/MiniBrowser/MBToolbarItem.m
new file mode 100644
index 0000000..56f7778
--- /dev/null
+++ b/WebKitTools/MiniBrowser/MBToolbarItem.m
@@ -0,0 +1,35 @@
+/*
+ * 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 "MBToolbarItem.h"
+
+@implementation MBToolbarItem
+
+- (void)validate
+{
+ [self setEnabled:[[self target] validateUserInterfaceItem:self]];
+}
+
+@end
diff --git a/WebKitTools/MiniBrowser/Makefile b/WebKitTools/MiniBrowser/Makefile
new file mode 100644
index 0000000..61cd475
--- /dev/null
+++ b/WebKitTools/MiniBrowser/Makefile
@@ -0,0 +1,21 @@
+# Build MiniBrowser only on SnowLeopard and later.
+
+OSX_VERSION ?= $(shell sw_vers -productVersion | cut -d. -f 2)
+BUILD_MINIBROWSER = $(shell (( $(OSX_VERSION) >= 6 )) && echo "YES" )
+
+ifeq "$(BUILD_MINIBROWSER)" "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/MiniBrowser/MiniBrowser.qrc b/WebKitTools/MiniBrowser/MiniBrowser.qrc
new file mode 100644
index 0000000..ffe77b0
--- /dev/null
+++ b/WebKitTools/MiniBrowser/MiniBrowser.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>useragentlist.txt</file>
+ </qresource>
+</RCC>
diff --git a/WebKitTools/MiniBrowser/MiniBrowser.vcproj b/WebKitTools/MiniBrowser/MiniBrowser.vcproj
new file mode 100644
index 0000000..b8bcebe
--- /dev/null
+++ b/WebKitTools/MiniBrowser/MiniBrowser.vcproj
@@ -0,0 +1,583 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="MiniBrowser"
+ ProjectGUID="{1480CF5F-4160-47B5-A0E6-96AEC8258FB5}"
+ RootNamespace="MiniBrowser"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;.\Configurations\MiniBrowserCoreFoundation.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ UseOfATL="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\Configurations\MiniBrowserCoreFoundation.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ UseOfATL="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_Internal|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;.\Configurations\MiniBrowserCoreFoundation.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ UseOfATL="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_All|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;.\Configurations\MiniBrowserCoreFoundation.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ UseOfATL="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;.\Configurations\MiniBrowserCFLite.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ UseOfATL="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\Configurations\MiniBrowserCFLite.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ UseOfATL="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\Configurations\MiniBrowserCoreFoundation.vsprops;.\Configurations\MiniBrowserCommon.vsprops"
+ UseOfATL="1"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath=".\win\BrowserView.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\win\BrowserWindow.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\win\main.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\win\MiniBrowser.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\win\stdafx.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Internal|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_CFLite|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_CFLite|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_LTCG|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath=".\win\BrowserView.h"
+ >
+ </File>
+ <File
+ RelativePath=".\win\BrowserWindow.h"
+ >
+ </File>
+ <File
+ RelativePath=".\win\MiniBrowser.h"
+ >
+ </File>
+ <File
+ RelativePath=".\win\Resource.h"
+ >
+ </File>
+ <File
+ RelativePath=".\win\stdafx.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
+ >
+ <File
+ RelativePath=".\win\MiniBrowser.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..1a7ccbb
--- /dev/null
+++ b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
@@ -0,0 +1,421 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 256AC3DA0F4B6AC300CF3369 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* AppDelegate.m */; };
+ 51E244FA11EFCE07008228D1 /* MBToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E244F911EFCE07008228D1 /* MBToolbarItem.m */; };
+ 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 */; };
+ BC72B89511E57E07001EB4EA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD58150DA1D0A300B32029 /* MainMenu.xib */; };
+ BC72B89611E57E0F001EB4EA /* BrowserWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC3294A2116A9852008635D0 /* 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 */
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+ 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
+ 1DDD58150DA1D0A300B32029 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = MainMenu.xib; path = mac/MainMenu.xib; sourceTree = "<group>"; };
+ 256AC3D80F4B6AC300CF3369 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = mac/AppDelegate.h; sourceTree = "<group>"; };
+ 256AC3D90F4B6AC300CF3369 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = mac/AppDelegate.m; sourceTree = "<group>"; };
+ 256AC3F00F4B6AF500CF3369 /* MiniBrowser_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MiniBrowser_Prefix.pch; path = mac/MiniBrowser_Prefix.pch; sourceTree = "<group>"; };
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ 51E244F811EFCE07008228D1 /* MBToolbarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBToolbarItem.h; sourceTree = "<group>"; };
+ 51E244F911EFCE07008228D1 /* MBToolbarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBToolbarItem.m; sourceTree = "<group>"; };
+ 8D1107320486CEB800E47090 /* MiniBrowser.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MiniBrowser.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC1770121188DF19007D9E9A /* make-launchable.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = "make-launchable.sh"; path = "mac/make-launchable.sh"; sourceTree = "<group>"; };
+ BC329486116A92E2008635D0 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = mac/main.m; sourceTree = "<group>"; };
+ BC329496116A941B008635D0 /* BrowserWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BrowserWindowController.h; path = mac/BrowserWindowController.h; sourceTree = "<group>"; };
+ BC329497116A941B008635D0 /* BrowserWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BrowserWindowController.m; path = mac/BrowserWindowController.m; sourceTree = "<group>"; };
+ BC3294A2116A9852008635D0 /* BrowserWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = BrowserWindow.xib; path = mac/BrowserWindow.xib; sourceTree = "<group>"; };
+ BC72B89711E57E6E001EB4EA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+ BC72B89A11E57E8A001EB4EA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = mac/Info.plist; sourceTree = "<group>"; };
+ BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ BCA8CBDD11E578A000812FB7 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
+ BCA8CBDE11E578A000812FB7 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
+ BCA8CBDF11E578A000812FB7 /* MiniBrowser.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = MiniBrowser.xcconfig; sourceTree = "<group>"; };
+ BCA8CBE011E578A000812FB7 /* WebBundle.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebBundle.xcconfig; sourceTree = "<group>"; };
+ BCBD381D11B0898200E01E54 /* WebBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ 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>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8D11072E0486CEB800E47090 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
+ BC8FB5A8116AA1FE0080D413 /* WebKit2.framework in Frameworks */,
+ );
+ 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 */
+ 080E96DDFE201D6D7F000001 /* MiniBrowser */ = {
+ isa = PBXGroup;
+ children = (
+ BC72B89A11E57E8A001EB4EA /* Info.plist */,
+ BC329486116A92E2008635D0 /* main.m */,
+ 256AC3D80F4B6AC300CF3369 /* AppDelegate.h */,
+ 256AC3D90F4B6AC300CF3369 /* AppDelegate.m */,
+ BC329496116A941B008635D0 /* BrowserWindowController.h */,
+ BC329497116A941B008635D0 /* BrowserWindowController.m */,
+ BCE625EF117FC82700572433 /* BrowserStatisticsWindowController.h */,
+ BCE625F0117FC82700572433 /* BrowserStatisticsWindowController.m */,
+ 51E244F811EFCE07008228D1 /* MBToolbarItem.h */,
+ 51E244F911EFCE07008228D1 /* MBToolbarItem.m */,
+ );
+ name = MiniBrowser;
+ sourceTree = "<group>";
+ };
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
+ BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */,
+ );
+ name = "Linked Frameworks";
+ sourceTree = "<group>";
+ };
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 29B97324FDCFA39411CA2CEA /* AppKit.framework */,
+ 13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
+ 29B97325FDCFA39411CA2CEA /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 19C28FACFE9D520D11CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8D1107320486CEB800E47090 /* MiniBrowser.app */,
+ BCBD381D11B0898200E01E54 /* WebBundle.bundle */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 29B97314FDCFA39411CA2CEA /* MiniBrowser */ = {
+ isa = PBXGroup;
+ children = (
+ 256AC3F00F4B6AF500CF3369 /* MiniBrowser_Prefix.pch */,
+ 080E96DDFE201D6D7F000001 /* MiniBrowser */,
+ BCBD382B11B089F700E01E54 /* WebBundle */,
+ 29B97317FDCFA39411CA2CEA /* Resources */,
+ BCA8CBDA11E5787800812FB7 /* Configurations */,
+ BC1770481188EB05007D9E9A /* Scripts */,
+ 29B97323FDCFA39411CA2CEA /* Frameworks */,
+ 19C28FACFE9D520D11CA2CBB /* Products */,
+ );
+ name = MiniBrowser;
+ sourceTree = "<group>";
+ };
+ 29B97317FDCFA39411CA2CEA /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ BC3294A2116A9852008635D0 /* BrowserWindow.xib */,
+ 1DDD58150DA1D0A300B32029 /* MainMenu.xib */,
+ BCE625ED117FC80E00572433 /* BrowserStatisticsWindow.xib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ 29B97323FDCFA39411CA2CEA /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
+ 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ BC1770481188EB05007D9E9A /* Scripts */ = {
+ isa = PBXGroup;
+ children = (
+ BC1770121188DF19007D9E9A /* make-launchable.sh */,
+ );
+ name = Scripts;
+ sourceTree = "<group>";
+ };
+ BCA8CBDA11E5787800812FB7 /* Configurations */ = {
+ isa = PBXGroup;
+ children = (
+ BCA8CBDD11E578A000812FB7 /* Base.xcconfig */,
+ BCA8CBDE11E578A000812FB7 /* DebugRelease.xcconfig */,
+ BCA8CBDF11E578A000812FB7 /* MiniBrowser.xcconfig */,
+ BCA8CBE011E578A000812FB7 /* WebBundle.xcconfig */,
+ );
+ path = Configurations;
+ sourceTree = "<group>";
+ };
+ BCBD382B11B089F700E01E54 /* WebBundle */ = {
+ isa = PBXGroup;
+ children = (
+ BC72B89711E57E6E001EB4EA /* Info.plist */,
+ BCBD383D11B08A3100E01E54 /* WebBundleMain.m */,
+ );
+ name = WebBundle;
+ path = mac/WebBundle;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8D1107260486CEB800E47090 /* MiniBrowser */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MiniBrowser" */;
+ buildPhases = (
+ 8D1107290486CEB800E47090 /* Resources */,
+ BCBD38CF11B08C0100E01E54 /* Copy WebBundle */,
+ 8D11072C0486CEB800E47090 /* Sources */,
+ 8D11072E0486CEB800E47090 /* Frameworks */,
+ BC17701E1188DFB4007D9E9A /* Make Launchable */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BCBD38C611B08BA400E01E54 /* PBXTargetDependency */,
+ );
+ name = MiniBrowser;
+ productInstallPath = "$(HOME)/Applications";
+ productName = MiniBrowser;
+ 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 */
+ 29B97313FDCFA39411CA2CEA /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MiniBrowser" */;
+ compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 29B97314FDCFA39411CA2CEA /* MiniBrowser */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8D1107260486CEB800E47090 /* MiniBrowser */,
+ BCBD381C11B0898200E01E54 /* WebBundle */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 8D1107290486CEB800E47090 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC72B89511E57E07001EB4EA /* MainMenu.xib in Resources */,
+ BC72B89611E57E0F001EB4EA /* BrowserWindow.xib in Resources */,
+ BCE625EE117FC80E00572433 /* BrowserStatisticsWindow.xib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BCBD381911B0898200E01E54 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ BC17701E1188DFB4007D9E9A /* Make Launchable */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Make Launchable";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "mac/make-launchable.sh\n";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8D11072C0486CEB800E47090 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 256AC3DA0F4B6AC300CF3369 /* AppDelegate.m in Sources */,
+ BC329487116A92E2008635D0 /* main.m in Sources */,
+ BC329498116A941B008635D0 /* BrowserWindowController.m in Sources */,
+ BCE625F1117FC82700572433 /* BrowserStatisticsWindowController.m in Sources */,
+ 51E244FA11EFCE07008228D1 /* MBToolbarItem.m in Sources */,
+ );
+ 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 XCBuildConfiguration section */
+ BCBD381F11B0898300E01E54 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BCA8CBE011E578A000812FB7 /* WebBundle.xcconfig */;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ BCBD382011B0898300E01E54 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BCA8CBE011E578A000812FB7 /* WebBundle.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+ C01FCF4B08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BCA8CBDF11E578A000812FB7 /* MiniBrowser.xcconfig */;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ C01FCF4C08A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BCA8CBDF11E578A000812FB7 /* MiniBrowser.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+ C01FCF4F08A954540054247B /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BCA8CBDE11E578A000812FB7 /* DebugRelease.xcconfig */;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ C01FCF5008A954540054247B /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BCA8CBDE11E578A000812FB7 /* DebugRelease.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+/* 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 = (
+ C01FCF4B08A954540054247B /* Debug */,
+ C01FCF4C08A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ C01FCF4E08A954540054247B /* Build configuration list for PBXProject "MiniBrowser" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ C01FCF4F08A954540054247B /* Debug */,
+ C01FCF5008A954540054247B /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
+}
diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.h b/WebKitTools/MiniBrowser/mac/AppDelegate.h
new file mode 100644
index 0000000..2173c93
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/AppDelegate.h
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+enum ProcessModel {
+ kProcessModelSharedSecondaryThread,
+ kProcessModelSharedSecondaryProcess
+};
+typedef unsigned long ProcessModel;
+
+@interface BrowserAppDelegate : NSObject <NSApplicationDelegate> {
+ ProcessModel currentProcessModel;
+ WKPageNamespaceRef threadPageNamespace;
+ WKPageNamespaceRef processPageNamespace;
+}
+
+- (WKPageNamespaceRef)getCurrentPageNamespace;
+
+- (IBAction)setSharedProcessProcessModel:(id)sender;
+- (IBAction)setSharedThreadProcessModel:(id)sender;
+- (IBAction)showStatisticsWindow:(id)sender;
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.m b/WebKitTools/MiniBrowser/mac/AppDelegate.m
new file mode 100644
index 0000000..3747e28
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/AppDelegate.m
@@ -0,0 +1,275 @@
+/*
+ * 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 "AppDelegate.h"
+
+#import "BrowserWindowController.h"
+#import "BrowserStatisticsWindowController.h"
+
+#import <WebKit2/WKContextPrivate.h>
+#import <WebKit2/WKStringCF.h>
+#import <WebKit2/WKURLCF.h>
+
+static NSString *defaultURL = @"http://www.webkit.org/";
+
+@implementation BrowserAppDelegate
+
+void didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
+{
+ CFStringRef cfMessageName = WKStringCopyCFString(0, messageName);
+
+ WKTypeID typeID = WKGetTypeID(messageBody);
+ if (typeID == WKStringGetTypeID()) {
+ CFStringRef cfMessageBody = WKStringCopyCFString(0, (WKStringRef)messageBody);
+ LOG(@"ContextInjectedBundleClient - didRecieveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody);
+ CFRelease(cfMessageBody);
+ } else {
+ LOG(@"ContextInjectedBundleClient - didRecieveMessage - MessageName: %@ (MessageBody Unhandeled)\n", cfMessageName);
+ }
+
+ CFRelease(cfMessageName);
+
+ WKStringRef newMessageName = WKStringCreateWithCFString(CFSTR("Response"));
+ WKStringRef newMessageBody = WKStringCreateWithCFString(CFSTR("Roger that!"));
+
+ WKContextPostMessageToInjectedBundle(context, newMessageName, newMessageBody);
+
+ WKRelease(newMessageName);
+ WKRelease(newMessageBody);
+}
+
+#pragma mark History Client Callbacks
+
+static void didNavigateWithNavigationData(WKContextRef context, WKPageRef page, WKNavigationDataRef navigationData, WKFrameRef frame, const void *clientInfo)
+{
+ WKStringRef wkTitle = WKNavigationDataCopyTitle(navigationData);
+ CFStringRef title = WKStringCopyCFString(0, wkTitle);
+ WKRelease(wkTitle);
+
+ WKURLRef wkURL = WKNavigationDataCopyURL(navigationData);
+ CFURLRef url = WKURLCopyCFURL(0, wkURL);
+ WKRelease(wkURL);
+
+ LOG(@"HistoryClient - didNavigateWithNavigationData - title: %@ - url: %@", title, url);
+ CFRelease(title);
+ CFRelease(url);
+}
+
+static void didPerformClientRedirect(WKContextRef context, WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo)
+{
+ CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
+ CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
+ LOG(@"HistoryClient - didPerformClientRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
+ CFRelease(cfSourceURL);
+ CFRelease(cfDestinationURL);
+}
+
+static void didPerformServerRedirect(WKContextRef context, WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef frame, const void *clientInfo)
+{
+ CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
+ CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
+ LOG(@"HistoryClient - didPerformServerRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
+ CFRelease(cfSourceURL);
+ CFRelease(cfDestinationURL);
+}
+
+static void didUpdateHistoryTitle(WKContextRef context, WKPageRef page, WKStringRef title, WKURLRef URL, WKFrameRef frame, const void *clientInfo)
+{
+ CFStringRef cfTitle = WKStringCopyCFString(0, title);
+ CFURLRef cfURL = WKURLCopyCFURL(0, URL);
+ LOG(@"HistoryClient - didUpdateHistoryTitle - title: %@ - URL: %@", cfTitle, cfURL);
+ CFRelease(cfTitle);
+ CFRelease(cfURL);
+}
+
+static void populateVisitedLinks(WKContextRef context, const void *clientInfo)
+{
+ LOG(@"HistoryClient - populateVisitedLinks");
+}
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ if ([NSEvent modifierFlags] & NSShiftKeyMask)
+ currentProcessModel = kProcessModelSharedSecondaryThread;
+ else
+ currentProcessModel = kProcessModelSharedSecondaryProcess;
+
+ WKContextHistoryClient historyClient = {
+ 0,
+ self,
+ didNavigateWithNavigationData,
+ didPerformClientRedirect,
+ didPerformServerRedirect,
+ didUpdateHistoryTitle,
+ populateVisitedLinks
+ };
+
+ WKContextRef threadContext = WKContextGetSharedThreadContext();
+ WKContextSetHistoryClient(threadContext, &historyClient);
+ WKContextSetCacheModel(threadContext, kWKCacheModelPrimaryWebBrowser);
+
+ threadPageNamespace = WKPageNamespaceCreate(threadContext);
+ WKRelease(threadContext);
+
+ CFStringRef bundlePathCF = (CFStringRef)[[NSBundle mainBundle] pathForAuxiliaryExecutable:@"WebBundle.bundle"];
+ WKStringRef bundlePath = WKStringCreateWithCFString(bundlePathCF);
+
+ WKContextRef processContext = WKContextCreateWithInjectedBundlePath(bundlePath);
+
+ WKContextInjectedBundleClient bundleClient = {
+ 0, /* version */
+ 0, /* clientInfo */
+ didRecieveMessageFromInjectedBundle,
+ 0
+ };
+ WKContextSetInjectedBundleClient(processContext, &bundleClient);
+ WKContextSetHistoryClient(processContext, &historyClient);
+ WKContextSetCacheModel(processContext, kWKCacheModelPrimaryWebBrowser);
+
+ processPageNamespace = WKPageNamespaceCreate(processContext);
+ WKRelease(processContext);
+
+ WKRelease(bundlePath);
+ }
+
+ return self;
+}
+
+- (IBAction)newWindow:(id)sender
+{
+ BrowserWindowController *controller = [[BrowserWindowController alloc] initWithPageNamespace:[self getCurrentPageNamespace]];
+ [[controller window] makeKeyAndOrderFront:sender];
+
+ [controller loadURLString:defaultURL];
+}
+
+- (WKPageNamespaceRef)getCurrentPageNamespace
+{
+ return (currentProcessModel == kProcessModelSharedSecondaryThread) ? threadPageNamespace : processPageNamespace;
+}
+
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
+{
+ if ([menuItem action] == @selector(setSharedProcessProcessModel:))
+ [menuItem setState:currentProcessModel == kProcessModelSharedSecondaryProcess ? NSOnState : NSOffState];
+ else if ([menuItem action] == @selector(setSharedThreadProcessModel:))
+ [menuItem setState:currentProcessModel == kProcessModelSharedSecondaryThread ? NSOnState : NSOffState];
+ return YES;
+}
+
+- (void)_setProcessModel:(ProcessModel)processModel
+{
+ if (processModel == currentProcessModel)
+ return;
+
+ currentProcessModel = processModel;
+}
+
+- (IBAction)setSharedProcessProcessModel:(id)sender
+{
+ [self _setProcessModel:kProcessModelSharedSecondaryProcess];
+}
+
+- (IBAction)setSharedThreadProcessModel:(id)sender
+{
+ [self _setProcessModel:kProcessModelSharedSecondaryThread];
+}
+
+- (IBAction)showStatisticsWindow:(id)sender
+{
+ static BrowserStatisticsWindowController* windowController;
+ if (!windowController)
+ windowController = [[BrowserStatisticsWindowController alloc] initWithThreadedWKContextRef:WKPageNamespaceGetContext(threadPageNamespace)
+ processWKContextRef:WKPageNamespaceGetContext(processPageNamespace)];
+
+ [[windowController window] makeKeyAndOrderFront:self];
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+ [self newWindow:self];
+}
+
+- (void)applicationWillTerminate:(NSNotification *)notification
+{
+ NSArray* windows = [NSApp windows];
+ for (NSWindow* window in windows) {
+ id delegate = [window delegate];
+ if ([delegate isKindOfClass:[BrowserWindowController class]]) {
+ BrowserWindowController *controller = (BrowserWindowController *)delegate;
+ [controller applicationTerminating];
+ }
+ }
+
+ WKRelease(threadPageNamespace);
+ threadPageNamespace = 0;
+
+ WKRelease(processPageNamespace);
+ processPageNamespace = 0;
+}
+
+- (BrowserWindowController *)frontmostBrowserWindowController
+{
+ NSArray* windows = [NSApp windows];
+ for (NSWindow* window in windows) {
+ id delegate = [window delegate];
+ if ([delegate isKindOfClass:[BrowserWindowController class]])
+ return (BrowserWindowController *)delegate;
+ }
+
+ return 0;
+}
+
+- (IBAction)openDocument:(id)sender
+{
+ NSOpenPanel *openPanel = [[NSOpenPanel openPanel] retain];
+ [openPanel beginForDirectory:nil
+ file:nil
+ types:nil
+ modelessDelegate:self
+ didEndSelector:@selector(openPanelDidEnd:returnCode:contextInfo:)
+ contextInfo:0];
+}
+
+- (void)openPanelDidEnd:(NSOpenPanel *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
+{
+ [sheet autorelease];
+ if (returnCode != NSOKButton || ![[sheet filenames] count])
+ return;
+
+ NSString* filePath = [[sheet filenames] objectAtIndex:0];
+
+ BrowserWindowController *controller = [self frontmostBrowserWindowController];
+ if (!controller) {
+ controller = [[BrowserWindowController alloc] initWithPageNamespace:[self getCurrentPageNamespace]];
+ [[controller window] makeKeyAndOrderFront:self];
+ }
+
+ [controller loadURLString:[[NSURL fileURLWithPath:filePath] absoluteString]];
+}
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindow.xib b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindow.xib
new file mode 100644
index 0000000..ae2b5f8
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindow.xib
@@ -0,0 +1,974 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1060</int>
+ <string key="IBDocument.SystemVersion">10D573</string>
+ <string key="IBDocument.InterfaceBuilderVersion">762</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">460.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">762</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="2"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1001">
+ <string key="NSClassName">BrowserStatisticsWindowController</string>
+ </object>
+ <object class="NSCustomObject" id="1003">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1004">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSWindowTemplate" id="1005">
+ <int key="NSWindowStyleMask">15</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{196, 352}, {398, 158}}</string>
+ <int key="NSWTFlags">544735232</int>
+ <string key="NSWindowTitle">Window</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <nil key="NSViewClass"/>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ <object class="NSView" key="NSWindowView" id="1006">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSBox" id="349928848">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">45</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSView" id="737205069">
+ <reference key="NSNextResponder" ref="349928848"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMatrix" id="840724334">
+ <reference key="NSNextResponder" ref="737205069"/>
+ <int key="NSvFlags">256</int>
+ <string key="NSFrame">{{18, 14}, {318, 42}}</string>
+ <reference key="NSSuperview" ref="737205069"/>
+ <bool key="NSEnabled">YES</bool>
+ <int key="NSNumRows">3</int>
+ <int key="NSNumCols">3</int>
+ <object class="NSMutableArray" key="NSCells">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSTextFieldCell" id="66669903">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents"/>
+ <object class="NSFont" key="NSSupport" id="57559">
+ <string key="NSName">LucidaGrande-Bold</string>
+ <double key="NSSize">11</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="840724334"/>
+ <object class="NSColor" key="NSBackgroundColor" id="159766406">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor" id="822671316">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ <object class="NSTextFieldCell" id="792638244">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents">Shared Process</string>
+ <reference key="NSSupport" ref="57559"/>
+ <reference key="NSControlView" ref="840724334"/>
+ <int key="NSTag">1</int>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSTextColor" ref="822671316"/>
+ </object>
+ <object class="NSTextFieldCell" id="220500282">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents">Shared Thread</string>
+ <reference key="NSSupport" ref="57559"/>
+ <reference key="NSControlView" ref="840724334"/>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSTextColor" ref="822671316"/>
+ </object>
+ <object class="NSTextFieldCell" id="822378002">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents">Pages</string>
+ <reference key="NSSupport" ref="57559"/>
+ <reference key="NSControlView" ref="840724334"/>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSTextColor" ref="822671316"/>
+ </object>
+ <object class="NSTextFieldCell" id="665973187">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents">-100</string>
+ <object class="NSFont" key="NSSupport" id="422232155">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">11</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <reference key="NSControlView" ref="840724334"/>
+ <int key="NSTag">11</int>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSTextColor" ref="822671316"/>
+ </object>
+ <object class="NSTextFieldCell" id="534624797">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents">-100</string>
+ <reference key="NSSupport" ref="422232155"/>
+ <reference key="NSControlView" ref="840724334"/>
+ <int key="NSTag">21</int>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSTextColor" ref="822671316"/>
+ </object>
+ <object class="NSTextFieldCell" id="576107244">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents">Frames</string>
+ <reference key="NSSupport" ref="57559"/>
+ <reference key="NSControlView" ref="840724334"/>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSTextColor" ref="822671316"/>
+ </object>
+ <object class="NSTextFieldCell" id="775125133">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents">-100</string>
+ <reference key="NSSupport" ref="422232155"/>
+ <reference key="NSControlView" ref="840724334"/>
+ <int key="NSTag">12</int>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSTextColor" ref="822671316"/>
+ </object>
+ <object class="NSTextFieldCell" id="1058484862">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents">-100</string>
+ <reference key="NSSupport" ref="422232155"/>
+ <reference key="NSControlView" ref="840724334"/>
+ <int key="NSTag">22</int>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSTextColor" ref="822671316"/>
+ </object>
+ </object>
+ <string key="NSCellSize">{106, 14}</string>
+ <string key="NSIntercellSpacing">{0, 0}</string>
+ <int key="NSMatrixFlags">-2080374784</int>
+ <nil key="NSCellClass"/>
+ <object class="NSTextFieldCell" key="NSProtoCell" id="609012621">
+ <int key="NSCellFlags">68288064</int>
+ <int key="NSCellFlags2">71435264</int>
+ <string key="NSContents">Page Namespaces</string>
+ <reference key="NSSupport" ref="57559"/>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSTextColor" ref="822671316"/>
+ </object>
+ <int key="NSSelectedRow">-1</int>
+ <int key="NSSelectedCol">-1</int>
+ <reference key="NSBackgroundColor" ref="159766406"/>
+ <reference key="NSCellBackgroundColor" ref="159766406"/>
+ </object>
+ </object>
+ <string key="NSFrame">{{1, 1}, {354, 66}}</string>
+ <reference key="NSSuperview" ref="349928848"/>
+ </object>
+ </object>
+ <string key="NSFrame">{{25, 56}, {356, 82}}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <string key="NSOffsets">{0, 0}</string>
+ <object class="NSTextFieldCell" key="NSTitleCell">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Statistics</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">11</double>
+ <int key="NSfFlags">3100</int>
+ </object>
+ <object class="NSColor" key="NSBackgroundColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textBackgroundColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MCAwLjgwMDAwMDAxMTkAA</bytes>
+ </object>
+ </object>
+ <reference key="NSContentView" ref="737205069"/>
+ <int key="NSBorderType">1</int>
+ <int key="NSBoxType">0</int>
+ <int key="NSTitlePosition">2</int>
+ <bool key="NSTransparent">NO</bool>
+ </object>
+ <object class="NSButton" id="913385411">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{288, 12}, {96, 32}}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="465163606">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Refresh</string>
+ <object class="NSFont" key="NSSupport">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="913385411"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{398, 158}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="1005"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">4</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">refreshStatistics:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="913385411"/>
+ </object>
+ <int key="connectionID">83</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">_basicStatsMatrix</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="840724334"/>
+ </object>
+ <int key="connectionID">84</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="1001"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="1003"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="1005"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1006"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="1006"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="349928848"/>
+ <reference ref="913385411"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="349928848"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="840724334"/>
+ </object>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">37</int>
+ <reference key="object" ref="913385411"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="465163606"/>
+ </object>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">38</int>
+ <reference key="object" ref="465163606"/>
+ <reference key="parent" ref="913385411"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">75</int>
+ <reference key="object" ref="840724334"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1058484862"/>
+ <reference ref="534624797"/>
+ <reference ref="220500282"/>
+ <reference ref="792638244"/>
+ <reference ref="66669903"/>
+ <reference ref="665973187"/>
+ <reference ref="822378002"/>
+ <reference ref="775125133"/>
+ <reference ref="576107244"/>
+ <reference ref="609012621"/>
+ </object>
+ <reference key="parent" ref="349928848"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">87</int>
+ <reference key="object" ref="1058484862"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">86</int>
+ <reference key="object" ref="534624797"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">85</int>
+ <reference key="object" ref="220500282"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">48</int>
+ <reference key="object" ref="792638244"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">42</int>
+ <reference key="object" ref="66669903"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">46</int>
+ <reference key="object" ref="665973187"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">43</int>
+ <reference key="object" ref="822378002"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">47</int>
+ <reference key="object" ref="775125133"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">44</int>
+ <reference key="object" ref="576107244"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">82</int>
+ <reference key="object" ref="609012621"/>
+ <reference key="parent" ref="840724334"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>1.IBWindowTemplateEditedContentRect</string>
+ <string>1.NSWindowTemplate.visibleAtLaunch</string>
+ <string>1.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>2.IBPluginDependency</string>
+ <string>37.IBPluginDependency</string>
+ <string>38.IBPluginDependency</string>
+ <string>5.IBPluginDependency</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{{362, 638}, {398, 158}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{362, 638}, {398, 158}}</string>
+ <integer value="1"/>
+ <string>{196, 240}</string>
+ <string>{{202, 428}, {480, 270}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">88</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">BrowserStatisticsWindowController</string>
+ <string key="superclassName">NSWindowController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">refreshStatistics:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">_basicStatsMatrix</string>
+ <string key="NS.object.0">NSMatrix</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">mac/BrowserStatisticsWindowController.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSActionCell</string>
+ <string key="superclassName">NSCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="580408357">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="153722584">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="814670282">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSBox</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSBox.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSButton</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSButtonCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSCell</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSControl</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="423015697">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFormatter</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMatrix</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMatrix.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMenu</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="571428989">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="580408357"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="153722584"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="814670282"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="423015697"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="571428989"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="214998123">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextFieldCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <string key="superclassName">NSResponder</string>
+ <reference key="sourceIdentifier" ref="214998123"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindowController</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">showWindow:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
+ <integer value="1060" key="NS.object.0"/>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../MiniBrowser.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ </data>
+</archive>
diff --git a/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.h b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.h
new file mode 100644
index 0000000..6b4438f
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.h
@@ -0,0 +1,20 @@
+//
+// BrowserStatisticsWindowController.h
+// MiniBrowser
+//
+// Created by Sam Weinig on 4/21/10.
+// Copyright 2010 Apple Inc. All rights reserved.
+//
+
+@interface BrowserStatisticsWindowController : NSWindowController {
+ IBOutlet NSMatrix *_basicStatsMatrix;
+
+ WKContextRef _threadContext;
+ WKContextRef _processContext;
+}
+
+- (id)initWithThreadedWKContextRef:(WKContextRef)threadContext processWKContextRef:(WKContextRef)processContext;
+
+- (IBAction)refreshStatistics:(id)sender;
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m
new file mode 100644
index 0000000..28ddb7a
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/BrowserStatisticsWindowController.m
@@ -0,0 +1,58 @@
+//
+// BrowserStatisticsWindowController.m
+// MiniBrowser
+//
+// Created by Sam Weinig on 4/21/10.
+// Copyright 2010 Apple Inc. All rights reserved.
+//
+
+#import "BrowserStatisticsWindowController.h"
+
+#import <WebKit2/WKContextPrivate.h>
+
+@implementation BrowserStatisticsWindowController
+
+- (id)initWithThreadedWKContextRef:(WKContextRef)threadContext processWKContextRef:(WKContextRef)processContext
+{
+ if ((self = [super initWithWindowNibName:@"BrowserStatisticsWindow"])) {
+ _threadContext = WKRetain(threadContext);
+ _processContext = WKRetain(processContext);
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ WKRelease(_threadContext);
+ _threadContext = 0;
+
+ WKRelease(_processContext);
+ _processContext = 0;
+
+ [super dealloc];
+}
+
+- (void)windowDidLoad
+{
+ [super windowDidLoad];
+ [self refreshStatistics:nil];
+}
+
+- (IBAction)refreshStatistics:(id)sender
+{
+ WKContextStatistics threadStats;
+ WKContextGetStatistics(_threadContext, &threadStats);
+
+ WKContextStatistics processStats;
+ WKContextGetStatistics(_processContext, &processStats);
+
+ [[_basicStatsMatrix cellWithTag:11] setIntValue:processStats.numberOfWKPages];
+ [[_basicStatsMatrix cellWithTag:12] setIntValue:processStats.numberOfWKFrames];
+
+ [[_basicStatsMatrix cellWithTag:21] setIntValue:threadStats.numberOfWKPages];
+ [[_basicStatsMatrix cellWithTag:22] setIntValue:threadStats.numberOfWKFrames];
+
+}
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindow.xib b/WebKitTools/MiniBrowser/mac/BrowserWindow.xib
new file mode 100644
index 0000000..5984fe5
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindow.xib
@@ -0,0 +1,1558 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1060</int>
+ <string key="IBDocument.SystemVersion">10H545</string>
+ <string key="IBDocument.InterfaceBuilderVersion">820</string>
+ <string key="IBDocument.AppKitVersion">1038.35</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">820</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="9"/>
+ <integer value="71"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1001">
+ <string key="NSClassName">BrowserWindowController</string>
+ </object>
+ <object class="NSCustomObject" id="1003">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1004">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSWindowTemplate" id="1005">
+ <int key="NSWindowStyleMask">4111</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{517, 330}, {776, 608}}</string>
+ <int key="NSWTFlags">544735232</int>
+ <string key="NSWindowTitle">Window</string>
+ <string key="NSWindowClass">NSWindow</string>
+ <object class="NSToolbar" key="NSViewClass" id="726585754">
+ <object class="NSMutableString" key="NSToolbarIdentifier">
+ <characters key="NS.bytes">994A0CB1-7575-4F39-A65B-7165AB1E8015</characters>
+ </object>
+ <nil key="NSToolbarDelegate"/>
+ <bool key="NSToolbarPrefersToBeShown">YES</bool>
+ <bool key="NSToolbarShowsBaselineSeparator">YES</bool>
+ <bool key="NSToolbarAllowsUserCustomization">YES</bool>
+ <bool key="NSToolbarAutosavesConfiguration">NO</bool>
+ <int key="NSToolbarDisplayMode">2</int>
+ <int key="NSToolbarSizeMode">1</int>
+ <object class="NSMutableDictionary" key="NSToolbarIBIdentifiedItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>255D29F2-C9AA-4B4B-BB43-B38FCD6A0BBB</string>
+ <string>6BDC61B7-F1A8-425A-A212-9CAC59C56385</string>
+ <string>73DE9F4B-73E2-4036-A134-2D9E029DA980</string>
+ <string>88C16109-D40F-4682-BCE4-CBEE2EDE32D2</string>
+ <string>E1A9D32A-59E3-467B-9ABA-A95780416E69</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSToolbarItem" id="16289946">
+ <object class="NSMutableString" key="NSToolbarItemIdentifier">
+ <characters key="NS.bytes">255D29F2-C9AA-4B4B-BB43-B38FCD6A0BBB</characters>
+ </object>
+ <string key="NSToolbarItemLabel">Location</string>
+ <string key="NSToolbarItemPaletteLabel">Location</string>
+ <nil key="NSToolbarItemToolTip"/>
+ <object class="NSTextField" key="NSToolbarItemView" id="690456651">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrame">{{0, 14}, {565, 22}}</string>
+ <int key="NSViewLayerContentsRedrawPolicy">2</int>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="1023147716">
+ <int key="NSCellFlags">-1804468671</int>
+ <int key="NSCellFlags2">268436480</int>
+ <string key="NSContents"/>
+ <object class="NSFont" key="NSSupport" id="1064395332">
+ <string key="NSName">LucidaGrande</string>
+ <double key="NSSize">13</double>
+ <int key="NSfFlags">1044</int>
+ </object>
+ <reference key="NSControlView" ref="690456651"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <object class="NSColor" key="NSBackgroundColor" id="1032961300">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textBackgroundColor</string>
+ <object class="NSColor" key="NSColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ </object>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">textColor</string>
+ <object class="NSColor" key="NSColor" id="365730878">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MAA</bytes>
+ </object>
+ </object>
+ </object>
+ </object>
+ <nil key="NSToolbarItemImage"/>
+ <nil key="NSToolbarItemTarget"/>
+ <nil key="NSToolbarItemAction"/>
+ <string key="NSToolbarItemMinSize">{200, 22}</string>
+ <string key="NSToolbarItemMaxSize">{800, 22}</string>
+ <bool key="NSToolbarItemEnabled">YES</bool>
+ <bool key="NSToolbarItemAutovalidates">YES</bool>
+ <int key="NSToolbarItemTag">0</int>
+ <bool key="NSToolbarIsUserRemovable">YES</bool>
+ <int key="NSToolbarItemVisibilityPriority">0</int>
+ </object>
+ <object class="NSToolbarItem" id="457655522">
+ <object class="NSMutableString" key="NSToolbarItemIdentifier">
+ <characters key="NS.bytes">6BDC61B7-F1A8-425A-A212-9CAC59C56385</characters>
+ </object>
+ <string key="NSToolbarItemLabel">Progress</string>
+ <string key="NSToolbarItemPaletteLabel">Progress</string>
+ <nil key="NSToolbarItemToolTip"/>
+ <object class="NSProgressIndicator" key="NSToolbarItemView" id="128750774">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">1289</int>
+ <object class="NSPSMatrix" key="NSDrawMatrix"/>
+ <string key="NSFrame">{{19, 14}, {16, 16}}</string>
+ <int key="NSpiFlags">28936</int>
+ <double key="NSMaxValue">1</double>
+ </object>
+ <nil key="NSToolbarItemImage"/>
+ <nil key="NSToolbarItemTarget"/>
+ <nil key="NSToolbarItemAction"/>
+ <string key="NSToolbarItemMinSize">{16, 16}</string>
+ <string key="NSToolbarItemMaxSize">{16, 16}</string>
+ <bool key="NSToolbarItemEnabled">YES</bool>
+ <bool key="NSToolbarItemAutovalidates">YES</bool>
+ <int key="NSToolbarItemTag">-1</int>
+ <bool key="NSToolbarIsUserRemovable">YES</bool>
+ <int key="NSToolbarItemVisibilityPriority">0</int>
+ </object>
+ <object class="NSToolbarItem" id="332491395">
+ <object class="NSMutableString" key="NSToolbarItemIdentifier">
+ <characters key="NS.bytes">73DE9F4B-73E2-4036-A134-2D9E029DA980</characters>
+ </object>
+ <string key="NSToolbarItemLabel">Go Back</string>
+ <string key="NSToolbarItemPaletteLabel">Go Back</string>
+ <nil key="NSToolbarItemToolTip"/>
+ <object class="NSButton" key="NSToolbarItemView" id="777930419">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{9, 14}, {32, 25}}</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="663899880">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="1064395332"/>
+ <reference key="NSControlView" ref="777930419"/>
+ <int key="NSButtonFlags">-2033434369</int>
+ <int key="NSButtonFlags2">163</int>
+ <object class="NSCustomResource" key="NSNormalImage" id="206098440">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSGoLeftTemplate</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ </object>
+ <reference key="NSToolbarItemImage" ref="206098440"/>
+ <nil key="NSToolbarItemTarget"/>
+ <nil key="NSToolbarItemAction"/>
+ <string key="NSToolbarItemMinSize">{32, 25}</string>
+ <string key="NSToolbarItemMaxSize">{32, 25}</string>
+ <bool key="NSToolbarItemEnabled">YES</bool>
+ <bool key="NSToolbarItemAutovalidates">YES</bool>
+ <int key="NSToolbarItemTag">0</int>
+ <bool key="NSToolbarIsUserRemovable">YES</bool>
+ <int key="NSToolbarItemVisibilityPriority">0</int>
+ </object>
+ <object class="NSToolbarItem" id="818723416">
+ <object class="NSMutableString" key="NSToolbarItemIdentifier">
+ <characters key="NS.bytes">88C16109-D40F-4682-BCE4-CBEE2EDE32D2</characters>
+ </object>
+ <string key="NSToolbarItemLabel">Refresh</string>
+ <string key="NSToolbarItemPaletteLabel">Refresh</string>
+ <nil key="NSToolbarItemToolTip"/>
+ <object class="NSButton" key="NSToolbarItemView" id="35464578">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{10, 14}, {29, 25}}</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="366486485">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="1064395332"/>
+ <reference key="NSControlView" ref="35464578"/>
+ <int key="NSButtonFlags">-2033434369</int>
+ <int key="NSButtonFlags2">163</int>
+ <object class="NSCustomResource" key="NSNormalImage" id="443763357">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSRefreshTemplate</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ </object>
+ <reference key="NSToolbarItemImage" ref="443763357"/>
+ <nil key="NSToolbarItemTarget"/>
+ <nil key="NSToolbarItemAction"/>
+ <string key="NSToolbarItemMinSize">{29, 25}</string>
+ <string key="NSToolbarItemMaxSize">{29, 25}</string>
+ <bool key="NSToolbarItemEnabled">YES</bool>
+ <bool key="NSToolbarItemAutovalidates">YES</bool>
+ <int key="NSToolbarItemTag">0</int>
+ <bool key="NSToolbarIsUserRemovable">YES</bool>
+ <int key="NSToolbarItemVisibilityPriority">0</int>
+ </object>
+ <object class="NSToolbarItem" id="928383107">
+ <object class="NSMutableString" key="NSToolbarItemIdentifier">
+ <characters key="NS.bytes">E1A9D32A-59E3-467B-9ABA-A95780416E69</characters>
+ </object>
+ <string key="NSToolbarItemLabel">Go Forward</string>
+ <string key="NSToolbarItemPaletteLabel">Go Forward</string>
+ <nil key="NSToolbarItemToolTip"/>
+ <object class="NSButton" key="NSToolbarItemView" id="95415629">
+ <nil key="NSNextResponder"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{19, 14}, {32, 25}}</string>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="767612038">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="1064395332"/>
+ <reference key="NSControlView" ref="95415629"/>
+ <int key="NSButtonFlags">-2033434369</int>
+ <int key="NSButtonFlags2">163</int>
+ <object class="NSCustomResource" key="NSNormalImage" id="163672266">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSGoRightTemplate</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ </object>
+ <reference key="NSToolbarItemImage" ref="163672266"/>
+ <nil key="NSToolbarItemTarget"/>
+ <nil key="NSToolbarItemAction"/>
+ <string key="NSToolbarItemMinSize">{32, 25}</string>
+ <string key="NSToolbarItemMaxSize">{32, 25}</string>
+ <bool key="NSToolbarItemEnabled">YES</bool>
+ <bool key="NSToolbarItemAutovalidates">YES</bool>
+ <int key="NSToolbarItemTag">0</int>
+ <bool key="NSToolbarIsUserRemovable">YES</bool>
+ <int key="NSToolbarItemVisibilityPriority">0</int>
+ </object>
+ </object>
+ </object>
+ <object class="NSArray" key="NSToolbarIBAllowedItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="332491395"/>
+ <reference ref="928383107"/>
+ <reference ref="818723416"/>
+ <reference ref="457655522"/>
+ <reference ref="16289946"/>
+ </object>
+ <object class="NSMutableArray" key="NSToolbarIBDefaultItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="332491395"/>
+ <reference ref="928383107"/>
+ <reference ref="818723416"/>
+ <reference ref="16289946"/>
+ <reference ref="457655522"/>
+ </object>
+ <object class="NSMutableArray" key="NSToolbarIBSelectableItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ <object class="NSView" key="NSWindowView" id="1006">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomView" id="877383975">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{776, 608}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <int key="NSViewLayerContentsRedrawPolicy">2</int>
+ <string key="NSClassName">NSView</string>
+ </object>
+ </object>
+ <string key="NSFrameSize">{776, 608}</string>
+ <reference key="NSSuperview"/>
+ <int key="NSViewLayerContentsRedrawPolicy">2</int>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ <string key="NSFrameAutosaveName">Main Window</string>
+ </object>
+ <object class="NSWindowTemplate" id="833876351">
+ <int key="NSWindowStyleMask">147</int>
+ <int key="NSWindowBacking">2</int>
+ <string key="NSWindowRect">{{230, 479}, {452, 62}}</string>
+ <int key="NSWTFlags">-461897728</int>
+ <string key="NSWindowTitle">Find</string>
+ <string key="NSWindowClass">NSPanel</string>
+ <nil key="NSViewClass"/>
+ <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ <object class="NSView" key="NSWindowView" id="585866018">
+ <reference key="NSNextResponder"/>
+ <int key="NSvFlags">256</int>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSSearchField" id="841639270">
+ <reference key="NSNextResponder" ref="585866018"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{20, 20}, {412, 22}}</string>
+ <reference key="NSSuperview" ref="585866018"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSSearchFieldCell" key="NSCell" id="41426839">
+ <int key="NSCellFlags">343014976</int>
+ <int key="NSCellFlags2">268436544</int>
+ <string key="NSContents"/>
+ <reference key="NSSupport" ref="1064395332"/>
+ <reference key="NSControlView" ref="841639270"/>
+ <bool key="NSDrawsBackground">YES</bool>
+ <int key="NSTextBezelStyle">1</int>
+ <reference key="NSBackgroundColor" ref="1032961300"/>
+ <object class="NSColor" key="NSTextColor">
+ <int key="NSColorSpace">6</int>
+ <string key="NSCatalogName">System</string>
+ <string key="NSColorName">controlTextColor</string>
+ <reference key="NSColor" ref="365730878"/>
+ </object>
+ <object class="NSButtonCell" key="NSSearchButtonCell">
+ <int key="NSCellFlags">130560</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">search</string>
+ <reference key="NSControlView" ref="841639270"/>
+ <string key="NSAction">_searchFieldSearch:</string>
+ <reference key="NSTarget" ref="41426839"/>
+ <int key="NSButtonFlags">138690815</int>
+ <int key="NSButtonFlags2">0</int>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ <object class="NSButtonCell" key="NSCancelButtonCell">
+ <int key="NSCellFlags">130560</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">clear</string>
+ <object class="NSMutableArray" key="NSAccessibilityOverriddenAttributes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMutableDictionary">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>AXDescription</string>
+ <string>NSAccessibilityEncodedAttributesValueType</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>cancel</string>
+ <integer value="1"/>
+ </object>
+ </object>
+ </object>
+ <reference key="NSControlView" ref="841639270"/>
+ <string key="NSAction">_searchFieldCancel:</string>
+ <reference key="NSTarget" ref="41426839"/>
+ <int key="NSButtonFlags">138690815</int>
+ <int key="NSButtonFlags2">0</int>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">400</int>
+ <int key="NSPeriodicInterval">75</int>
+ </object>
+ <int key="NSMaximumRecents">255</int>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrameSize">{452, 62}</string>
+ <reference key="NSSuperview"/>
+ </object>
+ <string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
+ <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">window</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="1005"/>
+ </object>
+ <int key="connectionID">3</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="1005"/>
+ <reference key="destination" ref="1001"/>
+ </object>
+ <int key="connectionID">4</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">urlText</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="690456651"/>
+ </object>
+ <int key="connectionID">32</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">progressIndicator</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="128750774"/>
+ </object>
+ <int key="connectionID">33</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">reloadButton</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="35464578"/>
+ </object>
+ <int key="connectionID">34</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">reload:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="35464578"/>
+ </object>
+ <int key="connectionID">35</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">fetch:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="690456651"/>
+ </object>
+ <int key="connectionID">36</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">containerView</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="877383975"/>
+ </object>
+ <int key="connectionID">37</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">backButton</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="777930419"/>
+ </object>
+ <int key="connectionID">46</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">forwardButton</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="95415629"/>
+ </object>
+ <int key="connectionID">47</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">goBack:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="332491395"/>
+ </object>
+ <int key="connectionID">61</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">goForward:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="928383107"/>
+ </object>
+ <int key="connectionID">62</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">toolbar</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="726585754"/>
+ </object>
+ <int key="connectionID">67</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">find:</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="841639270"/>
+ </object>
+ <int key="connectionID">76</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">findPanelWindow</string>
+ <reference key="source" ref="1001"/>
+ <reference key="destination" ref="833876351"/>
+ </object>
+ <int key="connectionID">77</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1000"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="1001"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="1003"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1004"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">1</int>
+ <reference key="object" ref="1005"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1006"/>
+ <reference ref="726585754"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">2</int>
+ <reference key="object" ref="1006"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="877383975"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">9</int>
+ <reference key="object" ref="877383975"/>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">48</int>
+ <reference key="object" ref="726585754"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="332491395"/>
+ <reference ref="928383107"/>
+ <reference ref="818723416"/>
+ <reference ref="16289946"/>
+ <reference ref="457655522"/>
+ </object>
+ <reference key="parent" ref="1005"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">56</int>
+ <reference key="object" ref="332491395"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="777930419"/>
+ </object>
+ <reference key="parent" ref="726585754"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">40</int>
+ <reference key="object" ref="777930419"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="663899880"/>
+ </object>
+ <reference key="parent" ref="332491395"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">41</int>
+ <reference key="object" ref="663899880"/>
+ <reference key="parent" ref="777930419"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">57</int>
+ <reference key="object" ref="928383107"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="95415629"/>
+ </object>
+ <reference key="parent" ref="726585754"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">42</int>
+ <reference key="object" ref="95415629"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="767612038"/>
+ </object>
+ <reference key="parent" ref="928383107"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">43</int>
+ <reference key="object" ref="767612038"/>
+ <reference key="parent" ref="95415629"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">58</int>
+ <reference key="object" ref="818723416"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="35464578"/>
+ </object>
+ <reference key="parent" ref="726585754"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="35464578"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="366486485"/>
+ </object>
+ <reference key="parent" ref="818723416"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">24</int>
+ <reference key="object" ref="366486485"/>
+ <reference key="parent" ref="35464578"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">59</int>
+ <reference key="object" ref="16289946"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="690456651"/>
+ </object>
+ <reference key="parent" ref="726585754"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">10</int>
+ <reference key="object" ref="690456651"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1023147716"/>
+ </object>
+ <reference key="parent" ref="16289946"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">11</int>
+ <reference key="object" ref="1023147716"/>
+ <reference key="parent" ref="690456651"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">60</int>
+ <reference key="object" ref="457655522"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="128750774"/>
+ </object>
+ <reference key="parent" ref="726585754"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">21</int>
+ <reference key="object" ref="128750774"/>
+ <reference key="parent" ref="457655522"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">70</int>
+ <reference key="object" ref="833876351"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="585866018"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">71</int>
+ <reference key="object" ref="585866018"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="841639270"/>
+ </object>
+ <reference key="parent" ref="833876351"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">74</int>
+ <reference key="object" ref="841639270"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="41426839"/>
+ </object>
+ <reference key="parent" ref="585866018"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">75</int>
+ <reference key="object" ref="41426839"/>
+ <reference key="parent" ref="841639270"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>1.IBEditorWindowLastContentRect</string>
+ <string>1.IBPluginDependency</string>
+ <string>1.IBWindowTemplateEditedContentRect</string>
+ <string>1.NSWindowTemplate.visibleAtLaunch</string>
+ <string>1.WindowOrigin</string>
+ <string>1.editorWindowContentRectSynchronizationRect</string>
+ <string>10.IBPluginDependency</string>
+ <string>11.IBPluginDependency</string>
+ <string>2.IBPluginDependency</string>
+ <string>21.IBPluginDependency</string>
+ <string>21.IBViewIntegration.shadowBlurRadius</string>
+ <string>21.IBViewIntegration.shadowColor</string>
+ <string>21.IBViewIntegration.shadowOffsetHeight</string>
+ <string>21.IBViewIntegration.shadowOffsetWidth</string>
+ <string>23.IBPluginDependency</string>
+ <string>24.IBPluginDependency</string>
+ <string>40.IBPluginDependency</string>
+ <string>41.IBPluginDependency</string>
+ <string>42.IBPluginDependency</string>
+ <string>43.IBPluginDependency</string>
+ <string>48.IBEditorWindowLastContentRect</string>
+ <string>48.IBPluginDependency</string>
+ <string>56.CustomClassName</string>
+ <string>57.CustomClassName</string>
+ <string>58.CustomClassName</string>
+ <string>70.IBEditorWindowLastContentRect</string>
+ <string>70.IBPluginDependency</string>
+ <string>70.IBWindowTemplateEditedContentRect</string>
+ <string>70.NSWindowTemplate.visibleAtLaunch</string>
+ <string>71.IBPluginDependency</string>
+ <string>74.IBPluginDependency</string>
+ <string>75.IBPluginDependency</string>
+ <string>9.IBPluginDependency</string>
+ <string>9.IBViewBoundsToFrameTransform</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{{404, 157}, {776, 608}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{404, 157}, {776, 608}}</string>
+ <integer value="1"/>
+ <string>{196, 240}</string>
+ <string>{{202, 428}, {480, 270}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <real value="0.0"/>
+ <reference ref="365730878"/>
+ <real value="0.0"/>
+ <real value="0.0"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{422, 781}, {616, 0}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>MBToolbarItem</string>
+ <string>MBToolbarItem</string>
+ <string>MBToolbarItem</string>
+ <string>{{558, 468}, {452, 62}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{558, 468}, {452, 62}}</string>
+ <boolean value="NO"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <object class="NSAffineTransform"/>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">77</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">BrowserWindowController</string>
+ <string key="superclassName">NSWindowController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>dumpSourceToConsole:</string>
+ <string>fetch:</string>
+ <string>find:</string>
+ <string>forceRepaint:</string>
+ <string>goBack:</string>
+ <string>goForward:</string>
+ <string>reload:</string>
+ <string>removeReinsertWebView:</string>
+ <string>resetZoom:</string>
+ <string>showHideWebView:</string>
+ <string>toggleZoomMode:</string>
+ <string>zoomIn:</string>
+ <string>zoomOut:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>dumpSourceToConsole:</string>
+ <string>fetch:</string>
+ <string>find:</string>
+ <string>forceRepaint:</string>
+ <string>goBack:</string>
+ <string>goForward:</string>
+ <string>reload:</string>
+ <string>removeReinsertWebView:</string>
+ <string>resetZoom:</string>
+ <string>showHideWebView:</string>
+ <string>toggleZoomMode:</string>
+ <string>zoomIn:</string>
+ <string>zoomOut:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">dumpSourceToConsole:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">fetch:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">find:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">forceRepaint:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">goBack:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">goForward:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">reload:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">removeReinsertWebView:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">resetZoom:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">showHideWebView:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">toggleZoomMode:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">zoomIn:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">zoomOut:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>backButton</string>
+ <string>containerView</string>
+ <string>findPanelWindow</string>
+ <string>forwardButton</string>
+ <string>progressIndicator</string>
+ <string>reloadButton</string>
+ <string>toolbar</string>
+ <string>urlText</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSButton</string>
+ <string>NSView</string>
+ <string>NSWindow</string>
+ <string>NSButton</string>
+ <string>NSProgressIndicator</string>
+ <string>NSButton</string>
+ <string>NSToolbar</string>
+ <string>NSTextField</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>backButton</string>
+ <string>containerView</string>
+ <string>findPanelWindow</string>
+ <string>forwardButton</string>
+ <string>progressIndicator</string>
+ <string>reloadButton</string>
+ <string>toolbar</string>
+ <string>urlText</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">backButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">containerView</string>
+ <string key="candidateClassName">NSView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">findPanelWindow</string>
+ <string key="candidateClassName">NSWindow</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">forwardButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">progressIndicator</string>
+ <string key="candidateClassName">NSProgressIndicator</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">reloadButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">toolbar</string>
+ <string key="candidateClassName">NSToolbar</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">urlText</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">mac/BrowserWindowController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">BrowserWindowController</string>
+ <string key="superclassName">NSWindowController</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">MBToolbarItem</string>
+ <string key="superclassName">NSToolbarItem</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">MBToolbarItem.h</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSActionCell</string>
+ <string key="superclassName">NSCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="558771426">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="344596456">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="428409299">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSButton</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSButtonCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSCell</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSControl</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="297186634">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFormatter</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMenu</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="808053469">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="558771426"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="344596456"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="428409299"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="297186634"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="808053469"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="335804019">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="555757547">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSPanel</string>
+ <string key="superclassName">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSProgressIndicator</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSProgressIndicator.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSSearchField</string>
+ <string key="superclassName">NSTextField</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSearchField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSSearchFieldCell</string>
+ <string key="superclassName">NSTextFieldCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSearchFieldCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextField</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextFieldCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSToolbar</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSToolbar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSToolbarItem</string>
+ <string key="superclassName">NSObject</string>
+ <reference key="sourceIdentifier" ref="335804019"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <string key="superclassName">NSResponder</string>
+ <reference key="sourceIdentifier" ref="555757547"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindowController</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">showWindow:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">showWindow:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">showWindow:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../MiniBrowser.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSGoLeftTemplate</string>
+ <string>NSGoRightTemplate</string>
+ <string>NSRefreshTemplate</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{9, 9}</string>
+ <string>{9, 9}</string>
+ <string>{10, 12}</string>
+ </object>
+ </object>
+ </data>
+</archive>
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.h b/WebKitTools/MiniBrowser/mac/BrowserWindowController.h
new file mode 100644
index 0000000..6b6aeb8
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.h
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+@interface BrowserWindowController : NSWindowController {
+ IBOutlet NSProgressIndicator *progressIndicator;
+ IBOutlet NSButton *reloadButton;
+ IBOutlet NSButton *backButton;
+ IBOutlet NSButton *forwardButton;
+ IBOutlet NSToolbar *toolbar;
+ IBOutlet NSTextField *urlText;
+ IBOutlet NSView *containerView;
+
+ IBOutlet NSWindow *findPanelWindow;
+
+ WKPageNamespaceRef _pageNamespace;
+ WKView *_webView;
+ BOOL _zoomTextOnly;
+}
+- (IBAction)fetch:(id)sender;
+- (IBAction)reload:(id)sender;
+- (IBAction)forceRepaint:(id)sender;
+- (IBAction)goBack:(id)sender;
+- (IBAction)goForward:(id)sender;
+
+- (IBAction)showHideWebView:(id)sender;
+- (IBAction)removeReinsertWebView:(id)sender;
+
+- (id)initWithPageNamespace:(WKPageNamespaceRef)pageNamespace;
+- (void)loadURLString:(NSString *)urlString;
+- (void)applicationTerminating;
+
+- (IBAction)zoomIn:(id)sender;
+- (IBAction)zoomOut:(id)sender;
+- (IBAction)resetZoom:(id)sender;
+- (BOOL)canZoomIn;
+- (BOOL)canZoomOut;
+- (BOOL)canResetZoom;
+
+- (IBAction)toggleZoomMode:(id)sender;
+
+- (IBAction)dumpSourceToConsole:(id)sender;
+
+- (IBAction)find:(id)sender;
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
new file mode 100644
index 0000000..4f2b63f
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -0,0 +1,697 @@
+/*
+ * 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 "BrowserWindowController.h"
+
+#import <WebKit2/WKPagePrivate.h>
+#import <WebKit2/WKStringCF.h>
+#import <WebKit2/WKURLCF.h>
+
+@interface BrowserWindowController ()
+- (void)didStartProgress;
+- (void)didChangeProgress:(double)value;
+- (void)didFinishProgress;
+- (void)didStartProvisionalLoadForFrame:(WKFrameRef)frame;
+- (void)didCommitLoadForFrame:(WKFrameRef)frame;
+- (void)didReceiveServerRedirectForProvisionalLoadForFrame:(WKFrameRef)frame;
+- (void)didFailProvisionalLoadWithErrorForFrame:(WKFrameRef)frame;
+- (void)didFailLoadWithErrorForFrame:(WKFrameRef)frame;
+@end
+
+@implementation BrowserWindowController
+
+- (id)initWithPageNamespace:(WKPageNamespaceRef)pageNamespace
+{
+ if ((self = [super initWithWindowNibName:@"BrowserWindow"])) {
+ _pageNamespace = WKRetain(pageNamespace);
+ _zoomTextOnly = NO;
+ }
+
+ return self;
+}
+
+- (void)dealloc
+{
+ assert(!_pageNamespace);
+ [super dealloc];
+}
+
+- (IBAction)fetch:(id)sender
+{
+ CFURLRef cfURL = CFURLCreateWithString(0, (CFStringRef)[urlText stringValue], 0);
+ if (!cfURL)
+ return;
+
+ WKURLRef url = WKURLCreateWithCFURL(cfURL);
+ CFRelease(cfURL);
+
+ WKPageLoadURL(_webView.pageRef, url);
+ WKRelease(url);
+}
+
+- (IBAction)showHideWebView:(id)sender
+{
+ BOOL hidden = ![_webView isHidden];
+
+ [_webView setHidden:hidden];
+}
+
+- (IBAction)removeReinsertWebView:(id)sender
+{
+ if ([_webView window]) {
+ [_webView retain];
+ [_webView removeFromSuperview];
+ } else {
+ [containerView addSubview:_webView];
+ [_webView release];
+ }
+}
+
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
+{
+ SEL action = [menuItem action];
+
+ if (action == @selector(zoomIn:))
+ return [self canZoomIn];
+ if (action == @selector(zoomOut:))
+ return [self canZoomOut];
+ if (action == @selector(resetZoom:))
+ return [self canResetZoom];
+
+ if (action == @selector(showHideWebView:))
+ [menuItem setTitle:[_webView isHidden] ? @"Show Web View" : @"Hide Web View"];
+ else if (action == @selector(removeReinsertWebView:))
+ [menuItem setTitle:[_webView window] ? @"Remove Web View" : @"Insert Web View"];
+ else if (action == @selector(toggleZoomMode:))
+ [menuItem setState:_zoomTextOnly ? NSOnState : NSOffState];
+ return YES;
+}
+
+- (IBAction)reload:(id)sender
+{
+ WKPageReload(_webView.pageRef);
+}
+
+- (IBAction)forceRepaint:(id)sender
+{
+ [_webView setNeedsDisplay:YES];
+}
+
+- (IBAction)goBack:(id)sender
+{
+ WKPageGoBack(_webView.pageRef);
+}
+
+- (IBAction)goForward:(id)sender
+{
+ WKPageGoForward(_webView.pageRef);
+}
+
+- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
+{
+ SEL action = [item action];
+
+ if (action == @selector(goBack:))
+ return _webView && WKPageCanGoBack(_webView.pageRef);
+
+ if (action == @selector(goForward:))
+ return _webView && WKPageCanGoForward(_webView.pageRef);
+
+ return YES;
+}
+
+- (void)validateToolbar
+{
+ [toolbar validateVisibleItems];
+}
+
+- (BOOL)windowShouldClose:(id)sender
+{
+ LOG(@"windowShouldClose");
+ BOOL canCloseImmediately = WKPageTryClose(_webView.pageRef);
+ return canCloseImmediately;
+}
+
+- (void)windowWillClose:(NSNotification *)notification
+{
+ WKRelease(_pageNamespace);
+ _pageNamespace = 0;
+}
+
+- (void)applicationTerminating
+{
+ WKPageClose(_webView.pageRef);
+ WKRelease(_webView.pageRef);
+}
+
+#define DefaultMinimumZoomFactor (.5)
+#define DefaultMaximumZoomFactor (3.0)
+#define DefaultZoomFactorRatio (1.2)
+
+- (double)currentZoomFactor
+{
+ return _zoomTextOnly ? WKPageGetTextZoomFactor(_webView.pageRef) : WKPageGetPageZoomFactor(_webView.pageRef);
+}
+
+- (void)setCurrentZoomFactor:(double)factor
+{
+ _zoomTextOnly ? WKPageSetTextZoomFactor(_webView.pageRef, factor) : WKPageSetPageZoomFactor(_webView.pageRef, factor);
+}
+
+- (BOOL)canZoomIn
+{
+ return [self currentZoomFactor] * DefaultZoomFactorRatio < DefaultMaximumZoomFactor;
+}
+
+- (void)zoomIn:(id)sender
+{
+ if (![self canZoomIn])
+ return;
+
+ double factor = [self currentZoomFactor] * DefaultZoomFactorRatio;
+ [self setCurrentZoomFactor:factor];
+}
+
+- (BOOL)canZoomOut
+{
+ return [self currentZoomFactor] / DefaultZoomFactorRatio > DefaultMinimumZoomFactor;
+}
+
+- (void)zoomOut:(id)sender
+{
+ if (![self canZoomIn])
+ return;
+
+ double factor = [self currentZoomFactor] / DefaultZoomFactorRatio;
+ [self setCurrentZoomFactor:factor];
+}
+
+- (BOOL)canResetZoom
+{
+ return _zoomTextOnly ? (WKPageGetTextZoomFactor(_webView.pageRef) != 1) : (WKPageGetPageZoomFactor(_webView.pageRef) != 1);
+}
+
+- (void)resetZoom:(id)sender
+{
+ if (![self canResetZoom])
+ return;
+
+ if (_zoomTextOnly)
+ WKPageSetTextZoomFactor(_webView.pageRef, 1);
+ else
+ WKPageSetPageZoomFactor(_webView.pageRef, 1);
+}
+
+- (IBAction)toggleZoomMode:(id)sender
+{
+ if (_zoomTextOnly) {
+ _zoomTextOnly = NO;
+ double currentTextZoom = WKPageGetTextZoomFactor(_webView.pageRef);
+ WKPageSetPageAndTextZoomFactors(_webView.pageRef, currentTextZoom, 1);
+ } else {
+ _zoomTextOnly = YES;
+ double currentPageZoom = WKPageGetPageZoomFactor(_webView.pageRef);
+ WKPageSetPageAndTextZoomFactors(_webView.pageRef, 1, currentPageZoom);
+ }
+}
+
+- (IBAction)dumpSourceToConsole:(id)sender
+{
+ WKPageGetSourceForFrame_b(_webView.pageRef, WKPageGetMainFrame(_webView.pageRef), ^(WKStringRef result, WKErrorRef error) {
+ CFStringRef cfResult = WKStringCopyCFString(0, result);
+ LOG(@"Main frame source\n \"%@\"", (NSString *)cfResult);
+ CFRelease(cfResult);
+ });
+}
+
+#pragma mark Loader Client Callbacks
+
+static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ [(BrowserWindowController *)clientInfo didStartProvisionalLoadForFrame:frame];
+}
+
+static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ [(BrowserWindowController *)clientInfo didReceiveServerRedirectForProvisionalLoadForFrame:frame];
+}
+
+static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void *clientInfo)
+{
+ [(BrowserWindowController *)clientInfo didFailProvisionalLoadWithErrorForFrame:frame];
+}
+
+static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ [(BrowserWindowController *)clientInfo didCommitLoadForFrame:frame];
+}
+
+static void didFinishDocumentLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didFinishDocumentLoadForFrame");
+}
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didFinishLoadForFrame");
+}
+
+static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void *clientInfo)
+{
+ [(BrowserWindowController *)clientInfo didFailLoadWithErrorForFrame:frame];
+}
+
+static void didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ CFStringRef cfTitle = WKStringCopyCFString(0, title);
+ LOG(@"didReceiveTitleForFrame \"%@\"", (NSString *)cfTitle);
+ CFRelease(cfTitle);
+}
+
+static void didFirstLayoutForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didFirstLayoutForFrame");
+}
+
+static void didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didFirstVisuallyNonEmptyLayoutForFrame");
+}
+
+static void didRemoveFrameFromHierarchy(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didRemoveFrameFromHierarchy");
+}
+
+static void didDisplayInsecureContentForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didDisplayInsecureContentForFrame");
+}
+
+static void didRunInsecureContentForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"didRunInsecureContentForFrame");
+}
+
+static void didStartProgress(WKPageRef page, const void *clientInfo)
+{
+ [(BrowserWindowController *)clientInfo didStartProgress];
+}
+
+static void didChangeProgress(WKPageRef page, const void *clientInfo)
+{
+ [(BrowserWindowController *)clientInfo didChangeProgress:WKPageGetEstimatedProgress(page)];
+}
+
+static void didFinishProgress(WKPageRef page, const void *clientInfo)
+{
+ [(BrowserWindowController *)clientInfo didFinishProgress];
+}
+
+static void didBecomeUnresponsive(WKPageRef page, const void *clientInfo)
+{
+ LOG(@"didBecomeUnresponsive");
+}
+
+static void didBecomeResponsive(WKPageRef page, const void *clientInfo)
+{
+ LOG(@"didBecomeResponsive");
+}
+
+static void processDidExit(WKPageRef page, const void *clientInfo)
+{
+ LOG(@"processDidExit");
+}
+
+static void didChangeBackForwardList(WKPageRef page, const void *clientInfo)
+{
+ [(BrowserWindowController *)clientInfo validateToolbar];
+}
+
+#pragma mark Policy Client Callbacks
+
+static void decidePolicyForNavigationAction(WKPageRef page, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+{
+ LOG(@"decidePolicyForNavigationAction");
+ WKFramePolicyListenerUse(listener);
+}
+
+static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+{
+ LOG(@"decidePolicyForNewWindowAction");
+ WKFramePolicyListenerUse(listener);
+}
+
+static void decidePolicyForMIMEType(WKPageRef page, WKStringRef MIMEType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
+{
+ WKFramePolicyListenerUse(listener);
+}
+
+#pragma mark UI Client Callbacks
+
+static WKPageRef createNewPage(WKPageRef page, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton button, const void* clientInfo)
+{
+ LOG(@"createNewPage");
+ BrowserWindowController *controller = [[BrowserWindowController alloc] initWithPageNamespace:WKPageGetPageNamespace(page)];
+ [controller loadWindow];
+
+ return controller->_webView.pageRef;
+}
+
+static void showPage(WKPageRef page, const void *clientInfo)
+{
+ LOG(@"showPage");
+ [[(BrowserWindowController *)clientInfo window] orderFront:nil];
+}
+
+static void closePage(WKPageRef page, const void *clientInfo)
+{
+ LOG(@"closePage");
+ WKPageClose(page);
+ [[(BrowserWindowController *)clientInfo window] close];
+ WKRelease(page);
+}
+
+static void runJavaScriptAlert(WKPageRef page, WKStringRef message, WKFrameRef frame, const void* clientInfo)
+{
+ NSAlert* alert = [[NSAlert alloc] init];
+
+ WKURLRef wkURL = WKFrameCopyURL(frame);
+ CFURLRef cfURL = WKURLCopyCFURL(0, wkURL);
+ WKRelease(wkURL);
+
+ [alert setMessageText:[NSString stringWithFormat:@"JavaScript alert dialog from %@.", [(NSURL *)cfURL absoluteString]]];
+ CFRelease(cfURL);
+
+ CFStringRef cfMessage = WKStringCopyCFString(0, message);
+ [alert setInformativeText:(NSString *)cfMessage];
+ CFRelease(cfMessage);
+
+ [alert addButtonWithTitle:@"OK"];
+
+ [alert runModal];
+ [alert release];
+}
+
+static bool runJavaScriptConfirm(WKPageRef page, WKStringRef message, WKFrameRef frame, const void* clientInfo)
+{
+ NSAlert* alert = [[NSAlert alloc] init];
+
+ WKURLRef wkURL = WKFrameCopyURL(frame);
+ CFURLRef cfURL = WKURLCopyCFURL(0, wkURL);
+ WKRelease(wkURL);
+
+ [alert setMessageText:[NSString stringWithFormat:@"JavaScript confirm dialog from %@.", [(NSURL *)cfURL absoluteString]]];
+ CFRelease(cfURL);
+
+ CFStringRef cfMessage = WKStringCopyCFString(0, message);
+ [alert setInformativeText:(NSString *)cfMessage];
+ CFRelease(cfMessage);
+
+ [alert addButtonWithTitle:@"OK"];
+ [alert addButtonWithTitle:@"Cancel"];
+
+ NSInteger button = [alert runModal];
+ [alert release];
+
+ return button == NSAlertFirstButtonReturn;
+}
+
+static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void* clientInfo)
+{
+ NSAlert* alert = [[NSAlert alloc] init];
+
+ WKURLRef wkURL = WKFrameCopyURL(frame);
+ CFURLRef cfURL = WKURLCopyCFURL(0, wkURL);
+ WKRelease(wkURL);
+
+ [alert setMessageText:[NSString stringWithFormat:@"JavaScript prompt dialog from %@.", [(NSURL *)cfURL absoluteString]]];
+ CFRelease(cfURL);
+
+ CFStringRef cfMessage = WKStringCopyCFString(0, message);
+ [alert setInformativeText:(NSString *)cfMessage];
+ CFRelease(cfMessage);
+
+ [alert addButtonWithTitle:@"OK"];
+ [alert addButtonWithTitle:@"Cancel"];
+
+ NSTextField* input = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 200, 24)];
+ CFStringRef cfDefaultValue = WKStringCopyCFString(0, defaultValue);
+ [input setStringValue:(NSString *)cfDefaultValue];
+ CFRelease(cfDefaultValue);
+
+ [alert setAccessoryView:input];
+
+ NSInteger button = [alert runModal];
+
+ NSString* result = nil;
+ if (button == NSAlertFirstButtonReturn) {
+ [input validateEditing];
+ result = [input stringValue];
+ }
+
+ [alert release];
+
+ if (!result)
+ return 0;
+ return WKStringCreateWithCFString((CFStringRef)result);
+}
+
+static void setStatusText(WKPageRef page, WKStringRef text, const void* clientInfo)
+{
+ LOG(@"setStatusText");
+}
+
+static void mouseDidMoveOverElement(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo)
+{
+ LOG(@"mouseDidMoveOverElement");
+}
+
+static WKRect getWindowFrame(WKPageRef page, const void* clientInfo)
+{
+ NSRect rect = [[(BrowserWindowController *)clientInfo window] frame];
+ WKRect wkRect;
+ wkRect.origin.x = rect.origin.x;
+ wkRect.origin.y = rect.origin.y;
+ wkRect.size.width = rect.size.width;
+ wkRect.size.height = rect.size.height;
+ return wkRect;
+}
+
+static void setWindowFrame(WKPageRef page, WKRect rect, const void* clientInfo)
+{
+ [[(BrowserWindowController *)clientInfo window] setFrame:NSMakeRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height) display:YES];
+}
+
+static bool runBeforeUnloadConfirmPanel(WKPageRef page, WKStringRef message, WKFrameRef frame, const void* clientInfo)
+{
+ NSAlert *alert = [[NSAlert alloc] init];
+
+ WKURLRef wkURL = WKFrameCopyURL(frame);
+ CFURLRef cfURL = WKURLCopyCFURL(0, wkURL);
+ WKRelease(wkURL);
+
+ [alert setMessageText:[NSString stringWithFormat:@"BeforeUnload confirm dialog from %@.", [(NSURL *)cfURL absoluteString]]];
+ CFRelease(cfURL);
+
+ CFStringRef cfMessage = WKStringCopyCFString(0, message);
+ [alert setInformativeText:(NSString *)cfMessage];
+ CFRelease(cfMessage);
+
+ [alert addButtonWithTitle:@"OK"];
+ [alert addButtonWithTitle:@"Cancel"];
+
+ NSInteger button = [alert runModal];
+ [alert release];
+
+ return button == NSAlertFirstButtonReturn;
+}
+
+- (void)awakeFromNib
+{
+ _webView = [[WKView alloc] initWithFrame:[containerView frame] pageNamespaceRef:_pageNamespace];
+
+ [containerView addSubview:_webView];
+ [_webView setFrame:[containerView frame]];
+
+ [_webView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
+
+ WKPageLoaderClient loadClient = {
+ 0, /* version */
+ self, /* clientInfo */
+ didStartProvisionalLoadForFrame,
+ didReceiveServerRedirectForProvisionalLoadForFrame,
+ didFailProvisionalLoadWithErrorForFrame,
+ didCommitLoadForFrame,
+ didFinishDocumentLoadForFrame,
+ didFinishLoadForFrame,
+ didFailLoadWithErrorForFrame,
+ didReceiveTitleForFrame,
+ didFirstLayoutForFrame,
+ didFirstVisuallyNonEmptyLayoutForFrame,
+ didRemoveFrameFromHierarchy,
+ didDisplayInsecureContentForFrame,
+ didRunInsecureContentForFrame,
+ didStartProgress,
+ didChangeProgress,
+ didFinishProgress,
+ didBecomeUnresponsive,
+ didBecomeResponsive,
+ processDidExit,
+ didChangeBackForwardList
+ };
+ WKPageSetPageLoaderClient(_webView.pageRef, &loadClient);
+
+ WKPagePolicyClient policyClient = {
+ 0, /* version */
+ self, /* clientInfo */
+ decidePolicyForNavigationAction,
+ decidePolicyForNewWindowAction,
+ decidePolicyForMIMEType
+ };
+ WKPageSetPagePolicyClient(_webView.pageRef, &policyClient);
+
+ WKPageUIClient uiClient = {
+ 0, /* version */
+ self, /* clientInfo */
+ createNewPage,
+ showPage,
+ closePage,
+ runJavaScriptAlert,
+ runJavaScriptConfirm,
+ runJavaScriptPrompt,
+ setStatusText,
+ mouseDidMoveOverElement,
+ 0, /* didNotHandleKeyEvent */
+ 0, /* toolbarsAreVisible */
+ 0, /* setToolbarsAreVisible */
+ 0, /* menuBarIsVisible */
+ 0, /* setMenuBarIsVisible */
+ 0, /* statusBarIsVisible */
+ 0, /* setStatusBarIsVisible */
+ 0, /* isResizable */
+ 0, /* setIsResizable */
+ getWindowFrame,
+ setWindowFrame,
+ runBeforeUnloadConfirmPanel,
+ 0, /* didDraw */
+ 0 /* pageDidScroll */
+ };
+ WKPageSetPageUIClient(_webView.pageRef, &uiClient);
+}
+
+- (void)didStartProgress
+{
+ [progressIndicator setDoubleValue:0.0];
+ [progressIndicator setHidden:NO];
+}
+
+- (void)didChangeProgress:(double)value
+{
+ [progressIndicator setDoubleValue:value];
+}
+
+- (void)didFinishProgress
+{
+ [progressIndicator setHidden:YES];
+ [progressIndicator setDoubleValue:1.0];
+}
+
+- (void)updateProvisionalURLForFrame:(WKFrameRef)frame
+{
+ static WKURLRef emptyURL = 0;
+ if (!emptyURL)
+ emptyURL = WKURLCreateWithUTF8CString("");
+
+ WKURLRef url = WKFrameCopyProvisionalURL(frame);
+ if (WKURLIsEqual(url, emptyURL)) {
+ WKRelease(url);
+ return;
+ }
+
+ CFURLRef cfSourceURL = WKURLCopyCFURL(0, url);
+ WKRelease(url);
+
+ [urlText setStringValue:(NSString*)CFURLGetString(cfSourceURL)];
+ CFRelease(cfSourceURL);
+}
+
+- (void)didStartProvisionalLoadForFrame:(WKFrameRef)frame
+{
+ if (!WKFrameIsMainFrame(frame))
+ return;
+
+ [self updateProvisionalURLForFrame:frame];
+}
+
+- (void)didReceiveServerRedirectForProvisionalLoadForFrame:(WKFrameRef)frame
+{
+ if (!WKFrameIsMainFrame(frame))
+ return;
+
+ [self updateProvisionalURLForFrame:frame];
+}
+
+- (void)didFailProvisionalLoadWithErrorForFrame:(WKFrameRef)frame
+{
+ if (!WKFrameIsMainFrame(frame))
+ return;
+
+ [self updateProvisionalURLForFrame:frame];
+}
+
+- (void)didFailLoadWithErrorForFrame:(WKFrameRef)frame
+{
+ if (!WKFrameIsMainFrame(frame))
+ return;
+
+ [self updateProvisionalURLForFrame:frame];
+}
+
+- (void)didCommitLoadForFrame:(WKFrameRef)frame
+{
+}
+
+- (void)loadURLString:(NSString *)urlString
+{
+ // FIXME: We shouldn't have to set the url text here.
+ [urlText setStringValue:urlString];
+ [self fetch:nil];
+}
+
+- (IBAction)performFindPanelAction:(id)sender
+{
+ [findPanelWindow makeKeyAndOrderFront:sender];
+}
+
+- (IBAction)find:(id)sender
+{
+ WKStringRef string = WKStringCreateWithCFString((CFStringRef)[sender stringValue]);
+
+ WKPageFindString(_webView.pageRef, string, kWKFindDirectionForward,
+ kWKFindOptionsCaseInsensitive | kWKFindOptionsWrapAround | kWKFindOptionsShowFindIndicator | kWKFindOptionsShowOverlay, 100);
+}
+
+@end
diff --git a/WebKitTools/MiniBrowser/mac/Info.plist b/WebKitTools/MiniBrowser/mac/Info.plist
new file mode 100644
index 0000000..7564a7e
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/Info.plist
@@ -0,0 +1,32 @@
+<?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>CFBundleIconFile</key>
+ <string>MiniBrowser</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>${PRODUCT_NAME}</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>${MACOSX_DEPLOYMENT_TARGET}</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>NSMainNibFile</key>
+ <string>MainMenu</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/WebKitTools/MiniBrowser/mac/MainMenu.xib b/WebKitTools/MiniBrowser/mac/MainMenu.xib
new file mode 100644
index 0000000..634f615
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/MainMenu.xib
@@ -0,0 +1,3623 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
+ <data>
+ <int key="IBDocument.SystemTarget">1060</int>
+ <string key="IBDocument.SystemVersion">10F569</string>
+ <string key="IBDocument.InterfaceBuilderVersion">788</string>
+ <string key="IBDocument.AppKitVersion">1038.29</string>
+ <string key="IBDocument.HIToolboxVersion">461.00</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string key="NS.object.0">788</string>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="535"/>
+ </object>
+ <object class="NSArray" key="IBDocument.PluginDependencies">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ </object>
+ <object class="NSMutableDictionary" key="IBDocument.Metadata">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys" id="0">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="IBDocument.RootObjects" id="1048">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSCustomObject" id="1021">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSCustomObject" id="1014">
+ <string key="NSClassName">FirstResponder</string>
+ </object>
+ <object class="NSCustomObject" id="1050">
+ <string key="NSClassName">NSApplication</string>
+ </object>
+ <object class="NSMenu" id="649796088">
+ <string key="NSTitle">AMainMenu</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="694149608">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">MiniBrowser</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <object class="NSCustomResource" key="NSOnImage" id="35465992">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuCheckmark</string>
+ </object>
+ <object class="NSCustomResource" key="NSMixedImage" id="502551668">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSMenuMixedState</string>
+ </object>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="110575045">
+ <string key="NSTitle">MiniBrowser</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="238522557">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">About MiniBrowser</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="304266470">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="609285721">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Preferences…</string>
+ <string key="NSKeyEquiv">,</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="481834944">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1046388886">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Services</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="752062318">
+ <string key="NSTitle">Services</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <string key="NSName">_NSServicesMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="646227648">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="755159360">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Hide MiniBrowser</string>
+ <string key="NSKeyEquiv">h</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="342932134">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Hide Others</string>
+ <string key="NSKeyEquiv">h</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="908899353">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Show All</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1056857174">
+ <reference key="NSMenu" ref="110575045"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="632727374">
+ <reference key="NSMenu" ref="110575045"/>
+ <string key="NSTitle">Quit MiniBrowser</string>
+ <string key="NSKeyEquiv">q</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ <string key="NSName">_NSAppleMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="379814623">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">File</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="720053764">
+ <string key="NSTitle">File</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="705341025">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">New Window</string>
+ <string key="NSKeyEquiv">n</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="722745758">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Open…</string>
+ <string key="NSKeyEquiv">o</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1025936716">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Open Recent</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="1065607017">
+ <string key="NSTitle">Open Recent</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="759406840">
+ <reference key="NSMenu" ref="1065607017"/>
+ <string key="NSTitle">Clear Menu</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ <string key="NSName">_NSRecentDocumentsMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="425164168">
+ <reference key="NSMenu" ref="720053764"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="776162233">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Close</string>
+ <string key="NSKeyEquiv">w</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1023925487">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Save</string>
+ <string key="NSKeyEquiv">s</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="117038363">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Save As…</string>
+ <string key="NSKeyEquiv">S</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="579971712">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Revert to Saved</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1010469920">
+ <reference key="NSMenu" ref="720053764"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="294629803">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Page Setup...</string>
+ <string key="NSKeyEquiv">P</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSToolTip"/>
+ </object>
+ <object class="NSMenuItem" id="49223823">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Print…</string>
+ <string key="NSKeyEquiv">p</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="952259628">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">Edit</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="789758025">
+ <string key="NSTitle">Edit</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="1058277027">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Undo</string>
+ <string key="NSKeyEquiv">z</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="790794224">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Redo</string>
+ <string key="NSKeyEquiv">Z</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1040322652">
+ <reference key="NSMenu" ref="789758025"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="296257095">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Cut</string>
+ <string key="NSKeyEquiv">x</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="860595796">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Copy</string>
+ <string key="NSKeyEquiv">c</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="29853731">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Paste</string>
+ <string key="NSKeyEquiv">v</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="82994268">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Paste and Match Style</string>
+ <string key="NSKeyEquiv">V</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="437104165">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Delete</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="583158037">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Select All</string>
+ <string key="NSKeyEquiv">a</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="212016141">
+ <reference key="NSMenu" ref="789758025"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="892235320">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Find</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="963351320">
+ <string key="NSTitle">Find</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="447796847">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Find…</string>
+ <string key="NSKeyEquiv">f</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">1</int>
+ </object>
+ <object class="NSMenuItem" id="326711663">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Find Next</string>
+ <string key="NSKeyEquiv">g</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">2</int>
+ </object>
+ <object class="NSMenuItem" id="270902937">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Find Previous</string>
+ <string key="NSKeyEquiv">G</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">3</int>
+ </object>
+ <object class="NSMenuItem" id="159080638">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Use Selection for Find</string>
+ <string key="NSKeyEquiv">e</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">7</int>
+ </object>
+ <object class="NSMenuItem" id="88285865">
+ <reference key="NSMenu" ref="963351320"/>
+ <string key="NSTitle">Jump to Selection</string>
+ <string key="NSKeyEquiv">j</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="972420730">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Spelling and Grammar</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="769623530">
+ <string key="NSTitle">Spelling and Grammar</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="679648819">
+ <reference key="NSMenu" ref="769623530"/>
+ <string key="NSTitle">Show Spelling and Grammar</string>
+ <string key="NSKeyEquiv">:</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="96193923">
+ <reference key="NSMenu" ref="769623530"/>
+ <string key="NSTitle">Check Document Now</string>
+ <string key="NSKeyEquiv">;</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="859480356">
+ <reference key="NSMenu" ref="769623530"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="948374510">
+ <reference key="NSMenu" ref="769623530"/>
+ <string key="NSTitle">Check Spelling While Typing</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="967646866">
+ <reference key="NSMenu" ref="769623530"/>
+ <string key="NSTitle">Check Grammar With Spelling</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="795346622">
+ <reference key="NSMenu" ref="769623530"/>
+ <string key="NSTitle">Correct Spelling Automatically</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="507821607">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Substitutions</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="698887838">
+ <string key="NSTitle">Substitutions</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="65139061">
+ <reference key="NSMenu" ref="698887838"/>
+ <string key="NSTitle">Show Substitutions</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="19036812">
+ <reference key="NSMenu" ref="698887838"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="605118523">
+ <reference key="NSMenu" ref="698887838"/>
+ <string key="NSTitle">Smart Copy/Paste</string>
+ <string key="NSKeyEquiv">f</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">1</int>
+ </object>
+ <object class="NSMenuItem" id="197661976">
+ <reference key="NSMenu" ref="698887838"/>
+ <string key="NSTitle">Smart Quotes</string>
+ <string key="NSKeyEquiv">g</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">2</int>
+ </object>
+ <object class="NSMenuItem" id="672708820">
+ <reference key="NSMenu" ref="698887838"/>
+ <string key="NSTitle">Smart Dashes</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="708854459">
+ <reference key="NSMenu" ref="698887838"/>
+ <string key="NSTitle">Smart Links</string>
+ <string key="NSKeyEquiv">G</string>
+ <int key="NSKeyEquivModMask">1179648</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <int key="NSTag">3</int>
+ </object>
+ <object class="NSMenuItem" id="537092702">
+ <reference key="NSMenu" ref="698887838"/>
+ <string key="NSTitle">Text Replacement</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="288088188">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Transformations</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="579392910">
+ <string key="NSTitle">Transformations</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="1060694897">
+ <reference key="NSMenu" ref="579392910"/>
+ <string key="NSTitle">Make Upper Case</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="879586729">
+ <reference key="NSMenu" ref="579392910"/>
+ <string key="NSTitle">Make Lower Case</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="56570060">
+ <reference key="NSMenu" ref="579392910"/>
+ <string key="NSTitle">Capitalize</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="676164635">
+ <reference key="NSMenu" ref="789758025"/>
+ <string key="NSTitle">Speech</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="785027613">
+ <string key="NSTitle">Speech</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="731782645">
+ <reference key="NSMenu" ref="785027613"/>
+ <string key="NSTitle">Start Speaking</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="680220178">
+ <reference key="NSMenu" ref="785027613"/>
+ <string key="NSTitle">Stop Speaking</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="586577488">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">View</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="466310130">
+ <string key="NSTitle">View</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="102151532">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Show Toolbar</string>
+ <string key="NSKeyEquiv">t</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="237841660">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Customize Toolbar…</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1025359947">
+ <reference key="NSMenu" ref="466310130"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="694544109">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Zoom In</string>
+ <string key="NSKeyEquiv">+</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="943694335">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Zoom Out</string>
+ <string key="NSKeyEquiv">-</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="863984465">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Reset Zoom</string>
+ <string key="NSKeyEquiv">0</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="138443116">
+ <reference key="NSMenu" ref="466310130"/>
+ <string key="NSTitle">Zoom Text Only</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="713487014">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">Window</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="835318025">
+ <string key="NSTitle">Window</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="1011231497">
+ <reference key="NSMenu" ref="835318025"/>
+ <string key="NSTitle">Minimize</string>
+ <string key="NSKeyEquiv">m</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="575023229">
+ <reference key="NSMenu" ref="835318025"/>
+ <string key="NSTitle">Zoom</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="299356726">
+ <reference key="NSMenu" ref="835318025"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="625202149">
+ <reference key="NSMenu" ref="835318025"/>
+ <string key="NSTitle">Bring All to Front</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ <string key="NSName">_NSWindowsMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="448692316">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">Help</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="992780483">
+ <string key="NSTitle">Help</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="105068016">
+ <reference key="NSMenu" ref="992780483"/>
+ <string key="NSTitle">MiniBrowser Help</string>
+ <string key="NSKeyEquiv">?</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ <string key="NSName">_NSHelpMenu</string>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="816668511">
+ <reference key="NSMenu" ref="649796088"/>
+ <string key="NSTitle">Debug</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="865232259">
+ <string key="NSTitle">Debug</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="878165919">
+ <reference key="NSMenu" ref="865232259"/>
+ <string key="NSTitle">Force Repaint</string>
+ <string key="NSKeyEquiv">r</string>
+ <int key="NSKeyEquivModMask">1572864</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="137933275">
+ <reference key="NSMenu" ref="865232259"/>
+ <string key="NSTitle">Hide Web View</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="1027125810">
+ <reference key="NSMenu" ref="865232259"/>
+ <string key="NSTitle">Remove Web View</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="864702084">
+ <reference key="NSMenu" ref="865232259"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="208343368">
+ <reference key="NSMenu" ref="865232259"/>
+ <string key="NSTitle">Show Statistics Window</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="162978490">
+ <reference key="NSMenu" ref="865232259"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="340689355">
+ <reference key="NSMenu" ref="865232259"/>
+ <string key="NSTitle">Process Model</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ <string key="NSAction">submenuAction:</string>
+ <object class="NSMenu" key="NSSubmenu" id="935112943">
+ <string key="NSTitle">Process Model</string>
+ <object class="NSMutableArray" key="NSMenuItems">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSMenuItem" id="993856752">
+ <reference key="NSMenu" ref="935112943"/>
+ <string key="NSTitle">Shared Process</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="516840223">
+ <reference key="NSMenu" ref="935112943"/>
+ <string key="NSTitle">Shared Thread</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ <object class="NSMenuItem" id="377902755">
+ <reference key="NSMenu" ref="865232259"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ <object class="NSMenuItem" id="191469404">
+ <reference key="NSMenu" ref="865232259"/>
+ <string key="NSTitle">Dump Source To Console</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="35465992"/>
+ <reference key="NSMixedImage" ref="502551668"/>
+ </object>
+ </object>
+ </object>
+ </object>
+ </object>
+ <string key="NSName">_NSMainMenu</string>
+ </object>
+ <object class="NSCustomObject" id="976324537">
+ <string key="NSClassName">BrowserAppDelegate</string>
+ </object>
+ <object class="NSCustomObject" id="755631768">
+ <string key="NSClassName">NSFontManager</string>
+ </object>
+ </object>
+ <object class="IBObjectContainer" key="IBDocument.Objects">
+ <object class="NSMutableArray" key="connectionRecords">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performMiniaturize:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1011231497"/>
+ </object>
+ <int key="connectionID">37</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">arrangeInFront:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="625202149"/>
+ </object>
+ <int key="connectionID">39</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">print:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="49223823"/>
+ </object>
+ <int key="connectionID">86</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">runPageLayout:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="294629803"/>
+ </object>
+ <int key="connectionID">87</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">clearRecentDocuments:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="759406840"/>
+ </object>
+ <int key="connectionID">127</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">orderFrontStandardAboutPanel:</string>
+ <reference key="source" ref="1021"/>
+ <reference key="destination" ref="238522557"/>
+ </object>
+ <int key="connectionID">142</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performClose:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="776162233"/>
+ </object>
+ <int key="connectionID">193</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleContinuousSpellChecking:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="948374510"/>
+ </object>
+ <int key="connectionID">222</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">undo:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1058277027"/>
+ </object>
+ <int key="connectionID">223</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">copy:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="860595796"/>
+ </object>
+ <int key="connectionID">224</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">checkSpelling:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="96193923"/>
+ </object>
+ <int key="connectionID">225</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">paste:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="29853731"/>
+ </object>
+ <int key="connectionID">226</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">stopSpeaking:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="680220178"/>
+ </object>
+ <int key="connectionID">227</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">cut:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="296257095"/>
+ </object>
+ <int key="connectionID">228</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showGuessPanel:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="679648819"/>
+ </object>
+ <int key="connectionID">230</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">redo:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="790794224"/>
+ </object>
+ <int key="connectionID">231</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">selectAll:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="583158037"/>
+ </object>
+ <int key="connectionID">232</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">startSpeaking:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="731782645"/>
+ </object>
+ <int key="connectionID">233</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">delete:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="437104165"/>
+ </object>
+ <int key="connectionID">235</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performZoom:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="575023229"/>
+ </object>
+ <int key="connectionID">240</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performFindPanelAction:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="447796847"/>
+ </object>
+ <int key="connectionID">241</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">centerSelectionInVisibleArea:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="88285865"/>
+ </object>
+ <int key="connectionID">245</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleGrammarChecking:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="967646866"/>
+ </object>
+ <int key="connectionID">347</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleSmartInsertDelete:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="605118523"/>
+ </object>
+ <int key="connectionID">355</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleAutomaticQuoteSubstitution:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="197661976"/>
+ </object>
+ <int key="connectionID">356</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleAutomaticLinkDetection:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="708854459"/>
+ </object>
+ <int key="connectionID">357</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">saveDocument:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1023925487"/>
+ </object>
+ <int key="connectionID">362</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">saveDocumentAs:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="117038363"/>
+ </object>
+ <int key="connectionID">363</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">revertDocumentToSaved:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="579971712"/>
+ </object>
+ <int key="connectionID">364</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">runToolbarCustomizationPalette:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="237841660"/>
+ </object>
+ <int key="connectionID">365</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleToolbarShown:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="102151532"/>
+ </object>
+ <int key="connectionID">366</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hide:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="755159360"/>
+ </object>
+ <int key="connectionID">367</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">hideOtherApplications:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="342932134"/>
+ </object>
+ <int key="connectionID">368</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">unhideAllApplications:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="908899353"/>
+ </object>
+ <int key="connectionID">370</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">openDocument:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="722745758"/>
+ </object>
+ <int key="connectionID">374</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">terminate:</string>
+ <reference key="source" ref="1050"/>
+ <reference key="destination" ref="632727374"/>
+ </object>
+ <int key="connectionID">449</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleAutomaticSpellingCorrection:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="795346622"/>
+ </object>
+ <int key="connectionID">456</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">orderFrontSubstitutionsPanel:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="65139061"/>
+ </object>
+ <int key="connectionID">458</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleAutomaticDashSubstitution:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="672708820"/>
+ </object>
+ <int key="connectionID">461</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleAutomaticTextReplacement:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="537092702"/>
+ </object>
+ <int key="connectionID">463</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">uppercaseWord:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1060694897"/>
+ </object>
+ <int key="connectionID">464</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">capitalizeWord:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="56570060"/>
+ </object>
+ <int key="connectionID">467</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">lowercaseWord:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="879586729"/>
+ </object>
+ <int key="connectionID">468</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">pasteAsPlainText:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="82994268"/>
+ </object>
+ <int key="connectionID">486</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performFindPanelAction:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="326711663"/>
+ </object>
+ <int key="connectionID">487</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performFindPanelAction:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="270902937"/>
+ </object>
+ <int key="connectionID">488</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">performFindPanelAction:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="159080638"/>
+ </object>
+ <int key="connectionID">489</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showHelp:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="105068016"/>
+ </object>
+ <int key="connectionID">493</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">delegate</string>
+ <reference key="source" ref="1021"/>
+ <reference key="destination" ref="976324537"/>
+ </object>
+ <int key="connectionID">495</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">newWindow:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="705341025"/>
+ </object>
+ <int key="connectionID">533</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">setSharedProcessProcessModel:</string>
+ <reference key="source" ref="976324537"/>
+ <reference key="destination" ref="993856752"/>
+ </object>
+ <int key="connectionID">543</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">setSharedThreadProcessModel:</string>
+ <reference key="source" ref="976324537"/>
+ <reference key="destination" ref="516840223"/>
+ </object>
+ <int key="connectionID">544</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">forceRepaint:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="878165919"/>
+ </object>
+ <int key="connectionID">547</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showHideWebView:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="137933275"/>
+ </object>
+ <int key="connectionID">549</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">removeReinsertWebView:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="1027125810"/>
+ </object>
+ <int key="connectionID">551</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">showStatisticsWindow:</string>
+ <reference key="source" ref="976324537"/>
+ <reference key="destination" ref="208343368"/>
+ </object>
+ <int key="connectionID">554</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">zoomIn:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="694544109"/>
+ </object>
+ <int key="connectionID">559</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">zoomOut:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="943694335"/>
+ </object>
+ <int key="connectionID">560</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">resetZoom:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="863984465"/>
+ </object>
+ <int key="connectionID">561</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">toggleZoomMode:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="138443116"/>
+ </object>
+ <int key="connectionID">564</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">dumpSourceToConsole:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="191469404"/>
+ </object>
+ <int key="connectionID">567</int>
+ </object>
+ </object>
+ <object class="IBMutableOrderedSet" key="objectRecords">
+ <object class="NSArray" key="orderedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBObjectRecord">
+ <int key="objectID">0</int>
+ <reference key="object" ref="0"/>
+ <reference key="children" ref="1048"/>
+ <nil key="parent"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-2</int>
+ <reference key="object" ref="1021"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">File's Owner</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-1</int>
+ <reference key="object" ref="1014"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">First Responder</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">-3</int>
+ <reference key="object" ref="1050"/>
+ <reference key="parent" ref="0"/>
+ <string key="objectName">Application</string>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">29</int>
+ <reference key="object" ref="649796088"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="713487014"/>
+ <reference ref="694149608"/>
+ <reference ref="952259628"/>
+ <reference ref="379814623"/>
+ <reference ref="586577488"/>
+ <reference ref="448692316"/>
+ <reference ref="816668511"/>
+ </object>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">19</int>
+ <reference key="object" ref="713487014"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="835318025"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">56</int>
+ <reference key="object" ref="694149608"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="110575045"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">217</int>
+ <reference key="object" ref="952259628"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="789758025"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">83</int>
+ <reference key="object" ref="379814623"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="720053764"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">81</int>
+ <reference key="object" ref="720053764"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1023925487"/>
+ <reference ref="117038363"/>
+ <reference ref="49223823"/>
+ <reference ref="722745758"/>
+ <reference ref="705341025"/>
+ <reference ref="1025936716"/>
+ <reference ref="294629803"/>
+ <reference ref="776162233"/>
+ <reference ref="425164168"/>
+ <reference ref="579971712"/>
+ <reference ref="1010469920"/>
+ </object>
+ <reference key="parent" ref="379814623"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">75</int>
+ <reference key="object" ref="1023925487"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">80</int>
+ <reference key="object" ref="117038363"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">78</int>
+ <reference key="object" ref="49223823"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">72</int>
+ <reference key="object" ref="722745758"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">82</int>
+ <reference key="object" ref="705341025"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">124</int>
+ <reference key="object" ref="1025936716"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1065607017"/>
+ </object>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">77</int>
+ <reference key="object" ref="294629803"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">73</int>
+ <reference key="object" ref="776162233"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">79</int>
+ <reference key="object" ref="425164168"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">112</int>
+ <reference key="object" ref="579971712"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">74</int>
+ <reference key="object" ref="1010469920"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">125</int>
+ <reference key="object" ref="1065607017"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="759406840"/>
+ </object>
+ <reference key="parent" ref="1025936716"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">126</int>
+ <reference key="object" ref="759406840"/>
+ <reference key="parent" ref="1065607017"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">205</int>
+ <reference key="object" ref="789758025"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="437104165"/>
+ <reference ref="583158037"/>
+ <reference ref="1058277027"/>
+ <reference ref="212016141"/>
+ <reference ref="296257095"/>
+ <reference ref="29853731"/>
+ <reference ref="860595796"/>
+ <reference ref="1040322652"/>
+ <reference ref="790794224"/>
+ <reference ref="892235320"/>
+ <reference ref="972420730"/>
+ <reference ref="676164635"/>
+ <reference ref="507821607"/>
+ <reference ref="288088188"/>
+ <reference ref="82994268"/>
+ </object>
+ <reference key="parent" ref="952259628"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">202</int>
+ <reference key="object" ref="437104165"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">198</int>
+ <reference key="object" ref="583158037"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">207</int>
+ <reference key="object" ref="1058277027"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">214</int>
+ <reference key="object" ref="212016141"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">199</int>
+ <reference key="object" ref="296257095"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">203</int>
+ <reference key="object" ref="29853731"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">197</int>
+ <reference key="object" ref="860595796"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">206</int>
+ <reference key="object" ref="1040322652"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">215</int>
+ <reference key="object" ref="790794224"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">218</int>
+ <reference key="object" ref="892235320"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="963351320"/>
+ </object>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">216</int>
+ <reference key="object" ref="972420730"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="769623530"/>
+ </object>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">200</int>
+ <reference key="object" ref="769623530"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="948374510"/>
+ <reference ref="96193923"/>
+ <reference ref="679648819"/>
+ <reference ref="967646866"/>
+ <reference ref="859480356"/>
+ <reference ref="795346622"/>
+ </object>
+ <reference key="parent" ref="972420730"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">219</int>
+ <reference key="object" ref="948374510"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">201</int>
+ <reference key="object" ref="96193923"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">204</int>
+ <reference key="object" ref="679648819"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">220</int>
+ <reference key="object" ref="963351320"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="270902937"/>
+ <reference ref="88285865"/>
+ <reference ref="159080638"/>
+ <reference ref="326711663"/>
+ <reference ref="447796847"/>
+ </object>
+ <reference key="parent" ref="892235320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">213</int>
+ <reference key="object" ref="270902937"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">210</int>
+ <reference key="object" ref="88285865"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">221</int>
+ <reference key="object" ref="159080638"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">208</int>
+ <reference key="object" ref="326711663"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">209</int>
+ <reference key="object" ref="447796847"/>
+ <reference key="parent" ref="963351320"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">57</int>
+ <reference key="object" ref="110575045"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="238522557"/>
+ <reference ref="755159360"/>
+ <reference ref="908899353"/>
+ <reference ref="632727374"/>
+ <reference ref="646227648"/>
+ <reference ref="609285721"/>
+ <reference ref="481834944"/>
+ <reference ref="304266470"/>
+ <reference ref="1046388886"/>
+ <reference ref="1056857174"/>
+ <reference ref="342932134"/>
+ </object>
+ <reference key="parent" ref="694149608"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">58</int>
+ <reference key="object" ref="238522557"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">134</int>
+ <reference key="object" ref="755159360"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">150</int>
+ <reference key="object" ref="908899353"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">136</int>
+ <reference key="object" ref="632727374"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">144</int>
+ <reference key="object" ref="646227648"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">129</int>
+ <reference key="object" ref="609285721"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">143</int>
+ <reference key="object" ref="481834944"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">236</int>
+ <reference key="object" ref="304266470"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">131</int>
+ <reference key="object" ref="1046388886"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="752062318"/>
+ </object>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">149</int>
+ <reference key="object" ref="1056857174"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">145</int>
+ <reference key="object" ref="342932134"/>
+ <reference key="parent" ref="110575045"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">130</int>
+ <reference key="object" ref="752062318"/>
+ <reference key="parent" ref="1046388886"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">24</int>
+ <reference key="object" ref="835318025"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="299356726"/>
+ <reference ref="625202149"/>
+ <reference ref="575023229"/>
+ <reference ref="1011231497"/>
+ </object>
+ <reference key="parent" ref="713487014"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">92</int>
+ <reference key="object" ref="299356726"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">5</int>
+ <reference key="object" ref="625202149"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">239</int>
+ <reference key="object" ref="575023229"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">23</int>
+ <reference key="object" ref="1011231497"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">295</int>
+ <reference key="object" ref="586577488"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="466310130"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">296</int>
+ <reference key="object" ref="466310130"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="102151532"/>
+ <reference ref="237841660"/>
+ <reference ref="694544109"/>
+ <reference ref="1025359947"/>
+ <reference ref="943694335"/>
+ <reference ref="863984465"/>
+ <reference ref="138443116"/>
+ </object>
+ <reference key="parent" ref="586577488"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">297</int>
+ <reference key="object" ref="102151532"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">298</int>
+ <reference key="object" ref="237841660"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">211</int>
+ <reference key="object" ref="676164635"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="785027613"/>
+ </object>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">212</int>
+ <reference key="object" ref="785027613"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="680220178"/>
+ <reference ref="731782645"/>
+ </object>
+ <reference key="parent" ref="676164635"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">195</int>
+ <reference key="object" ref="680220178"/>
+ <reference key="parent" ref="785027613"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">196</int>
+ <reference key="object" ref="731782645"/>
+ <reference key="parent" ref="785027613"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">346</int>
+ <reference key="object" ref="967646866"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">348</int>
+ <reference key="object" ref="507821607"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="698887838"/>
+ </object>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">349</int>
+ <reference key="object" ref="698887838"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="605118523"/>
+ <reference ref="197661976"/>
+ <reference ref="708854459"/>
+ <reference ref="65139061"/>
+ <reference ref="19036812"/>
+ <reference ref="672708820"/>
+ <reference ref="537092702"/>
+ </object>
+ <reference key="parent" ref="507821607"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">350</int>
+ <reference key="object" ref="605118523"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">351</int>
+ <reference key="object" ref="197661976"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">354</int>
+ <reference key="object" ref="708854459"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">420</int>
+ <reference key="object" ref="755631768"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">450</int>
+ <reference key="object" ref="288088188"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="579392910"/>
+ </object>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">451</int>
+ <reference key="object" ref="579392910"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="1060694897"/>
+ <reference ref="879586729"/>
+ <reference ref="56570060"/>
+ </object>
+ <reference key="parent" ref="288088188"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">452</int>
+ <reference key="object" ref="1060694897"/>
+ <reference key="parent" ref="579392910"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">453</int>
+ <reference key="object" ref="859480356"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">454</int>
+ <reference key="object" ref="795346622"/>
+ <reference key="parent" ref="769623530"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">457</int>
+ <reference key="object" ref="65139061"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">459</int>
+ <reference key="object" ref="19036812"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">460</int>
+ <reference key="object" ref="672708820"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">462</int>
+ <reference key="object" ref="537092702"/>
+ <reference key="parent" ref="698887838"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">465</int>
+ <reference key="object" ref="879586729"/>
+ <reference key="parent" ref="579392910"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">466</int>
+ <reference key="object" ref="56570060"/>
+ <reference key="parent" ref="579392910"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">485</int>
+ <reference key="object" ref="82994268"/>
+ <reference key="parent" ref="789758025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">490</int>
+ <reference key="object" ref="448692316"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="992780483"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">491</int>
+ <reference key="object" ref="992780483"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="105068016"/>
+ </object>
+ <reference key="parent" ref="448692316"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">492</int>
+ <reference key="object" ref="105068016"/>
+ <reference key="parent" ref="992780483"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">494</int>
+ <reference key="object" ref="976324537"/>
+ <reference key="parent" ref="0"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">534</int>
+ <reference key="object" ref="816668511"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="865232259"/>
+ </object>
+ <reference key="parent" ref="649796088"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">535</int>
+ <reference key="object" ref="865232259"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="340689355"/>
+ <reference ref="878165919"/>
+ <reference ref="162978490"/>
+ <reference ref="137933275"/>
+ <reference ref="1027125810"/>
+ <reference ref="864702084"/>
+ <reference ref="208343368"/>
+ <reference ref="377902755"/>
+ <reference ref="191469404"/>
+ </object>
+ <reference key="parent" ref="816668511"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">537</int>
+ <reference key="object" ref="340689355"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="935112943"/>
+ </object>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">538</int>
+ <reference key="object" ref="935112943"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="993856752"/>
+ <reference ref="516840223"/>
+ </object>
+ <reference key="parent" ref="340689355"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">539</int>
+ <reference key="object" ref="993856752"/>
+ <reference key="parent" ref="935112943"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">540</int>
+ <reference key="object" ref="516840223"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ <reference key="parent" ref="935112943"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">545</int>
+ <reference key="object" ref="878165919"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">546</int>
+ <reference key="object" ref="162978490"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">548</int>
+ <reference key="object" ref="137933275"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">550</int>
+ <reference key="object" ref="1027125810"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">552</int>
+ <reference key="object" ref="208343368"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">553</int>
+ <reference key="object" ref="864702084"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">555</int>
+ <reference key="object" ref="694544109"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">556</int>
+ <reference key="object" ref="1025359947"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">557</int>
+ <reference key="object" ref="943694335"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">558</int>
+ <reference key="object" ref="863984465"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">562</int>
+ <reference key="object" ref="138443116"/>
+ <reference key="parent" ref="466310130"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">565</int>
+ <reference key="object" ref="377902755"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">566</int>
+ <reference key="object" ref="191469404"/>
+ <reference key="parent" ref="865232259"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="flattenedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>-3.IBPluginDependency</string>
+ <string>112.IBPluginDependency</string>
+ <string>112.ImportedFromIB2</string>
+ <string>124.IBPluginDependency</string>
+ <string>124.ImportedFromIB2</string>
+ <string>125.IBPluginDependency</string>
+ <string>125.ImportedFromIB2</string>
+ <string>125.editorWindowContentRectSynchronizationRect</string>
+ <string>126.IBPluginDependency</string>
+ <string>126.ImportedFromIB2</string>
+ <string>129.IBPluginDependency</string>
+ <string>129.ImportedFromIB2</string>
+ <string>130.IBPluginDependency</string>
+ <string>130.ImportedFromIB2</string>
+ <string>130.editorWindowContentRectSynchronizationRect</string>
+ <string>131.IBPluginDependency</string>
+ <string>131.ImportedFromIB2</string>
+ <string>134.IBPluginDependency</string>
+ <string>134.ImportedFromIB2</string>
+ <string>136.IBPluginDependency</string>
+ <string>136.ImportedFromIB2</string>
+ <string>143.IBPluginDependency</string>
+ <string>143.ImportedFromIB2</string>
+ <string>144.IBPluginDependency</string>
+ <string>144.ImportedFromIB2</string>
+ <string>145.IBPluginDependency</string>
+ <string>145.ImportedFromIB2</string>
+ <string>149.IBPluginDependency</string>
+ <string>149.ImportedFromIB2</string>
+ <string>150.IBPluginDependency</string>
+ <string>150.ImportedFromIB2</string>
+ <string>19.IBPluginDependency</string>
+ <string>19.ImportedFromIB2</string>
+ <string>195.IBPluginDependency</string>
+ <string>195.ImportedFromIB2</string>
+ <string>196.IBPluginDependency</string>
+ <string>196.ImportedFromIB2</string>
+ <string>197.IBPluginDependency</string>
+ <string>197.ImportedFromIB2</string>
+ <string>198.IBPluginDependency</string>
+ <string>198.ImportedFromIB2</string>
+ <string>199.IBPluginDependency</string>
+ <string>199.ImportedFromIB2</string>
+ <string>200.IBEditorWindowLastContentRect</string>
+ <string>200.IBPluginDependency</string>
+ <string>200.ImportedFromIB2</string>
+ <string>200.editorWindowContentRectSynchronizationRect</string>
+ <string>201.IBPluginDependency</string>
+ <string>201.ImportedFromIB2</string>
+ <string>202.IBPluginDependency</string>
+ <string>202.ImportedFromIB2</string>
+ <string>203.IBPluginDependency</string>
+ <string>203.ImportedFromIB2</string>
+ <string>204.IBPluginDependency</string>
+ <string>204.ImportedFromIB2</string>
+ <string>205.IBEditorWindowLastContentRect</string>
+ <string>205.IBPluginDependency</string>
+ <string>205.ImportedFromIB2</string>
+ <string>205.editorWindowContentRectSynchronizationRect</string>
+ <string>206.IBPluginDependency</string>
+ <string>206.ImportedFromIB2</string>
+ <string>207.IBPluginDependency</string>
+ <string>207.ImportedFromIB2</string>
+ <string>208.IBPluginDependency</string>
+ <string>208.ImportedFromIB2</string>
+ <string>209.IBPluginDependency</string>
+ <string>209.ImportedFromIB2</string>
+ <string>210.IBPluginDependency</string>
+ <string>210.ImportedFromIB2</string>
+ <string>211.IBPluginDependency</string>
+ <string>211.ImportedFromIB2</string>
+ <string>212.IBPluginDependency</string>
+ <string>212.ImportedFromIB2</string>
+ <string>212.editorWindowContentRectSynchronizationRect</string>
+ <string>213.IBPluginDependency</string>
+ <string>213.ImportedFromIB2</string>
+ <string>214.IBPluginDependency</string>
+ <string>214.ImportedFromIB2</string>
+ <string>215.IBPluginDependency</string>
+ <string>215.ImportedFromIB2</string>
+ <string>216.IBPluginDependency</string>
+ <string>216.ImportedFromIB2</string>
+ <string>217.IBPluginDependency</string>
+ <string>217.ImportedFromIB2</string>
+ <string>218.IBPluginDependency</string>
+ <string>218.ImportedFromIB2</string>
+ <string>219.IBPluginDependency</string>
+ <string>219.ImportedFromIB2</string>
+ <string>220.IBEditorWindowLastContentRect</string>
+ <string>220.IBPluginDependency</string>
+ <string>220.ImportedFromIB2</string>
+ <string>220.editorWindowContentRectSynchronizationRect</string>
+ <string>221.IBPluginDependency</string>
+ <string>221.ImportedFromIB2</string>
+ <string>23.IBPluginDependency</string>
+ <string>23.ImportedFromIB2</string>
+ <string>236.IBPluginDependency</string>
+ <string>236.ImportedFromIB2</string>
+ <string>239.IBPluginDependency</string>
+ <string>239.ImportedFromIB2</string>
+ <string>24.IBEditorWindowLastContentRect</string>
+ <string>24.IBPluginDependency</string>
+ <string>24.ImportedFromIB2</string>
+ <string>24.editorWindowContentRectSynchronizationRect</string>
+ <string>29.IBEditorWindowLastContentRect</string>
+ <string>29.IBPluginDependency</string>
+ <string>29.ImportedFromIB2</string>
+ <string>29.WindowOrigin</string>
+ <string>29.editorWindowContentRectSynchronizationRect</string>
+ <string>295.IBPluginDependency</string>
+ <string>296.IBEditorWindowLastContentRect</string>
+ <string>296.IBPluginDependency</string>
+ <string>296.editorWindowContentRectSynchronizationRect</string>
+ <string>297.IBPluginDependency</string>
+ <string>298.IBPluginDependency</string>
+ <string>346.IBPluginDependency</string>
+ <string>346.ImportedFromIB2</string>
+ <string>348.IBPluginDependency</string>
+ <string>348.ImportedFromIB2</string>
+ <string>349.IBEditorWindowLastContentRect</string>
+ <string>349.IBPluginDependency</string>
+ <string>349.ImportedFromIB2</string>
+ <string>349.editorWindowContentRectSynchronizationRect</string>
+ <string>350.IBPluginDependency</string>
+ <string>350.ImportedFromIB2</string>
+ <string>351.IBPluginDependency</string>
+ <string>351.ImportedFromIB2</string>
+ <string>354.IBPluginDependency</string>
+ <string>354.ImportedFromIB2</string>
+ <string>450.IBPluginDependency</string>
+ <string>451.IBEditorWindowLastContentRect</string>
+ <string>451.IBPluginDependency</string>
+ <string>452.IBPluginDependency</string>
+ <string>453.IBPluginDependency</string>
+ <string>454.IBPluginDependency</string>
+ <string>457.IBPluginDependency</string>
+ <string>459.IBPluginDependency</string>
+ <string>460.IBPluginDependency</string>
+ <string>462.IBPluginDependency</string>
+ <string>465.IBPluginDependency</string>
+ <string>466.IBPluginDependency</string>
+ <string>485.IBPluginDependency</string>
+ <string>490.IBPluginDependency</string>
+ <string>491.IBEditorWindowLastContentRect</string>
+ <string>491.IBPluginDependency</string>
+ <string>492.IBPluginDependency</string>
+ <string>5.IBPluginDependency</string>
+ <string>5.ImportedFromIB2</string>
+ <string>534.IBPluginDependency</string>
+ <string>535.IBEditorWindowLastContentRect</string>
+ <string>535.IBPluginDependency</string>
+ <string>537.IBPluginDependency</string>
+ <string>538.IBEditorWindowLastContentRect</string>
+ <string>538.IBPluginDependency</string>
+ <string>539.IBPluginDependency</string>
+ <string>540.IBPluginDependency</string>
+ <string>545.IBPluginDependency</string>
+ <string>546.IBPluginDependency</string>
+ <string>548.IBPluginDependency</string>
+ <string>550.IBPluginDependency</string>
+ <string>552.IBPluginDependency</string>
+ <string>553.IBPluginDependency</string>
+ <string>555.IBPluginDependency</string>
+ <string>556.IBPluginDependency</string>
+ <string>557.IBPluginDependency</string>
+ <string>558.IBPluginDependency</string>
+ <string>56.IBPluginDependency</string>
+ <string>56.ImportedFromIB2</string>
+ <string>562.IBPluginDependency</string>
+ <string>565.IBPluginDependency</string>
+ <string>566.IBPluginDependency</string>
+ <string>57.IBEditorWindowLastContentRect</string>
+ <string>57.IBPluginDependency</string>
+ <string>57.ImportedFromIB2</string>
+ <string>57.editorWindowContentRectSynchronizationRect</string>
+ <string>58.IBPluginDependency</string>
+ <string>58.ImportedFromIB2</string>
+ <string>72.IBPluginDependency</string>
+ <string>72.ImportedFromIB2</string>
+ <string>73.IBPluginDependency</string>
+ <string>73.ImportedFromIB2</string>
+ <string>74.IBPluginDependency</string>
+ <string>74.ImportedFromIB2</string>
+ <string>75.IBPluginDependency</string>
+ <string>75.ImportedFromIB2</string>
+ <string>77.IBPluginDependency</string>
+ <string>77.ImportedFromIB2</string>
+ <string>78.IBPluginDependency</string>
+ <string>78.ImportedFromIB2</string>
+ <string>79.IBPluginDependency</string>
+ <string>79.ImportedFromIB2</string>
+ <string>80.IBPluginDependency</string>
+ <string>80.ImportedFromIB2</string>
+ <string>81.IBEditorWindowLastContentRect</string>
+ <string>81.IBPluginDependency</string>
+ <string>81.ImportedFromIB2</string>
+ <string>81.editorWindowContentRectSynchronizationRect</string>
+ <string>82.IBPluginDependency</string>
+ <string>82.ImportedFromIB2</string>
+ <string>83.IBPluginDependency</string>
+ <string>83.ImportedFromIB2</string>
+ <string>92.IBPluginDependency</string>
+ <string>92.ImportedFromIB2</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{522, 812}, {146, 23}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{436, 809}, {64, 6}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{753, 187}, {275, 113}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{608, 612}, {275, 83}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{650, 538}, {254, 283}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{187, 434}, {243, 243}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{608, 612}, {167, 43}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{753, 217}, {238, 103}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{608, 612}, {241, 103}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{744, 748}, {194, 73}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{525, 802}, {197, 73}}</string>
+ <string>{{488, 821}, {451, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{74, 862}</string>
+ <string>{{6, 978}, {478, 20}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{694, 688}, {234, 133}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{475, 832}, {234, 43}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{746, 287}, {220, 133}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{608, 612}, {215, 63}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{753, 197}, {170, 63}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{881, 798}, {189, 23}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{864, 668}, {260, 153}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{1110, 678}, {154, 43}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>{{286, 129}, {275, 183}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{23, 794}, {245, 183}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{608, 618}, {196, 203}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>{{145, 474}, {199, 203}}</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <integer value="1"/>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="unlocalizedProperties">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="activeLocalization"/>
+ <object class="NSMutableDictionary" key="localizations">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference key="dict.sortedKeys" ref="0"/>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ </object>
+ </object>
+ <nil key="sourceID"/>
+ <int key="maxID">567</int>
+ </object>
+ <object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">BrowserAppDelegate</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>setSharedProcessProcessModel:</string>
+ <string>setSharedThreadProcessModel:</string>
+ <string>showStatisticsWindow:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>setSharedProcessProcessModel:</string>
+ <string>setSharedThreadProcessModel:</string>
+ <string>showStatisticsWindow:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">setSharedProcessProcessModel:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">setSharedThreadProcessModel:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">showStatisticsWindow:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">mac/AppDelegate.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">BrowserAppDelegate</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">window</string>
+ <string key="NS.object.0">NSWindow</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">window</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">window</string>
+ <string key="candidateClassName">NSWindow</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">BrowserWindowController</string>
+ <string key="superclassName">NSWindowController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>dumpSourceToConsole:</string>
+ <string>fetch:</string>
+ <string>forceRepaint:</string>
+ <string>goBack:</string>
+ <string>goForward:</string>
+ <string>reload:</string>
+ <string>removeReinsertWebView:</string>
+ <string>resetZoom:</string>
+ <string>showHideWebView:</string>
+ <string>toggleZoomMode:</string>
+ <string>zoomIn:</string>
+ <string>zoomOut:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>dumpSourceToConsole:</string>
+ <string>fetch:</string>
+ <string>forceRepaint:</string>
+ <string>goBack:</string>
+ <string>goForward:</string>
+ <string>reload:</string>
+ <string>removeReinsertWebView:</string>
+ <string>resetZoom:</string>
+ <string>showHideWebView:</string>
+ <string>toggleZoomMode:</string>
+ <string>zoomIn:</string>
+ <string>zoomOut:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">dumpSourceToConsole:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">fetch:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">forceRepaint:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">goBack:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">goForward:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">reload:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">removeReinsertWebView:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">resetZoom:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">showHideWebView:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">toggleZoomMode:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">zoomIn:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">zoomOut:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>backButton</string>
+ <string>containerView</string>
+ <string>forwardButton</string>
+ <string>progressIndicator</string>
+ <string>reloadButton</string>
+ <string>toolbar</string>
+ <string>urlText</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSButton</string>
+ <string>NSView</string>
+ <string>NSButton</string>
+ <string>NSProgressIndicator</string>
+ <string>NSButton</string>
+ <string>NSToolbar</string>
+ <string>NSTextField</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>backButton</string>
+ <string>containerView</string>
+ <string>forwardButton</string>
+ <string>progressIndicator</string>
+ <string>reloadButton</string>
+ <string>toolbar</string>
+ <string>urlText</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBToOneOutletInfo">
+ <string key="name">backButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">containerView</string>
+ <string key="candidateClassName">NSView</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">forwardButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">progressIndicator</string>
+ <string key="candidateClassName">NSProgressIndicator</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">reloadButton</string>
+ <string key="candidateClassName">NSButton</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">toolbar</string>
+ <string key="candidateClassName">NSToolbar</string>
+ </object>
+ <object class="IBToOneOutletInfo">
+ <string key="name">urlText</string>
+ <string key="candidateClassName">NSTextField</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBProjectSource</string>
+ <string key="minorKey">mac/BrowserWindowController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">FirstResponder</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>forceRepaint:</string>
+ <string>newWindow:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>forceRepaint:</string>
+ <string>newWindow:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">forceRepaint:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">newWindow:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ </object>
+ <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="822405504">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="850738725">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="624831158">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSApplication</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSBrowser</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSBrowser.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSButton</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSControl</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="310914472">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSDocument</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>printDocument:</string>
+ <string>revertDocumentToSaved:</string>
+ <string>runPageLayout:</string>
+ <string>saveDocument:</string>
+ <string>saveDocumentAs:</string>
+ <string>saveDocumentTo:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>printDocument:</string>
+ <string>revertDocumentToSaved:</string>
+ <string>runPageLayout:</string>
+ <string>saveDocument:</string>
+ <string>saveDocumentAs:</string>
+ <string>saveDocumentTo:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">printDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">revertDocumentToSaved:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">runPageLayout:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveDocumentAs:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveDocumentTo:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDocument.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSDocument</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDocumentScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSDocumentController</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>clearRecentDocuments:</string>
+ <string>newDocument:</string>
+ <string>openDocument:</string>
+ <string>saveAllDocuments:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>clearRecentDocuments:</string>
+ <string>newDocument:</string>
+ <string>openDocument:</string>
+ <string>saveAllDocuments:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">clearRecentDocuments:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">newDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">openDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveAllDocuments:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDocumentController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFontManager</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="946436764">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSFormatter</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMatrix</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMatrix.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMenu</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="1056362899">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMenuItem</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="472958451">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSMovieView</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSMovieView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="822405504"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="850738725"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="624831158"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="310914472"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="946436764"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <reference key="sourceIdentifier" ref="1056362899"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="809545482">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier" id="260078765">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSProgressIndicator</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSProgressIndicator.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSResponder</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTableView</string>
+ <string key="superclassName">NSControl</string>
+ <reference key="sourceIdentifier" ref="809545482"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSText</string>
+ <string key="superclassName">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSText.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextField</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSTextView</string>
+ <string key="superclassName">NSText</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSTextView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSToolbar</string>
+ <string key="superclassName">NSObject</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSToolbar.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <reference key="sourceIdentifier" ref="472958451"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSView</string>
+ <string key="superclassName">NSResponder</string>
+ <reference key="sourceIdentifier" ref="260078765"/>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindow</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSWindowController</string>
+ <string key="superclassName">NSResponder</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">showWindow:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">showWindow:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">showWindow:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string>
+ </object>
+ </object>
+ </object>
+ </object>
+ <int key="IBDocument.localizationMode">0</int>
+ <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
+ <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
+ <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
+ <integer value="3000" key="NS.object.0"/>
+ </object>
+ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
+ <string key="IBDocument.LastKnownRelativeProjectPath">../MiniBrowser.xcodeproj</string>
+ <int key="IBDocument.defaultPropertyAccessControl">3</int>
+ <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSMenuCheckmark</string>
+ <string>NSMenuMixedState</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>{9, 8}</string>
+ <string>{7, 2}</string>
+ </object>
+ </object>
+ </data>
+</archive>
diff --git a/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
new file mode 100644
index 0000000..a4e648e
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
@@ -0,0 +1,38 @@
+/*
+ * 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__
+ #import <Cocoa/Cocoa.h>
+#endif
+
+#import <WebKit2/WebKit2.h>
+
+#define ENABLE_LOGGING 0
+
+#if ENABLE_LOGGING
+#define LOG NSLog
+#else
+#define LOG(...) ((void)0)
+#endif
diff --git a/WebKitTools/MiniBrowser/mac/WebBundle/Info.plist b/WebKitTools/MiniBrowser/mac/WebBundle/Info.plist
new file mode 100644
index 0000000..c285a47
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/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/WebBundle/WebBundleMain.m b/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m
new file mode 100644
index 0000000..f3d44a5
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m
@@ -0,0 +1,103 @@
+/*
+ * 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/WKBundleFrame.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 functions
+
+void didClearWindowObjectForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void *clientInfo)
+{
+ WKURLRef wkURL = WKBundleFrameCopyURL(WKBundlePageGetMainFrame(page));
+ CFURLRef cfURL = WKURLCopyCFURL(0, wkURL);
+ WKRelease(wkURL);
+
+ LOG(@"WKBundlePageClient - didClearWindowForFrame %@", [(NSURL *)cfURL absoluteString]);
+ CFRelease(cfURL);
+
+ WKStringRef messageName = WKStringCreateWithCFString(CFSTR("Callback"));
+ WKStringRef messageBody = WKStringCreateWithCFString(CFSTR("Window was cleared"));
+ WKBundlePostMessage(globalBundle, messageName, messageBody);
+ WKRelease(messageName);
+ WKRelease(messageBody);
+}
+
+
+// WKBundleClient
+
+void didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+ LOG(@"WKBundleClient - didCreatePage\n");
+
+ WKBundlePageLoaderClient client;
+ memset(&client, 0, sizeof(client));
+ client.didClearWindowObjectForFrame = didClearWindowObjectForFrame;
+
+ WKBundlePageSetLoaderClient(page, &client);
+}
+
+void willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+ LOG(@"WKBundleClient - willDestroyPage\n");
+}
+
+void didRecieveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
+{
+ CFStringRef cfMessageName = WKStringCopyCFString(0, messageName);
+
+ WKTypeID typeID = WKGetTypeID(messageBody);
+ if (typeID == WKStringGetTypeID()) {
+ CFStringRef cfMessageBody = WKStringCopyCFString(0, (WKStringRef)messageBody);
+ LOG(@"WKBundleClient - didRecieveMessage - MessageName: %@ MessageBody %@", cfMessageName, cfMessageBody);
+ CFRelease(cfMessageBody);
+ } else {
+ LOG(@"WKBundleClient - didRecieveMessage - MessageName: %@ (MessageBody Unhandeled)\n", cfMessageName);
+ }
+
+ CFRelease(cfMessageName);
+}
+
+void WKBundleInitialize(WKBundleRef bundle, WKTypeRef initializationUserData)
+{
+ globalBundle = bundle;
+
+ WKBundleClient client = {
+ 0,
+ 0,
+ didCreatePage,
+ willDestroyPage,
+ didRecieveMessage
+ };
+ WKBundleSetClient(bundle, &client);
+}
diff --git a/WebKitTools/MiniBrowser/mac/main.m b/WebKitTools/MiniBrowser/mac/main.m
new file mode 100644
index 0000000..7f56737
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/main.m
@@ -0,0 +1,31 @@
+/*
+ * 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 <Cocoa/Cocoa.h>
+
+int main(int argc, char *argv[])
+{
+ return NSApplicationMain(argc, (const char **) argv);
+}
diff --git a/WebKitTools/MiniBrowser/mac/make-launchable.sh b/WebKitTools/MiniBrowser/mac/make-launchable.sh
new file mode 100755
index 0000000..7fba058
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/make-launchable.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# 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.
+
+echo "Making app bundle launchable";
+defaults write "${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH%.plist}" LSEnvironment -dict DYLD_FRAMEWORK_PATH "${BUILT_PRODUCTS_DIR}"
diff --git a/WebKitTools/MiniBrowser/qt/BrowserView.cpp b/WebKitTools/MiniBrowser/qt/BrowserView.cpp
new file mode 100644
index 0000000..c885a39
--- /dev/null
+++ b/WebKitTools/MiniBrowser/qt/BrowserView.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2010 University of Szeged
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "BrowserView.h"
+
+#include <QGraphicsScene>
+#include "WKContext.h"
+
+static QWKPage* createNewPage(QWKPage* page)
+{
+ return page;
+}
+
+BrowserView::BrowserView(QGraphicsWKView::BackingStoreType backingStoreType, QWidget* parent)
+ : QGraphicsView(parent)
+ , m_item(0)
+ , m_context(WKContextGetSharedProcessContext())
+{
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(m_context.get()));
+
+ m_item = new QGraphicsWKView(pageNamespace.get(), backingStoreType, 0);
+ setScene(new QGraphicsScene(this));
+ scene()->addItem(m_item);
+
+ setFrameShape(QFrame::NoFrame);
+ setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
+ connect(m_item, SIGNAL(titleChanged(QString)), this, SLOT(setWindowTitle(QString)));
+ m_item->page()->setCreateNewPageFunction(createNewPage);
+}
+
+void BrowserView::resizeEvent(QResizeEvent* event)
+{
+ QGraphicsView::resizeEvent(event);
+ QRectF rect(QPoint(0, 0), event->size());
+ m_item->setGeometry(rect);
+ scene()->setSceneRect(rect);
+}
+
+void BrowserView::load(const QString& url)
+{
+ return m_item->load(QUrl::fromUserInput(url));
+}
+
+QGraphicsWKView* BrowserView::view() const
+{
+ return m_item;
+}
diff --git a/WebKitTools/MiniBrowser/qt/BrowserView.h b/WebKitTools/MiniBrowser/qt/BrowserView.h
new file mode 100644
index 0000000..7e8288e
--- /dev/null
+++ b/WebKitTools/MiniBrowser/qt/BrowserView.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2010 University of Szeged
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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.
+ */
+
+#ifndef BrowserView_h
+#define BrowserView_h
+
+#include <QGraphicsView>
+#include "qgraphicswkview.h"
+#include "WKRetainPtr.h"
+
+class BrowserView : public QGraphicsView {
+ Q_OBJECT
+
+public:
+ BrowserView(QGraphicsWKView::BackingStoreType, QWidget* parent = 0);
+ virtual ~BrowserView() { delete m_item; }
+
+ void load(const QString&);
+ QGraphicsWKView* view() const;
+
+protected:
+ virtual void resizeEvent(QResizeEvent*);
+
+private:
+ QGraphicsWKView* m_item;
+ WKRetainPtr<WKContextRef> m_context;
+};
+
+#endif
diff --git a/WebKitTools/MiniBrowser/qt/BrowserWindow.cpp b/WebKitTools/MiniBrowser/qt/BrowserWindow.cpp
new file mode 100644
index 0000000..4c56c3b
--- /dev/null
+++ b/WebKitTools/MiniBrowser/qt/BrowserWindow.cpp
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2010 University of Szeged
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "BrowserWindow.h"
+
+#include "WKPageNamespace.h"
+
+BrowserWindow::BrowserWindow(QGraphicsWKView::BackingStoreType type)
+ : m_backingStoreType(type)
+{
+ setAttribute(Qt::WA_DeleteOnClose);
+
+ m_menu = new QMenuBar();
+ m_browser = new BrowserView(m_backingStoreType);
+ m_addressBar = new QLineEdit();
+
+ m_menu->addAction("New Window", this, SLOT(newWindow()));
+ m_menu->addAction("Change User Agent", this, SLOT(showUserAgentDialog()));
+
+ m_menu->addSeparator();
+ m_menu->addAction("Quit", this, SLOT(close()));
+
+ m_browser->setFocus(Qt::OtherFocusReason);
+
+ connect(m_addressBar, SIGNAL(returnPressed()), SLOT(changeLocation()));
+ connect(m_browser->view(), SIGNAL(loadProgress(int)), SLOT(loadProgress(int)));
+ connect(m_browser->view(), SIGNAL(titleChanged(const QString&)), SLOT(titleChanged(const QString&)));
+ connect(m_browser->view(), SIGNAL(urlChanged(const QUrl&)), SLOT(urlChanged(const QUrl&)));
+
+ QToolBar* bar = addToolBar("Navigation");
+ bar->addAction(m_browser->view()->page()->action(QWKPage::Back));
+ bar->addAction(m_browser->view()->page()->action(QWKPage::Forward));
+ bar->addAction(m_browser->view()->page()->action(QWKPage::Reload));
+ bar->addAction(m_browser->view()->page()->action(QWKPage::Stop));
+ bar->addWidget(m_addressBar);
+
+ this->setMenuBar(m_menu);
+ this->setCentralWidget(m_browser);
+
+ m_browser->setFocus(Qt::OtherFocusReason);
+
+ QShortcut* selectAddressBar = new QShortcut(Qt::CTRL | Qt::Key_L, this);
+ connect(selectAddressBar, SIGNAL(activated()), this, SLOT(openLocation()));
+
+ resize(960, 640);
+ show();
+}
+
+void BrowserWindow::load(const QString& url)
+{
+ m_addressBar->setText(url);
+ m_browser->load(url);
+}
+
+BrowserWindow* BrowserWindow::newWindow(const QString& url)
+{
+ BrowserWindow* window = new BrowserWindow(m_backingStoreType);
+ window->load(url);
+ return window;
+}
+
+void BrowserWindow::openLocation()
+{
+ m_addressBar->selectAll();
+ m_addressBar->setFocus();
+}
+
+void BrowserWindow::changeLocation()
+{
+ QString string = m_addressBar->text();
+ m_browser->load(string);
+}
+
+void BrowserWindow::loadProgress(int progress)
+{
+ QColor backgroundColor = QApplication::palette().color(QPalette::Base);
+ QColor progressColor = QColor(120, 180, 240);
+ QPalette pallete = m_addressBar->palette();
+
+ if (progress <= 0 || progress >= 100)
+ pallete.setBrush(QPalette::Base, backgroundColor);
+ else {
+ QLinearGradient gradient(0, 0, width(), 0);
+ gradient.setColorAt(0, progressColor);
+ gradient.setColorAt(((double) progress) / 100, progressColor);
+ if (progress != 100)
+ gradient.setColorAt((double) progress / 100 + 0.001, backgroundColor);
+ pallete.setBrush(QPalette::Base, gradient);
+ }
+ m_addressBar->setPalette(pallete);
+}
+
+void BrowserWindow::titleChanged(const QString& title)
+{
+ setWindowTitle(title);
+}
+
+void BrowserWindow::urlChanged(const QUrl& url)
+{
+ m_addressBar->setText(url.toString());
+}
+
+void BrowserWindow::updateUserAgentList()
+{
+ QWKPage* page = m_browser->view()->page();
+
+ QFile file(":/useragentlist.txt");
+
+ if (file.open(QIODevice::ReadOnly)) {
+ while (!file.atEnd())
+ m_userAgentList << file.readLine().trimmed();
+ file.close();
+ }
+
+ Q_ASSERT(!m_userAgentList.isEmpty());
+
+ if (!(page->customUserAgent().isEmpty() || m_userAgentList.contains(page->customUserAgent())))
+ m_userAgentList << page->customUserAgent();
+}
+
+void BrowserWindow::showUserAgentDialog()
+{
+ updateUserAgentList();
+
+ QDialog dialog(this);
+ dialog.setWindowTitle("Change User Agent");
+ dialog.resize(size().width() * 0.7, dialog.size().height());
+ QVBoxLayout* layout = new QVBoxLayout(&dialog);
+ dialog.setLayout(layout);
+
+ QComboBox* combo = new QComboBox(&dialog);
+ combo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
+ combo->setEditable(true);
+ combo->insertItems(0, m_userAgentList);
+ layout->addWidget(combo);
+
+ int index = combo->findText(m_browser->view()->page()->customUserAgent());
+ combo->setCurrentIndex(index);
+
+ QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel
+ , Qt::Horizontal, &dialog);
+ connect(buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
+ layout->addWidget(buttonBox);
+
+ if (dialog.exec() && !combo->currentText().isEmpty())
+ m_browser->view()->page()->setCustomUserAgent(combo->currentText());
+}
+
+BrowserWindow::~BrowserWindow()
+{
+ delete m_addressBar;
+ delete m_browser;
+ delete m_menu;
+}
diff --git a/WebKitTools/MiniBrowser/qt/BrowserWindow.h b/WebKitTools/MiniBrowser/qt/BrowserWindow.h
new file mode 100644
index 0000000..fe94d6b
--- /dev/null
+++ b/WebKitTools/MiniBrowser/qt/BrowserWindow.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2010 University of Szeged
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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.
+ */
+
+#ifndef BrowserWindow_h
+#define BrowserWindow_h
+
+#include "BrowserView.h"
+#include <QStringList>
+#include <QtGui>
+#include <qgraphicswkview.h>
+
+class BrowserWindow : public QMainWindow {
+ Q_OBJECT
+
+public:
+ BrowserWindow(QGraphicsWKView::BackingStoreType);
+ ~BrowserWindow();
+ void load(const QString& url);
+
+public slots:
+ BrowserWindow* newWindow(const QString& url = "about:blank");
+ void openLocation();
+
+protected slots:
+ void changeLocation();
+ void loadProgress(int progress);
+ void titleChanged(const QString&);
+ void urlChanged(const QUrl&);
+ void showUserAgentDialog();
+
+private:
+ void updateUserAgentList();
+
+ BrowserView* m_browser;
+ QMenuBar* m_menu;
+ QLineEdit* m_addressBar;
+ QStringList m_userAgentList;
+ QGraphicsWKView::BackingStoreType m_backingStoreType;
+};
+
+#endif
diff --git a/WebKitTools/MiniBrowser/qt/MiniBrowser.pro b/WebKitTools/MiniBrowser/qt/MiniBrowser.pro
new file mode 100644
index 0000000..82f6a00
--- /dev/null
+++ b/WebKitTools/MiniBrowser/qt/MiniBrowser.pro
@@ -0,0 +1,60 @@
+TEMPLATE = app
+TARGET = MiniBrowser
+
+SOURCES += \
+ main.cpp \
+ BrowserView.cpp \
+ BrowserWindow.cpp \
+
+HEADERS += \
+ BrowserView.h \
+ BrowserWindow.h \
+
+CONFIG += uitools
+
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
+include(../../../WebKit.pri)
+
+INCLUDEPATH += \
+ $$PWD/../../../WebKit2/ \
+ $$PWD/../../../WebKit2/UIProcess/API/cpp \
+ $$PWD/../../../WebKit2/UIProcess/API/C \
+ $$PWD/../../../WebKit2/UIProcess/API/qt \
+ $$OUTPUT_DIR/include
+
+
+DESTDIR = $$OUTPUT_DIR/bin
+!CONFIG(standalone_package): CONFIG -= app_bundle
+
+QT += network
+macx:QT+=xml
+
+linux-* {
+ # From Creator's src/rpath.pri:
+ # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
+ # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var.
+ QMAKE_RPATHDIR = \$\$ORIGIN/../lib $$QMAKE_RPATHDIR
+ MY_RPATH = $$join(QMAKE_RPATHDIR, ":")
+
+ QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${MY_RPATH}\'
+ QMAKE_RPATHDIR =
+} else {
+ QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+}
+
+symbian {
+ TARGET.UID3 = 0xA000E543
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
+}
+
+contains(QT_CONFIG, opengl) {
+ QT += opengl
+ DEFINES += QT_CONFIGURED_WITH_OPENGL
+}
+
+# We have to copy the resource file to the build directory
+# to use the useragentlist.txt file of QtTestBrowser without
+# polluting the source tree.
+# The copier is defined in WebKit2/DerivedSources.pro.
+RESOURCES += \
+ $$OUTPUT_DIR/WebKitTools/MiniBrowser/qt/MiniBrowser.qrc
diff --git a/WebKitTools/MiniBrowser/qt/main.cpp b/WebKitTools/MiniBrowser/qt/main.cpp
new file mode 100644
index 0000000..20f4ff5
--- /dev/null
+++ b/WebKitTools/MiniBrowser/qt/main.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2010 University of Szeged
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "BrowserWindow.h"
+#include <QLatin1String>
+#include <QRegExp>
+#include <qgraphicswkview.h>
+#include <QtGui>
+
+int main(int argc, char** argv) {
+ QApplication app(argc, argv);
+
+ QStringList args = QApplication::arguments();
+ args.removeAt(0);
+
+ QGraphicsWKView::BackingStoreType backingStoreTypeToUse = QGraphicsWKView::Simple;
+ int indexOfTiledOption;
+ if ((indexOfTiledOption = args.indexOf(QRegExp(QLatin1String("-tiled")))) != -1) {
+ backingStoreTypeToUse = QGraphicsWKView::Tiled;
+ args.removeAt(indexOfTiledOption);
+ }
+
+ if (args.isEmpty()) {
+ QString defaultUrl = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
+ if (QDir(defaultUrl).exists())
+ args.append(defaultUrl);
+ else
+ args.append("http://www.google.com");
+ }
+
+ BrowserWindow* window = new BrowserWindow(backingStoreTypeToUse);
+ window->load(args[0]);
+
+ for (int i = 1; i < args.size(); ++i)
+ window->newWindow(args[i]);
+
+ app.exec();
+
+ return 0;
+}
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.cpp b/WebKitTools/MiniBrowser/win/BrowserView.cpp
new file mode 100644
index 0000000..b182740
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/BrowserView.cpp
@@ -0,0 +1,145 @@
+/*
+ * 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 "StdAfx.h"
+#include "BrowserView.h"
+
+#include "BrowserWindow.h"
+#include <WebKit2/WKContextPrivate.h>
+#include <WebKit2/WKURLCF.h>
+
+static const unsigned short HIGH_BIT_MASK_SHORT = 0x8000;
+
+BrowserView::BrowserView()
+ : m_webView(0)
+{
+}
+
+// UI Client Callbacks
+
+static WKPageRef createNewPage(WKPageRef page, WKDictionaryRef features, WKEventModifiers modifiers, WKEventMouseButton mouseButton, const void* clientInfo)
+{
+ BrowserWindow* browserWindow = BrowserWindow::create();
+ browserWindow->createWindow(0, 0, 800, 600);
+
+ return WKViewGetPage(browserWindow->view().webView());
+}
+
+static void showPage(WKPageRef page, const void *clientInfo)
+{
+ static_cast<BrowserWindow*>(const_cast<void*>(clientInfo))->showWindow();
+}
+
+static void closePage(WKPageRef page, const void *clientInfo)
+{
+}
+
+static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
+{
+}
+
+static bool runJavaScriptConfirm(WKPageRef page, WKStringRef message, WKFrameRef frame, const void* clientInfo)
+{
+ return false;
+}
+
+static WKStringRef runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, const void* clientInfo)
+{
+ return 0;
+}
+
+static void setStatusText(WKPageRef page, WKStringRef text, const void* clientInfo)
+{
+}
+
+static void mouseDidMoveOverElement(WKPageRef page, WKEventModifiers modifiers, WKTypeRef userData, const void *clientInfo)
+{
+}
+
+void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
+{
+ assert(!m_webView);
+
+ bool isShiftKeyDown = ::GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT;
+
+ WKContextRef context;
+ if (isShiftKeyDown)
+ context = WKContextGetSharedThreadContext();
+ else
+ context = WKContextGetSharedProcessContext();
+
+ WKPageNamespaceRef pageNamespace = WKPageNamespaceCreate(context);
+
+ m_webView = WKViewCreate(webViewRect, pageNamespace, parentWindow->window());
+
+ WKPageUIClient uiClient = {
+ 0, /* version */
+ parentWindow, /* clientInfo */
+ createNewPage,
+ showPage,
+ closePage,
+ runJavaScriptAlert,
+ runJavaScriptConfirm,
+ runJavaScriptPrompt,
+ setStatusText,
+ mouseDidMoveOverElement,
+ 0, /* didNotHandleKeyEvent */
+ 0, /* toolbarsAreVisible */
+ 0, /* setToolbarsAreVisible */
+ 0, /* menuBarIsVisible */
+ 0, /* setMenuBarIsVisible */
+ 0, /* statusBarIsVisible */
+ 0, /* setStatusBarIsVisible */
+ 0, /* isResizable */
+ 0, /* setIsResizable */
+ 0, /* getWindowFrame */
+ 0, /* setWindowFrame */
+ 0, /* runBeforeUnloadConfirmPanel */
+ 0, /* didDraw */
+ 0 /* pageDidScroll */
+ };
+
+ WKPageSetPageUIClient(WKViewGetPage(m_webView), &uiClient);
+}
+
+void BrowserView::setFrame(RECT rect)
+{
+ HWND webViewWindow = WKViewGetWindow(m_webView);
+ ::SetWindowPos(webViewWindow, 0, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS);
+}
+
+void BrowserView::goToURL(const std::wstring& urlString)
+{
+ CFStringRef string = CFStringCreateWithCharacters(0, (const UniChar*)urlString.data(), urlString.size());
+ CFURLRef cfURL = CFURLCreateWithString(0, string, 0);
+ CFRelease(string);
+
+ WKURLRef url = WKURLCreateWithCFURL(cfURL);
+ CFRelease(cfURL);
+
+ WKPageRef page = WKViewGetPage(m_webView);
+ WKPageLoadURL(page, url);
+ WKRelease(url);
+}
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.h b/WebKitTools/MiniBrowser/win/BrowserView.h
new file mode 100644
index 0000000..08c5e4a
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/BrowserView.h
@@ -0,0 +1,49 @@
+/*
+ * 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 BrowserView_h
+#define BrowserView_h
+
+#include <WebKit2/WebKit2.h>
+#include <string>
+
+class BrowserWindow;
+
+class BrowserView {
+public:
+ BrowserView();
+
+ void goToURL(const std::wstring& url);
+
+ void create(RECT, BrowserWindow* parentWindow);
+ void setFrame(RECT);
+
+ WKViewRef webView() const { return m_webView; }
+
+private:
+ WKViewRef m_webView;
+};
+
+#endif // BrowserView_h
diff --git a/WebKitTools/MiniBrowser/win/BrowserWindow.cpp b/WebKitTools/MiniBrowser/win/BrowserWindow.cpp
new file mode 100644
index 0000000..dc43a68
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/BrowserWindow.cpp
@@ -0,0 +1,261 @@
+/*
+ * 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 "StdAfx.h"
+#include "BrowserWindow.h"
+#include "MiniBrowser.h"
+#include "Resource.h"
+
+#include <assert.h>
+#include <commctrl.h>
+#include <shlwapi.h>
+#include <vector>
+#include <wininet.h>
+
+using namespace std;
+
+BrowserWindow::BrowserWindow()
+ : m_window(0)
+ , m_rebarWindow(0)
+ , m_comboBoxWindow(0)
+{
+}
+
+LRESULT CALLBACK BrowserWindow::BrowserWindowWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ LONG_PTR longPtr = ::GetWindowLongPtr(window, 0);
+
+ if (BrowserWindow* browserView = reinterpret_cast<BrowserWindow*>(longPtr))
+ return browserView->wndProc(window, message, wParam, lParam);
+
+ if (message == WM_CREATE) {
+ LPCREATESTRUCT createStruct = reinterpret_cast<LPCREATESTRUCT>(lParam);
+ BrowserWindow* browserWindow = static_cast<BrowserWindow*>(createStruct->lpCreateParams);
+ browserWindow->m_window = window;
+
+ ::SetWindowLongPtr(window, 0, (LONG_PTR)browserWindow);
+
+ browserWindow->onCreate(createStruct);
+ return 0;
+ }
+
+ return ::DefWindowProc(window, message, wParam, lParam);
+}
+
+LRESULT BrowserWindow::wndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ LRESULT lResult = 0;
+ bool handled = true;
+
+ switch (message) {
+ case WM_ERASEBKGND:
+ lResult = 1;
+ break;
+
+ case WM_COMMAND:
+ lResult = onCommand(LOWORD(wParam), handled);
+ break;
+
+ case WM_SIZE:
+ onSize(LOWORD(lParam), HIWORD(lParam));
+ break;
+
+ case WM_DESTROY:
+ onDestroy();
+ break;
+
+ case WM_NCDESTROY:
+ onNCDestroy();
+ break;
+
+ default:
+ handled = false;
+ }
+
+ if (!handled)
+ lResult = ::DefWindowProc(window, message, wParam, lParam);
+
+ return lResult;
+}
+
+void BrowserWindow::createWindow(int x, int y, int width, int height)
+{
+ assert(!m_window);
+
+ // Register the class.
+ WNDCLASSEX windowClass = { 0 };
+ windowClass.cbSize = sizeof(windowClass);
+ windowClass.style = 0;
+ windowClass.lpfnWndProc = BrowserWindowWndProc;
+ windowClass.cbClsExtra = 0;
+ windowClass.cbWndExtra = sizeof(this);
+ windowClass.hInstance = MiniBrowser::shared().instance();
+ windowClass.hIcon = 0;
+ windowClass.hCursor = ::LoadCursor(0, IDC_ARROW);
+ windowClass.hbrBackground = (HBRUSH)::GetStockObject(WHITE_BRUSH);
+ windowClass.lpszMenuName = MAKEINTRESOURCE(IDR_MAINFRAME);
+ windowClass.lpszClassName = L"MiniBrowser";
+ windowClass.hIconSm = 0;
+
+ ::RegisterClassEx(&windowClass);
+
+ ::CreateWindowW(L"MiniBrowser", L"MiniBrowser", WS_OVERLAPPEDWINDOW, x, y, width, height, 0, 0, MiniBrowser::shared().instance(), this);
+}
+
+void BrowserWindow::showWindow()
+{
+ assert(m_window);
+
+ ::ShowWindow(m_window, SW_SHOWNORMAL);
+}
+
+void BrowserWindow::goToURL(const std::wstring& url)
+{
+ m_browserView.goToURL(url);
+}
+
+void BrowserWindow::onCreate(LPCREATESTRUCT createStruct)
+{
+ // Register our window.
+ MiniBrowser::shared().registerWindow(this);
+
+ // Create the rebar control.
+ m_rebarWindow = ::CreateWindowEx(0, REBARCLASSNAME, 0, WS_VISIBLE | WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CCS_NODIVIDER | CCS_NOPARENTALIGN | RBS_VARHEIGHT | RBS_BANDBORDERS,
+ 0, 0, 0, 0, m_window, 0, createStruct->hInstance, 0);
+ REBARINFO rebarInfo = { 0 };
+ rebarInfo.cbSize = sizeof(rebarInfo);
+ rebarInfo.fMask = 0;
+ ::SendMessage(m_rebarWindow, RB_SETBARINFO, 0, (LPARAM)&rebarInfo);
+
+ // Create the combo box control.
+ m_comboBoxWindow = ::CreateWindowEx(0, L"combobox", 0, WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_VSCROLL | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CBS_AUTOHSCROLL | CBS_DROPDOWN,
+ 0, 0, 0, 0, m_rebarWindow, 0, createStruct->hInstance, 0);
+ SendMessage(m_comboBoxWindow, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(TRUE, 0));
+
+ REBARBANDINFO bandInfo;
+ bandInfo.cbSize = sizeof(bandInfo);
+ bandInfo.fMask = RBBIM_STYLE | RBBIM_TEXT | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE;
+ bandInfo.fStyle = RBBS_CHILDEDGE | RBBS_GRIPPERALWAYS;
+ bandInfo.lpText = L"Address";
+ bandInfo.hwndChild = m_comboBoxWindow;
+
+ RECT comboBoxRect;
+ ::GetWindowRect(m_comboBoxWindow, &comboBoxRect);
+ bandInfo.cx = 100;
+ bandInfo.cxMinChild = comboBoxRect.right - comboBoxRect.left;
+ bandInfo.cyMinChild = comboBoxRect.bottom - comboBoxRect.top;
+
+ // Add the band to the rebar.
+ int result = ::SendMessage(m_rebarWindow, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&bandInfo);
+
+ // Create the browser view.
+ RECT webViewRect = { 0, 0, 0, 0};
+ m_browserView.create(webViewRect, this);
+}
+
+void BrowserWindow::onDestroy()
+{
+ MiniBrowser::shared().unregisterWindow(this);
+
+ // FIXME: Should we close the browser view here?
+}
+
+void BrowserWindow::onNCDestroy()
+{
+ delete this;
+}
+
+void BrowserWindow::onSize(int width, int height)
+{
+ RECT rebarRect;
+ ::GetClientRect(m_rebarWindow, &rebarRect);
+
+ // Resize the rebar.
+ ::MoveWindow(m_rebarWindow, 0, 0, width, rebarRect.bottom - rebarRect.top, true);
+
+ RECT webViewRect;
+ webViewRect.top = rebarRect.bottom;
+ webViewRect.left = 0;
+ webViewRect.right = width;
+ webViewRect.bottom = height;
+ m_browserView.setFrame(webViewRect);
+}
+
+LRESULT BrowserWindow::onCommand(int commandID, bool& handled)
+{
+ switch (commandID) {
+ case ID_FILE_NEW_WINDOW:
+ MiniBrowser::shared().createNewWindow();
+ break;
+ case ID_FILE_CLOSE:
+ ::PostMessage(m_window, WM_CLOSE, 0, 0);
+ break;
+ case ID_DEBUG_SHOW_WEB_VIEW: {
+ HMENU menu = ::GetMenu(m_window);
+ bool shouldHide = ::GetMenuState(menu, ID_DEBUG_SHOW_WEB_VIEW, MF_BYCOMMAND) & MF_CHECKED;
+
+ ::CheckMenuItem(menu, ID_DEBUG_SHOW_WEB_VIEW, MF_BYCOMMAND | (shouldHide ? MF_UNCHECKED : MF_CHECKED));
+
+ // Show or hide the web view.
+ HWND webViewWindow = WKViewGetWindow(m_browserView.webView());
+ ::ShowWindow(webViewWindow, shouldHide ? SW_HIDE : SW_SHOW);
+ break;
+ }
+ default:
+ handled = false;
+ }
+
+ return 0;
+}
+
+bool BrowserWindow::handleMessage(const MSG* message)
+{
+ if (message->hwnd != m_comboBoxWindow && !::IsChild(m_comboBoxWindow, message->hwnd))
+ return false;
+
+ // Look for a WM_KEYDOWN message.
+ if (message->message != WM_KEYDOWN)
+ return false;
+
+ // Look for the VK_RETURN key.
+ if (message->wParam != VK_RETURN)
+ return false;
+
+ std::vector<WCHAR> buffer;
+ int textLength = ::GetWindowTextLength(m_comboBoxWindow);
+
+ buffer.resize(textLength + 1);
+ ::GetWindowText(m_comboBoxWindow, &buffer[0], buffer.size());
+
+ std::wstring url(&buffer[0], buffer.size() - 1);
+
+ if (url.find(L"http://"))
+ url = L"http://" + url;
+
+ m_browserView.goToURL(url);
+
+ // We handled this message.
+ return true;
+}
diff --git a/WebKitTools/MiniBrowser/win/BrowserWindow.h b/WebKitTools/MiniBrowser/win/BrowserWindow.h
new file mode 100644
index 0000000..1cf7350
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/BrowserWindow.h
@@ -0,0 +1,70 @@
+/*
+ * 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 BrowserWindow_h
+#define BrowserWindow_h
+
+#include "BrowserView.h"
+#include <string>
+
+class BrowserWindow {
+public:
+ static BrowserWindow* create()
+ {
+ return new BrowserWindow;
+ }
+
+ void createWindow(int x, int y, int width, int height);
+ void showWindow();
+
+ void goToURL(const std::wstring& url);
+
+ bool handleMessage(const MSG*);
+
+ const BrowserView& view() const { return m_browserView; }
+ HWND window() const { return m_window; }
+
+private:
+ BrowserWindow();
+
+ static LRESULT CALLBACK BrowserWindowWndProc(HWND, UINT, WPARAM, LPARAM);
+
+ // Message handlers.
+ LRESULT wndProc(HWND, UINT, WPARAM, LPARAM);
+ void onCreate(LPCREATESTRUCT);
+ void onDestroy();
+ void onNCDestroy();
+
+ void onSize(int width, int height);
+ LRESULT onCommand(int commandID, bool& handled);
+
+ HWND m_window;
+
+ HWND m_rebarWindow;
+ HWND m_comboBoxWindow;
+ BrowserView m_browserView;
+};
+
+#endif // BrowserWindow_h
diff --git a/WebKitTools/MiniBrowser/win/MiniBrowser.cpp b/WebKitTools/MiniBrowser/win/MiniBrowser.cpp
new file mode 100644
index 0000000..7e3d488
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/MiniBrowser.cpp
@@ -0,0 +1,84 @@
+/*
+ * 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 "stdafx.h"
+
+#include "BrowserWindow.h"
+#include "MiniBrowser.h"
+#include <assert.h>
+
+MiniBrowser::MiniBrowser()
+ : m_instance(0)
+{
+}
+
+MiniBrowser& MiniBrowser::shared()
+{
+ static MiniBrowser miniBrowser;
+
+ return miniBrowser;
+}
+
+void MiniBrowser::initialize(HINSTANCE instance)
+{
+ assert(!m_instance);
+
+ m_instance = instance;
+}
+
+void MiniBrowser::createNewWindow()
+{
+ static const wchar_t* kDefaultURLString = L"http://webkit.org/";
+
+ BrowserWindow* browserWindow = BrowserWindow::create();
+ browserWindow->createWindow(0, 0, 800, 600);
+ browserWindow->showWindow();
+ browserWindow->goToURL(kDefaultURLString);
+}
+
+void MiniBrowser::registerWindow(BrowserWindow* window)
+{
+ m_browserWindows.insert(window);
+}
+
+void MiniBrowser::unregisterWindow(BrowserWindow* window)
+{
+ m_browserWindows.erase(window);
+
+ if (m_browserWindows.empty())
+ ::PostQuitMessage(0);
+}
+
+bool MiniBrowser::handleMessage(const MSG* message)
+{
+ for (std::set<BrowserWindow*>::const_iterator it = m_browserWindows.begin(), end = m_browserWindows.end(); it != end; ++it) {
+ BrowserWindow* browserWindow = *it;
+
+ if (browserWindow->handleMessage(message))
+ return true;
+ }
+
+ return false;
+}
diff --git a/WebKitTools/MiniBrowser/win/MiniBrowser.h b/WebKitTools/MiniBrowser/win/MiniBrowser.h
new file mode 100644
index 0000000..c7b5177
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/MiniBrowser.h
@@ -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.
+ */
+
+#ifndef MiniBrowser_h
+#define MiniBrowser_h
+
+#include <set>
+
+class BrowserWindow;
+
+class MiniBrowser {
+public:
+ static MiniBrowser& shared();
+
+ void initialize(HINSTANCE);
+
+ void createNewWindow();
+
+ void registerWindow(BrowserWindow*);
+ void unregisterWindow(BrowserWindow*);
+
+ bool handleMessage(const MSG*);
+
+ HINSTANCE instance() const { return m_instance; }
+
+private:
+ MiniBrowser();
+
+ HINSTANCE m_instance;
+ std::set<BrowserWindow*> m_browserWindows;
+};
+
+#endif // MiniBrowser_h
diff --git a/WebKitTools/MiniBrowser/win/MiniBrowser.rc b/WebKitTools/MiniBrowser/win/MiniBrowser.rc
new file mode 100644
index 0000000..0ff88b0
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/MiniBrowser.rc
@@ -0,0 +1,79 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+#include "winresrc.h"
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MAINFRAME MENU
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&New Window\tCtrl+N", ID_FILE_NEW_WINDOW
+ MENUITEM SEPARATOR
+ MENUITEM "&Close", ID_FILE_CLOSE
+ END
+ POPUP "&Debug"
+ BEGIN
+ MENUITEM "&Show WebView", ID_DEBUG_SHOW_WEB_VIEW, CHECKED
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDR_MAINFRAME_ACCEL ACCELERATORS
+BEGIN
+ "N", ID_FILE_NEW_WINDOW, VIRTKEY, CONTROL, NOINVERT
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.\0"
+END
+
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/WebKitTools/MiniBrowser/win/main.cpp b/WebKitTools/MiniBrowser/win/main.cpp
new file mode 100644
index 0000000..0c125ba
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/main.cpp
@@ -0,0 +1,62 @@
+/*
+ * 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 "stdafx.h"
+
+#include "BrowserWindow.h"
+#include "MiniBrowser.h"
+#include <string>
+
+#if defined _M_IX86
+#define PROCESSORARCHITECTURE "x86"
+#elif defined _M_IA64
+#define PROCESSORARCHITECTURE "ia64"
+#elif defined _M_X64
+#define PROCESSORARCHITECTURE "amd64"
+#else
+#define PROCESSORARCHITECTURE "*"
+#endif
+
+#pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='" PROCESSORARCHITECTURE "' publicKeyToken='6595b64144ccf1df' language='*'\"")
+
+int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpstrCmdLine, int nCmdShow)
+{
+ MiniBrowser::shared().initialize(hInstance);
+
+ // Create and show our initial window.
+ MiniBrowser::shared().createNewWindow();
+
+ MSG message;
+ while (BOOL result = ::GetMessage(&message, 0, 0, 0)) {
+ if (result == -1)
+ break;
+ ::TranslateMessage(&message);
+
+ if (!MiniBrowser::shared().handleMessage(&message))
+ ::DispatchMessage(&message);
+ }
+
+ return 0;
+}
diff --git a/WebKitTools/MiniBrowser/win/resource.h b/WebKitTools/MiniBrowser/win/resource.h
new file mode 100644
index 0000000..b12b906
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/resource.h
@@ -0,0 +1,23 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by MiniBrowser.rc
+//
+
+#define ID_FILE_NEW_WINDOW 32770
+#define ID_FILE_OPEN 32771
+#define ID_FILE_CLOSE 32772
+#define ID_DEBUG_SHOW_WEB_VIEW 32773
+
+#define IDR_MAINFRAME 128
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NO_MFC 1
+#define _APS_NEXT_RESOURCE_VALUE 132
+#define _APS_NEXT_COMMAND_VALUE 32775
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 110
+#endif
+#endif
diff --git a/WebKitTools/MiniBrowser/win/stdafx.cpp b/WebKitTools/MiniBrowser/win/stdafx.cpp
new file mode 100644
index 0000000..c664e32
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/stdafx.cpp
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+// stdafx.cpp : source file that includes just the standard includes
+// MiniBrowser.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/WebKitTools/MiniBrowser/win/stdafx.h b/WebKitTools/MiniBrowser/win/stdafx.h
new file mode 100644
index 0000000..c5a35f9
--- /dev/null
+++ b/WebKitTools/MiniBrowser/win/stdafx.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.
+ */
+
+#define STRICT
+#define WIN32_LEAN_AND_MEAN
+
+#include <tchar.h>
+#include <windows.h>
diff --git a/WebKitTools/QtLauncher/QtLauncher.pro b/WebKitTools/QtLauncher/QtLauncher.pro
deleted file mode 100644
index 7dcc8e4..0000000
--- a/WebKitTools/QtLauncher/QtLauncher.pro
+++ /dev/null
@@ -1,36 +0,0 @@
-TEMPLATE = app
-
-SOURCES += \
- locationedit.cpp \
- main.cpp \
- mainwindow.cpp \
- urlloader.cpp \
- utils.cpp \
- webpage.cpp \
- webview.cpp \
-
-HEADERS += \
- locationedit.h \
- mainwindow.h \
- urlloader.h \
- utils.h \
- webinspector.h \
- webpage.h \
- webview.h \
-
-CONFIG -= app_bundle
-CONFIG += uitools
-DESTDIR = ../../bin
-
-include(../../WebKit.pri)
-
-INCLUDEPATH += ../../JavaScriptCore
-
-QT += network
-macx:QT+=xml
-QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
-
-symbian {
- TARGET.UID3 = 0xA000E543
- TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices
-}
diff --git a/WebKitTools/QtLauncher/main.cpp b/WebKitTools/QtLauncher/main.cpp
deleted file mode 100644
index c725c2f..0000000
--- a/WebKitTools/QtLauncher/main.cpp
+++ /dev/null
@@ -1,749 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
- * Copyright (C) 2006 George Staikos <staikos@kde.org>
- * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
- *
- * 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 COMPUTER, 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 COMPUTER, 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 <QtGui>
-#include <QtNetwork/QNetworkRequest>
-#if !defined(QT_NO_PRINTER)
-#include <QPrintPreviewDialog>
-#endif
-
-#ifndef QT_NO_UITOOLS
-#include <QtUiTools/QUiLoader>
-#endif
-
-#include <QDebug>
-
-#include <cstdio>
-#include "mainwindow.h"
-#include <qevent.h>
-#include <qwebelement.h>
-#include <qwebframe.h>
-#include <qwebinspector.h>
-#include <qwebsettings.h>
-
-#ifdef Q_WS_MAEMO_5
-#include <qx11info_x11.h>
-#endif
-
-#include "urlloader.h"
-#include "utils.h"
-#include "webinspector.h"
-#include "webpage.h"
-#include "webview.h"
-
-#ifdef Q_WS_MAEMO_5
-#include <X11/Xatom.h>
-#include <X11/Xlib.h>
-#undef KeyPress
-#endif
-
-#ifndef NDEBUG
-void QWEBKIT_EXPORT qt_drt_garbageCollector_collect();
-#endif
-
-
-static bool gUseGraphicsView = false;
-static bool gUseCompositing = false;
-static bool gCacheWebView = false;
-static bool gShowFrameRate = false;
-static QGraphicsView::ViewportUpdateMode gViewportUpdateMode = QGraphicsView::MinimalViewportUpdate;
-
-
-class LauncherWindow : public MainWindow {
- Q_OBJECT
-
-public:
- LauncherWindow(QString url = QString());
- virtual ~LauncherWindow();
-
- virtual void keyPressEvent(QKeyEvent* event);
- void grabZoomKeys(bool grab);
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- void sendTouchEvent();
- bool eventFilter(QObject* obj, QEvent* event);
-#endif
-
-protected slots:
- void loadStarted();
- void loadFinished();
-
- void showLinkHover(const QString &link, const QString &toolTip);
-
- void zoomIn();
- void zoomOut();
- void resetZoom();
- void toggleZoomTextOnly(bool on);
-
- void print();
- void screenshot();
-
- void setEditable(bool on);
-
- /* void dumpPlugins() */
- void dumpHtml();
-
- void selectElements();
-
- void setTouchMocking(bool on);
- void toggleAcceleratedCompositing(bool toggle);
- void initializeView(bool useGraphicsView = false);
-
-public slots:
- void newWindow(const QString& url = QString());
-
-private:
- // create the status bar, tool bar & menu
- void setupUI();
-
-private:
- QVector<int> zoomLevels;
- int currentZoom;
-
- QWidget* m_view;
- WebInspector* inspector;
-
- QAction* formatMenuAction;
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- QList<QTouchEvent::TouchPoint> touchPoints;
- bool touchMocking;
-#endif
-};
-
-
-LauncherWindow::LauncherWindow(QString url)
- : MainWindow(url)
- , currentZoom(100)
-{
- QSplitter* splitter = new QSplitter(Qt::Vertical, this);
- setCentralWidget(splitter);
-
-#if defined(Q_WS_S60)
- showMaximized();
-#else
- resize(800, 600);
-#endif
-
- m_view = 0;
- initializeView();
-
- connect(page(), SIGNAL(loadStarted()), this, SLOT(loadStarted()));
- connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
- connect(page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)),
- this, SLOT(showLinkHover(const QString&, const QString&)));
-
- inspector = new WebInspector(splitter);
- inspector->setPage(page());
- inspector->hide();
- connect(this, SIGNAL(destroyed()), inspector, SLOT(deleteLater()));
-
- setupUI();
-
- // the zoom values are chosen to be like in Mozilla Firefox 3
- zoomLevels << 30 << 50 << 67 << 80 << 90;
- zoomLevels << 100;
- zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
-
- grabZoomKeys(true);
-
- load(url);
-}
-
-LauncherWindow::~LauncherWindow()
-{
- grabZoomKeys(false);
-}
-
-void LauncherWindow::keyPressEvent(QKeyEvent* event)
-{
-#ifdef Q_WS_MAEMO_5
- switch (event->key()) {
- case Qt::Key_F7:
- zoomIn();
- event->accept();
- break;
- case Qt::Key_F8:
- zoomOut();
- event->accept();
- break;
- }
-#endif
- MainWindow::keyPressEvent(event);
-}
-
-void LauncherWindow::grabZoomKeys(bool grab)
-{
-#ifdef Q_WS_MAEMO_5
- if (!winId()) {
- qWarning("Can't grab keys unless we have a window id");
- return;
- }
-
- Atom atom = XInternAtom(QX11Info::display(), "_HILDON_ZOOM_KEY_ATOM", False);
- if (!atom) {
- qWarning("Unable to obtain _HILDON_ZOOM_KEY_ATOM");
- return;
- }
-
- unsigned long val = (grab) ? 1 : 0;
- XChangeProperty(QX11Info::display(), winId(), atom, XA_INTEGER, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&val), 1);
-#endif
-}
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-void LauncherWindow::sendTouchEvent()
-{
- if (touchPoints.isEmpty())
- return;
-
- QEvent::Type type = QEvent::TouchUpdate;
- if (touchPoints.size() == 1) {
- if (touchPoints[0].state() == Qt::TouchPointReleased)
- type = QEvent::TouchEnd;
- else if (touchPoints[0].state() == Qt::TouchPointPressed)
- type = QEvent::TouchBegin;
- }
-
- QTouchEvent touchEv(type);
- touchEv.setTouchPoints(touchPoints);
- QCoreApplication::sendEvent(page(), &touchEv);
-
- // After sending the event, remove all touchpoints that were released
- if (touchPoints[0].state() == Qt::TouchPointReleased)
- touchPoints.removeAt(0);
- if (touchPoints.size() > 1 && touchPoints[1].state() == Qt::TouchPointReleased)
- touchPoints.removeAt(1);
-}
-
-bool LauncherWindow::eventFilter(QObject* obj, QEvent* event)
-{
- if (!touchMocking || obj != m_view)
- return QObject::eventFilter(obj, event);
-
- if (event->type() == QEvent::MouseButtonPress
- || event->type() == QEvent::MouseButtonRelease
- || event->type() == QEvent::MouseButtonDblClick
- || event->type() == QEvent::MouseMove) {
-
- QMouseEvent* ev = static_cast<QMouseEvent*>(event);
- if (ev->type() == QEvent::MouseMove
- && !(ev->buttons() & Qt::LeftButton))
- return false;
-
- QTouchEvent::TouchPoint touchPoint;
- touchPoint.setState(Qt::TouchPointMoved);
- if ((ev->type() == QEvent::MouseButtonPress
- || ev->type() == QEvent::MouseButtonDblClick))
- touchPoint.setState(Qt::TouchPointPressed);
- else if (ev->type() == QEvent::MouseButtonRelease)
- touchPoint.setState(Qt::TouchPointReleased);
-
- touchPoint.setId(0);
- touchPoint.setScreenPos(ev->globalPos());
- touchPoint.setPos(ev->pos());
- touchPoint.setPressure(1);
-
- // If the point already exists, update it. Otherwise create it.
- if (touchPoints.size() > 0 && !touchPoints[0].id())
- touchPoints[0] = touchPoint;
- else if (touchPoints.size() > 1 && !touchPoints[1].id())
- touchPoints[1] = touchPoint;
- else
- touchPoints.append(touchPoint);
-
- sendTouchEvent();
- } else if (event->type() == QEvent::KeyPress
- && static_cast<QKeyEvent*>(event)->key() == Qt::Key_F
- && static_cast<QKeyEvent*>(event)->modifiers() == Qt::ControlModifier) {
-
- // If the keyboard point is already pressed, release it.
- // Otherwise create it and append to touchPoints.
- if (touchPoints.size() > 0 && touchPoints[0].id() == 1) {
- touchPoints[0].setState(Qt::TouchPointReleased);
- sendTouchEvent();
- } else if (touchPoints.size() > 1 && touchPoints[1].id() == 1) {
- touchPoints[1].setState(Qt::TouchPointReleased);
- sendTouchEvent();
- } else {
- QTouchEvent::TouchPoint touchPoint;
- touchPoint.setState(Qt::TouchPointPressed);
- touchPoint.setId(1);
- touchPoint.setScreenPos(QCursor::pos());
- touchPoint.setPos(m_view->mapFromGlobal(QCursor::pos()));
- touchPoint.setPressure(1);
- touchPoints.append(touchPoint);
- sendTouchEvent();
-
- // After sending the event, change the touchpoint state to stationary
- touchPoints.last().setState(Qt::TouchPointStationary);
- }
- }
- return false;
-}
-#endif // QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
-
-void LauncherWindow::loadStarted()
-{
- m_view->setFocus(Qt::OtherFocusReason);
-}
-
-void LauncherWindow::loadFinished()
-{
- QUrl url = page()->mainFrame()->url();
- setAddressUrl(url.toString());
- addCompleterEntry(url);
-}
-
-void LauncherWindow::showLinkHover(const QString &link, const QString &toolTip)
-{
-#ifndef Q_WS_MAEMO_5
- statusBar()->showMessage(link);
-#endif
-#ifndef QT_NO_TOOLTIP
- if (!toolTip.isEmpty())
- QToolTip::showText(QCursor::pos(), toolTip);
-#endif
-}
-
-void LauncherWindow::zoomIn()
-{
- int i = zoomLevels.indexOf(currentZoom);
- Q_ASSERT(i >= 0);
- if (i < zoomLevels.count() - 1)
- currentZoom = zoomLevels[i + 1];
-
- page()->mainFrame()->setZoomFactor(qreal(currentZoom) / 100.0);
-}
-
-void LauncherWindow::zoomOut()
-{
- int i = zoomLevels.indexOf(currentZoom);
- Q_ASSERT(i >= 0);
- if (i > 0)
- currentZoom = zoomLevels[i - 1];
-
- page()->mainFrame()->setZoomFactor(qreal(currentZoom) / 100.0);
-}
-
-void LauncherWindow::resetZoom()
-{
- currentZoom = 100;
- page()->mainFrame()->setZoomFactor(1.0);
-}
-
-void LauncherWindow::toggleZoomTextOnly(bool b)
-{
- page()->settings()->setAttribute(QWebSettings::ZoomTextOnly, b);
-}
-
-void LauncherWindow::print()
-{
-#if !defined(QT_NO_PRINTER)
- QPrintPreviewDialog dlg(this);
- connect(&dlg, SIGNAL(paintRequested(QPrinter*)),
- m_view, SLOT(print(QPrinter*)));
- dlg.exec();
-#endif
-}
-
-void LauncherWindow::screenshot()
-{
- QPixmap pixmap = QPixmap::grabWidget(m_view);
- QLabel* label = new QLabel;
- label->setAttribute(Qt::WA_DeleteOnClose);
- label->setWindowTitle("Screenshot - Preview");
- label->setPixmap(pixmap);
- label->show();
-
- QString fileName = QFileDialog::getSaveFileName(label, "Screenshot");
- if (!fileName.isEmpty()) {
- pixmap.save(fileName, "png");
- label->setWindowTitle(QString("Screenshot - Saved at %1").arg(fileName));
- }
-}
-
-void LauncherWindow::setEditable(bool on)
-{
- page()->setContentEditable(on);
- formatMenuAction->setVisible(on);
-}
-
-/*
-void LauncherWindow::dumpPlugins() {
- QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins();
- foreach (const QWebPluginInfo plugin, plugins) {
- qDebug() << "Plugin:" << plugin.name();
- foreach (const QWebPluginInfo::MimeType mime, plugin.mimeTypes()) {
- qDebug() << " " << mime.name;
- }
- }
-}
-*/
-
-void LauncherWindow::dumpHtml()
-{
- qDebug() << "HTML: " << page()->mainFrame()->toHtml();
-}
-
-void LauncherWindow::selectElements()
-{
- bool ok;
- QString str = QInputDialog::getText(this, "Select elements", "Choose elements",
- QLineEdit::Normal, "a", &ok);
-
- if (ok && !str.isEmpty()) {
- QWebElementCollection result = page()->mainFrame()->findAllElements(str);
- foreach (QWebElement e, result)
- e.setStyleProperty("background-color", "yellow");
-#ifndef Q_WS_MAEMO_5
- statusBar()->showMessage(QString("%1 element(s) selected").arg(result.count()), 5000);
-#endif
- }
-}
-
-void LauncherWindow::setTouchMocking(bool on)
-{
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- touchMocking = on;
-#endif
-}
-
-void LauncherWindow::toggleAcceleratedCompositing(bool toggle)
-{
- page()->settings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, toggle);
-}
-
-void LauncherWindow::initializeView(bool useGraphicsView)
-{
- delete m_view;
-
- QSplitter* splitter = static_cast<QSplitter*>(centralWidget());
-
- if (!useGraphicsView) {
- WebViewTraditional* view = new WebViewTraditional(splitter);
- view->setPage(page());
- m_view = view;
- } else {
- WebViewGraphicsBased* view = new WebViewGraphicsBased(splitter);
- view->setPage(page());
- view->setViewportUpdateMode(gViewportUpdateMode);
- view->setItemCacheMode(gCacheWebView ? QGraphicsItem::DeviceCoordinateCache : QGraphicsItem::NoCache);
- if (gShowFrameRate)
- view->enableFrameRateMeasurement();
- page()->settings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, gUseCompositing);
- m_view = view;
- }
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- m_view->installEventFilter(this);
- touchMocking = false;
-#endif
-}
-
-void LauncherWindow::newWindow(const QString& url)
-{
- LauncherWindow* mw = new LauncherWindow(url);
- mw->show();
-}
-
-void LauncherWindow::setupUI()
-{
- QMenu* fileMenu = menuBar()->addMenu("&File");
- fileMenu->addAction("New Window", this, SLOT(newWindow()), QKeySequence::New);
- fileMenu->addAction(tr("Open File..."), this, SLOT(openFile()), QKeySequence::Open);
- fileMenu->addAction("Close Window", this, SLOT(close()), QKeySequence::Close);
- fileMenu->addSeparator();
- fileMenu->addAction("Take Screen Shot...", this, SLOT(screenshot()));
- fileMenu->addAction(tr("Print..."), this, SLOT(print()), QKeySequence::Print);
- fileMenu->addSeparator();
- fileMenu->addAction("Quit", QApplication::instance(), SLOT(closeAllWindows()), QKeySequence(Qt::CTRL | Qt::Key_Q));
-
- QMenu* editMenu = menuBar()->addMenu("&Edit");
- editMenu->addAction(page()->action(QWebPage::Undo));
- editMenu->addAction(page()->action(QWebPage::Redo));
- editMenu->addSeparator();
- editMenu->addAction(page()->action(QWebPage::Cut));
- editMenu->addAction(page()->action(QWebPage::Copy));
- editMenu->addAction(page()->action(QWebPage::Paste));
- editMenu->addSeparator();
- QAction* setEditable = editMenu->addAction("Set Editable", this, SLOT(setEditable(bool)));
- setEditable->setCheckable(true);
-
- QMenu* viewMenu = menuBar()->addMenu("&View");
- viewMenu->addAction(page()->action(QWebPage::Stop));
- viewMenu->addAction(page()->action(QWebPage::Reload));
- viewMenu->addSeparator();
- QAction* zoomIn = viewMenu->addAction("Zoom &In", this, SLOT(zoomIn()));
- QAction* zoomOut = viewMenu->addAction("Zoom &Out", this, SLOT(zoomOut()));
- QAction* resetZoom = viewMenu->addAction("Reset Zoom", this, SLOT(resetZoom()));
- QAction* zoomTextOnly = viewMenu->addAction("Zoom Text Only", this, SLOT(toggleZoomTextOnly(bool)));
- zoomTextOnly->setCheckable(true);
- zoomTextOnly->setChecked(false);
- viewMenu->addSeparator();
- viewMenu->addAction("Dump HTML", this, SLOT(dumpHtml()));
- // viewMenu->addAction("Dump plugins", this, SLOT(dumpPlugins()));
-
- QMenu* formatMenu = new QMenu("F&ormat", this);
- formatMenuAction = menuBar()->addMenu(formatMenu);
- formatMenuAction->setVisible(false);
- formatMenu->addAction(page()->action(QWebPage::ToggleBold));
- formatMenu->addAction(page()->action(QWebPage::ToggleItalic));
- formatMenu->addAction(page()->action(QWebPage::ToggleUnderline));
- QMenu* writingMenu = formatMenu->addMenu(tr("Writing Direction"));
- writingMenu->addAction(page()->action(QWebPage::SetTextDirectionDefault));
- writingMenu->addAction(page()->action(QWebPage::SetTextDirectionLeftToRight));
- writingMenu->addAction(page()->action(QWebPage::SetTextDirectionRightToLeft));
-
- zoomIn->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Plus));
- zoomOut->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Minus));
- resetZoom->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0));
-
- QMenu* toolsMenu = menuBar()->addMenu("&Develop");
- toolsMenu->addAction("Select Elements...", this, SLOT(selectElements()));
- QAction* showInspectorAction = toolsMenu->addAction("Show Web Inspector", inspector, SLOT(setVisible(bool)), QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
- showInspectorAction->setCheckable(true);
- showInspectorAction->connect(inspector, SIGNAL(visibleChanged(bool)), SLOT(setChecked(bool)));
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
- QAction* touchMockAction = toolsMenu->addAction("Toggle multitouch mocking", this, SLOT(setTouchMocking(bool)));
- touchMockAction->setCheckable(true);
- touchMockAction->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_T));
-#endif
-
- QAction* toggleAcceleratedCompositing = toolsMenu->addAction("Toggle Accelerated Compositing", this, SLOT(toggleAcceleratedCompositing(bool)));
- toggleAcceleratedCompositing->setCheckable(true);
- toggleAcceleratedCompositing->setChecked(false);
-
- QAction* toggleGraphicsView = toolsMenu->addAction("Toggle use of QGraphicsView", this, SLOT(initializeView(bool)));
- toggleGraphicsView->setCheckable(true);
- toggleGraphicsView->setChecked(false);
-}
-
-QWebPage* WebPage::createWindow(QWebPage::WebWindowType type)
-{
- LauncherWindow* mw = new LauncherWindow;
- if (type == WebModalDialog)
- mw->setWindowModality(Qt::ApplicationModal);
- mw->show();
- return mw->page();
-}
-
-QObject* WebPage::createPlugin(const QString &classId, const QUrl&, const QStringList&, const QStringList&)
-{
- if (classId == "alien_QLabel") {
- QLabel* l = new QLabel;
- l->winId();
- return l;
- }
-
-#ifndef QT_NO_UITOOLS
- QUiLoader loader;
- return loader.createWidget(classId, view());
-#else
- Q_UNUSED(classId);
- return 0;
-#endif
-}
-
-
-int launcherMain(const QApplication& app)
-{
-#ifndef NDEBUG
- int retVal = app.exec();
- qt_drt_garbageCollector_collect();
- QWebSettings::clearMemoryCaches();
- return retVal;
-#else
- return app.exec();
-#endif
-}
-
-class LauncherApplication : public QApplication {
- Q_OBJECT
-
-public:
- LauncherApplication(int& argc, char** argv);
- QStringList urls() const { return m_urls; }
- bool isRobotized() const { return m_isRobotized; }
-
-private:
- void handleUserOptions();
- void applyDefaultSettings();
-
-private:
- bool m_isRobotized;
- QStringList m_urls;
-};
-
-void LauncherApplication::applyDefaultSettings()
-{
- QWebSettings::setMaximumPagesInCache(4);
-
- QWebSettings::setObjectCacheCapacities((16*1024*1024) / 8, (16*1024*1024) / 8, 16*1024*1024);
-
- QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
- QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
- QWebSettings::enablePersistentStorage();
-}
-
-LauncherApplication::LauncherApplication(int& argc, char** argv)
- : QApplication(argc, argv)
- , m_isRobotized(false)
-{
- // To allow QWebInspector's configuration persistence
- setOrganizationName("Nokia");
- setApplicationName("QtLauncher");
- setApplicationVersion("0.1");
-
- applyDefaultSettings();
-
- handleUserOptions();
-}
-
-static void requiresGraphicsView(const QString& option)
-{
- if (gUseGraphicsView)
- return;
- appQuit(1, QString("%1 only works in combination with the -graphicsbased option").arg(option));
-}
-
-void LauncherApplication::handleUserOptions()
-{
- QStringList args = arguments();
- QFileInfo program(args.at(0));
- QString programName("QtLauncher");
- if (program.exists())
- programName = program.baseName();
-
- QList<QString> updateModes(enumToKeys(QGraphicsView::staticMetaObject,
- "ViewportUpdateMode", "ViewportUpdate"));
-
- if (args.contains("-help")) {
- qDebug() << "Usage:" << programName.toLatin1().data()
- << "[-graphicsbased]"
- << "[-compositing]"
- << QString("[-viewport-update-mode %1]").arg(formatKeys(updateModes)).toLatin1().data()
- << "[-cache-webview]"
- << "[-show-fps]"
- << "[-r list]"
- << "URLs";
- appQuit(0);
- }
-
- if (args.contains("-graphicsbased"))
- gUseGraphicsView = true;
-
- if (args.contains("-compositing")) {
- requiresGraphicsView("-compositing");
- gUseCompositing = true;
- }
-
- if (args.contains("-show-fps")) {
- requiresGraphicsView("-show-fps");
- gShowFrameRate = true;
- }
-
- if (args.contains("-cache-webview")) {
- requiresGraphicsView("-cache-webview");
- gCacheWebView = true;
- }
-
- QString arg1("-viewport-update-mode");
- int modeIndex = args.indexOf(arg1);
- if (modeIndex != -1) {
- requiresGraphicsView(arg1);
-
- QString mode = takeOptionValue(&args, modeIndex);
- if (mode.isEmpty())
- appQuit(1, QString("%1 needs a value of one of [%2]").arg(arg1).arg(formatKeys(updateModes)));
- int idx = updateModes.indexOf(mode);
- if (idx == -1)
- appQuit(1, QString("%1 value has to be one of [%2]").arg(arg1).arg(formatKeys(updateModes)));
-
- gViewportUpdateMode = static_cast<QGraphicsView::ViewportUpdateMode>(idx);
- }
-
- int robotIndex = args.indexOf("-r");
- if (robotIndex != -1) {
- QString listFile = takeOptionValue(&args, robotIndex);
- if (listFile.isEmpty())
- appQuit(1, "-r needs a list file to start in robotized mode");
- if (!QFile::exists(listFile))
- appQuit(1, "The list file supplied to -r does not exist.");
-
- m_isRobotized = true;
- m_urls = QStringList(listFile);
- return;
- }
-
- int lastArg = args.lastIndexOf(QRegExp("^-.*"));
- m_urls = (lastArg != -1) ? args.mid(++lastArg) : args.mid(1);
-}
-
-
-int main(int argc, char **argv)
-{
- LauncherApplication app(argc, argv);
-
- if (app.isRobotized()) {
- LauncherWindow* window = new LauncherWindow();
- UrlLoader loader(window->page()->mainFrame(), app.urls().at(0));
- QObject::connect(window->page()->mainFrame(), SIGNAL(loadFinished(bool)), &loader, SLOT(loadNext()));
- loader.loadNext();
- window->show();
- return launcherMain(app);
- }
-
- QStringList urls = app.urls();
-
- if (urls.isEmpty()) {
- QString defaultUrl = QString("file://%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
- if (QDir(defaultUrl).exists())
- urls.append(defaultUrl);
- else
- urls.append("");
- }
-
- LauncherWindow* window = 0;
- foreach (QString url, urls) {
- if (!window)
- window = new LauncherWindow(url);
- else
- window->newWindow(url);
- }
-
- window->show();
- return launcherMain(app);
-}
-
-#include "main.moc"
diff --git a/WebKitTools/QtLauncher/webview.cpp b/WebKitTools/QtLauncher/webview.cpp
deleted file mode 100644
index 443fc3e..0000000
--- a/WebKitTools/QtLauncher/webview.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
- * Copyright (C) 2006 George Staikos <staikos@kde.org>
- * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
- * Copyright (C) 2006 Zack Rusin <zack@kde.org>
- * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
- *
- * 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 COMPUTER, 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 COMPUTER, 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 "webview.h"
-
-#include <QtGui>
-#include <QGraphicsScene>
-
-WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent)
- : QGraphicsView(parent)
- , m_item(new GraphicsWebView)
- , m_numPaintsTotal(0)
- , m_numPaintsSinceLastMeasure(0)
- , m_measureFps(false)
-{
- setScene(new QGraphicsScene(this));
- scene()->addItem(m_item);
-
- setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
- setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-
-}
-
-void WebViewGraphicsBased::resizeEvent(QResizeEvent* event)
-{
- QGraphicsView::resizeEvent(event);
- QRectF rect(QPoint(0, 0), event->size());
- m_item->setGeometry(rect);
-}
-
-void WebViewGraphicsBased::enableFrameRateMeasurement()
-{
- m_measureFps = true;
- m_lastConsultTime = m_startTime = QTime::currentTime();
- QTimer* updateTimer = new QTimer(this);
- updateTimer->setInterval(1000);
- connect(updateTimer, SIGNAL(timeout()), this, SLOT(updateFrameRate()));
- updateTimer->start();
-}
-
-void WebViewGraphicsBased::updateFrameRate()
-{
- QTime now = QTime::currentTime();
-
- int interval = m_lastConsultTime.msecsTo(now);
- int total = m_startTime.msecsTo(now);
-
- int average = total ? m_numPaintsTotal * 1000 / total : 0;
- int current = interval ? m_numPaintsSinceLastMeasure * 1000 / interval : 0;
-
- qDebug("[FPS] average: %d, current: %d", average, current);
-
- m_lastConsultTime = now;
- m_numPaintsSinceLastMeasure = 0;
-}
-
-void WebViewGraphicsBased::paintEvent(QPaintEvent* event)
-{
- QGraphicsView::paintEvent(event);
- if (!m_measureFps)
- return;
- m_numPaintsSinceLastMeasure++;
- m_numPaintsTotal++;
-}
-
-static QMenu* createContextMenu(QWebPage* page, QPoint position)
-{
- QMenu* menu = page->createStandardContextMenu();
-
- QWebHitTestResult r = page->mainFrame()->hitTestContent(position);
-
- if (!r.linkUrl().isEmpty()) {
- WebPage* webPage = qobject_cast<WebPage*>(page);
- QAction* newTabAction = menu->addAction("Open in Default &Browser", webPage, SLOT(openUrlInDefaultBrowser()));
- newTabAction->setData(r.linkUrl());
- menu->insertAction(menu->actions().at(2), newTabAction);
- }
- return menu;
-}
-
-void GraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* event)
-{
- setProperty("mouseButtons", QVariant::fromValue(int(event->buttons())));
- setProperty("keyboardModifiers", QVariant::fromValue(int(event->modifiers())));
-
- QGraphicsWebView::mousePressEvent(event);
-}
-
-void WebViewTraditional::mousePressEvent(QMouseEvent* event)
-{
- setProperty("mouseButtons", QVariant::fromValue(int(event->buttons())));
- setProperty("keyboardModifiers", QVariant::fromValue(int(event->modifiers())));
-
- QWebView::mousePressEvent(event);
-}
-
-void GraphicsWebView::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
-{
- QMenu* menu = createContextMenu(page(), event->pos().toPoint());
- menu->exec(mapToScene(event->pos()).toPoint());
- delete menu;
-}
-
-void WebViewTraditional::contextMenuEvent(QContextMenuEvent* event)
-{
- QMenu* menu = createContextMenu(page(), event->pos());
- menu->exec(mapToGlobal(event->pos()));
- delete menu;
-}
-
diff --git a/WebKitTools/QtTestBrowser/QtTestBrowser.pro b/WebKitTools/QtTestBrowser/QtTestBrowser.pro
new file mode 100644
index 0000000..62d2c02
--- /dev/null
+++ b/WebKitTools/QtTestBrowser/QtTestBrowser.pro
@@ -0,0 +1,61 @@
+TEMPLATE = app
+
+SOURCES += \
+ locationedit.cpp \
+ launcherwindow.cpp \
+ main.cpp \
+ mainwindow.cpp \
+ urlloader.cpp \
+ utils.cpp \
+ webpage.cpp \
+ webview.cpp \
+ fpstimer.cpp \
+
+HEADERS += \
+ locationedit.h \
+ launcherwindow.h \
+ mainwindow.h \
+ urlloader.h \
+ utils.h \
+ webinspector.h \
+ webpage.h \
+ webview.h \
+ fpstimer.h \
+
+CONFIG += uitools
+
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..
+include(../../WebKit.pri)
+
+DESTDIR = $$OUTPUT_DIR/bin
+!CONFIG(standalone_package): CONFIG -= app_bundle
+
+QT += network
+macx:QT+=xml
+
+linux-* {
+ # From Creator's src/rpath.pri:
+ # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
+ # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var.
+ QMAKE_RPATHDIR = \$\$ORIGIN/../lib $$QMAKE_RPATHDIR
+ MY_RPATH = $$join(QMAKE_RPATHDIR, ":")
+
+ QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${MY_RPATH}\'
+ QMAKE_RPATHDIR =
+} else {
+ QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+}
+
+symbian {
+ TARGET.UID3 = 0xA000E543
+ TARGET.CAPABILITY = ReadUserData WriteUserData NetworkServices Location
+ MMP_RULES *= pageddata
+}
+
+contains(QT_CONFIG, opengl) {
+ QT += opengl
+ DEFINES += QT_CONFIGURED_WITH_OPENGL
+}
+
+RESOURCES += \
+ QtTestBrowser.qrc
diff --git a/WebKitTools/QtTestBrowser/QtTestBrowser.qrc b/WebKitTools/QtTestBrowser/QtTestBrowser.qrc
new file mode 100644
index 0000000..ffe77b0
--- /dev/null
+++ b/WebKitTools/QtTestBrowser/QtTestBrowser.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>useragentlist.txt</file>
+ </qresource>
+</RCC>
diff --git a/WebKitTools/QtTestBrowser/fpstimer.cpp b/WebKitTools/QtTestBrowser/fpstimer.cpp
new file mode 100644
index 0000000..eae3d9c
--- /dev/null
+++ b/WebKitTools/QtTestBrowser/fpstimer.cpp
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "fpstimer.h"
+
+#include <QDateTime>
+#include <QTimerEvent>
+
+// We save a maximum of 10000 frames, and purge 2000 at a time
+#define MAX_FRAMES_SAVED 10000
+#define FRAMES_TO_PURGE_WHEN_FULL 2000
+// 60 FPS
+#define FPS_MEASURE_INTERVAL 1000 / 60
+
+FpsTimer::FpsTimer(QObject* parent)
+ : QObject(parent)
+ , m_timer(0)
+{
+}
+
+int FpsTimer::numFrames(int spanMillis) const
+{
+ const QTime now = QTime::currentTime();
+
+ int count = 0;
+ for (int i = m_frames.length() - 1; i >= 0; --i, ++count) {
+ int msecs = m_frames[i].msecsTo(now);
+ if (msecs < 0)
+ msecs += 24 * 60 * 60 * 1000;
+ if (msecs > spanMillis)
+ break;
+ }
+ return count;
+}
+
+void FpsTimer::start()
+{
+ m_timer = startTimer(FPS_MEASURE_INTERVAL);
+}
+
+void FpsTimer::stop()
+{
+ if (!m_timer)
+ return;
+ killTimer(m_timer);
+ m_frames.clear();
+}
+
+void FpsTimer::timerEvent(QTimerEvent* event)
+{
+ if (event->timerId() != m_timer)
+ return;
+ m_frames.append(QTime::currentTime());
+ if (m_frames.length() > MAX_FRAMES_SAVED)
+ m_frames.erase(m_frames.begin(), m_frames.begin() + FRAMES_TO_PURGE_WHEN_FULL);
+}
diff --git a/WebKitTools/QtTestBrowser/fpstimer.h b/WebKitTools/QtTestBrowser/fpstimer.h
new file mode 100644
index 0000000..eed1198
--- /dev/null
+++ b/WebKitTools/QtTestBrowser/fpstimer.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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.
+ */
+
+#ifndef fpstimer_h
+#define fpstimer_h
+
+#include <QObject>
+#include <QSet>
+#include <QTime>
+
+class FpsTimer : public QObject {
+ Q_OBJECT
+
+public:
+ FpsTimer(QObject* parent = 0);
+ int numFrames(int spanMillis = 1000) const;
+
+public Q_SLOTS:
+ void start();
+ void stop();
+
+protected slots:
+ virtual void timerEvent(QTimerEvent*);
+
+private:
+ int m_timer;
+ QList<QTime> m_frames;
+};
+
+#endif // FPSMEASURE_H
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.cpp b/WebKitTools/QtTestBrowser/launcherwindow.cpp
new file mode 100644
index 0000000..7608063
--- /dev/null
+++ b/WebKitTools/QtTestBrowser/launcherwindow.cpp
@@ -0,0 +1,861 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "launcherwindow.h"
+
+const int gExitClickArea = 80;
+QVector<int> LauncherWindow::m_zoomLevels;
+
+LauncherWindow::LauncherWindow(WindowOptions* data, QGraphicsScene* sharedScene)
+ : MainWindow()
+ , m_currentZoom(100)
+ , m_view(0)
+ , m_inspector(0)
+ , m_formatMenuAction(0)
+ , m_zoomAnimation(0)
+{
+ if (data)
+ m_windowOptions = *data;
+
+ init();
+ if (sharedScene && data->useGraphicsView)
+ static_cast<QGraphicsView*>(m_view)->setScene(sharedScene);
+
+ createChrome();
+}
+
+LauncherWindow::~LauncherWindow()
+{
+ grabZoomKeys(false);
+}
+
+void LauncherWindow::init()
+{
+ QSplitter* splitter = new QSplitter(Qt::Vertical, this);
+ setCentralWidget(splitter);
+
+#if defined(Q_OS_SYMBIAN)
+ setWindowState(Qt::WindowMaximized);
+#else
+ setWindowState(Qt::WindowNoState);
+ resize(800, 600);
+#endif
+
+ m_inspector = new WebInspector;
+#ifndef QT_NO_PROPERTIES
+ if (!m_windowOptions.inspectorUrl.isEmpty())
+ m_inspector->setProperty("_q_inspectorUrl", m_windowOptions.inspectorUrl);
+#endif
+ connect(this, SIGNAL(destroyed()), m_inspector, SLOT(deleteLater()));
+
+ // the zoom values are chosen to be like in Mozilla Firefox 3
+ if (!m_zoomLevels.count()) {
+ m_zoomLevels << 30 << 50 << 67 << 80 << 90;
+ m_zoomLevels << 100;
+ m_zoomLevels << 110 << 120 << 133 << 150 << 170 << 200 << 240 << 300;
+ }
+
+ grabZoomKeys(true);
+
+ initializeView();
+}
+
+void LauncherWindow::initializeView()
+{
+ delete m_view;
+
+ QUrl url = page()->mainFrame()->url();
+ setPage(new WebPage(this));
+
+ QSplitter* splitter = static_cast<QSplitter*>(centralWidget());
+
+ if (!m_windowOptions.useGraphicsView) {
+ WebViewTraditional* view = new WebViewTraditional(splitter);
+ view->setPage(page());
+
+ view->installEventFilter(this);
+
+ m_view = view;
+ } else {
+ WebViewGraphicsBased* view = new WebViewGraphicsBased(splitter);
+ view->setPage(page());
+
+ connect(view, SIGNAL(currentFPSUpdated(int)), this, SLOT(updateFPS(int)));
+
+ view->installEventFilter(this);
+ // The implementation of QAbstractScrollArea::eventFilter makes us need
+ // to install the event filter also on the viewport of a QGraphicsView.
+ view->viewport()->installEventFilter(this);
+
+ m_view = view;
+ }
+
+ m_touchMocking = false;
+
+ connect(page(), SIGNAL(loadStarted()), this, SLOT(loadStarted()));
+ connect(page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished()));
+ connect(page(), SIGNAL(linkHovered(const QString&, const QString&, const QString&)),
+ this, SLOT(showLinkHover(const QString&, const QString&)));
+ connect(this, SIGNAL(enteredFullScreenMode(bool)), this, SLOT(toggleFullScreenMode(bool)));
+
+ applyPrefs();
+
+ splitter->addWidget(m_inspector);
+ m_inspector->setPage(page());
+ m_inspector->hide();
+
+ if (m_windowOptions.remoteInspectorPort)
+ page()->setProperty("_q_webInspectorServerPort", m_windowOptions.remoteInspectorPort);
+
+ if (url.isValid())
+ page()->mainFrame()->load(url);
+}
+
+void LauncherWindow::applyPrefs()
+{
+ QWebSettings* settings = page()->settings();
+ settings->setAttribute(QWebSettings::AcceleratedCompositingEnabled, m_windowOptions.useCompositing);
+ settings->setAttribute(QWebSettings::TiledBackingStoreEnabled, m_windowOptions.useTiledBackingStore);
+ settings->setAttribute(QWebSettings::FrameFlatteningEnabled, m_windowOptions.useFrameFlattening);
+ settings->setAttribute(QWebSettings::WebGLEnabled, m_windowOptions.useWebGL);
+
+ if (!isGraphicsBased())
+ return;
+
+ WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+ view->setViewportUpdateMode(m_windowOptions.viewportUpdateMode);
+ view->setFrameRateMeasurementEnabled(m_windowOptions.showFrameRate);
+ view->setItemCacheMode(m_windowOptions.cacheWebView ? QGraphicsItem::DeviceCoordinateCache : QGraphicsItem::NoCache);
+
+ if (m_windowOptions.resizesToContents)
+ toggleResizesToContents(m_windowOptions.resizesToContents);
+}
+
+void LauncherWindow::createChrome()
+{
+ QMenu* fileMenu = menuBar()->addMenu("&File");
+ fileMenu->addAction("New Window", this, SLOT(newWindow()), QKeySequence::New);
+ fileMenu->addAction(tr("Open File..."), this, SLOT(openFile()), QKeySequence::Open);
+ fileMenu->addAction(tr("Open Location..."), this, SLOT(openLocation()), QKeySequence(Qt::CTRL | Qt::Key_L));
+ fileMenu->addAction("Close Window", this, SLOT(close()), QKeySequence::Close);
+ fileMenu->addSeparator();
+ fileMenu->addAction("Take Screen Shot...", this, SLOT(screenshot()));
+ fileMenu->addAction(tr("Print..."), this, SLOT(print()), QKeySequence::Print);
+ fileMenu->addSeparator();
+ fileMenu->addAction("Quit", QApplication::instance(), SLOT(closeAllWindows()), QKeySequence(Qt::CTRL | Qt::Key_Q));
+
+ QMenu* editMenu = menuBar()->addMenu("&Edit");
+ editMenu->addAction(page()->action(QWebPage::Undo));
+ editMenu->addAction(page()->action(QWebPage::Redo));
+ editMenu->addSeparator();
+ editMenu->addAction(page()->action(QWebPage::Cut));
+ editMenu->addAction(page()->action(QWebPage::Copy));
+ editMenu->addAction(page()->action(QWebPage::Paste));
+ editMenu->addSeparator();
+ QAction* setEditable = editMenu->addAction("Set Editable", this, SLOT(setEditable(bool)));
+ setEditable->setCheckable(true);
+
+ QMenu* viewMenu = menuBar()->addMenu("&View");
+ viewMenu->addAction(page()->action(QWebPage::Stop));
+ viewMenu->addAction(page()->action(QWebPage::Reload));
+ viewMenu->addSeparator();
+ QAction* zoomIn = viewMenu->addAction("Zoom &In", this, SLOT(zoomIn()));
+ QAction* zoomOut = viewMenu->addAction("Zoom &Out", this, SLOT(zoomOut()));
+ QAction* resetZoom = viewMenu->addAction("Reset Zoom", this, SLOT(resetZoom()));
+ QAction* zoomTextOnly = viewMenu->addAction("Zoom Text Only", this, SLOT(toggleZoomTextOnly(bool)));
+ zoomTextOnly->setCheckable(true);
+ zoomTextOnly->setChecked(false);
+ viewMenu->addSeparator();
+ viewMenu->addAction("Dump HTML", this, SLOT(dumpHtml()));
+ // viewMenu->addAction("Dump plugins", this, SLOT(dumpPlugins()));
+
+ zoomIn->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Plus));
+ zoomOut->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_Minus));
+ resetZoom->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_0));
+
+ QMenu* formatMenu = new QMenu("F&ormat", this);
+ m_formatMenuAction = menuBar()->addMenu(formatMenu);
+ m_formatMenuAction->setVisible(false);
+ formatMenu->addAction(page()->action(QWebPage::ToggleBold));
+ formatMenu->addAction(page()->action(QWebPage::ToggleItalic));
+ formatMenu->addAction(page()->action(QWebPage::ToggleUnderline));
+ QMenu* writingMenu = formatMenu->addMenu(tr("Writing Direction"));
+ writingMenu->addAction(page()->action(QWebPage::SetTextDirectionDefault));
+ writingMenu->addAction(page()->action(QWebPage::SetTextDirectionLeftToRight));
+ writingMenu->addAction(page()->action(QWebPage::SetTextDirectionRightToLeft));
+
+ QMenu* windowMenu = menuBar()->addMenu("&Window");
+ QAction* toggleFullScreen = windowMenu->addAction("Toggle FullScreen", this, SIGNAL(enteredFullScreenMode(bool)));
+ toggleFullScreen->setShortcut(Qt::Key_F11);
+ toggleFullScreen->setCheckable(true);
+ toggleFullScreen->setChecked(false);
+ // When exit fullscreen mode by clicking on the exit area (bottom right corner) we must
+ // uncheck the Toggle FullScreen action.
+ toggleFullScreen->connect(this, SIGNAL(enteredFullScreenMode(bool)), SLOT(setChecked(bool)));
+
+ QWebSettings* settings = page()->settings();
+
+ QMenu* toolsMenu = menuBar()->addMenu("&Develop");
+ QMenu* graphicsViewMenu = toolsMenu->addMenu("QGraphicsView");
+ QAction* toggleGraphicsView = graphicsViewMenu->addAction("Toggle use of QGraphicsView", this, SLOT(toggleWebView(bool)));
+ toggleGraphicsView->setCheckable(true);
+ toggleGraphicsView->setChecked(isGraphicsBased());
+
+ QAction* toggleWebGL = toolsMenu->addAction("Toggle WebGL", this, SLOT(toggleWebGL(bool)));
+ toggleWebGL->setCheckable(true);
+ toggleWebGL->setChecked(settings->testAttribute(QWebSettings::WebGLEnabled));
+
+ QAction* spatialNavigationAction = toolsMenu->addAction("Toggle Spatial Navigation", this, SLOT(toggleSpatialNavigation(bool)));
+ spatialNavigationAction->setCheckable(true);
+ spatialNavigationAction->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_S));
+
+ QAction* toggleFrameFlattening = toolsMenu->addAction("Toggle Frame Flattening", this, SLOT(toggleFrameFlattening(bool)));
+ toggleFrameFlattening->setCheckable(true);
+ toggleFrameFlattening->setChecked(settings->testAttribute(QWebSettings::FrameFlatteningEnabled));
+
+ QAction* touchMockAction = toolsMenu->addAction("Toggle touch mocking", this, SLOT(setTouchMocking(bool)));
+ touchMockAction->setCheckable(true);
+ touchMockAction->setShortcut(QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_T));
+
+ toolsMenu->addSeparator();
+
+ QAction* toggleInterruptingJavaScripteEnabled = toolsMenu->addAction("Enable interrupting js scripts", this, SLOT(toggleInterruptingJavaScriptEnabled(bool)));
+ toggleInterruptingJavaScripteEnabled->setCheckable(true);
+ toggleInterruptingJavaScripteEnabled->setChecked(false);
+
+ QAction* toggleJavascriptCanOpenWindows = toolsMenu->addAction("Enable js popup windows", this, SLOT(toggleJavascriptCanOpenWindows(bool)));
+ toggleJavascriptCanOpenWindows->setCheckable(true);
+ toggleJavascriptCanOpenWindows->setChecked(false);
+
+ toolsMenu->addSeparator();
+
+ QAction* userAgentAction = toolsMenu->addAction("Change User Agent", this, SLOT(showUserAgentDialog()));
+ userAgentAction->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_U));
+
+ toolsMenu->addAction("Select Elements...", this, SLOT(selectElements()));
+
+ QAction* showInspectorAction = toolsMenu->addAction("Show Web Inspector", m_inspector, SLOT(setVisible(bool)), QKeySequence(Qt::CTRL | Qt::ALT | Qt::Key_I));
+ showInspectorAction->setCheckable(true);
+ showInspectorAction->connect(m_inspector, SIGNAL(visibleChanged(bool)), SLOT(setChecked(bool)));
+
+ // GraphicsView sub menu.
+ QAction* toggleAcceleratedCompositing = graphicsViewMenu->addAction("Toggle Accelerated Compositing", this, SLOT(toggleAcceleratedCompositing(bool)));
+ toggleAcceleratedCompositing->setCheckable(true);
+ toggleAcceleratedCompositing->setChecked(settings->testAttribute(QWebSettings::AcceleratedCompositingEnabled));
+ toggleAcceleratedCompositing->setEnabled(isGraphicsBased());
+ toggleAcceleratedCompositing->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+
+ QAction* toggleResizesToContents = graphicsViewMenu->addAction("Toggle Resizes To Contents Mode", this, SLOT(toggleResizesToContents(bool)));
+ toggleResizesToContents->setCheckable(true);
+ toggleResizesToContents->setChecked(m_windowOptions.resizesToContents);
+ toggleResizesToContents->setEnabled(isGraphicsBased());
+ toggleResizesToContents->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+
+ QAction* toggleTiledBackingStore = graphicsViewMenu->addAction("Toggle Tiled Backing Store", this, SLOT(toggleTiledBackingStore(bool)));
+ toggleTiledBackingStore->setCheckable(true);
+ toggleTiledBackingStore->setChecked(m_windowOptions.useTiledBackingStore);
+ toggleTiledBackingStore->setEnabled(isGraphicsBased());
+ toggleTiledBackingStore->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+ QAction* toggleQGLWidgetViewport = graphicsViewMenu->addAction("Toggle use of QGLWidget Viewport", this, SLOT(toggleQGLWidgetViewport(bool)));
+ toggleQGLWidgetViewport->setCheckable(true);
+ toggleQGLWidgetViewport->setChecked(m_windowOptions.useQGLWidgetViewport);
+ toggleQGLWidgetViewport->setEnabled(isGraphicsBased());
+ toggleQGLWidgetViewport->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+#endif
+
+ QMenu* viewportUpdateMenu = graphicsViewMenu->addMenu("Change Viewport Update Mode");
+ viewportUpdateMenu->setEnabled(isGraphicsBased());
+ viewportUpdateMenu->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+
+ QAction* fullUpdate = viewportUpdateMenu->addAction("FullViewportUpdate");
+ fullUpdate->setCheckable(true);
+ fullUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::FullViewportUpdate) ? true : false);
+
+ QAction* minimalUpdate = viewportUpdateMenu->addAction("MinimalViewportUpdate");
+ minimalUpdate->setCheckable(true);
+ minimalUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::MinimalViewportUpdate) ? true : false);
+
+ QAction* smartUpdate = viewportUpdateMenu->addAction("SmartViewportUpdate");
+ smartUpdate->setCheckable(true);
+ smartUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::SmartViewportUpdate) ? true : false);
+
+ QAction* boundingRectUpdate = viewportUpdateMenu->addAction("BoundingRectViewportUpdate");
+ boundingRectUpdate->setCheckable(true);
+ boundingRectUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::BoundingRectViewportUpdate) ? true : false);
+
+ QAction* noUpdate = viewportUpdateMenu->addAction("NoViewportUpdate");
+ noUpdate->setCheckable(true);
+ noUpdate->setChecked((m_windowOptions.viewportUpdateMode == QGraphicsView::NoViewportUpdate) ? true : false);
+
+ QSignalMapper* signalMapper = new QSignalMapper(viewportUpdateMenu);
+ signalMapper->setMapping(fullUpdate, QGraphicsView::FullViewportUpdate);
+ signalMapper->setMapping(minimalUpdate, QGraphicsView::MinimalViewportUpdate);
+ signalMapper->setMapping(smartUpdate, QGraphicsView::SmartViewportUpdate);
+ signalMapper->setMapping(boundingRectUpdate, QGraphicsView::BoundingRectViewportUpdate);
+ signalMapper->setMapping(noUpdate, QGraphicsView::NoViewportUpdate);
+
+ connect(fullUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+ connect(minimalUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+ connect(smartUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+ connect(boundingRectUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+ connect(noUpdate, SIGNAL(triggered()), signalMapper, SLOT(map()));
+
+ connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(changeViewportUpdateMode(int)));
+
+ QActionGroup* viewportUpdateModeActions = new QActionGroup(viewportUpdateMenu);
+ viewportUpdateModeActions->addAction(fullUpdate);
+ viewportUpdateModeActions->addAction(minimalUpdate);
+ viewportUpdateModeActions->addAction(smartUpdate);
+ viewportUpdateModeActions->addAction(boundingRectUpdate);
+ viewportUpdateModeActions->addAction(noUpdate);
+
+ graphicsViewMenu->addSeparator();
+
+ QAction* flipAnimated = graphicsViewMenu->addAction("Animated Flip");
+ flipAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ flipAnimated->setEnabled(isGraphicsBased());
+ connect(flipAnimated, SIGNAL(triggered()), SLOT(animatedFlip()));
+
+ QAction* flipYAnimated = graphicsViewMenu->addAction("Animated Y-Flip");
+ flipYAnimated->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ flipYAnimated->setEnabled(isGraphicsBased());
+ connect(flipYAnimated, SIGNAL(triggered()), SLOT(animatedYFlip()));
+
+ QAction* cloneWindow = graphicsViewMenu->addAction("Clone Window", this, SLOT(cloneWindow()));
+ cloneWindow->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ cloneWindow->setEnabled(isGraphicsBased());
+
+ graphicsViewMenu->addSeparator();
+
+ QAction* showFPS = graphicsViewMenu->addAction("Show FPS", this, SLOT(showFPS(bool)));
+ showFPS->setCheckable(true);
+ showFPS->setEnabled(isGraphicsBased());
+ showFPS->connect(toggleGraphicsView, SIGNAL(toggled(bool)), SLOT(setEnabled(bool)));
+ showFPS->setChecked(m_windowOptions.showFrameRate);
+}
+
+bool LauncherWindow::isGraphicsBased() const
+{
+ return bool(qobject_cast<QGraphicsView*>(m_view));
+}
+
+void LauncherWindow::keyPressEvent(QKeyEvent* event)
+{
+#ifdef Q_WS_MAEMO_5
+ switch (event->key()) {
+ case Qt::Key_F7:
+ zoomIn();
+ event->accept();
+ break;
+ case Qt::Key_F8:
+ zoomOut();
+ event->accept();
+ break;
+ }
+#endif
+ MainWindow::keyPressEvent(event);
+}
+
+void LauncherWindow::grabZoomKeys(bool grab)
+{
+#ifdef Q_WS_MAEMO_5
+ if (!winId()) {
+ qWarning("Can't grab keys unless we have a window id");
+ return;
+ }
+
+ Atom atom = XInternAtom(QX11Info::display(), "_HILDON_ZOOM_KEY_ATOM", False);
+ if (!atom) {
+ qWarning("Unable to obtain _HILDON_ZOOM_KEY_ATOM");
+ return;
+ }
+
+ unsigned long val = (grab) ? 1 : 0;
+ XChangeProperty(QX11Info::display(), winId(), atom, XA_INTEGER, 32, PropModeReplace, reinterpret_cast<unsigned char*>(&val), 1);
+#endif
+}
+
+void LauncherWindow::sendTouchEvent()
+{
+ if (m_touchPoints.isEmpty())
+ return;
+
+ QEvent::Type type = QEvent::TouchUpdate;
+ if (m_touchPoints.size() == 1) {
+ if (m_touchPoints[0].state() == Qt::TouchPointReleased)
+ type = QEvent::TouchEnd;
+ else if (m_touchPoints[0].state() == Qt::TouchPointPressed)
+ type = QEvent::TouchBegin;
+ }
+
+ QTouchEvent touchEv(type);
+ touchEv.setTouchPoints(m_touchPoints);
+ QCoreApplication::sendEvent(page(), &touchEv);
+
+ // After sending the event, remove all touchpoints that were released
+ if (m_touchPoints[0].state() == Qt::TouchPointReleased)
+ m_touchPoints.removeAt(0);
+ if (m_touchPoints.size() > 1 && m_touchPoints[1].state() == Qt::TouchPointReleased)
+ m_touchPoints.removeAt(1);
+}
+
+bool LauncherWindow::eventFilter(QObject* obj, QEvent* event)
+{
+ // If click pos is the bottom right corner (square with size defined by gExitClickArea)
+ // and the window is on FullScreen, the window must return to its original state.
+ if (event->type() == QEvent::MouseButtonRelease) {
+ QMouseEvent* ev = static_cast<QMouseEvent*>(event);
+ if (windowState() == Qt::WindowFullScreen
+ && ev->pos().x() > (width() - gExitClickArea)
+ && ev->pos().y() > (height() - gExitClickArea)) {
+
+ emit enteredFullScreenMode(false);
+ }
+ }
+
+ if (!m_touchMocking)
+ return QObject::eventFilter(obj, event);
+
+ if (event->type() == QEvent::MouseButtonPress
+ || event->type() == QEvent::MouseButtonRelease
+ || event->type() == QEvent::MouseButtonDblClick
+ || event->type() == QEvent::MouseMove) {
+
+ QMouseEvent* ev = static_cast<QMouseEvent*>(event);
+ if (ev->type() == QEvent::MouseMove
+ && !(ev->buttons() & Qt::LeftButton))
+ return false;
+
+ QTouchEvent::TouchPoint touchPoint;
+ touchPoint.setState(Qt::TouchPointMoved);
+ if ((ev->type() == QEvent::MouseButtonPress
+ || ev->type() == QEvent::MouseButtonDblClick))
+ touchPoint.setState(Qt::TouchPointPressed);
+ else if (ev->type() == QEvent::MouseButtonRelease)
+ touchPoint.setState(Qt::TouchPointReleased);
+
+ touchPoint.setId(0);
+ touchPoint.setScreenPos(ev->globalPos());
+ touchPoint.setPos(ev->pos());
+ touchPoint.setPressure(1);
+
+ // If the point already exists, update it. Otherwise create it.
+ if (m_touchPoints.size() > 0 && !m_touchPoints[0].id())
+ m_touchPoints[0] = touchPoint;
+ else if (m_touchPoints.size() > 1 && !m_touchPoints[1].id())
+ m_touchPoints[1] = touchPoint;
+ else
+ m_touchPoints.append(touchPoint);
+
+ sendTouchEvent();
+ } else if (event->type() == QEvent::KeyPress
+ && static_cast<QKeyEvent*>(event)->key() == Qt::Key_F
+ && static_cast<QKeyEvent*>(event)->modifiers() == Qt::ControlModifier) {
+
+ // If the keyboard point is already pressed, release it.
+ // Otherwise create it and append to m_touchPoints.
+ if (m_touchPoints.size() > 0 && m_touchPoints[0].id() == 1) {
+ m_touchPoints[0].setState(Qt::TouchPointReleased);
+ sendTouchEvent();
+ } else if (m_touchPoints.size() > 1 && m_touchPoints[1].id() == 1) {
+ m_touchPoints[1].setState(Qt::TouchPointReleased);
+ sendTouchEvent();
+ } else {
+ QTouchEvent::TouchPoint touchPoint;
+ touchPoint.setState(Qt::TouchPointPressed);
+ touchPoint.setId(1);
+ touchPoint.setScreenPos(QCursor::pos());
+ touchPoint.setPos(m_view->mapFromGlobal(QCursor::pos()));
+ touchPoint.setPressure(1);
+ m_touchPoints.append(touchPoint);
+ sendTouchEvent();
+
+ // After sending the event, change the touchpoint state to stationary
+ m_touchPoints.last().setState(Qt::TouchPointStationary);
+ }
+ }
+
+ return false;
+}
+
+void LauncherWindow::loadStarted()
+{
+ m_view->setFocus(Qt::OtherFocusReason);
+}
+
+void LauncherWindow::loadFinished()
+{
+ QUrl url = page()->mainFrame()->url();
+ setAddressUrl(url.toString(QUrl::RemoveUserInfo));
+ addCompleterEntry(url);
+}
+
+void LauncherWindow::showLinkHover(const QString &link, const QString &toolTip)
+{
+#ifndef Q_WS_MAEMO_5
+ statusBar()->showMessage(link);
+#endif
+#ifndef QT_NO_TOOLTIP
+ if (!toolTip.isEmpty())
+ QToolTip::showText(QCursor::pos(), toolTip);
+#endif
+}
+
+void LauncherWindow::zoomAnimationFinished()
+{
+ if (!isGraphicsBased())
+ return;
+ QGraphicsWebView* view = static_cast<WebViewGraphicsBased*>(m_view)->graphicsWebView();
+ view->setTiledBackingStoreFrozen(false);
+}
+
+void LauncherWindow::applyZoom()
+{
+ if (isGraphicsBased() && page()->settings()->testAttribute(QWebSettings::TiledBackingStoreEnabled)) {
+ QGraphicsWebView* view = static_cast<WebViewGraphicsBased*>(m_view)->graphicsWebView();
+ view->setTiledBackingStoreFrozen(true);
+ if (!m_zoomAnimation) {
+ m_zoomAnimation = new QPropertyAnimation(view, "scale");
+ m_zoomAnimation->setStartValue(view->scale());
+ connect(m_zoomAnimation, SIGNAL(finished()), this, SLOT(zoomAnimationFinished()));
+ } else {
+ m_zoomAnimation->stop();
+ m_zoomAnimation->setStartValue(m_zoomAnimation->currentValue());
+ }
+
+ m_zoomAnimation->setDuration(300);
+ m_zoomAnimation->setEndValue(qreal(m_currentZoom) / 100.);
+ m_zoomAnimation->start();
+ return;
+ }
+ page()->mainFrame()->setZoomFactor(qreal(m_currentZoom) / 100.0);
+}
+
+void LauncherWindow::zoomIn()
+{
+ int i = m_zoomLevels.indexOf(m_currentZoom);
+ Q_ASSERT(i >= 0);
+ if (i < m_zoomLevels.count() - 1)
+ m_currentZoom = m_zoomLevels[i + 1];
+
+ applyZoom();
+}
+
+void LauncherWindow::zoomOut()
+{
+ int i = m_zoomLevels.indexOf(m_currentZoom);
+ Q_ASSERT(i >= 0);
+ if (i > 0)
+ m_currentZoom = m_zoomLevels[i - 1];
+
+ applyZoom();
+}
+
+void LauncherWindow::resetZoom()
+{
+ m_currentZoom = 100;
+ applyZoom();
+}
+
+void LauncherWindow::toggleZoomTextOnly(bool b)
+{
+ page()->settings()->setAttribute(QWebSettings::ZoomTextOnly, b);
+}
+
+void LauncherWindow::print()
+{
+#if !defined(QT_NO_PRINTER)
+ QPrintPreviewDialog dlg(this);
+ connect(&dlg, SIGNAL(paintRequested(QPrinter*)),
+ page()->mainFrame(), SLOT(print(QPrinter*)));
+ dlg.exec();
+#endif
+}
+
+void LauncherWindow::screenshot()
+{
+ QPixmap pixmap = QPixmap::grabWidget(m_view);
+ QLabel* label = 0;
+#if !defined(Q_OS_SYMBIAN)
+ label = new QLabel;
+ label->setAttribute(Qt::WA_DeleteOnClose);
+ label->setWindowTitle("Screenshot - Preview");
+ label->setPixmap(pixmap);
+ label->show();
+#endif
+
+ QString fileName = QFileDialog::getSaveFileName(label, "Screenshot");
+ if (!fileName.isEmpty()) {
+ pixmap.save(fileName, "png");
+ if (label)
+ label->setWindowTitle(QString("Screenshot - Saved at %1").arg(fileName));
+ }
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+ toggleQGLWidgetViewport(m_windowOptions.useQGLWidgetViewport);
+#endif
+}
+
+void LauncherWindow::setEditable(bool on)
+{
+ page()->setContentEditable(on);
+ m_formatMenuAction->setVisible(on);
+}
+
+/*
+void LauncherWindow::dumpPlugins() {
+ QList<QWebPluginInfo> plugins = QWebSettings::pluginDatabase()->plugins();
+ foreach (const QWebPluginInfo plugin, plugins) {
+ qDebug() << "Plugin:" << plugin.name();
+ foreach (const QWebPluginInfo::MimeType mime, plugin.mimeTypes()) {
+ qDebug() << " " << mime.name;
+ }
+ }
+}
+*/
+
+void LauncherWindow::dumpHtml()
+{
+ qDebug() << "HTML: " << page()->mainFrame()->toHtml();
+}
+
+void LauncherWindow::selectElements()
+{
+ bool ok;
+ QString str = QInputDialog::getText(this, "Select elements", "Choose elements",
+ QLineEdit::Normal, "a", &ok);
+
+ if (ok && !str.isEmpty()) {
+ QWebElementCollection result = page()->mainFrame()->findAllElements(str);
+ foreach (QWebElement e, result)
+ e.setStyleProperty("background-color", "yellow");
+#ifndef Q_WS_MAEMO_5
+ statusBar()->showMessage(QString("%1 element(s) selected").arg(result.count()), 5000);
+#endif
+ }
+}
+
+void LauncherWindow::setTouchMocking(bool on)
+{
+ m_touchMocking = on;
+}
+
+void LauncherWindow::toggleWebView(bool graphicsBased)
+{
+ m_windowOptions.useGraphicsView = graphicsBased;
+ initializeView();
+ menuBar()->clear();
+ createChrome();
+}
+
+void LauncherWindow::toggleAcceleratedCompositing(bool toggle)
+{
+ m_windowOptions.useCompositing = toggle;
+ page()->settings()->setAttribute(QWebSettings::AcceleratedCompositingEnabled, toggle);
+}
+
+void LauncherWindow::toggleTiledBackingStore(bool toggle)
+{
+ page()->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, toggle);
+}
+
+void LauncherWindow::toggleResizesToContents(bool toggle)
+{
+ m_windowOptions.resizesToContents = toggle;
+ static_cast<WebViewGraphicsBased*>(m_view)->setResizesToContents(toggle);
+}
+
+void LauncherWindow::toggleWebGL(bool toggle)
+{
+ m_windowOptions.useWebGL = toggle;
+ page()->settings()->setAttribute(QWebSettings::WebGLEnabled, toggle);
+}
+
+void LauncherWindow::animatedFlip()
+{
+ qobject_cast<WebViewGraphicsBased*>(m_view)->animatedFlip();
+}
+
+void LauncherWindow::animatedYFlip()
+{
+ qobject_cast<WebViewGraphicsBased*>(m_view)->animatedYFlip();
+}
+void LauncherWindow::toggleSpatialNavigation(bool b)
+{
+ page()->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, b);
+}
+
+void LauncherWindow::toggleFullScreenMode(bool enable)
+{
+ if (enable)
+ setWindowState(Qt::WindowFullScreen);
+ else {
+#if defined(Q_OS_SYMBIAN)
+ setWindowState(Qt::WindowMaximized);
+#else
+ setWindowState(Qt::WindowNoState);
+#endif
+ }
+}
+
+void LauncherWindow::toggleFrameFlattening(bool toggle)
+{
+ m_windowOptions.useFrameFlattening = toggle;
+ page()->settings()->setAttribute(QWebSettings::FrameFlatteningEnabled, toggle);
+}
+
+void LauncherWindow::toggleInterruptingJavaScriptEnabled(bool enable)
+{
+ page()->setInterruptingJavaScriptEnabled(enable);
+}
+
+void LauncherWindow::toggleJavascriptCanOpenWindows(bool enable)
+{
+ page()->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, enable);
+}
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+void LauncherWindow::toggleQGLWidgetViewport(bool enable)
+{
+ if (!isGraphicsBased())
+ return;
+
+ m_windowOptions.useQGLWidgetViewport = enable;
+ WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+
+ view->setViewport(enable ? new QGLWidget() : 0);
+}
+#endif
+
+void LauncherWindow::changeViewportUpdateMode(int mode)
+{
+ m_windowOptions.viewportUpdateMode = QGraphicsView::ViewportUpdateMode(mode);
+
+ if (!isGraphicsBased())
+ return;
+
+ WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+ view->setViewportUpdateMode(m_windowOptions.viewportUpdateMode);
+}
+
+void LauncherWindow::showFPS(bool enable)
+{
+ if (!isGraphicsBased())
+ return;
+
+ m_windowOptions.showFrameRate = enable;
+ WebViewGraphicsBased* view = static_cast<WebViewGraphicsBased*>(m_view);
+ view->setFrameRateMeasurementEnabled(enable);
+
+ if (!enable) {
+#if defined(Q_WS_MAEMO_5) && defined(Q_OS_SYMBIAN)
+ setWindowTitle("");
+#else
+ statusBar()->clearMessage();
+#endif
+ }
+}
+
+void LauncherWindow::showUserAgentDialog()
+{
+ QStringList items;
+ QFile file(":/useragentlist.txt");
+ if (file.open(QIODevice::ReadOnly)) {
+ while (!file.atEnd())
+ items << file.readLine().trimmed();
+ file.close();
+ }
+
+ QSettings settings;
+ QString customUserAgent = settings.value("CustomUserAgent").toString();
+ if (!items.contains(customUserAgent) && !customUserAgent.isEmpty())
+ items << customUserAgent;
+
+ QDialog* dialog = new QDialog(this);
+ dialog->resize(size().width() * 0.7, dialog->size().height());
+ dialog->setMaximumHeight(dialog->size().height());
+ dialog->setWindowTitle("Change User Agent");
+
+ QVBoxLayout* layout = new QVBoxLayout(dialog);
+ dialog->setLayout(layout);
+
+ QComboBox* combo = new QComboBox(dialog);
+ combo->setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
+ combo->setEditable(true);
+ combo->insertItems(0, items);
+ layout->addWidget(combo);
+
+ int index = combo->findText(page()->userAgentForUrl(QUrl()));
+ combo->setCurrentIndex(index);
+
+ QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
+ | QDialogButtonBox::Cancel, Qt::Horizontal, dialog);
+ connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject()));
+ layout->addWidget(buttonBox);
+
+ if (dialog->exec() && !combo->currentText().isEmpty()) {
+ page()->setUserAgent(combo->currentText());
+ if (!items.contains(combo->currentText()))
+ settings.setValue("CustomUserAgent", combo->currentText());
+ }
+
+ delete dialog;
+}
+
+void LauncherWindow::updateFPS(int fps)
+{
+ QString fpsStatusText = QString("Current FPS: %1").arg(fps);
+
+#if defined(Q_WS_MAEMO_5) && defined(Q_OS_SYMBIAN)
+ setWindowTitle(fpsStatusText);
+#else
+ statusBar()->showMessage(fpsStatusText);
+#endif
+}
+
+LauncherWindow* LauncherWindow::newWindow()
+{
+ LauncherWindow* mw = new LauncherWindow(&m_windowOptions);
+ mw->show();
+ return mw;
+}
+
+LauncherWindow* LauncherWindow::cloneWindow()
+{
+ LauncherWindow* mw = new LauncherWindow(&m_windowOptions, qobject_cast<QGraphicsView*>(m_view)->scene());
+ mw->show();
+ return mw;
+}
+
diff --git a/WebKitTools/QtTestBrowser/launcherwindow.h b/WebKitTools/QtTestBrowser/launcherwindow.h
new file mode 100644
index 0000000..84dedaa
--- /dev/null
+++ b/WebKitTools/QtTestBrowser/launcherwindow.h
@@ -0,0 +1,206 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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.
+ */
+
+#ifndef launcherwindow_h
+#define launcherwindow_h
+
+#include <QtGui>
+#include <QtNetwork/QNetworkRequest>
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+#include <QtOpenGL/QGLWidget>
+#endif
+
+#if !defined(QT_NO_PRINTER)
+#include <QPrintPreviewDialog>
+#endif
+
+#ifndef QT_NO_UITOOLS
+#include <QtUiTools/QUiLoader>
+#endif
+
+#include <QDebug>
+
+#include <cstdio>
+#include <qevent.h>
+#include <qwebelement.h>
+#include <qwebframe.h>
+#include <qwebinspector.h>
+#include <qwebsettings.h>
+
+#ifdef Q_WS_MAEMO_5
+#include <qx11info_x11.h>
+#endif
+
+#include "mainwindow.h"
+#include "urlloader.h"
+#include "utils.h"
+#include "webinspector.h"
+#include "webpage.h"
+#include "webview.h"
+#include "../../WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h"
+
+#ifdef Q_WS_MAEMO_5
+#include <X11/Xatom.h>
+#include <X11/Xlib.h>
+#undef KeyPress
+#endif
+
+class WindowOptions {
+public:
+ WindowOptions()
+ : useGraphicsView(false)
+ , useCompositing(true)
+ , useTiledBackingStore(false)
+ , useWebGL(false)
+#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
+ , useFrameFlattening(true)
+#else
+ , useFrameFlattening(false)
+#endif
+ , cacheWebView(false)
+ , showFrameRate(false)
+ , resizesToContents(false)
+ , viewportUpdateMode(QGraphicsView::MinimalViewportUpdate)
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+ , useQGLWidgetViewport(false)
+#endif
+ {
+ }
+
+ bool useGraphicsView;
+ bool useCompositing;
+ bool useTiledBackingStore;
+ bool useWebGL;
+ bool useFrameFlattening;
+ bool cacheWebView;
+ bool showFrameRate;
+ bool resizesToContents;
+ QGraphicsView::ViewportUpdateMode viewportUpdateMode;
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+ bool useQGLWidgetViewport;
+#endif
+ QUrl inspectorUrl;
+ quint16 remoteInspectorPort;
+};
+
+class LauncherWindow : public MainWindow {
+ Q_OBJECT
+
+public:
+ LauncherWindow(WindowOptions* data = 0, QGraphicsScene* sharedScene = 0);
+ virtual ~LauncherWindow();
+
+ virtual void keyPressEvent(QKeyEvent* event);
+ void grabZoomKeys(bool grab);
+
+ void sendTouchEvent();
+
+ bool eventFilter(QObject* obj, QEvent* event);
+
+protected slots:
+ void loadStarted();
+ void loadFinished();
+
+ void showLinkHover(const QString &link, const QString &toolTip);
+
+ void zoomIn();
+ void zoomOut();
+ void resetZoom();
+ void toggleZoomTextOnly(bool on);
+ void zoomAnimationFinished();
+
+ void print();
+ void screenshot();
+
+ void setEditable(bool on);
+
+ /* void dumpPlugins() */
+ void dumpHtml();
+
+ void setTouchMocking(bool on);
+ void toggleWebView(bool graphicsBased);
+ void toggleAcceleratedCompositing(bool toggle);
+ void toggleTiledBackingStore(bool toggle);
+ void toggleResizesToContents(bool toggle);
+ void toggleWebGL(bool toggle);
+ void toggleSpatialNavigation(bool b);
+ void toggleFullScreenMode(bool enable);
+ void toggleFrameFlattening(bool toggle);
+ void toggleInterruptingJavaScriptEnabled(bool enable);
+ void toggleJavascriptCanOpenWindows(bool enable);
+
+#if defined(QT_CONFIGURED_WITH_OPENGL)
+ void toggleQGLWidgetViewport(bool enable);
+#endif
+
+ void changeViewportUpdateMode(int mode);
+ void animatedFlip();
+ void animatedYFlip();
+ void selectElements();
+ void showFPS(bool enable);
+ void showUserAgentDialog();
+
+public slots:
+ LauncherWindow* newWindow();
+ LauncherWindow* cloneWindow();
+ void updateFPS(int fps);
+
+signals:
+ void enteredFullScreenMode(bool on);
+
+private:
+ void init();
+ void initializeView();
+ void createChrome();
+ void applyPrefs();
+ void applyZoom();
+
+ bool isGraphicsBased() const;
+
+private:
+ static QVector<int> m_zoomLevels;
+ int m_currentZoom;
+
+ QWidget* m_view;
+ WebInspector* m_inspector;
+
+ WindowOptions m_windowOptions;
+
+ QAction* m_formatMenuAction;
+
+ QPropertyAnimation* m_zoomAnimation;
+ QList<QTouchEvent::TouchPoint> m_touchPoints;
+ bool m_touchMocking;
+};
+
+#endif
diff --git a/WebKitTools/QtLauncher/locationedit.cpp b/WebKitTools/QtTestBrowser/locationedit.cpp
index a97f148..a97f148 100644
--- a/WebKitTools/QtLauncher/locationedit.cpp
+++ b/WebKitTools/QtTestBrowser/locationedit.cpp
diff --git a/WebKitTools/QtLauncher/locationedit.h b/WebKitTools/QtTestBrowser/locationedit.h
index e82920c..e82920c 100644
--- a/WebKitTools/QtLauncher/locationedit.h
+++ b/WebKitTools/QtTestBrowser/locationedit.h
diff --git a/WebKitTools/QtTestBrowser/main.cpp b/WebKitTools/QtTestBrowser/main.cpp
new file mode 100644
index 0000000..41471fa
--- /dev/null
+++ b/WebKitTools/QtTestBrowser/main.cpp
@@ -0,0 +1,258 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "launcherwindow.h"
+#include "urlloader.h"
+
+WindowOptions windowOptions;
+
+int launcherMain(const QApplication& app)
+{
+#ifndef NDEBUG
+ int retVal = app.exec();
+ DumpRenderTreeSupportQt::garbageCollectorCollect();
+ QWebSettings::clearMemoryCaches();
+ return retVal;
+#else
+ return app.exec();
+#endif
+}
+
+class LauncherApplication : public QApplication {
+ Q_OBJECT
+
+public:
+ LauncherApplication(int& argc, char** argv);
+ QStringList urls() const { return m_urls; }
+ bool isRobotized() const { return m_isRobotized; }
+ int robotTimeout() const { return m_robotTimeoutSeconds; }
+ int robotExtraTime() const { return m_robotExtraTimeSeconds; }
+
+private:
+ void handleUserOptions();
+ void applyDefaultSettings();
+
+private:
+ bool m_isRobotized;
+ int m_robotTimeoutSeconds;
+ int m_robotExtraTimeSeconds;
+ QStringList m_urls;
+};
+
+void LauncherApplication::applyDefaultSettings()
+{
+ QWebSettings::setMaximumPagesInCache(4);
+
+ QWebSettings::setObjectCacheCapacities((16*1024*1024) / 8, (16*1024*1024) / 8, 16*1024*1024);
+
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::PluginsEnabled, true);
+ QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
+ QWebSettings::enablePersistentStorage();
+}
+
+LauncherApplication::LauncherApplication(int& argc, char** argv)
+ : QApplication(argc, argv, QApplication::GuiServer)
+ , m_isRobotized(false)
+ , m_robotTimeoutSeconds(0)
+ , m_robotExtraTimeSeconds(0)
+{
+ // To allow QWebInspector's configuration persistence
+ setOrganizationName("Nokia");
+ setApplicationName("QtTestBrowser");
+ setApplicationVersion("0.1");
+
+ applyDefaultSettings();
+
+ handleUserOptions();
+}
+
+static void requiresGraphicsView(const QString& option)
+{
+ if (windowOptions.useGraphicsView)
+ return;
+ appQuit(1, QString("%1 only works in combination with the -graphicsbased option").arg(option));
+}
+
+void LauncherApplication::handleUserOptions()
+{
+ QStringList args = arguments();
+ QFileInfo program(args.at(0));
+ QString programName("QtTestBrowser");
+ if (program.exists())
+ programName = program.baseName();
+
+ QList<QString> updateModes(enumToKeys(QGraphicsView::staticMetaObject,
+ "ViewportUpdateMode", "ViewportUpdate"));
+
+ if (args.contains("-help")) {
+ qDebug() << "Usage:" << programName.toLatin1().data()
+ << "[-graphicsbased]"
+ << "[-no-compositing]"
+ << QString("[-viewport-update-mode %1]").arg(formatKeys(updateModes)).toLatin1().data()
+ << "[-cache-webview]"
+ << "[-show-fps]"
+ << "[-r list]"
+ << "[-robot-timeout seconds]"
+ << "[-robot-extra-time seconds]"
+ << "[-inspector-url location]"
+ << "[-tiled-backing-store]"
+ << "[-resizes-to-contents]"
+ << "URLs";
+ appQuit(0);
+ }
+
+ const bool defaultForAnimations = args.contains("-default-animations");
+ if (args.contains("-graphicsbased") || defaultForAnimations)
+ windowOptions.useGraphicsView = true;
+
+ if (args.contains("-no-compositing")) {
+ requiresGraphicsView("-no-compositing");
+ windowOptions.useCompositing = false;
+ }
+
+ if (args.contains("-show-fps")) {
+ requiresGraphicsView("-show-fps");
+ windowOptions.showFrameRate = true;
+ }
+
+ if (args.contains("-cache-webview") || defaultForAnimations) {
+ requiresGraphicsView("-cache-webview");
+ windowOptions.cacheWebView = true;
+ }
+
+ if (args.contains("-tiled-backing-store")) {
+ requiresGraphicsView("-tiled-backing-store");
+ windowOptions.useTiledBackingStore = true;
+ }
+
+ if (args.contains("-resizes-to-contents")) {
+ requiresGraphicsView("-resizes-to-contents");
+ windowOptions.resizesToContents = true;
+ }
+
+ if (defaultForAnimations)
+ windowOptions.viewportUpdateMode = QGraphicsView::BoundingRectViewportUpdate;
+
+ QString arg1("-viewport-update-mode");
+ int modeIndex = args.indexOf(arg1);
+ if (modeIndex != -1) {
+ requiresGraphicsView(arg1);
+
+ QString mode = takeOptionValue(&args, modeIndex);
+ if (mode.isEmpty())
+ appQuit(1, QString("%1 needs a value of one of [%2]").arg(arg1).arg(formatKeys(updateModes)));
+ int idx = updateModes.indexOf(mode);
+ if (idx == -1)
+ appQuit(1, QString("%1 value has to be one of [%2]").arg(arg1).arg(formatKeys(updateModes)));
+
+ windowOptions.viewportUpdateMode = static_cast<QGraphicsView::ViewportUpdateMode>(idx);
+ }
+#ifdef QT_CONFIGURED_WITH_OPENGL
+ if (args.contains("-gl-viewport") || defaultForAnimations) {
+ requiresGraphicsView("-gl-viewport");
+ windowOptions.useQGLWidgetViewport = true;
+ }
+#endif
+
+ QString inspectorUrlArg("-inspector-url");
+ int inspectorUrlIndex = args.indexOf(inspectorUrlArg);
+ if (inspectorUrlIndex != -1)
+ windowOptions.inspectorUrl = takeOptionValue(&args, inspectorUrlIndex);
+
+ QString remoteInspectorPortArg("-remote-inspector-port");
+ int remoteInspectorPortIndex = args.indexOf(remoteInspectorPortArg);
+ if (remoteInspectorPortIndex != -1)
+ windowOptions.remoteInspectorPort = takeOptionValue(&args, remoteInspectorPortIndex).toInt();
+
+ int robotIndex = args.indexOf("-r");
+ if (robotIndex != -1) {
+ QString listFile = takeOptionValue(&args, robotIndex);
+ if (listFile.isEmpty())
+ appQuit(1, "-r needs a list file to start in robotized mode");
+ if (!QFile::exists(listFile))
+ appQuit(1, "The list file supplied to -r does not exist.");
+
+ m_isRobotized = true;
+ m_urls = QStringList(listFile);
+ } else {
+ int lastArg = args.lastIndexOf(QRegExp("^-.*"));
+ m_urls = (lastArg != -1) ? args.mid(++lastArg) : args.mid(1);
+ }
+
+ int robotTimeoutIndex = args.indexOf("-robot-timeout");
+ if (robotTimeoutIndex != -1)
+ m_robotTimeoutSeconds = takeOptionValue(&args, robotTimeoutIndex).toInt();
+
+ int robotExtraTimeIndex = args.indexOf("-robot-extra-time");
+ if (robotExtraTimeIndex != -1)
+ m_robotExtraTimeSeconds = takeOptionValue(&args, robotExtraTimeIndex).toInt();
+}
+
+
+int main(int argc, char **argv)
+{
+ LauncherApplication app(argc, argv);
+
+ if (app.isRobotized()) {
+ LauncherWindow* window = new LauncherWindow();
+ UrlLoader loader(window->page()->mainFrame(), app.urls().at(0), app.robotTimeout(), app.robotExtraTime());
+ loader.loadNext();
+ window->show();
+ return launcherMain(app);
+ }
+
+ QStringList urls = app.urls();
+
+ if (urls.isEmpty()) {
+ QString defaultIndexFile = QString("%1/%2").arg(QDir::homePath()).arg(QLatin1String("index.html"));
+ if (QFile(defaultIndexFile).exists())
+ urls.append(QString("file://") + defaultIndexFile);
+ else
+ urls.append("");
+ }
+
+ LauncherWindow* window = 0;
+ foreach (QString url, urls) {
+ LauncherWindow* newWindow;
+ if (!window)
+ newWindow = window = new LauncherWindow(&windowOptions);
+ else
+ newWindow = window->newWindow();
+
+ newWindow->load(url);
+ }
+
+ window->show();
+ return launcherMain(app);
+}
+
+#include "main.moc"
diff --git a/WebKitTools/QtLauncher/mainwindow.cpp b/WebKitTools/QtTestBrowser/mainwindow.cpp
index 47755ec..9854c4f 100644
--- a/WebKitTools/QtLauncher/mainwindow.cpp
+++ b/WebKitTools/QtTestBrowser/mainwindow.cpp
@@ -35,44 +35,53 @@
#include "locationedit.h"
#include "utils.h"
-MainWindow::MainWindow(const QString& url)
+MainWindow::MainWindow()
: m_page(new WebPage(this))
+ , m_toolBar(0)
+ , urlEdit(0)
{
setAttribute(Qt::WA_DeleteOnClose);
-#if QT_VERSION >= QT_VERSION_CHECK(4, 5, 0)
- if (qgetenv("QTLAUNCHER_USE_ARGB_VISUALS").toInt() == 1)
+ if (qgetenv("QTTESTBROWSER_USE_ARGB_VISUALS").toInt() == 1)
setAttribute(Qt::WA_TranslucentBackground);
-#endif
buildUI();
}
void MainWindow::buildUI()
{
- QToolBar* bar = addToolBar("Navigation");
-#if defined(Q_WS_S60)
- bar->setIconSize(QSize(16, 16));
+#if defined(Q_OS_SYMBIAN)
+ delete urlEdit;
+#endif
+ delete m_toolBar;
+
+ m_toolBar = addToolBar("Navigation");
+#if defined(Q_OS_SYMBIAN)
+ m_toolBar->setIconSize(QSize(16, 16));
#endif
- bar->addAction(page()->action(QWebPage::Back));
- bar->addAction(page()->action(QWebPage::Forward));
- bar->addAction(page()->action(QWebPage::Reload));
- bar->addAction(page()->action(QWebPage::Stop));
+ QAction* reloadAction = page()->action(QWebPage::Reload);
+ connect(reloadAction, SIGNAL(triggered()), this, SLOT(changeLocation()));
- urlEdit = new LocationEdit(this);
+ m_toolBar->addAction(page()->action(QWebPage::Back));
+ m_toolBar->addAction(page()->action(QWebPage::Forward));
+ m_toolBar->addAction(reloadAction);
+ m_toolBar->addAction(page()->action(QWebPage::Stop));
+
+ urlEdit = new LocationEdit(m_toolBar);
urlEdit->setSizePolicy(QSizePolicy::Expanding, urlEdit->sizePolicy().verticalPolicy());
connect(urlEdit, SIGNAL(returnPressed()), SLOT(changeLocation()));
- QCompleter* completer = new QCompleter(this);
+ QCompleter* completer = new QCompleter(m_toolBar);
urlEdit->setCompleter(completer);
completer->setModel(&urlModel);
-#if defined(Q_WS_S60)
+#if defined(Q_OS_SYMBIAN)
addToolBarBreak();
addToolBar("Location")->addWidget(urlEdit);
#else
- bar->addWidget(urlEdit);
+ m_toolBar->addWidget(urlEdit);
#endif
connect(page()->mainFrame(), SIGNAL(titleChanged(const QString&)),
this, SLOT(setWindowTitle(const QString&)));
+ connect(page()->mainFrame(), SIGNAL(urlChanged(QUrl)), this, SLOT(setAddressUrl(QUrl)));
connect(page(), SIGNAL(loadProgress(int)), urlEdit, SLOT(setProgress(int)));
connect(page(), SIGNAL(windowCloseRequested()), this, SLOT(close()));
@@ -92,14 +101,28 @@ void MainWindow::buildUI()
page()->action(QWebPage::ToggleUnderline)->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_U));
}
-WebPage* MainWindow::page()
+void MainWindow::setPage(WebPage* page)
+{
+ delete m_page;
+ m_page = page;
+
+ buildUI();
+}
+
+WebPage* MainWindow::page() const
{
return m_page;
}
+void MainWindow::setAddressUrl(const QUrl& url)
+{
+ setAddressUrl(url.toString(QUrl::RemoveUserInfo));
+}
+
void MainWindow::setAddressUrl(const QString& url)
{
- urlEdit->setText(url);
+ if (!url.contains("about:"))
+ urlEdit->setText(url);
}
void MainWindow::addCompleterEntry(const QUrl& url)
@@ -138,6 +161,13 @@ void MainWindow::load(const QUrl& url)
void MainWindow::changeLocation()
{
QString string = urlEdit->text();
+ QUrl mainFrameURL = page()->mainFrame()->url();
+
+ if (mainFrameURL.isValid() && string == mainFrameURL.toString()) {
+ page()->triggerAction(QWebPage::Reload);
+ return;
+ }
+
load(string);
}
@@ -157,3 +187,8 @@ void MainWindow::openFile()
}
}
+void MainWindow::openLocation()
+{
+ urlEdit->selectAll();
+ urlEdit->setFocus();
+}
diff --git a/WebKitTools/QtLauncher/mainwindow.h b/WebKitTools/QtTestBrowser/mainwindow.h
index 1a30a09..3a39d57 100644
--- a/WebKitTools/QtLauncher/mainwindow.h
+++ b/WebKitTools/QtTestBrowser/mainwindow.h
@@ -42,28 +42,31 @@ class MainWindow : public QMainWindow {
Q_OBJECT
public:
- MainWindow(const QString& url = QString());
+ MainWindow();
- void setAddressUrl(const QString& url);
void addCompleterEntry(const QUrl& url);
void load(const QString& url);
void load(const QUrl& url);
- WebPage* page();
+ WebPage* page() const;
+ void setPage(WebPage*);
protected slots:
+ void setAddressUrl(const QString& url);
+ void setAddressUrl(const QUrl& url);
void openFile();
+ void openLocation();
void changeLocation();
private:
void buildUI();
+ WebPage* m_page;
+ QToolBar* m_toolBar;
QStringListModel urlModel;
QStringList urlList;
LocationEdit* urlEdit;
-
- WebPage* m_page;
};
#endif
diff --git a/WebKitTools/QtLauncher/urlloader.cpp b/WebKitTools/QtTestBrowser/urlloader.cpp
index 630ead6..2ae722b 100644
--- a/WebKitTools/QtLauncher/urlloader.cpp
+++ b/WebKitTools/QtTestBrowser/urlloader.cpp
@@ -30,17 +30,43 @@
#include <QFile>
#include <QDebug>
+#include <QWebPage>
-UrlLoader::UrlLoader(QWebFrame* frame, const QString& inputFileName)
+UrlLoader::UrlLoader(QWebFrame* frame, const QString& inputFileName, int timeoutSeconds, int extraTimeSeconds)
: m_frame(frame)
, m_stdOut(stdout)
, m_loaded(0)
+ , m_numFramesLoading(0)
{
- init(inputFileName);
+ m_checkIfFinishedTimer.setInterval(200);
+ m_checkIfFinishedTimer.setSingleShot(true);
+ connect(&m_checkIfFinishedTimer, SIGNAL(timeout()), this, SLOT(checkIfFinished()));
+ // loadStarted and loadFinished on QWebPage is emitted for each frame/sub-frame
+ connect(m_frame->page(), SIGNAL(loadStarted()), this, SLOT(frameLoadStarted()));
+ connect(m_frame->page(), SIGNAL(loadFinished(bool)), this, SLOT(frameLoadFinished()));
+
+ if (timeoutSeconds) {
+ m_timeoutTimer.setInterval(timeoutSeconds * 1000);
+ m_timeoutTimer.setSingleShot(true);
+ connect(frame, SIGNAL(loadStarted()), &m_timeoutTimer, SLOT(start()));
+ connect(&m_timeoutTimer, SIGNAL(timeout()), this, SLOT(loadNext()));
+ }
+ if (extraTimeSeconds) {
+ m_extraTimeTimer.setInterval(extraTimeSeconds * 1000);
+ m_extraTimeTimer.setSingleShot(true);
+ connect(this, SIGNAL(pageLoadFinished()), &m_extraTimeTimer, SLOT(start()));
+ connect(&m_extraTimeTimer, SIGNAL(timeout()), this, SLOT(loadNext()));
+ } else
+ connect(this, SIGNAL(pageLoadFinished()), this, SLOT(loadNext()));
+ loadUrlList(inputFileName);
}
void UrlLoader::loadNext()
{
+ m_timeoutTimer.stop();
+ m_extraTimeTimer.stop();
+ m_checkIfFinishedTimer.stop();
+ m_numFramesLoading = 0;
QString qstr;
if (getUrl(qstr)) {
QUrl url(qstr, QUrl::StrictMode);
@@ -53,7 +79,28 @@ void UrlLoader::loadNext()
disconnect(m_frame, 0, this, 0);
}
-void UrlLoader::init(const QString& inputFileName)
+void UrlLoader::checkIfFinished()
+{
+ if (!m_numFramesLoading)
+ emit pageLoadFinished();
+}
+
+void UrlLoader::frameLoadStarted()
+{
+ ++m_numFramesLoading;
+ m_checkIfFinishedTimer.stop();
+}
+
+void UrlLoader::frameLoadFinished()
+{
+ Q_ASSERT(m_numFramesLoading > 0);
+ --m_numFramesLoading;
+ // Once our frame has finished loading, wait a moment to call loadNext for cases
+ // where a sub-frame starts loading or another frame is loaded through JavaScript.
+ m_checkIfFinishedTimer.start();
+}
+
+void UrlLoader::loadUrlList(const QString& inputFileName)
{
QFile inputFile(inputFileName);
if (inputFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
diff --git a/WebKitTools/QtLauncher/urlloader.h b/WebKitTools/QtTestBrowser/urlloader.h
index ed14adc..8ce24c0 100644
--- a/WebKitTools/QtLauncher/urlloader.h
+++ b/WebKitTools/QtTestBrowser/urlloader.h
@@ -32,19 +32,28 @@
#include "qwebframe.h"
#include <QTextStream>
+#include <QTimer>
#include <QVector>
class UrlLoader : public QObject {
Q_OBJECT
public:
- UrlLoader(QWebFrame* frame, const QString& inputFileName);
+ UrlLoader(QWebFrame* frame, const QString& inputFileName, int timeoutSeconds, int extraTimeSeconds);
public slots:
void loadNext();
+private slots:
+ void checkIfFinished();
+ void frameLoadStarted();
+ void frameLoadFinished();
+
+signals:
+ void pageLoadFinished();
+
private:
- void init(const QString& inputFileName);
+ void loadUrlList(const QString& inputFileName);
bool getUrl(QString& qstr);
private:
@@ -53,6 +62,10 @@ private:
QWebFrame* m_frame;
QTextStream m_stdOut;
int m_loaded;
+ QTimer m_timeoutTimer;
+ QTimer m_extraTimeTimer;
+ QTimer m_checkIfFinishedTimer;
+ int m_numFramesLoading;
};
#endif
diff --git a/WebKitTools/QtTestBrowser/useragentlist.txt b/WebKitTools/QtTestBrowser/useragentlist.txt
new file mode 100644
index 0000000..1c424d9
--- /dev/null
+++ b/WebKitTools/QtTestBrowser/useragentlist.txt
@@ -0,0 +1,10 @@
+Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/533.3 (KHTML, like Gecko) QtTestBrowser/0.1 Safari/533.3
+Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0; en-GB) AppleWebKit/533.3 (KHTML, like Gecko) QtTestBrowser/0.1 Mobile Safari/533.3
+Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8
+Mozilla/5.0 (Linux; U; Android 1.1; en-gb; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2
+Mozilla/5.0 (iPhone; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
+Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
+Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10
+Opera/9.25 (Windows NT 6.0; U; en)
+Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1b/20.2.014; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413
+Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
diff --git a/WebKitTools/QtLauncher/utils.cpp b/WebKitTools/QtTestBrowser/utils.cpp
index 2d45dd0..567c989 100644
--- a/WebKitTools/QtLauncher/utils.cpp
+++ b/WebKitTools/QtTestBrowser/utils.cpp
@@ -82,11 +82,7 @@ QUrl urlFromUserInput(const QString& string)
if (fi.exists() && fi.isRelative())
input = fi.absoluteFilePath();
-#if QT_VERSION >= QT_VERSION_CHECK(4, 6, 0)
return QUrl::fromUserInput(input);
-#else
- return QUrl(input);
-#endif
}
diff --git a/WebKitTools/QtLauncher/utils.h b/WebKitTools/QtTestBrowser/utils.h
index 9a16067..b67351e 100644
--- a/WebKitTools/QtLauncher/utils.h
+++ b/WebKitTools/QtTestBrowser/utils.h
@@ -28,10 +28,18 @@
#ifndef utils_h
#define utils_h
-#include <wtf/AlwaysInline.h>
-
#include <QtCore>
+#ifndef NO_RETURN
+#if defined(__CC_ARM) || defined(__ARMCC__)
+#define NO_RETURN __declspec(noreturn)
+#elif defined(__GNUC__)
+#define NO_RETURN __attribute((__noreturn__))
+#else
+#define NO_RETURN
+#endif
+#endif
+
// options handling
QString takeOptionValue(QStringList* arguments, int index);
QString formatKeys(QList<QString> keys);
diff --git a/WebKitTools/QtLauncher/webinspector.h b/WebKitTools/QtTestBrowser/webinspector.h
index d251c5c..5cc7f8a 100644
--- a/WebKitTools/QtLauncher/webinspector.h
+++ b/WebKitTools/QtTestBrowser/webinspector.h
@@ -35,7 +35,7 @@ class WebInspector : public QWebInspector {
Q_OBJECT
public:
- WebInspector(QWidget* parent) : QWebInspector(parent) {}
+ WebInspector(QWidget* parent = 0) : QWebInspector(parent) {}
signals:
void visibleChanged(bool nowVisible);
diff --git a/WebKitTools/QtLauncher/webpage.cpp b/WebKitTools/QtTestBrowser/webpage.cpp
index 2fe1306..114ed6c 100644
--- a/WebKitTools/QtLauncher/webpage.cpp
+++ b/WebKitTools/QtTestBrowser/webpage.cpp
@@ -32,15 +32,26 @@
#include "webpage.h"
+#include "launcherwindow.h"
+
+#include <QAuthenticator>
#include <QDesktopServices>
#include <QtGui>
+#include <QtNetwork/QNetworkReply>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkProxy>
WebPage::WebPage(QObject* parent)
: QWebPage(parent)
+ , m_userAgent()
+ , m_interruptingJavaScriptEnabled(false)
{
applyProxy();
+
+ connect(networkAccessManager(), SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
+ this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*)));
+ connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain)));
+ connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)));
}
void WebPage::applyProxy()
@@ -103,4 +114,91 @@ void WebPage::openUrlInDefaultBrowser(const QUrl& url)
QDesktopServices::openUrl(url);
}
+QString WebPage::userAgentForUrl(const QUrl& url) const
+{
+ if (!m_userAgent.isEmpty())
+ return m_userAgent;
+ return QWebPage::userAgentForUrl(url);
+}
+
+bool WebPage::shouldInterruptJavaScript()
+{
+ if (!m_interruptingJavaScriptEnabled)
+ return false;
+ return QWebPage::shouldInterruptJavaScript();
+}
+
+void WebPage::authenticationRequired(QNetworkReply* reply, QAuthenticator* authenticator)
+{
+ QDialog* dialog = new QDialog(QApplication::activeWindow());
+ dialog->setWindowTitle("HTTP Authentication");
+
+ QGridLayout* layout = new QGridLayout(dialog);
+ dialog->setLayout(layout);
+
+ QLabel* messageLabel = new QLabel(dialog);
+ messageLabel->setWordWrap(true);
+ QString messageStr = QString("Enter with username and password for: %1");
+ messageLabel->setText(messageStr.arg(reply->url().toString()));
+ layout->addWidget(messageLabel, 0, 1);
+
+ QLabel* userLabel = new QLabel("Username:", dialog);
+ layout->addWidget(userLabel, 1, 0);
+ QLineEdit* userInput = new QLineEdit(dialog);
+ layout->addWidget(userInput, 1, 1);
+
+ QLabel* passLabel = new QLabel("Password:", dialog);
+ layout->addWidget(passLabel, 2, 0);
+ QLineEdit* passInput = new QLineEdit(dialog);
+ passInput->setEchoMode(QLineEdit::Password);
+ layout->addWidget(passInput, 2, 1);
+
+ QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok
+ | QDialogButtonBox::Cancel, Qt::Horizontal, dialog);
+ connect(buttonBox, SIGNAL(accepted()), dialog, SLOT(accept()));
+ connect(buttonBox, SIGNAL(rejected()), dialog, SLOT(reject()));
+ layout->addWidget(buttonBox, 3, 1);
+
+ if (dialog->exec() == QDialog::Accepted) {
+ authenticator->setUser(userInput->text());
+ authenticator->setPassword(passInput->text());
+ }
+
+ delete dialog;
+}
+
+void WebPage::requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain)
+{
+ setUserPermission(frame, domain, PermissionGranted);
+}
+
+void WebPage::cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)
+{
+}
+
+QWebPage* WebPage::createWindow(QWebPage::WebWindowType type)
+{
+ LauncherWindow* mw = new LauncherWindow;
+ if (type == WebModalDialog)
+ mw->setWindowModality(Qt::ApplicationModal);
+ mw->show();
+ return mw->page();
+}
+
+QObject* WebPage::createPlugin(const QString &classId, const QUrl&, const QStringList&, const QStringList&)
+{
+ if (classId == "alien_QLabel") {
+ QLabel* l = new QLabel;
+ l->winId();
+ return l;
+ }
+
+#ifndef QT_NO_UITOOLS
+ QUiLoader loader;
+ return loader.createWidget(classId, view());
+#else
+ Q_UNUSED(classId);
+ return 0;
+#endif
+}
diff --git a/WebKitTools/QtLauncher/webpage.h b/WebKitTools/QtTestBrowser/webpage.h
index 14a0571..27198e5 100644
--- a/WebKitTools/QtLauncher/webpage.h
+++ b/WebKitTools/QtTestBrowser/webpage.h
@@ -49,11 +49,21 @@ public:
virtual bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type);
+ QString userAgentForUrl(const QUrl& url) const;
+ void setInterruptingJavaScriptEnabled(bool enabled) { m_interruptingJavaScriptEnabled = enabled; }
+
public slots:
void openUrlInDefaultBrowser(const QUrl& url = QUrl());
+ void setUserAgent(const QString& ua) { m_userAgent = ua; }
+ bool shouldInterruptJavaScript();
+ void authenticationRequired(QNetworkReply*, QAuthenticator*);
+ void requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
+ void cancelRequestsForPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
private:
void applyProxy();
+ QString m_userAgent;
+ bool m_interruptingJavaScriptEnabled;
};
#endif
diff --git a/WebKitTools/QtTestBrowser/webview.cpp b/WebKitTools/QtTestBrowser/webview.cpp
new file mode 100644
index 0000000..fffaf9c
--- /dev/null
+++ b/WebKitTools/QtTestBrowser/webview.cpp
@@ -0,0 +1,272 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Girish Ramakrishnan <girish@forwardbias.in>
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
+ *
+ * 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 COMPUTER, 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 COMPUTER, 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 "webview.h"
+
+#include <QtGui>
+#include <QGraphicsScene>
+
+WebViewGraphicsBased::WebViewGraphicsBased(QWidget* parent)
+ : QGraphicsView(parent)
+ , m_item(new GraphicsWebView)
+ , m_numPaintsTotal(0)
+ , m_numPaintsSinceLastMeasure(0)
+ , m_measureFps(false)
+ , m_resizesToContents(false)
+ , m_machine(0)
+{
+ setScene(new QGraphicsScene(this));
+ scene()->addItem(m_item);
+
+ setFrameShape(QFrame::NoFrame);
+ setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+
+ m_updateTimer = new QTimer(this);
+ m_updateTimer->setInterval(1000);
+ connect(m_updateTimer, SIGNAL(timeout()), this, SLOT(updateFrameRate()));
+}
+
+void WebViewGraphicsBased::setPage(QWebPage* page)
+{
+ connect(page->mainFrame(), SIGNAL(contentsSizeChanged(const QSize&)), SLOT(contentsSizeChanged(const QSize&)));
+ connect(page, SIGNAL(scrollRequested(int, int, const QRect&)), SLOT(scrollRequested(int, int)));
+ graphicsWebView()->setPage(page);
+}
+
+void WebViewGraphicsBased::scrollRequested(int x, int y)
+{
+ if (!m_resizesToContents)
+ return;
+
+ // Turn off interactive mode while scrolling, or QGraphicsView will replay the
+ // last mouse event which may cause WebKit to initiate a drag operation.
+ bool interactive = isInteractive();
+ setInteractive(false);
+
+ verticalScrollBar()->setValue(-y);
+ horizontalScrollBar()->setValue(-x);
+
+ setInteractive(interactive);
+}
+
+void WebViewGraphicsBased::contentsSizeChanged(const QSize& size)
+{
+ if (m_resizesToContents)
+ scene()->setSceneRect(0, 0, size.width(), size.height());
+}
+
+void WebViewGraphicsBased::setResizesToContents(bool b)
+{
+ if (b == m_resizesToContents)
+ return;
+
+ m_resizesToContents = b;
+ graphicsWebView()->setResizesToContents(m_resizesToContents);
+
+ // When setting resizesToContents ON, our web view widget will always size as big as the
+ // web content being displayed, and so will the QWebPage's viewport. It implies that internally
+ // WebCore will work as if there was no content rendered offscreen, and then no scrollbars need
+ // drawing. In order to keep scrolling working, we:
+ //
+ // 1) Set QGraphicsView's scrollbars policy back to 'auto'.
+ // 2) Set scene's boundaries rect to an invalid size, which automatically makes it to be as big
+ // as it needs to enclose all items onto it. We do that because QGraphicsView also calculates
+ // the size of its scrollable area according to the amount of content in scene that is rendered
+ // offscreen.
+ // 3) Set QWebPage's preferredContentsSize according to the size of QGraphicsView's viewport,
+ // so WebCore properly lays pages out.
+ //
+ // On the other hand, when toggling resizesToContents OFF, we set back the default values, as
+ // opposite as described above.
+ if (m_resizesToContents) {
+ setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+ graphicsWebView()->page()->setPreferredContentsSize(size());
+ QRectF itemRect(graphicsWebView()->geometry().topLeft(), graphicsWebView()->page()->mainFrame()->contentsSize());
+ graphicsWebView()->setGeometry(itemRect);
+ scene()->setSceneRect(itemRect);
+ } else {
+ setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ graphicsWebView()->page()->setPreferredContentsSize(QSize());
+ QRect viewportRect(QPoint(0, 0), size());
+ graphicsWebView()->setGeometry(viewportRect);
+ scene()->setSceneRect(viewportRect);
+ }
+}
+
+void WebViewGraphicsBased::resizeEvent(QResizeEvent* event)
+{
+ QGraphicsView::resizeEvent(event);
+
+ QSize size(event->size());
+
+ if (m_resizesToContents) {
+ graphicsWebView()->page()->setPreferredContentsSize(size);
+ return;
+ }
+
+ QRectF rect(QPoint(0, 0), size);
+ graphicsWebView()->setGeometry(rect);
+ scene()->setSceneRect(rect);
+}
+
+void WebViewGraphicsBased::setFrameRateMeasurementEnabled(bool enabled)
+{
+ m_measureFps = enabled;
+ if (m_measureFps) {
+ m_lastConsultTime = m_startTime = QTime::currentTime();
+ m_fpsTimer.start();
+ m_updateTimer->start();
+ } else {
+ m_fpsTimer.stop();
+ m_updateTimer->stop();
+ }
+}
+
+void WebViewGraphicsBased::updateFrameRate()
+{
+ const QTime now = QTime::currentTime();
+ int interval = m_lastConsultTime.msecsTo(now);
+ int frames = m_fpsTimer.numFrames(interval);
+ int current = interval ? frames * 1000 / interval : 0;
+
+ emit currentFPSUpdated(current);
+
+ m_lastConsultTime = now;
+}
+
+void WebViewGraphicsBased::animatedFlip()
+{
+ QSizeF center = graphicsWebView()->boundingRect().size() / 2;
+ QPointF centerPoint = QPointF(center.width(), center.height());
+ graphicsWebView()->setTransformOriginPoint(centerPoint);
+
+ QPropertyAnimation* animation = new QPropertyAnimation(graphicsWebView(), "rotation", this);
+ animation->setDuration(1000);
+
+ int rotation = int(graphicsWebView()->rotation());
+
+ animation->setStartValue(rotation);
+ animation->setEndValue(rotation + 180 - (rotation % 180));
+
+ animation->start(QAbstractAnimation::DeleteWhenStopped);
+}
+
+void WebViewGraphicsBased::animatedYFlip()
+{
+ if (!m_machine) {
+ m_machine = new QStateMachine(this);
+
+ QState* s0 = new QState(m_machine);
+ s0->assignProperty(this, "yRotation", 0);
+
+ QState* s1 = new QState(m_machine);
+ s1->assignProperty(this, "yRotation", 90);
+
+ QAbstractTransition* t1 = s0->addTransition(s1);
+ QPropertyAnimation* yRotationAnim = new QPropertyAnimation(this, "yRotation", this);
+ t1->addAnimation(yRotationAnim);
+
+ QState* s2 = new QState(m_machine);
+ s2->assignProperty(this, "yRotation", -90);
+ s1->addTransition(s1, SIGNAL(propertiesAssigned()), s2);
+
+ QState* s3 = new QState(m_machine);
+ s3->assignProperty(this, "yRotation", 0);
+
+ QAbstractTransition* t2 = s2->addTransition(s3);
+ t2->addAnimation(yRotationAnim);
+
+ QFinalState* final = new QFinalState(m_machine);
+ s3->addTransition(s3, SIGNAL(propertiesAssigned()), final);
+
+ m_machine->setInitialState(s0);
+ yRotationAnim->setDuration(1000);
+ }
+
+ m_machine->start();
+}
+
+void WebViewGraphicsBased::paintEvent(QPaintEvent* event)
+{
+ QGraphicsView::paintEvent(event);
+ if (!m_measureFps)
+ return;
+}
+
+static QMenu* createContextMenu(QWebPage* page, QPoint position)
+{
+ QMenu* menu = page->createStandardContextMenu();
+
+ QWebHitTestResult r = page->mainFrame()->hitTestContent(position);
+
+ if (!r.linkUrl().isEmpty()) {
+ WebPage* webPage = qobject_cast<WebPage*>(page);
+ QAction* newTabAction = menu->addAction("Open in Default &Browser", webPage, SLOT(openUrlInDefaultBrowser()));
+ newTabAction->setData(r.linkUrl());
+ menu->insertAction(menu->actions().at(2), newTabAction);
+ }
+ return menu;
+}
+
+void GraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* event)
+{
+ setProperty("mouseButtons", QVariant::fromValue(int(event->buttons())));
+ setProperty("keyboardModifiers", QVariant::fromValue(int(event->modifiers())));
+
+ QGraphicsWebView::mousePressEvent(event);
+}
+
+void WebViewTraditional::mousePressEvent(QMouseEvent* event)
+{
+ setProperty("mouseButtons", QVariant::fromValue(int(event->buttons())));
+ setProperty("keyboardModifiers", QVariant::fromValue(int(event->modifiers())));
+
+ QWebView::mousePressEvent(event);
+}
+
+void GraphicsWebView::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
+{
+ QMenu* menu = createContextMenu(page(), event->pos().toPoint());
+ menu->exec(event->screenPos());
+ delete menu;
+}
+
+void WebViewTraditional::contextMenuEvent(QContextMenuEvent* event)
+{
+ QMenu* menu = createContextMenu(page(), event->pos());
+ menu->exec(event->globalPos());
+ delete menu;
+}
+
diff --git a/WebKitTools/QtLauncher/webview.h b/WebKitTools/QtTestBrowser/webview.h
index 83bd801..240ea89 100644
--- a/WebKitTools/QtLauncher/webview.h
+++ b/WebKitTools/QtTestBrowser/webview.h
@@ -33,6 +33,7 @@
#ifndef webview_h
#define webview_h
+#include "fpstimer.h"
#include "webpage.h"
#include <qwebview.h>
#include <qgraphicswebview.h>
@@ -40,6 +41,8 @@
#include <QGraphicsWidget>
#include <QTime>
+class QStateMachine;
+
class WebViewTraditional : public QWebView {
Q_OBJECT
@@ -66,18 +69,38 @@ protected:
class WebViewGraphicsBased : public QGraphicsView {
Q_OBJECT
+ Q_PROPERTY(qreal yRotation READ yRotation WRITE setYRotation)
public:
WebViewGraphicsBased(QWidget* parent);
- virtual void resizeEvent(QResizeEvent*);
- void setPage(QWebPage* page) { m_item->setPage(page); }
- void setItemCacheMode(QGraphicsItem::CacheMode mode) { m_item->setCacheMode(mode); }
+ void setPage(QWebPage* page);
+
+ void setItemCacheMode(QGraphicsItem::CacheMode mode) { graphicsWebView()->setCacheMode(mode); }
+ QGraphicsItem::CacheMode itemCacheMode() { return graphicsWebView()->cacheMode(); }
- void enableFrameRateMeasurement();
+ void setFrameRateMeasurementEnabled(bool enabled);
+ bool frameRateMeasurementEnabled() const { return m_measureFps; }
+
+ virtual void resizeEvent(QResizeEvent*);
virtual void paintEvent(QPaintEvent* event);
+ void setResizesToContents(bool b);
+ bool resizesToContents() const { return m_resizesToContents; }
+
+ void setYRotation(qreal angle);
+ qreal yRotation() const { return m_yRotation; }
+
+ GraphicsWebView* graphicsWebView() const { return m_item; }
+
public slots:
void updateFrameRate();
+ void animatedFlip();
+ void animatedYFlip();
+ void contentsSizeChanged(const QSize&);
+ void scrollRequested(int, int);
+
+signals:
+ void currentFPSUpdated(int fps);
private:
GraphicsWebView* m_item;
@@ -85,7 +108,22 @@ private:
int m_numPaintsSinceLastMeasure;
QTime m_startTime;
QTime m_lastConsultTime;
+ QTimer* m_updateTimer;
bool m_measureFps;
+ qreal m_yRotation;
+ bool m_resizesToContents;
+ QStateMachine* m_machine;
+ FpsTimer m_fpsTimer;
};
+inline void WebViewGraphicsBased::setYRotation(qreal angle)
+{
+ QRectF r = graphicsWebView()->boundingRect();
+ graphicsWebView()->setTransform(QTransform()
+ .translate(r.width() / 2, r.height() / 2)
+ .rotate(angle, Qt::YAxis)
+ .translate(-r.width() / 2, -r.height() / 2));
+ m_yRotation = angle;
+}
+
#endif
diff --git a/WebKitTools/QueueStatusServer/__init__.py b/WebKitTools/QueueStatusServer/__init__.py
new file mode 100644
index 0000000..2346c23
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/__init__.py
@@ -0,0 +1,29 @@
+# Required for Python to search this directory for module files
+
+# This __init__.py makes unit testing easier by allowing us to treat the entire server as one big module.
+# This file is only accessed when not on AppEngine itself.
+
+# Make sure that this module will load in that case by including paths to
+# the default Google AppEngine install.
+
+
+def fix_sys_path():
+ import sys
+ import os
+
+ # AppEngine imports a bunch of google-specific modules. Thankfully the dev_appserver
+ # knows how to do the same. Re-use the dev_appserver fix_sys_path logic to import
+ # all the google.appengine.* stuff so we can run under test-webkitpy
+ sys.path.append("/usr/local/google_appengine")
+ import dev_appserver
+ dev_appserver.fix_sys_path()
+
+ # test-webkitpy adds $WEBKIT/WebKitTools to the sys.path and imports
+ # QueueStatusServer to run all the tests. However, when AppEngine runs
+ # our code QueueStatusServer is the root (and thus in the path).
+ # Emulate that here for test-webkitpy so that we can import "model."
+ # not "QueueStatusServer.model.", etc.
+ sys.path.append(os.path.dirname(__file__))
+
+
+fix_sys_path()
diff --git a/WebKitTools/QueueStatusServer/app.yaml b/WebKitTools/QueueStatusServer/app.yaml
index f6ff870..e320eb0 100644
--- a/WebKitTools/QueueStatusServer/app.yaml
+++ b/WebKitTools/QueueStatusServer/app.yaml
@@ -3,6 +3,10 @@ version: 1
runtime: python
api_version: 1
+builtins:
+- datastore_admin: on
+- remote_api: on
+
handlers:
- url: /stylesheets
static_dir: stylesheets
diff --git a/WebKitTools/QueueStatusServer/handlers/__init__.py b/WebKitTools/QueueStatusServer/handlers/__init__.py
index ef65bee..296e173 100644
--- a/WebKitTools/QueueStatusServer/handlers/__init__.py
+++ b/WebKitTools/QueueStatusServer/handlers/__init__.py
@@ -1 +1,3 @@
# Required for Python to search this directory for module files
+
+from handlers.updatebase import UpdateBase
diff --git a/WebKitTools/QueueStatusServer/handlers/dashboard.py b/WebKitTools/QueueStatusServer/handlers/dashboard.py
index 80f30ec..660c595 100644
--- a/WebKitTools/QueueStatusServer/handlers/dashboard.py
+++ b/WebKitTools/QueueStatusServer/handlers/dashboard.py
@@ -26,16 +26,39 @@
# (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 operator
+
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from model.attachment import Attachment
+from model.queues import Queue
+
class Dashboard(webapp.RequestHandler):
- def get(self):
- attachments = Attachment.recent(limit=25)
+ # We may want to sort these?
+ _ordered_queues = Queue.all()
+ _header_names = [queue.short_name() for queue in _ordered_queues]
+
+ def _build_bubble(self, attachment, queue):
+ queue_status = attachment.status_for_queue(queue)
+ bubble = {
+ "status_class": attachment.state_from_queue_status(queue_status) if queue_status else "none",
+ "status_date": queue_status.date if queue_status else None,
+ }
+ return bubble
+
+ def _build_row(self, attachment):
+ row = {
+ "bug_id": attachment.bug_id(),
+ "attachment_id": attachment.id,
+ "bubbles": [self._build_bubble(attachment, queue) for queue in self._ordered_queues],
+ }
+ return row
+ def get(self):
template_values = {
- "summaries" : [attachment.summary() for attachment in attachments],
+ "headers": self._header_names,
+ "rows": [self._build_row(attachment) for attachment in Attachment.recent(limit=25)],
}
self.response.out.write(template.render("templates/dashboard.html", template_values))
diff --git a/WebKitTools/QueueStatusServer/handlers/nextpatch.py b/WebKitTools/QueueStatusServer/handlers/nextpatch.py
new file mode 100644
index 0000000..5f6d71d
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/nextpatch.py
@@ -0,0 +1,59 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from datetime import datetime
+
+from google.appengine.ext import db
+from google.appengine.ext import webapp
+
+from model.queues import Queue
+
+
+class NextPatch(webapp.RequestHandler):
+ # FIXME: This should probably be a post, or an explict lock_patch
+ # since GET requests shouldn't really modify the datastore.
+ def get(self, queue_name):
+ queue = Queue.queue_with_name(queue_name)
+ if not queue:
+ self.error(404)
+ return
+ # FIXME: Patch assignment should probably move into Queue.
+ patch_id = db.run_in_transaction(self._assign_patch, queue.active_work_items().key(), queue.work_items().item_ids)
+ if not patch_id:
+ self.error(404)
+ return
+ self.response.out.write(patch_id)
+
+ @staticmethod
+ def _assign_patch(key, work_item_ids):
+ now = datetime.now()
+ active_work_items = db.get(key)
+ active_work_items.deactivate_expired(now)
+ next_item = active_work_items.next_item(work_item_ids, now)
+ active_work_items.put()
+ return next_item
diff --git a/WebKitTools/Scripts/webkitpy/steps/completerollout.py b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
index 8534956..54c0fdd 100644
--- a/WebKitTools/Scripts/webkitpy/steps/completerollout.py
+++ b/WebKitTools/QueueStatusServer/handlers/queuestatus.py
@@ -1,9 +1,9 @@
# Copyright (C) 2010 Google Inc. All rights reserved.
-#
+#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
-#
+#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
@@ -13,7 +13,7 @@
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
-#
+#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -26,41 +26,47 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.comments import bug_comment_from_commit_text
-from webkitpy.steps.build import Build
-from webkitpy.steps.commit import Commit
-from webkitpy.steps.metastep import MetaStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
+import itertools
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
-class CompleteRollout(MetaStep):
- substeps = [
- Build,
- Commit,
- ]
+from model.queues import Queue
+from model import queuestatus
- @classmethod
- def options(cls):
- collected_options = cls._collect_options_from_steps(cls.substeps)
- collected_options.append(Options.complete_rollout)
- return collected_options
- def run(self, state):
- bug_id = state["bug_id"]
- # FIXME: Fully automated rollout is not 100% idiot-proof yet, so for now just log with instructions on how to complete the rollout.
- # Once we trust rollout we will remove this option.
- if not self._options.complete_rollout:
- log("\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"webkit-patch land %s\" to commit the rollout." % bug_id)
- return
+class QueueStatus(webapp.RequestHandler):
+ def _rows_for_work_items(self, queue):
+ queued_items = queue.work_items()
+ active_items = queue.active_work_items()
+ if not queued_items:
+ return []
+ rows = []
+ for item_id in queued_items.item_ids:
+ rows.append({
+ "attachment_id": item_id,
+ "bug_id": 1,
+ "lock_time": active_items and active_items.time_for_item(item_id),
+ })
+ return rows
- MetaStep.run(self, state)
+ def _grouping_key_for_status(self, status):
+ return "%s-%s" % (status.active_patch_id, status.bot_id)
- commit_comment = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
- comment_text = "Reverted r%s for reason:\n\n%s\n\n%s" % (state["revision"], state["reason"], commit_comment)
+ def _build_status_groups(self, statuses):
+ return [list(group) for key, group in itertools.groupby(statuses, self._grouping_key_for_status)]
- if not bug_id:
- log(comment_text)
- log("No bugs were updated.")
+ def get(self, queue_name):
+ queue_name = queue_name.lower()
+ queue = Queue.queue_with_name(queue_name)
+ if not queue:
+ self.error(404)
return
- self._tool.bugs.reopen_bug(bug_id, comment_text)
+
+ statuses = queuestatus.QueueStatus.all().filter("queue_name =", queue.name()).order("-date").fetch(15)
+ template_values = {
+ "display_queue_name": queue.display_name(),
+ "work_item_rows": self._rows_for_work_items(queue),
+ "status_groups": self._build_status_groups(statuses),
+ }
+ self.response.out.write(template.render("templates/queuestatus.html", template_values))
diff --git a/WebKitTools/QueueStatusServer/handlers/queuestatus_unittest.py b/WebKitTools/QueueStatusServer/handlers/queuestatus_unittest.py
new file mode 100644
index 0000000..a5ae844
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/queuestatus_unittest.py
@@ -0,0 +1,62 @@
+# Copyright (C) 2010 Google, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Research in Motion Ltd. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from handlers.queuestatus import QueueStatus
+from model.queues import Queue
+
+
+class MockStatus(object):
+ def __init__(self, patch_id, bot_id):
+ self.active_patch_id = patch_id
+ self.bot_id = bot_id
+
+
+class QueueStatusTest(unittest.TestCase):
+ def test_build_status_groups(self):
+ queue_status = QueueStatus()
+ statuses = [
+ MockStatus(1, "foo"),
+ MockStatus(1, "foo"),
+ MockStatus(2, "foo"),
+ MockStatus(1, "foo"),
+ MockStatus(1, "bar"),
+ MockStatus(1, "foo"),
+ ]
+ groups = queue_status._build_status_groups(statuses)
+ self.assertEqual(len(groups), 5)
+ self.assertEqual(groups[0], statuses[0:2])
+ self.assertEqual(groups[1], statuses[2:3])
+ self.assertEqual(groups[2], statuses[3:4])
+ self.assertEqual(groups[3], statuses[4:5])
+ self.assertEqual(groups[4], statuses[5:6])
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/QueueStatusServer/handlers/recentstatus.py b/WebKitTools/QueueStatusServer/handlers/recentstatus.py
index d1df78c..fddc93a 100644
--- a/WebKitTools/QueueStatusServer/handlers/recentstatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/recentstatus.py
@@ -26,32 +26,69 @@
# (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 datetime
+
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
-from model.queues import queues
+from model.queues import Queue
from model.queuestatus import QueueStatus
+from model.workitems import WorkItems
+
+
+class QueueBubble(object):
+ """View support class for recentstatus.html"""
+ def __init__(self, queue):
+ self._queue = queue
+ self._work_items = queue.work_items()
+ self._last_status = QueueStatus.all().filter("queue_name =", queue.name()).order("-date").get()
+
+ # FIXME: name and display_name should be replaced by a .queue() accessor.
+ def name(self):
+ return self._queue.name()
+
+ def display_name(self):
+ return self._queue.display_name()
+
+ def _last_status_date(self):
+ if not self._last_status:
+ return None
+ return self._last_status.date
+
+ def last_heard_from(self):
+ if not self._work_items:
+ return self._last_status_date()
+ return max(self._last_status_date(), self._work_items.date)
+
+ def is_alive(self):
+ if not self.last_heard_from():
+ return False
+ return self.last_heard_from() > (datetime.datetime.now() - datetime.timedelta(minutes=30))
+
+ def status_class(self):
+ if not self.is_alive():
+ return "dead"
+ if self.pending_items_count() > 1:
+ return "behind"
+ return "alive"
+
+ def status_text(self):
+ if not self._work_items:
+ return "Offline"
+ if not self._work_items.item_ids:
+ return "Idle"
+ return self._last_status.message
+
+ def pending_items_count(self):
+ if not self._work_items:
+ return 0
+ return len(self._work_items.item_ids)
+
-class RecentStatus(webapp.RequestHandler):
- def _title_case(self, string):
- words = string.split(" ")
- words = map(lambda word: word.capitalize(), words)
- return " ".join(words)
-
- def _pretty_queue_name(self, queue_name):
- return self._title_case(queue_name.replace("-", " "))
-
- # We could change "/" to just redirect to /queue-status/commit-queue in the future
- # at which point we would not need a default value for queue_name here.
- def get(self, queue_name="commit-queue"):
- queue_status = {}
- for queue in queues:
- statuses = QueueStatus.all().filter("queue_name =", queue).order("-date").fetch(6)
- if not statuses:
- continue
- queue_status[queue] = statuses
+class QueuesOverview(webapp.RequestHandler):
+ def get(self):
template_values = {
- "queue_status" : queue_status,
+ "queues": [QueueBubble(queue) for queue in Queue.all()],
}
self.response.out.write(template.render("templates/recentstatus.html", template_values))
diff --git a/WebKitTools/QueueStatusServer/handlers/releasepatch.py b/WebKitTools/QueueStatusServer/handlers/releasepatch.py
new file mode 100644
index 0000000..0e46e69
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/releasepatch.py
@@ -0,0 +1,62 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.ext import webapp, db
+from google.appengine.ext.webapp import template
+
+from handlers.updatebase import UpdateBase
+from model.attachment import Attachment
+from model.queues import Queue
+
+
+class ReleasePatch(UpdateBase):
+ def get(self):
+ self.response.out.write(template.render("templates/releasepatch.html", None))
+
+ def post(self):
+ queue_name = self.request.get("queue_name")
+ # FIXME: This queue lookup should be shared between handlers.
+ queue = Queue.queue_with_name(queue_name)
+ if not queue:
+ self.error(404)
+ return
+
+ attachment_id = self._int_from_request("attachment_id")
+ attachment = Attachment(attachment_id)
+ last_status = attachment.status_for_queue(queue)
+
+ # Ideally we should use a transaction for the calls to
+ # WorkItems and ActiveWorkItems.
+
+ # Only remove it from the queue if the last message is not a retry request.
+ # Allow removing it from the queue even if there is no last_status for easier testing.
+ if not last_status or not last_status.is_retry_request():
+ queue.work_items().remove_work_item(attachment_id)
+
+ # Always release the lock on the item.
+ queue.active_work_items().expire_item(attachment_id)
diff --git a/WebKitTools/QueueStatusServer/handlers/statusbubble.py b/WebKitTools/QueueStatusServer/handlers/statusbubble.py
index d52509f..5690484 100644
--- a/WebKitTools/QueueStatusServer/handlers/statusbubble.py
+++ b/WebKitTools/QueueStatusServer/handlers/statusbubble.py
@@ -26,17 +26,34 @@
# (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 operator
+
from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from model.attachment import Attachment
+from model.workitems import WorkItems
+from model.queues import Queue
class StatusBubble(webapp.RequestHandler):
+ _queues_to_display = [queue for queue in Queue.all() if queue.is_ews()]
+
+ def _build_bubble(self, queue, attachment):
+ queue_status = attachment.status_for_queue(queue)
+ bubble = {
+ "name": queue.short_name().lower(),
+ "attachment_id": attachment.id,
+ "queue_position": attachment.position_in_queue(queue),
+ "state": attachment.state_from_queue_status(queue_status) if queue_status else "none",
+ "status": queue_status,
+ }
+ return bubble
+
def get(self, attachment_id):
attachment = Attachment(int(attachment_id))
-
+ bubbles = [self._build_bubble(queue, attachment) for queue in self._queues_to_display]
template_values = {
- "summary" : attachment.summary()
+ "bubbles": bubbles,
}
self.response.out.write(template.render("templates/statusbubble.html", template_values))
diff --git a/WebKitTools/Scripts/webkitpy/user_unittest.py b/WebKitTools/QueueStatusServer/handlers/statusbubble_unittest.py
index 34d9983..3ffbdaf 100644
--- a/WebKitTools/Scripts/webkitpy/user_unittest.py
+++ b/WebKitTools/QueueStatusServer/handlers/statusbubble_unittest.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2010 Research in Motion Ltd. All rights reserved.
+# Copyright (C) 2010 Google, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -27,27 +27,36 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import unittest
-from webkitpy.user import User
-
-class UserTest(unittest.TestCase):
-
- example_user_response = "example user response"
-
- def test_prompt_repeat(self):
- self.repeatsRemaining = 2
- def mock_raw_input(message):
- self.repeatsRemaining -= 1
- if not self.repeatsRemaining:
- return UserTest.example_user_response
- return None
- self.assertEqual(User.prompt("input", repeat=self.repeatsRemaining, raw_input=mock_raw_input), UserTest.example_user_response)
-
- def test_prompt_when_exceeded_repeats(self):
- self.repeatsRemaining = 2
- def mock_raw_input(message):
- self.repeatsRemaining -= 1
- return None
- self.assertEqual(User.prompt("input", repeat=self.repeatsRemaining, raw_input=mock_raw_input), None)
+
+
+from handlers.statusbubble import StatusBubble
+from model.queues import Queue
+
+
+class MockAttachment(object):
+ def __init__(self):
+ self.id = 1
+
+ def status_for_queue(self, queue):
+ return None
+
+ def position_in_queue(self, queue):
+ return 1
+
+
+class StatusBubbleTest(unittest.TestCase):
+ def test_build_bubble(self):
+ bubble = StatusBubble()
+ queue = Queue("mac-ews")
+ attachment = MockAttachment()
+ bubble_dict = bubble._build_bubble(queue, attachment)
+ # FIXME: assertDictEqual (in Python 2.7) would be better to use here.
+ self.assertEqual(bubble_dict["name"], "mac")
+ self.assertEqual(bubble_dict["attachment_id"], 1)
+ self.assertEqual(bubble_dict["queue_position"], 1)
+ self.assertEqual(bubble_dict["state"], "none")
+ self.assertEqual(bubble_dict["status"], None)
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/QueueStatusServer/handlers/submittoews.py b/WebKitTools/QueueStatusServer/handlers/submittoews.py
new file mode 100644
index 0000000..3ba4373
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/submittoews.py
@@ -0,0 +1,64 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.ext import webapp, db
+from google.appengine.ext.webapp import template
+
+from handlers.updatebase import UpdateBase
+from model.attachment import Attachment
+from model.queues import Queue
+
+
+class SubmitToEWS(UpdateBase):
+ def get(self):
+ self.response.out.write(template.render("templates/submittoews.html", None))
+
+ def _should_add_to_ews_queue(self, queue, attachment):
+ # This assert() is here to make sure we're not submitting to the commit-queue.
+ # The commit-queue clients check each patch anyway, but there is not sense
+ # in adding things to the commit-queue when they won't be processed by it.
+ assert(queue.is_ews())
+ latest_status = attachment.status_for_queue(queue)
+ if not latest_status:
+ return True
+ # Only ever re-submit to the EWS if the EWS specifically requested a retry.
+ # This allows us to restart the EWS feeder queue, without all r? patches
+ # being retried as a result of that restart!
+ # In some future version we might add a "force" button to allow the user
+ # to override this restriction.
+ return latest_status.is_retry_request()
+
+ def _add_attachment_to_ews_queues(self, attachment):
+ for queue in Queue.all_ews(): # all_ews() currently includes the style-queue
+ if self._should_add_to_ews_queue(queue, attachment):
+ queue.work_items().add_work_item(attachment.id)
+
+ def post(self):
+ attachment_id = self._int_from_request("attachment_id")
+ attachment = Attachment(attachment_id)
+ self._add_attachment_to_ews_queues(attachment)
diff --git a/WebKitTools/pywebsocket/example/echo_wsh.py b/WebKitTools/QueueStatusServer/handlers/svnrevision.py
index 50cad31..36eab33 100644
--- a/WebKitTools/pywebsocket/example/echo_wsh.py
+++ b/WebKitTools/QueueStatusServer/handlers/svnrevision.py
@@ -1,10 +1,9 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
+# Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
-#
+#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
@@ -14,7 +13,7 @@
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
-#
+#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -27,23 +26,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from google.appengine.ext import webapp
-from mod_pywebsocket import msgutil
-
-
-_GOODBYE_MESSAGE = 'Goodbye'
+import model
-def web_socket_do_extra_handshake(request):
- pass # Always accept.
-
-
-def web_socket_transfer_data(request):
- while True:
- line = msgutil.receive_message(request)
- msgutil.send_message(request, line)
- if line == _GOODBYE_MESSAGE:
+class SVNRevision(webapp.RequestHandler):
+ def get(self, svn_revision_number):
+ svn_revisions = model.SVNRevision.all().filter('number =', int(svn_revision_number)).order('-date').fetch(1)
+ if not svn_revisions:
+ self.error(404)
return
-
-
-# vi:sts=4 sw=4 et
+ self.response.out.write(svn_revisions[0].to_xml())
diff --git a/WebKitTools/QueueStatusServer/handlers/updatebase.py b/WebKitTools/QueueStatusServer/handlers/updatebase.py
new file mode 100644
index 0000000..b087e83
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/updatebase.py
@@ -0,0 +1,41 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.api import users
+from google.appengine.ext import webapp, db
+
+
+class UpdateBase(webapp.RequestHandler):
+ def _int_from_request(self, name):
+ string_value = self.request.get(name)
+ try:
+ int_value = int(string_value)
+ return int_value
+ except ValueError, TypeError:
+ pass
+ return None
diff --git a/WebKitTools/QueueStatusServer/handlers/updatestatus.py b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
index 3ad7b77..7301101 100644
--- a/WebKitTools/QueueStatusServer/handlers/updatestatus.py
+++ b/WebKitTools/QueueStatusServer/handlers/updatestatus.py
@@ -30,38 +30,37 @@ from google.appengine.api import users
from google.appengine.ext import webapp, db
from google.appengine.ext.webapp import template
+from handlers.updatebase import UpdateBase
from model.attachment import Attachment
from model.queuestatus import QueueStatus
-class UpdateStatus(webapp.RequestHandler):
+class UpdateStatus(UpdateBase):
def get(self):
self.response.out.write(template.render("templates/updatestatus.html", None))
- def _int_from_request(self, name):
- string_value = self.request.get(name)
- try:
- int_value = int(string_value)
- return int_value
- except ValueError, TypeError:
- pass
- return None
-
- def post(self):
+ def _queue_status_from_request(self):
queue_status = QueueStatus()
+ # FIXME: I think this can be removed, no one uses it.
if users.get_current_user():
queue_status.author = users.get_current_user()
bug_id = self._int_from_request("bug_id")
patch_id = self._int_from_request("patch_id")
queue_name = self.request.get("queue_name")
+ bot_id = self.request.get("bot_id")
queue_status.queue_name = queue_name
+ queue_status.bot_id = bot_id
queue_status.active_bug_id = bug_id
queue_status.active_patch_id = patch_id
queue_status.message = self.request.get("status")
results_file = self.request.get("results_file")
queue_status.results_file = db.Blob(str(results_file))
+ return queue_status
+
+ def post(self):
+ queue_status = self._queue_status_from_request()
queue_status.put()
- Attachment.dirty(patch_id)
+ Attachment.dirty(queue_status.active_patch_id)
self.response.out.write(queue_status.key().id())
diff --git a/WebKitTools/QueueStatusServer/handlers/updatesvnrevision.py b/WebKitTools/QueueStatusServer/handlers/updatesvnrevision.py
new file mode 100644
index 0000000..075982a
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/updatesvnrevision.py
@@ -0,0 +1,53 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.ext import webapp, db
+from google.appengine.ext.webapp import template
+
+import handlers
+import model
+
+
+class UpdateSVNRevision(handlers.UpdateBase):
+ def get(self):
+ self.response.out.write(template.render("templates/updatesvnrevision.html", None))
+
+ def post(self):
+ svn_revision_number = self._int_from_request("number")
+
+ svn_revisions = model.SVNRevision.all().filter('number =', svn_revision_number).order('-date').fetch(1)
+ svn_revision = None
+ if svn_revisions:
+ svn_revision = svn_revisions[0]
+ else:
+ svn_revision = model.SVNRevision()
+ svn_revision.number = svn_revision_number
+ svn_revision.broken_bots.append(self.request.get("broken_bot"))
+ svn_revision.put()
+
+ self.response.out.write(svn_revision.key().id())
diff --git a/WebKitTools/QueueStatusServer/handlers/updateworkitems.py b/WebKitTools/QueueStatusServer/handlers/updateworkitems.py
new file mode 100644
index 0000000..16a9d49
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/handlers/updateworkitems.py
@@ -0,0 +1,66 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.ext import webapp, db
+from google.appengine.ext.webapp import template
+
+from handlers.updatebase import UpdateBase
+from model.queues import Queue
+from model.workitems import WorkItems
+
+from datetime import datetime
+
+
+class UpdateWorkItems(UpdateBase):
+ def get(self):
+ self.response.out.write(template.render("templates/updateworkitems.html", None))
+
+ def _parse_work_items_string(self, items_string):
+ # Our parsing could be much more robust.
+ item_strings = items_string.split(" ") if items_string else []
+ return map(int, item_strings)
+
+ def _work_items_from_request(self):
+ queue_name = self.request.get("queue_name")
+ queue = Queue.queue_with_name(queue_name)
+ if not queue:
+ self.response.out.write("\"%s\" is not in queues %s" % (queue_name, Queue.all()))
+ return None
+
+ items_string = self.request.get("work_items")
+ work_items = queue.work_items()
+ work_items.item_ids = self._parse_work_items_string(items_string)
+ work_items.date = datetime.now()
+ return work_items
+
+ def post(self):
+ work_items = self._work_items_from_request()
+ if not work_items:
+ self.response.set_status(500)
+ return
+ work_items.put()
diff --git a/WebKitTools/QueueStatusServer/index.yaml b/WebKitTools/QueueStatusServer/index.yaml
index 60ba3df..6c9a3b2 100644
--- a/WebKitTools/QueueStatusServer/index.yaml
+++ b/WebKitTools/QueueStatusServer/index.yaml
@@ -27,4 +27,15 @@ indexes:
properties:
- name: queue_name
- name: date
+
+- kind: QueueStatus
+ properties:
+ - name: queue_name
+ - name: date
+ direction: desc
+
+- kind: SVNRevision
+ properties:
+ - name: number
+ - name: date
direction: desc
diff --git a/WebKitTools/QueueStatusServer/main.py b/WebKitTools/QueueStatusServer/main.py
index 8efc771..3fbee5c 100644
--- a/WebKitTools/QueueStatusServer/main.py
+++ b/WebKitTools/QueueStatusServer/main.py
@@ -35,25 +35,39 @@ from google.appengine.ext.webapp.util import run_wsgi_app
from handlers.dashboard import Dashboard
from handlers.gc import GC
+from handlers.nextpatch import NextPatch
from handlers.patch import Patch
from handlers.patchstatus import PatchStatus
-from handlers.recentstatus import RecentStatus
+from handlers.queuestatus import QueueStatus
+from handlers.recentstatus import QueuesOverview
+from handlers.releasepatch import ReleasePatch
from handlers.showresults import ShowResults
from handlers.statusbubble import StatusBubble
+from handlers.submittoews import SubmitToEWS
+from handlers.svnrevision import SVNRevision
from handlers.updatestatus import UpdateStatus
+from handlers.updatesvnrevision import UpdateSVNRevision
+from handlers.updateworkitems import UpdateWorkItems
+
webapp.template.register_template_library('filters.webkit_extras')
routes = [
- ('/', RecentStatus),
+ ('/', QueuesOverview),
('/dashboard', Dashboard),
('/gc', GC),
(r'/patch-status/(.*)/(.*)', PatchStatus),
(r'/patch/(.*)', Patch),
+ (r'/submit-to-ews', SubmitToEWS),
(r'/results/(.*)', ShowResults),
(r'/status-bubble/(.*)', StatusBubble),
- (r'/queue-status/(.*)', RecentStatus),
+ (r'/svn-revision/(.*)', SVNRevision),
+ (r'/queue-status/(.*)', QueueStatus),
+ (r'/next-patch/(.*)', NextPatch),
+ (r'/release-patch', ReleasePatch),
('/update-status', UpdateStatus),
+ ('/update-work-items', UpdateWorkItems),
+ ('/update-svn-revision', UpdateSVNRevision),
]
application = webapp.WSGIApplication(routes, debug=True)
diff --git a/WebKitTools/QueueStatusServer/model/__init__.py b/WebKitTools/QueueStatusServer/model/__init__.py
index ef65bee..1eaa044 100644
--- a/WebKitTools/QueueStatusServer/model/__init__.py
+++ b/WebKitTools/QueueStatusServer/model/__init__.py
@@ -1 +1,3 @@
# Required for Python to search this directory for module files
+
+from model.svnrevision import SVNRevision
diff --git a/WebKitTools/QueueStatusServer/model/activeworkitems.py b/WebKitTools/QueueStatusServer/model/activeworkitems.py
new file mode 100644
index 0000000..ab5d7a6
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/activeworkitems.py
@@ -0,0 +1,89 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.ext import db
+
+from datetime import timedelta, datetime
+import time
+
+from model.queuepropertymixin import QueuePropertyMixin
+
+
+class ActiveWorkItems(db.Model, QueuePropertyMixin):
+ queue_name = db.StringProperty()
+ item_ids = db.ListProperty(int)
+ item_dates = db.ListProperty(float)
+ date = db.DateTimeProperty(auto_now_add=True)
+
+ # The id/date pairs should probably just be their own class.
+ def _item_time_pairs(self):
+ return zip(self.item_ids, self.item_dates)
+
+ def _set_item_time_pairs(self, pairs):
+ if pairs:
+ # The * operator raises on an empty list.
+ # db.Model does not tuples, we have to make lists.
+ self.item_ids, self.item_dates = map(list, zip(*pairs))
+ else:
+ self.item_ids = []
+ self.item_dates = []
+
+ def _append_item_time_pair(self, pair):
+ self.item_ids.append(pair[0])
+ self.item_dates.append(pair[1])
+
+ def _remove_item(self, item_id):
+ nonexpired_pairs = [pair for pair in self._item_time_pairs() if pair[0] != item_id]
+ self._set_item_time_pairs(nonexpired_pairs)
+
+ @staticmethod
+ def _expire_item(key, item_id):
+ active_work_items = db.get(key)
+ active_work_items._remove_item(item_id)
+ active_work_items.put()
+
+ def expire_item(self, item_id):
+ return db.run_in_transaction(self._expire_item, self.key(), item_id)
+
+ def deactivate_expired(self, now):
+ one_hour_ago = time.mktime((now - timedelta(minutes=60)).timetuple())
+ nonexpired_pairs = [pair for pair in self._item_time_pairs() if pair[1] > one_hour_ago]
+ self._set_item_time_pairs(nonexpired_pairs)
+
+ def next_item(self, work_item_ids, now):
+ for item_id in work_item_ids:
+ if item_id not in self.item_ids:
+ self._append_item_time_pair([item_id, time.mktime(now.timetuple())])
+ return item_id
+ return None
+
+ def time_for_item(self, item_id):
+ for active_item_id, time in self._item_time_pairs():
+ if active_item_id == item_id:
+ return datetime.fromtimestamp(time)
+ return None
diff --git a/WebKitTools/QueueStatusServer/model/activeworkitems_unitest.py b/WebKitTools/QueueStatusServer/model/activeworkitems_unitest.py
new file mode 100644
index 0000000..6d915a1
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/activeworkitems_unitest.py
@@ -0,0 +1,52 @@
+# Copyright (C) 2010 Google, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Research in Motion Ltd. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+from datetime import datetime
+
+from model.activeworkitems import ActiveWorkItems
+
+
+class ActiveWorkItemsTest(unittest.TestCase):
+ def test_basic(self):
+ items = ActiveWorkItems()
+ queued_items = [1, 2]
+ time = datetime.now()
+ self.assertEqual(items.next_item(queued_items, time), 1)
+ self.assertEqual(items.next_item([1], time), None)
+ self.assertEqual(items.next_item([], time), None)
+
+ self.assertEqual(items.time_for_item(1), time)
+ self.assertEqual(items.time_for_item(2), None)
+
+ items.expire_item(1)
+ self.assertEqual(items.time_for_item(1), None)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/QueueStatusServer/model/attachment.py b/WebKitTools/QueueStatusServer/model/attachment.py
index 751f78e..f98f265 100644
--- a/WebKitTools/QueueStatusServer/model/attachment.py
+++ b/WebKitTools/QueueStatusServer/model/attachment.py
@@ -30,8 +30,9 @@ import re
from google.appengine.api import memcache
-from model.queues import queues
+from model.queues import Queue
from model.queuestatus import QueueStatus
+from model.workitems import WorkItems
class Attachment(object):
@@ -60,6 +61,7 @@ class Attachment(object):
def __init__(self, attachment_id):
self.id = attachment_id
self._summary = None
+ self._cached_queue_positions = None
def summary(self):
if self._summary:
@@ -71,11 +73,7 @@ class Attachment(object):
memcache.set(str(self.id), self._summary, namespace="attachment-summary")
return self._summary
- def _dash_to_underscore(self, dashed_name):
- regexp = re.compile("-")
- return regexp.sub("_", dashed_name)
-
- def _state_from_status(self, status):
+ def state_from_queue_status(self, status):
table = {
"Pass" : "pass",
"Fail" : "fail",
@@ -89,6 +87,31 @@ class Attachment(object):
return "pending"
return None
+ def position_in_queue(self, queue):
+ return self._queue_positions().get(queue.name())
+
+ def status_for_queue(self, queue):
+ # summary() is a horrible API and should be killed.
+ queue_summary = self.summary().get(queue.name_with_underscores())
+ if not queue_summary:
+ return None
+ return queue_summary.get("status")
+
+ def bug_id(self):
+ return self.summary().get("bug_id")
+
+ def _queue_positions(self):
+ if self._cached_queue_positions:
+ return self._cached_queue_positions
+ # FIXME: Should we be mem-caching this?
+ self._cached_queue_positions = self._calculate_queue_positions()
+ return self._cached_queue_positions
+
+ def _calculate_queue_positions(self):
+ all_work_items = WorkItems.all().fetch(limit=len(Queue.all()))
+ return dict([(items.queue.name(), items.display_position_for_attachment(self.id)) for items in all_work_items])
+
+ # FIXME: This is controller/view code and does not belong in a model.
def _fetch_summary(self):
summary = { "attachment_id" : self.id }
@@ -98,12 +121,13 @@ class Attachment(object):
return summary
summary["bug_id"] = first_status.active_bug_id
- for queue in queues:
- summary[queue] = None
- status = QueueStatus.all().filter('queue_name =', queue).filter('active_patch_id =', self.id).order('-date').get()
+ for queue in Queue.all():
+ summary[queue.name_with_underscores()] = None
+ status = QueueStatus.all().filter('queue_name =', queue.name()).filter('active_patch_id =', self.id).order('-date').get()
if status:
- summary[self._dash_to_underscore(queue)] = {
- "state" : self._state_from_status(status),
- "status" : status,
+ # summary() is a horrible API and should be killed.
+ summary[queue.name_with_underscores()] = {
+ "state": self.state_from_queue_status(status),
+ "status": status,
}
return summary
diff --git a/WebKitTools/QueueStatusServer/model/queuepropertymixin.py b/WebKitTools/QueueStatusServer/model/queuepropertymixin.py
new file mode 100644
index 0000000..a462586
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/queuepropertymixin.py
@@ -0,0 +1,39 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+class QueuePropertyMixin(object):
+ def _queue_getter(self):
+ # Import at runtime to avoid circular imports
+ from model.queues import Queue
+ return Queue.queue_with_name(self.queue_name)
+
+ def _queue_setter(self, queue):
+ self.queue_name = queue.name() if queue else None
+
+ queue = property(_queue_getter, _queue_setter)
diff --git a/WebKitTools/QueueStatusServer/model/queuepropertymixin_unittest.py b/WebKitTools/QueueStatusServer/model/queuepropertymixin_unittest.py
new file mode 100644
index 0000000..9a301fe
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/queuepropertymixin_unittest.py
@@ -0,0 +1,52 @@
+# Copyright (C) 2010 Google, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Research in Motion Ltd. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from model.queuepropertymixin import QueuePropertyMixin
+from model.queues import Queue
+
+
+class ObjectWithQueueName(QueuePropertyMixin):
+ def __init__(self):
+ self.queue_name = None
+
+
+class QueuePropertyMixinTest(unittest.TestCase):
+ def test_queue_property(self):
+ test_object = ObjectWithQueueName()
+ mac_ews = Queue("mac-ews")
+ test_object.queue = mac_ews
+ self.assertEquals(test_object.queue.name(), "mac-ews")
+ self.assertEquals(test_object.queue_name, "mac-ews")
+ test_object.queue = None
+ self.assertEquals(test_object.queue_name, None)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/QueueStatusServer/model/queues.py b/WebKitTools/QueueStatusServer/model/queues.py
index 8d48aff..1d46f89 100644
--- a/WebKitTools/QueueStatusServer/model/queues.py
+++ b/WebKitTools/QueueStatusServer/model/queues.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -26,11 +26,88 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-queues = [
- "style-queue",
- "chromium-ews",
- "qt-ews",
- "mac-ews",
- "gtk-ews",
- "commit-queue",
-]
+
+import re
+
+from model.activeworkitems import ActiveWorkItems
+from model.workitems import WorkItems
+
+
+class Queue(object):
+
+ # Eventually the list of queues may be stored in the data store.
+ _all_queue_names = [
+ "commit-queue",
+ "style-queue",
+ "chromium-ews",
+ "qt-ews",
+ "gtk-ews",
+ "mac-ews",
+ "win-ews",
+ "efl-ews",
+ "cr-mac-ews",
+ ]
+
+ def __init__(self, name):
+ assert(name in self._all_queue_names)
+ self._name = name
+
+ @classmethod
+ def queue_with_name(cls, queue_name):
+ if queue_name not in cls._all_queue_names:
+ return None
+ return Queue(queue_name)
+
+ @classmethod
+ def all(cls):
+ return [Queue(name) for name in cls._all_queue_names]
+
+ @classmethod
+ def all_ews(cls):
+ return [queue for queue in cls.all() if queue.is_ews()]
+
+ def name(self):
+ return self._name
+
+ def work_items(self):
+ key_name = "work-items-%s" % (self._name)
+ return WorkItems.get_or_insert(key_name=key_name, queue_name=self._name)
+
+ # FIXME: active_work_items is a bad name for this lock-table.
+ def active_work_items(self):
+ key_name = "active-work-items-%s" % (self._name)
+ return ActiveWorkItems.get_or_insert(key_name=key_name, queue_name=self._name)
+
+ def _caplitalize_after_dash(self, string):
+ return "-".join([word[0].upper() + word[1:] for word in string.split("-")])
+
+ # For use in status bubbles or table headers
+ def short_name(self):
+ # HACK: chromium-ews is incorrectly named.
+ short_name = self._name.replace("chromium-ews", "Cr-Linux-ews")
+ short_name = short_name.replace("-ews", "")
+ short_name = short_name.replace("-queue", "")
+ return self._caplitalize_after_dash(short_name.capitalize())
+
+ def display_name(self):
+ # HACK: chromium-ews is incorrectly named.
+ display_name = self._name.replace("chromium-ews", "cr-linux-ews")
+
+ display_name = display_name.replace("-", " ")
+ display_name = display_name.replace("cr", "chromium")
+ display_name = display_name.title()
+ display_name = display_name.replace("Ews", "EWS")
+ return display_name
+
+ _dash_regexp = re.compile("-")
+
+ def name_with_underscores(self):
+ return self._dash_regexp.sub("_", self._name)
+
+ def is_ews(self):
+ # Note: The style-queue is just like an EWS in that it has an EWS
+ # bubble, and it works off of the r? patches. If at some later
+ # point code wants to not treat the style-queue as an EWS
+ # (e.g. expecting is_ews() queues to have build results?)
+ # then we should fix all callers and change this check.
+ return self._name.endswith("-ews") or self._name == "style-queue"
diff --git a/WebKitTools/QueueStatusServer/model/queues_unittest.py b/WebKitTools/QueueStatusServer/model/queues_unittest.py
new file mode 100644
index 0000000..cfa7fcd
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/queues_unittest.py
@@ -0,0 +1,80 @@
+# Copyright (C) 2010 Google, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Research in Motion Ltd. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+
+from model.queues import Queue
+
+
+class QueueTest(unittest.TestCase):
+ def test_is_ews(self):
+ mac_ews = Queue("mac-ews")
+ self.assertTrue(mac_ews.is_ews())
+
+ def test_queue_with_name(self):
+ self.assertEqual(Queue.queue_with_name("bogus"), None)
+ self.assertEqual(Queue.queue_with_name("mac-ews").name(), "mac-ews")
+ self.assertRaises(AssertionError, Queue, ("bogus"))
+
+ def _assert_short_name(self, queue_name, short_name):
+ self.assertEquals(Queue(queue_name).short_name(), short_name)
+
+ def test_short_name(self):
+ self._assert_short_name("mac-ews", "Mac")
+ self._assert_short_name("chromium-ews", "Cr-Linux")
+ self._assert_short_name("commit-queue", "Commit")
+ self._assert_short_name("style-queue", "Style")
+
+ def _assert_display_name(self, queue_name, short_name):
+ self.assertEquals(Queue(queue_name).display_name(), short_name)
+
+ def test_display_name(self):
+ self._assert_display_name("mac-ews", "Mac EWS")
+ self._assert_display_name("chromium-ews", "Chromium Linux EWS")
+ self._assert_display_name("commit-queue", "Commit Queue")
+ self._assert_display_name("style-queue", "Style Queue")
+
+ def _assert_name_with_underscores(self, queue_name, short_name):
+ self.assertEquals(Queue(queue_name).name_with_underscores(), short_name)
+
+ def test_name_with_underscores(self):
+ self._assert_name_with_underscores("mac-ews", "mac_ews")
+ self._assert_name_with_underscores("chromium-ews", "chromium_ews")
+ self._assert_name_with_underscores("commit-queue", "commit_queue")
+
+ def test_style_queue_is_ews(self):
+ # For now we treat the style-queue as an EWS since most users would
+ # describe it as such. If is_ews() ever needs to mean "builds the patch"
+ # or similar, then we will need to adjust all callers.
+ self.assertTrue(Queue("style-queue").is_ews())
+ self.assertTrue("style-queue" in map(Queue.name, Queue.all_ews()))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/QueueStatusServer/model/queuestatus.py b/WebKitTools/QueueStatusServer/model/queuestatus.py
index 3d7e599..8002f89 100644
--- a/WebKitTools/QueueStatusServer/model/queuestatus.py
+++ b/WebKitTools/QueueStatusServer/model/queuestatus.py
@@ -27,12 +27,18 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from google.appengine.ext import db
+from model.queuepropertymixin import QueuePropertyMixin
-class QueueStatus(db.Model):
+
+class QueueStatus(db.Model, QueuePropertyMixin):
author = db.UserProperty()
queue_name = db.StringProperty()
+ bot_id = db.StringProperty()
active_bug_id = db.IntegerProperty()
active_patch_id = db.IntegerProperty()
message = db.StringProperty(multiline=True)
date = db.DateTimeProperty(auto_now_add=True)
results_file = db.BlobProperty()
+
+ def is_retry_request(self):
+ return self.message == "Retry" # From AbstractQueue._retry_status
diff --git a/WebKitTools/QueueStatusServer/model/svnrevision.py b/WebKitTools/QueueStatusServer/model/svnrevision.py
new file mode 100644
index 0000000..f5d3644
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/svnrevision.py
@@ -0,0 +1,35 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.ext import db
+
+
+class SVNRevision(db.Model):
+ number = db.IntegerProperty()
+ broken_bots = db.StringListProperty(default=[])
+ date = db.DateTimeProperty(auto_now_add=True)
diff --git a/WebKitTools/QueueStatusServer/model/workitems.py b/WebKitTools/QueueStatusServer/model/workitems.py
new file mode 100644
index 0000000..772fc39
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/workitems.py
@@ -0,0 +1,69 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.ext import db
+
+from model.queuepropertymixin import QueuePropertyMixin
+
+
+class WorkItems(db.Model, QueuePropertyMixin):
+ queue_name = db.StringProperty()
+ item_ids = db.ListProperty(int)
+ date = db.DateTimeProperty(auto_now_add=True)
+
+ def display_position_for_attachment(self, attachment_id):
+ """Returns a 1-based index corresponding to the position
+ of the attachment_id in the queue. If the attachment is
+ not in this queue, this returns None"""
+ if attachment_id in self.item_ids:
+ return self.item_ids.index(attachment_id) + 1
+ return None
+
+ @staticmethod
+ def _unguarded_add(key, attachment_id):
+ work_items = db.get(key)
+ if attachment_id in work_items.item_ids:
+ return
+ work_items.item_ids.append(attachment_id)
+ work_items.put()
+
+ # Because this uses .key() self.is_saved() must be True or this will throw NotSavedError.
+ def add_work_item(self, attachment_id):
+ db.run_in_transaction(self._unguarded_add, self.key(), attachment_id)
+
+ @staticmethod
+ def _unguarded_remove(key, attachment_id):
+ work_items = db.get(key)
+ if attachment_id in work_items.item_ids:
+ # We should never have more than one entry for a work item, so we only need remove the first.
+ work_items.item_ids.remove(attachment_id)
+ work_items.put()
+
+ # Because this uses .key() self.is_saved() must be True or this will throw NotSavedError.
+ def remove_work_item(self, attachment_id):
+ db.run_in_transaction(self._unguarded_remove, self.key(), attachment_id)
diff --git a/WebKitTools/QueueStatusServer/model/workitems_unittest.py b/WebKitTools/QueueStatusServer/model/workitems_unittest.py
new file mode 100644
index 0000000..b1ff1d3
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/model/workitems_unittest.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2010 Google, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Research in Motion Ltd. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+
+from model.workitems import WorkItems
+
+
+class WorkItemsTest(unittest.TestCase):
+ def test_display_position_for_attachment(self):
+ items = WorkItems()
+ items.item_ids = [0, 1, 2]
+ self.assertEquals(items.display_position_for_attachment(0), 1)
+ self.assertEquals(items.display_position_for_attachment(1), 2)
+ self.assertEquals(items.display_position_for_attachment(3), None)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/QueueStatusServer/stylesheets/dashboard.css b/WebKitTools/QueueStatusServer/stylesheets/dashboard.css
index 1ecf2eb..7b4f857 100644
--- a/WebKitTools/QueueStatusServer/stylesheets/dashboard.css
+++ b/WebKitTools/QueueStatusServer/stylesheets/dashboard.css
@@ -44,36 +44,59 @@ td {
tr:hover, li:hover {
background-color: #EEE;
}
+
+.status-group {
+ font-size: 90%;
+}
+
+.status-bug {
+ font-weight: bold;
+}
+
+.status-group ul {
+ font-size: 90%;
+}
+
+.status-group ul li {
+ padding: 2px 0 2px 7px;
+ overflow: hidden;
+}
+
+.status-group ul li:hover {
+ background: #ddd;
+}
+
.status-date {
color: #AAA;
float: right;
font-size: 8pt;
}
-.status {
+
+.status-cell {
margin: 1px;
padding: 1px 2px;
font-size: 9pt;
border: 1px solid transparent;
}
-.status:hover {
+.status-cell:hover {
border: 1px solid black;
}
-.pass {
+.status-cell.pass {
background-color: #8FDF5F;
cursor: pointer;
/* border: 1px solid #4F8530; */
}
-.fail {
+.status-cell.fail {
background-color: #E98080;
cursor: pointer;
/* border: 1px solid #A77272; */
}
-.pending {
+.status-cell.pending {
background-color: #FFFC6C;
cursor: pointer;
/* border: 1px solid #C5C56D; */
}
-.error {
+.status-cell.error {
background-color: #E0B0FF;
cursor: pointer;
/* border: 1px solid #ACA0B3; */
diff --git a/WebKitTools/QueueStatusServer/templates/dashboard.html b/WebKitTools/QueueStatusServer/templates/dashboard.html
index 84ecabb..f88a5ea 100644
--- a/WebKitTools/QueueStatusServer/templates/dashboard.html
+++ b/WebKitTools/QueueStatusServer/templates/dashboard.html
@@ -17,47 +17,27 @@ function statusDetail(patch_id) {
<tr>
<th>Bug</th>
<th>Attachment</th>
- <th>Style</th>
- <th>Chromium</th>
- <th>Qt</th>
- <th>Mac</th>
- <th>Gtk</th>
- <th>Commit</th>
+ {% for header in headers %}
+ <th>{{ header }}</th>
+ {% endfor %}
</tr>
</thead>
- <tbody>{% for summary in summaries %}
+ <tbody>{% for row in rows %}
<tr>
- <td class="status">
- {{ summary.bug_id|force_escape|webkit_bug_id|safe }}
+ <td class="status-cell">
+ {{ row.bug_id|force_escape|webkit_bug_id|safe }}
</td>
- <td class="status">
- {{ summary.attachment_id|force_escape|webkit_attachment_id|safe }}
+ <td class="status-cell">
+ {{ row.attachment_id|force_escape|webkit_attachment_id|safe }}
</td>
- <!-- FIXME: Find some way to remove this copy-and-paste code! -->
- <td class="status {{ summary.style_queue.state }}"{% if summary.style_queue.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.style_queue.status.date|timesince }}"{% endif %}>
- </td>
- <td class="status {{ summary.chromium_ews.state }}"{% if summary.chromium_ews.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.chromium_ews.status.date|timesince }} ago"{% endif %}>
- </td>
- <td class="status {{ summary.qt_ews.state }}"{% if summary.qt_ews.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.qt_ews.status.date|timesince }} ago"{% endif %}>
- </td>
- <td class="status {{ summary.mac_ews.state }}"{% if summary.mac_ews.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.mac_ews.status.date|timesince }} ago"{% endif %}>
- </td>
- <td class="status {{ summary.gtk_ews.state }}"{% if summary.gtk_ews.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.gtk_ews.status.date|timesince }} ago"{% endif %}>
- </td>
- <td class="status {{ summary.commit_queue.state }}"{% if summary.commit_queue.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.commit_queue.status.date|timesince }} ago"{% endif %}>
+ {% for bubble in row.bubbles %}
+ <td class="status-cell {{ bubble.status_class }}"
+ {% if bubble.status %}
+ onclick="statusDetail({{ row.attachment_id }})"
+ title="{{ bubble.status_date|timesince }}"
+ {% endif %}>
</td>
+ {% endfor %}
</tr>{% endfor %}
</tbody>
</table>
diff --git a/WebKitTools/QueueStatusServer/templates/includes/singlequeuestatus.html b/WebKitTools/QueueStatusServer/templates/includes/singlequeuestatus.html
new file mode 100644
index 0000000..0adbfbd
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/templates/includes/singlequeuestatus.html
@@ -0,0 +1,9 @@
+<span class="status-date">{{ status.date|timesince }} ago
+{% if status.bot_id %}
+({{ status.bot_id }})
+{% endif %}
+</span>
+<span class="status-message">{{ status.message|force_escape|urlize|webkit_linkify|safe }}</span>
+{% if status.results_file %}
+ <span class="status-results">[{{ status.key.id|results_link|safe }}]</span>
+{% endif %}
diff --git a/WebKitTools/QueueStatusServer/templates/queuestatus.html b/WebKitTools/QueueStatusServer/templates/queuestatus.html
new file mode 100644
index 0000000..1b98952
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/templates/queuestatus.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>{{ display_queue_name }} Status</title>
+<link type="text/css" rel="stylesheet" href="/stylesheets/dashboard.css" />
+</head>
+<body>
+<h1>{{ display_queue_name }} Status</h1>
+
+<h3>Recent Status</h3>
+
+<div class="status-details">
+ <ul>
+ {% for status_group in status_groups %}
+ {% with status_group.0 as title_status %}
+ <li class="status-group">
+ {% if title_status.active_bug_id %}
+ <span class="status-bug">
+ Patch {{ title_status.active_patch_id|force_escape|webkit_attachment_id|safe }} from bug
+ {{ title_status.active_bug_id|force_escape|webkit_bug_id|safe }}:
+ </span>
+ {% endif %}
+
+ {% ifequal status_group|length 1 %}
+ {% with title_status as status %}
+ {% include 'includes/singlequeuestatus.html' %}
+ {% endwith %}
+ {% else %}
+ <ul>
+ {% for status in status_group %}
+ <li class="status">
+ {% include 'includes/singlequeuestatus.html' %}
+ </li>
+ {% endfor %}
+ </ul>
+ {% endifequal %}
+ </li>
+ {% endwith %}
+ {% endfor %}
+ </ul>
+</div>
+
+<h3>Patches in queue</h3>
+<table>
+ <tr><th>Position</th><th>Patch</th><th>Lock Acquired</th></tr>
+ {% for row in work_item_rows %}
+ <tr>
+ <td>#{{ forloop.counter }}</td>
+ <td>
+ {{ row.attachment_id|force_escape|webkit_attachment_id|safe }}
+ </td>
+ <td>
+ {% if row.lock_time %}
+ {{ row.lock_time|timesince }} ago
+ {% endif %}
+ </td>
+ </tr>
+ {% endfor %}
+</table>
+
+</body>
+</html>
diff --git a/WebKitTools/QueueStatusServer/templates/recentstatus.html b/WebKitTools/QueueStatusServer/templates/recentstatus.html
index 2bb9fbb..808d8d7 100644
--- a/WebKitTools/QueueStatusServer/templates/recentstatus.html
+++ b/WebKitTools/QueueStatusServer/templates/recentstatus.html
@@ -3,22 +3,52 @@
<head>
<title>WebKit Queue Status</title>
<link type="text/css" rel="stylesheet" href="/stylesheets/dashboard.css" />
+<style>
+.queue_bubble {
+ border: 1px solid black;
+ margin-bottom: 10px;
+ border-radius: 10px;
+ padding: 5px;
+}
+.queue_name {
+ float:left;
+}
+.last_heard_from {
+ float: right;
+}
+.status_text {
+ clear: both;
+}
+.alive {
+ background-color: #8FDF5F;
+}
+.behind {
+ background-color: #FFFC6C;
+}
+.dead {
+ background-color: #E98080;
+}
+</style>
</head>
<body>
-<h1>WebKit Queue Status</h1>{% for queue_name, statuses in queue_status.items %}
-<div class="status-details">
- <h2>{{ queue_name }}</h2>
- <ul>{% for status in statuses %}
- <li>{% if status.active_bug_id %}
- <span class="status-bug">
- Patch {{ status.active_patch_id|force_escape|webkit_attachment_id|safe }} from bug
- {{ status.active_bug_id|force_escape|webkit_bug_id|safe }}:
- </span>{% endif %}
- <span class="status-message">{{ status.message|force_escape|urlize|webkit_linkify|safe }}</span>{% if status.results_file %}
- <span class="status-results">[{{ status.key.id|results_link|safe }}]</span>{% endif %}
- <span class="status-date">{{ status.date|timesince }} ago</span>
- </li>{% endfor %}
- </ul>
-</div>{% endfor %}
+<h1>WebKit Queue Status</h1>
+{% for queue in queues %}
+<div class="queue_bubble {{ queue.status_class }}">
+ <div class="queue_name">
+ <a href="/queue-status/{{ queue.name }}">
+ {{ queue.display_name }}
+ </a>
+ </div>
+ {% if queue.last_heard_from %}
+ <div class="last_heard_from">{{ queue.last_heard_from|timesince }} ago</div>
+ {% endif %}
+ <div class="status_text">
+ Status: {{ queue.status_text|force_escape|urlize|webkit_linkify|safe }}
+ </div>
+ <div>
+ {{ queue.pending_items_count }} pending
+ </div>
+</div>
+{% endfor %}
</body>
</html>
diff --git a/WebKitTools/QueueStatusServer/templates/releasepatch.html b/WebKitTools/QueueStatusServer/templates/releasepatch.html
new file mode 100644
index 0000000..cbd6d6f
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/templates/releasepatch.html
@@ -0,0 +1,3 @@
+<form name="release_patch" enctype="multipart/form-data" method="post">
+Patch to release: <input name="attachment_id"> from <input name="queue_name"><input type="submit" value="Release locks and remove from queue"></div>
+</form>
diff --git a/WebKitTools/QueueStatusServer/templates/statusbubble.html b/WebKitTools/QueueStatusServer/templates/statusbubble.html
index d1f331c..f11544d 100644
--- a/WebKitTools/QueueStatusServer/templates/statusbubble.html
+++ b/WebKitTools/QueueStatusServer/templates/statusbubble.html
@@ -18,26 +18,29 @@ body {
border: 1px solid #AAA;
background-color: white;
font-size: 11px;
+ cursor: pointer;
+}
+.none {
+ cursor: auto;
}
.pass {
background-color: #8FDF5F;
border: 1px solid #4F8530;
- cursor: pointer;
}
.fail {
background-color: #E98080;
border: 1px solid #A77272;
- cursor: pointer;
}
.pending {
background-color: #FFFC6C;
border: 1px solid #C5C56D;
- cursor: pointer;
}
.error {
background-color: #E0B0FF;
border: 1px solid #ACA0B3;
- cursor: pointer;
+}
+.queue_position {
+ font-size: 9px;
}
</style>
<script>
@@ -47,31 +50,15 @@ function statusDetail(patch_id) {
</script>
</head>
<body>
-<!-- FIXME: Find some way to remove this copy-and-paste code! -->
-<div class="status {{ summary.style_queue.state }}"{% if summary.style_queue.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.style_queue.status.date|timesince }} ago"{% endif %}>
- style
-</div>
-<div class="status {{ summary.chromium_ews.state }}"{% if summary.chromium_ews.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.chromium_ews.status.date|timesince }} ago"{% endif %}>
- chromium
-</div>
-<div class="status {{ summary.qt_ews.state }}"{% if summary.qt_ews.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.qt_ews.status.date|timesince }} ago"{% endif %}>
- qt
-</div>
-<div class="status {{ summary.gtk_ews.state }}"{% if summary.gtk_ews.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.gtk_ews.status.date|timesince }} ago"{% endif %}>
- gtk
-</div>
-<div class="status {{ summary.mac_ews.state }}"{% if summary.mac_ews.status %}
- onclick="statusDetail({{ summary.attachment_id }})"
- title="{{ summary.mac_ews.status.date|timesince }} ago"{% endif %}>
- mac
+{% for bubble in bubbles %}
+<div class="status {{ bubble.state }}"{% if bubble.status %}
+ onclick="statusDetail({{ bubble.attachment_id }})"
+ title="{{ bubble.status.date|timesince }} ago"{% endif %}>
+ {{ bubble.name }}
+ {% if bubble.queue_position %}
+ <span class="queue_position">#{{ bubble.queue_position }}</span>
+ {% endif %}
</div>
+{% endfor %}
</body>
</html>
diff --git a/WebKitTools/QueueStatusServer/templates/submittoews.html b/WebKitTools/QueueStatusServer/templates/submittoews.html
new file mode 100644
index 0000000..fb9d8aa
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/templates/submittoews.html
@@ -0,0 +1,3 @@
+<form name="submit_to_ews" enctype="multipart/form-data" method="post">
+Patch to submit: <input name="attachment_id"><input type="submit" value="Submit for EWS Processing"></div>
+</form>
diff --git a/WebKitTools/QueueStatusServer/templates/updatestatus.html b/WebKitTools/QueueStatusServer/templates/updatestatus.html
index 9343c60..0f98ba4 100644
--- a/WebKitTools/QueueStatusServer/templates/updatestatus.html
+++ b/WebKitTools/QueueStatusServer/templates/updatestatus.html
@@ -1,6 +1,10 @@
<form name="update_status" enctype="multipart/form-data" method="post">
Update status for a queue: <input name="queue_name">
<div>
+ Bot Id:
+ <input name="bot_id">
+ </div>
+ <div>
Active Bug Id:
<input name="bug_id">
</div>
diff --git a/WebKitTools/QueueStatusServer/templates/updatesvnrevision.html b/WebKitTools/QueueStatusServer/templates/updatesvnrevision.html
new file mode 100644
index 0000000..6ea4e7b
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/templates/updatesvnrevision.html
@@ -0,0 +1,8 @@
+<form name="update_svn_revision" method="post">
+Update an SVN revision: <input name="number">
+ <div>
+ Broken Bot:
+ <input name="broken_bot">
+ </div>
+ <div><input type="submit" value="Update"></div>
+</form>
diff --git a/WebKitTools/QueueStatusServer/templates/updateworkitems.html b/WebKitTools/QueueStatusServer/templates/updateworkitems.html
new file mode 100644
index 0000000..b086fc3
--- /dev/null
+++ b/WebKitTools/QueueStatusServer/templates/updateworkitems.html
@@ -0,0 +1,8 @@
+<form name="update_work_items" enctype="multipart/form-data" method="post">
+Update work items for a queue: <input name="queue_name">
+ <div>
+ Work Items:
+ <input name="work_items">
+ </div>
+ <div><input type="submit" value="Update Work Items"></div>
+</form>
diff --git a/WebKitTools/Scripts/VCSUtils.pm b/WebKitTools/Scripts/VCSUtils.pm
index 022c72a..faed7ed 100644
--- a/WebKitTools/Scripts/VCSUtils.pm
+++ b/WebKitTools/Scripts/VCSUtils.pm
@@ -1,5 +1,6 @@
# Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
# Copyright (C) 2009, 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+# Copyright (C) Research In Motion Limited 2010. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -43,6 +44,7 @@ BEGIN {
$VERSION = 1.00;
@ISA = qw(Exporter);
@EXPORT = qw(
+ &callSilently
&canonicalizePath
&changeLogEmailAddress
&changeLogName
@@ -61,12 +63,19 @@ BEGIN {
&isSVNDirectory
&isSVNVersion16OrNewer
&makeFilePathRelative
+ &mergeChangeLogs
&normalizePath
&parsePatch
&pathRelativeToSVNRepositoryRootForPath
+ &prepareParsedPatch
+ &removeEOL
&runPatchCommand
+ &scmMoveOrRenameFile
+ &scmToggleExecutableBit
+ &setChangeLogDateAndReviewer
&svnRevisionForDirectory
&svnStatus
+ &toWindowsLineEndings
);
%EXPORT_TAGS = ( );
@EXPORT_OK = ();
@@ -81,6 +90,15 @@ my $isGitBranchBuild;
my $isSVN;
my $svnVersion;
+# Project time zone for Cupertino, CA, US
+my $changeLogTimeZone = "PST8PDT";
+
+my $gitDiffStartRegEx = qr#^diff --git (\w/)?(.+) (\w/)?([^\r\n]+)#;
+my $svnDiffStartRegEx = qr#^Index: ([^\r\n]+)#;
+my $svnPropertiesStartRegEx = qr#^Property changes on: ([^\r\n]+)#; # $1 is normally the same as the index path.
+my $svnPropertyStartRegEx = qr#^(Modified|Name|Added|Deleted): ([^\r\n]+)#; # $2 is the name of the property.
+my $svnPropertyValueStartRegEx = qr#^ (\+|-|Merged|Reverse-merged) ([^\r\n]+)#; # $2 is the start of the property's value (which may span multiple lines).
+
# This method is for portability. Return the system-appropriate exit
# status of a child process.
#
@@ -95,6 +113,78 @@ sub exitStatus($)
return WEXITSTATUS($returnvalue);
}
+# Call a function while suppressing STDERR, and return the return values
+# as an array.
+sub callSilently($@) {
+ my ($func, @args) = @_;
+
+ # The following pattern was taken from here:
+ # http://www.sdsc.edu/~moreland/courses/IntroPerl/docs/manual/pod/perlfunc/open.html
+ #
+ # Also see this Perl documentation (search for "open OLDERR"):
+ # http://perldoc.perl.org/functions/open.html
+ open(OLDERR, ">&STDERR");
+ close(STDERR);
+ my @returnValue = &$func(@args);
+ open(STDERR, ">&OLDERR");
+ close(OLDERR);
+
+ return @returnValue;
+}
+
+sub toWindowsLineEndings
+{
+ my ($text) = @_;
+ $text =~ s/\n/\r\n/g;
+ return $text;
+}
+
+# Note, this method will not error if the file corresponding to the $source path does not exist.
+sub scmMoveOrRenameFile
+{
+ my ($source, $destination) = @_;
+ return if ! -e $source;
+ if (isSVN()) {
+ system("svn", "move", $source, $destination);
+ } elsif (isGit()) {
+ system("git", "mv", $source, $destination);
+ }
+}
+
+# Note, this method will not error if the file corresponding to the path does not exist.
+sub scmToggleExecutableBit
+{
+ my ($path, $executableBitDelta) = @_;
+ return if ! -e $path;
+ if ($executableBitDelta == 1) {
+ scmAddExecutableBit($path);
+ } elsif ($executableBitDelta == -1) {
+ scmRemoveExecutableBit($path);
+ }
+}
+
+sub scmAddExecutableBit($)
+{
+ my ($path) = @_;
+
+ if (isSVN()) {
+ system("svn", "propset", "svn:executable", "on", $path) == 0 or die "Failed to run 'svn propset svn:executable on $path'.";
+ } elsif (isGit()) {
+ chmod(0755, $path);
+ }
+}
+
+sub scmRemoveExecutableBit($)
+{
+ my ($path) = @_;
+
+ if (isSVN()) {
+ system("svn", "propdel", "svn:executable", $path) == 0 or die "Failed to run 'svn propdel svn:executable $path'.";
+ } elsif (isGit()) {
+ chmod(0664, $path);
+ }
+}
+
sub isGitDirectory($)
{
my ($dir) = @_;
@@ -324,6 +414,7 @@ sub canonicalizePath($)
sub removeEOL($)
{
my ($line) = @_;
+ return "" unless $line;
$line =~ s/[\r\n]+$//g;
return $line;
@@ -361,164 +452,384 @@ sub svnStatus($)
return $svnStatus;
}
-# Convert a line of a git-formatted patch to SVN format, while
-# preserving any end-of-line characters.
-sub gitdiff2svndiff($)
+# Return whether the given file mode is executable in the source control
+# sense. We make this determination based on whether the executable bit
+# is set for "others" rather than the stronger condition that it be set
+# for the user, group, and others. This is sufficient for distinguishing
+# the default behavior in Git and SVN.
+#
+# Args:
+# $fileMode: A number or string representing a file mode in octal notation.
+sub isExecutable($)
{
- $_ = shift @_;
+ my $fileMode = shift;
- if (m#^diff --git \w/(.+) \w/([^\r\n]+)#) {
- return "Index: $1$POSTMATCH";
- }
- if (m#^index [0-9a-f]{7}\.\.[0-9a-f]{7} [0-9]{6}#) {
- # FIXME: No need to return dividing line once parseDiffHeader() is used.
- return "===================================================================$POSTMATCH";
- }
- if (m#^--- \w/([^\r\n]+)#) {
- return "--- $1$POSTMATCH";
+ return $fileMode % 2;
+}
+
+# Parse the next Git diff header from the given file handle, and advance
+# the handle so the last line read is the first line after the header.
+#
+# This subroutine dies if given leading junk.
+#
+# Args:
+# $fileHandle: advanced so the last line read from the handle is the first
+# line of the header to parse. This should be a line
+# beginning with "diff --git".
+# $line: the line last read from $fileHandle
+#
+# Returns ($headerHashRef, $lastReadLine):
+# $headerHashRef: a hash reference representing a diff header, as follows--
+# copiedFromPath: the path from which the file was copied or moved if
+# the diff is a copy or move.
+# executableBitDelta: the value 1 or -1 if the executable bit was added or
+# removed, respectively. New and deleted files have
+# this value only if the file is executable, in which
+# case the value is 1 and -1, respectively.
+# indexPath: the path of the target file.
+# isBinary: the value 1 if the diff is for a binary file.
+# isDeletion: the value 1 if the diff is a file deletion.
+# isCopyWithChanges: the value 1 if the file was copied or moved and
+# the target file was changed in some way after being
+# copied or moved (e.g. if its contents or executable
+# bit were changed).
+# isNew: the value 1 if the diff is for a new file.
+# shouldDeleteSource: the value 1 if the file was copied or moved and
+# the source file was deleted -- i.e. if the copy
+# was actually a move.
+# svnConvertedText: the header text with some lines converted to SVN
+# format. Git-specific lines are preserved.
+# $lastReadLine: the line last read from $fileHandle.
+sub parseGitDiffHeader($$)
+{
+ my ($fileHandle, $line) = @_;
+
+ $_ = $line;
+
+ my $indexPath;
+ if (/$gitDiffStartRegEx/) {
+ # The first and second paths can differ in the case of copies
+ # and renames. We use the second file path because it is the
+ # destination path.
+ $indexPath = $4;
+ # Use $POSTMATCH to preserve the end-of-line character.
+ $_ = "Index: $indexPath$POSTMATCH"; # Convert to SVN format.
+ } else {
+ die("Could not parse leading \"diff --git\" line: \"$line\".");
}
- if (m#^\+\+\+ \w/([^\r\n]+)#) {
- return "+++ $1$POSTMATCH";
+
+ my $copiedFromPath;
+ my $foundHeaderEnding;
+ my $isBinary;
+ my $isDeletion;
+ my $isNew;
+ my $newExecutableBit = 0;
+ my $oldExecutableBit = 0;
+ my $shouldDeleteSource = 0;
+ my $similarityIndex = 0;
+ my $svnConvertedText;
+ while (1) {
+ # Temporarily strip off any end-of-line characters to simplify
+ # regex matching below.
+ s/([\n\r]+)$//;
+ my $eol = $1;
+
+ if (/^(deleted file|old) mode (\d+)/) {
+ $oldExecutableBit = (isExecutable($2) ? 1 : 0);
+ $isDeletion = 1 if $1 eq "deleted file";
+ } elsif (/^new( file)? mode (\d+)/) {
+ $newExecutableBit = (isExecutable($2) ? 1 : 0);
+ $isNew = 1 if $1;
+ } elsif (/^similarity index (\d+)%/) {
+ $similarityIndex = $1;
+ } elsif (/^copy from (\S+)/) {
+ $copiedFromPath = $1;
+ } elsif (/^rename from (\S+)/) {
+ # FIXME: Record this as a move rather than as a copy-and-delete.
+ # This will simplify adding rename support to svn-unapply.
+ # Otherwise, the hash for a deletion would have to know
+ # everything about the file being deleted in order to
+ # support undoing itself. Recording as a move will also
+ # permit us to use "svn move" and "git move".
+ $copiedFromPath = $1;
+ $shouldDeleteSource = 1;
+ } elsif (/^--- \S+/) {
+ $_ = "--- $indexPath"; # Convert to SVN format.
+ } elsif (/^\+\+\+ \S+/) {
+ $_ = "+++ $indexPath"; # Convert to SVN format.
+ $foundHeaderEnding = 1;
+ } elsif (/^GIT binary patch$/ ) {
+ $isBinary = 1;
+ $foundHeaderEnding = 1;
+ # The "git diff" command includes a line of the form "Binary files
+ # <path1> and <path2> differ" if the --binary flag is not used.
+ } elsif (/^Binary files / ) {
+ die("Error: the Git diff contains a binary file without the binary data in ".
+ "line: \"$_\". Be sure to use the --binary flag when invoking \"git diff\" ".
+ "with diffs containing binary files.");
+ }
+
+ $svnConvertedText .= "$_$eol"; # Also restore end-of-line characters.
+
+ $_ = <$fileHandle>; # Not defined if end-of-file reached.
+
+ last if (!defined($_) || /$gitDiffStartRegEx/ || $foundHeaderEnding);
}
- return $_;
+
+ my $executableBitDelta = $newExecutableBit - $oldExecutableBit;
+
+ my %header;
+
+ $header{copiedFromPath} = $copiedFromPath if $copiedFromPath;
+ $header{executableBitDelta} = $executableBitDelta if $executableBitDelta;
+ $header{indexPath} = $indexPath;
+ $header{isBinary} = $isBinary if $isBinary;
+ $header{isCopyWithChanges} = 1 if ($copiedFromPath && ($similarityIndex != 100 || $executableBitDelta));
+ $header{isDeletion} = $isDeletion if $isDeletion;
+ $header{isNew} = $isNew if $isNew;
+ $header{shouldDeleteSource} = $shouldDeleteSource if $shouldDeleteSource;
+ $header{svnConvertedText} = $svnConvertedText;
+
+ return (\%header, $_);
}
-# Parse the next diff header from the given file handle, and advance
-# the file handle so the last line read is the first line after the
-# parsed header block.
+# Parse the next SVN diff header from the given file handle, and advance
+# the handle so the last line read is the first line after the header.
#
-# This subroutine dies if given leading junk or if the end of the header
-# block could not be detected. The last line of a header block is a
-# line beginning with "+++".
+# This subroutine dies if given leading junk or if it could not detect
+# the end of the header block.
#
# Args:
-# $fileHandle: advanced so the last line read is the first line of the
-# next diff header. For SVN-formatted diffs, this is the
-# "Index:" line.
+# $fileHandle: advanced so the last line read from the handle is the first
+# line of the header to parse. This should be a line
+# beginning with "Index:".
# $line: the line last read from $fileHandle
#
# Returns ($headerHashRef, $lastReadLine):
-# $headerHashRef: a hash reference representing a diff header
-# copiedFromPath: if a file copy, the path from which the file was
-# copied. Otherwise, undefined.
-# indexPath: the path in the "Index:" line.
-# sourceRevision: the revision number of the source. This is the same
-# as the revision number the file was copied from, in
-# the case of a file copy.
-# svnConvertedText: the header text converted to SVN format.
-# Unrecognized lines are discarded.
-# $lastReadLine: the line last read from $fileHandle. This is the first
-# line after the header ending.
-sub parseDiffHeader($$)
+# $headerHashRef: a hash reference representing a diff header, as follows--
+# copiedFromPath: the path from which the file was copied if the diff
+# is a copy.
+# indexPath: the path of the target file, which is the path found in
+# the "Index:" line.
+# isBinary: the value 1 if the diff is for a binary file.
+# isNew: the value 1 if the diff is for a new file.
+# sourceRevision: the revision number of the source, if it exists. This
+# is the same as the revision number the file was copied
+# from, in the case of a file copy.
+# svnConvertedText: the header text converted to a header with the paths
+# in some lines corrected.
+# $lastReadLine: the line last read from $fileHandle.
+sub parseSvnDiffHeader($$)
{
my ($fileHandle, $line) = @_;
- my $filter;
- if ($line =~ m#^diff --git #) {
- $filter = \&gitdiff2svndiff;
- }
- $line = &$filter($line) if $filter;
+ $_ = $line;
my $indexPath;
- if ($line =~ /^Index: ([^\r\n]+)/) {
+ if (/$svnDiffStartRegEx/) {
$indexPath = $1;
} else {
- die("Could not parse first line of diff header: \"$line\".");
+ die("First line of SVN diff does not begin with \"Index \": \"$_\"");
}
- my %header;
-
+ my $copiedFromPath;
my $foundHeaderEnding;
- my $lastReadLine;
+ my $isBinary;
+ my $isNew;
my $sourceRevision;
- my $svnConvertedText = $line;
- while (<$fileHandle>) {
+ my $svnConvertedText;
+ while (1) {
# Temporarily strip off any end-of-line characters to simplify
# regex matching below.
s/([\n\r]+)$//;
my $eol = $1;
- $_ = &$filter($_) if $filter;
-
# Fix paths on ""---" and "+++" lines to match the leading
# index line.
if (s/^--- \S+/--- $indexPath/) {
# ---
if (/^--- .+\(revision (\d+)\)/) {
- $sourceRevision = $1 if ($1 != 0);
+ $sourceRevision = $1;
+ $isNew = 1 if !$sourceRevision; # if revision 0.
if (/\(from (\S+):(\d+)\)$/) {
# The "from" clause is created by svn-create-patch, in
# which case there is always also a "revision" clause.
- $header{copiedFromPath} = $1;
+ $copiedFromPath = $1;
die("Revision number \"$2\" in \"from\" clause does not match " .
"source revision number \"$sourceRevision\".") if ($2 != $sourceRevision);
}
}
- $_ = "=" x 67 . "$eol$_"; # Prepend dividing line ===....
} elsif (s/^\+\+\+ \S+/+++ $indexPath/) {
- # +++
$foundHeaderEnding = 1;
- } else {
- # Skip unrecognized lines.
- next;
+ } elsif (/^Cannot display: file marked as a binary type.$/) {
+ $isBinary = 1;
+ $foundHeaderEnding = 1;
}
$svnConvertedText .= "$_$eol"; # Also restore end-of-line characters.
- if ($foundHeaderEnding) {
- $lastReadLine = <$fileHandle>;
- last;
- }
- } # $lastReadLine is undef if while loop ran out.
+
+ $_ = <$fileHandle>; # Not defined if end-of-file reached.
+
+ last if (!defined($_) || /$svnDiffStartRegEx/ || $foundHeaderEnding);
+ }
if (!$foundHeaderEnding) {
die("Did not find end of header block corresponding to index path \"$indexPath\".");
}
+ my %header;
+
+ $header{copiedFromPath} = $copiedFromPath if $copiedFromPath;
$header{indexPath} = $indexPath;
- $header{sourceRevision} = $sourceRevision;
+ $header{isBinary} = $isBinary if $isBinary;
+ $header{isNew} = $isNew if $isNew;
+ $header{sourceRevision} = $sourceRevision if $sourceRevision;
$header{svnConvertedText} = $svnConvertedText;
- return (\%header, $lastReadLine);
+ return (\%header, $_);
+}
+
+# Parse the next diff header from the given file handle, and advance
+# the handle so the last line read is the first line after the header.
+#
+# This subroutine dies if given leading junk or if it could not detect
+# the end of the header block.
+#
+# Args:
+# $fileHandle: advanced so the last line read from the handle is the first
+# line of the header to parse. For SVN-formatted diffs, this
+# is a line beginning with "Index:". For Git, this is a line
+# beginning with "diff --git".
+# $line: the line last read from $fileHandle
+#
+# Returns ($headerHashRef, $lastReadLine):
+# $headerHashRef: a hash reference representing a diff header
+# copiedFromPath: the path from which the file was copied if the diff
+# is a copy.
+# executableBitDelta: the value 1 or -1 if the executable bit was added or
+# removed, respectively. New and deleted files have
+# this value only if the file is executable, in which
+# case the value is 1 and -1, respectively.
+# indexPath: the path of the target file.
+# isBinary: the value 1 if the diff is for a binary file.
+# isGit: the value 1 if the diff is Git-formatted.
+# isSvn: the value 1 if the diff is SVN-formatted.
+# sourceRevision: the revision number of the source, if it exists. This
+# is the same as the revision number the file was copied
+# from, in the case of a file copy.
+# svnConvertedText: the header text with some lines converted to SVN
+# format. Git-specific lines are preserved.
+# $lastReadLine: the line last read from $fileHandle.
+sub parseDiffHeader($$)
+{
+ my ($fileHandle, $line) = @_;
+
+ my $header; # This is a hash ref.
+ my $isGit;
+ my $isSvn;
+ my $lastReadLine;
+
+ if ($line =~ $svnDiffStartRegEx) {
+ $isSvn = 1;
+ ($header, $lastReadLine) = parseSvnDiffHeader($fileHandle, $line);
+ } elsif ($line =~ $gitDiffStartRegEx) {
+ $isGit = 1;
+ ($header, $lastReadLine) = parseGitDiffHeader($fileHandle, $line);
+ } else {
+ die("First line of diff does not begin with \"Index:\" or \"diff --git\": \"$line\"");
+ }
+
+ $header->{isGit} = $isGit if $isGit;
+ $header->{isSvn} = $isSvn if $isSvn;
+
+ return ($header, $lastReadLine);
}
+# FIXME: The %diffHash "object" should not have an svnConvertedText property.
+# Instead, the hash object should store its information in a
+# structured way as properties. This should be done in a way so
+# that, if necessary, the text of an SVN or Git patch can be
+# reconstructed from the information in those hash properties.
+#
+# A %diffHash is a hash representing a source control diff of a single
+# file operation (e.g. a file modification, copy, or delete).
+#
+# These hashes appear, for example, in the parseDiff(), parsePatch(),
+# and prepareParsedPatch() subroutines of this package.
+#
+# The corresponding values are--
+#
+# copiedFromPath: the path from which the file was copied if the diff
+# is a copy.
+# executableBitDelta: the value 1 or -1 if the executable bit was added or
+# removed from the target file, respectively.
+# indexPath: the path of the target file. For SVN-formatted diffs,
+# this is the same as the path in the "Index:" line.
+# isBinary: the value 1 if the diff is for a binary file.
+# isDeletion: the value 1 if the diff is known from the header to be a deletion.
+# isGit: the value 1 if the diff is Git-formatted.
+# isNew: the value 1 if the dif is known from the header to be a new file.
+# isSvn: the value 1 if the diff is SVN-formatted.
+# sourceRevision: the revision number of the source, if it exists. This
+# is the same as the revision number the file was copied
+# from, in the case of a file copy.
+# svnConvertedText: the diff with some lines converted to SVN format.
+# Git-specific lines are preserved.
+
# Parse one diff from a patch file created by svn-create-patch, and
# advance the file handle so the last line read is the first line
# of the next header block.
#
# This subroutine preserves any leading junk encountered before the header.
#
+# Composition of an SVN diff
+#
+# There are three parts to an SVN diff: the header, the property change, and
+# the binary contents, in that order. Either the header or the property change
+# may be ommitted, but not both. If there are binary changes, then you always
+# have all three.
+#
# Args:
# $fileHandle: a file handle advanced to the first line of the next
# header block. Leading junk is okay.
# $line: the line last read from $fileHandle.
#
-# Returns ($diffHashRef, $lastReadLine):
-# $diffHashRef:
-# copiedFromPath: if a file copy, the path from which the file was
-# copied. Otherwise, undefined.
-# indexPath: the path in the "Index:" line.
-# sourceRevision: the revision number of the source. This is the same
-# as the revision number the file was copied from, in
-# the case of a file copy.
-# svnConvertedText: the diff converted to SVN format.
+# Returns ($diffHashRefs, $lastReadLine):
+# $diffHashRefs: A reference to an array of references to %diffHash hashes.
+# See the %diffHash documentation above.
# $lastReadLine: the line last read from $fileHandle
sub parseDiff($$)
{
+ # FIXME: Adjust this method so that it dies if the first line does not
+ # match the start of a diff. This will require a change to
+ # parsePatch() so that parsePatch() skips over leading junk.
my ($fileHandle, $line) = @_;
- my $headerStartRegEx = qr#^Index: #; # SVN-style header for the default
- my $gitHeaderStartRegEx = qr#^diff --git \w/#;
+ my $headerStartRegEx = $svnDiffStartRegEx; # SVN-style header for the default
my $headerHashRef; # Last header found, as returned by parseDiffHeader().
+ my $svnPropertiesHashRef; # Last SVN properties diff found, as returned by parseSvnDiffProperties().
my $svnText;
while (defined($line)) {
- if (!$headerHashRef && ($line =~ $gitHeaderStartRegEx)) {
+ if (!$headerHashRef && ($line =~ $gitDiffStartRegEx)) {
# Then assume all diffs in the patch are Git-formatted. This
# block was made to be enterable at most once since we assume
# all diffs in the patch are formatted the same (SVN or Git).
- $headerStartRegEx = $gitHeaderStartRegEx;
+ $headerStartRegEx = $gitDiffStartRegEx;
}
+ if ($line =~ $svnPropertiesStartRegEx) {
+ my $propertyPath = $1;
+ if ($svnPropertiesHashRef || $headerHashRef && ($propertyPath ne $headerHashRef->{indexPath})) {
+ # This is the start of the second diff in the while loop, which happens to
+ # be a property diff. If $svnPropertiesHasRef is defined, then this is the
+ # second consecutive property diff, otherwise it's the start of a property
+ # diff for a file that only has property changes.
+ last;
+ }
+ ($svnPropertiesHashRef, $line) = parseSvnDiffProperties($fileHandle, $line);
+ next;
+ }
if ($line !~ $headerStartRegEx) {
# Then we are in the body of the diff.
$svnText .= $line;
@@ -526,8 +837,9 @@ sub parseDiff($$)
next;
} # Otherwise, we found a diff header.
- if ($headerHashRef) {
- # Then this is the second diff header of this while loop.
+ if ($svnPropertiesHashRef || $headerHashRef) {
+ # Then either we just processed an SVN property change or this
+ # is the start of the second diff header of this while loop.
last;
}
@@ -536,13 +848,289 @@ sub parseDiff($$)
$svnText .= $headerHashRef->{svnConvertedText};
}
- my %diffHashRef;
- $diffHashRef{copiedFromPath} = $headerHashRef->{copiedFromPath};
- $diffHashRef{indexPath} = $headerHashRef->{indexPath};
- $diffHashRef{sourceRevision} = $headerHashRef->{sourceRevision};
- $diffHashRef{svnConvertedText} = $svnText;
+ my @diffHashRefs;
+
+ if ($headerHashRef->{shouldDeleteSource}) {
+ my %deletionHash;
+ $deletionHash{indexPath} = $headerHashRef->{copiedFromPath};
+ $deletionHash{isDeletion} = 1;
+ push @diffHashRefs, \%deletionHash;
+ }
+ if ($headerHashRef->{copiedFromPath}) {
+ my %copyHash;
+ $copyHash{copiedFromPath} = $headerHashRef->{copiedFromPath};
+ $copyHash{indexPath} = $headerHashRef->{indexPath};
+ $copyHash{sourceRevision} = $headerHashRef->{sourceRevision} if $headerHashRef->{sourceRevision};
+ if ($headerHashRef->{isSvn}) {
+ $copyHash{executableBitDelta} = $svnPropertiesHashRef->{executableBitDelta} if $svnPropertiesHashRef->{executableBitDelta};
+ }
+ push @diffHashRefs, \%copyHash;
+ }
+
+ # Note, the order of evaluation for the following if conditional has been explicitly chosen so that
+ # it evaluates to false when there is no headerHashRef (e.g. a property change diff for a file that
+ # only has property changes).
+ if ($headerHashRef->{isCopyWithChanges} || (%$headerHashRef && !$headerHashRef->{copiedFromPath})) {
+ # Then add the usual file modification.
+ my %diffHash;
+ # FIXME: We should expand this code to support other properties. In the future,
+ # parseSvnDiffProperties may return a hash whose keys are the properties.
+ if ($headerHashRef->{isSvn}) {
+ # SVN records the change to the executable bit in a separate property change diff
+ # that follows the contents of the diff, except for binary diffs. For binary
+ # diffs, the property change diff follows the diff header.
+ $diffHash{executableBitDelta} = $svnPropertiesHashRef->{executableBitDelta} if $svnPropertiesHashRef->{executableBitDelta};
+ } elsif ($headerHashRef->{isGit}) {
+ # Git records the change to the executable bit in the header of a diff.
+ $diffHash{executableBitDelta} = $headerHashRef->{executableBitDelta} if $headerHashRef->{executableBitDelta};
+ }
+ $diffHash{indexPath} = $headerHashRef->{indexPath};
+ $diffHash{isBinary} = $headerHashRef->{isBinary} if $headerHashRef->{isBinary};
+ $diffHash{isDeletion} = $headerHashRef->{isDeletion} if $headerHashRef->{isDeletion};
+ $diffHash{isGit} = $headerHashRef->{isGit} if $headerHashRef->{isGit};
+ $diffHash{isNew} = $headerHashRef->{isNew} if $headerHashRef->{isNew};
+ $diffHash{isSvn} = $headerHashRef->{isSvn} if $headerHashRef->{isSvn};
+ if (!$headerHashRef->{copiedFromPath}) {
+ # If the file was copied, then we have already incorporated the
+ # sourceRevision information into the change.
+ $diffHash{sourceRevision} = $headerHashRef->{sourceRevision} if $headerHashRef->{sourceRevision};
+ }
+ # FIXME: Remove the need for svnConvertedText. See the %diffHash
+ # code comments above for more information.
+ #
+ # Note, we may not always have SVN converted text since we intend
+ # to deprecate it in the future. For example, a property change
+ # diff for a file that only has property changes will not return
+ # any SVN converted text.
+ $diffHash{svnConvertedText} = $svnText if $svnText;
+ push @diffHashRefs, \%diffHash;
+ }
- return (\%diffHashRef, $line);
+ if (!%$headerHashRef && $svnPropertiesHashRef) {
+ # A property change diff for a file that only has property changes.
+ my %propertyChangeHash;
+ $propertyChangeHash{executableBitDelta} = $svnPropertiesHashRef->{executableBitDelta} if $svnPropertiesHashRef->{executableBitDelta};
+ $propertyChangeHash{indexPath} = $svnPropertiesHashRef->{propertyPath};
+ $propertyChangeHash{isSvn} = 1;
+ push @diffHashRefs, \%propertyChangeHash;
+ }
+
+ return (\@diffHashRefs, $line);
+}
+
+# Parse an SVN property change diff from the given file handle, and advance
+# the handle so the last line read is the first line after this diff.
+#
+# For the case of an SVN binary diff, the binary contents will follow the
+# the property changes.
+#
+# This subroutine dies if the first line does not begin with "Property changes on"
+# or if the separator line that follows this line is missing.
+#
+# Args:
+# $fileHandle: advanced so the last line read from the handle is the first
+# line of the footer to parse. This line begins with
+# "Property changes on".
+# $line: the line last read from $fileHandle.
+#
+# Returns ($propertyHashRef, $lastReadLine):
+# $propertyHashRef: a hash reference representing an SVN diff footer.
+# propertyPath: the path of the target file.
+# executableBitDelta: the value 1 or -1 if the executable bit was added or
+# removed from the target file, respectively.
+# $lastReadLine: the line last read from $fileHandle.
+sub parseSvnDiffProperties($$)
+{
+ my ($fileHandle, $line) = @_;
+
+ $_ = $line;
+
+ my %footer;
+ if (/$svnPropertiesStartRegEx/) {
+ $footer{propertyPath} = $1;
+ } else {
+ die("Failed to find start of SVN property change, \"Property changes on \": \"$_\"");
+ }
+
+ # We advance $fileHandle two lines so that the next line that
+ # we process is $svnPropertyStartRegEx in a well-formed footer.
+ # A well-formed footer has the form:
+ # Property changes on: FileA
+ # ___________________________________________________________________
+ # Added: svn:executable
+ # + *
+ $_ = <$fileHandle>; # Not defined if end-of-file reached.
+ my $separator = "_" x 67;
+ if (defined($_) && /^$separator[\r\n]+$/) {
+ $_ = <$fileHandle>;
+ } else {
+ die("Failed to find separator line: \"$_\".");
+ }
+
+ # FIXME: We should expand this to support other SVN properties
+ # (e.g. return a hash of property key-values that represents
+ # all properties).
+ #
+ # Notice, we keep processing until we hit end-of-file or some
+ # line that does not resemble $svnPropertyStartRegEx, such as
+ # the empty line that precedes the start of the binary contents
+ # of a patch, or the start of the next diff (e.g. "Index:").
+ my $propertyHashRef;
+ while (defined($_) && /$svnPropertyStartRegEx/) {
+ ($propertyHashRef, $_) = parseSvnProperty($fileHandle, $_);
+ if ($propertyHashRef->{name} eq "svn:executable") {
+ # Notice, for SVN properties, propertyChangeDelta is always non-zero
+ # because a property can only be added or removed.
+ $footer{executableBitDelta} = $propertyHashRef->{propertyChangeDelta};
+ }
+ }
+
+ return(\%footer, $_);
+}
+
+# Parse the next SVN property from the given file handle, and advance the handle so the last
+# line read is the first line after the property.
+#
+# This subroutine dies if the first line is not a valid start of an SVN property,
+# or the property is missing a value, or the property change type (e.g. "Added")
+# does not correspond to the property value type (e.g. "+").
+#
+# Args:
+# $fileHandle: advanced so the last line read from the handle is the first
+# line of the property to parse. This should be a line
+# that matches $svnPropertyStartRegEx.
+# $line: the line last read from $fileHandle.
+#
+# Returns ($propertyHashRef, $lastReadLine):
+# $propertyHashRef: a hash reference representing a SVN property.
+# name: the name of the property.
+# value: the last property value. For instance, suppose the property is "Modified".
+# Then it has both a '-' and '+' property value in that order. Therefore,
+# the value of this key is the value of the '+' property by ordering (since
+# it is the last value).
+# propertyChangeDelta: the value 1 or -1 if the property was added or
+# removed, respectively.
+# $lastReadLine: the line last read from $fileHandle.
+sub parseSvnProperty($$)
+{
+ my ($fileHandle, $line) = @_;
+
+ $_ = $line;
+
+ my $propertyName;
+ my $propertyChangeType;
+ if (/$svnPropertyStartRegEx/) {
+ $propertyChangeType = $1;
+ $propertyName = $2;
+ } else {
+ die("Failed to find SVN property: \"$_\".");
+ }
+
+ $_ = <$fileHandle>; # Not defined if end-of-file reached.
+
+ # The "svn diff" command neither inserts newline characters between property values
+ # nor between successive properties.
+ #
+ # FIXME: We do not support property values that contain tailing newline characters
+ # as it is difficult to disambiguate these trailing newlines from the empty
+ # line that precedes the contents of a binary patch.
+ my $propertyValue;
+ my $propertyValueType;
+ while (defined($_) && /$svnPropertyValueStartRegEx/) {
+ # Note, a '-' property may be followed by a '+' property in the case of a "Modified"
+ # or "Name" property. We only care about the ending value (i.e. the '+' property)
+ # in such circumstances. So, we take the property value for the property to be its
+ # last parsed property value.
+ #
+ # FIXME: We may want to consider strictly enforcing a '-', '+' property ordering or
+ # add error checking to prevent '+', '+', ..., '+' and other invalid combinations.
+ $propertyValueType = $1;
+ ($propertyValue, $_) = parseSvnPropertyValue($fileHandle, $_);
+ }
+
+ if (!$propertyValue) {
+ die("Failed to find the property value for the SVN property \"$propertyName\": \"$_\".");
+ }
+
+ my $propertyChangeDelta;
+ if ($propertyValueType eq "+" || $propertyValueType eq "Merged") {
+ $propertyChangeDelta = 1;
+ } elsif ($propertyValueType eq "-" || $propertyValueType eq "Reverse-merged") {
+ $propertyChangeDelta = -1;
+ } else {
+ die("Not reached.");
+ }
+
+ # We perform a simple validation that an "Added" or "Deleted" property
+ # change type corresponds with a "+" and "-" value type, respectively.
+ my $expectedChangeDelta;
+ if ($propertyChangeType eq "Added") {
+ $expectedChangeDelta = 1;
+ } elsif ($propertyChangeType eq "Deleted") {
+ $expectedChangeDelta = -1;
+ }
+
+ if ($expectedChangeDelta && $propertyChangeDelta != $expectedChangeDelta) {
+ die("The final property value type found \"$propertyValueType\" does not " .
+ "correspond to the property change type found \"$propertyChangeType\".");
+ }
+
+ my %propertyHash;
+ $propertyHash{name} = $propertyName;
+ $propertyHash{propertyChangeDelta} = $propertyChangeDelta;
+ $propertyHash{value} = $propertyValue;
+ return (\%propertyHash, $_);
+}
+
+# Parse the value of an SVN property from the given file handle, and advance
+# the handle so the last line read is the first line after the property value.
+#
+# This subroutine dies if the first line is an invalid SVN property value line
+# (i.e. a line that does not begin with " +" or " -").
+#
+# Args:
+# $fileHandle: advanced so the last line read from the handle is the first
+# line of the property value to parse. This should be a line
+# beginning with " +" or " -".
+# $line: the line last read from $fileHandle.
+#
+# Returns ($propertyValue, $lastReadLine):
+# $propertyValue: the value of the property.
+# $lastReadLine: the line last read from $fileHandle.
+sub parseSvnPropertyValue($$)
+{
+ my ($fileHandle, $line) = @_;
+
+ $_ = $line;
+
+ my $propertyValue;
+ my $eol;
+ if (/$svnPropertyValueStartRegEx/) {
+ $propertyValue = $2; # Does not include the end-of-line character(s).
+ $eol = $POSTMATCH;
+ } else {
+ die("Failed to find property value beginning with '+', '-', 'Merged', or 'Reverse-merged': \"$_\".");
+ }
+
+ while (<$fileHandle>) {
+ if (/^[\r\n]+$/ || /$svnPropertyValueStartRegEx/ || /$svnPropertyStartRegEx/) {
+ # Note, we may encounter an empty line before the contents of a binary patch.
+ # Also, we check for $svnPropertyValueStartRegEx because a '-' property may be
+ # followed by a '+' property in the case of a "Modified" or "Name" property.
+ # We check for $svnPropertyStartRegEx because it indicates the start of the
+ # next property to parse.
+ last;
+ }
+
+ # Temporarily strip off any end-of-line characters. We add the end-of-line characters
+ # from the previously processed line to the start of this line so that the last line
+ # of the property value does not end in end-of-line characters.
+ s/([\n\r]+)$//;
+ $propertyValue .= "$eol$_";
+ $eol = $1;
+ }
+
+ return ($propertyValue, $_);
}
# Parse a patch file created by svn-create-patch.
@@ -552,27 +1140,144 @@ sub parseDiff($$)
# read from.
#
# Returns:
-# @diffHashRefs: an array of diff hash references. See parseDiff() for
-# a description of each $diffHashRef.
+# @diffHashRefs: an array of diff hash references.
+# See the %diffHash documentation above.
sub parsePatch($)
{
my ($fileHandle) = @_;
+ my $newDiffHashRefs;
my @diffHashRefs; # return value
my $line = <$fileHandle>;
while (defined($line)) { # Otherwise, at EOF.
- my $diffHashRef;
- ($diffHashRef, $line) = parseDiff($fileHandle, $line);
+ ($newDiffHashRefs, $line) = parseDiff($fileHandle, $line);
- push @diffHashRefs, $diffHashRef;
+ push @diffHashRefs, @$newDiffHashRefs;
}
return @diffHashRefs;
}
+# Prepare the results of parsePatch() for use in svn-apply and svn-unapply.
+#
+# Args:
+# $shouldForce: Whether to continue processing if an unexpected
+# state occurs.
+# @diffHashRefs: An array of references to %diffHashes.
+# See the %diffHash documentation above.
+#
+# Returns $preparedPatchHashRef:
+# copyDiffHashRefs: A reference to an array of the $diffHashRefs in
+# @diffHashRefs that represent file copies. The original
+# ordering is preserved.
+# nonCopyDiffHashRefs: A reference to an array of the $diffHashRefs in
+# @diffHashRefs that do not represent file copies.
+# The original ordering is preserved.
+# sourceRevisionHash: A reference to a hash of source path to source
+# revision number.
+sub prepareParsedPatch($@)
+{
+ my ($shouldForce, @diffHashRefs) = @_;
+
+ my %copiedFiles;
+
+ # Return values
+ my @copyDiffHashRefs = ();
+ my @nonCopyDiffHashRefs = ();
+ my %sourceRevisionHash = ();
+ for my $diffHashRef (@diffHashRefs) {
+ my $copiedFromPath = $diffHashRef->{copiedFromPath};
+ my $indexPath = $diffHashRef->{indexPath};
+ my $sourceRevision = $diffHashRef->{sourceRevision};
+ my $sourcePath;
+
+ if (defined($copiedFromPath)) {
+ # Then the diff is a copy operation.
+ $sourcePath = $copiedFromPath;
+
+ # FIXME: Consider printing a warning or exiting if
+ # exists($copiedFiles{$indexPath}) is true -- i.e. if
+ # $indexPath appears twice as a copy target.
+ $copiedFiles{$indexPath} = $sourcePath;
+
+ push @copyDiffHashRefs, $diffHashRef;
+ } else {
+ # Then the diff is not a copy operation.
+ $sourcePath = $indexPath;
+
+ push @nonCopyDiffHashRefs, $diffHashRef;
+ }
+
+ if (defined($sourceRevision)) {
+ if (exists($sourceRevisionHash{$sourcePath}) &&
+ ($sourceRevisionHash{$sourcePath} != $sourceRevision)) {
+ if (!$shouldForce) {
+ die "Two revisions of the same file required as a source:\n".
+ " $sourcePath:$sourceRevisionHash{$sourcePath}\n".
+ " $sourcePath:$sourceRevision";
+ }
+ }
+ $sourceRevisionHash{$sourcePath} = $sourceRevision;
+ }
+ }
+
+ my %preparedPatchHash;
+
+ $preparedPatchHash{copyDiffHashRefs} = \@copyDiffHashRefs;
+ $preparedPatchHash{nonCopyDiffHashRefs} = \@nonCopyDiffHashRefs;
+ $preparedPatchHash{sourceRevisionHash} = \%sourceRevisionHash;
+
+ return \%preparedPatchHash;
+}
+
+# Return localtime() for the project's time zone, given an integer time as
+# returned by Perl's time() function.
+sub localTimeInProjectTimeZone($)
+{
+ my $epochTime = shift;
+
+ # Change the time zone temporarily for the localtime() call.
+ my $savedTimeZone = $ENV{'TZ'};
+ $ENV{'TZ'} = $changeLogTimeZone;
+ my @localTime = localtime($epochTime);
+ if (defined $savedTimeZone) {
+ $ENV{'TZ'} = $savedTimeZone;
+ } else {
+ delete $ENV{'TZ'};
+ }
+
+ return @localTime;
+}
+
+# Set the reviewer and date in a ChangeLog patch, and return the new patch.
+#
+# Args:
+# $patch: a ChangeLog patch as a string.
+# $reviewer: the name of the reviewer, or undef if the reviewer should not be set.
+# $epochTime: an integer time as returned by Perl's time() function.
+sub setChangeLogDateAndReviewer($$$)
+{
+ my ($patch, $reviewer, $epochTime) = @_;
+
+ my @localTime = localTimeInProjectTimeZone($epochTime);
+ my $newDate = strftime("%Y-%m-%d", @localTime);
+
+ my $firstChangeLogLineRegEx = qr#(\n\+)\d{4}-[^-]{2}-[^-]{2}( )#;
+ $patch =~ s/$firstChangeLogLineRegEx/$1$newDate$2/;
+
+ if (defined($reviewer)) {
+ # We include a leading plus ("+") in the regular expression to make
+ # the regular expression less likely to match text in the leading junk
+ # for the patch, if the patch has leading junk.
+ $patch =~ s/(\n\+.*)NOBODY \(OOPS!\)/$1$reviewer/;
+ }
+
+ return $patch;
+}
+
# If possible, returns a ChangeLog patch equivalent to the given one,
# but with the newest ChangeLog entry inserted at the top of the
# file -- i.e. no leading context and all lines starting with "+".
@@ -595,6 +1300,16 @@ sub parsePatch($)
# context.
#
# This subroutine has unit tests in VCSUtils_unittest.pl.
+#
+# Returns $changeLogHashRef:
+# $changeLogHashRef: a hash reference representing a change log patch.
+# patch: a ChangeLog patch equivalent to the given one, but with the
+# newest ChangeLog entry inserted at the top of the file, if possible.
+# hasOverlappingLines: the value 1 if the change log entry overlaps
+# some lines of another change log entry. This can
+# happen when deliberately inserting a new ChangeLog
+# entry earlier in the file above an entry with
+# the same date and author.
sub fixChangeLogPatch($)
{
my $patch = shift; # $patch will only contain patch fragments for ChangeLog.
@@ -612,10 +1327,12 @@ sub fixChangeLogPatch($)
}
}
my $chunkStartIndex = ++$i;
+ my %changeLogHashRef;
# Optimization: do not process if new lines already begin the chunk.
if (substr($lines[$i], 0, 1) eq "+") {
- return $patch;
+ $changeLogHashRef{patch} = $patch;
+ return \%changeLogHashRef;
}
# Skip to first line of newly added ChangeLog entry.
@@ -632,10 +1349,12 @@ sub fixChangeLogPatch($)
} elsif ($firstChar eq " " or $firstChar eq "+") {
next;
}
- return $patch; # Do not change if, for example, "-" or "@" found.
+ $changeLogHashRef{patch} = $patch; # Do not change if, for example, "-" or "@" found.
+ return \%changeLogHashRef;
}
if ($i >= @lines) {
- return $patch; # Do not change if date not found.
+ $changeLogHashRef{patch} = $patch; # Do not change if date not found.
+ return \%changeLogHashRef;
}
my $dateStartIndex = $i;
@@ -670,7 +1389,7 @@ sub fixChangeLogPatch($)
# Work backwards, shifting overlapping lines towards front
# while checking that patch stays equivalent.
- for ($i = $dateStartIndex - 1; $i >= $chunkStartIndex; --$i) {
+ for ($i = $dateStartIndex - 1; @overlappingLines && $i >= $chunkStartIndex; --$i) {
my $line = $lines[$i];
if (substr($line, 0, 1) ne " ") {
next;
@@ -678,7 +1397,8 @@ sub fixChangeLogPatch($)
my $text = substr($line, 1);
my $newLine = pop(@overlappingLines);
if ($text ne substr($newLine, 1)) {
- return $patch; # Unexpected difference.
+ $changeLogHashRef{patch} = $patch; # Unexpected difference.
+ return \%changeLogHashRef;
}
$lines[$i] = "+$text";
}
@@ -690,7 +1410,8 @@ sub fixChangeLogPatch($)
# FIXME: Handle errors differently from ChangeLog files that
# are okay but should not be altered. That way we can find out
# if improvements to the script ever become necessary.
- return $patch; # Error: unexpected patch string format.
+ $changeLogHashRef{patch} = $patch; # Error: unexpected patch string format.
+ return \%changeLogHashRef;
}
my $skippedFirstLineCount = $1 - 1;
my $oldSourceLineCount = $2;
@@ -699,7 +1420,9 @@ sub fixChangeLogPatch($)
if (@overlappingLines != $skippedFirstLineCount) {
# This can happen, for example, when deliberately inserting
# a new ChangeLog entry earlier in the file.
- return $patch;
+ $changeLogHashRef{hasOverlappingLines} = 1;
+ $changeLogHashRef{patch} = $patch;
+ return \%changeLogHashRef;
}
# If @overlappingLines > 0, this is where we make use of the
# assumption that the beginning of the source file was not modified.
@@ -709,7 +1432,8 @@ sub fixChangeLogPatch($)
my $targetLineCount = $oldTargetLineCount + @overlappingLines - $deletedLineCount;
$lines[$chunkStartIndex - 1] = "@@ -1,$sourceLineCount +1,$targetLineCount @@";
- return join($lineEnding, @lines) . "\n"; # patch(1) expects an extra trailing newline.
+ $changeLogHashRef{patch} = join($lineEnding, @lines) . "\n"; # patch(1) expects an extra trailing newline.
+ return \%changeLogHashRef;
}
# This is a supporting method for runPatchCommand.
@@ -815,6 +1539,81 @@ sub runPatchCommand($$$;$)
return $exitStatus;
}
+# Merge ChangeLog patches using a three-file approach.
+#
+# This is used by resolve-ChangeLogs when it's operated as a merge driver
+# and when it's used to merge conflicts after a patch is applied or after
+# an svn update.
+#
+# It's also used for traditional rejected patches.
+#
+# Args:
+# $fileMine: The merged version of the file. Also known in git as the
+# other branch's version (%B) or "ours".
+# For traditional patch rejects, this is the *.rej file.
+# $fileOlder: The base version of the file. Also known in git as the
+# ancestor version (%O) or "base".
+# For traditional patch rejects, this is the *.orig file.
+# $fileNewer: The current version of the file. Also known in git as the
+# current version (%A) or "theirs".
+# For traditional patch rejects, this is the original-named
+# file.
+#
+# Returns 1 if merge was successful, else 0.
+sub mergeChangeLogs($$$)
+{
+ my ($fileMine, $fileOlder, $fileNewer) = @_;
+
+ my $traditionalReject = $fileMine =~ /\.rej$/ ? 1 : 0;
+
+ local $/ = undef;
+
+ my $patch;
+ if ($traditionalReject) {
+ open(DIFF, "<", $fileMine) or die $!;
+ $patch = <DIFF>;
+ close(DIFF);
+ rename($fileMine, "$fileMine.save");
+ rename($fileOlder, "$fileOlder.save");
+ } else {
+ open(DIFF, "-|", qw(diff -u -a --binary), $fileOlder, $fileMine) or die $!;
+ $patch = <DIFF>;
+ close(DIFF);
+ }
+
+ unlink("${fileNewer}.orig");
+ unlink("${fileNewer}.rej");
+
+ open(PATCH, "| patch --force --fuzz=3 --binary $fileNewer > " . File::Spec->devnull()) or die $!;
+ if ($traditionalReject) {
+ print PATCH $patch;
+ } else {
+ my $changeLogHash = fixChangeLogPatch($patch);
+ print PATCH $changeLogHash->{patch};
+ }
+ close(PATCH);
+
+ my $result = !exitStatus($?);
+
+ # Refuse to merge the patch if it did not apply cleanly
+ if (-e "${fileNewer}.rej") {
+ unlink("${fileNewer}.rej");
+ if (-f "${fileNewer}.orig") {
+ unlink($fileNewer);
+ rename("${fileNewer}.orig", $fileNewer);
+ }
+ } else {
+ unlink("${fileNewer}.orig");
+ }
+
+ if ($traditionalReject) {
+ rename("$fileMine.save", $fileMine);
+ rename("$fileOlder.save", $fileOlder);
+ }
+
+ return $result;
+}
+
sub gitConfig($)
{
return unless $isGit;
diff --git a/WebKitTools/Scripts/build-api-tests b/WebKitTools/Scripts/build-api-tests
new file mode 100755
index 0000000..9db6653
--- /dev/null
+++ b/WebKitTools/Scripts/build-api-tests
@@ -0,0 +1,70 @@
+#!/usr/bin/perl -w
+
+# 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.
+
+use strict;
+use File::Basename;
+use FindBin;
+use Getopt::Long qw(:config pass_through);
+use lib $FindBin::Bin;
+use webkitdirs;
+use POSIX;
+
+my $showHelp = 0;
+my $clean = 0;
+
+my $programName = basename($0);
+my $usage = <<EOF;
+Usage: $programName [options] [options to pass to build system]
+ --help Show this help message
+ --clean Clean up the build directory
+EOF
+
+GetOptions(
+ 'help' => \$showHelp,
+ 'clean' => \$clean,
+);
+
+if ($showHelp) {
+ print STDERR $usage;
+ exit 1;
+}
+
+checkRequiredSystemConfig();
+setConfiguration();
+chdirWebKit();
+
+# Build
+chdir "WebKitTools/TestWebKitAPI" or die;
+
+my $result;
+if (isAppleMacWebKit()) {
+ $result = buildXCodeProject("TestWebKitAPI", $clean, XcodeOptions(), @ARGV);
+} elsif (isAppleWinWebKit()) {
+ $result = buildVisualStudioProject("win/TestWebKitAPI.sln", $clean);
+} else {
+ die "TestWebKitAPI is not supported on this platform.\n";
+}
+
+exit exitStatus($result);
diff --git a/WebKitTools/Scripts/build-dumprendertree b/WebKitTools/Scripts/build-dumprendertree
index 72e81b0..87c720f 100755
--- a/WebKitTools/Scripts/build-dumprendertree
+++ b/WebKitTools/Scripts/build-dumprendertree
@@ -45,6 +45,7 @@ Usage: $programName [options] [options to pass to build system]
--gtk Build the GTK+ port
--qt Build the Qt port
--wx Build the wxWindows port
+ --chromium Build the Chromium port
EOF
GetOptions(
@@ -69,8 +70,8 @@ if (isAppleMacWebKit()) {
$result = buildXCodeProject("DumpRenderTree", $clean, XcodeOptions(), @ARGV);
} elsif (isAppleWinWebKit()) {
$result = buildVisualStudioProject("DumpRenderTree.sln", $clean);
-} elsif (isQt() || isGtk() || isWx()) {
- # Qt, Gtk and wxWindows build everything in one shot. No need to build anything here.
+} elsif (isQt() || isGtk() || isWx() || isChromium()) {
+ # Qt, Gtk wxWindows, and Chromium build everything in one shot. No need to build anything here.
$result = 0;
} else {
die "Building not defined for this platform!\n";
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index 5ae1aae..d9534f8 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -1,7 +1,8 @@
#!/usr/bin/perl -w
-# Copyright (C) 2005, 2006 Apple Inc. All rights reserved.
+# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2010 moiji-mobile.com All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -31,6 +32,7 @@
use strict;
use File::Basename;
+use File::Find;
use File::Spec;
use FindBin;
use Getopt::Long qw(:config pass_through);
@@ -48,23 +50,78 @@ chdirWebKit();
my $showHelp = 0;
my $clean = 0;
my $minimal = 0;
+my $v8 = 0;
+my $installHeaders;
+my $installLibs;
+my $prefixPath;
my $makeArgs;
my $startTime = time();
-my ($threeDCanvasSupport, $threeDRenderingSupport, $channelMessagingSupport, $clientBasedGeolocationSupport, $databaseSupport, $datagridSupport, $datalistSupport,
- $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport, $indexedDatabaseSupport,
- $javaScriptDebuggerSupport, $mathmlSupport, $offlineWebApplicationSupport, $rubySupport, $sharedWorkersSupport,
- $svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport,
- $svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport,
- $xpathSupport, $xsltSupport, $coverageSupport, $notificationsSupport);
+my (
+ $threeDCanvasSupport,
+ $threeDRenderingSupport,
+ $accelerated2dCanvasSupport,
+ $blobSupport,
+ $channelMessagingSupport,
+ $clientBasedGeolocationSupport,
+ $coverageSupport,
+ $databaseSupport,
+ $datagridSupport,
+ $datalistSupport,
+ $deviceOrientationSupport,
+ $directoryUploadSupport,
+ $domStorageSupport,
+ $eventsourceSupport,
+ $fileSystemSupport,
+ $filtersSupport,
+ $fullscreenAPISupport,
+ $geolocationSupport,
+ $iconDatabaseSupport,
+ $imageResizerSupport,
+ $indexedDatabaseSupport,
+ $inputSpeechSupport,
+ $javaScriptDebuggerSupport,
+ $linkPrefetchSupport,
+ $mathmlSupport,
+ $meterTagSupport,
+ $notificationsSupport,
+ $offlineWebApplicationSupport,
+ $progressTagSupport,
+ $sharedWorkersSupport,
+ $svgSupport,
+ $svgAnimationSupport,
+ $svgAsImageSupport,
+ $svgDOMObjCBindingsSupport,
+ $svgFontsSupport,
+ $svgForeignObjectSupport,
+ $svgUseSupport,
+ $systemMallocSupport,
+ $tiledBackingStoreSupport,
+ $videoSupport,
+ $wcssSupport,
+ $webAudioSupport,
+ $webSocketsSupport,
+ $webTimingSupport,
+ $wmlSupport,
+ $workersSupport,
+ $xhtmlmpSupport,
+ $xpathSupport,
+ $xsltSupport,
+);
my @features = (
{ option => "3d-canvas", desc => "Toggle 3D canvas support",
- define => "ENABLE_3D_CANVAS", default => (isAppleMacWebKit() && !isTiger()), value => \$threeDCanvasSupport },
+ define => "ENABLE_3D_CANVAS", default => (isAppleMacWebKit() && !isTiger() && !isLeopard()), value => \$threeDCanvasSupport },
{ option => "3d-rendering", desc => "Toggle 3D rendering support",
define => "ENABLE_3D_RENDERING", default => (isAppleMacWebKit() && !isTiger()), value => \$threeDRenderingSupport },
+ { option => "accelerated-2d-canvas", desc => "Toggle accelerated 2D canvas support",
+ define => "ENABLE_ACCELERATED_2D_CANVAS", default => 0, value => \$accelerated2dCanvasSupport },
+
+ { option => "blob", desc => "Toggle Blob support",
+ define => "ENABLE_BLOB", default => (isAppleMacWebKit()), value => \$blobSupport },
+
{ option => "channel-messaging", desc => "Toggle MessageChannel and MessagePort support",
define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport },
@@ -79,18 +136,30 @@ my @features = (
{ option => "datagrid", desc => "Toggle Datagrid Support",
define => "ENABLE_DATAGRID", default => 0, value => \$datagridSupport },
-
+
{ option => "datalist", desc => "Toggle HTML5 datalist support",
define => "ENABLE_DATALIST", default => 1, value => \$datalistSupport },
-
+
+ { option => "device-orientation", desc => "Toggle DeviceOrientation support",
+ define => "ENABLE_DEVICE_ORIENTATION", default => 0, value => \$deviceOrientationSupport },
+
+ { option => "directory-upload", desc => "Toogle Directory upload support",
+ define => "ENABLE_DIRECTORY_UPLOAD", default => 0, value => \$directoryUploadSupport },
+
{ option => "dom-storage", desc => "Toggle DOM Storage Support",
define => "ENABLE_DOM_STORAGE", default => 1, value => \$domStorageSupport },
{ option => "eventsource", desc => "Toggle server-sent events support",
define => "ENABLE_EVENTSOURCE", default => 1, value => \$eventsourceSupport },
+ { option => "file-system", desc => "Toggle FileSystem support",
+ define => "ENABLE_FILE_SYSTEM", default => 0, value => \$fileSystemSupport },
+
{ option => "filters", desc => "Toggle Filters support",
- define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt()), value => \$filtersSupport },
+ define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt() || isEfl()), value => \$filtersSupport },
+
+ { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
+ define => "ENABLE_FULLSCREEN_API", default => isAppleMacWebKit(), value => \$fullscreenAPISupport },
{ option => "geolocation", desc => "Toggle Geolocation support",
define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isGtk()), value => \$geolocationSupport },
@@ -98,14 +167,26 @@ my @features = (
{ option => "icon-database", desc => "Toggle Icon database support",
define => "ENABLE_ICONDATABASE", default => 1, value => \$iconDatabaseSupport },
+ { option => "image-resizer", desc => "Toggle Image Resizer API support",
+ define => "ENABLE_IMAGE_RESIZER", default => 0, value => \$imageResizerSupport },
+
{ 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 },
+ { option => "link-prefetch", desc => "Toggle pre fetching support",
+ define => "ENABLE_LINK_PREFETCH", default => 0, value => \$linkPrefetchSupport },
+
{ option => "mathml", desc => "Toggle MathML support",
- define => "ENABLE_MATHML", default => 0, value => \$mathmlSupport },
+ define => "ENABLE_MATHML", default => 1, value => \$mathmlSupport },
+
+ { option => "meter-tag", desc => "Meter Tag support",
+ define => "ENABLE_METER_TAG", default => !isGtk() && !isAppleWinWebKit(), value => \$meterTagSupport },
{ option => "notifications", desc => "Toggle Desktop Notifications Support",
define => "ENABLE_NOTIFICATIONS", default => 0, value => \$notificationsSupport },
@@ -113,8 +194,11 @@ my @features = (
{ option => "offline-web-applications", desc => "Toggle Offline Web Application Support",
define => "ENABLE_OFFLINE_WEB_APPLICATIONS", default => 1, value => \$offlineWebApplicationSupport },
- { option => "ruby", desc => "Toggle HTML5 Ruby support",
- define => "ENABLE_RUBY", default => 1, value => \$rubySupport },
+ { option => "progress-tag", desc => "Progress Tag support",
+ define => "ENABLE_PROGRESS_TAG", default => 1, value => \$progressTagSupport },
+
+ { option => "system-malloc", desc => "Toggle system allocator instead of TCmalloc",
+ define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport },
{ option => "shared-workers", desc => "Toggle SharedWorkers support",
define => "ENABLE_SHARED_WORKERS", default => (isAppleWebKit() || isGtk()), value => \$sharedWorkersSupport },
@@ -140,24 +224,33 @@ my @features = (
{ option => "svg-use", desc => "Toggle SVG use element support (implies SVG support)",
define => "ENABLE_SVG_USE", default => 1, value => \$svgUseSupport },
+ { option => "tiled-backing-store", desc => "Toggle Tiled Backing Store support",
+ define => "ENABLE_TILED_BACKING_STORE", default => isQt(), value => \$tiledBackingStoreSupport },
+
{ option => "video", desc => "Toggle Video support",
define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk()), value => \$videoSupport },
+ { option => "wcss", desc => "Toggle WCSS support",
+ define => "ENABLE_WCSS", default => 0, value => \$wcssSupport },
+
+ { option => "web-audio", desc => "Toggle Web Audio support",
+ define => "ENABLE_WEB_AUDIO", default => 0, value=> \$webAudioSupport },
+
{ option => "web-sockets", desc => "Toggle Web Sockets support",
define => "ENABLE_WEB_SOCKETS", default => 1, value=> \$webSocketsSupport },
+ { option => "web-timing", desc => "Toggle Web Timing support",
+ define => "ENABLE_WEB_TIMING", default => 0, value=> \$webTimingSupport },
+
{ option => "wml", desc => "Toggle WML support",
define => "ENABLE_WML", default => 0, value => \$wmlSupport },
- { option => "xhtmlmp", desc => "Toggle XHTML-MP support",
- define => "ENABLE_XHTMLMP", default => 0, value => \$xhtmlmpSupport },
-
- { option => "wcss", desc => "Toggle WCSS support",
- define => "ENABLE_WCSS", default => 0, value => \$wcssSupport },
-
{ option => "workers", desc => "Toggle Web Workers support",
define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk()), value => \$workersSupport },
+ { option => "xhtmlmp", desc => "Toggle XHTML-MP support",
+ define => "ENABLE_XHTMLMP", default => 0, value => \$xhtmlmpSupport },
+
{ option => "xpath", desc => "Toggle XPath support",
define => "ENABLE_XPATH", default => 1, value => \$xpathSupport },
@@ -180,7 +273,8 @@ push @ARGV, split(/ /, $ENV{'BUILD_WEBKIT_ARGS'}) if ($ENV{'BUILD_WEBKIT_ARGS'})
foreach (@ARGV) {
if ($_ eq '--minimal') {
$minimal = 1;
- last;
+ } elsif ($_ eq '--v8') {
+ $v8 = 1;
}
}
@@ -200,12 +294,18 @@ Usage: $programName [options] [options to pass to build system]
--help Show this help message
--clean Cleanup the build directory
--debug Compile in debug mode
- --cairo-win32 Build using Cairo (rather than CoreGraphics) on Windows
+ --wincairo Build using Cairo (rather than CoreGraphics) on Windows
--chromium Build the Chromium port on Mac/Win/Linux
--gtk Build the GTK+ port
--qt Build the Qt port
+ --efl Build the EFL port
--inspector-frontend Copy changes to the inspector front-end files to the build directory
+ --install-headers=<path> Set installation path for the headers (Qt only)
+ --install-libs=<path> Set installation path for the libraries (Qt only)
+ --v8 Use V8 as JavaScript engine (Qt only)
+
+ --prefix=<path> Set installation prefix to the given path (Gtk/Efl only)
--makeargs=<arguments> Optional Makefile flags
--minimal No optional features, unless explicitly enabled.
@@ -215,8 +315,12 @@ EOF
my %options = (
'help' => \$showHelp,
'clean' => \$clean,
+ 'install-headers=s' => \$installHeaders,
+ 'install-libs=s' => \$installLibs,
+ 'prefix=s' => \$prefixPath,
'makeargs=s' => \$makeArgs,
'minimal' => \$minimal,
+ 'v8' => \$v8,
);
# Build usage text and options list from features
@@ -238,10 +342,20 @@ setConfiguration();
my $productDir = productDir();
+# Remove 0 byte sized files from productDir after slave lost for Qt buildbots.
+File::Find::find(\&unlinkZeroFiles, $productDir) if (isQt() && -e $productDir);
+
+sub unlinkZeroFiles ()
+{
+ my $file = $File::Find::name;
+ if (! -s $file) {
+ unlink $file;
+ print "0 byte sized file removed from build directory: $file\n";
+ }
+}
+
# Check that all the project directories are there.
my @projects = ("JavaScriptCore", "WebCore", "WebKit");
-# Only Apple builds JavaScriptGlue, and only on the Mac
-splice @projects, 1, 0, "JavaScriptGlue" if isAppleMacWebKit();
my @otherDirs = ("WebKitLibraries");
for my $dir (@projects, @otherDirs) {
@@ -254,30 +368,40 @@ my @options = ();
# enable autotool options accordingly
if (isGtk()) {
+ @options = @ARGV;
foreach (@features) {
push @options, autotoolsFlag(${$_->{value}}, $_->{option});
}
+ push @options, "--prefix=" . $prefixPath if defined($prefixPath);
push @options, "--makeargs=" . $makeArgs if defined($makeArgs);
} elsif (isAppleMacWebKit()) {
push @options, XcodeOptions();
- sub option($$)
+ sub option($$$)
{
- my ($feature, $isEnabled) = @_;
+ my ($feature, $isEnabled, $defaultValue) = @_;
+ return "" if $defaultValue == $isEnabled;
return $feature . "=" . ($isEnabled ? $feature : " ");
}
foreach (@features) {
- if ($_->{option} eq "coverage") {
- push @options, XcodeCoverageSupportOptions() if $coverageSupport;
- } else {
- push @options, option($_->{define}, ${$_->{value}});
+ if ($_->{option} ne "coverage") {
+ my $option = option($_->{define}, ${$_->{value}}, $_->{default});
+ push @options, $option unless $option eq "";
}
}
- # Copy library and header from WebKitLibraries to a findable place in the product directory.
+ # Apple builds JavaScriptGlue, and only on the Mac.
+ splice @projects, 1, 0, "JavaScriptGlue";
+
+ # ANGLE must come before WebCore
+ splice @projects, 0, 0, "ANGLE";
+
+ # WebKit2 is only supported in SnowLeopard and later at present.
+ push @projects, ("WebKit2", "WebKitTools/MiniBrowser") if osXVersion()->{"minor"} >= 6;
+ # Copy library and header from WebKitLibraries to a findable place in the product directory.
my @librariesToCopy = (
"libWebKitSystemInterfaceTiger.a",
"libWebKitSystemInterfaceLeopard.a",
@@ -315,11 +439,21 @@ if (isGtk()) {
(system("perl WebKitTools/Scripts/update-webkit-support-libs") == 0) or die;
} elsif (isQt()) {
@options = @ARGV;
+ push @options, "--install-headers=" . $installHeaders if defined($installHeaders);
+ push @options, "--install-libs=" . $installLibs if defined($installLibs);
push @options, "--makeargs=" . $makeArgs if defined($makeArgs);
foreach (@features) {
push @options, "DEFINES+=$_->{define}=${$_->{value}}" if ${$_->{value}} != $_->{default};
}
+
+ if ($minimal) {
+ push @options, "CONFIG+=minimal";
+ }
+
+ if ($v8) {
+ push @options, "CONFIG+=v8";
+ }
}
# Force re-link of existing libraries if different than expected
@@ -331,18 +465,39 @@ if (isInspectorFrontend()) {
if (isWx()) {
downloadWafIfNeeded();
- push @projects, 'WebKitTools/DumpRenderTree';
- push @projects, 'WebKitTools/wx/browser';
- push @projects, 'WebKit/wx/bindings/python';
+ @options = ();
+ if (defined($makeArgs)) {
+ @options = split(/ /, $makeArgs);
+ }
+ @projects = ();
+ my $result = buildWafProject('.', $clean, @options);
+ exit exitStatus($result) if exitStatus($result);
}
if (isChromium()) {
+ @options = @ARGV;
# Chromium doesn't build by project directories.
@projects = ();
my $result = buildChromium($clean, @options);
exit exitStatus($result) if exitStatus($result);
}
+if (isEfl()) {
+ @options = ();
+ @projects = ();
+ foreach (@features) {
+ my $featureName = $_->{define};
+ if ($featureName) {
+ my $featureEnabled = ${$_->{value}} ? "ON" : "OFF";
+ push @options, "-D$featureName=$featureEnabled";
+ }
+ }
+ push @options, "--makeargs=" . $makeArgs if defined($makeArgs);
+ push @options, "--prefix=" . $prefixPath if defined($prefixPath);
+ my $result = buildCMakeEflProject($clean, @options);
+ exit exitStatus($result) if exitStatus($result);
+}
+
# Build, and abort if the build fails.
for my $dir (@projects) {
chdir $dir or die;
@@ -359,34 +514,33 @@ for my $dir (@projects) {
} elsif (isQt()) {
$result = buildQMakeQtProject($dir, $clean, @options);
} elsif (isAppleMacWebKit()) {
- $result = buildXCodeProject($dir, $clean, @options, @ARGV);
+ $dir = "MiniBrowser" if $dir eq "WebKitTools/MiniBrowser";
+ my @local_options = @options;
+ push @local_options, XcodeCoverageSupportOptions() if $coverageSupport && $dir ne "ANGLE";
+ $result = buildXCodeProject($dir, $clean, @local_options, @ARGV);
} elsif (isAppleWinWebKit()) {
if ($dir eq "WebKit") {
$result = buildVisualStudioProject("win/WebKit.vcproj/WebKit.sln", $clean);
}
- } elsif (isWx()) {
- @options = ();
- if (defined($makeArgs)) {
- @options = split(/ /, $makeArgs);
- }
- if ($dir eq "WebKit" && isWx()) {
- chdir 'wx' or die;
- }
-
- $result = buildWafProject($dir, $clean, @options);
}
+ # Various build* calls above may change the CWD.
+ chdirWebKit();
if (exitStatus($result)) {
+ my $scriptDir = relativeScriptsDir();
+ if (usingVisualStudioExpress()) {
+ # Visual Studio Express is so lame it can't stdout build failures.
+ # So we find its logs and dump them to the console ourselves.
+ system(File::Spec->catfile($scriptDir, "print-vse-failure-logs"));
+ }
if (isAppleWinWebKit()) {
print "\n\n===== BUILD FAILED ======\n\n";
- my $scriptDir = relativeScriptsDir();
print "Please ensure you have run $scriptDir/update-webkit to install dependencies.\n\n";
my $baseProductDir = baseProductDir();
print "You can view build errors by checking the BuildLog.htm files located at:\n$baseProductDir/obj/<project>/<config>.\n";
}
exit exitStatus($result);
}
- chdirWebKit();
}
# Don't report the "WebKit is now built" message after a clean operation.
diff --git a/WebKitTools/Scripts/build-webkittestrunner b/WebKitTools/Scripts/build-webkittestrunner
new file mode 100755
index 0000000..6cb6ac8
--- /dev/null
+++ b/WebKitTools/Scripts/build-webkittestrunner
@@ -0,0 +1,73 @@
+#!/usr/bin/perl -w
+
+# 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.
+
+use strict;
+use File::Basename;
+use FindBin;
+use Getopt::Long qw(:config pass_through);
+use lib $FindBin::Bin;
+use webkitdirs;
+use POSIX;
+
+my $showHelp = 0;
+my $clean = 0;
+
+my $programName = basename($0);
+my $usage = <<EOF;
+Usage: $programName [options] [options to pass to build system]
+ --help Show this help message
+ --clean Clean up the build directory
+EOF
+
+GetOptions(
+ 'help' => \$showHelp,
+ 'clean' => \$clean,
+);
+
+if ($showHelp) {
+ print STDERR $usage;
+ exit 1;
+}
+
+checkRequiredSystemConfig();
+setConfiguration();
+chdirWebKit();
+
+# Build
+chdir "WebKitTools/WebKitTestRunner" or die;
+
+my $result;
+if (isAppleMacWebKit()) {
+ $result = buildXCodeProject("WebKitTestRunner", $clean, XcodeOptions(), @ARGV);
+} elsif (isAppleWinWebKit()) {
+ $result = buildVisualStudioProject("WebKitTestRunner.sln", $clean);
+} elsif (isQt()) {
+ # Qt builds everything in one shot. No need to build anything here.
+ $result = 0;
+} else {
+ die "WebKitTestRunner is not supported on this platform.\n";
+}
+
+exit exitStatus($result);
diff --git a/WebKitTools/Scripts/check-Xcode-source-file-types b/WebKitTools/Scripts/check-Xcode-source-file-types
new file mode 100755
index 0000000..57a70b9
--- /dev/null
+++ b/WebKitTools/Scripts/check-Xcode-source-file-types
@@ -0,0 +1,168 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2007, 2008, 2009, 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 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 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.
+
+# Script to check that source file extensions match file types in Xcode project.pbxproj files.
+
+# TODO
+# - Add support for file types other than source code files.
+# - Can't differentiate between sourcecode.c.h and sourcecode.cpp.h.
+# (Hint: Use gcc -x c/objective-c/c++/objective-c++ -E. It will
+# take time to check each header using gcc, so make it a switch.)
+
+use strict;
+
+use File::Basename;
+use File::Spec;
+use File::Temp qw(tempfile);
+use Getopt::Long;
+
+# Map of Xcode file types to file extensions.
+my %typeExtensionMap = qw(
+ sourcecode.c.c .c
+ sourcecode.c.h .h
+ sourcecode.c.objc .m
+ sourcecode.cpp.h .h
+ sourcecode.cpp.cpp .cpp
+ sourcecode.cpp.objcpp .mm
+ sourcecode.exports .exp
+ sourcecode.javascript .js
+ sourcecode.make .make
+ sourcecode.mig .defs
+ sourcecode.yacc .y
+);
+
+# Map of file extensions to Xcode file types.
+my %extensionTypeMap = map { $typeExtensionMap{$_} => $_ } keys %typeExtensionMap;
+$extensionTypeMap{'.h'} = 'sourcecode.c.h'; # See TODO list.
+
+my $shouldFixIssues = 0;
+my $printWarnings = 1;
+my $showHelp;
+
+my $getOptionsResult = GetOptions(
+ 'f|fix' => \$shouldFixIssues,
+ 'h|help' => \$showHelp,
+ 'w|warnings!' => \$printWarnings,
+);
+
+if (scalar(@ARGV) == 0 && !$showHelp) {
+ print STDERR "ERROR: No Xcode project files (project.pbxproj) listed on command-line.\n";
+ undef $getOptionsResult;
+}
+
+if (!$getOptionsResult || $showHelp) {
+ print STDERR <<__END__;
+Usage: @{[ basename($0) ]} [options] path/to/project.pbxproj [path/to/project.pbxproj ...]
+ -f|--fix fix mismatched types in Xcode project file
+ -h|--help show this help message
+ -w|--[no-]warnings show or suppress warnings (default: show warnings)
+__END__
+ exit 1;
+}
+
+for my $projectFile (@ARGV) {
+ my $issuesFound = 0;
+ my $issuesFixed = 0;
+
+ if (basename($projectFile) =~ /\.xcodeproj$/) {
+ $projectFile = File::Spec->catfile($projectFile, "project.pbxproj");
+ }
+
+ if (basename($projectFile) ne "project.pbxproj") {
+ print STDERR "WARNING: Not an Xcode project file: $projectFile\n" if $printWarnings;
+ next;
+ }
+
+ open(IN, "< $projectFile") || die "Could not open $projectFile: $!";
+
+ my ($OUT, $tempFileName);
+ if ($shouldFixIssues) {
+ ($OUT, $tempFileName) = tempfile(
+ basename($projectFile) . "-XXXXXXXX",
+ DIR => dirname($projectFile),
+ UNLINK => 0,
+ );
+
+ # Clean up temp file in case of die()
+ $SIG{__DIE__} = sub {
+ close(IN);
+ close($OUT);
+ unlink($tempFileName);
+ };
+ }
+
+ # Fast-forward to "Begin PBXFileReference section".
+ while (my $line = <IN>) {
+ print $OUT $line if $shouldFixIssues;
+ last if $line =~ m#^\Q/* Begin PBXFileReference section */\E$#;
+ }
+
+ while (my $line = <IN>) {
+ if ($line =~ m#^\Q/* End PBXFileReference section */\E$#) {
+ print $OUT $line if $shouldFixIssues;
+ last;
+ }
+
+ if ($line =~ m#^\s*[A-Z0-9]{24} /\* (.+) \*/\s+=\s+\{.*\s+explicitFileType = (sourcecode[^;]*);.*\s+path = ([^;]+);.*\};$#) {
+ my $fileName = $1;
+ my $fileType = $2;
+ my $filePath = $3;
+ my (undef, undef, $fileExtension) = map { lc($_) } fileparse(basename($filePath), qr{\.[^.]+$});
+
+ if (!exists $typeExtensionMap{$fileType}) {
+ $issuesFound++;
+ print STDERR "WARNING: Unknown file type '$fileType' for file '$filePath'.\n" if $printWarnings;
+ } elsif ($typeExtensionMap{$fileType} ne $fileExtension) {
+ $issuesFound++;
+ print STDERR "WARNING: Incorrect file type '$fileType' for file '$filePath'.\n" if $printWarnings;
+ $line =~ s/(\s+)explicitFileType( = )(sourcecode[^;]*);/$1lastKnownFileType$2$extensionTypeMap{$fileExtension};/;
+ $issuesFixed++ if $shouldFixIssues;
+ }
+ }
+
+ print $OUT $line if $shouldFixIssues;
+ }
+
+ # Output the rest of the file.
+ print $OUT <IN> if $shouldFixIssues;
+
+ close(IN);
+
+ if ($shouldFixIssues) {
+ close($OUT);
+
+ unlink($projectFile) || die "Could not delete $projectFile: $!";
+ rename($tempFileName, $projectFile) || die "Could not rename $tempFileName to $projectFile: $!";
+ }
+
+ if ($printWarnings) {
+ printf STDERR "%s issues found for $projectFile.\n", ($issuesFound ? $issuesFound : "No");
+ print STDERR "$issuesFixed issues fixed for $projectFile.\n" if $issuesFixed && $shouldFixIssues;
+ print STDERR "NOTE: Open $projectFile in Xcode to let it have its way with the file.\n" if $issuesFixed;
+ print STDERR "\n";
+ }
+}
+
+exit 0;
diff --git a/WebKitTools/Scripts/check-for-global-initializers b/WebKitTools/Scripts/check-for-global-initializers
index cf83048..102fa09 100755
--- a/WebKitTools/Scripts/check-for-global-initializers
+++ b/WebKitTools/Scripts/check-for-global-initializers
@@ -37,6 +37,7 @@ use strict;
use File::Basename;
sub touch($);
+sub demangle($);
my $arch = $ENV{'CURRENT_ARCH'};
my $configuration = $ENV{'CONFIGURATION'};
@@ -78,9 +79,14 @@ for my $file (sort @files) {
next;
}
my $sawGlobal = 0;
+ my @globals;
while (<NM>) {
if (/^STDOUT:/) {
- $sawGlobal = 1 if /__GLOBAL__I/;
+ my $line = $_;
+ if ($line =~ /__GLOBAL__I(.+)$/) {
+ $sawGlobal = 1;
+ push(@globals, demangle($1));
+ }
} else {
print STDERR if $_ ne "nm: no name list\n";
}
@@ -99,18 +105,19 @@ for my $file (sort @files) {
next if $shortName eq "nodes.o";
}
if ($target eq "WebCore") {
+ next if $shortName eq "BidiRun.o";
next if $shortName eq "CachedPage.o";
next if $shortName eq "CachedResource.o";
+ next if $shortName eq "FEGaussianBlur.o";
next if $shortName eq "Frame.o";
next if $shortName eq "JSCustomSQLTransactionCallback.o";
next if $shortName eq "JSLazyEventListener.o";
next if $shortName eq "Node.o";
next if $shortName eq "Page.o";
next if $shortName eq "Range.o";
- next if $shortName eq "BidiRun.o";
next if $shortName eq "RenderObject.o";
- next if $shortName eq "SubresourceLoader.o";
next if $shortName eq "SVGElementInstance.o";
+ next if $shortName eq "SubresourceLoader.o";
next if $shortName eq "XMLHttpRequest.o";
}
if ($target eq "WebKit") {
@@ -119,7 +126,7 @@ for my $file (sort @files) {
}
}
- print "ERROR: $shortName has a global initializer in it! ($file)\n";
+ print "ERROR: $shortName has one or more global initializers in it! ($file), near @globals\n";
$sawError = 1;
}
}
@@ -138,3 +145,17 @@ sub touch($)
open(TOUCH, ">", $path) or die "$!";
close(TOUCH);
}
+
+sub demangle($)
+{
+ my ($symbol) = @_;
+ if (!open FILT, "c++filt $symbol |") {
+ print "ERROR: Could not open c++filt\n";
+ return;
+ }
+ my $result = <FILT>;
+ close FILT;
+ chomp $result;
+ return $result;
+}
+
diff --git a/WebKitTools/Scripts/check-for-inappropriate-files-in-framework b/WebKitTools/Scripts/check-for-inappropriate-files-in-framework
new file mode 100755
index 0000000..a323bc4
--- /dev/null
+++ b/WebKitTools/Scripts/check-for-inappropriate-files-in-framework
@@ -0,0 +1,68 @@
+#!/usr/bin/env ruby
+
+# 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.
+
+base_directory = ENV['TARGET_BUILD_DIR'] or throw "Unable to find TARGET_BUILD_DIR in the environment!"
+project_name = ENV['PROJECT_NAME'] or throw "Unable to find PROJECT_NAME in the environment!"
+is_shallow_bundle = (ENV['SHALLOW_BUNDLE'] || "NO").upcase == "YES"
+
+$INAPPROPRIATE_FILES = { "WebCore" => { "Resources" => ["*.css", "*.in", "*.idl"] } }
+
+Dir.chdir base_directory
+
+$error_printed = false
+
+def print_error msg
+ $error_printed = true
+ STDERR.puts "ERROR: #{msg}"
+end
+
+def print_inappropriate_file_error framework, relative_path
+ print_error "#{framework}.framework/#{relative_path} should not be present in the framework."
+end
+
+def check_framework framework, is_shallow_bundle
+ $INAPPROPRIATE_FILES[framework].each do |directory, patterns|
+ framework_bundle_path = is_shallow_bundle ? "#{framework}.framework" : "#{framework}.framework/Versions/A/#{directory}"
+ Dir.chdir framework_bundle_path do
+ patterns.each do |pattern|
+ Dir.glob(pattern).each do |inappropriate_file|
+ print_inappropriate_file_error framework, is_shallow_bundle ? inappropriate_file : "#{directory}/#{inappropriate_file}"
+ File.unlink inappropriate_file
+ end
+ end
+ end
+ end
+end
+
+check_framework project_name, is_shallow_bundle
+
+if $error_printed
+ STDERR.puts
+ STDERR.puts " Inappropriate files were detected and have been removed from the framework."
+ STDERR.puts " If this error continues to appear after building again then the build system needs"
+ STDERR.puts " to be modified so that the inappropriate files are no longer copied in to the framework."
+ STDERR.puts
+ exit 1
+end
diff --git a/WebKitTools/Scripts/check-for-webkit-framework-include-consistency b/WebKitTools/Scripts/check-for-webkit-framework-include-consistency
new file mode 100755
index 0000000..339fa7e
--- /dev/null
+++ b/WebKitTools/Scripts/check-for-webkit-framework-include-consistency
@@ -0,0 +1,111 @@
+#!/usr/bin/env ruby
+
+# 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.
+
+
+base_directory = ENV['TARGET_BUILD_DIR'] or throw "Unable to find TARGET_BUILD_DIR in the environment!"
+is_shallow_bundle = (ENV['SHALLOW_BUNDLE'] || "NO").upcase == "YES"
+
+unless base_directory
+ throw "Unable to find TARGET_BUILD_DIR in the environment!"
+end
+
+Dir.chdir base_directory
+
+$PERMITTED_INCLUDE_TYPES = { :public => [ :public ], :private => [ :public, :private ] }
+
+$HEADER_NAMES_TO_TYPE = { }
+$HEADERS_BY_TYPE = { :public => [], :private => [] }
+
+$error_printed = false
+
+def print_error msg
+ $error_printed = true
+ STDERR.puts "ERROR: #{msg}"
+end
+
+def build_header_maps is_shallow_bundle
+ current_version_path = is_shallow_bundle ? "" : "Versions/A/"
+ all_headers = `find WebKit.framework/#{current_version_path}{,Private}Headers -type f -name '*.h'`.split
+
+ all_headers.each do |header|
+ if /\/Headers\/(.*)/.match(header)
+ $HEADER_NAMES_TO_TYPE[$1] = :public
+ $HEADERS_BY_TYPE[:public] << header
+ elsif /\/PrivateHeaders\/(.*)/.match(header)
+ $HEADER_NAMES_TO_TYPE[$1] = :private
+ $HEADERS_BY_TYPE[:private] << header
+ else
+ print_error "Unknown header type: #{header}"
+ end
+ end
+end
+
+def resolve_include(header, included_header, permitted_types)
+ # Ignore includes that aren't in the typical framework style.
+ return unless /<([^\/]+)\/(.*)>/.match(included_header)
+
+ framework, included_header_name = [$1, $2]
+
+ # Ignore includes that aren't related to other WebKit headers.
+ return unless framework =~ /^Web/
+
+ # A header of any type including a WebCore header is a recipe for disaster.
+ if framework == "WebCore"
+ # <rdar://problem/7718826> WebKeyGenerator.h should not include a WebCore header
+ return if header =~ /\/WebKeyGenerator.h$/ and included_header_name == "WebCoreKeyGenerator.h"
+
+ print_error "#{header} included #{included_header}!"
+ return
+ end
+
+ header_type = $HEADER_NAMES_TO_TYPE[included_header_name]
+
+ if not header_type
+ print_error "#{header} included #{included_header} but I could not find a header of that name!"
+ elsif not permitted_types.member?(header_type)
+ print_error "#{header} included #{included_header} which is #{header_type}!"
+ end
+end
+
+def verify_includes(header, permitted_types)
+ File.open(header) do |file|
+ file.each_line do |line|
+ if /#(include|import) (.*)/.match(line)
+ resolve_include(header, $2, permitted_types)
+ end
+ end
+ end
+end
+
+build_header_maps is_shallow_bundle
+
+$HEADERS_BY_TYPE.each do |header_type, headers|
+ permitted_types = $PERMITTED_INCLUDE_TYPES[header_type]
+ headers.each do |header|
+ verify_includes header, permitted_types
+ end
+end
+
+exit 1 if $error_printed
diff --git a/WebKitTools/Scripts/check-webkit-style b/WebKitTools/Scripts/check-webkit-style
index 501264b..076c712 100755
--- a/WebKitTools/Scripts/check-webkit-style
+++ b/WebKitTools/Scripts/check-webkit-style
@@ -43,52 +43,91 @@ same line, but it is far from perfect (in either direction).
"""
import codecs
+import logging
import os
import os.path
import sys
+from webkitpy.style_references import detect_checkout
import webkitpy.style.checker as checker
-from webkitpy.style_references import SimpleScm
+from webkitpy.style.patchreader import PatchReader
+from webkitpy.style.checker import StyleProcessor
+from webkitpy.style.filereader import TextFileReader
+from webkitpy.style.main import change_directory
+_log = logging.getLogger("check-webkit-style")
+
+
+# FIXME: Move this code to style.main.
def main():
# Change stderr to write with replacement characters so we don't die
# if we try to print something containing non-ASCII characters.
- sys.stderr = codecs.StreamReaderWriter(sys.stderr,
- codecs.getreader('utf8'),
- codecs.getwriter('utf8'),
- 'replace')
+ stderr = codecs.StreamReaderWriter(sys.stderr,
+ codecs.getreader('utf8'),
+ codecs.getwriter('utf8'),
+ 'replace')
+ # Setting an "encoding" attribute on the stream is necessary to
+ # prevent the logging module from raising an error. See
+ # the checker.configure_logging() function for more information.
+ stderr.encoding = "UTF-8"
+
+ # FIXME: Change webkitpy.style so that we do not need to overwrite
+ # the global sys.stderr. This involves updating the code to
+ # accept a stream parameter where necessary, and not calling
+ # sys.stderr explicitly anywhere.
+ sys.stderr = stderr
+
+ args = sys.argv[1:]
+
+ # Checking for the verbose flag before calling check_webkit_style_parser()
+ # lets us enable verbose logging earlier.
+ is_verbose = "-v" in args or "--verbose" in args
+
+ checker.configure_logging(stream=stderr, is_verbose=is_verbose)
+ _log.debug("Verbose logging enabled.")
+
+ parser = checker.check_webkit_style_parser()
+ (paths, options) = parser.parse(args)
+
+ checkout = detect_checkout()
+
+ if checkout is None:
+ if not paths:
+ _log.error("WebKit checkout not found: You must run this script "
+ "from within a WebKit checkout if you are not passing "
+ "specific paths to check.")
+ sys.exit(1)
+
+ checkout_root = None
+ _log.debug("WebKit checkout not found for current directory.")
+ else:
+ checkout_root = checkout.root_path()
+ _log.debug("WebKit checkout found with root: %s" % checkout_root)
- defaults = checker.webkit_argument_defaults()
+ configuration = checker.check_webkit_style_configuration(options)
- parser = checker.ArgumentParser(defaults)
- (files, options) = parser.parse(sys.argv[1:])
+ paths = change_directory(checkout_root=checkout_root, paths=paths)
- style_checker = checker.StyleChecker(options)
+ style_processor = StyleProcessor(configuration)
- if files:
- for filename in files:
- style_checker.check_file(filename)
+ file_reader = TextFileReader(style_processor)
+ if paths and not options.diff_files:
+ file_reader.process_paths(paths)
else:
- scm = SimpleScm()
-
- os.chdir(scm.checkout_root())
-
- if options.git_commit:
- commit = options.git_commit
- if '..' in commit:
- # FIXME: If the range is a "...", the code should find the common ancestor and
- # start there (see git diff --help for information about how ... usually works).
- commit = commit[:commit.find('..')]
- print >> sys.stderr, "Warning: Ranges are not supported for --git-commit. Checking all changes since %s.\n" % commit
- patch = scm.create_patch_since_local_commit(commit)
- else:
- patch = scm.create_patch()
- style_checker.check_patch(patch)
-
- error_count = style_checker.error_count
- sys.stderr.write('Total errors found: %d\n' % error_count)
- sys.exit(error_count > 0)
+ changed_files = paths if options.diff_files else None
+ patch = checkout.create_patch(options.git_commit, changed_files=changed_files)
+ patch_checker = PatchReader(file_reader)
+ patch_checker.check(patch)
+
+ error_count = style_processor.error_count
+ file_count = file_reader.file_count
+ delete_only_file_count = file_reader.delete_only_file_count
+
+ _log.info("Total errors found: %d in %d files"
+ % (error_count, file_count))
+ # We fail when style errors are found or there are no checked files.
+ sys.exit(error_count > 0 or (file_count == 0 and delete_only_file_count == 0))
if __name__ == "__main__":
diff --git a/WebKitTools/Scripts/commit-log-editor b/WebKitTools/Scripts/commit-log-editor
index 75017e3..f40295d 100755
--- a/WebKitTools/Scripts/commit-log-editor
+++ b/WebKitTools/Scripts/commit-log-editor
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -40,6 +40,7 @@ use webkitdirs;
sub normalizeLineEndings($$);
sub removeLongestCommonPrefixEndingInDoubleNewline(\%);
+sub isCommitLogEditor($);
sub usage
{
@@ -61,30 +62,47 @@ if (!$log) {
my $baseDir = baseProductDir();
my $editor = $ENV{SVN_LOG_EDITOR};
-if (!$editor) {
- $editor = $ENV{CVS_LOG_EDITOR};
-}
+$editor = $ENV{CVS_LOG_EDITOR} if !$editor;
+$editor = "" if $editor && isCommitLogEditor($editor);
+
+my $splitEditor = 1;
if (!$editor) {
my $builtEditorApplication = "$baseDir/Release/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
- $editor = $builtEditorApplication if -x $builtEditorApplication;
+ if (-x $builtEditorApplication) {
+ $editor = $builtEditorApplication;
+ $splitEditor = 0;
+ }
}
if (!$editor) {
my $builtEditorApplication = "$baseDir/Debug/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
- $editor = $builtEditorApplication if -x $builtEditorApplication;
+ if (-x $builtEditorApplication) {
+ $editor = $builtEditorApplication;
+ $splitEditor = 0;
+ }
}
if (!$editor) {
- my $installedEditorApplication = "$ENV{HOME}/Applications/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
- $editor = $installedEditorApplication if -x $installedEditorApplication;
+ my $builtEditorApplication = "$ENV{HOME}/Applications/Commit Log Editor.app/Contents/MacOS/Commit Log Editor";
+ if (-x $builtEditorApplication) {
+ $editor = $builtEditorApplication;
+ $splitEditor = 0;
+ }
}
-if (!$editor) {
- $editor = $ENV{EDITOR} || "/usr/bin/vi";
+
+$editor = $ENV{EDITOR} if !$editor;
+$editor = "/usr/bin/vi" if !$editor;
+
+my @editor;
+if ($splitEditor) {
+ @editor = split ' ', $editor;
+} else {
+ @editor = ($editor);
}
my $inChangesToBeCommitted = !isGit();
my @changeLogs = ();
my $logContents = "";
my $existingLog = 0;
-open LOG, $log or die;
+open LOG, $log or die "Could not open the log file.";
while (<LOG>) {
if (isGit()) {
if (/^# Changes to be committed:$/) {
@@ -102,7 +120,7 @@ while (<LOG>) {
}
$existingLog = isGit() && !(/^#/ || /^\s*$/) unless $existingLog;
- push @changeLogs, makeFilePathRelative($1) if $inChangesToBeCommitted && (/^M....(.*ChangeLog)\r?\n?$/ || /^#\tmodified: (.*ChangeLog)/) && !/-ChangeLog/;
+ push @changeLogs, makeFilePathRelative($1) if $inChangesToBeCommitted && (/^(?:M|A)....(.*ChangeLog)\r?\n?$/ || /^#\t(?:modified|new file): (.*ChangeLog)$/) && !/-ChangeLog$/;
}
close LOG;
@@ -120,9 +138,8 @@ if ($regenerateLog && $existingLog && scalar(@changeLogs) > 0) {
$keepExistingLog = 0 if ($key eq "r");
}
-# Don't change anything if there's already a log message
-# (as can happen with git-commit --amend)
-exec $editor, @ARGV if $existingLog && $keepExistingLog;
+# Don't change anything if there's already a log message (as can happen with git-commit --amend).
+exec (@editor, @ARGV) if $existingLog && $keepExistingLog;
my $topLevel = determineVCSRoot();
@@ -151,8 +168,8 @@ for my $changeLog (@changeLogs) {
# Remove indentation spaces
$line =~ s/^ {8}//;
- # Save the reviewed by line
- if ($line =~ m/^Reviewed by .*/) {
+ # Save the reviewed / rubber stamped by line.
+ if ($line =~ m/^Reviewed by .*/ || $line =~ m/^Rubber[ \-]?stamped by .*/) {
$reviewedByLine = $line;
next;
}
@@ -184,7 +201,6 @@ for my $changeLog (@changeLogs) {
$reviewedByLine = "";
}
-
$lineCount++;
$contents .= $line;
} else {
@@ -204,12 +220,6 @@ for my $changeLog (@changeLogs) {
my $sortKey = lc $label;
if ($label eq "top level") {
$sortKey = "";
- } elsif ($label eq "Tools") {
- $sortKey = "-, just after top level";
- } elsif ($label eq "WebBrowser") {
- $sortKey = lc "WebKit, WebBrowser after";
- } elsif ($label eq "WebCore") {
- $sortKey = lc "WebFoundation, WebCore after";
} elsif ($label eq "LayoutTests") {
$sortKey = lc "~, LayoutTests last";
}
@@ -251,7 +261,7 @@ if (isGit() && scalar keys %changeLogSort == 0) {
print NEWLOG $logContents;
close NEWLOG;
-system $editor, "$log.edit";
+system (@editor, "$log.edit");
open NEWLOG, "$log.edit" or exit;
my $foundComment = 0;
@@ -307,3 +317,9 @@ sub removeLongestCommonPrefixEndingInDoubleNewline(\%)
}
return substr($prefix, 0, $lastDoubleNewline + 2);
}
+
+sub isCommitLogEditor($)
+{
+ my $editor = shift;
+ return $editor =~ m/commit-log-editor/;
+}
diff --git a/WebKitTools/Scripts/debug-minibrowser b/WebKitTools/Scripts/debug-minibrowser
new file mode 100755
index 0000000..06685b4
--- /dev/null
+++ b/WebKitTools/Scripts/debug-minibrowser
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2005, 2007 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.
+# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
+
+# Simplified "debug" script for debugging the WebKit2 MiniBrowser.
+
+use strict;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+setConfiguration();
+
+exit exitStatus(debugMiniBrowser());
diff --git a/WebKitTools/Scripts/debug-test-runner b/WebKitTools/Scripts/debug-test-runner
new file mode 100755
index 0000000..5a9b7f9
--- /dev/null
+++ b/WebKitTools/Scripts/debug-test-runner
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+# 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.
+
+# Simplified "debug" script for debugging the WebKitTestRunner.
+
+use strict;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+setConfiguration();
+
+exit exitStatus(debugWebKitTestRunner());
diff --git a/WebKitTools/Scripts/deduplicate-tests b/WebKitTools/Scripts/deduplicate-tests
new file mode 100755
index 0000000..f0afe13
--- /dev/null
+++ b/WebKitTools/Scripts/deduplicate-tests
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 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 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 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.
+
+"""deduplicate-tests -- print test results duplicated between platforms.
+
+If platform/mac-leopard is missing an expected test output, we fall back on
+platform/mac. This means it's possible to grow redundant test outputs,
+where we have the same expected data in both a platform directory and another
+platform it falls back on.
+
+This command dumps out all such files. You can use it like this:
+ deduplicate-tests --verbose # print out the duplicated files
+ deduplicate-tests | xargs git rm # delete them
+"""
+
+
+import optparse
+import webkitpy.common.system.logutils as logutils
+import webkitpy.layout_tests.deduplicate_tests as deduplicate_tests
+
+
+def parse_args():
+ """Provides a default set of command line args.
+
+ Returns a tuple of options, args from optparse"""
+
+ configuration_options = [
+ optparse.make_option("-v", "--verbose", dest="verbose",
+ action="store_true", default=False,
+ help="Verbose output."),
+ optparse.make_option("-g", "--glob", dest="glob_pattern",
+ default="*-expected*",
+ help="Specify the glob to filter the files, defaults to *-expected*."),
+ ]
+
+ option_list = (configuration_options)
+ option_parser = optparse.OptionParser(option_list=option_list)
+
+ options, _ = option_parser.parse_args()
+
+ return options
+
+
+def run(options):
+ logutils.configure_logging()
+ if options.verbose:
+ format = ("* %(test)s\n"
+ "\tredundantly on %(platform)s and %(fallback)s\n"
+ "\tconsider deleting %(path)s")
+ else:
+ format = "%(path)s"
+
+ for dupe in deduplicate_tests.deduplicate(options.glob_pattern):
+ print(format % dupe)
+
+
+def main():
+ options = parse_args()
+ run(options)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/WebKitTools/Scripts/do-file-rename b/WebKitTools/Scripts/do-file-rename
index ac5099e..9c4c898 100755
--- a/WebKitTools/Scripts/do-file-rename
+++ b/WebKitTools/Scripts/do-file-rename
@@ -29,10 +29,11 @@
# Script to do file renaming.
use strict;
+use File::Find;
use FindBin;
use lib $FindBin::Bin;
use webkitdirs;
-use File::Find;
+use VCSUtils;
setConfiguration();
chdirWebKit();
@@ -46,6 +47,7 @@ find(\&wanted, "JavaScriptCore");
find(\&wanted, "JavaScriptGlue");
find(\&wanted, "WebCore");
find(\&wanted, "WebKit");
+find(\&wanted, "WebKit2");
sub wanted
{
@@ -86,7 +88,7 @@ for my $file (sort @paths) {
if ($newFile{$file}) {
my $newFile = $newFile{$file};
print "Renaming $file to $newFile\n";
- system "svn move $file $newFile";
+ scmMoveOrRenameFile($file, $newFile);
}
}
diff --git a/WebKitTools/Scripts/do-webcore-rename b/WebKitTools/Scripts/do-webcore-rename
index 56d8bed..6dcb719 100755
--- a/WebKitTools/Scripts/do-webcore-rename
+++ b/WebKitTools/Scripts/do-webcore-rename
@@ -29,16 +29,42 @@
# Script to do a rename in JavaScriptCore, WebCore, and WebKit.
use strict;
+
+use File::Find;
use FindBin;
+use Getopt::Long qw(:config pass_through);
+
use lib $FindBin::Bin;
use webkitdirs;
-use File::Find;
use VCSUtils;
setConfiguration();
chdirWebKit();
-my %words;
+my $showHelp;
+my $verbose;
+
+my $programName = basename($0);
+my $usage = <<EOF;
+Usage: $programName [options]
+ -h|--help Show this help message
+ -v|--verbose More verbose output
+EOF
+
+my $getOptionsResult = GetOptions(
+ 'help|h' => \$showHelp,
+ 'verbose|v' => \$verbose,
+);
+
+if (!$getOptionsResult || $showHelp) {
+ print STDERR $usage;
+ exit 1;
+}
+
+my @directoriesToIgnoreList = (
+ "icu",
+);
+my %directoriesToIgnore = map { $_ => 1 } @directoriesToIgnoreList;
# find all files we want to process
@@ -47,29 +73,30 @@ find(\&wanted, "JavaScriptCore");
find(\&wanted, "JavaScriptGlue");
find(\&wanted, "WebCore");
find(\&wanted, "WebKit");
+find(\&wanted, "WebKit2");
sub wanted
{
my $file = $_;
- if ($file eq "icu") {
- $File::Find::prune = 1;
- return;
- }
-
- if ($file =~ /^\../) {
+ # Ignore excluded and hidden files/directories.
+ if ($directoriesToIgnore{$file} or $file =~ /^\../ or $file =~ /^ChangeLog/) {
+ print "Ignoring $File::Find::name\n" if $verbose;
$File::Find::prune = 1;
return;
}
- return if $file =~ /^ChangeLog/;
return if -d $file;
push @paths, $File::Find::name;
}
+
+# Setting isDOMTypeRename to 1 rather than 0 expands the regexps used
+# below to handle custom JavaScript bindings.
my $isDOMTypeRename = 0;
my %renames = (
- "m_sel" => "m_selection",
+ # Renames go here in the form of:
+ "DocLoader" => "CachedResourceLoader",
);
my %renamesContemplatedForTheFuture = (
@@ -142,29 +169,49 @@ my %renamesContemplatedForTheFuture = (
"NativeFunction" => "HostFunction",
);
+# Sort the keys of the renames hash in order of decreasing length. This
+# handles the case where some of the renames are substrings of others;
+# i.e., "Foo" => "Bar" and "FooBuffer" => "BarBuffer".
+my @sortedRenameKeys = sort { length($b) - length($a) } keys %renames;
+
# rename files
+sub renameFile
+{
+ my $file = shift;
+
+ if ($isDOMTypeRename) {
+ # Find the longest key in %renames which matches this more permissive regexp.
+ # (The old regexp would match ".../Foo.cpp" but not ".../JSFooCustom.cpp".)
+ # This handles renaming of custom JavaScript bindings even when some of the
+ # renames are substrings of others. The only reason we don't do this all the
+ # time is to avoid accidental file renamings for short, non-DOM renames.
+ for my $key (@sortedRenameKeys) {
+ my $newFile = "";
+ $newFile = "$1$renames{$2}$3" if $file =~ /^(.*\/\w*)($key)(\w*\.\w+)$/;
+ if ($newFile ne "") {
+ return $newFile;
+ }
+ }
+ } else {
+ $file = "$1$renames{$2}$3" if $file =~ /^(.*\/)(\w+)(\.\w+)$/ && $renames{$2};
+ }
+ return $file;
+}
+
my %newFile;
for my $file (sort @paths) {
- my $f = $file;
- $f = "$1$renames{$2}$3" if $f =~ /^(.*\/)(\w+)(\.\w+)$/ && $renames{$2};
+ my $f = renameFile($file);
if ($f ne $file) {
$newFile{$file} = $f;
}
}
-
-my $isGit = isGit();
-
for my $file (sort @paths) {
if ($newFile{$file}) {
my $newFile = $newFile{$file};
print "Renaming $file to $newFile\n";
- if ($isGit) {
- system "git mv $file $newFile";
- } else {
- system "svn move $file $newFile";
- }
+ scmMoveOrRenameFile($file, $newFile);
}
}
@@ -175,24 +222,25 @@ for my $file (sort @paths) {
my $contents;
{
local $/;
- open FILE, $file or die;
+ open FILE, $file or die "Failed to open $file";
$contents = <FILE>;
close FILE;
}
my $newContents = $contents;
if ($isDOMTypeRename) {
- for my $from (keys %renames) {
- $newContents =~ s/\b$from/$renames{$from}/g;
+ for my $from (@sortedRenameKeys) {
+ # Handle JavaScript custom bindings.
+ $newContents =~ s/\b(JS|V8|to|)$from/$1$renames{$from}/g;
}
} else {
- for my $from (keys %renames) {
+ for my $from (@sortedRenameKeys) {
$newContents =~ s/\b$from(?!["\w])/$renames{$from}/g; # this " unconfuses Xcode syntax highlighting
}
}
if ($newContents ne $contents) {
- open FILE, ">", $file or die;
+ open FILE, ">", $file or die "Failed to open $file";
print FILE $newContents;
close FILE;
}
diff --git a/WebKitTools/Scripts/ensure-valid-python b/WebKitTools/Scripts/ensure-valid-python
new file mode 100755
index 0000000..aede812
--- /dev/null
+++ b/WebKitTools/Scripts/ensure-valid-python
@@ -0,0 +1,152 @@
+#!/usr/bin/perl -w
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 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.
+# 3. Neither the name of Apple Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
+
+use strict;
+
+use File::Basename;
+use File::Spec;
+use File::Temp qw(tempdir);
+use FindBin;
+use Getopt::Long;
+
+use lib $FindBin::Bin;
+use webkitdirs;
+use VCSUtils;
+
+my $macPythonURL = "http://www.python.org/ftp/python/2.6.5/python-2.6.5-macosx10.3-2010-03-24.dmg";
+my $macPythonMD5 = "84489bba813fdbb6041b69d4310a86da";
+my $macPythonInstallerName = "Python.mpkg";
+
+# We could use a consistent download location, like the source or build directory.
+my $tempDirectory = File::Temp::tempdir("WebKitPythonXXXX", TMPDIR => 1, CLEANUP => 1);
+my $downloadDirectory = $tempDirectory;
+my $mountPoint = File::Spec->join($tempDirectory, "mount");
+
+sub checkPythonVersion()
+{
+ # Will exit 0 if Python is 2.5 or greater, non-zero otherwise.
+ `python -c "import sys;sys.exit(sys.version_info[:2] < (2,5))"`;
+ return exitStatus($?) == 0;
+}
+
+sub downloadFileToPath($$)
+{
+ my ($remoteURL, $localPath) = @_;
+ print "Downloading $remoteURL to $localPath\n";
+ my $exitCode = system("curl", "-o", $localPath, $remoteURL);
+ return exitStatus($exitCode) == 0;
+}
+
+sub checkMD5($$)
+{
+ my ($path, $expectedMD5) = @_;
+ my $md5Output = `md5 -q "$path"`;
+ chomp($md5Output);
+ my $isValid = $md5Output eq $expectedMD5;
+ print "'$md5Output' does not match expected: '$expectedMD5'\n" unless $isValid;
+ return $isValid;
+}
+
+sub mountDMG($$)
+{
+ my ($dmgPath, $mountPoint) = @_;
+ print "Mounting $dmgPath at $mountPoint\n";
+ return system("hdiutil", "attach", "-mountpoint", $mountPoint, "-nobrowse", $dmgPath) == 0;
+}
+
+sub unmountDMG($)
+{
+ my ($mountPoint) = @_;
+ print "Unmounting disk image from $mountPoint\n";
+ my $exitCode = system("hdiutil", "detach", $mountPoint);
+ return exitStatus($exitCode) == 0;
+}
+
+sub runInstaller($)
+{
+ my ($installerPackage) = @_;
+ print "sudo will now ask for your password to run the Python installer.\n";
+ print "The installer will install Python in /Library/Frameworks/Python.framework\n";
+ print "and add symlinks from /usr/local/bin.\n";
+ return system("sudo", "installer", "-verbose", "-pkg", $installerPackage, "-target", "/") == 0;
+}
+
+sub downloadAndMountMacPythonDMG($$)
+{
+ my ($pythonURL, $pythonMD5) = @_;
+ my $localFilename = basename($pythonURL);
+ my $localPath = File::Spec->join($downloadDirectory, $localFilename);
+
+ downloadFileToPath($pythonURL, $localPath) or die "Failed to download $pythonURL";
+ checkMD5($localPath, $pythonMD5) or die "MD5 check failed on $localPath";
+ return mountDMG($localPath, $mountPoint);
+}
+
+sub installMacPython()
+{
+ downloadAndMountMacPythonDMG($macPythonURL, $macPythonMD5) or die "Failed to download and mount disk image.";
+ print "Mounted python install image at: $mountPoint\n";
+ my $installerPackage = File::Spec->join($mountPoint, $macPythonInstallerName);
+ my $installSuccess = runInstaller($installerPackage);
+ unmountDMG($mountPoint) or die "Failed to unmount disk image from $mountPoint";
+ return $installSuccess;
+}
+
+sub main()
+{
+ my $checkOnly = 0;
+ my $showHelp = 0;
+ my $getOptionsResult = GetOptions(
+ 'check-only!' => \$checkOnly,
+ 'help|h' => \$showHelp,
+ );
+ if (!$getOptionsResult || $showHelp) {
+ print STDERR <<HELP;
+Usage: $0 [options]
+ --check-only Check python version only.
+ -h|--help Show this help message.
+HELP
+ return 1;
+ }
+ # Congrats, your Python is fine.
+ return 0 if checkPythonVersion();
+
+ return 1 if $checkOnly;
+
+ if (!isTiger()) {
+ print "Your Python version is insufficient to run WebKit's Python code. Please update.\n";
+ print "See http://trac.webkit.org/wiki/PythonGuidelines for more info.\n";
+ return 1;
+ }
+
+ installMacPython() or die "Failed to install Python.";
+
+ checkPythonVersion() or die "Final version check failed, must have failed to update Python";
+ print "Successfully updated python.\n";
+}
+
+exit(main());
diff --git a/WebKitTools/Scripts/extract-localizable-strings b/WebKitTools/Scripts/extract-localizable-strings
index cf4f8f0..b31550a 100755
--- a/WebKitTools/Scripts/extract-localizable-strings
+++ b/WebKitTools/Scripts/extract-localizable-strings
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007, 2009, 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
@@ -48,7 +48,7 @@ sub UnescapeHexSequence($);
my %isDebugMacro = ( ASSERT_WITH_MESSAGE => 1, LOG_ERROR => 1, ERROR => 1, NSURL_ERROR => 1, FATAL => 1, LOG => 1, LOG_WARNING => 1, UI_STRING_LOCALIZE_LATER => 1, LPCTSTR_UI_STRING_LOCALIZE_LATER => 1, UNLOCALIZED_STRING => 1, UNLOCALIZED_LPCTSTR => 1, dprintf => 1, NSException => 1, NSLog => 1, printf => 1 );
-@ARGV >= 1 or die "Usage: extract-localizable-strings <exceptions file> [ directory... ]\nDid you mean to run update-webkit-localizable-strings instead?\n";
+@ARGV >= 2 or die "Usage: extract-localizable-strings <exceptions file> <file to update> [ directory... ]\nDid you mean to run update-webkit-localizable-strings instead?\n";
my $exceptionsFile = shift @ARGV;
-f $exceptionsFile or die "Couldn't find exceptions file $exceptionsFile\n";
@@ -99,14 +99,13 @@ if (open EXCEPTIONS, $exceptionsFile) {
my $quotedDirectoriesString = '"' . join('" "', @directories) . '"';
for my $dir (@directoriesToSkip) {
- $quotedDirectoriesString .= ' -path "' . $dir . '" -prune';
+ $quotedDirectoriesString .= ' -path "' . $dir . '" -prune -o';
}
-my @files = ( split "\n", `find $quotedDirectoriesString -name "*.h" -o -name "*.m" -o -name "*.mm" -o -name "*.c" -o -name "*.cpp"` );
+my @files = ( split "\n", `find $quotedDirectoriesString \\( -name "*.h" -o -name "*.m" -o -name "*.mm" -o -name "*.c" -o -name "*.cpp" \\)` );
for my $file (sort @files) {
- next if $file =~ /\/WebLocalizableStrings\.h$/;
- next if $file =~ /\/icu\//;
+ next if $file =~ /\/\w+LocalizableStrings\.h$/;
$file =~ s-^./--;
diff --git a/WebKitTools/Scripts/find-included-framework-headers b/WebKitTools/Scripts/find-included-framework-headers
index 3e7aaf6..759a60b 100755
--- a/WebKitTools/Scripts/find-included-framework-headers
+++ b/WebKitTools/Scripts/find-included-framework-headers
@@ -1,10 +1,30 @@
#!/bin/sh
-
-FILE_EXTENSIONS_TO_SEARCH="cpp h m mm"
+# Copyright (C) 2007, 2008, 2009, 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.
+#
+# A script to find headers included from the given frameworks by files in the
+# current directory (and subdirectories).
for framework in $*; do
echo -e "\n$framework\n=================="
- for ext in ${FILE_EXTENSIONS_TO_SEARCH}; do
- find . -name "*.$ext" -exec grep $framework {} ';' | grep '\(include\|import\)' | sed -e 's|.*/\(.*\.h\).*|\1|'
- done | sort | uniq
+ find . \( -name '*.cpp' -o -name '*.h' -o -name '*.m' -o -name '*.mm' \) -exec grep "<$framework/" {} ';' | sed -e 's|.*/\(.*\.h\).*|\1|' | sort -u
done
diff --git a/WebKitTools/Scripts/generate-forwarding-headers.pl b/WebKitTools/Scripts/generate-forwarding-headers.pl
new file mode 100755
index 0000000..ed58702
--- /dev/null
+++ b/WebKitTools/Scripts/generate-forwarding-headers.pl
@@ -0,0 +1,99 @@
+#!/usr/bin/perl -w
+# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
+# 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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.
+#
+# A script which searches for headers included by WebKit2 files
+# and generates forwarding headers for these headers.
+
+use strict;
+use Cwd qw(abs_path realpath);
+use File::Find;
+use File::Basename;
+use File::Spec::Functions;
+
+my $srcRoot = realpath(File::Spec->catfile(dirname(abs_path($0)), "../.."));
+my $incFromRoot = abs_path($ARGV[0]);
+my @platformPrefixes = ("android", "brew", "cf", "chromium", "curl", "efl", "gtk", "haiku", "mac", "qt", "soup", "v8", "win", "wx");
+my @frameworks = ( "JavaScriptCore", "WebCore", "WebKit2");
+my @skippedPrefixes;
+my @frameworkHeaders;
+my $framework;
+my %neededHeaders;
+
+shift;
+my $outputDirectory = $ARGV[0];
+shift;
+my $platform = $ARGV[0];
+
+foreach my $prefix (@platformPrefixes) {
+ push(@skippedPrefixes, $prefix) unless ($prefix =~ $platform);
+}
+
+foreach (@frameworks) {
+ $framework = $_;
+ find(\&collectNeededHeaders, $incFromRoot);
+ find(\&collectFameworkHeaderPaths, File::Spec->catfile($srcRoot, $framework));
+ createForwardingHeadersForFramework();
+}
+
+sub collectNeededHeaders {
+ my $filePath = $File::Find::name;
+ my $file = $_;
+ if ($filePath =~ '\.h$|\.cpp$') {
+ open(FILE, "<$file") or die "Could not open $filePath.\n";
+ while (<FILE>) {
+ if (m/^#.*<$framework\/(.*\.h)/) {
+ $neededHeaders{$1} = 1;
+ }
+ }
+ close(FILE);
+ }
+}
+
+sub collectFameworkHeaderPaths {
+ my $filePath = $File::Find::name;
+ my $file = $_;
+ if ($filePath =~ '\.h$' && $filePath !~ "ForwardingHeaders" && grep{$file eq $_} keys %neededHeaders) {
+ my $headerPath = substr($filePath, length("$srcRoot/$framework/"));
+ push(@frameworkHeaders, $headerPath) unless (grep($headerPath =~ "$_/", @skippedPrefixes));
+ }
+}
+
+sub createForwardingHeadersForFramework {
+ foreach my $header (@frameworkHeaders) {
+ my $forwardingHeaderPath = File::Spec->catfile($outputDirectory, $framework, basename($header));
+ my $expectedIncludeStatement = "#include \"$header\"";
+ my $foundIncludeStatement = 0;
+ $foundIncludeStatement = <EXISTING_HEADER> if open(EXISTING_HEADER, "<$forwardingHeaderPath");
+ chomp($foundIncludeStatement);
+ if (! $foundIncludeStatement || $foundIncludeStatement ne $expectedIncludeStatement) {
+ print "[Creating forwarding header for $framework/$header]\n";
+ open(FORWARDING_HEADER, ">$forwardingHeaderPath") or die "Could not open $forwardingHeaderPath.";
+ print FORWARDING_HEADER "$expectedIncludeStatement\n";
+ close(FORWARDING_HEADER);
+ }
+ close(EXISTING_HEADER);
+ }
+}
+
diff --git a/WebKitTools/Scripts/new-run-webkit-httpd b/WebKitTools/Scripts/new-run-webkit-httpd
new file mode 100755
index 0000000..f6ec164
--- /dev/null
+++ b/WebKitTools/Scripts/new-run-webkit-httpd
@@ -0,0 +1,97 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""A utility script for starting and stopping the HTTP server with the
+ same configuration as used in the layout tests."""
+
+#
+# FIXME: currently this code only works with the Chromium ports and LigHTTPd.
+# It should be made to work on all ports.
+#
+# This script is also used by Chromium's ui_tests to run http layout tests
+# in a browser.
+#
+import optparse
+import os
+import sys
+import tempfile
+
+scripts_directory = os.path.dirname(os.path.abspath(sys.argv[0]))
+webkitpy_directory = os.path.join(scripts_directory, "webkitpy")
+sys.path.append(os.path.join(webkitpy_directory, "layout_tests"))
+
+import port
+from port import http_server
+
+def run(options):
+ if not options.server:
+ print ('Usage: %s --server {start|stop} [--root=root_dir]'
+ ' [--port=port_number]' % sys.argv[0])
+ else:
+ if (options.root is None) and (options.port is not None):
+ # specifying root but not port means we want httpd on default
+ # set of ports that LayoutTest use, but pointing to a different
+ # source of tests. Specifying port but no root does not seem
+ # meaningful.
+ raise 'Specifying port requires also a root.'
+ port_obj = port.get(None, options)
+ httpd = http_server.Lighttpd(port_obj,
+ tempfile.gettempdir(),
+ port=options.port,
+ root=options.root,
+ run_background=options.run_background)
+ if options.server == 'start':
+ httpd.start()
+ else:
+ httpd.stop(force=True)
+
+
+def main():
+ option_parser = optparse.OptionParser()
+ option_parser.add_option('-k', '--server',
+ help='Server action (start|stop)')
+ option_parser.add_option('-p', '--port',
+ help='Port to listen on (overrides layout test ports)')
+ option_parser.add_option('-r', '--root',
+ help='Absolute path to DocumentRoot (overrides layout test roots)')
+ option_parser.add_option('--register_cygwin', action="store_true",
+ dest="register_cygwin", help='Register Cygwin paths (on Win try bots)')
+ option_parser.add_option('--run_background', action="store_true",
+ dest="run_background",
+ help='Run on background (for running as UI test)')
+ options, args = option_parser.parse_args()
+
+ # FIXME: Make this work with other ports as well.
+ options.chromium = True
+
+ run(options)
+
+
+if '__main__' == __name__:
+ main()
diff --git a/WebKitTools/Scripts/new-run-webkit-tests b/WebKitTools/Scripts/new-run-webkit-tests
new file mode 100755
index 0000000..9fcacaa
--- /dev/null
+++ b/WebKitTools/Scripts/new-run-webkit-tests
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Wrapper around webkitpy/layout_tests/run_webkit_tests.py"""
+import signal
+import sys
+
+import webkitpy.layout_tests.run_webkit_tests as run_webkit_tests
+
+if __name__ == '__main__':
+ try:
+ sys.exit(run_webkit_tests.main())
+ except KeyboardInterrupt:
+ # this mirrors what the shell normally does
+ sys.exit(signal.SIGINT + 128)
diff --git a/WebKitTools/Scripts/new-run-webkit-websocketserver b/WebKitTools/Scripts/new-run-webkit-websocketserver
new file mode 100644
index 0000000..3350582
--- /dev/null
+++ b/WebKitTools/Scripts/new-run-webkit-websocketserver
@@ -0,0 +1,108 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""A utility script for starting and stopping the web socket server with the
+ same configuration as used in the layout tests."""
+
+import logging
+import optparse
+import tempfile
+
+import webkitpy.layout_tests.port.factory as factory
+import webkitpy.layout_tests.port.websocket_server as websocket_server
+
+
+def main():
+ option_parser = optparse.OptionParser()
+ option_parser.add_option('--server', type='choice',
+ choices=['start', 'stop'], default='start',
+ help='Server action (start|stop).')
+ option_parser.add_option('-p', '--port', dest='port',
+ default=None, help='Port to listen on.')
+ option_parser.add_option('-r', '--root',
+ help='Absolute path to DocumentRoot '
+ '(overrides layout test roots).')
+ option_parser.add_option('-t', '--tls', dest='use_tls',
+ action='store_true',
+ default=False, help='use TLS (wss://).')
+ option_parser.add_option('-k', '--private_key', dest='private_key',
+ default='', help='TLS private key file.')
+ option_parser.add_option('-c', '--certificate', dest='certificate',
+ default='', help='TLS certificate file.')
+ option_parser.add_option('--chromium', action='store_true',
+ dest='chromium',
+ default=False,
+ help='Use the Chromium port.')
+ option_parser.add_option('--register_cygwin', action="store_true",
+ dest="register_cygwin",
+ help='Register Cygwin paths (on Win try bots).')
+ option_parser.add_option('--pidfile', help='path to pid file.')
+ option_parser.add_option('--output-dir', dest='output_dir',
+ default=None, help='output directory.')
+ option_parser.add_option('-v', '--verbose', action='store_true',
+ default=False,
+ help='Include debug-level logging.')
+ options, args = option_parser.parse_args()
+
+ if not options.port:
+ if options.use_tls:
+ # FIXME: We shouldn't grab at this private variable.
+ options.port = websocket_server._DEFAULT_WSS_PORT
+ else:
+ # FIXME: We shouldn't grab at this private variable.
+ options.port = websocket_server._DEFAULT_WS_PORT
+
+ if not options.output_dir:
+ options.output_dir = tempfile.gettempdir()
+
+ kwds = {'port': options.port, 'use_tls': options.use_tls}
+ if options.root:
+ kwds['root'] = options.root
+ if options.private_key:
+ kwds['private_key'] = options.private_key
+ if options.certificate:
+ kwds['certificate'] = options.certificate
+ if options.pidfile:
+ kwds['pidfile'] = options.pidfile
+
+ port_obj = factory.get(options=options)
+ pywebsocket = websocket_server.PyWebSocket(port_obj, options.output_dir, **kwds)
+
+ log_level = logging.WARN
+ if options.verbose:
+ log_level = logging.DEBUG
+ logging.basicConfig(level=log_level)
+
+ if 'start' == options.server:
+ pywebsocket.start()
+ else:
+ pywebsocket.stop(force=True)
+
+if '__main__' == __name__:
+ main()
diff --git a/WebKitTools/Scripts/num-cpus b/WebKitTools/Scripts/num-cpus
index ede9995..8a8c97f 100755
--- a/WebKitTools/Scripts/num-cpus
+++ b/WebKitTools/Scripts/num-cpus
@@ -1,3 +1,6 @@
-#!/bin/bash
-# Assumes cygwin.
-ls /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor | wc -w
+#!/usr/bin/perl -w
+use strict;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+print numberOfCPUs() . "\n";
diff --git a/WebKitTools/Scripts/old-run-webkit-tests b/WebKitTools/Scripts/old-run-webkit-tests
new file mode 100755
index 0000000..eeaaab3
--- /dev/null
+++ b/WebKitTools/Scripts/old-run-webkit-tests
@@ -0,0 +1,2481 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+# Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
+# Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com)
+# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
+# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2009 Andras Becsi (becsi.andras@stud.u-szeged.hu), University of Szeged
+#
+# 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.
+# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
+
+# Script to run the WebKit Open Source Project layout tests.
+
+# Run all the tests passed in on the command line.
+# If no tests are passed, find all the .html, .shtml, .xml, .xhtml, .xhtmlmp, .pl, .php (and svg) files in the test directory.
+
+# Run each text.
+# Compare against the existing file xxx-expected.txt.
+# If there is a mismatch, generate xxx-actual.txt and xxx-diffs.txt.
+
+# At the end, report:
+# the number of tests that got the expected results
+# the number of tests that ran, but did not get the expected results
+# the number of tests that failed to run
+# the number of tests that were run but had no expected results to compare against
+
+use strict;
+use warnings;
+
+use Config;
+use Cwd;
+use Data::Dumper;
+use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
+use File::Basename;
+use File::Copy;
+use File::Find;
+use File::Path;
+use File::Spec;
+use File::Spec::Functions;
+use File::Temp;
+use FindBin;
+use Getopt::Long;
+use IPC::Open2;
+use IPC::Open3;
+use Time::HiRes qw(time usleep);
+
+use List::Util 'shuffle';
+
+use lib $FindBin::Bin;
+use webkitperl::features;
+use webkitperl::httpd;
+use webkitdirs;
+use VCSUtils;
+use POSIX;
+
+sub buildPlatformResultHierarchy();
+sub buildPlatformTestHierarchy(@);
+sub checkPythonVersion();
+sub closeCygpaths();
+sub closeDumpTool();
+sub closeWebSocketServer();
+sub configureAndOpenHTTPDIfNeeded();
+sub countAndPrintLeaks($$$);
+sub countFinishedTest($$$$);
+sub deleteExpectedAndActualResults($);
+sub dumpToolDidCrash();
+sub epiloguesAndPrologues($$);
+sub expectedDirectoryForTest($;$;$);
+sub fileNameWithNumber($$);
+sub htmlForResultsSection(\@$&);
+sub isTextOnlyTest($);
+sub launchWithEnv(\@\%);
+sub resolveAndMakeTestResultsDirectory();
+sub numericcmp($$);
+sub openDiffTool();
+sub buildDumpTool($);
+sub openDumpTool();
+sub parseLeaksandPrintUniqueLeaks();
+sub openWebSocketServerIfNeeded();
+sub pathcmp($$);
+sub printFailureMessageForTest($$);
+sub processIgnoreTests($$);
+sub readFromDumpToolWithTimer(**);
+sub readSkippedFiles($);
+sub recordActualResultsAndDiff($$);
+sub sampleDumpTool();
+sub setFileHandleNonBlocking(*$);
+sub setUpWindowsCrashLogSaving();
+sub slowestcmp($$);
+sub splitpath($);
+sub stopRunningTestsEarlyIfNeeded();
+sub stripExtension($);
+sub stripMetrics($$);
+sub testCrashedOrTimedOut($$$$$);
+sub toCygwinPath($);
+sub toURL($);
+sub toWindowsPath($);
+sub validateSkippedArg($$;$);
+sub writeToFile($$);
+
+# Argument handling
+my $addPlatformExceptions = 0;
+my $complexText = 0;
+my $exitAfterNFailures = 0;
+my $exitAfterNCrashesOrTimeouts = 0;
+my $generateNewResults = isAppleMacWebKit() ? 1 : 0;
+my $guardMalloc = '';
+# FIXME: Dynamic HTTP-port configuration in this file is wrong. The various
+# apache config files in LayoutTests/http/config govern the port numbers.
+# Dynamic configuration as-written will also cause random failures in
+# an IPv6 environment. See https://bugs.webkit.org/show_bug.cgi?id=37104.
+my $httpdPort = 8000;
+my $httpdSSLPort = 8443;
+my $ignoreMetrics = 0;
+my $webSocketPort = 8880;
+# wss is disabled until all platforms support pyOpenSSL.
+# my $webSocketSecurePort = 9323;
+my $ignoreTests = '';
+my $iterations = 1;
+my $launchSafari = 1;
+my $mergeDepth;
+my $pixelTests = '';
+my $platform;
+my $quiet = '';
+my $randomizeTests = 0;
+my $repeatEach = 1;
+my $report10Slowest = 0;
+my $resetResults = 0;
+my $reverseTests = 0;
+my $root;
+my $runSample = 1;
+my $shouldCheckLeaks = 0;
+my $showHelp = 0;
+my $stripEditingCallbacks;
+my $testHTTP = 1;
+my $testWebSocket = 1;
+my $testMedia = 1;
+my $tmpDir = "/tmp";
+my $testResultsDirectory = File::Spec->catdir($tmpDir, "layout-test-results");
+my $testsPerDumpTool = 1000;
+my $threaded = 0;
+# DumpRenderTree has an internal timeout of 30 seconds, so this must be > 30.
+my $timeoutSeconds = 35;
+my $tolerance = 0;
+my $treatSkipped = "default";
+my $useRemoteLinksToTests = 0;
+my $useValgrind = 0;
+my $verbose = 0;
+my $shouldWaitForHTTPD = 0;
+my $useWebKitTestRunner = 0;
+
+my @leaksFilenames;
+
+if (isWindows() || isMsys()) {
+ print "This script has to be run under Cygwin to function correctly.\n";
+ exit 1;
+}
+
+# Default to --no-http for wx for now.
+$testHTTP = 0 if (isWx());
+
+my $perlInterpreter = "perl";
+
+my $expectedTag = "expected";
+my $actualTag = "actual";
+my $prettyDiffTag = "pretty-diff";
+my $diffsTag = "diffs";
+my $errorTag = "stderr";
+
+# These are defined here instead of closer to where they are used so that they
+# will always be accessible from the END block that uses them, even if the user
+# presses Ctrl-C before Perl has finished evaluating this whole file.
+my $windowsPostMortemDebuggerKey = "/HKLM/SOFTWARE/Microsoft/Windows NT/CurrentVersion/AeDebug";
+my %previousWindowsPostMortemDebuggerValues;
+
+my $realPlatform;
+
+my @macPlatforms = ("mac-tiger", "mac-leopard", "mac-snowleopard", "mac");
+my @winPlatforms = ("win-xp", "win-vista", "win-7", "win");
+
+if (isAppleMacWebKit()) {
+ if (isTiger()) {
+ $platform = "mac-tiger";
+ $tolerance = 1.0;
+ } elsif (isLeopard()) {
+ $platform = "mac-leopard";
+ $tolerance = 0.1;
+ } elsif (isSnowLeopard()) {
+ $platform = "mac-snowleopard";
+ $tolerance = 0.1;
+ } else {
+ $platform = "mac";
+ }
+} elsif (isQt()) {
+ if (isDarwin()) {
+ $platform = "qt-mac";
+ } elsif (isLinux()) {
+ $platform = "qt-linux";
+ } elsif (isWindows() || isCygwin()) {
+ $platform = "qt-win";
+ } else {
+ $platform = "qt";
+ }
+} elsif (isGtk()) {
+ $platform = "gtk";
+} elsif (isWx()) {
+ $platform = "wx";
+} elsif (isCygwin() || isWindows()) {
+ if (isWindowsXP()) {
+ $platform = "win-xp";
+ } elsif (isWindowsVista()) {
+ $platform = "win-vista";
+ } elsif (isWindows7()) {
+ $platform = "win-7";
+ } else {
+ $platform = "win";
+ }
+}
+
+if (isQt() || isAppleWinWebKit()) {
+ my $testfontPath = $ENV{"WEBKIT_TESTFONTS"};
+ if (!$testfontPath || !-d "$testfontPath") {
+ print "The WEBKIT_TESTFONTS environment variable is not defined or not set properly\n";
+ print "You must set it before running the tests.\n";
+ print "Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts\n";
+ exit 1;
+ }
+}
+
+if (!defined($platform)) {
+ print "WARNING: Your platform is not recognized. Any platform-specific results will be generated in platform/undefined.\n";
+ $platform = "undefined";
+}
+
+if (!checkPythonVersion()) {
+ print "WARNING: Your platform does not have Python 2.5+, which is required to run websocket server, so disabling websocket/tests.\n";
+ $testWebSocket = 0;
+}
+
+my $programName = basename($0);
+my $launchSafariDefault = $launchSafari ? "launch" : "do not launch";
+my $httpDefault = $testHTTP ? "run" : "do not run";
+my $sampleDefault = $runSample ? "run" : "do not run";
+
+my $usage = <<EOF;
+Usage: $programName [options] [testdir|testpath ...]
+ --add-platform-exceptions Put new results for non-platform-specific failing tests into the platform-specific results directory
+ --complex-text Use the complex text code path for all text (Mac OS X and Windows only)
+ -c|--configuration config Set DumpRenderTree build configuration
+ -g|--guard-malloc Enable malloc guard
+ --exit-after-n-failures N Exit after the first N failures (includes crashes) instead of running all tests
+ --exit-after-n-crashes-or-timeouts N
+ Exit after the first N crashes instead of running all tests
+ -h|--help Show this help message
+ --[no-]http Run (or do not run) http tests (default: $httpDefault)
+ --[no-]wait-for-httpd Wait for httpd if some other test session is using it already (same as WEBKIT_WAIT_FOR_HTTPD=1). (default: $shouldWaitForHTTPD)
+ -i|--ignore-tests Comma-separated list of directories or tests to ignore
+ --iterations n Number of times to run the set of tests (e.g. ABCABCABC)
+ --[no-]launch-safari Launch (or do not launch) Safari to display test results (default: $launchSafariDefault)
+ -l|--leaks Enable leaks checking
+ --[no-]new-test-results Generate results for new tests
+ --nthly n Restart DumpRenderTree every n tests (default: $testsPerDumpTool)
+ -p|--pixel-tests Enable pixel tests
+ --tolerance t Ignore image differences less than this percentage (default: $tolerance)
+ --platform Override the detected platform to use for tests and results (default: $platform)
+ --port Web server port to use with http tests
+ -q|--quiet Less verbose output
+ --reset-results Reset ALL results (including pixel tests if --pixel-tests is set)
+ -o|--results-directory Output results directory (default: $testResultsDirectory)
+ --random Run the tests in a random order
+ --repeat-each n Number of times to run each test (e.g. AAABBBCCC)
+ --reverse Run the tests in reverse alphabetical order
+ --root Path to root tools build
+ --[no-]sample-on-timeout Run sample on timeout (default: $sampleDefault) (Mac OS X only)
+ -1|--singly Isolate each test case run (implies --nthly 1 --verbose)
+ --skipped=[default|ignore|only] Specifies how to treat the Skipped file
+ default: Tests/directories listed in the Skipped file are not tested
+ ignore: The Skipped file is ignored
+ only: Only those tests/directories listed in the Skipped file will be run
+ --slowest Report the 10 slowest tests
+ --ignore-metrics Ignore metrics in tests
+ --[no-]strip-editing-callbacks Remove editing callbacks from expected results
+ -t|--threaded Run a concurrent JavaScript thead with each test
+ --timeout t Sets the number of seconds before a test times out (default: $timeoutSeconds)
+ --valgrind Run DumpRenderTree inside valgrind (Qt/Linux only)
+ -v|--verbose More verbose output (overrides --quiet)
+ -m|--merge-leak-depth arg Merges leak callStacks and prints the number of unique leaks beneath a callstack depth of arg. Defaults to 5.
+ --use-remote-links-to-tests Link to test files within the SVN repository in the results.
+ -2|--webkit-test-runner Use WebKitTestRunner rather than DumpRenderTree.
+EOF
+
+setConfiguration();
+
+my $getOptionsResult = GetOptions(
+ 'add-platform-exceptions' => \$addPlatformExceptions,
+ 'complex-text' => \$complexText,
+ 'exit-after-n-failures=i' => \$exitAfterNFailures,
+ 'exit-after-n-crashes-or-timeouts=i' => \$exitAfterNCrashesOrTimeouts,
+ 'guard-malloc|g' => \$guardMalloc,
+ 'help|h' => \$showHelp,
+ 'http!' => \$testHTTP,
+ 'wait-for-httpd!' => \$shouldWaitForHTTPD,
+ 'ignore-metrics!' => \$ignoreMetrics,
+ 'ignore-tests|i=s' => \$ignoreTests,
+ 'iterations=i' => \$iterations,
+ 'launch-safari!' => \$launchSafari,
+ 'leaks|l' => \$shouldCheckLeaks,
+ 'merge-leak-depth|m:5' => \$mergeDepth,
+ 'new-test-results!' => \$generateNewResults,
+ 'nthly=i' => \$testsPerDumpTool,
+ 'pixel-tests|p' => \$pixelTests,
+ 'platform=s' => \$platform,
+ 'port=i' => \$httpdPort,
+ 'quiet|q' => \$quiet,
+ 'random' => \$randomizeTests,
+ 'repeat-each=i' => \$repeatEach,
+ 'reset-results' => \$resetResults,
+ 'results-directory|o=s' => \$testResultsDirectory,
+ 'reverse' => \$reverseTests,
+ 'root=s' => \$root,
+ 'sample-on-timeout!' => \$runSample,
+ 'singly|1' => sub { $testsPerDumpTool = 1; },
+ 'skipped=s' => \&validateSkippedArg,
+ 'slowest' => \$report10Slowest,
+ 'strip-editing-callbacks!' => \$stripEditingCallbacks,
+ 'threaded|t' => \$threaded,
+ 'timeout=i' => \$timeoutSeconds,
+ 'tolerance=f' => \$tolerance,
+ 'use-remote-links-to-tests' => \$useRemoteLinksToTests,
+ 'valgrind' => \$useValgrind,
+ 'verbose|v' => \$verbose,
+ 'webkit-test-runner|2' => \$useWebKitTestRunner,
+);
+
+if (!$getOptionsResult || $showHelp) {
+ print STDERR $usage;
+ exit 1;
+}
+
+if ($useWebKitTestRunner) {
+ if (isAppleMacWebKit()) {
+ $realPlatform = $platform;
+ $platform = "mac-wk2";
+ } elsif (isAppleWinWebKit()) {
+ $stripEditingCallbacks = 0 unless defined $stripEditingCallbacks;
+ $realPlatform = $platform;
+ $platform = "win-wk2";
+ } elsif (isQt()) {
+ $realPlatform = $platform;
+ $platform = "qt-wk2";
+ }
+}
+
+$timeoutSeconds *= 10 if $guardMalloc;
+
+$stripEditingCallbacks = isCygwin() unless defined $stripEditingCallbacks;
+
+my $ignoreSkipped = $treatSkipped eq "ignore";
+my $skippedOnly = $treatSkipped eq "only";
+
+my $configuration = configuration();
+
+# We need an environment variable to be able to enable the feature per-slave
+$shouldWaitForHTTPD = $ENV{"WEBKIT_WAIT_FOR_HTTPD"} unless ($shouldWaitForHTTPD);
+$verbose = 1 if $testsPerDumpTool == 1;
+
+if ($shouldCheckLeaks && $testsPerDumpTool > 1000) {
+ print STDERR "\nWARNING: Running more than 1000 tests at a time with MallocStackLogging enabled may cause a crash.\n\n";
+}
+
+# Stack logging does not play well with QuickTime on Tiger (rdar://problem/5537157)
+$testMedia = 0 if $shouldCheckLeaks && isTiger();
+
+# Generating remote links causes a lot of unnecessary spew on GTK build bot
+$useRemoteLinksToTests = 0 if isGtk();
+
+setUpWindowsCrashLogSaving() if isCygwin();
+
+setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
+my $productDir = productDir();
+$productDir .= "/bin" if isQt();
+$productDir .= "/Programs" if isGtk();
+
+chdirWebKit();
+
+if (!defined($root)) {
+ # FIXME: We build both DumpRenderTree and WebKitTestRunner for
+ # WebKitTestRunner runs becuase DumpRenderTree still includes
+ # the DumpRenderTreeSupport module and the TestNetscapePlugin.
+ # These two projects should be factored out into their own
+ # projects.
+ buildDumpTool("DumpRenderTree");
+ buildDumpTool("WebKitTestRunner") if $useWebKitTestRunner;
+}
+
+my $dumpToolName = $useWebKitTestRunner ? "WebKitTestRunner" : "DumpRenderTree";
+
+if (isAppleWinWebKit()) {
+ $dumpToolName .= "_debug" if configurationForVisualStudio() !~ /^Release|Debug_Internal$/;
+ $dumpToolName .= $Config{_exe};
+}
+my $dumpTool = File::Spec->catfile($productDir, $dumpToolName);
+die "can't find executable $dumpToolName (looked in $productDir)\n" unless -x $dumpTool;
+
+my $imageDiffTool = "$productDir/ImageDiff";
+$imageDiffTool .= "_debug" if isCygwin() && configurationForVisualStudio() !~ /^Release|Debug_Internal$/;
+die "can't find executable $imageDiffTool (looked in $productDir)\n" if $pixelTests && !-x $imageDiffTool;
+
+checkFrameworks() unless isCygwin();
+
+if (isAppleMacWebKit()) {
+ push @INC, $productDir;
+ require DumpRenderTreeSupport;
+}
+
+my $layoutTestsName = "LayoutTests";
+my $testDirectory = File::Spec->rel2abs($layoutTestsName);
+my $expectedDirectory = $testDirectory;
+my $platformBaseDirectory = catdir($testDirectory, "platform");
+my $platformTestDirectory = catdir($platformBaseDirectory, $platform);
+my @platformResultHierarchy = buildPlatformResultHierarchy();
+my @platformTestHierarchy = buildPlatformTestHierarchy(@platformResultHierarchy);
+
+$expectedDirectory = $ENV{"WebKitExpectedTestResultsDirectory"} if $ENV{"WebKitExpectedTestResultsDirectory"};
+
+$testResultsDirectory = File::Spec->rel2abs($testResultsDirectory);
+my $testResults = File::Spec->catfile($testResultsDirectory, "results.html");
+
+if (isAppleMacWebKit()) {
+ print STDERR "Compiling Java tests\n";
+ my $javaTestsDirectory = catdir($testDirectory, "java");
+
+ if (system("/usr/bin/make", "-C", "$javaTestsDirectory")) {
+ exit 1;
+ }
+}
+
+
+print "Running tests from $testDirectory\n";
+if ($pixelTests) {
+ print "Enabling pixel tests with a tolerance of $tolerance%\n";
+ if (isDarwin()) {
+ print "WARNING: Temporarily changing the main display color profile:\n";
+ print "\tThe colors on your screen will change for the duration of the testing.\n";
+ print "\tThis allows the pixel tests to have consistent color values across all machines.\n";
+
+ if (isPerianInstalled()) {
+ print "WARNING: Perian's QuickTime component is installed and this may affect pixel test results!\n";
+ print "\tYou should avoid generating new pixel results in this environment.\n";
+ print "\tSee https://bugs.webkit.org/show_bug.cgi?id=22615 for details.\n";
+ }
+ }
+}
+
+system "ln", "-s", $testDirectory, "/tmp/LayoutTests" unless -x "/tmp/LayoutTests";
+
+my %ignoredFiles = ( "results.html" => 1 );
+my %ignoredDirectories = map { $_ => 1 } qw(platform);
+my %ignoredLocalDirectories = map { $_ => 1 } qw(.svn _svn resources script-tests);
+my %supportedFileExtensions = map { $_ => 1 } qw(html shtml xml xhtml xhtmlmp pl php);
+
+if (!checkWebCoreFeatureSupport("MathML", 0)) {
+ $ignoredDirectories{'mathml'} = 1;
+}
+
+# FIXME: We should fix webkitperl/features.pm:hasFeature() to do the correct feature detection for Cygwin.
+if (checkWebCoreFeatureSupport("SVG", 0)) {
+ $supportedFileExtensions{'svg'} = 1;
+} elsif (isCygwin()) {
+ $supportedFileExtensions{'svg'} = 1;
+} else {
+ $ignoredLocalDirectories{'svg'} = 1;
+}
+
+if (!$testHTTP) {
+ $ignoredDirectories{'http'} = 1;
+ $ignoredDirectories{'websocket'} = 1;
+}
+if (!$testWebSocket) {
+ $ignoredDirectories{'websocket'} = 1;
+}
+
+if (!$testMedia) {
+ $ignoredDirectories{'media'} = 1;
+ $ignoredDirectories{'http/tests/media'} = 1;
+}
+
+my $supportedFeaturesResult = "";
+
+if (isCygwin()) {
+ # Collect supported features list
+ setPathForRunningWebKitApp(\%ENV);
+ my $supportedFeaturesCommand = "\"$dumpTool\" --print-supported-features 2>&1";
+ $supportedFeaturesResult = `$supportedFeaturesCommand 2>&1`;
+}
+
+my $hasAcceleratedCompositing = 0;
+my $has3DRendering = 0;
+
+if (isCygwin()) {
+ $hasAcceleratedCompositing = $supportedFeaturesResult =~ /AcceleratedCompositing/;
+ $has3DRendering = $supportedFeaturesResult =~ /3DRendering/;
+} else {
+ $hasAcceleratedCompositing = checkWebCoreFeatureSupport("Accelerated Compositing", 0);
+ $has3DRendering = checkWebCoreFeatureSupport("3D Rendering", 0);
+}
+
+if (!$hasAcceleratedCompositing) {
+ $ignoredDirectories{'compositing'} = 1;
+
+ # This test has slightly different floating-point rounding when accelerated
+ # compositing is enabled.
+ $ignoredFiles{'svg/custom/use-on-symbol-inside-pattern.svg'} = 1;
+
+ if (isAppleWebKit()) {
+ # In Apple's ports, the default controls for <video> contain a "full
+ # screen" button only if accelerated compositing is enabled.
+ $ignoredFiles{'media/controls-after-reload.html'} = 1;
+ $ignoredFiles{'media/controls-drag-timebar.html'} = 1;
+ $ignoredFiles{'media/controls-strict.html'} = 1;
+ $ignoredFiles{'media/controls-styling.html'} = 1;
+ $ignoredFiles{'media/video-controls-rendering.html'} = 1;
+ $ignoredFiles{'media/video-display-toggle.html'} = 1;
+ $ignoredFiles{'media/video-no-audio.html'} = 1;
+ }
+
+ # Here we're using !$hasAcceleratedCompositing as a proxy for "is a headless XP machine" (like
+ # our test slaves). Headless XP machines can neither support accelerated compositing nor pass
+ # this test, so skipping the test here is expedient, if a little sloppy. See
+ # <http://webkit.org/b/48333>.
+ $ignoredFiles{'platform/win/plugins/npn-invalidate-rect-invalidates-window.html'} = 1 if isAppleWinWebKit();
+}
+
+if (!$has3DRendering) {
+ $ignoredDirectories{'animations/3d'} = 1;
+ $ignoredDirectories{'transforms/3d'} = 1;
+
+ # These tests use the -webkit-transform-3d media query.
+ $ignoredFiles{'fast/media/mq-transform-02.html'} = 1;
+ $ignoredFiles{'fast/media/mq-transform-03.html'} = 1;
+}
+
+if (!checkWebCoreFeatureSupport("3D Canvas", 0)) {
+ $ignoredDirectories{'fast/canvas/webgl'} = 1;
+ $ignoredDirectories{'compositing/webgl'} = 1;
+ $ignoredDirectories{'http/tests/canvas/webgl'} = 1;
+}
+
+if (checkWebCoreFeatureSupport("WML", 0)) {
+ $supportedFileExtensions{'wml'} = 1;
+} else {
+ $ignoredDirectories{'http/tests/wml'} = 1;
+ $ignoredDirectories{'fast/wml'} = 1;
+ $ignoredDirectories{'wml'} = 1;
+}
+
+if (!checkWebCoreFeatureSupport("WCSS", 0)) {
+ $ignoredDirectories{'fast/wcss'} = 1;
+}
+
+if (!checkWebCoreFeatureSupport("XHTMLMP", 0)) {
+ $ignoredDirectories{'fast/xhtmlmp'} = 1;
+}
+
+processIgnoreTests($ignoreTests, "ignore-tests") if $ignoreTests;
+if (!$ignoreSkipped) {
+ if (!$skippedOnly || @ARGV == 0) {
+ readSkippedFiles("");
+ } else {
+ # Since readSkippedFiles() appends to @ARGV, we must use a foreach
+ # loop so that we only iterate over the original argument list.
+ foreach my $argnum (0 .. $#ARGV) {
+ readSkippedFiles(shift @ARGV);
+ }
+ }
+}
+
+my @tests = findTestsToRun();
+
+die "no tests to run\n" if !@tests;
+
+my %counts;
+my %tests;
+my %imagesPresent;
+my %imageDifferences;
+my %durations;
+my $count = 0;
+my $leaksOutputFileNumber = 1;
+my $totalLeaks = 0;
+
+my @toolArgs = ();
+push @toolArgs, "--pixel-tests" if $pixelTests;
+push @toolArgs, "--threaded" if $threaded;
+push @toolArgs, "--complex-text" if $complexText;
+push @toolArgs, "-";
+
+my @diffToolArgs = ();
+push @diffToolArgs, "--tolerance", $tolerance;
+
+$| = 1;
+
+my $dumpToolPID;
+my $isDumpToolOpen = 0;
+my $dumpToolCrashed = 0;
+my $imageDiffToolPID;
+my $isDiffToolOpen = 0;
+
+my $atLineStart = 1;
+my $lastDirectory = "";
+
+my $isHttpdOpen = 0;
+my $isWebSocketServerOpen = 0;
+my $webSocketServerPidFile = 0;
+my $failedToStartWebSocketServer = 0;
+# wss is disabled until all platforms support pyOpenSSL.
+# my $webSocketSecureServerPID = 0;
+
+sub catch_pipe { $dumpToolCrashed = 1; }
+$SIG{"PIPE"} = "catch_pipe";
+
+print "Testing ", scalar @tests, " test cases";
+print " $iterations times" if ($iterations > 1);
+print ", repeating each test $repeatEach times" if ($repeatEach > 1);
+print ".\n";
+
+my $overallStartTime = time;
+
+my %expectedResultPaths;
+
+my @originalTests = @tests;
+# Add individual test repetitions
+if ($repeatEach > 1) {
+ @tests = ();
+ foreach my $test (@originalTests) {
+ for (my $i = 0; $i < $repeatEach; $i++) {
+ push(@tests, $test);
+ }
+ }
+}
+# Add test set repetitions
+for (my $i = 1; $i < $iterations; $i++) {
+ push(@tests, @originalTests);
+}
+
+for my $test (@tests) {
+ my $newDumpTool = not $isDumpToolOpen;
+ openDumpTool();
+
+ my $base = stripExtension($test);
+ my $expectedExtension = ".txt";
+
+ my $dir = $base;
+ $dir =~ s|/[^/]+$||;
+
+ if ($newDumpTool || $dir ne $lastDirectory) {
+ foreach my $logue (epiloguesAndPrologues($newDumpTool ? "" : $lastDirectory, $dir)) {
+ if (isCygwin()) {
+ $logue = toWindowsPath($logue);
+ } else {
+ $logue = canonpath($logue);
+ }
+ if ($verbose) {
+ print "running epilogue or prologue $logue\n";
+ }
+ print OUT "$logue\n";
+ # Throw away output from DumpRenderTree.
+ # Once for the test output and once for pixel results (empty)
+ while (<IN>) {
+ last if /#EOF/;
+ }
+ while (<IN>) {
+ last if /#EOF/;
+ }
+ }
+ }
+
+ if ($verbose) {
+ print "running $test -> ";
+ $atLineStart = 0;
+ } elsif (!$quiet) {
+ if ($dir ne $lastDirectory) {
+ print "\n" unless $atLineStart;
+ print "$dir ";
+ }
+ print ".";
+ $atLineStart = 0;
+ }
+
+ $lastDirectory = $dir;
+
+ my $result;
+
+ my $startTime = time if $report10Slowest;
+
+ # Try to read expected hash file for pixel tests
+ my $suffixExpectedHash = "";
+ if ($pixelTests && !$resetResults) {
+ my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
+ if (open EXPECTEDHASH, File::Spec->catfile($expectedPixelDir, "$base-$expectedTag.checksum")) {
+ my $expectedHash = <EXPECTEDHASH>;
+ chomp($expectedHash);
+ close EXPECTEDHASH;
+
+ # Format expected hash into a suffix string that is appended to the path / URL passed to DRT
+ $suffixExpectedHash = "'$expectedHash";
+ }
+ }
+
+ if ($test =~ /^http\//) {
+ configureAndOpenHTTPDIfNeeded();
+ if ($test =~ /^http\/tests\/websocket\//) {
+ if ($test =~ /^websocket\/tests\/local\//) {
+ my $testPath = "$testDirectory/$test";
+ if (isCygwin()) {
+ $testPath = toWindowsPath($testPath);
+ } else {
+ $testPath = canonpath($testPath);
+ }
+ print OUT "$testPath\n";
+ } else {
+ if (openWebSocketServerIfNeeded()) {
+ my $path = canonpath($test);
+ if ($test =~ /^http\/tests\/websocket\/tests\/ssl\//) {
+ # wss is disabled until all platforms support pyOpenSSL.
+ print STDERR "Error: wss is disabled until all platforms support pyOpenSSL.";
+ } else {
+ $path =~ s/^http\/tests\///;
+ print OUT "http://127.0.0.1:$httpdPort/$path\n";
+ }
+ } else {
+ # We failed to launch the WebSocket server. Display a useful error message rather than attempting
+ # to run tests that expect the server to be available.
+ my $errorMessagePath = "$testDirectory/http/tests/websocket/resources/server-failed-to-start.html";
+ $errorMessagePath = isCygwin() ? toWindowsPath($errorMessagePath) : canonpath($errorMessagePath);
+ print OUT "$errorMessagePath\n";
+ }
+ }
+ } elsif ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\// && $test !~ /^http\/tests\/wml\// && $test !~ /^http\/tests\/media\//) {
+ my $path = canonpath($test);
+ $path =~ s/^http\/tests\///;
+ print OUT "http://127.0.0.1:$httpdPort/$path$suffixExpectedHash\n";
+ } elsif ($test =~ /^http\/tests\/ssl\//) {
+ my $path = canonpath($test);
+ $path =~ s/^http\/tests\///;
+ print OUT "https://127.0.0.1:$httpdSSLPort/$path$suffixExpectedHash\n";
+ } else {
+ my $testPath = "$testDirectory/$test";
+ if (isCygwin()) {
+ $testPath = toWindowsPath($testPath);
+ } else {
+ $testPath = canonpath($testPath);
+ }
+ print OUT "$testPath$suffixExpectedHash\n";
+ }
+ } else {
+ my $testPath = "$testDirectory/$test";
+ if (isCygwin()) {
+ $testPath = toWindowsPath($testPath);
+ } else {
+ $testPath = canonpath($testPath);
+ }
+ print OUT "$testPath$suffixExpectedHash\n" if defined $testPath;
+ }
+
+ # DumpRenderTree is expected to dump two "blocks" to stdout for each test.
+ # Each block is terminated by a #EOF on a line by itself.
+ # The first block is the output of the test (in text, RenderTree or other formats).
+ # The second block is for optional pixel data in PNG format, and may be empty if
+ # pixel tests are not being run, or the test does not dump pixels (e.g. text tests).
+ my $readResults = readFromDumpToolWithTimer(IN, ERROR);
+
+ my $actual = $readResults->{output};
+ my $error = $readResults->{error};
+
+ $expectedExtension = $readResults->{extension};
+ my $expectedFileName = "$base-$expectedTag.$expectedExtension";
+
+ my $isText = isTextOnlyTest($actual);
+
+ my $expectedDir = expectedDirectoryForTest($base, $isText, $expectedExtension);
+ $expectedResultPaths{$base} = File::Spec->catfile($expectedDir, $expectedFileName);
+
+ unless ($readResults->{status} eq "success") {
+ my $crashed = $readResults->{status} eq "crashed";
+ testCrashedOrTimedOut($test, $base, $crashed, $actual, $error);
+ countFinishedTest($test, $base, $crashed ? "crash" : "timedout", 0);
+ last if stopRunningTestsEarlyIfNeeded();
+ next;
+ }
+
+ $durations{$test} = time - $startTime if $report10Slowest;
+
+ my $expected;
+
+ if (!$resetResults && open EXPECTED, "<", $expectedResultPaths{$base}) {
+ $expected = "";
+ while (<EXPECTED>) {
+ next if $stripEditingCallbacks && $_ =~ /^EDITING DELEGATE:/;
+ $expected .= $_;
+ }
+ close EXPECTED;
+ }
+
+ if ($ignoreMetrics && !$isText && defined $expected) {
+ ($actual, $expected) = stripMetrics($actual, $expected);
+ }
+
+ if ($shouldCheckLeaks && $testsPerDumpTool == 1) {
+ print " $test -> ";
+ }
+
+ my $actualPNG = "";
+ my $diffPNG = "";
+ my $diffPercentage = 0;
+ my $diffResult = "passed";
+
+ my $actualHash = "";
+ my $expectedHash = "";
+ my $actualPNGSize = 0;
+
+ while (<IN>) {
+ last if /#EOF/;
+ if (/ActualHash: ([a-f0-9]{32})/) {
+ $actualHash = $1;
+ } elsif (/ExpectedHash: ([a-f0-9]{32})/) {
+ $expectedHash = $1;
+ } elsif (/Content-Length: (\d+)\s*/) {
+ $actualPNGSize = $1;
+ read(IN, $actualPNG, $actualPNGSize);
+ }
+ }
+
+ if ($verbose && $pixelTests && !$resetResults && $actualPNGSize) {
+ if ($actualHash eq "" && $expectedHash eq "") {
+ printFailureMessageForTest($test, "WARNING: actual & expected pixel hashes are missing!");
+ } elsif ($actualHash eq "") {
+ printFailureMessageForTest($test, "WARNING: actual pixel hash is missing!");
+ } elsif ($expectedHash eq "") {
+ printFailureMessageForTest($test, "WARNING: expected pixel hash is missing!");
+ }
+ }
+
+ if ($actualPNGSize > 0) {
+ my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
+ my $expectedPNGPath = File::Spec->catfile($expectedPixelDir, "$base-$expectedTag.png");
+
+ if (!$resetResults && ($expectedHash ne $actualHash || ($actualHash eq "" && $expectedHash eq ""))) {
+ if (-f $expectedPNGPath) {
+ my $expectedPNGSize = -s $expectedPNGPath;
+ my $expectedPNG = "";
+ open EXPECTEDPNG, $expectedPNGPath;
+ read(EXPECTEDPNG, $expectedPNG, $expectedPNGSize);
+
+ openDiffTool();
+ print DIFFOUT "Content-Length: $actualPNGSize\n";
+ print DIFFOUT $actualPNG;
+
+ print DIFFOUT "Content-Length: $expectedPNGSize\n";
+ print DIFFOUT $expectedPNG;
+
+ while (<DIFFIN>) {
+ last if /^error/ || /^diff:/;
+ if (/Content-Length: (\d+)\s*/) {
+ read(DIFFIN, $diffPNG, $1);
+ }
+ }
+
+ if (/^diff: (.+)% (passed|failed)/) {
+ $diffPercentage = $1 + 0;
+ $imageDifferences{$base} = $diffPercentage;
+ $diffResult = $2;
+ }
+
+ if (!$diffPercentage) {
+ printFailureMessageForTest($test, "pixel hash failed (but pixel test still passes)");
+ }
+ } elsif ($verbose) {
+ printFailureMessageForTest($test, "WARNING: expected image is missing!");
+ }
+ }
+
+ if ($resetResults || !-f $expectedPNGPath) {
+ mkpath catfile($expectedPixelDir, dirname($base)) if $testDirectory ne $expectedPixelDir;
+ writeToFile($expectedPNGPath, $actualPNG);
+ }
+
+ my $expectedChecksumPath = File::Spec->catfile($expectedPixelDir, "$base-$expectedTag.checksum");
+ if ($actualHash ne "" && ($resetResults || !-f $expectedChecksumPath)) {
+ writeToFile($expectedChecksumPath, $actualHash);
+ }
+ }
+
+ if (dumpToolDidCrash()) {
+ $result = "crash";
+ testCrashedOrTimedOut($test, $base, 1, $actual, $error);
+ } elsif (!defined $expected) {
+ if ($verbose) {
+ print "new " . ($resetResults ? "result" : "test");
+ }
+ $result = "new";
+
+ if ($generateNewResults || $resetResults) {
+ mkpath catfile($expectedDir, dirname($base)) if $testDirectory ne $expectedDir;
+ writeToFile("$expectedDir/$expectedFileName", $actual);
+ }
+ deleteExpectedAndActualResults($base);
+ recordActualResultsAndDiff($base, $actual);
+ if (!$resetResults) {
+ # Always print the file name for new tests, as they will probably need some manual inspection.
+ # in verbose mode we already printed the test case, so no need to do it again.
+ unless ($verbose) {
+ print "\n" unless $atLineStart;
+ print "$test -> ";
+ }
+ my $resultsDir = catdir($expectedDir, dirname($base));
+ if (!$verbose) {
+ print "new";
+ }
+ if ($generateNewResults) {
+ print " (results generated in $resultsDir)";
+ }
+ print "\n" unless $atLineStart;
+ $atLineStart = 1;
+ }
+ } elsif ($actual eq $expected && $diffResult eq "passed") {
+ if ($verbose) {
+ print "succeeded\n";
+ $atLineStart = 1;
+ }
+ $result = "match";
+ deleteExpectedAndActualResults($base);
+ } else {
+ $result = "mismatch";
+
+ my $pixelTestFailed = $pixelTests && $diffPNG && $diffPNG ne "";
+ my $testFailed = $actual ne $expected;
+
+ my $message = !$testFailed ? "pixel test failed" : "failed";
+
+ if (($testFailed || $pixelTestFailed) && $addPlatformExceptions) {
+ my $testBase = catfile($testDirectory, $base);
+ my $expectedBase = catfile($expectedDir, $base);
+ my $testIsMaximallyPlatformSpecific = $testBase =~ m|^\Q$platformTestDirectory\E/|;
+ my $expectedResultIsMaximallyPlatformSpecific = $expectedBase =~ m|^\Q$platformTestDirectory\E/|;
+ if (!$testIsMaximallyPlatformSpecific && !$expectedResultIsMaximallyPlatformSpecific) {
+ mkpath catfile($platformTestDirectory, dirname($base));
+ if ($testFailed) {
+ my $expectedFile = catfile($platformTestDirectory, "$expectedFileName");
+ writeToFile("$expectedFile", $actual);
+ }
+ if ($pixelTestFailed) {
+ my $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.checksum");
+ writeToFile("$expectedFile", $actualHash);
+
+ $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.png");
+ writeToFile("$expectedFile", $actualPNG);
+ }
+ $message .= " (results generated in $platformTestDirectory)";
+ }
+ }
+
+ printFailureMessageForTest($test, $message);
+
+ my $dir = "$testResultsDirectory/$base";
+ $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
+ my $testName = $1;
+ mkpath $dir;
+
+ deleteExpectedAndActualResults($base);
+ recordActualResultsAndDiff($base, $actual);
+
+ if ($pixelTestFailed) {
+ $imagesPresent{$base} = 1;
+
+ writeToFile("$testResultsDirectory/$base-$actualTag.png", $actualPNG);
+ writeToFile("$testResultsDirectory/$base-$diffsTag.png", $diffPNG);
+
+ my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
+ copy("$expectedPixelDir/$base-$expectedTag.png", "$testResultsDirectory/$base-$expectedTag.png");
+
+ open DIFFHTML, ">$testResultsDirectory/$base-$diffsTag.html" or die;
+ print DIFFHTML "<html>\n";
+ print DIFFHTML "<head>\n";
+ print DIFFHTML "<title>$base Image Compare</title>\n";
+ print DIFFHTML "<script language=\"Javascript\" type=\"text/javascript\">\n";
+ print DIFFHTML "var currentImage = 0;\n";
+ print DIFFHTML "var imageNames = new Array(\"Actual\", \"Expected\");\n";
+ print DIFFHTML "var imagePaths = new Array(\"$testName-$actualTag.png\", \"$testName-$expectedTag.png\");\n";
+ if (-f "$testDirectory/$base-w3c.png") {
+ copy("$testDirectory/$base-w3c.png", "$testResultsDirectory/$base-w3c.png");
+ print DIFFHTML "imageNames.push(\"W3C\");\n";
+ print DIFFHTML "imagePaths.push(\"$testName-w3c.png\");\n";
+ }
+ print DIFFHTML "function animateImage() {\n";
+ print DIFFHTML " var image = document.getElementById(\"animatedImage\");\n";
+ print DIFFHTML " var imageText = document.getElementById(\"imageText\");\n";
+ print DIFFHTML " image.src = imagePaths[currentImage];\n";
+ print DIFFHTML " imageText.innerHTML = imageNames[currentImage] + \" Image\";\n";
+ print DIFFHTML " currentImage = (currentImage + 1) % imageNames.length;\n";
+ print DIFFHTML " setTimeout('animateImage()',2000);\n";
+ print DIFFHTML "}\n";
+ print DIFFHTML "</script>\n";
+ print DIFFHTML "</head>\n";
+ print DIFFHTML "<body onLoad=\"animateImage();\">\n";
+ print DIFFHTML "<table>\n";
+ if ($diffPercentage) {
+ print DIFFHTML "<tr>\n";
+ print DIFFHTML "<td>Difference between images: <a href=\"$testName-$diffsTag.png\">$diffPercentage%</a></td>\n";
+ print DIFFHTML "</tr>\n";
+ }
+ print DIFFHTML "<tr>\n";
+ print DIFFHTML "<td><a href=\"" . toURL("$testDirectory/$test") . "\">test file</a></td>\n";
+ print DIFFHTML "</tr>\n";
+ print DIFFHTML "<tr>\n";
+ print DIFFHTML "<td id=\"imageText\" style=\"text-weight: bold;\">Actual Image</td>\n";
+ print DIFFHTML "</tr>\n";
+ print DIFFHTML "<tr>\n";
+ print DIFFHTML "<td><img src=\"$testName-$actualTag.png\" id=\"animatedImage\"></td>\n";
+ print DIFFHTML "</tr>\n";
+ print DIFFHTML "</table>\n";
+ print DIFFHTML "</body>\n";
+ print DIFFHTML "</html>\n";
+ }
+ }
+
+ if ($error) {
+ my $dir = dirname(File::Spec->catdir($testResultsDirectory, $base));
+ mkpath $dir;
+
+ writeToFile(File::Spec->catfile($testResultsDirectory, "$base-$errorTag.txt"), $error);
+
+ $counts{error}++;
+ push @{$tests{error}}, $test;
+ }
+
+ countFinishedTest($test, $base, $result, $isText);
+ last if stopRunningTestsEarlyIfNeeded();
+}
+
+my $totalTestingTime = time - $overallStartTime;
+my $waitTime = getWaitTime();
+if ($waitTime > 0.1) {
+ my $normalizedTestingTime = $totalTestingTime - $waitTime;
+ printf "\n%0.2fs HTTPD waiting time\n", $waitTime . "";
+ printf "%0.2fs normalized testing time", $normalizedTestingTime . "";
+}
+printf "\n%0.2fs total testing time\n", $totalTestingTime . "";
+
+!$isDumpToolOpen || die "Failed to close $dumpToolName.\n";
+
+$isHttpdOpen = !closeHTTPD();
+closeWebSocketServer();
+
+# Because multiple instances of this script are running concurrently we cannot
+# safely delete this symlink.
+# system "rm /tmp/LayoutTests";
+
+# FIXME: Do we really want to check the image-comparison tool for leaks every time?
+if ($isDiffToolOpen && $shouldCheckLeaks) {
+ $totalLeaks += countAndPrintLeaks("ImageDiff", $imageDiffToolPID, "$testResultsDirectory/ImageDiff-leaks.txt");
+}
+
+if ($totalLeaks) {
+ if ($mergeDepth) {
+ parseLeaksandPrintUniqueLeaks();
+ } else {
+ print "\nWARNING: $totalLeaks total leaks found!\n";
+ print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
+ }
+}
+
+close IN;
+close OUT;
+close ERROR;
+
+if ($report10Slowest) {
+ print "\n\nThe 10 slowest tests:\n\n";
+ my $count = 0;
+ for my $test (sort slowestcmp keys %durations) {
+ printf "%0.2f secs: %s\n", $durations{$test}, $test;
+ last if ++$count == 10;
+ }
+}
+
+print "\n";
+
+if ($skippedOnly && $counts{"match"}) {
+ print "The following tests are in the Skipped file (" . File::Spec->abs2rel("$platformTestDirectory/Skipped", $testDirectory) . "), but succeeded:\n";
+ foreach my $test (@{$tests{"match"}}) {
+ print " $test\n";
+ }
+}
+
+if ($resetResults || ($counts{match} && $counts{match} == $count)) {
+ print "all $count test cases succeeded\n";
+ unlink $testResults;
+ exit;
+}
+
+printResults();
+
+mkpath $testResultsDirectory;
+
+open HTML, ">", $testResults or die "Failed to open $testResults. $!";
+print HTML "<html>\n";
+print HTML "<head>\n";
+print HTML "<title>Layout Test Results</title>\n";
+print HTML "</head>\n";
+print HTML "<body>\n";
+
+if ($ignoreMetrics) {
+ print HTML "<h4>Tested with metrics ignored.</h4>";
+}
+
+print HTML htmlForResultsSection(@{$tests{mismatch}}, "Tests where results did not match expected results", \&linksForMismatchTest);
+print HTML htmlForResultsSection(@{$tests{timedout}}, "Tests that timed out", \&linksForErrorTest);
+print HTML htmlForResultsSection(@{$tests{crash}}, "Tests that caused the DumpRenderTree tool to crash", \&linksForErrorTest);
+print HTML htmlForResultsSection(@{$tests{error}}, "Tests that had stderr output", \&linksForErrorTest);
+print HTML htmlForResultsSection(@{$tests{new}}, "Tests that had no expected results (probably new)", \&linksForNewTest);
+
+print HTML "</body>\n";
+print HTML "</html>\n";
+close HTML;
+
+my @configurationArgs = argumentsForConfiguration();
+
+if (isGtk()) {
+ system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
+} elsif (isQt()) {
+ unshift @configurationArgs, qw(-graphicssystem raster -style windows);
+ if (isCygwin()) {
+ $testResults = "/" . toWindowsPath($testResults);
+ $testResults =~ s/\\/\//g;
+ }
+ system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
+} elsif (isCygwin()) {
+ system "cygstart", $testResults if $launchSafari;
+} elsif (isWindows()) {
+ system "start", $testResults if $launchSafari;
+} else {
+ system "WebKitTools/Scripts/run-safari", @configurationArgs, "-NSOpen", $testResults if $launchSafari;
+}
+
+closeCygpaths() if isCygwin();
+
+exit 1;
+
+sub countAndPrintLeaks($$$)
+{
+ my ($dumpToolName, $dumpToolPID, $leaksFilePath) = @_;
+
+ print "\n" unless $atLineStart;
+ $atLineStart = 1;
+
+ # We are excluding the following reported leaks so they don't get in our way when looking for WebKit leaks:
+ # This allows us ignore known leaks and only be alerted when new leaks occur. Some leaks are in the old
+ # versions of the system frameworks that are being used by the leaks bots. Even though a leak has been
+ # fixed, it will be listed here until the bot has been updated with the newer frameworks.
+
+ my @typesToExclude = (
+ );
+
+ my @callStacksToExclude = (
+ "Flash_EnforceLocalSecurity" # leaks in Flash plug-in code, rdar://problem/4449747
+ );
+
+ if (isTiger()) {
+ # Leak list for the version of Tiger used on the build bot.
+ push @callStacksToExclude, (
+ "CFRunLoopRunSpecific \\| malloc_zone_malloc", "CFRunLoopRunSpecific \\| CFAllocatorAllocate ", # leak in CFRunLoopRunSpecific, rdar://problem/4670839
+ "CGImageSourceGetPropertiesAtIndex", # leak in ImageIO, rdar://problem/4628809
+ "FOGetCoveredUnicodeChars", # leak in ATS, rdar://problem/3943604
+ "GetLineDirectionPreference", "InitUnicodeUtilities", # leaks tool falsely reporting leak in CFNotificationCenterAddObserver, rdar://problem/4964790
+ "ICCFPrefWrapper::GetPrefDictionary", # leaks in Internet Config. code, rdar://problem/4449794
+ "NSHTTPURLProtocol setResponseHeader:", # leak in multipart/mixed-replace handling in Foundation, no Radar, but fixed in Leopard
+ "NSURLCache cachedResponseForRequest", # leak in CFURL cache, rdar://problem/4768430
+ "PCFragPrepareClosureFromFile", # leak in Code Fragment Manager, rdar://problem/3426998
+ "WebCore::Selection::toRange", # bug in 'leaks', rdar://problem/4967949
+ "WebCore::SubresourceLoader::create", # bug in 'leaks', rdar://problem/4985806
+ "_CFPreferencesDomainDeepCopyDictionary", # leak in CFPreferences, rdar://problem/4220786
+ "_objc_msgForward", # leak in NSSpellChecker, rdar://problem/4965278
+ "gldGetString", # leak in OpenGL, rdar://problem/5013699
+ "_setDefaultUserInfoFromURL", # leak in NSHTTPAuthenticator, rdar://problem/5546453
+ "SSLHandshake", # leak in SSL, rdar://problem/5546440
+ "SecCertificateCreateFromData", # leak in SSL code, rdar://problem/4464397
+ );
+ push @typesToExclude, (
+ "THRD", # bug in 'leaks', rdar://problem/3387783
+ "DRHT", # ditto (endian little hate i)
+ );
+ }
+
+ if (isLeopard()) {
+ # Leak list for the version of Leopard used on the build bot.
+ push @callStacksToExclude, (
+ "CFHTTPMessageAppendBytes", # leak in CFNetwork, rdar://problem/5435912
+ "sendDidReceiveDataCallback", # leak in CFNetwork, rdar://problem/5441619
+ "_CFHTTPReadStreamReadMark", # leak in CFNetwork, rdar://problem/5441468
+ "httpProtocolStart", # leak in CFNetwork, rdar://problem/5468837
+ "_CFURLConnectionSendCallbacks", # leak in CFNetwork, rdar://problem/5441600
+ "DispatchQTMsg", # leak in QuickTime, PPC only, rdar://problem/5667132
+ "QTMovieContentView createVisualContext", # leak in QuickTime, PPC only, rdar://problem/5667132
+ "_CopyArchitecturesForJVMVersion", # leak in Java, rdar://problem/5910823
+ );
+ }
+
+ if (isSnowLeopard()) {
+ push @callStacksToExclude, (
+ "readMakerNoteProps", # <rdar://problem/7156432> leak in ImageIO
+ "QTKitMovieControllerView completeUISetup", # <rdar://problem/7155156> leak in QTKit
+ "getVMInitArgs", # <rdar://problem/7714444> leak in Java
+ "Java_java_lang_System_initProperties", # <rdar://problem/7714465> leak in Java
+ "glrCompExecuteKernel", # <rdar://problem/7815391> leak in graphics driver while using OpenGL
+ );
+ }
+
+ if (isDarwin() && !isTiger() && !isLeopard() && !isSnowLeopard()) {
+ push @callStacksToExclude, (
+ "CGGradientCreateWithColorComponents", # leak in CoreGraphics, <rdar://problem/7888492>
+ );
+ }
+
+ my $leaksTool = sourceDir() . "/WebKitTools/Scripts/run-leaks";
+ my $excludeString = "--exclude-callstack '" . (join "' --exclude-callstack '", @callStacksToExclude) . "'";
+ $excludeString .= " --exclude-type '" . (join "' --exclude-type '", @typesToExclude) . "'" if @typesToExclude;
+
+ print " ? checking for leaks in $dumpToolName\n";
+ my $leaksOutput = `$leaksTool $excludeString $dumpToolPID`;
+ my ($count, $bytes) = $leaksOutput =~ /Process $dumpToolPID: (\d+) leaks? for (\d+) total/;
+ my ($excluded) = $leaksOutput =~ /(\d+) leaks? excluded/;
+
+ my $adjustedCount = $count;
+ $adjustedCount -= $excluded if $excluded;
+
+ if (!$adjustedCount) {
+ print " - no leaks found\n";
+ unlink $leaksFilePath;
+ return 0;
+ } else {
+ my $dir = $leaksFilePath;
+ $dir =~ s|/[^/]+$|| or die;
+ mkpath $dir;
+
+ if ($excluded) {
+ print " + $adjustedCount leaks ($bytes bytes including $excluded excluded leaks) were found, details in $leaksFilePath\n";
+ } else {
+ print " + $count leaks ($bytes bytes) were found, details in $leaksFilePath\n";
+ }
+
+ writeToFile($leaksFilePath, $leaksOutput);
+
+ push @leaksFilenames, $leaksFilePath;
+ }
+
+ return $adjustedCount;
+}
+
+sub writeToFile($$)
+{
+ my ($filePath, $contents) = @_;
+ open NEWFILE, ">", "$filePath" or die "Could not create $filePath. $!\n";
+ print NEWFILE $contents;
+ close NEWFILE;
+}
+
+# Break up a path into the directory (with slash) and base name.
+sub splitpath($)
+{
+ my ($path) = @_;
+
+ my $pathSeparator = "/";
+ my $dirname = dirname($path) . $pathSeparator;
+ $dirname = "" if $dirname eq "." . $pathSeparator;
+
+ return ($dirname, basename($path));
+}
+
+# Sort first by directory, then by file, so all paths in one directory are grouped
+# rather than being interspersed with items from subdirectories.
+# Use numericcmp to sort directory and filenames to make order logical.
+sub pathcmp($$)
+{
+ my ($patha, $pathb) = @_;
+
+ my ($dira, $namea) = splitpath($patha);
+ my ($dirb, $nameb) = splitpath($pathb);
+
+ return numericcmp($dira, $dirb) if $dira ne $dirb;
+ return numericcmp($namea, $nameb);
+}
+
+# Sort numeric parts of strings as numbers, other parts as strings.
+# Makes 1.33 come after 1.3, which is cool.
+sub numericcmp($$)
+{
+ my ($aa, $bb) = @_;
+
+ my @a = split /(\d+)/, $aa;
+ my @b = split /(\d+)/, $bb;
+
+ # Compare one chunk at a time.
+ # Each chunk is either all numeric digits, or all not numeric digits.
+ while (@a && @b) {
+ my $a = shift @a;
+ my $b = shift @b;
+
+ # Use numeric comparison if chunks are non-equal numbers.
+ return $a <=> $b if $a =~ /^\d/ && $b =~ /^\d/ && $a != $b;
+
+ # Use string comparison if chunks are any other kind of non-equal string.
+ return $a cmp $b if $a ne $b;
+ }
+
+ # One of the two is now empty; compare lengths for result in this case.
+ return @a <=> @b;
+}
+
+# Sort slowest tests first.
+sub slowestcmp($$)
+{
+ my ($testa, $testb) = @_;
+
+ my $dura = $durations{$testa};
+ my $durb = $durations{$testb};
+ return $durb <=> $dura if $dura != $durb;
+ return pathcmp($testa, $testb);
+}
+
+sub launchWithEnv(\@\%)
+{
+ my ($args, $env) = @_;
+
+ # Dump the current environment as perl code and then put it in quotes so it is one parameter.
+ my $environmentDumper = Data::Dumper->new([\%{$env}], [qw(*ENV)]);
+ $environmentDumper->Indent(0);
+ $environmentDumper->Purity(1);
+ my $allEnvVars = $environmentDumper->Dump();
+ unshift @{$args}, "\"$allEnvVars\"";
+
+ my $execScript = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts execAppWithEnv));
+ unshift @{$args}, $perlInterpreter, $execScript;
+ return @{$args};
+}
+
+sub resolveAndMakeTestResultsDirectory()
+{
+ my $absTestResultsDirectory = File::Spec->rel2abs(glob $testResultsDirectory);
+ mkpath $absTestResultsDirectory;
+ return $absTestResultsDirectory;
+}
+
+sub openDiffTool()
+{
+ return if $isDiffToolOpen;
+ return if !$pixelTests;
+
+ my %CLEAN_ENV;
+ $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
+ $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, launchWithEnv(@diffToolArgs, %CLEAN_ENV)) or die "unable to open $imageDiffTool\n";
+ $isDiffToolOpen = 1;
+}
+
+sub buildDumpTool($)
+{
+ my ($dumpToolName) = @_;
+
+ my $dumpToolBuildScript = "build-" . lc($dumpToolName);
+ print STDERR "Running $dumpToolBuildScript\n";
+
+ local *DEVNULL;
+ my ($childIn, $childOut, $childErr);
+ if ($quiet) {
+ open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
+ $childOut = ">&DEVNULL";
+ $childErr = ">&DEVNULL";
+ } else {
+ # When not quiet, let the child use our stdout/stderr.
+ $childOut = ">&STDOUT";
+ $childErr = ">&STDERR";
+ }
+
+ my @args = argumentsForConfiguration();
+ my $buildProcess = open3($childIn, $childOut, $childErr, $perlInterpreter, File::Spec->catfile(qw(WebKitTools Scripts), $dumpToolBuildScript), @args) or die "Failed to run build-dumprendertree";
+ close($childIn);
+ waitpid $buildProcess, 0;
+ my $buildResult = $?;
+ close($childOut);
+ close($childErr);
+
+ close DEVNULL if ($quiet);
+
+ if ($buildResult) {
+ print STDERR "Compiling $dumpToolName failed!\n";
+ exit exitStatus($buildResult);
+ }
+}
+
+sub openDumpTool()
+{
+ return if $isDumpToolOpen;
+
+ if ($verbose && $testsPerDumpTool != 1) {
+ print "| Opening DumpTool |\n";
+ }
+
+ my %CLEAN_ENV;
+
+ # Generic environment variables
+ if (defined $ENV{'WEBKIT_TESTFONTS'}) {
+ $CLEAN_ENV{WEBKIT_TESTFONTS} = $ENV{'WEBKIT_TESTFONTS'};
+ }
+
+ # unique temporary directory for each DumpRendertree - needed for running more DumpRenderTree in parallel
+ $CLEAN_ENV{DUMPRENDERTREE_TEMP} = File::Temp::tempdir('DumpRenderTree-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+ $CLEAN_ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995>
+
+ # Platform spesifics
+ if (isLinux()) {
+ if (defined $ENV{'DISPLAY'}) {
+ $CLEAN_ENV{DISPLAY} = $ENV{'DISPLAY'};
+ } else {
+ $CLEAN_ENV{DISPLAY} = ":1";
+ }
+ if (defined $ENV{'XAUTHORITY'}) {
+ $CLEAN_ENV{XAUTHORITY} = $ENV{'XAUTHORITY'};
+ }
+
+ $CLEAN_ENV{HOME} = $ENV{'HOME'};
+
+ if (defined $ENV{'LD_LIBRARY_PATH'}) {
+ $CLEAN_ENV{LD_LIBRARY_PATH} = $ENV{'LD_LIBRARY_PATH'};
+ }
+ if (defined $ENV{'DBUS_SESSION_BUS_ADDRESS'}) {
+ $CLEAN_ENV{DBUS_SESSION_BUS_ADDRESS} = $ENV{'DBUS_SESSION_BUS_ADDRESS'};
+ }
+ } elsif (isDarwin()) {
+ if (defined $ENV{'DYLD_LIBRARY_PATH'}) {
+ $CLEAN_ENV{DYLD_LIBRARY_PATH} = $ENV{'DYLD_LIBRARY_PATH'};
+ }
+
+ $CLEAN_ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+ $CLEAN_ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
+ } elsif (isCygwin()) {
+ $CLEAN_ENV{HOMEDRIVE} = $ENV{'HOMEDRIVE'};
+ $CLEAN_ENV{HOMEPATH} = $ENV{'HOMEPATH'};
+ $CLEAN_ENV{_NT_SYMBOL_PATH} = $ENV{_NT_SYMBOL_PATH};
+
+ setPathForRunningWebKitApp(\%CLEAN_ENV);
+ }
+
+ # Port specifics
+ if (isGtk()) {
+ $CLEAN_ENV{GTK_MODULES} = "gail";
+ $CLEAN_ENV{WEBKIT_INSPECTOR_PATH} = "$productDir/resources/inspector";
+ }
+
+ if (isQt()) {
+ $CLEAN_ENV{QTWEBKIT_PLUGIN_PATH} = productDir() . "/lib/plugins";
+ $CLEAN_ENV{QT_DRT_WEBVIEW_MODE} = $ENV{"QT_DRT_WEBVIEW_MODE"};
+ }
+
+ my @args = ($dumpTool, @toolArgs);
+ if (isAppleMacWebKit() and !isTiger()) {
+ unshift @args, "arch", "-" . architecture();
+ }
+
+ if ($useValgrind) {
+ unshift @args, "valgrind", "--suppressions=$platformBaseDirectory/qt/SuppressedValgrindErrors";
+ }
+
+ if ($useWebKitTestRunner) {
+ # Make WebKitTestRunner use a similar timeout. We don't use the exact same timeout to avoid
+ # race conditions.
+ push @args, "--timeout", $timeoutSeconds - 5;
+ }
+
+ $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
+
+ $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, launchWithEnv(@args, %CLEAN_ENV)) or die "Failed to start tool: $dumpTool\n";
+ $isDumpToolOpen = 1;
+ $dumpToolCrashed = 0;
+}
+
+sub closeDumpTool()
+{
+ return if !$isDumpToolOpen;
+
+ if ($verbose && $testsPerDumpTool != 1) {
+ print "| Closing DumpTool |\n";
+ }
+
+ close IN;
+ close OUT;
+ waitpid $dumpToolPID, 0;
+
+ # check for WebCore counter leaks.
+ if ($shouldCheckLeaks) {
+ while (<ERROR>) {
+ print;
+ }
+ }
+ close ERROR;
+ $isDumpToolOpen = 0;
+}
+
+sub dumpToolDidCrash()
+{
+ return 1 if $dumpToolCrashed;
+ return 0 unless $isDumpToolOpen;
+ my $pid = waitpid(-1, WNOHANG);
+ return 1 if ($pid == $dumpToolPID);
+
+ # On Mac OS X, crashing may be significantly delayed by crash reporter.
+ return 0 unless isAppleMacWebKit();
+
+ return DumpRenderTreeSupport::processIsCrashing($dumpToolPID);
+}
+
+sub configureAndOpenHTTPDIfNeeded()
+{
+ return if $isHttpdOpen;
+ my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
+ my $listen = "127.0.0.1:$httpdPort";
+ my @args = (
+ "-c", "CustomLog \"$absTestResultsDirectory/access_log.txt\" common",
+ "-c", "ErrorLog \"$absTestResultsDirectory/error_log.txt\"",
+ "-C", "Listen $listen"
+ );
+
+ my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory);
+ @args = (@defaultArgs, @args);
+
+ waitForHTTPDLock() if $shouldWaitForHTTPD;
+ $isHttpdOpen = openHTTPD(@args);
+}
+
+sub checkPythonVersion()
+{
+ # we have not chdir to sourceDir yet.
+ system $perlInterpreter, File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts ensure-valid-python)), "--check-only";
+ return exitStatus($?) == 0;
+}
+
+sub openWebSocketServerIfNeeded()
+{
+ return 1 if $isWebSocketServerOpen;
+ return 0 if $failedToStartWebSocketServer;
+
+ my $webSocketHandlerDir = "$testDirectory";
+ my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
+ $webSocketServerPidFile = "$absTestResultsDirectory/websocket.pid";
+
+ my @args = (
+ "WebKitTools/Scripts/new-run-webkit-websocketserver",
+ "--server", "start",
+ "--port", "$webSocketPort",
+ "--root", "$webSocketHandlerDir",
+ "--output-dir", "$absTestResultsDirectory",
+ "--pidfile", "$webSocketServerPidFile"
+ );
+ system "/usr/bin/python", @args;
+
+ $isWebSocketServerOpen = 1;
+ return 1;
+}
+
+sub closeWebSocketServer()
+{
+ return if !$isWebSocketServerOpen;
+
+ my @args = (
+ "WebKitTools/Scripts/new-run-webkit-websocketserver",
+ "--server", "stop",
+ "--pidfile", "$webSocketServerPidFile"
+ );
+ system "/usr/bin/python", @args;
+ unlink "$webSocketServerPidFile";
+
+ # wss is disabled until all platforms support pyOpenSSL.
+ $isWebSocketServerOpen = 0;
+}
+
+sub fileNameWithNumber($$)
+{
+ my ($base, $number) = @_;
+ return "$base$number" if ($number > 1);
+ return $base;
+}
+
+sub processIgnoreTests($$)
+{
+ my @ignoreList = split(/\s*,\s*/, shift);
+ my $listName = shift;
+
+ my $disabledSuffix = "-disabled";
+
+ my $addIgnoredDirectories = sub {
+ return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
+ $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)} = 1;
+ return @_;
+ };
+ foreach my $item (@ignoreList) {
+ my $path = catfile($testDirectory, $item);
+ if (-d $path) {
+ $ignoredDirectories{$item} = 1;
+ find({ preprocess => $addIgnoredDirectories, wanted => sub {} }, $path);
+ }
+ elsif (-f $path) {
+ $ignoredFiles{$item} = 1;
+ } elsif (-f $path . $disabledSuffix) {
+ # The test is disabled, so do nothing.
+ } else {
+ print "$listName list contained '$item', but no file of that name could be found\n";
+ }
+ }
+}
+
+sub stripExtension($)
+{
+ my ($test) = @_;
+
+ $test =~ s/\.[a-zA-Z]+$//;
+ return $test;
+}
+
+sub isTextOnlyTest($)
+{
+ my ($actual) = @_;
+ my $isText;
+ if ($actual =~ /^layer at/ms) {
+ $isText = 0;
+ } else {
+ $isText = 1;
+ }
+ return $isText;
+}
+
+sub expectedDirectoryForTest($;$;$)
+{
+ my ($base, $isText, $expectedExtension) = @_;
+
+ my @directories = @platformResultHierarchy;
+ push @directories, map { catdir($platformBaseDirectory, $_) } qw(mac-snowleopard mac) if isAppleWinWebKit();
+ push @directories, $expectedDirectory;
+
+ # If we already have expected results, just return their location.
+ foreach my $directory (@directories) {
+ return $directory if -f File::Spec->catfile($directory, "$base-$expectedTag.$expectedExtension");
+ }
+
+ # For cross-platform tests, text-only results should go in the cross-platform directory,
+ # while render tree dumps should go in the least-specific platform directory.
+ return $isText ? $expectedDirectory : $platformResultHierarchy[$#platformResultHierarchy];
+}
+
+sub countFinishedTest($$$$)
+{
+ my ($test, $base, $result, $isText) = @_;
+
+ if (($count + 1) % $testsPerDumpTool == 0 || $count == $#tests) {
+ if ($shouldCheckLeaks) {
+ my $fileName;
+ if ($testsPerDumpTool == 1) {
+ $fileName = File::Spec->catfile($testResultsDirectory, "$base-leaks.txt");
+ } else {
+ $fileName = File::Spec->catfile($testResultsDirectory, fileNameWithNumber($dumpToolName, $leaksOutputFileNumber) . "-leaks.txt");
+ }
+ my $leakCount = countAndPrintLeaks($dumpToolName, $dumpToolPID, $fileName);
+ $totalLeaks += $leakCount;
+ $leaksOutputFileNumber++ if ($leakCount);
+ }
+
+ closeDumpTool();
+ }
+
+ $count++;
+ $counts{$result}++;
+ push @{$tests{$result}}, $test;
+}
+
+sub testCrashedOrTimedOut($$$$$)
+{
+ my ($test, $base, $didCrash, $actual, $error) = @_;
+
+ printFailureMessageForTest($test, $didCrash ? "crashed" : "timed out");
+
+ sampleDumpTool() unless $didCrash;
+
+ my $dir = dirname(File::Spec->catdir($testResultsDirectory, $base));
+ mkpath $dir;
+
+ deleteExpectedAndActualResults($base);
+
+ if (defined($error) && length($error)) {
+ writeToFile(File::Spec->catfile($testResultsDirectory, "$base-$errorTag.txt"), $error);
+ }
+
+ recordActualResultsAndDiff($base, $actual);
+
+ kill 9, $dumpToolPID unless $didCrash;
+
+ closeDumpTool();
+
+ return unless isCygwin() && !$didCrash && $base =~ /^http/;
+ # On Cygwin, http tests timing out can be a symptom of a non-responsive httpd.
+ # If we timed out running an http test, try restarting httpd.
+ $isHttpdOpen = !closeHTTPD();
+ configureAndOpenHTTPDIfNeeded();
+}
+
+sub printFailureMessageForTest($$)
+{
+ my ($test, $description) = @_;
+
+ unless ($verbose) {
+ print "\n" unless $atLineStart;
+ print "$test -> ";
+ }
+ print "$description\n";
+ $atLineStart = 1;
+}
+
+my %cygpaths = ();
+
+sub openCygpathIfNeeded($)
+{
+ my ($options) = @_;
+
+ return unless isCygwin();
+ return $cygpaths{$options} if $cygpaths{$options} && $cygpaths{$options}->{"open"};
+
+ local (*CYGPATHIN, *CYGPATHOUT);
+ my $pid = open2(\*CYGPATHIN, \*CYGPATHOUT, "cygpath -f - $options");
+ my $cygpath = {
+ "pid" => $pid,
+ "in" => *CYGPATHIN,
+ "out" => *CYGPATHOUT,
+ "open" => 1
+ };
+
+ $cygpaths{$options} = $cygpath;
+
+ return $cygpath;
+}
+
+sub closeCygpaths()
+{
+ return unless isCygwin();
+
+ foreach my $cygpath (values(%cygpaths)) {
+ close $cygpath->{"in"};
+ close $cygpath->{"out"};
+ waitpid($cygpath->{"pid"}, 0);
+ $cygpath->{"open"} = 0;
+
+ }
+}
+
+sub convertPathUsingCygpath($$)
+{
+ my ($path, $options) = @_;
+
+ # cygpath -f (at least in Cygwin 1.7) converts spaces into newlines. We remove spaces here and
+ # add them back in after conversion to work around this.
+ my $spaceSubstitute = "__NOTASPACE__";
+ $path =~ s/ /\Q$spaceSubstitute\E/g;
+
+ my $cygpath = openCygpathIfNeeded($options);
+ local *inFH = $cygpath->{"in"};
+ local *outFH = $cygpath->{"out"};
+ print outFH $path . "\n";
+ my $convertedPath = <inFH>;
+ chomp($convertedPath) if defined $convertedPath;
+
+ $convertedPath =~ s/\Q$spaceSubstitute\E/ /g;
+ return $convertedPath;
+}
+
+sub toCygwinPath($)
+{
+ my ($path) = @_;
+ return unless isCygwin();
+
+ return convertPathUsingCygpath($path, "-u");
+}
+
+sub toWindowsPath($)
+{
+ my ($path) = @_;
+ return unless isCygwin();
+
+ return convertPathUsingCygpath($path, "-w");
+}
+
+sub toURL($)
+{
+ my ($path) = @_;
+
+ if ($useRemoteLinksToTests) {
+ my $relativePath = File::Spec->abs2rel($path, $testDirectory);
+
+ # If the file is below the test directory then convert it into a link to the file in SVN
+ if ($relativePath !~ /^\.\.\//) {
+ my $revision = svnRevisionForDirectory($testDirectory);
+ my $svnPath = pathRelativeToSVNRepositoryRootForPath($path);
+ return "http://trac.webkit.org/export/$revision/$svnPath";
+ }
+ }
+
+ return $path unless isCygwin();
+
+ return "file:///" . convertPathUsingCygpath($path, "-m");
+}
+
+sub validateSkippedArg($$;$)
+{
+ my ($option, $value, $value2) = @_;
+ my %validSkippedValues = map { $_ => 1 } qw(default ignore only);
+ $value = lc($value);
+ die "Invalid argument '" . $value . "' for option $option" unless $validSkippedValues{$value};
+ $treatSkipped = $value;
+}
+
+sub htmlForResultsSection(\@$&)
+{
+ my ($tests, $description, $linkGetter) = @_;
+
+ my @html = ();
+ return join("\n", @html) unless @{$tests};
+
+ push @html, "<p>$description:</p>";
+ push @html, "<table>";
+ foreach my $test (@{$tests}) {
+ push @html, "<tr>";
+ push @html, "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$test</a></td>";
+ foreach my $link (@{&{$linkGetter}($test)}) {
+ push @html, "<td><a href=\"$link->{href}\">$link->{text}</a></td>";
+ }
+ push @html, "</tr>";
+ }
+ push @html, "</table>";
+
+ return join("\n", @html);
+}
+
+sub linksForExpectedAndActualResults($)
+{
+ my ($base) = @_;
+
+ my @links = ();
+
+ return \@links unless -s "$testResultsDirectory/$base-$diffsTag.txt";
+
+ my $expectedResultPath = $expectedResultPaths{$base};
+ my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
+
+ push @links, { href => "$base-$expectedTag$expectedResultExtension", text => "expected" };
+ push @links, { href => "$base-$actualTag$expectedResultExtension", text => "actual" };
+ push @links, { href => "$base-$diffsTag.txt", text => "diff" };
+ push @links, { href => "$base-$prettyDiffTag.html", text => "pretty diff" };
+
+ return \@links;
+}
+
+sub linksForMismatchTest
+{
+ my ($test) = @_;
+
+ my @links = ();
+
+ my $base = stripExtension($test);
+
+ push @links, @{linksForExpectedAndActualResults($base)};
+ return \@links unless $pixelTests && $imagesPresent{$base};
+
+ push @links, { href => "$base-$expectedTag.png", text => "expected image" };
+ push @links, { href => "$base-$diffsTag.html", text => "image diffs" };
+ push @links, { href => "$base-$diffsTag.png", text => "$imageDifferences{$base}%" };
+
+ return \@links;
+}
+
+sub linksForErrorTest
+{
+ my ($test) = @_;
+
+ my @links = ();
+
+ my $base = stripExtension($test);
+
+ push @links, @{linksForExpectedAndActualResults($base)};
+ push @links, { href => "$base-$errorTag.txt", text => "stderr" };
+
+ return \@links;
+}
+
+sub linksForNewTest
+{
+ my ($test) = @_;
+
+ my @links = ();
+
+ my $base = stripExtension($test);
+
+ my $expectedResultPath = $expectedResultPaths{$base};
+ my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
+
+ push @links, { href => "$base-$actualTag$expectedResultExtension", text => "result" };
+ if ($pixelTests && $imagesPresent{$base}) {
+ push @links, { href => "$base-$expectedTag.png", text => "image" };
+ }
+
+ return \@links;
+}
+
+sub deleteExpectedAndActualResults($)
+{
+ my ($base) = @_;
+
+ unlink "$testResultsDirectory/$base-$actualTag.txt";
+ unlink "$testResultsDirectory/$base-$diffsTag.txt";
+ unlink "$testResultsDirectory/$base-$errorTag.txt";
+}
+
+sub recordActualResultsAndDiff($$)
+{
+ my ($base, $actualResults) = @_;
+
+ return unless defined($actualResults) && length($actualResults);
+
+ my $expectedResultPath = $expectedResultPaths{$base};
+ my ($expectedResultFileNameMinusExtension, $expectedResultDirectoryPath, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
+ my $actualResultsPath = File::Spec->catfile($testResultsDirectory, "$base-$actualTag$expectedResultExtension");
+ my $copiedExpectedResultsPath = File::Spec->catfile($testResultsDirectory, "$base-$expectedTag$expectedResultExtension");
+
+ mkpath(dirname($actualResultsPath));
+ writeToFile("$actualResultsPath", $actualResults);
+
+ if (-f $expectedResultPath) {
+ copy("$expectedResultPath", "$copiedExpectedResultsPath");
+ } else {
+ open EMPTY, ">$copiedExpectedResultsPath";
+ close EMPTY;
+ }
+
+ my $diffOuputBasePath = File::Spec->catfile($testResultsDirectory, $base);
+ my $diffOutputPath = "$diffOuputBasePath-$diffsTag.txt";
+ system "diff -u \"$copiedExpectedResultsPath\" \"$actualResultsPath\" > \"$diffOutputPath\"";
+
+ my $prettyDiffOutputPath = "$diffOuputBasePath-$prettyDiffTag.html";
+ my $prettyPatchPath = "BugsSite/PrettyPatch/";
+ my $prettifyPath = "$prettyPatchPath/prettify.rb";
+ system "ruby -I \"$prettyPatchPath\" \"$prettifyPath\" \"$diffOutputPath\" > \"$prettyDiffOutputPath\"";
+}
+
+sub buildPlatformResultHierarchy()
+{
+ mkpath($platformTestDirectory) if ($platform eq "undefined" && !-d "$platformTestDirectory");
+
+ my @platforms;
+
+ my $isMac = $platform =~ /^mac/;
+ my $isWin = $platform =~ /^win/;
+ if ($isMac || $isWin) {
+ my $effectivePlatform = $platform;
+ if ($platform eq "mac-wk2" || $platform eq "win-wk2") {
+ push @platforms, $platform;
+ $effectivePlatform = $realPlatform;
+ }
+
+ my @platformList = $isMac ? @macPlatforms : @winPlatforms;
+ my $i;
+ for ($i = 0; $i < @platformList; $i++) {
+ last if $platformList[$i] eq $effectivePlatform;
+ }
+ for (; $i < @platformList; $i++) {
+ push @platforms, $platformList[$i];
+ }
+ } elsif ($platform =~ /^qt-/) {
+ push @platforms, $platform;
+ push @platforms, "qt";
+ } else {
+ @platforms = $platform;
+ }
+
+ my @hierarchy;
+ for (my $i = 0; $i < @platforms; $i++) {
+ my $scoped = catdir($platformBaseDirectory, $platforms[$i]);
+ push(@hierarchy, $scoped) if (-d $scoped);
+ }
+
+ return @hierarchy;
+}
+
+sub buildPlatformTestHierarchy(@)
+{
+ my (@platformHierarchy) = @_;
+ return @platformHierarchy if (@platformHierarchy < 2);
+ if ($platformHierarchy[0] =~ /mac-wk2/) {
+ return ($platformHierarchy[0], $platformHierarchy[1], $platformHierarchy[$#platformHierarchy]);
+ }
+ return ($platformHierarchy[0], $platformHierarchy[$#platformHierarchy]);
+}
+
+sub epiloguesAndPrologues($$)
+{
+ my ($lastDirectory, $directory) = @_;
+ my @lastComponents = split('/', $lastDirectory);
+ my @components = split('/', $directory);
+
+ while (@lastComponents) {
+ if (!defined($components[0]) || $lastComponents[0] ne $components[0]) {
+ last;
+ }
+ shift @components;
+ shift @lastComponents;
+ }
+
+ my @result;
+ my $leaving = $lastDirectory;
+ foreach (@lastComponents) {
+ my $epilogue = $leaving . "/resources/run-webkit-tests-epilogue.html";
+ foreach (@platformResultHierarchy) {
+ push @result, catdir($_, $epilogue) if (stat(catdir($_, $epilogue)));
+ }
+ push @result, catdir($testDirectory, $epilogue) if (stat(catdir($testDirectory, $epilogue)));
+ $leaving =~ s|(^\|/)[^/]+$||;
+ }
+
+ my $entering = $leaving;
+ foreach (@components) {
+ $entering .= '/' . $_;
+ my $prologue = $entering . "/resources/run-webkit-tests-prologue.html";
+ push @result, catdir($testDirectory, $prologue) if (stat(catdir($testDirectory, $prologue)));
+ foreach (reverse @platformResultHierarchy) {
+ push @result, catdir($_, $prologue) if (stat(catdir($_, $prologue)));
+ }
+ }
+ return @result;
+}
+
+sub parseLeaksandPrintUniqueLeaks()
+{
+ return unless @leaksFilenames;
+
+ my $mergedFilenames = join " ", @leaksFilenames;
+ my $parseMallocHistoryTool = sourceDir() . "/WebKitTools/Scripts/parse-malloc-history";
+
+ open MERGED_LEAKS, "cat $mergedFilenames | $parseMallocHistoryTool --merge-depth $mergeDepth - |" ;
+ my @leakLines = <MERGED_LEAKS>;
+ close MERGED_LEAKS;
+
+ my $uniqueLeakCount = 0;
+ my $totalBytes;
+ foreach my $line (@leakLines) {
+ ++$uniqueLeakCount if ($line =~ /^(\d*)\scalls/);
+ $totalBytes = $1 if $line =~ /^total\:\s(.*)\s\(/;
+ }
+
+ print "\nWARNING: $totalLeaks total leaks found for a total of $totalBytes!\n";
+ print "WARNING: $uniqueLeakCount unique leaks found!\n";
+ print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
+
+}
+
+sub extensionForMimeType($)
+{
+ my ($mimeType) = @_;
+
+ if ($mimeType eq "application/x-webarchive") {
+ return "webarchive";
+ } elsif ($mimeType eq "application/pdf") {
+ return "pdf";
+ }
+ return "txt";
+}
+
+# Read up to the first #EOF (the content block of the test), or until detecting crashes or timeouts.
+sub readFromDumpToolWithTimer(**)
+{
+ my ($fhIn, $fhError) = @_;
+
+ setFileHandleNonBlocking($fhIn, 1);
+ setFileHandleNonBlocking($fhError, 1);
+
+ my $maximumSecondsWithoutOutput = $timeoutSeconds;
+ my $microsecondsToWaitBeforeReadingAgain = 1000;
+
+ my $timeOfLastSuccessfulRead = time;
+
+ my @output = ();
+ my @error = ();
+ my $status = "success";
+ my $mimeType = "text/plain";
+ # We don't have a very good way to know when the "headers" stop
+ # and the content starts, so we use this as a hack:
+ my $haveSeenContentType = 0;
+ my $haveSeenEofIn = 0;
+ my $haveSeenEofError = 0;
+
+ while (1) {
+ if (time - $timeOfLastSuccessfulRead > $maximumSecondsWithoutOutput) {
+ $status = dumpToolDidCrash() ? "crashed" : "timedOut";
+ last;
+ }
+
+ # Once we've seen the EOF, we must not read anymore.
+ my $lineIn = readline($fhIn) unless $haveSeenEofIn;
+ my $lineError = readline($fhError) unless $haveSeenEofError;
+ if (!defined($lineIn) && !defined($lineError)) {
+ last if ($haveSeenEofIn && $haveSeenEofError);
+
+ if ($! != EAGAIN) {
+ $status = "crashed";
+ last;
+ }
+
+ # No data ready
+ usleep($microsecondsToWaitBeforeReadingAgain);
+ next;
+ }
+
+ $timeOfLastSuccessfulRead = time;
+
+ if (defined($lineIn)) {
+ if (!$haveSeenContentType && $lineIn =~ /^Content-Type: (\S+)$/) {
+ $mimeType = $1;
+ $haveSeenContentType = 1;
+ } elsif ($lineIn =~ /#EOF/) {
+ $haveSeenEofIn = 1;
+ } else {
+ push @output, $lineIn;
+ }
+ }
+ if (defined($lineError)) {
+ if ($lineError =~ /#CRASHED/) {
+ $status = "crashed";
+ last;
+ }
+ if ($lineError =~ /#EOF/) {
+ $haveSeenEofError = 1;
+ } else {
+ push @error, $lineError;
+ }
+ }
+ }
+
+ setFileHandleNonBlocking($fhIn, 0);
+ setFileHandleNonBlocking($fhError, 0);
+ return {
+ output => join("", @output),
+ error => join("", @error),
+ status => $status,
+ mimeType => $mimeType,
+ extension => extensionForMimeType($mimeType)
+ };
+}
+
+sub setFileHandleNonBlocking(*$)
+{
+ my ($fh, $nonBlocking) = @_;
+
+ my $flags = fcntl($fh, F_GETFL, 0) or die "Couldn't get filehandle flags";
+
+ if ($nonBlocking) {
+ $flags |= O_NONBLOCK;
+ } else {
+ $flags &= ~O_NONBLOCK;
+ }
+
+ fcntl($fh, F_SETFL, $flags) or die "Couldn't set filehandle flags";
+
+ return 1;
+}
+
+sub sampleDumpTool()
+{
+ return unless isAppleMacWebKit();
+ return unless $runSample;
+
+ my $outputDirectory = "$ENV{HOME}/Library/Logs/DumpRenderTree";
+ -d $outputDirectory or mkdir $outputDirectory;
+
+ my $outputFile = "$outputDirectory/HangReport.txt";
+ system "/usr/bin/sample", $dumpToolPID, qw(10 10 -file), $outputFile;
+}
+
+sub stripMetrics($$)
+{
+ my ($actual, $expected) = @_;
+
+ foreach my $result ($actual, $expected) {
+ $result =~ s/at \(-?[0-9]+,-?[0-9]+\) *//g;
+ $result =~ s/size -?[0-9]+x-?[0-9]+ *//g;
+ $result =~ s/text run width -?[0-9]+: //g;
+ $result =~ s/text run width -?[0-9]+ [a-zA-Z ]+: //g;
+ $result =~ s/RenderButton {BUTTON} .*/RenderButton {BUTTON}/g;
+ $result =~ s/RenderImage {INPUT} .*/RenderImage {INPUT}/g;
+ $result =~ s/RenderBlock {INPUT} .*/RenderBlock {INPUT}/g;
+ $result =~ s/RenderTextControl {INPUT} .*/RenderTextControl {INPUT}/g;
+ $result =~ s/\([0-9]+px/px/g;
+ $result =~ s/ *" *\n +" */ /g;
+ $result =~ s/" +$/"/g;
+
+ $result =~ s/- /-/g;
+ $result =~ s/\n( *)"\s+/\n$1"/g;
+ $result =~ s/\s+"\n/"\n/g;
+ $result =~ s/scrollWidth [0-9]+/scrollWidth/g;
+ $result =~ s/scrollHeight [0-9]+/scrollHeight/g;
+ }
+
+ return ($actual, $expected);
+}
+
+sub fileShouldBeIgnored
+{
+ my ($filePath) = @_;
+ foreach my $ignoredDir (keys %ignoredDirectories) {
+ if ($filePath =~ m/^$ignoredDir/) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
+sub readSkippedFiles($)
+{
+ my ($constraintPath) = @_;
+
+ my @skippedFileDirectories = @platformTestHierarchy;
+
+ # Because nearly all of the skipped tests for WebKit 2 on Mac are due to
+ # cross-platform issues, Windows will use both the Mac and Windows skipped
+ # lists to avoid maintaining separate lists.
+ push(@skippedFileDirectories, catdir($platformBaseDirectory, "mac-wk2")) if $platform eq "win-wk2";
+
+ foreach my $level (@skippedFileDirectories) {
+ if (open SKIPPED, "<", "$level/Skipped") {
+ if ($verbose) {
+ my ($dir, $name) = splitpath($level);
+ print "Skipped tests in $name:\n";
+ }
+
+ while (<SKIPPED>) {
+ my $skipped = $_;
+ chomp $skipped;
+ $skipped =~ s/^[ \n\r]+//;
+ $skipped =~ s/[ \n\r]+$//;
+ if ($skipped && $skipped !~ /^#/) {
+ if ($skippedOnly) {
+ if (!fileShouldBeIgnored($skipped)) {
+ if (!$constraintPath) {
+ # Always add $skipped since no constraint path was specified on the command line.
+ push(@ARGV, $skipped);
+ } elsif ($skipped =~ /^($constraintPath)/) {
+ # Add $skipped only if it matches the current path constraint, e.g.,
+ # "--skipped=only dir1" with "dir1/file1.html" on the skipped list.
+ push(@ARGV, $skipped);
+ } elsif ($constraintPath =~ /^($skipped)/) {
+ # Add current path constraint if it is more specific than the skip list entry,
+ # e.g., "--skipped=only dir1/dir2/dir3" with "dir1" on the skipped list.
+ push(@ARGV, $constraintPath);
+ }
+ } elsif ($verbose) {
+ print " $skipped\n";
+ }
+ } else {
+ if ($verbose) {
+ print " $skipped\n";
+ }
+ processIgnoreTests($skipped, "Skipped");
+ }
+ }
+ }
+ close SKIPPED;
+ }
+ }
+}
+
+my @testsFound;
+
+sub directoryFilter
+{
+ return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
+ return () if exists $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)};
+ return @_;
+}
+
+sub fileFilter
+{
+ my $filename = $_;
+ if ($filename =~ /\.([^.]+)$/) {
+ if (exists $supportedFileExtensions{$1}) {
+ my $path = File::Spec->abs2rel(catfile($File::Find::dir, $filename), $testDirectory);
+ push @testsFound, $path if !exists $ignoredFiles{$path};
+ }
+ }
+}
+
+sub findTestsToRun
+{
+ my @testsToRun = ();
+
+ for my $test (@ARGV) {
+ $test =~ s/^(\Q$layoutTestsName\E|\Q$testDirectory\E)\///;
+ my $fullPath = catfile($testDirectory, $test);
+ if (file_name_is_absolute($test)) {
+ print "can't run test $test outside $testDirectory\n";
+ } elsif (-f $fullPath) {
+ my ($filename, $pathname, $fileExtension) = fileparse($test, qr{\.[^.]+$});
+ if (!exists $supportedFileExtensions{substr($fileExtension, 1)}) {
+ print "test $test does not have a supported extension\n";
+ } elsif ($testHTTP || $pathname !~ /^http\//) {
+ push @testsToRun, $test;
+ }
+ } elsif (-d $fullPath) {
+ @testsFound = ();
+ find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $fullPath);
+ for my $level (@platformTestHierarchy) {
+ my $platformPath = catfile($level, $test);
+ find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $platformPath) if (-d $platformPath);
+ }
+ push @testsToRun, sort pathcmp @testsFound;
+ @testsFound = ();
+ } else {
+ print "test $test not found\n";
+ }
+ }
+
+ if (!scalar @ARGV) {
+ @testsFound = ();
+ find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $testDirectory);
+ for my $level (@platformTestHierarchy) {
+ find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $level);
+ }
+ push @testsToRun, sort pathcmp @testsFound;
+ @testsFound = ();
+
+ # We need to minimize the time when Apache and WebSocketServer is locked by tests
+ # so run them last if no explicit order was specified in the argument list.
+ my @httpTests;
+ my @websocketTests;
+ my @otherTests;
+ foreach my $test (@testsToRun) {
+ if ($test =~ /^http\//) {
+ push(@httpTests, $test);
+ } elsif ($test =~ /^websocket\//) {
+ push(@websocketTests, $test);
+ } else {
+ push(@otherTests, $test);
+ }
+ }
+ @testsToRun = (@otherTests, @httpTests, @websocketTests);
+ }
+
+ # Reverse the tests
+ @testsToRun = reverse @testsToRun if $reverseTests;
+
+ # Shuffle the array
+ @testsToRun = shuffle(@testsToRun) if $randomizeTests;
+
+ return @testsToRun;
+}
+
+sub printResults
+{
+ my %text = (
+ match => "succeeded",
+ mismatch => "had incorrect layout",
+ new => "were new",
+ timedout => "timed out",
+ crash => "crashed",
+ error => "had stderr output"
+ );
+
+ for my $type ("match", "mismatch", "new", "timedout", "crash", "error") {
+ my $typeCount = $counts{$type};
+ next unless $typeCount;
+ my $typeText = $text{$type};
+ my $message;
+ if ($typeCount == 1) {
+ $typeText =~ s/were/was/;
+ $message = sprintf "1 test case (%d%%) %s\n", 1 * 100 / $count, $typeText;
+ } else {
+ $message = sprintf "%d test cases (%d%%) %s\n", $typeCount, $typeCount * 100 / $count, $typeText;
+ }
+ $message =~ s-\(0%\)-(<1%)-;
+ print $message;
+ }
+}
+
+sub stopRunningTestsEarlyIfNeeded()
+{
+ # --reset-results does not check pass vs. fail, so exitAfterNFailures makes no sense with --reset-results.
+ return 0 if $resetResults;
+
+ my $passCount = $counts{match} || 0; # $counts{match} will be undefined if we've not yet passed a test (e.g. the first test fails).
+ my $newCount = $counts{new} || 0;
+ my $failureCount = $count - $passCount - $newCount; # "Failure" here includes timeouts, crashes, etc.
+ if ($exitAfterNFailures && $failureCount >= $exitAfterNFailures) {
+ print "\nExiting early after $failureCount failures. $count tests run.";
+ closeDumpTool();
+ return 1;
+ }
+
+ my $crashCount = $counts{crash} || 0;
+ my $timeoutCount = $counts{timedout} || 0;
+ if ($exitAfterNCrashesOrTimeouts && $crashCount + $timeoutCount >= $exitAfterNCrashesOrTimeouts) {
+ print "\nExiting early after $crashCount crashes and $timeoutCount timeouts. $count tests run.";
+ closeDumpTool();
+ return 1;
+ }
+
+ return 0;
+}
+
+sub setUpWindowsCrashLogSaving()
+{
+ return unless isCygwin();
+
+ unless (defined $ENV{_NT_SYMBOL_PATH}) {
+ print "The _NT_SYMBOL_PATH environment variable is not set. Crash logs will not be saved.\nSee <http://trac.webkit.org/wiki/BuildingOnWindows#GettingCrashLogs>.\n";
+ return;
+ }
+
+ my $ntsdPath = File::Spec->catfile(toCygwinPath($ENV{PROGRAMFILES}), "Debugging Tools for Windows (x86)", "ntsd.exe");
+ unless (-f $ntsdPath) {
+ $ntsdPath = File::Spec->catfile(toCygwinPath($ENV{SYSTEMROOT}), "system32", "ntsd.exe");
+ unless (-f $ntsdPath) {
+ print STDERR "Can't find ntsd.exe. Crash logs will not be saved.\nSee <http://trac.webkit.org/wiki/BuildingOnWindows#GettingCrashLogs>.\n";
+ return;
+ }
+ }
+
+ my %values = (
+ Debugger => '"' . toWindowsPath($ntsdPath) . '" -p %ld -e %ld -g -lines -c ".logopen /t \"' . toWindowsPath($testResultsDirectory) . '\CrashLog.txt\";!analyze -vv;~*kpn;q"',
+ Auto => 1
+ );
+
+ foreach my $value (keys %values) {
+ chomp($previousWindowsPostMortemDebuggerValues{$value} = `regtool get "$windowsPostMortemDebuggerKey/$value"`);
+ my $result = system "regtool", "set", "-s", "$windowsPostMortemDebuggerKey/$value", $values{$value};
+ next unless $result;
+
+ print "Failed to set \"$windowsPostMortemDebuggerKey/$value\". Crash logs will not be saved.\nSee <http://trac.webkit.org/wiki/BuildingOnWindows#GettingCrashLogs>.\n";
+ return;
+ }
+
+ print "Crash logs will be saved to $testResultsDirectory.\n";
+}
+
+END {
+ return unless isCygwin();
+
+ foreach my $value (keys %previousWindowsPostMortemDebuggerValues) {
+ my $result = system "regtool", "set", "-s", "$windowsPostMortemDebuggerKey/$value", $previousWindowsPostMortemDebuggerValues{$value};
+ !$result or print "Failed to restore \"$windowsPostMortemDebuggerKey/$value\" to its previous value \"$previousWindowsPostMortemDebuggerValues{$value}\"\n.";
+ }
+}
diff --git a/WebKitTools/Scripts/prepare-ChangeLog b/WebKitTools/Scripts/prepare-ChangeLog
index 3350aa3..ad84e4f 100755
--- a/WebKitTools/Scripts/prepare-ChangeLog
+++ b/WebKitTools/Scripts/prepare-ChangeLog
@@ -89,6 +89,7 @@ sub get_function_line_ranges($$);
sub get_function_line_ranges_for_c($$);
sub get_function_line_ranges_for_java($$);
sub get_function_line_ranges_for_javascript($$);
+sub get_selector_line_ranges_for_css($$);
sub method_decl_to_selector($);
sub processPaths(\@);
sub reviewerAndDescriptionForGitCommit($);
@@ -101,6 +102,7 @@ my $changeLogTimeZone = "PST8PDT";
my $bugNumber;
my $name;
my $emailAddress;
+my $mergeBase = 0;
my $gitCommit = 0;
my $gitIndex = "";
my $gitReviewer = "";
@@ -114,6 +116,7 @@ my $parseOptionsResult =
"bug:i" => \$bugNumber,
"name:s" => \$name,
"email:s" => \$emailAddress,
+ "merge-base:s" => \$mergeBase,
"git-commit:s" => \$gitCommit,
"git-index" => \$gitIndex,
"git-reviewer:s" => \$gitReviewer,
@@ -125,6 +128,7 @@ if (!$parseOptionsResult || $showHelp) {
print STDERR basename($0) . " [--bug] [-d|--diff] [-h|--help] [-o|--open] [--git-commit=<committish>] [--git-reviewer=<name>] [svndir1 [svndir2 ...]]\n";
print STDERR " --bug Fill in the ChangeLog bug information from the given bug.\n";
print STDERR " -d|--diff Spew diff to stdout when running\n";
+ print STDERR " --merge-base Populate the ChangeLogs with the diff to this branch\n";
print STDERR " --git-commit Populate the ChangeLogs from the specified git commit\n";
print STDERR " --git-index Populate the ChangeLogs from the git index only\n";
print STDERR " --git-reviewer When populating the ChangeLogs from a git commit claim that the spcified name reviewed the change.\n";
@@ -256,10 +260,20 @@ if ($bugNumber) {
$bugURL = "https://bugs.webkit.org/show_bug.cgi?id=$bugNumber";
my $bugXMLURL = "$bugURL&ctype=xml";
# Perl has no built in XML processing, so we'll fetch and parse with curl and grep
- my $descriptionLine = `curl --silent "$bugXMLURL" | grep short_desc`;
+ # Pass --insecure because some cygwin installs have no certs we don't
+ # care about validating that bugs.webkit.org is who it says it is here.
+ my $descriptionLine = `curl --insecure --silent "$bugXMLURL" | grep short_desc`;
if ($descriptionLine !~ /<short_desc>(.*)<\/short_desc>/) {
- print STDERR " Bug $bugNumber has no bug description. Maybe you set wrong bug ID?\n";
- print STDERR " The bug URL: $bugXMLURL\n";
+ # Maybe the reason the above did not work is because the curl that is installed doesn't
+ # support ssl at all.
+ if (`curl --version | grep ^Protocols` !~ /\bhttps\b/) {
+ print STDERR " Could not get description for bug $bugNumber.\n";
+ print STDERR " It looks like your version of curl does not support ssl.\n";
+ print STDERR " If you are using macports, this can be fixed with sudo port install curl +ssl.\n";
+ } else {
+ print STDERR " Bug $bugNumber has no bug description. Maybe you set wrong bug ID?\n";
+ print STDERR " The bug URL: $bugXMLURL\n";
+ }
exit 1;
}
$bugDescription = decodeEntities($1);
@@ -419,11 +433,16 @@ if ($spewDiff && @changed_files) {
# Open ChangeLogs.
if ($openChangeLogs && @logs) {
print STDERR " Opening the edited ChangeLog files.\n";
- my $editor = $ENV{"CHANGE_LOG_EDIT_APPLICATION"};
+ my $editor = $ENV{CHANGE_LOG_EDITOR};
if ($editor) {
- system "open", "-a", $editor, @logs;
+ system ((split ' ', $editor), @logs);
} else {
- system "open", "-e", @logs;
+ $editor = $ENV{CHANGE_LOG_EDIT_APPLICATION};
+ if ($editor) {
+ system "open", "-a", $editor, @logs;
+ } else {
+ system "open", "-e", @logs;
+ }
}
}
@@ -474,6 +493,8 @@ sub get_function_line_ranges($$)
return get_function_line_ranges_for_java ($file_handle, $file_name);
} elsif ($file_name =~ /\.js$/) {
return get_function_line_ranges_for_javascript ($file_handle, $file_name);
+ } elsif ($file_name =~ /\.css$/) {
+ return get_selector_line_ranges_for_css ($file_handle, $file_name);
}
return ();
}
@@ -694,7 +715,7 @@ sub get_function_line_ranges_for_c($$)
if (!$in_braces and $potential_start) {
$start = $potential_start;
$name = $potential_name;
- if (@namespaces && (length($name) < 2 || substr($name,1,1) ne "[")) {
+ if (@namespaces && $name && (length($name) < 2 || substr($name,1,1) ne "[")) {
$name = join ('::', @namespaces, $name);
}
}
@@ -1173,6 +1194,41 @@ sub get_function_line_ranges_for_javascript($$)
return @ranges;
}
+# Read a file and get all the line ranges of the things that look like CSS selectors. A selector is
+# anything before an opening brace on a line. A selector starts at the line containing the opening
+# brace and ends at the closing brace.
+# FIXME: Comments are parsed just like uncommented text.
+#
+# Result is a list of triples: [ start_line, end_line, selector ].
+
+sub get_selector_line_ranges_for_css($$)
+{
+ my ($fileHandle, $fileName) = @_;
+
+ my @ranges;
+
+ my $currentSelector = "";
+ my $start = 0;
+
+ while (<$fileHandle>) {
+ if (/^[ \t]*(.*[^ \t])[ \t]*{/) {
+ $currentSelector = $1;
+ $start = $.;
+ }
+ if (index($_, "}") >= 0) {
+ unless ($start) {
+ warn "mismatched braces in $fileName\n";
+ next;
+ }
+ push(@ranges, [$start, $., $currentSelector]);
+ $currentSelector = "";
+ $start = 0;
+ next;
+ }
+ }
+
+ return @ranges;
+}
sub processPaths(\@)
{
@@ -1216,6 +1272,7 @@ sub diffFromToString()
return $gitCommit if $gitCommit =~ m/.+\.\..+/;
return "\"$gitCommit^\" \"$gitCommit\"" if $gitCommit;
return "--cached" if $gitIndex;
+ return $mergeBase if $mergeBase;
return "HEAD" if $isGit;
}
@@ -1230,7 +1287,7 @@ sub diffCommand(@)
$command = "$SVN diff --diff-cmd diff -x -N $pathsString";
} elsif ($isGit) {
$command = "$GIT diff --no-ext-diff -U0 " . diffFromToString();
- $command .= " -- $pathsString" unless $gitCommit;
+ $command .= " -- $pathsString" unless $gitCommit or $mergeBase;
}
return $command;
@@ -1245,7 +1302,7 @@ sub statusCommand(@)
if ($isSVN) {
$command = "$SVN stat $filesString";
} elsif ($isGit) {
- $command = "$GIT diff -r --name-status -C -C -M " . diffFromToString();
+ $command = "$GIT diff -r --name-status -M -C " . diffFromToString();
$command .= " -- $filesString" unless $gitCommit;
}
@@ -1260,7 +1317,7 @@ sub createPatchCommand($)
if ($isSVN) {
$command = "'$FindBin::Bin/svn-create-patch' $changedFilesString";
} elsif ($isGit) {
- $command = "$GIT diff -C -C -M " . diffFromToString();
+ $command = "$GIT diff -M -C " . diffFromToString();
$command .= " -- $changedFilesString" unless $gitCommit;
}
diff --git a/WebKitTools/Scripts/print-vse-failure-logs b/WebKitTools/Scripts/print-vse-failure-logs
new file mode 100755
index 0000000..7580465
--- /dev/null
+++ b/WebKitTools/Scripts/print-vse-failure-logs
@@ -0,0 +1,113 @@
+#!/usr/bin/env python
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# This is a very simple script designed to crawl the build directory
+# for visual studio express build logs and print them to stdout.
+
+from __future__ import with_statement
+
+import codecs
+import os
+import re
+
+from webkitpy.common.checkout import scm
+from webkitpy.common.system.executive import Executive
+from webkitpy.thirdparty import BeautifulSoup
+
+
+class PrintVisualStudioExpressLogs(object):
+ def __init__(self):
+ self._executive = Executive()
+
+ def _find_buildlogs(self, build_directory):
+ build_log_paths = []
+ for dirpath, dirnames, filenames in os.walk(build_directory):
+ for file_name in filenames:
+ if file_name == "BuildLog.htm":
+ file_path = os.path.join(dirpath, file_name)
+ build_log_paths.append(file_path)
+ return build_log_paths
+
+ def _build_order(self):
+ """Returns a list of project names in the order in which they are built."""
+ script_path = os.path.join(self._scripts_directory(), "print-msvc-project-dependencies")
+ sln_path = os.path.join(scm.find_checkout_root(), "WebKit", "win", "WebKit.vcproj", "WebKit.sln")
+ lines = self._executive.run_command([script_path, sln_path]).splitlines()
+ order = [line.strip() for line in lines if line.find("Folder") == -1]
+ order.reverse()
+ return order
+
+ def _sort_buildlogs(self, log_paths):
+ build_order = self._build_order()
+ def sort_key(log_path):
+ project_name = os.path.basename(os.path.dirname(os.path.dirname(log_path)))
+ try:
+ index = build_order.index(project_name)
+ except ValueError:
+ # If the project isn't in the list, sort it after all items that
+ # are in the list.
+ index = len(build_order)
+ # Sort first by build order, then by project name
+ return (index, project_name)
+ return sorted(log_paths, key=sort_key)
+
+ def _obj_directory(self):
+ build_directory_script_path = os.path.join(self._scripts_directory(), "webkit-build-directory")
+ # FIXME: ports/webkit.py should provide the build directory in a nice API.
+ # NOTE: The windows VSE build does not seem to use different directories
+ # for Debug and Release.
+ build_directory = self._executive.run_command([build_directory_script_path, "--top-level"]).rstrip()
+ return os.path.join(build_directory, "obj")
+
+ def _scripts_directory(self):
+ return os.path.dirname(__file__)
+
+ def _relevant_text(self, log):
+ soup = BeautifulSoup.BeautifulSoup(log)
+ # The Output Window table is where the useful output starts in the build log.
+ output_window_table = soup.find(text=re.compile("Output Window")).findParent("table")
+ result = []
+ for table in [output_window_table] + output_window_table.findNextSiblings("table"):
+ result.extend([text.replace("&nbsp;", "") for text in table.findAll(text=True)])
+ result.append("\n")
+ return "".join(result)
+
+ def main(self):
+ build_log_paths = self._sort_buildlogs(self._find_buildlogs(self._obj_directory()))
+
+ print "Found %s Visual Studio Express Build Logs:\n%s" % (len(build_log_paths), "\n".join(build_log_paths))
+
+ for build_log_path in build_log_paths:
+ print "%s:\n" % build_log_path
+ with codecs.open(build_log_path, "r", "utf-16") as build_log:
+ print self._relevant_text(build_log)
+
+
+if __name__ == '__main__':
+ PrintVisualStudioExpressLogs().main()
diff --git a/WebKitTools/Scripts/rebaseline-chromium-webkit-tests b/WebKitTools/Scripts/rebaseline-chromium-webkit-tests
index aea0edc..8d14b86 100755
--- a/WebKitTools/Scripts/rebaseline-chromium-webkit-tests
+++ b/WebKitTools/Scripts/rebaseline-chromium-webkit-tests
@@ -31,8 +31,12 @@
import os
import sys
-sys.path.append(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),
- "webkitpy", "layout_tests"))
+scripts_directory = os.path.dirname(os.path.abspath(sys.argv[0]))
+webkitpy_directory = os.path.join(scripts_directory, "webkitpy")
+sys.path.append(os.path.join(webkitpy_directory, "layout_tests"))
+
+# For simplejson
+sys.path.append(os.path.join(webkitpy_directory, "thirdparty"))
import rebaseline_chromium_webkit_tests
diff --git a/WebKitTools/Scripts/resolve-ChangeLogs b/WebKitTools/Scripts/resolve-ChangeLogs
index 1a2d2af..6635711 100755
--- a/WebKitTools/Scripts/resolve-ChangeLogs
+++ b/WebKitTools/Scripts/resolve-ChangeLogs
@@ -34,6 +34,7 @@ use FindBin;
use lib $FindBin::Bin;
use File::Basename;
+use File::Copy;
use File::Path;
use File::Spec;
use Getopt::Long;
@@ -48,7 +49,6 @@ sub fixMergedChangeLogs($;@);
sub fixOneMergedChangeLog($);
sub hasGitUnmergedFiles();
sub isInGitFilterBranch();
-sub mergeChanges($$$);
sub parseFixMerged($$;$);
sub removeChangeLogArguments($);
sub resolveChangeLog($);
@@ -64,28 +64,30 @@ my $GIT = "git";
my $fixMerged;
my $gitRebaseContinue = 0;
+my $mergeDriver = 0;
my $printWarnings = 1;
my $showHelp;
my $getOptionsResult = GetOptions(
- 'c|continue!' => \$gitRebaseContinue,
- 'f|fix-merged:s' => \&parseFixMerged,
- 'h|help' => \$showHelp,
- 'w|warnings!' => \$printWarnings,
+ 'c|continue!' => \$gitRebaseContinue,
+ 'f|fix-merged:s' => \&parseFixMerged,
+ 'm|merge-driver!' => \$mergeDriver,
+ 'h|help' => \$showHelp,
+ 'w|warnings!' => \$printWarnings,
);
my $relativePath = isInGitFilterBranch() ? '.' : chdirReturningRelativePath(determineVCSRoot());
my @changeLogFiles = removeChangeLogArguments($relativePath);
-if (!defined $fixMerged && scalar(@changeLogFiles) == 0) {
+if (!defined $fixMerged && !$mergeDriver && scalar(@changeLogFiles) == 0) {
@changeLogFiles = findUnmergedChangeLogs();
}
-if (scalar(@ARGV) > 0) {
+if (!$mergeDriver && scalar(@ARGV) > 0) {
print STDERR "ERROR: Files listed on command-line that are not ChangeLogs.\n";
undef $getOptionsResult;
-} elsif (!defined $fixMerged && scalar(@changeLogFiles) == 0) {
+} elsif (!defined $fixMerged && !$mergeDriver && scalar(@changeLogFiles) == 0) {
print STDERR "ERROR: No ChangeLog files listed on command-line or found unmerged.\n";
undef $getOptionsResult;
} elsif ($gitRebaseContinue && !$isGit) {
@@ -94,6 +96,12 @@ if (scalar(@ARGV) > 0) {
} elsif (defined $fixMerged && !$isGit) {
print STDERR "ERROR: --fix-merged may only be used with a git repository\n";
undef $getOptionsResult;
+} elsif ($mergeDriver && !$isGit) {
+ print STDERR "ERROR: --merge-driver may only be used with a git repository\n";
+ undef $getOptionsResult;
+} elsif ($mergeDriver && scalar(@ARGV) < 3) {
+ print STDERR "ERROR: --merge-driver expects %O %A %B as arguments\n";
+ undef $getOptionsResult;
}
sub usageAndExit()
@@ -104,6 +112,7 @@ Usage: @{[ basename($0) ]} [options] [path/to/ChangeLog] [path/to/another/Change
entries (default: --no-continue)
-f|--fix-merged [revision-range] fix git-merged ChangeLog entries; if a revision-range
is specified, run git filter-branch on the range
+ -m|--merge-driver %O %A %B act as a git merge-driver on files %O %A %B
-h|--help show this help message
-w|--[no-]warnings show or suppress warnings (default: show warnings)
__END__
@@ -118,6 +127,14 @@ if (defined $fixMerged && length($fixMerged) > 0) {
my $commitRange = $fixMerged;
$commitRange = $commitRange . "..HEAD" if index($commitRange, "..") < 0;
fixMergedChangeLogs($commitRange, @changeLogFiles);
+} elsif ($mergeDriver) {
+ my ($base, $theirs, $ours) = @ARGV;
+ if (mergeChangeLogs($ours, $base, $theirs)) {
+ unlink($ours);
+ copy($theirs, $ours) or die $!;
+ } else {
+ exec qw(git merge-file -L THEIRS -L BASE -L OURS), $theirs, $base, $ours;
+ }
} elsif (@changeLogFiles) {
for my $file (@changeLogFiles) {
if (defined $fixMerged) {
@@ -383,55 +400,6 @@ sub isInGitFilterBranch()
return exists $ENV{MAPPED_PREVIOUS_COMMIT} && $ENV{MAPPED_PREVIOUS_COMMIT};
}
-sub mergeChanges($$$)
-{
- my ($fileMine, $fileOlder, $fileNewer) = @_;
-
- my $traditionalReject = $fileMine =~ /\.rej$/ ? 1 : 0;
-
- local $/ = undef;
-
- my $patch;
- if ($traditionalReject) {
- open(DIFF, "<", $fileMine) or die $!;
- $patch = <DIFF>;
- close(DIFF);
- rename($fileMine, "$fileMine.save");
- rename($fileOlder, "$fileOlder.save");
- } else {
- open(DIFF, "-|", qw(diff -u -a --binary), $fileOlder, $fileMine) or die $!;
- $patch = <DIFF>;
- close(DIFF);
- }
-
- unlink("${fileNewer}.orig");
- unlink("${fileNewer}.rej");
-
- open(PATCH, "| patch --fuzz=3 --binary $fileNewer > " . File::Spec->devnull()) or die $!;
- print PATCH fixChangeLogPatch($patch);
- close(PATCH);
-
- my $result;
-
- # Refuse to merge the patch if it did not apply cleanly
- if (-e "${fileNewer}.rej") {
- unlink("${fileNewer}.rej");
- unlink($fileNewer);
- rename("${fileNewer}.orig", $fileNewer);
- $result = 0;
- } else {
- unlink("${fileNewer}.orig");
- $result = 1;
- }
-
- if ($traditionalReject) {
- rename("$fileMine.save", $fileMine);
- rename("$fileOlder.save", $fileOlder);
- }
-
- return $result;
-}
-
sub parseFixMerged($$;$)
{
my ($switchName, $key, $value) = @_;
@@ -473,7 +441,7 @@ sub resolveChangeLog($)
return unless $fileMine && $fileOlder && $fileNewer;
- if (mergeChanges($fileMine, $fileOlder, $fileNewer)) {
+ if (mergeChangeLogs($fileMine, $fileOlder, $fileNewer)) {
if ($file ne $fileNewer) {
unlink($file);
rename($fileNewer, $file) or die $!;
diff --git a/WebKitTools/Scripts/run-api-tests b/WebKitTools/Scripts/run-api-tests
new file mode 100755
index 0000000..3d08013
--- /dev/null
+++ b/WebKitTools/Scripts/run-api-tests
@@ -0,0 +1,246 @@
+#!/usr/bin/perl -w
+
+# 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.
+
+# Features to add:
+# - Command line option to run a single test.
+# - Command line option to run all tests in a suite.
+
+use strict;
+use warnings;
+
+use File::Basename;
+use FindBin;
+use Getopt::Long qw(:config pass_through);
+use IPC::Open3;
+use lib $FindBin::Bin;
+use webkitdirs;
+use Term::ANSIColor qw(:constants);
+
+sub dumpAllTests();
+sub runAllTests();
+sub runAllTestsInSuite($);
+sub runTest($$);
+sub populateTests();
+sub buildTestTool();
+
+my $showHelp = 0;
+my $quiet = 0;
+my $dump = 0;
+
+my $programName = basename($0);
+my $usage = <<EOF;
+Usage: $programName [options]
+ --help Show this help message
+ -q|--quite Less verbose output
+ -d|--dump-tests Dump the names of testcases without running them
+EOF
+
+GetOptions(
+ 'help' => \$showHelp,
+ 'quiet|q' => \$quiet,
+ 'dump|d' => \$dump,
+);
+
+if ($showHelp) {
+ print STDERR $usage;
+ exit 1;
+}
+
+setConfiguration();
+buildTestTool();
+setPathForRunningWebKitApp(\%ENV);
+my %testsToRun = populateTests();
+
+if ($dump) {
+ dumpAllTests();
+ exit 0;
+}
+
+runAllTests();
+
+sub dumpAllTests()
+{
+ print "Dumping test cases\n";
+ print "------------------\n";
+ for my $suite (keys %testsToRun) {
+ print $suite . ":\n";
+ print map { " " . $_ . "\n" } @{ $testsToRun{$suite} };
+ }
+ print "------------------\n";
+}
+
+sub runAllTests()
+{
+ my $anyFailures = 0;
+ for my $suite (keys %testsToRun) {
+ my $failed = runAllTestsInSuite($suite);
+ if ($failed) {
+ $anyFailures = 1;
+ }
+ }
+ return $anyFailures;
+}
+
+sub runAllTestsInSuite($)
+{
+ my ($suite) = @_;
+ print "Suite: $suite\n";
+
+ my $anyFailures = 0;
+ for my $test (@{$testsToRun{$suite}}) {
+ my $failed = runTest($suite, $test);
+ if ($failed) {
+ $anyFailures = 1;
+ }
+ }
+
+ return $anyFailures;
+}
+
+sub runTest($$)
+{
+ my ($suite, $testName) = @_;
+ my $test = $suite . "/" . $testName;
+
+ print " Test: $testName -> ";
+
+ my $result = 0;
+ if (isAppleMacWebKit()) {
+ my $productDir = productDir();
+ $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+ $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
+ my $apiTesterPath = "$productDir/TestWebKitAPI";
+ if (architecture()) {
+ $result = system "arch", "-" . architecture(), $apiTesterPath, $test, @ARGV;
+ } else {
+ $result = system $apiTesterPath, $test, @ARGV;
+ }
+ } elsif (isAppleWinWebKit()) {
+ my $apiTesterNameSuffix;
+ if (configurationForVisualStudio() =~ /^Release|Debug_Internal$/) {
+ $apiTesterNameSuffix = "";
+ } else {
+ $apiTesterNameSuffix = "_debug";
+ }
+ my $apiTesterPath = File::Spec->catfile(productDir(), "TestWebKitAPI$apiTesterNameSuffix.exe");
+ $result = system $apiTesterPath, $test, @ARGV;
+ } else {
+ die "run-api-tests is not supported on this platform.\n"
+ }
+
+ if ($result == 0) {
+ print BOLD GREEN, "Passed", RESET, "\n";
+ } else {
+ print BOLD RED, "Failed", RESET, "\n";
+ }
+}
+
+
+sub populateTests()
+{
+ my @tests;
+
+ if (isAppleMacWebKit()) {
+ my $productDir = productDir();
+ $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+ $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
+ my $apiTesterPath = "$productDir/TestWebKitAPI";
+
+ my ($pid, $childIn, $childOut);
+ if (architecture()) {
+ $pid = open3($childIn, $childOut, ">&STDERR", "arch", "-" . architecture(), $apiTesterPath, "--dump-tests") or die "Failed to build list of tests!";
+ } else {
+ $pid = open3($childIn, $childOut, ">&STDERR", $apiTesterPath, "--dump-tests") or die "Failed to build list of tests!";
+ }
+ close($childIn);
+ @tests = <$childOut>;
+ close($childOut);
+
+ waitpid($pid, 0);
+ my $result = $?;
+
+ if ($result) {
+ print STDERR "Failed to build list of tests!\n";
+ exit exitStatus($result);
+ }
+ } elsif (isAppleWinWebKit()) {
+ my $apiTesterNameSuffix;
+ if (configurationForVisualStudio() =~ /^Release|Debug_Internal$/) {
+ $apiTesterNameSuffix = "";
+ } else {
+ $apiTesterNameSuffix = "_debug";
+ }
+ my $apiTesterPath = File::Spec->catfile(productDir(), "TestWebKitAPI$apiTesterNameSuffix.exe");
+ open(TESTS, "-|", $apiTesterPath, "--dump-tests") or die $!;
+ @tests = <TESTS>;
+ close(TESTS) or die $!;
+ } else {
+ die "run-api-tests is not supported on this platform.\n"
+ }
+
+ my %keyedTests = ();
+ for my $test (@tests) {
+ $test =~ s/[\r\n]*$//;
+ my ($suite, $testName) = split(/\//, $test);
+ push @{$keyedTests{$suite}}, $testName;
+ }
+
+ return %keyedTests;
+}
+
+sub buildTestTool()
+{
+ chdirWebKit();
+
+ my $buildTestTool = "build-api-tests";
+ print STDERR "Running $buildTestTool\n";
+
+ local *DEVNULL;
+ my ($childIn, $childOut, $childErr);
+ if ($quiet) {
+ open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
+ $childOut = ">&DEVNULL";
+ $childErr = ">&DEVNULL";
+ } else {
+ # When not quiet, let the child use our stdout/stderr.
+ $childOut = ">&STDOUT";
+ $childErr = ">&STDERR";
+ }
+
+ my @args = argumentsForConfiguration();
+ my $buildProcess = open3($childIn, $childOut, $childErr, "WebKitTools/Scripts/$buildTestTool", @args) or die "Failed to run " . $buildTestTool;
+ close($childIn);
+ waitpid $buildProcess, 0;
+ my $buildResult = $?;
+ close($childOut);
+ close($childErr);
+
+ close DEVNULL if ($quiet);
+
+ if ($buildResult) {
+ print STDERR "Compiling TestWebKitAPI failed!\n";
+ exit exitStatus($buildResult);
+ }
+}
diff --git a/WebKitTools/Scripts/run-bindings-tests b/WebKitTools/Scripts/run-bindings-tests
new file mode 100755
index 0000000..4a093d1
--- /dev/null
+++ b/WebKitTools/Scripts/run-bindings-tests
@@ -0,0 +1,137 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 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 COMPUTER, 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 COMPUTER, 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.
+#
+
+# This script generates h and cpp file for TestObj.idl using the V8 code
+# generator. Please execute the script whenever changes are made to
+# CodeGeneratorV8.pm, and submit the changes in V8TestObj.h/cpp in the same
+# patch. This makes it easier to track and review changes in generated code.
+# To execute, invoke: 'python run_tests.py'
+
+import os
+import os.path
+import subprocess
+import sys
+import tempfile
+from webkitpy.common.checkout import scm
+
+
+def generate_from_idl(generator, idl_file, output_directory):
+ cmd = ['perl', '-w',
+ '-IWebCore/bindings/scripts',
+ 'WebCore/bindings/scripts/generate-bindings.pl',
+ # idl include directories (path relative to generate-bindings.pl)
+ '--include', '.',
+ '--defines', 'TESTING_%s' % generator,
+ '--generator', generator,
+ '--outputDir', output_directory,
+ idl_file]
+ return subprocess.call(cmd) == 0
+
+
+def detect_changes(work_directory, reference_directory):
+ changes_found = False
+ for output_file in os.listdir(work_directory):
+ print 'Detecting changes in %s...' % output_file
+ cmd = ['diff',
+ '-u',
+ os.path.join(reference_directory, output_file),
+ os.path.join(work_directory, output_file)]
+ if subprocess.call(cmd) != 0:
+ print 'Detected changes in %s (see above)' % output_file
+ changes_found = True
+ else:
+ print 'No changes found.'
+
+ return changes_found
+
+
+def run_tests(generator, input_directory, reference_directory, reset_results):
+ work_directory = reference_directory
+
+ passed = True
+ for input_file in os.listdir(input_directory):
+ (name, extension) = os.path.splitext(input_file)
+ if extension != '.idl':
+ continue
+ print 'Testing the %s generator on %s' % (generator, input_file)
+ # Generate output into the work directory (either the given one or a
+ # temp one if not reset_results is performed)
+ if not reset_results:
+ work_directory = tempfile.mkdtemp()
+ if not generate_from_idl(generator, os.path.join(input_directory,
+ input_file),
+ work_directory):
+ passed = False
+ if reset_results:
+ print "Overwrote reference files"
+ continue
+ # Detect changes
+ if detect_changes(work_directory, reference_directory):
+ passed = False
+
+ if not passed:
+ print '%s generator failed.' % generator
+ return passed
+
+
+def main(argv):
+ """Runs WebCore bindings code generators on test IDL files and compares
+ the results with reference files.
+
+ Options:
+ --reset-results: Overwrites the reference files with the generated results.
+
+ """
+ reset_results = "--reset-results" in argv
+
+ current_scm = scm.detect_scm_system(os.curdir)
+ os.chdir(current_scm.checkout_root)
+
+ all_tests_passed = True
+
+ generators = [
+ 'JS',
+ 'V8',
+ 'ObjC',
+ 'GObject',
+ 'CPP'
+ ]
+
+ for generator in generators:
+ input_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test')
+ reference_directory = os.path.join('WebCore', 'bindings', 'scripts', 'test', generator)
+ if not run_tests(generator, input_directory, reference_directory, reset_results):
+ all_tests_passed = False
+
+ if all_tests_passed:
+ print 'All tests passed!'
+ return 0
+ else:
+ print '(To update the reference files, execute "run-bindings-tests --reset-results")'
+ return -1
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
diff --git a/WebKitTools/Scripts/run-chromium-webkit-unit-tests b/WebKitTools/Scripts/run-chromium-webkit-unit-tests
new file mode 100755
index 0000000..62646af
--- /dev/null
+++ b/WebKitTools/Scripts/run-chromium-webkit-unit-tests
@@ -0,0 +1,51 @@
+#!/usr/bin/perl -w
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+use strict;
+use File::Spec;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+# Allow running this script from any directory.
+my $sourceRootDir = File::Spec->catfile($FindBin::Bin, "../..");
+chdir($sourceRootDir);
+
+setConfiguration();
+
+my $pathToBinary;
+if (isDarwin()) {
+ $pathToBinary = "WebKit/chromium/xcodebuild/" . configuration() . "/webkit_unit_tests";
+} elsif (isCygwin() || isWindows()) {
+ $pathToBinary = "WebKit/chromium/" . configuration() . "/webkit_unit_tests.exe";
+} elsif (isLinux()) {
+ $pathToBinary = "out/" . configuration() . "/webkit_unit_tests";
+}
+
+exit system ($pathToBinary, @ARGV);
diff --git a/WebKitTools/Scripts/run-gtk-tests b/WebKitTools/Scripts/run-gtk-tests
new file mode 100644
index 0000000..9a57319
--- /dev/null
+++ b/WebKitTools/Scripts/run-gtk-tests
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2009 Gustavo Noronha Silva <gns@gnome.org>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this library; see the file COPYING.LIB. If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+# This initializes the correct configuration (Release/Debug)
+setConfiguration();
+
+my $productDir = productDir();
+my @unitTests = glob $productDir . "/Programs/unittests/*";
+if ($#unitTests < 1) {
+ die "ERROR: tests not found in $productDir.\n";
+}
+system "gtester -k @unitTests"
diff --git a/WebKitTools/Scripts/run-launcher b/WebKitTools/Scripts/run-launcher
index e12a64a..414d4af 100755
--- a/WebKitTools/Scripts/run-launcher
+++ b/WebKitTools/Scripts/run-launcher
@@ -47,7 +47,7 @@ checkFrameworks();
# Set paths according to the build system used
if (isQt()) {
my $libDir = catdir(productDir(), 'lib');
- $launcherPath = catdir($launcherPath, "bin", "QtLauncher");
+ $launcherPath = catdir($launcherPath, "bin", "QtTestBrowser");
$ENV{QTWEBKIT_PLUGIN_PATH} = catdir($libDir, 'plugins');
@@ -64,6 +64,10 @@ if (isQt()) {
$launcherPath = catdir($launcherPath, "Programs", "GtkLauncher");
}
+ if (isEfl()) {
+ $launcherPath = catdir($launcherPath, "Programs", "EWebLauncher");
+ }
+
if (isWx()) {
if (isDarwin()) {
$launcherPath = catdir($launcherPath, 'wxBrowser.app', 'Contents', 'MacOS', 'wxBrowser');
diff --git a/WebKitTools/Scripts/run-minibrowser b/WebKitTools/Scripts/run-minibrowser
new file mode 100755
index 0000000..c2fd412
--- /dev/null
+++ b/WebKitTools/Scripts/run-minibrowser
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+# Copyright (C) 2005, 2007 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.
+# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
+
+# Simplified "run" script for launching the WebKit2 MiniBrowser.
+
+use strict;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+setConfiguration();
+
+exit exitStatus(runMiniBrowser());
diff --git a/WebKitTools/Scripts/run-qtwebkit-tests b/WebKitTools/Scripts/run-qtwebkit-tests
new file mode 100644
index 0000000..373de0a
--- /dev/null
+++ b/WebKitTools/Scripts/run-qtwebkit-tests
@@ -0,0 +1,358 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+#Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+#This library is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Library General Public
+#License as published by the Free Software Foundation; either
+#version 2 of the License, or (at your option) any later version.
+
+#This library is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+#Library General Public License for more details.
+
+#You should have received a copy of the GNU Library General Public License
+#along with this library; see the file COPYING.LIB. If not, write to
+#the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+#Boston, MA 02110-1301, USA.
+
+from __future__ import with_statement
+
+import sys
+import os
+import os.path
+import re
+import logging
+from subprocess import Popen, PIPE, STDOUT
+from optparse import OptionParser
+
+
+class Log(object):
+ def __init__(self, name):
+ self._log = logging.getLogger(name)
+ self.debug = self._log.debug
+ self.warn = self._log.warn
+ self.error = self._log.error
+ self.exception = self._log.exception
+ self.info = self._log.info
+
+
+class Options(Log):
+ """ Option manager. It parses and checks script's parameters, sets an internal variable. """
+
+ def __init__(self, args):
+ Log.__init__(self, "Options")
+ log = self._log
+ opt = OptionParser("%prog [options] PathToSearch.\nTry -h or --help.")
+ opt.add_option("-j", "--parallel-level", action="store", type="int",
+ dest="parallel_level", default=None,
+ help="Number of parallel processes executing the Qt's tests. Default: cpu count.")
+ opt.add_option("-v", "--verbose", action="store", type="int",
+ dest="verbose", default=2,
+ help="Verbose level (0 - quiet, 1 - errors only, 2 - infos and warnings, 3 - debug information). Default: %default.")
+ opt.add_option("", "--tests-options", action="store", type="string",
+ dest="tests_options", default="",
+ help="Parameters passed to Qt's tests (for example '-eventdelay 123').")
+ opt.add_option("-o", "--output-file", action="store", type="string",
+ dest="output_file", default="/tmp/qtwebkittests.html",
+ help="File where results will be stored. The file will be overwritten. Default: %default.")
+ opt.add_option("-b", "--browser", action="store", dest="browser",
+ default="xdg-open",
+ help="Browser in which results will be opened. Default %default.")
+ opt.add_option("", "--do-not-open-results", action="store_false",
+ dest="open_results", default=True,
+ help="The results shouldn't pop-up in a browser automatically")
+ opt.add_option("-d", "--developer-mode", action="store_true",
+ dest="developer", default=False,
+ help="Special mode for debugging. In general it simulates human behavior, running all autotests. In the mode everything is executed synchronously, no html output will be generated, no changes or transformation will be applied to stderr or stdout. In this mode options; parallel-level, output-file, browser and do-not-open-results will be ignored.")
+
+ self._o, self._a = opt.parse_args(args)
+ verbose = self._o.verbose
+ if verbose == 0:
+ logging.basicConfig(level=logging.CRITICAL,)
+ elif verbose == 1:
+ logging.basicConfig(level=logging.ERROR,)
+ elif verbose == 2:
+ logging.basicConfig(level=logging.INFO,)
+ elif verbose == 3:
+ logging.basicConfig(level=logging.DEBUG,)
+ else:
+ logging.basicConfig(level=logging.INFO,)
+ log.warn("Bad verbose level, switching to default.")
+ try:
+ if not os.path.exists(self._a[0]):
+ raise Exception("Given path doesn't exist.")
+ if len(self._a) > 1:
+ raise IndexError("Only one directory could be provided.")
+ self._o.path = self._a[0]
+ except IndexError:
+ log.error("Bad usage. Please try -h or --help.")
+ sys.exit(1)
+ except Exception:
+ log.error("Path '%s' doesn't exist", self._a[0])
+ sys.exit(2)
+ if self._o.developer:
+ if not self._o.parallel_level is None:
+ log.warn("Developer mode sets parallel-level option to one.")
+ self._o.parallel_level = 1
+ self._o.open_results = False
+
+ def __getattr__(self, attr):
+ """ Maps all options properties into this object (remove one level of indirection). """
+ return getattr(self._o, attr)
+
+
+def run_test(args):
+ """ Runs one given test.
+ args should contain a tuple with 3 elements;
+ TestSuiteResult containing full file name of an autotest executable.
+ str with options that should be passed to the autotest executable
+ bool if true then the stdout will be buffered and separated from the stderr, if it is false
+ then the stdout and the stderr will be merged together and left unbuffered (the TestSuiteResult output will be None).
+ """
+ log = logging.getLogger("Exec")
+ test_suite, options, buffered = args
+ try:
+ log.info("Running... %s", test_suite.test_file_name())
+ if buffered:
+ tst = Popen(test_suite.test_file_name() + options, stdout=PIPE, stderr=None, shell=True)
+ else:
+ tst = Popen(test_suite.test_file_name() + options, stdout=None, stderr=STDOUT, shell=True)
+ except OSError, e:
+ log.exception("Can't open an autotest file: '%s'. Skipping the test...", e.filename)
+ else:
+ test_suite.set_output(tst.communicate()[0]) # takes stdout only, in developer mode it would be None.
+ log.info("Finished %s", test_suite.test_file_name())
+ return test_suite
+
+
+class TestSuiteResult(object):
+ """ Keeps information about a test. """
+
+ def __init__(self):
+ self._output = None
+ self._test_file_name = None
+
+ def set_output(self, xml):
+ if xml:
+ self._output = xml.strip()
+
+ def output(self):
+ return self._output
+
+ def set_test_file_name(self, file_name):
+ self._test_file_name = file_name
+
+ def test_file_name(self):
+ return self._test_file_name
+
+
+class Main(Log):
+ """ The main script. All real work is done in run() method. """
+
+ def __init__(self, options):
+ Log.__init__(self, "Main")
+ self._options = options
+ if options.parallel_level > 1 or options.parallel_level is None:
+ try:
+ from multiprocessing import Pool
+ except ImportError:
+ self.warn("Import Error: the multiprocessing module couldn't be loaded (may be lack of python-multiprocessing package?). The Qt autotests will be executed one by one.")
+ options.parallel_level = 1
+ if options.parallel_level == 1:
+
+ class Pool(object):
+ """ A hack, created to avoid problems with multiprocessing module, this class is single thread replacement for the multiprocessing.Pool class. """
+ def __init__(self, processes):
+ pass
+
+ def imap_unordered(self, func, files):
+ return map(func, files)
+
+ def map(self, func, files):
+ return map(func, files)
+
+ self._Pool = Pool
+
+ def run(self):
+ """ Find && execute && publish results of all test. "All in one" function. """
+ self.debug("Searching executables...")
+ tests_executables = self.find_tests_paths(self._options.path)
+ self.debug("Found: %s", len(tests_executables))
+ self.debug("Executing tests...")
+ results = self.run_tests(tests_executables)
+ if not self._options.developer:
+ self.debug("Transforming...")
+ transformed_results = self.transform(results)
+ self.debug("Publishing...")
+ self.announce_results(transformed_results)
+
+ def find_tests_paths(self, path):
+ """ Finds all tests executables inside the given path. """
+ executables = []
+ for root, dirs, files in os.walk(path):
+ # Check only for a file that name starts from 'tst_' and that we can execute.
+ filtered_path = filter(lambda w: w.startswith('tst_') and os.access(os.path.join(root, w), os.X_OK), files)
+ filtered_path = map(lambda w: os.path.join(root, w), filtered_path)
+ for file_name in filtered_path:
+ r = TestSuiteResult()
+ r.set_test_file_name(file_name)
+ executables.append(r)
+ return executables
+
+ def run_tests(self, files):
+ """ Executes given files by using a pool of workers. """
+ workers = self._Pool(processes=self._options.parallel_level)
+ # to each file add options.
+ self.debug("Using %s the workers pool, number of workers %i", repr(workers), self._options.parallel_level)
+ package = map(lambda w: [w, self._options.tests_options, not self._options.developer], files)
+ self.debug("Generated packages for workers: %s", repr(package))
+ results = workers.map(run_test, package) # Collects results.
+ return results
+
+ def transform(self, results):
+ """ Transforms list of the results to specialized versions. """
+ stdout = self.convert_to_stdout(results)
+ html = self.convert_to_html(results)
+ return {"stdout": stdout, "html": html}
+
+ def announce_results(self, results):
+ """ Shows the results. """
+ self.announce_results_stdout(results['stdout'])
+ self.announce_results_html(results['html'])
+
+ def announce_results_stdout(self, results):
+ """ Show the results by printing to the stdout."""
+ print(results)
+
+ def announce_results_html(self, results):
+ """ Shows the result by creating a html file and calling a web browser to render it. """
+ with file(self._options.output_file, 'w') as f:
+ f.write(results)
+ if self._options.open_results:
+ Popen(self._options.browser + " " + self._options.output_file, stdout=None, stderr=None, shell=True)
+
+ def convert_to_stdout(self, results):
+ """ Converts results, that they could be nicely presented in the stdout. """
+ # Join all results into one piece.
+ txt = "\n\n".join(map(lambda w: w.output(), results))
+ # Find total count of failed, skipped and passed tests.
+ totals = re.findall(r"([0-9]+) passed, ([0-9]+) failed, ([0-9]+) skipped", txt)
+ totals = reduce(lambda x, y: (int(x[0]) + int(y[0]), int(x[1]) + int(y[1]), int(x[2]) + int(y[2])), totals)
+ totals = map(str, totals)
+ totals = totals[0] + " passed, " + totals[1] + " failed, " + totals[2] + " skipped"
+ # Add a summary.
+ txt += '\n\n\n' + '*' * 70
+ txt += "\n**" + ("TOTALS: " + totals).center(66) + '**'
+ txt += '\n' + '*' * 70 + '\n'
+ return txt
+
+ def convert_to_html(self, results):
+ """ Converts results, that they could showed as a html page. """
+ # Join results into one piece.
+ txt = "\n\n".join(map(lambda w: w.output(), results))
+ txt = txt.replace('&', '&amp;').replace('<', "&lt;").replace('>', "&gt;")
+ # Add a color and a style.
+ txt = re.sub(r"([* ]+(Finished)[ a-z_A-Z0-9]+[*]+)",
+ lambda w: r"",
+ txt)
+ txt = re.sub(r"([*]+[ a-z_A-Z0-9]+[*]+)",
+ lambda w: "<case class='good'><br><br><b>" + w.group(0) + r"</b></case>",
+ txt)
+ txt = re.sub(r"(Config: Using QTest library)((.)+)",
+ lambda w: "\n<case class='good'><br><i>" + w.group(0) + r"</i> ",
+ txt)
+ txt = re.sub(r"\n(PASS)((.)+)",
+ lambda w: "</case>\n<case class='good'><br><status class='pass'>" + w.group(1) + r"</status>" + w.group(2),
+ txt)
+ txt = re.sub(r"\n(FAIL!)((.)+)",
+ lambda w: "</case>\n<case class='bad'><br><status class='fail'>" + w.group(1) + r"</status>" + w.group(2),
+ txt)
+ txt = re.sub(r"\n(XPASS)((.)+)",
+ lambda w: "</case>\n<case class='bad'><br><status class='xpass'>" + w.group(1) + r"</status>" + w.group(2),
+ txt)
+ txt = re.sub(r"\n(XFAIL)((.)+)",
+ lambda w: "</case>\n<case class='good'><br><status class='xfail'>" + w.group(1) + r"</status>" + w.group(2),
+ txt)
+ txt = re.sub(r"\n(SKIP)((.)+)",
+ lambda w: "</case>\n<case class='good'><br><status class='xfail'>" + w.group(1) + r"</status>" + w.group(2),
+ txt)
+ txt = re.sub(r"\n(QWARN)((.)+)",
+ lambda w: "</case>\n<case class='bad'><br><status class='warn'>" + w.group(1) + r"</status>" + w.group(2),
+ txt)
+ txt = re.sub(r"\n(RESULT)((.)+)",
+ lambda w: "</case>\n<case class='good'><br><status class='benchmark'>" + w.group(1) + r"</status>" + w.group(2),
+ txt)
+ txt = re.sub(r"\n(QFATAL)((.)+)",
+ lambda w: "</case>\n<case class='bad'><br><status class='crash'>" + w.group(1) + r"</status>" + w.group(2),
+ txt)
+ txt = re.sub(r"\n(Totals:)([0-9', a-z]*)",
+ lambda w: "</case>\n<case class='good'><br><b>" + w.group(1) + r"</b>" + w.group(2) + "</case>",
+ txt)
+ # Find total count of failed, skipped and passed tests.
+ totals = re.findall(r"([0-9]+) passed, ([0-9]+) failed, ([0-9]+) skipped", txt)
+ totals = reduce(lambda x, y: (int(x[0]) + int(y[0]), int(x[1]) + int(y[1]), int(x[2]) + int(y[2])), totals)
+ totals = map(str, totals)
+ totals = totals[0] + " passed, " + totals[1] + " failed, " + totals[2] + " skipped."
+ # Create a header of the html source.
+ txt = """
+ <html>
+ <head>
+ <script>
+ function init() {
+ // Try to find the right styleSheet (this document could be embedded in an other html doc)
+ for (i = document.styleSheets.length - 1; i >= 0; --i) {
+ if (document.styleSheets[i].cssRules[0].selectorText == "case.good") {
+ resultStyleSheet = i;
+ return;
+ }
+ }
+ // The styleSheet hasn't been found, but it should be the last one.
+ resultStyleSheet = document.styleSheets.length - 1;
+ }
+
+ function hide() {
+ document.styleSheets[resultStyleSheet].cssRules[0].style.display='none';
+ }
+
+ function show() {
+ document.styleSheets[resultStyleSheet].cssRules[0].style.display='';
+ }
+
+ </script>
+ <style type="text/css">
+ case.good {color:black}
+ case.bad {color:black}
+ status.pass {color:green}
+ status.crash {color:red}
+ status.fail {color:red}
+ status.xpass {color:663300}
+ status.xfail {color:004500}
+ status.benchmark {color:000088}
+ status.warn {color:orange}
+ status.crash {color:red; text-decoration:blink; background-color:black}
+ </style>
+ </head>
+ <body onload="init()">
+ <center>
+ <h1>Qt's autotests results</h1>%(totals)s<br>
+ <hr>
+ <form>
+ <input type="button" value="Show failures only" onclick="hide()"/>
+ &nbsp;
+ <input type="button" value="Show all" onclick="show()"/>
+ </form>
+ </center>
+ <hr>
+ %(results)s
+ </body>
+ </html>""" % {"totals": totals, "results": txt}
+ return txt
+
+
+if __name__ == '__main__':
+ options = Options(sys.argv[1:])
+ main = Main(options)
+ main.run()
diff --git a/WebKitTools/Scripts/run-test-runner b/WebKitTools/Scripts/run-test-runner
new file mode 100755
index 0000000..98fa3b6
--- /dev/null
+++ b/WebKitTools/Scripts/run-test-runner
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+# 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.
+
+# Simplified "run" script for launching the WebKit2 WebKitTestRunner.
+
+use strict;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+setConfiguration();
+
+exit exitStatus(runWebKitTestRunner());
diff --git a/WebKitTools/Scripts/run-test-webkit-api b/WebKitTools/Scripts/run-test-webkit-api
new file mode 100755
index 0000000..dfd85d5
--- /dev/null
+++ b/WebKitTools/Scripts/run-test-webkit-api
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+# 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.
+# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
+
+# Simplified "run" script for launching the WebKit2 estWebKitAPI.
+
+use strict;
+use FindBin;
+use lib $FindBin::Bin;
+use webkitdirs;
+
+setConfiguration();
+
+exit exitStatus(runTestWebKitAPI());
diff --git a/WebKitTools/Scripts/run-webkit-httpd b/WebKitTools/Scripts/run-webkit-httpd
index 018f64c..9ea2551 100755
--- a/WebKitTools/Scripts/run-webkit-httpd
+++ b/WebKitTools/Scripts/run-webkit-httpd
@@ -42,6 +42,10 @@ use lib $FindBin::Bin;
use webkitperl::httpd;
use webkitdirs;
+# FIXME: Dynamic HTTP-port configuration in this file is wrong. The various
+# apache config files in LayoutTests/http/config govern the port numbers.
+# Dynamic configuration as-written will also cause random failures in
+# an IPv6 environment. See https://bugs.webkit.org/show_bug.cgi?id=37104.
# Argument handling
my $httpdPort = 8000;
my $allInterfaces = 0;
diff --git a/WebKitTools/Scripts/run-webkit-tests b/WebKitTools/Scripts/run-webkit-tests
index 809e078..6b530e1 100755
--- a/WebKitTools/Scripts/run-webkit-tests
+++ b/WebKitTools/Scripts/run-webkit-tests
@@ -1,2222 +1,84 @@
#!/usr/bin/perl
-
-# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-# Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
-# Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com)
-# Copyright (C) 2007 Eric Seidel <eric@webkit.org>
-# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2009 Andras Becsi (becsi.andras@stud.u-szeged.hu), University of Szeged
+# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
+# 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.
-# 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-# its contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
#
-# THIS SOFTWARE IS PROVIDED BY APPLE 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 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.
-
-# Script to run the WebKit Open Source Project layout tests.
-
-# Run all the tests passed in on the command line.
-# If no tests are passed, find all the .html, .shtml, .xml, .xhtml, .pl, .php (and svg) files in the test directory.
-
-# Run each text.
-# Compare against the existing file xxx-expected.txt.
-# If there is a mismatch, generate xxx-actual.txt and xxx-diffs.txt.
-
-# At the end, report:
-# the number of tests that got the expected results
-# the number of tests that ran, but did not get the expected results
-# the number of tests that failed to run
-# the number of tests that were run but had no expected results to compare against
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# This file is a temporary hack.
+# It will be removed as soon as all platforms are are ready to move to
+# new-run-webkit-tests and we can then update the buildbots to explicitly
+# call old-run-webkit-tests for any platforms which will never support
+# a Python run-webkit-tests.
+
+# This is intentionally written in Perl to guarantee support on
+# the same set of platforms as old-run-webkit-tests currently supports.
+# The buildbot master.cfg also currently passes run-webkit-tests to
+# perl directly instead of executing it in a shell.
use strict;
use warnings;
-use Cwd;
-use Data::Dumper;
-use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK);
-use File::Basename;
-use File::Copy;
-use File::Find;
-use File::Path;
use File::Spec;
-use File::Spec::Functions;
use FindBin;
-use Getopt::Long;
-use IPC::Open2;
-use IPC::Open3;
-use Time::HiRes qw(time usleep);
-
-use List::Util 'shuffle';
-
use lib $FindBin::Bin;
-use webkitperl::features;
-use webkitperl::httpd;
use webkitdirs;
-use VCSUtils;
-use POSIX;
-
-sub buildPlatformResultHierarchy();
-sub buildPlatformTestHierarchy(@);
-sub closeCygpaths();
-sub closeDumpTool();
-sub closeWebSocketServer();
-sub configureAndOpenHTTPDIfNeeded();
-sub countAndPrintLeaks($$$);
-sub countFinishedTest($$$$);
-sub deleteExpectedAndActualResults($);
-sub dumpToolDidCrash();
-sub epiloguesAndPrologues($$);
-sub expectedDirectoryForTest($;$;$);
-sub fileNameWithNumber($$);
-sub htmlForResultsSection(\@$&);
-sub isTextOnlyTest($);
-sub launchWithEnv(\@\%);
-sub resolveAndMakeTestResultsDirectory();
-sub numericcmp($$);
-sub openDiffTool();
-sub openDumpTool();
-sub parseLeaksandPrintUniqueLeaks();
-sub openWebSocketServerIfNeeded();
-sub pathcmp($$);
-sub printFailureMessageForTest($$);
-sub processIgnoreTests($$);
-sub readFromDumpToolWithTimer(**);
-sub readSkippedFiles($);
-sub recordActualResultsAndDiff($$);
-sub sampleDumpTool();
-sub setFileHandleNonBlocking(*$);
-sub slowestcmp($$);
-sub splitpath($);
-sub stripExtension($);
-sub stripMetrics($$);
-sub testCrashedOrTimedOut($$$$$);
-sub toURL($);
-sub toWindowsPath($);
-sub validateSkippedArg($$;$);
-sub writeToFile($$);
-
-# Argument handling
-my $addPlatformExceptions = 0;
-my $complexText = 0;
-my $exitAfterNFailures = 0;
-my $generateNewResults = isAppleMacWebKit() ? 1 : 0;
-my $guardMalloc = '';
-my $httpdPort = 8000;
-my $httpdSSLPort = 8443;
-my $ignoreMetrics = 0;
-my $webSocketPort = 8880;
-# wss is disabled until all platforms support pyOpenSSL.
-# my $webSocketSecurePort = 9323;
-my $ignoreTests = '';
-my $iterations = 1;
-my $launchSafari = 1;
-my $mergeDepth;
-my $pixelTests = '';
-my $platform;
-my $quiet = '';
-my $randomizeTests = 0;
-my $repeatEach = 1;
-my $report10Slowest = 0;
-my $resetResults = 0;
-my $reverseTests = 0;
-my $root;
-my $runSample = 1;
-my $shouldCheckLeaks = 0;
-my $showHelp = 0;
-my $stripEditingCallbacks = isCygwin();
-my $testHTTP = 1;
-my $testMedia = 1;
-my $tmpDir = "/tmp";
-my $testResultsDirectory = File::Spec->catfile($tmpDir, "layout-test-results");
-my $testsPerDumpTool = 1000;
-my $threaded = 0;
-# DumpRenderTree has an internal timeout of 15 seconds, so this must be > 15.
-my $timeoutSeconds = 20;
-my $tolerance = 0;
-my $treatSkipped = "default";
-my $useRemoteLinksToTests = 0;
-my $useValgrind = 0;
-my $verbose = 0;
-my $shouldWaitForHTTPD = 0;
-
-my @leaksFilenames;
-
-if (isWindows() || isMsys()) {
- print "This script has to be run under Cygwin to function correctly.\n";
- exit 1;
-}
-
-# Default to --no-http for wx for now.
-$testHTTP = 0 if (isWx());
-
-my $expectedTag = "expected";
-my $actualTag = "actual";
-my $prettyDiffTag = "pretty-diff";
-my $diffsTag = "diffs";
-my $errorTag = "stderr";
-
-my @macPlatforms = ("mac-tiger", "mac-leopard", "mac-snowleopard", "mac");
-
-if (isAppleMacWebKit()) {
- if (isTiger()) {
- $platform = "mac-tiger";
- $tolerance = 1.0;
- } elsif (isLeopard()) {
- $platform = "mac-leopard";
- $tolerance = 0.1;
- } elsif (isSnowLeopard()) {
- $platform = "mac-snowleopard";
- $tolerance = 0.1;
- } else {
- $platform = "mac";
- }
-} elsif (isQt()) {
- if (isDarwin()) {
- $platform = "qt-mac";
- } elsif (isLinux()) {
- $platform = "qt-linux";
- } elsif (isWindows() || isCygwin()) {
- $platform = "qt-win";
- } else {
- $platform = "qt";
- }
-} elsif (isGtk()) {
- $platform = "gtk";
- if (!$ENV{"WEBKIT_TESTFONTS"}) {
- print "The WEBKIT_TESTFONTS environment variable is not defined.\n";
- print "You must set it before running the tests.\n";
- print "Use git to grab the actual fonts from http://gitorious.org/qtwebkit/testfonts\n";
- exit 1;
- }
-} elsif (isWx()) {
- $platform = "wx";
-} elsif (isCygwin()) {
- $platform = "win";
-}
-
-if (!defined($platform)) {
- print "WARNING: Your platform is not recognized. Any platform-specific results will be generated in platform/undefined.\n";
- $platform = "undefined";
-}
-
-my $programName = basename($0);
-my $launchSafariDefault = $launchSafari ? "launch" : "do not launch";
-my $httpDefault = $testHTTP ? "run" : "do not run";
-my $sampleDefault = $runSample ? "run" : "do not run";
-
-my $usage = <<EOF;
-Usage: $programName [options] [testdir|testpath ...]
- --add-platform-exceptions Put new results for non-platform-specific failing tests into the platform-specific results directory
- --complex-text Use the complex text code path for all text (Mac OS X and Windows only)
- -c|--configuration config Set DumpRenderTree build configuration
- -g|--guard-malloc Enable malloc guard
- --exit-after-n-failures N Exit after the first N failures instead of running all tests
- -h|--help Show this help message
- --[no-]http Run (or do not run) http tests (default: $httpDefault)
- --[no-]wait-for-httpd Wait for httpd if some other test session is using it already (same as WEBKIT_WAIT_FOR_HTTPD=1). (default: $shouldWaitForHTTPD)
- -i|--ignore-tests Comma-separated list of directories or tests to ignore
- --iterations n Number of times to run the set of tests (e.g. ABCABCABC)
- --[no-]launch-safari Launch (or do not launch) Safari to display test results (default: $launchSafariDefault)
- -l|--leaks Enable leaks checking
- --[no-]new-test-results Generate results for new tests
- --nthly n Restart DumpRenderTree every n tests (default: $testsPerDumpTool)
- -p|--pixel-tests Enable pixel tests
- --tolerance t Ignore image differences less than this percentage (default: $tolerance)
- --platform Override the detected platform to use for tests and results (default: $platform)
- --port Web server port to use with http tests
- -q|--quiet Less verbose output
- --reset-results Reset ALL results (including pixel tests if --pixel-tests is set)
- -o|--results-directory Output results directory (default: $testResultsDirectory)
- --random Run the tests in a random order
- --repeat-each n Number of times to run each test (e.g. AAABBBCCC)
- --reverse Run the tests in reverse alphabetical order
- --root Path to root tools build
- --[no-]sample-on-timeout Run sample on timeout (default: $sampleDefault) (Mac OS X only)
- -1|--singly Isolate each test case run (implies --nthly 1 --verbose)
- --skipped=[default|ignore|only] Specifies how to treat the Skipped file
- default: Tests/directories listed in the Skipped file are not tested
- ignore: The Skipped file is ignored
- only: Only those tests/directories listed in the Skipped file will be run
- --slowest Report the 10 slowest tests
- --ignore-metrics Ignore metrics in tests
- --[no-]strip-editing-callbacks Remove editing callbacks from expected results
- -t|--threaded Run a concurrent JavaScript thead with each test
- --timeout t Sets the number of seconds before a test times out (default: $timeoutSeconds)
- --valgrind Run DumpRenderTree inside valgrind (Qt/Linux only)
- -v|--verbose More verbose output (overrides --quiet)
- -m|--merge-leak-depth arg Merges leak callStacks and prints the number of unique leaks beneath a callstack depth of arg. Defaults to 5.
- --use-remote-links-to-tests Link to test files within the SVN repository in the results.
-EOF
-
-setConfiguration();
-
-my $getOptionsResult = GetOptions(
- 'add-platform-exceptions' => \$addPlatformExceptions,
- 'complex-text' => \$complexText,
- 'exit-after-n-failures=i' => \$exitAfterNFailures,
- 'guard-malloc|g' => \$guardMalloc,
- 'help|h' => \$showHelp,
- 'http!' => \$testHTTP,
- 'wait-for-httpd!' => \$shouldWaitForHTTPD,
- 'ignore-metrics!' => \$ignoreMetrics,
- 'ignore-tests|i=s' => \$ignoreTests,
- 'iterations=i' => \$iterations,
- 'launch-safari!' => \$launchSafari,
- 'leaks|l' => \$shouldCheckLeaks,
- 'merge-leak-depth|m:5' => \$mergeDepth,
- 'new-test-results!' => \$generateNewResults,
- 'nthly=i' => \$testsPerDumpTool,
- 'pixel-tests|p' => \$pixelTests,
- 'platform=s' => \$platform,
- 'port=i' => \$httpdPort,
- 'quiet|q' => \$quiet,
- 'random' => \$randomizeTests,
- 'repeat-each=i' => \$repeatEach,
- 'reset-results' => \$resetResults,
- 'results-directory|o=s' => \$testResultsDirectory,
- 'reverse' => \$reverseTests,
- 'root=s' => \$root,
- 'sample-on-timeout!' => \$runSample,
- 'singly|1' => sub { $testsPerDumpTool = 1; },
- 'skipped=s' => \&validateSkippedArg,
- 'slowest' => \$report10Slowest,
- 'strip-editing-callbacks!' => \$stripEditingCallbacks,
- 'threaded|t' => \$threaded,
- 'timeout=i' => \$timeoutSeconds,
- 'tolerance=f' => \$tolerance,
- 'use-remote-links-to-tests' => \$useRemoteLinksToTests,
- 'valgrind' => \$useValgrind,
- 'verbose|v' => \$verbose,
-);
-
-if (!$getOptionsResult || $showHelp) {
- print STDERR $usage;
- exit 1;
-}
-
-my $ignoreSkipped = $treatSkipped eq "ignore";
-my $skippedOnly = $treatSkipped eq "only";
-
-my $configuration = configuration();
-
-# We need an environment variable to be able to enable the feature per-slave
-$shouldWaitForHTTPD = $ENV{"WEBKIT_WAIT_FOR_HTTPD"} unless ($shouldWaitForHTTPD);
-$verbose = 1 if $testsPerDumpTool == 1;
-
-if ($shouldCheckLeaks && $testsPerDumpTool > 1000) {
- print STDERR "\nWARNING: Running more than 1000 tests at a time with MallocStackLogging enabled may cause a crash.\n\n";
-}
-
-# Stack logging does not play well with QuickTime on Tiger (rdar://problem/5537157)
-$testMedia = 0 if $shouldCheckLeaks && isTiger();
-
-# Generating remote links causes a lot of unnecessary spew on GTK build bot
-$useRemoteLinksToTests = 0 if isGtk();
-
-setConfigurationProductDir(Cwd::abs_path($root)) if (defined($root));
-my $productDir = productDir();
-$productDir .= "/bin" if isQt();
-$productDir .= "/Programs" if isGtk();
-
-chdirWebKit();
-
-if (!defined($root)) {
- print STDERR "Running build-dumprendertree\n";
-
- local *DEVNULL;
- my ($childIn, $childOut, $childErr);
- if ($quiet) {
- open(DEVNULL, ">", File::Spec->devnull()) or die "Failed to open /dev/null";
- $childOut = ">&DEVNULL";
- $childErr = ">&DEVNULL";
- } else {
- # When not quiet, let the child use our stdout/stderr.
- $childOut = ">&STDOUT";
- $childErr = ">&STDERR";
- }
-
- my @args = argumentsForConfiguration();
- my $buildProcess = open3($childIn, $childOut, $childErr, "WebKitTools/Scripts/build-dumprendertree", @args) or die "Failed to run build-dumprendertree";
- close($childIn);
- waitpid $buildProcess, 0;
- my $buildResult = $?;
- close($childOut);
- close($childErr);
-
- close DEVNULL if ($quiet);
-
- if ($buildResult) {
- print STDERR "Compiling DumpRenderTree failed!\n";
- exit exitStatus($buildResult);
- }
-}
-
-my $dumpToolName = "DumpRenderTree";
-$dumpToolName .= "_debug" if isCygwin() && configurationForVisualStudio() !~ /^Release|Debug_Internal$/;
-my $dumpTool = "$productDir/$dumpToolName";
-die "can't find executable $dumpToolName (looked in $productDir)\n" unless -x $dumpTool;
-
-my $imageDiffTool = "$productDir/ImageDiff";
-$imageDiffTool .= "_debug" if isCygwin() && configurationForVisualStudio() !~ /^Release|Debug_Internal$/;
-die "can't find executable $imageDiffTool (looked in $productDir)\n" if $pixelTests && !-x $imageDiffTool;
-
-checkFrameworks() unless isCygwin();
-
-if (isAppleMacWebKit()) {
- push @INC, $productDir;
- require DumpRenderTreeSupport;
-}
-
-my $layoutTestsName = "LayoutTests";
-my $testDirectory = File::Spec->rel2abs($layoutTestsName);
-my $expectedDirectory = $testDirectory;
-my $platformBaseDirectory = catdir($testDirectory, "platform");
-my $platformTestDirectory = catdir($platformBaseDirectory, $platform);
-my @platformResultHierarchy = buildPlatformResultHierarchy();
-my @platformTestHierarchy = buildPlatformTestHierarchy(@platformResultHierarchy);
-
-$expectedDirectory = $ENV{"WebKitExpectedTestResultsDirectory"} if $ENV{"WebKitExpectedTestResultsDirectory"};
-
-$testResultsDirectory = File::Spec->rel2abs($testResultsDirectory);
-my $testResults = File::Spec->catfile($testResultsDirectory, "results.html");
-
-print "Running tests from $testDirectory\n";
-if ($pixelTests) {
- print "Enabling pixel tests with a tolerance of $tolerance%\n";
- if (isDarwin()) {
- print "WARNING: Temporarily changing the main display color profile:\n";
- print "\tThe colors on your screen will change for the duration of the testing.\n";
- print "\tThis allows the pixel tests to have consistent color values across all machines.\n";
-
- if (isPerianInstalled()) {
- print "WARNING: Perian's QuickTime component is installed and this may affect pixel test results!\n";
- print "\tYou should avoid generating new pixel results in this environment.\n";
- print "\tSee https://bugs.webkit.org/show_bug.cgi?id=22615 for details.\n";
- }
- }
-}
-
-system "ln", "-s", $testDirectory, "/tmp/LayoutTests" unless -x "/tmp/LayoutTests";
-
-my %ignoredFiles = ( "results.html" => 1 );
-my %ignoredDirectories = map { $_ => 1 } qw(platform);
-my %ignoredLocalDirectories = map { $_ => 1 } qw(.svn _svn resources script-tests);
-my %supportedFileExtensions = map { $_ => 1 } qw(html shtml xml xhtml pl php);
-
-if (!checkWebCoreFeatureSupport("MathML", 0)) {
- $ignoredDirectories{'mathml'} = 1;
-}
-
-# FIXME: We should fix webkitperl/features.pm:hasFeature() to do the correct feature detection for Cygwin.
-if (checkWebCoreFeatureSupport("SVG", 0)) {
- $supportedFileExtensions{'svg'} = 1;
-} elsif (isCygwin()) {
- $supportedFileExtensions{'svg'} = 1;
-} else {
- $ignoredLocalDirectories{'svg'} = 1;
-}
-
-if (!$testHTTP) {
- $ignoredDirectories{'http'} = 1;
- $ignoredDirectories{'websocket'} = 1;
-}
-
-if (!$testMedia) {
- $ignoredDirectories{'media'} = 1;
- $ignoredDirectories{'http/tests/media'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("Accelerated Compositing", 0)) {
- $ignoredDirectories{'compositing'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("3D Rendering", 0)) {
- $ignoredDirectories{'animations/3d'} = 1;
- $ignoredDirectories{'transforms/3d'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("3D Canvas", 0)) {
- $ignoredDirectories{'fast/canvas/webgl'} = 1;
-}
-
-if (checkWebCoreFeatureSupport("WML", 0)) {
- $supportedFileExtensions{'wml'} = 1;
-} else {
- $ignoredDirectories{'http/tests/wml'} = 1;
- $ignoredDirectories{'fast/wml'} = 1;
- $ignoredDirectories{'wml'} = 1;
-}
-
-if (!checkWebCoreFeatureSupport("XHTMLMP", 0)) {
- $ignoredDirectories{'fast/xhtmlmp'} = 1;
-}
-
-processIgnoreTests($ignoreTests, "ignore-tests") if $ignoreTests;
-if (!$ignoreSkipped) {
- if (!$skippedOnly || @ARGV == 0) {
- readSkippedFiles("");
- } else {
- # Since readSkippedFiles() appends to @ARGV, we must use a foreach
- # loop so that we only iterate over the original argument list.
- foreach my $argnum (0 .. $#ARGV) {
- readSkippedFiles(shift @ARGV);
- }
- }
-}
-
-my @tests = findTestsToRun();
-
-die "no tests to run\n" if !@tests;
-
-my %counts;
-my %tests;
-my %imagesPresent;
-my %imageDifferences;
-my %durations;
-my $count = 0;
-my $leaksOutputFileNumber = 1;
-my $totalLeaks = 0;
-
-my @toolArgs = ();
-push @toolArgs, "--pixel-tests" if $pixelTests;
-push @toolArgs, "--threaded" if $threaded;
-push @toolArgs, "--complex-text" if $complexText;
-push @toolArgs, "-";
-
-my @diffToolArgs = ();
-push @diffToolArgs, "--tolerance", $tolerance;
-
-$| = 1;
-
-my $dumpToolPID;
-my $isDumpToolOpen = 0;
-my $dumpToolCrashed = 0;
-my $imageDiffToolPID;
-my $isDiffToolOpen = 0;
-
-my $atLineStart = 1;
-my $lastDirectory = "";
-
-my $isHttpdOpen = 0;
-my $isWebSocketServerOpen = 0;
-my $webSocketServerPID = 0;
-my $failedToStartWebSocketServer = 0;
-# wss is disabled until all platforms support pyOpenSSL.
-# my $webSocketSecureServerPID = 0;
-
-sub catch_pipe { $dumpToolCrashed = 1; }
-$SIG{"PIPE"} = "catch_pipe";
-
-print "Testing ", scalar @tests, " test cases";
-print " $iterations times" if ($iterations > 1);
-print ", repeating each test $repeatEach times" if ($repeatEach > 1);
-print ".\n";
-
-my $overallStartTime = time;
-
-my %expectedResultPaths;
-
-my @originalTests = @tests;
-# Add individual test repetitions
-if ($repeatEach > 1) {
- @tests = ();
- foreach my $test (@originalTests) {
- for (my $i = 0; $i < $repeatEach; $i++) {
- push(@tests, $test);
- }
- }
-}
-# Add test set repetitions
-for (my $i = 1; $i < $iterations; $i++) {
- push(@tests, @originalTests);
-}
-
-for my $test (@tests) {
- my $newDumpTool = not $isDumpToolOpen;
- openDumpTool();
-
- my $base = stripExtension($test);
- my $expectedExtension = ".txt";
-
- my $dir = $base;
- $dir =~ s|/[^/]+$||;
-
- if ($newDumpTool || $dir ne $lastDirectory) {
- foreach my $logue (epiloguesAndPrologues($newDumpTool ? "" : $lastDirectory, $dir)) {
- if (isCygwin()) {
- $logue = toWindowsPath($logue);
- } else {
- $logue = canonpath($logue);
- }
- if ($verbose) {
- print "running epilogue or prologue $logue\n";
- }
- print OUT "$logue\n";
- # Throw away output from DumpRenderTree.
- # Once for the test output and once for pixel results (empty)
- while (<IN>) {
- last if /#EOF/;
- }
- while (<IN>) {
- last if /#EOF/;
- }
- }
- }
-
- if ($verbose) {
- print "running $test -> ";
- $atLineStart = 0;
- } elsif (!$quiet) {
- if ($dir ne $lastDirectory) {
- print "\n" unless $atLineStart;
- print "$dir ";
- }
- print ".";
- $atLineStart = 0;
- }
-
- $lastDirectory = $dir;
-
- my $result;
-
- my $startTime = time if $report10Slowest;
-
- # Try to read expected hash file for pixel tests
- my $suffixExpectedHash = "";
- if ($pixelTests && !$resetResults) {
- my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
- if (open EXPECTEDHASH, "$expectedPixelDir/$base-$expectedTag.checksum") {
- my $expectedHash = <EXPECTEDHASH>;
- chomp($expectedHash);
- close EXPECTEDHASH;
-
- # Format expected hash into a suffix string that is appended to the path / URL passed to DRT
- $suffixExpectedHash = "'$expectedHash";
- }
- }
-
- if ($test =~ /^http\//) {
- configureAndOpenHTTPDIfNeeded();
- if ($test !~ /^http\/tests\/local\// && $test !~ /^http\/tests\/ssl\// && $test !~ /^http\/tests\/wml\// && $test !~ /^http\/tests\/media\//) {
- my $path = canonpath($test);
- $path =~ s/^http\/tests\///;
- print OUT "http://127.0.0.1:$httpdPort/$path$suffixExpectedHash\n";
- } elsif ($test =~ /^http\/tests\/ssl\//) {
- my $path = canonpath($test);
- $path =~ s/^http\/tests\///;
- print OUT "https://127.0.0.1:$httpdSSLPort/$path$suffixExpectedHash\n";
- } else {
- my $testPath = "$testDirectory/$test";
- if (isCygwin()) {
- $testPath = toWindowsPath($testPath);
- } else {
- $testPath = canonpath($testPath);
- }
- print OUT "$testPath$suffixExpectedHash\n";
- }
- } elsif ($test =~ /^websocket\//) {
- if ($test =~ /^websocket\/tests\/local\//) {
- my $testPath = "$testDirectory/$test";
- if (isCygwin()) {
- $testPath = toWindowsPath($testPath);
- } else {
- $testPath = canonpath($testPath);
- }
- print OUT "$testPath\n";
- } else {
- if (openWebSocketServerIfNeeded()) {
- my $path = canonpath($test);
- if ($test =~ /^websocket\/tests\/ssl\//) {
- # wss is disabled until all platforms support pyOpenSSL.
- print STDERR "Error: wss is disabled until all platforms support pyOpenSSL.";
- # print OUT "https://127.0.0.1:$webSocketSecurePort/$path\n";
- } else {
- print OUT "http://127.0.0.1:$webSocketPort/$path\n";
- }
- } else {
- # We failed to launch the WebSocket server. Display a useful error message rather than attempting
- # to run tests that expect the server to be available.
- my $errorMessagePath = "$testDirectory/websocket/resources/server-failed-to-start.html";
- $errorMessagePath = isCygwin() ? toWindowsPath($errorMessagePath) : canonpath($errorMessagePath);
- print OUT "$errorMessagePath\n";
- }
- }
- } else {
- my $testPath = "$testDirectory/$test";
- if (isCygwin()) {
- $testPath = toWindowsPath($testPath);
- } else {
- $testPath = canonpath($testPath);
- }
- print OUT "$testPath$suffixExpectedHash\n" if defined $testPath;
- }
-
- # DumpRenderTree is expected to dump two "blocks" to stdout for each test.
- # Each block is terminated by a #EOF on a line by itself.
- # The first block is the output of the test (in text, RenderTree or other formats).
- # The second block is for optional pixel data in PNG format, and may be empty if
- # pixel tests are not being run, or the test does not dump pixels (e.g. text tests).
- my $readResults = readFromDumpToolWithTimer(IN, ERROR);
-
- my $actual = $readResults->{output};
- my $error = $readResults->{error};
-
- $expectedExtension = $readResults->{extension};
- my $expectedFileName = "$base-$expectedTag.$expectedExtension";
-
- my $isText = isTextOnlyTest($actual);
-
- my $expectedDir = expectedDirectoryForTest($base, $isText, $expectedExtension);
- $expectedResultPaths{$base} = "$expectedDir/$expectedFileName";
-
- unless ($readResults->{status} eq "success") {
- my $crashed = $readResults->{status} eq "crashed";
- testCrashedOrTimedOut($test, $base, $crashed, $actual, $error);
- countFinishedTest($test, $base, $crashed ? "crash" : "timedout", 0);
- next;
- }
-
- $durations{$test} = time - $startTime if $report10Slowest;
-
- my $expected;
-
- if (!$resetResults && open EXPECTED, "<", "$expectedDir/$expectedFileName") {
- $expected = "";
- while (<EXPECTED>) {
- next if $stripEditingCallbacks && $_ =~ /^EDITING DELEGATE:/;
- $expected .= $_;
- }
- close EXPECTED;
- }
-
- if ($ignoreMetrics && !$isText && defined $expected) {
- ($actual, $expected) = stripMetrics($actual, $expected);
- }
-
- if ($shouldCheckLeaks && $testsPerDumpTool == 1) {
- print " $test -> ";
- }
-
- my $actualPNG = "";
- my $diffPNG = "";
- my $diffPercentage = 0;
- my $diffResult = "passed";
-
- my $actualHash = "";
- my $expectedHash = "";
- my $actualPNGSize = 0;
-
- while (<IN>) {
- last if /#EOF/;
- if (/ActualHash: ([a-f0-9]{32})/) {
- $actualHash = $1;
- } elsif (/ExpectedHash: ([a-f0-9]{32})/) {
- $expectedHash = $1;
- } elsif (/Content-Length: (\d+)\s*/) {
- $actualPNGSize = $1;
- read(IN, $actualPNG, $actualPNGSize);
- }
- }
-
- if ($verbose && $pixelTests && !$resetResults && $actualPNGSize) {
- if ($actualHash eq "" && $expectedHash eq "") {
- printFailureMessageForTest($test, "WARNING: actual & expected pixel hashes are missing!");
- } elsif ($actualHash eq "") {
- printFailureMessageForTest($test, "WARNING: actual pixel hash is missing!");
- } elsif ($expectedHash eq "") {
- printFailureMessageForTest($test, "WARNING: expected pixel hash is missing!");
- }
- }
- if ($actualPNGSize > 0) {
- my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
-
- if (!$resetResults && ($expectedHash ne $actualHash || ($actualHash eq "" && $expectedHash eq ""))) {
- if (-f "$expectedPixelDir/$base-$expectedTag.png") {
- my $expectedPNGSize = -s "$expectedPixelDir/$base-$expectedTag.png";
- my $expectedPNG = "";
- open EXPECTEDPNG, "$expectedPixelDir/$base-$expectedTag.png";
- read(EXPECTEDPNG, $expectedPNG, $expectedPNGSize);
-
- openDiffTool();
- print DIFFOUT "Content-Length: $actualPNGSize\n";
- print DIFFOUT $actualPNG;
-
- print DIFFOUT "Content-Length: $expectedPNGSize\n";
- print DIFFOUT $expectedPNG;
-
- while (<DIFFIN>) {
- last if /^error/ || /^diff:/;
- if (/Content-Length: (\d+)\s*/) {
- read(DIFFIN, $diffPNG, $1);
- }
- }
-
- if (/^diff: (.+)% (passed|failed)/) {
- $diffPercentage = $1 + 0;
- $imageDifferences{$base} = $diffPercentage;
- $diffResult = $2;
- }
-
- if (!$diffPercentage) {
- printFailureMessageForTest($test, "pixel hash failed (but pixel test still passes)");
- }
- } elsif ($verbose) {
- printFailureMessageForTest($test, "WARNING: expected image is missing!");
- }
- }
-
- if ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.png") {
- mkpath catfile($expectedPixelDir, dirname($base)) if $testDirectory ne $expectedPixelDir;
- writeToFile("$expectedPixelDir/$base-$expectedTag.png", $actualPNG);
- }
-
- if ($actualHash ne "" && ($resetResults || !-f "$expectedPixelDir/$base-$expectedTag.checksum")) {
- writeToFile("$expectedPixelDir/$base-$expectedTag.checksum", $actualHash);
- }
- }
-
- if (dumpToolDidCrash()) {
- $result = "crash";
- testCrashedOrTimedOut($test, $base, 1, $actual, $error);
- } elsif (!defined $expected) {
- if ($verbose) {
- print "new " . ($resetResults ? "result" : "test") ."\n";
- $atLineStart = 1;
- }
- $result = "new";
-
- if ($generateNewResults || $resetResults) {
- mkpath catfile($expectedDir, dirname($base)) if $testDirectory ne $expectedDir;
- writeToFile("$expectedDir/$expectedFileName", $actual);
- }
- deleteExpectedAndActualResults($base);
- recordActualResultsAndDiff($base, $actual);
- if (!$resetResults) {
- # Always print the file name for new tests, as they will probably need some manual inspection.
- # in verbose mode we already printed the test case, so no need to do it again.
- unless ($verbose) {
- print "\n" unless $atLineStart;
- print "$test -> ";
- }
- my $resultsDir = catdir($expectedDir, dirname($base));
- if ($generateNewResults) {
- print "new (results generated in $resultsDir)\n";
- } else {
- print "new\n";
- }
- $atLineStart = 1;
- }
- } elsif ($actual eq $expected && $diffResult eq "passed") {
- if ($verbose) {
- print "succeeded\n";
- $atLineStart = 1;
- }
- $result = "match";
- deleteExpectedAndActualResults($base);
- } else {
- $result = "mismatch";
-
- my $pixelTestFailed = $pixelTests && $diffPNG && $diffPNG ne "";
- my $testFailed = $actual ne $expected;
-
- my $message = !$testFailed ? "pixel test failed" : "failed";
-
- if (($testFailed || $pixelTestFailed) && $addPlatformExceptions) {
- my $testBase = catfile($testDirectory, $base);
- my $expectedBase = catfile($expectedDir, $base);
- my $testIsMaximallyPlatformSpecific = $testBase =~ m|^\Q$platformTestDirectory\E/|;
- my $expectedResultIsMaximallyPlatformSpecific = $expectedBase =~ m|^\Q$platformTestDirectory\E/|;
- if (!$testIsMaximallyPlatformSpecific && !$expectedResultIsMaximallyPlatformSpecific) {
- mkpath catfile($platformTestDirectory, dirname($base));
- if ($testFailed) {
- my $expectedFile = catfile($platformTestDirectory, "$expectedFileName");
- writeToFile("$expectedFile", $actual);
- }
- if ($pixelTestFailed) {
- my $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.checksum");
- writeToFile("$expectedFile", $actualHash);
-
- $expectedFile = catfile($platformTestDirectory, "$base-$expectedTag.png");
- writeToFile("$expectedFile", $actualPNG);
- }
- $message .= " (results generated in $platformTestDirectory)";
- }
- }
-
- printFailureMessageForTest($test, $message);
-
- my $dir = "$testResultsDirectory/$base";
- $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
- my $testName = $1;
- mkpath $dir;
-
- deleteExpectedAndActualResults($base);
- recordActualResultsAndDiff($base, $actual);
-
- if ($pixelTestFailed) {
- $imagesPresent{$base} = 1;
-
- writeToFile("$testResultsDirectory/$base-$actualTag.png", $actualPNG);
- writeToFile("$testResultsDirectory/$base-$diffsTag.png", $diffPNG);
-
- my $expectedPixelDir = expectedDirectoryForTest($base, 0, "png");
- copy("$expectedPixelDir/$base-$expectedTag.png", "$testResultsDirectory/$base-$expectedTag.png");
-
- open DIFFHTML, ">$testResultsDirectory/$base-$diffsTag.html" or die;
- print DIFFHTML "<html>\n";
- print DIFFHTML "<head>\n";
- print DIFFHTML "<title>$base Image Compare</title>\n";
- print DIFFHTML "<script language=\"Javascript\" type=\"text/javascript\">\n";
- print DIFFHTML "var currentImage = 0;\n";
- print DIFFHTML "var imageNames = new Array(\"Actual\", \"Expected\");\n";
- print DIFFHTML "var imagePaths = new Array(\"$testName-$actualTag.png\", \"$testName-$expectedTag.png\");\n";
- if (-f "$testDirectory/$base-w3c.png") {
- copy("$testDirectory/$base-w3c.png", "$testResultsDirectory/$base-w3c.png");
- print DIFFHTML "imageNames.push(\"W3C\");\n";
- print DIFFHTML "imagePaths.push(\"$testName-w3c.png\");\n";
- }
- print DIFFHTML "function animateImage() {\n";
- print DIFFHTML " var image = document.getElementById(\"animatedImage\");\n";
- print DIFFHTML " var imageText = document.getElementById(\"imageText\");\n";
- print DIFFHTML " image.src = imagePaths[currentImage];\n";
- print DIFFHTML " imageText.innerHTML = imageNames[currentImage] + \" Image\";\n";
- print DIFFHTML " currentImage = (currentImage + 1) % imageNames.length;\n";
- print DIFFHTML " setTimeout('animateImage()',2000);\n";
- print DIFFHTML "}\n";
- print DIFFHTML "</script>\n";
- print DIFFHTML "</head>\n";
- print DIFFHTML "<body onLoad=\"animateImage();\">\n";
- print DIFFHTML "<table>\n";
- if ($diffPercentage) {
- print DIFFHTML "<tr>\n";
- print DIFFHTML "<td>Difference between images: <a href=\"$testName-$diffsTag.png\">$diffPercentage%</a></td>\n";
- print DIFFHTML "</tr>\n";
- }
- print DIFFHTML "<tr>\n";
- print DIFFHTML "<td><a href=\"" . toURL("$testDirectory/$test") . "\">test file</a></td>\n";
- print DIFFHTML "</tr>\n";
- print DIFFHTML "<tr>\n";
- print DIFFHTML "<td id=\"imageText\" style=\"text-weight: bold;\">Actual Image</td>\n";
- print DIFFHTML "</tr>\n";
- print DIFFHTML "<tr>\n";
- print DIFFHTML "<td><img src=\"$testName-$actualTag.png\" id=\"animatedImage\"></td>\n";
- print DIFFHTML "</tr>\n";
- print DIFFHTML "</table>\n";
- print DIFFHTML "</body>\n";
- print DIFFHTML "</html>\n";
- }
- }
-
- if ($error) {
- my $dir = "$testResultsDirectory/$base";
- $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
- mkpath $dir;
-
- writeToFile("$testResultsDirectory/$base-$errorTag.txt", $error);
-
- $counts{error}++;
- push @{$tests{error}}, $test;
- }
-
- countFinishedTest($test, $base, $result, $isText);
-
- # --reset-results does not check pass vs. fail, so exitAfterNFailures makes no sense with --reset-results.
- if ($exitAfterNFailures && !$resetResults) {
- my $passCount = $counts{match} || 0; # $counts{match} will be undefined if we've not yet passed a test (e.g. the first test fails).
- my $failureCount = $count - $passCount; # "Failure" here includes new tests, timeouts, crashes, etc.
- if ($failureCount >= $exitAfterNFailures) {
- print "\nExiting early after $failureCount failures. $count tests run.";
- closeDumpTool();
- last;
- }
- }
-}
-my $totalTestingTime = time - $overallStartTime;
-my $waitTime = getWaitTime();
-if ($waitTime > 0.1) {
- my $normalizedTestingTime = $totalTestingTime - $waitTime;
- printf "\n%0.2fs HTTPD waiting time\n", $waitTime . "";
- printf "%0.2fs normalized testing time", $normalizedTestingTime . "";
-}
-printf "\n%0.2fs total testing time\n", $totalTestingTime . "";
-
-!$isDumpToolOpen || die "Failed to close $dumpToolName.\n";
-
-$isHttpdOpen = !closeHTTPD();
-closeWebSocketServer();
-
-# Because multiple instances of this script are running concurrently we cannot
-# safely delete this symlink.
-# system "rm /tmp/LayoutTests";
-
-# FIXME: Do we really want to check the image-comparison tool for leaks every time?
-if ($isDiffToolOpen && $shouldCheckLeaks) {
- $totalLeaks += countAndPrintLeaks("ImageDiff", $imageDiffToolPID, "$testResultsDirectory/ImageDiff-leaks.txt");
-}
-
-if ($totalLeaks) {
- if ($mergeDepth) {
- parseLeaksandPrintUniqueLeaks();
- } else {
- print "\nWARNING: $totalLeaks total leaks found!\n";
- print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
- }
-}
-
-close IN;
-close OUT;
-close ERROR;
-
-if ($report10Slowest) {
- print "\n\nThe 10 slowest tests:\n\n";
- my $count = 0;
- for my $test (sort slowestcmp keys %durations) {
- printf "%0.2f secs: %s\n", $durations{$test}, $test;
- last if ++$count == 10;
- }
-}
-
-print "\n";
-
-if ($skippedOnly && $counts{"match"}) {
- print "The following tests are in the Skipped file (" . File::Spec->abs2rel("$platformTestDirectory/Skipped", $testDirectory) . "), but succeeded:\n";
- foreach my $test (@{$tests{"match"}}) {
- print " $test\n";
- }
-}
-
-if ($resetResults || ($counts{match} && $counts{match} == $count)) {
- print "all $count test cases succeeded\n";
- unlink $testResults;
- exit;
-}
-
-printResults();
-
-mkpath $testResultsDirectory;
-
-open HTML, ">", $testResults or die "Failed to open $testResults. $!";
-print HTML "<html>\n";
-print HTML "<head>\n";
-print HTML "<title>Layout Test Results</title>\n";
-print HTML "</head>\n";
-print HTML "<body>\n";
-
-if ($ignoreMetrics) {
- print HTML "<h4>Tested with metrics ignored.</h4>";
-}
-
-print HTML htmlForResultsSection(@{$tests{mismatch}}, "Tests where results did not match expected results", \&linksForMismatchTest);
-print HTML htmlForResultsSection(@{$tests{timedout}}, "Tests that timed out", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{crash}}, "Tests that caused the DumpRenderTree tool to crash", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{error}}, "Tests that had stderr output", \&linksForErrorTest);
-print HTML htmlForResultsSection(@{$tests{new}}, "Tests that had no expected results (probably new)", \&linksForNewTest);
-
-print HTML "</body>\n";
-print HTML "</html>\n";
-close HTML;
-
-my @configurationArgs = argumentsForConfiguration();
-
-if (isGtk()) {
- system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
-} elsif (isQt()) {
- unshift @configurationArgs, qw(-graphicssystem raster -style windows);
- if (isCygwin()) {
- $testResults = "/" . toWindowsPath($testResults);
- $testResults =~ s/\\/\//g;
- }
- system "WebKitTools/Scripts/run-launcher", @configurationArgs, "file://".$testResults if $launchSafari;
-} elsif (isCygwin()) {
- system "cygstart", $testResults if $launchSafari;
-} else {
- system "WebKitTools/Scripts/run-safari", @configurationArgs, "-NSOpen", $testResults if $launchSafari;
-}
-
-closeCygpaths() if isCygwin();
-
-exit 1;
-
-sub countAndPrintLeaks($$$)
+sub runningOnBuildBot()
{
- my ($dumpToolName, $dumpToolPID, $leaksFilePath) = @_;
-
- print "\n" unless $atLineStart;
- $atLineStart = 1;
-
- # We are excluding the following reported leaks so they don't get in our way when looking for WebKit leaks:
- # This allows us ignore known leaks and only be alerted when new leaks occur. Some leaks are in the old
- # versions of the system frameworks that are being used by the leaks bots. Even though a leak has been
- # fixed, it will be listed here until the bot has been updated with the newer frameworks.
-
- my @typesToExclude = (
- );
-
- my @callStacksToExclude = (
- "Flash_EnforceLocalSecurity" # leaks in Flash plug-in code, rdar://problem/4449747
- );
-
- if (isTiger()) {
- # Leak list for the version of Tiger used on the build bot.
- push @callStacksToExclude, (
- "CFRunLoopRunSpecific \\| malloc_zone_malloc", "CFRunLoopRunSpecific \\| CFAllocatorAllocate ", # leak in CFRunLoopRunSpecific, rdar://problem/4670839
- "CGImageSourceGetPropertiesAtIndex", # leak in ImageIO, rdar://problem/4628809
- "FOGetCoveredUnicodeChars", # leak in ATS, rdar://problem/3943604
- "GetLineDirectionPreference", "InitUnicodeUtilities", # leaks tool falsely reporting leak in CFNotificationCenterAddObserver, rdar://problem/4964790
- "ICCFPrefWrapper::GetPrefDictionary", # leaks in Internet Config. code, rdar://problem/4449794
- "NSHTTPURLProtocol setResponseHeader:", # leak in multipart/mixed-replace handling in Foundation, no Radar, but fixed in Leopard
- "NSURLCache cachedResponseForRequest", # leak in CFURL cache, rdar://problem/4768430
- "PCFragPrepareClosureFromFile", # leak in Code Fragment Manager, rdar://problem/3426998
- "WebCore::Selection::toRange", # bug in 'leaks', rdar://problem/4967949
- "WebCore::SubresourceLoader::create", # bug in 'leaks', rdar://problem/4985806
- "_CFPreferencesDomainDeepCopyDictionary", # leak in CFPreferences, rdar://problem/4220786
- "_objc_msgForward", # leak in NSSpellChecker, rdar://problem/4965278
- "gldGetString", # leak in OpenGL, rdar://problem/5013699
- "_setDefaultUserInfoFromURL", # leak in NSHTTPAuthenticator, rdar://problem/5546453
- "SSLHandshake", # leak in SSL, rdar://problem/5546440
- "SecCertificateCreateFromData", # leak in SSL code, rdar://problem/4464397
- );
- push @typesToExclude, (
- "THRD", # bug in 'leaks', rdar://problem/3387783
- "DRHT", # ditto (endian little hate i)
- );
- }
-
- if (isLeopard()) {
- # Leak list for the version of Leopard used on the build bot.
- push @callStacksToExclude, (
- "CFHTTPMessageAppendBytes", # leak in CFNetwork, rdar://problem/5435912
- "sendDidReceiveDataCallback", # leak in CFNetwork, rdar://problem/5441619
- "_CFHTTPReadStreamReadMark", # leak in CFNetwork, rdar://problem/5441468
- "httpProtocolStart", # leak in CFNetwork, rdar://problem/5468837
- "_CFURLConnectionSendCallbacks", # leak in CFNetwork, rdar://problem/5441600
- "DispatchQTMsg", # leak in QuickTime, PPC only, rdar://problem/5667132
- "QTMovieContentView createVisualContext", # leak in QuickTime, PPC only, rdar://problem/5667132
- "_CopyArchitecturesForJVMVersion", # leak in Java, rdar://problem/5910823
- );
- }
-
- if (isSnowLeopard()) {
- push @callStacksToExclude, (
- "readMakerNoteProps", # <rdar://problem/7156432> leak in ImageIO
- "QTKitMovieControllerView completeUISetup", # <rdar://problem/7155156> leak in QTKit
- );
- }
-
- my $leaksTool = sourceDir() . "/WebKitTools/Scripts/run-leaks";
- my $excludeString = "--exclude-callstack '" . (join "' --exclude-callstack '", @callStacksToExclude) . "'";
- $excludeString .= " --exclude-type '" . (join "' --exclude-type '", @typesToExclude) . "'" if @typesToExclude;
-
- print " ? checking for leaks in $dumpToolName\n";
- my $leaksOutput = `$leaksTool $excludeString $dumpToolPID`;
- my ($count, $bytes) = $leaksOutput =~ /Process $dumpToolPID: (\d+) leaks? for (\d+) total/;
- my ($excluded) = $leaksOutput =~ /(\d+) leaks? excluded/;
-
- my $adjustedCount = $count;
- $adjustedCount -= $excluded if $excluded;
-
- if (!$adjustedCount) {
- print " - no leaks found\n";
- unlink $leaksFilePath;
- return 0;
- } else {
- my $dir = $leaksFilePath;
- $dir =~ s|/[^/]+$|| or die;
- mkpath $dir;
-
- if ($excluded) {
- print " + $adjustedCount leaks ($bytes bytes including $excluded excluded leaks) were found, details in $leaksFilePath\n";
- } else {
- print " + $count leaks ($bytes bytes) were found, details in $leaksFilePath\n";
- }
-
- writeToFile($leaksFilePath, $leaksOutput);
-
- push @leaksFilenames, $leaksFilePath;
- }
-
- return $adjustedCount;
-}
-
-sub writeToFile($$)
-{
- my ($filePath, $contents) = @_;
- open NEWFILE, ">", "$filePath" or die "Could not create $filePath. $!\n";
- print NEWFILE $contents;
- close NEWFILE;
-}
-
-# Break up a path into the directory (with slash) and base name.
-sub splitpath($)
-{
- my ($path) = @_;
-
- my $pathSeparator = "/";
- my $dirname = dirname($path) . $pathSeparator;
- $dirname = "" if $dirname eq "." . $pathSeparator;
-
- return ($dirname, basename($path));
-}
-
-# Sort first by directory, then by file, so all paths in one directory are grouped
-# rather than being interspersed with items from subdirectories.
-# Use numericcmp to sort directory and filenames to make order logical.
-sub pathcmp($$)
-{
- my ($patha, $pathb) = @_;
-
- my ($dira, $namea) = splitpath($patha);
- my ($dirb, $nameb) = splitpath($pathb);
-
- return numericcmp($dira, $dirb) if $dira ne $dirb;
- return numericcmp($namea, $nameb);
-}
-
-# Sort numeric parts of strings as numbers, other parts as strings.
-# Makes 1.33 come after 1.3, which is cool.
-sub numericcmp($$)
-{
- my ($aa, $bb) = @_;
-
- my @a = split /(\d+)/, $aa;
- my @b = split /(\d+)/, $bb;
-
- # Compare one chunk at a time.
- # Each chunk is either all numeric digits, or all not numeric digits.
- while (@a && @b) {
- my $a = shift @a;
- my $b = shift @b;
-
- # Use numeric comparison if chunks are non-equal numbers.
- return $a <=> $b if $a =~ /^\d/ && $b =~ /^\d/ && $a != $b;
-
- # Use string comparison if chunks are any other kind of non-equal string.
- return $a cmp $b if $a ne $b;
- }
-
- # One of the two is now empty; compare lengths for result in this case.
- return @a <=> @b;
-}
-
-# Sort slowest tests first.
-sub slowestcmp($$)
-{
- my ($testa, $testb) = @_;
-
- my $dura = $durations{$testa};
- my $durb = $durations{$testb};
- return $durb <=> $dura if $dura != $durb;
- return pathcmp($testa, $testb);
-}
-
-sub launchWithEnv(\@\%)
-{
- my ($args, $env) = @_;
-
- # Dump the current environment as perl code and then put it in quotes so it is one parameter.
- my $environmentDumper = Data::Dumper->new([\%{$env}], [qw(*ENV)]);
- $environmentDumper->Indent(0);
- $environmentDumper->Purity(1);
- my $allEnvVars = $environmentDumper->Dump();
- unshift @{$args}, "\"$allEnvVars\"";
-
- my $execScript = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts execAppWithEnv));
- unshift @{$args}, $execScript;
- return @{$args};
-}
-
-sub resolveAndMakeTestResultsDirectory()
-{
- my $absTestResultsDirectory = File::Spec->rel2abs(glob $testResultsDirectory);
- mkpath $absTestResultsDirectory;
- return $absTestResultsDirectory;
-}
-
-sub openDiffTool()
-{
- return if $isDiffToolOpen;
- return if !$pixelTests;
-
- my %CLEAN_ENV;
- $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
- $imageDiffToolPID = open2(\*DIFFIN, \*DIFFOUT, $imageDiffTool, launchWithEnv(@diffToolArgs, %CLEAN_ENV)) or die "unable to open $imageDiffTool\n";
- $isDiffToolOpen = 1;
+ # This is a hack to detect if we're running on the buildbot so we can
+ # pass --verbose to new-run-webkit-tests. This will be removed when we
+ # update the buildbot config to call new-run-webkit-tests explicitly.
+ my %isBuildBotUser = ("apple" => 1, "buildbot" => 1);
+ return $isBuildBotUser{$ENV{"USER"}};
}
-sub openDumpTool()
+sub useNewRunWebKitTests()
{
- return if $isDumpToolOpen;
-
- my %CLEAN_ENV;
-
- # Generic environment variables
- if (defined $ENV{'WEBKIT_TESTFONTS'}) {
- $CLEAN_ENV{WEBKIT_TESTFONTS} = $ENV{'WEBKIT_TESTFONTS'};
- }
-
- $CLEAN_ENV{XML_CATALOG_FILES} = ""; # work around missing /etc/catalog <rdar://problem/4292995>
-
- # Platform spesifics
- if (isLinux()) {
- if (defined $ENV{'DISPLAY'}) {
- $CLEAN_ENV{DISPLAY} = $ENV{'DISPLAY'};
- } else {
- $CLEAN_ENV{DISPLAY} = ":1";
- }
- if (defined $ENV{'XAUTHORITY'}) {
- $CLEAN_ENV{XAUTHORITY} = $ENV{'XAUTHORITY'};
- }
-
- $CLEAN_ENV{HOME} = $ENV{'HOME'};
-
- if (defined $ENV{'LD_LIBRARY_PATH'}) {
- $CLEAN_ENV{LD_LIBRARY_PATH} = $ENV{'LD_LIBRARY_PATH'};
- }
- if (defined $ENV{'DBUS_SESSION_BUS_ADDRESS'}) {
- $CLEAN_ENV{DBUS_SESSION_BUS_ADDRESS} = $ENV{'DBUS_SESSION_BUS_ADDRESS'};
- }
- } elsif (isDarwin()) {
- if (defined $ENV{'DYLD_LIBRARY_PATH'}) {
- $CLEAN_ENV{DYLD_LIBRARY_PATH} = $ENV{'DYLD_LIBRARY_PATH'};
- }
-
- $CLEAN_ENV{DYLD_FRAMEWORK_PATH} = $productDir;
- $CLEAN_ENV{DYLD_INSERT_LIBRARIES} = "/usr/lib/libgmalloc.dylib" if $guardMalloc;
- } elsif (isCygwin()) {
- $CLEAN_ENV{HOMEDRIVE} = $ENV{'HOMEDRIVE'};
- $CLEAN_ENV{HOMEPATH} = $ENV{'HOMEPATH'};
-
- setPathForRunningWebKitApp(\%CLEAN_ENV);
- }
-
- # Port spesifics
- if (isQt()) {
- $CLEAN_ENV{QTWEBKIT_PLUGIN_PATH} = productDir() . "/lib/plugins";
- }
-
- my @args = ($dumpTool, @toolArgs);
- if (isAppleMacWebKit() and !isTiger()) {
- unshift @args, "arch", "-" . architecture();
- }
-
- if ($useValgrind) {
- unshift @args, "valgrind", "--suppressions=$platformBaseDirectory/qt/SuppressedValgrindErrors";
- }
-
- $CLEAN_ENV{MallocStackLogging} = 1 if $shouldCheckLeaks;
-
- $dumpToolPID = open3(\*OUT, \*IN, \*ERROR, launchWithEnv(@args, %CLEAN_ENV)) or die "Failed to start tool: $dumpTool\n";
- $isDumpToolOpen = 1;
- $dumpToolCrashed = 0;
-}
-
-sub closeDumpTool()
-{
- return if !$isDumpToolOpen;
-
- close IN;
- close OUT;
- waitpid $dumpToolPID, 0;
-
- # check for WebCore counter leaks.
- if ($shouldCheckLeaks) {
- while (<ERROR>) {
- print;
- }
- }
- close ERROR;
- $isDumpToolOpen = 0;
-}
-
-sub dumpToolDidCrash()
-{
- return 1 if $dumpToolCrashed;
- return 0 unless $isDumpToolOpen;
- my $pid = waitpid(-1, WNOHANG);
- return 1 if ($pid == $dumpToolPID);
-
- # On Mac OS X, crashing may be significantly delayed by crash reporter.
- return 0 unless isAppleMacWebKit();
-
- return DumpRenderTreeSupport::processIsCrashing($dumpToolPID);
-}
-
-sub configureAndOpenHTTPDIfNeeded()
-{
- return if $isHttpdOpen;
- my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
- my $listen = "127.0.0.1:$httpdPort";
- my @args = (
- "-c", "CustomLog \"$absTestResultsDirectory/access_log.txt\" common",
- "-c", "ErrorLog \"$absTestResultsDirectory/error_log.txt\"",
- "-C", "Listen $listen"
- );
-
- my @defaultArgs = getDefaultConfigForTestDirectory($testDirectory);
- @args = (@defaultArgs, @args);
-
- waitForHTTPDLock() if $shouldWaitForHTTPD;
- $isHttpdOpen = openHTTPD(@args);
-}
-
-sub openWebSocketServerIfNeeded()
-{
- return 1 if $isWebSocketServerOpen;
- return 0 if $failedToStartWebSocketServer;
-
- my $webSocketServerPath = "/usr/bin/python";
- my $webSocketPythonPath = "WebKitTools/pywebsocket";
- my $webSocketHandlerDir = "$testDirectory";
- my $webSocketHandlerScanDir = "$testDirectory/websocket/tests";
- my $webSocketHandlerMapFile = "$webSocketHandlerScanDir/handler_map.txt";
- my $sslCertificate = "$testDirectory/http/conf/webkit-httpd.pem";
- my $absTestResultsDirectory = resolveAndMakeTestResultsDirectory();
- my $logFile = "$absTestResultsDirectory/pywebsocket_log.txt";
-
- my @args = (
- "WebKitTools/pywebsocket/mod_pywebsocket/standalone.py",
- "-p", "$webSocketPort",
- "-d", "$webSocketHandlerDir",
- "-s", "$webSocketHandlerScanDir",
- "-m", "$webSocketHandlerMapFile",
- "-x", "/websocket/tests/cookies",
- "-l", "$logFile",
- "--strict",
- );
- # wss is disabled until all platforms support pyOpenSSL.
- # my @argsSecure = (
- # "WebKitTools/pywebsocket/mod_pywebsocket/standalone.py",
- # "-p", "$webSocketSecurePort",
- # "-d", "$webSocketHandlerDir",
- # "-t",
- # "-k", "$sslCertificate",
- # "-c", "$sslCertificate",
- # );
-
- $ENV{"PYTHONPATH"} = $webSocketPythonPath;
- $webSocketServerPID = open3(\*WEBSOCKETSERVER_IN, \*WEBSOCKETSERVER_OUT, \*WEBSOCKETSERVER_ERR, $webSocketServerPath, @args);
- # wss is disabled until all platforms support pyOpenSSL.
- # $webSocketSecureServerPID = open3(\*WEBSOCKETSECURESERVER_IN, \*WEBSOCKETSECURESERVER_OUT, \*WEBSOCKETSECURESERVER_ERR, $webSocketServerPath, @argsSecure);
- # my @listen = ("http://127.0.0.1:$webSocketPort", "https://127.0.0.1:$webSocketSecurePort");
- my @listen = ("http://127.0.0.1:$webSocketPort");
- for (my $i = 0; $i < @listen; $i++) {
- my $retryCount = 10;
- while (system("/usr/bin/curl -k -q --silent --stderr - --output /dev/null $listen[$i]") && $retryCount) {
- sleep 1;
- --$retryCount;
- }
- unless ($retryCount) {
- print STDERR "Timed out waiting for WebSocketServer to start.\n";
- $failedToStartWebSocketServer = 1;
- return 0;
- }
- }
-
- $isWebSocketServerOpen = 1;
- return 1;
-}
-
-sub closeWebSocketServer()
-{
- return if !$isWebSocketServerOpen;
-
- close WEBSOCKETSERVER_IN;
- close WEBSOCKETSERVER_OUT;
- close WEBSOCKETSERVER_ERR;
- kill 15, $webSocketServerPID;
-
- # wss is disabled until all platforms support pyOpenSSL.
- # close WEBSOCKETSECURESERVER_IN;
- # close WEBSOCKETSECURESERVER_OUT;
- # close WEBSOCKETSECURESERVER_ERR;
- # kill 15, $webSocketSecureServerPID;
-
- $isWebSocketServerOpen = 0;
-}
-
-sub fileNameWithNumber($$)
-{
- my ($base, $number) = @_;
- return "$base$number" if ($number > 1);
- return $base;
-}
-
-sub processIgnoreTests($$)
-{
- my @ignoreList = split(/\s*,\s*/, shift);
- my $listName = shift;
-
- my $disabledSuffix = "-disabled";
-
- my $addIgnoredDirectories = sub {
- return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
- $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)} = 1;
- return @_;
- };
- foreach my $item (@ignoreList) {
- my $path = catfile($testDirectory, $item);
- if (-d $path) {
- $ignoredDirectories{$item} = 1;
- find({ preprocess => $addIgnoredDirectories, wanted => sub {} }, $path);
- }
- elsif (-f $path) {
- $ignoredFiles{$item} = 1;
- } elsif (-f $path . $disabledSuffix) {
- # The test is disabled, so do nothing.
- } else {
- print "$listName list contained '$item', but no file of that name could be found\n";
- }
- }
-}
-
-sub stripExtension($)
-{
- my ($test) = @_;
-
- $test =~ s/\.[a-zA-Z]+$//;
- return $test;
-}
-
-sub isTextOnlyTest($)
-{
- my ($actual) = @_;
- my $isText;
- if ($actual =~ /^layer at/ms) {
- $isText = 0;
- } else {
- $isText = 1;
- }
- return $isText;
-}
-
-sub expectedDirectoryForTest($;$;$)
-{
- my ($base, $isText, $expectedExtension) = @_;
-
- my @directories = @platformResultHierarchy;
- push @directories, map { catdir($platformBaseDirectory, $_) } qw(mac-snowleopard mac) if isCygwin();
- push @directories, $expectedDirectory;
-
- # If we already have expected results, just return their location.
- foreach my $directory (@directories) {
- return $directory if (-f "$directory/$base-$expectedTag.$expectedExtension");
- }
-
- # For cross-platform tests, text-only results should go in the cross-platform directory,
- # while render tree dumps should go in the least-specific platform directory.
- return $isText ? $expectedDirectory : $platformResultHierarchy[$#platformResultHierarchy];
-}
-
-sub countFinishedTest($$$$)
-{
- my ($test, $base, $result, $isText) = @_;
-
- if (($count + 1) % $testsPerDumpTool == 0 || $count == $#tests) {
- if ($shouldCheckLeaks) {
- my $fileName;
- if ($testsPerDumpTool == 1) {
- $fileName = "$testResultsDirectory/$base-leaks.txt";
- } else {
- $fileName = "$testResultsDirectory/" . fileNameWithNumber($dumpToolName, $leaksOutputFileNumber) . "-leaks.txt";
- }
- my $leakCount = countAndPrintLeaks($dumpToolName, $dumpToolPID, $fileName);
- $totalLeaks += $leakCount;
- $leaksOutputFileNumber++ if ($leakCount);
- }
-
- closeDumpTool();
- }
-
- $count++;
- $counts{$result}++;
- push @{$tests{$result}}, $test;
-}
-
-sub testCrashedOrTimedOut($$$$$)
-{
- my ($test, $base, $didCrash, $actual, $error) = @_;
-
- printFailureMessageForTest($test, $didCrash ? "crashed" : "timed out");
-
- sampleDumpTool() unless $didCrash;
-
- my $dir = "$testResultsDirectory/$base";
- $dir =~ s|/([^/]+)$|| or die "Failed to find test name from base\n";
- mkpath $dir;
-
- deleteExpectedAndActualResults($base);
-
- if (defined($error) && length($error)) {
- writeToFile("$testResultsDirectory/$base-$errorTag.txt", $error);
- }
-
- recordActualResultsAndDiff($base, $actual);
-
- kill 9, $dumpToolPID unless $didCrash;
-
- closeDumpTool();
-}
-
-sub printFailureMessageForTest($$)
-{
- my ($test, $description) = @_;
-
- unless ($verbose) {
- print "\n" unless $atLineStart;
- print "$test -> ";
- }
- print "$description\n";
- $atLineStart = 1;
-}
-
-my %cygpaths = ();
-
-sub openCygpathIfNeeded($)
-{
- my ($options) = @_;
-
- return unless isCygwin();
- return $cygpaths{$options} if $cygpaths{$options} && $cygpaths{$options}->{"open"};
-
- local (*CYGPATHIN, *CYGPATHOUT);
- my $pid = open2(\*CYGPATHIN, \*CYGPATHOUT, "cygpath -f - $options");
- my $cygpath = {
- "pid" => $pid,
- "in" => *CYGPATHIN,
- "out" => *CYGPATHOUT,
- "open" => 1
- };
-
- $cygpaths{$options} = $cygpath;
-
- return $cygpath;
-}
-
-sub closeCygpaths()
-{
- return unless isCygwin();
-
- foreach my $cygpath (values(%cygpaths)) {
- close $cygpath->{"in"};
- close $cygpath->{"out"};
- waitpid($cygpath->{"pid"}, 0);
- $cygpath->{"open"} = 0;
-
- }
-}
-
-sub convertPathUsingCygpath($$)
-{
- my ($path, $options) = @_;
-
- my $cygpath = openCygpathIfNeeded($options);
- local *inFH = $cygpath->{"in"};
- local *outFH = $cygpath->{"out"};
- print outFH $path . "\n";
- my $convertedPath = <inFH>;
- chomp($convertedPath) if defined $convertedPath;
- return $convertedPath;
-}
-
-sub toWindowsPath($)
-{
- my ($path) = @_;
- return unless isCygwin();
-
- return convertPathUsingCygpath($path, "-w");
-}
-
-sub toURL($)
-{
- my ($path) = @_;
-
- if ($useRemoteLinksToTests) {
- my $relativePath = File::Spec->abs2rel($path, $testDirectory);
-
- # If the file is below the test directory then convert it into a link to the file in SVN
- if ($relativePath !~ /^\.\.\//) {
- my $revision = svnRevisionForDirectory($testDirectory);
- my $svnPath = pathRelativeToSVNRepositoryRootForPath($path);
- return "http://trac.webkit.org/export/$revision/$svnPath";
- }
- }
-
- return $path unless isCygwin();
-
- return "file:///" . convertPathUsingCygpath($path, "-m");
-}
-
-sub validateSkippedArg($$;$)
-{
- my ($option, $value, $value2) = @_;
- my %validSkippedValues = map { $_ => 1 } qw(default ignore only);
- $value = lc($value);
- die "Invalid argument '" . $value . "' for option $option" unless $validSkippedValues{$value};
- $treatSkipped = $value;
-}
-
-sub htmlForResultsSection(\@$&)
-{
- my ($tests, $description, $linkGetter) = @_;
-
- my @html = ();
- return join("\n", @html) unless @{$tests};
-
- push @html, "<p>$description:</p>";
- push @html, "<table>";
- foreach my $test (@{$tests}) {
- push @html, "<tr>";
- push @html, "<td><a href=\"" . toURL("$testDirectory/$test") . "\">$test</a></td>";
- foreach my $link (@{&{$linkGetter}($test)}) {
- push @html, "<td><a href=\"$link->{href}\">$link->{text}</a></td>";
- }
- push @html, "</tr>";
- }
- push @html, "</table>";
-
- return join("\n", @html);
-}
-
-sub linksForExpectedAndActualResults($)
-{
- my ($base) = @_;
-
- my @links = ();
-
- return \@links unless -s "$testResultsDirectory/$base-$diffsTag.txt";
-
- my $expectedResultPath = $expectedResultPaths{$base};
- my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
-
- push @links, { href => "$base-$expectedTag$expectedResultExtension", text => "expected" };
- push @links, { href => "$base-$actualTag$expectedResultExtension", text => "actual" };
- push @links, { href => "$base-$diffsTag.txt", text => "diff" };
- push @links, { href => "$base-$prettyDiffTag.html", text => "pretty diff" };
-
- return \@links;
-}
-
-sub linksForMismatchTest
-{
- my ($test) = @_;
-
- my @links = ();
-
- my $base = stripExtension($test);
-
- push @links, @{linksForExpectedAndActualResults($base)};
- return \@links unless $pixelTests && $imagesPresent{$base};
-
- push @links, { href => "$base-$expectedTag.png", text => "expected image" };
- push @links, { href => "$base-$diffsTag.html", text => "image diffs" };
- push @links, { href => "$base-$diffsTag.png", text => "$imageDifferences{$base}%" };
-
- return \@links;
-}
-
-sub linksForErrorTest
-{
- my ($test) = @_;
-
- my @links = ();
-
- my $base = stripExtension($test);
-
- push @links, @{linksForExpectedAndActualResults($base)};
- push @links, { href => "$base-$errorTag.txt", text => "stderr" };
-
- return \@links;
-}
-
-sub linksForNewTest
-{
- my ($test) = @_;
-
- my @links = ();
-
- my $base = stripExtension($test);
-
- my $expectedResultPath = $expectedResultPaths{$base};
- my ($expectedResultFileName, $expectedResultsDirectory, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
-
- push @links, { href => "$base-$actualTag$expectedResultExtension", text => "result" };
- if ($pixelTests && $imagesPresent{$base}) {
- push @links, { href => "$base-$expectedTag.png", text => "image" };
- }
-
- return \@links;
-}
-
-sub deleteExpectedAndActualResults($)
-{
- my ($base) = @_;
-
- unlink "$testResultsDirectory/$base-$actualTag.txt";
- unlink "$testResultsDirectory/$base-$diffsTag.txt";
- unlink "$testResultsDirectory/$base-$errorTag.txt";
-}
-
-sub recordActualResultsAndDiff($$)
-{
- my ($base, $actualResults) = @_;
-
- return unless defined($actualResults) && length($actualResults);
-
- my $expectedResultPath = $expectedResultPaths{$base};
- my ($expectedResultFileNameMinusExtension, $expectedResultDirectoryPath, $expectedResultExtension) = fileparse($expectedResultPath, qr{\.[^.]+$});
- my $actualResultsPath = "$testResultsDirectory/$base-$actualTag$expectedResultExtension";
- my $copiedExpectedResultsPath = "$testResultsDirectory/$base-$expectedTag$expectedResultExtension";
-
- mkpath(dirname($actualResultsPath));
- writeToFile("$actualResultsPath", $actualResults);
-
- if (-f $expectedResultPath) {
- copy("$expectedResultPath", "$copiedExpectedResultsPath");
- } else {
- open EMPTY, ">$copiedExpectedResultsPath";
- close EMPTY;
- }
-
- my $diffOuputBasePath = "$testResultsDirectory/$base";
- my $diffOutputPath = "$diffOuputBasePath-$diffsTag.txt";
- system "diff -u \"$copiedExpectedResultsPath\" \"$actualResultsPath\" > \"$diffOutputPath\"";
-
- my $prettyDiffOutputPath = "$diffOuputBasePath-$prettyDiffTag.html";
- my $prettyPatchPath = "BugsSite/PrettyPatch/";
- my $prettifyPath = "$prettyPatchPath/prettify.rb";
- system "ruby -I \"$prettyPatchPath\" \"$prettifyPath\" \"$diffOutputPath\" > \"$prettyDiffOutputPath\"";
-}
-
-sub buildPlatformResultHierarchy()
-{
- mkpath($platformTestDirectory) if ($platform eq "undefined" && !-d "$platformTestDirectory");
-
- my @platforms;
- if ($platform =~ /^mac-/) {
- my $i;
- for ($i = 0; $i < @macPlatforms; $i++) {
- last if $macPlatforms[$i] eq $platform;
- }
- for (; $i < @macPlatforms; $i++) {
- push @platforms, $macPlatforms[$i];
- }
- } elsif ($platform =~ /^qt-/) {
- push @platforms, $platform;
- push @platforms, "qt";
- } else {
- @platforms = $platform;
- }
-
- my @hierarchy;
- for (my $i = 0; $i < @platforms; $i++) {
- my $scoped = catdir($platformBaseDirectory, $platforms[$i]);
- push(@hierarchy, $scoped) if (-d $scoped);
- }
-
- return @hierarchy;
-}
-
-sub buildPlatformTestHierarchy(@)
-{
- my (@platformHierarchy) = @_;
- return @platformHierarchy if (@platformHierarchy < 2);
-
- return ($platformHierarchy[0], $platformHierarchy[$#platformHierarchy]);
-}
-
-sub epiloguesAndPrologues($$)
-{
- my ($lastDirectory, $directory) = @_;
- my @lastComponents = split('/', $lastDirectory);
- my @components = split('/', $directory);
-
- while (@lastComponents) {
- if (!defined($components[0]) || $lastComponents[0] ne $components[0]) {
- last;
- }
- shift @components;
- shift @lastComponents;
- }
-
- my @result;
- my $leaving = $lastDirectory;
- foreach (@lastComponents) {
- my $epilogue = $leaving . "/resources/run-webkit-tests-epilogue.html";
- foreach (@platformResultHierarchy) {
- push @result, catdir($_, $epilogue) if (stat(catdir($_, $epilogue)));
- }
- push @result, catdir($testDirectory, $epilogue) if (stat(catdir($testDirectory, $epilogue)));
- $leaving =~ s|(^\|/)[^/]+$||;
- }
-
- my $entering = $leaving;
- foreach (@components) {
- $entering .= '/' . $_;
- my $prologue = $entering . "/resources/run-webkit-tests-prologue.html";
- push @result, catdir($testDirectory, $prologue) if (stat(catdir($testDirectory, $prologue)));
- foreach (reverse @platformResultHierarchy) {
- push @result, catdir($_, $prologue) if (stat(catdir($_, $prologue)));
- }
- }
- return @result;
-}
-
-sub parseLeaksandPrintUniqueLeaks()
-{
- return unless @leaksFilenames;
-
- my $mergedFilenames = join " ", @leaksFilenames;
- my $parseMallocHistoryTool = sourceDir() . "/WebKitTools/Scripts/parse-malloc-history";
-
- open MERGED_LEAKS, "cat $mergedFilenames | $parseMallocHistoryTool --merge-depth $mergeDepth - |" ;
- my @leakLines = <MERGED_LEAKS>;
- close MERGED_LEAKS;
-
- my $uniqueLeakCount = 0;
- my $totalBytes;
- foreach my $line (@leakLines) {
- ++$uniqueLeakCount if ($line =~ /^(\d*)\scalls/);
- $totalBytes = $1 if $line =~ /^total\:\s(.*)\s\(/;
- }
-
- print "\nWARNING: $totalLeaks total leaks found for a total of $totalBytes!\n";
- print "WARNING: $uniqueLeakCount unique leaks found!\n";
- print "See above for individual leaks results.\n" if ($leaksOutputFileNumber > 2);
-
-}
-
-sub extensionForMimeType($)
-{
- my ($mimeType) = @_;
-
- if ($mimeType eq "application/x-webarchive") {
- return "webarchive";
- } elsif ($mimeType eq "application/pdf") {
- return "pdf";
- }
- return "txt";
-}
-
-# Read up to the first #EOF (the content block of the test), or until detecting crashes or timeouts.
-sub readFromDumpToolWithTimer(**)
-{
- my ($fhIn, $fhError) = @_;
-
- setFileHandleNonBlocking($fhIn, 1);
- setFileHandleNonBlocking($fhError, 1);
-
- my $maximumSecondsWithoutOutput = $timeoutSeconds;
- $maximumSecondsWithoutOutput *= 10 if $guardMalloc;
- my $microsecondsToWaitBeforeReadingAgain = 1000;
-
- my $timeOfLastSuccessfulRead = time;
-
- my @output = ();
- my @error = ();
- my $status = "success";
- my $mimeType = "text/plain";
- # We don't have a very good way to know when the "headers" stop
- # and the content starts, so we use this as a hack:
- my $haveSeenContentType = 0;
- my $haveSeenEofIn = 0;
- my $haveSeenEofError = 0;
-
- while (1) {
- if (time - $timeOfLastSuccessfulRead > $maximumSecondsWithoutOutput) {
- $status = dumpToolDidCrash() ? "crashed" : "timedOut";
- last;
- }
-
- # Once we've seen the EOF, we must not read anymore.
- my $lineIn = readline($fhIn) unless $haveSeenEofIn;
- my $lineError = readline($fhError) unless $haveSeenEofError;
- if (!defined($lineIn) && !defined($lineError)) {
- last if ($haveSeenEofIn && $haveSeenEofError);
-
- if ($! != EAGAIN) {
- $status = "crashed";
- last;
- }
-
- # No data ready
- usleep($microsecondsToWaitBeforeReadingAgain);
- next;
- }
-
- $timeOfLastSuccessfulRead = time;
-
- if (defined($lineIn)) {
- if (!$haveSeenContentType && $lineIn =~ /^Content-Type: (\S+)$/) {
- $mimeType = $1;
- $haveSeenContentType = 1;
- } elsif ($lineIn =~ /#EOF/) {
- $haveSeenEofIn = 1;
- } else {
- push @output, $lineIn;
- }
- }
- if (defined($lineError)) {
- if ($lineError =~ /#EOF/) {
- $haveSeenEofError = 1;
- } else {
- push @error, $lineError;
- }
- }
- }
-
- setFileHandleNonBlocking($fhIn, 0);
- setFileHandleNonBlocking($fhError, 0);
- return {
- output => join("", @output),
- error => join("", @error),
- status => $status,
- mimeType => $mimeType,
- extension => extensionForMimeType($mimeType)
- };
-}
-
-sub setFileHandleNonBlocking(*$)
-{
- my ($fh, $nonBlocking) = @_;
-
- my $flags = fcntl($fh, F_GETFL, 0) or die "Couldn't get filehandle flags";
-
- if ($nonBlocking) {
- $flags |= O_NONBLOCK;
- } else {
- $flags &= ~O_NONBLOCK;
- }
-
- fcntl($fh, F_SETFL, $flags) or die "Couldn't set filehandle flags";
-
- return 1;
-}
-
-sub sampleDumpTool()
-{
- return unless isAppleMacWebKit();
- return unless $runSample;
-
- my $outputDirectory = "$ENV{HOME}/Library/Logs/DumpRenderTree";
- -d $outputDirectory or mkdir $outputDirectory;
-
- my $outputFile = "$outputDirectory/HangReport.txt";
- system "/usr/bin/sample", $dumpToolPID, qw(10 10 -file), $outputFile;
-}
-
-sub stripMetrics($$)
-{
- my ($actual, $expected) = @_;
-
- foreach my $result ($actual, $expected) {
- $result =~ s/at \(-?[0-9]+,-?[0-9]+\) *//g;
- $result =~ s/size -?[0-9]+x-?[0-9]+ *//g;
- $result =~ s/text run width -?[0-9]+: //g;
- $result =~ s/text run width -?[0-9]+ [a-zA-Z ]+: //g;
- $result =~ s/RenderButton {BUTTON} .*/RenderButton {BUTTON}/g;
- $result =~ s/RenderImage {INPUT} .*/RenderImage {INPUT}/g;
- $result =~ s/RenderBlock {INPUT} .*/RenderBlock {INPUT}/g;
- $result =~ s/RenderTextControl {INPUT} .*/RenderTextControl {INPUT}/g;
- $result =~ s/\([0-9]+px/px/g;
- $result =~ s/ *" *\n +" */ /g;
- $result =~ s/" +$/"/g;
-
- $result =~ s/- /-/g;
- $result =~ s/\n( *)"\s+/\n$1"/g;
- $result =~ s/\s+"\n/"\n/g;
- $result =~ s/scrollWidth [0-9]+/scrollWidth/g;
- $result =~ s/scrollHeight [0-9]+/scrollHeight/g;
- }
-
- return ($actual, $expected);
-}
-
-sub fileShouldBeIgnored
-{
- my ($filePath) = @_;
- foreach my $ignoredDir (keys %ignoredDirectories) {
- if ($filePath =~ m/^$ignoredDir/) {
- return 1;
- }
- }
+ # Change this check to control which platforms use
+ # new-run-webkit-tests by default.
+ # Example: return runningOnBuildBot() && isLeopard();
+ # would enable new-run-webkit-tests on only the leopard buildbots.
return 0;
}
-sub readSkippedFiles($)
-{
- my ($constraintPath) = @_;
-
- foreach my $level (@platformTestHierarchy) {
- if (open SKIPPED, "<", "$level/Skipped") {
- if ($verbose) {
- my ($dir, $name) = splitpath($level);
- print "Skipped tests in $name:\n";
- }
-
- while (<SKIPPED>) {
- my $skipped = $_;
- chomp $skipped;
- $skipped =~ s/^[ \n\r]+//;
- $skipped =~ s/[ \n\r]+$//;
- if ($skipped && $skipped !~ /^#/) {
- if ($skippedOnly) {
- if (!fileShouldBeIgnored($skipped)) {
- if (!$constraintPath) {
- # Always add $skipped since no constraint path was specified on the command line.
- push(@ARGV, $skipped);
- } elsif ($skipped =~ /^($constraintPath)/) {
- # Add $skipped only if it matches the current path constraint, e.g.,
- # "--skipped=only dir1" with "dir1/file1.html" on the skipped list.
- push(@ARGV, $skipped);
- } elsif ($constraintPath =~ /^($skipped)/) {
- # Add current path constraint if it is more specific than the skip list entry,
- # e.g., "--skipped=only dir1/dir2/dir3" with "dir1" on the skipped list.
- push(@ARGV, $constraintPath);
- }
- } elsif ($verbose) {
- print " $skipped\n";
- }
- } else {
- if ($verbose) {
- print " $skipped\n";
- }
- processIgnoreTests($skipped, "Skipped");
- }
- }
- }
- close SKIPPED;
- }
- }
-}
-
-my @testsToRun;
-
-sub directoryFilter
-{
- return () if exists $ignoredLocalDirectories{basename($File::Find::dir)};
- return () if exists $ignoredDirectories{File::Spec->abs2rel($File::Find::dir, $testDirectory)};
- return @_;
-}
-
-sub fileFilter
-{
- my $filename = $_;
- if ($filename =~ /\.([^.]+)$/) {
- if (exists $supportedFileExtensions{$1}) {
- my $path = File::Spec->abs2rel(catfile($File::Find::dir, $filename), $testDirectory);
- push @testsToRun, $path if !exists $ignoredFiles{$path};
- }
- }
-}
-
-sub findTestsToRun
-{
- @testsToRun = ();
-
- for my $test (@ARGV) {
- $test =~ s/^($layoutTestsName|$testDirectory)\///;
- my $fullPath = catfile($testDirectory, $test);
- if (file_name_is_absolute($test)) {
- print "can't run test $test outside $testDirectory\n";
- } elsif (-f $fullPath) {
- my ($filename, $pathname, $fileExtension) = fileparse($test, qr{\.[^.]+$});
- if (!exists $supportedFileExtensions{substr($fileExtension, 1)}) {
- print "test $test does not have a supported extension\n";
- } elsif ($testHTTP || $pathname !~ /^http\//) {
- push @testsToRun, $test;
- }
- } elsif (-d $fullPath) {
- find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $fullPath);
- for my $level (@platformTestHierarchy) {
- my $platformPath = catfile($level, $test);
- find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $platformPath) if (-d $platformPath);
- }
- } else {
- print "test $test not found\n";
- }
- }
-
- if (!scalar @ARGV) {
- find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $testDirectory);
- for my $level (@platformTestHierarchy) {
- find({ preprocess => \&directoryFilter, wanted => \&fileFilter }, $level);
- }
- }
-
- # Remove duplicate tests
- @testsToRun = keys %{{ map { $_ => 1 } @testsToRun }};
+my $harnessName = "old-run-webkit-tests";
- @testsToRun = sort pathcmp @testsToRun;
-
- # We need to minimize the time when Apache and WebSocketServer is locked by tests
- # so run them last if no explicit order was specified in the argument list.
- if (!scalar @ARGV) {
- my @httpTests;
- my @websocketTests;
- my @otherTests;
- foreach my $test (@testsToRun) {
- if ($test =~ /^http\//) {
- push(@httpTests, $test);
- } elsif ($test =~ /^websocket\//) {
- push(@websocketTests, $test);
- } else {
- push(@otherTests, $test);
- }
- }
- @testsToRun = (@otherTests, @httpTests, @websocketTests);
+if (useNewRunWebKitTests()) {
+ $harnessName = "new-run-webkit-tests";
+ if (runningOnBuildBot()) {
+ push(@ARGV, "--verbose");
+ # old-run-webkit-tests treats --results-directory as $CWD relative.
+ # new-run-webkit-tests treats --results-directory as build directory relative.
+ # Override the passed in --results-directory by appending a new one
+ # (later arguments override earlier ones in Python's optparse).
+ push(@ARGV, "--results-directory");
+ # The buildbot always uses $SRCDIR/layout-test-results, hardcode it:
+ push(@ARGV, sourceDir() . "/layout-test-results");
}
-
- # Reverse the tests
- @testsToRun = reverse @testsToRun if $reverseTests;
-
- # Shuffle the array
- @testsToRun = shuffle(@testsToRun) if $randomizeTests;
-
- return @testsToRun;
}
-sub printResults
-{
- my %text = (
- match => "succeeded",
- mismatch => "had incorrect layout",
- new => "were new",
- timedout => "timed out",
- crash => "crashed",
- error => "had stderr output"
- );
-
- for my $type ("match", "mismatch", "new", "timedout", "crash", "error") {
- my $typeCount = $counts{$type};
- next unless $typeCount;
- my $typeText = $text{$type};
- my $message;
- if ($typeCount == 1) {
- $typeText =~ s/were/was/;
- $message = sprintf "1 test case (%d%%) %s\n", 1 * 100 / $count, $typeText;
- } else {
- $message = sprintf "%d test cases (%d%%) %s\n", $typeCount, $typeCount * 100 / $count, $typeText;
- }
- $message =~ s-\(0%\)-(<1%)-;
- print $message;
- }
-}
+my $harnessPath = File::Spec->catfile(relativeScriptsDir(), $harnessName);
+exec $harnessPath ($harnessPath, @ARGV) or die "Failed to execute $harnessPath";
diff --git a/WebKitTools/Scripts/run-webkit-websocketserver b/WebKitTools/Scripts/run-webkit-websocketserver
index 64a724d..08d430b 100755
--- a/WebKitTools/Scripts/run-webkit-websocketserver
+++ b/WebKitTools/Scripts/run-webkit-websocketserver
@@ -47,7 +47,7 @@ my $webSocketPort = 8880;
my $srcDir = sourceDir();
my $layoutTestsName = "$srcDir/LayoutTests";
my $testDirectory = File::Spec->rel2abs($layoutTestsName);
-my $webSocketServerPID = 0;
+my $webSocketServerPidFile = "$testDirectory/websocket.pid";
print "Starting Web Socket server...\n";
@@ -60,40 +60,29 @@ closeWebSocketServer();
print "Stopped.\n";
exit 0;
-
sub openWebSocketServer()
{
- my $webSocketServerPath = "/usr/bin/python";
- my $webSocketPythonPath = "$srcDir/WebKitTools/pywebsocket";
my $webSocketHandlerDir = "$testDirectory";
- my $webSocketHandlerScanDir = "$testDirectory/websocket/tests";
- my $webSocketHandlerMapFile = "$webSocketHandlerScanDir/handler_map.txt";
my @args = (
- "$srcDir/WebKitTools/pywebsocket/mod_pywebsocket/standalone.py",
- "-p", "$webSocketPort",
- "-d", "$webSocketHandlerDir",
- "-s", "$webSocketHandlerScanDir",
- "-m", "$webSocketHandlerMapFile",
- "-x", "/websocket/tests/cookies",
+ "$srcDir/WebKitTools/Scripts/new-run-webkit-websocketserver",
+ "--server", "start",
+ "--port", "$webSocketPort",
+ "--root", "$webSocketHandlerDir",
+ "--pidfile", "$webSocketServerPidFile"
);
-
- $ENV{"PYTHONPATH"} = $webSocketPythonPath;
- $webSocketServerPID = open2(\*WEBSOCKETSERVER_IN, \*WEBSOCKETSERVER_OUT, $webSocketServerPath, @args);
-
- my $listen = "http://127.0.0.1:$webSocketPort";
- my $retryCount = 10;
- while (system("/usr/bin/curl -k -q --silent --stderr - --output /dev/null $listen") && $retryCount) {
- sleep 1;
- --$retryCount;
- }
- die "Timed out waiting for WebSocketServer to start" unless $retryCount;
+ system "/usr/bin/python", @args;
}
sub closeWebSocketServer()
{
- close WEBSOCKETSERVER_IN;
- close WEBSOCKETSERVER_OUT;
- kill 15, $webSocketServerPID;
+ my @args = (
+ "$srcDir/WebKitTools/Scripts/new-run-webkit-websocketserver",
+ "--server", "stop",
+ "--pidfile", "$webSocketServerPidFile"
+ );
+ system "/usr/bin/python", @args;
+ unlink "$webSocketServerPidFile";
}
+
diff --git a/WebKitTools/Scripts/sort-Xcode-project-file b/WebKitTools/Scripts/sort-Xcode-project-file
index 044186f..705b41d 100755
--- a/WebKitTools/Scripts/sort-Xcode-project-file
+++ b/WebKitTools/Scripts/sort-Xcode-project-file
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+# Copyright (C) 2007, 2008, 2009, 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
@@ -31,6 +31,7 @@
use strict;
use File::Basename;
+use File::Spec;
use File::Temp qw(tempfile);
use Getopt::Long;
@@ -54,7 +55,7 @@ my $getOptionsResult = GetOptions(
'w|warnings!' => \$printWarnings,
);
-if (scalar(@ARGV) == 0) {
+if (scalar(@ARGV) == 0 && !$showHelp) {
print STDERR "ERROR: No Xcode project files (project.pbxproj) listed on command-line.\n";
undef $getOptionsResult;
}
@@ -69,6 +70,10 @@ __END__
}
for my $projectFile (@ARGV) {
+ if (basename($projectFile) =~ /\.xcodeproj$/) {
+ $projectFile = File::Spec->catfile($projectFile, "project.pbxproj");
+ }
+
if (basename($projectFile) ne "project.pbxproj") {
print STDERR "WARNING: Not an Xcode project file: $projectFile\n" if $printWarnings;
next;
diff --git a/WebKitTools/Scripts/sunspider-compare-results b/WebKitTools/Scripts/sunspider-compare-results
index 3446cd8..193ee8f 100755
--- a/WebKitTools/Scripts/sunspider-compare-results
+++ b/WebKitTools/Scripts/sunspider-compare-results
@@ -55,7 +55,7 @@ Usage: $programName [options] FILE FILE
--parse-only Use the parse-only benchmark suite. Same as --suite=parse-only
EOF
-GetOptions('root=s' => sub { my ($argName, $value); setConfigurationProductDir(Cwd::abs_path($value)); },
+GetOptions('root=s' => sub { my ($argName, $value) = @_; setConfigurationProductDir(Cwd::abs_path($value)); $root = $value; },
'suite=s' => \$suite,
'ubench' => \$ubench,
'v8' => \$v8,
diff --git a/WebKitTools/Scripts/svn-apply b/WebKitTools/Scripts/svn-apply
index f586211..cab7fb4 100755
--- a/WebKitTools/Scripts/svn-apply
+++ b/WebKitTools/Scripts/svn-apply
@@ -42,8 +42,7 @@
# Paths from Index: lines are used rather than the paths on the patch lines, which
# makes patches generated by "cvs diff" work (increasingly unimportant since we
# use Subversion now).
-# ChangeLog patches use --fuzz=3 to prevent rejects, and the entry date is set in
-# the patch to today's date using $changeLogTimeZone.
+# ChangeLog patches use --fuzz=3 to prevent rejects.
# Handles binary files (requires patches made by svn-create-patch).
# Handles copied and moved files (requires patches made by svn-create-patch).
# Handles git-diff patches (without binary changes) created at the top-level directory
@@ -80,7 +79,6 @@ sub handleGitBinaryChange($$);
sub isDirectoryEmptyForRemoval($);
sub patch($);
sub removeDirectoriesIfNeeded();
-sub setChangeLogDateAndReviewer($$);
# These should be replaced by an scm class/module:
sub scmKnowsOfFile($);
@@ -88,10 +86,6 @@ sub scmCopy($$);
sub scmAdd($);
sub scmRemove($);
-
-# Project time zone for Cupertino, CA, US
-my $changeLogTimeZone = "PST8PDT";
-
my $merge = 0;
my $showHelp = 0;
my $reviewer;
@@ -117,78 +111,47 @@ my %removeDirectoryIgnoreList = (
'_svn' => 1,
);
+my $epochTime = time(); # This is used to set the date in ChangeLog files.
my $globalExitStatus = 0;
my $repositoryRootPath = determineVCSRoot();
my %checkedDirectories;
-my %copiedFiles;
-my @patches;
-my %versions;
-
-my $copiedFromPath;
-my $filter;
-my $indexPath;
-my $patch;
-while (<>) {
- s/([\n\r]+)$//mg;
- my $eol = $1;
- if (!defined($indexPath) && m#^diff --git \w/#) {
- $filter = \&gitdiff2svndiff;
- }
- $_ = &$filter($_) if $filter;
- if (/^Index: (.+)/) {
- $indexPath = $1;
- if ($patch) {
- if (!$copiedFromPath) {
- push @patches, $patch;
- }
- $copiedFromPath = "";
- $patch = "";
- }
- }
- if ($indexPath) {
- # Fix paths on diff, ---, and +++ lines to match preceding Index: line.
- s/\S+$/$indexPath/ if /^diff/;
- s/^--- \S+/--- $indexPath/;
- if (/^--- .+\(from (\S+):(\d+)\)$/) {
- $copiedFromPath = $1;
- $copiedFiles{$indexPath} = $copiedFromPath;
- $versions{$copiedFromPath} = $2 if ($2 != 0);
- }
- elsif (/^--- .+\(revision (\d+)\)$/) {
- $versions{$indexPath} = $1 if ($1 != 0);
- }
- if (s/^\+\+\+ \S+/+++ $indexPath/) {
- $indexPath = "";
- }
- }
- $patch .= $_;
- $patch .= $eol;
-}
-if ($patch && !$copiedFromPath) {
- push @patches, $patch;
-}
+# Need to use a typeglob to pass the file handle as a parameter,
+# otherwise get a bareword error.
+my @diffHashRefs = parsePatch(*ARGV);
+
+print "Parsed " . @diffHashRefs . " diffs from patch file(s).\n";
+
+my $preparedPatchHash = prepareParsedPatch($force, @diffHashRefs);
+
+my @copyDiffHashRefs = @{$preparedPatchHash->{copyDiffHashRefs}};
+my @nonCopyDiffHashRefs = @{$preparedPatchHash->{nonCopyDiffHashRefs}};
+my %sourceRevisions = %{$preparedPatchHash->{sourceRevisionHash}};
if ($merge) {
die "--merge is currently only supported for SVN" unless isSVN();
# How do we handle Git patches applied to an SVN checkout here?
- for my $file (sort keys %versions) {
- my $version = $versions{$file};
+ for my $file (sort keys %sourceRevisions) {
+ my $version = $sourceRevisions{$file};
print "Getting version $version of $file\n";
system("svn", "update", "-r", $version, $file) == 0 or die "Failed to run svn update -r $version $file.";
}
}
-# Handle copied and moved files first since moved files may have their source deleted before the move.
-for my $file (keys %copiedFiles) {
- addDirectoriesIfNeeded(dirname($file));
- scmCopy($copiedFiles{$file}, $file);
+# Handle copied and moved files first since moved files may have their
+# source deleted before the move.
+for my $copyDiffHashRef (@copyDiffHashRefs) {
+ my $indexPath = $copyDiffHashRef->{indexPath};
+ my $copiedFromPath = $copyDiffHashRef->{copiedFromPath};
+
+ addDirectoriesIfNeeded(dirname($indexPath));
+ scmCopy($copiedFromPath, $indexPath);
}
-for $patch (@patches) {
- patch($patch);
+for my $diffHashRef (@nonCopyDiffHashRefs) {
+ patch($diffHashRef);
}
removeDirectoriesIfNeeded();
@@ -276,14 +239,16 @@ sub handleBinaryChange($$)
sub handleGitBinaryChange($$)
{
- my ($fullPath, $contents) = @_;
+ my ($fullPath, $diffHashRef) = @_;
+
+ my $contents = $diffHashRef->{svnConvertedText};
my ($binaryChunkType, $binaryChunk, $reverseBinaryChunkType, $reverseBinaryChunk) = decodeGitBinaryPatch($contents, $fullPath);
# FIXME: support "delta" type.
die "only literal type is supported now" if ($binaryChunkType ne "literal" || $reverseBinaryChunkType ne "literal");
- my $isFileAddition = $contents =~ /\nnew file mode \d+\n/;
- my $isFileDeletion = $contents =~ /\ndeleted file mode \d+\n/;
+ my $isFileAddition = $diffHashRef->{isNew};
+ my $isFileDeletion = $diffHashRef->{isDeletion};
my $originalContents = "";
if (open FILE, $fullPath) {
@@ -310,11 +275,12 @@ sub handleGitBinaryChange($$)
sub isDirectoryEmptyForRemoval($)
{
my ($dir) = @_;
+ return 1 unless -d $dir;
my $directoryIsEmpty = 1;
opendir DIR, $dir or die "Could not open '$dir' to list files: $?";
for (my $item = readdir DIR; $item && $directoryIsEmpty; $item = readdir DIR) {
next if exists $removeDirectoryIgnoreList{$item};
- if (! -d File::Spec->catdir($dir, $item)) {
+ if (-d File::Spec->catdir($dir, $item)) {
$directoryIsEmpty = 0;
} else {
next if (scmWillDeleteFile(File::Spec->catdir($dir, $item)));
@@ -325,37 +291,37 @@ sub isDirectoryEmptyForRemoval($)
return $directoryIsEmpty;
}
+# Args:
+# $diffHashRef: a diff hash reference of the type returned by parsePatch().
sub patch($)
{
- my ($patch) = @_;
- return if !$patch;
-
- unless ($patch =~ m|^Index: ([^\r\n]+)|) {
- my $separator = '-' x 67;
- warn "Failed to find 'Index:' in:\n$separator\n$patch\n$separator\n";
- die unless $force;
- return;
- }
- my $fullPath = $1;
+ my ($diffHashRef) = @_;
+
+ # Make sure $patch is initialized to some value. A deletion can have no
+ # svnConvertedText property in the case of a deletion resulting from a
+ # Git rename.
+ my $patch = $diffHashRef->{svnConvertedText} || "";
+
+ my $fullPath = $diffHashRef->{indexPath};
+ my $isBinary = $diffHashRef->{isBinary};
+ my $isGit = $diffHashRef->{isGit};
my $deletion = 0;
my $addition = 0;
- my $isBinary = 0;
- my $isGitBinary = 0;
- $addition = 1 if ($patch =~ /\n--- .+\(revision 0\)\r?\n/ || $patch =~ /\n@@ -0,0 .* @@/) && !exists($copiedFiles{$fullPath});
- $deletion = 1 if $patch =~ /\n@@ .* \+0,0 @@/;
- $isBinary = 1 if $patch =~ /\nCannot display: file marked as a binary type\./;
- $isGitBinary = 1 if $patch =~ /\nGIT binary patch\n/;
+ $addition = 1 if ($diffHashRef->{isNew} || $patch =~ /\n@@ -0,0 .* @@/);
+ $deletion = 1 if ($diffHashRef->{isDeletion} || $patch =~ /\n@@ .* \+0,0 @@/);
- if (!$addition && !$deletion && !$isBinary && !$isGitBinary) {
+ if (!$addition && !$deletion && !$isBinary) {
# Standard patch, patch tool can handle this.
if (basename($fullPath) eq "ChangeLog") {
my $changeLogDotOrigExisted = -f "${fullPath}.orig";
- applyPatch(setChangeLogDateAndReviewer(fixChangeLogPatch($patch), $reviewer), $fullPath, ["--fuzz=3"]);
+ my $changeLogHash = fixChangeLogPatch($patch);
+ my $newPatch = setChangeLogDateAndReviewer($changeLogHash->{patch}, $reviewer, $epochTime);
+ applyPatch($newPatch, $fullPath, ["--fuzz=3"]);
unlink("${fullPath}.orig") if (! $changeLogDotOrigExisted);
} else {
- applyPatch($patch, $fullPath);
+ applyPatch($patch, $fullPath) if $patch;
}
} else {
# Either a deletion, an addition or a binary change.
@@ -363,25 +329,26 @@ sub patch($)
addDirectoriesIfNeeded(dirname($fullPath));
if ($isBinary) {
- # Binary change
- handleBinaryChange($fullPath, $patch);
- } elsif ($isGitBinary) {
- # Git binary change
- handleGitBinaryChange($fullPath, $patch);
+ if ($isGit) {
+ handleGitBinaryChange($fullPath, $diffHashRef);
+ } else {
+ handleBinaryChange($fullPath, $patch) if $patch;
+ }
} elsif ($deletion) {
- # Deletion
- applyPatch($patch, $fullPath, ["--force"]);
+ applyPatch($patch, $fullPath, ["--force"]) if $patch;
scmRemove($fullPath);
} else {
# Addition
rename($fullPath, "$fullPath.orig") if -e $fullPath;
- applyPatch($patch, $fullPath);
+ applyPatch($patch, $fullPath) if $patch;
unlink("$fullPath.orig") if -e "$fullPath.orig" && checksum($fullPath) eq checksum("$fullPath.orig");
scmAdd($fullPath);
# What is this for?
system("svn", "stat", "$fullPath.orig") if isSVN() && -e "$fullPath.orig";
}
}
+
+ scmToggleExecutableBit($fullPath, $diffHashRef->{executableBitDelta}) if defined($diffHashRef->{executableBitDelta});
}
sub removeDirectoriesIfNeeded()
@@ -393,26 +360,6 @@ sub removeDirectoriesIfNeeded()
}
}
-sub setChangeLogDateAndReviewer($$)
-{
- my $patch = shift;
- my $reviewer = shift;
- my $savedTimeZone = $ENV{'TZ'};
- # Set TZ temporarily so that localtime() is in that time zone
- $ENV{'TZ'} = $changeLogTimeZone;
- my $newDate = strftime("%Y-%m-%d", localtime());
- if (defined $savedTimeZone) {
- $ENV{'TZ'} = $savedTimeZone;
- } else {
- delete $ENV{'TZ'};
- }
- $patch =~ s/(\n\+)\d{4}-[^-]{2}-[^-]{2}( )/$1$newDate$2/;
- if (defined($reviewer)) {
- $patch =~ s/NOBODY \(OOPS!\)/$reviewer/;
- }
- return $patch;
-}
-
# This could be made into a more general "status" call, except svn and git
# have different ideas about "moving" files which might get confusing.
sub scmWillDeleteFile($)
@@ -428,6 +375,22 @@ sub scmWillDeleteFile($)
return 0;
}
+# Return whether the file at the given path is known to Git.
+#
+# This method outputs a message like the following to STDERR when
+# returning false:
+#
+# "error: pathspec 'test.png' did not match any file(s) known to git.
+# Did you forget to 'git add'?"
+sub gitKnowsOfFile($)
+{
+ my $path = shift;
+
+ `git ls-files --error-unmatch -- $path`;
+ my $exitStatus = exitStatus($?);
+ return $exitStatus == 0;
+}
+
sub scmKnowsOfFile($)
{
my ($path) = @_;
@@ -440,9 +403,8 @@ sub scmKnowsOfFile($)
# This does not handle errors well.
return 1;
} elsif (isGit()) {
- `git ls-files --error-unmatch -- $path`;
- my $exitCode = $? >> 8;
- return $exitCode == 0;
+ my @result = callSilently(\&gitKnowsOfFile, $path);
+ return $result[0];
}
}
@@ -481,6 +443,12 @@ sub scmRemove($)
close SVN;
print $svnOutput if $svnOutput;
} elsif (isGit()) {
- system("git", "rm", "--force", $path) == 0 or die "Failed to git rm --force $path.";
+ # Git removes a directory if it becomes empty when the last file it contains is
+ # removed by `git rm`. In svn-apply this can happen when a directory is being
+ # removed in a patch, and all of the files inside of the directory are removed
+ # before attemping to remove the directory itself. In this case, Git will have
+ # already deleted the directory and `git rm` would exit with an error claiming
+ # there was no file. The --ignore-unmatch switch gracefully handles this case.
+ system("git", "rm", "--force", "--ignore-unmatch", $path) == 0 or die "Failed to git rm --force --ignore-unmatch $path.";
}
}
diff --git a/WebKitTools/Scripts/svn-create-patch b/WebKitTools/Scripts/svn-create-patch
index 768a8ed..863998d 100755
--- a/WebKitTools/Scripts/svn-create-patch
+++ b/WebKitTools/Scripts/svn-create-patch
@@ -56,12 +56,14 @@ use Time::gmtime;
use VCSUtils;
sub binarycmp($$);
+sub diffOptionsForFile($);
sub findBaseUrl($);
sub findMimeType($;$);
sub findModificationType($);
sub findSourceFileAndRevision($);
sub generateDiff($$);
sub generateFileList($\%);
+sub hunkHeaderLineRegExForFile($);
sub isBinaryMimeType($);
sub manufacturePatchForAdditionWithHistory($);
sub numericcmp($$);
@@ -99,9 +101,16 @@ for my $path (keys %paths) {
my $svnRoot = determineSVNRoot();
my $prefix = chdirReturningRelativePath($svnRoot);
+my $patchSize = 0;
+
# Generate the diffs, in a order chosen for easy reviewing.
for my $path (sort patchpathcmp values %diffFiles) {
- generateDiff($path, $prefix);
+ $patchSize += generateDiff($path, $prefix);
+}
+
+if ($patchSize > 20480) {
+ print STDERR "WARNING: Patch's size is " . int($patchSize/1024) . " kbytes.\n";
+ print STDERR "Patches 20k or smaller are more likely to be reviewed. Larger patches may sit unreviewed for a long time.\n";
}
exit 0;
@@ -130,6 +139,19 @@ sub binarycmp($$)
return $fileDataA->{isBinary} <=> $fileDataB->{isBinary};
}
+sub diffOptionsForFile($)
+{
+ my ($file) = @_;
+
+ my $options = "uaNp";
+
+ if (my $hunkHeaderLineRegEx = hunkHeaderLineRegExForFile($file)) {
+ $options .= "F'$hunkHeaderLineRegEx'";
+ }
+
+ return $options;
+}
+
sub findBaseUrl($)
{
my ($infoPath) = @_;
@@ -196,24 +218,30 @@ sub generateDiff($$)
my $file = File::Spec->catdir($prefix, $fileData->{path});
if ($ignoreChangelogs && basename($file) eq "ChangeLog") {
- return;
+ return 0;
}
- my $patch;
+ my $patch = "";
if ($fileData->{modificationType} eq "additionWithHistory") {
manufacturePatchForAdditionWithHistory($fileData);
}
- open DIFF, "svn diff --diff-cmd diff -x -uaNp '$file' |" or die;
+
+ my $diffOptions = diffOptionsForFile($file);
+ open DIFF, "svn diff --diff-cmd diff -x -$diffOptions '$file' |" or die;
while (<DIFF>) {
$patch .= $_;
}
close DIFF;
- $patch = fixChangeLogPatch($patch) if basename($file) eq "ChangeLog";
- print $patch if $patch;
+ if (basename($file) eq "ChangeLog") {
+ my $changeLogHash = fixChangeLogPatch($patch);
+ $patch = $changeLogHash->{patch};
+ }
+ print $patch;
if ($fileData->{isBinary}) {
print "\n" if ($patch && $patch =~ m/\n\S+$/m);
outputBinaryContent($file);
}
+ return length($patch);
}
sub generateFileList($\%)
@@ -252,6 +280,15 @@ sub generateFileList($\%)
close STAT;
}
+sub hunkHeaderLineRegExForFile($)
+{
+ my ($file) = @_;
+
+ my $startOfObjCInterfaceRegEx = "@(implementation\\|interface\\|protocol)";
+ return "^[-+]\\|$startOfObjCInterfaceRegEx" if $file =~ /\.mm?$/;
+ return "^$startOfObjCInterfaceRegEx" if $file =~ /^(.*\/)?(mac|objc)\// && $file =~ /\.h$/;
+}
+
sub isBinaryMimeType($)
{
my ($file) = @_;
diff --git a/WebKitTools/Scripts/svn-unapply b/WebKitTools/Scripts/svn-unapply
index eb20ca0..1dca11c 100755
--- a/WebKitTools/Scripts/svn-unapply
+++ b/WebKitTools/Scripts/svn-unapply
@@ -97,54 +97,24 @@ my $repositoryRootPath = determineVCSRoot();
my @copiedFiles;
my %directoriesToCheck;
-my $copiedFromPath;
-my $filter;
-my $indexPath;
-my $patch;
-while (<>) {
- s/([\n\r]+)$//mg;
- my $eol = $1;
- if (!defined($indexPath) && m#^diff --git \w/#) {
- $filter = \&gitdiff2svndiff;
- }
- $_ = &$filter($_) if $filter;
- if (/^Index: (.+)/) {
- $indexPath = $1;
- if ($patch) {
- if ($copiedFromPath) {
- push @copiedFiles, $patch;
- } else {
- patch($patch);
- }
- $copiedFromPath = "";
- $patch = "";
- }
- }
- if ($indexPath) {
- # Fix paths on diff, ---, and +++ lines to match preceding Index: line.
- s/^--- \S+/--- $indexPath/;
- if (/^--- .+\(from (\S+):\d+\)$/) {
- $copiedFromPath = $1;
- }
- if (s/^\+\+\+ \S+/+++ $indexPath/) {
- $indexPath = "";
- }
- }
- $patch .= $_;
- $patch .= $eol;
-}
+# Need to use a typeglob to pass the file handle as a parameter,
+# otherwise get a bareword error.
+my @diffHashRefs = parsePatch(*ARGV);
-if ($patch) {
- if ($copiedFromPath) {
- push @copiedFiles, $patch;
- } else {
- patch($patch);
- }
+print "Parsed " . @diffHashRefs . " diffs from patch file(s).\n";
+
+my $preparedPatchHash = prepareParsedPatch($force, @diffHashRefs);
+
+my @copyDiffHashRefs = @{$preparedPatchHash->{copyDiffHashRefs}};
+my @nonCopyDiffHashRefs = @{$preparedPatchHash->{nonCopyDiffHashRefs}};
+
+for my $diffHashRef (@nonCopyDiffHashRefs) {
+ patch($diffHashRef);
}
# Handle copied and moved files last since they may have had post-copy changes that have now been unapplied
-for $patch (@copiedFiles) {
- patch($patch);
+for my $diffHashRef (@copyDiffHashRefs) {
+ patch($diffHashRef);
}
if (isSVN()) {
@@ -163,32 +133,33 @@ sub checksum($)
return $checksum;
}
+# Args:
+# $diffHashRef: a diff hash reference of the type returned by parsePatch().
sub patch($)
{
- my ($patch) = @_;
- return if !$patch;
+ my ($diffHashRef) = @_;
+
+ # Make sure $patch is initialized to some value. There is no
+ # svnConvertedText when reversing an svn copy/move.
+ my $patch = $diffHashRef->{svnConvertedText} || "";
+
+ my $fullPath = $diffHashRef->{indexPath};
+ my $isSvnBinary = $diffHashRef->{isBinary} && $diffHashRef->{isSvn};
- unless ($patch =~ m|^Index: ([^\r\n]+)|) {
- my $separator = '-' x 67;
- warn "Failed to find 'Index:' in:\n$separator\n$patch\n$separator\n";
- return;
- }
- my $fullPath = $1;
$directoriesToCheck{dirname($fullPath)} = 1;
my $deletion = 0;
my $addition = 0;
- my $isBinary = 0;
- $addition = 1 if ($patch =~ /\n--- .+\(revision 0\)\n/ || $patch =~ /\n@@ -0,0 .* @@/);
- $deletion = 1 if $patch =~ /\n@@ .* \+0,0 @@/;
- $isBinary = 1 if $patch =~ /\nCannot display: file marked as a binary type\./;
+ $addition = 1 if ($diffHashRef->{isNew} || $diffHashRef->{copiedFromPath} || $patch =~ /\n@@ -0,0 .* @@/);
+ $deletion = 1 if ($diffHashRef->{isDeletion} || $patch =~ /\n@@ .* \+0,0 @@/);
- if (!$addition && !$deletion && !$isBinary) {
+ if (!$addition && !$deletion && !$isSvnBinary) {
# Standard patch, patch tool can handle this.
if (basename($fullPath) eq "ChangeLog") {
my $changeLogDotOrigExisted = -f "${fullPath}.orig";
- unapplyPatch(unsetChangeLogDate($fullPath, fixChangeLogPatch($patch)), $fullPath, ["--fuzz=3"]);
+ my $changeLogHash = fixChangeLogPatch($patch);
+ unapplyPatch(unsetChangeLogDate($fullPath, $changeLogHash->{patch}), $fullPath, ["--fuzz=3"]);
unlink("${fullPath}.orig") if (! $changeLogDotOrigExisted);
} else {
unapplyPatch($patch, $fullPath);
@@ -196,7 +167,8 @@ sub patch($)
} else {
# Either a deletion, an addition or a binary change.
- if ($isBinary) {
+ # FIXME: Add support for Git binary files.
+ if ($isSvnBinary) {
# Reverse binary change
unlink($fullPath) if (-e $fullPath);
system "svn", "revert", $fullPath;
@@ -228,11 +200,17 @@ sub patch($)
system "svn", "stat", $fullPath;
} else {
# Reverse addition
- unapplyPatch($patch, $fullPath, ["--force"]);
+ #
+ # FIXME: This should use the same logic as svn-apply's deletion
+ # code. In particular, svn-apply's scmRemove() subroutine
+ # should be used here.
+ unapplyPatch($patch, $fullPath, ["--force"]) if $patch;
unlink($fullPath) if -z $fullPath;
system "svn", "revert", $fullPath;
}
}
+
+ scmToggleExecutableBit($fullPath, -1 * $diffHashRef->{executableBitDelta}) if defined($diffHashRef->{executableBitDelta});
}
sub revertDirectories()
diff --git a/WebKitTools/Scripts/test-webkitperl b/WebKitTools/Scripts/test-webkitperl
index 2e31593..4e63b8a 100755
--- a/WebKitTools/Scripts/test-webkitperl
+++ b/WebKitTools/Scripts/test-webkitperl
@@ -39,10 +39,20 @@ use Test::Harness;
use lib $FindBin::Bin; # so this script can be run from any directory.
use VCSUtils;
-# Use an absolute path so this script can be run from any directory.
-my $scriptsDir = $FindBin::Bin;
+# Change the working directory so that we can pass shorter, relative
+# paths to runtests(), rather than longer, absolute paths.
+#
+# We change to the source root so the paths can be relative to the
+# source root. These paths display on the screen, and their meaning
+# will be clearer to the user if relative to the root, rather than to
+# the Scripts directory, say.
+#
+# Source root is two levels up from the Scripts directory.
+my $sourceRootDir = File::Spec->catfile($FindBin::Bin, "../..");
+chdir($sourceRootDir);
-my $pattern = File::Spec->catfile($scriptsDir, "webkitperl/*_unittest/*.pl");
+# Relative to root
+my $pattern = "WebKitTools/Scripts/webkitperl/*_unittest/*.pl";
my @files = <${pattern}>; # lists files alphabetically
diff --git a/WebKitTools/Scripts/test-webkitpy b/WebKitTools/Scripts/test-webkitpy
index cfd3434..fcff4b4 100755
--- a/WebKitTools/Scripts/test-webkitpy
+++ b/WebKitTools/Scripts/test-webkitpy
@@ -1,5 +1,6 @@
#!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -27,40 +28,239 @@
# (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 logging
+import os
import sys
-import unittest
-
-from webkitpy.bugzilla_unittest import *
-from webkitpy.buildbot_unittest import *
-from webkitpy.changelogs_unittest import *
-from webkitpy.commands.download_unittest import *
-from webkitpy.commands.early_warning_system_unittest import *
-from webkitpy.commands.openbugs_unittest import OpenBugsTest
-from webkitpy.commands.upload_unittest import *
-from webkitpy.commands.queries_unittest import *
-from webkitpy.commands.queues_unittest import *
-from webkitpy.committers_unittest import *
-from webkitpy.credentials_unittest import *
-from webkitpy.diff_parser_unittest import *
-from webkitpy.executive_unittest import *
-from webkitpy.grammar_unittest import *
-from webkitpy.multicommandtool_unittest import *
-from webkitpy.networktransaction_unittest import *
-from webkitpy.patchcollection_unittest import *
-from webkitpy.queueengine_unittest import *
-from webkitpy.steps.steps_unittest import *
-from webkitpy.steps.closebugforlanddiff_unittest import *
-from webkitpy.steps.updatechangelogswithreview_unittests import *
-from webkitpy.style.unittests import * # for check-webkit-style
-from webkitpy.user_unittest import *
-from webkitpy.webkit_logging_unittest import *
-from webkitpy.webkitport_unittest import *
+
+# Do not import anything from webkitpy prior to cleaning webkitpy of
+# orphaned *.pyc files. This ensures that no orphaned *.pyc files are
+# accidentally imported during the course of this script.
+#
+# Also, do not import or execute any Python code incompatible with
+# Python 2.4 until after execution of the init() method below.
+
+
+_log = logging.getLogger("test-webkitpy")
+
+
+# Verbose logging is useful for debugging test-webkitpy code that runs
+# before the actual unit tests -- things like autoinstall downloading and
+# unit-test auto-detection logic. This is different from verbose logging
+# of the unit tests themselves (i.e. the unittest module's --verbose flag).
+def configure_logging(is_verbose_logging):
+ """Configure the root logger.
+
+ Configure the root logger not to log any messages from webkitpy --
+ except for messages from the autoinstall module. Also set the
+ logging level as described below.
+
+ Args:
+ is_verbose_logging: A boolean value of whether logging should be
+ verbose. If this parameter is true, the logging
+ level for the handler on the root logger is set to
+ logging.DEBUG. Otherwise, it is set to logging.INFO.
+
+ """
+ # Don't use the Python ternary operator here so that this method will
+ # work with Python 2.4.
+ if is_verbose_logging:
+ logging_level = logging.DEBUG
+ else:
+ logging_level = logging.INFO
+
+ handler = logging.StreamHandler(sys.stderr)
+ # We constrain the level on the handler rather than on the root
+ # logger itself. This is probably better because the handler is
+ # configured and known only to this module, whereas the root logger
+ # is an object shared (and potentially modified) by many modules.
+ # Modifying the handler, then, is less intrusive and less likely to
+ # interfere with modifications made by other modules (e.g. in unit
+ # tests).
+ handler.setLevel(logging_level)
+ formatter = logging.Formatter("%(name)s: %(levelname)-8s %(message)s")
+ handler.setFormatter(formatter)
+
+ logger = logging.getLogger()
+ logger.addHandler(handler)
+ logger.setLevel(logging.NOTSET)
+
+ # Filter out most webkitpy messages.
+ #
+ # Messages can be selectively re-enabled for this script by updating
+ # this method accordingly.
+ def filter(record):
+ """Filter out autoinstall and non-third-party webkitpy messages."""
+ # FIXME: Figure out a way not to use strings here, for example by
+ # using syntax like webkitpy.test.__name__. We want to be
+ # sure not to import any non-Python 2.4 code, though, until
+ # after the version-checking code has executed.
+ if (record.name.startswith("webkitpy.common.system.autoinstall") or
+ record.name.startswith("webkitpy.test")):
+ return True
+ if record.name.startswith("webkitpy"):
+ return False
+ return True
+
+ testing_filter = logging.Filter()
+ testing_filter.filter = filter
+
+ # Display a message so developers are not mystified as to why
+ # logging does not work in the unit tests.
+ _log.info("Suppressing most webkitpy logging while running unit tests.")
+ handler.addFilter(testing_filter)
+
+
+def _clean_pyc_files(dir_to_clean, paths_not_to_log):
+ """Delete from a directory all .pyc files that have no .py file.
+
+ Args:
+ dir_to_clean: The path to the directory to clean.
+ paths_not_to_log: A list of paths to .pyc files whose deletions should
+ not be logged. This list should normally include
+ only test .pyc files.
+
+ """
+ _log.debug("Cleaning orphaned *.pyc files from: %s" % dir_to_clean)
+
+ # Normalize paths not to log.
+ paths_not_to_log = [os.path.abspath(path) for path in paths_not_to_log]
+
+ for dir_path, dir_names, file_names in os.walk(dir_to_clean):
+ for file_name in file_names:
+ if file_name.endswith(".pyc") and file_name[:-1] not in file_names:
+ file_path = os.path.join(dir_path, file_name)
+ if os.path.abspath(file_path) not in paths_not_to_log:
+ _log.info("Deleting orphan *.pyc file: %s" % file_path)
+ os.remove(file_path)
+
+
+# As a substitute for a unit test, this method tests _clean_pyc_files()
+# in addition to calling it. We chose not to use the unittest module
+# because _clean_pyc_files() is called only once and is not used elsewhere.
+def _clean_packages_with_test(external_package_paths):
+ webkitpy_dir = os.path.join(os.path.dirname(__file__), "webkitpy")
+ package_paths = [webkitpy_dir] + external_package_paths
+
+ # The test .pyc file is--
+ # webkitpy/python24/TEMP_test-webkitpy_test_pyc_file.pyc.
+ test_path = os.path.join(webkitpy_dir, "python24",
+ "TEMP_test-webkitpy_test_pyc_file.pyc")
+
+ test_file = open(test_path, "w")
+ try:
+ test_file.write("Test .pyc file generated by test-webkitpy.")
+ finally:
+ test_file.close()
+
+ # Confirm that the test file exists so that when we check that it does
+ # not exist, the result is meaningful.
+ if not os.path.exists(test_path):
+ raise Exception("Test .pyc file not created: %s" % test_path)
+
+ for path in package_paths:
+ _clean_pyc_files(path, [test_path])
+
+ if os.path.exists(test_path):
+ raise Exception("Test .pyc file not deleted: %s" % test_path)
+
+
+def init(command_args, external_package_paths):
+ """Execute code prior to importing from webkitpy.unittests.
+
+ Args:
+ command_args: The list of command-line arguments -- usually
+ sys.argv[1:].
+
+ """
+ verbose_logging_flag = "--verbose-logging"
+ is_verbose_logging = verbose_logging_flag in command_args
+ if is_verbose_logging:
+ # Remove the flag so it doesn't cause unittest.main() to error out.
+ #
+ # FIXME: Get documentation for the --verbose-logging flag to show
+ # up in the usage instructions, which are currently generated
+ # by unittest.main(). It's possible that this will require
+ # re-implementing the option parser for unittest.main()
+ # since there may not be an easy way to modify its existing
+ # option parser.
+ sys.argv.remove(verbose_logging_flag)
+
+ configure_logging(is_verbose_logging)
+ _log.debug("Verbose WebKit logging enabled.")
+
+ # We clean orphaned *.pyc files from the packages prior to importing from
+ # them to make sure that no import statements falsely succeed.
+ # This helps to check that import statements have been updated correctly
+ # after any file moves. Otherwise, incorrect import statements can
+ # be masked.
+ #
+ # For example, if webkitpy/python24/versioning.py were moved to a
+ # different location without changing any import statements, and if
+ # the corresponding .pyc file were left behind without deleting it,
+ # then "import webkitpy.python24.versioning" would continue to succeed
+ # even though it would fail for someone checking out a fresh copy
+ # of the source tree. This is because of a Python feature:
+ #
+ # "It is possible to have a file called spam.pyc (or spam.pyo when -O
+ # is used) without a file spam.py for the same module. This can be used
+ # to distribute a library of Python code in a form that is moderately
+ # hard to reverse engineer."
+ #
+ # ( http://docs.python.org/tutorial/modules.html#compiled-python-files )
+ #
+ # Deleting the orphaned .pyc file prior to importing, however, would
+ # cause an ImportError to occur on import as desired.
+ _clean_packages_with_test(external_package_paths)
+
+ import webkitpy.python24.versioning as versioning
+
+ versioning.check_version(log=_log)
+
+ (comparison, current_version, minimum_version) = \
+ versioning.compare_version()
+
+ if comparison > 0:
+ # Then the current version is later than the minimum version.
+ message = ("You are testing webkitpy with a Python version (%s) "
+ "higher than the minimum version (%s) it was meant "
+ "to support." % (current_version, minimum_version))
+ _log.warn(message)
+
+
+def _path_from_webkit_root(*components):
+ webkit_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
+ return os.path.join(webkit_root, *components)
+
+
+def _test_import(module_path):
+ try:
+ sys.path.append(os.path.dirname(module_path))
+ module_name = os.path.basename(module_path)
+ __import__(module_name)
+ return True
+ except Exception, e:
+ message = "Skipping tests in %s due to failure (%s)." % (module_path, e)
+ if module_name.endswith("QueueStatusServer"):
+ message += " This module is optional. The failure is likely due to a missing Google AppEngine install. (http://code.google.com/appengine/downloads.html)"
+ _log.warn(message)
+ return False
if __name__ == "__main__":
- # FIXME: This is a hack, but I'm tired of commenting out the test.
- # See https://bugs.webkit.org/show_bug.cgi?id=31818
- if len(sys.argv) > 1 and sys.argv[1] == "--all":
- sys.argv.remove("--all")
- from webkitpy.scm_unittest import *
+ # FIXME: We should probably test each package separately to avoid naming conflicts.
+ external_package_paths = [
+ _path_from_webkit_root('WebKit2', 'Scripts', 'webkit2'),
+ _path_from_webkit_root('WebKitTools', 'QueueStatusServer'),
+ ]
+ init(sys.argv[1:], external_package_paths)
+
+ # We import the unit test code after init() to ensure that any
+ # Python version warnings are displayed in case an error occurs
+ # while interpreting webkitpy.unittests. This also allows
+ # logging to be configured prior to importing -- for example to
+ # enable the display of autoinstall logging.log messages while
+ # running the unit tests.
+ from webkitpy.test.main import Tester
+
+ external_package_paths = filter(_test_import, external_package_paths)
- unittest.main()
+ Tester().run_tests(sys.argv, external_package_paths)
diff --git a/WebKitTools/Scripts/update-iexploder-cssproperties b/WebKitTools/Scripts/update-iexploder-cssproperties
index b7ae6cb..3fbcf83 100755
--- a/WebKitTools/Scripts/update-iexploder-cssproperties
+++ b/WebKitTools/Scripts/update-iexploder-cssproperties
@@ -1,6 +1,7 @@
#!/usr/bin/perl
# Copyright (C) 2007 Apple Inc. All rights reserved.
+# Copyright (C) 2010 Holger Hans Peter Freyther
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -26,87 +27,103 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# This script updates WebKitTools/iExploder/htdocs/cssproperties.in based on
-# WebCore/css/CSSPropertyNames.in.
+# This script updates WebKitTools/iExploder/htdocs/*.in based on
+# WebCore/css/CSSPropertyNames.in, WebCore/html/HTMLTagNames.in
+# and WebCore/html/HTMLAttributeNames.in
use warnings;
use strict;
use FindBin;
use lib $FindBin::Bin;
+use VCSUtils;
use webkitdirs;
use File::Spec;
-sub generateSectionFromCSSPropertyNamesFile();
-sub readiExploderFile();
-sub svnRevision($);
-sub writeiExploderFile();
+sub generateEntityListFromFile($);
+sub readiExploderFile($);
+sub update($$);
+sub writeiExploderFile($@);
-my $iExploderFile = File::Spec->catfile(sourceDir(), split("/", "WebKitTools/iExploder/htdocs/cssproperties.in"));
-my $cssPropertyNamesFile = File::Spec->catfile(sourceDir(), split("/", "WebCore/css/CSSPropertyNames.in"));
-
-my @sections = readiExploderFile();
-$sections[0] = generateSectionFromCSSPropertyNamesFile();
-writeiExploderFile();
-
-print `svn stat $iExploderFile`;
+update("cssproperties.in", "css/CSSPropertyNames.in");
+update("htmlattrs.in", "html/HTMLAttributeNames.in");
+update("htmltags.in", "html/HTMLTagNames.in");
print "Successfully updated!\n";
exit 0;
-sub generateSectionFromCSSPropertyNamesFile()
+sub generateEntityListFromFile($)
{
- my $revision = svnRevision($cssPropertyNamesFile);
- my $path = File::Spec->abs2rel($cssPropertyNamesFile, sourceDir());
+ my ($filename) = @_;
+
+ my $revision = svnRevisionForDirectory(dirname($filename));
+ my $path = File::Spec->abs2rel($filename, sourceDir());
my $result = "# From WebKit svn r" . $revision . " (" . $path . ")\n";
- my @properties = ();
+ my @entities = ();
+ my $in_namespace = 0;
- open(IN, $cssPropertyNamesFile) || die "$!";
+ open(IN, $filename) || die "$!";
while (my $l = <IN>) {
chomp $l;
+ if ($l =~ m/^namespace=\"/) {
+ $in_namespace = 1;
+ } elsif ($in_namespace && $l =~ m/^$/) {
+ $in_namespace = 0;
+ }
+
+ next if $in_namespace;
next if $l =~ m/^\s*#/ || $l =~ m/^\s*$/;
- push(@properties, $l);
+
+ # For HTML Tags that can have additional information
+ if ($l =~ m/ /) {
+ my @split = split / /, $l;
+ $l = $split[0]
+ }
+
+ push(@entities, $l);
}
close(IN);
- $result .= join("\n", sort { $a cmp $b } @properties) . "\n\n";
+ $result .= join("\n", sort { $a cmp $b } @entities) . "\n\n";
return $result;
}
-sub readiExploderFile()
+sub readiExploderFile($)
{
+ my ($filename) = @_;
+
my @sections = ();
local $/ = "\n\n";
- open(IN, $iExploderFile) || die "$!";
+ open(IN, $filename) || die "$!";
@sections = <IN>;
close(IN);
return @sections;
}
-sub svnRevision($)
+sub update($$)
{
- my ($file) = @_;
- my $revision = "";
+ my ($iexploderPath, $webcorePath) = @_;
- open INFO, "svn info '$file' |" or die;
- while (<INFO>) {
- if (/^Revision: (.+)/) {
- $revision = $1;
- }
- }
- close INFO;
+ $iexploderPath = File::Spec->catfile(sourceDir(), "WebKitTools", "iExploder", "htdocs", split("/", $iexploderPath));
+ $webcorePath = File::Spec->catfile(sourceDir(), "WebCore", split("/", $webcorePath));
- return $revision ? $revision : "UNKNOWN";
+ my @sections = readiExploderFile($iexploderPath);
+ $sections[0] = generateEntityListFromFile($webcorePath);
+ writeiExploderFile($iexploderPath, @sections);
}
-sub writeiExploderFile()
+
+sub writeiExploderFile($@)
{
- open(OUT, "> $iExploderFile") || die "$!";
+ my ($filename, @sections) = @_;
+
+ open(OUT, "> $filename") || die "$!";
print OUT join("", @sections);
close(OUT);
}
+
diff --git a/WebKitTools/Scripts/webkitpy/steps/commit.py b/WebKitTools/Scripts/update-webgl-conformance-tests
index dd1fed7..dfe20a1 100644..100755
--- a/WebKitTools/Scripts/webkitpy/steps/commit.py
+++ b/WebKitTools/Scripts/update-webgl-conformance-tests
@@ -1,9 +1,10 @@
+#!/usr/bin/env python
# Copyright (C) 2010 Google Inc. All rights reserved.
-#
+#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
-#
+#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
@@ -13,7 +14,7 @@
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
-#
+#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -26,10 +27,10 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
+"""Wrapper around webkitpy/layout_tests/update-webgl-conformance-tests.py"""
+import webkitpy.layout_tests.update_webgl_conformance_tests
+import sys
-class Commit(AbstractStep):
- def run(self, state):
- commit_message = self._tool.scm().commit_message_for_this_commit()
- state["commit_text"] = self._tool.scm().commit_with_message(commit_message.message())
+if __name__ == '__main__':
+ sys.exit(webkitpy.layout_tests.update_webgl_conformance_tests.main())
diff --git a/WebKitTools/Scripts/update-webkit b/WebKitTools/Scripts/update-webkit
index 7602c41..3fc2efd 100755
--- a/WebKitTools/Scripts/update-webkit
+++ b/WebKitTools/Scripts/update-webkit
@@ -33,6 +33,7 @@ use strict;
use FindBin;
use lib $FindBin::Bin;
use File::Basename;
+use File::Path;
use File::Spec;
use Getopt::Long;
use VCSUtils;
@@ -67,6 +68,8 @@ __END__
exit 1;
}
+my $startTime = time();
+
my @svnOptions = ();
push @svnOptions, '-q' if $quiet;
@@ -83,6 +86,13 @@ if (-d "../Internal") {
runSvnUpdate() if $isSVN;
runGitUpdate() if $isGit;
} elsif (isChromium()) {
+ # Workaround for https://bugs.webkit.org/show_bug.cgi?id=38926
+ # We should remove the following "if" block when we find a right fix.
+ if ((isCygwin() || isWindows()) && (stat("WebKit/chromium/features.gypi"))[9] >= $startTime) {
+ print "features.gypi has been updated. Cleaning the build directories.\n";
+ rmtree(["WebKit/chromium/Debug", "WebKit/chromium/Release"]);
+ }
+
system("perl", "WebKitTools/Scripts/update-webkit-chromium") == 0 or die $!;
} elsif (isAppleWinWebKit()) {
system("perl", "WebKitTools/Scripts/update-webkit-auxiliary-libs") == 0 or die;
diff --git a/WebKitTools/Scripts/update-webkit-auxiliary-libs b/WebKitTools/Scripts/update-webkit-auxiliary-libs
index 9c52449..19e4ad3 100755
--- a/WebKitTools/Scripts/update-webkit-auxiliary-libs
+++ b/WebKitTools/Scripts/update-webkit-auxiliary-libs
@@ -31,11 +31,12 @@
use strict;
use warnings;
-use HTTP::Date qw(str2time);
use File::Find;
-use File::Temp ();
use File::Spec;
+use File::Temp ();
use FindBin;
+use HTTP::Date qw(str2time);
+use POSIX;
use lib $FindBin::Bin;
use webkitdirs;
@@ -58,9 +59,21 @@ my $tmpDir = File::Spec->rel2abs(File::Temp::tempdir("webkitlibsXXXXXXX", TMPDIR
print "Checking Last-Modified date of $zipFile...\n";
my $result = system "curl -s -I $auxiliaryLibsURL | grep Last-Modified > \"$tmpDir/$file.headers\"";
-print STDERR "Couldn't check Last-Modified date of new $zipFile.\n" if $result;
-if (!$result && open NEW, "$tmpDir/$file.headers") {
+if (WEXITSTATUS($result)) {
+ print STDERR "Couldn't check Last-Modified date of new $zipFile.\n";
+ print STDERR "Please ensure that $auxiliaryLibsURL is reachable.\n";
+
+ if (! -f "$webkitLibrariesDir/$file.headers") {
+ print STDERR "Unable to check Last-Modified date and no version of $file to fall back to.\n";
+ exit 1;
+ }
+
+ print STDERR "Falling back to existing version of $file.\n";
+ exit 0;
+}
+
+if (open NEW, "$tmpDir/$file.headers") {
my $new = lastModifiedToUnixTime(<NEW>);
close NEW;
diff --git a/WebKitTools/Scripts/update-webkit-chromium b/WebKitTools/Scripts/update-webkit-chromium
index fa94f8c..1db1826 100755
--- a/WebKitTools/Scripts/update-webkit-chromium
+++ b/WebKitTools/Scripts/update-webkit-chromium
@@ -28,11 +28,17 @@
# Update script for the WebKit Chromium Port.
+use File::Path;
+use FindBin;
+use Getopt::Long;
+use lib $FindBin::Bin;
+use webkitdirs;
+
chdir("WebKit/chromium") or die $!;
# Find gclient or install it.
my $gclientPath;
-if (`gclient --version`) {
+if (commandExists('gclient')) {
$gclientPath = 'gclient';
} elsif (-e 'depot_tools/gclient') {
$gclientPath = 'depot_tools/gclient';
@@ -45,11 +51,18 @@ if (`gclient --version`) {
if (! -e ".gclient") {
# If .gclient configuration file doesn't exist, create it.
print "Configuring gclient...\n";
- system($gclientPath,
+ system($gclientPath,
"config",
"--spec=solutions=[{'name':'./','url':None}]") == 0 or die $!;
}
+my $force = 0;
+GetOptions(
+ 'force' => \$force,
+);
+
# Execute gclient sync.
print "Updating chromium port dependencies using gclient...\n";
-system($gclientPath, "sync", "--force") == 0 or die $!;
+my @gclientArgs = ($gclientPath, "sync");
+push @gclientArgs, "--force" if $force;
+system(@gclientArgs) == 0 or die $!;
diff --git a/WebKitTools/Scripts/update-webkit-localizable-strings b/WebKitTools/Scripts/update-webkit-localizable-strings
index 1d1f413..493a777 100755
--- a/WebKitTools/Scripts/update-webkit-localizable-strings
+++ b/WebKitTools/Scripts/update-webkit-localizable-strings
@@ -34,7 +34,7 @@ use FindBin;
use lib $FindBin::Bin;
use webkitdirs;
-my @directoriesToScan = ("WebKit/mac", "WebKit/win");
+my @directoriesToScan = ("WebKit/mac", "WebKit/win", "-WebCore/icu", "-WebKit/mac/icu");
my $fileToUpdate = "WebKit/English.lproj/Localizable.strings";
my $exceptionsFile = "WebKit/StringsNotToBeLocalized.txt";
diff --git a/WebKitTools/Scripts/update-webkit-support-libs b/WebKitTools/Scripts/update-webkit-support-libs
index 7065293..fa2afd0 100755
--- a/WebKitTools/Scripts/update-webkit-support-libs
+++ b/WebKitTools/Scripts/update-webkit-support-libs
@@ -38,43 +38,33 @@ use FindBin;
use lib $FindBin::Bin;
use webkitdirs;
-my $expectedMD5 = "a1341aadbcce1ef26dad2b2895457314";
-
my $sourceDir = sourceDir();
my $file = "WebKitSupportLibrary";
my $zipFile = "$file.zip";
my $zipDirectory = toUnixPath($ENV{'WEBKITSUPPORTLIBRARIESZIPDIR'}) || $sourceDir;
my $pathToZip = File::Spec->catfile($zipDirectory, $zipFile);
my $webkitLibrariesDir = toUnixPath($ENV{'WEBKITLIBRARIESDIR'}) || "$sourceDir/WebKitLibraries/win";
+my $versionFile = $file . "Version";
+my $pathToVersionFile = File::Spec->catfile($webkitLibrariesDir, $versionFile);
my $tmpDir = File::Spec->rel2abs(File::Temp::tempdir("webkitlibsXXXXXXX", TMPDIR => 1, CLEANUP => 1));
-# Make sure the file zipfile exists and matches the expected MD5 before doing anything.
-
--f $pathToZip or dieAndInstructToDownload("$zipFile could not be find in your root source directory.");
-
-`md5sum "$pathToZip"` =~ /^([0-9a-fA-F]{32}).*/ or die "Error running md5sum on \"$pathToZip\"";
-my $actualMD5 = $1;
-$actualMD5 eq $expectedMD5 or dieAndInstructToDownload("$zipFile is out of date.");
-
-print "Checking mod-date of $zipFile...\n";
-open MOD, ">$tmpDir/$file.modified" or die "Couldn't open $tmpDir/$file.modified for writing";
-print MOD (stat $pathToZip)[9] . "\n";
-close MOD;
+chomp(my $expectedVersion = `curl -s http://developer.apple.com/opensource/internet/$versionFile`);
-if (open NEW, "$tmpDir/$file.modified") {
- my $new = <NEW>;
- close NEW;
-
- if (open OLD, "$webkitLibrariesDir/$file.modified") {
- my $old = <OLD>;
- close OLD;
- if ($old eq $new) {
- print "Current $file is up to date\n";
- exit 0;
- }
+# Check whether the extracted library is up-to-date. If it is, we don't have anything to do.
+if (open VERSION, "<", $pathToVersionFile) {
+ chomp(my $extractedVersion = <VERSION>);
+ close VERSION;
+ if ($extractedVersion eq $expectedVersion) {
+ print "$file is up-to-date.\n";
+ exit;
}
}
+# Check whether the downloaded library is up-to-date. If it isn't, the user needs to download it.
+-f $pathToZip or dieAndInstructToDownload("$zipFile could not be found in $zipDirectory.");
+chomp(my $zipFileVersion = `unzip -p "$pathToZip" $file/win/$versionFile`);
+dieAndInstructToDownload("$zipFile is out-of-date.") if $zipFileVersion ne $expectedVersion;
+
my $result = system "unzip", "-q", "-d", $tmpDir, $pathToZip;
die "Couldn't unzip $zipFile." if $result;
@@ -95,9 +85,6 @@ sub wanted
File::Find::find(\&wanted, "$tmpDir/$file");
-$result = system "mv", "$tmpDir/$file.modified", $webkitLibrariesDir;
-print STDERR "Couldn't move $file.modified to $webkitLibrariesDir" . ".\n" if $result;
-
print "The $file has been sucessfully installed in\n $webkitLibrariesDir\n";
exit;
diff --git a/WebKitTools/Scripts/validate-committer-lists b/WebKitTools/Scripts/validate-committer-lists
index 2f2dd32..2519e01 100755
--- a/WebKitTools/Scripts/validate-committer-lists
+++ b/WebKitTools/Scripts/validate-committer-lists
@@ -36,13 +36,13 @@ import subprocess
import re
import urllib2
from datetime import date, datetime, timedelta
-from webkitpy.committers import CommitterList
-from webkitpy.webkit_logging import log, error
-from webkitpy.scm import Git
+from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.system.deprecated_logging import log, error
+from webkitpy.common.checkout.scm import Git
# WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy
# so this import should always succeed.
-from webkitpy.BeautifulSoup import BeautifulSoup
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
def print_list_if_non_empty(title, list_to_print):
if not list_to_print:
diff --git a/WebKitTools/Scripts/webkit-build-directory b/WebKitTools/Scripts/webkit-build-directory
index a85c587..bf7d66d 100755
--- a/WebKitTools/Scripts/webkit-build-directory
+++ b/WebKitTools/Scripts/webkit-build-directory
@@ -34,31 +34,35 @@ use Getopt::Long;
use lib $FindBin::Bin;
use webkitdirs;
-my $showBaseProductDirectory = 0;
+my $showConfigurationDirectory = 0;
my $showHelp = 0;
+my $showTopLevelDirectory = 0;
+
my $programName = basename($0);
my $usage = <<EOF;
Usage: $programName [options]
- --base Show the root build directory instead of one corresponding to the current target (e.g. Debug, Release)
- --debug Show build directory for the Debug target
- -h|--help Show this help message
- --release Show build directory for the Release target
+ --configuration Show the build directory for a specific configuration (e.g. Debug, Release. Defaults to the active configuration set by set-webkit-configuration)
+ -h|--help Show this help message
+ --top-level Show the top-level build directory
+
+Either --configuration or --top-level is required.
EOF
setConfiguration(); # Figure out from the command line if we're --debug or --release or the default.
my $getOptionsResult = GetOptions(
- 'base' => \$showBaseProductDirectory,
+ 'configuration' => \$showConfigurationDirectory,
+ 'top-level' => \$showTopLevelDirectory,
'help|h' => \$showHelp,
);
-if (!$getOptionsResult || $showHelp) {
+if (!$getOptionsResult || $showHelp || (!$showConfigurationDirectory && !$showTopLevelDirectory)) {
print STDERR $usage;
exit 1;
}
-if ($showBaseProductDirectory) {
+if ($showTopLevelDirectory) {
print baseProductDir() . "\n";
} else {
print productDir() . "\n";
diff --git a/WebKitTools/Scripts/webkit-patch b/WebKitTools/Scripts/webkit-patch
index b4bcc4c..007f919 100755
--- a/WebKitTools/Scripts/webkit-patch
+++ b/WebKitTools/Scripts/webkit-patch
@@ -1,6 +1,7 @@
#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2010 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -30,80 +31,40 @@
#
# A tool for automating dealing with bugzilla, posting patches, committing patches, etc.
+import logging
import os
+import sys
-from webkitpy.bugzilla import Bugzilla
-from webkitpy.buildbot import BuildBot
-from webkitpy.commands.download import *
-from webkitpy.commands.early_warning_system import *
-from webkitpy.commands.openbugs import OpenBugs
-from webkitpy.commands.queries import *
-from webkitpy.commands.queues import *
-from webkitpy.commands.upload import *
-from webkitpy.executive import Executive
-from webkitpy.webkit_logging import log
-from webkitpy.multicommandtool import MultiCommandTool
-from webkitpy.scm import detect_scm_system
-from webkitpy.user import User
+from webkitpy.common.system.logutils import configure_logging
+import webkitpy.python24.versioning as versioning
+_log = logging.getLogger("webkit-patch")
-class WebKitPatch(MultiCommandTool):
- global_options = [
- make_option("--dry-run", action="store_true", dest="dry_run", default=False, help="do not touch remote servers"),
- make_option("--status-host", action="store", dest="status_host", type="string", nargs=1, help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
- ]
+def main():
+ # This is a hack to let us enable DEBUG logging as early as possible.
+ # Note this can't be ternary as versioning.check_version()
+ # hasn't run yet and this python might be older than 2.5.
+ if set(["-v", "--verbose"]).intersection(set(sys.argv)):
+ logging_level = logging.DEBUG
+ else:
+ logging_level = logging.INFO
+ configure_logging(logging_level=logging_level)
- def __init__(self):
- MultiCommandTool.__init__(self)
+ versioning.check_version()
+
+ if sys.platform == "win32":
+ _log.fatal("webkit-patch is only supported under Cygwin Python, "
+ "not Win32 Python")
+ sys.exit(1)
- self.bugs = Bugzilla()
- self.buildbot = BuildBot()
- self.executive = Executive()
- self.user = User()
- self._scm = None
- self.status_server = StatusServer()
+ # Import webkit-patch code only after version-checking so that
+ # script doesn't error out before having a chance to report the
+ # version warning.
+ from webkitpy.tool.main import WebKitPatch
- def scm(self):
- # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
- original_cwd = os.path.abspath(".")
- if not self._scm:
- self._scm = detect_scm_system(original_cwd)
-
- if not self._scm:
- script_directory = os.path.abspath(sys.path[0])
- webkit_directory = os.path.abspath(os.path.join(script_directory, "../.."))
- self._scm = detect_scm_system(webkit_directory)
- if self._scm:
- log("The current directory (%s) is not a WebKit checkout, using %s" % (original_cwd, webkit_directory))
- else:
- error("FATAL: Failed to determine the SCM system for either %s or %s" % (original_cwd, webkit_directory))
-
- return self._scm
-
- def path(self):
- return __file__
-
- def should_show_in_main_help(self, command):
- if not command.show_in_main_help:
- return False
- if command.requires_local_commits:
- return self.scm().supports_local_commits()
- return True
-
- # FIXME: This may be unnecessary since we pass global options to all commands during execute() as well.
- def handle_global_options(self, options):
- if options.dry_run:
- self.scm().dryrun = True
- self.bugs.dryrun = True
- if options.status_host:
- self.status_server.set_host(options.status_host)
-
- def should_execute_command(self, command):
- if command.requires_local_commits and not self.scm().supports_local_commits():
- failure_reason = "%s requires local commits using %s in %s." % (command.name, self.scm().display_name(), self.scm().checkout_root)
- return (False, failure_reason)
- return (True, None)
+ WebKitPatch(__file__).main()
if __name__ == "__main__":
- WebKitPatch().main()
+
+ main()
diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
index a788b3d..2c1d8da 100644
--- a/WebKitTools/Scripts/webkitdirs.pm
+++ b/WebKitTools/Scripts/webkitdirs.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
+# Copyright (C) 2005, 2006, 2007, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -50,6 +50,7 @@ BEGIN {
our @EXPORT_OK;
my $architecture;
+my $numberOfCPUs;
my $baseProductDir;
my @baseProductDirOption;
my $configuration;
@@ -63,14 +64,16 @@ my $isSymbian;
my %qtFeatureDefaults;
my $isGtk;
my $isWx;
+my $isEfl;
my @wxArgs;
my $isChromium;
my $isInspectorFrontend;
# Variables for Win32 support
my $vcBuildPath;
-my $windowsTmpPath;
my $windowsSourceDir;
+my $winVersion;
+my $willUseVCExpressWhenBuilding = 0;
# Defined in VCSUtils.
sub exitStatus($);
@@ -113,7 +116,9 @@ sub determineBaseProductDir
return if defined $baseProductDir;
determineSourceDir();
- if (isAppleMacWebKit()) {
+ $baseProductDir = $ENV{"WEBKITOUTPUTDIR"};
+
+ if (!defined($baseProductDir) and isAppleMacWebKit()) {
# Silently remove ~/Library/Preferences/xcodebuild.plist which can
# cause build failure. The presence of
# ~/Library/Preferences/xcodebuild.plist can prevent xcodebuild from
@@ -146,7 +151,7 @@ sub determineBaseProductDir
}
if (!defined($baseProductDir)) { # Port-spesific checks failed, use default
- $baseProductDir = $ENV{"WEBKITOUTPUTDIR"} || "$sourceDir/WebKitBuild";
+ $baseProductDir = "$sourceDir/WebKitBuild";
}
if (isGit() && isGitBranchBuild()) {
@@ -167,9 +172,6 @@ sub determineBaseProductDir
my $dosBuildPath = `cygpath --windows \"$baseProductDir\"`;
chomp $dosBuildPath;
$ENV{"WEBKITOUTPUTDIR"} = $dosBuildPath;
- }
-
- if (isAppleWinWebKit()) {
my $unixBuildPath = `cygpath --unix \"$baseProductDir\"`;
chomp $unixBuildPath;
$baseProductDir = $unixBuildPath;
@@ -225,12 +227,36 @@ sub determineArchitecture
}
}
+sub determineNumberOfCPUs
+{
+ return if defined $numberOfCPUs;
+ if (isLinux()) {
+ # First try the nproc utility, if it exists. If we get no
+ # results fall back to just interpretting /proc directly.
+ chomp($numberOfCPUs = `nproc 2> /dev/null`);
+ if ($numberOfCPUs eq "") {
+ $numberOfCPUs = (grep /processor/, `cat /proc/cpuinfo`);
+ }
+ } elsif (isWindows() || isCygwin()) {
+ if (defined($ENV{NUMBER_OF_PROCESSORS})) {
+ $numberOfCPUs = $ENV{NUMBER_OF_PROCESSORS};
+ } else {
+ # Assumes cygwin
+ $numberOfCPUs = `ls /proc/registry/HKEY_LOCAL_MACHINE/HARDWARE/DESCRIPTION/System/CentralProcessor | wc -w`;
+ }
+ } elsif (isDarwin()) {
+ $numberOfCPUs = `sysctl -n hw.ncpu`;
+ }
+}
+
sub jscPath($)
{
my ($productDir) = @_;
my $jscName = "jsc";
$jscName .= "_debug" if (isCygwin() && ($configuration eq "Debug"));
- return "$productDir/$jscName";
+ $jscName .= ".exe" if (isWindows() || isCygwin());
+ return "$productDir/$jscName" if -e "$productDir/$jscName";
+ return "$productDir/JavaScriptCore.framework/Resources/$jscName";
}
sub argumentsForConfiguration()
@@ -245,6 +271,7 @@ sub argumentsForConfiguration()
push(@args, '--qt') if isQt();
push(@args, '--symbian') if isSymbian();
push(@args, '--gtk') if isGtk();
+ push(@args, '--efl') if isEfl();
push(@args, '--wx') if isWx();
push(@args, '--chromium') if isChromium();
push(@args, '--inspector-frontend') if isInspectorFrontend();
@@ -258,8 +285,9 @@ sub determineConfigurationForVisualStudio
$configurationForVisualStudio = $configuration;
return unless $configuration eq "Debug";
setupCygwinEnv();
- chomp(my $dir = `cygpath -ua '$ENV{WEBKITLIBRARIESDIR}'`);
- $configurationForVisualStudio = "Debug_Internal" if -f "$dir/bin/CoreFoundation_debug.dll";
+ my $dir = $ENV{WEBKITLIBRARIESDIR};
+ chomp($dir = `cygpath -ua '$dir'`) if isCygwin();
+ $configurationForVisualStudio = "Debug_Internal" if -f File::Spec->catfile($dir, "bin", "CoreFoundation_debug.dll");
}
sub determineConfigurationProductDir
@@ -268,13 +296,13 @@ sub determineConfigurationProductDir
determineBaseProductDir();
determineConfiguration();
if (isAppleWinWebKit() && !isWx()) {
- $configurationProductDir = "$baseProductDir/bin";
+ $configurationProductDir = File::Spec->catdir($baseProductDir, "bin");
} else {
- # [Gtk] We don't have Release/Debug configurations in straight
+ # [Gtk][Efl] We don't have Release/Debug configurations in straight
# autotool builds (non build-webkit). In this case and if
# WEBKITOUTPUTDIR exist, use that as our configuration dir. This will
# allows us to run run-webkit-tests without using build-webkit.
- if ($ENV{"WEBKITOUTPUTDIR"} && isGtk()) {
+ if ($ENV{"WEBKITOUTPUTDIR"} && (isGtk() || isEfl())) {
$configurationProductDir = "$baseProductDir";
} else {
$configurationProductDir = "$baseProductDir/$configuration";
@@ -325,7 +353,7 @@ sub jscProductDir
my $productDir = productDir();
$productDir .= "/JavaScriptCore" if isQt();
$productDir .= "/$configuration" if (isQt() && isWindows());
- $productDir .= "/Programs" if isGtk();
+ $productDir .= "/Programs" if (isGtk() || isEfl());
return $productDir;
}
@@ -373,7 +401,7 @@ sub XcodeCoverageSupportOptions()
push @coverageSupportOptions, "GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES";
push @coverageSupportOptions, "EXTRA_LINK= \$(EXTRA_LINK) -ftest-coverage -fprofile-arcs";
push @coverageSupportOptions, "OTHER_CFLAGS= \$(OTHER_CFLAGS) -DCOVERAGE -MD";
- push @coverageSupportOptions, "OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -ftest-coverage -fprofile-arcs -framework AppKit";
+ push @coverageSupportOptions, "OTHER_LDFLAGS=\$(OTHER_LDFLAGS) -ftest-coverage -fprofile-arcs -lgcov";
return @coverageSupportOptions;
}
@@ -384,7 +412,7 @@ sub determinePassedConfiguration
return if $searchedForPassedConfiguration;
$searchedForPassedConfiguration = 1;
- my $isWinCairo = checkForArgumentAndRemoveFromARGV("--cairo-win32");
+ my $isWinCairo = checkForArgumentAndRemoveFromARGV("--wincairo");
for my $i (0 .. $#ARGV) {
my $opt = $ARGV[$i];
@@ -463,6 +491,12 @@ sub architecture()
return $architecture;
}
+sub numberOfCPUs()
+{
+ determineNumberOfCPUs();
+ return $numberOfCPUs;
+}
+
sub setArchitecture
{
if (my $arch = shift @_) {
@@ -492,7 +526,7 @@ sub installedSafariPath
} elsif (isAppleWinWebKit()) {
$safariBundle = `"$configurationProductDir/FindSafari.exe"`;
$safariBundle =~ s/[\r\n]+$//;
- $safariBundle = `cygpath -u '$safariBundle'`;
+ $safariBundle = `cygpath -u '$safariBundle'` if isCygwin();
$safariBundle =~ s/[\r\n]+$//;
$safariBundle .= "Safari.exe";
}
@@ -541,6 +575,11 @@ sub builtDylibPathForName
if (isDarwin() and -d "$configurationProductDir/lib/$libraryName.framework") {
return "$configurationProductDir/lib/$libraryName.framework/$libraryName";
} elsif (isWindows()) {
+ if (configuration() eq "Debug") {
+ # On Windows, there is a "d" suffix to the library name. See <http://trac.webkit.org/changeset/53924/>.
+ $libraryName .= "d";
+ }
+
my $mkspec = `qmake -query QMAKE_MKSPECS`;
$mkspec =~ s/[\n|\r]$//g;
my $qtMajorVersion = retrieveQMakespecVar("$mkspec/qconfig.pri", "QT_MAJOR_VERSION");
@@ -556,7 +595,14 @@ sub builtDylibPathForName
return "$configurationProductDir/libwxwebkit.dylib";
}
if (isGtk()) {
- return "$configurationProductDir/$libraryName/../.libs/libwebkit-1.0.so";
+ my $libraryDir = "$configurationProductDir/$libraryName/../.libs/";
+ if (-e $libraryDir . "libwebkitgtk-3.0.so") {
+ return $libraryDir . "libwebkitgtk-3.0.so";
+ }
+ return $libraryDir . "libwebkitgtk-1.0.so";
+ }
+ if (isEfl()) {
+ return "$configurationProductDir/$libraryName/../.libs/libewebkit.so";
}
if (isAppleMacWebKit()) {
return "$configurationProductDir/$libraryName.framework/Versions/A/$libraryName";
@@ -569,13 +615,13 @@ sub builtDylibPathForName
}
}
- die "Unsupported platform, can't determine built library locations.";
+ die "Unsupported platform, can't determine built library locations.\nTry `build-webkit --help` for more information.\n";
}
# Check to see that all the frameworks are built.
sub checkFrameworks # FIXME: This is a poor name since only the Mac calls built WebCore a Framework.
{
- return if isCygwin();
+ return if isCygwin() || isWindows();
my @frameworks = ("JavaScriptCore", "WebCore");
push(@frameworks, "WebKit") if isAppleMacWebKit(); # FIXME: This seems wrong, all ports should have a WebKit these days.
for my $framework (@frameworks) {
@@ -614,15 +660,23 @@ sub qtFeatureDefaults()
return %qtFeatureDefaults;
}
+sub commandExists($)
+{
+ my $command = shift;
+ my $devnull = File::Spec->devnull();
+ return `$command --version 2> $devnull`;
+}
+
sub determineQtFeatureDefaults()
{
return if %qtFeatureDefaults;
+ die "ERROR: qmake missing but required to build WebKit.\n" if not commandExists("qmake");
my $originalCwd = getcwd();
chdir File::Spec->catfile(sourceDir(), "WebCore");
my $defaults = `qmake CONFIG+=compute_defaults 2>&1`;
chdir $originalCwd;
- while ($defaults =~ m/(\S*?)=(.*?)( |$)/gi) {
+ while ($defaults =~ m/(\S+?)=(\S+?)/gi) {
$qtFeatureDefaults{$1}=$2;
}
}
@@ -649,8 +703,8 @@ sub determineIsQt()
return;
}
- # The presence of QTDIR only means Qt if --gtk is not on the command-line
- if (isGtk() || isWx()) {
+ # The presence of QTDIR only means Qt if --gtk or --wx or --efl are not on the command-line
+ if (isGtk() || isWx() || isEfl()) {
$isQt = 0;
return;
}
@@ -666,8 +720,18 @@ sub determineIsSymbian()
$isSymbian = 1;
return;
}
+}
- $isSymbian = defined($ENV{'EPOCROOT'});
+sub determineIsEfl()
+{
+ return if defined($isEfl);
+ $isEfl = checkForArgumentAndRemoveFromARGV("--efl");
+}
+
+sub isEfl()
+{
+ determineIsEfl();
+ return $isEfl;
}
sub isGtk()
@@ -739,6 +803,41 @@ sub isCygwin()
return ($^O eq "cygwin") || 0;
}
+sub determineWinVersion()
+{
+ return if $winVersion;
+
+ if (!isCygwin()) {
+ $winVersion = -1;
+ return;
+ }
+
+ my $versionString = `uname -s`;
+ $versionString =~ /(\d\.\d)/;
+ $winVersion = $1;
+}
+
+sub winVersion()
+{
+ determineWinVersion();
+ return $winVersion;
+}
+
+sub isWindows7()
+{
+ return winVersion() eq "6.1";
+}
+
+sub isWindowsVista()
+{
+ return winVersion() eq "6.0";
+}
+
+sub isWindowsXP()
+{
+ return winVersion() eq "5.1";
+}
+
sub isDarwin()
{
return ($^O eq "darwin") || 0;
@@ -761,7 +860,7 @@ sub isLinux()
sub isAppleWebKit()
{
- return !(isQt() or isGtk() or isWx() or isChromium());
+ return !(isQt() or isGtk() or isWx() or isChromium() or isEfl());
}
sub isAppleMacWebKit()
@@ -771,7 +870,7 @@ sub isAppleMacWebKit()
sub isAppleWinWebKit()
{
- return isAppleWebKit() && isCygwin();
+ return isAppleWebKit() && (isCygwin() || isWindows());
}
sub isPerianInstalled()
@@ -848,7 +947,7 @@ sub relativeScriptsDir()
sub launcherPath()
{
my $relativeScriptsPath = relativeScriptsDir();
- if (isGtk() || isQt() || isWx()) {
+ if (isGtk() || isQt() || isWx() || isEfl()) {
return "$relativeScriptsPath/run-launcher";
} elsif (isAppleWebKit()) {
return "$relativeScriptsPath/run-safari";
@@ -860,11 +959,13 @@ sub launcherName()
if (isGtk()) {
return "GtkLauncher";
} elsif (isQt()) {
- return "QtLauncher";
+ return "QtTestBrowser";
} elsif (isWx()) {
return "wxBrowser";
} elsif (isAppleWebKit()) {
return "Safari";
+ } elsif (isEfl()) {
+ return "EWebLauncher";
}
}
@@ -887,14 +988,13 @@ sub checkRequiredSystemConfig
print "http://developer.apple.com/tools/xcode\n";
print "*************************************************************\n";
}
- } elsif (isGtk() or isQt() or isWx()) {
+ } elsif (isGtk() or isQt() or isWx() or isEfl()) {
my @cmds = qw(flex bison gperf);
my @missing = ();
foreach my $cmd (@cmds) {
- if (not `$cmd --version`) {
- push @missing, $cmd;
- }
+ push @missing, $cmd if not commandExists($cmd);
}
+
if (@missing) {
my $list = join ", ", @missing;
die "ERROR: $list missing but required to build WebKit.\n";
@@ -906,8 +1006,8 @@ sub checkRequiredSystemConfig
sub determineWindowsSourceDir()
{
return if $windowsSourceDir;
- my $sourceDir = sourceDir();
- chomp($windowsSourceDir = `cygpath -w '$sourceDir'`);
+ $windowsSourceDir = sourceDir();
+ chomp($windowsSourceDir = `cygpath -w '$windowsSourceDir'`) if isCygwin();
}
sub windowsSourceDir()
@@ -967,25 +1067,25 @@ sub setupAppleWinEnv()
sub setupCygwinEnv()
{
- return if !isCygwin();
+ return if !isCygwin() && !isWindows();
return if $vcBuildPath;
my $vsInstallDir;
- my $programFilesPath = $ENV{'PROGRAMFILES'} || "C:\\Program Files";
+ my $programFilesPath = $ENV{'PROGRAMFILES(X86)'} || $ENV{'PROGRAMFILES'} || "C:\\Program Files";
if ($ENV{'VSINSTALLDIR'}) {
$vsInstallDir = $ENV{'VSINSTALLDIR'};
} else {
- $vsInstallDir = "$programFilesPath/Microsoft Visual Studio 8";
+ $vsInstallDir = File::Spec->catdir($programFilesPath, "Microsoft Visual Studio 8");
}
- $vsInstallDir = `cygpath "$vsInstallDir"`;
- chomp $vsInstallDir;
- $vcBuildPath = "$vsInstallDir/Common7/IDE/devenv.com";
+ chomp($vsInstallDir = `cygpath "$vsInstallDir"`) if isCygwin();
+ $vcBuildPath = File::Spec->catfile($vsInstallDir, qw(Common7 IDE devenv.com));
if (-e $vcBuildPath) {
# Visual Studio is installed; we can use pdevenv to build.
- $vcBuildPath = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts pdevenv));
+ # FIXME: Make pdevenv work with non-Cygwin Perl.
+ $vcBuildPath = File::Spec->catfile(sourceDir(), qw(WebKitTools Scripts pdevenv)) if isCygwin();
} else {
# Visual Studio not found, try VC++ Express
- $vcBuildPath = "$vsInstallDir/Common7/IDE/VCExpress.exe";
+ $vcBuildPath = File::Spec->catfile($vsInstallDir, qw(Common7 IDE VCExpress.exe));
if (! -e $vcBuildPath) {
print "*************************************************************\n";
print "Cannot find '$vcBuildPath'\n";
@@ -995,9 +1095,10 @@ sub setupCygwinEnv()
print "*************************************************************\n";
die;
}
+ $willUseVCExpressWhenBuilding = 1;
}
- my $qtSDKPath = "$programFilesPath/QuickTime SDK";
+ my $qtSDKPath = File::Spec->catdir($programFilesPath, "QuickTime SDK");
if (0 && ! -e $qtSDKPath) {
print "*************************************************************\n";
print "Cannot find '$qtSDKPath'\n";
@@ -1007,15 +1108,37 @@ sub setupCygwinEnv()
die;
}
- chomp($ENV{'WEBKITLIBRARIESDIR'} = `cygpath -wa "$sourceDir/WebKitLibraries/win"`) unless $ENV{'WEBKITLIBRARIESDIR'};
+ unless ($ENV{WEBKITLIBRARIESDIR}) {
+ $ENV{'WEBKITLIBRARIESDIR'} = File::Spec->catdir($sourceDir, "WebKitLibraries", "win");
+ chomp($ENV{WEBKITLIBRARIESDIR} = `cygpath -wa $ENV{WEBKITLIBRARIESDIR}`) if isCygwin();
+ }
- $windowsTmpPath = `cygpath -w /tmp`;
- chomp $windowsTmpPath;
print "Building results into: ", baseProductDir(), "\n";
print "WEBKITOUTPUTDIR is set to: ", $ENV{"WEBKITOUTPUTDIR"}, "\n";
print "WEBKITLIBRARIESDIR is set to: ", $ENV{"WEBKITLIBRARIESDIR"}, "\n";
}
+sub dieIfWindowsPlatformSDKNotInstalled
+{
+ my $registry32Path = "/proc/registry/";
+ my $registry64Path = "/proc/registry64/";
+ my $windowsPlatformSDKRegistryEntry = "HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/MicrosoftSDK/InstalledSDKs/D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1";
+
+ # FIXME: It would be better to detect whether we are using 32- or 64-bit Windows
+ # and only check the appropriate entry. But for now we just blindly check both.
+ return if (-e $registry32Path . $windowsPlatformSDKRegistryEntry) || (-e $registry64Path . $windowsPlatformSDKRegistryEntry);
+
+ print "*************************************************************\n";
+ print "Cannot find registry entry '$windowsPlatformSDKRegistryEntry'.\n";
+ print "Please download and install the Microsoft Windows Server 2003 R2\n";
+ print "Platform SDK from <http://www.microsoft.com/downloads/details.aspx?\n";
+ print "familyid=0baf2b35-c656-4969-ace8-e4c0c0716adb&displaylang=en>.\n\n";
+ print "Then follow step 2 in the Windows section of the \"Installing Developer\n";
+ print "Tools\" instructions at <http://www.webkit.org/building/tools.html>.\n";
+ print "*************************************************************\n";
+ die;
+}
+
sub copyInspectorFrontendFiles
{
my $productDir = productDir();
@@ -1033,6 +1156,9 @@ sub copyInspectorFrontendFiles
} elsif (isQt() || isGtk()) {
my $prefix = $ENV{"WebKitInstallationPrefix"};
$inspectorResourcesDirPath = (defined($prefix) ? $prefix : "/usr/share") . "/webkit-1.0/webinspector";
+ } elsif (isEfl()) {
+ my $prefix = $ENV{"WebKitInstallationPrefix"};
+ $inspectorResourcesDirPath = (defined($prefix) ? $prefix : "/usr/share") . "/ewebkit/webinspector";
}
if (! -d $inspectorResourcesDirPath) {
@@ -1045,7 +1171,7 @@ sub copyInspectorFrontendFiles
print "*************************************************************\n";
die;
}
- return system "rsync", "-aut", "--exclude=/.DS_Store", "--exclude=.svn/", !isQt() ? "--exclude=/WebKit.qrc" : "", $sourceInspectorPath, $inspectorResourcesDirPath;
+ return system "rsync", "-aut", "--exclude=/.DS_Store", "--exclude=*.re2js", "--exclude=.svn/", !isQt() ? "--exclude=/WebKit.qrc" : "", $sourceInspectorPath, $inspectorResourcesDirPath;
}
sub buildXCodeProject($$@)
@@ -1060,6 +1186,12 @@ sub buildXCodeProject($$@)
return system "xcodebuild", "-project", "$project.xcodeproj", @extraOptions;
}
+sub usingVisualStudioExpress()
+{
+ determineConfigurationForVisualStudio();
+ return $willUseVCExpressWhenBuilding;
+}
+
sub buildVisualStudioProject
{
my ($project, $clean) = @_;
@@ -1067,14 +1199,16 @@ sub buildVisualStudioProject
my $config = configurationForVisualStudio();
- chomp(my $winProjectPath = `cygpath -w "$project"`);
+ dieIfWindowsPlatformSDKNotInstalled() if $willUseVCExpressWhenBuilding;
+
+ chomp($project = `cygpath -w "$project"`) if isCygwin();
my $action = "/build";
if ($clean) {
$action = "/clean";
}
- my @command = ($vcBuildPath, $winProjectPath, $action, $config);
+ my @command = ($vcBuildPath, $project, $action, $config);
print join(" ", @command), "\n";
return system @command;
@@ -1162,7 +1296,7 @@ sub qtMakeCommand($)
#print "default spec: " . $mkspec . "\n";
#print "compiler found: " . $compiler . "\n";
- if ($compiler eq "cl") {
+ if ($compiler && $compiler eq "cl") {
return "nmake";
}
@@ -1177,6 +1311,21 @@ sub autotoolsFlag($$)
return $prefix . '-' . $feature;
}
+sub autogenArgumentsHaveChanged($@)
+{
+ my ($filename, @currentArguments) = @_;
+
+ if (! -e $filename) {
+ return 1;
+ }
+
+ open(AUTOTOOLS_ARGUMENTS, $filename);
+ chomp(my $previousArguments = <AUTOTOOLS_ARGUMENTS>);
+ close(AUTOTOOLS_ARGUMENTS);
+
+ return $previousArguments ne join(" ", @currentArguments);
+}
+
sub buildAutotoolsProject($@)
{
my ($clean, @buildParams) = @_;
@@ -1184,7 +1333,7 @@ sub buildAutotoolsProject($@)
my $make = 'make';
my $dir = productDir();
my $config = passedConfiguration() || configuration();
- my $prefix = $ENV{"WebKitInstallationPrefix"};
+ my $prefix;
my @buildArgs = ();
my $makeArgs = $ENV{"WebKitMakeArguments"} || "";
@@ -1192,11 +1341,20 @@ sub buildAutotoolsProject($@)
my $opt = $buildParams[$i];
if ($opt =~ /^--makeargs=(.*)/i ) {
$makeArgs = $makeArgs . " " . $1;
+ } elsif ($opt =~ /^--prefix=(.*)/i ) {
+ $prefix = $1;
} else {
push @buildArgs, $opt;
}
}
+ # Automatically determine the number of CPUs for make only
+ # if make arguments haven't already been specified.
+ if ($makeArgs eq "") {
+ $makeArgs = "-j" . numberOfCPUs();
+ }
+
+ $prefix = $ENV{"WebKitInstallationPrefix"} if !defined($prefix);
push @buildArgs, "--prefix=" . $prefix if defined($prefix);
# check if configuration is Debug
@@ -1212,31 +1370,37 @@ sub buildAutotoolsProject($@)
}
if (! -d $dir) {
- system "mkdir", "-p", "$dir";
- if (! -d $dir) {
- die "Failed to create build directory " . $dir;
- }
+ File::Path::mkpath($dir) or die "Failed to create build directory " . $dir
}
-
chdir $dir or die "Failed to cd into " . $dir . "\n";
- my $result;
if ($clean) {
- #$result = system $make, "distclean";
return 0;
}
- print "Calling configure in " . $dir . "\n\n";
- print "Installation directory: $prefix\n" if(defined($prefix));
+ # If GNUmakefile exists, don't run autogen.sh. The makefile should be
+ # smart enough to track autotools dependencies and re-run autogen.sh
+ # when build files change.
+ my $autogenArgumentsFile = "previous-autogen-arguments.txt";
+ my $result;
+ if (!(-e "GNUmakefile") or autogenArgumentsHaveChanged($autogenArgumentsFile, @buildArgs)) {
- # Make the path relative since it will appear in all -I compiler flags.
- # Long argument lists cause bizarre slowdowns in libtool.
- my $relSourceDir = File::Spec->abs2rel($sourceDir);
- $relSourceDir = "." if !$relSourceDir;
+ # Write autogen.sh arguments to a file so that we can detect
+ # when they change and automatically re-run it.
+ open(AUTOTOOLS_ARGUMENTS, ">$autogenArgumentsFile");
+ print AUTOTOOLS_ARGUMENTS join(" ", @buildArgs);
+ close(AUTOTOOLS_ARGUMENTS);
- $result = system "$relSourceDir/autogen.sh", @buildArgs;
- if ($result ne 0) {
- die "Failed to setup build environment using 'autotools'!\n";
+ print "Calling configure in " . $dir . "\n\n";
+ print "Installation prefix directory: $prefix\n" if(defined($prefix));
+
+ # Make the path relative since it will appear in all -I compiler flags.
+ # Long argument lists cause bizarre slowdowns in libtool.
+ my $relSourceDir = File::Spec->abs2rel($sourceDir) || ".";
+ $result = system "$relSourceDir/autogen.sh", @buildArgs;
+ if ($result ne 0) {
+ die "Failed to setup build environment using 'autotools'!\n";
+ }
}
$result = system "$make $makeArgs";
@@ -1248,6 +1412,75 @@ sub buildAutotoolsProject($@)
return $result;
}
+sub buildCMakeProject($@)
+{
+ my ($port, $clean, @buildParams) = @_;
+ my $dir = File::Spec->canonpath(baseProductDir());
+ my $config = configuration();
+ my $result;
+ my $makeArgs = "";
+ my @buildArgs;
+
+ $makeArgs .= " -j" . numberOfCPUs() if ($makeArgs !~ m/-j\s*\d+/);
+
+ if ($clean) {
+ print "Cleaning the build directory '$dir'\n";
+ $dir = File::Spec->catfile($dir, $config);
+ File::Path::remove_tree($dir, {keep_root => 1});
+ $result = 0;
+ } else {
+ my $cmakebin = "cmake";
+ my $make = "make";
+
+ push @buildArgs, "-DPORT=$port";
+
+ for my $i (0 .. $#buildParams) {
+ my $opt = $buildParams[$i];
+ if ($opt =~ /^--makeargs=(.*)/i ) {
+ $makeArgs = $1;
+ } elsif ($opt =~ /^--prefix=(.*)/i ) {
+ push @buildArgs, "-DCMAKE_INSTALL_PREFIX=$1";
+ } else {
+ push @buildArgs, $opt;
+ }
+ }
+
+ if ($config =~ m/debug/i) {
+ push @buildArgs, "-DCMAKE_BUILD_TYPE=Debug";
+ } elsif ($config =~ m/release/i) {
+ push @buildArgs, "-DCMAKE_BUILD_TYPE=Release";
+ }
+
+ push @buildArgs, sourceDir();
+
+ $dir = File::Spec->catfile($dir, $config);
+ File::Path::mkpath($dir);
+ chdir $dir or die "Failed to cd into " . $dir . "\n";
+
+ print "Calling '$cmakebin @buildArgs' in " . $dir . "\n\n";
+ my $result = system "$cmakebin @buildArgs";
+ if ($result ne 0) {
+ die "Failed while running $cmakebin to generate makefiles!\n";
+ }
+
+ print "Calling '$make $makeArgs' in " . $dir . "\n\n";
+ $result = system "$make $makeArgs";
+ if ($result ne 0) {
+ die "Failed to build $port port\n";
+ }
+
+ chdir ".." or die;
+ }
+
+ return $result;
+}
+
+sub buildCMakeEflProject($@)
+{
+ my ($clean, @buildArgs) = @_;
+ return buildCMakeProject("Efl", $clean, @buildArgs);
+}
+
sub buildQMakeProject($@)
{
my ($clean, @buildParams) = @_;
@@ -1256,6 +1489,8 @@ sub buildQMakeProject($@)
my $qmakebin = "qmake"; # Allow override of the qmake binary from $PATH
my $makeargs = "";
+ my $installHeaders;
+ my $installLibs;
for my $i (0 .. $#buildParams) {
my $opt = $buildParams[$i];
if ($opt =~ /^--qmake=(.*)/i ) {
@@ -1264,6 +1499,10 @@ sub buildQMakeProject($@)
push @buildArgs, $1;
} elsif ($opt =~ /^--makeargs=(.*)/i ) {
$makeargs = $1;
+ } elsif ($opt =~ /^--install-headers=(.*)/i ) {
+ $installHeaders = $1;
+ } elsif ($opt =~ /^--install-libs=(.*)/i ) {
+ $installLibs = $1;
} else {
push @buildArgs, $opt;
}
@@ -1271,7 +1510,8 @@ sub buildQMakeProject($@)
my $make = qtMakeCommand($qmakebin);
my $config = configuration();
- my $prefix = $ENV{"WebKitInstallationPrefix"};
+ push @buildArgs, "INSTALL_HEADERS=" . $installHeaders if defined($installHeaders);
+ push @buildArgs, "INSTALL_LIBS=" . $installLibs if defined($installLibs);
my $dir = File::Spec->canonpath(baseProductDir());
$dir = File::Spec->catfile($dir, $config) unless isSymbian();
File::Path::mkpath($dir);
@@ -1279,6 +1519,8 @@ sub buildQMakeProject($@)
print "Generating derived sources\n\n";
+ push @buildArgs, "OUTPUT_DIR=" . baseProductDir() . "/$config";
+
my @dsQmakeArgs = @buildArgs;
push @dsQmakeArgs, "-r";
push @dsQmakeArgs, sourceDir() . "/DerivedSources.pro";
@@ -1292,7 +1534,13 @@ sub buildQMakeProject($@)
my $dsMakefile = "Makefile.DerivedSources";
# Iterate over different source directories manually to workaround a problem with qmake+extraTargets+s60
- for my $subdir ("JavaScriptCore", "WebCore", "WebKit/qt/Api") {
+ my @subdirs = ("JavaScriptCore", "WebCore", "WebKit/qt/Api");
+ if (grep { $_ eq "CONFIG+=webkit2"} @buildArgs) {
+ push @subdirs, "WebKit2";
+ push @subdirs, "WebKitTools/WebKitTestRunner";
+ }
+
+ for my $subdir (@subdirs) {
print "Calling '$make $makeargs -f $dsMakefile generated_files' in " . $dir . "/$subdir\n\n";
if ($make eq "nmake") {
my $subdirWindows = $subdir;
@@ -1306,8 +1554,6 @@ sub buildQMakeProject($@)
}
}
- push @buildArgs, "OUTPUT_DIR=" . baseProductDir() . "/$config";
- push @buildArgs, sourceDir() . "/WebKit.pro";
if ($config =~ m/debug/i) {
push @buildArgs, "CONFIG-=release";
push @buildArgs, "CONFIG+=debug";
@@ -1322,14 +1568,27 @@ sub buildQMakeProject($@)
}
}
+ push @buildArgs, sourceDir() . "/WebKit.pro";
+
print "Calling '$qmakebin @buildArgs' in " . $dir . "\n\n";
- print "Installation directory: $prefix\n" if(defined($prefix));
+ print "Installation headers directory: $installHeaders\n" if(defined($installHeaders));
+ print "Installation libraries directory: $installLibs\n" if(defined($installLibs));
$result = system "$qmakebin @buildArgs";
if ($result ne 0) {
die "Failed to setup build environment using $qmakebin!\n";
}
+ # Manually create makefiles for the examples so we don't build by default
+ my $examplesDir = $dir . "/WebKit/qt/examples";
+ File::Path::mkpath($examplesDir);
+ $buildArgs[-1] = sourceDir() . "/WebKit/qt/examples/examples.pro";
+ chdir $examplesDir or die;
+ print "Calling '$qmakebin @buildArgs' in " . $examplesDir . "\n\n";
+ $result = system "$qmakebin @buildArgs";
+ die "Failed to create makefiles for the examples!\n" if $result ne 0;
+ chdir $dir or die;
+
if ($clean) {
print "Calling '$make $makeargs distclean' in " . $dir . "\n\n";
$result = system "$make $makeargs distclean";
@@ -1364,15 +1623,15 @@ sub buildGtkProject($$@)
return buildAutotoolsProject($clean, @buildArgs);
}
-sub buildChromiumMakefile($$$)
+sub buildChromiumMakefile($$)
{
- my ($dir, $target, $clean) = @_;
- chdir $dir;
+ my ($target, $clean) = @_;
if ($clean) {
return system qw(rm -rf out);
}
my $config = configuration();
- my @command = ("make", "-j4", "BUILDTYPE=$config", $target);
+ my $numCpus = numberOfCPUs();
+ my @command = ("make", "-fMakefile.chromium", "-j$numCpus", "BUILDTYPE=$config", $target);
print join(" ", @command) . "\n";
return system @command;
}
@@ -1396,6 +1655,19 @@ sub buildChromiumVisualStudioProject($$)
$vsInstallDir = `cygpath "$vsInstallDir"` if isCygwin();
chomp $vsInstallDir;
$vcBuildPath = "$vsInstallDir/Common7/IDE/devenv.com";
+ if (! -e $vcBuildPath) {
+ # Visual Studio not found, try VC++ Express
+ $vcBuildPath = "$vsInstallDir/Common7/IDE/VCExpress.exe";
+ if (! -e $vcBuildPath) {
+ print "*************************************************************\n";
+ print "Cannot find '$vcBuildPath'\n";
+ print "Please execute the file 'vcvars32.bat' from\n";
+ print "'$programFilesPath\\Microsoft Visual Studio 8\\VC\\bin\\'\n";
+ print "to setup the necessary environment variables.\n";
+ print "*************************************************************\n";
+ die;
+ }
+ }
# Create command line and execute it.
my @command = ($vcBuildPath, $projectPath, $action, $config);
@@ -1408,16 +1680,19 @@ sub buildChromium($@)
{
my ($clean, @options) = @_;
+ # We might need to update DEPS or re-run GYP if things have changed.
+ system("perl", "WebKitTools/Scripts/update-webkit-chromium") == 0 or die $!;
+
my $result = 1;
if (isDarwin()) {
# Mac build - builds the root xcode project.
- $result = buildXCodeProject("WebKit/chromium/WebKit", $clean, (@options));
+ $result = buildXCodeProject("WebKit/chromium/WebKit", $clean, "-configuration", configuration(), @options);
} elsif (isCygwin() || isWindows()) {
# Windows build - builds the root visual studio solution.
$result = buildChromiumVisualStudioProject("WebKit/chromium/WebKit.sln", $clean);
} elsif (isLinux()) {
# Linux build - build using make.
- $ result = buildChromiumMakefile("WebKit/chromium/", "all", $clean);
+ $ result = buildChromiumMakefile("all", $clean);
} else {
print STDERR "This platform is not supported by chromium.\n";
}
@@ -1454,7 +1729,7 @@ sub runSafari
my ($debugger) = @_;
if (isAppleMacWebKit()) {
- return system "$FindBin::Bin/gdb-safari", @ARGV if $debugger;
+ return system "$FindBin::Bin/gdb-safari", argumentsForConfiguration() if $debugger;
my $productDir = productDir();
print "Starting Safari with DYLD_FRAMEWORK_PATH set to point to built WebKit in $productDir.\n";
@@ -1468,17 +1743,115 @@ 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();
+ return 1;
+}
+
+sub runMiniBrowser
+{
+ if (isAppleMacWebKit()) {
+ my $productDir = productDir();
+ print "Starting MiniBrowser with DYLD_FRAMEWORK_PATH set to point to $productDir.\n";
+ $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+ $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
+ my $miniBrowserPath = "$productDir/MiniBrowser.app/Contents/MacOS/MiniBrowser";
+ if (!isTiger() && architecture()) {
+ return system "arch", "-" . architecture(), $miniBrowserPath, @ARGV;
+ } else {
+ return system $miniBrowserPath, @ARGV;
+ }
+ }
- my $debuggerFlag = $debugger ? "/debugger" : "";
- $result = system "cmd", "/c", "call $script $debuggerFlag";
- chdir $cwd;
- return $result;
+ return 1;
+}
+
+sub debugMiniBrowser
+{
+ if (isAppleMacWebKit()) {
+ my $gdbPath = "/usr/bin/gdb";
+ die "Can't find gdb executable. Is gdb installed?\n" unless -x $gdbPath;
+
+ my $productDir = productDir();
+
+ $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+ $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = 'YES';
+
+ my $miniBrowserPath = "$productDir/MiniBrowser.app/Contents/MacOS/MiniBrowser";
+
+ print "Starting MiniBrowser under gdb with DYLD_FRAMEWORK_PATH set to point to built WebKit2 in $productDir.\n";
+ my @architectureFlags = ("-arch", architecture()) if !isTiger();
+ exec $gdbPath, @architectureFlags, $miniBrowserPath or die;
+ return;
+ }
+
+ return 1;
+}
+
+sub runWebKitTestRunner
+{
+ if (isAppleMacWebKit()) {
+ my $productDir = productDir();
+ print "Starting WebKitTestRunner with DYLD_FRAMEWORK_PATH set to point to $productDir.\n";
+ $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+ $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
+ my $webKitTestRunnerPath = "$productDir/WebKitTestRunner";
+ if (!isTiger() && architecture()) {
+ return system "arch", "-" . architecture(), $webKitTestRunnerPath, @ARGV;
+ } else {
+ return system $webKitTestRunnerPath, @ARGV;
+ }
+ }
+
+ return 1;
+}
+
+sub debugWebKitTestRunner
+{
+ if (isAppleMacWebKit()) {
+ my $gdbPath = "/usr/bin/gdb";
+ die "Can't find gdb executable. Is gdb installed?\n" unless -x $gdbPath;
+
+ my $productDir = productDir();
+ $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+ $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = 'YES';
+
+ my $webKitTestRunnerPath = "$productDir/WebKitTestRunner";
+
+ print "Starting WebKitTestRunner under gdb with DYLD_FRAMEWORK_PATH set to point to $productDir.\n";
+ my @architectureFlags = ("-arch", architecture()) if !isTiger();
+ exec $gdbPath, @architectureFlags, $webKitTestRunnerPath or die;
+ return;
+ }
+
+ return 1;
+}
+
+sub runTestWebKitAPI
+{
+ if (isAppleMacWebKit()) {
+ my $productDir = productDir();
+ print "Starting TestWebKitAPI with DYLD_FRAMEWORK_PATH set to point to $productDir.\n";
+ $ENV{DYLD_FRAMEWORK_PATH} = $productDir;
+ $ENV{WEBKIT_UNSET_DYLD_FRAMEWORK_PATH} = "YES";
+ my $testWebKitAPIPath = "$productDir/TestWebKitAPI";
+ if (!isTiger() && architecture()) {
+ return system "arch", "-" . architecture(), $testWebKitAPIPath, @ARGV;
+ } else {
+ return system $testWebKitAPIPath, @ARGV;
+ }
}
return 1;
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl
index d21c706..a7282c7 100644
--- a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/fixChangeLogPatch.pl
@@ -1,6 +1,7 @@
#!/usr/bin/perl
#
# Copyright (C) 2009, 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+# Copyright (C) Research In Motion 2010. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -30,7 +31,10 @@
# Unit tests of VCSUtils::fixChangeLogPatch().
-use Test::Simple tests => 7;
+use strict;
+use warnings;
+
+use Test::More;
use VCSUtils;
# The source ChangeLog for these tests is the following:
@@ -53,14 +57,156 @@ use VCSUtils;
# * File:
# * File2:
-my $title;
-my $in;
-my $out;
-
-# New test
-$title = "fixChangeLogPatch: [no change] First line is new line.";
-
-$in = <<'END';
+my @testCaseHashRefs = (
+{ # New test
+ diffName => "fixChangeLogPatch: [no change] In-place change.",
+ inputText => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -1,5 +1,5 @@
+ 2010-12-22 Bob <bob@email.address>
+
+- Reviewed by Sue.
++ Reviewed by Ray.
+
+ Changed some code on 2010-12-22.
+END
+ expectedReturn => {
+ patch => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -1,5 +1,5 @@
+ 2010-12-22 Bob <bob@email.address>
+
+- Reviewed by Sue.
++ Reviewed by Ray.
+
+ Changed some code on 2010-12-22.
+END
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: [no change] Remove first entry.",
+ inputText => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -1,11 +1,3 @@
+-2010-12-22 Bob <bob@email.address>
+-
+- Reviewed by Ray.
+-
+- Changed some code on 2010-12-22.
+-
+- * File:
+-
+ 2010-12-22 Alice <alice@email.address>
+
+ Reviewed by Ray.
+END
+ expectedReturn => {
+ patch => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -1,11 +1,3 @@
+-2010-12-22 Bob <bob@email.address>
+-
+- Reviewed by Ray.
+-
+- Changed some code on 2010-12-22.
+-
+- * File:
+-
+ 2010-12-22 Alice <alice@email.address>
+
+ Reviewed by Ray.
+END
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: [no change] Remove entry in the middle.",
+ inputText => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@@ -7,10 +7,6 @@
+
+ * File:
+
+-2010-12-22 Bob <bob@email.address>
+-
+- Changed some code on 2010-12-22.
+-
+ 2010-12-22 Alice <alice@email.address>
+
+ Reviewed by Ray.
+END
+ expectedReturn => {
+ patch => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@@ -7,10 +7,6 @@
+
+ * File:
+
+-2010-12-22 Bob <bob@email.address>
+-
+- Changed some code on 2010-12-22.
+-
+ 2010-12-22 Alice <alice@email.address>
+
+ Reviewed by Ray.
+END
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: [no change] Far apart changes (i.e. more than one chunk).",
+ inputText => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -7,7 +7,7 @@
+
+ * File:
+
+-2010-12-22 Bob <bob@email.address>
++2010-12-22 Bobby <bob@email.address>
+
+ Changed some code on 2010-12-22.
+
+@@ -21,7 +21,7 @@
+
+ * File2:
+
+-2010-12-21 Bob <bob@email.address>
++2010-12-21 Bobby <bob@email.address>
+
+ Changed some code on 2010-12-21.
+END
+ expectedReturn => {
+ patch => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -7,7 +7,7 @@
+
+ * File:
+
+-2010-12-22 Bob <bob@email.address>
++2010-12-22 Bobby <bob@email.address>
+
+ Changed some code on 2010-12-22.
+
+@@ -21,7 +21,7 @@
+
+ * File2:
+
+-2010-12-21 Bob <bob@email.address>
++2010-12-21 Bobby <bob@email.address>
+
+ Changed some code on 2010-12-21.
+END
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: [no change] First line is new line.",
+ inputText => <<'END',
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,11 @@
@@ -76,13 +222,28 @@ $in = <<'END';
Reviewed by Ray.
END
-
-ok(fixChangeLogPatch($in) eq $in, $title);
-
-# New test
-$title = "fixChangeLogPatch: [no change] No date string.";
-
-$in = <<'END';
+ expectedReturn => {
+ patch => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -1,3 +1,11 @@
++2009-12-22 Bob <bob@email.address>
++
++ Reviewed by Ray.
++
++ Changed some more code on 2009-12-22.
++
++ * File:
++
+ 2009-12-22 Alice <alice@email.address>
+
+ Reviewed by Ray.
+END
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: [no change] No date string.",
+ inputText => <<'END',
--- ChangeLog
+++ ChangeLog
@@ -6,6 +6,7 @@
@@ -94,13 +255,24 @@ $in = <<'END';
2009-12-21 Alice <alice@email.address>
END
-
-ok(fixChangeLogPatch($in) eq $in, $title);
-
-# New test
-$title = "fixChangeLogPatch: [no change] New entry inserted in middle.";
-
-$in = <<'END';
+ expectedReturn => {
+ patch => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -6,6 +6,7 @@
+
+ * File:
+ * File2:
++ * File3:
+
+ 2009-12-21 Alice <alice@email.address>
+
+END
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: [no change] New entry inserted in middle.",
+ inputText => <<'END',
--- ChangeLog
+++ ChangeLog
@@ -11,6 +11,14 @@
@@ -119,13 +291,76 @@ $in = <<'END';
* File:
END
-
-ok(fixChangeLogPatch($in) eq $in, $title);
-
-# New test
-$title = "fixChangeLogPatch: Leading context includes first line.";
-
-$in = <<'END';
+ expectedReturn => {
+ hasOverlappingLines => 1,
+ patch => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -11,6 +11,14 @@
+
+ Reviewed by Ray.
+
++ Changed some more code on 2009-12-21.
++
++ * File:
++
++2009-12-21 Alice <alice@email.address>
++
++ Reviewed by Ray.
++
+ Changed some code on 2009-12-21.
+
+ * File:
+END
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: [no change] New entry inserted earlier in the file, but after an entry with the same author and date.",
+ inputText => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -70,6 +70,14 @@
+
+ 2009-12-22 Alice <alice@email.address>
+
++ Reviewed by Sue.
++
++ Changed some more code on 2009-12-22.
++
++ * File:
++
++2009-12-22 Alice <alice@email.address>
++
+ Reviewed by Ray.
+
+ Changed some code on 2009-12-22.
+END
+ expectedReturn => {
+ hasOverlappingLines => 1,
+ patch => <<'END',
+--- ChangeLog
++++ ChangeLog
+@@ -70,6 +70,14 @@
+
+ 2009-12-22 Alice <alice@email.address>
+
++ Reviewed by Sue.
++
++ Changed some more code on 2009-12-22.
++
++ * File:
++
++2009-12-22 Alice <alice@email.address>
++
+ Reviewed by Ray.
+
+ Changed some code on 2009-12-22.
+END
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: Leading context includes first line.",
+ inputText => <<'END',
--- ChangeLog
+++ ChangeLog
@@ -1,5 +1,13 @@
@@ -143,8 +378,8 @@ $in = <<'END';
Changed some code on 2009-12-22.
END
-
-$out = <<'END';
+ expectedReturn => {
+ patch => <<'END',
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,11 @@
@@ -160,13 +395,11 @@ $out = <<'END';
Reviewed by Ray.
END
-
-ok(fixChangeLogPatch($in) eq $out, $title);
-
-# New test
-$title = "fixChangeLogPatch: Leading context does not include first line.";
-
-$in = <<'END';
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: Leading context does not include first line.",
+ inputText => <<'END',
@@ -2,6 +2,14 @@
Reviewed by Ray.
@@ -183,8 +416,8 @@ $in = <<'END';
* File:
END
-
-$out = <<'END';
+ expectedReturn => {
+ patch => <<'END',
@@ -1,3 +1,11 @@
+2009-12-22 Alice <alice@email.address>
+
@@ -198,18 +431,17 @@ $out = <<'END';
Reviewed by Ray.
END
-
-ok(fixChangeLogPatch($in) eq $out, $title);
-
-# New test
-$title = "fixChangeLogPatch: Non-consecutive line additions.";
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: Non-consecutive line additions.",
# This can occur, for example, if the new ChangeLog entry includes
# trailing white space in the first blank line but not the second.
# A diff command can then match the second blank line of the new
# ChangeLog entry with the first blank line of the old.
# The svn diff command with the default --diff-cmd has done this.
-$in = <<'END';
+ inputText => <<'END',
@@ -1,5 +1,11 @@
2009-12-22 Alice <alice@email.address>
+ <pretend-whitespace>
@@ -223,8 +455,8 @@ $in = <<'END';
Changed some code on 2009-12-22.
END
-
-$out = <<'END';
+ expectedReturn => {
+ patch => <<'END',
@@ -1,3 +1,9 @@
+2009-12-22 Alice <alice@email.address>
+ <pretend-whitespace>
@@ -236,13 +468,11 @@ $out = <<'END';
Reviewed by Ray.
END
-
-ok(fixChangeLogPatch($in) eq $out, $title);
-
-# New test
-$title = "fixChangeLogPatch: Additional edits after new entry.";
-
-$in = <<'END';
+ }
+},
+{ # New test
+ diffName => "fixChangeLogPatch: Additional edits after new entry.",
+ inputText => <<'END',
@@ -2,10 +2,17 @@
Reviewed by Ray.
@@ -263,8 +493,8 @@ $in = <<'END';
2009-12-21 Alice <alice@email.address>
END
-
-$out = <<'END';
+ expectedReturn => {
+ patch => <<'END',
@@ -1,11 +1,18 @@
+2009-12-22 Alice <alice@email.address>
+
@@ -286,5 +516,18 @@ $out = <<'END';
2009-12-21 Alice <alice@email.address>
END
+ }
+},
+);
+
+my $testCasesCount = @testCaseHashRefs;
+plan(tests => $testCasesCount); # Total number of assertions.
-ok(fixChangeLogPatch($in) eq $out, $title);
+foreach my $testCase (@testCaseHashRefs) {
+ my $testNameStart = "fixChangeLogPatch(): $testCase->{diffName}: comparing";
+
+ my $got = VCSUtils::fixChangeLogPatch($testCase->{inputText});
+ my $expectedReturn = $testCase->{expectedReturn};
+
+ is_deeply($got, $expectedReturn, "$testNameStart return value.");
+}
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl
deleted file mode 100644
index 93708d6..0000000
--- a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/gitdiff2svndiff.pl
+++ /dev/null
@@ -1,117 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Copyright (C) 2009, 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
-# Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Unit tests of VCSUtils::gitdiff2svndiff()
-
-use strict;
-use warnings;
-
-use Test::Simple tests => 20;
-use VCSUtils;
-
-# We use this for display purposes, to keep each test title on one line.
-sub excerptString($)
-{
- my ($text) = @_;
-
- my $length = 25;
-
- my $shortened = substr($text, 0, $length);
- $shortened .= "..." if (length($text) > $length);
-
- return $shortened;
-}
-
-my $git_patch = <<END;
-diff --git a/WebCore/rendering/style/StyleFlexibleBoxData.h b/WebCore/rendering/style/StyleFlexibleBoxData.h
-index f5d5e74..3b6aa92 100644
---- a/WebCore/rendering/style/StyleFlexibleBoxData.h
-+++ b/WebCore/rendering/style/StyleFlexibleBoxData.h
-@@ -47,7 +47,6 @@ public:
-END
-
-my $svn_patch = <<END;
-Index: WebCore/rendering/style/StyleFlexibleBoxData.h
-===================================================================
---- WebCore/rendering/style/StyleFlexibleBoxData.h
-+++ WebCore/rendering/style/StyleFlexibleBoxData.h
-@@ -47,7 +47,6 @@ public:
-END
-
-my @gitLines = split("\n", $git_patch);
-my @svnLines = split("\n", $svn_patch);
-
-# New test: check each git header line with different line endings
-my $titleHeader = "gitdiff2svndiff: ";
-
-my @lineEndingPairs = ( # display name, value
- ["", ""],
- ["\\n", "\n"],
- ["\\r\\n", "\r\n"],
-);
-
-for (my $i = 0; $i < @gitLines; $i++) {
- foreach my $pair (@lineEndingPairs) {
- my $gitLine = $gitLines[$i] . $pair->[1];
- my $expected = $svnLines[$i] . $pair->[1];
- my $title = $titleHeader . excerptString($gitLine);
- $title .= " [line-end: \"$pair->[0]\"]";
-
- ok($expected eq gitdiff2svndiff($gitLine), $title);
- }
-}
-
-# New test
-my $title = "gitdiff2svndiff: Convert mnemonic git diff to svn diff";
-
-my @prefixes = (
- { 'a' => 'i', 'b' => 'w' }, # git-diff (compares the (i)ndex and the (w)ork tree)
- { 'a' => 'c', 'b' => 'w' }, # git-diff HEAD (compares a (c)ommit and the (w)ork tree)
- { 'a' => 'c', 'b' => 'i' }, # git diff --cached (compares a (c)ommit and the (i)ndex)
- { 'a' => 'o', 'b' => 'w' }, # git-diff HEAD:file1 file2 (compares an (o)bject and a (w)ork tree entity)
- { 'a' => '1', 'b' => '2' }, # git diff --no-index a b (compares two non-git things (1) and (2))
-);
-
-my $out = "";
-
-foreach my $prefix (@prefixes) {
- my $mnemonic_patch = $git_patch;
- $mnemonic_patch =~ s/ a\// $prefix->{'a'}\//g;
- $mnemonic_patch =~ s/ b\// $prefix->{'b'}\//g;
-
- $out = "";
- foreach my $line (split('\n', $mnemonic_patch)) {
- $out .= gitdiff2svndiff($line) . "\n";
- }
-
- ok($svn_patch eq $out, $title . " (" . $prefix->{'a'} . "," . $prefix->{'b'} . ")");
-}
-
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl
new file mode 100644
index 0000000..a226e43
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/mergeChangeLogs.pl
@@ -0,0 +1,336 @@
+#!/usr/bin/perl
+#
+# 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.
+
+# Unit tests of VCSUtils::mergeChangeLogs().
+
+use strict;
+
+use Test::Simple tests => 16;
+use File::Temp qw(tempfile);
+use VCSUtils;
+
+# Read contents of a file and return it.
+sub readFile($)
+{
+ my ($fileName) = @_;
+
+ local $/;
+ open(FH, "<", $fileName);
+ my $content = <FH>;
+ close(FH);
+
+ return $content;
+}
+
+# Write a temporary file and return the filename.
+sub writeTempFile($$$)
+{
+ my ($name, $extension, $content) = @_;
+
+ my ($FH, $fileName) = tempfile(
+ $name . "-XXXXXXXX",
+ DIR => ($ENV{'TMPDIR'} || "/tmp"),
+ UNLINK => 0,
+ );
+ print $FH $content;
+ close $FH;
+
+ if ($extension) {
+ my $newFileName = $fileName . $extension;
+ rename($fileName, $newFileName);
+ $fileName = $newFileName;
+ }
+
+ return $fileName;
+}
+
+# --------------------------------------------------------------------------------
+
+{
+ # New test
+ my $title = "mergeChangeLogs: traditional rejected patch success";
+
+ my $fileNewerContent = <<'EOF';
+2010-01-29 Mark Rowe <mrowe@apple.com>
+
+ Fix the Mac build.
+
+ Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Fix the ARM build.
+EOF
+ my $fileNewer = writeTempFile("file", "", $fileNewerContent);
+
+ my $fileMineContent = <<'EOF';
+***************
+*** 1,3 ****
+ 2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+--- 1,9 ----
++ 2010-01-29 Oliver Hunt <oliver@apple.com>
++
++ Reviewed by Darin Adler.
++
++ JSC is failing to propagate anonymous slot count on some transitions
++
+ 2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+EOF
+ my $fileMine = writeTempFile("file", ".rej", $fileMineContent);
+ rename($fileMine, $fileNewer . ".rej");
+ $fileMine = $fileNewer . ".rej";
+
+ my $fileOlderContent = $fileNewerContent;
+ my $fileOlder = writeTempFile("file", ".orig", $fileOlderContent);
+ rename($fileOlder, $fileNewer . ".orig");
+ $fileOlder = $fileNewer . ".orig";
+
+ my $exitStatus = mergeChangeLogs($fileMine, $fileOlder, $fileNewer);
+
+ # mergeChangeLogs() should return 1 since the patch succeeded.
+ ok($exitStatus == 1, "$title: should return 1 for success");
+
+ ok(readFile($fileMine) eq $fileMineContent, "$title: \$fileMine should be unchanged");
+ ok(readFile($fileOlder) eq $fileOlderContent, "$title: \$fileOlder should be unchanged");
+
+ my $expectedContent = <<'EOF';
+2010-01-29 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Darin Adler.
+
+ JSC is failing to propagate anonymous slot count on some transitions
+
+EOF
+ $expectedContent .= $fileNewerContent;
+ ok(readFile($fileNewer) eq $expectedContent, "$title: \$fileNewer should be updated to include patch");
+
+ unlink($fileMine, $fileOlder, $fileNewer);
+}
+
+# --------------------------------------------------------------------------------
+
+{
+ # New test
+ my $title = "mergeChangeLogs: traditional rejected patch failure";
+
+ my $fileNewerContent = <<'EOF';
+2010-01-29 Mark Rowe <mrowe@apple.com>
+
+ Fix the Mac build.
+
+ Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Fix the ARM build.
+EOF
+ my $fileNewer = writeTempFile("file", "", $fileNewerContent);
+
+ my $fileMineContent = <<'EOF';
+***************
+*** 1,9 ****
+- 2010-01-29 Oliver Hunt <oliver@apple.com>
+-
+- Reviewed by Darin Adler.
+-
+- JSC is failing to propagate anonymous slot count on some transitions
+-
+ 2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+--- 1,3 ----
+ 2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+EOF
+ my $fileMine = writeTempFile("file", ".rej", $fileMineContent);
+ rename($fileMine, $fileNewer . ".rej");
+ $fileMine = $fileNewer . ".rej";
+
+ my $fileOlderContent = $fileNewerContent;
+ my $fileOlder = writeTempFile("file", ".orig", $fileOlderContent);
+ rename($fileOlder, $fileNewer . ".orig");
+ $fileOlder = $fileNewer . ".orig";
+
+ my $exitStatus = mergeChangeLogs($fileMine, $fileOlder, $fileNewer);
+
+ # mergeChangeLogs() should return 0 since the patch failed.
+ ok($exitStatus == 0, "$title: should return 0 for failure");
+
+ ok(readFile($fileMine) eq $fileMineContent, "$title: \$fileMine should be unchanged");
+ ok(readFile($fileOlder) eq $fileOlderContent, "$title: \$fileOlder should be unchanged");
+ ok(readFile($fileNewer) eq $fileNewerContent, "$title: \$fileNewer should be unchanged");
+
+ unlink($fileMine, $fileOlder, $fileNewer);
+}
+
+# --------------------------------------------------------------------------------
+
+{
+ # New test
+ my $title = "mergeChangeLogs: patch succeeds";
+
+ my $fileMineContent = <<'EOF';
+2010-01-29 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Darin Adler.
+
+ JSC is failing to propagate anonymous slot count on some transitions
+
+2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Fix the ARM build.
+EOF
+ my $fileMine = writeTempFile("fileMine", "", $fileMineContent);
+
+ my $fileOlderContent = <<'EOF';
+2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Fix the ARM build.
+EOF
+ my $fileOlder = writeTempFile("fileOlder", "", $fileOlderContent);
+
+ my $fileNewerContent = <<'EOF';
+2010-01-29 Mark Rowe <mrowe@apple.com>
+
+ Fix the Mac build.
+
+ Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Fix the ARM build.
+EOF
+ my $fileNewer = writeTempFile("fileNewer", "", $fileNewerContent);
+
+ my $exitStatus = mergeChangeLogs($fileMine, $fileOlder, $fileNewer);
+
+ # mergeChangeLogs() should return 1 since the patch succeeded.
+ ok($exitStatus == 1, "$title: should return 1 for success");
+
+ ok(readFile($fileMine) eq $fileMineContent, "$title: \$fileMine should be unchanged");
+ ok(readFile($fileOlder) eq $fileOlderContent, "$title: \$fileOlder should be unchanged");
+
+ my $expectedContent = <<'EOF';
+2010-01-29 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Darin Adler.
+
+ JSC is failing to propagate anonymous slot count on some transitions
+
+EOF
+ $expectedContent .= $fileNewerContent;
+
+ ok(readFile($fileNewer) eq $expectedContent, "$title: \$fileNewer should be patched");
+
+ unlink($fileMine, $fileOlder, $fileNewer);
+}
+
+# --------------------------------------------------------------------------------
+
+{
+ # New test
+ my $title = "mergeChangeLogs: patch fails";
+
+ my $fileMineContent = <<'EOF';
+2010-01-29 Mark Rowe <mrowe@apple.com>
+
+ Fix the Mac build.
+
+ Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Fix the ARM build.
+EOF
+ my $fileMine = writeTempFile("fileMine", "", $fileMineContent);
+
+ my $fileOlderContent = <<'EOF';
+2010-01-29 Mark Rowe <mrowe@apple.com>
+
+ Fix the Mac build.
+
+ Disable ENABLE_INDEXED_DATABASE since it is "completely non-functional".
+
+2010-01-29 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Darin Adler.
+
+ JSC is failing to propagate anonymous slot count on some transitions
+
+2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Fix the ARM build.
+EOF
+ my $fileOlder = writeTempFile("fileOlder", "", $fileOlderContent);
+
+ my $fileNewerContent = <<'EOF';
+2010-01-29 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Darin Adler.
+
+ JSC is failing to propagate anonymous slot count on some transitions
+
+2010-01-29 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Maciej Stachowiak.
+
+ Fix the ARM build.
+EOF
+ my $fileNewer = writeTempFile("fileNewer", "", $fileNewerContent);
+
+ my $exitStatus = mergeChangeLogs($fileMine, $fileOlder, $fileNewer);
+
+ # mergeChangeLogs() should return a non-zero exit status since the patch failed.
+ ok($exitStatus == 0, "$title: return non-zero exit status for failure");
+
+ ok(readFile($fileMine) eq $fileMineContent, "$title: \$fileMine should be unchanged");
+ ok(readFile($fileOlder) eq $fileOlderContent, "$title: \$fileOlder should be unchanged");
+
+ # $fileNewer should still exist unchanged because the patch failed
+ ok(readFile($fileNewer) eq $fileNewerContent, "$title: \$fileNewer should be unchanged");
+
+ unlink($fileMine, $fileOlder, $fileNewer);
+}
+
+# --------------------------------------------------------------------------------
+
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl
index 2507d2d..9fe077f 100644
--- a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiff.pl
@@ -30,13 +30,6 @@ use warnings;
use Test::More;
use VCSUtils;
-my @diffHashRefKeys = ( # The $diffHashRef keys to check.
- "copiedFromPath",
- "indexPath",
- "sourceRevision",
- "svnConvertedText",
-);
-
# The array of test cases.
my @testCaseHashRefs = (
{
@@ -53,7 +46,8 @@ Index: Makefile
all:
END
- # Header keys to check
+ expectedReturn => [
+[{
svnConvertedText => <<'END', # Same as input text
Index: Makefile
===================================================================
@@ -65,12 +59,86 @@ Index: Makefile
all:
END
- copiedFromPath => undef,
indexPath => "Makefile",
+ isSvn => 1,
sourceRevision => "53052",
- # Other values to check
- lastReadLine => undef,
- nextLine => undef,
+}],
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "SVN: binary file (isBinary true)",
+ inputText => <<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END', # Same as input text
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ indexPath => "test_file.swf",
+ isBinary => 1,
+ isSvn => 1,
+}],
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "SVN: binary file (isBinary true) using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+),
+ expectedReturn => [
+[{
+ svnConvertedText => toWindowsLineEndings(<<'END', # Same as input text
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+),
+ indexPath => "test_file.swf",
+ isBinary => 1,
+ isSvn => 1,
+}],
+undef],
+ expectedNextLine => undef,
},
{
# New test
@@ -89,7 +157,8 @@ Index: Makefile
all:
END
- # Header keys to check
+ expectedReturn => [
+[{
svnConvertedText => <<'END', # Same as input text
LEADING JUNK
@@ -104,12 +173,12 @@ Index: Makefile
all:
END
- copiedFromPath => undef,
indexPath => "Makefile",
+ isSvn => 1,
sourceRevision => "53052",
- # Other values to check
- lastReadLine => undef,
- nextLine => undef,
+}],
+undef],
+ expectedNextLine => undef,
},
{
# New test
@@ -122,21 +191,14 @@ Index: Makefile_new
@@ -0,0 +1,1 @@
+MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKitTools
END
- # Header keys to check
- svnConvertedText => <<'END', # Same as input text
-Index: Makefile_new
-===================================================================
---- Makefile_new (revision 53131) (from Makefile:53131)
-+++ Makefile_new (working copy)
-@@ -0,0 +1,1 @@
-+MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKitTools
-END
+ expectedReturn => [
+[{
copiedFromPath => "Makefile",
indexPath => "Makefile_new",
sourceRevision => "53131",
- # Other values to check
- lastReadLine => undef,
- nextLine => undef,
+}],
+undef],
+ expectedNextLine => undef,
},
{
# New test
@@ -152,7 +214,8 @@ Index: Makefile_new
===================================================================
--- Makefile_new (revision 53131) (from Makefile:53131)
END
- # Header keys to check
+ expectedReturn => [
+[{
svnConvertedText => <<'END',
Index: Makefile
===================================================================
@@ -161,12 +224,12 @@ Index: Makefile
@@ -1,1 +0,0 @@
-MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKitTools
END
- copiedFromPath => undef,
indexPath => "Makefile",
+ isSvn => 1,
sourceRevision => "53131",
- # Other values to check
- lastReadLine => "Index: Makefile_new\n",
- nextLine => "===================================================================\n",
+}],
+"Index: Makefile_new\n"],
+ expectedNextLine => "===================================================================\n",
},
{
# New test
@@ -184,7 +247,8 @@ index f5d5e74..3b6aa92 100644
+++ b/Makefile
@@ -1,1 1,1 @@ public:
END
- # Header keys to check
+ expectedReturn => [
+[{
svnConvertedText => <<'END', # Same as input text
Index: Makefile
===================================================================
@@ -198,13 +262,702 @@ index f5d5e74..3b6aa92 100644
+++ b/Makefile
@@ -1,1 1,1 @@ public:
END
- copiedFromPath => undef,
indexPath => "Makefile",
+ isSvn => 1,
sourceRevision => "53131",
- # Other values to check
- lastReadLine => undef,
- nextLine => undef,
+}],
+undef],
+ expectedNextLine => undef,
+},
+####
+# Property Changes: Simple
+##
+{
+ # New test
+ diffName => "SVN: file change diff with property change diff",
+ inputText => <<'END',
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+Property changes on: Makefile
+___________________________________________________________________
+Name: svn:executable
+ + *
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END', # Same as input text
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+END
+ executableBitDelta => 1,
+ indexPath => "Makefile",
+ isSvn => 1,
+ sourceRevision => "60021",
+}],
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "SVN: file change diff, followed by property change diff on different file",
+ inputText => <<'END',
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+Property changes on: Makefile.shared
+___________________________________________________________________
+Name: svn:executable
+ + *
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END', # Same as input text
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+END
+ indexPath => "Makefile",
+ isSvn => 1,
+ sourceRevision => "60021",
+}],
+"Property changes on: Makefile.shared\n"],
+ expectedNextLine => "___________________________________________________________________\n",
+},
+{
+ # New test
+ diffName => "SVN: property diff, followed by file change diff",
+ inputText => <<'END',
+Property changes on: Makefile
+___________________________________________________________________
+Deleted: svn:executable
+ - *
+
+Index: Makefile.shared
+===================================================================
+--- Makefile.shared (revision 60021)
++++ Makefile.shared (working copy)
+@@ -1,3 +1,4 @@
++
+SCRIPTS_PATH ?= ../WebKitTools/Scripts
+XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()'` $(ARGS)
+END
+ expectedReturn => [
+[{
+ executableBitDelta => -1,
+ indexPath => "Makefile",
+ isSvn => 1,
+}],
+"Index: Makefile.shared\n"],
+ expectedNextLine => "===================================================================\n",
+},
+{
+ # New test
+ diffName => "SVN: property diff, followed by file change diff using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Property changes on: Makefile
+___________________________________________________________________
+Deleted: svn:executable
+ - *
+
+Index: Makefile.shared
+===================================================================
+--- Makefile.shared (revision 60021)
++++ Makefile.shared (working copy)
+@@ -1,3 +1,4 @@
++
+SCRIPTS_PATH ?= ../WebKitTools/Scripts
+XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()'` $(ARGS)
+END
+),
+ expectedReturn => [
+[{
+ executableBitDelta => -1,
+ indexPath => "Makefile",
+ isSvn => 1,
+}],
+"Index: Makefile.shared\r\n"],
+ expectedNextLine => "===================================================================\r\n",
+},
+{
+ # New test
+ diffName => "SVN: copied file with property change",
+ inputText => <<'END',
+Index: NMakefile
+===================================================================
+--- NMakefile (revision 60021) (from Makefile:60021)
++++ NMakefile (working copy)
+@@ -0,0 +1,1 @@
++MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+Property changes on: NMakefile
+___________________________________________________________________
+Added: svn:executable
+ + *
+END
+ expectedReturn => [
+[{
+ copiedFromPath => "Makefile",
+ executableBitDelta => 1,
+ indexPath => "NMakefile",
+ sourceRevision => "60021",
+}],
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "SVN: two consecutive property diffs",
+ inputText => <<'END',
+Property changes on: Makefile
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+
+Property changes on: Makefile.shared
+___________________________________________________________________
+Added: svn:executable
+ + *
+END
+ expectedReturn => [
+[{
+ executableBitDelta => 1,
+ indexPath => "Makefile",
+ isSvn => 1,
+}],
+"Property changes on: Makefile.shared\n"],
+ expectedNextLine => "___________________________________________________________________\n",
+},
+{
+ # New test
+ diffName => "SVN: two consecutive property diffs using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Property changes on: Makefile
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+
+Property changes on: Makefile.shared
+___________________________________________________________________
+Added: svn:executable
+ + *
+END
+),
+ expectedReturn => [
+[{
+ executableBitDelta => 1,
+ indexPath => "Makefile",
+ isSvn => 1,
+}],
+"Property changes on: Makefile.shared\r\n"],
+ expectedNextLine => "___________________________________________________________________\r\n",
+},
+####
+# Property Changes: Binary files
+##
+{
+ # New test
+ diffName => "SVN: binary file with executable bit change",
+ inputText => <<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+Name: svn:executable
+ + *
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END', # Same as input text
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ executableBitDelta => 1,
+ indexPath => "test_file.swf",
+ isBinary => 1,
+ isSvn => 1,
+}],
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "SVN: binary file with executable bit change usng Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+Name: svn:executable
+ + *
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+),
+ expectedReturn => [
+[{
+ svnConvertedText => toWindowsLineEndings(<<'END', # Same as input text
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+),
+ executableBitDelta => 1,
+ indexPath => "test_file.swf",
+ isBinary => 1,
+ isSvn => 1,
+}],
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "SVN: binary file followed by property change on different file",
+ inputText => <<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+
+Property changes on: Makefile
+___________________________________________________________________
+Added: svn:executable
+ + *
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END', # Same as input text
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+
+END
+ indexPath => "test_file.swf",
+ isBinary => 1,
+ isSvn => 1,
+}],
+"Property changes on: Makefile\n"],
+ expectedNextLine => "___________________________________________________________________\n",
+},
+{
+ # New test
+ diffName => "SVN: binary file followed by property change on different file using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+
+Property changes on: Makefile
+___________________________________________________________________
+Added: svn:executable
+ + *
+END
+),
+ expectedReturn => [
+[{
+ svnConvertedText => toWindowsLineEndings(<<'END', # Same as input text
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+
+END
+),
+ indexPath => "test_file.swf",
+ isBinary => 1,
+ isSvn => 1,
+}],
+"Property changes on: Makefile\r\n"],
+ expectedNextLine => "___________________________________________________________________\r\n",
+},
+{
+ # New test
+ diffName => "SVN: binary file followed by file change on different file",
+ inputText => <<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END', # Same as input text
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+
+END
+ indexPath => "test_file.swf",
+ isBinary => 1,
+ isSvn => 1,
+}],
+"Index: Makefile\n"],
+ expectedNextLine => "===================================================================\n",
+},
+{
+ # New test
+ diffName => "SVN: binary file followed by file change on different file using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+END
+),
+ expectedReturn => [
+[{
+ svnConvertedText => toWindowsLineEndings(<<'END', # Same as input text
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+
+END
+),
+ indexPath => "test_file.swf",
+ isBinary => 1,
+ isSvn => 1,
+}],
+"Index: Makefile\r\n"],
+ expectedNextLine => "===================================================================\r\n",
+},
+####
+# Property Changes: File change with property change
+##
+{
+ # New test
+ diffName => "SVN: file change diff with property change, followed by property change diff",
+ inputText => <<'END',
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+Property changes on: Makefile
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+
+Property changes on: Makefile.shared
+___________________________________________________________________
+Deleted: svn:executable
+ - *
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END', # Same as input text
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+
+
+END
+ executableBitDelta => 1,
+ indexPath => "Makefile",
+ isSvn => 1,
+ sourceRevision => "60021",
+}],
+"Property changes on: Makefile.shared\n"],
+ expectedNextLine => "___________________________________________________________________\n",
+},
+{
+ # New test
+ diffName => "SVN: file change diff with property change, followed by property change diff using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+Property changes on: Makefile
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+
+Property changes on: Makefile.shared
+___________________________________________________________________
+Deleted: svn:executable
+ - *
+END
+),
+ expectedReturn => [
+[{
+ svnConvertedText => toWindowsLineEndings(<<'END', # Same as input text
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+
+
+END
+),
+ executableBitDelta => 1,
+ indexPath => "Makefile",
+ isSvn => 1,
+ sourceRevision => "60021",
+}],
+"Property changes on: Makefile.shared\r\n"],
+ expectedNextLine => "___________________________________________________________________\r\n",
+},
+{
+ # New test
+ diffName => "SVN: file change diff with property change, followed by file change diff",
+ inputText => <<'END',
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+Property changes on: Makefile
+___________________________________________________________________
+Name: svn:executable
+ - *
+
+Index: Makefile.shared
+===================================================================
+--- Makefile.shared (revision 60021)
++++ Makefile.shared (working copy)
+@@ -1,3 +1,4 @@
++
+SCRIPTS_PATH ?= ../WebKitTools/Scripts
+XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()'` $(ARGS)
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END', # Same as input text
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+
+END
+ executableBitDelta => -1,
+ indexPath => "Makefile",
+ isSvn => 1,
+ sourceRevision => "60021",
+}],
+"Index: Makefile.shared\n"],
+ expectedNextLine => "===================================================================\n",
+},
+{
+ # New test
+ diffName => "SVN: file change diff with property change, followed by file change diff using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+Property changes on: Makefile
+___________________________________________________________________
+Name: svn:executable
+ - *
+
+Index: Makefile.shared
+===================================================================
+--- Makefile.shared (revision 60021)
++++ Makefile.shared (working copy)
+@@ -1,3 +1,4 @@
++
+SCRIPTS_PATH ?= ../WebKitTools/Scripts
+XCODE_OPTIONS = `perl -I$(SCRIPTS_PATH) -Mwebkitdirs -e 'print XcodeOptionString()'` $(ARGS)
+END
+),
+ expectedReturn => [
+[{
+ svnConvertedText => toWindowsLineEndings(<<'END', # Same as input text
+Index: Makefile
+===================================================================
+--- Makefile (revision 60021)
++++ Makefile (working copy)
+@@ -1,3 +1,4 @@
++
+ MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKit2 WebKitTools
+
+ all:
+
+
+END
+),
+ executableBitDelta => -1,
+ indexPath => "Makefile",
+ isSvn => 1,
+ sourceRevision => "60021",
+}],
+"Index: Makefile.shared\r\n"],
+ expectedNextLine => "===================================================================\r\n",
},
+####
+# Git test cases
+##
{
# New test
diffName => "Git: simple",
@@ -215,20 +968,82 @@ index f5d5e74..3b6aa92 100644
+++ b/Makefile
@@ -1,1 1,1 @@ public:
END
- # Header keys to check
+ expectedReturn => [
+[{
svnConvertedText => <<'END',
Index: Makefile
-===================================================================
+index f5d5e74..3b6aa92 100644
--- Makefile
+++ Makefile
@@ -1,1 1,1 @@ public:
END
- copiedFromPath => undef,
indexPath => "Makefile",
- sourceRevision => undef,
- # Other values to check
- lastReadLine => undef,
- nextLine => undef,
+ isGit => 1,
+}],
+undef],
+ expectedNextLine => undef,
+},
+{ # New test
+ diffName => "Git: new file",
+ inputText => <<'END',
+diff --git a/foo.h b/foo.h
+new file mode 100644
+index 0000000..3c9f114
+--- /dev/null
++++ b/foo.h
+@@ -0,0 +1,34 @@
++<html>
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END',
+Index: foo.h
+new file mode 100644
+index 0000000..3c9f114
+--- foo.h
++++ foo.h
+@@ -0,0 +1,34 @@
++<html>
+END
+ indexPath => "foo.h",
+ isGit => 1,
+ isNew => 1,
+}],
+"diff --git a/bar b/bar\n"],
+ expectedNextLine => "index d45dd40..3494526 100644\n",
+},
+{ # New test
+ diffName => "Git: file deletion",
+ inputText => <<'END',
+diff --git a/foo b/foo
+deleted file mode 100644
+index 1e50d1d..0000000
+--- a/foo
++++ /dev/null
+@@ -1,1 +0,0 @@
+-line1
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+[{
+ svnConvertedText => <<'END',
+Index: foo
+deleted file mode 100644
+index 1e50d1d..0000000
+--- foo
++++ foo
+@@ -1,1 +0,0 @@
+-line1
+END
+ indexPath => "foo",
+ isDeletion => 1,
+ isGit => 1,
+}],
+"diff --git a/bar b/bar\n"],
+ expectedNextLine => "index d45dd40..3494526 100644\n",
},
{
# New test
@@ -243,10 +1058,11 @@ Index: Makefile_new
===================================================================
--- Makefile_new (revision 53131) (from Makefile:53131)
END
- # Header keys to check
+ expectedReturn => [
+[{
svnConvertedText => <<'END',
Index: Makefile
-===================================================================
+index f5d5e74..3b6aa92 100644
--- Makefile
+++ Makefile
@@ -1,1 1,1 @@ public:
@@ -254,75 +1070,139 @@ Index: Makefile_new
===================================================================
--- Makefile_new (revision 53131) (from Makefile:53131)
END
- copiedFromPath => undef,
indexPath => "Makefile",
- sourceRevision => undef,
- # Other values to check
- lastReadLine => undef,
- nextLine => undef,
+ isGit => 1,
+}],
+undef],
+ expectedNextLine => undef,
+},
+####
+# Git test cases: file moves (multiple return values)
+##
+{
+ diffName => "Git: rename (with similarity index 100%)",
+ inputText => <<'END',
+diff --git a/foo b/foo_new
+similarity index 100%
+rename from foo
+rename to foo_new
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+[{
+ indexPath => "foo",
+ isDeletion => 1,
+},
+{
+ copiedFromPath => "foo",
+ indexPath => "foo_new",
+}],
+"diff --git a/bar b/bar\n"],
+ expectedNextLine => "index d45dd40..3494526 100644\n",
+},
+{
+ diffName => "rename (with similarity index < 100%)",
+ inputText => <<'END',
+diff --git a/foo b/foo_new
+similarity index 99%
+rename from foo
+rename to foo_new
+index 1e50d1d..1459d21 100644
+--- a/foo
++++ b/foo_new
+@@ -15,3 +15,4 @@ release r deployment dep deploy:
+ line1
+ line2
+ line3
++line4
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+[{
+ indexPath => "foo",
+ isDeletion => 1,
+},
+{
+ copiedFromPath => "foo",
+ indexPath => "foo_new",
+},
+{
+ indexPath => "foo_new",
+ isGit => 1,
+ svnConvertedText => <<'END',
+Index: foo_new
+similarity index 99%
+rename from foo
+rename to foo_new
+index 1e50d1d..1459d21 100644
+--- foo_new
++++ foo_new
+@@ -15,3 +15,4 @@ release r deployment dep deploy:
+ line1
+ line2
+ line3
++line4
+END
+}],
+"diff --git a/bar b/bar\n"],
+ expectedNextLine => "index d45dd40..3494526 100644\n",
+},
+{
+ diffName => "rename (with executable bit change)",
+ inputText => <<'END',
+diff --git a/foo b/foo_new
+old mode 100644
+new mode 100755
+similarity index 100%
+rename from foo
+rename to foo_new
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+[{
+ indexPath => "foo",
+ isDeletion => 1,
+},
+{
+ copiedFromPath => "foo",
+ indexPath => "foo_new",
+},
+{
+ executableBitDelta => 1,
+ indexPath => "foo_new",
+ isGit => 1,
+ svnConvertedText => <<'END',
+Index: foo_new
+old mode 100644
+new mode 100755
+similarity index 100%
+rename from foo
+rename to foo_new
+END
+}],
+"diff --git a/bar b/bar\n"],
+ expectedNextLine => "index d45dd40..3494526 100644\n",
},
);
-# Return the arguments for each assertion per test case.
-#
-# In particular, the number of assertions per test case is the length
-# of the return value of this subroutine on a sample input.
-#
-# Returns @assertionArgsArrayRefs:
-# $assertionArgsArrayRef: A reference to an array of parameters to pass
-# to each call to is(). The parameters are--
-# $got: The value obtained
-# $expected: The expected value
-# $testName: The name of the test
-sub testParseDiffAssertionArgs($)
-{
- my ($testCaseHashRef) = @_;
+my $testCasesCount = @testCaseHashRefs;
+plan(tests => 2 * $testCasesCount); # Total number of assertions.
- my $fileHandle;
- open($fileHandle, "<", \$testCaseHashRef->{inputText});
+foreach my $testCase (@testCaseHashRefs) {
+ my $testNameStart = "parseDiff(): $testCase->{diffName}: comparing";
+ my $fileHandle;
+ open($fileHandle, "<", \$testCase->{inputText});
my $line = <$fileHandle>;
- my ($diffHashRef, $lastReadLine) = VCSUtils::parseDiff($fileHandle, $line);
-
- my $testNameStart = "parseDiff(): [$testCaseHashRef->{diffName}] ";
-
- my @assertionArgsArrayRefs; # Return value
- my @assertionArgs;
- foreach my $diffHashRefKey (@diffHashRefKeys) {
- my $testName = "${testNameStart}key=\"$diffHashRefKey\"";
- @assertionArgs = ($diffHashRef->{$diffHashRefKey}, $testCaseHashRef->{$diffHashRefKey}, $testName);
- push(@assertionArgsArrayRefs, \@assertionArgs);
- }
-
- @assertionArgs = ($lastReadLine, $testCaseHashRef->{lastReadLine}, "${testNameStart}lastReadLine");
- push(@assertionArgsArrayRefs, \@assertionArgs);
-
- my $nextLine = <$fileHandle>;
- @assertionArgs = ($nextLine, $testCaseHashRef->{nextLine}, "${testNameStart}nextLine");
- push(@assertionArgsArrayRefs, \@assertionArgs);
-
- return @assertionArgsArrayRefs;
-}
-
-# Test parseDiff() for the given test case.
-sub testParseDiff($)
-{
- my ($testCaseHashRef) = @_;
-
- my @assertionArgsArrayRefs = testParseDiffAssertionArgs($testCaseHashRef);
-
- foreach my $arrayRef (@assertionArgsArrayRefs) {
- # The parameters are -- is($got, $expected, $testName).
- is($arrayRef->[0], $arrayRef->[1], $arrayRef->[2]);
- }
-}
-
-# Count the number of assertions per test case, using a sample test case.
-my $assertionCount = testParseDiffAssertionArgs($testCaseHashRefs[0]);
+ my @got = VCSUtils::parseDiff($fileHandle, $line);
+ my $expectedReturn = $testCase->{expectedReturn};
-plan(tests => @testCaseHashRefs * $assertionCount); # Total number of tests
+ is_deeply(\@got, $expectedReturn, "$testNameStart return value.");
-foreach my $testCaseHashRef (@testCaseHashRefs) {
- testParseDiff($testCaseHashRef);
+ my $gotNextLine = <$fileHandle>;
+ is($gotNextLine, $testCase->{expectedNextLine}, "$testNameStart next read line.");
}
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl
index a7a3c26..8c20f65 100644
--- a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl
@@ -36,68 +36,21 @@ use warnings;
use Test::More;
use VCSUtils;
-my @diffHeaderHashRefKeys = ( # The $diffHeaderHashRef keys to check.
- "copiedFromPath",
- "indexPath",
- "sourceRevision",
- "svnConvertedText",
-);
-
-# The array of test cases.
+# The unit tests for parseGitDiffHeader() and parseSvnDiffHeader()
+# already thoroughly test parsing each format.
+#
+# For parseDiffHeader(), it should suffice to verify that -- (1) for each
+# format, the method can return non-trivial values back for each key
+# supported by that format (e.g. "sourceRevision" for SVN), (2) the method
+# correctly sets default values when specific key-values are not set
+# (e.g. undef for "sourceRevision" for Git), and (3) key-values unique to
+# this method are set correctly (e.g. "scmFormat").
my @testCaseHashRefs = (
-{
- # New test
- diffName => "SVN: simple",
- inputText => <<'END',
-Index: WebKitTools/Scripts/VCSUtils.pm
-===================================================================
---- WebKitTools/Scripts/VCSUtils.pm (revision 53004)
-+++ WebKitTools/Scripts/VCSUtils.pm (working copy)
-@@ -32,6 +32,7 @@ use strict;
- use warnings;
-END
- # Header keys to check
- svnConvertedText => <<'END',
-Index: WebKitTools/Scripts/VCSUtils.pm
-===================================================================
---- WebKitTools/Scripts/VCSUtils.pm (revision 53004)
-+++ WebKitTools/Scripts/VCSUtils.pm (working copy)
-END
- copiedFromPath => undef,
- indexPath => "WebKitTools/Scripts/VCSUtils.pm",
- sourceRevision => "53004",
- # Other values to check
- lastReadLine => "@@ -32,6 +32,7 @@ use strict;\n",
- nextLine => " use warnings;\n",
-},
-{
- # New test
- diffName => "SVN: new file",
- inputText => <<'END',
-Index: WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl
-===================================================================
---- WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0)
-+++ WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0)
-@@ -0,0 +1,262 @@
-+#!/usr/bin/perl -w
-END
- # Header keys to check
- svnConvertedText => <<'END',
-Index: WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl
-===================================================================
---- WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0)
-+++ WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0)
-END
- copiedFromPath => undef,
- indexPath => "WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl",
- sourceRevision => undef,
- # Other values to check
- lastReadLine => "@@ -0,0 +1,262 @@\n",
- nextLine => "+#!/usr/bin/perl -w\n",
-},
-{
- # New test
- diffName => "SVN: copy",
+####
+# SVN test cases
+##
+{ # New test
+ diffName => "SVN: non-trivial copiedFromPath and sourceRevision values",
inputText => <<'END',
Index: index_path.py
===================================================================
@@ -106,7 +59,8 @@ Index: index_path.py
@@ -0,0 +1,7 @@
+# Python file...
END
- # Header keys to check
+ expectedReturn => [
+{
svnConvertedText => <<'END',
Index: index_path.py
===================================================================
@@ -115,174 +69,53 @@ Index: index_path.py
END
copiedFromPath => "copied_from_path.py",
indexPath => "index_path.py",
+ isSvn => 1,
sourceRevision => 53048,
- # Other values to check
- lastReadLine => "@@ -0,0 +1,7 @@\n",
- nextLine => "+# Python file...\n",
},
-{
- # New test
- diffName => "SVN: \\r\\n lines",
- inputText => <<END, # No single quotes to allow interpolation of "\r"
-Index: index_path.py\r
-===================================================================\r
---- index_path.py (revision 53048) (from copied_from_path.py:53048)\r
-+++ index_path.py (working copy)\r
-@@ -0,0 +1,7 @@\r
-+# Python file...\r
-END
- # Header keys to check
- svnConvertedText => <<END, # No single quotes to allow interpolation of "\r"
-Index: index_path.py\r
-===================================================================\r
---- index_path.py (revision 53048) (from copied_from_path.py:53048)\r
-+++ index_path.py (working copy)\r
-END
- copiedFromPath => "copied_from_path.py",
- indexPath => "index_path.py",
- sourceRevision => 53048,
- # Other values to check
- lastReadLine => "@@ -0,0 +1,7 @@\r\n",
- nextLine => "+# Python file...\r\n",
+"@@ -0,0 +1,7 @@\n"],
+ expectedNextLine => "+# Python file...\n",
},
-{
- # New test
- diffName => "SVN: path corrections",
+####
+# Git test cases
+##
+{ # New test case
+ diffName => "Git: Non-zero executable bit",
inputText => <<'END',
-Index: index_path.py
-===================================================================
---- bad_path (revision 53048) (from copied_from_path.py:53048)
-+++ bad_path (working copy)
-@@ -0,0 +1,7 @@
-+# Python file...
-END
- # Header keys to check
- svnConvertedText => <<'END',
-Index: index_path.py
-===================================================================
---- index_path.py (revision 53048) (from copied_from_path.py:53048)
-+++ index_path.py (working copy)
+diff --git a/foo.exe b/foo.exe
+old mode 100644
+new mode 100755
END
- copiedFromPath => "copied_from_path.py",
- indexPath => "index_path.py",
- sourceRevision => 53048,
- # Other values to check
- lastReadLine => "@@ -0,0 +1,7 @@\n",
- nextLine => "+# Python file...\n",
-},
+ expectedReturn => [
{
- # New test
- diffName => "Git: simple",
- inputText => <<'END',
-diff --git a/WebCore/rendering/style/StyleFlexibleBoxData.h b/WebCore/rendering/style/StyleFlexibleBoxData.h
-index f5d5e74..3b6aa92 100644
---- a/WebCore/rendering/style/StyleFlexibleBoxData.h
-+++ b/WebCore/rendering/style/StyleFlexibleBoxData.h
-@@ -47,7 +47,6 @@ public:
-END
- # Header keys to check
svnConvertedText => <<'END',
-Index: WebCore/rendering/style/StyleFlexibleBoxData.h
-===================================================================
---- WebCore/rendering/style/StyleFlexibleBoxData.h
-+++ WebCore/rendering/style/StyleFlexibleBoxData.h
+Index: foo.exe
+old mode 100644
+new mode 100755
END
- copiedFromPath => undef,
- indexPath => "WebCore/rendering/style/StyleFlexibleBoxData.h",
- sourceRevision => undef,
- # Other values to check
- lastReadLine => "@@ -47,7 +47,6 @@ public:\n",
- nextLine => undef,
+ executableBitDelta => 1,
+ indexPath => "foo.exe",
+ isGit => 1,
},
-{
- # New test
- diffName => "Git: unrecognized lines",
- inputText => <<'END',
-diff --git a/LayoutTests/http/tests/security/listener/xss-inactive-closure.html b/LayoutTests/http/tests/security/listener/xss-inactive-closure.html
-new file mode 100644
-index 0000000..3c9f114
---- /dev/null
-+++ b/LayoutTests/http/tests/security/listener/xss-inactive-closure.html
-@@ -0,0 +1,34 @@
-+<html>
-END
- # Header keys to check
- svnConvertedText => <<'END',
-Index: LayoutTests/http/tests/security/listener/xss-inactive-closure.html
-===================================================================
---- LayoutTests/http/tests/security/listener/xss-inactive-closure.html
-+++ LayoutTests/http/tests/security/listener/xss-inactive-closure.html
-END
- copiedFromPath => undef,
- indexPath => "LayoutTests/http/tests/security/listener/xss-inactive-closure.html",
- sourceRevision => undef,
- # Other values to check
- lastReadLine => "@@ -0,0 +1,34 @@\n",
- nextLine => "+<html>\n",
+undef],
+ expectedNextLine => undef,
},
);
-# Return the arguments for each assertion per test case.
-#
-# In particular, the number of assertions per test case is the length
-# of the return value of this subroutine on a sample input.
-#
-# Returns @assertionArgsArrayRefs:
-# $assertionArgsArrayRef: A reference to an array of parameters to pass
-# to each call to is(). The parameters are--
-# $got: The value obtained
-# $expected: The expected value
-# $testName: The name of the test
-sub testParseDiffHeaderAssertionArgs($)
-{
- my ($testCaseHashRef) = @_;
+my $testCasesCount = @testCaseHashRefs;
+plan(tests => 2 * $testCasesCount); # Total number of assertions.
- my $fileHandle;
- open($fileHandle, "<", \$testCaseHashRef->{inputText});
+foreach my $testCase (@testCaseHashRefs) {
+ my $testNameStart = "parseDiffHeader(): $testCase->{diffName}: comparing";
+ my $fileHandle;
+ open($fileHandle, "<", \$testCase->{inputText});
my $line = <$fileHandle>;
- my ($headerHashRef, $lastReadLine) = VCSUtils::parseDiffHeader($fileHandle, $line);
-
- my $testNameStart = "parseDiffHeader(): [$testCaseHashRef->{diffName}] ";
-
- my @assertionArgsArrayRefs; # Return value
- my @assertionArgs;
- foreach my $diffHeaderHashRefKey (@diffHeaderHashRefKeys) {
- my $testName = "${testNameStart}key=\"$diffHeaderHashRefKey\"";
- @assertionArgs = ($headerHashRef->{$diffHeaderHashRefKey}, $testCaseHashRef->{$diffHeaderHashRefKey}, $testName);
- push(@assertionArgsArrayRefs, \@assertionArgs);
- }
-
- @assertionArgs = ($lastReadLine, $testCaseHashRef->{lastReadLine}, "${testNameStart}lastReadLine");
- push(@assertionArgsArrayRefs, \@assertionArgs);
-
- my $nextLine = <$fileHandle>;
- @assertionArgs = ($nextLine, $testCaseHashRef->{nextLine}, "${testNameStart}nextLine");
- push(@assertionArgsArrayRefs, \@assertionArgs);
-
- return @assertionArgsArrayRefs;
-}
-
-# Test parseDiffHeader() for the given test case.
-sub testParseDiffHeader($)
-{
- my ($testCaseHashRef) = @_;
-
- my @assertionArgsArrayRefs = testParseDiffHeaderAssertionArgs($testCaseHashRef);
-
- foreach my $arrayRef (@assertionArgsArrayRefs) {
- # The parameters are -- is($got, $expected, $testName).
- is($arrayRef->[0], $arrayRef->[1], $arrayRef->[2]);
- }
-}
-
-# Count the number of assertions per test case to calculate the total number
-# of Test::More tests. We could have used any test case for the count.
-my $assertionCount = testParseDiffHeaderAssertionArgs($testCaseHashRefs[0]);
+ my @got = VCSUtils::parseDiffHeader($fileHandle, $line);
+ my $expectedReturn = $testCase->{expectedReturn};
-plan(tests => @testCaseHashRefs * $assertionCount); # Total number of tests
+ is_deeply(\@got, $expectedReturn, "$testNameStart return value.");
-foreach my $testCaseHashRef (@testCaseHashRefs) {
- testParseDiffHeader($testCaseHashRef);
+ my $gotNextLine = <$fileHandle>;
+ is($gotNextLine, $testCase->{expectedNextLine}, "$testNameStart next read line.");
}
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl
new file mode 100644
index 0000000..bc0d4d4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseGitDiffHeader.pl
@@ -0,0 +1,494 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+# Unit tests of parseGitDiffHeader().
+
+use strict;
+use warnings;
+
+use Test::More;
+use VCSUtils;
+
+# The array of test cases.
+my @testCaseHashRefs = (
+{ # New test
+ diffName => "Modified file",
+ inputText => <<'END',
+diff --git a/foo.h b/foo.h
+index f5d5e74..3b6aa92 100644
+--- a/foo.h
++++ b/foo.h
+@@ -1 +1 @@
+-file contents
++new file contents
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo.h
+index f5d5e74..3b6aa92 100644
+--- foo.h
++++ foo.h
+END
+ indexPath => "foo.h",
+},
+"@@ -1 +1 @@\n"],
+ expectedNextLine => "-file contents\n",
+},
+{ # New test
+ diffName => "new file",
+ inputText => <<'END',
+diff --git a/foo.h b/foo.h
+new file mode 100644
+index 0000000..3c9f114
+--- /dev/null
++++ b/foo.h
+@@ -0,0 +1,34 @@
++<html>
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo.h
+new file mode 100644
+index 0000000..3c9f114
+--- foo.h
++++ foo.h
+END
+ indexPath => "foo.h",
+ isNew => 1,
+},
+"@@ -0,0 +1,34 @@\n"],
+ expectedNextLine => "+<html>\n",
+},
+{ # New test
+ diffName => "file deletion",
+ inputText => <<'END',
+diff --git a/foo b/foo
+deleted file mode 100644
+index 1e50d1d..0000000
+--- a/foo
++++ /dev/null
+@@ -1,1 +0,0 @@
+-line1
+diff --git a/configure.ac b/configure.ac
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo
+deleted file mode 100644
+index 1e50d1d..0000000
+--- foo
++++ foo
+END
+ indexPath => "foo",
+ isDeletion => 1,
+},
+"@@ -1,1 +0,0 @@\n"],
+ expectedNextLine => "-line1\n",
+},
+{ # New test
+ diffName => "using --no-prefix",
+ inputText => <<'END',
+diff --git foo.h foo.h
+index c925780..9e65c43 100644
+--- foo.h
++++ foo.h
+@@ -1,3 +1,17 @@
++contents
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo.h
+index c925780..9e65c43 100644
+--- foo.h
++++ foo.h
+END
+ indexPath => "foo.h",
+},
+"@@ -1,3 +1,17 @@\n"],
+ expectedNextLine => "+contents\n",
+},
+####
+# Copy operations
+##
+{ # New test
+ diffName => "copy (with similarity index 100%)",
+ inputText => <<'END',
+diff --git a/foo b/foo_new
+similarity index 100%
+copy from foo
+copy to foo_new
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo_new
+similarity index 100%
+copy from foo
+copy to foo_new
+END
+ copiedFromPath => "foo",
+ indexPath => "foo_new",
+},
+"diff --git a/bar b/bar\n"],
+ expectedNextLine => "index d45dd40..3494526 100644\n",
+},
+{ # New test
+ diffName => "copy (with similarity index < 100%)",
+ inputText => <<'END',
+diff --git a/foo b/foo_new
+similarity index 99%
+copy from foo
+copy to foo_new
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo_new
+similarity index 99%
+copy from foo
+copy to foo_new
+END
+ copiedFromPath => "foo",
+ indexPath => "foo_new",
+ isCopyWithChanges => 1,
+},
+"diff --git a/bar b/bar\n"],
+ expectedNextLine => "index d45dd40..3494526 100644\n",
+},
+{ # New test
+ diffName => "rename (with similarity index 100%)",
+ inputText => <<'END',
+diff --git a/foo b/foo_new
+similarity index 100%
+rename from foo
+rename to foo_new
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo_new
+similarity index 100%
+rename from foo
+rename to foo_new
+END
+ copiedFromPath => "foo",
+ indexPath => "foo_new",
+ shouldDeleteSource => 1,
+},
+"diff --git a/bar b/bar\n"],
+ expectedNextLine => "index d45dd40..3494526 100644\n",
+},
+{ # New test
+ diffName => "rename (with similarity index < 100%)",
+ inputText => <<'END',
+diff --git a/foo b/foo_new
+similarity index 99%
+rename from foo
+rename to foo_new
+index 1e50d1d..1459d21 100644
+--- a/foo
++++ b/foo_new
+@@ -15,3 +15,4 @@ release r deployment dep deploy:
+ line1
+ line2
+ line3
++line4
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo_new
+similarity index 99%
+rename from foo
+rename to foo_new
+index 1e50d1d..1459d21 100644
+--- foo_new
++++ foo_new
+END
+ copiedFromPath => "foo",
+ indexPath => "foo_new",
+ isCopyWithChanges => 1,
+ shouldDeleteSource => 1,
+},
+"@@ -15,3 +15,4 @@ release r deployment dep deploy:\n"],
+ expectedNextLine => " line1\n",
+},
+{ # New test
+ diffName => "rename (with executable bit change)",
+ inputText => <<'END',
+diff --git a/foo b/foo_new
+old mode 100644
+new mode 100755
+similarity index 100%
+rename from foo
+rename to foo_new
+diff --git a/bar b/bar
+index d45dd40..3494526 100644
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo_new
+old mode 100644
+new mode 100755
+similarity index 100%
+rename from foo
+rename to foo_new
+END
+ copiedFromPath => "foo",
+ executableBitDelta => 1,
+ indexPath => "foo_new",
+ isCopyWithChanges => 1,
+ shouldDeleteSource => 1,
+},
+"diff --git a/bar b/bar\n"],
+ expectedNextLine => "index d45dd40..3494526 100644\n",
+},
+####
+# Binary file test cases
+##
+{
+ # New test case
+ diffName => "New binary file",
+ inputText => <<'END',
+diff --git a/foo.gif b/foo.gif
+new file mode 100644
+index 0000000000000000000000000000000000000000..64a9532e7794fcd791f6f12157406d9060151690
+GIT binary patch
+literal 7
+OcmYex&reDa;sO8*F9L)B
+
+literal 0
+HcmV?d00001
+
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo.gif
+new file mode 100644
+index 0000000000000000000000000000000000000000..64a9532e7794fcd791f6f12157406d9060151690
+GIT binary patch
+END
+ indexPath => "foo.gif",
+ isBinary => 1,
+ isNew => 1,
+},
+"literal 7\n"],
+ expectedNextLine => "OcmYex&reDa;sO8*F9L)B\n",
+},
+{
+ # New test case
+ diffName => "Deleted binary file",
+ inputText => <<'END',
+diff --git a/foo.gif b/foo.gif
+deleted file mode 100644
+index 323fae0..0000000
+GIT binary patch
+literal 0
+HcmV?d00001
+
+literal 7
+OcmYex&reDa;sO8*F9L)B
+
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo.gif
+deleted file mode 100644
+index 323fae0..0000000
+GIT binary patch
+END
+ indexPath => "foo.gif",
+ isBinary => 1,
+ isDeletion => 1,
+},
+"literal 0\n"],
+ expectedNextLine => "HcmV?d00001\n",
+},
+####
+# Executable bit test cases
+##
+{
+ # New test case
+ diffName => "Modified executable file",
+ inputText => <<'END',
+diff --git a/foo b/foo
+index d03e242..435ad3a 100755
+--- a/foo
++++ b/foo
+@@ -1 +1 @@
+-file contents
++new file contents
+
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo
+index d03e242..435ad3a 100755
+--- foo
++++ foo
+END
+ indexPath => "foo",
+},
+"@@ -1 +1 @@\n"],
+ expectedNextLine => "-file contents\n",
+},
+{
+ # New test case
+ diffName => "Making file executable (last diff)",
+ inputText => <<'END',
+diff --git a/foo.exe b/foo.exe
+old mode 100644
+new mode 100755
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo.exe
+old mode 100644
+new mode 100755
+END
+ executableBitDelta => 1,
+ indexPath => "foo.exe",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test case
+ diffName => "Making file executable (not last diff)",
+ inputText => <<'END',
+diff --git a/foo.exe b/foo.exe
+old mode 100644
+new mode 100755
+diff --git a/another_file.txt b/another_file.txt
+index d03e242..435ad3a 100755
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo.exe
+old mode 100644
+new mode 100755
+END
+ executableBitDelta => 1,
+ indexPath => "foo.exe",
+},
+"diff --git a/another_file.txt b/another_file.txt\n"],
+ expectedNextLine => "index d03e242..435ad3a 100755\n",
+},
+{
+ # New test case
+ diffName => "New executable file",
+ inputText => <<'END',
+diff --git a/foo b/foo
+new file mode 100755
+index 0000000..d03e242
+--- /dev/null
++++ b/foo
+@@ -0,0 +1 @@
++file contents
+
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo
+new file mode 100755
+index 0000000..d03e242
+--- foo
++++ foo
+END
+ executableBitDelta => 1,
+ indexPath => "foo",
+ isNew => 1,
+},
+"@@ -0,0 +1 @@\n"],
+ expectedNextLine => "+file contents\n",
+},
+{
+ # New test case
+ diffName => "Deleted executable file",
+ inputText => <<'END',
+diff --git a/foo b/foo
+deleted file mode 100755
+index d03e242..0000000
+--- a/foo
++++ /dev/null
+@@ -1 +0,0 @@
+-file contents
+
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: foo
+deleted file mode 100755
+index d03e242..0000000
+--- foo
++++ foo
+END
+ executableBitDelta => -1,
+ indexPath => "foo",
+ isDeletion => 1,
+},
+"@@ -1 +0,0 @@\n"],
+ expectedNextLine => "-file contents\n",
+},
+);
+
+my $testCasesCount = @testCaseHashRefs;
+plan(tests => 2 * $testCasesCount); # Total number of assertions.
+
+foreach my $testCase (@testCaseHashRefs) {
+ my $testNameStart = "parseGitDiffHeader(): $testCase->{diffName}: comparing";
+
+ my $fileHandle;
+ open($fileHandle, "<", \$testCase->{inputText});
+ my $line = <$fileHandle>;
+
+ my @got = VCSUtils::parseGitDiffHeader($fileHandle, $line);
+ my $expectedReturn = $testCase->{expectedReturn};
+
+ is_deeply(\@got, $expectedReturn, "$testNameStart return value.");
+
+ my $gotNextLine = <$fileHandle>;
+ is($gotNextLine, $testCase->{expectedNextLine}, "$testNameStart next read line.");
+}
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl
index e6f82ca..8aae3d4 100644
--- a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parsePatch.pl
@@ -69,14 +69,6 @@ END
sourceRevision => "53131",
},
{
- svnConvertedText => <<'END',
-Index: Makefile_new
-===================================================================
---- Makefile_new (revision 53131) (from Makefile:53131)
-+++ Makefile_new (working copy)
-@@ -0,0 +1,1 @@
-+MODULES = JavaScriptCore JavaScriptGlue WebCore WebKit WebKitTools
-END
copiedFromPath => "Makefile",
indexPath => "Makefile_new",
sourceRevision => "53131",
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl
new file mode 100644
index 0000000..4f05431
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffFooter.pl
@@ -0,0 +1,397 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) Research in Motion Limited 2010. All Rights Reserved.
+# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Unit tests of parseSvnDiffProperties().
+
+use strict;
+use warnings;
+
+use Test::More;
+use VCSUtils;
+
+my @testCaseHashRefs = (
+####
+# Simple test cases
+##
+{
+ # New test
+ diffName => "simple: add svn:executable",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: svn:executable
+ + *
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => 1,
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: add svn:mergeinfo",
+ inputText => <<'END',
+Property changes on: Makefile
+___________________________________________________________________
+Added: svn:mergeinfo
+ Merged /trunk/Makefile:r33020
+END
+ expectedReturn => [
+{
+ propertyPath => "Makefile",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: delete svn:mergeinfo",
+ inputText => <<'END',
+Property changes on: Makefile
+___________________________________________________________________
+Deleted: svn:mergeinfo
+ Reverse-merged /trunk/Makefile:r33020
+END
+ expectedReturn => [
+{
+ propertyPath => "Makefile",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: modified svn:mergeinfo",
+ inputText => <<'END',
+Property changes on: Makefile
+___________________________________________________________________
+Modified: svn:mergeinfo
+ Reverse-merged /trunk/Makefile:r33020
+ Merged /trunk/Makefile:r41697
+END
+ expectedReturn => [
+{
+ propertyPath => "Makefile",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: delete svn:executable",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Deleted: svn:executable
+ - *
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => -1,
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: delete svn:executable using SVN 1.4 syntax",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Name: svn:executable
+ - *
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => -1,
+},
+undef],
+ expectedNextLine => undef,
+},
+####
+# Property value followed by empty line and start of next diff
+##
+{
+ # New test
+ diffName => "add svn:executable, followed by empty line and start of next diff",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Index: Makefile.shared
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => 1,
+},
+"\n"],
+ expectedNextLine => "Index: Makefile.shared\n",
+},
+{
+ # New test
+ diffName => "add svn:executable, followed by empty line and start of next property diff",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Property changes on: Makefile.shared
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => 1,
+},
+"\n"],
+ expectedNextLine => "Property changes on: Makefile.shared\n",
+},
+####
+# Property value followed by empty line and start of the binary contents
+##
+{
+ # New test
+ diffName => "add svn:executable, followed by empty line and start of binary contents",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: svn:executable
+ + *
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => 1,
+},
+"\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\n",
+},
+{
+ # New test
+ diffName => "custom property followed by svn:executable, empty line and start of binary contents",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: documentation
+ + This is an example sentence.
+Added: svn:executable
+ + *
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => 1,
+},
+"\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\n",
+},
+####
+# Successive properties
+##
+{
+ # New test
+ diffName => "svn:executable followed by custom property",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: svn:executable
+ + *
+Added: documentation
+ + This is an example sentence.
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => 1,
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "custom property followed by svn:executable",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: documentation
+ + This is an example sentence.
+Added: svn:executable
+ + *
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => 1,
+},
+undef],
+ expectedNextLine => undef,
+},
+####
+# Successive properties followed by empty line and start of next diff
+##
+{
+ # New test
+ diffName => "custom property followed by svn:executable, empty line and start of next property diff",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: documentation
+ + This is an example sentence.
+Added: svn:executable
+ + *
+
+Property changes on: Makefile.shared
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => 1,
+},
+"\n"],
+ expectedNextLine => "Property changes on: Makefile.shared\n",
+},
+{
+ # New test
+ diffName => "custom property followed by svn:executable, empty line and start of next index diff",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: documentation
+ + This is an example sentence.
+Added: svn:executable
+ + *
+
+Index: Makefile.shared
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => 1,
+},
+"\n"],
+ expectedNextLine => "Index: Makefile.shared\n",
+},
+####
+# Custom properties
+##
+# FIXME: We do not support anything other than the svn:executable property.
+# We should add support for handling other properties.
+{
+ # New test
+ diffName => "simple: custom property",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Name: documentation
+ + This is an example sentence.
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "custom property followed by custom property",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: copyright
+ + Copyright (C) Research in Motion Limited 2010. All Rights Reserved.
+Added: documentation
+ + This is an example sentence.
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+},
+undef],
+ expectedNextLine => undef,
+},
+####
+# Malformed property diffs
+##
+# We shouldn't encounter such diffs in practice.
+{
+ # New test
+ diffName => "svn:executable followed by custom property and svn:executable",
+ inputText => <<'END',
+Property changes on: FileA
+___________________________________________________________________
+Added: svn:executable
+ + *
+Added: documentation
+ + This is an example sentence.
+Deleted: svn:executable
+ - *
+END
+ expectedReturn => [
+{
+ propertyPath => "FileA",
+ executableBitDelta => -1,
+},
+undef],
+ expectedNextLine => undef,
+},
+);
+
+my $testCasesCount = @testCaseHashRefs;
+plan(tests => 2 * $testCasesCount); # Total number of assertions.
+
+foreach my $testCase (@testCaseHashRefs) {
+ my $testNameStart = "parseSvnDiffProperties(): $testCase->{diffName}: comparing";
+
+ my $fileHandle;
+ open($fileHandle, "<", \$testCase->{inputText});
+ my $line = <$fileHandle>;
+
+ my @got = VCSUtils::parseSvnDiffProperties($fileHandle, $line);
+ my $expectedReturn = $testCase->{expectedReturn};
+
+ is_deeply(\@got, $expectedReturn, "$testNameStart return value.");
+
+ my $gotNextLine = <$fileHandle>;
+ is($gotNextLine, $testCase->{expectedNextLine}, "$testNameStart next read line.");
+}
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl
new file mode 100644
index 0000000..ed8550d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnDiffHeader.pl
@@ -0,0 +1,220 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Unit tests of parseSvnDiffHeader().
+
+use strict;
+use warnings;
+
+use Test::More;
+use VCSUtils;
+
+# The array of test cases.
+my @testCaseHashRefs = (
+{
+ # New test
+ diffName => "simple diff",
+ inputText => <<'END',
+Index: WebKitTools/Scripts/VCSUtils.pm
+===================================================================
+--- WebKitTools/Scripts/VCSUtils.pm (revision 53004)
++++ WebKitTools/Scripts/VCSUtils.pm (working copy)
+@@ -32,6 +32,7 @@ use strict;
+ use warnings;
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: WebKitTools/Scripts/VCSUtils.pm
+===================================================================
+--- WebKitTools/Scripts/VCSUtils.pm (revision 53004)
++++ WebKitTools/Scripts/VCSUtils.pm (working copy)
+END
+ indexPath => "WebKitTools/Scripts/VCSUtils.pm",
+ sourceRevision => "53004",
+},
+"@@ -32,6 +32,7 @@ use strict;\n"],
+ expectedNextLine => " use warnings;\n",
+},
+{
+ # New test
+ diffName => "new file",
+ inputText => <<'END',
+Index: WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl
+===================================================================
+--- WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0)
++++ WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0)
+@@ -0,0 +1,262 @@
++#!/usr/bin/perl -w
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl
+===================================================================
+--- WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0)
++++ WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl (revision 0)
+END
+ indexPath => "WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseDiffHeader.pl",
+ isNew => 1,
+},
+"@@ -0,0 +1,262 @@\n"],
+ expectedNextLine => "+#!/usr/bin/perl -w\n",
+},
+{
+ # New test
+ diffName => "copied file",
+ inputText => <<'END',
+Index: index_path.py
+===================================================================
+--- index_path.py (revision 53048) (from copied_from_path.py:53048)
++++ index_path.py (working copy)
+@@ -0,0 +1,7 @@
++# Python file...
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: index_path.py
+===================================================================
+--- index_path.py (revision 53048) (from copied_from_path.py:53048)
++++ index_path.py (working copy)
+END
+ copiedFromPath => "copied_from_path.py",
+ indexPath => "index_path.py",
+ sourceRevision => 53048,
+},
+"@@ -0,0 +1,7 @@\n"],
+ expectedNextLine => "+# Python file...\n",
+},
+{
+ # New test
+ diffName => "contains \\r\\n lines",
+ inputText => <<END, # No single quotes to allow interpolation of "\r"
+Index: index_path.py\r
+===================================================================\r
+--- index_path.py (revision 53048)\r
++++ index_path.py (working copy)\r
+@@ -0,0 +1,7 @@\r
++# Python file...\r
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<END, # No single quotes to allow interpolation of "\r"
+Index: index_path.py\r
+===================================================================\r
+--- index_path.py (revision 53048)\r
++++ index_path.py (working copy)\r
+END
+ indexPath => "index_path.py",
+ sourceRevision => 53048,
+},
+"@@ -0,0 +1,7 @@\r\n"],
+ expectedNextLine => "+# Python file...\r\n",
+},
+{
+ # New test
+ diffName => "contains path corrections",
+ inputText => <<'END',
+Index: index_path.py
+===================================================================
+--- bad_path (revision 53048) (from copied_from_path.py:53048)
++++ bad_path (working copy)
+@@ -0,0 +1,7 @@
++# Python file...
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: index_path.py
+===================================================================
+--- index_path.py (revision 53048) (from copied_from_path.py:53048)
++++ index_path.py (working copy)
+END
+ copiedFromPath => "copied_from_path.py",
+ indexPath => "index_path.py",
+ sourceRevision => 53048,
+},
+"@@ -0,0 +1,7 @@\n"],
+ expectedNextLine => "+# Python file...\n",
+},
+####
+# Binary test cases
+##
+{
+ # New test
+ diffName => "binary file",
+ inputText => <<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => [
+{
+ svnConvertedText => <<'END',
+Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+END
+ indexPath => "test_file.swf",
+ isBinary => 1,
+},
+"svn:mime-type = application/octet-stream\n"],
+ expectedNextLine => "\n",
+},
+);
+
+my $testCasesCount = @testCaseHashRefs;
+plan(tests => 2 * $testCasesCount); # Total number of assertions.
+
+foreach my $testCase (@testCaseHashRefs) {
+ my $testNameStart = "parseSvnDiffHeader(): $testCase->{diffName}: comparing";
+
+ my $fileHandle;
+ open($fileHandle, "<", \$testCase->{inputText});
+ my $line = <$fileHandle>;
+
+ my @got = VCSUtils::parseSvnDiffHeader($fileHandle, $line);
+ my $expectedReturn = $testCase->{expectedReturn};
+
+ is_deeply(\@got, $expectedReturn, "$testNameStart return value.");
+
+ my $gotNextLine = <$fileHandle>;
+ is($gotNextLine, $testCase->{expectedNextLine}, "$testNameStart next read line.");
+}
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl
new file mode 100644
index 0000000..6914051
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl
@@ -0,0 +1,743 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) Research in Motion Limited 2010. All Rights Reserved.
+# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Unit tests of parseSvnProperty().
+
+use strict;
+use warnings;
+
+use Test::More;
+use VCSUtils;
+
+my @testCaseHashRefs = (
+####
+# Simple test cases
+##
+{
+ # New test
+ diffName => "simple: add svn:executable",
+ inputText => <<'END',
+Added: svn:executable
+ + *
+END
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => 1,
+ value => "*",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: delete svn:executable",
+ inputText => <<'END',
+Deleted: svn:executable
+ - *
+END
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => -1,
+ value => "*",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: add svn:mergeinfo",
+ inputText => <<'END',
+Added: svn:mergeinfo
+ Merged /trunk/Makefile:r33020
+END
+ expectedReturn => [
+{
+ name => "svn:mergeinfo",
+ propertyChangeDelta => 1,
+ value => "/trunk/Makefile:r33020",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: delete svn:mergeinfo",
+ inputText => <<'END',
+Deleted: svn:mergeinfo
+ Reverse-merged /trunk/Makefile:r33020
+END
+ expectedReturn => [
+{
+ name => "svn:mergeinfo",
+ propertyChangeDelta => -1,
+ value => "/trunk/Makefile:r33020",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: modified svn:mergeinfo",
+ inputText => <<'END',
+Modified: svn:mergeinfo
+ Reverse-merged /trunk/Makefile:r33020
+ Merged /trunk/Makefile:r41697
+END
+ expectedReturn => [
+{
+ name => "svn:mergeinfo",
+ propertyChangeDelta => 1,
+ value => "/trunk/Makefile:r41697",
+},
+undef],
+ expectedNextLine => undef,
+},
+####
+# Using SVN 1.4 syntax
+##
+{
+ # New test
+ diffName => "simple: modified svn:mergeinfo using SVN 1.4 syntax",
+ inputText => <<'END',
+Name: svn:mergeinfo
+ Reverse-merged /trunk/Makefile:r33020
+ Merged /trunk/Makefile:r41697
+END
+ expectedReturn => [
+{
+ name => "svn:mergeinfo",
+ propertyChangeDelta => 1,
+ value => "/trunk/Makefile:r41697",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: delete svn:executable using SVN 1.4 syntax",
+ inputText => <<'END',
+Name: svn:executable
+ - *
+END
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => -1,
+ value => "*",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "simple: add svn:executable using SVN 1.4 syntax",
+ inputText => <<'END',
+Name: svn:executable
+ + *
+END
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => 1,
+ value => "*",
+},
+undef],
+ expectedNextLine => undef,
+},
+####
+# Property value followed by empty line and start of next diff
+##
+{
+ # New test
+ diffName => "add svn:executable, followed by empty line and start of next diff",
+ inputText => <<'END',
+Added: svn:executable
+ + *
+
+Index: Makefile.shared
+END
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => 1,
+ value => "*",
+},
+"\n"],
+ expectedNextLine => "Index: Makefile.shared\n",
+},
+{
+ # New test
+ diffName => "add svn:executable, followed by empty line and start of next diff using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Added: svn:executable
+ + *
+
+Index: Makefile.shared
+END
+),
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => 1,
+ value => "*",
+},
+"\r\n"],
+ expectedNextLine => "Index: Makefile.shared\r\n",
+},
+{
+ # New test
+ diffName => "add svn:executable, followed by empty line and start of next property diff",
+ inputText => <<'END',
+Added: svn:executable
+ + *
+
+Property changes on: Makefile.shared
+END
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => 1,
+ value => "*",
+},
+"\n"],
+ expectedNextLine => "Property changes on: Makefile.shared\n",
+},
+{
+ # New test
+ diffName => "add svn:executable, followed by empty line and start of next property diff using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Added: svn:executable
+ + *
+
+Property changes on: Makefile.shared
+END
+),
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => 1,
+ value => "*",
+},
+"\r\n"],
+ expectedNextLine => "Property changes on: Makefile.shared\r\n",
+},
+{
+ # New test
+ diffName => "multi-line '+' change, followed by empty line and start of next diff",
+ inputText => <<'END',
+Name: documentation
+ + A
+long sentence that spans
+multiple lines.
+
+Index: Makefile.shared
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A\nlong sentence that spans\nmultiple lines.",
+},
+"\n"],
+ expectedNextLine => "Index: Makefile.shared\n",
+},
+{
+ # New test
+ diffName => "multi-line '+' change, followed by empty line and start of next diff using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Name: documentation
+ + A
+long sentence that spans
+multiple lines.
+
+Index: Makefile.shared
+END
+),
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A\r\nlong sentence that spans\r\nmultiple lines.",
+},
+"\r\n"],
+ expectedNextLine => "Index: Makefile.shared\r\n",
+},
+{
+ # New test
+ diffName => "multi-line '+' change, followed by empty line and start of next property diff",
+ inputText => <<'END',
+Name: documentation
+ + A
+long sentence that spans
+multiple lines.
+
+Property changes on: Makefile.shared
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A\nlong sentence that spans\nmultiple lines.",
+},
+"\n"],
+ expectedNextLine => "Property changes on: Makefile.shared\n",
+},
+{
+ # New test
+ diffName => "multi-line '+' change, followed by empty line and start of next property diff using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Name: documentation
+ + A
+long sentence that spans
+multiple lines.
+
+Property changes on: Makefile.shared
+END
+),
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A\r\nlong sentence that spans\r\nmultiple lines.",
+},
+"\r\n"],
+ expectedNextLine => "Property changes on: Makefile.shared\r\n",
+},
+####
+# Property value followed by empty line and start of binary patch
+##
+{
+ # New test
+ diffName => "add svn:executable, followed by empty line and start of binary patch",
+ inputText => <<'END',
+Added: svn:executable
+ + *
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => 1,
+ value => "*",
+},
+"\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\n",
+},
+{
+ # New test
+ diffName => "add svn:executable, followed by empty line and start of binary patch using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Added: svn:executable
+ + *
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+),
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => 1,
+ value => "*",
+},
+"\r\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\r\n",
+},
+{
+ # New test
+ diffName => "multi-line '+' change, followed by empty line and start of binary patch",
+ inputText => <<'END',
+Name: documentation
+ + A
+long sentence that spans
+multiple lines.
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A\nlong sentence that spans\nmultiple lines.",
+},
+"\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\n",
+},
+{
+ # New test
+ diffName => "multi-line '+' change, followed by empty line and start of binary patch using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Name: documentation
+ + A
+long sentence that spans
+multiple lines.
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+),
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A\r\nlong sentence that spans\r\nmultiple lines.",
+},
+"\r\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\r\n",
+},
+{
+ # New test
+ diffName => "multi-line '-' change, followed by multi-line '+' change, empty line, and start of binary patch",
+ inputText => <<'END',
+Modified: documentation
+ - A
+long sentence that spans
+multiple lines.
+ + Another
+long sentence that spans
+multiple lines.
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "Another\nlong sentence that spans\nmultiple lines.",
+},
+"\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\n",
+},
+{
+ # New test
+ diffName => "multi-line '-' change, followed by multi-line '+' change, empty line, and start of binary patch using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Modified: documentation
+ - A
+long sentence that spans
+multiple lines.
+ + Another
+long sentence that spans
+multiple lines.
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+),
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "Another\r\nlong sentence that spans\r\nmultiple lines.",
+},
+"\r\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\r\n",
+},
+####
+# Successive properties
+##
+{
+ # New test
+ diffName => "single-line '+' change followed by custom property with single-line '+' change",
+ inputText => <<'END',
+Added: svn:executable
+ + *
+Added: documentation
+ + A sentence.
+END
+ expectedReturn => [
+{
+ name => "svn:executable",
+ propertyChangeDelta => 1,
+ value => "*",
+},
+"Added: documentation\n"],
+ expectedNextLine => " + A sentence.\n",
+},
+{
+ # New test
+ diffName => "multi-line '+' change, followed by svn:executable",
+ inputText => <<'END',
+Name: documentation
+ + A
+long sentence that spans
+multiple lines.
+Name: svn:executable
+ + *
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A\nlong sentence that spans\nmultiple lines.",
+},
+"Name: svn:executable\n"],
+ expectedNextLine => " + *\n",
+},
+{
+ # New test
+ diffName => "multi-line '-' change, followed by multi-line '+' change and add svn:executable",
+ inputText => <<'END',
+Modified: documentation
+ - A
+long sentence that spans
+multiple lines.
+ + Another
+long sentence that spans
+multiple lines.
+Added: svn:executable
+ + *
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "Another\nlong sentence that spans\nmultiple lines.",
+},
+"Added: svn:executable\n"],
+ expectedNextLine => " + *\n",
+},
+{
+ # New test
+ diffName => "'Merged' change followed by 'Merged' change",
+ inputText => <<'END',
+Added: svn:mergeinfo
+ Merged /trunk/Makefile:r33020
+ Merged /trunk/Makefile.shared:r58350
+END
+ expectedReturn => [
+{
+ name => "svn:mergeinfo",
+ propertyChangeDelta => 1,
+ value => "/trunk/Makefile.shared:r58350",
+},
+undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "'Reverse-merged' change followed by 'Reverse-merged' change",
+ inputText => <<'END',
+Deleted: svn:mergeinfo
+ Reverse-merged /trunk/Makefile:r33020
+ Reverse-merged /trunk/Makefile.shared:r58350
+END
+ expectedReturn => [
+{
+ name => "svn:mergeinfo",
+ propertyChangeDelta => -1,
+ value => "/trunk/Makefile.shared:r58350",
+},
+undef],
+ expectedNextLine => undef,
+},
+####
+# Property values with trailing new lines.
+##
+# FIXME: We do not support property values with trailing new lines, since it is difficult to
+# disambiguate them from the empty line that preceeds the contents of a binary patch as
+# in the test case (above): "multi-line '+' change, followed by empty line and start of binary patch".
+{
+ # New test
+ diffName => "single-line '+' with trailing new line",
+ inputText => <<'END',
+Added: documentation
+ + A sentence.
+
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A sentence.",
+},
+"\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "single-line '+' with trailing new line using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Added: documentation
+ + A sentence.
+
+END
+),
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A sentence.",
+},
+"\r\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "single-line '+' with trailing new line, followed by empty line and start of binary patch",
+ inputText => <<'END',
+Added: documentation
+ + A sentence.
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A sentence.",
+},
+"\n"],
+ expectedNextLine => "\n",
+},
+{
+ # New test
+ diffName => "single-line '+' with trailing new line, followed by empty line and start of binary patch using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Added: documentation
+ + A sentence.
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+),
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => 1,
+ value => "A sentence.",
+},
+"\r\n"],
+ expectedNextLine => "\r\n",
+},
+{
+ # New test
+ diffName => "single-line '-' change with trailing new line, and single-line '+' change",
+ inputText => <<'END',
+Modified: documentation
+ - A long sentence.
+
+ + A sentence.
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => -1, # Since we only interpret the '-' property.
+ value => "A long sentence.",
+},
+"\n"],
+ expectedNextLine => " + A sentence.\n",
+},
+{
+ # New test
+ diffName => "single-line '-' change with trailing new line, and single-line '+' change using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Modified: documentation
+ - A long sentence.
+
+ + A sentence.
+END
+),
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => -1, # Since we only interpret the '-' property.
+ value => "A long sentence.",
+},
+"\r\n"],
+ expectedNextLine => " + A sentence.\r\n",
+},
+{
+ # New test
+ diffName => "multi-line '-' change with trailing new line, and multi-line '+' change",
+ inputText => <<'END',
+Modified: documentation
+ - A
+long sentence that spans
+multiple lines.
+
+ + Another
+long sentence that spans
+multiple lines.
+END
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => -1, # Since we only interpret the '-' property.
+ value => "A\nlong sentence that spans\nmultiple lines.",
+},
+"\n"],
+ expectedNextLine => " + Another\n",
+},
+{
+ # New test
+ diffName => "multi-line '-' change with trailing new line, and multi-line '+' change using Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+Modified: documentation
+ - A
+long sentence that spans
+multiple lines.
+
+ + Another
+long sentence that spans
+multiple lines.
+END
+),
+ expectedReturn => [
+{
+ name => "documentation",
+ propertyChangeDelta => -1, # Since we only interpret the '-' property.
+ value => "A\r\nlong sentence that spans\r\nmultiple lines.",
+},
+"\r\n"],
+ expectedNextLine => " + Another\r\n",
+},
+);
+
+my $testCasesCount = @testCaseHashRefs;
+plan(tests => 2 * $testCasesCount); # Total number of assertions.
+
+foreach my $testCase (@testCaseHashRefs) {
+ my $testNameStart = "parseSvnProperty(): $testCase->{diffName}: comparing";
+
+ my $fileHandle;
+ open($fileHandle, "<", \$testCase->{inputText});
+ my $line = <$fileHandle>;
+
+ my @got = VCSUtils::parseSvnProperty($fileHandle, $line);
+ my $expectedReturn = $testCase->{expectedReturn};
+
+ is_deeply(\@got, $expectedReturn, "$testNameStart return value.");
+
+ my $gotNextLine = <$fileHandle>;
+ is($gotNextLine, $testCase->{expectedNextLine}, "$testNameStart next read line.");
+}
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl
new file mode 100644
index 0000000..2de8ae3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnPropertyValue.pl
@@ -0,0 +1,233 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) Research in Motion Limited 2010. All Rights Reserved.
+# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# its contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Unit tests of parseSvnPropertyValue().
+
+use strict;
+use warnings;
+
+use Test::More;
+use VCSUtils;
+
+my @testCaseHashRefs = (
+{
+ # New test
+ diffName => "singe-line '+' change",
+ inputText => <<'END',
+ + *
+END
+ expectedReturn => ["*", undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "single-line '-' change",
+ inputText => <<'END',
+ - *
+END
+ expectedReturn => ["*", undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "'Merged' change",
+ inputText => <<'END',
+ Merged /trunk/Makefile:r33020
+END
+ expectedReturn => ["/trunk/Makefile:r33020", undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "'Reverse-merged' change",
+ inputText => <<'END',
+ Reverse-merged /trunk/Makefile:r33020
+END
+ expectedReturn => ["/trunk/Makefile:r33020", undef],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "single-line '-' change followed by empty line with Unix line endings",
+ inputText => <<'END',
+ - *
+
+END
+ expectedReturn => ["*", "\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "single-line '-' change followed by empty line with Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+ - *
+
+END
+),
+ expectedReturn => ["*", "\r\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "single-line '-' change followed by the next property",
+ inputText => <<'END',
+ - *
+Deleted: svn:executable
+END
+ expectedReturn => ["*", "Deleted: svn:executable\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "multi-line '+' change and start of binary patch",
+ inputText => <<'END',
+ + A
+long sentence that spans
+multiple lines.
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+ expectedReturn => ["A\nlong sentence that spans\nmultiple lines.", "\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\n",
+},
+{
+ # New test
+ diffName => "multi-line '+' change and start of binary patch with Windows line endings",
+ inputText => toWindowsLineEndings(<<'END',
+ + A
+long sentence that spans
+multiple lines.
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+END
+),
+ expectedReturn => ["A\r\nlong sentence that spans\r\nmultiple lines.", "\r\n"],
+ expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\r\n",
+},
+{
+ # New test
+ diffName => "multi-line '-' change followed by '+' single-line change",
+ inputText => <<'END',
+ - A
+long sentence that spans
+multiple lines.
+ + A single-line.
+END
+ expectedReturn => ["A\nlong sentence that spans\nmultiple lines.", " + A single-line.\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "multi-line '-' change followed by the next property",
+ inputText => <<'END',
+ - A
+long sentence that spans
+multiple lines.
+Added: svn:executable
+END
+ expectedReturn => ["A\nlong sentence that spans\nmultiple lines.", "Added: svn:executable\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "multi-line '-' change followed by '+' multi-line change",
+ inputText => <<'END',
+ - A
+long sentence that spans
+multiple lines.
+ + Another
+long sentence that spans
+multiple lines.
+END
+ expectedReturn => ["A\nlong sentence that spans\nmultiple lines.", " + Another\n"],
+ expectedNextLine => "long sentence that spans\n",
+},
+{
+ # New test
+ diffName => "'Reverse-merged' change followed by 'Merge' change",
+ inputText => <<'END',
+ Reverse-merged /trunk/Makefile:r33020
+ Merged /trunk/Makefile:r41697
+END
+ expectedReturn => ["/trunk/Makefile:r33020", " Merged /trunk/Makefile:r41697\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "'Merged' change followed by 'Merge' change",
+ inputText => <<'END',
+ Merged /trunk/Makefile:r33020
+ Merged /trunk/Makefile.shared:r58350
+END
+ expectedReturn => ["/trunk/Makefile:r33020", " Merged /trunk/Makefile.shared:r58350\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "'Reverse-merged' change followed by 'Reverse-merged' change",
+ inputText => <<'END',
+ Reverse-merged /trunk/Makefile:r33020
+ Reverse-merged /trunk/Makefile.shared:r58350
+END
+ expectedReturn => ["/trunk/Makefile:r33020", " Reverse-merged /trunk/Makefile.shared:r58350\n"],
+ expectedNextLine => undef,
+},
+{
+ # New test
+ diffName => "'Reverse-merged' change followed by 'Reverse-merged' change followed by 'Merged' change",
+ inputText => <<'END',
+ Reverse-merged /trunk/Makefile:r33020
+ Reverse-merged /trunk/Makefile.shared:r58350
+ Merged /trunk/ChangeLog:r64190
+END
+ expectedReturn => ["/trunk/Makefile:r33020", " Reverse-merged /trunk/Makefile.shared:r58350\n"],
+ expectedNextLine => " Merged /trunk/ChangeLog:r64190\n",
+},
+);
+
+my $testCasesCount = @testCaseHashRefs;
+plan(tests => 2 * $testCasesCount); # Total number of assertions.
+
+foreach my $testCase (@testCaseHashRefs) {
+ my $testNameStart = "parseSvnPropertyValue(): $testCase->{diffName}: comparing";
+
+ my $fileHandle;
+ open($fileHandle, "<", \$testCase->{inputText});
+ my $line = <$fileHandle>;
+
+ my @got = VCSUtils::parseSvnPropertyValue($fileHandle, $line);
+ my $expectedReturn = $testCase->{expectedReturn};
+
+ is_deeply(\@got, $expectedReturn, "$testNameStart return value.");
+
+ my $gotNextLine = <$fileHandle>;
+ is($gotNextLine, $testCase->{expectedNextLine}, "$testNameStart next read line.");
+}
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/prepareParsedPatch.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/prepareParsedPatch.pl
new file mode 100644
index 0000000..a7ae807
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/prepareParsedPatch.pl
@@ -0,0 +1,136 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+# Unit tests of prepareParsedPatch().
+
+use strict;
+use warnings;
+
+use Test::More;
+use VCSUtils;
+
+my $diffHashRef1 = { # not a copy, no source revision
+ copiedFromPath => undef,
+ indexPath => "indexPath1",
+ sourceRevision => undef,
+ svnConvertedText => "diff1",
+};
+my $diffHashRef2 = { # not a copy, has source revision
+ copiedFromPath => undef,
+ indexPath => "indexPath2",
+ sourceRevision => 20,
+ svnConvertedText => "diff2",
+};
+my $diffHashRef3 = { # a copy (copies always have source revision)
+ copiedFromPath => "sourcePath3",
+ indexPath => "indexPath2", # Deliberately choosing same as $diffHashRef2
+ sourceRevision => 3,
+ svnConvertedText => "diff3",
+};
+
+my @testCases = (
+{
+ # New test
+ testName => "zero diffs: empty array",
+ diffHashRefsInput => [],
+ expected => {
+ copyDiffHashRefs => [],
+ nonCopyDiffHashRefs => [],
+ sourceRevisionHash => {},
+ },
+},
+{
+ # New test
+ testName => "one diff: non-copy, no revision",
+ diffHashRefsInput => [$diffHashRef1],
+ expected => {
+ copyDiffHashRefs => [],
+ nonCopyDiffHashRefs => [$diffHashRef1],
+ sourceRevisionHash => {},
+ },
+},
+{
+ # New test
+ testName => "one diff: non-copy, has revision",
+ diffHashRefsInput => [$diffHashRef2],
+ expected => {
+ copyDiffHashRefs => [],
+ nonCopyDiffHashRefs => [$diffHashRef2],
+ sourceRevisionHash => {
+ "indexPath2" => 20,
+ }
+ },
+},
+{
+ # New test
+ testName => "one diff: copy (has revision)",
+ diffHashRefsInput => [$diffHashRef3],
+ expected => {
+ copyDiffHashRefs => [$diffHashRef3],
+ nonCopyDiffHashRefs => [],
+ sourceRevisionHash => {
+ "sourcePath3" => 3,
+ }
+ },
+},
+{
+ # New test
+ testName => "two diffs: two non-copies",
+ diffHashRefsInput => [$diffHashRef1, $diffHashRef2],
+ expected => {
+ copyDiffHashRefs => [],
+ nonCopyDiffHashRefs => [$diffHashRef1, $diffHashRef2],
+ sourceRevisionHash => {
+ "indexPath2" => 20,
+ }
+ },
+},
+{
+ # New test
+ testName => "two diffs: non-copy and copy",
+ diffHashRefsInput => [$diffHashRef2, $diffHashRef3],
+ expected => {
+ copyDiffHashRefs => [$diffHashRef3],
+ nonCopyDiffHashRefs => [$diffHashRef2],
+ sourceRevisionHash => {
+ "sourcePath3" => 3,
+ "indexPath2" => 20,
+ }
+ },
+},
+);
+
+my $testCasesCount = @testCases;
+plan(tests => $testCasesCount);
+
+foreach my $testCase (@testCases) {
+ my $testName = $testCase->{testName};
+ my @diffHashRefs = @{$testCase->{diffHashRefsInput}};
+ my $expected = $testCase->{expected};
+
+ my $got = prepareParsedPatch(0, @diffHashRefs);
+
+ is_deeply($got, $expected, $testName);
+}
+
diff --git a/WebKitTools/Scripts/webkitpy/style/unittests.py b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl
index f8e3f71..8bd8e90 100644
--- a/WebKitTools/Scripts/webkitpy/style/unittests.py
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/removeEOL.pl
@@ -1,21 +1,21 @@
-#!/usr/bin/env python
+#!/usr/bin/perl
#
-# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+# Copyright (C) Research In Motion Limited 2010. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
-#
+#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
-# * Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+# * Neither the name of Research In Motion Limited nor the names of
# its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
-#
+#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -28,16 +28,29 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Runs style package unit tests."""
+# Unit tests of VCSUtils::removeEOL().
+
+use Test::Simple tests => 5;
+use VCSUtils;
+
+my $title;
+
+# New test
+$title = "removeEOL: Undefined argument.";
+ok(removeEOL(undef) eq "");
+
+# New test
+$title = "removeEOL: Line with Windows line ending.";
+ok(removeEOL("This line ends with a Windows line ending.\r\n") eq "This line ends with a Windows line ending.");
-# This module is imported by test-webkitpy.
+# New test
+$title = "removeEOL: Line with Unix line ending.";
+ok(removeEOL("This line ends with a Unix line ending.\n") eq "This line ends with a Unix line ending.");
-import sys
-import unittest
+# New test
+$title = "removeEOL: Line with Mac line ending.";
+ok(removeEOL("This line ends with a Mac line ending.\r") eq "This line ends with a Mac line ending.");
-from checker_unittest import *
-from error_handlers_unittest import *
-from filter_unittest import *
-from processors.common_unittest import *
-from processors.cpp_unittest import *
-from processors.text_unittest import *
+# New test
+$title = "removeEOL: Line with a mix of line endings.";
+ok(removeEOL("This line contains a mix of line endings.\r\n\r\n\r\r\n\n\n\n") eq "This line contains a mix of line endings.");
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl
index 8111def..5acc517 100644
--- a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/runPatchCommand.pl
@@ -33,19 +33,6 @@
use Test::Simple tests => 4;
use VCSUtils;
-# Call a function while suppressing STDERR.
-sub callSilently($@) {
- my ($func, @args) = @_;
-
- open(OLDERR, ">&STDERR");
- close(STDERR);
- my @returnValue = &$func(@args);
- open(STDERR, ">&OLDERR");
- close(OLDERR); # FIXME: Is this necessary?
-
- return @returnValue;
-}
-
# New test
$title = "runPatchCommand: Unsuccessful patch, forcing.";
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/setChangeLogDateAndReviewer.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/setChangeLogDateAndReviewer.pl
new file mode 100644
index 0000000..076d88c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/setChangeLogDateAndReviewer.pl
@@ -0,0 +1,128 @@
+#!/usr/bin/perl -w
+#
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+# Unit tests of setChangeLogDateAndReviewer().
+
+use strict;
+use warnings;
+
+use Test::More;
+use VCSUtils;
+
+my @testCaseHashRefs = (
+{
+ testName => "reviewer defined and \"NOBODY (OOPS!)\" in leading junk",
+ reviewer => "John Doe",
+ epochTime => 1273414321,
+ patch => <<'END',
+Subject: [PATCH]
+
+Reviewed by NOBODY (OOPS!).
+
+diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
+--- a/WebCore/ChangeLog
++++ b/WebCore/ChangeLog
+@@ -1,3 +1,15 @@
++2010-05-08 Chris Jerdonek <cjerdonek@webkit.org>
++
++ Reviewed by NOBODY (OOPS!).
++
+ 2010-05-08 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Jane Doe.
+END
+ expectedReturn => <<'END',
+Subject: [PATCH]
+
+Reviewed by NOBODY (OOPS!).
+
+diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
+--- a/WebCore/ChangeLog
++++ b/WebCore/ChangeLog
+@@ -1,3 +1,15 @@
++2010-05-09 Chris Jerdonek <cjerdonek@webkit.org>
++
++ Reviewed by John Doe.
++
+ 2010-05-08 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Jane Doe.
+END
+},
+{
+ testName => "reviewer not defined and \"NOBODY (OOPS!)\" in leading junk",
+ reviewer => undef,
+ epochTime => 1273414321,
+ patch => <<'END',
+Subject: [PATCH]
+
+Reviewed by NOBODY (OOPS!).
+
+diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
+--- a/WebCore/ChangeLog
++++ b/WebCore/ChangeLog
+@@ -1,3 +1,15 @@
++2010-05-08 Chris Jerdonek <cjerdonek@webkit.org>
++
++ Reviewed by NOBODY (OOPS!).
++
+ 2010-05-08 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Jane Doe.
+END
+ expectedReturn => <<'END',
+Subject: [PATCH]
+
+Reviewed by NOBODY (OOPS!).
+
+diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
+--- a/WebCore/ChangeLog
++++ b/WebCore/ChangeLog
+@@ -1,3 +1,15 @@
++2010-05-09 Chris Jerdonek <cjerdonek@webkit.org>
++
++ Reviewed by NOBODY (OOPS!).
++
+ 2010-05-08 Chris Jerdonek <cjerdonek@webkit.org>
+
+ Reviewed by Jane Doe.
+END
+},
+);
+
+my $testCasesCount = @testCaseHashRefs;
+plan(tests => 1 * $testCasesCount); # Total number of assertions.
+
+foreach my $testCase (@testCaseHashRefs) {
+ my $testNameStart = "setChangeLogDateAndReviewer(): $testCase->{testName}: comparing";
+
+ my $patch = $testCase->{patch};
+ my $reviewer = $testCase->{reviewer};
+ my $epochTime = $testCase->{epochTime};
+
+ my $got = VCSUtils::setChangeLogDateAndReviewer($patch, $reviewer, $epochTime);
+ my $expectedReturn = $testCase->{expectedReturn};
+
+ is($got, $expectedReturn, "$testNameStart return value.");
+}
diff --git a/WebKitTools/Scripts/webkitperl/features.pm b/WebKitTools/Scripts/webkitperl/features.pm
index 1f88022..7ca924b 100644
--- a/WebKitTools/Scripts/webkitperl/features.pm
+++ b/WebKitTools/Scripts/webkitperl/features.pm
@@ -72,6 +72,7 @@ sub hasFeature($$)
"3D Rendering" => "WebCoreHas3DRendering",
"3D Canvas" => "WebGLShader",
"WML" => "WMLElement",
+ "WCSS" => "parseWCSSInputProperty",
"XHTMLMP" => "isXHTMLMPDocument",
);
my $symbolName = $symbolForFeature{$featureName};
diff --git a/WebKitTools/Scripts/webkitperl/httpd.pm b/WebKitTools/Scripts/webkitperl/httpd.pm
index 05eb21c..b415db6 100644
--- a/WebKitTools/Scripts/webkitperl/httpd.pm
+++ b/WebKitTools/Scripts/webkitperl/httpd.pm
@@ -31,6 +31,7 @@
use strict;
use warnings;
+use File::Copy;
use File::Path;
use File::Spec;
use File::Spec::Functions;
@@ -153,19 +154,12 @@ sub openHTTPD(@)
close PIDFILE;
if (0 != kill 0, $oldPid) {
print "\nhttpd is already running: pid $oldPid, killing...\n";
- kill 15, $oldPid;
-
- my $retryCount = 20;
- while ((kill(0, $oldPid) != 0) && $retryCount) {
- sleep 1;
- --$retryCount;
- }
-
- if (!$retryCount) {
+ if (!killHTTPD($oldPid)) {
cleanUp();
die "Timed out waiting for httpd to quit";
}
}
+ unlink $httpdPidFile;
}
$httpdPath = "/usr/sbin/httpd" unless ($httpdPath);
@@ -195,22 +189,31 @@ sub openHTTPD(@)
sub closeHTTPD
{
close HTTPDIN;
- my $retryCount = 20;
- if ($httpdPid) {
- kill 15, $httpdPid;
- while (-f $httpdPidFile && $retryCount) {
- sleep 1;
- --$retryCount;
- }
- }
+ my $succeeded = killHTTPD($httpdPid);
cleanUp();
- if (!$retryCount) {
- print STDERR "Timed out waiting for httpd to terminate!\n";
+ unless ($succeeded) {
+ print STDERR "Timed out waiting for httpd to terminate!\n" unless $succeeded;
return 0;
}
return 1;
}
+sub killHTTPD
+{
+ my ($pid) = @_;
+
+ return 1 unless $pid;
+
+ kill 15, $pid;
+
+ my $retryCount = 20;
+ while (kill(0, $pid) && $retryCount) {
+ sleep 1;
+ --$retryCount;
+ }
+ return $retryCount != 0;
+}
+
sub setShouldWaitForUserInterrupt
{
$waitForUserInterrupt = 1;
@@ -218,7 +221,16 @@ sub setShouldWaitForUserInterrupt
sub handleInterrupt
{
- closeHTTPD();
+ # On Cygwin, when we receive a signal Apache is still running, so we need
+ # to kill it. On other platforms (at least Mac OS X), Apache will have
+ # already been killed, and trying to kill it again will cause us to hang.
+ # All we need to do in this case is clean up our own files.
+ if (isCygwin()) {
+ closeHTTPD();
+ } else {
+ cleanUp();
+ }
+
print "\n";
exit(1);
}
diff --git a/WebKitTools/Scripts/webkitpy/BeautifulSoup.pyc b/WebKitTools/Scripts/webkitpy/BeautifulSoup.pyc
deleted file mode 100644
index dffb144..0000000
--- a/WebKitTools/Scripts/webkitpy/BeautifulSoup.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/__init__.py b/WebKitTools/Scripts/webkitpy/__init__.py
index 94ecc70..b376bf2 100644
--- a/WebKitTools/Scripts/webkitpy/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/__init__.py
@@ -1,8 +1,13 @@
# Required for Python to search this directory for module files
-import autoinstall
-
-# List our third-party library dependencies here and where they can be
-# downloaded.
-autoinstall.bind("ClientForm", "http://pypi.python.org/packages/source/C/ClientForm/ClientForm-0.2.10.zip", "ClientForm-0.2.10")
-autoinstall.bind("mechanize", "http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip", "mechanize-0.1.11")
+# Keep this file free of any code or import statements that could
+# cause either an error to occur or a log message to be logged.
+# This ensures that calling code can import initialization code from
+# webkitpy before any errors or log messages due to code in this file.
+# Initialization code can include things like version-checking code and
+# logging configuration code.
+#
+# We do not execute any version-checking code or logging configuration
+# code in this file so that callers can opt-in as they want. This also
+# allows different callers to choose different initialization code,
+# as necessary.
diff --git a/WebKitTools/Scripts/webkitpy/__init__.pyc b/WebKitTools/Scripts/webkitpy/__init__.pyc
deleted file mode 100644
index d1ffa10..0000000
--- a/WebKitTools/Scripts/webkitpy/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/autoinstall.py b/WebKitTools/Scripts/webkitpy/autoinstall.py
deleted file mode 100644
index 467e6b4..0000000
--- a/WebKitTools/Scripts/webkitpy/autoinstall.py
+++ /dev/null
@@ -1,335 +0,0 @@
-# Copyright (c) 2009, Daniel Krech All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# * Neither the name of the Daniel Krech nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER 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.
-
-"""\
-package loader for auto installing Python packages.
-
-A package loader in the spirit of Zero Install that can be used to
-inject dependencies into the import process.
-
-
-To install::
-
- easy_install -U autoinstall
-
- or
-
- download, unpack, python setup.py install
-
- or
-
- try the bootstrap loader. See below.
-
-
-To use::
-
- # You can bind any package name to a URL pointing to something
- # that can be imported using the zipimporter.
-
- autoinstall.bind("pymarc", "http://pypi.python.org/packages/2.5/p/pymarc/pymarc-2.1-py2.5.egg")
-
- import pymarc
-
- print pymarc.__version__, pymarc.__file__
-
-
-Changelog::
-
-- added support for non top level packages.
-- cache files now use filename part from URL.
-- applied patch from Eric Seidel <eseidel@google.com> to add support
-for loading modules where the module is not at the root of the .zip
-file.
-
-
-TODO::
-
-- a description of the intended use case
-- address other issues pointed out in:
-
- http://mail.python.org/pipermail/python-dev/2008-March/077926.html
-
-Scribbles::
-
-pull vs. push
-user vs. system
-web vs. filesystem
-auto vs. manual
-
-manage development sandboxes
-
-optional interfaces...
-
- def get_data(pathname) -> string with file data.
-
- Return the data associated with 'pathname'. Raise IOError if
- the file wasn't found.");
-
- def is_package,
- "is_package(fullname) -> bool.
-
- Return True if the module specified by fullname is a package.
- Raise ZipImportError is the module couldn't be found.");
-
- def get_code,
- "get_code(fullname) -> code object.
-
- Return the code object for the specified module. Raise ZipImportError
- is the module couldn't be found.");
-
- def get_source,
- "get_source(fullname) -> source string.
-
- Return the source code for the specified module. Raise ZipImportError
- is the module couldn't be found, return None if the archive does
- contain the module, but has no source for it.");
-
-
-Autoinstall can also be bootstraped with the nascent package loader
-bootstrap module. For example::
-
- # or via the bootstrap
- # loader.
-
- try:
- _version = "0.2"
- import autoinstall
- if autoinstall.__version__ != _version:
- raise ImportError("A different version than expected found.")
- except ImportError, e:
- # http://svn.python.org/projects/sandbox/trunk/bootstrap/bootstrap.py
- import bootstrap
- pypi = "http://pypi.python.org"
- dir = "packages/source/a/autoinstall"
- url = "%s/%s/autoinstall-%s.tar.gz" % (pypi, dir, _version)
- bootstrap.main((url,))
- import autoinstall
-
-References::
-
- http://0install.net/
- http://www.python.org/dev/peps/pep-0302/
- http://svn.python.org/projects/sandbox/trunk/import_in_py
- http://0install.net/injector-find.html
- http://roscidus.com/desktop/node/903
-
-"""
-
-# To allow use of the "with" keyword for Python 2.5 users.
-from __future__ import with_statement
-
-__version__ = "0.2"
-__docformat__ = "restructuredtext en"
-
-import os
-import new
-import sys
-import urllib
-import logging
-import tempfile
-import zipimport
-
-_logger = logging.getLogger(__name__)
-
-
-_importer = None
-
-def _getImporter():
- global _importer
- if _importer is None:
- _importer = Importer()
- sys.meta_path.append(_importer)
- return _importer
-
-def bind(package_name, url, zip_subpath=None):
- """bind a top level package name to a URL.
-
- The package name should be a package name and the url should be a
- url to something that can be imported using the zipimporter.
-
- Optional zip_subpath parameter allows searching for modules
- below the root level of the zip file.
- """
- _getImporter().bind(package_name, url, zip_subpath)
-
-
-class Cache(object):
-
- def __init__(self, directory=None):
- if directory is None:
- # Default to putting the cache directory in the same directory
- # as this file.
- containing_directory = os.path.dirname(__file__)
- directory = os.path.join(containing_directory, "autoinstall.cache.d");
-
- self.directory = directory
- try:
- if not os.path.exists(self.directory):
- self._create_cache_directory()
- except Exception, err:
- _logger.exception(err)
- self.cache_directry = tempfile.mkdtemp()
- _logger.info("Using cache directory '%s'." % self.directory)
-
- def _create_cache_directory(self):
- _logger.debug("Creating cache directory '%s'." % self.directory)
- os.mkdir(self.directory)
- readme_path = os.path.join(self.directory, "README")
- with open(readme_path, "w") as f:
- f.write("This directory was auto-generated by '%s'.\n"
- "It is safe to delete.\n" % __file__)
-
- def get(self, url):
- _logger.info("Getting '%s' from cache." % url)
- filename = url.rsplit("/")[-1]
-
- # so that source url is significant in determining cache hits
- d = os.path.join(self.directory, "%s" % hash(url))
- if not os.path.exists(d):
- os.mkdir(d)
-
- filename = os.path.join(d, filename)
-
- if os.path.exists(filename):
- _logger.debug("... already cached in file '%s'." % filename)
- else:
- _logger.debug("... not in cache. Caching in '%s'." % filename)
- stream = file(filename, "wb")
- self.download(url, stream)
- stream.close()
- return filename
-
- def download(self, url, stream):
- _logger.info("Downloading: %s" % url)
- try:
- netstream = urllib.urlopen(url)
- code = 200
- if hasattr(netstream, "getcode"):
- code = netstream.getcode()
- if not 200 <= code < 300:
- raise ValueError("HTTP Error code %s" % code)
- except Exception, err:
- _logger.exception(err)
-
- BUFSIZE = 2**13 # 8KB
- size = 0
- while True:
- data = netstream.read(BUFSIZE)
- if not data:
- break
- stream.write(data)
- size += len(data)
- netstream.close()
- _logger.info("Downloaded %d bytes." % size)
-
-
-class Importer(object):
-
- def __init__(self):
- self.packages = {}
- self.__cache = None
-
- def __get_store(self):
- return self.__store
- store = property(__get_store)
-
- def _get_cache(self):
- if self.__cache is None:
- self.__cache = Cache()
- return self.__cache
- def _set_cache(self, cache):
- self.__cache = cache
- cache = property(_get_cache, _set_cache)
-
- def find_module(self, fullname, path=None):
- """-> self or None.
-
- Search for a module specified by 'fullname'. 'fullname' must be
- the fully qualified (dotted) module name. It returns the
- zipimporter instance itself if the module was found, or None if
- it wasn't. The optional 'path' argument is ignored -- it's
- there for compatibility with the importer protocol.");
- """
- _logger.debug("find_module(%s, path=%s)" % (fullname, path))
-
- if fullname in self.packages:
- (url, zip_subpath) = self.packages[fullname]
- filename = self.cache.get(url)
- zip_path = "%s/%s" % (filename, zip_subpath) if zip_subpath else filename
- _logger.debug("fullname: %s url: %s path: %s zip_path: %s" % (fullname, url, path, zip_path))
- try:
- loader = zipimport.zipimporter(zip_path)
- _logger.debug("returning: %s" % loader)
- except Exception, e:
- _logger.exception(e)
- return None
- return loader
- return None
-
- def bind(self, package_name, url, zip_subpath):
- _logger.info("binding: %s -> %s subpath: %s" % (package_name, url, zip_subpath))
- self.packages[package_name] = (url, zip_subpath)
-
-
-if __name__=="__main__":
- import logging
- #logging.basicConfig()
- logger = logging.getLogger()
-
- console = logging.StreamHandler()
- console.setLevel(logging.DEBUG)
- # set a format which is simpler for console use
- formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')
- # tell the handler to use this format
- console.setFormatter(formatter)
- # add the handler to the root logger
- logger.addHandler(console)
- logger.setLevel(logging.INFO)
-
- bind("pymarc", "http://pypi.python.org/packages/2.5/p/pymarc/pymarc-2.1-py2.5.egg")
-
- import pymarc
-
- print pymarc.__version__, pymarc.__file__
-
- assert pymarc.__version__=="2.1"
-
- d = _getImporter().cache.directory
- assert d in pymarc.__file__, "'%s' not found in pymarc.__file__ (%s)" % (d, pymarc.__file__)
-
- # Can now also bind to non top level packages. The packages
- # leading up to the package being bound will need to be defined
- # however.
- #
- # bind("rdf.plugins.stores.memory",
- # "http://pypi.python.org/packages/2.5/r/rdf.plugins.stores.memeory/rdf.plugins.stores.memory-0.9a-py2.5.egg")
- #
- # from rdf.plugins.stores.memory import Memory
-
-
diff --git a/WebKitTools/Scripts/webkitpy/autoinstall.pyc b/WebKitTools/Scripts/webkitpy/autoinstall.pyc
deleted file mode 100644
index 68e46fd..0000000
--- a/WebKitTools/Scripts/webkitpy/autoinstall.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/bugzilla.pyc b/WebKitTools/Scripts/webkitpy/bugzilla.pyc
deleted file mode 100644
index dfde47c..0000000
--- a/WebKitTools/Scripts/webkitpy/bugzilla.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/buildbot.py b/WebKitTools/Scripts/webkitpy/buildbot.py
deleted file mode 100644
index 38828fd..0000000
--- a/WebKitTools/Scripts/webkitpy/buildbot.py
+++ /dev/null
@@ -1,133 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# WebKit's Python module for interacting with WebKit's buildbot
-
-import re
-import urllib2
-
-# Import WebKit-specific modules.
-from webkitpy.webkit_logging import log
-
-# WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy
-# so this import should always succeed.
-from .BeautifulSoup import BeautifulSoup
-
-
-class BuildBot:
-
- default_host = "build.webkit.org"
-
- def __init__(self, host=default_host):
- self.buildbot_host = host
- self.buildbot_server_url = "http://%s/" % self.buildbot_host
-
- # If any Leopard builder/tester, Windows builder or Chromium builder is
- # red we should not be landing patches. Other builders should be added
- # to this list once they are known to be reliable.
- # See https://bugs.webkit.org/show_bug.cgi?id=33296 and related bugs.
- self.core_builder_names_regexps = [
- "Leopard",
- "Windows.*Build",
- "Chromium",
- ]
-
- def _parse_builder_status_from_row(self, status_row):
- # If WebKit's buildbot has an XMLRPC interface we could use, we could
- # do something more sophisticated here. For now we just parse out the
- # basics, enough to support basic questions like "is the tree green?"
- status_cells = status_row.findAll('td')
- builder = {}
-
- name_link = status_cells[0].find('a')
- builder['name'] = name_link.string
- # We could generate the builder_url from the name in a future version
- # of this code.
- builder['builder_url'] = self.buildbot_server_url + name_link['href']
-
- status_link = status_cells[1].find('a')
- if not status_link:
- # We failed to find a link in the first cell, just give up. This
- # can happen if a builder is just-added, the first cell will just
- # be "no build"
- # Other parts of the code depend on is_green being present.
- builder['is_green'] = False
- return builder
- # Will be either a revision number or a build number
- revision_string = status_link.string
- # If revision_string has non-digits assume it's not a revision number.
- builder['built_revision'] = int(revision_string) \
- if not re.match('\D', revision_string) \
- else None
- builder['is_green'] = not re.search('fail',
- status_cells[1].renderContents())
- # We could parse out the build number instead, but for now just store
- # the URL.
- builder['build_url'] = self.buildbot_server_url + status_link['href']
-
- # We could parse out the current activity too.
-
- return builder
-
- def _builder_statuses_with_names_matching_regexps(self,
- builder_statuses,
- name_regexps):
- builders = []
- for builder in builder_statuses:
- for name_regexp in name_regexps:
- if re.match(name_regexp, builder['name']):
- builders.append(builder)
- return builders
-
- def red_core_builders(self):
- red_builders = []
- for builder in self._builder_statuses_with_names_matching_regexps(
- self.builder_statuses(),
- self.core_builder_names_regexps):
- if not builder['is_green']:
- red_builders.append(builder)
- return red_builders
-
- def red_core_builders_names(self):
- red_builders = self.red_core_builders()
- return map(lambda builder: builder['name'], red_builders)
-
- def core_builders_are_green(self):
- return not self.red_core_builders()
-
- def builder_statuses(self):
- build_status_url = self.buildbot_server_url + 'one_box_per_builder'
- page = urllib2.urlopen(build_status_url)
- soup = BeautifulSoup(page)
-
- builders = []
- status_table = soup.find('table')
- for status_row in status_table.findAll('tr'):
- builder = self._parse_builder_status_from_row(status_row)
- builders.append(builder)
- return builders
diff --git a/WebKitTools/Scripts/webkitpy/buildbot.pyc b/WebKitTools/Scripts/webkitpy/buildbot.pyc
deleted file mode 100644
index 49b1e68..0000000
--- a/WebKitTools/Scripts/webkitpy/buildbot.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/buildbot_unittest.py b/WebKitTools/Scripts/webkitpy/buildbot_unittest.py
deleted file mode 100644
index bde3e04..0000000
--- a/WebKitTools/Scripts/webkitpy/buildbot_unittest.py
+++ /dev/null
@@ -1,155 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest
-
-from webkitpy.buildbot import BuildBot
-
-from webkitpy.BeautifulSoup import BeautifulSoup
-
-class BuildBotTest(unittest.TestCase):
-
- _example_one_box_status = '''
- <table>
- <tr>
- <td class="box"><a href="builders/Windows%20Debug%20%28Tests%29">Windows Debug (Tests)</a></td>
- <td align="center" class="LastBuild box success"><a href="builders/Windows%20Debug%20%28Tests%29/builds/3693">47380</a><br />build<br />successful</td>
- <td align="center" class="Activity building">building<br />ETA in<br />~ 14 mins<br />at 13:40</td>
- <tr>
- <td class="box"><a href="builders/SnowLeopard%20Intel%20Release">SnowLeopard Intel Release</a></td>
- <td class="LastBuild box" >no build</td>
- <td align="center" class="Activity building">building<br />< 1 min</td>
- <tr>
- <td class="box"><a href="builders/Qt%20Linux%20Release">Qt Linux Release</a></td>
- <td align="center" class="LastBuild box failure"><a href="builders/Qt%20Linux%20Release/builds/654">47383</a><br />failed<br />compile-webkit</td>
- <td align="center" class="Activity idle">idle</td>
- </table>
-'''
- _expected_example_one_box_parsings = [
- {
- 'builder_url': u'http://build.webkit.org/builders/Windows%20Debug%20%28Tests%29',
- 'build_url': u'http://build.webkit.org/builders/Windows%20Debug%20%28Tests%29/builds/3693',
- 'is_green': True,
- 'name': u'Windows Debug (Tests)',
- 'built_revision': 47380
- },
- {
- 'builder_url': u'http://build.webkit.org/builders/SnowLeopard%20Intel%20Release',
- 'is_green': False,
- 'name': u'SnowLeopard Intel Release',
- },
- {
- 'builder_url': u'http://build.webkit.org/builders/Qt%20Linux%20Release',
- 'build_url': u'http://build.webkit.org/builders/Qt%20Linux%20Release/builds/654',
- 'is_green': False,
- 'name': u'Qt Linux Release',
- 'built_revision': 47383
- },
- ]
-
- def test_status_parsing(self):
- buildbot = BuildBot()
-
- soup = BeautifulSoup(self._example_one_box_status)
- status_table = soup.find("table")
- input_rows = status_table.findAll('tr')
-
- for x in range(len(input_rows)):
- status_row = input_rows[x]
- expected_parsing = self._expected_example_one_box_parsings[x]
-
- builder = buildbot._parse_builder_status_from_row(status_row)
-
- # Make sure we aren't parsing more or less than we expect
- self.assertEquals(builder.keys(), expected_parsing.keys())
-
- for key, expected_value in expected_parsing.items():
- self.assertEquals(builder[key], expected_value, ("Builder %d parse failure for key: %s: Actual='%s' Expected='%s'" % (x, key, builder[key], expected_value)))
-
- def test_core_builder_methods(self):
- buildbot = BuildBot()
-
- # Override builder_statuses function to not touch the network.
- def example_builder_statuses(): # We could use instancemethod() to bind 'self' but we don't need to.
- return BuildBotTest._expected_example_one_box_parsings
- buildbot.builder_statuses = example_builder_statuses
-
- buildbot.core_builder_names_regexps = [ 'Leopard', "Windows.*Build" ]
- self.assertEquals(buildbot.red_core_builders_names(), [])
- self.assertTrue(buildbot.core_builders_are_green())
-
- buildbot.core_builder_names_regexps = [ 'SnowLeopard', 'Qt' ]
- self.assertEquals(buildbot.red_core_builders_names(), [ u'SnowLeopard Intel Release', u'Qt Linux Release' ])
- self.assertFalse(buildbot.core_builders_are_green())
-
- def test_builder_name_regexps(self):
- buildbot = BuildBot()
-
- # For complete testing, this list should match the list of builders at build.webkit.org:
- example_builders = [
- { 'name': u'Tiger Intel Release', },
- { 'name': u'Leopard Intel Release (Build)', },
- { 'name': u'Leopard Intel Release (Tests)', },
- { 'name': u'Leopard Intel Debug (Build)', },
- { 'name': u'Leopard Intel Debug (Tests)', },
- { 'name': u'SnowLeopard Intel Release (Build)', },
- { 'name': u'SnowLeopard Intel Release (Tests)', },
- { 'name': u'SnowLeopard Intel Leaks', },
- { 'name': u'Windows Release (Build)', },
- { 'name': u'Windows Release (Tests)', },
- { 'name': u'Windows Debug (Build)', },
- { 'name': u'Windows Debug (Tests)', },
- { 'name': u'Qt Linux Release', },
- { 'name': u'Gtk Linux Release', },
- { 'name': u'Gtk Linux 32-bit Debug', },
- { 'name': u'Gtk Linux 64-bit Debug', },
- { 'name': u'Chromium Linux Release', },
- { 'name': u'Chromium Mac Release', },
- { 'name': u'Chromium Win Release', },
- ]
- name_regexps = [ "Leopard", "Windows.*Build", "Chromium" ]
- expected_builders = [
- { 'name': u'Leopard Intel Release (Build)', },
- { 'name': u'Leopard Intel Release (Tests)', },
- { 'name': u'Leopard Intel Debug (Build)', },
- { 'name': u'Leopard Intel Debug (Tests)', },
- { 'name': u'Windows Release (Build)', },
- { 'name': u'Windows Debug (Build)', },
- { 'name': u'Chromium Linux Release', },
- { 'name': u'Chromium Mac Release', },
- { 'name': u'Chromium Win Release', },
- ]
-
- # This test should probably be updated if the default regexp list changes
- self.assertEquals(buildbot.core_builder_names_regexps, name_regexps)
-
- builders = buildbot._builder_statuses_with_names_matching_regexps(example_builders, name_regexps)
- self.assertEquals(builders, expected_builders)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/changelogs.pyc b/WebKitTools/Scripts/webkitpy/changelogs.pyc
deleted file mode 100644
index 2fca994..0000000
--- a/WebKitTools/Scripts/webkitpy/changelogs.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.pyc b/WebKitTools/Scripts/webkitpy/commands/__init__.pyc
deleted file mode 100644
index ac801ef..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.pyc b/WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.pyc
deleted file mode 100644
index 6d3afc4..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/commands/download.pyc b/WebKitTools/Scripts/webkitpy/commands/download.pyc
deleted file mode 100644
index 3a0046f..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/download.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/commands/early_warning_system.pyc b/WebKitTools/Scripts/webkitpy/commands/early_warning_system.pyc
deleted file mode 100644
index d6e0800..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/early_warning_system.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/commands/early_warning_system_unittest.py b/WebKitTools/Scripts/webkitpy/commands/early_warning_system_unittest.py
deleted file mode 100644
index d516b84..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/early_warning_system_unittest.py
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-
-from webkitpy.commands.early_warning_system import *
-from webkitpy.commands.queuestest import QueuesTest
-from webkitpy.mock import Mock
-
-class EarlyWarningSytemTest(QueuesTest):
- def test_chromium_ews(self):
- expected_stderr = {
- "begin_work_queue" : "CAUTION: chromium-ews will discard all local changes in \"%s\"\nRunning WebKit chromium-ews.\n" % os.getcwd(),
- "handle_unexpected_error" : "Mock error message\n",
- }
- self.assert_queue_outputs(ChromiumEWS(), expected_stderr=expected_stderr)
-
- def test_qt_ews(self):
- expected_stderr = {
- "begin_work_queue" : "CAUTION: qt-ews will discard all local changes in \"%s\"\nRunning WebKit qt-ews.\n" % os.getcwd(),
- "handle_unexpected_error" : "Mock error message\n",
- }
- self.assert_queue_outputs(QtEWS(), expected_stderr=expected_stderr)
-
- def test_gtk_ews(self):
- expected_stderr = {
- "begin_work_queue" : "CAUTION: gtk-ews will discard all local changes in \"%s\"\nRunning WebKit gtk-ews.\n" % os.getcwd(),
- "handle_unexpected_error" : "Mock error message\n",
- }
- self.assert_queue_outputs(GtkEWS(), expected_stderr=expected_stderr)
-
- def test_mac_ews(self):
- expected_stderr = {
- "begin_work_queue" : "CAUTION: mac-ews will discard all local changes in \"%s\"\nRunning WebKit mac-ews.\n" % os.getcwd(),
- "handle_unexpected_error" : "Mock error message\n",
- }
- self.assert_queue_outputs(MacEWS(), expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/commands/queries.py b/WebKitTools/Scripts/webkitpy/commands/queries.py
deleted file mode 100644
index 3ca4f42..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queries.py
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-from optparse import make_option
-
-from webkitpy.buildbot import BuildBot
-from webkitpy.committers import CommitterList
-from webkitpy.webkit_logging import log
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-
-
-class BugsToCommit(AbstractDeclarativeCommand):
- name = "bugs-to-commit"
- help_text = "List bugs in the commit-queue"
-
- def execute(self, options, args, tool):
- # FIXME: This command is poorly named. It's fetching the commit-queue list here. The name implies it's fetching pending-commit (all r+'d patches).
- bug_ids = tool.bugs.queries.fetch_bug_ids_from_commit_queue()
- for bug_id in bug_ids:
- print "%s" % bug_id
-
-
-class PatchesInCommitQueue(AbstractDeclarativeCommand):
- name = "patches-in-commit-queue"
- help_text = "List patches in the commit-queue"
-
- def execute(self, options, args, tool):
- patches = tool.bugs.queries.fetch_patches_from_commit_queue()
- log("Patches in commit queue:")
- for patch in patches:
- print patch.url()
-
-
-class PatchesToCommitQueue(AbstractDeclarativeCommand):
- name = "patches-to-commit-queue"
- help_text = "Patches which should be added to the commit queue"
- def __init__(self):
- options = [
- make_option("--bugs", action="store_true", dest="bugs", help="Output bug links instead of patch links"),
- ]
- AbstractDeclarativeCommand.__init__(self, options=options)
-
- @staticmethod
- def _needs_commit_queue(patch):
- if patch.commit_queue() == "+": # If it's already cq+, ignore the patch.
- log("%s already has cq=%s" % (patch.id(), patch.commit_queue()))
- return False
-
- # We only need to worry about patches from contributers who are not yet committers.
- committer_record = CommitterList().committer_by_email(patch.attacher_email())
- if committer_record:
- log("%s committer = %s" % (patch.id(), committer_record))
- return not committer_record
-
- def execute(self, options, args, tool):
- patches = tool.bugs.queries.fetch_patches_from_pending_commit_list()
- patches_needing_cq = filter(self._needs_commit_queue, patches)
- if options.bugs:
- bugs_needing_cq = map(lambda patch: patch.bug_id(), patches_needing_cq)
- bugs_needing_cq = sorted(set(bugs_needing_cq))
- for bug_id in bugs_needing_cq:
- print "%s" % tool.bugs.bug_url_for_bug_id(bug_id)
- else:
- for patch in patches_needing_cq:
- print "%s" % tool.bugs.attachment_url_for_id(patch.id(), action="edit")
-
-
-class PatchesToReview(AbstractDeclarativeCommand):
- name = "patches-to-review"
- help_text = "List patches that are pending review"
-
- def execute(self, options, args, tool):
- patch_ids = tool.bugs.queries.fetch_attachment_ids_from_review_queue()
- log("Patches pending review:")
- for patch_id in patch_ids:
- print patch_id
-
-
-class TreeStatus(AbstractDeclarativeCommand):
- name = "tree-status"
- help_text = "Print the status of the %s buildbots" % BuildBot.default_host
- long_help = """Fetches build status from http://build.webkit.org/one_box_per_builder
-and displayes the status of each builder."""
-
- def execute(self, options, args, tool):
- for builder in tool.buildbot.builder_statuses():
- status_string = "ok" if builder["is_green"] else "FAIL"
- print "%s : %s" % (status_string.ljust(4), builder["name"])
diff --git a/WebKitTools/Scripts/webkitpy/commands/queries.pyc b/WebKitTools/Scripts/webkitpy/commands/queries.pyc
deleted file mode 100644
index 829b6e3..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queries.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/commands/queues.py b/WebKitTools/Scripts/webkitpy/commands/queues.py
deleted file mode 100644
index 6ea1c48..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queues.py
+++ /dev/null
@@ -1,295 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import traceback
-import os
-
-from datetime import datetime
-from optparse import make_option
-from StringIO import StringIO
-
-from webkitpy.bugzilla import CommitterValidator
-from webkitpy.executive import ScriptError
-from webkitpy.grammar import pluralize
-from webkitpy.webkit_logging import error, log
-from webkitpy.multicommandtool import Command
-from webkitpy.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
-from webkitpy.statusserver import StatusServer
-from webkitpy.stepsequence import StepSequenceErrorHandler
-from webkitpy.queueengine import QueueEngine, QueueEngineDelegate
-
-class AbstractQueue(Command, QueueEngineDelegate):
- watchers = [
- "webkit-bot-watchers@googlegroups.com",
- ]
-
- _pass_status = "Pass"
- _fail_status = "Fail"
- _error_status = "Error"
-
- def __init__(self, options=None): # Default values should never be collections (like []) as default values are shared between invocations
- options_list = (options or []) + [
- make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Do not ask the user for confirmation before running the queue. Dangerous!"),
- ]
- Command.__init__(self, "Run the %s" % self.name, options=options_list)
-
- def _cc_watchers(self, bug_id):
- try:
- self.tool.bugs.add_cc_to_bug(bug_id, self.watchers)
- except Exception, e:
- traceback.print_exc()
- log("Failed to CC watchers.")
-
- def _update_status(self, message, patch=None, results_file=None):
- self.tool.status_server.update_status(self.name, message, patch, results_file)
-
- def _did_pass(self, patch):
- self._update_status(self._pass_status, patch)
-
- def _did_fail(self, patch):
- self._update_status(self._fail_status, patch)
-
- def _did_error(self, patch, reason):
- message = "%s: %s" % (self._error_status, reason)
- self._update_status(message, patch)
-
- def queue_log_path(self):
- return "%s.log" % self.name
-
- def work_item_log_path(self, patch):
- return os.path.join("%s-logs" % self.name, "%s.log" % patch.bug_id())
-
- def begin_work_queue(self):
- log("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self.tool.scm().checkout_root))
- if self.options.confirm:
- response = self.tool.user.prompt("Are you sure? Type \"yes\" to continue: ")
- if (response != "yes"):
- error("User declined.")
- log("Running WebKit %s." % self.name)
-
- def should_continue_work_queue(self):
- return True
-
- def next_work_item(self):
- raise NotImplementedError, "subclasses must implement"
-
- def should_proceed_with_work_item(self, work_item):
- raise NotImplementedError, "subclasses must implement"
-
- def process_work_item(self, work_item):
- raise NotImplementedError, "subclasses must implement"
-
- def handle_unexpected_error(self, work_item, message):
- raise NotImplementedError, "subclasses must implement"
-
- def run_webkit_patch(self, args):
- webkit_patch_args = [self.tool.path()]
- # FIXME: This is a hack, we should have a more general way to pass global options.
- webkit_patch_args += ["--status-host=%s" % self.tool.status_server.host]
- webkit_patch_args += map(str, args)
- self.tool.executive.run_and_throw_if_fail(webkit_patch_args)
-
- def log_progress(self, patch_ids):
- log("%s in %s [%s]" % (pluralize("patch", len(patch_ids)), self.name, ", ".join(map(str, patch_ids))))
-
- def execute(self, options, args, tool, engine=QueueEngine):
- self.options = options
- self.tool = tool
- return engine(self.name, self).run()
-
- @classmethod
- def _update_status_for_script_error(cls, tool, state, script_error, is_error=False):
- message = script_error.message
- if is_error:
- message = "Error: %s" % message
- output = script_error.message_with_output(output_limit=5*1024*1024) # 5MB
- return tool.status_server.update_status(cls.name, message, state["patch"], StringIO(output))
-
-
-class CommitQueue(AbstractQueue, StepSequenceErrorHandler):
- name = "commit-queue"
- def __init__(self):
- AbstractQueue.__init__(self)
-
- # AbstractQueue methods
-
- def begin_work_queue(self):
- AbstractQueue.begin_work_queue(self)
- self.committer_validator = CommitterValidator(self.tool.bugs)
-
- def _validate_patches_in_commit_queue(self):
- # Not using BugzillaQueries.fetch_patches_from_commit_queue() so we can reject patches with invalid committers/reviewers.
- bug_ids = self.tool.bugs.queries.fetch_bug_ids_from_commit_queue()
- all_patches = sum([self.tool.bugs.fetch_bug(bug_id).commit_queued_patches(include_invalid=True) for bug_id in bug_ids], [])
- return self.committer_validator.patches_after_rejecting_invalid_commiters_and_reviewers(all_patches)
-
- def next_work_item(self):
- patches = self._validate_patches_in_commit_queue()
- # FIXME: We could sort the patches in a specific order here, was suggested by https://bugs.webkit.org/show_bug.cgi?id=33395
- if not patches:
- 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])
- return patches[0]
-
- def _can_build_and_test(self):
- try:
- self.run_webkit_patch(["build-and-test", "--force-clean", "--non-interactive", "--build-style=both", "--quiet"])
- except ScriptError, e:
- self._update_status("Unabled to successfully build and test", None)
- 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 self._builders_are_green():
- return False
- if not self._can_build_and_test():
- return False
- if not self._builders_are_green():
- return False
- self._update_status("Landing patch", patch)
- return True
-
- def process_work_item(self, patch):
- try:
- self._cc_watchers(patch.bug_id())
- # We pass --no-update here because we've already validated
- # that the current revision actually builds and passes the tests.
- # If we update, we risk moving to a revision that doesn't!
- self.run_webkit_patch(["land-attachment", "--force-clean", "--non-interactive", "--no-update", "--parent-command=commit-queue", "--build-style=both", "--quiet", patch.id()])
- self._did_pass(patch)
- except ScriptError, e:
- self._did_fail(patch)
- raise e
-
- def handle_unexpected_error(self, patch, message):
- self.committer_validator.reject_patch_from_commit_queue(patch.id(), message)
-
- # StepSequenceErrorHandler methods
-
- @staticmethod
- def _error_message_for_bug(tool, status_id, script_error):
- if not script_error.output:
- return script_error.message_with_output()
- results_link = tool.status_server.results_url_for_status(status_id)
- return "%s\nFull output: %s" % (script_error.message_with_output(), results_link)
-
- @classmethod
- def handle_script_error(cls, tool, state, script_error):
- status_id = cls._update_status_for_script_error(tool, state, script_error)
- validator = CommitterValidator(tool.bugs)
- validator.reject_patch_from_commit_queue(state["patch"].id(), cls._error_message_for_bug(tool, status_id, script_error))
-
-
-class AbstractReviewQueue(AbstractQueue, PersistentPatchCollectionDelegate, StepSequenceErrorHandler):
- def __init__(self, options=None):
- AbstractQueue.__init__(self, options)
-
- def _review_patch(self, patch):
- raise NotImplementedError, "subclasses must implement"
-
- # PersistentPatchCollectionDelegate methods
-
- def collection_name(self):
- return self.name
-
- def fetch_potential_patch_ids(self):
- return self.tool.bugs.queries.fetch_attachment_ids_from_review_queue()
-
- def status_server(self):
- return self.tool.status_server
-
- def is_terminal_status(self, status):
- return status == "Pass" or status == "Fail" or status.startswith("Error:")
-
- # AbstractQueue methods
-
- def begin_work_queue(self):
- AbstractQueue.begin_work_queue(self)
- self._patches = PersistentPatchCollection(self)
-
- def next_work_item(self):
- patch_id = self._patches.next()
- if patch_id:
- return self.tool.bugs.fetch_attachment(patch_id)
- self._update_status("Empty queue")
-
- def should_proceed_with_work_item(self, patch):
- raise NotImplementedError, "subclasses must implement"
-
- def process_work_item(self, patch):
- try:
- self._review_patch(patch)
- self._did_pass(patch)
- except ScriptError, e:
- if e.exit_code != QueueEngine.handled_error_code:
- self._did_fail(patch)
- raise e
-
- def handle_unexpected_error(self, patch, message):
- log(message)
-
- # StepSequenceErrorHandler methods
-
- @classmethod
- def handle_script_error(cls, tool, state, script_error):
- log(script_error.message_with_output())
-
-
-class StyleQueue(AbstractReviewQueue):
- name = "style-queue"
- def __init__(self):
- AbstractReviewQueue.__init__(self)
-
- def should_proceed_with_work_item(self, patch):
- self._update_status("Checking style", patch)
- return True
-
- def _review_patch(self, patch):
- self.run_webkit_patch(["check-style", "--force-clean", "--non-interactive", "--parent-command=style-queue", patch.id()])
-
- @classmethod
- def handle_script_error(cls, tool, state, script_error):
- is_svn_apply = script_error.command_name() == "svn-apply"
- status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply)
- if is_svn_apply:
- QueueEngine.exit_after_handled_error(script_error)
- message = "Attachment %s did not pass %s:\n\n%s\n\nIf any of these errors are false positives, please file a bug against check-webkit-style." % (state["patch"].id(), cls.name, script_error.message_with_output(output_limit=3*1024))
- tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers)
- exit(1)
diff --git a/WebKitTools/Scripts/webkitpy/commands/queues.pyc b/WebKitTools/Scripts/webkitpy/commands/queues.pyc
deleted file mode 100644
index 8d52d05..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queues.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py
deleted file mode 100644
index 87cd645..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queues_unittest.py
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.queues import *
-from webkitpy.commands.queuestest import QueuesTest
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
-
-
-class TestQueue(AbstractQueue):
- name = "test-queue"
-
-
-class TestReviewQueue(AbstractReviewQueue):
- name = "test-review-queue"
-
-
-class AbstractQueueTest(CommandsTest):
- def _assert_log_progress_output(self, patch_ids, progress_output):
- OutputCapture().assert_outputs(self, TestQueue().log_progress, [patch_ids], expected_stderr=progress_output)
-
- def test_log_progress(self):
- self._assert_log_progress_output([1,2,3], "3 patches in test-queue [1, 2, 3]\n")
- self._assert_log_progress_output(["1","2","3"], "3 patches in test-queue [1, 2, 3]\n")
- self._assert_log_progress_output([1], "1 patch in test-queue [1]\n")
-
- def _assert_run_webkit_patch(self, run_args):
- queue = TestQueue()
- tool = MockBugzillaTool()
- queue.bind_to_tool(tool)
-
- queue.run_webkit_patch(run_args)
- expected_run_args = ["echo", "--status-host=example.com"] + map(str, run_args)
- tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
-
- def test_run_webkit_patch(self):
- self._assert_run_webkit_patch([1])
- self._assert_run_webkit_patch(["one", 2])
-
-
-class AbstractReviewQueueTest(CommandsTest):
- def test_patch_collection_delegate_methods(self):
- queue = TestReviewQueue()
- tool = MockBugzillaTool()
- queue.bind_to_tool(tool)
- self.assertEquals(queue.collection_name(), "test-review-queue")
- self.assertEquals(queue.fetch_potential_patch_ids(), [103])
- queue.status_server()
- self.assertTrue(queue.is_terminal_status("Pass"))
- self.assertTrue(queue.is_terminal_status("Fail"))
- self.assertTrue(queue.is_terminal_status("Error: Your patch exploded"))
- self.assertFalse(queue.is_terminal_status("Foo"))
-
-
-class CommitQueueTest(QueuesTest):
- def test_commit_queue(self):
- expected_stderr = {
- "begin_work_queue" : "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % os.getcwd(),
- # 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)
-2 patches in commit-queue [197, 106]
-""",
- }
- self.assert_queue_outputs(CommitQueue(), expected_stderr=expected_stderr)
-
-
-class StyleQueueTest(QueuesTest):
- def test_style_queue(self):
- expected_stderr = {
- "begin_work_queue" : "CAUTION: style-queue will discard all local changes in \"%s\"\nRunning WebKit style-queue.\n" % os.getcwd(),
- "handle_unexpected_error" : "Mock error message\n",
- }
- self.assert_queue_outputs(StyleQueue(), expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/commands/queuestest.py b/WebKitTools/Scripts/webkitpy/commands/queuestest.py
deleted file mode 100644
index 09d1c26..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/queuestest.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import unittest
-
-from webkitpy.bugzilla import Attachment
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
-
-
-class MockQueueEngine(object):
- def __init__(self, name, queue):
- pass
-
- def run(self):
- pass
-
-
-class QueuesTest(unittest.TestCase):
- mock_work_item = Attachment({
- "id" : 1234,
- "bug_id" : 345,
- "attacher_email": "adam@example.com",
- }, None)
-
- def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, options=Mock(), tool=MockBugzillaTool()):
- if not expected_stdout:
- expected_stdout = {}
- if not expected_stderr:
- expected_stderr = {}
- if not args:
- args = []
- if not work_item:
- work_item = self.mock_work_item
- tool.user.prompt = lambda message: "yes"
-
- queue.execute(options, args, tool, engine=MockQueueEngine)
-
- OutputCapture().assert_outputs(self,
- queue.queue_log_path,
- expected_stdout=expected_stdout.get("queue_log_path", ""),
- expected_stderr=expected_stderr.get("queue_log_path", ""))
- OutputCapture().assert_outputs(self,
- queue.work_item_log_path,
- args=[work_item],
- expected_stdout=expected_stdout.get("work_item_log_path", ""),
- expected_stderr=expected_stderr.get("work_item_log_path", ""))
- OutputCapture().assert_outputs(self,
- queue.begin_work_queue,
- expected_stdout=expected_stdout.get("begin_work_queue", ""),
- expected_stderr=expected_stderr.get("begin_work_queue", ""))
- OutputCapture().assert_outputs(self,
- queue.should_continue_work_queue,
- expected_stdout=expected_stdout.get("should_continue_work_queue", ""), expected_stderr=expected_stderr.get("should_continue_work_queue", ""))
- OutputCapture().assert_outputs(self,
- queue.next_work_item,
- expected_stdout=expected_stdout.get("next_work_item", ""),
- expected_stderr=expected_stderr.get("next_work_item", ""))
- OutputCapture().assert_outputs(self,
- queue.should_proceed_with_work_item,
- args=[work_item],
- expected_stdout=expected_stdout.get("should_proceed_with_work_item", ""),
- expected_stderr=expected_stderr.get("should_proceed_with_work_item", ""))
- OutputCapture().assert_outputs(self,
- queue.process_work_item,
- args=[work_item],
- expected_stdout=expected_stdout.get("process_work_item", ""),
- expected_stderr=expected_stderr.get("process_work_item", ""))
- OutputCapture().assert_outputs(self,
- queue.handle_unexpected_error,
- args=[work_item, "Mock error message"],
- expected_stdout=expected_stdout.get("handle_unexpected_error", ""),
- expected_stderr=expected_stderr.get("handle_unexpected_error", ""))
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload.pyc b/WebKitTools/Scripts/webkitpy/commands/upload.pyc
deleted file mode 100644
index a4bd81b..0000000
--- a/WebKitTools/Scripts/webkitpy/commands/upload.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/comments.pyc b/WebKitTools/Scripts/webkitpy/comments.pyc
deleted file mode 100644
index ead9e58..0000000
--- a/WebKitTools/Scripts/webkitpy/comments.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/committers.py b/WebKitTools/Scripts/webkitpy/committers.py
deleted file mode 100644
index 7af0987..0000000
--- a/WebKitTools/Scripts/webkitpy/committers.py
+++ /dev/null
@@ -1,270 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# WebKit's Python module for committer and reviewer validation
-
-
-class Committer:
-
- def __init__(self, name, email_or_emails):
- self.full_name = name
- if isinstance(email_or_emails, str):
- self.emails = [email_or_emails]
- else:
- self.emails = email_or_emails
- self.can_review = False
-
- def bugzilla_email(self):
- # FIXME: We're assuming the first email is a valid bugzilla email,
- # which might not be right.
- return self.emails[0]
-
- def __str__(self):
- return '"%s" <%s>' % (self.full_name, self.emails[0])
-
-
-class Reviewer(Committer):
-
- def __init__(self, name, email_or_emails):
- Committer.__init__(self, name, email_or_emails)
- self.can_review = True
-
-
-# This is intended as a canonical, machine-readable list of all non-reviewer
-# committers for WebKit. If your name is missing here and you are a committer,
-# please add it. No review needed. All reviewers are committers, so this list
-# is only of committers who are not reviewers.
-
-
-committers_unable_to_review = [
- Committer("Aaron Boodman", "aa@chromium.org"),
- Committer("Adam Langley", "agl@chromium.org"),
- Committer("Albert J. Wong", "ajwong@chromium.org"),
- Committer("Alejandro G. Castro", ["alex@igalia.com", "alex@webkit.org"]),
- Committer("Alexander Kellett", ["lypanov@mac.com", "a-lists001@lypanov.net", "lypanov@kde.org"]),
- Committer("Alexander Pavlov", "apavlov@chromium.org"),
- Committer("Andre Boule", "aboule@apple.com"),
- Committer("Andrew Wellington", ["andrew@webkit.org", "proton@wiretapped.net"]),
- Committer("Andras Becsi", "abecsi@webkit.org"),
- Committer("Anthony Ricaud", "rik@webkit.org"),
- Committer("Anton Muhin", "antonm@chromium.org"),
- Committer("Antonio Gomes", "tonikitoo@webkit.org"),
- Committer("Ben Murdoch", "benm@google.com"),
- Committer("Benjamin C Meyer", ["ben@meyerhome.net", "ben@webkit.org"]),
- Committer("Benjamin Otte", ["otte@gnome.org", "otte@webkit.org"]),
- Committer("Brent Fulgham", "bfulgham@webkit.org"),
- Committer("Brett Wilson", "brettw@chromium.org"),
- Committer("Brian Weinstein", "bweinstein@apple.com"),
- Committer("Cameron McCormack", "cam@webkit.org"),
- Committer("Carol Szabo", "carol.szabo@nokia.com"),
- Committer("Chang Shu", "chang.shu@nokia.com"),
- Committer("Chris Fleizach", "cfleizach@apple.com"),
- Committer("Chris Jerdonek", "cjerdonek@webkit.org"),
- Committer("Chris Marrin", "cmarrin@apple.com"),
- Committer("Chris Petersen", "cpetersen@apple.com"),
- Committer("Christian Dywan", ["christian@twotoasts.de", "christian@webkit.org"]),
- Committer("Collin Jackson", "collinj@webkit.org"),
- Committer("Csaba Osztrogonac", "ossy@webkit.org"),
- Committer("Daniel Bates", "dbates@webkit.org"),
- Committer("David Smith", ["catfish.man@gmail.com", "dsmith@webkit.org"]),
- Committer("Dean Jackson", "dino@apple.com"),
- Committer("Dirk Pranke", "dpranke@chromium.org"),
- Committer("Drew Wilson", "atwilson@chromium.org"),
- Committer("Dumitru Daniliuc", "dumi@chromium.org"),
- Committer("Eli Fidler", "eli@staikos.net"),
- Committer("Enrica Casucci", "enrica@apple.com"),
- Committer("Erik Arvidsson", "arv@chromium.org"),
- Committer("Eric Roman", "eroman@chromium.org"),
- Committer("Feng Qian", "feng@chromium.org"),
- Committer("Fumitoshi Ukai", "ukai@chromium.org"),
- Committer("Gabor Loki", "loki@webkit.org"),
- Committer("Girish Ramakrishnan", ["girish@forwardbias.in", "ramakrishnan.girish@gmail.com"]),
- Committer("Graham Dennis", ["Graham.Dennis@gmail.com", "gdennis@webkit.org"]),
- Committer("Greg Bolsinga", "bolsinga@apple.com"),
- Committer("Hin-Chung Lam", ["hclam@google.com", "hclam@chromium.org"]),
- Committer("Jakob Petsovits", ["jpetsovits@rim.com", "jpetso@gmx.at"]),
- Committer("Jens Alfke", ["snej@chromium.org", "jens@apple.com"]),
- Committer("Jeremy Moskovich", ["playmobil@google.com", "jeremy@chromium.org"]),
- Committer("Jessie Berlin", ["jberlin@webkit.org", "jberlin@apple.com"]),
- Committer("Jian Li", "jianli@chromium.org"),
- Committer("John Abd-El-Malek", "jam@chromium.org"),
- Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"]),
- Committer("Joseph Pecoraro", "joepeck@webkit.org"),
- Committer("Julie Parent", ["jparent@google.com", "jparent@chromium.org"]),
- Committer("Julien Chaffraix", ["jchaffraix@webkit.org", "julien.chaffraix@gmail.com"]),
- Committer("Jungshik Shin", "jshin@chromium.org"),
- Committer("Keishi Hattori", "keishi@webkit.org"),
- Committer("Kelly Norton", "knorton@google.com"),
- Committer("Kenneth Russell", "kbr@google.com"),
- Committer("Kent Tamura", "tkent@chromium.org"),
- Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
- Committer("Levi Weintraub", "lweintraub@apple.com"),
- Committer("Mads Ager", "ager@chromium.org"),
- Committer("Matt Lilek", ["webkit@mattlilek.com", "pewtermoose@webkit.org"]),
- Committer("Matt Perry", "mpcomplete@chromium.org"),
- Committer("Maxime Britto", ["maxime.britto@gmail.com", "britto@apple.com"]),
- Committer("Maxime Simon", ["simon.maxime@gmail.com", "maxime.simon@webkit.org"]),
- Committer("Martin Robinson", ["mrobinson@webkit.org", "martin.james.robinson@gmail.com"]),
- Committer("Michelangelo De Simone", "michelangelo@webkit.org"),
- Committer("Mike Belshe", ["mbelshe@chromium.org", "mike@belshe.com"]),
- Committer("Mike Fenton", ["mike.fenton@torchmobile.com", "mifenton@rim.com"]),
- Committer("Mike Thole", ["mthole@mikethole.com", "mthole@apple.com"]),
- Committer("Mikhail Naganov", "mnaganov@chromium.org"),
- Committer("Ojan Vafai", "ojan@chromium.org"),
- Committer("Pam Greene", "pam@chromium.org"),
- Committer("Peter Kasting", ["pkasting@google.com", "pkasting@chromium.org"]),
- Committer("Philippe Normand", ["pnormand@igalia.com", "philn@webkit.org"]),
- Committer("Pierre d'Herbemont", ["pdherbemont@free.fr", "pdherbemont@apple.com"]),
- Committer("Pierre-Olivier Latour", "pol@apple.com"),
- Committer("Roland Steiner", "rolandsteiner@chromium.org"),
- Committer("Ryosuke Niwa", "rniwa@webkit.org"),
- Committer("Scott Violet", "sky@chromium.org"),
- Committer("Stephen White", "senorblanco@chromium.org"),
- Committer("Steve Block", "steveblock@google.com"),
- Committer("Tony Chang", "tony@chromium.org"),
- Committer("Trey Matteson", "trey@usa.net"),
- Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]),
- Committer("Victor Wang", "victorw@chromium.org"),
- Committer("William Siegrist", "wsiegrist@apple.com"),
- Committer("Yael Aharon", "yael.aharon@nokia.com"),
- Committer("Yaar Schnitman", ["yaar@chromium.org", "yaar@google.com"]),
- Committer("Yong Li", ["yong.li@torchmobile.com", "yong.li.webkit@gmail.com"]),
- Committer("Yongjun Zhang", "yongjun.zhang@nokia.com"),
- Committer("Yury Semikhatsky", "yurys@chromium.org"),
- Committer("Yuzo Fujishima", "yuzo@google.com"),
- Committer("Zoltan Herczeg", "zherczeg@webkit.org"),
- Committer("Zoltan Horvath", "zoltan@webkit.org"),
-]
-
-
-# This is intended as a canonical, machine-readable list of all reviewers for
-# WebKit. If your name is missing here and you are a reviewer, please add it.
-# No review needed.
-
-
-reviewers_list = [
- Reviewer("Ada Chan", "adachan@apple.com"),
- Reviewer("Adam Barth", "abarth@webkit.org"),
- Reviewer("Adam Roben", "aroben@apple.com"),
- Reviewer("Adam Treat", ["treat@kde.org", "treat@webkit.org"]),
- Reviewer("Adele Peterson", "adele@apple.com"),
- Reviewer("Alexey Proskuryakov", ["ap@webkit.org", "ap@apple.com"]),
- Reviewer("Alice Liu", "alice.liu@apple.com"),
- Reviewer("Alp Toker", ["alp@nuanti.com", "alp@atoker.com", "alp@webkit.org"]),
- Reviewer("Anders Carlsson", ["andersca@apple.com", "acarlsson@apple.com"]),
- Reviewer("Antti Koivisto", ["koivisto@iki.fi", "antti@apple.com"]),
- Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@webkit.org"]),
- Reviewer("Beth Dakin", "bdakin@apple.com"),
- Reviewer("Brady Eidson", "beidson@apple.com"),
- Reviewer("Cameron Zwarich", ["zwarich@apple.com", "cwzwarich@apple.com", "cwzwarich@webkit.org"]),
- Reviewer("Chris Blumenberg", "cblu@apple.com"),
- Reviewer("Dan Bernstein", ["mitz@webkit.org", "mitz@apple.com"]),
- Reviewer("Darin Adler", "darin@apple.com"),
- Reviewer("Darin Fisher", ["fishd@chromium.org", "darin@chromium.org"]),
- Reviewer("David Harrison", "harrison@apple.com"),
- Reviewer("David Hyatt", "hyatt@apple.com"),
- Reviewer("David Kilzer", ["ddkilzer@webkit.org", "ddkilzer@apple.com"]),
- Reviewer("David Levin", "levin@chromium.org"),
- Reviewer("Dimitri Glazkov", "dglazkov@chromium.org"),
- Reviewer("Dirk Schulze", "krit@webkit.org"),
- Reviewer("Dmitry Titov", "dimich@chromium.org"),
- Reviewer("Don Melton", "gramps@apple.com"),
- Reviewer("Eric Carlson", "eric.carlson@apple.com"),
- Reviewer("Eric Seidel", "eric@webkit.org"),
- Reviewer("Gavin Barraclough", "barraclough@apple.com"),
- Reviewer("Geoffrey Garen", "ggaren@apple.com"),
- Reviewer("George Staikos", ["staikos@kde.org", "staikos@webkit.org"]),
- Reviewer("Gustavo Noronha Silva", ["gns@gnome.org", "kov@webkit.org"]),
- Reviewer("Holger Freyther", ["zecke@selfish.org", "zecke@webkit.org"]),
- Reviewer("Jan Alonzo", ["jmalonzo@gmail.com", "jmalonzo@webkit.org"]),
- Reviewer("Jeremy Orlow", "jorlow@chromium.org"),
- Reviewer("John Sullivan", "sullivan@apple.com"),
- Reviewer("Jon Honeycutt", "jhoneycutt@apple.com"),
- Reviewer("Justin Garcia", "justin.garcia@apple.com"),
- Reviewer("Ken Kocienda", "kocienda@apple.com"),
- Reviewer("Kenneth Rohde Christiansen", ["kenneth@webkit.org", "kenneth.christiansen@openbossa.org"]),
- Reviewer("Kevin Decker", "kdecker@apple.com"),
- Reviewer("Kevin McCullough", "kmccullough@apple.com"),
- Reviewer("Kevin Ollivier", ["kevino@theolliviers.com", "kevino@webkit.org"]),
- Reviewer("Lars Knoll", ["lars@trolltech.com", "lars@kde.org"]),
- Reviewer("Laszlo Gombos", "laszlo.1.gombos@nokia.com"),
- Reviewer("Maciej Stachowiak", "mjs@apple.com"),
- Reviewer("Mark Rowe", "mrowe@apple.com"),
- Reviewer("Nate Chapin", "japhet@chromium.org"),
- Reviewer("Nikolas Zimmermann", ["zimmermann@kde.org", "zimmermann@physik.rwth-aachen.de", "zimmermann@webkit.org"]),
- Reviewer("Oliver Hunt", "oliver@apple.com"),
- Reviewer("Pavel Feldman", "pfeldman@chromium.org"),
- Reviewer("Richard Williamson", "rjw@apple.com"),
- Reviewer("Rob Buis", ["rwlbuis@gmail.com", "rwlbuis@webkit.org"]),
- Reviewer("Sam Weinig", ["sam@webkit.org", "weinig@apple.com"]),
- Reviewer("Shinichiro Hamaji", "hamaji@chromium.org"),
- Reviewer("Simon Fraser", "simon.fraser@apple.com"),
- Reviewer("Simon Hausmann", ["hausmann@webkit.org", "hausmann@kde.org", "simon.hausmann@nokia.com"]),
- Reviewer("Stephanie Lewis", "slewis@apple.com"),
- Reviewer("Steve Falkenburg", "sfalken@apple.com"),
- Reviewer("Tim Omernick", "timo@apple.com"),
- Reviewer("Timothy Hatcher", ["timothy@hatcher.name", "timothy@apple.com"]),
- Reviewer(u'Tor Arne Vestb\xf8', "vestbo@webkit.org"),
- Reviewer("Vicki Murley", "vicki@apple.com"),
- Reviewer("Xan Lopez", ["xan.lopez@gmail.com", "xan@gnome.org", "xan@webkit.org"]),
- Reviewer("Zack Rusin", "zack@kde.org"),
-]
-
-
-class CommitterList:
-
- # Committers and reviewers are passed in to allow easy testing
-
- def __init__(self,
- committers=committers_unable_to_review,
- reviewers=reviewers_list):
- self._committers = committers + reviewers
- self._reviewers = reviewers
- self._committers_by_email = {}
-
- def committers(self):
- return self._committers
-
- def reviewers(self):
- return self._reviewers
-
- def _email_to_committer_map(self):
- if not len(self._committers_by_email):
- for committer in self._committers:
- for email in committer.emails:
- self._committers_by_email[email] = committer
- return self._committers_by_email
-
- def committer_by_email(self, email):
- return self._email_to_committer_map().get(email)
-
- def reviewer_by_email(self, email):
- committer = self.committer_by_email(email)
- if committer and not committer.can_review:
- return None
- return committer
diff --git a/WebKitTools/Scripts/webkitpy/committers.pyc b/WebKitTools/Scripts/webkitpy/committers.pyc
deleted file mode 100644
index bce8c17..0000000
--- a/WebKitTools/Scripts/webkitpy/committers.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/commands/__init__.py b/WebKitTools/Scripts/webkitpy/common/__init__.py
index ef65bee..ef65bee 100644
--- a/WebKitTools/Scripts/webkitpy/commands/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/common/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/common/array_stream.py b/WebKitTools/Scripts/webkitpy/common/array_stream.py
new file mode 100644
index 0000000..e425d02
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/array_stream.py
@@ -0,0 +1,66 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Package that private an array-based implementation of a stream."""
+
+
+class ArrayStream(object):
+ """Simple class that implmements a stream interface on top of an array.
+
+ This is used primarily by unit test classes to mock output streams. It
+ performs a similar function to StringIO, but (a) it is write-only, and
+ (b) it can be used to retrieve each individual write(); StringIO
+ concatenates all of the writes together.
+ """
+
+ def __init__(self):
+ self._contents = []
+
+ def write(self, msg):
+ """Implement stream.write() by appending to the stream's contents."""
+ self._contents.append(msg)
+
+ def get(self):
+ """Return the contents of a stream (as an array)."""
+ return self._contents
+
+ def reset(self):
+ """Empty the stream."""
+ self._contents = []
+
+ def empty(self):
+ """Return whether the stream is empty."""
+ return (len(self._contents) == 0)
+
+ def flush(self):
+ """Flush the stream (a no-op implemented for compatibility)."""
+ pass
+
+ def __repr__(self):
+ return '<ArrayStream: ' + str(self._contents) + '>'
diff --git a/WebKitTools/Scripts/webkitpy/steps/steps_unittest.py b/WebKitTools/Scripts/webkitpy/common/array_stream_unittest.py
index 3e6a032..1a9b34a 100644
--- a/WebKitTools/Scripts/webkitpy/steps/steps_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/array_stream_unittest.py
@@ -1,9 +1,10 @@
+#!/usr/bin/python
# Copyright (C) 2010 Google Inc. All rights reserved.
-#
+#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
-#
+#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
@@ -13,7 +14,7 @@
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
-#
+#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -26,31 +27,52 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+"""Unit tests for array_stream.py."""
+
+import pdb
import unittest
-from webkitpy.steps.update import Update
-from webkitpy.steps.promptforbugortitle import PromptForBugOrTitle
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
-from webkitpy.mock import Mock
-
-
-class StepsTest(unittest.TestCase):
- def _run_step(self, step, tool=None, options=None, state=None):
- if not tool:
- tool = MockBugzillaTool()
- if not options:
- options = Mock()
- if not state:
- state = {}
- step(tool, options).run(state)
-
- def test_update_step(self):
- options = Mock()
- options.update = True
- self._run_step(Update, options)
-
- def test_prompt_for_bug_or_title_step(self):
- tool = MockBugzillaTool()
- tool.user.prompt = lambda message: 42
- self._run_step(PromptForBugOrTitle, tool=tool)
+from webkitpy.common.array_stream import ArrayStream
+
+
+class ArrayStreamTest(unittest.TestCase):
+ def assertEmpty(self, a_stream):
+ self.assertTrue(a_stream.empty())
+
+ def assertNotEmpty(self, a_stream):
+ self.assertFalse(a_stream.empty())
+
+ def assertContentsMatch(self, a_stream, contents):
+ self.assertEquals(a_stream.get(), contents)
+
+ def test_basics(self):
+ a = ArrayStream()
+ self.assertEmpty(a)
+ self.assertContentsMatch(a, [])
+
+ a.flush()
+ self.assertEmpty(a)
+ self.assertContentsMatch(a, [])
+
+ a.write("foo")
+ a.write("bar")
+ self.assertNotEmpty(a)
+ self.assertContentsMatch(a, ["foo", "bar"])
+
+ a.flush()
+ self.assertNotEmpty(a)
+ self.assertContentsMatch(a, ["foo", "bar"])
+
+ a.reset()
+ self.assertEmpty(a)
+ self.assertContentsMatch(a, [])
+
+ self.assertEquals(str(a), "<ArrayStream: []>")
+
+ a.write("foo")
+ self.assertNotEmpty(a)
+ self.assertContentsMatch(a, ["foo"])
+ self.assertEquals(str(a), "<ArrayStream: ['foo']>")
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/__init__.py b/WebKitTools/Scripts/webkitpy/common/checkout/__init__.py
new file mode 100644
index 0000000..597dcbd
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/__init__.py
@@ -0,0 +1,3 @@
+# Required for Python to search this directory for module files
+
+from api import Checkout
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/api.py b/WebKitTools/Scripts/webkitpy/common/checkout/api.py
new file mode 100644
index 0000000..dbe1e84
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/api.py
@@ -0,0 +1,160 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import StringIO
+
+from webkitpy.common.checkout.changelog import ChangeLog
+from webkitpy.common.checkout.commitinfo import CommitInfo
+from webkitpy.common.checkout.scm import CommitMessage
+from webkitpy.common.memoized import memoized
+from webkitpy.common.net.bugzilla import parse_bug_id
+from webkitpy.common.system.executive import Executive, run_command, ScriptError
+from webkitpy.common.system.deprecated_logging import log
+
+
+# This class represents the WebKit-specific parts of the checkout (like
+# ChangeLogs).
+# FIXME: Move a bunch of ChangeLog-specific processing from SCM to this object.
+class Checkout(object):
+ def __init__(self, scm):
+ self._scm = scm
+
+ def _is_path_to_changelog(self, path):
+ return os.path.basename(path) == "ChangeLog"
+
+ def _latest_entry_for_changelog_at_revision(self, changelog_path, revision):
+ changelog_contents = self._scm.contents_at_revision(changelog_path, revision)
+ # contents_at_revision returns a byte array (str()), but we know
+ # that ChangeLog files are utf-8. parse_latest_entry_from_file
+ # expects a file-like object which vends unicode(), so we decode here.
+ changelog_file = StringIO.StringIO(changelog_contents.decode("utf-8"))
+ return ChangeLog.parse_latest_entry_from_file(changelog_file)
+
+ def changelog_entries_for_revision(self, revision):
+ changed_files = self._scm.changed_files_for_revision(revision)
+ return [self._latest_entry_for_changelog_at_revision(path, revision) for path in changed_files if self._is_path_to_changelog(path)]
+
+ @memoized
+ def commit_info_for_revision(self, revision):
+ committer_email = self._scm.committer_email_for_revision(revision)
+ changelog_entries = self.changelog_entries_for_revision(revision)
+ # Assume for now that the first entry has everything we need:
+ # FIXME: This will throw an exception if there were no ChangeLogs.
+ if not len(changelog_entries):
+ return None
+ changelog_entry = changelog_entries[0]
+ changelog_data = {
+ "bug_id": parse_bug_id(changelog_entry.contents()),
+ "author_name": changelog_entry.author_name(),
+ "author_email": changelog_entry.author_email(),
+ "author": changelog_entry.author(),
+ "reviewer_text": changelog_entry.reviewer_text(),
+ "reviewer": changelog_entry.reviewer(),
+ }
+ # We could pass the changelog_entry instead of a dictionary here, but that makes
+ # mocking slightly more involved, and would make aggregating data from multiple
+ # entries more difficult to wire in if we need to do that in the future.
+ return CommitInfo(revision, committer_email, changelog_data)
+
+ def bug_id_for_revision(self, revision):
+ return self.commit_info_for_revision(revision).bug_id()
+
+ def _modified_files_matching_predicate(self, git_commit, predicate, changed_files=None):
+ # SCM returns paths relative to scm.checkout_root
+ # Callers (especially those using the ChangeLog class) may
+ # expect absolute paths, so this method returns absolute paths.
+ if not changed_files:
+ changed_files = self._scm.changed_files(git_commit)
+ absolute_paths = [os.path.join(self._scm.checkout_root, path) for path in changed_files]
+ return [path for path in absolute_paths if predicate(path)]
+
+ def modified_changelogs(self, git_commit, changed_files=None):
+ return self._modified_files_matching_predicate(git_commit, self._is_path_to_changelog, changed_files=changed_files)
+
+ def modified_non_changelogs(self, git_commit, changed_files=None):
+ return self._modified_files_matching_predicate(git_commit, lambda path: not self._is_path_to_changelog(path), changed_files=changed_files)
+
+ def commit_message_for_this_commit(self, git_commit, changed_files=None):
+ changelog_paths = self.modified_changelogs(git_commit, changed_files)
+ if not len(changelog_paths):
+ raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
+ "All changes require a ChangeLog. See:\n"
+ "http://webkit.org/coding/contributing.html")
+
+ changelog_messages = []
+ for changelog_path in changelog_paths:
+ log("Parsing ChangeLog: %s" % changelog_path)
+ changelog_entry = ChangeLog(changelog_path).latest_entry()
+ if not changelog_entry:
+ raise ScriptError(message="Failed to parse ChangeLog: %s" % os.path.abspath(changelog_path))
+ changelog_messages.append(changelog_entry.contents())
+
+ # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
+ return CommitMessage("".join(changelog_messages).splitlines())
+
+ def recent_commit_infos_for_files(self, paths):
+ revisions = set(sum(map(self._scm.revisions_changing_file, paths), []))
+ return set(map(self.commit_info_for_revision, revisions))
+
+ def suggested_reviewers(self, git_commit, changed_files=None):
+ changed_files = self.modified_non_changelogs(git_commit, changed_files)
+ commit_infos = self.recent_commit_infos_for_files(changed_files)
+ reviewers = [commit_info.reviewer() for commit_info in commit_infos if commit_info.reviewer()]
+ reviewers.extend([commit_info.author() for commit_info in commit_infos if commit_info.author() and commit_info.author().can_review])
+ return sorted(set(reviewers))
+
+ def bug_id_for_this_commit(self, git_commit, changed_files=None):
+ try:
+ return parse_bug_id(self.commit_message_for_this_commit(git_commit, changed_files).message())
+ except ScriptError, e:
+ pass # We might not have ChangeLogs.
+
+ def apply_patch(self, patch, force=False):
+ # It's possible that the patch was not made from the root directory.
+ # We should detect and handle that case.
+ # FIXME: Move _scm.script_path here once we get rid of all the dependencies.
+ args = [self._scm.script_path('svn-apply')]
+ if patch.reviewer():
+ args += ['--reviewer', patch.reviewer().full_name]
+ if force:
+ args.append('--force')
+ run_command(args, input=patch.contents())
+
+ def apply_reverse_diff(self, revision):
+ self._scm.apply_reverse_diff(revision)
+
+ # We revert the ChangeLogs because removing lines from a ChangeLog
+ # doesn't make sense. ChangeLogs are append only.
+ changelog_paths = self.modified_changelogs(git_commit=None)
+ if len(changelog_paths):
+ self._scm.revert_files(changelog_paths)
+
+ conflicts = self._scm.conflicted_files()
+ if len(conflicts):
+ raise ScriptError(message="Failed to apply reverse diff for revision %s because of the following conflicts:\n%s" % (revision, "\n".join(conflicts)))
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py
new file mode 100644
index 0000000..1f97abd
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/api_unittest.py
@@ -0,0 +1,196 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from __future__ import with_statement
+
+import codecs
+import os
+import shutil
+import tempfile
+import unittest
+
+from webkitpy.common.checkout.api import Checkout
+from webkitpy.common.checkout.changelog import ChangeLogEntry
+from webkitpy.common.checkout.scm import detect_scm_system, CommitMessage
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+
+
+# FIXME: Copied from scm_unittest.py
+def write_into_file_at_path(file_path, contents, encoding="utf-8"):
+ with codecs.open(file_path, "w", encoding) as file:
+ file.write(contents)
+
+
+_changelog1entry1 = u"""2010-03-25 Tor Arne Vestb\u00f8 <vestbo@webkit.org>
+
+ Unreviewed build fix to un-break webkit-patch land.
+
+ Move commit_message_for_this_commit from scm to checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36629
+
+ * Scripts/webkitpy/common/checkout/api.py: import scm.CommitMessage
+"""
+_changelog1entry2 = u"""2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move commit_message_for_this_commit from scm to checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36629
+
+ * Scripts/webkitpy/common/checkout/api.py:
+"""
+_changelog1 = u"\n".join([_changelog1entry1, _changelog1entry2])
+_changelog2 = u"""2010-03-25 Tor Arne Vestb\u00f8 <vestbo@webkit.org>
+
+ Unreviewed build fix to un-break webkit-patch land.
+
+ Second part of this complicated change.
+
+ * Path/To/Complicated/File: Added.
+
+2010-03-25 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Filler change.
+"""
+
+class CommitMessageForThisCommitTest(unittest.TestCase):
+ expected_commit_message = u"""2010-03-25 Tor Arne Vestb\u00f8 <vestbo@webkit.org>
+
+ Unreviewed build fix to un-break webkit-patch land.
+
+ Move commit_message_for_this_commit from scm to checkout
+ https://bugs.webkit.org/show_bug.cgi?id=36629
+
+ * Scripts/webkitpy/common/checkout/api.py: import scm.CommitMessage
+2010-03-25 Tor Arne Vestb\u00f8 <vestbo@webkit.org>
+
+ Unreviewed build fix to un-break webkit-patch land.
+
+ Second part of this complicated change.
+
+ * Path/To/Complicated/File: Added.
+"""
+
+ def setUp(self):
+ self.temp_dir = tempfile.mkdtemp(suffix="changelogs")
+ self.old_cwd = os.getcwd()
+ os.chdir(self.temp_dir)
+ write_into_file_at_path("ChangeLog1", _changelog1)
+ write_into_file_at_path("ChangeLog2", _changelog2)
+
+ def tearDown(self):
+ shutil.rmtree(self.temp_dir, ignore_errors=True)
+ os.chdir(self.old_cwd)
+
+ # FIXME: This should not need to touch the file system, however
+ # ChangeLog is difficult to mock at current.
+ def test_commit_message_for_this_commit(self):
+ checkout = Checkout(None)
+ checkout.modified_changelogs = lambda git_commit, changed_files=None: ["ChangeLog1", "ChangeLog2"]
+ output = OutputCapture()
+ expected_stderr = "Parsing ChangeLog: ChangeLog1\nParsing ChangeLog: ChangeLog2\n"
+ commit_message = output.assert_outputs(self, checkout.commit_message_for_this_commit,
+ kwargs={"git_commit": None}, expected_stderr=expected_stderr)
+ self.assertEqual(commit_message.message(), self.expected_commit_message)
+
+
+class CheckoutTest(unittest.TestCase):
+ def test_latest_entry_for_changelog_at_revision(self):
+ scm = Mock()
+ def mock_contents_at_revision(changelog_path, revision):
+ self.assertEqual(changelog_path, "foo")
+ self.assertEqual(revision, "bar")
+ # contents_at_revision is expected to return a byte array (str)
+ # so we encode our unicode ChangeLog down to a utf-8 stream.
+ return _changelog1.encode("utf-8")
+ scm.contents_at_revision = mock_contents_at_revision
+ checkout = Checkout(scm)
+ entry = checkout._latest_entry_for_changelog_at_revision("foo", "bar")
+ self.assertEqual(entry.contents(), _changelog1entry1)
+
+ def test_commit_info_for_revision(self):
+ scm = Mock()
+ scm.committer_email_for_revision = lambda revision: "committer@example.com"
+ checkout = Checkout(scm)
+ checkout.changelog_entries_for_revision = lambda revision: [ChangeLogEntry(_changelog1entry1)]
+ commitinfo = checkout.commit_info_for_revision(4)
+ self.assertEqual(commitinfo.bug_id(), 36629)
+ self.assertEqual(commitinfo.author_name(), u"Tor Arne Vestb\u00f8")
+ self.assertEqual(commitinfo.author_email(), "vestbo@webkit.org")
+ self.assertEqual(commitinfo.reviewer_text(), None)
+ self.assertEqual(commitinfo.reviewer(), None)
+ self.assertEqual(commitinfo.committer_email(), "committer@example.com")
+ self.assertEqual(commitinfo.committer(), None)
+
+ checkout.changelog_entries_for_revision = lambda revision: []
+ self.assertEqual(checkout.commit_info_for_revision(1), None)
+
+ def test_bug_id_for_revision(self):
+ scm = Mock()
+ scm.committer_email_for_revision = lambda revision: "committer@example.com"
+ checkout = Checkout(scm)
+ checkout.changelog_entries_for_revision = lambda revision: [ChangeLogEntry(_changelog1entry1)]
+ self.assertEqual(checkout.bug_id_for_revision(4), 36629)
+
+ def test_bug_id_for_this_commit(self):
+ scm = Mock()
+ checkout = Checkout(scm)
+ checkout.commit_message_for_this_commit = lambda git_commit, changed_files=None: CommitMessage(ChangeLogEntry(_changelog1entry1).contents().splitlines())
+ self.assertEqual(checkout.bug_id_for_this_commit(git_commit=None), 36629)
+
+ def test_modified_changelogs(self):
+ scm = Mock()
+ scm.checkout_root = "/foo/bar"
+ scm.changed_files = lambda git_commit: ["file1", "ChangeLog", "relative/path/ChangeLog"]
+ checkout = Checkout(scm)
+ expected_changlogs = ["/foo/bar/ChangeLog", "/foo/bar/relative/path/ChangeLog"]
+ self.assertEqual(checkout.modified_changelogs(git_commit=None), expected_changlogs)
+
+ def test_suggested_reviewers(self):
+ def mock_changelog_entries_for_revision(revision):
+ if revision % 2 == 0:
+ return [ChangeLogEntry(_changelog1entry1)]
+ return [ChangeLogEntry(_changelog1entry2)]
+
+ def mock_revisions_changing_file(path, limit=5):
+ if path.endswith("ChangeLog"):
+ return [3]
+ return [4, 8]
+
+ scm = Mock()
+ scm.checkout_root = "/foo/bar"
+ scm.changed_files = lambda git_commit: ["file1", "file2", "relative/path/ChangeLog"]
+ scm.revisions_changing_file = mock_revisions_changing_file
+ checkout = Checkout(scm)
+ checkout.changelog_entries_for_revision = mock_changelog_entries_for_revision
+ reviewers = checkout.suggested_reviewers(git_commit=None)
+ reviewer_names = [reviewer.full_name for reviewer in reviewers]
+ self.assertEqual(reviewer_names, [u'Tor Arne Vestb\xf8'])
diff --git a/WebKitTools/Scripts/webkitpy/changelogs.py b/WebKitTools/Scripts/webkitpy/common/checkout/changelog.py
index ebc89c4..40657eb 100644
--- a/WebKitTools/Scripts/webkitpy/changelogs.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/changelog.py
@@ -28,10 +28,16 @@
#
# WebKit's Python module for parsing and modifying ChangeLog files
+import codecs
import fileinput # inplace file editing for set_reviewer_in_changelog
+import os.path
import re
import textwrap
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.net.bugzilla import parse_bug_id
+
def view_source_url(revision_number):
# FIMXE: This doesn't really belong in this file, but we don't have a
@@ -40,39 +46,89 @@ def view_source_url(revision_number):
return "http://trac.webkit.org/changeset/%s" % revision_number
-class ChangeLog:
+class ChangeLogEntry(object):
+ # e.g. 2009-06-03 Eric Seidel <eric@webkit.org>
+ date_line_regexp = r'^(?P<date>\d{4}-\d{2}-\d{2})\s+(?P<name>.+?)\s+<(?P<email>[^<>]+)>$'
+
+ def __init__(self, contents, committer_list=CommitterList()):
+ self._contents = contents
+ self._committer_list = committer_list
+ self._parse_entry()
+
+ def _parse_entry(self):
+ match = re.match(self.date_line_regexp, self._contents, re.MULTILINE)
+ if not match:
+ log("WARNING: Creating invalid ChangeLogEntry:\n%s" % self._contents)
+
+ # FIXME: group("name") does not seem to be Unicode? Probably due to self._contents not being unicode.
+ self._author_name = match.group("name") if match else None
+ self._author_email = match.group("email") if match else None
+
+ match = re.search("^\s+Reviewed by (?P<reviewer>.*?)[\.,]?\s*$", self._contents, re.MULTILINE) # Discard everything after the first period
+ self._reviewer_text = match.group("reviewer") if match else None
+
+ self._reviewer = self._committer_list.committer_by_name(self._reviewer_text)
+ self._author = self._committer_list.committer_by_email(self._author_email) or self._committer_list.committer_by_name(self._author_name)
+
+ def author_name(self):
+ return self._author_name
+
+ def author_email(self):
+ return self._author_email
+
+ def author(self):
+ return self._author # Might be None
+
+ # FIXME: Eventually we would like to map reviwer names to reviewer objects.
+ # See https://bugs.webkit.org/show_bug.cgi?id=26533
+ def reviewer_text(self):
+ return self._reviewer_text
+
+ def reviewer(self):
+ return self._reviewer # Might be None
+
+ def contents(self):
+ return self._contents
+
+ def bug_id(self):
+ return parse_bug_id(self._contents)
+
+
+# FIXME: Various methods on ChangeLog should move into ChangeLogEntry instead.
+class ChangeLog(object):
def __init__(self, path):
self.path = path
_changelog_indent = " " * 8
- # e.g. 2009-06-03 Eric Seidel <eric@webkit.org>
- date_line_regexp = re.compile('^(\d{4}-\d{2}-\d{2})' # Consume the date.
- + '\s+(.+)\s+' # Consume the name.
- + '<([^<>]+)>$') # And the email address.
-
@staticmethod
- def _parse_latest_entry_from_file(changelog_file):
+ def parse_latest_entry_from_file(changelog_file):
+ """changelog_file must be a file-like object which returns
+ unicode strings. Use codecs.open or StringIO(unicode())
+ to pass file objects to this class."""
+ date_line_regexp = re.compile(ChangeLogEntry.date_line_regexp)
entry_lines = []
# The first line should be a date line.
first_line = changelog_file.readline()
- if not ChangeLog.date_line_regexp.match(first_line):
+ assert(isinstance(first_line, unicode))
+ if not date_line_regexp.match(first_line):
return None
entry_lines.append(first_line)
for line in changelog_file:
# If we've hit the next entry, return.
- if ChangeLog.date_line_regexp.match(line):
+ if date_line_regexp.match(line):
# Remove the extra newline at the end
- return ''.join(entry_lines[:-1])
+ return ChangeLogEntry(''.join(entry_lines[:-1]))
entry_lines.append(line)
return None # We never found a date line!
def latest_entry(self):
- changelog_file = open(self.path)
+ # ChangeLog files are always UTF-8, we read them in as such to support Reviewers with unicode in their names.
+ changelog_file = codecs.open(self.path, "r", "utf-8")
try:
- return self._parse_latest_entry_from_file(changelog_file)
+ return self.parse_latest_entry_from_file(changelog_file)
finally:
changelog_file.close()
@@ -96,7 +152,7 @@ class ChangeLog:
# This probably does not belong in changelogs.py
def _message_for_revert(self, revision, reason, bug_url):
- message = "No review, rolling out r%s.\n" % revision
+ message = "Unreviewed, rolling out r%s.\n" % revision
message += "%s\n" % view_source_url(revision)
if bug_url:
message += "%s\n" % bug_url
@@ -132,3 +188,8 @@ class ChangeLog:
for line in fileinput.FileInput(self.path, inplace=1):
# Trailing comma suppresses printing newline
print line.replace("NOBODY (OOPS!)", reviewer.encode("utf-8")),
+
+ def set_short_description_and_bug_url(self, short_description, bug_url):
+ message = "%s\n %s" % (short_description, bug_url)
+ for line in fileinput.FileInput(self.path, inplace=1):
+ print line.replace("Need a short description and bug URL (OOPS!)", message.encode("utf-8")),
diff --git a/WebKitTools/Scripts/webkitpy/changelogs_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/changelog_unittest.py
index de3e60c..6aeb1f8 100644
--- a/WebKitTools/Scripts/webkitpy/changelogs_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/changelog_unittest.py
@@ -26,18 +26,23 @@
# (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 unittest
-from changelogs import *
+from __future__ import with_statement
+import codecs
import os
import tempfile
+import unittest
+
from StringIO import StringIO
-class ChangeLogsTest(unittest.TestCase):
+from webkitpy.common.checkout.changelog import *
- _example_entry = '''2009-08-17 Peter Kasting <pkasting@google.com>
- Reviewed by Steve Falkenburg.
+class ChangeLogTest(unittest.TestCase):
+
+ _example_entry = u'''2009-08-17 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Tor Arne Vestb\xf8.
https://bugs.webkit.org/show_bug.cgi?id=27323
Only add Cygwin to the path when it isn't already there. This avoids
@@ -50,7 +55,7 @@ class ChangeLogsTest(unittest.TestCase):
'''
# More example text than we need. Eventually we need to support parsing this all and write tests for the parsing.
- _example_changelog = '''2009-08-17 David Kilzer <ddkilzer@apple.com>
+ _example_changelog = u"""2009-08-17 Tor Arne Vestb\xf8 <vestbo@webkit.org>
<http://webkit.org/b/28393> check-webkit-style: add check for use of std::max()/std::min() instead of MAX()/MIN()
@@ -82,28 +87,30 @@ class ChangeLogsTest(unittest.TestCase):
so we can't assert here.
== Rolled over to ChangeLog-2009-06-16 ==
-'''
+"""
def test_latest_entry_parse(self):
- changelog_contents = "%s\n%s" % (self._example_entry, self._example_changelog)
+ changelog_contents = u"%s\n%s" % (self._example_entry, self._example_changelog)
changelog_file = StringIO(changelog_contents)
- latest_entry = ChangeLog._parse_latest_entry_from_file(changelog_file)
- self.assertEquals(self._example_entry, latest_entry)
+ latest_entry = ChangeLog.parse_latest_entry_from_file(changelog_file)
+ self.assertEquals(latest_entry.contents(), self._example_entry)
+ self.assertEquals(latest_entry.author_name(), "Peter Kasting")
+ self.assertEquals(latest_entry.author_email(), "pkasting@google.com")
+ self.assertEquals(latest_entry.reviewer_text(), u"Tor Arne Vestb\xf8")
+ self.assertTrue(latest_entry.reviewer()) # Make sure that our UTF8-based lookup of Tor works.
@staticmethod
- def _write_tmp_file_with_contents(contents):
+ def _write_tmp_file_with_contents(byte_array):
+ assert(isinstance(byte_array, str))
(file_descriptor, file_path) = tempfile.mkstemp() # NamedTemporaryFile always deletes the file on close in python < 2.6
- file = os.fdopen(file_descriptor, 'w')
- file.write(contents)
- file.close()
+ with os.fdopen(file_descriptor, "w") as file:
+ file.write(byte_array)
return file_path
@staticmethod
- def _read_file_contents(file_path):
- file = open(file_path)
- contents = file.read()
- file.close()
- return contents
+ def _read_file_contents(file_path, encoding):
+ with codecs.open(file_path, "r", encoding) as file:
+ return file.read()
_new_entry_boilerplate = '''2009-08-19 Eric Seidel <eric@webkit.org>
@@ -115,16 +122,28 @@ class ChangeLogsTest(unittest.TestCase):
'''
def test_set_reviewer(self):
- changelog_contents = "%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
- changelog_path = self._write_tmp_file_with_contents(changelog_contents)
+ changelog_contents = u"%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
+ changelog_path = self._write_tmp_file_with_contents(changelog_contents.encode("utf-8"))
reviewer_name = 'Test Reviewer'
ChangeLog(changelog_path).set_reviewer(reviewer_name)
- actual_contents = self._read_file_contents(changelog_path)
+ actual_contents = self._read_file_contents(changelog_path, "utf-8")
expected_contents = changelog_contents.replace('NOBODY (OOPS!)', reviewer_name)
os.remove(changelog_path)
self.assertEquals(actual_contents, expected_contents)
- _revert_message = """ No review, rolling out r12345.
+ def test_set_short_description_and_bug_url(self):
+ changelog_contents = u"%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
+ changelog_path = self._write_tmp_file_with_contents(changelog_contents.encode("utf-8"))
+ short_description = "A short description"
+ bug_url = "http://example.com/b/2344"
+ ChangeLog(changelog_path).set_short_description_and_bug_url(short_description, bug_url)
+ actual_contents = self._read_file_contents(changelog_path, "utf-8")
+ expected_message = "%s\n %s" % (short_description, bug_url)
+ expected_contents = changelog_contents.replace("Need a short description and bug URL (OOPS!)", expected_message)
+ os.remove(changelog_path)
+ self.assertEquals(actual_contents, expected_contents)
+
+ _revert_message = """ Unreviewed, rolling out r12345.
http://trac.webkit.org/changeset/12345
http://example.com/123
@@ -143,7 +162,7 @@ class ChangeLogsTest(unittest.TestCase):
_revert_entry_with_bug_url = '''2009-08-19 Eric Seidel <eric@webkit.org>
- No review, rolling out r12345.
+ Unreviewed, rolling out r12345.
http://trac.webkit.org/changeset/12345
http://example.com/123
@@ -154,7 +173,7 @@ class ChangeLogsTest(unittest.TestCase):
_revert_entry_without_bug_url = '''2009-08-19 Eric Seidel <eric@webkit.org>
- No review, rolling out r12345.
+ Unreviewed, rolling out r12345.
http://trac.webkit.org/changeset/12345
Reason
@@ -163,17 +182,22 @@ class ChangeLogsTest(unittest.TestCase):
'''
def _assert_update_for_revert_output(self, args, expected_entry):
- changelog_contents = "%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
- changelog_path = self._write_tmp_file_with_contents(changelog_contents)
+ changelog_contents = u"%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
+ changelog_path = self._write_tmp_file_with_contents(changelog_contents.encode("utf-8"))
changelog = ChangeLog(changelog_path)
changelog.update_for_revert(*args)
actual_entry = changelog.latest_entry()
os.remove(changelog_path)
- self.assertEquals(actual_entry, expected_entry)
+ self.assertEquals(actual_entry.contents(), expected_entry)
+ self.assertEquals(actual_entry.reviewer_text(), None)
+ # These checks could be removed to allow this to work on other entries:
+ self.assertEquals(actual_entry.author_name(), "Eric Seidel")
+ self.assertEquals(actual_entry.author_email(), "eric@webkit.org")
def test_update_for_revert(self):
self._assert_update_for_revert_output([12345, "Reason"], self._revert_entry_without_bug_url)
self._assert_update_for_revert_output([12345, "Reason", "http://example.com/123"], self._revert_entry_with_bug_url)
+
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py b/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py
new file mode 100644
index 0000000..448d530
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo.py
@@ -0,0 +1,93 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# WebKit's python module for holding information on a commit
+
+from webkitpy.common.checkout.changelog import view_source_url
+from webkitpy.common.config.committers import CommitterList
+
+
+class CommitInfo(object):
+ def __init__(self, revision, committer_email, changelog_data, committer_list=CommitterList()):
+ self._revision = revision
+ self._committer_email = committer_email
+ self._bug_id = changelog_data["bug_id"]
+ self._author_name = changelog_data["author_name"]
+ self._author_email = changelog_data["author_email"]
+ self._author = changelog_data["author"]
+ self._reviewer_text = changelog_data["reviewer_text"]
+ self._reviewer = changelog_data["reviewer"]
+
+ # Derived values:
+ self._committer = committer_list.committer_by_email(committer_email)
+
+ def revision(self):
+ return self._revision
+
+ def committer(self):
+ return self._committer # None if committer isn't in committers.py
+
+ def committer_email(self):
+ return self._committer_email
+
+ def bug_id(self):
+ return self._bug_id # May be None
+
+ def author(self):
+ return self._author # May be None
+
+ def author_name(self):
+ return self._author_name
+
+ def author_email(self):
+ return self._author_email
+
+ def reviewer(self):
+ return self._reviewer # May be None
+
+ def reviewer_text(self):
+ return self._reviewer_text # May be None
+
+ def responsible_parties(self):
+ responsible_parties = [
+ self.committer(),
+ self.author(),
+ self.reviewer(),
+ ]
+ return set([party for party in responsible_parties if party]) # Filter out None
+
+ # FIXME: It is slightly lame that this "view" method is on this "model" class (in MVC terms)
+ def blame_string(self, bugs):
+ string = "r%s:\n" % self.revision()
+ string += " %s\n" % view_source_url(self.revision())
+ string += " Bug: %s (%s)\n" % (self.bug_id(), bugs.bug_url_for_bug_id(self.bug_id()))
+ author_line = "\"%s\" <%s>" % (self.author_name(), self.author_email())
+ string += " Author: %s\n" % (self.author() or author_line)
+ string += " Reviewer: %s\n" % (self.reviewer() or self.reviewer_text())
+ string += " Committer: %s" % self.committer()
+ return string
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py
new file mode 100644
index 0000000..f58e6f1
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/commitinfo_unittest.py
@@ -0,0 +1,61 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.checkout.commitinfo import CommitInfo
+from webkitpy.common.config.committers import CommitterList, Committer, Reviewer
+
+class CommitInfoTest(unittest.TestCase):
+
+ def test_commit_info_creation(self):
+ author = Committer("Author", "author@example.com")
+ committer = Committer("Committer", "committer@example.com")
+ reviewer = Reviewer("Reviewer", "reviewer@example.com")
+ committer_list = CommitterList(committers=[author, committer], reviewers=[reviewer])
+
+ changelog_data = {
+ "bug_id": 1234,
+ "author_name": "Committer",
+ "author_email": "author@example.com",
+ "author": author,
+ "reviewer_text": "Reviewer",
+ "reviewer": reviewer,
+ }
+ commit = CommitInfo(123, "committer@example.com", changelog_data, committer_list)
+
+ self.assertEqual(commit.revision(), 123)
+ self.assertEqual(commit.bug_id(), 1234)
+ self.assertEqual(commit.author_name(), "Committer")
+ self.assertEqual(commit.author_email(), "author@example.com")
+ self.assertEqual(commit.author(), author)
+ self.assertEqual(commit.reviewer_text(), "Reviewer")
+ self.assertEqual(commit.reviewer(), reviewer)
+ self.assertEqual(commit.committer(), committer)
+ self.assertEqual(commit.committer_email(), "committer@example.com")
+ self.assertEqual(commit.responsible_parties(), set([author, committer, reviewer]))
diff --git a/WebKitTools/Scripts/webkitpy/diff_parser.py b/WebKitTools/Scripts/webkitpy/common/checkout/diff_parser.py
index 7dce7e8..a6ea756 100644
--- a/WebKitTools/Scripts/webkitpy/diff_parser.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/diff_parser.py
@@ -31,10 +31,15 @@
import logging
import re
+_log = logging.getLogger("webkitpy.common.checkout.diff_parser")
+
+# FIXME: This is broken. We should compile our regexps up-front
+# instead of using a custom cache.
_regexp_compile_cache = {}
+# FIXME: This function should be removed.
def match(pattern, string):
"""Matches the string with the pattern, caching the compiled regexp."""
if not pattern in _regexp_compile_cache:
@@ -42,12 +47,15 @@ def match(pattern, string):
return _regexp_compile_cache[pattern].match(string)
+# FIXME: This belongs on DiffParser (e.g. as to_svn_diff()).
def git_diff_to_svn_diff(line):
"""Converts a git formatted diff line to a svn formatted line.
Args:
line: A string representing a line of the diff.
"""
+ # FIXME: This list should be a class member on DiffParser.
+ # These regexp patterns should be compiled once instead of every time.
conversion_patterns = (("^diff --git \w/(.+) \w/(?P<FilePath>.+)", lambda matched: "Index: " + matched.group('FilePath') + "\n"),
("^new file.*", lambda matched: "\n"),
("^index [0-9a-f]{7}\.\.[0-9a-f]{7} [0-9]{6}", lambda matched: "===================================================================\n"),
@@ -61,6 +69,7 @@ def git_diff_to_svn_diff(line):
return line
+# FIXME: This method belongs on DiffParser
def get_diff_converter(first_diff_line):
"""Gets a converter function of diff lines.
@@ -79,7 +88,7 @@ _DECLARED_FILE_PATH = 2
_PROCESSING_CHUNK = 3
-class DiffFile:
+class DiffFile(object):
"""Contains the information for one file in a patch.
The field "lines" is a list which contains tuples in this format:
@@ -87,6 +96,13 @@ class DiffFile:
If deleted_line_number is zero, it means this line is newly added.
If new_line_number is zero, it means this line is deleted.
"""
+ # FIXME: Tuples generally grow into classes. We should consider
+ # adding a DiffLine object.
+
+ def added_or_modified_line_numbers(self):
+ # This logic was moved from patchreader.py, but may not be
+ # the right API for this object long-term.
+ return [line[1] for line in self.lines if not line[0]]
def __init__(self, filename):
self.filename = filename
@@ -102,13 +118,14 @@ class DiffFile:
self.lines.append((deleted_line_number, new_line_number, line))
-class DiffParser:
+class DiffParser(object):
"""A parser for a patch file.
The field "files" is a dict whose key is the filename and value is
a DiffFile object.
"""
+ # FIXME: This function is way too long and needs to be broken up.
def __init__(self, diff_input):
"""Parses a diff.
@@ -138,7 +155,8 @@ class DiffParser:
lines_changed = match(r"^@@ -(?P<OldStartLine>\d+)(,\d+)? \+(?P<NewStartLine>\d+)(,\d+)? @@", line)
if lines_changed:
if state != _DECLARED_FILE_PATH and state != _PROCESSING_CHUNK:
- logging.error('Unexpected line change without file path declaration: %r' % line)
+ _log.error('Unexpected line change without file path '
+ 'declaration: %r' % line)
old_diff_line = int(lines_changed.group('OldStartLine'))
new_diff_line = int(lines_changed.group('NewStartLine'))
state = _PROCESSING_CHUNK
@@ -159,4 +177,5 @@ class DiffParser:
# Nothing to do. We may still have some added lines.
pass
else:
- logging.error('Unexpected diff format when parsing a chunk: %r' % line)
+ _log.error('Unexpected diff format when parsing a '
+ 'chunk: %r' % line)
diff --git a/WebKitTools/Scripts/webkitpy/diff_parser_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py
index 7eb0eab..7eb0eab 100644
--- a/WebKitTools/Scripts/webkitpy/diff_parser_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/diff_parser_unittest.py
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
new file mode 100644
index 0000000..11e82ac
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm.py
@@ -0,0 +1,916 @@
+# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Python module for interacting with an SCM system (like SVN or Git)
+
+import os
+import re
+import sys
+import shutil
+
+from webkitpy.common.system.executive import Executive, run_command, ScriptError
+from webkitpy.common.system.deprecated_logging import error, log
+from webkitpy.common.memoized import memoized
+
+
+def find_checkout_root():
+ """Returns the current checkout root (as determined by default_scm().
+
+ Returns the absolute path to the top of the WebKit checkout, or None
+ if it cannot be determined.
+
+ """
+ scm_system = default_scm()
+ if scm_system:
+ return scm_system.checkout_root
+ return None
+
+
+def default_scm():
+ """Return the default SCM object as determined by the CWD and running code.
+
+ Returns the default SCM object for the current working directory; if the
+ CWD is not in a checkout, then we attempt to figure out if the SCM module
+ itself is part of a checkout, and return that one. If neither is part of
+ a checkout, None is returned.
+
+ """
+ cwd = os.getcwd()
+ scm_system = detect_scm_system(cwd)
+ if not scm_system:
+ script_directory = os.path.dirname(os.path.abspath(__file__))
+ scm_system = detect_scm_system(script_directory)
+ if scm_system:
+ log("The current directory (%s) is not a WebKit checkout, using %s" % (cwd, scm_system.checkout_root))
+ else:
+ error("FATAL: Failed to determine the SCM system for either %s or %s" % (cwd, script_directory))
+ return scm_system
+
+
+def detect_scm_system(path):
+ absolute_path = os.path.abspath(path)
+
+ if SVN.in_working_directory(absolute_path):
+ return SVN(cwd=absolute_path)
+
+ if Git.in_working_directory(absolute_path):
+ return Git(cwd=absolute_path)
+
+ return None
+
+
+def first_non_empty_line_after_index(lines, index=0):
+ first_non_empty_line = index
+ for line in lines[index:]:
+ if re.match("^\s*$", line):
+ first_non_empty_line += 1
+ else:
+ break
+ return first_non_empty_line
+
+
+class CommitMessage:
+ def __init__(self, message):
+ self.message_lines = message[first_non_empty_line_after_index(message, 0):]
+
+ def body(self, lstrip=False):
+ lines = self.message_lines[first_non_empty_line_after_index(self.message_lines, 1):]
+ if lstrip:
+ lines = [line.lstrip() for line in lines]
+ return "\n".join(lines) + "\n"
+
+ def description(self, lstrip=False, strip_url=False):
+ line = self.message_lines[0]
+ if lstrip:
+ line = line.lstrip()
+ if strip_url:
+ line = re.sub("^(\s*)<.+> ", "\1", line)
+ return line
+
+ def message(self):
+ return "\n".join(self.message_lines) + "\n"
+
+
+class CheckoutNeedsUpdate(ScriptError):
+ def __init__(self, script_args, exit_code, output, cwd):
+ ScriptError.__init__(self, script_args=script_args, exit_code=exit_code, output=output, cwd=cwd)
+
+
+def commit_error_handler(error):
+ if re.search("resource out of date", error.output):
+ raise CheckoutNeedsUpdate(script_args=error.script_args, exit_code=error.exit_code, output=error.output, cwd=error.cwd)
+ Executive.default_error_handler(error)
+
+
+class AuthenticationError(Exception):
+ def __init__(self, server_host):
+ self.server_host = server_host
+
+
+class AmbiguousCommitError(Exception):
+ def __init__(self, num_local_commits, working_directory_is_clean):
+ self.num_local_commits = num_local_commits
+ self.working_directory_is_clean = working_directory_is_clean
+
+
+# SCM methods are expected to return paths relative to self.checkout_root.
+class SCM:
+ def __init__(self, cwd):
+ self.cwd = cwd
+ self.checkout_root = self.find_checkout_root(self.cwd)
+ self.dryrun = False
+
+ # A wrapper used by subclasses to create processes.
+ def run(self, args, cwd=None, input=None, error_handler=None, return_exit_code=False, return_stderr=True, decode_output=True):
+ # FIXME: We should set cwd appropriately.
+ # FIXME: We should use Executive.
+ return run_command(args,
+ cwd=cwd,
+ input=input,
+ error_handler=error_handler,
+ return_exit_code=return_exit_code,
+ return_stderr=return_stderr,
+ decode_output=decode_output)
+
+ # SCM always returns repository relative path, but sometimes we need
+ # absolute paths to pass to rm, etc.
+ def absolute_path(self, repository_relative_path):
+ return os.path.join(self.checkout_root, repository_relative_path)
+
+ # FIXME: This belongs in Checkout, not SCM.
+ def scripts_directory(self):
+ return os.path.join(self.checkout_root, "WebKitTools", "Scripts")
+
+ # FIXME: This belongs in Checkout, not SCM.
+ def script_path(self, script_name):
+ return os.path.join(self.scripts_directory(), script_name)
+
+ def ensure_clean_working_directory(self, force_clean):
+ if not force_clean and not self.working_directory_is_clean():
+ # FIXME: Shouldn't this use cwd=self.checkout_root?
+ print self.run(self.status_command(), error_handler=Executive.ignore_error)
+ raise ScriptError(message="Working directory has modifications, pass --force-clean or --no-clean to continue.")
+
+ log("Cleaning working directory")
+ self.clean_working_directory()
+
+ def ensure_no_local_commits(self, force):
+ if not self.supports_local_commits():
+ return
+ commits = self.local_commits()
+ if not len(commits):
+ return
+ if not force:
+ error("Working directory has local commits, pass --force-clean to continue.")
+ self.discard_local_commits()
+
+ def run_status_and_extract_filenames(self, status_command, status_regexp):
+ filenames = []
+ # We run with cwd=self.checkout_root so that returned-paths are root-relative.
+ for line in self.run(status_command, cwd=self.checkout_root).splitlines():
+ match = re.search(status_regexp, line)
+ if not match:
+ continue
+ # status = match.group('status')
+ filename = match.group('filename')
+ filenames.append(filename)
+ return filenames
+
+ def strip_r_from_svn_revision(self, svn_revision):
+ match = re.match("^r(?P<svn_revision>\d+)", unicode(svn_revision))
+ if (match):
+ return match.group('svn_revision')
+ return svn_revision
+
+ def svn_revision_from_commit_text(self, commit_text):
+ match = re.search(self.commit_success_regexp(), commit_text, re.MULTILINE)
+ return match.group('svn_revision')
+
+ @staticmethod
+ def _subclass_must_implement():
+ raise NotImplementedError("subclasses must implement")
+
+ @staticmethod
+ def in_working_directory(path):
+ SCM._subclass_must_implement()
+
+ @staticmethod
+ def find_checkout_root(path):
+ SCM._subclass_must_implement()
+
+ @staticmethod
+ def commit_success_regexp():
+ SCM._subclass_must_implement()
+
+ def working_directory_is_clean(self):
+ self._subclass_must_implement()
+
+ def clean_working_directory(self):
+ self._subclass_must_implement()
+
+ def status_command(self):
+ self._subclass_must_implement()
+
+ def add(self, path, return_exit_code=False):
+ self._subclass_must_implement()
+
+ def delete(self, path):
+ self._subclass_must_implement()
+
+ def changed_files(self, git_commit=None):
+ self._subclass_must_implement()
+
+ def changed_files_for_revision(self, revision):
+ self._subclass_must_implement()
+
+ def revisions_changing_file(self, path, limit=5):
+ self._subclass_must_implement()
+
+ def added_files(self):
+ self._subclass_must_implement()
+
+ def conflicted_files(self):
+ self._subclass_must_implement()
+
+ def display_name(self):
+ self._subclass_must_implement()
+
+ def create_patch(self, git_commit=None, changed_files=[]):
+ self._subclass_must_implement()
+
+ def committer_email_for_revision(self, revision):
+ self._subclass_must_implement()
+
+ def contents_at_revision(self, path, revision):
+ self._subclass_must_implement()
+
+ def diff_for_revision(self, revision):
+ self._subclass_must_implement()
+
+ def diff_for_file(self, path, log=None):
+ self._subclass_must_implement()
+
+ def show_head(self, path):
+ self._subclass_must_implement()
+
+ def apply_reverse_diff(self, revision):
+ self._subclass_must_implement()
+
+ def revert_files(self, file_paths):
+ self._subclass_must_implement()
+
+ def commit_with_message(self, message, username=None, git_commit=None, force_squash=False):
+ self._subclass_must_implement()
+
+ def svn_commit_log(self, svn_revision):
+ self._subclass_must_implement()
+
+ def last_svn_commit_log(self):
+ self._subclass_must_implement()
+
+ # Subclasses must indicate if they support local commits,
+ # but the SCM baseclass will only call local_commits methods when this is true.
+ @staticmethod
+ def supports_local_commits():
+ SCM._subclass_must_implement()
+
+ def remote_merge_base():
+ SCM._subclass_must_implement()
+
+ def commit_locally_with_message(self, message):
+ error("Your source control manager does not support local commits.")
+
+ def discard_local_commits(self):
+ pass
+
+ def local_commits(self):
+ return []
+
+
+class SVN(SCM):
+ # FIXME: We should move these values to a WebKit-specific config. file.
+ svn_server_host = "svn.webkit.org"
+ svn_server_realm = "<http://svn.webkit.org:80> Mac OS Forge"
+
+ def __init__(self, cwd):
+ SCM.__init__(self, cwd)
+ self._bogus_dir = None
+
+ @staticmethod
+ def in_working_directory(path):
+ return os.path.isdir(os.path.join(path, '.svn'))
+
+ @classmethod
+ def find_uuid(cls, path):
+ if not cls.in_working_directory(path):
+ return None
+ return cls.value_from_svn_info(path, 'Repository UUID')
+
+ @classmethod
+ def value_from_svn_info(cls, path, field_name):
+ svn_info_args = ['svn', 'info', path]
+ info_output = run_command(svn_info_args).rstrip()
+ match = re.search("^%s: (?P<value>.+)$" % field_name, info_output, re.MULTILINE)
+ if not match:
+ raise ScriptError(script_args=svn_info_args, message='svn info did not contain a %s.' % field_name)
+ return match.group('value')
+
+ @staticmethod
+ def find_checkout_root(path):
+ uuid = SVN.find_uuid(path)
+ # If |path| is not in a working directory, we're supposed to return |path|.
+ if not uuid:
+ return path
+ # Search up the directory hierarchy until we find a different UUID.
+ last_path = None
+ while True:
+ if uuid != SVN.find_uuid(path):
+ return last_path
+ last_path = path
+ (path, last_component) = os.path.split(path)
+ if last_path == path:
+ return None
+
+ @staticmethod
+ def commit_success_regexp():
+ return "^Committed revision (?P<svn_revision>\d+)\.$"
+
+ def has_authorization_for_realm(self, realm=svn_server_realm, home_directory=os.getenv("HOME")):
+ # Assumes find and grep are installed.
+ if not os.path.isdir(os.path.join(home_directory, ".subversion")):
+ return False
+ find_args = ["find", ".subversion", "-type", "f", "-exec", "grep", "-q", realm, "{}", ";", "-print"];
+ find_output = self.run(find_args, cwd=home_directory, error_handler=Executive.ignore_error).rstrip()
+ return find_output and os.path.isfile(os.path.join(home_directory, find_output))
+
+ @memoized
+ def svn_version(self):
+ return self.run(['svn', '--version', '--quiet'])
+
+ def working_directory_is_clean(self):
+ return self.run(["svn", "diff"], cwd=self.checkout_root, decode_output=False) == ""
+
+ def clean_working_directory(self):
+ # Make sure there are no locks lying around from a previously aborted svn invocation.
+ # This is slightly dangerous, as it's possible the user is running another svn process
+ # on this checkout at the same time. However, it's much more likely that we're running
+ # under windows and svn just sucks (or the user interrupted svn and it failed to clean up).
+ self.run(["svn", "cleanup"], cwd=self.checkout_root)
+
+ # svn revert -R is not as awesome as git reset --hard.
+ # It will leave added files around, causing later svn update
+ # calls to fail on the bots. We make this mirror git reset --hard
+ # by deleting any added files as well.
+ added_files = reversed(sorted(self.added_files()))
+ # added_files() returns directories for SVN, we walk the files in reverse path
+ # length order so that we remove files before we try to remove the directories.
+ self.run(["svn", "revert", "-R", "."], cwd=self.checkout_root)
+ for path in added_files:
+ # This is robust against cwd != self.checkout_root
+ absolute_path = self.absolute_path(path)
+ # Completely lame that there is no easy way to remove both types with one call.
+ if os.path.isdir(path):
+ os.rmdir(absolute_path)
+ else:
+ os.remove(absolute_path)
+
+ def status_command(self):
+ return ['svn', 'status']
+
+ def _status_regexp(self, expected_types):
+ field_count = 6 if self.svn_version() > "1.6" else 5
+ return "^(?P<status>[%s]).{%s} (?P<filename>.+)$" % (expected_types, field_count)
+
+ def _add_parent_directories(self, path):
+ """Does 'svn add' to the path and its parents."""
+ if self.in_working_directory(path):
+ return
+ dirname = os.path.dirname(path)
+ # We have dirname directry - ensure it added.
+ if dirname != path:
+ self._add_parent_directories(dirname)
+ self.add(path)
+
+ def add(self, path, return_exit_code=False):
+ self._add_parent_directories(os.path.dirname(os.path.abspath(path)))
+ return self.run(["svn", "add", path], return_exit_code=return_exit_code)
+
+ def delete(self, path):
+ parent, base = os.path.split(os.path.abspath(path))
+ return self.run(["svn", "delete", "--force", base], cwd=parent)
+
+ def changed_files(self, git_commit=None):
+ return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("ACDMR"))
+
+ def changed_files_for_revision(self, revision):
+ # As far as I can tell svn diff --summarize output looks just like svn status output.
+ # No file contents printed, thus utf-8 auto-decoding in self.run is fine.
+ status_command = ["svn", "diff", "--summarize", "-c", revision]
+ return self.run_status_and_extract_filenames(status_command, self._status_regexp("ACDMR"))
+
+ def revisions_changing_file(self, path, limit=5):
+ revisions = []
+ # svn log will exit(1) (and thus self.run will raise) if the path does not exist.
+ log_command = ['svn', 'log', '--quiet', '--limit=%s' % limit, path]
+ for line in self.run(log_command, cwd=self.checkout_root).splitlines():
+ match = re.search('^r(?P<revision>\d+) ', line)
+ if not match:
+ continue
+ revisions.append(int(match.group('revision')))
+ return revisions
+
+ def conflicted_files(self):
+ return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("C"))
+
+ def added_files(self):
+ return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("A"))
+
+ def deleted_files(self):
+ return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("D"))
+
+ @staticmethod
+ def supports_local_commits():
+ return False
+
+ def display_name(self):
+ return "svn"
+
+ # FIXME: This method should be on Checkout.
+ def create_patch(self, git_commit=None, changed_files=[]):
+ """Returns a byte array (str()) representing the patch file.
+ Patch files are effectively binary since they may contain
+ files of multiple different encodings."""
+ return self.run([self.script_path("svn-create-patch")] + changed_files,
+ cwd=self.checkout_root, return_stderr=False,
+ decode_output=False)
+
+ def committer_email_for_revision(self, revision):
+ return self.run(["svn", "propget", "svn:author", "--revprop", "-r", revision]).rstrip()
+
+ def contents_at_revision(self, path, revision):
+ """Returns a byte array (str()) containing the contents
+ of path @ revision in the repository."""
+ remote_path = "%s/%s" % (self._repository_url(), path)
+ return self.run(["svn", "cat", "-r", revision, remote_path], decode_output=False)
+
+ def diff_for_revision(self, revision):
+ # FIXME: This should probably use cwd=self.checkout_root
+ return self.run(['svn', 'diff', '-c', revision])
+
+ def _bogus_dir_name(self):
+ if sys.platform.startswith("win"):
+ parent_dir = tempfile.gettempdir()
+ else:
+ parent_dir = sys.path[0] # tempdir is not secure.
+ return os.path.join(parent_dir, "temp_svn_config")
+
+ def _setup_bogus_dir(self, log):
+ self._bogus_dir = self._bogus_dir_name()
+ if not os.path.exists(self._bogus_dir):
+ os.mkdir(self._bogus_dir)
+ self._delete_bogus_dir = True
+ else:
+ self._delete_bogus_dir = False
+ if log:
+ log.debug(' Html: temp config dir: "%s".', self._bogus_dir)
+
+ def _teardown_bogus_dir(self, log):
+ if self._delete_bogus_dir:
+ shutil.rmtree(self._bogus_dir, True)
+ if log:
+ log.debug(' Html: removed temp config dir: "%s".', self._bogus_dir)
+ self._bogus_dir = None
+
+ def diff_for_file(self, path, log=None):
+ self._setup_bogus_dir(log)
+ try:
+ args = ['svn', 'diff']
+ if self._bogus_dir:
+ args += ['--config-dir', self._bogus_dir]
+ args.append(path)
+ return self.run(args)
+ finally:
+ self._teardown_bogus_dir(log)
+
+ def show_head(self, path):
+ return self.run(['svn', 'cat', '-r', 'BASE', path], decode_output=False)
+
+ def _repository_url(self):
+ return self.value_from_svn_info(self.checkout_root, 'URL')
+
+ def apply_reverse_diff(self, revision):
+ # '-c -revision' applies the inverse diff of 'revision'
+ svn_merge_args = ['svn', 'merge', '--non-interactive', '-c', '-%s' % revision, self._repository_url()]
+ log("WARNING: svn merge has been known to take more than 10 minutes to complete. It is recommended you use git for rollouts.")
+ log("Running '%s'" % " ".join(svn_merge_args))
+ # FIXME: Should this use cwd=self.checkout_root?
+ self.run(svn_merge_args)
+
+ def revert_files(self, file_paths):
+ # FIXME: This should probably use cwd=self.checkout_root.
+ self.run(['svn', 'revert'] + file_paths)
+
+ def commit_with_message(self, message, username=None, git_commit=None, force_squash=False):
+ # git-commit and force are not used by SVN.
+ if self.dryrun:
+ # Return a string which looks like a commit so that things which parse this output will succeed.
+ return "Dry run, no commit.\nCommitted revision 0."
+
+ svn_commit_args = ["svn", "commit"]
+
+ if not username and not self.has_authorization_for_realm():
+ raise AuthenticationError(self.svn_server_host)
+ if username:
+ svn_commit_args.extend(["--username", username])
+
+ svn_commit_args.extend(["-m", message])
+ # FIXME: Should this use cwd=self.checkout_root?
+ return self.run(svn_commit_args, error_handler=commit_error_handler)
+
+ def svn_commit_log(self, svn_revision):
+ svn_revision = self.strip_r_from_svn_revision(svn_revision)
+ return self.run(['svn', 'log', '--non-interactive', '--revision', svn_revision])
+
+ def last_svn_commit_log(self):
+ # BASE is the checkout revision, HEAD is the remote repository revision
+ # http://svnbook.red-bean.com/en/1.0/ch03s03.html
+ return self.svn_commit_log('BASE')
+
+ def propset(self, pname, pvalue, path):
+ dir, base = os.path.split(path)
+ return self.run(['svn', 'pset', pname, pvalue, base], cwd=dir)
+
+ def propget(self, pname, path):
+ dir, base = os.path.split(path)
+ return self.run(['svn', 'pget', pname, base], cwd=dir).encode('utf-8').rstrip("\n")
+
+
+# All git-specific logic should go here.
+class Git(SCM):
+ def __init__(self, cwd):
+ SCM.__init__(self, cwd)
+
+ @classmethod
+ def in_working_directory(cls, path):
+ return run_command(['git', 'rev-parse', '--is-inside-work-tree'], cwd=path, error_handler=Executive.ignore_error).rstrip() == "true"
+
+ @classmethod
+ def find_checkout_root(cls, path):
+ # "git rev-parse --show-cdup" would be another way to get to the root
+ (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=(path or "./")))
+ # If we were using 2.6 # checkout_root = os.path.relpath(checkout_root, path)
+ if not os.path.isabs(checkout_root): # Sometimes git returns relative paths
+ checkout_root = os.path.join(path, checkout_root)
+ return checkout_root
+
+ @classmethod
+ def to_object_name(cls, filepath):
+ root_end_with_slash = os.path.join(cls.find_checkout_root(os.path.dirname(filepath)), '')
+ return filepath.replace(root_end_with_slash, '')
+
+ @classmethod
+ def read_git_config(cls, key):
+ # FIXME: This should probably use cwd=self.checkout_root.
+ return run_command(["git", "config", key],
+ error_handler=Executive.ignore_error).rstrip('\n')
+
+ @staticmethod
+ def commit_success_regexp():
+ return "^Committed r(?P<svn_revision>\d+)$"
+
+ def discard_local_commits(self):
+ # FIXME: This should probably use cwd=self.checkout_root
+ self.run(['git', 'reset', '--hard', self.remote_branch_ref()])
+
+ def local_commits(self):
+ # FIXME: This should probably use cwd=self.checkout_root
+ return self.run(['git', 'log', '--pretty=oneline', 'HEAD...' + self.remote_branch_ref()]).splitlines()
+
+ def rebase_in_progress(self):
+ return os.path.exists(os.path.join(self.checkout_root, '.git/rebase-apply'))
+
+ def working_directory_is_clean(self):
+ # FIXME: This should probably use cwd=self.checkout_root
+ return self.run(['git', 'diff', 'HEAD', '--name-only']) == ""
+
+ def clean_working_directory(self):
+ # FIXME: These should probably use cwd=self.checkout_root.
+ # Could run git clean here too, but that wouldn't match working_directory_is_clean
+ self.run(['git', 'reset', '--hard', 'HEAD'])
+ # Aborting rebase even though this does not match working_directory_is_clean
+ if self.rebase_in_progress():
+ self.run(['git', 'rebase', '--abort'])
+
+ def status_command(self):
+ # git status returns non-zero when there are changes, so we use git diff name --name-status HEAD instead.
+ # No file contents printed, thus utf-8 autodecoding in self.run is fine.
+ return ["git", "diff", "--name-status", "HEAD"]
+
+ def _status_regexp(self, expected_types):
+ return '^(?P<status>[%s])\t(?P<filename>.+)$' % expected_types
+
+ def add(self, path, return_exit_code=False):
+ return self.run(["git", "add", path], return_exit_code=return_exit_code)
+
+ def delete(self, path):
+ return self.run(["git", "rm", "-f", path])
+
+ def _assert_synced(self):
+ if len(run_command(['git', 'rev-list', '--max-count=1', self.remote_branch_ref(), '^HEAD'])):
+ raise ScriptError(message="Not fully merged/rebased to %s. This branch needs to be synced first." % self.remote_branch_ref())
+
+ def merge_base(self, git_commit):
+ if git_commit:
+ # Special-case HEAD.. to mean working-copy changes only.
+ if git_commit.upper() == 'HEAD..':
+ return 'HEAD'
+
+ if '..' not in git_commit:
+ git_commit = git_commit + "^.." + git_commit
+ return git_commit
+
+ self._assert_synced()
+ return self.remote_merge_base()
+
+ def changed_files(self, git_commit=None):
+ status_command = ['git', 'diff', '-r', '--name-status', '-C', '-M', "--no-ext-diff", "--full-index", self.merge_base(git_commit)]
+ return self.run_status_and_extract_filenames(status_command, self._status_regexp("ADM"))
+
+ def _changes_files_for_commit(self, git_commit):
+ # --pretty="format:" makes git show not print the commit log header,
+ changed_files = self.run(["git", "show", "--pretty=format:", "--name-only", git_commit]).splitlines()
+ # instead it just prints a blank line at the top, so we skip the blank line:
+ return changed_files[1:]
+
+ def changed_files_for_revision(self, revision):
+ commit_id = self.git_commit_from_svn_revision(revision)
+ return self._changes_files_for_commit(commit_id)
+
+ def revisions_changing_file(self, path, limit=5):
+ # git rev-list head --remove-empty --limit=5 -- path would be equivalent.
+ commit_ids = self.run(["git", "log", "--remove-empty", "--pretty=format:%H", "-%s" % limit, "--", path]).splitlines()
+ return filter(lambda revision: revision, map(self.svn_revision_from_git_commit, commit_ids))
+
+ def conflicted_files(self):
+ # We do not need to pass decode_output for this diff command
+ # as we're passing --name-status which does not output any data.
+ status_command = ['git', 'diff', '--name-status', '-C', '-M', '--diff-filter=U']
+ return self.run_status_and_extract_filenames(status_command, self._status_regexp("U"))
+
+ def added_files(self):
+ return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("A"))
+
+ def deleted_files(self):
+ return self.run_status_and_extract_filenames(self.status_command(), self._status_regexp("D"))
+
+ @staticmethod
+ def supports_local_commits():
+ return True
+
+ def display_name(self):
+ return "git"
+
+ def create_patch(self, git_commit=None, changed_files=[]):
+ """Returns a byte array (str()) representing the patch file.
+ Patch files are effectively binary since they may contain
+ files of multiple different encodings."""
+ return self.run(['git', 'diff', '--binary', "--no-ext-diff", "--full-index", "-M", self.merge_base(git_commit), "--"] + changed_files, decode_output=False, cwd=self.checkout_root)
+
+ def _run_git_svn_find_rev(self, arg):
+ # git svn find-rev always exits 0, even when the revision or commit is not found.
+ return self.run(['git', 'svn', 'find-rev', arg], cwd=self.checkout_root).rstrip()
+
+ def _string_to_int_or_none(self, string):
+ try:
+ return int(string)
+ except ValueError, e:
+ return None
+
+ @memoized
+ def git_commit_from_svn_revision(self, svn_revision):
+ git_commit = self._run_git_svn_find_rev('r%s' % svn_revision)
+ if not git_commit:
+ # FIXME: Alternatively we could offer to update the checkout? Or return None?
+ raise ScriptError(message='Failed to find git commit for revision %s, your checkout likely needs an update.' % svn_revision)
+ return git_commit
+
+ @memoized
+ def svn_revision_from_git_commit(self, git_commit):
+ svn_revision = self._run_git_svn_find_rev(git_commit)
+ return self._string_to_int_or_none(svn_revision)
+
+ def contents_at_revision(self, path, revision):
+ """Returns a byte array (str()) containing the contents
+ of path @ revision in the repository."""
+ return self.run(["git", "show", "%s:%s" % (self.git_commit_from_svn_revision(revision), path)], decode_output=False)
+
+ def diff_for_revision(self, revision):
+ git_commit = self.git_commit_from_svn_revision(revision)
+ return self.create_patch(git_commit)
+
+ def diff_for_file(self, path, log=None):
+ return self.run(['git', 'diff', 'HEAD', '--', path])
+
+ def show_head(self, path):
+ return self.run(['git', 'show', 'HEAD:' + self.to_object_name(path)], decode_output=False)
+
+ def committer_email_for_revision(self, revision):
+ git_commit = self.git_commit_from_svn_revision(revision)
+ committer_email = self.run(["git", "log", "-1", "--pretty=format:%ce", git_commit])
+ # Git adds an extra @repository_hash to the end of every committer email, remove it:
+ return committer_email.rsplit("@", 1)[0]
+
+ def apply_reverse_diff(self, revision):
+ # Assume the revision is an svn revision.
+ git_commit = self.git_commit_from_svn_revision(revision)
+ # I think this will always fail due to ChangeLogs.
+ self.run(['git', 'revert', '--no-commit', git_commit], error_handler=Executive.ignore_error)
+
+ def revert_files(self, file_paths):
+ self.run(['git', 'checkout', 'HEAD'] + file_paths)
+
+ def _assert_can_squash(self, working_directory_is_clean):
+ squash = Git.read_git_config('webkit-patch.commit-should-always-squash')
+ should_squash = squash and squash.lower() == "true"
+
+ if not should_squash:
+ # Only warn if there are actually multiple commits to squash.
+ num_local_commits = len(self.local_commits())
+ if num_local_commits > 1 or (num_local_commits > 0 and not working_directory_is_clean):
+ raise AmbiguousCommitError(num_local_commits, working_directory_is_clean)
+
+ def commit_with_message(self, message, username=None, git_commit=None, force_squash=False):
+ # Username is ignored during Git commits.
+ working_directory_is_clean = self.working_directory_is_clean()
+
+ if git_commit:
+ # Special-case HEAD.. to mean working-copy changes only.
+ if git_commit.upper() == 'HEAD..':
+ if working_directory_is_clean:
+ raise ScriptError(message="The working copy is not modified. --git-commit=HEAD.. only commits working copy changes.")
+ self.commit_locally_with_message(message)
+ return self._commit_on_branch(message, 'HEAD')
+
+ # Need working directory changes to be committed so we can checkout the merge branch.
+ if not working_directory_is_clean:
+ # FIXME: webkit-patch land will modify the ChangeLogs to correct the reviewer.
+ # That will modify the working-copy and cause us to hit this error.
+ # The ChangeLog modification could be made to modify the existing local commit.
+ raise ScriptError(message="Working copy is modified. Cannot commit individual git_commits.")
+ return self._commit_on_branch(message, git_commit)
+
+ if not force_squash:
+ self._assert_can_squash(working_directory_is_clean)
+ self._assert_synced()
+ self.run(['git', 'reset', '--soft', self.remote_branch_ref()])
+ self.commit_locally_with_message(message)
+ return self.push_local_commits_to_server()
+
+ def _commit_on_branch(self, message, git_commit):
+ branch_ref = self.run(['git', 'symbolic-ref', 'HEAD']).strip()
+ branch_name = branch_ref.replace('refs/heads/', '')
+ commit_ids = self.commit_ids_from_commitish_arguments([git_commit])
+
+ # We want to squash all this branch's commits into one commit with the proper description.
+ # We do this by doing a "merge --squash" into a new commit branch, then dcommitting that.
+ MERGE_BRANCH_NAME = 'webkit-patch-land'
+ self.delete_branch(MERGE_BRANCH_NAME)
+
+ # We might be in a directory that's present in this branch but not in the
+ # trunk. Move up to the top of the tree so that git commands that expect a
+ # valid CWD won't fail after we check out the merge branch.
+ os.chdir(self.checkout_root)
+
+ # Stuff our change into the merge branch.
+ # We wrap in a try...finally block so if anything goes wrong, we clean up the branches.
+ commit_succeeded = True
+ try:
+ self.run(['git', 'checkout', '-q', '-b', MERGE_BRANCH_NAME, self.remote_branch_ref()])
+
+ for commit in commit_ids:
+ # We're on a different branch now, so convert "head" to the branch name.
+ commit = re.sub(r'(?i)head', branch_name, commit)
+ # FIXME: Once changed_files and create_patch are modified to separately handle each
+ # commit in a commit range, commit each cherry pick so they'll get dcommitted separately.
+ self.run(['git', 'cherry-pick', '--no-commit', commit])
+
+ self.run(['git', 'commit', '-m', message])
+ output = self.push_local_commits_to_server()
+ except Exception, e:
+ log("COMMIT FAILED: " + str(e))
+ output = "Commit failed."
+ commit_succeeded = False
+ finally:
+ # And then swap back to the original branch and clean up.
+ self.clean_working_directory()
+ self.run(['git', 'checkout', '-q', branch_name])
+ self.delete_branch(MERGE_BRANCH_NAME)
+
+ return output
+
+ def svn_commit_log(self, svn_revision):
+ svn_revision = self.strip_r_from_svn_revision(svn_revision)
+ return self.run(['git', 'svn', 'log', '-r', svn_revision])
+
+ def last_svn_commit_log(self):
+ return self.run(['git', 'svn', 'log', '--limit=1'])
+
+ # Git-specific methods:
+ def _branch_ref_exists(self, branch_ref):
+ return self.run(['git', 'show-ref', '--quiet', '--verify', branch_ref], return_exit_code=True) == 0
+
+ def delete_branch(self, branch_name):
+ if self._branch_ref_exists('refs/heads/' + branch_name):
+ self.run(['git', 'branch', '-D', branch_name])
+
+ def remote_merge_base(self):
+ return self.run(['git', 'merge-base', self.remote_branch_ref(), 'HEAD']).strip()
+
+ def remote_branch_ref(self):
+ # Use references so that we can avoid collisions, e.g. we don't want to operate on refs/heads/trunk if it exists.
+
+ # FIXME: This should so something like: Git.read_git_config('svn-remote.svn.fetch').split(':')[1]
+ # but that doesn't work if the git repo is tracking multiple svn branches.
+ remote_branch_refs = [
+ 'refs/remotes/trunk', # A git-svn checkout as per http://trac.webkit.org/wiki/UsingGitWithWebKit.
+ 'refs/remotes/origin/master', # A git clone of git://git.webkit.org/WebKit.git that is not tracking svn.
+ ]
+
+ for ref in remote_branch_refs:
+ if self._branch_ref_exists(ref):
+ return ref
+
+ raise ScriptError(message="Can't find a branch to diff against. %s branches do not exist." % " and ".join(remote_branch_refs))
+
+ def commit_locally_with_message(self, message):
+ self.run(['git', 'commit', '--all', '-F', '-'], input=message)
+
+ def push_local_commits_to_server(self):
+ dcommit_command = ['git', 'svn', 'dcommit']
+ if self.dryrun:
+ dcommit_command.append('--dry-run')
+ output = self.run(dcommit_command, error_handler=commit_error_handler)
+ # Return a string which looks like a commit so that things which parse this output will succeed.
+ if self.dryrun:
+ output += "\nCommitted r0"
+ return output
+
+ # This function supports the following argument formats:
+ # no args : rev-list trunk..HEAD
+ # A..B : rev-list A..B
+ # A...B : error!
+ # A B : [A, B] (different from git diff, which would use "rev-list A..B")
+ def commit_ids_from_commitish_arguments(self, args):
+ if not len(args):
+ args.append('%s..HEAD' % self.remote_branch_ref())
+
+ commit_ids = []
+ for commitish in args:
+ if '...' in commitish:
+ raise ScriptError(message="'...' is not supported (found in '%s'). Did you mean '..'?" % commitish)
+ elif '..' in commitish:
+ commit_ids += reversed(self.run(['git', 'rev-list', commitish]).splitlines())
+ else:
+ # Turn single commits or branch or tag names into commit ids.
+ commit_ids += self.run(['git', 'rev-parse', '--revs-only', commitish]).splitlines()
+ return commit_ids
+
+ def commit_message_for_local_commit(self, commit_id):
+ commit_lines = self.run(['git', 'cat-file', 'commit', commit_id]).splitlines()
+
+ # Skip the git headers.
+ first_line_after_headers = 0
+ for line in commit_lines:
+ first_line_after_headers += 1
+ if line == "":
+ break
+ return CommitMessage(commit_lines[first_line_after_headers:])
+
+ def files_changed_summary_for_commit(self, commit_id):
+ return self.run(['git', 'diff-tree', '--shortstat', '--no-commit-id', commit_id])
diff --git a/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
new file mode 100644
index 0000000..8af9ad5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
@@ -0,0 +1,1287 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2009 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from __future__ import with_statement
+
+import base64
+import codecs
+import getpass
+import os
+import os.path
+import re
+import stat
+import sys
+import subprocess
+import tempfile
+import unittest
+import urllib
+import shutil
+
+from datetime import date
+from webkitpy.common.checkout.api import Checkout
+from webkitpy.common.checkout.scm import detect_scm_system, SCM, SVN, CheckoutNeedsUpdate, commit_error_handler, AuthenticationError, AmbiguousCommitError, find_checkout_root, default_scm
+from webkitpy.common.config.committers import Committer # FIXME: This should not be needed
+from webkitpy.common.net.bugzilla import Attachment # FIXME: This should not be needed
+from webkitpy.common.system.executive import Executive, run_command, ScriptError
+from webkitpy.common.system.outputcapture import OutputCapture
+
+# Eventually we will want to write tests which work for both scms. (like update_webkit, changed_files, etc.)
+# Perhaps through some SCMTest base-class which both SVNTest and GitTest inherit from.
+
+# FIXME: This should be unified into one of the executive.py commands!
+# Callers could use run_and_throw_if_fail(args, cwd=cwd, quiet=True)
+def run_silent(args, cwd=None):
+ # Note: Not thread safe: http://bugs.python.org/issue2320
+ process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
+ process.communicate() # ignore output
+ exit_code = process.wait()
+ if exit_code:
+ raise ScriptError('Failed to run "%s" exit_code: %d cwd: %s' % (args, exit_code, cwd))
+
+
+def write_into_file_at_path(file_path, contents, encoding="utf-8"):
+ if encoding:
+ with codecs.open(file_path, "w", encoding) as file:
+ file.write(contents)
+ else:
+ with open(file_path, "w") as file:
+ file.write(contents)
+
+
+def read_from_path(file_path, encoding="utf-8"):
+ with codecs.open(file_path, "r", encoding) as file:
+ return file.read()
+
+
+def _make_diff(command, *args):
+ # We use this wrapper to disable output decoding. diffs should be treated as
+ # binary files since they may include text files of multiple differnet encodings.
+ return run_command([command, "diff"] + list(args), decode_output=False)
+
+
+def _svn_diff(*args):
+ return _make_diff("svn", *args)
+
+
+def _git_diff(*args):
+ return _make_diff("git", *args)
+
+
+# Exists to share svn repository creation code between the git and svn tests
+class SVNTestRepository:
+ @classmethod
+ def _svn_add(cls, path):
+ run_command(["svn", "add", path])
+
+ @classmethod
+ def _svn_commit(cls, message):
+ run_command(["svn", "commit", "--quiet", "--message", message])
+
+ @classmethod
+ def _setup_test_commits(cls, test_object):
+ # Add some test commits
+ os.chdir(test_object.svn_checkout_path)
+
+ write_into_file_at_path("test_file", "test1")
+ cls._svn_add("test_file")
+ cls._svn_commit("initial commit")
+
+ write_into_file_at_path("test_file", "test1test2")
+ # This used to be the last commit, but doing so broke
+ # GitTest.test_apply_git_patch which use the inverse diff of the last commit.
+ # svn-apply fails to remove directories in Git, see:
+ # https://bugs.webkit.org/show_bug.cgi?id=34871
+ os.mkdir("test_dir")
+ # Slash should always be the right path separator since we use cygwin on Windows.
+ test_file3_path = "test_dir/test_file3"
+ write_into_file_at_path(test_file3_path, "third file")
+ cls._svn_add("test_dir")
+ cls._svn_commit("second commit")
+
+ write_into_file_at_path("test_file", "test1test2test3\n")
+ write_into_file_at_path("test_file2", "second file")
+ cls._svn_add("test_file2")
+ cls._svn_commit("third commit")
+
+ # This 4th commit is used to make sure that our patch file handling
+ # code correctly treats patches as binary and does not attempt to
+ # decode them assuming they're utf-8.
+ write_into_file_at_path("test_file", u"latin1 test: \u00A0\n", "latin1")
+ write_into_file_at_path("test_file2", u"utf-8 test: \u00A0\n", "utf-8")
+ cls._svn_commit("fourth commit")
+
+ # svn does not seem to update after commit as I would expect.
+ run_command(['svn', 'update'])
+
+ @classmethod
+ def setup(cls, test_object):
+ # Create an test SVN repository
+ test_object.svn_repo_path = tempfile.mkdtemp(suffix="svn_test_repo")
+ test_object.svn_repo_url = "file://%s" % test_object.svn_repo_path # Not sure this will work on windows
+ # git svn complains if we don't pass --pre-1.5-compatible, not sure why:
+ # Expected FS format '2'; found format '3' at /usr/local/libexec/git-core//git-svn line 1477
+ run_command(['svnadmin', 'create', '--pre-1.5-compatible', test_object.svn_repo_path])
+
+ # Create a test svn checkout
+ test_object.svn_checkout_path = tempfile.mkdtemp(suffix="svn_test_checkout")
+ run_command(['svn', 'checkout', '--quiet', test_object.svn_repo_url, test_object.svn_checkout_path])
+
+ # Create and checkout a trunk dir to match the standard svn configuration to match git-svn's expectations
+ os.chdir(test_object.svn_checkout_path)
+ os.mkdir('trunk')
+ cls._svn_add('trunk')
+ # We can add tags and branches as well if we ever need to test those.
+ cls._svn_commit('add trunk')
+
+ # Change directory out of the svn checkout so we can delete the checkout directory.
+ # _setup_test_commits will CD back to the svn checkout directory.
+ os.chdir('/')
+ run_command(['rm', '-rf', test_object.svn_checkout_path])
+ run_command(['svn', 'checkout', '--quiet', test_object.svn_repo_url + '/trunk', test_object.svn_checkout_path])
+
+ cls._setup_test_commits(test_object)
+
+ @classmethod
+ def tear_down(cls, test_object):
+ run_command(['rm', '-rf', test_object.svn_repo_path])
+ run_command(['rm', '-rf', test_object.svn_checkout_path])
+
+ # Now that we've deleted the checkout paths, cwddir may be invalid
+ # Change back to a valid directory so that later calls to os.getcwd() do not fail.
+ os.chdir(detect_scm_system(os.path.dirname(__file__)).checkout_root)
+
+
+class StandaloneFunctionsTest(unittest.TestCase):
+ """This class tests any standalone/top-level functions in the package."""
+ def setUp(self):
+ self.orig_cwd = os.path.abspath(os.getcwd())
+ self.orig_abspath = os.path.abspath
+
+ # We capture but ignore the output from stderr to reduce unwanted
+ # logging.
+ self.output = OutputCapture()
+ self.output.capture_output()
+
+ def tearDown(self):
+ os.chdir(self.orig_cwd)
+ os.path.abspath = self.orig_abspath
+ self.output.restore_output()
+
+ def test_find_checkout_root(self):
+ # Test from inside the tree.
+ os.chdir(sys.path[0])
+ dir = find_checkout_root()
+ self.assertNotEqual(dir, None)
+ self.assertTrue(os.path.exists(dir))
+
+ # Test from outside the tree.
+ os.chdir(os.path.expanduser("~"))
+ dir = find_checkout_root()
+ self.assertNotEqual(dir, None)
+ self.assertTrue(os.path.exists(dir))
+
+ # Mock out abspath() to test being not in a checkout at all.
+ os.path.abspath = lambda x: "/"
+ self.assertRaises(SystemExit, find_checkout_root)
+ os.path.abspath = self.orig_abspath
+
+ def test_default_scm(self):
+ # Test from inside the tree.
+ os.chdir(sys.path[0])
+ scm = default_scm()
+ self.assertNotEqual(scm, None)
+
+ # Test from outside the tree.
+ os.chdir(os.path.expanduser("~"))
+ dir = find_checkout_root()
+ self.assertNotEqual(dir, None)
+
+ # Mock out abspath() to test being not in a checkout at all.
+ os.path.abspath = lambda x: "/"
+ self.assertRaises(SystemExit, default_scm)
+ os.path.abspath = self.orig_abspath
+
+# For testing the SCM baseclass directly.
+class SCMClassTests(unittest.TestCase):
+ def setUp(self):
+ self.dev_null = open(os.devnull, "w") # Used to make our Popen calls quiet.
+
+ def tearDown(self):
+ self.dev_null.close()
+
+ def test_run_command_with_pipe(self):
+ input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null)
+ self.assertEqual(run_command(['grep', 'bar'], input=input_process.stdout), "bar\n")
+
+ # Test the non-pipe case too:
+ self.assertEqual(run_command(['grep', 'bar'], input="foo\nbar"), "bar\n")
+
+ command_returns_non_zero = ['/bin/sh', '--invalid-option']
+ # Test when the input pipe process fails.
+ input_process = subprocess.Popen(command_returns_non_zero, stdout=subprocess.PIPE, stderr=self.dev_null)
+ self.assertTrue(input_process.poll() != 0)
+ self.assertRaises(ScriptError, run_command, ['grep', 'bar'], input=input_process.stdout)
+
+ # Test when the run_command process fails.
+ input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null) # grep shows usage and calls exit(2) when called w/o arguments.
+ self.assertRaises(ScriptError, run_command, command_returns_non_zero, input=input_process.stdout)
+
+ def test_error_handlers(self):
+ git_failure_message="Merge conflict during commit: Your file or directory 'WebCore/ChangeLog' is probably out-of-date: resource out of date; try updating at /usr/local/libexec/git-core//git-svn line 469"
+ svn_failure_message="""svn: Commit failed (details follow):
+svn: File or directory 'ChangeLog' is out of date; try updating
+svn: resource out of date; try updating
+"""
+ command_does_not_exist = ['does_not_exist', 'invalid_option']
+ self.assertRaises(OSError, run_command, command_does_not_exist)
+ self.assertRaises(OSError, run_command, command_does_not_exist, error_handler=Executive.ignore_error)
+
+ command_returns_non_zero = ['/bin/sh', '--invalid-option']
+ self.assertRaises(ScriptError, run_command, command_returns_non_zero)
+ # Check if returns error text:
+ self.assertTrue(run_command(command_returns_non_zero, error_handler=Executive.ignore_error))
+
+ self.assertRaises(CheckoutNeedsUpdate, commit_error_handler, ScriptError(output=git_failure_message))
+ self.assertRaises(CheckoutNeedsUpdate, commit_error_handler, ScriptError(output=svn_failure_message))
+ self.assertRaises(ScriptError, commit_error_handler, ScriptError(output='blah blah blah'))
+
+
+# GitTest and SVNTest inherit from this so any test_ methods here will be run once for this class and then once for each subclass.
+class SCMTest(unittest.TestCase):
+ def _create_patch(self, patch_contents):
+ # FIXME: This code is brittle if the Attachment API changes.
+ attachment = Attachment({"bug_id": 12345}, None)
+ attachment.contents = lambda: patch_contents
+
+ joe_cool = Committer(name="Joe Cool", email_or_emails=None)
+ attachment.reviewer = lambda: joe_cool
+
+ return attachment
+
+ def _setup_webkittools_scripts_symlink(self, local_scm):
+ webkit_scm = detect_scm_system(os.path.dirname(os.path.abspath(__file__)))
+ webkit_scripts_directory = webkit_scm.scripts_directory()
+ local_scripts_directory = local_scm.scripts_directory()
+ os.mkdir(os.path.dirname(local_scripts_directory))
+ os.symlink(webkit_scripts_directory, local_scripts_directory)
+
+ # Tests which both GitTest and SVNTest should run.
+ # FIXME: There must be a simpler way to add these w/o adding a wrapper method to both subclasses
+
+ def _shared_test_changed_files(self):
+ write_into_file_at_path("test_file", "changed content")
+ self.assertEqual(self.scm.changed_files(), ["test_file"])
+ write_into_file_at_path("test_dir/test_file3", "new stuff")
+ self.assertEqual(self.scm.changed_files(), ["test_dir/test_file3", "test_file"])
+ old_cwd = os.getcwd()
+ os.chdir("test_dir")
+ # Validate that changed_files does not change with our cwd, see bug 37015.
+ self.assertEqual(self.scm.changed_files(), ["test_dir/test_file3", "test_file"])
+ os.chdir(old_cwd)
+
+ def _shared_test_added_files(self):
+ write_into_file_at_path("test_file", "changed content")
+ self.assertEqual(self.scm.added_files(), [])
+
+ write_into_file_at_path("added_file", "new stuff")
+ self.scm.add("added_file")
+
+ os.mkdir("added_dir")
+ write_into_file_at_path("added_dir/added_file2", "new stuff")
+ self.scm.add("added_dir")
+
+ # SVN reports directory changes, Git does not.
+ added_files = self.scm.added_files()
+ if "added_dir" in added_files:
+ added_files.remove("added_dir")
+ self.assertEqual(added_files, ["added_dir/added_file2", "added_file"])
+
+ # Test also to make sure clean_working_directory removes added files
+ self.scm.clean_working_directory()
+ self.assertEqual(self.scm.added_files(), [])
+ self.assertFalse(os.path.exists("added_file"))
+ self.assertFalse(os.path.exists("added_dir"))
+
+ def _shared_test_changed_files_for_revision(self):
+ # SVN reports directory changes, Git does not.
+ changed_files = self.scm.changed_files_for_revision(3)
+ if "test_dir" in changed_files:
+ changed_files.remove("test_dir")
+ self.assertEqual(changed_files, ["test_dir/test_file3", "test_file"])
+ self.assertEqual(sorted(self.scm.changed_files_for_revision(4)), sorted(["test_file", "test_file2"])) # Git and SVN return different orders.
+ self.assertEqual(self.scm.changed_files_for_revision(2), ["test_file"])
+
+ def _shared_test_contents_at_revision(self):
+ self.assertEqual(self.scm.contents_at_revision("test_file", 3), "test1test2")
+ self.assertEqual(self.scm.contents_at_revision("test_file", 4), "test1test2test3\n")
+
+ # Verify that contents_at_revision returns a byte array, aka str():
+ self.assertEqual(self.scm.contents_at_revision("test_file", 5), u"latin1 test: \u00A0\n".encode("latin1"))
+ self.assertEqual(self.scm.contents_at_revision("test_file2", 5), u"utf-8 test: \u00A0\n".encode("utf-8"))
+
+ self.assertEqual(self.scm.contents_at_revision("test_file2", 4), "second file")
+ # Files which don't exist:
+ # Currently we raise instead of returning None because detecting the difference between
+ # "file not found" and any other error seems impossible with svn (git seems to expose such through the return code).
+ self.assertRaises(ScriptError, self.scm.contents_at_revision, "test_file2", 2)
+ self.assertRaises(ScriptError, self.scm.contents_at_revision, "does_not_exist", 2)
+
+ def _shared_test_revisions_changing_file(self):
+ self.assertEqual(self.scm.revisions_changing_file("test_file"), [5, 4, 3, 2])
+ self.assertRaises(ScriptError, self.scm.revisions_changing_file, "non_existent_file")
+
+ def _shared_test_committer_email_for_revision(self):
+ self.assertEqual(self.scm.committer_email_for_revision(3), getpass.getuser()) # Committer "email" will be the current user
+
+ def _shared_test_reverse_diff(self):
+ self._setup_webkittools_scripts_symlink(self.scm) # Git's apply_reverse_diff uses resolve-ChangeLogs
+ # Only test the simple case, as any other will end up with conflict markers.
+ self.scm.apply_reverse_diff('5')
+ self.assertEqual(read_from_path('test_file'), "test1test2test3\n")
+
+ def _shared_test_diff_for_revision(self):
+ # Patch formats are slightly different between svn and git, so just regexp for things we know should be there.
+ r3_patch = self.scm.diff_for_revision(4)
+ self.assertTrue(re.search('test3', r3_patch))
+ self.assertFalse(re.search('test4', r3_patch))
+ self.assertTrue(re.search('test2', r3_patch))
+ self.assertTrue(re.search('test2', self.scm.diff_for_revision(3)))
+
+ def _shared_test_svn_apply_git_patch(self):
+ self._setup_webkittools_scripts_symlink(self.scm)
+ git_binary_addition = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
+new file mode 100644
+index 0000000000000000000000000000000000000000..64a9532e7794fcd791f6f12157406d90
+60151690
+GIT binary patch
+literal 512
+zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?
+zhJP##HdZC#4K}7F68@!1jfWQg2daCm-gs#3|JREDT>c+pG4L<_2;w##WMO#ysPPap
+zLqpAf1OE938xAsSp4!5f-o><?VKe(#0jEcwfHGF4%M1^kRs14oVBp2ZEL{E1N<-zJ
+zsfLmOtKta;2_;2c#^S1-8cf<nb!QnGl>c!Xe6RXvrEtAWBvSDTgTO1j3vA31Puw!A
+zs(87q)j_mVDTqBo-P+03-P5mHCEnJ+x}YdCuS7#bCCyePUe(ynK+|4b-3qK)T?Z&)
+zYG+`tl4h?GZv_$t82}X4*DTE|$;{DEiPyF@)U-1+FaX++T9H{&%cag`W1|zVP@`%b
+zqiSkp6{BTpWTkCr!=<C6Q=?#~R8^JfrliAF6Q^gV9Iup8RqCXqqhqC`qsyhk<-nlB
+z00f{QZvfK&|Nm#oZ0TQl`Yr$BIa6A@16O26ud7H<QM=xl`toLKnz-3h@9c9q&wm|X
+z{89I|WPyD!*M?gv?q`;L=2YFeXrJQNti4?}s!zFo=5CzeBxC69xA<zrjP<wUcCRh4
+ptUl-ZG<%a~#LwkIWv&q!KSCH7tQ8cJDiw+|GV?MN)RjY50RTb-xvT&H
+
+literal 0
+HcmV?d00001
+
+"""
+ self.checkout.apply_patch(self._create_patch(git_binary_addition))
+ added = read_from_path('fizzbuzz7.gif', encoding=None)
+ self.assertEqual(512, len(added))
+ self.assertTrue(added.startswith('GIF89a'))
+ self.assertTrue('fizzbuzz7.gif' in self.scm.changed_files())
+
+ # The file already exists.
+ self.assertRaises(ScriptError, self.checkout.apply_patch, self._create_patch(git_binary_addition))
+
+ git_binary_modification = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
+index 64a9532e7794fcd791f6f12157406d9060151690..323fae03f4606ea9991df8befbb2fca7
+GIT binary patch
+literal 7
+OcmYex&reD$;sO8*F9L)B
+
+literal 512
+zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?
+zhJP##HdZC#4K}7F68@!1jfWQg2daCm-gs#3|JREDT>c+pG4L<_2;w##WMO#ysPPap
+zLqpAf1OE938xAsSp4!5f-o><?VKe(#0jEcwfHGF4%M1^kRs14oVBp2ZEL{E1N<-zJ
+zsfLmOtKta;2_;2c#^S1-8cf<nb!QnGl>c!Xe6RXvrEtAWBvSDTgTO1j3vA31Puw!A
+zs(87q)j_mVDTqBo-P+03-P5mHCEnJ+x}YdCuS7#bCCyePUe(ynK+|4b-3qK)T?Z&)
+zYG+`tl4h?GZv_$t82}X4*DTE|$;{DEiPyF@)U-1+FaX++T9H{&%cag`W1|zVP@`%b
+zqiSkp6{BTpWTkCr!=<C6Q=?#~R8^JfrliAF6Q^gV9Iup8RqCXqqhqC`qsyhk<-nlB
+z00f{QZvfK&|Nm#oZ0TQl`Yr$BIa6A@16O26ud7H<QM=xl`toLKnz-3h@9c9q&wm|X
+z{89I|WPyD!*M?gv?q`;L=2YFeXrJQNti4?}s!zFo=5CzeBxC69xA<zrjP<wUcCRh4
+ptUl-ZG<%a~#LwkIWv&q!KSCH7tQ8cJDiw+|GV?MN)RjY50RTb-xvT&H
+
+"""
+ self.checkout.apply_patch(self._create_patch(git_binary_modification))
+ modified = read_from_path('fizzbuzz7.gif', encoding=None)
+ self.assertEqual('foobar\n', modified)
+ self.assertTrue('fizzbuzz7.gif' in self.scm.changed_files())
+
+ # Applying the same modification should fail.
+ self.assertRaises(ScriptError, self.checkout.apply_patch, self._create_patch(git_binary_modification))
+
+ git_binary_deletion = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
+deleted file mode 100644
+index 323fae0..0000000
+GIT binary patch
+literal 0
+HcmV?d00001
+
+literal 7
+OcmYex&reD$;sO8*F9L)B
+
+"""
+ self.checkout.apply_patch(self._create_patch(git_binary_deletion))
+ self.assertFalse(os.path.exists('fizzbuzz7.gif'))
+ self.assertFalse('fizzbuzz7.gif' in self.scm.changed_files())
+
+ # Cannot delete again.
+ self.assertRaises(ScriptError, self.checkout.apply_patch, self._create_patch(git_binary_deletion))
+
+ def _shared_test_add_recursively(self):
+ os.mkdir("added_dir")
+ write_into_file_at_path("added_dir/added_file", "new stuff")
+ self.scm.add("added_dir/added_file")
+ self.assertTrue("added_dir/added_file" in self.scm.added_files())
+
+class SVNTest(SCMTest):
+
+ @staticmethod
+ def _set_date_and_reviewer(changelog_entry):
+ # Joe Cool matches the reviewer set in SCMTest._create_patch
+ changelog_entry = changelog_entry.replace('REVIEWER_HERE', 'Joe Cool')
+ # svn-apply will update ChangeLog entries with today's date.
+ return changelog_entry.replace('DATE_HERE', date.today().isoformat())
+
+ def test_svn_apply(self):
+ first_entry = """2009-10-26 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Foo Bar.
+
+ Most awesome change ever.
+
+ * scm_unittest.py:
+"""
+ intermediate_entry = """2009-10-27 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Baz Bar.
+
+ A more awesomer change yet!
+
+ * scm_unittest.py:
+"""
+ one_line_overlap_patch = """Index: ChangeLog
+===================================================================
+--- ChangeLog (revision 5)
++++ ChangeLog (working copy)
+@@ -1,5 +1,13 @@
+ 2009-10-26 Eric Seidel <eric@webkit.org>
+
++ Reviewed by NOBODY (OOPS!).
++
++ Second most awesome change ever.
++
++ * scm_unittest.py:
++
++2009-10-26 Eric Seidel <eric@webkit.org>
++
+ Reviewed by Foo Bar.
+
+ Most awesome change ever.
+"""
+ one_line_overlap_entry = """DATE_HERE Eric Seidel <eric@webkit.org>
+
+ Reviewed by REVIEWER_HERE.
+
+ Second most awesome change ever.
+
+ * scm_unittest.py:
+"""
+ two_line_overlap_patch = """Index: ChangeLog
+===================================================================
+--- ChangeLog (revision 5)
++++ ChangeLog (working copy)
+@@ -2,6 +2,14 @@
+
+ Reviewed by Foo Bar.
+
++ Second most awesome change ever.
++
++ * scm_unittest.py:
++
++2009-10-26 Eric Seidel <eric@webkit.org>
++
++ Reviewed by Foo Bar.
++
+ Most awesome change ever.
+
+ * scm_unittest.py:
+"""
+ two_line_overlap_entry = """DATE_HERE Eric Seidel <eric@webkit.org>
+
+ Reviewed by Foo Bar.
+
+ Second most awesome change ever.
+
+ * scm_unittest.py:
+"""
+ write_into_file_at_path('ChangeLog', first_entry)
+ run_command(['svn', 'add', 'ChangeLog'])
+ run_command(['svn', 'commit', '--quiet', '--message', 'ChangeLog commit'])
+
+ # Patch files were created against just 'first_entry'.
+ # Add a second commit to make svn-apply have to apply the patches with fuzz.
+ changelog_contents = "%s\n%s" % (intermediate_entry, first_entry)
+ write_into_file_at_path('ChangeLog', changelog_contents)
+ run_command(['svn', 'commit', '--quiet', '--message', 'Intermediate commit'])
+
+ self._setup_webkittools_scripts_symlink(self.scm)
+ self.checkout.apply_patch(self._create_patch(one_line_overlap_patch))
+ expected_changelog_contents = "%s\n%s" % (self._set_date_and_reviewer(one_line_overlap_entry), changelog_contents)
+ self.assertEquals(read_from_path('ChangeLog'), expected_changelog_contents)
+
+ self.scm.revert_files(['ChangeLog'])
+ self.checkout.apply_patch(self._create_patch(two_line_overlap_patch))
+ expected_changelog_contents = "%s\n%s" % (self._set_date_and_reviewer(two_line_overlap_entry), changelog_contents)
+ self.assertEquals(read_from_path('ChangeLog'), expected_changelog_contents)
+
+ def setUp(self):
+ SVNTestRepository.setup(self)
+ os.chdir(self.svn_checkout_path)
+ self.scm = detect_scm_system(self.svn_checkout_path)
+ # For historical reasons, we test some checkout code here too.
+ self.checkout = Checkout(self.scm)
+
+ def tearDown(self):
+ SVNTestRepository.tear_down(self)
+
+ def test_detect_scm_system_relative_url(self):
+ scm = detect_scm_system(".")
+ # I wanted to assert that we got the right path, but there was some
+ # crazy magic with temp folder names that I couldn't figure out.
+ self.assertTrue(scm.checkout_root)
+
+ def test_create_patch_is_full_patch(self):
+ test_dir_path = os.path.join(self.svn_checkout_path, "test_dir2")
+ os.mkdir(test_dir_path)
+ test_file_path = os.path.join(test_dir_path, 'test_file2')
+ write_into_file_at_path(test_file_path, 'test content')
+ run_command(['svn', 'add', 'test_dir2'])
+
+ # create_patch depends on 'svn-create-patch', so make a dummy version.
+ scripts_path = os.path.join(self.svn_checkout_path, 'WebKitTools', 'Scripts')
+ os.makedirs(scripts_path)
+ create_patch_path = os.path.join(scripts_path, 'svn-create-patch')
+ write_into_file_at_path(create_patch_path, '#!/bin/sh\necho $PWD') # We could pass -n to prevent the \n, but not all echo accept -n.
+ os.chmod(create_patch_path, stat.S_IXUSR | stat.S_IRUSR)
+
+ # Change into our test directory and run the create_patch command.
+ os.chdir(test_dir_path)
+ scm = detect_scm_system(test_dir_path)
+ self.assertEqual(scm.checkout_root, self.svn_checkout_path) # Sanity check that detection worked right.
+ patch_contents = scm.create_patch()
+ # Our fake 'svn-create-patch' returns $PWD instead of a patch, check that it was executed from the root of the repo.
+ self.assertEqual("%s\n" % os.path.realpath(scm.checkout_root), patch_contents) # Add a \n because echo adds a \n.
+
+ def test_detection(self):
+ scm = detect_scm_system(self.svn_checkout_path)
+ self.assertEqual(scm.display_name(), "svn")
+ self.assertEqual(scm.supports_local_commits(), False)
+
+ def test_apply_small_binary_patch(self):
+ patch_contents = """Index: test_file.swf
+===================================================================
+Cannot display: file marked as a binary type.
+svn:mime-type = application/octet-stream
+
+Property changes on: test_file.swf
+___________________________________________________________________
+Name: svn:mime-type
+ + application/octet-stream
+
+
+Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
+"""
+ expected_contents = base64.b64decode("Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==")
+ self._setup_webkittools_scripts_symlink(self.scm)
+ patch_file = self._create_patch(patch_contents)
+ self.checkout.apply_patch(patch_file)
+ actual_contents = read_from_path("test_file.swf", encoding=None)
+ self.assertEqual(actual_contents, expected_contents)
+
+ def test_apply_svn_patch(self):
+ scm = detect_scm_system(self.svn_checkout_path)
+ patch = self._create_patch(_svn_diff("-r5:4"))
+ self._setup_webkittools_scripts_symlink(scm)
+ Checkout(scm).apply_patch(patch)
+
+ def test_apply_svn_patch_force(self):
+ scm = detect_scm_system(self.svn_checkout_path)
+ patch = self._create_patch(_svn_diff("-r3:5"))
+ self._setup_webkittools_scripts_symlink(scm)
+ self.assertRaises(ScriptError, Checkout(scm).apply_patch, patch, force=True)
+
+ def test_commit_logs(self):
+ # Commits have dates and usernames in them, so we can't just direct compare.
+ self.assertTrue(re.search('fourth commit', self.scm.last_svn_commit_log()))
+ self.assertTrue(re.search('second commit', self.scm.svn_commit_log(3)))
+
+ def _shared_test_commit_with_message(self, username=None):
+ write_into_file_at_path('test_file', 'more test content')
+ commit_text = self.scm.commit_with_message("another test commit", username)
+ self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '6')
+
+ self.scm.dryrun = True
+ write_into_file_at_path('test_file', 'still more test content')
+ commit_text = self.scm.commit_with_message("yet another test commit", username)
+ self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '0')
+
+ def test_commit_text_parsing(self):
+ self._shared_test_commit_with_message()
+
+ def test_commit_with_username(self):
+ self._shared_test_commit_with_message("dbates@webkit.org")
+
+ def test_commit_without_authorization(self):
+ self.scm.has_authorization_for_realm = lambda: False
+ self.assertRaises(AuthenticationError, self._shared_test_commit_with_message)
+
+ def test_has_authorization_for_realm(self):
+ scm = detect_scm_system(self.svn_checkout_path)
+ fake_home_dir = tempfile.mkdtemp(suffix="fake_home_dir")
+ svn_config_dir_path = os.path.join(fake_home_dir, ".subversion")
+ os.mkdir(svn_config_dir_path)
+ fake_webkit_auth_file = os.path.join(svn_config_dir_path, "fake_webkit_auth_file")
+ write_into_file_at_path(fake_webkit_auth_file, SVN.svn_server_realm)
+ self.assertTrue(scm.has_authorization_for_realm(home_directory=fake_home_dir))
+ os.remove(fake_webkit_auth_file)
+ os.rmdir(svn_config_dir_path)
+ os.rmdir(fake_home_dir)
+
+ def test_not_have_authorization_for_realm(self):
+ scm = detect_scm_system(self.svn_checkout_path)
+ fake_home_dir = tempfile.mkdtemp(suffix="fake_home_dir")
+ svn_config_dir_path = os.path.join(fake_home_dir, ".subversion")
+ os.mkdir(svn_config_dir_path)
+ self.assertFalse(scm.has_authorization_for_realm(home_directory=fake_home_dir))
+ os.rmdir(svn_config_dir_path)
+ os.rmdir(fake_home_dir)
+
+ def test_reverse_diff(self):
+ self._shared_test_reverse_diff()
+
+ def test_diff_for_revision(self):
+ self._shared_test_diff_for_revision()
+
+ def test_svn_apply_git_patch(self):
+ self._shared_test_svn_apply_git_patch()
+
+ def test_changed_files(self):
+ self._shared_test_changed_files()
+
+ def test_changed_files_for_revision(self):
+ self._shared_test_changed_files_for_revision()
+
+ def test_added_files(self):
+ self._shared_test_added_files()
+
+ def test_contents_at_revision(self):
+ self._shared_test_contents_at_revision()
+
+ def test_revisions_changing_file(self):
+ self._shared_test_revisions_changing_file()
+
+ def test_committer_email_for_revision(self):
+ self._shared_test_committer_email_for_revision()
+
+ def test_add_recursively(self):
+ self._shared_test_add_recursively()
+
+ def test_delete(self):
+ os.chdir(self.svn_checkout_path)
+ self.scm.delete("test_file")
+ self.assertTrue("test_file" in self.scm.deleted_files())
+
+ def test_propset_propget(self):
+ filepath = os.path.join(self.svn_checkout_path, "test_file")
+ expected_mime_type = "x-application/foo-bar"
+ self.scm.propset("svn:mime-type", expected_mime_type, filepath)
+ self.assertEqual(expected_mime_type, self.scm.propget("svn:mime-type", filepath))
+
+ def test_show_head(self):
+ write_into_file_at_path("test_file", u"Hello!", "utf-8")
+ SVNTestRepository._svn_commit("fourth commit")
+ self.assertEqual("Hello!", self.scm.show_head('test_file'))
+
+ def test_show_head_binary(self):
+ data = "\244"
+ write_into_file_at_path("binary_file", data, encoding=None)
+ self.scm.add("binary_file")
+ self.scm.commit_with_message("a test commit")
+ self.assertEqual(data, self.scm.show_head('binary_file'))
+
+ def do_test_diff_for_file(self):
+ write_into_file_at_path('test_file', 'some content')
+ self.scm.commit_with_message("a test commit")
+ diff = self.scm.diff_for_file('test_file')
+ self.assertEqual(diff, "")
+
+ write_into_file_at_path("test_file", "changed content")
+ diff = self.scm.diff_for_file('test_file')
+ self.assertTrue("-some content" in diff)
+ self.assertTrue("+changed content" in diff)
+
+ def clean_bogus_dir(self):
+ self.bogus_dir = self.scm._bogus_dir_name()
+ if os.path.exists(self.bogus_dir):
+ shutil.rmtree(self.bogus_dir)
+
+ def test_diff_for_file_with_existing_bogus_dir(self):
+ self.clean_bogus_dir()
+ os.mkdir(self.bogus_dir)
+ self.do_test_diff_for_file()
+ self.assertTrue(os.path.exists(self.bogus_dir))
+ shutil.rmtree(self.bogus_dir)
+
+ def test_diff_for_file_with_missing_bogus_dir(self):
+ self.clean_bogus_dir()
+ self.do_test_diff_for_file()
+ self.assertFalse(os.path.exists(self.bogus_dir))
+
+ def test_svn_lock(self):
+ svn_root_lock_path = ".svn/lock"
+ write_into_file_at_path(svn_root_lock_path, "", "utf-8")
+ # webkit-patch uses a Checkout object and runs update-webkit, just use svn update here.
+ self.assertRaises(ScriptError, run_command, ['svn', 'update'])
+ self.scm.clean_working_directory()
+ self.assertFalse(os.path.exists(svn_root_lock_path))
+ run_command(['svn', 'update']) # Should succeed and not raise.
+
+
+class GitTest(SCMTest):
+
+ def setUp(self):
+ """Sets up fresh git repository with one commit. Then setups a second git
+ repo that tracks the first one."""
+ self.original_dir = os.getcwd()
+
+ self.untracking_checkout_path = tempfile.mkdtemp(suffix="git_test_checkout2")
+ run_command(['git', 'init', self.untracking_checkout_path])
+
+ os.chdir(self.untracking_checkout_path)
+ write_into_file_at_path('foo_file', 'foo')
+ run_command(['git', 'add', 'foo_file'])
+ run_command(['git', 'commit', '-am', 'dummy commit'])
+ self.untracking_scm = detect_scm_system(self.untracking_checkout_path)
+
+ self.tracking_git_checkout_path = tempfile.mkdtemp(suffix="git_test_checkout")
+ run_command(['git', 'clone', '--quiet', self.untracking_checkout_path, self.tracking_git_checkout_path])
+ os.chdir(self.tracking_git_checkout_path)
+ self.tracking_scm = detect_scm_system(self.tracking_git_checkout_path)
+
+ def tearDown(self):
+ # Change back to a valid directory so that later calls to os.getcwd() do not fail.
+ os.chdir(self.original_dir)
+ run_command(['rm', '-rf', self.tracking_git_checkout_path])
+ run_command(['rm', '-rf', self.untracking_checkout_path])
+
+ def test_remote_branch_ref(self):
+ self.assertEqual(self.tracking_scm.remote_branch_ref(), 'refs/remotes/origin/master')
+
+ os.chdir(self.untracking_checkout_path)
+ self.assertRaises(ScriptError, self.untracking_scm.remote_branch_ref)
+
+
+class GitSVNTest(SCMTest):
+
+ def _setup_git_checkout(self):
+ self.git_checkout_path = tempfile.mkdtemp(suffix="git_test_checkout")
+ # --quiet doesn't make git svn silent, so we use run_silent to redirect output
+ run_silent(['git', 'svn', 'clone', '-T', 'trunk', self.svn_repo_url, self.git_checkout_path])
+ os.chdir(self.git_checkout_path)
+
+ def _tear_down_git_checkout(self):
+ # Change back to a valid directory so that later calls to os.getcwd() do not fail.
+ os.chdir(self.original_dir)
+ run_command(['rm', '-rf', self.git_checkout_path])
+
+ def setUp(self):
+ self.original_dir = os.getcwd()
+
+ SVNTestRepository.setup(self)
+ self._setup_git_checkout()
+ self.scm = detect_scm_system(self.git_checkout_path)
+ # For historical reasons, we test some checkout code here too.
+ self.checkout = Checkout(self.scm)
+
+ def tearDown(self):
+ SVNTestRepository.tear_down(self)
+ self._tear_down_git_checkout()
+
+ def test_detection(self):
+ scm = detect_scm_system(self.git_checkout_path)
+ self.assertEqual(scm.display_name(), "git")
+ self.assertEqual(scm.supports_local_commits(), True)
+
+ def test_read_git_config(self):
+ key = 'test.git-config'
+ value = 'git-config value'
+ run_command(['git', 'config', key, value])
+ self.assertEqual(self.scm.read_git_config(key), value)
+
+ def test_local_commits(self):
+ test_file = os.path.join(self.git_checkout_path, 'test_file')
+ write_into_file_at_path(test_file, 'foo')
+ run_command(['git', 'commit', '-a', '-m', 'local commit'])
+
+ self.assertEqual(len(self.scm.local_commits()), 1)
+
+ def test_discard_local_commits(self):
+ test_file = os.path.join(self.git_checkout_path, 'test_file')
+ write_into_file_at_path(test_file, 'foo')
+ run_command(['git', 'commit', '-a', '-m', 'local commit'])
+
+ self.assertEqual(len(self.scm.local_commits()), 1)
+ self.scm.discard_local_commits()
+ self.assertEqual(len(self.scm.local_commits()), 0)
+
+ def test_delete_branch(self):
+ new_branch = 'foo'
+
+ run_command(['git', 'checkout', '-b', new_branch])
+ self.assertEqual(run_command(['git', 'symbolic-ref', 'HEAD']).strip(), 'refs/heads/' + new_branch)
+
+ run_command(['git', 'checkout', '-b', 'bar'])
+ self.scm.delete_branch(new_branch)
+
+ self.assertFalse(re.search(r'foo', run_command(['git', 'branch'])))
+
+ def test_remote_merge_base(self):
+ # Diff to merge-base should include working-copy changes,
+ # which the diff to svn_branch.. doesn't.
+ test_file = os.path.join(self.git_checkout_path, 'test_file')
+ write_into_file_at_path(test_file, 'foo')
+
+ diff_to_common_base = _git_diff(self.scm.remote_branch_ref() + '..')
+ diff_to_merge_base = _git_diff(self.scm.remote_merge_base())
+
+ self.assertFalse(re.search(r'foo', diff_to_common_base))
+ self.assertTrue(re.search(r'foo', diff_to_merge_base))
+
+ def test_rebase_in_progress(self):
+ svn_test_file = os.path.join(self.svn_checkout_path, 'test_file')
+ write_into_file_at_path(svn_test_file, "svn_checkout")
+ run_command(['svn', 'commit', '--message', 'commit to conflict with git commit'], cwd=self.svn_checkout_path)
+
+ git_test_file = os.path.join(self.git_checkout_path, 'test_file')
+ write_into_file_at_path(git_test_file, "git_checkout")
+ run_command(['git', 'commit', '-a', '-m', 'commit to be thrown away by rebase abort'])
+
+ # --quiet doesn't make git svn silent, so use run_silent to redirect output
+ self.assertRaises(ScriptError, run_silent, ['git', 'svn', '--quiet', 'rebase']) # Will fail due to a conflict leaving us mid-rebase.
+
+ scm = detect_scm_system(self.git_checkout_path)
+ self.assertTrue(scm.rebase_in_progress())
+
+ # Make sure our cleanup works.
+ scm.clean_working_directory()
+ self.assertFalse(scm.rebase_in_progress())
+
+ # Make sure cleanup doesn't throw when no rebase is in progress.
+ scm.clean_working_directory()
+
+ def test_commitish_parsing(self):
+ scm = detect_scm_system(self.git_checkout_path)
+
+ # Multiple revisions are cherry-picked.
+ self.assertEqual(len(scm.commit_ids_from_commitish_arguments(['HEAD~2'])), 1)
+ self.assertEqual(len(scm.commit_ids_from_commitish_arguments(['HEAD', 'HEAD~2'])), 2)
+
+ # ... is an invalid range specifier
+ self.assertRaises(ScriptError, scm.commit_ids_from_commitish_arguments, ['trunk...HEAD'])
+
+ def test_commitish_order(self):
+ scm = detect_scm_system(self.git_checkout_path)
+
+ commit_range = 'HEAD~3..HEAD'
+
+ actual_commits = scm.commit_ids_from_commitish_arguments([commit_range])
+ expected_commits = []
+ expected_commits += reversed(run_command(['git', 'rev-list', commit_range]).splitlines())
+
+ self.assertEqual(actual_commits, expected_commits)
+
+ def test_apply_git_patch(self):
+ scm = detect_scm_system(self.git_checkout_path)
+ # We carefullly pick a diff which does not have a directory addition
+ # as currently svn-apply will error out when trying to remove directories
+ # in Git: https://bugs.webkit.org/show_bug.cgi?id=34871
+ patch = self._create_patch(_git_diff('HEAD..HEAD^'))
+ self._setup_webkittools_scripts_symlink(scm)
+ Checkout(scm).apply_patch(patch)
+
+ def test_apply_git_patch_force(self):
+ scm = detect_scm_system(self.git_checkout_path)
+ patch = self._create_patch(_git_diff('HEAD~2..HEAD'))
+ self._setup_webkittools_scripts_symlink(scm)
+ self.assertRaises(ScriptError, Checkout(scm).apply_patch, patch, force=True)
+
+ def test_commit_text_parsing(self):
+ write_into_file_at_path('test_file', 'more test content')
+ commit_text = self.scm.commit_with_message("another test commit")
+ self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '6')
+
+ self.scm.dryrun = True
+ write_into_file_at_path('test_file', 'still more test content')
+ commit_text = self.scm.commit_with_message("yet another test commit")
+ self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '0')
+
+ def test_commit_with_message_working_copy_only(self):
+ write_into_file_at_path('test_file_commit1', 'more test content')
+ run_command(['git', 'add', 'test_file_commit1'])
+ scm = detect_scm_system(self.git_checkout_path)
+ commit_text = scm.commit_with_message("yet another test commit")
+
+ self.assertEqual(scm.svn_revision_from_commit_text(commit_text), '6')
+ svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
+ self.assertTrue(re.search(r'test_file_commit1', svn_log))
+
+ def _one_local_commit(self):
+ write_into_file_at_path('test_file_commit1', 'more test content')
+ run_command(['git', 'add', 'test_file_commit1'])
+ self.scm.commit_locally_with_message("another test commit")
+
+ def _one_local_commit_plus_working_copy_changes(self):
+ self._one_local_commit()
+ write_into_file_at_path('test_file_commit2', 'still more test content')
+ run_command(['git', 'add', 'test_file_commit2'])
+
+ def _two_local_commits(self):
+ self._one_local_commit()
+ write_into_file_at_path('test_file_commit2', 'still more test content')
+ run_command(['git', 'add', 'test_file_commit2'])
+ self.scm.commit_locally_with_message("yet another test commit")
+
+ def _three_local_commits(self):
+ write_into_file_at_path('test_file_commit0', 'more test content')
+ run_command(['git', 'add', 'test_file_commit0'])
+ self.scm.commit_locally_with_message("another test commit")
+ self._two_local_commits()
+
+ def test_revisions_changing_files_with_local_commit(self):
+ self._one_local_commit()
+ self.assertEquals(self.scm.revisions_changing_file('test_file_commit1'), [])
+
+ def test_commit_with_message(self):
+ self._one_local_commit_plus_working_copy_changes()
+ scm = detect_scm_system(self.git_checkout_path)
+ self.assertRaises(AmbiguousCommitError, scm.commit_with_message, "yet another test commit")
+ commit_text = scm.commit_with_message("yet another test commit", force_squash=True)
+
+ self.assertEqual(scm.svn_revision_from_commit_text(commit_text), '6')
+ svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
+ self.assertTrue(re.search(r'test_file_commit2', svn_log))
+ self.assertTrue(re.search(r'test_file_commit1', svn_log))
+
+ def test_commit_with_message_git_commit(self):
+ self._two_local_commits()
+
+ scm = detect_scm_system(self.git_checkout_path)
+ commit_text = scm.commit_with_message("another test commit", git_commit="HEAD^")
+ self.assertEqual(scm.svn_revision_from_commit_text(commit_text), '6')
+
+ svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
+ self.assertTrue(re.search(r'test_file_commit1', svn_log))
+ self.assertFalse(re.search(r'test_file_commit2', svn_log))
+
+ def test_commit_with_message_git_commit_range(self):
+ self._three_local_commits()
+
+ scm = detect_scm_system(self.git_checkout_path)
+ commit_text = scm.commit_with_message("another test commit", git_commit="HEAD~2..HEAD")
+ self.assertEqual(scm.svn_revision_from_commit_text(commit_text), '6')
+
+ svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
+ self.assertFalse(re.search(r'test_file_commit0', svn_log))
+ self.assertTrue(re.search(r'test_file_commit1', svn_log))
+ self.assertTrue(re.search(r'test_file_commit2', svn_log))
+
+ def test_changed_files_working_copy_only(self):
+ self._one_local_commit_plus_working_copy_changes()
+ scm = detect_scm_system(self.git_checkout_path)
+ commit_text = scm.commit_with_message("another test commit", git_commit="HEAD..")
+ self.assertFalse(re.search(r'test_file_commit1', svn_log))
+ self.assertTrue(re.search(r'test_file_commit2', svn_log))
+
+ def test_commit_with_message_only_local_commit(self):
+ self._one_local_commit()
+ scm = detect_scm_system(self.git_checkout_path)
+ commit_text = scm.commit_with_message("another test commit")
+ svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
+ self.assertTrue(re.search(r'test_file_commit1', svn_log))
+
+ def test_commit_with_message_multiple_local_commits_and_working_copy(self):
+ self._two_local_commits()
+ write_into_file_at_path('test_file_commit1', 'working copy change')
+ scm = detect_scm_system(self.git_checkout_path)
+
+ self.assertRaises(AmbiguousCommitError, scm.commit_with_message, "another test commit")
+ commit_text = scm.commit_with_message("another test commit", force_squash=True)
+
+ self.assertEqual(scm.svn_revision_from_commit_text(commit_text), '6')
+ svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
+ self.assertTrue(re.search(r'test_file_commit2', svn_log))
+ self.assertTrue(re.search(r'test_file_commit1', svn_log))
+
+ def test_commit_with_message_git_commit_and_working_copy(self):
+ self._two_local_commits()
+ write_into_file_at_path('test_file_commit1', 'working copy change')
+ scm = detect_scm_system(self.git_checkout_path)
+ self.assertRaises(ScriptError, scm.commit_with_message, "another test commit", git_commit="HEAD^")
+
+ def test_commit_with_message_multiple_local_commits_always_squash(self):
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ scm._assert_can_squash = lambda working_directory_is_clean: True
+ commit_text = scm.commit_with_message("yet another test commit")
+ self.assertEqual(scm.svn_revision_from_commit_text(commit_text), '6')
+
+ svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
+ self.assertTrue(re.search(r'test_file_commit2', svn_log))
+ self.assertTrue(re.search(r'test_file_commit1', svn_log))
+
+ def test_commit_with_message_multiple_local_commits(self):
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ self.assertRaises(AmbiguousCommitError, scm.commit_with_message, "yet another test commit")
+ commit_text = scm.commit_with_message("yet another test commit", force_squash=True)
+
+ self.assertEqual(scm.svn_revision_from_commit_text(commit_text), '6')
+
+ svn_log = run_command(['git', 'svn', 'log', '--limit=1', '--verbose'])
+ self.assertTrue(re.search(r'test_file_commit2', svn_log))
+ self.assertTrue(re.search(r'test_file_commit1', svn_log))
+
+ def test_commit_with_message_not_synced(self):
+ run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ self.assertRaises(AmbiguousCommitError, scm.commit_with_message, "another test commit")
+ self.assertRaises(ScriptError, scm.commit_with_message, "another test commit", force_squash=True)
+
+ def test_remote_branch_ref(self):
+ self.assertEqual(self.scm.remote_branch_ref(), 'refs/remotes/trunk')
+
+ def test_reverse_diff(self):
+ self._shared_test_reverse_diff()
+
+ def test_diff_for_revision(self):
+ self._shared_test_diff_for_revision()
+
+ def test_svn_apply_git_patch(self):
+ self._shared_test_svn_apply_git_patch()
+
+ def test_create_patch_local_plus_working_copy(self):
+ self._one_local_commit_plus_working_copy_changes()
+ scm = detect_scm_system(self.git_checkout_path)
+ patch = scm.create_patch()
+ self.assertTrue(re.search(r'test_file_commit1', patch))
+ self.assertTrue(re.search(r'test_file_commit2', patch))
+
+ def test_create_patch(self):
+ self._one_local_commit_plus_working_copy_changes()
+ scm = detect_scm_system(self.git_checkout_path)
+ patch = scm.create_patch()
+ self.assertTrue(re.search(r'test_file_commit2', patch))
+ self.assertTrue(re.search(r'test_file_commit1', patch))
+
+ def test_create_patch_with_changed_files(self):
+ self._one_local_commit_plus_working_copy_changes()
+ scm = detect_scm_system(self.git_checkout_path)
+ patch = scm.create_patch(changed_files=['test_file_commit2'])
+ self.assertTrue(re.search(r'test_file_commit2', patch))
+
+ def test_create_patch_with_rm_and_changed_files(self):
+ self._one_local_commit_plus_working_copy_changes()
+ scm = detect_scm_system(self.git_checkout_path)
+ os.remove('test_file_commit1')
+ patch = scm.create_patch()
+ patch_with_changed_files = scm.create_patch(changed_files=['test_file_commit1', 'test_file_commit2'])
+ self.assertEquals(patch, patch_with_changed_files)
+
+ def test_create_patch_git_commit(self):
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ patch = scm.create_patch(git_commit="HEAD^")
+ self.assertTrue(re.search(r'test_file_commit1', patch))
+ self.assertFalse(re.search(r'test_file_commit2', patch))
+
+ def test_create_patch_git_commit_range(self):
+ self._three_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ patch = scm.create_patch(git_commit="HEAD~2..HEAD")
+ self.assertFalse(re.search(r'test_file_commit0', patch))
+ self.assertTrue(re.search(r'test_file_commit2', patch))
+ self.assertTrue(re.search(r'test_file_commit1', patch))
+
+ def test_create_patch_working_copy_only(self):
+ self._one_local_commit_plus_working_copy_changes()
+ scm = detect_scm_system(self.git_checkout_path)
+ patch = scm.create_patch(git_commit="HEAD..")
+ self.assertFalse(re.search(r'test_file_commit1', patch))
+ self.assertTrue(re.search(r'test_file_commit2', patch))
+
+ def test_create_patch_multiple_local_commits(self):
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ patch = scm.create_patch()
+ self.assertTrue(re.search(r'test_file_commit2', patch))
+ self.assertTrue(re.search(r'test_file_commit1', patch))
+
+ def test_create_patch_not_synced(self):
+ run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ self.assertRaises(ScriptError, scm.create_patch)
+
+ def test_create_binary_patch(self):
+ # Create a git binary patch and check the contents.
+ scm = detect_scm_system(self.git_checkout_path)
+ test_file_name = 'binary_file'
+ test_file_path = os.path.join(self.git_checkout_path, test_file_name)
+ file_contents = ''.join(map(chr, range(256)))
+ write_into_file_at_path(test_file_path, file_contents, encoding=None)
+ run_command(['git', 'add', test_file_name])
+ patch = scm.create_patch()
+ self.assertTrue(re.search(r'\nliteral 0\n', patch))
+ self.assertTrue(re.search(r'\nliteral 256\n', patch))
+
+ # Check if we can apply the created patch.
+ run_command(['git', 'rm', '-f', test_file_name])
+ self._setup_webkittools_scripts_symlink(scm)
+ self.checkout.apply_patch(self._create_patch(patch))
+ self.assertEqual(file_contents, read_from_path(test_file_path, encoding=None))
+
+ # Check if we can create a patch from a local commit.
+ write_into_file_at_path(test_file_path, file_contents, encoding=None)
+ run_command(['git', 'add', test_file_name])
+ run_command(['git', 'commit', '-m', 'binary diff'])
+ patch_from_local_commit = scm.create_patch('HEAD')
+ self.assertTrue(re.search(r'\nliteral 0\n', patch_from_local_commit))
+ self.assertTrue(re.search(r'\nliteral 256\n', patch_from_local_commit))
+
+ def test_changed_files_local_plus_working_copy(self):
+ self._one_local_commit_plus_working_copy_changes()
+ scm = detect_scm_system(self.git_checkout_path)
+ files = scm.changed_files()
+ self.assertTrue('test_file_commit1' in files)
+ self.assertTrue('test_file_commit2' in files)
+
+ def test_changed_files_git_commit(self):
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ files = scm.changed_files(git_commit="HEAD^")
+ self.assertTrue('test_file_commit1' in files)
+ self.assertFalse('test_file_commit2' in files)
+
+ def test_changed_files_git_commit_range(self):
+ self._three_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ files = scm.changed_files(git_commit="HEAD~2..HEAD")
+ self.assertTrue('test_file_commit0' not in files)
+ self.assertTrue('test_file_commit1' in files)
+ self.assertTrue('test_file_commit2' in files)
+
+ def test_changed_files_working_copy_only(self):
+ self._one_local_commit_plus_working_copy_changes()
+ scm = detect_scm_system(self.git_checkout_path)
+ files = scm.changed_files(git_commit="HEAD..")
+ self.assertFalse('test_file_commit1' in files)
+ self.assertTrue('test_file_commit2' in files)
+
+ def test_changed_files_multiple_local_commits(self):
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ files = scm.changed_files()
+ self.assertTrue('test_file_commit2' in files)
+ self.assertTrue('test_file_commit1' in files)
+
+ def test_changed_files_not_synced(self):
+ run_command(['git', 'checkout', '-b', 'my-branch', 'trunk~3'])
+ self._two_local_commits()
+ scm = detect_scm_system(self.git_checkout_path)
+ self.assertRaises(ScriptError, scm.changed_files)
+
+ def test_changed_files(self):
+ self._shared_test_changed_files()
+
+ def test_changed_files_for_revision(self):
+ self._shared_test_changed_files_for_revision()
+
+ def test_contents_at_revision(self):
+ self._shared_test_contents_at_revision()
+
+ def test_revisions_changing_file(self):
+ self._shared_test_revisions_changing_file()
+
+ def test_added_files(self):
+ self._shared_test_added_files()
+
+ def test_committer_email_for_revision(self):
+ self._shared_test_committer_email_for_revision()
+
+ def test_add_recursively(self):
+ self._shared_test_add_recursively()
+
+ def test_delete(self):
+ self._two_local_commits()
+ self.scm.delete('test_file_commit1')
+ self.assertTrue("test_file_commit1" in self.scm.deleted_files())
+
+ def test_to_object_name(self):
+ relpath = 'test_file_commit1'
+ fullpath = os.path.join(self.git_checkout_path, relpath)
+ self._two_local_commits()
+ self.assertEqual(relpath, self.scm.to_object_name(fullpath))
+
+ def test_show_head(self):
+ self._two_local_commits()
+ self.assertEqual("more test content", self.scm.show_head('test_file_commit1'))
+
+ def test_show_head_binary(self):
+ self._two_local_commits()
+ data = "\244"
+ write_into_file_at_path("binary_file", data, encoding=None)
+ self.scm.add("binary_file")
+ self.scm.commit_locally_with_message("a test commit")
+ self.assertEqual(data, self.scm.show_head('binary_file'))
+
+ def test_diff_for_file(self):
+ self._two_local_commits()
+ write_into_file_at_path('test_file_commit1', "Updated", encoding=None)
+
+ diff = self.scm.diff_for_file('test_file_commit1')
+ cached_diff = self.scm.diff_for_file('test_file_commit1')
+ self.assertTrue("+Updated" in diff)
+ self.assertTrue("-more test content" in diff)
+
+ self.scm.add('test_file_commit1')
+
+ cached_diff = self.scm.diff_for_file('test_file_commit1')
+ self.assertTrue("+Updated" in cached_diff)
+ self.assertTrue("-more test content" in cached_diff)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/__init__.py b/WebKitTools/Scripts/webkitpy/common/config/__init__.py
index ef65bee..ef65bee 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/__init__.py
diff --git a/WebKitTools/Scripts/webkitpy/common/config/build.py b/WebKitTools/Scripts/webkitpy/common/config/build.py
new file mode 100644
index 0000000..c45f122
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/build.py
@@ -0,0 +1,138 @@
+# 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.
+
+"""Functions relating to building WebKit"""
+
+import re
+
+
+def _should_file_trigger_build(target_platform, file):
+ # The directories and patterns lists below map directory names or
+ # regexp patterns to the bot platforms for which they should trigger a
+ # build. Mapping to the empty list means that no builds should be
+ # triggered on any platforms. Earlier directories/patterns take
+ # precendence over later ones.
+
+ # FIXME: The patterns below have only been verified to be correct on
+ # Windows. We should implement this for other platforms and start using
+ # it for their bots. Someone familiar with each platform will have to
+ # figure out what the right set of directories/patterns is for that
+ # platform.
+ assert(target_platform == "win")
+
+ directories = [
+ # Directories that shouldn't trigger builds on any bots.
+ ("BugsSite", []),
+ ("PageLoadTests", []),
+ ("PlanetWebKit", []),
+ ("WebCore/manual-tests", []),
+ ("WebKitExamplePlugins", []),
+ ("WebKitSite", []),
+ ("android", []),
+ ("brew", []),
+ ("efl", []),
+ ("haiku", []),
+ ("iphone", []),
+ ("opengl", []),
+ ("opentype", []),
+ ("openvg", []),
+ ("wx", []),
+ ("wince", []),
+
+ # Directories that should trigger builds on only some bots.
+ ("JavaScriptGlue", ["mac"]),
+ ("LayoutTests/platform/mac", ["mac", "win"]),
+ ("LayoutTests/platform/mac-snowleopard", ["mac-snowleopard", "win"]),
+ ("WebCore/image-decoders", ["chromium"]),
+ ("cairo", ["gtk", "wincairo"]),
+ ("cf", ["chromium-mac", "mac", "qt", "win"]),
+ ("chromium", ["chromium"]),
+ ("cocoa", ["chromium-mac", "mac"]),
+ ("curl", ["gtk", "wincairo"]),
+ ("gobject", ["gtk"]),
+ ("gpu", ["chromium", "mac"]),
+ ("gstreamer", ["gtk"]),
+ ("gtk", ["gtk"]),
+ ("mac", ["chromium-mac", "mac"]),
+ ("mac-leopard", ["mac-leopard"]),
+ ("mac-snowleopard", ["mac-snowleopard"]),
+ ("mac-wk2", ["mac-snowleopard", "win"]),
+ ("objc", ["mac"]),
+ ("qt", ["qt"]),
+ ("skia", ["chromium"]),
+ ("soup", ["gtk"]),
+ ("v8", ["chromium"]),
+ ("win", ["chromium-win", "win"]),
+ ]
+ patterns = [
+ # Patterns that shouldn't trigger builds on any bots.
+ (r"(?:^|/)Makefile$", []),
+ (r"/ARM", []),
+ (r"/CMake.*", []),
+ (r"/ChangeLog.*$", []),
+ (r"/LICENSE[^/]+$", []),
+ (r"ARM(?:v7)?\.(?:cpp|h)$", []),
+ (r"MIPS\.(?:cpp|h)$", []),
+ (r"WinCE\.(?:cpp|h|mm)$", []),
+ (r"\.(?:bkl|mk)$", []),
+
+ # Patterns that should trigger builds on only some bots.
+ (r"/GNUmakefile\.am$", ["gtk"]),
+ (r"/\w+Chromium\w*\.(?:cpp|h|mm)$", ["chromium"]),
+ (r"Mac\.(?:cpp|h|mm)$", ["mac"]),
+ (r"\.exp$", ["mac"]),
+ (r"\.gypi?", ["chromium"]),
+ (r"\.order$", ["mac"]),
+ (r"\.pr[io]$", ["qt"]),
+ (r"\.xcconfig$", ["mac"]),
+ (r"\.xcodeproj/", ["mac"]),
+ ]
+
+ base_platform = target_platform.split("-")[0]
+
+ # See if the file is in one of the known directories.
+ for directory, platforms in directories:
+ if re.search(r"(?:^|/)%s/" % directory, file):
+ return target_platform in platforms or base_platform in platforms
+
+ # See if the file matches a known pattern.
+ for pattern, platforms in patterns:
+ if re.search(pattern, file):
+ return target_platform in platforms or base_platform in platforms
+
+ # See if the file is a platform-specific test result.
+ match = re.match("LayoutTests/platform/(?P<platform>[^/]+)/", file)
+ if match:
+ # See if the file is a test result for this platform, our base
+ # platform, or one of our sub-platforms.
+ return match.group("platform") in (target_platform, base_platform) or match.group("platform").startswith("%s-" % target_platform)
+
+ # The file isn't one we know about specifically, so we should assume we
+ # have to build.
+ return True
+
+
+def should_build(target_platform, changed_files):
+ """Returns true if the changed files affect the given platform, and
+ thus a build should be performed. target_platform should be one of the
+ platforms used in the build.webkit.org master's config.json file."""
+ return any(_should_file_trigger_build(target_platform, file) for file in changed_files)
diff --git a/WebKitTools/Scripts/webkitpy/common/config/build_unittest.py b/WebKitTools/Scripts/webkitpy/common/config/build_unittest.py
new file mode 100644
index 0000000..3e70ff0
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/build_unittest.py
@@ -0,0 +1,64 @@
+# 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 unittest
+
+from webkitpy.common.config import build
+
+
+class ShouldBuildTest(unittest.TestCase):
+ _should_build_tests = [
+ (["BugsSite/foo", "WebCore/bar"], ["*"]),
+ (["BugsSite/foo"], []),
+ (["JavaScriptCore/JavaScriptCore.xcodeproj/foo"], ["mac-leopard", "mac-snowleopard"]),
+ (["JavaScriptGlue/foo", "WebCore/bar"], ["*"]),
+ (["JavaScriptGlue/foo"], ["mac-leopard", "mac-snowleopard"]),
+ (["LayoutTests/foo"], ["*"]),
+ (["LayoutTests/platform/chromium-linux/foo"], ["chromium-linux"]),
+ (["LayoutTests/platform/chromium-win/fast/compact/001-expected.txt"], ["chromium-win"]),
+ (["LayoutTests/platform/mac-leopard/foo"], ["mac-leopard"]),
+ (["LayoutTests/platform/mac-snowleopard/foo"], ["mac-snowleopard", "win"]),
+ (["LayoutTests/platform/mac-wk2/Skipped"], ["mac-snowleopard", "win"]),
+ (["LayoutTests/platform/mac/foo"], ["mac-leopard", "mac-snowleopard", "win"]),
+ (["LayoutTests/platform/win-xp/foo"], ["win"]),
+ (["LayoutTests/platform/win-wk2/foo"], ["win"]),
+ (["LayoutTests/platform/win/foo"], ["win"]),
+ (["WebCore/mac/foo"], ["chromium-mac", "mac-leopard", "mac-snowleopard"]),
+ (["WebCore/win/foo"], ["chromium-win", "win"]),
+ (["WebCore/platform/graphics/gpu/foo"], ["mac-leopard", "mac-snowleopard"]),
+ (["WebCore/platform/wx/wxcode/win/foo"], []),
+ (["WebCore/rendering/RenderThemeMac.mm", "WebCore/rendering/RenderThemeMac.h"], ["mac-leopard", "mac-snowleopard"]),
+ (["WebCore/rendering/RenderThemeChromiumLinux.h"], ["chromium-linux"]),
+ (["WebCore/rendering/RenderThemeWinCE.h"], []),
+ ]
+
+ def test_should_build(self):
+ for files, platforms in self._should_build_tests:
+ # FIXME: We should test more platforms here once
+ # build._should_file_trigger_build is implemented for them.
+ for platform in ["win"]:
+ should_build = platform in platforms or "*" in platforms
+ self.assertEqual(build.should_build(platform, files), should_build, "%s should%s have built but did%s (files: %s)" % (platform, "" if should_build else "n't", "n't" if should_build else "", str(files)))
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py
new file mode 100644
index 0000000..0967340
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py
@@ -0,0 +1,331 @@
+# Copyright (c) 2009, Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# WebKit's Python module for committer and reviewer validation
+
+
+class Committer:
+
+ def __init__(self, name, email_or_emails, irc_nickname=None):
+ self.full_name = name
+ if isinstance(email_or_emails, str):
+ self.emails = [email_or_emails]
+ else:
+ self.emails = email_or_emails
+ self.irc_nickname = irc_nickname
+ self.can_review = False
+
+ def bugzilla_email(self):
+ # FIXME: We're assuming the first email is a valid bugzilla email,
+ # which might not be right.
+ return self.emails[0]
+
+ def __str__(self):
+ return '"%s" <%s>' % (self.full_name, self.emails[0])
+
+
+class Reviewer(Committer):
+
+ def __init__(self, name, email_or_emails, irc_nickname=None):
+ Committer.__init__(self, name, email_or_emails, irc_nickname)
+ self.can_review = True
+
+
+# This is intended as a canonical, machine-readable list of all non-reviewer
+# committers for WebKit. If your name is missing here and you are a committer,
+# please add it. No review needed. All reviewers are committers, so this list
+# is only of committers who are not reviewers.
+
+
+committers_unable_to_review = [
+ Committer("Aaron Boodman", "aa@chromium.org", "aboodman"),
+ Committer("Abhishek Arya", "inferno@chromium.org", "inferno-sec"),
+ Committer("Adam Langley", "agl@chromium.org", "agl"),
+ Committer("Albert J. Wong", "ajwong@chromium.org"),
+ Committer("Alejandro G. Castro", ["alex@igalia.com", "alex@webkit.org"]),
+ Committer("Alexander Kellett", ["lypanov@mac.com", "a-lists001@lypanov.net", "lypanov@kde.org"], "lypanov"),
+ Committer("Alexander Pavlov", "apavlov@chromium.org", "apavlov"),
+ Committer("Andre Boule", "aboule@apple.com"),
+ Committer("Andrei Popescu", "andreip@google.com", "andreip"),
+ Committer("Andrew Wellington", ["andrew@webkit.org", "proton@wiretapped.net"], "proton"),
+ Committer("Andrey Kosyakov", "caseq@chromium.org", "caseq"),
+ Committer("Andras Becsi", "abecsi@webkit.org", "bbandix"),
+ Committer("Andy Estes", "aestes@apple.com", "estes"),
+ Committer("Anthony Ricaud", "rik@webkit.org", "rik"),
+ Committer("Anton Muhin", "antonm@chromium.org", "antonm"),
+ Committer("Balazs Kelemen", "kbalazs@webkit.org", "kbalazs"),
+ Committer("Ben Murdoch", "benm@google.com", "benm"),
+ Committer("Benjamin C Meyer", ["ben@meyerhome.net", "ben@webkit.org"], "icefox"),
+ Committer("Benjamin Otte", ["otte@gnome.org", "otte@webkit.org"], "otte"),
+ Committer("Benjamin Poulain", ["benjamin.poulain@nokia.com", "ikipou@gmail.com"]),
+ Committer("Brent Fulgham", "bfulgham@webkit.org", "bfulgham"),
+ Committer("Brett Wilson", "brettw@chromium.org", "brettx"),
+ Committer("Brian Weinstein", "bweinstein@apple.com", "bweinstein"),
+ Committer("Cameron McCormack", "cam@webkit.org", "heycam"),
+ Committer("Carol Szabo", "carol.szabo@nokia.com"),
+ Committer("Chang Shu", "Chang.Shu@nokia.com"),
+ Committer("Chris Evans", "cevans@google.com"),
+ Committer("Chris Petersen", "cpetersen@apple.com", "cpetersen"),
+ Committer("Chris Rogers", "crogers@google.com", "crogers"),
+ Committer("Christian Dywan", ["christian@twotoasts.de", "christian@webkit.org"]),
+ Committer("Collin Jackson", "collinj@webkit.org"),
+ Committer("David Smith", ["catfish.man@gmail.com", "dsmith@webkit.org"], "catfishman"),
+ Committer("Dean Jackson", "dino@apple.com", "dino"),
+ 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("Eli Fidler", "eli@staikos.net", "QBin"),
+ Committer("Enrica Casucci", "enrica@apple.com"),
+ Committer("Erik Arvidsson", "arv@chromium.org", "arv"),
+ Committer("Eric Roman", "eroman@chromium.org", "eroman"),
+ Committer("Evan Martin", "evan@chromium.org", "evmar"),
+ Committer("Evan Stade", "estade@chromium.org", "estade"),
+ Committer("Fady Samuel", "fsamuel@chromium.org", "fsamuel"),
+ Committer("Feng Qian", "feng@chromium.org"),
+ Committer("Fumitoshi Ukai", "ukai@chromium.org", "ukai"),
+ Committer("Gabor Loki", "loki@webkit.org", "loki04"),
+ Committer("Girish Ramakrishnan", ["girish@forwardbias.in", "ramakrishnan.girish@gmail.com"]),
+ Committer("Graham Dennis", ["Graham.Dennis@gmail.com", "gdennis@webkit.org"]),
+ Committer("Greg Bolsinga", "bolsinga@apple.com"),
+ Committer("Gyuyoung Kim", ["gyuyoung.kim@samsung.com", "gyuyoung@gmail.com", "gyuyoung@webkit.org"], "gyuyoung"),
+ Committer("Hans Wennborg", "hans@chromium.org", "hwennborg"),
+ Committer("Hayato Ito", "hayato@chromium.org", "hayato"),
+ Committer("Hin-Chung Lam", ["hclam@google.com", "hclam@chromium.org"]),
+ Committer("Ilya Tikhonovsky", "loislo@chromium.org", "loislo"),
+ 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("Jay Civelli", "jcivelli@chromium.org", "jcivelli"),
+ 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("Jochen Eisinger", "jochen@chromium.org", "jochen__"),
+ 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("Kent Hansen", "kent.hansen@nokia.com", "khansen"),
+ Committer("Kimmo Kinnunen", ["kimmo.t.kinnunen@nokia.com", "kimmok@iki.fi", "ktkinnun@webkit.org"], "kimmok"),
+ Committer("Kinuko Yasuda", "kinuko@chromium.org", "kinuko"),
+ Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
+ Committer("Kwang Yul Seo", ["kwangyul.seo@gmail.com", "skyul@company100.net", "kseo@webkit.org"], "kwangseo"),
+ Committer("Leandro Pereira", ["leandro@profusion.mobi", "leandro@webkit.org"], "acidx"),
+ Committer("Levi Weintraub", "lweintraub@apple.com"),
+ Committer("Lucas De Marchi", ["lucas.demarchi@profusion.mobi", "demarchi@webkit.org"], "demarchi"),
+ 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("Mario Sanchez Prada", ["msanchez@igalia.com", "mario@webkit.org"], "msanchez"),
+ Committer("Matt Delaney", "mdelaney@apple.com"),
+ Committer("Matt Lilek", ["webkit@mattlilek.com", "pewtermoose@webkit.org"]),
+ Committer("Matt Perry", "mpcomplete@chromium.org"),
+ Committer("Maxime Britto", ["maxime.britto@gmail.com", "britto@apple.com"]),
+ Committer("Maxime Simon", ["simon.maxime@gmail.com", "maxime.simon@webkit.org"], "maxime.simon"),
+ Committer("Michael Nordman", "michaeln@google.com", "michaeln"),
+ Committer("Michael Saboff", "msaboff@apple.com"),
+ Committer("Michelangelo De Simone", "michelangelo@webkit.org", "michelangelo"),
+ Committer("Mihai Parparita", "mihaip@chromium.org", "mihaip"),
+ Committer("Mike Belshe", ["mbelshe@chromium.org", "mike@belshe.com"]),
+ Committer("Mike Fenton", ["mifenton@rim.com", "mike.fenton@torchmobile.com"], "mfenton"),
+ Committer("Mike Thole", ["mthole@mikethole.com", "mthole@apple.com"]),
+ Committer("Mikhail Naganov", "mnaganov@chromium.org"),
+ Committer("MORITA Hajime", "morrita@google.com", "morrita"),
+ Committer("Nico Weber", ["thakis@chromium.org", "thakis@google.com"], "thakis"),
+ Committer("Noam Rosenthal", "noam.rosenthal@nokia.com", "noamr"),
+ Committer("Pam Greene", "pam@chromium.org", "pamg"),
+ Committer("Patrick Gansterer", ["paroga@paroga.com", "paroga@webkit.org"], "paroga"),
+ Committer("Pavel Podivilov", "podivilov@chromium.org", "podivilov"),
+ Committer("Peter Kasting", ["pkasting@google.com", "pkasting@chromium.org"], "pkasting"),
+ Committer("Philippe Normand", ["pnormand@igalia.com", "philn@webkit.org"], "philn-tp"),
+ Committer("Pierre d'Herbemont", ["pdherbemont@free.fr", "pdherbemont@apple.com"], "pdherbemont"),
+ Committer("Pierre-Olivier Latour", "pol@apple.com", "pol"),
+ Committer("Renata Hodovan", "reni@webkit.org", "reni"),
+ Committer("Robert Hogan", ["robert@webkit.org", "robert@roberthogan.net", "lists@roberthogan.net"], "mwenge"),
+ Committer("Roland Steiner", "rolandsteiner@chromium.org"),
+ Committer("Ryosuke Niwa", "rniwa@webkit.org", "rniwa"),
+ Committer("Satish Sampath", "satish@chromium.org"),
+ Committer("Scott Violet", "sky@chromium.org", "sky"),
+ Committer("Stephen White", "senorblanco@chromium.org", "senorblanco"),
+ 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("Vangelis Kokkevis", "vangelis@chromium.org", "vangelis"),
+ Committer("Victor Wang", "victorw@chromium.org", "victorw"),
+ Committer("Vitaly Repeshko", "vitalyr@chromium.org"),
+ Committer("William Siegrist", "wsiegrist@apple.com", "wms"),
+ Committer("Xiaomei Ji", "xji@chromium.org", "xji"),
+ Committer("Yael Aharon", "yael.aharon@nokia.com"),
+ Committer("Yaar Schnitman", ["yaar@chromium.org", "yaar@google.com"]),
+ Committer("Yong Li", ["yong.li.webkit@gmail.com", "yong.li@torchmobile.com"], "yong"),
+ Committer("Yongjun Zhang", "yongjun.zhang@nokia.com"),
+ Committer("Yuta Kitamura", "yutak@chromium.org", "yutak"),
+ Committer("Yuzo Fujishima", "yuzo@google.com", "yuzo"),
+ Committer("Zhenyao Mo", "zmo@google.com", "zhenyao"),
+ Committer("Zoltan Herczeg", "zherczeg@webkit.org", "zherczeg"),
+ Committer("Zoltan Horvath", ["zoltan@webkit.org", "hzoltan@inf.u-szeged.hu", "horvath.zoltan.6@stud.u-szeged.hu"], "zoltan"),
+]
+
+
+# This is intended as a canonical, machine-readable list of all reviewers for
+# WebKit. If your name is missing here and you are a reviewer, please add it.
+# No review needed.
+
+
+reviewers_list = [
+ Reviewer("Ada Chan", "adachan@apple.com", "chanada"),
+ Reviewer("Adam Barth", "abarth@webkit.org", "abarth"),
+ Reviewer("Adam Roben", "aroben@apple.com", "aroben"),
+ Reviewer("Adam Treat", ["treat@kde.org", "treat@webkit.org", "atreat@rim.com"], "manyoso"),
+ Reviewer("Adele Peterson", "adele@apple.com", "adele"),
+ Reviewer("Alexey Proskuryakov", ["ap@webkit.org", "ap@apple.com"], "ap"),
+ Reviewer("Alice Liu", "alice.liu@apple.com", "aliu"),
+ Reviewer("Alp Toker", ["alp@nuanti.com", "alp@atoker.com", "alp@webkit.org"], "alp"),
+ Reviewer("Anders Carlsson", ["andersca@apple.com", "acarlsson@apple.com"], "andersca"),
+ Reviewer("Andreas Kling", ["kling@webkit.org", "andreas.kling@nokia.com"], "kling"),
+ Reviewer("Antonio Gomes", ["tonikitoo@webkit.org", "agomes@rim.com"], "tonikitoo"),
+ Reviewer("Antti Koivisto", ["koivisto@iki.fi", "antti@apple.com", "antti.j.koivisto@nokia.com"], "anttik"),
+ Reviewer("Ariya Hidayat", ["ariya.hidayat@gmail.com", "ariya@sencha.com", "ariya@webkit.org"], "ariya"),
+ Reviewer("Beth Dakin", "bdakin@apple.com", "dethbakin"),
+ Reviewer("Brady Eidson", "beidson@apple.com", "bradee-oh"),
+ Reviewer("Cameron Zwarich", ["zwarich@apple.com", "cwzwarich@apple.com", "cwzwarich@webkit.org"]),
+ Reviewer("Chris Blumenberg", "cblu@apple.com", "cblu"),
+ Reviewer("Chris Marrin", "cmarrin@apple.com", "cmarrin"),
+ Reviewer("Chris Fleizach", "cfleizach@apple.com", "cfleizach"),
+ Reviewer("Chris Jerdonek", "cjerdonek@webkit.org", "cjerdonek"),
+ Reviewer(u"Csaba Osztrogon\u00e1c", "ossy@webkit.org", "ossy"),
+ Reviewer("Dan Bernstein", ["mitz@webkit.org", "mitz@apple.com"], "mitzpettel"),
+ Reviewer("Daniel Bates", "dbates@webkit.org", "dydz"),
+ Reviewer("Darin Adler", "darin@apple.com", "darin"),
+ Reviewer("Darin Fisher", ["fishd@chromium.org", "darin@chromium.org"], "fishd"),
+ Reviewer("David Harrison", "harrison@apple.com", "harrison"),
+ Reviewer("David Hyatt", "hyatt@apple.com", "hyatt"),
+ Reviewer("David Kilzer", ["ddkilzer@webkit.org", "ddkilzer@apple.com"], "ddkilzer"),
+ Reviewer("David Levin", "levin@chromium.org", "dave_levin"),
+ Reviewer("Dimitri Glazkov", "dglazkov@chromium.org", "dglazkov"),
+ 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"),
+ Reviewer("Geoffrey Garen", "ggaren@apple.com", "ggaren"),
+ Reviewer("George Staikos", ["staikos@kde.org", "staikos@webkit.org"]),
+ Reviewer("Gustavo Noronha Silva", ["gns@gnome.org", "kov@webkit.org", "gustavo.noronha@collabora.co.uk"], "kov"),
+ Reviewer("Holger Freyther", ["zecke@selfish.org", "zecke@webkit.org"], "zecke"),
+ Reviewer("James Robinson", ["jamesr@chromium.org", "jamesr@google.com"], "jamesr"),
+ Reviewer("Jan Alonzo", ["jmalonzo@gmail.com", "jmalonzo@webkit.org"], "janm"),
+ Reviewer("Jeremy Orlow", "jorlow@chromium.org", "jorlow"),
+ Reviewer("Jian Li", "jianli@chromium.org", "jianli"),
+ Reviewer("John Sullivan", "sullivan@apple.com", "sullivan"),
+ Reviewer("Jon Honeycutt", "jhoneycutt@apple.com", "jhoneycutt"),
+ Reviewer("Joseph Pecoraro", ["joepeck@webkit.org", "pecoraro@apple.com"], "JoePeck"),
+ Reviewer("Justin Garcia", "justin.garcia@apple.com", "justing"),
+ Reviewer("Ken Kocienda", "kocienda@apple.com"),
+ Reviewer("Kenneth Rohde Christiansen", ["kenneth@webkit.org", "kenneth.christiansen@openbossa.org", "kenneth.christiansen@gmail.com"], "kenne"),
+ Reviewer("Kenneth Russell", "kbr@google.com", "kbr_google"),
+ Reviewer("Kent Tamura", "tkent@chromium.org", "tkent"),
+ Reviewer("Kevin Decker", "kdecker@apple.com", "superkevin"),
+ Reviewer("Kevin McCullough", "kmccullough@apple.com", "maculloch"),
+ Reviewer("Kevin Ollivier", ["kevino@theolliviers.com", "kevino@webkit.org"], "kollivier"),
+ Reviewer("Lars Knoll", ["lars@trolltech.com", "lars@kde.org", "lars.knoll@nokia.com"], "lars"),
+ Reviewer("Laszlo Gombos", "laszlo.1.gombos@nokia.com", "lgombos"),
+ Reviewer("Maciej Stachowiak", "mjs@apple.com", "othermaciej"),
+ Reviewer("Mark Rowe", "mrowe@apple.com", "bdash"),
+ Reviewer("Martin Robinson", ["mrobinson@webkit.org", "mrobinson@igalia.com", "martin.james.robinson@gmail.com"], "mrobinson"),
+ Reviewer("Nate Chapin", "japhet@chromium.org", "japhet"),
+ Reviewer("Nikolas Zimmermann", ["zimmermann@kde.org", "zimmermann@physik.rwth-aachen.de", "zimmermann@webkit.org"], "wildfox"),
+ Reviewer("Ojan Vafai", "ojan@chromium.org", "ojan"),
+ Reviewer("Oliver Hunt", "oliver@apple.com", "olliej"),
+ Reviewer("Pavel Feldman", "pfeldman@chromium.org", "pfeldman"),
+ Reviewer("Richard Williamson", "rjw@apple.com", "rjw"),
+ Reviewer("Rob Buis", ["rwlbuis@gmail.com", "rwlbuis@webkit.org"], "rwlbuis"),
+ Reviewer("Sam Weinig", ["sam@webkit.org", "weinig@apple.com"], "weinig"),
+ Reviewer("Shinichiro Hamaji", "hamaji@chromium.org", "hamaji"),
+ Reviewer("Simon Fraser", "simon.fraser@apple.com", "smfr"),
+ Reviewer("Simon Hausmann", ["hausmann@webkit.org", "hausmann@kde.org", "simon.hausmann@nokia.com"], "tronical"),
+ Reviewer("Stephanie Lewis", "slewis@apple.com", "sundiamonde"),
+ Reviewer("Steve Block", "steveblock@google.com", "steveblock"),
+ Reviewer("Steve Falkenburg", "sfalken@apple.com", "sfalken"),
+ Reviewer("Tim Omernick", "timo@apple.com"),
+ Reviewer("Timothy Hatcher", ["timothy@apple.com", "timothy@hatcher.name"], "xenon"),
+ Reviewer("Tony Chang", "tony@chromium.org", "tony^work"),
+ Reviewer(u"Tor Arne Vestb\u00f8", ["vestbo@webkit.org", "tor.arne.vestbo@nokia.com"], "torarne"),
+ Reviewer("Vicki Murley", "vicki@apple.com"),
+ Reviewer("Xan Lopez", ["xan.lopez@gmail.com", "xan@gnome.org", "xan@webkit.org"], "xan"),
+ Reviewer("Yury Semikhatsky", "yurys@chromium.org", "yurys"),
+ Reviewer("Zack Rusin", "zack@kde.org", "zackr"),
+]
+
+
+class CommitterList:
+
+ # Committers and reviewers are passed in to allow easy testing
+
+ def __init__(self,
+ committers=committers_unable_to_review,
+ reviewers=reviewers_list):
+ self._committers = committers + reviewers
+ self._reviewers = reviewers
+ self._committers_by_email = {}
+
+ def committers(self):
+ return self._committers
+
+ def reviewers(self):
+ return self._reviewers
+
+ def _email_to_committer_map(self):
+ if not len(self._committers_by_email):
+ for committer in self._committers:
+ for email in committer.emails:
+ self._committers_by_email[email] = committer
+ return self._committers_by_email
+
+ def committer_by_name(self, name):
+ # This could be made into a hash lookup if callers need it to be fast.
+ for committer in self.committers():
+ if committer.full_name == name:
+ return committer
+
+ def committer_by_email(self, email):
+ return self._email_to_committer_map().get(email)
+
+ def reviewer_by_email(self, email):
+ committer = self.committer_by_email(email)
+ if committer and not committer.can_review:
+ return None
+ return committer
diff --git a/WebKitTools/Scripts/webkitpy/committers_unittest.py b/WebKitTools/Scripts/webkitpy/common/config/committers_unittest.py
index f5dc539..068c0ee 100644
--- a/WebKitTools/Scripts/webkitpy/committers_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers_unittest.py
@@ -27,12 +27,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import unittest
-from committers import CommitterList, Committer, Reviewer
+from webkitpy.common.config.committers import CommitterList, Committer, Reviewer
class CommittersTest(unittest.TestCase):
def test_committer_lookup(self):
- committer = Committer('Test One', 'one@test.com')
+ committer = Committer('Test One', 'one@test.com', 'one')
reviewer = Reviewer('Test Two', ['two@test.com', 'two@rad.com', 'so_two@gmail.com'])
committer_list = CommitterList(committers=[committer], reviewers=[reviewer])
@@ -43,6 +43,11 @@ class CommittersTest(unittest.TestCase):
self.assertEqual(committer_list.committer_by_email('two@rad.com'), reviewer)
self.assertEqual(committer_list.reviewer_by_email('so_two@gmail.com'), reviewer)
+ # Test valid committer and reviewer lookup
+ self.assertEqual(committer_list.committer_by_name("Test One"), committer)
+ self.assertEqual(committer_list.committer_by_name("Test Two"), reviewer)
+ self.assertEqual(committer_list.committer_by_name("Test Three"), None)
+
# Test that the first email is assumed to be the Bugzilla email address (for now)
self.assertEqual(committer_list.committer_by_email('two@rad.com').bugzilla_email(), 'two@test.com')
@@ -56,6 +61,8 @@ class CommittersTest(unittest.TestCase):
# Test that emails returns a list.
self.assertEqual(committer.emails, ['one@test.com'])
+ self.assertEqual(committer.irc_nickname, 'one')
+
# Test that committers returns committers and reviewers and reviewers() just reviewers.
self.assertEqual(committer_list.committers(), [committer, reviewer])
self.assertEqual(committer_list.reviewers(), [reviewer])
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committervalidator.py b/WebKitTools/Scripts/webkitpy/common/config/committervalidator.py
new file mode 100644
index 0000000..b7b2990
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/committervalidator.py
@@ -0,0 +1,120 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 Apple Inc. All rights reserved.
+# Copyright (c) 2010 Research In Motion Limited. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+
+from webkitpy.common.system.ospath import relpath
+from webkitpy.common.config import committers
+
+
+class CommitterValidator(object):
+
+ def __init__(self, bugzilla):
+ self._bugzilla = bugzilla
+
+ # _view_source_url belongs in some sort of webkit_config.py module.
+ def _view_source_url(self, local_path):
+ return "http://trac.webkit.org/browser/trunk/%s" % local_path
+
+ def _checkout_root(self):
+ # FIXME: This is a hack, we would have this from scm.checkout_root
+ # if we had any way to get to an scm object here.
+ components = __file__.split(os.sep)
+ tools_index = components.index("WebKitTools")
+ return os.sep.join(components[:tools_index])
+
+ def _committers_py_path(self):
+ # extension can sometimes be .pyc, we always want .py
+ (path, extension) = os.path.splitext(committers.__file__)
+ # FIXME: When we're allowed to use python 2.6 we can use the real
+ # os.path.relpath
+ path = relpath(path, self._checkout_root())
+ return ".".join([path, "py"])
+
+ def _flag_permission_rejection_message(self, setter_email, flag_name):
+ # Should come from some webkit_config.py
+ contribution_guidlines = "http://webkit.org/coding/contributing.html"
+ # This could be queried from the status_server.
+ queue_administrator = "eseidel@chromium.org"
+ # This could be queried from the tool.
+ queue_name = "commit-queue"
+ committers_list = self._committers_py_path()
+ message = "%s does not have %s permissions according to %s." % (
+ setter_email,
+ flag_name,
+ self._view_source_url(committers_list))
+ message += "\n\n- If you do not have %s rights please read %s for instructions on how to use bugzilla flags." % (
+ flag_name, contribution_guidlines)
+ message += "\n\n- If you have %s rights please correct the error in %s by adding yourself to the file (no review needed). " % (
+ flag_name, committers_list)
+ message += "The %s restarts itself every 2 hours. After restart the %s will correctly respect your %s rights." % (
+ queue_name, queue_name, flag_name)
+ return message
+
+ def _validate_setter_email(self, patch, result_key, rejection_function):
+ committer = getattr(patch, result_key)()
+ # If the flag is set, and we don't recognize the setter, reject the
+ # flag!
+ setter_email = patch._attachment_dictionary.get("%s_email" % result_key)
+ if setter_email and not committer:
+ rejection_function(patch.id(),
+ self._flag_permission_rejection_message(setter_email,
+ result_key))
+ return False
+ return True
+
+ def _reject_patch_if_flags_are_invalid(self, patch):
+ return (self._validate_setter_email(
+ patch, "reviewer", self.reject_patch_from_review_queue)
+ and self._validate_setter_email(
+ patch, "committer", self.reject_patch_from_commit_queue))
+
+ def patches_after_rejecting_invalid_commiters_and_reviewers(self, patches):
+ return [patch for patch in patches if self._reject_patch_if_flags_are_invalid(patch)]
+
+ def reject_patch_from_commit_queue(self,
+ attachment_id,
+ additional_comment_text=None):
+ comment_text = "Rejecting patch %s from commit-queue." % attachment_id
+ self._bugzilla.set_flag_on_attachment(attachment_id,
+ "commit-queue",
+ "-",
+ comment_text,
+ additional_comment_text)
+
+ def reject_patch_from_review_queue(self,
+ attachment_id,
+ additional_comment_text=None):
+ comment_text = "Rejecting patch %s from review queue." % attachment_id
+ self._bugzilla.set_flag_on_attachment(attachment_id,
+ 'review',
+ '-',
+ comment_text,
+ additional_comment_text)
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committervalidator_unittest.py b/WebKitTools/Scripts/webkitpy/common/config/committervalidator_unittest.py
new file mode 100644
index 0000000..61fa3bf
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/config/committervalidator_unittest.py
@@ -0,0 +1,43 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from .committervalidator import CommitterValidator
+
+
+class CommitterValidatorTest(unittest.TestCase):
+ def test_flag_permission_rejection_message(self):
+ validator = CommitterValidator(bugzilla=None)
+ self.assertEqual(validator._committers_py_path(), "WebKitTools/Scripts/webkitpy/common/config/committers.py")
+ expected_messsage = """foo@foo.com does not have review permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.
+
+- If you do not have review rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
+
+- If you have review rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your review rights."""
+ self.assertEqual(validator._flag_permission_rejection_message("foo@foo.com", "review"), expected_messsage)
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py b/WebKitTools/Scripts/webkitpy/common/config/irc.py
index 26352eb..950c573 100644
--- a/WebKitTools/pywebsocket/test/testdata/handlers/sub/non_callable_wsh.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/irc.py
@@ -1,5 +1,4 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -27,13 +26,6 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Non-callable handlers.
-"""
-
-
-web_socket_do_extra_handshake = True
-web_socket_transfer_data = 1
-
-
-# vi:sts=4 sw=4 et
+server="irc.freenode.net"
+port=6667
+channel="#webkit"
diff --git a/WebKitTools/Scripts/webkitpy/webkitport.py b/WebKitTools/Scripts/webkitpy/common/config/ports.py
index cd60a54..d268865 100644
--- a/WebKitTools/Scripts/webkitpy/webkitport.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/ports.py
@@ -29,9 +29,9 @@
# WebKit's Python module for understanding the various ports
import os
+import platform
-from optparse import make_option
-from webkitpy.executive import Executive
+from webkitpy.common.system.executive import Executive
class WebKitPort(object):
@@ -45,12 +45,26 @@ class WebKitPort(object):
def port(port_name):
ports = {
"chromium": ChromiumPort,
+ "chromium-xvfb": ChromiumXVFBPort,
"gtk": GtkPort,
"mac": MacPort,
+ "win": WinPort,
"qt": QtPort,
+ "efl": EflPort,
}
- # FIXME: We should default to WinPort on Windows.
- return ports.get(port_name, MacPort)
+ default_port = {
+ "Windows": WinPort,
+ "Darwin": MacPort,
+ }
+ # Do we really need MacPort as the ultimate default?
+ return ports.get(port_name, default_port.get(platform.system(), MacPort))
+
+ @staticmethod
+ def makeArgs():
+ args = '--makeargs="-j%s"' % Executive().cpu_count()
+ if os.environ.has_key('MAKEFLAGS'):
+ args = '--makeargs="%s"' % os.environ['MAKEFLAGS']
+ return args
@classmethod
def name(cls):
@@ -89,6 +103,10 @@ class WebKitPort(object):
def run_perl_unittests_command(cls):
return [cls.script_path("test-webkitperl")]
+ @classmethod
+ def layout_tests_results_path(cls):
+ return "/tmp/layout-test-results/results.html"
+
class MacPort(WebKitPort):
@@ -100,6 +118,28 @@ class MacPort(WebKitPort):
def flag(cls):
return "--port=mac"
+ @classmethod
+ def _system_version(cls):
+ version_string = platform.mac_ver()[0] # e.g. "10.5.6"
+ version_tuple = version_string.split('.')
+ return map(int, version_tuple)
+
+ @classmethod
+ def is_leopard(cls):
+ return tuple(cls._system_version()[:2]) == (10, 5)
+
+
+class WinPort(WebKitPort):
+
+ @classmethod
+ def name(cls):
+ return "Win"
+
+ @classmethod
+ def flag(cls):
+ # FIXME: This is lame. We should autogenerate this from a codename or something.
+ return "--port=win"
+
class GtkPort(WebKitPort):
@@ -115,7 +155,7 @@ class GtkPort(WebKitPort):
def build_webkit_command(cls, build_style=None):
command = WebKitPort.build_webkit_command(build_style=build_style)
command.append("--gtk")
- command.append('--makeargs="-j%s"' % Executive.cpu_count())
+ command.append(WebKitPort.makeArgs())
return command
@classmethod
@@ -139,7 +179,25 @@ class QtPort(WebKitPort):
def build_webkit_command(cls, build_style=None):
command = WebKitPort.build_webkit_command(build_style=build_style)
command.append("--qt")
- command.append('--makeargs="-j%s"' % Executive.cpu_count())
+ command.append(WebKitPort.makeArgs())
+ return command
+
+
+class EflPort(WebKitPort):
+
+ @classmethod
+ def name(cls):
+ return "Efl"
+
+ @classmethod
+ def flag(cls):
+ return "--port=efl"
+
+ @classmethod
+ def build_webkit_command(cls, build_style=None):
+ command = WebKitPort.build_webkit_command(build_style=build_style)
+ command.append("--efl")
+ command.append(WebKitPort.makeArgs())
return command
@@ -164,3 +222,28 @@ class ChromiumPort(WebKitPort):
command = WebKitPort.build_webkit_command(build_style=build_style)
command.append("--chromium")
return command
+
+ @classmethod
+ def run_webkit_tests_command(cls):
+ return [
+ cls.script_path("new-run-webkit-tests"),
+ "--chromium",
+ "--use-drt",
+ "--no-pixel-tests",
+ ]
+
+ @classmethod
+ def run_javascriptcore_tests_command(cls):
+ return None
+
+
+class ChromiumXVFBPort(ChromiumPort):
+
+ @classmethod
+ def flag(cls):
+ return "--port=chromium-xvfb"
+
+ @classmethod
+ def run_webkit_tests_command(cls):
+ # FIXME: We should find a better way to do this.
+ return ["xvfb-run"] + ChromiumPort.run_webkit_tests_command()
diff --git a/WebKitTools/Scripts/webkitpy/webkitport_unittest.py b/WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py
index 202234f..3bdf0e6 100644
--- a/WebKitTools/Scripts/webkitpy/webkitport_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/ports_unittest.py
@@ -29,8 +29,7 @@
import unittest
-from webkitpy.executive import Executive
-from webkitpy.webkitport import WebKitPort, MacPort, GtkPort, QtPort, ChromiumPort
+from webkitpy.common.config.ports import *
class WebKitPortTest(unittest.TestCase):
@@ -42,28 +41,36 @@ class WebKitPortTest(unittest.TestCase):
self.assertEquals(MacPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug"])
self.assertEquals(MacPort.build_webkit_command(build_style="release"), [WebKitPort.script_path("build-webkit"), "--release"])
+ class TestIsLeopard(MacPort):
+ @classmethod
+ def _system_version(cls):
+ return [10, 5]
+ self.assertTrue(TestIsLeopard.is_leopard())
+
def test_gtk_port(self):
self.assertEquals(GtkPort.name(), "Gtk")
self.assertEquals(GtkPort.flag(), "--port=gtk")
self.assertEquals(GtkPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests"), "--gtk"])
- self.assertEquals(GtkPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--gtk", '--makeargs="-j%s"' % Executive.cpu_count()])
- self.assertEquals(GtkPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--gtk", '--makeargs="-j%s"' % Executive.cpu_count()])
+ self.assertEquals(GtkPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--gtk", WebKitPort.makeArgs()])
+ self.assertEquals(GtkPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--gtk", WebKitPort.makeArgs()])
def test_qt_port(self):
self.assertEquals(QtPort.name(), "Qt")
self.assertEquals(QtPort.flag(), "--port=qt")
self.assertEquals(QtPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
- self.assertEquals(QtPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--qt", '--makeargs="-j%s"' % Executive.cpu_count()])
- self.assertEquals(QtPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--qt", '--makeargs="-j%s"' % Executive.cpu_count()])
+ self.assertEquals(QtPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--qt", WebKitPort.makeArgs()])
+ self.assertEquals(QtPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--qt", WebKitPort.makeArgs()])
def test_chromium_port(self):
self.assertEquals(ChromiumPort.name(), "Chromium")
self.assertEquals(ChromiumPort.flag(), "--port=chromium")
- self.assertEquals(ChromiumPort.run_webkit_tests_command(), [WebKitPort.script_path("run-webkit-tests")])
+ self.assertEquals(ChromiumPort.run_webkit_tests_command(), [WebKitPort.script_path("new-run-webkit-tests"), "--chromium", "--use-drt", "--no-pixel-tests"])
self.assertEquals(ChromiumPort.build_webkit_command(), [WebKitPort.script_path("build-webkit"), "--chromium"])
self.assertEquals(ChromiumPort.build_webkit_command(build_style="debug"), [WebKitPort.script_path("build-webkit"), "--debug", "--chromium"])
self.assertEquals(ChromiumPort.update_webkit_command(), [WebKitPort.script_path("update-webkit"), "--chromium"])
+ def test_chromium_xvfb_port(self):
+ self.assertEquals(ChromiumXVFBPort.run_webkit_tests_command(), ["xvfb-run", "WebKitTools/Scripts/new-run-webkit-tests", "--chromium", "--use-drt", "--no-pixel-tests"])
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/pywebsocket/test/test_util.py b/WebKitTools/Scripts/webkitpy/common/memoized.py
index 83e2635..dc844a5 100644
--- a/WebKitTools/pywebsocket/test/test_util.py
+++ b/WebKitTools/Scripts/webkitpy/common/memoized.py
@@ -1,7 +1,4 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
+# Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -29,35 +26,30 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Python does not (yet) seem to provide automatic memoization. So we've
+# written a small decorator to do so.
-"""Tests for util module."""
-
+import functools
-import unittest
-import config # This must be imported before mod_pywebsocket.
-from mod_pywebsocket import util
+class memoized(object):
+ def __init__(self, function):
+ self._function = function
+ self._results_cache = {}
-
-class UtilTest(unittest.TestCase):
- def test_get_stack_trace(self):
- self.assertEqual('None\n', util.get_stack_trace())
+ def __call__(self, *args):
try:
- a = 1 / 0 # Intentionally raise exception.
- except Exception:
- trace = util.get_stack_trace()
- self.failUnless(trace.startswith('Traceback'))
- self.failUnless(trace.find('ZeroDivisionError') != -1)
-
- def test_prepend_message_to_exception(self):
- exc = Exception('World')
- self.assertEqual('World', str(exc))
- util.prepend_message_to_exception('Hello ', exc)
- self.assertEqual('Hello World', str(exc))
-
-
-if __name__ == '__main__':
- unittest.main()
-
-
-# vi:sts=4 sw=4 et
+ return self._results_cache[args]
+ except KeyError:
+ # If we didn't find the args in our cache, call and save the results.
+ result = self._function(*args)
+ self._results_cache[args] = result
+ return result
+ # FIXME: We may need to handle TypeError here in the case
+ # that "args" is not a valid dictionary key.
+
+ # Use python "descriptor" protocol __get__ to appear
+ # invisible during property access.
+ def __get__(self, instance, owner):
+ # Return a function partial with obj already bound as self.
+ return functools.partial(self.__call__, instance)
diff --git a/WebKitTools/Scripts/webkitpy/patchcollection_unittest.py b/WebKitTools/Scripts/webkitpy/common/memoized_unittest.py
index 811fed9..dd7c793 100644
--- a/WebKitTools/Scripts/webkitpy/patchcollection_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/memoized_unittest.py
@@ -1,10 +1,9 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
-#
+#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
@@ -14,7 +13,7 @@
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
-#
+#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -29,25 +28,38 @@
import unittest
-from webkitpy.mock import Mock
-from webkitpy.patchcollection import PersistentPatchCollection, PersistentPatchCollectionDelegate
+from webkitpy.common.memoized import memoized
-class TestPersistentPatchCollectionDelegate(PersistentPatchCollectionDelegate):
- def collection_name(self):
- return "test-collection"
+class _TestObject(object):
+ def __init__(self):
+ self.callCount = 0
- def fetch_potential_patch_ids(self):
- return [42, 192, 87]
+ @memoized
+ def memoized_add(self, argument):
+ """testing docstring"""
+ self.callCount += 1
+ if argument is None:
+ return None # Avoid the TypeError from None + 1
+ return argument + 1
- def status_server(self):
- return Mock()
- def is_terminal_status(self, status):
- return False
+class MemoizedTest(unittest.TestCase):
+ def test_caching(self):
+ test = _TestObject()
+ test.callCount = 0
+ self.assertEqual(test.memoized_add(1), 2)
+ self.assertEqual(test.callCount, 1)
+ self.assertEqual(test.memoized_add(1), 2)
+ self.assertEqual(test.callCount, 1)
+ # Validate that callCount is working as expected.
+ self.assertEqual(test.memoized_add(2), 3)
+ self.assertEqual(test.callCount, 2)
-class PersistentPatchCollectionTest(unittest.TestCase):
- def test_next(self):
- collection = PersistentPatchCollection(TestPersistentPatchCollectionDelegate())
- collection.next()
+ def test_tearoff(self):
+ test = _TestObject()
+ # Make sure that get()/tear-offs work:
+ tearoff = test.memoized_add
+ self.assertEqual(tearoff(4), 5)
+ self.assertEqual(test.callCount, 1)
diff --git a/WebKitTools/Scripts/webkitpy/common/net/__init__.py b/WebKitTools/Scripts/webkitpy/common/net/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla/__init__.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/__init__.py
new file mode 100644
index 0000000..cfaf3b1
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/__init__.py
@@ -0,0 +1,8 @@
+# Required for Python to search this directory for module files
+
+# We only export public API here.
+# FIXME: parse_bug_id should not be a free function.
+from .bugzilla import Bugzilla, parse_bug_id
+# Unclear if Bug and Attachment need to be public classes.
+from .bug import Bug
+from .attachment import Attachment
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla/attachment.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/attachment.py
new file mode 100644
index 0000000..85761fe
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/attachment.py
@@ -0,0 +1,114 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 Apple Inc. All rights reserved.
+# Copyright (c) 2010 Research In Motion Limited. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from webkitpy.common.system.deprecated_logging import log
+
+
+class Attachment(object):
+
+ rollout_preamble = "ROLLOUT of r"
+
+ def __init__(self, attachment_dictionary, bug):
+ self._attachment_dictionary = attachment_dictionary
+ self._bug = bug
+ self._reviewer = None
+ self._committer = None
+
+ def _bugzilla(self):
+ return self._bug._bugzilla
+
+ def id(self):
+ return int(self._attachment_dictionary.get("id"))
+
+ def attacher_is_committer(self):
+ return self._bugzilla.committers.committer_by_email(
+ patch.attacher_email())
+
+ def attacher_email(self):
+ return self._attachment_dictionary.get("attacher_email")
+
+ def bug(self):
+ return self._bug
+
+ def bug_id(self):
+ return int(self._attachment_dictionary.get("bug_id"))
+
+ def is_patch(self):
+ return not not self._attachment_dictionary.get("is_patch")
+
+ def is_obsolete(self):
+ return not not self._attachment_dictionary.get("is_obsolete")
+
+ def is_rollout(self):
+ return self.name().startswith(self.rollout_preamble)
+
+ def name(self):
+ return self._attachment_dictionary.get("name")
+
+ def attach_date(self):
+ return self._attachment_dictionary.get("attach_date")
+
+ def review(self):
+ return self._attachment_dictionary.get("review")
+
+ def commit_queue(self):
+ return self._attachment_dictionary.get("commit-queue")
+
+ def url(self):
+ # FIXME: This should just return
+ # self._bugzilla().attachment_url_for_id(self.id()). scm_unittest.py
+ # depends on the current behavior.
+ return self._attachment_dictionary.get("url")
+
+ def contents(self):
+ # FIXME: We shouldn't be grabbing at _bugzilla.
+ return self._bug._bugzilla.fetch_attachment_contents(self.id())
+
+ def _validate_flag_value(self, flag):
+ email = self._attachment_dictionary.get("%s_email" % flag)
+ if not email:
+ return None
+ committer = getattr(self._bugzilla().committers,
+ "%s_by_email" % flag)(email)
+ if committer:
+ return committer
+ log("Warning, attachment %s on bug %s has invalid %s (%s)" % (
+ self._attachment_dictionary['id'],
+ self._attachment_dictionary['bug_id'], flag, email))
+
+ def reviewer(self):
+ if not self._reviewer:
+ self._reviewer = self._validate_flag_value("reviewer")
+ return self._reviewer
+
+ def committer(self):
+ if not self._committer:
+ self._committer = self._validate_flag_value("committer")
+ return self._committer
diff --git a/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug.py
new file mode 100644
index 0000000..2cb4bc8
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug.py
@@ -0,0 +1,105 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 Apple Inc. All rights reserved.
+# Copyright (c) 2010 Research In Motion Limited. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from .attachment import Attachment
+
+
+class Bug(object):
+ # FIXME: This class is kinda a hack for now. It exists so we have one
+ # place to hold bug logic, even if much of the code deals with
+ # dictionaries still.
+
+ def __init__(self, bug_dictionary, bugzilla):
+ self.bug_dictionary = bug_dictionary
+ self._bugzilla = bugzilla
+
+ def id(self):
+ return self.bug_dictionary["id"]
+
+ def title(self):
+ return self.bug_dictionary["title"]
+
+ def assigned_to_email(self):
+ return self.bug_dictionary["assigned_to_email"]
+
+ # FIXME: This information should be stored in some sort of webkit_config.py instead of here.
+ unassigned_emails = frozenset([
+ "webkit-unassigned@lists.webkit.org",
+ "webkit-qt-unassigned@trolltech.com",
+ ])
+
+ def is_unassigned(self):
+ return self.assigned_to_email() in self.unassigned_emails
+
+ def status(self):
+ return self.bug_dictionary["bug_status"]
+
+ # Bugzilla has many status states we don't really use in WebKit:
+ # https://bugs.webkit.org/page.cgi?id=fields.html#status
+ _open_states = ["UNCONFIRMED", "NEW", "ASSIGNED", "REOPENED"]
+ _closed_states = ["RESOLVED", "VERIFIED", "CLOSED"]
+
+ def is_open(self):
+ return self.status() in self._open_states
+
+ def is_closed(self):
+ return not self.is_open()
+
+ # Rarely do we actually want obsolete attachments
+ def attachments(self, include_obsolete=False):
+ attachments = self.bug_dictionary["attachments"]
+ if not include_obsolete:
+ attachments = filter(lambda attachment:
+ not attachment["is_obsolete"], attachments)
+ return [Attachment(attachment, self) for attachment in attachments]
+
+ def patches(self, include_obsolete=False):
+ return [patch for patch in self.attachments(include_obsolete)
+ if patch.is_patch()]
+
+ def unreviewed_patches(self):
+ return [patch for patch in self.patches() if patch.review() == "?"]
+
+ def reviewed_patches(self, include_invalid=False):
+ patches = [patch for patch in self.patches() if patch.review() == "+"]
+ if include_invalid:
+ return patches
+ # Checking reviewer() ensures that it was both reviewed and has a valid
+ # reviewer.
+ return filter(lambda patch: patch.reviewer(), patches)
+
+ def commit_queued_patches(self, include_invalid=False):
+ patches = [patch for patch in self.patches()
+ if patch.commit_queue() == "+"]
+ if include_invalid:
+ return patches
+ # Checking committer() ensures that it was both commit-queue+'d and has
+ # a valid committer.
+ return filter(lambda patch: patch.committer(), patches)
diff --git a/WebKitTools/Scripts/webkitpy/executive_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug_unittest.py
index f78e301..d43d64f 100644
--- a/WebKitTools/Scripts/webkitpy/executive_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bug_unittest.py
@@ -1,5 +1,4 @@
# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2009 Daniel Bates (dbates@intudata.com). All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -28,14 +27,14 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import unittest
-from webkitpy.executive import Executive, run_command
-class ExecutiveTest(unittest.TestCase):
+from .bug import Bug
- def test_run_command_with_bad_command(self):
- def run_bad_command():
- run_command(["foo_bar_command_blah"], error_handler=Executive.ignore_error, return_exit_code=True)
- self.failUnlessRaises(OSError, run_bad_command)
-if __name__ == '__main__':
- unittest.main()
+class BugTest(unittest.TestCase):
+ def test_is_unassigned(self):
+ for email in Bug.unassigned_emails:
+ bug = Bug({"assigned_to_email": email}, bugzilla=None)
+ self.assertTrue(bug.is_unassigned())
+ bug = Bug({"assigned_to_email": "test@test.com"}, bugzilla=None)
+ self.assertFalse(bug.is_unassigned())
diff --git a/WebKitTools/Scripts/webkitpy/bugzilla.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
index 4506af2..9fa7fe5 100644
--- a/WebKitTools/Scripts/webkitpy/bugzilla.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla.py
@@ -30,25 +30,27 @@
#
# WebKit's Python module for interacting with Bugzilla
+import os.path
import re
-import subprocess
+import StringIO
from datetime import datetime # used in timestamp()
-# Import WebKit-specific modules.
-from webkitpy.webkit_logging import error, log
-from webkitpy.committers import CommitterList
-from webkitpy.credentials import Credentials
-from webkitpy.user import User
+from .attachment import Attachment
+from .bug import Bug
-# WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy
-# so this import should always succeed.
-from .BeautifulSoup import BeautifulSoup, SoupStrainer
-
-from mechanize import Browser
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.config import committers
+from webkitpy.common.net.credentials import Credentials
+from webkitpy.common.system.user import User
+from webkitpy.thirdparty.autoinstalled.mechanize import Browser
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, SoupStrainer
+# FIXME: parse_bug_id should not be a free function.
def parse_bug_id(message):
+ if not message:
+ return None
match = re.search("http\://webkit\.org/b/(?P<bug_id>\d+)", message)
if match:
return int(match.group('bug_id'))
@@ -64,125 +66,6 @@ def timestamp():
return datetime.now().strftime("%Y%m%d%H%M%S")
-class Attachment(object):
-
- def __init__(self, attachment_dictionary, bug):
- self._attachment_dictionary = attachment_dictionary
- self._bug = bug
- self._reviewer = None
- self._committer = None
-
- def _bugzilla(self):
- return self._bug._bugzilla
-
- def id(self):
- return int(self._attachment_dictionary.get("id"))
-
- def attacher_is_committer(self):
- return self._bugzilla.committers.committer_by_email(
- patch.attacher_email())
-
- def attacher_email(self):
- return self._attachment_dictionary.get("attacher_email")
-
- def bug(self):
- return self._bug
-
- def bug_id(self):
- return int(self._attachment_dictionary.get("bug_id"))
-
- def is_patch(self):
- return not not self._attachment_dictionary.get("is_patch")
-
- def is_obsolete(self):
- return not not self._attachment_dictionary.get("is_obsolete")
-
- def name(self):
- return self._attachment_dictionary.get("name")
-
- def review(self):
- return self._attachment_dictionary.get("review")
-
- def commit_queue(self):
- return self._attachment_dictionary.get("commit-queue")
-
- def url(self):
- # FIXME: This should just return
- # self._bugzilla().attachment_url_for_id(self.id()). scm_unittest.py
- # depends on the current behavior.
- return self._attachment_dictionary.get("url")
-
- def _validate_flag_value(self, flag):
- email = self._attachment_dictionary.get("%s_email" % flag)
- if not email:
- return None
- committer = getattr(self._bugzilla().committers,
- "%s_by_email" % flag)(email)
- if committer:
- return committer
- log("Warning, attachment %s on bug %s has invalid %s (%s)" % (
- self._attachment_dictionary['id'],
- self._attachment_dictionary['bug_id'], flag, email))
-
- def reviewer(self):
- if not self._reviewer:
- self._reviewer = self._validate_flag_value("reviewer")
- return self._reviewer
-
- def committer(self):
- if not self._committer:
- self._committer = self._validate_flag_value("committer")
- return self._committer
-
-
-class Bug(object):
- # FIXME: This class is kinda a hack for now. It exists so we have one
- # place to hold bug logic, even if much of the code deals with
- # dictionaries still.
-
- def __init__(self, bug_dictionary, bugzilla):
- self.bug_dictionary = bug_dictionary
- self._bugzilla = bugzilla
-
- def id(self):
- return self.bug_dictionary["id"]
-
- def assigned_to_email(self):
- return self.bug_dictionary["assigned_to_email"]
-
- # Rarely do we actually want obsolete attachments
- def attachments(self, include_obsolete=False):
- attachments = self.bug_dictionary["attachments"]
- if not include_obsolete:
- attachments = filter(lambda attachment:
- not attachment["is_obsolete"], attachments)
- return [Attachment(attachment, self) for attachment in attachments]
-
- def patches(self, include_obsolete=False):
- return [patch for patch in self.attachments(include_obsolete)
- if patch.is_patch()]
-
- def unreviewed_patches(self):
- return [patch for patch in self.patches() if patch.review() == "?"]
-
- def reviewed_patches(self, include_invalid=False):
- patches = [patch for patch in self.patches() if patch.review() == "+"]
- if include_invalid:
- return patches
- # Checking reviewer() ensures that it was both reviewed and has a valid
- # reviewer.
- return filter(lambda patch: patch.reviewer(), patches)
-
- def commit_queued_patches(self, include_invalid=False):
- patches = [patch for patch in self.patches()
- if patch.commit_queue() == "+"]
- if include_invalid:
- return patches
- # Checking committer() ensures that it was both commit-queue+'d and has
- # a valid committer.
- return filter(lambda patch: patch.committer(), patches)
-
-
# A container for all of the logic for making and parsing buzilla queries.
class BugzillaQueries(object):
@@ -218,6 +101,14 @@ class BugzillaQueries(object):
def _fetch_attachment_ids_request_query(self, query):
return self._parse_attachment_ids_request_query(self._load_query(query))
+ def _parse_quips(self, page):
+ soup = BeautifulSoup(page, convertEntities=BeautifulSoup.HTML_ENTITIES)
+ quips = soup.find(text=re.compile(r"Existing quips:")).findNext("ul").findAll("li")
+ return [unicode(quip_entry.string) for quip_entry in quips]
+
+ def fetch_quips(self):
+ return self._parse_quips(self._load_query("/quips.cgi?action=show"))
+
# List of all r+'d bugs.
def fetch_bug_ids_from_pending_commit_list(self):
needs_commit_query_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review%2B"
@@ -237,107 +128,31 @@ class BugzillaQueries(object):
return sum([self._fetch_bug(bug_id).commit_queued_patches()
for bug_id in self.fetch_bug_ids_from_commit_queue()], [])
- def _fetch_bug_ids_from_review_queue(self):
+ def fetch_bug_ids_from_review_queue(self):
review_queue_url = "buglist.cgi?query_format=advanced&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&field0-0-0=flagtypes.name&type0-0-0=equals&value0-0-0=review?"
return self._fetch_bug_ids_advanced_query(review_queue_url)
+ # This method will make several requests to bugzilla.
def fetch_patches_from_review_queue(self, limit=None):
# [:None] returns the whole array.
return sum([self._fetch_bug(bug_id).unreviewed_patches()
- for bug_id in self._fetch_bug_ids_from_review_queue()[:limit]], [])
-
- # FIXME: Why do we have both fetch_patches_from_review_queue and
- # fetch_attachment_ids_from_review_queue??
- # NOTE: This is also the only client of _fetch_attachment_ids_request_query
+ for bug_id in self.fetch_bug_ids_from_review_queue()[:limit]], [])
+ # NOTE: This is the only client of _fetch_attachment_ids_request_query
+ # This method only makes one request to bugzilla.
def fetch_attachment_ids_from_review_queue(self):
review_queue_url = "request.cgi?action=queue&type=review&group=type"
return self._fetch_attachment_ids_request_query(review_queue_url)
-class CommitterValidator(object):
-
- def __init__(self, bugzilla):
- self._bugzilla = bugzilla
-
- # _view_source_url belongs in some sort of webkit_config.py module.
- def _view_source_url(self, local_path):
- return "http://trac.webkit.org/browser/trunk/%s" % local_path
-
- def _flag_permission_rejection_message(self, setter_email, flag_name):
- # This could be computed from CommitterList.__file__
- committer_list = "WebKitTools/Scripts/webkitpy/committers.py"
- # Should come from some webkit_config.py
- contribution_guidlines = "http://webkit.org/coding/contributing.html"
- # This could be queried from the status_server.
- queue_administrator = "eseidel@chromium.org"
- # This could be queried from the tool.
- queue_name = "commit-queue"
- message = "%s does not have %s permissions according to %s." % (
- setter_email,
- flag_name,
- self._view_source_url(committer_list))
- message += "\n\n- If you do not have %s rights please read %s for instructions on how to use bugzilla flags." % (
- flag_name, contribution_guidlines)
- message += "\n\n- If you have %s rights please correct the error in %s by adding yourself to the file (no review needed). " % (
- flag_name, committer_list)
- message += "Due to bug 30084 the %s will require a restart after your change. " % queue_name
- message += "Please contact %s to request a %s restart. " % (
- queue_administrator, queue_name)
- message += "After restart the %s will correctly respect your %s rights." % (
- queue_name, flag_name)
- return message
-
- def _validate_setter_email(self, patch, result_key, rejection_function):
- committer = getattr(patch, result_key)()
- # If the flag is set, and we don't recognize the setter, reject the
- # flag!
- setter_email = patch._attachment_dictionary.get("%s_email" % result_key)
- if setter_email and not committer:
- rejection_function(patch.id(),
- self._flag_permission_rejection_message(setter_email,
- result_key))
- return False
- return True
-
- def patches_after_rejecting_invalid_commiters_and_reviewers(self, patches):
- validated_patches = []
- for patch in patches:
- if (self._validate_setter_email(
- patch, "reviewer", self.reject_patch_from_review_queue)
- and self._validate_setter_email(
- patch, "committer", self.reject_patch_from_commit_queue)):
- validated_patches.append(patch)
- return validated_patches
-
- def reject_patch_from_commit_queue(self,
- attachment_id,
- additional_comment_text=None):
- comment_text = "Rejecting patch %s from commit-queue." % attachment_id
- self._bugzilla.set_flag_on_attachment(attachment_id,
- "commit-queue",
- "-",
- comment_text,
- additional_comment_text)
-
- def reject_patch_from_review_queue(self,
- attachment_id,
- additional_comment_text=None):
- comment_text = "Rejecting patch %s from review queue." % attachment_id
- self._bugzilla.set_flag_on_attachment(attachment_id,
- 'review',
- '-',
- comment_text,
- additional_comment_text)
-
-
class Bugzilla(object):
- def __init__(self, dryrun=False, committers=CommitterList()):
+ def __init__(self, dryrun=False, committers=committers.CommitterList()):
self.dryrun = dryrun
self.authenticated = False
self.queries = BugzillaQueries(self)
self.committers = committers
+ self.cached_quips = []
# FIXME: We should use some sort of Browser mock object when in dryrun
# mode (to prevent any mistakes).
@@ -350,18 +165,30 @@ class Bugzilla(object):
bug_server_host = "bugs.webkit.org"
bug_server_regex = "https?://%s/" % re.sub('\.', '\\.', bug_server_host)
bug_server_url = "https://%s/" % bug_server_host
- unassigned_email = "webkit-unassigned@lists.webkit.org"
+
+ def quips(self):
+ # We only fetch and parse the list of quips once per instantiation
+ # so that we do not burden bugs.webkit.org.
+ if not self.cached_quips and not self.dryrun:
+ self.cached_quips = self.queries.fetch_quips()
+ return self.cached_quips
def bug_url_for_bug_id(self, bug_id, xml=False):
+ if not bug_id:
+ return None
content_type = "&ctype=xml" if xml else ""
return "%sshow_bug.cgi?id=%s%s" % (self.bug_server_url,
bug_id,
content_type)
def short_bug_url_for_bug_id(self, bug_id):
+ if not bug_id:
+ return None
return "http://webkit.org/b/%s" % bug_id
def attachment_url_for_id(self, attachment_id, action="view"):
+ if not attachment_id:
+ return None
action_param = ""
if action and action != "view":
action_param = "&action=%s" % action
@@ -379,6 +206,31 @@ class Bugzilla(object):
attachment[flag_name] = flag['status']
if flag['status'] == '+':
attachment[result_key] = flag['setter']
+ # Sadly show_bug.cgi?ctype=xml does not expose the flag modification date.
+
+ def _string_contents(self, soup):
+ # WebKit's bugzilla instance uses UTF-8.
+ # BeautifulSoup always returns Unicode strings, however
+ # the .string method returns a (unicode) NavigableString.
+ # NavigableString can confuse other parts of the code, so we
+ # convert from NavigableString to a real unicode() object using unicode().
+ return unicode(soup.string)
+
+ # Example: 2010-01-20 14:31 PST
+ # FIXME: Some bugzilla dates seem to have seconds in them?
+ # Python does not support timezones out of the box.
+ # Assume that bugzilla always uses PST (which is true for bugs.webkit.org)
+ _bugzilla_date_format = "%Y-%m-%d %H:%M"
+
+ @classmethod
+ def _parse_date(cls, date_string):
+ (date, time, time_zone) = date_string.split(" ")
+ # Ignore the timezone because python doesn't understand timezones out of the box.
+ date_string = "%s %s" % (date, time)
+ return datetime.strptime(date_string, cls._bugzilla_date_format)
+
+ def _date_contents(self, soup):
+ return self._parse_date(self._string_contents(soup))
def _parse_attachment_element(self, element, bug_id):
attachment = {}
@@ -388,9 +240,10 @@ class Bugzilla(object):
attachment['id'] = int(element.find('attachid').string)
# FIXME: No need to parse out the url here.
attachment['url'] = self.attachment_url_for_id(attachment['id'])
- attachment['name'] = unicode(element.find('desc').string)
- attachment['attacher_email'] = str(element.find('attacher').string)
- attachment['type'] = str(element.find('type').string)
+ attachment["attach_date"] = self._date_contents(element.find("date"))
+ attachment['name'] = self._string_contents(element.find('desc'))
+ attachment['attacher_email'] = self._string_contents(element.find('attacher'))
+ attachment['type'] = self._string_contents(element.find('type'))
self._parse_attachment_flag(
element, 'review', attachment, 'reviewer_email')
self._parse_attachment_flag(
@@ -401,10 +254,11 @@ class Bugzilla(object):
soup = BeautifulSoup(page)
bug = {}
bug["id"] = int(soup.find("bug_id").string)
- bug["title"] = unicode(soup.find("short_desc").string)
- bug["reporter_email"] = str(soup.find("reporter").string)
- bug["assigned_to_email"] = str(soup.find("assigned_to").string)
- bug["cc_emails"] = [str(element.string)
+ bug["title"] = self._string_contents(soup.find("short_desc"))
+ bug["bug_status"] = self._string_contents(soup.find("bug_status"))
+ bug["reporter_email"] = self._string_contents(soup.find("reporter"))
+ bug["assigned_to_email"] = self._string_contents(soup.find("assigned_to"))
+ bug["cc_emails"] = [self._string_contents(element)
for element in soup.findAll('cc')]
bug["attachments"] = [self._parse_attachment_element(element, bug["id"]) for element in soup.findAll('attachment')]
return bug
@@ -418,13 +272,25 @@ class Bugzilla(object):
return self.browser.open(bug_url)
def fetch_bug_dictionary(self, bug_id):
- return self._parse_bug_page(self._fetch_bug_page(bug_id))
+ try:
+ return self._parse_bug_page(self._fetch_bug_page(bug_id))
+ except KeyboardInterrupt:
+ raise
+ except:
+ self.authenticate()
+ return self._parse_bug_page(self._fetch_bug_page(bug_id))
# FIXME: A BugzillaCache object should provide all these fetch_ methods.
def fetch_bug(self, bug_id):
return Bug(self.fetch_bug_dictionary(bug_id), self)
+ def fetch_attachment_contents(self, attachment_id):
+ attachment_url = self.attachment_url_for_id(attachment_id)
+ # We need to authenticate to download patches from security bugs.
+ self.authenticate()
+ return self.browser.open(attachment_url).read()
+
def _parse_bug_id_from_attachment_page(self, page):
# The "Up" relation happens to point to the bug.
up_link = BeautifulSoup(page).find('link', rel='Up')
@@ -468,11 +334,12 @@ class Bugzilla(object):
self.authenticated = True
return
+ credentials = Credentials(self.bug_server_host, git_prefix="bugzilla")
+
attempts = 0
while not self.authenticated:
attempts += 1
- (username, password) = Credentials(
- self.bug_server_host, git_prefix="bugzilla").read_credentials()
+ username, password = credentials.read_credentials()
log("Logging in as %s..." % username)
self.browser.open(self.bug_server_url +
@@ -494,6 +361,7 @@ class Bugzilla(object):
raise Exception(errorMessage)
else:
self.authenticated = True
+ self.username = username
def _fill_attachment_form(self,
description,
@@ -501,7 +369,8 @@ class Bugzilla(object):
comment_text=None,
mark_for_review=False,
mark_for_commit_queue=False,
- mark_for_landing=False, bug_id=None):
+ mark_for_landing=False,
+ bug_id=None):
self.browser['description'] = description
self.browser['ispatch'] = ("1",)
self.browser['flag_type-1'] = ('?',) if mark_for_review else ('X',)
@@ -517,6 +386,7 @@ class Bugzilla(object):
patch_name = "bug-%s-%s.patch" % (bug_id, timestamp())
else:
patch_name ="%s.patch" % timestamp()
+
self.browser.add_file(patch_file_object,
"text/plain",
patch_name,
@@ -524,7 +394,7 @@ class Bugzilla(object):
def add_patch_to_bug(self,
bug_id,
- patch_file_object,
+ diff,
description,
comment_text=None,
mark_for_review=False,
@@ -543,6 +413,11 @@ class Bugzilla(object):
self.browser.open("%sattachment.cgi?action=enter&bugid=%s" % (
self.bug_server_url, bug_id))
self.browser.select_form(name="entryform")
+
+ # _fill_attachment_form expects a file-like object
+ # Patch files are already binary, so no encoding needed.
+ assert(isinstance(diff, str))
+ patch_file_object = StringIO.StringIO(diff)
self._fill_attachment_form(description,
patch_file_object,
mark_for_review=mark_for_review,
@@ -554,15 +429,6 @@ class Bugzilla(object):
self.browser['comment'] = comment_text
self.browser.submit()
- def prompt_for_component(self, components):
- log("Please pick a component:")
- i = 0
- for name in components:
- i += 1
- log("%2d. %s" % (i, name))
- result = int(User.prompt("Enter a number: ")) - 1
- return components[result]
-
def _check_create_bug_response(self, response_html):
match = re.search("<title>Bug (?P<bug_id>\d+) Submitted</title>",
response_html)
@@ -586,9 +452,11 @@ class Bugzilla(object):
bug_title,
bug_description,
component=None,
- patch_file_object=None,
+ diff=None,
patch_description=None,
cc=None,
+ blocked=None,
+ assignee=None,
mark_for_review=False,
mark_for_commit_queue=False):
self.authenticate()
@@ -605,14 +473,24 @@ class Bugzilla(object):
if not component:
component = "New Bugs"
if component not in component_names:
- component = self.prompt_for_component(component_names)
- self.browser['component'] = [component]
+ component = User.prompt_with_list("Please pick a component:", component_names)
+ self.browser["component"] = [component]
if cc:
- self.browser['cc'] = cc
- self.browser['short_desc'] = bug_title
- self.browser['comment'] = bug_description
-
- if patch_file_object:
+ self.browser["cc"] = cc
+ if blocked:
+ self.browser["blocked"] = unicode(blocked)
+ if assignee == None:
+ assignee = self.username
+ if assignee and not self.browser.find_control("assigned_to").disabled:
+ self.browser["assigned_to"] = assignee
+ self.browser["short_desc"] = bug_title
+ self.browser["comment"] = bug_description
+
+ if diff:
+ # _fill_attachment_form expects a file-like object
+ # Patch files are already binary, so no encoding needed.
+ assert(isinstance(diff, str))
+ patch_file_object = StringIO.StringIO(diff)
self._fill_attachment_form(
patch_description,
patch_file_object,
@@ -630,7 +508,7 @@ class Bugzilla(object):
# FIXME: This will break if we ever re-order attachment flags
if flag_name == "review":
return self.browser.find_control(type='select', nr=0)
- if flag_name == "commit-queue":
+ elif flag_name == "commit-queue":
return self.browser.find_control(type='select', nr=1)
raise Exception("Don't know how to find flag named \"%s\"" % flag_name)
@@ -658,8 +536,8 @@ class Bugzilla(object):
attachment_id,
flag_name,
flag_value,
- comment_text,
- additional_comment_text):
+ comment_text=None,
+ additional_comment_text=None):
# FIXME: We need a way to test this function on a live bugzilla
# instance.
@@ -674,7 +552,10 @@ class Bugzilla(object):
self.browser.open(self.attachment_url_for_id(attachment_id, 'edit'))
self.browser.select_form(nr=1)
- self.browser.set_value(comment_text, name='comment', nr=0)
+
+ if comment_text:
+ self.browser.set_value(comment_text, name='comment', nr=0)
+
self._find_select_element_for_flag(flag_name).value = (flag_value,)
self.browser.submit()
@@ -741,7 +622,6 @@ class Bugzilla(object):
self.browser.open(self.bug_url_for_bug_id(bug_id))
self.browser.select_form(name="changeform")
if comment_text:
- log(comment_text)
self.browser['comment'] = comment_text
self.browser['bug_status'] = ['RESOLVED']
self.browser['resolution'] = ['FIXED']
@@ -782,9 +662,13 @@ class Bugzilla(object):
possible_bug_statuses = map(lambda item: item.name, bug_status.items)
if "REOPENED" in possible_bug_statuses:
bug_status.value = ["REOPENED"]
+ # If the bug was never confirmed it will not have a "REOPENED"
+ # state, but only an "UNCONFIRMED" state.
+ elif "UNCONFIRMED" in possible_bug_statuses:
+ bug_status.value = ["UNCONFIRMED"]
else:
- log("Did not reopen bug %s. " +
- "It appears to already be open with status %s." % (
- bug_id, bug_status.value))
+ # FIXME: This logic is slightly backwards. We won't print this
+ # message if the bug is already open with state "UNCONFIRMED".
+ log("Did not reopen bug %s, it appears to already be open with status %s." % (bug_id, bug_status.value))
self.browser['comment'] = comment_text
self.browser.submit()
diff --git a/WebKitTools/Scripts/webkitpy/bugzilla_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py
index d555f78..c476c81 100644
--- a/WebKitTools/Scripts/webkitpy/bugzilla_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py
@@ -27,37 +27,14 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import unittest
+import datetime
-from webkitpy.committers import CommitterList, Reviewer, Committer
-from webkitpy.bugzilla import Bugzilla, BugzillaQueries, parse_bug_id, CommitterValidator
-from webkitpy.outputcapture import OutputCapture
-from webkitpy.mock import Mock
+from .bugzilla import Bugzilla, BugzillaQueries, parse_bug_id
-from webkitpy.BeautifulSoup import BeautifulSoup
-
-
-class MockBrowser(object):
- def open(self, url):
- pass
-
- def select_form(self, name):
- pass
-
- def __setitem__(self, key, value):
- pass
-
- def submit(self):
- pass
-
-class CommitterValidatorTest(unittest.TestCase):
- def test_flag_permission_rejection_message(self):
- validator = CommitterValidator(bugzilla=None)
- expected_messsage="""foo@foo.com does not have review permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/committers.py.
-
-- If you do not have review rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
-
-- If you have review rights please correct the error in WebKitTools/Scripts/webkitpy/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 review rights."""
- self.assertEqual(validator._flag_permission_rejection_message("foo@foo.com", "review"), expected_messsage)
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockBrowser
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
class BugzillaTest(unittest.TestCase):
@@ -87,6 +64,7 @@ class BugzillaTest(unittest.TestCase):
</attachment>
'''
_expected_example_attachment_parsing = {
+ 'attach_date': datetime.datetime(2009, 07, 29, 10, 23),
'bug_id' : 100,
'is_obsolete' : True,
'is_patch' : True,
@@ -101,6 +79,13 @@ class BugzillaTest(unittest.TestCase):
'attacher_email' : 'christian.plesner.hansen@gmail.com',
}
+ def test_url_creation(self):
+ # FIXME: These would be all better as doctests
+ bugs = Bugzilla()
+ self.assertEquals(None, bugs.bug_url_for_bug_id(None))
+ self.assertEquals(None, bugs.short_bug_url_for_bug_id(None))
+ self.assertEquals(None, bugs.attachment_url_for_id(None))
+
def test_parse_bug_id(self):
# FIXME: These would be all better as doctests
bugs = Bugzilla()
@@ -171,12 +156,12 @@ removed-because-it-was-really-long
ZEZpbmlzaExvYWRXaXRoUmVhc29uOnJlYXNvbl07Cit9CisKIEBlbmQKIAogI2VuZGlmCg==
</data>
- <flag name="review"
- id="27602"
- status="?"
- setter="mjs@apple.com"
- />
- </attachment>
+ <flag name="review"
+ id="27602"
+ status="?"
+ setter="mjs@apple.com"
+ />
+ </attachment>
</bug>
</bugzilla>
"""
@@ -186,7 +171,9 @@ ZEZpbmlzaExvYWRXaXRoUmVhc29uOnJlYXNvbl07Cit9CisKIEBlbmQKIAogI2VuZGlmCg==
"cc_emails" : ["foo@bar.com", "example@example.com"],
"reporter_email" : "eric@webkit.org",
"assigned_to_email" : "webkit-unassigned@lists.webkit.org",
+ "bug_status": "NEW",
"attachments" : [{
+ "attach_date": datetime.datetime(2009, 12, 27, 23, 51),
'name': u'Patch',
'url' : "https://bugs.webkit.org/attachment.cgi?id=45548",
'is_obsolete': False,
@@ -199,6 +186,7 @@ ZEZpbmlzaExvYWRXaXRoUmVhc29uOnJlYXNvbl07Cit9CisKIEBlbmQKIAogI2VuZGlmCg==
}],
}
+ # FIXME: This should move to a central location and be shared by more unit tests.
def _assert_dictionaries_equal(self, actual, expected):
# Make sure we aren't parsing more or less than we expect
self.assertEquals(sorted(actual.keys()), sorted(expected.keys()))
@@ -241,6 +229,35 @@ ZEZpbmlzaExvYWRXaXRoUmVhc29uOnJlYXNvbl07Cit9CisKIEBlbmQKIAogI2VuZGlmCg==
expected_stderr = "Adding ['adam@example.com'] to the CC list for bug 42\n"
OutputCapture().assert_outputs(self, bugzilla.add_cc_to_bug, [42, ["adam@example.com"]], expected_stderr=expected_stderr)
+ def _mock_control_item(self, name):
+ mock_item = Mock()
+ mock_item.name = name
+ return mock_item
+
+ def _mock_find_control(self, item_names=[], selected_index=0):
+ mock_control = Mock()
+ mock_control.items = [self._mock_control_item(name) for name in item_names]
+ mock_control.value = [item_names[selected_index]] if item_names else None
+ return lambda name, type: mock_control
+
+ def _assert_reopen(self, item_names=None, selected_index=None, extra_stderr=None):
+ bugzilla = Bugzilla()
+ bugzilla.browser = MockBrowser()
+ bugzilla.authenticate = lambda: None
+
+ mock_find_control = self._mock_find_control(item_names, selected_index)
+ bugzilla.browser.find_control = mock_find_control
+ expected_stderr = "Re-opening bug 42\n['comment']\n"
+ if extra_stderr:
+ expected_stderr += extra_stderr
+ OutputCapture().assert_outputs(self, bugzilla.reopen_bug, [42, ["comment"]], expected_stderr=expected_stderr)
+
+ def test_reopen_bug(self):
+ self._assert_reopen(item_names=["REOPENED", "RESOLVED", "CLOSED"], selected_index=1)
+ self._assert_reopen(item_names=["UNCONFIRMED", "RESOLVED", "CLOSED"], selected_index=1)
+ extra_stderr = "Did not reopen bug 42, it appears to already be open with status ['NEW'].\n"
+ self._assert_reopen(item_names=["NEW", "RESOLVED"], selected_index=0, extra_stderr=extra_stderr)
+
class BugzillaQueriesTest(unittest.TestCase):
_sample_request_page = """
@@ -289,15 +306,37 @@ class BugzillaQueriesTest(unittest.TestCase):
</body>
</html>
"""
+ _sample_quip_page = u"""
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <head>
+ <title>Bugzilla Quip System</title>
+ </head>
+ <body>
+ <h2>
+
+ Existing quips:
+ </h2>
+ <ul>
+ <li>Everything should be made as simple as possible, but not simpler. - Albert Einstein</li>
+ <li>Good artists copy. Great artists steal. - Pablo Picasso</li>
+ <li>\u00e7gua mole em pedra dura, tanto bate at\u008e que fura.</li>
+
+ </ul>
+ </body>
+</html>
+"""
def test_request_page_parsing(self):
queries = BugzillaQueries(None)
self.assertEquals([40511, 40722, 40723], queries._parse_attachment_ids_request_query(self._sample_request_page))
+ def test_quip_page_parsing(self):
+ queries = BugzillaQueries(None)
+ expected_quips = ["Everything should be made as simple as possible, but not simpler. - Albert Einstein", "Good artists copy. Great artists steal. - Pablo Picasso", u"\u00e7gua mole em pedra dura, tanto bate at\u008e que fura."]
+ self.assertEquals(expected_quips, queries._parse_quips(self._sample_quip_page))
+
def test_load_query(self):
queries = BugzillaQueries(Mock())
queries._load_query("request.cgi?action=queue&type=review&group=type")
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
new file mode 100644
index 0000000..88cdd4e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
@@ -0,0 +1,452 @@
+# Copyright (c) 2009, Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# WebKit's Python module for interacting with WebKit's buildbot
+
+import operator
+import re
+import urllib
+import urllib2
+import xmlrpclib
+
+from webkitpy.common.net.failuremap import FailureMap
+from webkitpy.common.net.layouttestresults import LayoutTestResults
+from webkitpy.common.net.regressionwindow import RegressionWindow
+from webkitpy.common.system.logutils import get_logger
+from webkitpy.thirdparty.autoinstalled.mechanize import Browser
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
+
+_log = get_logger(__file__)
+
+
+class Builder(object):
+ def __init__(self, name, buildbot):
+ self._name = name
+ self._buildbot = buildbot
+ self._builds_cache = {}
+ self._revision_to_build_number = None
+ self._browser = Browser()
+ self._browser.set_handle_robots(False) # The builder pages are excluded by robots.txt
+
+ def name(self):
+ return self._name
+
+ def results_url(self):
+ return "http://%s/results/%s" % (self._buildbot.buildbot_host, self.url_encoded_name())
+
+ def url_encoded_name(self):
+ return urllib.quote(self._name)
+
+ def url(self):
+ return "http://%s/builders/%s" % (self._buildbot.buildbot_host, self.url_encoded_name())
+
+ # This provides a single place to mock
+ def _fetch_build(self, build_number):
+ build_dictionary = self._buildbot._fetch_xmlrpc_build_dictionary(self, build_number)
+ if not build_dictionary:
+ return None
+ return Build(self,
+ build_number=int(build_dictionary['number']),
+ revision=int(build_dictionary['revision']),
+ is_green=(build_dictionary['results'] == 0) # Undocumented, buildbot XMLRPC, 0 seems to mean "pass"
+ )
+
+ def build(self, build_number):
+ if not build_number:
+ return None
+ cached_build = self._builds_cache.get(build_number)
+ if cached_build:
+ return cached_build
+
+ build = self._fetch_build(build_number)
+ self._builds_cache[build_number] = build
+ return build
+
+ def force_build(self, username="webkit-patch", comments=None):
+ def predicate(form):
+ try:
+ return form.find_control("username")
+ except Exception, e:
+ return False
+ self._browser.open(self.url())
+ self._browser.select_form(predicate=predicate)
+ self._browser["username"] = username
+ if comments:
+ self._browser["comments"] = comments
+ return self._browser.submit()
+
+ file_name_regexp = re.compile(r"r(?P<revision>\d+) \((?P<build_number>\d+)\)")
+ def _revision_and_build_for_filename(self, filename):
+ # Example: "r47483 (1)/" or "r47483 (1).zip"
+ match = self.file_name_regexp.match(filename)
+ return (int(match.group("revision")), int(match.group("build_number")))
+
+ def _fetch_revision_to_build_map(self):
+ # All _fetch requests go through _buildbot for easier mocking
+ # FIXME: This should use NetworkTransaction's 404 handling instead.
+ try:
+ # FIXME: This method is horribly slow due to the huge network load.
+ # FIXME: This is a poor way to do revision -> build mapping.
+ # Better would be to ask buildbot through some sort of API.
+ print "Loading revision/build list from %s." % self.results_url()
+ print "This may take a while..."
+ result_files = self._buildbot._fetch_twisted_directory_listing(self.results_url())
+ except urllib2.HTTPError, error:
+ if error.code != 404:
+ raise
+ result_files = []
+
+ # This assumes there was only one build per revision, which is false but we don't care for now.
+ return dict([self._revision_and_build_for_filename(file_info["filename"]) for file_info in result_files])
+
+ def _revision_to_build_map(self):
+ if not self._revision_to_build_number:
+ self._revision_to_build_number = self._fetch_revision_to_build_map()
+ return self._revision_to_build_number
+
+ def revision_build_pairs_with_results(self):
+ return self._revision_to_build_map().items()
+
+ # This assumes there can be only one build per revision, which is false, but we don't care for now.
+ def build_for_revision(self, revision, allow_failed_lookups=False):
+ # NOTE: This lookup will fail if that exact revision was never built.
+ build_number = self._revision_to_build_map().get(int(revision))
+ if not build_number:
+ return None
+ build = self.build(build_number)
+ if not build and allow_failed_lookups:
+ # Builds for old revisions with fail to lookup via buildbot's xmlrpc api.
+ build = Build(self,
+ build_number=build_number,
+ revision=revision,
+ is_green=False,
+ )
+ return build
+
+ def find_regression_window(self, red_build, look_back_limit=30):
+ if not red_build or red_build.is_green():
+ return RegressionWindow(None, None)
+ common_failures = None
+ current_build = red_build
+ build_after_current_build = None
+ look_back_count = 0
+ while current_build:
+ if current_build.is_green():
+ # current_build can't possibly have any failures in common
+ # with red_build because it's green.
+ break
+ results = current_build.layout_test_results()
+ # We treat a lack of results as if all the test failed.
+ # This occurs, for example, when we can't compile at all.
+ if results:
+ failures = set(results.failing_tests())
+ if common_failures == None:
+ common_failures = failures
+ else:
+ common_failures = common_failures.intersection(failures)
+ if not common_failures:
+ # current_build doesn't have any failures in common with
+ # the red build we're worried about. We assume that any
+ # failures in current_build were due to flakiness.
+ break
+ look_back_count += 1
+ if look_back_count > look_back_limit:
+ return RegressionWindow(None, current_build, failing_tests=common_failures)
+ build_after_current_build = current_build
+ current_build = current_build.previous_build()
+ # We must iterate at least once because red_build is red.
+ assert(build_after_current_build)
+ # Current build must either be green or have no failures in common
+ # with red build, so we've found our failure transition.
+ return RegressionWindow(current_build, build_after_current_build, failing_tests=common_failures)
+
+ def find_blameworthy_regression_window(self, red_build_number, look_back_limit=30, avoid_flakey_tests=True):
+ red_build = self.build(red_build_number)
+ regression_window = self.find_regression_window(red_build, look_back_limit)
+ if not regression_window.build_before_failure():
+ return None # We ran off the limit of our search
+ # If avoid_flakey_tests, require at least 2 bad builds before we
+ # suspect a real failure transition.
+ if avoid_flakey_tests and regression_window.failing_build() == red_build:
+ return None
+ return regression_window
+
+
+class Build(object):
+ def __init__(self, builder, build_number, revision, is_green):
+ self._builder = builder
+ self._number = build_number
+ self._revision = revision
+ self._is_green = is_green
+ self._layout_test_results = None
+
+ @staticmethod
+ def build_url(builder, build_number):
+ return "%s/builds/%s" % (builder.url(), build_number)
+
+ def url(self):
+ return self.build_url(self.builder(), self._number)
+
+ def results_url(self):
+ results_directory = "r%s (%s)" % (self.revision(), self._number)
+ return "%s/%s" % (self._builder.results_url(), urllib.quote(results_directory))
+
+ def _fetch_results_html(self):
+ results_html = "%s/results.html" % (self.results_url())
+ # FIXME: This should use NetworkTransaction's 404 handling instead.
+ try:
+ # It seems this can return None if the url redirects and then returns 404.
+ return urllib2.urlopen(results_html)
+ except urllib2.HTTPError, error:
+ if error.code != 404:
+ raise
+
+ def layout_test_results(self):
+ if not self._layout_test_results:
+ # FIXME: This should cache that the result was a 404 and stop hitting the network.
+ self._layout_test_results = LayoutTestResults.results_from_string(self._fetch_results_html())
+ return self._layout_test_results
+
+ def builder(self):
+ return self._builder
+
+ def revision(self):
+ return self._revision
+
+ def is_green(self):
+ return self._is_green
+
+ def previous_build(self):
+ # previous_build() allows callers to avoid assuming build numbers are sequential.
+ # They may not be sequential across all master changes, or when non-trunk builds are made.
+ return self._builder.build(self._number - 1)
+
+
+class BuildBot(object):
+ # FIXME: This should move into some sort of webkit_config.py
+ default_host = "build.webkit.org"
+
+ def __init__(self, host=default_host):
+ self.buildbot_host = host
+ self._builder_by_name = {}
+
+ # If any core builder is red we should not be landing patches. Other
+ # builders should be added to this list once they are known to be
+ # reliable.
+ # See https://bugs.webkit.org/show_bug.cgi?id=33296 and related bugs.
+ self.core_builder_names_regexps = [
+ "SnowLeopard.*Build",
+ "SnowLeopard.*\(Test", # Exclude WebKit2 for now.
+ "Leopard",
+ "Tiger",
+ "Windows.*Build",
+ "GTK.*32",
+ "GTK.*64.*Debug", # Disallow the 64-bit Release bot which is broken.
+ "Qt",
+ "Chromium.*Release$",
+ ]
+
+ def _parse_last_build_cell(self, builder, cell):
+ status_link = cell.find('a')
+ if status_link:
+ # Will be either a revision number or a build number
+ revision_string = status_link.string
+ # If revision_string has non-digits assume it's not a revision number.
+ builder['built_revision'] = int(revision_string) \
+ if not re.match('\D', revision_string) \
+ else None
+
+ # FIXME: We treat slave lost as green even though it is not to
+ # work around the Qts bot being on a broken internet connection.
+ # The real fix is https://bugs.webkit.org/show_bug.cgi?id=37099
+ builder['is_green'] = not re.search('fail', cell.renderContents()) or \
+ not not re.search('lost', cell.renderContents())
+
+ status_link_regexp = r"builders/(?P<builder_name>.*)/builds/(?P<build_number>\d+)"
+ link_match = re.match(status_link_regexp, status_link['href'])
+ builder['build_number'] = int(link_match.group("build_number"))
+ else:
+ # We failed to find a link in the first cell, just give up. This
+ # can happen if a builder is just-added, the first cell will just
+ # be "no build"
+ # Other parts of the code depend on is_green being present.
+ builder['is_green'] = False
+ builder['built_revision'] = None
+ builder['build_number'] = None
+
+ def _parse_current_build_cell(self, builder, cell):
+ activity_lines = cell.renderContents().split("<br />")
+ builder["activity"] = activity_lines[0] # normally "building" or "idle"
+ # The middle lines document how long left for any current builds.
+ match = re.match("(?P<pending_builds>\d) pending", activity_lines[-1])
+ builder["pending_builds"] = int(match.group("pending_builds")) if match else 0
+
+ def _parse_builder_status_from_row(self, status_row):
+ status_cells = status_row.findAll('td')
+ builder = {}
+
+ # First cell is the name
+ name_link = status_cells[0].find('a')
+ builder["name"] = unicode(name_link.string)
+
+ self._parse_last_build_cell(builder, status_cells[1])
+ self._parse_current_build_cell(builder, status_cells[2])
+ return builder
+
+ def _matches_regexps(self, builder_name, name_regexps):
+ for name_regexp in name_regexps:
+ if re.match(name_regexp, builder_name):
+ return True
+ return False
+
+ # FIXME: Should move onto Builder
+ def _is_core_builder(self, builder_name):
+ return self._matches_regexps(builder_name, self.core_builder_names_regexps)
+
+ # FIXME: This method needs to die, but is used by a unit test at the moment.
+ def _builder_statuses_with_names_matching_regexps(self, builder_statuses, name_regexps):
+ return [builder for builder in builder_statuses if self._matches_regexps(builder["name"], name_regexps)]
+
+ def red_core_builders(self):
+ return [builder for builder in self.core_builder_statuses() if not builder["is_green"]]
+
+ def red_core_builders_names(self):
+ return [builder["name"] for builder in self.red_core_builders()]
+
+ def idle_red_core_builders(self):
+ return [builder for builder in self.red_core_builders() if builder["activity"] == "idle"]
+
+ def core_builders_are_green(self):
+ return not self.red_core_builders()
+
+ # FIXME: These _fetch methods should move to a networking class.
+ def _fetch_xmlrpc_build_dictionary(self, builder, build_number):
+ # The buildbot XMLRPC API is super-limited.
+ # For one, you cannot fetch info on builds which are incomplete.
+ proxy = xmlrpclib.ServerProxy("http://%s/xmlrpc" % self.buildbot_host, allow_none=True)
+ try:
+ return proxy.getBuild(builder.name(), int(build_number))
+ except xmlrpclib.Fault, err:
+ build_url = Build.build_url(builder, build_number)
+ _log.error("Error fetching data for %s build %s (%s): %s" % (builder.name(), build_number, build_url, err))
+ return None
+
+ def _fetch_one_box_per_builder(self):
+ build_status_url = "http://%s/one_box_per_builder" % self.buildbot_host
+ return urllib2.urlopen(build_status_url)
+
+ def _file_cell_text(self, file_cell):
+ """Traverses down through firstChild elements until one containing a string is found, then returns that string"""
+ element = file_cell
+ while element.string is None and element.contents:
+ element = element.contents[0]
+ return element.string
+
+ def _parse_twisted_file_row(self, file_row):
+ string_or_empty = lambda string: unicode(string) if string else u""
+ file_cells = file_row.findAll('td')
+ return {
+ "filename": string_or_empty(self._file_cell_text(file_cells[0])),
+ "size": string_or_empty(self._file_cell_text(file_cells[1])),
+ "type": string_or_empty(self._file_cell_text(file_cells[2])),
+ "encoding": string_or_empty(self._file_cell_text(file_cells[3])),
+ }
+
+ def _parse_twisted_directory_listing(self, page):
+ soup = BeautifulSoup(page)
+ # HACK: Match only table rows with a class to ignore twisted header/footer rows.
+ file_rows = soup.find('table').findAll('tr', {'class': re.compile(r'\b(?:directory|file)\b')})
+ return [self._parse_twisted_file_row(file_row) for file_row in file_rows]
+
+ # FIXME: There should be a better way to get this information directly from twisted.
+ def _fetch_twisted_directory_listing(self, url):
+ return self._parse_twisted_directory_listing(urllib2.urlopen(url))
+
+ def builders(self):
+ return [self.builder_with_name(status["name"]) for status in self.builder_statuses()]
+
+ # This method pulls from /one_box_per_builder as an efficient way to get information about
+ def builder_statuses(self):
+ soup = BeautifulSoup(self._fetch_one_box_per_builder())
+ return [self._parse_builder_status_from_row(status_row) for status_row in soup.find('table').findAll('tr')]
+
+ def core_builder_statuses(self):
+ return [builder for builder in self.builder_statuses() if self._is_core_builder(builder["name"])]
+
+ def builder_with_name(self, name):
+ builder = self._builder_by_name.get(name)
+ if not builder:
+ builder = Builder(name, self)
+ self._builder_by_name[name] = builder
+ return builder
+
+ def failure_map(self, only_core_builders=True):
+ builder_statuses = self.core_builder_statuses() if only_core_builders else self.builder_statuses()
+ failure_map = FailureMap()
+ revision_to_failing_bots = {}
+ for builder_status in builder_statuses:
+ if builder_status["is_green"]:
+ continue
+ builder = self.builder_with_name(builder_status["name"])
+ regression_window = builder.find_blameworthy_regression_window(builder_status["build_number"])
+ if regression_window:
+ failure_map.add_regression_window(builder, regression_window)
+ return failure_map
+
+ # This makes fewer requests than calling Builder.latest_build would. It grabs all builder
+ # statuses in one request using self.builder_statuses (fetching /one_box_per_builder instead of builder pages).
+ def _latest_builds_from_builders(self, only_core_builders=True):
+ builder_statuses = self.core_builder_statuses() if only_core_builders else self.builder_statuses()
+ return [self.builder_with_name(status["name"]).build(status["build_number"]) for status in builder_statuses]
+
+ def _build_at_or_before_revision(self, build, revision):
+ while build:
+ if build.revision() <= revision:
+ return build
+ build = build.previous_build()
+
+ def last_green_revision(self, only_core_builders=True):
+ builds = self._latest_builds_from_builders(only_core_builders)
+ target_revision = builds[0].revision()
+ # An alternate way to do this would be to start at one revision and walk backwards
+ # checking builder.build_for_revision, however build_for_revision is very slow on first load.
+ while True:
+ # Make builds agree on revision
+ builds = [self._build_at_or_before_revision(build, target_revision) for build in builds]
+ if None in builds: # One of the builds failed to load from the server.
+ return None
+ min_revision = min(map(lambda build: build.revision(), builds))
+ if min_revision != target_revision:
+ target_revision = min_revision
+ continue # Builds don't all agree on revision, keep searching
+ # Check to make sure they're all green
+ all_are_green = reduce(operator.and_, map(lambda build: build.is_green(), builds))
+ if not all_are_green:
+ target_revision -= 1
+ continue
+ return min_revision
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
new file mode 100644
index 0000000..4fdf24c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
@@ -0,0 +1,410 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.net.buildbot import BuildBot, Builder, Build, LayoutTestResults
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
+
+
+class BuilderTest(unittest.TestCase):
+ def _install_fetch_build(self, failure):
+ def _mock_fetch_build(build_number):
+ build = Build(
+ builder=self.builder,
+ build_number=build_number,
+ revision=build_number + 1000,
+ is_green=build_number < 4
+ )
+ parsed_results = {LayoutTestResults.fail_key: failure(build_number)}
+ build._layout_test_results = LayoutTestResults(parsed_results)
+ return build
+ self.builder._fetch_build = _mock_fetch_build
+
+ def setUp(self):
+ self.buildbot = BuildBot()
+ self.builder = Builder(u"Test Builder \u2661", self.buildbot)
+ self._install_fetch_build(lambda build_number: ["test1", "test2"])
+
+ def test_find_regression_window(self):
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1003)
+ self.assertEqual(regression_window.failing_build().revision(), 1004)
+
+ regression_window = self.builder.find_regression_window(self.builder.build(10), look_back_limit=2)
+ self.assertEqual(regression_window.build_before_failure(), None)
+ self.assertEqual(regression_window.failing_build().revision(), 1008)
+
+ def test_none_build(self):
+ self.builder._fetch_build = lambda build_number: None
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure(), None)
+ self.assertEqual(regression_window.failing_build(), None)
+
+ def test_flaky_tests(self):
+ self._install_fetch_build(lambda build_number: ["test1"] if build_number % 2 else ["test2"])
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1009)
+ self.assertEqual(regression_window.failing_build().revision(), 1010)
+
+ def test_failure_and_flaky(self):
+ self._install_fetch_build(lambda build_number: ["test1", "test2"] if build_number % 2 else ["test2"])
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1003)
+ self.assertEqual(regression_window.failing_build().revision(), 1004)
+
+ def test_no_results(self):
+ self._install_fetch_build(lambda build_number: ["test1", "test2"] if build_number % 2 else ["test2"])
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1003)
+ self.assertEqual(regression_window.failing_build().revision(), 1004)
+
+ def test_failure_after_flaky(self):
+ self._install_fetch_build(lambda build_number: ["test1", "test2"] if build_number > 6 else ["test3"])
+ regression_window = self.builder.find_regression_window(self.builder.build(10))
+ self.assertEqual(regression_window.build_before_failure().revision(), 1006)
+ self.assertEqual(regression_window.failing_build().revision(), 1007)
+
+ def test_find_blameworthy_regression_window(self):
+ self.assertEqual(self.builder.find_blameworthy_regression_window(10).revisions(), [1004])
+ self.assertEqual(self.builder.find_blameworthy_regression_window(10, look_back_limit=2), None)
+ # Flakey test avoidance requires at least 2 red builds:
+ self.assertEqual(self.builder.find_blameworthy_regression_window(4), None)
+ self.assertEqual(self.builder.find_blameworthy_regression_window(4, avoid_flakey_tests=False).revisions(), [1004])
+ # Green builder:
+ self.assertEqual(self.builder.find_blameworthy_regression_window(3), None)
+
+ def test_build_caching(self):
+ self.assertEqual(self.builder.build(10), self.builder.build(10))
+
+ def test_build_and_revision_for_filename(self):
+ expectations = {
+ "r47483 (1)/" : (47483, 1),
+ "r47483 (1).zip" : (47483, 1),
+ }
+ for filename, revision_and_build in expectations.items():
+ self.assertEqual(self.builder._revision_and_build_for_filename(filename), revision_and_build)
+
+
+class BuildTest(unittest.TestCase):
+ def test_layout_test_results(self):
+ build = Build(None, None, None, None)
+ build._fetch_results_html = lambda: None
+ # Test that layout_test_results() returns None if the fetch fails.
+ self.assertEqual(build.layout_test_results(), None)
+
+
+class BuildBotTest(unittest.TestCase):
+
+ _example_one_box_status = '''
+ <table>
+ <tr>
+ <td class="box"><a href="builders/Windows%20Debug%20%28Tests%29">Windows Debug (Tests)</a></td>
+ <td align="center" class="LastBuild box success"><a href="builders/Windows%20Debug%20%28Tests%29/builds/3693">47380</a><br />build<br />successful</td>
+ <td align="center" class="Activity building">building<br />ETA in<br />~ 14 mins<br />at 13:40</td>
+ <tr>
+ <td class="box"><a href="builders/SnowLeopard%20Intel%20Release">SnowLeopard Intel Release</a></td>
+ <td class="LastBuild box" >no build</td>
+ <td align="center" class="Activity building">building<br />< 1 min</td>
+ <tr>
+ <td class="box"><a href="builders/Qt%20Linux%20Release">Qt Linux Release</a></td>
+ <td align="center" class="LastBuild box failure"><a href="builders/Qt%20Linux%20Release/builds/654">47383</a><br />failed<br />compile-webkit</td>
+ <td align="center" class="Activity idle">idle<br />3 pending</td>
+ <tr>
+ <td class="box"><a href="builders/Qt%20Windows%2032-bit%20Debug">Qt Windows 32-bit Debug</a></td>
+ <td align="center" class="LastBuild box failure"><a href="builders/Qt%20Windows%2032-bit%20Debug/builds/2090">60563</a><br />failed<br />failed<br />slave<br />lost</td>
+ <td align="center" class="Activity building">building<br />ETA in<br />~ 5 mins<br />at 08:25</td>
+ </table>
+'''
+ _expected_example_one_box_parsings = [
+ {
+ 'is_green': True,
+ 'build_number' : 3693,
+ 'name': u'Windows Debug (Tests)',
+ 'built_revision': 47380,
+ 'activity': 'building',
+ 'pending_builds': 0,
+ },
+ {
+ 'is_green': False,
+ 'build_number' : None,
+ 'name': u'SnowLeopard Intel Release',
+ 'built_revision': None,
+ 'activity': 'building',
+ 'pending_builds': 0,
+ },
+ {
+ 'is_green': False,
+ 'build_number' : 654,
+ 'name': u'Qt Linux Release',
+ 'built_revision': 47383,
+ 'activity': 'idle',
+ 'pending_builds': 3,
+ },
+ {
+ 'is_green': True,
+ 'build_number' : 2090,
+ 'name': u'Qt Windows 32-bit Debug',
+ 'built_revision': 60563,
+ 'activity': 'building',
+ 'pending_builds': 0,
+ },
+ ]
+
+ def test_status_parsing(self):
+ buildbot = BuildBot()
+
+ soup = BeautifulSoup(self._example_one_box_status)
+ status_table = soup.find("table")
+ input_rows = status_table.findAll('tr')
+
+ for x in range(len(input_rows)):
+ status_row = input_rows[x]
+ expected_parsing = self._expected_example_one_box_parsings[x]
+
+ builder = buildbot._parse_builder_status_from_row(status_row)
+
+ # Make sure we aren't parsing more or less than we expect
+ self.assertEquals(builder.keys(), expected_parsing.keys())
+
+ for key, expected_value in expected_parsing.items():
+ self.assertEquals(builder[key], expected_value, ("Builder %d parse failure for key: %s: Actual='%s' Expected='%s'" % (x, key, builder[key], expected_value)))
+
+ def test_core_builder_methods(self):
+ buildbot = BuildBot()
+
+ # Override builder_statuses function to not touch the network.
+ def example_builder_statuses(): # We could use instancemethod() to bind 'self' but we don't need to.
+ return BuildBotTest._expected_example_one_box_parsings
+ buildbot.builder_statuses = example_builder_statuses
+
+ buildbot.core_builder_names_regexps = [ 'Leopard', "Windows.*Build" ]
+ self.assertEquals(buildbot.red_core_builders_names(), [])
+ self.assertTrue(buildbot.core_builders_are_green())
+
+ buildbot.core_builder_names_regexps = [ 'SnowLeopard', 'Qt' ]
+ self.assertEquals(buildbot.red_core_builders_names(), [ u'SnowLeopard Intel Release', u'Qt Linux Release' ])
+ self.assertFalse(buildbot.core_builders_are_green())
+
+ def test_builder_name_regexps(self):
+ buildbot = BuildBot()
+
+ # For complete testing, this list should match the list of builders at build.webkit.org:
+ example_builders = [
+ {'name': u'Tiger Intel Release', },
+ {'name': u'Leopard Intel Release (Build)', },
+ {'name': u'Leopard Intel Release (Tests)', },
+ {'name': u'Leopard Intel Debug (Build)', },
+ {'name': u'Leopard Intel Debug (Tests)', },
+ {'name': u'SnowLeopard Intel Release (Build)', },
+ {'name': u'SnowLeopard Intel Release (Tests)', },
+ {'name': u'SnowLeopard Intel Release (WebKit2 Tests)', },
+ {'name': u'SnowLeopard Intel Leaks', },
+ {'name': u'Windows Release (Build)', },
+ {'name': u'Windows Release (Tests)', },
+ {'name': u'Windows Debug (Build)', },
+ {'name': u'Windows Debug (Tests)', },
+ {'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', },
+ {'name': u'Qt Linux ARMv7 Release', },
+ {'name': u'Qt Windows 32-bit Release', },
+ {'name': u'Qt Windows 32-bit Debug', },
+ {'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 = [
+ "SnowLeopard.*Build",
+ "SnowLeopard.*\(Test",
+ "Leopard",
+ "Tiger",
+ "Windows.*Build",
+ "GTK.*32",
+ "GTK.*64.*Debug", # Disallow the 64-bit Release bot which is broken.
+ "Qt",
+ "Chromium.*Release$",
+ ]
+ expected_builders = [
+ {'name': u'Tiger Intel Release', },
+ {'name': u'Leopard Intel Release (Build)', },
+ {'name': u'Leopard Intel Release (Tests)', },
+ {'name': u'Leopard Intel Debug (Build)', },
+ {'name': u'Leopard Intel Debug (Tests)', },
+ {'name': u'SnowLeopard Intel Release (Build)', },
+ {'name': u'SnowLeopard Intel Release (Tests)', },
+ {'name': u'Windows Release (Build)', },
+ {'name': u'Windows Debug (Build)', },
+ {'name': u'GTK Linux 32-bit Release', },
+ {'name': u'GTK Linux 32-bit Debug', },
+ {'name': u'GTK Linux 64-bit Debug', },
+ {'name': u'Qt Linux Release', },
+ {'name': u'Qt Linux Release minimal', },
+ {'name': u'Qt Linux ARMv5 Release', },
+ {'name': u'Qt Linux ARMv7 Release', },
+ {'name': u'Qt Windows 32-bit Release', },
+ {'name': u'Qt Windows 32-bit Debug', },
+ {'name': u'Chromium Linux Release', },
+ {'name': u'Chromium Mac Release', },
+ {'name': u'Chromium Win Release', },
+ ]
+
+ # This test should probably be updated if the default regexp list changes
+ self.assertEquals(buildbot.core_builder_names_regexps, name_regexps)
+
+ builders = buildbot._builder_statuses_with_names_matching_regexps(example_builders, name_regexps)
+ self.assertEquals(builders, expected_builders)
+
+ def test_builder_with_name(self):
+ buildbot = BuildBot()
+
+ builder = buildbot.builder_with_name("Test Builder")
+ self.assertEqual(builder.name(), "Test Builder")
+ self.assertEqual(builder.url(), "http://build.webkit.org/builders/Test%20Builder")
+ self.assertEqual(builder.url_encoded_name(), "Test%20Builder")
+ self.assertEqual(builder.results_url(), "http://build.webkit.org/results/Test%20Builder")
+
+ # Override _fetch_xmlrpc_build_dictionary function to not touch the network.
+ def mock_fetch_xmlrpc_build_dictionary(self, build_number):
+ build_dictionary = {
+ "revision" : 2 * build_number,
+ "number" : int(build_number),
+ "results" : build_number % 2, # 0 means pass
+ }
+ return build_dictionary
+ buildbot._fetch_xmlrpc_build_dictionary = mock_fetch_xmlrpc_build_dictionary
+
+ build = builder.build(10)
+ self.assertEqual(build.builder(), builder)
+ self.assertEqual(build.url(), "http://build.webkit.org/builders/Test%20Builder/builds/10")
+ self.assertEqual(build.results_url(), "http://build.webkit.org/results/Test%20Builder/r20%20%2810%29")
+ self.assertEqual(build.revision(), 20)
+ self.assertEqual(build.is_green(), True)
+
+ build = build.previous_build()
+ self.assertEqual(build.builder(), builder)
+ self.assertEqual(build.url(), "http://build.webkit.org/builders/Test%20Builder/builds/9")
+ self.assertEqual(build.results_url(), "http://build.webkit.org/results/Test%20Builder/r18%20%289%29")
+ self.assertEqual(build.revision(), 18)
+ self.assertEqual(build.is_green(), False)
+
+ self.assertEqual(builder.build(None), None)
+
+ _example_directory_listing = '''
+<h1>Directory listing for /results/SnowLeopard Intel Leaks/</h1>
+
+<table>
+ <tr class="alt">
+ <th>Filename</th>
+ <th>Size</th>
+ <th>Content type</th>
+ <th>Content encoding</th>
+ </tr>
+<tr class="directory ">
+ <td><a href="r47483%20%281%29/"><b>r47483 (1)/</b></a></td>
+ <td><b></b></td>
+ <td><b>[Directory]</b></td>
+ <td><b></b></td>
+</tr>
+<tr class="file alt">
+ <td><a href="r47484%20%282%29.zip">r47484 (2).zip</a></td>
+ <td>89K</td>
+ <td>[application/zip]</td>
+ <td></td>
+</tr>
+'''
+ _expected_files = [
+ {
+ "filename" : "r47483 (1)/",
+ "size" : "",
+ "type" : "[Directory]",
+ "encoding" : "",
+ },
+ {
+ "filename" : "r47484 (2).zip",
+ "size" : "89K",
+ "type" : "[application/zip]",
+ "encoding" : "",
+ },
+ ]
+
+ def test_parse_build_to_revision_map(self):
+ buildbot = BuildBot()
+ files = buildbot._parse_twisted_directory_listing(self._example_directory_listing)
+ self.assertEqual(self._expected_files, files)
+
+ # Revision, is_green
+ # Ordered from newest (highest number) to oldest.
+ fake_builder1 = [
+ [2, False],
+ [1, True],
+ ]
+ fake_builder2 = [
+ [2, False],
+ [1, True],
+ ]
+ fake_builders = [
+ fake_builder1,
+ fake_builder2,
+ ]
+ def _build_from_fake(self, fake_builder, index):
+ if index >= len(fake_builder):
+ return None
+ fake_build = fake_builder[index]
+ build = Build(
+ builder=fake_builder,
+ build_number=index,
+ revision=fake_build[0],
+ is_green=fake_build[1],
+ )
+ def mock_previous_build():
+ return self._build_from_fake(fake_builder, index + 1)
+ build.previous_build = mock_previous_build
+ return build
+
+ def _fake_builds_at_index(self, index):
+ return [self._build_from_fake(builder, index) for builder in self.fake_builders]
+
+ def test_last_green_revision(self):
+ buildbot = BuildBot()
+ def mock_builds_from_builders(only_core_builders):
+ return self._fake_builds_at_index(0)
+ buildbot._latest_builds_from_builders = mock_builds_from_builders
+ self.assertEqual(buildbot.last_green_revision(), 1)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/credentials.py b/WebKitTools/Scripts/webkitpy/common/net/credentials.py
index 295c576..30480b3 100644
--- a/WebKitTools/Scripts/webkitpy/credentials.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/credentials.py
@@ -34,30 +34,42 @@ import os
import platform
import re
-from webkitpy.executive import Executive, ScriptError
-from webkitpy.webkit_logging import log
-from webkitpy.scm import Git
-from webkitpy.user import User
+from webkitpy.common.checkout.scm import Git
+from webkitpy.common.system.executive import Executive, ScriptError
+from webkitpy.common.system.user import User
+from webkitpy.common.system.deprecated_logging import log
+
+try:
+ # Use keyring, a cross platform keyring interface, as a fallback:
+ # http://pypi.python.org/pypi/keyring
+ import keyring
+except ImportError:
+ keyring = None
class Credentials(object):
+ _environ_prefix = "webkit_bugzilla_"
- def __init__(self, host, git_prefix=None, executive=None, cwd=os.getcwd()):
+ def __init__(self, host, git_prefix=None, executive=None, cwd=os.getcwd(),
+ keyring=keyring):
self.host = host
- self.git_prefix = git_prefix
+ self.git_prefix = "%s." % git_prefix if git_prefix else ""
self.executive = executive or Executive()
self.cwd = cwd
+ self._keyring = keyring
def _credentials_from_git(self):
- return [self._read_git_config("username"),
- self._read_git_config("password")]
-
- def _read_git_config(self, key):
- config_key = "%s.%s" % (self.git_prefix, key) if self.git_prefix \
- else key
- return self.executive.run_command(
- ["git", "config", "--get", config_key],
- error_handler=Executive.ignore_error).rstrip('\n')
+ try:
+ if not Git.in_working_directory(self.cwd):
+ return (None, None)
+ return (Git.read_git_config(self.git_prefix + "username"),
+ Git.read_git_config(self.git_prefix + "password"))
+ except OSError, e:
+ # Catch and ignore OSError exceptions such as "no such file
+ # or directory" (OSError errno 2), which imply that the Git
+ # command cannot be found/is not installed.
+ pass
+ return (None, None)
def _keychain_value_with_label(self, label, source_text):
match = re.search("%s\"(?P<value>.+)\"" % label,
@@ -108,26 +120,36 @@ class Credentials(object):
else:
return [None, None]
- def read_credentials(self):
- username = None
- password = None
+ def _read_environ(self, key):
+ environ_key = self._environ_prefix + key
+ return os.environ.get(environ_key.upper())
- try:
- if Git.in_working_directory(self.cwd):
- (username, password) = self._credentials_from_git()
- except OSError, e:
- # Catch and ignore OSError exceptions such as "no such file
- # or directory" (OSError errno 2), which imply that the Git
- # command cannot be found/is not installed.
- pass
+ def _credentials_from_environment(self):
+ return (self._read_environ("username"), self._read_environ("password"))
+
+ def _offer_to_store_credentials_in_keyring(self, username, password):
+ if not self._keyring:
+ return
+ if not User().confirm("Store password in system keyring?", User.DEFAULT_NO):
+ return
+ self._keyring.set_password(self.host, username, password)
+ def read_credentials(self):
+ username, password = self._credentials_from_environment()
+ # FIXME: We don't currently support pulling the username from one
+ # source and the password from a separate source.
+ if not username or not password:
+ username, password = self._credentials_from_git()
if not username or not password:
- (username, password) = self._credentials_from_keychain(username)
+ username, password = self._credentials_from_keychain(username)
+
+ if username and not password and self._keyring:
+ password = self._keyring.get_password(self.host, username)
if not username:
username = User.prompt("%s login: " % self.host)
if not password:
- password = getpass.getpass("%s password for %s: " % (self.host,
- username))
+ password = getpass.getpass("%s password for %s: " % (self.host, username))
+ self._offer_to_store_credentials_in_keyring(username, password)
- return [username, password]
+ return (username, password)
diff --git a/WebKitTools/Scripts/webkitpy/credentials_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
index 0bd5340..6f2d909 100644
--- a/WebKitTools/Scripts/webkitpy/credentials_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/credentials_unittest.py
@@ -26,13 +26,30 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from __future__ import with_statement
+
import os
import tempfile
import unittest
-from webkitpy.credentials import Credentials
-from webkitpy.executive import Executive
-from webkitpy.outputcapture import OutputCapture
-from webkitpy.mock import Mock
+from webkitpy.common.net.credentials import Credentials
+from webkitpy.common.system.executive import Executive
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+
+
+# FIXME: Other unit tests probably want this class.
+class _TemporaryDirectory(object):
+ def __init__(self, **kwargs):
+ self._kwargs = kwargs
+ self._directory_path = None
+
+ def __enter__(self):
+ self._directory_path = tempfile.mkdtemp(**self._kwargs)
+ return self._directory_path
+
+ def __exit__(self, type, value, traceback):
+ os.rmdir(self._directory_path)
+
class CredentialsTest(unittest.TestCase):
example_security_output = """keychain: "/Users/test/Library/Keychains/login.keychain"
@@ -101,27 +118,59 @@ password: "SECRETSAUCE"
self._assert_security_call()
self._assert_security_call(username="foo")
- def test_git_config_calls(self):
+ def test_credentials_from_environment(self):
executive_mock = Mock()
credentials = Credentials("example.com", executive=executive_mock)
- credentials._read_git_config("foo")
- executive_mock.run_command.assert_called_with(["git", "config", "--get", "foo"], error_handler=Executive.ignore_error)
- credentials = Credentials("example.com", git_prefix="test_prefix", executive=executive_mock)
- credentials._read_git_config("foo")
- executive_mock.run_command.assert_called_with(["git", "config", "--get", "test_prefix.foo"], error_handler=Executive.ignore_error)
+ saved_environ = os.environ.copy()
+ os.environ['WEBKIT_BUGZILLA_USERNAME'] = "foo"
+ os.environ['WEBKIT_BUGZILLA_PASSWORD'] = "bar"
+ username, password = credentials._credentials_from_environment()
+ self.assertEquals(username, "foo")
+ self.assertEquals(password, "bar")
+ os.environ = saved_environ
def test_read_credentials_without_git_repo(self):
+ # FIXME: This should share more code with test_keyring_without_git_repo
class FakeCredentials(Credentials):
def _is_mac_os_x(self):
return True
+
def _credentials_from_keychain(self, username):
- return ["test@webkit.org", "SECRETSAUCE"]
+ return ("test@webkit.org", "SECRETSAUCE")
+
+ def _credentials_from_environment(self):
+ return (None, None)
+
+ with _TemporaryDirectory(suffix="not_a_git_repo") as temp_dir_path:
+ credentials = FakeCredentials("bugs.webkit.org", cwd=temp_dir_path)
+ # FIXME: Using read_credentials here seems too broad as higher-priority
+ # credential source could be affected by the user's environment.
+ self.assertEqual(credentials.read_credentials(), ("test@webkit.org", "SECRETSAUCE"))
+
+
+ def test_keyring_without_git_repo(self):
+ # FIXME: This should share more code with test_read_credentials_without_git_repo
+ class MockKeyring(object):
+ def get_password(self, host, username):
+ return "NOMNOMNOM"
+
+ class FakeCredentials(Credentials):
+ def _is_mac_os_x(self):
+ return True
+
+ def _credentials_from_keychain(self, username):
+ return ("test@webkit.org", None)
+
+ def _credentials_from_environment(self):
+ return (None, None)
+
+ with _TemporaryDirectory(suffix="not_a_git_repo") as temp_dir_path:
+ credentials = FakeCredentials("fake.hostname", cwd=temp_dir_path, keyring=MockKeyring())
+ # FIXME: Using read_credentials here seems too broad as higher-priority
+ # credential source could be affected by the user's environment.
+ self.assertEqual(credentials.read_credentials(), ("test@webkit.org", "NOMNOMNOM"))
- temp_dir_path = tempfile.mkdtemp(suffix="not_a_git_repo")
- credentials = FakeCredentials("bugs.webkit.org", cwd=temp_dir_path)
- self.assertEqual(credentials.read_credentials(), ["test@webkit.org", "SECRETSAUCE"])
- os.rmdir(temp_dir_path)
if __name__ == '__main__':
unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/failuremap.py b/WebKitTools/Scripts/webkitpy/common/net/failuremap.py
new file mode 100644
index 0000000..e2d53ae
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/failuremap.py
@@ -0,0 +1,84 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+class FailureMap(object):
+ def __init__(self):
+ self._failures = []
+
+ def add_regression_window(self, builder, regression_window):
+ self._failures.append({
+ 'builder': builder,
+ 'regression_window': regression_window,
+ })
+
+ def is_empty(self):
+ return not self._failures
+
+ def failing_revisions(self):
+ failing_revisions = [failure_info['regression_window'].revisions()
+ for failure_info in self._failures]
+ return sorted(set(sum(failing_revisions, [])))
+
+ def builders_failing_for(self, revision):
+ return self._builders_failing_because_of([revision])
+
+ def tests_failing_for(self, revision):
+ tests = [failure_info['regression_window'].failing_tests()
+ for failure_info in self._failures
+ if revision in failure_info['regression_window'].revisions()
+ and failure_info['regression_window'].failing_tests()]
+ result = set()
+ for test in tests:
+ result = result.union(test)
+ return sorted(result)
+
+ def _old_failures(self, is_old_failure):
+ return filter(lambda revision: is_old_failure(revision),
+ self.failing_revisions())
+
+ def _builders_failing_because_of(self, revisions):
+ revision_set = set(revisions)
+ return [failure_info['builder'] for failure_info in self._failures
+ if revision_set.intersection(
+ failure_info['regression_window'].revisions())]
+
+ # FIXME: We should re-process old failures after some time delay.
+ # https://bugs.webkit.org/show_bug.cgi?id=36581
+ def filter_out_old_failures(self, is_old_failure):
+ old_failures = self._old_failures(is_old_failure)
+ old_failing_builder_names = set([builder.name()
+ for builder in self._builders_failing_because_of(old_failures)])
+
+ # We filter out all the failing builders that could have been caused
+ # by old_failures. We could miss some new failures this way, but
+ # emperically, this reduces the amount of spam we generate.
+ failures = self._failures
+ self._failures = [failure_info for failure_info in failures
+ if failure_info['builder'].name() not in old_failing_builder_names]
+ self._cache = {}
diff --git a/WebKitTools/Scripts/webkitpy/common/net/failuremap_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/failuremap_unittest.py
new file mode 100644
index 0000000..2f0b49d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/failuremap_unittest.py
@@ -0,0 +1,76 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.net.buildbot import Build
+from webkitpy.common.net.failuremap import *
+from webkitpy.common.net.regressionwindow import RegressionWindow
+from webkitpy.tool.mocktool import MockBuilder
+
+
+class FailureMapTest(unittest.TestCase):
+ builder1 = MockBuilder("Builder1")
+ builder2 = MockBuilder("Builder2")
+
+ build1a = Build(builder1, build_number=22, revision=1233, is_green=True)
+ build1b = Build(builder1, build_number=23, revision=1234, is_green=False)
+ build2a = Build(builder2, build_number=89, revision=1233, is_green=True)
+ build2b = Build(builder2, build_number=90, revision=1235, is_green=False)
+
+ regression_window1 = RegressionWindow(build1a, build1b, failing_tests=[u'test1', u'test1'])
+ regression_window2 = RegressionWindow(build2a, build2b, failing_tests=[u'test1'])
+
+ def _make_failure_map(self):
+ failure_map = FailureMap()
+ failure_map.add_regression_window(self.builder1, self.regression_window1)
+ failure_map.add_regression_window(self.builder2, self.regression_window2)
+ return failure_map
+
+ def test_failing_revisions(self):
+ failure_map = self._make_failure_map()
+ self.assertEquals(failure_map.failing_revisions(), [1234, 1235])
+
+ def test_new_failures(self):
+ failure_map = self._make_failure_map()
+ failure_map.filter_out_old_failures(lambda revision: False)
+ self.assertEquals(failure_map.failing_revisions(), [1234, 1235])
+
+ def test_new_failures_with_old_revisions(self):
+ failure_map = self._make_failure_map()
+ failure_map.filter_out_old_failures(lambda revision: revision == 1234)
+ self.assertEquals(failure_map.failing_revisions(), [])
+
+ def test_new_failures_with_more_old_revisions(self):
+ failure_map = self._make_failure_map()
+ failure_map.filter_out_old_failures(lambda revision: revision == 1235)
+ self.assertEquals(failure_map.failing_revisions(), [1234])
+
+ def test_tests_failing_for(self):
+ failure_map = self._make_failure_map()
+ self.assertEquals(failure_map.tests_failing_for(1234), [u'test1'])
diff --git a/WebKitTools/Scripts/webkitpy/common/net/irc/__init__.py b/WebKitTools/Scripts/webkitpy/common/net/irc/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/irc/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/common/net/irc/ircbot.py b/WebKitTools/Scripts/webkitpy/common/net/irc/ircbot.py
new file mode 100644
index 0000000..f742867
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/irc/ircbot.py
@@ -0,0 +1,91 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import webkitpy.common.config.irc as config_irc
+
+from webkitpy.common.thread.messagepump import MessagePump, MessagePumpDelegate
+from webkitpy.thirdparty.autoinstalled.irc import ircbot
+from webkitpy.thirdparty.autoinstalled.irc import irclib
+
+
+class IRCBotDelegate(object):
+ def irc_message_received(self, nick, message):
+ raise NotImplementedError, "subclasses must implement"
+
+ def irc_nickname(self):
+ raise NotImplementedError, "subclasses must implement"
+
+ def irc_password(self):
+ raise NotImplementedError, "subclasses must implement"
+
+
+class IRCBot(ircbot.SingleServerIRCBot, MessagePumpDelegate):
+ # FIXME: We should get this information from a config file.
+ def __init__(self,
+ message_queue,
+ delegate):
+ self._message_queue = message_queue
+ self._delegate = delegate
+ ircbot.SingleServerIRCBot.__init__(
+ self,
+ [(
+ config_irc.server,
+ config_irc.port,
+ self._delegate.irc_password()
+ )],
+ self._delegate.irc_nickname(),
+ self._delegate.irc_nickname())
+ self._channel = config_irc.channel
+
+ # ircbot.SingleServerIRCBot methods
+
+ def on_nicknameinuse(self, connection, event):
+ connection.nick(connection.get_nickname() + "_")
+
+ def on_welcome(self, connection, event):
+ connection.join(self._channel)
+ self._message_pump = MessagePump(self, self._message_queue)
+
+ def on_pubmsg(self, connection, event):
+ nick = irclib.nm_to_n(event.source())
+ request = event.arguments()[0].split(":", 1)
+ if len(request) > 1 and irclib.irc_lower(request[0]) == irclib.irc_lower(self.connection.get_nickname()):
+ response = self._delegate.irc_message_received(nick, request[1])
+ if response:
+ connection.privmsg(self._channel, response)
+
+ # MessagePumpDelegate methods
+
+ def schedule(self, interval, callback):
+ self.connection.execute_delayed(interval, callback)
+
+ def message_available(self, message):
+ self.connection.privmsg(self._channel, message)
+
+ def final_message_delivered(self):
+ self.die()
diff --git a/WebKitTools/pywebsocket/setup.py b/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy.py
index 9729322..13348b4 100644
--- a/WebKitTools/pywebsocket/setup.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy.py
@@ -1,7 +1,4 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
+# Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -29,35 +26,37 @@
# (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 threading
-"""Set up script for mod_pywebsocket.
-"""
-
+from webkitpy.common.net.irc.ircbot import IRCBot
+from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
+from webkitpy.common.system.deprecated_logging import log
-from distutils.core import setup
-import sys
+class _IRCThread(threading.Thread):
+ def __init__(self, message_queue, irc_delegate, irc_bot):
+ threading.Thread.__init__(self)
+ self.setDaemon(True)
+ self._message_queue = message_queue
+ self._irc_delegate = irc_delegate
+ self._irc_bot = irc_bot
-_PACKAGE_NAME = 'mod_pywebsocket'
+ def run(self):
+ bot = self._irc_bot(self._message_queue, self._irc_delegate)
+ bot.start()
-if sys.version < '2.3':
- print >>sys.stderr, '%s requires Python 2.3 or later.' % _PACKAGE_NAME
- sys.exit(1)
-setup(author='Yuzo Fujishima',
- author_email='yuzo@chromium.org',
- description='Web Socket extension for Apache HTTP Server.',
- long_description=(
- 'mod_pywebsocket is an Apache HTTP Server extension for '
- 'Web Socket (http://tools.ietf.org/html/'
- 'draft-hixie-thewebsocketprotocol). '
- 'See mod_pywebsocket/__init__.py for more detail.'),
- license='See COPYING',
- name=_PACKAGE_NAME,
- packages=[_PACKAGE_NAME],
- url='http://code.google.com/p/pywebsocket/',
- version='0.4.8',
- )
+class IRCProxy(object):
+ def __init__(self, irc_delegate, irc_bot=IRCBot):
+ log("Connecting to IRC")
+ self._message_queue = ThreadedMessageQueue()
+ self._child_thread = _IRCThread(self._message_queue, irc_delegate, irc_bot)
+ self._child_thread.start()
+ def post(self, message):
+ self._message_queue.post(message)
-# vi:sts=4 sw=4 et
+ def disconnect(self):
+ log("Disconnecting from IRC...")
+ self._message_queue.stop()
+ self._child_thread.join()
diff --git a/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py
new file mode 100644
index 0000000..b44ce40
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/irc/ircproxy_unittest.py
@@ -0,0 +1,43 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.net.irc.ircproxy import IRCProxy
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+
+class IRCProxyTest(unittest.TestCase):
+ def test_trivial(self):
+ def fun():
+ proxy = IRCProxy(Mock(), Mock())
+ proxy.post("hello")
+ proxy.disconnect()
+
+ expected_stderr = "Connecting to IRC\nDisconnecting from IRC...\n"
+ OutputCapture().assert_outputs(self, fun, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/common/net/layouttestresults.py b/WebKitTools/Scripts/webkitpy/common/net/layouttestresults.py
new file mode 100644
index 0000000..a7b3b0a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/layouttestresults.py
@@ -0,0 +1,90 @@
+# Copyright (c) 2010, Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# A module for parsing results.html files generated by old-run-webkit-tests
+
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup, SoupStrainer
+
+
+# FIXME: This should be unified with all the layout test results code in the layout_tests package
+# This doesn't belong in common.net, but we don't have a better place for it yet.
+def path_for_layout_test(test_name):
+ return "LayoutTests/%s" % test_name
+
+
+# FIXME: This should be unified with all the layout test results code in the layout_tests package
+# This doesn't belong in common.net, but we don't have a better place for it yet.
+class LayoutTestResults(object):
+ """This class knows how to parse old-run-webkit-tests results.html files."""
+
+ stderr_key = u'Tests that had stderr output:'
+ fail_key = u'Tests where results did not match expected results:'
+ timeout_key = u'Tests that timed out:'
+ crash_key = u'Tests that caused the DumpRenderTree tool to crash:'
+ missing_key = u'Tests that had no expected results (probably new):'
+
+ expected_keys = [
+ stderr_key,
+ fail_key,
+ crash_key,
+ timeout_key,
+ missing_key,
+ ]
+
+ @classmethod
+ def _parse_results_html(cls, page):
+ if not page:
+ return None
+ parsed_results = {}
+ tables = BeautifulSoup(page).findAll("table")
+ for table in tables:
+ table_title = unicode(table.findPreviousSibling("p").string)
+ if table_title not in cls.expected_keys:
+ # This Exception should only ever be hit if run-webkit-tests changes its results.html format.
+ raise Exception("Unhandled title: %s" % table_title)
+ # We might want to translate table titles into identifiers before storing.
+ parsed_results[table_title] = [unicode(row.find("a").string) for row in table.findAll("tr")]
+
+ return parsed_results
+
+ @classmethod
+ def results_from_string(cls, string):
+ parsed_results = cls._parse_results_html(string)
+ if not parsed_results:
+ return None
+ return cls(parsed_results)
+
+ def __init__(self, parsed_results):
+ self._parsed_results = parsed_results
+
+ def parsed_results(self):
+ return self._parsed_results
+
+ def failing_tests(self):
+ failing_keys = [self.fail_key, self.crash_key, self.timeout_key]
+ return sorted(sum([tests for key, tests in self._parsed_results.items() if key in failing_keys], []))
diff --git a/WebKitTools/Scripts/webkitpy/common/net/layouttestresults_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
new file mode 100644
index 0000000..8490eae
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/layouttestresults_unittest.py
@@ -0,0 +1,77 @@
+# Copyright (c) 2010, Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.net.layouttestresults import LayoutTestResults
+
+
+class LayoutTestResultsTest(unittest.TestCase):
+ _example_results_html = """
+<html>
+<head>
+<title>Layout Test Results</title>
+</head>
+<body>
+<p>Tests that had stderr output:</p>
+<table>
+<tr>
+<td><a href="/var/lib/buildbot/build/gtk-linux-64-release/build/LayoutTests/accessibility/aria-activedescendant-crash.html">accessibility/aria-activedescendant-crash.html</a></td>
+<td><a href="accessibility/aria-activedescendant-crash-stderr.txt">stderr</a></td>
+</tr>
+<td><a href="/var/lib/buildbot/build/gtk-linux-64-release/build/LayoutTests/http/tests/security/canvas-remote-read-svg-image.html">http/tests/security/canvas-remote-read-svg-image.html</a></td>
+<td><a href="http/tests/security/canvas-remote-read-svg-image-stderr.txt">stderr</a></td>
+</tr>
+</table><p>Tests that had no expected results (probably new):</p>
+<table>
+<tr>
+<td><a href="/var/lib/buildbot/build/gtk-linux-64-release/build/LayoutTests/fast/repaint/no-caret-repaint-in-non-content-editable-element.html">fast/repaint/no-caret-repaint-in-non-content-editable-element.html</a></td>
+<td><a href="fast/repaint/no-caret-repaint-in-non-content-editable-element-actual.txt">result</a></td>
+</tr>
+</table></body>
+</html>
+"""
+
+ _expected_layout_test_results = {
+ 'Tests that had stderr output:': [
+ 'accessibility/aria-activedescendant-crash.html',
+ ],
+ 'Tests that had no expected results (probably new):': [
+ 'fast/repaint/no-caret-repaint-in-non-content-editable-element.html',
+ ],
+ }
+
+ def test_parse_layout_test_results(self):
+ results = LayoutTestResults._parse_results_html(self._example_results_html)
+ self.assertEqual(self._expected_layout_test_results, results)
+
+ def test_results_from_string(self):
+ self.assertEqual(LayoutTestResults.results_from_string(None), None)
+ self.assertEqual(LayoutTestResults.results_from_string(""), None)
+ results = LayoutTestResults.results_from_string(self._example_results_html)
+ self.assertEqual(len(results.failing_tests()), 0)
diff --git a/WebKitTools/Scripts/webkitpy/networktransaction.py b/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
index 65ea27d..de19e94 100644
--- a/WebKitTools/Scripts/webkitpy/networktransaction.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/networktransaction.py
@@ -26,10 +26,14 @@
# (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 logging
import time
-from mechanize import HTTPError
-from webkitpy.webkit_logging import log
+from webkitpy.thirdparty.autoinstalled import mechanize
+from webkitpy.common.system.deprecated_logging import log
+
+
+_log = logging.getLogger(__name__)
class NetworkTimeout(Exception):
@@ -37,10 +41,11 @@ class NetworkTimeout(Exception):
class NetworkTransaction(object):
- def __init__(self, initial_backoff_seconds=10, grown_factor=1.1, timeout_seconds=5*60*60):
+ def __init__(self, initial_backoff_seconds=10, grown_factor=1.5, timeout_seconds=(10 * 60), convert_404_to_None=False):
self._initial_backoff_seconds = initial_backoff_seconds
self._grown_factor = grown_factor
self._timeout_seconds = timeout_seconds
+ self._convert_404_to_None = convert_404_to_None
def run(self, request):
self._total_sleep = 0
@@ -48,9 +53,13 @@ class NetworkTransaction(object):
while True:
try:
return request()
- except HTTPError, e:
+ # FIXME: We should catch urllib2.HTTPError here too.
+ except mechanize.HTTPError, e:
+ if self._convert_404_to_None and e.code == 404:
+ return None
self._check_for_timeout()
- log("Received HTTP status %s from server. Retrying in %s seconds..." % (e.code, self._backoff_seconds))
+ _log.warn("Received HTTP status %s from server. Retrying in "
+ "%s seconds..." % (e.code, self._backoff_seconds))
self._sleep()
def _check_for_timeout(self):
diff --git a/WebKitTools/Scripts/webkitpy/networktransaction_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py
index 3cffe02..49aaeed 100644
--- a/WebKitTools/Scripts/webkitpy/networktransaction_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/networktransaction_unittest.py
@@ -28,10 +28,12 @@
import unittest
-from mechanize import HTTPError
-from webkitpy.networktransaction import NetworkTransaction, NetworkTimeout
+from webkitpy.common.net.networktransaction import NetworkTransaction, NetworkTimeout
+from webkitpy.common.system.logtesting import LoggingTestCase
+from webkitpy.thirdparty.autoinstalled.mechanize import HTTPError
-class NetworkTransactionTest(unittest.TestCase):
+
+class NetworkTransactionTest(LoggingTestCase):
exception = Exception("Test exception")
def test_success(self):
@@ -54,17 +56,28 @@ class NetworkTransactionTest(unittest.TestCase):
self.assertTrue(did_throw_exception)
self.assertTrue(did_process_exception)
- def _raise_http_error(self):
+ def _raise_500_error(self):
self._run_count += 1
if self._run_count < 3:
- raise HTTPError("http://example.com/", 500, "inteneral server error", None, None)
+ raise HTTPError("http://example.com/", 500, "internal server error", None, None)
return 42
+ def _raise_404_error(self):
+ raise HTTPError("http://foo.com/", 404, "not found", None, None)
+
def test_retry(self):
self._run_count = 0
transaction = NetworkTransaction(initial_backoff_seconds=0)
- self.assertEqual(transaction.run(lambda: self._raise_http_error()), 42)
+ self.assertEqual(transaction.run(lambda: self._raise_500_error()), 42)
self.assertEqual(self._run_count, 3)
+ self.assertLog(['WARNING: Received HTTP status 500 from server. '
+ 'Retrying in 0 seconds...\n',
+ 'WARNING: Received HTTP status 500 from server. '
+ 'Retrying in 0.0 seconds...\n'])
+
+ def test_convert_404_to_None(self):
+ transaction = NetworkTransaction(convert_404_to_None=True)
+ self.assertEqual(transaction.run(lambda: self._raise_404_error()), None)
def test_timeout(self):
self._run_count = 0
@@ -72,7 +85,7 @@ class NetworkTransactionTest(unittest.TestCase):
did_process_exception = False
did_throw_exception = True
try:
- transaction.run(lambda: self._raise_http_error())
+ transaction.run(lambda: self._raise_500_error())
did_throw_exception = False
except NetworkTimeout, e:
did_process_exception = True
diff --git a/WebKitTools/Scripts/webkitpy/common/net/regressionwindow.py b/WebKitTools/Scripts/webkitpy/common/net/regressionwindow.py
new file mode 100644
index 0000000..ad89815
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/regressionwindow.py
@@ -0,0 +1,51 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+class RegressionWindow(object):
+ def __init__(self, build_before_failure, failing_build, failing_tests=None):
+ self._build_before_failure = build_before_failure
+ self._failing_build = failing_build
+ self._failing_tests = failing_tests
+ self._revisions = None
+
+ def build_before_failure(self):
+ return self._build_before_failure
+
+ def failing_build(self):
+ return self._failing_build
+
+ def failing_tests(self):
+ return self._failing_tests
+
+ def revisions(self):
+ # Cache revisions to avoid excessive allocations.
+ if not self._revisions:
+ self._revisions = range(self._failing_build.revision(), self._build_before_failure.revision(), -1)
+ self._revisions.reverse()
+ return self._revisions
diff --git a/WebKitTools/Scripts/webkitpy/common/net/statusserver.py b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
new file mode 100644
index 0000000..64dd77b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/net/statusserver.py
@@ -0,0 +1,160 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from webkitpy.common.net.networktransaction import NetworkTransaction
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.thirdparty.autoinstalled.mechanize import Browser
+from webkitpy.thirdparty.BeautifulSoup import BeautifulSoup
+
+import logging
+import urllib2
+
+
+_log = logging.getLogger("webkitpy.common.net.statusserver")
+
+
+class StatusServer:
+ default_host = "queues.webkit.org"
+
+ def __init__(self, host=default_host, browser=None, bot_id=None):
+ self.set_host(host)
+ self._browser = browser or Browser()
+ self.set_bot_id(bot_id)
+
+ def set_host(self, host):
+ self.host = host
+ self.url = "http://%s" % self.host
+
+ def set_bot_id(self, bot_id):
+ self.bot_id = bot_id
+
+ def results_url_for_status(self, status_id):
+ return "%s/results/%s" % (self.url, status_id)
+
+ def _add_patch(self, patch):
+ if not patch:
+ return
+ if patch.bug_id():
+ self._browser["bug_id"] = unicode(patch.bug_id())
+ if patch.id():
+ self._browser["patch_id"] = unicode(patch.id())
+
+ def _add_results_file(self, results_file):
+ if not results_file:
+ return
+ self._browser.add_file(results_file, "text/plain", "results.txt", 'results_file')
+
+ def _post_status_to_server(self, queue_name, status, patch, results_file):
+ if results_file:
+ # We might need to re-wind the file if we've already tried to post it.
+ results_file.seek(0)
+
+ update_status_url = "%s/update-status" % self.url
+ self._browser.open(update_status_url)
+ self._browser.select_form(name="update_status")
+ self._browser["queue_name"] = queue_name
+ if self.bot_id:
+ self._browser["bot_id"] = self.bot_id
+ self._add_patch(patch)
+ self._browser["status"] = status
+ self._add_results_file(results_file)
+ return self._browser.submit().read() # This is the id of the newly created status object.
+
+ def _post_svn_revision_to_server(self, svn_revision_number, broken_bot):
+ update_svn_revision_url = "%s/update-svn-revision" % self.url
+ self._browser.open(update_svn_revision_url)
+ self._browser.select_form(name="update_svn_revision")
+ self._browser["number"] = unicode(svn_revision_number)
+ self._browser["broken_bot"] = broken_bot
+ return self._browser.submit().read()
+
+ def _post_work_items_to_server(self, queue_name, work_items):
+ update_work_items_url = "%s/update-work-items" % self.url
+ self._browser.open(update_work_items_url)
+ self._browser.select_form(name="update_work_items")
+ self._browser["queue_name"] = queue_name
+ work_items = map(unicode, work_items) # .join expects strings
+ self._browser["work_items"] = " ".join(work_items)
+ return self._browser.submit().read()
+
+ def _post_work_item_to_ews(self, attachment_id):
+ submit_to_ews_url = "%s/submit-to-ews" % self.url
+ self._browser.open(submit_to_ews_url)
+ self._browser.select_form(name="submit_to_ews")
+ self._browser["attachment_id"] = unicode(attachment_id)
+ self._browser.submit()
+
+ def submit_to_ews(self, attachment_id):
+ _log.info("Submitting attachment %s to EWS queues" % attachment_id)
+ return NetworkTransaction().run(lambda: self._post_work_item_to_ews(attachment_id))
+
+ def next_work_item(self, queue_name):
+ _log.debug("Fetching next work item for %s" % queue_name)
+ patch_status_url = "%s/next-patch/%s" % (self.url, queue_name)
+ return self._fetch_url(patch_status_url)
+
+ def _post_release_work_item(self, queue_name, patch):
+ release_patch_url = "%s/release-patch" % (self.url)
+ self._browser.open(release_patch_url)
+ self._browser.select_form(name="release_patch")
+ self._browser["queue_name"] = queue_name
+ self._browser["attachment_id"] = unicode(patch.id())
+ self._browser.submit()
+
+ def release_work_item(self, queue_name, patch):
+ _log.info("Releasing work item %s from %s" % (patch.id(), queue_name))
+ return NetworkTransaction(convert_404_to_None=True).run(lambda: self._post_release_work_item(queue_name, patch))
+
+ def update_work_items(self, queue_name, work_items):
+ _log.debug("Recording work items: %s for %s" % (work_items, queue_name))
+ return NetworkTransaction().run(lambda: self._post_work_items_to_server(queue_name, work_items))
+
+ def update_status(self, queue_name, status, patch=None, results_file=None):
+ log(status)
+ return NetworkTransaction().run(lambda: self._post_status_to_server(queue_name, status, patch, results_file))
+
+ def update_svn_revision(self, svn_revision_number, broken_bot):
+ log("SVN revision: %s broke %s" % (svn_revision_number, broken_bot))
+ return NetworkTransaction().run(lambda: self._post_svn_revision_to_server(svn_revision_number, broken_bot))
+
+ def _fetch_url(self, url):
+ # FIXME: This should use NetworkTransaction's 404 handling instead.
+ try:
+ return urllib2.urlopen(url).read()
+ except urllib2.HTTPError, e:
+ if e.code == 404:
+ return None
+ raise e
+
+ def patch_status(self, queue_name, patch_id):
+ patch_status_url = "%s/patch-status/%s/%s" % (self.url, queue_name, patch_id)
+ return self._fetch_url(patch_status_url)
+
+ def svn_revision(self, svn_revision_number):
+ svn_revision_url = "%s/svn-revision/%s" % (self.url, svn_revision_number)
+ return self._fetch_url(svn_revision_url)
diff --git a/WebKitTools/pywebsocket/test/run_all.py b/WebKitTools/Scripts/webkitpy/common/net/statusserver_unittest.py
index 3885618..1169ba0 100644
--- a/WebKitTools/pywebsocket/test/run_all.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/statusserver_unittest.py
@@ -1,7 +1,4 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
+# Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -29,36 +26,18 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Run all tests in the same directory.
-"""
-
-
-import os
-import re
import unittest
-
-_TEST_MODULE_PATTERN = re.compile(r'^(test_.+)\.py$')
-
-
-def _list_test_modules(directory):
- module_names = []
- for filename in os.listdir(directory):
- match = _TEST_MODULE_PATTERN.search(filename)
- if match:
- module_names.append(match.group(1))
- return module_names
-
-
-def _suite():
- loader = unittest.TestLoader()
- return loader.loadTestsFromNames(
- _list_test_modules(os.path.join(os.path.split(__file__)[0], '.')))
-
-
-if __name__ == '__main__':
- unittest.main(defaultTest='_suite')
+from webkitpy.common.net.statusserver import StatusServer
+from webkitpy.common.system.outputcapture import OutputCaptureTestCaseBase
+from webkitpy.tool.mocktool import MockBrowser
-# vi:sts=4 sw=4 et
+class StatusServerTest(OutputCaptureTestCaseBase):
+ def test_url_for_issue(self):
+ mock_browser = MockBrowser()
+ status_server = StatusServer(browser=mock_browser, bot_id='123')
+ status_server.update_status('queue name', 'the status')
+ self.assertEqual('queue name', mock_browser.params['queue_name'])
+ self.assertEqual('the status', mock_browser.params['status'])
+ self.assertEqual('123', mock_browser.params['bot_id'])
diff --git a/WebKitTools/Scripts/webkitpy/common/newstringio.py b/WebKitTools/Scripts/webkitpy/common/newstringio.py
new file mode 100644
index 0000000..f6d08ec
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/newstringio.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""'with'-compliant StringIO implementation."""
+
+import StringIO
+
+
+class StringIO(StringIO.StringIO):
+ def __enter__(self):
+ return self
+
+ def __exit__(self, type, value, traceback):
+ pass
diff --git a/WebKitTools/Scripts/webkitpy/common/newstringio_unittest.py b/WebKitTools/Scripts/webkitpy/common/newstringio_unittest.py
new file mode 100644
index 0000000..5755c98
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/newstringio_unittest.py
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for newstringio module."""
+
+from __future__ import with_statement
+
+import unittest
+
+import newstringio
+
+
+class NewStringIOTest(unittest.TestCase):
+ def test_with(self):
+ with newstringio.StringIO("foo") as f:
+ contents = f.read()
+ self.assertEqual(contents, "foo")
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/prettypatch.py b/WebKitTools/Scripts/webkitpy/common/prettypatch.py
new file mode 100644
index 0000000..4e92a53
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/prettypatch.py
@@ -0,0 +1,66 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import tempfile
+
+
+class PrettyPatch(object):
+ # FIXME: PrettyPatch should not require checkout_root.
+ def __init__(self, executive, checkout_root):
+ self._executive = executive
+ self._checkout_root = checkout_root
+
+ def pretty_diff_file(self, diff):
+ # Diffs can contain multiple text files of different encodings
+ # so we always deal with them as byte arrays, not unicode strings.
+ assert(isinstance(diff, str))
+ pretty_diff = self.pretty_diff(diff)
+ diff_file = tempfile.NamedTemporaryFile(suffix=".html")
+ diff_file.write(pretty_diff)
+ diff_file.flush()
+ return diff_file
+
+ def pretty_diff(self, diff):
+ # pretify.rb will hang forever if given no input.
+ # Avoid the hang by returning an empty string.
+ if not diff:
+ return ""
+
+ pretty_patch_path = os.path.join(self._checkout_root,
+ "BugsSite", "PrettyPatch")
+ prettify_path = os.path.join(pretty_patch_path, "prettify.rb")
+ args = [
+ "ruby",
+ "-I",
+ pretty_patch_path,
+ prettify_path,
+ ]
+ # PrettyPatch does not modify the encoding of the diff output
+ # so we can't expect it to be utf-8.
+ return self._executive.run_command(args, input=diff, decode_output=False)
diff --git a/WebKitTools/Scripts/webkitpy/common/prettypatch_unittest.py b/WebKitTools/Scripts/webkitpy/common/prettypatch_unittest.py
new file mode 100644
index 0000000..1307856
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/prettypatch_unittest.py
@@ -0,0 +1,70 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os.path
+import unittest
+
+from webkitpy.common.system.executive import Executive
+from webkitpy.common.prettypatch import PrettyPatch
+
+
+class PrettyPatchTest(unittest.TestCase):
+
+ _diff_with_multiple_encodings = """
+Index: utf8_test
+===================================================================
+--- utf8_test\t(revision 0)
++++ utf8_test\t(revision 0)
+@@ -0,0 +1 @@
++utf-8 test: \xc2\xa0
+Index: latin1_test
+===================================================================
+--- latin1_test\t(revision 0)
++++ latin1_test\t(revision 0)
+@@ -0,0 +1 @@
++latin1 test: \xa0
+"""
+
+ def _webkit_root(self):
+ webkitpy_common = os.path.dirname(__file__)
+ webkitpy = os.path.dirname(webkitpy_common)
+ scripts = os.path.dirname(webkitpy)
+ webkit_tools = os.path.dirname(scripts)
+ webkit_root = os.path.dirname(webkit_tools)
+ return webkit_root
+
+ def test_pretty_diff_encodings(self):
+ pretty_patch = PrettyPatch(Executive(), self._webkit_root())
+ pretty = pretty_patch.pretty_diff(self._diff_with_multiple_encodings)
+ self.assertTrue(pretty) # We got some output
+ self.assertTrue(isinstance(pretty, str)) # It's a byte array, not unicode
+
+ def test_pretty_print_empty_string(self):
+ # Make sure that an empty diff does not hang the process.
+ pretty_patch = PrettyPatch(Executive(), self._webkit_root())
+ self.assertEqual(pretty_patch.pretty_diff(""), "")
diff --git a/WebKitTools/Scripts/webkitpy/common/system/__init__.py b/WebKitTools/Scripts/webkitpy/common/system/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/common/system/autoinstall.py b/WebKitTools/Scripts/webkitpy/common/system/autoinstall.py
new file mode 100755
index 0000000..9adab29
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/autoinstall.py
@@ -0,0 +1,517 @@
+# Copyright (c) 2009, Daniel Krech All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the name of the Daniel Krech nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER 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.
+
+"""Support for automatically downloading Python packages from an URL."""
+
+
+from __future__ import with_statement
+
+import codecs
+import logging
+import new
+import os
+import shutil
+import sys
+import tarfile
+import tempfile
+import urllib
+import urlparse
+import zipfile
+import zipimport
+
+_log = logging.getLogger(__name__)
+
+
+class AutoInstaller(object):
+
+ """Supports automatically installing Python packages from an URL.
+
+ Supports uncompressed files, .tar.gz, and .zip formats.
+
+ Basic usage:
+
+ installer = AutoInstaller()
+
+ installer.install(url="http://pypi.python.org/packages/source/p/pep8/pep8-0.5.0.tar.gz#md5=512a818af9979290cd619cce8e9c2e2b",
+ url_subpath="pep8-0.5.0/pep8.py")
+ installer.install(url="http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip",
+ url_subpath="mechanize")
+
+ """
+
+ def __init__(self, append_to_search_path=False, make_package=True,
+ target_dir=None, temp_dir=None):
+ """Create an AutoInstaller instance, and set up the target directory.
+
+ Args:
+ append_to_search_path: A boolean value of whether to append the
+ target directory to the sys.path search path.
+ make_package: A boolean value of whether to make the target
+ directory a package. This adds an __init__.py file
+ to the target directory -- allowing packages and
+ modules within the target directory to be imported
+ explicitly using dotted module names.
+ target_dir: The directory path to which packages should be installed.
+ Defaults to a subdirectory of the folder containing
+ this module called "autoinstalled".
+ temp_dir: The directory path to use for any temporary files
+ generated while downloading, unzipping, and extracting
+ packages to install. Defaults to a standard temporary
+ location generated by the tempfile module. This
+ parameter should normally be used only for development
+ testing.
+
+ """
+ if target_dir is None:
+ this_dir = os.path.dirname(__file__)
+ target_dir = os.path.join(this_dir, "autoinstalled")
+
+ # Ensure that the target directory exists.
+ self._set_up_target_dir(target_dir, append_to_search_path, make_package)
+
+ self._target_dir = target_dir
+ self._temp_dir = temp_dir
+
+ def _log_transfer(self, message, source, target, log_method=None):
+ """Log a debug message that involves a source and target."""
+ if log_method is None:
+ log_method = _log.debug
+
+ log_method("%s" % message)
+ log_method(' From: "%s"' % source)
+ log_method(' To: "%s"' % target)
+
+ def _create_directory(self, path, name=None):
+ """Create a directory."""
+ log = _log.debug
+
+ name = name + " " if name is not None else ""
+ log('Creating %sdirectory...' % name)
+ log(' "%s"' % path)
+
+ os.makedirs(path)
+
+ def _write_file(self, path, text, encoding):
+ """Create a file at the given path with given text.
+
+ This method overwrites any existing file.
+
+ """
+ _log.debug("Creating file...")
+ _log.debug(' "%s"' % path)
+ with codecs.open(path, "w", encoding) as file:
+ file.write(text)
+
+ def _set_up_target_dir(self, target_dir, append_to_search_path,
+ make_package):
+ """Set up a target directory.
+
+ Args:
+ target_dir: The path to the target directory to set up.
+ append_to_search_path: A boolean value of whether to append the
+ target directory to the sys.path search path.
+ make_package: A boolean value of whether to make the target
+ directory a package. This adds an __init__.py file
+ to the target directory -- allowing packages and
+ modules within the target directory to be imported
+ explicitly using dotted module names.
+
+ """
+ if not os.path.exists(target_dir):
+ self._create_directory(target_dir, "autoinstall target")
+
+ if append_to_search_path:
+ sys.path.append(target_dir)
+
+ if make_package:
+ init_path = os.path.join(target_dir, "__init__.py")
+ if not os.path.exists(init_path):
+ text = ("# This file is required for Python to search this "
+ "directory for modules.\n")
+ self._write_file(init_path, text, "ascii")
+
+ def _create_scratch_directory_inner(self, prefix):
+ """Create a scratch directory without exception handling.
+
+ Creates a scratch directory inside the AutoInstaller temp
+ directory self._temp_dir, or inside a platform-dependent temp
+ directory if self._temp_dir is None. Returns the path to the
+ created scratch directory.
+
+ Raises:
+ OSError: [Errno 2] if the containing temp directory self._temp_dir
+ is not None and does not exist.
+
+ """
+ # The tempfile.mkdtemp() method function requires that the
+ # directory corresponding to the "dir" parameter already exist
+ # if it is not None.
+ scratch_dir = tempfile.mkdtemp(prefix=prefix, dir=self._temp_dir)
+ return scratch_dir
+
+ def _create_scratch_directory(self, target_name):
+ """Create a temporary scratch directory, and return its path.
+
+ The scratch directory is generated inside the temp directory
+ of this AutoInstaller instance. This method also creates the
+ temp directory if it does not already exist.
+
+ """
+ prefix = target_name + "_"
+ try:
+ scratch_dir = self._create_scratch_directory_inner(prefix)
+ except OSError:
+ # Handle case of containing temp directory not existing--
+ # OSError: [Errno 2] No such file or directory:...
+ temp_dir = self._temp_dir
+ if temp_dir is None or os.path.exists(temp_dir):
+ raise
+ # Else try again after creating the temp directory.
+ self._create_directory(temp_dir, "autoinstall temp")
+ scratch_dir = self._create_scratch_directory_inner(prefix)
+
+ return scratch_dir
+
+ def _url_downloaded_path(self, target_name):
+ """Return the path to the file containing the URL downloaded."""
+ filename = ".%s.url" % target_name
+ path = os.path.join(self._target_dir, filename)
+ return path
+
+ def _is_downloaded(self, target_name, url):
+ """Return whether a package version has been downloaded."""
+ version_path = self._url_downloaded_path(target_name)
+
+ _log.debug('Checking %s URL downloaded...' % target_name)
+ _log.debug(' "%s"' % version_path)
+
+ if not os.path.exists(version_path):
+ # Then no package version has been downloaded.
+ _log.debug("No URL file found.")
+ return False
+
+ with codecs.open(version_path, "r", "utf-8") as file:
+ version = file.read()
+
+ return version.strip() == url.strip()
+
+ def _record_url_downloaded(self, target_name, url):
+ """Record the URL downloaded to a file."""
+ version_path = self._url_downloaded_path(target_name)
+ _log.debug("Recording URL downloaded...")
+ _log.debug(' URL: "%s"' % url)
+ _log.debug(' To: "%s"' % version_path)
+
+ self._write_file(version_path, url, "utf-8")
+
+ def _extract_targz(self, path, scratch_dir):
+ # tarfile.extractall() extracts to a path without the
+ # trailing ".tar.gz".
+ target_basename = os.path.basename(path[:-len(".tar.gz")])
+ target_path = os.path.join(scratch_dir, target_basename)
+
+ self._log_transfer("Starting gunzip/extract...", path, target_path)
+
+ try:
+ tar_file = tarfile.open(path)
+ except tarfile.ReadError, err:
+ # Append existing Error message to new Error.
+ message = ("Could not open tar file: %s\n"
+ " The file probably does not have the correct format.\n"
+ " --> Inner message: %s"
+ % (path, err))
+ raise Exception(message)
+
+ try:
+ # This is helpful for debugging purposes.
+ _log.debug("Listing tar file contents...")
+ for name in tar_file.getnames():
+ _log.debug(' * "%s"' % name)
+ _log.debug("Extracting gzipped tar file...")
+ tar_file.extractall(target_path)
+ finally:
+ tar_file.close()
+
+ return target_path
+
+ # This is a replacement for ZipFile.extractall(), which is
+ # available in Python 2.6 but not in earlier versions.
+ def _extract_all(self, zip_file, target_dir):
+ self._log_transfer("Extracting zip file...", zip_file, target_dir)
+
+ # This is helpful for debugging purposes.
+ _log.debug("Listing zip file contents...")
+ for name in zip_file.namelist():
+ _log.debug(' * "%s"' % name)
+
+ for name in zip_file.namelist():
+ path = os.path.join(target_dir, name)
+ self._log_transfer("Extracting...", name, path)
+
+ if not os.path.basename(path):
+ # Then the path ends in a slash, so it is a directory.
+ self._create_directory(path)
+ continue
+ # Otherwise, it is a file.
+
+ try:
+ # We open this file w/o encoding, as we're reading/writing
+ # the raw byte-stream from the zip file.
+ outfile = open(path, 'wb')
+ except IOError, err:
+ # Not all zip files seem to list the directories explicitly,
+ # so try again after creating the containing directory.
+ _log.debug("Got IOError: retrying after creating directory...")
+ dir = os.path.dirname(path)
+ self._create_directory(dir)
+ outfile = open(path, 'wb')
+
+ try:
+ outfile.write(zip_file.read(name))
+ finally:
+ outfile.close()
+
+ def _unzip(self, path, scratch_dir):
+ # zipfile.extractall() extracts to a path without the
+ # trailing ".zip".
+ target_basename = os.path.basename(path[:-len(".zip")])
+ target_path = os.path.join(scratch_dir, target_basename)
+
+ self._log_transfer("Starting unzip...", path, target_path)
+
+ try:
+ zip_file = zipfile.ZipFile(path, "r")
+ except zipfile.BadZipfile, err:
+ message = ("Could not open zip file: %s\n"
+ " --> Inner message: %s"
+ % (path, err))
+ raise Exception(message)
+
+ try:
+ self._extract_all(zip_file, scratch_dir)
+ finally:
+ zip_file.close()
+
+ return target_path
+
+ def _prepare_package(self, path, scratch_dir):
+ """Prepare a package for use, if necessary, and return the new path.
+
+ For example, this method unzips zipped files and extracts
+ tar files.
+
+ Args:
+ path: The path to the downloaded URL contents.
+ scratch_dir: The scratch directory. Note that the scratch
+ directory contains the file designated by the
+ path parameter.
+
+ """
+ # FIXME: Add other natural extensions.
+ if path.endswith(".zip"):
+ new_path = self._unzip(path, scratch_dir)
+ elif path.endswith(".tar.gz"):
+ new_path = self._extract_targz(path, scratch_dir)
+ else:
+ # No preparation is needed.
+ new_path = path
+
+ return new_path
+
+ def _download_to_stream(self, url, stream):
+ """Download an URL to a stream, and return the number of bytes."""
+ try:
+ netstream = urllib.urlopen(url)
+ except IOError, err:
+ # Append existing Error message to new Error.
+ message = ('Could not download Python modules from URL "%s".\n'
+ " Make sure you are connected to the internet.\n"
+ " You must be connected to the internet when "
+ "downloading needed modules for the first time.\n"
+ " --> Inner message: %s"
+ % (url, err))
+ raise IOError(message)
+ code = 200
+ if hasattr(netstream, "getcode"):
+ code = netstream.getcode()
+ if not 200 <= code < 300:
+ raise ValueError("HTTP Error code %s" % code)
+
+ BUFSIZE = 2**13 # 8KB
+ bytes = 0
+ while True:
+ data = netstream.read(BUFSIZE)
+ if not data:
+ break
+ stream.write(data)
+ bytes += len(data)
+ netstream.close()
+ return bytes
+
+ def _download(self, url, scratch_dir):
+ """Download URL contents, and return the download path."""
+ url_path = urlparse.urlsplit(url)[2]
+ url_path = os.path.normpath(url_path) # Removes trailing slash.
+ target_filename = os.path.basename(url_path)
+ target_path = os.path.join(scratch_dir, target_filename)
+
+ self._log_transfer("Starting download...", url, target_path)
+
+ with open(target_path, "wb") as stream:
+ bytes = self._download_to_stream(url, stream)
+
+ _log.debug("Downloaded %s bytes." % bytes)
+
+ return target_path
+
+ def _install(self, scratch_dir, package_name, target_path, url,
+ url_subpath):
+ """Install a python package from an URL.
+
+ This internal method overwrites the target path if the target
+ path already exists.
+
+ """
+ path = self._download(url=url, scratch_dir=scratch_dir)
+ path = self._prepare_package(path, scratch_dir)
+
+ if url_subpath is None:
+ source_path = path
+ else:
+ source_path = os.path.join(path, url_subpath)
+
+ if os.path.exists(target_path):
+ _log.debug('Refreshing install: deleting "%s".' % target_path)
+ if os.path.isdir(target_path):
+ shutil.rmtree(target_path)
+ else:
+ os.remove(target_path)
+
+ self._log_transfer("Moving files into place...", source_path, target_path)
+
+ # The shutil.move() command creates intermediate directories if they
+ # do not exist, but we do not rely on this behavior since we
+ # need to create the __init__.py file anyway.
+ shutil.move(source_path, target_path)
+
+ self._record_url_downloaded(package_name, url)
+
+ def install(self, url, should_refresh=False, target_name=None,
+ url_subpath=None):
+ """Install a python package from an URL.
+
+ Args:
+ url: The URL from which to download the package.
+
+ Optional Args:
+ should_refresh: A boolean value of whether the package should be
+ downloaded again if the package is already present.
+ target_name: The name of the folder or file in the autoinstaller
+ target directory at which the package should be
+ installed. Defaults to the base name of the
+ URL sub-path. This parameter must be provided if
+ the URL sub-path is not specified.
+ url_subpath: The relative path of the URL directory that should
+ be installed. Defaults to the full directory, or
+ the entire URL contents.
+
+ """
+ if target_name is None:
+ if not url_subpath:
+ raise ValueError('The "target_name" parameter must be '
+ 'provided if the "url_subpath" parameter '
+ "is not provided.")
+ # Remove any trailing slashes.
+ url_subpath = os.path.normpath(url_subpath)
+ target_name = os.path.basename(url_subpath)
+
+ target_path = os.path.join(self._target_dir, target_name)
+ if not should_refresh and self._is_downloaded(target_name, url):
+ _log.debug('URL for %s already downloaded. Skipping...'
+ % target_name)
+ _log.debug(' "%s"' % url)
+ return
+
+ self._log_transfer("Auto-installing package: %s" % target_name,
+ url, target_path, log_method=_log.info)
+
+ # The scratch directory is where we will download and prepare
+ # files specific to this install until they are ready to move
+ # into place.
+ scratch_dir = self._create_scratch_directory(target_name)
+
+ try:
+ self._install(package_name=target_name,
+ target_path=target_path,
+ scratch_dir=scratch_dir,
+ url=url,
+ url_subpath=url_subpath)
+ except Exception, err:
+ # Append existing Error message to new Error.
+ message = ("Error auto-installing the %s package to:\n"
+ ' "%s"\n'
+ " --> Inner message: %s"
+ % (target_name, target_path, err))
+ raise Exception(message)
+ finally:
+ _log.debug('Cleaning up: deleting "%s".' % scratch_dir)
+ shutil.rmtree(scratch_dir)
+ _log.debug('Auto-installed %s to:' % target_name)
+ _log.debug(' "%s"' % target_path)
+
+
+if __name__=="__main__":
+
+ # Configure the autoinstall logger to log DEBUG messages for
+ # development testing purposes.
+ console = logging.StreamHandler()
+
+ formatter = logging.Formatter('%(name)s: %(levelname)-8s %(message)s')
+ console.setFormatter(formatter)
+ _log.addHandler(console)
+ _log.setLevel(logging.DEBUG)
+
+ # Use a more visible temp directory for debug purposes.
+ this_dir = os.path.dirname(__file__)
+ target_dir = os.path.join(this_dir, "autoinstalled")
+ temp_dir = os.path.join(target_dir, "Temp")
+
+ installer = AutoInstaller(target_dir=target_dir,
+ temp_dir=temp_dir)
+
+ installer.install(should_refresh=False,
+ target_name="pep8.py",
+ url="http://pypi.python.org/packages/source/p/pep8/pep8-0.5.0.tar.gz#md5=512a818af9979290cd619cce8e9c2e2b",
+ url_subpath="pep8-0.5.0/pep8.py")
+ installer.install(should_refresh=False,
+ target_name="mechanize",
+ url="http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip",
+ url_subpath="mechanize")
+
diff --git a/WebKitTools/Scripts/webkitpy/webkit_logging.py b/WebKitTools/Scripts/webkitpy/common/system/deprecated_logging.py
index ba1c5eb..9e6b529 100644
--- a/WebKitTools/Scripts/webkitpy/webkit_logging.py
+++ b/WebKitTools/Scripts/webkitpy/common/system/deprecated_logging.py
@@ -30,24 +30,30 @@
# WebKit's Python module for logging
# This module is now deprecated in favor of python's built-in logging.py.
+import codecs
import os
import sys
+
def log(string):
print >> sys.stderr, string
+
def error(string):
log("ERROR: %s" % string)
exit(1)
+
# Simple class to split output between multiple destinations
class tee:
def __init__(self, *files):
self.files = files
- def write(self, string):
+ # Callers should pass an already encoded string for writing.
+ def write(self, bytes):
for file in self.files:
- file.write(string)
+ file.write(bytes)
+
class OutputTee:
def __init__(self):
@@ -71,7 +77,7 @@ class OutputTee:
(log_directory, log_name) = os.path.split(log_path)
if log_directory and not os.path.exists(log_directory):
os.makedirs(log_directory)
- return open(log_path, 'a+')
+ return codecs.open(log_path, "a+", "utf-8")
def _tee_outputs_to_files(self, files):
if not self._original_stdout:
diff --git a/WebKitTools/Scripts/webkitpy/webkit_logging_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/deprecated_logging_unittest.py
index b940a4d..3778162 100644
--- a/WebKitTools/Scripts/webkitpy/webkit_logging_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/system/deprecated_logging_unittest.py
@@ -27,13 +27,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import os
-import subprocess
import StringIO
import tempfile
import unittest
-from webkitpy.executive import ScriptError
-from webkitpy.webkit_logging import *
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.system.deprecated_logging import *
class LoggingTest(unittest.TestCase):
@@ -46,7 +45,7 @@ class LoggingTest(unittest.TestCase):
log(log_input)
actual_output = test_stderr.getvalue()
finally:
- original_stderr = original_stderr
+ sys.stderr = original_stderr
self.assertEquals(actual_output, expected_output, "log(\"%s\") expected: %s actual: %s" % (log_input, expected_output, actual_output))
diff --git a/WebKitTools/Scripts/webkitpy/common/system/executive.py b/WebKitTools/Scripts/webkitpy/common/system/executive.py
new file mode 100644
index 0000000..85a683a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/executive.py
@@ -0,0 +1,399 @@
+# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+try:
+ # This API exists only in Python 2.6 and higher. :(
+ import multiprocessing
+except ImportError:
+ multiprocessing = None
+
+import ctypes
+import errno
+import logging
+import os
+import platform
+import StringIO
+import signal
+import subprocess
+import sys
+import time
+
+from webkitpy.common.system.deprecated_logging import tee
+from webkitpy.python24 import versioning
+
+
+_log = logging.getLogger("webkitpy.common.system")
+
+
+class ScriptError(Exception):
+
+ def __init__(self,
+ message=None,
+ script_args=None,
+ exit_code=None,
+ output=None,
+ cwd=None):
+ if not message:
+ message = 'Failed to run "%s"' % script_args
+ if exit_code:
+ message += " exit_code: %d" % exit_code
+ if cwd:
+ message += " cwd: %s" % cwd
+
+ Exception.__init__(self, message)
+ self.script_args = script_args # 'args' is already used by Exception
+ self.exit_code = exit_code
+ self.output = output
+ self.cwd = cwd
+
+ def message_with_output(self, output_limit=500):
+ if self.output:
+ if output_limit and len(self.output) > output_limit:
+ return u"%s\nLast %s characters of output:\n%s" % \
+ (self, output_limit, self.output[-output_limit:])
+ return u"%s\n%s" % (self, self.output)
+ return unicode(self)
+
+ def command_name(self):
+ command_path = self.script_args
+ if type(command_path) is list:
+ command_path = command_path[0]
+ return os.path.basename(command_path)
+
+
+def run_command(*args, **kwargs):
+ # FIXME: This should not be a global static.
+ # New code should use Executive.run_command directly instead
+ return Executive().run_command(*args, **kwargs)
+
+
+class Executive(object):
+
+ def _should_close_fds(self):
+ # We need to pass close_fds=True to work around Python bug #2320
+ # (otherwise we can hang when we kill DumpRenderTree when we are running
+ # multiple threads). See http://bugs.python.org/issue2320 .
+ # Note that close_fds isn't supported on Windows, but this bug only
+ # shows up on Mac and Linux.
+ return sys.platform not in ('win32', 'cygwin')
+
+ def _run_command_with_teed_output(self, args, teed_output):
+ args = map(unicode, args) # Popen will throw an exception if args are non-strings (like int())
+ args = map(self._encode_argument_if_needed, args)
+
+ child_process = subprocess.Popen(args,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ close_fds=self._should_close_fds())
+
+ # Use our own custom wait loop because Popen ignores a tee'd
+ # stderr/stdout.
+ # FIXME: This could be improved not to flatten output to stdout.
+ while True:
+ output_line = child_process.stdout.readline()
+ if output_line == "" and child_process.poll() != None:
+ # poll() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
+ return child_process.poll()
+ # We assume that the child process wrote to us in utf-8,
+ # so no re-encoding is necessary before writing here.
+ teed_output.write(output_line)
+
+ # FIXME: Remove this deprecated method and move callers to run_command.
+ # FIXME: This method is a hack to allow running command which both
+ # capture their output and print out to stdin. Useful for things
+ # like "build-webkit" where we want to display to the user that we're building
+ # but still have the output to stuff into a log file.
+ def run_and_throw_if_fail(self, args, quiet=False, decode_output=True):
+ # Cache the child's output locally so it can be used for error reports.
+ child_out_file = StringIO.StringIO()
+ tee_stdout = sys.stdout
+ if quiet:
+ dev_null = open(os.devnull, "w") # FIXME: Does this need an encoding?
+ tee_stdout = dev_null
+ child_stdout = tee(child_out_file, tee_stdout)
+ exit_code = self._run_command_with_teed_output(args, child_stdout)
+ if quiet:
+ dev_null.close()
+
+ child_output = child_out_file.getvalue()
+ child_out_file.close()
+
+ if decode_output:
+ child_output = child_output.decode(self._child_process_encoding())
+
+ if exit_code:
+ raise ScriptError(script_args=args,
+ exit_code=exit_code,
+ output=child_output)
+ return child_output
+
+ def cpu_count(self):
+ if multiprocessing:
+ return multiprocessing.cpu_count()
+ # Darn. We don't have the multiprocessing package.
+ system_name = platform.system()
+ if system_name == "Darwin":
+ return int(self.run_command(["sysctl", "-n", "hw.ncpu"]))
+ elif system_name == "Windows":
+ return int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
+ elif system_name == "Linux":
+ num_cores = os.sysconf("SC_NPROCESSORS_ONLN")
+ if isinstance(num_cores, int) and num_cores > 0:
+ return num_cores
+ # This quantity is a lie but probably a reasonable guess for modern
+ # machines.
+ return 2
+
+ def kill_process(self, pid):
+ """Attempts to kill the given pid.
+ Will fail silently if pid does not exist or insufficient permisssions."""
+ if sys.platform == "win32":
+ # We only use taskkill.exe on windows (not cygwin) because subprocess.pid
+ # is a CYGWIN pid and taskkill.exe expects a windows pid.
+ # Thankfully os.kill on CYGWIN handles either pid type.
+ command = ["taskkill.exe", "/f", "/pid", pid]
+ # taskkill will exit 128 if the process is not found. We should log.
+ self.run_command(command, error_handler=self.ignore_error)
+ return
+
+ # According to http://docs.python.org/library/os.html
+ # os.kill isn't available on Windows. python 2.5.5 os.kill appears
+ # to work in cygwin, however it occasionally raises EAGAIN.
+ retries_left = 10 if sys.platform == "cygwin" else 1
+ while retries_left > 0:
+ try:
+ retries_left -= 1
+ os.kill(pid, signal.SIGKILL)
+ except OSError, e:
+ if e.errno == errno.EAGAIN:
+ if retries_left <= 0:
+ _log.warn("Failed to kill pid %s. Too many EAGAIN errors." % pid)
+ continue
+ if e.errno == errno.ESRCH: # The process does not exist.
+ _log.warn("Called kill_process with a non-existant pid %s" % pid)
+ return
+ raise
+
+ def _win32_check_running_pid(self, pid):
+
+ class PROCESSENTRY32(ctypes.Structure):
+ _fields_ = [("dwSize", ctypes.c_ulong),
+ ("cntUsage", ctypes.c_ulong),
+ ("th32ProcessID", ctypes.c_ulong),
+ ("th32DefaultHeapID", ctypes.c_ulong),
+ ("th32ModuleID", ctypes.c_ulong),
+ ("cntThreads", ctypes.c_ulong),
+ ("th32ParentProcessID", ctypes.c_ulong),
+ ("pcPriClassBase", ctypes.c_ulong),
+ ("dwFlags", ctypes.c_ulong),
+ ("szExeFile", ctypes.c_char * 260)]
+
+ CreateToolhelp32Snapshot = ctypes.windll.kernel32.CreateToolhelp32Snapshot
+ Process32First = ctypes.windll.kernel32.Process32First
+ Process32Next = ctypes.windll.kernel32.Process32Next
+ CloseHandle = ctypes.windll.kernel32.CloseHandle
+ TH32CS_SNAPPROCESS = 0x00000002 # win32 magic number
+ hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
+ pe32 = PROCESSENTRY32()
+ pe32.dwSize = ctypes.sizeof(PROCESSENTRY32)
+ result = False
+ if not Process32First(hProcessSnap, ctypes.byref(pe32)):
+ _log.debug("Failed getting first process.")
+ CloseHandle(hProcessSnap)
+ return result
+ while True:
+ if pe32.th32ProcessID == pid:
+ result = True
+ break
+ if not Process32Next(hProcessSnap, ctypes.byref(pe32)):
+ break
+ CloseHandle(hProcessSnap)
+ return result
+
+ def check_running_pid(self, pid):
+ """Return True if pid is alive, otherwise return False."""
+ if sys.platform in ('darwin', 'linux2', 'cygwin'):
+ try:
+ os.kill(pid, 0)
+ return True
+ except OSError:
+ return False
+ elif sys.platform == 'win32':
+ return self._win32_check_running_pid(pid)
+
+ assert(False)
+
+ def _windows_image_name(self, process_name):
+ name, extension = os.path.splitext(process_name)
+ if not extension:
+ # taskkill expects processes to end in .exe
+ # If necessary we could add a flag to disable appending .exe.
+ process_name = "%s.exe" % name
+ return process_name
+
+ def kill_all(self, process_name):
+ """Attempts to kill processes matching process_name.
+ Will fail silently if no process are found."""
+ if sys.platform in ("win32", "cygwin"):
+ image_name = self._windows_image_name(process_name)
+ command = ["taskkill.exe", "/f", "/im", image_name]
+ # taskkill will exit 128 if the process is not found. We should log.
+ self.run_command(command, error_handler=self.ignore_error)
+ return
+
+ # FIXME: This is inconsistent that kill_all uses TERM and kill_process
+ # uses KILL. Windows is always using /f (which seems like -KILL).
+ # We should pick one mode, or add support for switching between them.
+ # Note: Mac OS X 10.6 requires -SIGNALNAME before -u USER
+ command = ["killall", "-TERM", "-u", os.getenv("USER"), process_name]
+ # killall returns 1 if no process can be found and 2 on command error.
+ # FIXME: We should pass a custom error_handler to allow only exit_code 1.
+ # We should log in exit_code == 1
+ self.run_command(command, error_handler=self.ignore_error)
+
+ # Error handlers do not need to be static methods once all callers are
+ # updated to use an Executive object.
+
+ @staticmethod
+ def default_error_handler(error):
+ raise error
+
+ @staticmethod
+ def ignore_error(error):
+ pass
+
+ def _compute_stdin(self, input):
+ """Returns (stdin, string_to_communicate)"""
+ # FIXME: We should be returning /dev/null for stdin
+ # or closing stdin after process creation to prevent
+ # child processes from getting input from the user.
+ if not input:
+ return (None, None)
+ if hasattr(input, "read"): # Check if the input is a file.
+ return (input, None) # Assume the file is in the right encoding.
+
+ # Popen in Python 2.5 and before does not automatically encode unicode objects.
+ # http://bugs.python.org/issue5290
+ # See https://bugs.webkit.org/show_bug.cgi?id=37528
+ # for an example of a regresion caused by passing a unicode string directly.
+ # FIXME: We may need to encode differently on different platforms.
+ if isinstance(input, unicode):
+ input = input.encode(self._child_process_encoding())
+ return (subprocess.PIPE, input)
+
+ def _command_for_printing(self, args):
+ """Returns a print-ready string representing command args.
+ The string should be copy/paste ready for execution in a shell."""
+ escaped_args = []
+ for arg in args:
+ if isinstance(arg, unicode):
+ # Escape any non-ascii characters for easy copy/paste
+ arg = arg.encode("unicode_escape")
+ # FIXME: Do we need to fix quotes here?
+ escaped_args.append(arg)
+ return " ".join(escaped_args)
+
+ # FIXME: run_and_throw_if_fail should be merged into this method.
+ def run_command(self,
+ args,
+ cwd=None,
+ input=None,
+ error_handler=None,
+ return_exit_code=False,
+ return_stderr=True,
+ decode_output=True):
+ """Popen wrapper for convenience and to work around python bugs."""
+ assert(isinstance(args, list) or isinstance(args, tuple))
+ start_time = time.time()
+ args = map(unicode, args) # Popen will throw an exception if args are non-strings (like int())
+ args = map(self._encode_argument_if_needed, args)
+
+ stdin, string_to_communicate = self._compute_stdin(input)
+ stderr = subprocess.STDOUT if return_stderr else None
+
+ process = subprocess.Popen(args,
+ stdin=stdin,
+ stdout=subprocess.PIPE,
+ stderr=stderr,
+ cwd=cwd,
+ close_fds=self._should_close_fds())
+ output = process.communicate(string_to_communicate)[0]
+
+ # run_command automatically decodes to unicode() unless explicitly told not to.
+ if decode_output:
+ output = output.decode(self._child_process_encoding())
+
+ # wait() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
+ exit_code = process.wait()
+
+ _log.debug('"%s" took %.2fs' % (self._command_for_printing(args), time.time() - start_time))
+
+ if return_exit_code:
+ return exit_code
+
+ if exit_code:
+ script_error = ScriptError(script_args=args,
+ exit_code=exit_code,
+ output=output,
+ cwd=cwd)
+ (error_handler or self.default_error_handler)(script_error)
+ return output
+
+ def _child_process_encoding(self):
+ # Win32 Python 2.x uses CreateProcessA rather than CreateProcessW
+ # to launch subprocesses, so we have to encode arguments using the
+ # current code page.
+ if sys.platform == 'win32' and versioning.compare_version(sys, '3.0')[0] < 0:
+ return 'mbcs'
+ # All other platforms use UTF-8.
+ # FIXME: Using UTF-8 on Cygwin will confuse Windows-native commands
+ # which will expect arguments to be encoded using the current code
+ # page.
+ return 'utf-8'
+
+ def _should_encode_child_process_arguments(self):
+ # Cygwin's Python's os.execv doesn't support unicode command
+ # arguments, and neither does Cygwin's execv itself.
+ if sys.platform == 'cygwin':
+ return True
+
+ # Win32 Python 2.x uses CreateProcessA rather than CreateProcessW
+ # to launch subprocesses, so we have to encode arguments using the
+ # current code page.
+ if sys.platform == 'win32' and versioning.compare_version(sys, '3.0')[0] < 0:
+ return True
+
+ return False
+
+ def _encode_argument_if_needed(self, argument):
+ if not self._should_encode_child_process_arguments():
+ return argument
+ return argument.encode(self._child_process_encoding())
diff --git a/WebKitTools/Scripts/webkitpy/common/system/executive_mock.py b/WebKitTools/Scripts/webkitpy/common/system/executive_mock.py
new file mode 100644
index 0000000..7347ff9
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/executive_mock.py
@@ -0,0 +1,55 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# FIXME: Implement the rest of the interface as needed for testing :).
+
+# FIXME: Unify with tool/mocktool.MockExecutive.
+
+
+class MockExecutive2(object):
+ def __init__(self, output='', exit_code=0, exception=None):
+ self._output = output
+ self._exit_code = exit_code
+ self._exception = exception
+
+ def cpu_count(self):
+ return 2
+
+ def kill_all(self, process_name):
+ pass
+
+ def kill_process(self, pid):
+ pass
+
+ def run_command(self, arg_list, return_exit_code=False,
+ decode_output=False):
+ if self._exception:
+ raise self._exception
+ if return_exit_code:
+ return self._exit_code
+ return self._output
diff --git a/WebKitTools/Scripts/webkitpy/common/system/executive_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/executive_unittest.py
new file mode 100644
index 0000000..b8fd82e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/executive_unittest.py
@@ -0,0 +1,151 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2009 Daniel Bates (dbates@intudata.com). All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import signal
+import subprocess
+import sys
+import unittest
+
+from webkitpy.common.system.executive import Executive, run_command, ScriptError
+from webkitpy.test import cat, echo
+
+
+def never_ending_command():
+ """Arguments for a command that will never end (useful for testing process
+ killing). It should be a process that is unlikely to already be running
+ because all instances will be killed."""
+ if sys.platform == 'win32':
+ return ['wmic']
+ return ['yes']
+
+
+class ExecutiveTest(unittest.TestCase):
+
+ def test_run_command_with_bad_command(self):
+ def run_bad_command():
+ run_command(["foo_bar_command_blah"], error_handler=Executive.ignore_error, return_exit_code=True)
+ self.failUnlessRaises(OSError, run_bad_command)
+
+ def test_run_command_args_type(self):
+ executive = Executive()
+ self.assertRaises(AssertionError, executive.run_command, "echo")
+ self.assertRaises(AssertionError, executive.run_command, u"echo")
+ executive.run_command(echo.command_arguments('foo'))
+ executive.run_command(tuple(echo.command_arguments('foo')))
+
+ def test_run_command_with_unicode(self):
+ """Validate that it is safe to pass unicode() objects
+ to Executive.run* methods, and they will return unicode()
+ objects by default unless decode_output=False"""
+ unicode_tor_input = u"WebKit \u2661 Tor Arne Vestb\u00F8!"
+ if sys.platform == 'win32':
+ encoding = 'mbcs'
+ else:
+ encoding = 'utf-8'
+ encoded_tor = unicode_tor_input.encode(encoding)
+ # On Windows, we expect the unicode->mbcs->unicode roundtrip to be
+ # lossy. On other platforms, we expect a lossless roundtrip.
+ if sys.platform == 'win32':
+ unicode_tor_output = encoded_tor.decode(encoding)
+ else:
+ unicode_tor_output = unicode_tor_input
+
+ executive = Executive()
+
+ output = executive.run_command(cat.command_arguments(), input=unicode_tor_input)
+ self.assertEquals(output, unicode_tor_output)
+
+ output = executive.run_command(echo.command_arguments("-n", unicode_tor_input))
+ self.assertEquals(output, unicode_tor_output)
+
+ output = executive.run_command(echo.command_arguments("-n", unicode_tor_input), decode_output=False)
+ self.assertEquals(output, encoded_tor)
+
+ # Make sure that str() input also works.
+ output = executive.run_command(cat.command_arguments(), input=encoded_tor, decode_output=False)
+ self.assertEquals(output, encoded_tor)
+
+ # FIXME: We should only have one run* method to test
+ output = executive.run_and_throw_if_fail(echo.command_arguments("-n", unicode_tor_input), quiet=True)
+ self.assertEquals(output, unicode_tor_output)
+
+ output = executive.run_and_throw_if_fail(echo.command_arguments("-n", unicode_tor_input), quiet=True, decode_output=False)
+ self.assertEquals(output, encoded_tor)
+
+ def test_kill_process(self):
+ executive = Executive()
+ process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
+ self.assertEqual(process.poll(), None) # Process is running
+ executive.kill_process(process.pid)
+ # Note: Can't use a ternary since signal.SIGKILL is undefined for sys.platform == "win32"
+ if sys.platform == "win32":
+ expected_exit_code = 1
+ else:
+ expected_exit_code = -signal.SIGKILL
+ self.assertEqual(process.wait(), expected_exit_code)
+ # Killing again should fail silently.
+ executive.kill_process(process.pid)
+
+ def _assert_windows_image_name(self, name, expected_windows_name):
+ executive = Executive()
+ windows_name = executive._windows_image_name(name)
+ self.assertEqual(windows_name, expected_windows_name)
+
+ def test_windows_image_name(self):
+ self._assert_windows_image_name("foo", "foo.exe")
+ self._assert_windows_image_name("foo.exe", "foo.exe")
+ self._assert_windows_image_name("foo.com", "foo.com")
+ # If the name looks like an extension, even if it isn't
+ # supposed to, we have no choice but to return the original name.
+ self._assert_windows_image_name("foo.baz", "foo.baz")
+ self._assert_windows_image_name("foo.baz.exe", "foo.baz.exe")
+
+ def test_kill_all(self):
+ executive = Executive()
+ # We use "yes" because it loops forever.
+ process = subprocess.Popen(never_ending_command(), stdout=subprocess.PIPE)
+ self.assertEqual(process.poll(), None) # Process is running
+ executive.kill_all(never_ending_command()[0])
+ # Note: Can't use a ternary since signal.SIGTERM is undefined for sys.platform == "win32"
+ if sys.platform == "cygwin":
+ expected_exit_code = 0 # os.kill results in exit(0) for this process.
+ elif sys.platform == "win32":
+ expected_exit_code = 1
+ else:
+ expected_exit_code = -signal.SIGTERM
+ self.assertEqual(process.wait(), expected_exit_code)
+ # Killing again should fail silently.
+ executive.kill_all(never_ending_command()[0])
+
+ def test_check_running_pid(self):
+ executive = Executive()
+ self.assertTrue(executive.check_running_pid(os.getpid()))
+ # Maximum pid number on Linux is 32768 by default
+ self.assertFalse(executive.check_running_pid(100000))
diff --git a/WebKitTools/Scripts/webkitpy/common/system/file_lock.py b/WebKitTools/Scripts/webkitpy/common/system/file_lock.py
new file mode 100644
index 0000000..7296958
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/file_lock.py
@@ -0,0 +1,83 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
+#
+# 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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.
+
+"""This class helps to lock files exclusively across processes."""
+
+import logging
+import os
+import sys
+import time
+
+
+_log = logging.getLogger("webkitpy.common.system.file_lock")
+
+
+class FileLock(object):
+
+ def __init__(self, lock_file_path, max_wait_time_sec=20):
+ self._lock_file_path = lock_file_path
+ self._lock_file_descriptor = None
+ self._max_wait_time_sec = max_wait_time_sec
+
+ def _create_lock(self):
+ if sys.platform in ('darwin', 'linux2', 'cygwin'):
+ import fcntl
+ fcntl.flock(self._lock_file_descriptor, fcntl.LOCK_EX | fcntl.LOCK_NB)
+ elif sys.platform == 'win32':
+ import msvcrt
+ msvcrt.locking(self._lock_file_descriptor, msvcrt.LK_NBLCK, 32)
+
+ def _remove_lock(self):
+ if sys.platform in ('darwin', 'linux2', 'cygwin'):
+ import fcntl
+ fcntl.flock(self._lock_file_descriptor, fcntl.LOCK_UN)
+ elif sys.platform == 'win32':
+ import msvcrt
+ msvcrt.locking(self._lock_file_descriptor, msvcrt.LK_UNLCK, 32)
+
+ def acquire_lock(self):
+ self._lock_file_descriptor = os.open(self._lock_file_path, os.O_TRUNC | os.O_CREAT)
+ start_time = time.time()
+ while True:
+ try:
+ self._create_lock()
+ return True
+ except IOError:
+ if time.time() - start_time > self._max_wait_time_sec:
+ _log.debug("File locking failed: %s" % str(sys.exc_info()))
+ os.close(self._lock_file_descriptor)
+ self._lock_file_descriptor = None
+ return False
+
+ def release_lock(self):
+ try:
+ if self._lock_file_descriptor:
+ self._remove_lock()
+ os.close(self._lock_file_descriptor)
+ self._lock_file_descriptor = None
+ os.unlink(self._lock_file_path)
+ except (IOError, OSError):
+ _log.debug("Warning in release lock: %s" % str(sys.exc_info()))
diff --git a/WebKitTools/Scripts/webkitpy/common/system/file_lock_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/file_lock_unittest.py
new file mode 100644
index 0000000..c5c1db3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/file_lock_unittest.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
+#
+# 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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.
+
+import os
+import tempfile
+import unittest
+
+from webkitpy.common.system.file_lock import FileLock
+
+
+class FileLockTest(unittest.TestCase):
+
+ def setUp(self):
+ self._lock_name = "TestWebKit" + str(os.getpid()) + ".lock"
+ self._lock_path = os.path.join(tempfile.gettempdir(), self._lock_name)
+ self._file_lock1 = FileLock(self._lock_path, 1)
+ self._file_lock2 = FileLock(self._lock_path, 1)
+
+ def tearDown(self):
+ self._file_lock1.release_lock()
+ self._file_lock2.release_lock()
+
+ def test_lock_lifecycle(self):
+ # Create the lock.
+ self._file_lock1.acquire_lock()
+ self.assertTrue(os.path.exists(self._lock_path))
+
+ # Try to lock again.
+ self.assertFalse(self._file_lock2.acquire_lock())
+
+ # Release the lock.
+ self._file_lock1.release_lock()
+ self.assertFalse(os.path.exists(self._lock_path))
+
+ def test_stuck_lock(self):
+ open(self._lock_path, 'w').close()
+ self._file_lock1.acquire_lock()
+ self._file_lock1.release_lock()
diff --git a/WebKitTools/Scripts/webkitpy/common/system/filesystem.py b/WebKitTools/Scripts/webkitpy/common/system/filesystem.py
new file mode 100644
index 0000000..c7efde3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/filesystem.py
@@ -0,0 +1,117 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Wrapper object for the file system / source tree."""
+
+from __future__ import with_statement
+
+import codecs
+import errno
+import os
+import tempfile
+
+
+class FileSystem(object):
+ """FileSystem interface for webkitpy.
+
+ Unless otherwise noted, all paths are allowed to be either absolute
+ or relative."""
+
+ def exists(self, path):
+ """Return whether the path exists in the filesystem."""
+ return os.path.exists(path)
+
+ def isdir(self, path):
+ """Return whether the path refers to a directory."""
+ return os.path.isdir(path)
+
+ def join(self, *comps):
+ """Return the path formed by joining the components."""
+ return os.path.join(*comps)
+
+ def listdir(self, path):
+ """Return the contents of the directory pointed to by path."""
+ return os.listdir(path)
+
+ def mkdtemp(self, **kwargs):
+ """Create and return a uniquely named directory.
+
+ This is like tempfile.mkdtemp, but if used in a with statement
+ the directory will self-delete at the end of the block (if the
+ directory is empty; non-empty directories raise errors). The
+ directory can be safely deleted inside the block as well, if so
+ desired."""
+ class TemporaryDirectory(object):
+ def __init__(self, **kwargs):
+ self._kwargs = kwargs
+ self._directory_path = None
+
+ def __enter__(self):
+ self._directory_path = tempfile.mkdtemp(**self._kwargs)
+ return self._directory_path
+
+ def __exit__(self, type, value, traceback):
+ # Only self-delete if necessary.
+
+ # FIXME: Should we delete non-empty directories?
+ if os.path.exists(self._directory_path):
+ os.rmdir(self._directory_path)
+
+ return TemporaryDirectory(**kwargs)
+
+ def maybe_make_directory(self, *path):
+ """Create the specified directory if it doesn't already exist."""
+ try:
+ os.makedirs(os.path.join(*path))
+ except OSError, e:
+ if e.errno != errno.EEXIST:
+ raise
+
+ def read_binary_file(self, path):
+ """Return the contents of the file at the given path as a byte string."""
+ with file(path, 'rb') as f:
+ return f.read()
+
+ def read_text_file(self, path):
+ """Return the contents of the file at the given path as a Unicode string.
+
+ The file is read assuming it is a UTF-8 encoded file with no BOM."""
+ with codecs.open(path, 'r', 'utf8') as f:
+ return f.read()
+
+ def write_binary_file(self, path, contents):
+ """Write the contents to the file at the given location."""
+ with file(path, 'wb') as f:
+ f.write(contents)
+
+ def write_text_file(self, path, contents):
+ """Write the contents to the file at the given location.
+
+ The file is written encoded as UTF-8 with no BOM."""
+ with codecs.open(path, 'w', 'utf8') as f:
+ f.write(contents)
diff --git a/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py b/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py
new file mode 100644
index 0000000..d2cde4f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py
@@ -0,0 +1,75 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import errno
+import os
+import path
+
+
+class MockFileSystem(object):
+ def __init__(self, files={}):
+ """Initializes a "mock" filesystem that can be used to completely
+ stub out a filesystem.
+
+ Args:
+ files: a dict of filenames -> file contents. A file contents
+ value of None is used to indicate that the file should
+ not exist (even if standalone is False).
+ standalone: If True, only the files listed in _files_ exist.
+ If False, the object will pass through read calls to the
+ underlying filesystem. Writes are never passed through.
+
+ """
+ self.files = files
+
+ def exists(self, path):
+ if path in self.files:
+ return self.files[path] is not None
+ return False
+
+ def join(self, *comps):
+ return '/'.join(comps)
+
+ def maybe_make_directory(self, *path):
+ # FIXME: Implement such that subsequent calls to isdir() work?
+ pass
+
+ def read_text_file(self, path):
+ return self.read_binary_file(path)
+
+ def read_binary_file(self, path):
+ if path in self.files:
+ if self.files[path] is None:
+ raise IOError(errno.ENOENT, path, os.strerror(errno.ENOENT))
+ return self.files[path]
+
+ def write_text_file(self, path, contents):
+ return self.write_binary_file(path, contents)
+
+ def write_binary_file(self, path, contents):
+ self.files[path] = contents
diff --git a/WebKitTools/Scripts/webkitpy/common/system/filesystem_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/filesystem_unittest.py
new file mode 100644
index 0000000..95684b7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/filesystem_unittest.py
@@ -0,0 +1,157 @@
+# vim: set fileencoding=utf-8 :
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# NOTE: The fileencoding comment on the first line of the file is
+# important; without it, Python will choke while trying to parse the file,
+# since it includes non-ASCII characters.
+
+from __future__ import with_statement
+
+import os
+import stat
+import sys
+import tempfile
+import unittest
+
+from filesystem import FileSystem
+
+
+class FileSystemTest(unittest.TestCase):
+ def setUp(self):
+ self._this_dir = os.path.dirname(os.path.abspath(__file__))
+ self._missing_file = os.path.join(self._this_dir, 'missing_file.py')
+ self._this_file = os.path.join(self._this_dir, 'filesystem_unittest.py')
+
+ def test_exists__true(self):
+ fs = FileSystem()
+ self.assertTrue(fs.exists(self._this_file))
+
+ def test_exists__false(self):
+ fs = FileSystem()
+ self.assertFalse(fs.exists(self._missing_file))
+
+ def test_isdir__true(self):
+ fs = FileSystem()
+ self.assertTrue(fs.isdir(self._this_dir))
+
+ def test_isdir__false(self):
+ fs = FileSystem()
+ self.assertFalse(fs.isdir(self._this_file))
+
+ def test_join(self):
+ fs = FileSystem()
+ self.assertEqual(fs.join('foo', 'bar'),
+ os.path.join('foo', 'bar'))
+
+ def test_listdir(self):
+ fs = FileSystem()
+ with fs.mkdtemp(prefix='filesystem_unittest_') as d:
+ self.assertEqual(fs.listdir(d), [])
+ new_file = os.path.join(d, 'foo')
+ fs.write_text_file(new_file, u'foo')
+ self.assertEqual(fs.listdir(d), ['foo'])
+ os.remove(new_file)
+
+ def test_maybe_make_directory__success(self):
+ fs = FileSystem()
+
+ with fs.mkdtemp(prefix='filesystem_unittest_') as base_path:
+ sub_path = os.path.join(base_path, "newdir")
+ self.assertFalse(os.path.exists(sub_path))
+ self.assertFalse(fs.isdir(sub_path))
+
+ fs.maybe_make_directory(sub_path)
+ self.assertTrue(os.path.exists(sub_path))
+ self.assertTrue(fs.isdir(sub_path))
+
+ # Make sure we can re-create it.
+ fs.maybe_make_directory(sub_path)
+ self.assertTrue(os.path.exists(sub_path))
+ self.assertTrue(fs.isdir(sub_path))
+
+ # Clean up.
+ os.rmdir(sub_path)
+
+ self.assertFalse(os.path.exists(base_path))
+ self.assertFalse(fs.isdir(base_path))
+
+ def test_maybe_make_directory__failure(self):
+ # FIXME: os.chmod() doesn't work on Windows to set directories
+ # as readonly, so we skip this test for now.
+ if sys.platform in ('win32', 'cygwin'):
+ return
+
+ fs = FileSystem()
+ with fs.mkdtemp(prefix='filesystem_unittest_') as d:
+ # Remove write permissions on the parent directory.
+ os.chmod(d, stat.S_IRUSR)
+
+ # Now try to create a sub directory - should fail.
+ sub_dir = fs.join(d, 'subdir')
+ self.assertRaises(OSError, fs.maybe_make_directory, sub_dir)
+
+ # Clean up in case the test failed and we did create the
+ # directory.
+ if os.path.exists(sub_dir):
+ os.rmdir(sub_dir)
+
+ def test_read_and_write_file(self):
+ fs = FileSystem()
+ text_path = None
+ binary_path = None
+
+ unicode_text_string = u'ŪnÄ­cÅde̽'
+ hex_equivalent = '\xC5\xAA\x6E\xC4\xAD\x63\xC5\x8D\x64\x65\xCC\xBD'
+ try:
+ text_path = tempfile.mktemp(prefix='tree_unittest_')
+ binary_path = tempfile.mktemp(prefix='tree_unittest_')
+ fs.write_text_file(text_path, unicode_text_string)
+ contents = fs.read_binary_file(text_path)
+ self.assertEqual(contents, hex_equivalent)
+
+ fs.write_text_file(binary_path, hex_equivalent)
+ text_contents = fs.read_text_file(binary_path)
+ self.assertEqual(text_contents, unicode_text_string)
+ except:
+ if text_path:
+ os.remove(text_path)
+ if binary_path:
+ os.remove(binary_path)
+
+ def test_read_binary_file__missing(self):
+ fs = FileSystem()
+ self.assertRaises(IOError, fs.read_binary_file, self._missing_file)
+
+ def test_read_text_file__missing(self):
+ fs = FileSystem()
+ self.assertRaises(IOError, fs.read_text_file, self._missing_file)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/system/fileutils.py b/WebKitTools/Scripts/webkitpy/common/system/fileutils.py
new file mode 100644
index 0000000..55821f8
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/fileutils.py
@@ -0,0 +1,33 @@
+# 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 sys
+
+
+def make_stdout_binary():
+ """Puts sys.stdout into binary mode (on platforms that have a distinction
+ between text and binary mode)."""
+ if sys.platform != 'win32' or not hasattr(sys.stdout, 'fileno'):
+ return
+ import msvcrt
+ import os
+ msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
diff --git a/WebKitTools/Scripts/webkitpy/common/system/logtesting.py b/WebKitTools/Scripts/webkitpy/common/system/logtesting.py
new file mode 100644
index 0000000..e361cb5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/logtesting.py
@@ -0,0 +1,258 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Supports the unit-testing of logging code.
+
+Provides support for unit-testing messages logged using the built-in
+logging module.
+
+Inherit from the LoggingTestCase class for basic testing needs. For
+more advanced needs (e.g. unit-testing methods that configure logging),
+see the TestLogStream class, and perhaps also the LogTesting class.
+
+"""
+
+import logging
+import unittest
+
+
+class TestLogStream(object):
+
+ """Represents a file-like object for unit-testing logging.
+
+ This is meant for passing to the logging.StreamHandler constructor.
+ Log messages captured by instances of this object can be tested
+ using self.assertMessages() below.
+
+ """
+
+ def __init__(self, test_case):
+ """Create an instance.
+
+ Args:
+ test_case: A unittest.TestCase instance.
+
+ """
+ self._test_case = test_case
+ self.messages = []
+ """A list of log messages written to the stream."""
+
+ # Python documentation says that any object passed to the StreamHandler
+ # constructor should support write() and flush():
+ #
+ # http://docs.python.org/library/logging.html#module-logging.handlers
+ def write(self, message):
+ self.messages.append(message)
+
+ def flush(self):
+ pass
+
+ def assertMessages(self, messages):
+ """Assert that the given messages match the logged messages.
+
+ messages: A list of log message strings.
+
+ """
+ self._test_case.assertEquals(messages, self.messages)
+
+
+class LogTesting(object):
+
+ """Supports end-to-end unit-testing of log messages.
+
+ Sample usage:
+
+ class SampleTest(unittest.TestCase):
+
+ def setUp(self):
+ self._log = LogTesting.setUp(self) # Turn logging on.
+
+ def tearDown(self):
+ self._log.tearDown() # Turn off and reset logging.
+
+ def test_logging_in_some_method(self):
+ call_some_method() # Contains calls to _log.info(), etc.
+
+ # Check the resulting log messages.
+ self._log.assertMessages(["INFO: expected message #1",
+ "WARNING: expected message #2"])
+
+ """
+
+ def __init__(self, test_stream, handler):
+ """Create an instance.
+
+ This method should never be called directly. Instances should
+ instead be created using the static setUp() method.
+
+ Args:
+ test_stream: A TestLogStream instance.
+ handler: The handler added to the logger.
+
+ """
+ self._test_stream = test_stream
+ self._handler = handler
+
+ @staticmethod
+ def _getLogger():
+ """Return the logger being tested."""
+ # It is possible we might want to return something other than
+ # the root logger in some special situation. For now, the
+ # root logger seems to suffice.
+ return logging.getLogger()
+
+ @staticmethod
+ def setUp(test_case, logging_level=logging.INFO):
+ """Configure logging for unit testing.
+
+ Configures the root logger to log to a testing log stream.
+ Only messages logged at or above the given level are logged
+ to the stream. Messages logged to the stream are formatted
+ in the following way, for example--
+
+ "INFO: This is a test log message."
+
+ This method should normally be called in the setUp() method
+ of a unittest.TestCase. See the docstring of this class
+ for more details.
+
+ Returns:
+ A LogTesting instance.
+
+ Args:
+ test_case: A unittest.TestCase instance.
+ logging_level: An integer logging level that is the minimum level
+ of log messages you would like to test.
+
+ """
+ stream = TestLogStream(test_case)
+ handler = logging.StreamHandler(stream)
+ handler.setLevel(logging_level)
+ formatter = logging.Formatter("%(levelname)s: %(message)s")
+ handler.setFormatter(formatter)
+
+ # Notice that we only change the root logger by adding a handler
+ # to it. In particular, we do not reset its level using
+ # logger.setLevel(). This ensures that we have not interfered
+ # with how the code being tested may have configured the root
+ # logger.
+ logger = LogTesting._getLogger()
+ logger.addHandler(handler)
+
+ return LogTesting(stream, handler)
+
+ def tearDown(self):
+ """Assert there are no remaining log messages, and reset logging.
+
+ This method asserts that there are no more messages in the array of
+ log messages, and then restores logging to its original state.
+ This method should normally be called in the tearDown() method of a
+ unittest.TestCase. See the docstring of this class for more details.
+
+ """
+ self.assertMessages([])
+ logger = LogTesting._getLogger()
+ logger.removeHandler(self._handler)
+
+ def messages(self):
+ """Return the current list of log messages."""
+ return self._test_stream.messages
+
+ # FIXME: Add a clearMessages() method for cases where the caller
+ # deliberately doesn't want to assert every message.
+
+ # We clear the log messages after asserting since they are no longer
+ # needed after asserting. This serves two purposes: (1) it simplifies
+ # the calling code when we want to check multiple logging calls in a
+ # single test method, and (2) it lets us check in the tearDown() method
+ # that there are no remaining log messages to be asserted.
+ #
+ # The latter ensures that no extra log messages are getting logged that
+ # the caller might not be aware of or may have forgotten to check for.
+ # This gets us a bit more mileage out of our tests without writing any
+ # additional code.
+ def assertMessages(self, messages):
+ """Assert the current array of log messages, and clear its contents.
+
+ Args:
+ messages: A list of log message strings.
+
+ """
+ try:
+ self._test_stream.assertMessages(messages)
+ finally:
+ # We want to clear the array of messages even in the case of
+ # an Exception (e.g. an AssertionError). Otherwise, another
+ # AssertionError can occur in the tearDown() because the
+ # array might not have gotten emptied.
+ self._test_stream.messages = []
+
+
+# This class needs to inherit from unittest.TestCase. Otherwise, the
+# setUp() and tearDown() methods will not get fired for test case classes
+# that inherit from this class -- even if the class inherits from *both*
+# unittest.TestCase and LoggingTestCase.
+#
+# FIXME: Rename this class to LoggingTestCaseBase to be sure that
+# the unittest module does not interpret this class as a unittest
+# test case itself.
+class LoggingTestCase(unittest.TestCase):
+
+ """Supports end-to-end unit-testing of log messages.
+
+ Sample usage:
+
+ class SampleTest(LoggingTestCase):
+
+ def test_logging_in_some_method(self):
+ call_some_method() # Contains calls to _log.info(), etc.
+
+ # Check the resulting log messages.
+ self.assertLog(["INFO: expected message #1",
+ "WARNING: expected message #2"])
+
+ """
+
+ def setUp(self):
+ self._log = LogTesting.setUp(self)
+
+ def tearDown(self):
+ self._log.tearDown()
+
+ def logMessages(self):
+ """Return the current list of log messages."""
+ return self._log.messages()
+
+ # FIXME: Add a clearMessages() method for cases where the caller
+ # deliberately doesn't want to assert every message.
+
+ # See the code comments preceding LogTesting.assertMessages() for
+ # an explanation of why we clear the array of messages after
+ # asserting its contents.
+ def assertLog(self, messages):
+ """Assert the current array of log messages, and clear its contents.
+
+ Args:
+ messages: A list of log message strings.
+
+ """
+ self._log.assertMessages(messages)
diff --git a/WebKitTools/Scripts/webkitpy/common/system/logutils.py b/WebKitTools/Scripts/webkitpy/common/system/logutils.py
new file mode 100644
index 0000000..cd4e60f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/logutils.py
@@ -0,0 +1,207 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Supports webkitpy logging."""
+
+# FIXME: Move this file to webkitpy/python24 since logging needs to
+# be configured prior to running version-checking code.
+
+import logging
+import os
+import sys
+
+import webkitpy
+
+
+_log = logging.getLogger(__name__)
+
+# We set these directory paths lazily in get_logger() below.
+_scripts_dir = ""
+"""The normalized, absolute path to the ...Scripts directory."""
+
+_webkitpy_dir = ""
+"""The normalized, absolute path to the ...Scripts/webkitpy directory."""
+
+
+def _normalize_path(path):
+ """Return the given path normalized.
+
+ Converts a path to an absolute path, removes any trailing slashes,
+ removes any extension, and lower-cases it.
+
+ """
+ path = os.path.abspath(path)
+ path = os.path.normpath(path)
+ path = os.path.splitext(path)[0] # Remove the extension, if any.
+ path = path.lower()
+
+ return path
+
+
+# Observe that the implementation of this function does not require
+# the use of any hard-coded strings like "webkitpy", etc.
+#
+# The main benefit this function has over using--
+#
+# _log = logging.getLogger(__name__)
+#
+# is that get_logger() returns the same value even if __name__ is
+# "__main__" -- i.e. even if the module is the script being executed
+# from the command-line.
+def get_logger(path):
+ """Return a logging.logger for the given path.
+
+ Returns:
+ A logger whose name is the name of the module corresponding to
+ the given path. If the module is in webkitpy, the name is
+ the fully-qualified dotted module name beginning with webkitpy....
+ Otherwise, the name is the base name of the module (i.e. without
+ any dotted module name prefix).
+
+ Args:
+ path: The path of the module. Normally, this parameter should be
+ the __file__ variable of the module.
+
+ Sample usage:
+
+ import webkitpy.common.system.logutils as logutils
+
+ _log = logutils.get_logger(__file__)
+
+ """
+ # Since we assign to _scripts_dir and _webkitpy_dir in this function,
+ # we need to declare them global.
+ global _scripts_dir
+ global _webkitpy_dir
+
+ path = _normalize_path(path)
+
+ # Lazily evaluate _webkitpy_dir and _scripts_dir.
+ if not _scripts_dir:
+ # The normalized, absolute path to ...Scripts/webkitpy/__init__.
+ webkitpy_path = _normalize_path(webkitpy.__file__)
+
+ _webkitpy_dir = os.path.split(webkitpy_path)[0]
+ _scripts_dir = os.path.split(_webkitpy_dir)[0]
+
+ if path.startswith(_webkitpy_dir):
+ # Remove the initial Scripts directory portion, so the path
+ # starts with /webkitpy, for example "/webkitpy/init/logutils".
+ path = path[len(_scripts_dir):]
+
+ parts = []
+ while True:
+ (path, tail) = os.path.split(path)
+ if not tail:
+ break
+ parts.insert(0, tail)
+
+ logger_name = ".".join(parts) # For example, webkitpy.common.system.logutils.
+ else:
+ # The path is outside of webkitpy. Default to the basename
+ # without the extension.
+ basename = os.path.basename(path)
+ logger_name = os.path.splitext(basename)[0]
+
+ return logging.getLogger(logger_name)
+
+
+def _default_handlers(stream):
+ """Return a list of the default logging handlers to use.
+
+ Args:
+ stream: See the configure_logging() docstring.
+
+ """
+ # Create the filter.
+ def should_log(record):
+ """Return whether a logging.LogRecord should be logged."""
+ # FIXME: Enable the logging of autoinstall messages once
+ # autoinstall is adjusted. Currently, autoinstall logs
+ # INFO messages when importing already-downloaded packages,
+ # which is too verbose.
+ if record.name.startswith("webkitpy.thirdparty.autoinstall"):
+ return False
+ return True
+
+ logging_filter = logging.Filter()
+ logging_filter.filter = should_log
+
+ # Create the handler.
+ handler = logging.StreamHandler(stream)
+ formatter = logging.Formatter("%(name)s: [%(levelname)s] %(message)s")
+ handler.setFormatter(formatter)
+ handler.addFilter(logging_filter)
+
+ return [handler]
+
+
+def configure_logging(logging_level=None, logger=None, stream=None,
+ handlers=None):
+ """Configure logging for standard purposes.
+
+ Returns:
+ A list of references to the logging handlers added to the root
+ logger. This allows the caller to later remove the handlers
+ using logger.removeHandler. This is useful primarily during unit
+ testing where the caller may want to configure logging temporarily
+ and then undo the configuring.
+
+ Args:
+ logging_level: The minimum logging level to log. Defaults to
+ logging.INFO.
+ logger: A logging.logger instance to configure. This parameter
+ should be used only in unit tests. Defaults to the
+ root logger.
+ stream: A file-like object to which to log used in creating the default
+ handlers. The stream must define an "encoding" data attribute,
+ or else logging raises an error. Defaults to sys.stderr.
+ handlers: A list of logging.Handler instances to add to the logger
+ being configured. If this parameter is provided, then the
+ stream parameter is not used.
+
+ """
+ # If the stream does not define an "encoding" data attribute, the
+ # logging module can throw an error like the following:
+ #
+ # Traceback (most recent call last):
+ # File "/System/Library/Frameworks/Python.framework/Versions/2.6/...
+ # lib/python2.6/logging/__init__.py", line 761, in emit
+ # self.stream.write(fs % msg.encode(self.stream.encoding))
+ # LookupError: unknown encoding: unknown
+ if logging_level is None:
+ logging_level = logging.INFO
+ if logger is None:
+ logger = logging.getLogger()
+ if stream is None:
+ stream = sys.stderr
+ if handlers is None:
+ handlers = _default_handlers(stream)
+
+ logger.setLevel(logging_level)
+
+ for handler in handlers:
+ logger.addHandler(handler)
+
+ _log.debug("Debug logging enabled.")
+
+ return handlers
diff --git a/WebKitTools/Scripts/webkitpy/common/system/logutils_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/logutils_unittest.py
new file mode 100644
index 0000000..a4a6496
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/logutils_unittest.py
@@ -0,0 +1,142 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Unit tests for logutils.py."""
+
+import logging
+import os
+import unittest
+
+from webkitpy.common.system.logtesting import LogTesting
+from webkitpy.common.system.logtesting import TestLogStream
+import webkitpy.common.system.logutils as logutils
+
+
+class GetLoggerTest(unittest.TestCase):
+
+ """Tests get_logger()."""
+
+ def test_get_logger_in_webkitpy(self):
+ logger = logutils.get_logger(__file__)
+ self.assertEquals(logger.name, "webkitpy.common.system.logutils_unittest")
+
+ def test_get_logger_not_in_webkitpy(self):
+ # Temporarily change the working directory so that we
+ # can test get_logger() for a path outside of webkitpy.
+ working_directory = os.getcwd()
+ root_dir = "/"
+ os.chdir(root_dir)
+
+ logger = logutils.get_logger("/WebKitTools/Scripts/test-webkitpy")
+ self.assertEquals(logger.name, "test-webkitpy")
+
+ logger = logutils.get_logger("/WebKitTools/Scripts/test-webkitpy.py")
+ self.assertEquals(logger.name, "test-webkitpy")
+
+ os.chdir(working_directory)
+
+
+class ConfigureLoggingTestBase(unittest.TestCase):
+
+ """Base class for configure_logging() unit tests."""
+
+ def _logging_level(self):
+ raise Exception("Not implemented.")
+
+ def setUp(self):
+ log_stream = TestLogStream(self)
+
+ # Use a logger other than the root logger or one prefixed with
+ # "webkitpy." so as not to conflict with test-webkitpy logging.
+ logger = logging.getLogger("unittest")
+
+ # Configure the test logger not to pass messages along to the
+ # root logger. This prevents test messages from being
+ # propagated to loggers used by test-webkitpy logging (e.g.
+ # the root logger).
+ logger.propagate = False
+
+ logging_level = self._logging_level()
+ self._handlers = logutils.configure_logging(logging_level=logging_level,
+ logger=logger,
+ stream=log_stream)
+ self._log = logger
+ self._log_stream = log_stream
+
+ def tearDown(self):
+ """Reset logging to its original state.
+
+ This method ensures that the logging configuration set up
+ for a unit test does not affect logging in other unit tests.
+
+ """
+ logger = self._log
+ for handler in self._handlers:
+ logger.removeHandler(handler)
+
+ def _assert_log_messages(self, messages):
+ """Assert that the logged messages equal the given messages."""
+ self._log_stream.assertMessages(messages)
+
+
+class ConfigureLoggingTest(ConfigureLoggingTestBase):
+
+ """Tests configure_logging() with the default logging level."""
+
+ def _logging_level(self):
+ return None
+
+ def test_info_message(self):
+ self._log.info("test message")
+ self._assert_log_messages(["unittest: [INFO] test message\n"])
+
+ def test_below_threshold_message(self):
+ # We test the boundary case of a logging level equal to 19.
+ # In practice, we will probably only be calling log.debug(),
+ # which corresponds to a logging level of 10.
+ level = logging.INFO - 1 # Equals 19.
+ self._log.log(level, "test message")
+ self._assert_log_messages([])
+
+ def test_two_messages(self):
+ self._log.info("message1")
+ self._log.info("message2")
+ self._assert_log_messages(["unittest: [INFO] message1\n",
+ "unittest: [INFO] message2\n"])
+
+
+class ConfigureLoggingCustomLevelTest(ConfigureLoggingTestBase):
+
+ """Tests configure_logging() with a custom logging level."""
+
+ _level = 36
+
+ def _logging_level(self):
+ return self._level
+
+ def test_logged_message(self):
+ self._log.log(self._level, "test message")
+ self._assert_log_messages(["unittest: [Level 36] test message\n"])
+
+ def test_below_threshold_message(self):
+ self._log.log(self._level - 1, "test message")
+ self._assert_log_messages([])
diff --git a/WebKitTools/Scripts/webkitpy/common/system/ospath.py b/WebKitTools/Scripts/webkitpy/common/system/ospath.py
new file mode 100644
index 0000000..aed7a3d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/ospath.py
@@ -0,0 +1,83 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Contains a substitute for Python 2.6's os.path.relpath()."""
+
+import os
+
+
+# This function is a replacement for os.path.relpath(), which is only
+# available in Python 2.6:
+#
+# http://docs.python.org/library/os.path.html#os.path.relpath
+#
+# It should behave essentially the same as os.path.relpath(), except for
+# returning None on paths not contained in abs_start_path.
+def relpath(path, start_path, os_path_abspath=None):
+ """Return a path relative to the given start path, or None.
+
+ Returns None if the path is not contained in the directory start_path.
+
+ Args:
+ path: An absolute or relative path to convert to a relative path.
+ start_path: The path relative to which the given path should be
+ converted.
+ os_path_abspath: A replacement function for unit testing. This
+ function should strip trailing slashes just like
+ os.path.abspath(). Defaults to os.path.abspath.
+
+ """
+ if os_path_abspath is None:
+ os_path_abspath = os.path.abspath
+
+ # Since os_path_abspath() calls os.path.normpath()--
+ #
+ # (see http://docs.python.org/library/os.path.html#os.path.abspath )
+ #
+ # it also removes trailing slashes and converts forward and backward
+ # slashes to the preferred slash os.sep.
+ start_path = os_path_abspath(start_path)
+ path = os_path_abspath(path)
+
+ if not path.lower().startswith(start_path.lower()):
+ # Then path is outside the directory given by start_path.
+ return None
+
+ rel_path = path[len(start_path):]
+
+ if not rel_path:
+ # Then the paths are the same.
+ pass
+ elif rel_path[0] == os.sep:
+ # It is probably sufficient to remove just the first character
+ # since os.path.normpath() collapses separators, but we use
+ # lstrip() just to be sure.
+ rel_path = rel_path.lstrip(os.sep)
+ else:
+ # We are in the case typified by the following example:
+ #
+ # start_path = "/tmp/foo"
+ # path = "/tmp/foobar"
+ # rel_path = "bar"
+ return None
+
+ return rel_path
diff --git a/WebKitTools/Scripts/webkitpy/common/system/ospath_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/ospath_unittest.py
new file mode 100644
index 0000000..0493c68
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/ospath_unittest.py
@@ -0,0 +1,62 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Unit tests for ospath.py."""
+
+import os
+import unittest
+
+from webkitpy.common.system.ospath import relpath
+
+
+# Make sure the tests in this class are platform independent.
+class RelPathTest(unittest.TestCase):
+
+ """Tests relpath()."""
+
+ os_path_abspath = lambda self, path: path
+
+ def _rel_path(self, path, abs_start_path):
+ return relpath(path, abs_start_path, self.os_path_abspath)
+
+ def test_same_path(self):
+ rel_path = self._rel_path("WebKit", "WebKit")
+ self.assertEquals(rel_path, "")
+
+ def test_long_rel_path(self):
+ start_path = "WebKit"
+ expected_rel_path = os.path.join("test", "Foo.txt")
+ path = os.path.join(start_path, expected_rel_path)
+
+ rel_path = self._rel_path(path, start_path)
+ self.assertEquals(expected_rel_path, rel_path)
+
+ def test_none_rel_path(self):
+ """Test _rel_path() with None return value."""
+ start_path = "WebKit"
+ path = os.path.join("other_dir", "foo.txt")
+
+ rel_path = self._rel_path(path, start_path)
+ self.assertTrue(rel_path is None)
+
+ rel_path = self._rel_path("WebKitTools", "WebKit")
+ self.assertTrue(rel_path is None)
diff --git a/WebKitTools/Scripts/webkitpy/outputcapture.py b/WebKitTools/Scripts/webkitpy/common/system/outputcapture.py
index 592a669..45e0e3f 100644
--- a/WebKitTools/Scripts/webkitpy/outputcapture.py
+++ b/WebKitTools/Scripts/webkitpy/common/system/outputcapture.py
@@ -29,6 +29,7 @@
# Class for unittest support. Used for capturing stderr/stdout.
import sys
+import unittest
from StringIO import StringIO
class OutputCapture(object):
@@ -37,7 +38,9 @@ class OutputCapture(object):
def _capture_output_with_name(self, output_name):
self.saved_outputs[output_name] = getattr(sys, output_name)
- setattr(sys, output_name, StringIO())
+ captured_output = StringIO()
+ setattr(sys, output_name, captured_output)
+ return captured_output
def _restore_output_with_name(self, output_name):
captured_output = getattr(sys, output_name).getvalue()
@@ -46,17 +49,38 @@ class OutputCapture(object):
return captured_output
def capture_output(self):
- self._capture_output_with_name("stdout")
- self._capture_output_with_name("stderr")
+ return (self._capture_output_with_name("stdout"), self._capture_output_with_name("stderr"))
def restore_output(self):
return (self._restore_output_with_name("stdout"), self._restore_output_with_name("stderr"))
- def assert_outputs(self, testcase, function, args=[], kwargs={}, expected_stdout="", expected_stderr=""):
+ def assert_outputs(self, testcase, function, args=[], kwargs={}, expected_stdout="", expected_stderr="", expected_exception=None):
self.capture_output()
- return_value = function(*args, **kwargs)
+ if expected_exception:
+ return_value = testcase.assertRaises(expected_exception, function, *args, **kwargs)
+ else:
+ return_value = function(*args, **kwargs)
(stdout_string, stderr_string) = self.restore_output()
testcase.assertEqual(stdout_string, expected_stdout)
testcase.assertEqual(stderr_string, expected_stderr)
# This is a little strange, but I don't know where else to return this information.
return return_value
+
+
+class OutputCaptureTestCaseBase(unittest.TestCase):
+ def setUp(self):
+ unittest.TestCase.setUp(self)
+ self.output_capture = OutputCapture()
+ (self.__captured_stdout, self.__captured_stderr) = self.output_capture.capture_output()
+
+ def tearDown(self):
+ del self.__captured_stdout
+ del self.__captured_stderr
+ self.output_capture.restore_output()
+ unittest.TestCase.tearDown(self)
+
+ def assertStdout(self, expected_stdout):
+ self.assertEquals(expected_stdout, self.__captured_stdout.getvalue())
+
+ def assertStderr(self, expected_stderr):
+ self.assertEquals(expected_stderr, self.__captured_stderr.getvalue())
diff --git a/WebKitTools/Scripts/webkitpy/common/system/path.py b/WebKitTools/Scripts/webkitpy/common/system/path.py
new file mode 100644
index 0000000..09787d7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/path.py
@@ -0,0 +1,138 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""generic routines to convert platform-specific paths to URIs."""
+from __future__ import with_statement
+
+import atexit
+import subprocess
+import sys
+import threading
+import urllib
+
+
+def abspath_to_uri(path, platform=None):
+ """Converts a platform-specific absolute path to a file: URL."""
+ if platform is None:
+ platform = sys.platform
+ return "file:" + _escape(_convert_path(path, platform))
+
+
+def cygpath(path):
+ """Converts an absolute cygwin path to an absolute Windows path."""
+ return _CygPath.convert_using_singleton(path)
+
+
+# Note that this object is not threadsafe and must only be called
+# from multiple threads under protection of a lock (as is done in cygpath())
+class _CygPath(object):
+ """Manages a long-running 'cygpath' process for file conversion."""
+ _lock = None
+ _singleton = None
+
+ @staticmethod
+ def stop_cygpath_subprocess():
+ if not _CygPath._lock:
+ return
+
+ with _CygPath._lock:
+ if _CygPath._singleton:
+ _CygPath._singleton.stop()
+
+ @staticmethod
+ def convert_using_singleton(path):
+ if not _CygPath._lock:
+ _CygPath._lock = threading.Lock()
+
+ with _CygPath._lock:
+ if not _CygPath._singleton:
+ _CygPath._singleton = _CygPath()
+ # Make sure the cygpath subprocess always gets shutdown cleanly.
+ atexit.register(_CygPath.stop_cygpath_subprocess)
+
+ return _CygPath._singleton.convert(path)
+
+ def __init__(self):
+ self._child_process = None
+
+ def start(self):
+ assert(self._child_process is None)
+ args = ['cygpath', '-f', '-', '-wa']
+ self._child_process = subprocess.Popen(args,
+ stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE)
+
+ def is_running(self):
+ if not self._child_process:
+ return False
+ return self._child_process.returncode is None
+
+ def stop(self):
+ if self._child_process:
+ self._child_process.stdin.close()
+ self._child_process.wait()
+ self._child_process = None
+
+ def convert(self, path):
+ if not self.is_running():
+ self.start()
+ self._child_process.stdin.write("%s\r\n" % path)
+ self._child_process.stdin.flush()
+ windows_path = self._child_process.stdout.readline().rstrip()
+ # Some versions of cygpath use lowercase drive letters while others
+ # use uppercase. We always convert to uppercase for consistency.
+ windows_path = '%s%s' % (windows_path[0].upper(), windows_path[1:])
+ return windows_path
+
+
+def _escape(path):
+ """Handle any characters in the path that should be escaped."""
+ # FIXME: web browsers don't appear to blindly quote every character
+ # when converting filenames to files. Instead of using urllib's default
+ # rules, we allow a small list of other characters through un-escaped.
+ # It's unclear if this is the best possible solution.
+ return urllib.quote(path, safe='/+:')
+
+
+def _convert_path(path, platform):
+ """Handles any os-specific path separators, mappings, etc."""
+ if platform == 'win32':
+ return _winpath_to_uri(path)
+ if platform == 'cygwin':
+ return _winpath_to_uri(cygpath(path))
+ return _unixypath_to_uri(path)
+
+
+def _winpath_to_uri(path):
+ """Converts a window absolute path to a file: URL."""
+ return "///" + path.replace("\\", "/")
+
+
+def _unixypath_to_uri(path):
+ """Converts a unix-style path to a file: URL."""
+ return "//" + path
diff --git a/WebKitTools/Scripts/webkitpy/common/system/path_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/path_unittest.py
new file mode 100644
index 0000000..4dbd38a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/path_unittest.py
@@ -0,0 +1,105 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+import sys
+
+import path
+
+class AbspathTest(unittest.TestCase):
+ def assertMatch(self, test_path, expected_uri,
+ platform=None):
+ if platform == 'cygwin' and sys.platform != 'cygwin':
+ return
+ self.assertEqual(path.abspath_to_uri(test_path, platform=platform),
+ expected_uri)
+
+ def test_abspath_to_uri_cygwin(self):
+ if sys.platform != 'cygwin':
+ return
+
+ self.assertMatch('/cygdrive/c/foo/bar.html',
+ 'file:///C:/foo/bar.html',
+ platform='cygwin')
+ self.assertEqual(path.abspath_to_uri('/cygdrive/c/foo/bar.html',
+ platform='cygwin'),
+ 'file:///C:/foo/bar.html')
+
+ def test_abspath_to_uri_darwin(self):
+ self.assertMatch('/foo/bar.html',
+ 'file:///foo/bar.html',
+ platform='darwin')
+ self.assertEqual(path.abspath_to_uri("/foo/bar.html",
+ platform='darwin'),
+ "file:///foo/bar.html")
+
+ def test_abspath_to_uri_linux2(self):
+ self.assertMatch('/foo/bar.html',
+ 'file:///foo/bar.html',
+ platform='darwin')
+ self.assertEqual(path.abspath_to_uri("/foo/bar.html",
+ platform='linux2'),
+ "file:///foo/bar.html")
+
+ def test_abspath_to_uri_win(self):
+ self.assertMatch('c:\\foo\\bar.html',
+ 'file:///c:/foo/bar.html',
+ platform='win32')
+ self.assertEqual(path.abspath_to_uri("c:\\foo\\bar.html",
+ platform='win32'),
+ "file:///c:/foo/bar.html")
+
+ def test_abspath_to_uri_escaping(self):
+ self.assertMatch('/foo/bar + baz%?.html',
+ 'file:///foo/bar%20+%20baz%25%3F.html',
+ platform='darwin')
+ self.assertMatch('/foo/bar + baz%?.html',
+ 'file:///foo/bar%20+%20baz%25%3F.html',
+ platform='linux2')
+
+ # Note that you can't have '?' in a filename on windows.
+ self.assertMatch('/cygdrive/c/foo/bar + baz%.html',
+ 'file:///C:/foo/bar%20+%20baz%25.html',
+ platform='cygwin')
+
+ def test_stop_cygpath_subprocess(self):
+ if sys.platform != 'cygwin':
+ return
+
+ # Call cygpath to ensure the subprocess is running.
+ path.cygpath("/cygdrive/c/foo.txt")
+ self.assertTrue(path._CygPath._singleton.is_running())
+
+ # Stop it.
+ path._CygPath.stop_cygpath_subprocess()
+
+ # Ensure that it is stopped.
+ self.assertFalse(path._CygPath._singleton.is_running())
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/common/system/user.py b/WebKitTools/Scripts/webkitpy/common/system/user.py
new file mode 100644
index 0000000..8917137
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/user.py
@@ -0,0 +1,143 @@
+# Copyright (c) 2009, Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import logging
+import os
+import re
+import shlex
+import subprocess
+import sys
+import webbrowser
+
+
+_log = logging.getLogger("webkitpy.common.system.user")
+
+
+try:
+ import readline
+except ImportError:
+ if sys.platform != "win32":
+ # There is no readline module for win32, not much to do except cry.
+ _log.warn("Unable to import readline.")
+ # FIXME: We could give instructions for non-mac platforms.
+ # Lack of readline results in a very bad user experiance.
+ if sys.platform == "mac":
+ _log.warn("If you're using MacPorts, try running:")
+ _log.warn(" sudo port install py25-readline")
+
+
+class User(object):
+ DEFAULT_NO = 'n'
+ DEFAULT_YES = 'y'
+
+ # FIXME: These are @classmethods because bugzilla.py doesn't have a Tool object (thus no User instance).
+ @classmethod
+ def prompt(cls, message, repeat=1, raw_input=raw_input):
+ response = None
+ while (repeat and not response):
+ repeat -= 1
+ response = raw_input(message)
+ return response
+
+ @classmethod
+ def prompt_with_list(cls, list_title, list_items, can_choose_multiple=False, raw_input=raw_input):
+ print list_title
+ i = 0
+ for item in list_items:
+ i += 1
+ print "%2d. %s" % (i, item)
+
+ # Loop until we get valid input
+ while True:
+ if can_choose_multiple:
+ response = cls.prompt("Enter one or more numbers (comma-separated), or \"all\": ", raw_input=raw_input)
+ if not response.strip() or response == "all":
+ return list_items
+ try:
+ indices = [int(r) - 1 for r in re.split("\s*,\s*", response)]
+ except ValueError, err:
+ continue
+ return [list_items[i] for i in indices]
+ else:
+ try:
+ result = int(cls.prompt("Enter a number: ", raw_input=raw_input)) - 1
+ except ValueError, err:
+ continue
+ return list_items[result]
+
+ def edit(self, files):
+ editor = os.environ.get("EDITOR") or "vi"
+ args = shlex.split(editor)
+ # Note: Not thread safe: http://bugs.python.org/issue2320
+ subprocess.call(args + files)
+
+ def _warn_if_application_is_xcode(self, edit_application):
+ if "Xcode" in edit_application:
+ print "Instead of using Xcode.app, consider using EDITOR=\"xed --wait\"."
+
+ def edit_changelog(self, files):
+ edit_application = os.environ.get("CHANGE_LOG_EDIT_APPLICATION")
+ if edit_application and sys.platform == "darwin":
+ # On Mac we support editing ChangeLogs using an application.
+ args = shlex.split(edit_application)
+ print "Using editor in the CHANGE_LOG_EDIT_APPLICATION environment variable."
+ print "Please quit the editor application when done editing."
+ self._warn_if_application_is_xcode(edit_application)
+ subprocess.call(["open", "-W", "-n", "-a"] + args + files)
+ return
+ self.edit(files)
+
+ def page(self, message):
+ pager = os.environ.get("PAGER") or "less"
+ try:
+ # Note: Not thread safe: http://bugs.python.org/issue2320
+ child_process = subprocess.Popen([pager], stdin=subprocess.PIPE)
+ child_process.communicate(input=message)
+ except IOError, e:
+ pass
+
+ def confirm(self, message=None, default=DEFAULT_YES, raw_input=raw_input):
+ if not message:
+ message = "Continue?"
+ choice = {'y': 'Y/n', 'n': 'y/N'}[default]
+ response = raw_input("%s [%s]: " % (message, choice))
+ if not response:
+ response = default
+ return response.lower() == 'y'
+
+ def can_open_url(self):
+ try:
+ webbrowser.get()
+ return True
+ except webbrowser.Error, e:
+ return False
+
+ def open_url(self, url):
+ if not self.can_open_url():
+ _log.warn("Failed to open %s" % url)
+ webbrowser.open(url)
diff --git a/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py
new file mode 100644
index 0000000..7ec9b34
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/system/user_unittest.py
@@ -0,0 +1,109 @@
+# Copyright (C) 2010 Research in Motion Ltd. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Research in Motion Ltd. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.common.system.user import User
+
+class UserTest(unittest.TestCase):
+
+ example_user_response = "example user response"
+
+ def test_prompt_repeat(self):
+ self.repeatsRemaining = 2
+ def mock_raw_input(message):
+ self.repeatsRemaining -= 1
+ if not self.repeatsRemaining:
+ return UserTest.example_user_response
+ return None
+ self.assertEqual(User.prompt("input", repeat=self.repeatsRemaining, raw_input=mock_raw_input), UserTest.example_user_response)
+
+ def test_prompt_when_exceeded_repeats(self):
+ self.repeatsRemaining = 2
+ def mock_raw_input(message):
+ self.repeatsRemaining -= 1
+ return None
+ self.assertEqual(User.prompt("input", repeat=self.repeatsRemaining, raw_input=mock_raw_input), None)
+
+ def test_prompt_with_list(self):
+ def run_prompt_test(inputs, expected_result, can_choose_multiple=False):
+ def mock_raw_input(message):
+ return inputs.pop(0)
+ output_capture = OutputCapture()
+ actual_result = output_capture.assert_outputs(
+ self,
+ User.prompt_with_list,
+ args=["title", ["foo", "bar"]],
+ kwargs={"can_choose_multiple": can_choose_multiple, "raw_input": mock_raw_input},
+ expected_stdout="title\n 1. foo\n 2. bar\n")
+ self.assertEqual(actual_result, expected_result)
+ self.assertEqual(len(inputs), 0)
+
+ run_prompt_test(["1"], "foo")
+ run_prompt_test(["badinput", "2"], "bar")
+
+ run_prompt_test(["1,2"], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test([" 1, 2 "], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test(["all"], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test([""], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test([" "], ["foo", "bar"], can_choose_multiple=True)
+ run_prompt_test(["badinput", "all"], ["foo", "bar"], can_choose_multiple=True)
+
+ def test_confirm(self):
+ test_cases = (
+ (("Continue? [Y/n]: ", True), (User.DEFAULT_YES, 'y')),
+ (("Continue? [Y/n]: ", False), (User.DEFAULT_YES, 'n')),
+ (("Continue? [Y/n]: ", True), (User.DEFAULT_YES, '')),
+ (("Continue? [Y/n]: ", False), (User.DEFAULT_YES, 'q')),
+ (("Continue? [y/N]: ", True), (User.DEFAULT_NO, 'y')),
+ (("Continue? [y/N]: ", False), (User.DEFAULT_NO, 'n')),
+ (("Continue? [y/N]: ", False), (User.DEFAULT_NO, '')),
+ (("Continue? [y/N]: ", False), (User.DEFAULT_NO, 'q')),
+ )
+ for test_case in test_cases:
+ expected, inputs = test_case
+
+ def mock_raw_input(message):
+ self.assertEquals(expected[0], message)
+ return inputs[1]
+
+ result = User().confirm(default=inputs[0],
+ raw_input=mock_raw_input)
+ self.assertEquals(expected[1], result)
+
+ def test_warn_if_application_is_xcode(self):
+ output = OutputCapture()
+ user = User()
+ output.assert_outputs(self, user._warn_if_application_is_xcode, ["TextMate"])
+ output.assert_outputs(self, user._warn_if_application_is_xcode, ["/Applications/TextMate.app"])
+ output.assert_outputs(self, user._warn_if_application_is_xcode, ["XCode"]) # case sensitive matching
+
+ xcode_warning = "Instead of using Xcode.app, consider using EDITOR=\"xed --wait\".\n"
+ output.assert_outputs(self, user._warn_if_application_is_xcode, ["Xcode"], expected_stdout=xcode_warning)
+ output.assert_outputs(self, user._warn_if_application_is_xcode, ["/Developer/Applications/Xcode.app"], expected_stdout=xcode_warning)
diff --git a/WebKitTools/Scripts/webkitpy/common/thread/__init__.py b/WebKitTools/Scripts/webkitpy/common/thread/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/thread/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/common/thread/messagepump.py b/WebKitTools/Scripts/webkitpy/common/thread/messagepump.py
new file mode 100644
index 0000000..0e39285
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/thread/messagepump.py
@@ -0,0 +1,59 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+class MessagePumpDelegate(object):
+ def schedule(self, interval, callback):
+ raise NotImplementedError, "subclasses must implement"
+
+ def message_available(self, message):
+ raise NotImplementedError, "subclasses must implement"
+
+ def final_message_delivered(self):
+ raise NotImplementedError, "subclasses must implement"
+
+
+class MessagePump(object):
+ interval = 10 # seconds
+
+ def __init__(self, delegate, message_queue):
+ self._delegate = delegate
+ self._message_queue = message_queue
+ self._schedule()
+
+ def _schedule(self):
+ self._delegate.schedule(self.interval, self._callback)
+
+ def _callback(self):
+ (messages, is_running) = self._message_queue.take_all()
+ for message in messages:
+ self._delegate.message_available(message)
+ if not is_running:
+ self._delegate.final_message_delivered()
+ return
+ self._schedule()
diff --git a/WebKitTools/Scripts/webkitpy/common/thread/messagepump_unittest.py b/WebKitTools/Scripts/webkitpy/common/thread/messagepump_unittest.py
new file mode 100644
index 0000000..f731db2
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/thread/messagepump_unittest.py
@@ -0,0 +1,83 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.thread.messagepump import MessagePump, MessagePumpDelegate
+from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
+
+
+class TestDelegate(MessagePumpDelegate):
+ def __init__(self):
+ self.log = []
+
+ def schedule(self, interval, callback):
+ self.callback = callback
+ self.log.append("schedule")
+
+ def message_available(self, message):
+ self.log.append("message_available: %s" % message)
+
+ def final_message_delivered(self):
+ self.log.append("final_message_delivered")
+
+
+class MessagePumpTest(unittest.TestCase):
+
+ def test_basic(self):
+ queue = ThreadedMessageQueue()
+ delegate = TestDelegate()
+ pump = MessagePump(delegate, queue)
+ self.assertEqual(delegate.log, [
+ 'schedule'
+ ])
+ delegate.callback()
+ queue.post("Hello")
+ queue.post("There")
+ delegate.callback()
+ self.assertEqual(delegate.log, [
+ 'schedule',
+ 'schedule',
+ 'message_available: Hello',
+ 'message_available: There',
+ 'schedule'
+ ])
+ queue.post("More")
+ queue.post("Messages")
+ queue.stop()
+ delegate.callback()
+ self.assertEqual(delegate.log, [
+ 'schedule',
+ 'schedule',
+ 'message_available: Hello',
+ 'message_available: There',
+ 'schedule',
+ 'message_available: More',
+ 'message_available: Messages',
+ 'final_message_delivered'
+ ])
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/util.py b/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue.py
index 0ea8053..17b6277 100644
--- a/WebKitTools/pywebsocket/mod_pywebsocket/util.py
+++ b/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue.py
@@ -1,5 +1,4 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
+# Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -27,33 +26,29 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from __future__ import with_statement
-"""Web Sockets utilities.
-"""
+import threading
-import StringIO
-import traceback
+class ThreadedMessageQueue(object):
+ def __init__(self):
+ self._messages = []
+ self._is_running = True
+ self._lock = threading.Lock()
+ def post(self, message):
+ with self._lock:
+ self._messages.append(message)
-def get_stack_trace():
- """Get the current stack trace as string.
+ def stop(self):
+ with self._lock:
+ self._is_running = False
- This is needed to support Python 2.3.
- TODO: Remove this when we only support Python 2.4 and above.
- Use traceback.format_exc instead.
- """
+ def take_all(self):
+ with self._lock:
+ messages = self._messages
+ is_running = self._is_running
+ self._messages = []
+ return (messages, is_running)
- out = StringIO.StringIO()
- traceback.print_exc(file=out)
- return out.getvalue()
-
-
-def prepend_message_to_exception(message, exc):
- """Prepend message to the exception."""
-
- exc.args = (message + str(exc),)
- return
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py b/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py
new file mode 100644
index 0000000..cb67c1e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/common/thread/threadedmessagequeue_unittest.py
@@ -0,0 +1,53 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
+
+class ThreadedMessageQueueTest(unittest.TestCase):
+
+ def test_basic(self):
+ queue = ThreadedMessageQueue()
+ queue.post("Hello")
+ queue.post("There")
+ (messages, is_running) = queue.take_all()
+ self.assertEqual(messages, ["Hello", "There"])
+ self.assertTrue(is_running)
+ (messages, is_running) = queue.take_all()
+ self.assertEqual(messages, [])
+ self.assertTrue(is_running)
+ queue.post("More")
+ queue.stop()
+ queue.post("Messages")
+ (messages, is_running) = queue.take_all()
+ self.assertEqual(messages, ["More", "Messages"])
+ self.assertFalse(is_running)
+ (messages, is_running) = queue.take_all()
+ self.assertEqual(messages, [])
+ self.assertFalse(is_running)
diff --git a/WebKitTools/Scripts/webkitpy/credentials.pyc b/WebKitTools/Scripts/webkitpy/credentials.pyc
deleted file mode 100644
index cd42568..0000000
--- a/WebKitTools/Scripts/webkitpy/credentials.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/executive.py b/WebKitTools/Scripts/webkitpy/executive.py
deleted file mode 100644
index 50b119b..0000000
--- a/WebKitTools/Scripts/webkitpy/executive.py
+++ /dev/null
@@ -1,171 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import StringIO
-import subprocess
-import sys
-
-from webkitpy.webkit_logging import tee
-
-
-class ScriptError(Exception):
-
- def __init__(self,
- message=None,
- script_args=None,
- exit_code=None,
- output=None,
- cwd=None):
- if not message:
- message = 'Failed to run "%s"' % script_args
- if exit_code:
- message += " exit_code: %d" % exit_code
- if cwd:
- message += " cwd: %s" % cwd
-
- Exception.__init__(self, message)
- self.script_args = script_args # 'args' is already used by Exception
- self.exit_code = exit_code
- self.output = output
- self.cwd = cwd
-
- def message_with_output(self, output_limit=500):
- if self.output:
- if output_limit and len(self.output) > output_limit:
- return "%s\nLast %s characters of output:\n%s" % \
- (self, output_limit, self.output[-output_limit:])
- return "%s\n%s" % (self, self.output)
- return str(self)
-
- def command_name(self):
- command_path = self.script_args
- if type(command_path) is list:
- command_path = command_path[0]
- return os.path.basename(command_path)
-
-
-def run_command(*args, **kwargs):
- # FIXME: This should not be a global static.
- # New code should use Executive.run_command directly instead
- return Executive().run_command(*args, **kwargs)
-
-
-class Executive(object):
-
- def _run_command_with_teed_output(self, args, teed_output):
- child_process = subprocess.Popen(args,
- stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
-
- # Use our own custom wait loop because Popen ignores a tee'd
- # stderr/stdout.
- # FIXME: This could be improved not to flatten output to stdout.
- while True:
- output_line = child_process.stdout.readline()
- if output_line == "" and child_process.poll() != None:
- return child_process.poll()
- teed_output.write(output_line)
-
- def run_and_throw_if_fail(self, args, quiet=False):
- # Cache the child's output locally so it can be used for error reports.
- child_out_file = StringIO.StringIO()
- if quiet:
- dev_null = open(os.devnull, "w")
- child_stdout = tee(child_out_file, dev_null if quiet else sys.stdout)
- exit_code = self._run_command_with_teed_output(args, child_stdout)
- if quiet:
- dev_null.close()
-
- child_output = child_out_file.getvalue()
- child_out_file.close()
-
- if exit_code:
- raise ScriptError(script_args=args,
- exit_code=exit_code,
- output=child_output)
-
- @staticmethod
- def cpu_count():
- # This API exists only in Python 2.6 and higher. :(
- try:
- import multiprocessing
- return multiprocessing.cpu_count()
- except (ImportError, NotImplementedError):
- # This quantity is a lie but probably a reasonable guess for modern
- # machines.
- return 2
-
- # Error handlers do not need to be static methods once all callers are
- # updated to use an Executive object.
-
- @staticmethod
- def default_error_handler(error):
- raise error
-
- @staticmethod
- def ignore_error(error):
- pass
-
- # FIXME: This should be merged with run_and_throw_if_fail
-
- def run_command(self,
- args,
- cwd=None,
- input=None,
- error_handler=None,
- return_exit_code=False,
- return_stderr=True):
- if hasattr(input, 'read'): # Check if the input is a file.
- stdin = input
- string_to_communicate = None
- else:
- stdin = subprocess.PIPE if input else None
- string_to_communicate = input
- if return_stderr:
- stderr = subprocess.STDOUT
- else:
- stderr = None
-
- process = subprocess.Popen(args,
- stdin=stdin,
- stdout=subprocess.PIPE,
- stderr=stderr,
- cwd=cwd)
- output = process.communicate(string_to_communicate)[0]
- exit_code = process.wait()
- if exit_code:
- script_error = ScriptError(script_args=args,
- exit_code=exit_code,
- output=output,
- cwd=cwd)
- (error_handler or self.default_error_handler)(script_error)
- if return_exit_code:
- return exit_code
- return output
diff --git a/WebKitTools/Scripts/webkitpy/executive.pyc b/WebKitTools/Scripts/webkitpy/executive.pyc
deleted file mode 100644
index 190fabb..0000000
--- a/WebKitTools/Scripts/webkitpy/executive.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/grammar.pyc b/WebKitTools/Scripts/webkitpy/grammar.pyc
deleted file mode 100644
index 50edeeb..0000000
--- a/WebKitTools/Scripts/webkitpy/grammar.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/__init__.py b/WebKitTools/Scripts/webkitpy/layout_tests/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
new file mode 100644
index 0000000..51dcac8
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests.py
@@ -0,0 +1,231 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 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 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 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.
+
+"""deduplicate_tests -- lists duplicated between platforms.
+
+If platform/mac-leopard is missing an expected test output, we fall back on
+platform/mac. This means it's possible to grow redundant test outputs,
+where we have the same expected data in both a platform directory and another
+platform it falls back on.
+"""
+
+import collections
+import fnmatch
+import os
+import subprocess
+import sys
+import re
+import webkitpy.common.checkout.scm as scm
+import webkitpy.common.system.executive as executive
+import webkitpy.common.system.logutils as logutils
+import webkitpy.common.system.ospath as ospath
+import webkitpy.layout_tests.port.factory as port_factory
+
+_log = logutils.get_logger(__file__)
+
+_BASE_PLATFORM = 'base'
+
+
+def port_fallbacks():
+ """Get the port fallback information.
+ Returns:
+ A dictionary mapping platform name to a list of other platforms to fall
+ back on. All platforms fall back on 'base'.
+ """
+ fallbacks = {_BASE_PLATFORM: []}
+ platform_dir = os.path.join(scm.find_checkout_root(), 'LayoutTests',
+ 'platform')
+ for port_name in os.listdir(platform_dir):
+ try:
+ platforms = port_factory.get(port_name).baseline_search_path()
+ except NotImplementedError:
+ _log.error("'%s' lacks baseline_search_path(), please fix."
+ % port_name)
+ fallbacks[port_name] = [_BASE_PLATFORM]
+ continue
+ fallbacks[port_name] = [os.path.basename(p) for p in platforms][1:]
+ fallbacks[port_name].append(_BASE_PLATFORM)
+ return fallbacks
+
+
+def parse_git_output(git_output, glob_pattern):
+ """Parses the output of git ls-tree and filters based on glob_pattern.
+ Args:
+ git_output: result of git ls-tree -r HEAD LayoutTests.
+ glob_pattern: a pattern to filter the files.
+ Returns:
+ A dictionary mapping (test name, hash of content) => [paths]
+ """
+ hashes = collections.defaultdict(set)
+ for line in git_output.split('\n'):
+ if not line:
+ break
+ attrs, path = line.strip().split('\t')
+ if not fnmatch.fnmatch(path, glob_pattern):
+ continue
+ path = path[len('LayoutTests/'):]
+ match = re.match(r'^(platform/.*?/)?(.*)', path)
+ test = match.group(2)
+ _, _, hash = attrs.split(' ')
+ hashes[(test, hash)].add(path)
+ return hashes
+
+
+def cluster_file_hashes(glob_pattern):
+ """Get the hashes of all the test expectations in the tree.
+ We cheat and use git's hashes.
+ Args:
+ glob_pattern: a pattern to filter the files.
+ Returns:
+ A dictionary mapping (test name, hash of content) => [paths]
+ """
+
+ # A map of file hash => set of all files with that hash.
+ hashes = collections.defaultdict(set)
+
+ # Fill in the map.
+ cmd = ('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests')
+ try:
+ git_output = executive.Executive().run_command(cmd,
+ cwd=scm.find_checkout_root())
+ except OSError, e:
+ if e.errno == 2: # No such file or directory.
+ _log.error("Error: 'No such file' when running git.")
+ _log.error("This script requires git.")
+ sys.exit(1)
+ raise e
+ return parse_git_output(git_output, glob_pattern)
+
+
+def extract_platforms(paths):
+ """Extracts the platforms from a list of paths matching ^platform/(.*?)/.
+ Args:
+ paths: a list of paths.
+ Returns:
+ A dictionary containing all platforms from paths.
+ """
+ platforms = {}
+ for path in paths:
+ match = re.match(r'^platform/(.*?)/', path)
+ if match:
+ platform = match.group(1)
+ else:
+ platform = _BASE_PLATFORM
+ platforms[platform] = path
+ return platforms
+
+
+def has_intermediate_results(test, fallbacks, matching_platform,
+ path_exists=os.path.exists):
+ """Returns True if there is a test result that causes us to not delete
+ this duplicate.
+
+ For example, chromium-linux may be a duplicate of the checked in result,
+ but chromium-win may have a different result checked in. In this case,
+ we need to keep the duplicate results.
+
+ Args:
+ test: The test name.
+ fallbacks: A list of platforms we fall back on.
+ matching_platform: The platform that we found the duplicate test
+ result. We can stop checking here.
+ path_exists: Optional parameter that allows us to stub out
+ os.path.exists for testing.
+ """
+ for platform in fallbacks:
+ if platform == matching_platform:
+ return False
+ test_path = os.path.join('LayoutTests', 'platform', platform, test)
+ if path_exists(test_path):
+ return True
+ return False
+
+
+def get_relative_test_path(filename, relative_to,
+ checkout_root=scm.find_checkout_root()):
+ """Constructs a relative path to |filename| from |relative_to|.
+ Args:
+ filename: The test file we're trying to get a relative path to.
+ relative_to: The absolute path we're relative to.
+ Returns:
+ A relative path to filename or None if |filename| is not below
+ |relative_to|.
+ """
+ layout_test_dir = os.path.join(checkout_root, 'LayoutTests')
+ abs_path = os.path.join(layout_test_dir, filename)
+ return ospath.relpath(abs_path, relative_to)
+
+
+def find_dups(hashes, port_fallbacks, relative_to):
+ """Yields info about redundant test expectations.
+ Args:
+ hashes: a list of hashes as returned by cluster_file_hashes.
+ port_fallbacks: a list of fallback information as returned by
+ get_port_fallbacks.
+ relative_to: the directory that we want the results relative to
+ Returns:
+ a tuple containing (test, platform, fallback, platforms)
+ """
+ for (test, hash), cluster in hashes.items():
+ if len(cluster) < 2:
+ continue # Common case: only one file with that hash.
+
+ # Compute the list of platforms we have this particular hash for.
+ platforms = extract_platforms(cluster)
+ if len(platforms) == 1:
+ continue
+
+ # See if any of the platforms are redundant with each other.
+ for platform in platforms.keys():
+ for fallback in port_fallbacks[platform]:
+ if fallback not in platforms.keys():
+ continue
+ # We have to verify that there isn't an intermediate result
+ # that causes this duplicate hash to exist.
+ if has_intermediate_results(test, port_fallbacks[platform],
+ fallback):
+ continue
+ # We print the relative path so it's easy to pipe the results
+ # to xargs rm.
+ path = get_relative_test_path(platforms[platform], relative_to)
+ if not path:
+ continue
+ yield {
+ 'test': test,
+ 'platform': platform,
+ 'fallback': fallback,
+ 'path': path,
+ }
+
+
+def deduplicate(glob_pattern):
+ """Traverses LayoutTests and returns information about duplicated files.
+ Args:
+ glob pattern to filter the files in LayoutTests.
+ Returns:
+ a dictionary containing test, path, platform and fallback.
+ """
+ fallbacks = port_fallbacks()
+ hashes = cluster_file_hashes(glob_pattern)
+ return list(find_dups(hashes, fallbacks, os.getcwd()))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
new file mode 100644
index 0000000..309bf8d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/deduplicate_tests_unittest.py
@@ -0,0 +1,210 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 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 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 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.
+
+"""Unit tests for deduplicate_tests.py."""
+
+import deduplicate_tests
+import os
+import unittest
+import webkitpy.common.checkout.scm as scm
+
+
+class MockExecutive(object):
+ last_run_command = []
+ response = ''
+
+ class Executive(object):
+ def run_command(self,
+ args,
+ cwd=None,
+ input=None,
+ error_handler=None,
+ return_exit_code=False,
+ return_stderr=True,
+ decode_output=True):
+ MockExecutive.last_run_command += [args]
+ return MockExecutive.response
+
+
+class ListDuplicatesTest(unittest.TestCase):
+ def setUp(self):
+ MockExecutive.last_run_command = []
+ MockExecutive.response = ''
+ deduplicate_tests.executive = MockExecutive
+ self._original_cwd = os.getcwd()
+ checkout_root = scm.find_checkout_root()
+ self.assertNotEqual(checkout_root, None)
+ os.chdir(checkout_root)
+
+ def tearDown(self):
+ os.chdir(self._original_cwd)
+
+ def test_parse_git_output(self):
+ git_output = (
+ '100644 blob 5053240b3353f6eb39f7cb00259785f16d121df2\tLayoutTests/mac/foo-expected.txt\n'
+ '100644 blob a004548d107ecc4e1ea08019daf0a14e8634a1ff\tLayoutTests/platform/chromium/foo-expected.txt\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/foo-expected.txt\n'
+ '100644 blob abcdebc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/animage.png\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/foo-expected.txt\n'
+ '100644 blob abcdebc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/animage.png\n'
+ '100644 blob 4303df5389ca87cae83dd3236b8dd84e16606517\tLayoutTests/platform/mac/foo-expected.txt\n')
+ hashes = deduplicate_tests.parse_git_output(git_output, '*')
+ expected = {('mac/foo-expected.txt', '5053240b3353f6eb39f7cb00259785f16d121df2'): set(['mac/foo-expected.txt']),
+ ('animage.png', 'abcdebc762e3aec5df03b5c04485b2cb3b65ffb1'): set(['platform/chromium-linux/animage.png', 'platform/chromium-win/animage.png']),
+ ('foo-expected.txt', '4303df5389ca87cae83dd3236b8dd84e16606517'): set(['platform/mac/foo-expected.txt']),
+ ('foo-expected.txt', 'd6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1'): set(['platform/chromium-linux/foo-expected.txt', 'platform/chromium-win/foo-expected.txt']),
+ ('foo-expected.txt', 'a004548d107ecc4e1ea08019daf0a14e8634a1ff'): set(['platform/chromium/foo-expected.txt'])}
+ self.assertEquals(expected, hashes)
+
+ hashes = deduplicate_tests.parse_git_output(git_output, '*.png')
+ expected = {('animage.png', 'abcdebc762e3aec5df03b5c04485b2cb3b65ffb1'): set(['platform/chromium-linux/animage.png', 'platform/chromium-win/animage.png'])}
+ self.assertEquals(expected, hashes)
+
+ def test_extract_platforms(self):
+ self.assertEquals({'foo': 'platform/foo/bar',
+ 'zoo': 'platform/zoo/com'},
+ deduplicate_tests.extract_platforms(['platform/foo/bar', 'platform/zoo/com']))
+ self.assertEquals({'foo': 'platform/foo/bar',
+ deduplicate_tests._BASE_PLATFORM: 'what/'},
+ deduplicate_tests.extract_platforms(['platform/foo/bar', 'what/']))
+
+ def test_has_intermediate_results(self):
+ test_cases = (
+ # If we found a duplicate in our first fallback, we have no
+ # intermediate results.
+ (False, ('fast/foo-expected.txt',
+ ['chromium-win', 'chromium', 'base'],
+ 'chromium-win',
+ lambda path: True)),
+ # Since chromium-win has a result, we have an intermediate result.
+ (True, ('fast/foo-expected.txt',
+ ['chromium-win', 'chromium', 'base'],
+ 'chromium',
+ lambda path: True)),
+ # There are no intermediate results.
+ (False, ('fast/foo-expected.txt',
+ ['chromium-win', 'chromium', 'base'],
+ 'chromium',
+ lambda path: False)),
+ # There are no intermediate results since a result for chromium is
+ # our duplicate file.
+ (False, ('fast/foo-expected.txt',
+ ['chromium-win', 'chromium', 'base'],
+ 'chromium',
+ lambda path: path == 'LayoutTests/platform/chromium/fast/foo-expected.txt')),
+ # We have an intermediate result in 'chromium' even though our
+ # duplicate is with the file in 'base'.
+ (True, ('fast/foo-expected.txt',
+ ['chromium-win', 'chromium', 'base'],
+ 'base',
+ lambda path: path == 'LayoutTests/platform/chromium/fast/foo-expected.txt')),
+ # We have an intermediate result in 'chromium-win' even though our
+ # duplicate is in 'base'.
+ (True, ('fast/foo-expected.txt',
+ ['chromium-win', 'chromium', 'base'],
+ 'base',
+ lambda path: path == 'LayoutTests/platform/chromium-win/fast/foo-expected.txt')),
+ )
+ for expected, inputs in test_cases:
+ self.assertEquals(expected,
+ deduplicate_tests.has_intermediate_results(*inputs))
+
+ def test_unique(self):
+ MockExecutive.response = (
+ '100644 blob 5053240b3353f6eb39f7cb00259785f16d121df2\tLayoutTests/mac/foo-expected.txt\n'
+ '100644 blob a004548d107ecc4e1ea08019daf0a14e8634a1ff\tLayoutTests/platform/chromium/foo-expected.txt\n'
+ '100644 blob abcd0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/foo-expected.txt\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/foo-expected.txt\n'
+ '100644 blob 4303df5389ca87cae83dd3236b8dd84e16606517\tLayoutTests/platform/mac/foo-expected.txt\n')
+ result = deduplicate_tests.deduplicate('*')
+ self.assertEquals(1, len(MockExecutive.last_run_command))
+ self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
+ self.assertEquals(0, len(result))
+
+ def test_duplicates(self):
+ MockExecutive.response = (
+ '100644 blob 5053240b3353f6eb39f7cb00259785f16d121df2\tLayoutTests/mac/foo-expected.txt\n'
+ '100644 blob a004548d107ecc4e1ea08019daf0a14e8634a1ff\tLayoutTests/platform/chromium/foo-expected.txt\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/foo-expected.txt\n'
+ '100644 blob abcdebc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-linux/animage.png\n'
+ '100644 blob d6bb0bc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/foo-expected.txt\n'
+ '100644 blob abcdebc762e3aec5df03b5c04485b2cb3b65ffb1\tLayoutTests/platform/chromium-win/animage.png\n'
+ '100644 blob 4303df5389ca87cae83dd3236b8dd84e16606517\tLayoutTests/platform/mac/foo-expected.txt\n')
+
+ result = deduplicate_tests.deduplicate('*')
+ self.assertEquals(1, len(MockExecutive.last_run_command))
+ self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
+ self.assertEquals(2, len(result))
+ self.assertEquals({'test': 'animage.png',
+ 'path': 'LayoutTests/platform/chromium-linux/animage.png',
+ 'fallback': 'chromium-win',
+ 'platform': 'chromium-linux'},
+ result[0])
+ self.assertEquals({'test': 'foo-expected.txt',
+ 'path': 'LayoutTests/platform/chromium-linux/foo-expected.txt',
+ 'fallback': 'chromium-win',
+ 'platform': 'chromium-linux'},
+ result[1])
+
+ result = deduplicate_tests.deduplicate('*.txt')
+ self.assertEquals(2, len(MockExecutive.last_run_command))
+ self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
+ self.assertEquals(1, len(result))
+ self.assertEquals({'test': 'foo-expected.txt',
+ 'path': 'LayoutTests/platform/chromium-linux/foo-expected.txt',
+ 'fallback': 'chromium-win',
+ 'platform': 'chromium-linux'},
+ result[0])
+
+ result = deduplicate_tests.deduplicate('*.png')
+ self.assertEquals(3, len(MockExecutive.last_run_command))
+ self.assertEquals(('git', 'ls-tree', '-r', 'HEAD', 'LayoutTests'), MockExecutive.last_run_command[-1])
+ self.assertEquals(1, len(result))
+ self.assertEquals({'test': 'animage.png',
+ 'path': 'LayoutTests/platform/chromium-linux/animage.png',
+ 'fallback': 'chromium-win',
+ 'platform': 'chromium-linux'},
+ result[0])
+
+ def test_get_relative_test_path(self):
+ checkout_root = scm.find_checkout_root()
+ layout_test_dir = os.path.join(checkout_root, 'LayoutTests')
+ test_cases = (
+ ('platform/mac/test.html',
+ ('platform/mac/test.html', layout_test_dir)),
+ ('LayoutTests/platform/mac/test.html',
+ ('platform/mac/test.html', checkout_root)),
+ (None,
+ ('platform/mac/test.html', os.path.join(checkout_root, 'WebCore'))),
+ ('test.html',
+ ('platform/mac/test.html', os.path.join(layout_test_dir, 'platform/mac'))),
+ (None,
+ ('platform/mac/test.html', os.path.join(layout_test_dir, 'platform/win'))),
+ )
+ for expected, inputs in test_cases:
+ self.assertEquals(expected,
+ deduplicate_tests.get_relative_test_path(*inputs))
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py b/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py
index 6e4ba99..633dfe8 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/driver_test.py
@@ -42,7 +42,8 @@ import port
def run_tests(port, options, tests):
# |image_path| is a path to the image capture from the driver.
image_path = 'image_result.png'
- driver = port.start_driver(image_path, None)
+ driver = port.create_driver(image_path, None)
+ driver.start()
for t in tests:
uri = port.filename_to_uri(os.path.join(port.layout_tests_dir(), t))
print "uri: " + uri
@@ -58,20 +59,23 @@ def run_tests(port, options, tests):
print ''.join(err)
print '"""'
print
+ driver.stop()
if __name__ == '__main__':
- optparser = optparse.OptionParser()
- optparser.add_option('-p', '--platform', action='store', default='mac',
- help='Platform to test (e.g., "mac", "chromium-mac", etc.')
- optparser.add_option('-t', '--target', action='store', default='Release',
- help='build type ("Debug" or "Release")')
- optparser.add_option('', '--timeout', action='store', default='2000',
- help='test timeout in milliseconds (2000 by default)')
- optparser.add_option('', '--wrapper', action='store')
- optparser.add_option('', '--no-pixel-tests', action='store_true',
- default=False,
- help='disable pixel-to-pixel PNG comparisons')
+ # FIXME: configuration_options belong in a shared location.
+ configuration_options = [
+ optparse.make_option('--debug', action='store_const', const='Debug', dest="configuration", help='Set the configuration to Debug'),
+ optparse.make_option('--release', action='store_const', const='Release', dest="configuration", help='Set the configuration to Release'),
+ ]
+ misc_options = [
+ optparse.make_option('-p', '--platform', action='store', default='mac', help='Platform to test (e.g., "mac", "chromium-mac", etc.'),
+ optparse.make_option('--timeout', action='store', default='2000', help='test timeout in milliseconds (2000 by default)'),
+ optparse.make_option('--wrapper', action='store'),
+ optparse.make_option('--no-pixel-tests', action='store_true', default=False, help='disable pixel-to-pixel PNG comparisons'),
+ ]
+ option_list = configuration_options + misc_options
+ optparser = optparse.OptionParser(option_list=option_list)
options, args = optparser.parse_args()
p = port.get(options.platform, options)
run_tests(p, options, args)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
new file mode 100644
index 0000000..88f493d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
@@ -0,0 +1,562 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""A Thread object for running DumpRenderTree and processing URLs from a
+shared queue.
+
+Each thread runs a separate instance of the DumpRenderTree binary and validates
+the output. When there are no more URLs to process in the shared queue, the
+thread exits.
+"""
+
+from __future__ import with_statement
+
+import codecs
+import copy
+import logging
+import os
+import Queue
+import signal
+import sys
+import thread
+import threading
+import time
+import traceback
+
+import test_failures
+import test_output
+import test_results
+
+_log = logging.getLogger("webkitpy.layout_tests.layout_package."
+ "dump_render_tree_thread")
+
+
+def find_thread_stack(id):
+ """Returns a stack object that can be used to dump a stack trace for
+ the given thread id (or None if the id is not found)."""
+ for thread_id, stack in sys._current_frames().items():
+ if thread_id == id:
+ return stack
+ return None
+
+
+def log_stack(stack):
+ """Log a stack trace to log.error()."""
+ for filename, lineno, name, line in traceback.extract_stack(stack):
+ _log.error('File: "%s", line %d, in %s' % (filename, lineno, name))
+ if line:
+ _log.error(' %s' % line.strip())
+
+
+def _expected_test_output(port, filename):
+ """Returns an expected TestOutput object."""
+ return test_output.TestOutput(port.expected_text(filename),
+ port.expected_image(filename),
+ port.expected_checksum(filename))
+
+def _process_output(port, options, test_input, test_types, test_args,
+ test_output):
+ """Receives the output from a DumpRenderTree process, subjects it to a
+ number of tests, and returns a list of failure types the test produced.
+
+ Args:
+ port: port-specific hooks
+ options: command line options argument from optparse
+ proc: an active DumpRenderTree process
+ test_input: Object containing the test filename and timeout
+ test_types: list of test types to subject the output to
+ test_args: arguments to be passed to each test
+ test_output: a TestOutput object containing the output of the test
+
+ Returns: a TestResult object
+ """
+ failures = []
+
+ if test_output.crash:
+ failures.append(test_failures.FailureCrash())
+ if test_output.timeout:
+ failures.append(test_failures.FailureTimeout())
+
+ if test_output.crash:
+ _log.debug("Stacktrace for %s:\n%s" % (test_input.filename,
+ test_output.error))
+ # Strip off "file://" since RelativeTestFilename expects
+ # filesystem paths.
+ filename = os.path.join(options.results_directory,
+ port.relative_test_filename(
+ test_input.filename))
+ filename = os.path.splitext(filename)[0] + "-stack.txt"
+ port.maybe_make_directory(os.path.split(filename)[0])
+ with codecs.open(filename, "wb", "utf-8") as file:
+ file.write(test_output.error)
+ elif test_output.error:
+ _log.debug("Previous test output stderr lines:\n%s" % test_output.error)
+
+ expected_test_output = _expected_test_output(port, test_input.filename)
+
+ # Check the output and save the results.
+ start_time = time.time()
+ time_for_diffs = {}
+ for test_type in test_types:
+ start_diff_time = time.time()
+ new_failures = test_type.compare_output(port, test_input.filename,
+ test_args, test_output,
+ expected_test_output)
+ # Don't add any more failures if we already have a crash, so we don't
+ # double-report those tests. We do double-report for timeouts since
+ # we still want to see the text and image output.
+ if not test_output.crash:
+ failures.extend(new_failures)
+ time_for_diffs[test_type.__class__.__name__] = (
+ time.time() - start_diff_time)
+
+ total_time_for_all_diffs = time.time() - start_diff_time
+ return test_results.TestResult(test_input.filename, failures, test_output.test_time,
+ total_time_for_all_diffs, time_for_diffs)
+
+
+def _pad_timeout(timeout):
+ """Returns a safe multiple of the per-test timeout value to use
+ to detect hung test threads.
+
+ """
+ # When we're running one test per DumpRenderTree process, we can
+ # enforce a hard timeout. The DumpRenderTree watchdog uses 2.5x
+ # the timeout; we want to be larger than that.
+ return timeout * 3
+
+
+def _milliseconds_to_seconds(msecs):
+ return float(msecs) / 1000.0
+
+
+def _should_fetch_expected_checksum(options):
+ return options.pixel_tests and not (options.new_baseline or options.reset_results)
+
+
+def _run_single_test(port, options, test_input, test_types, test_args, driver):
+ # FIXME: Pull this into TestShellThread._run().
+
+ # The image hash is used to avoid doing an image dump if the
+ # checksums match, so it should be set to a blank value if we
+ # are generating a new baseline. (Otherwise, an image from a
+ # previous run will be copied into the baseline."""
+ if _should_fetch_expected_checksum(options):
+ image_hash_to_driver = port.expected_checksum(test_input.filename)
+ else:
+ image_hash_to_driver = None
+ uri = port.filename_to_uri(test_input.filename)
+ test_output = driver.run_test(uri, test_input.timeout, image_hash_to_driver)
+ return _process_output(port, options, test_input, test_types, test_args,
+ test_output)
+
+
+class SingleTestThread(threading.Thread):
+ """Thread wrapper for running a single test file."""
+
+ def __init__(self, port, options, test_input, test_types, test_args):
+ """
+ Args:
+ port: object implementing port-specific hooks
+ options: command line argument object from optparse
+ test_input: Object containing the test filename and timeout
+ test_types: A list of TestType objects to run the test output
+ against.
+ test_args: A TestArguments object to pass to each TestType.
+ """
+
+ threading.Thread.__init__(self)
+ self._port = port
+ self._options = options
+ self._test_input = test_input
+ self._test_types = test_types
+ self._test_args = test_args
+ self._driver = None
+
+ def run(self):
+ self._covered_run()
+
+ def _covered_run(self):
+ # FIXME: this is a separate routine to work around a bug
+ # in coverage: see http://bitbucket.org/ned/coveragepy/issue/85.
+ self._driver = self._port.create_driver(self._test_args.png_path,
+ self._options)
+ self._driver.start()
+ self._test_result = _run_single_test(self._port, self._options,
+ self._test_input, self._test_types,
+ self._test_args, self._driver)
+ self._driver.stop()
+
+ def get_test_result(self):
+ return self._test_result
+
+
+class WatchableThread(threading.Thread):
+ """This class abstracts an interface used by
+ run_webkit_tests.TestRunner._wait_for_threads_to_finish for thread
+ management."""
+ def __init__(self):
+ threading.Thread.__init__(self)
+ self._canceled = False
+ self._exception_info = None
+ self._next_timeout = None
+ self._thread_id = None
+
+ def cancel(self):
+ """Set a flag telling this thread to quit."""
+ self._canceled = True
+
+ def clear_next_timeout(self):
+ """Mark a flag telling this thread to stop setting timeouts."""
+ self._timeout = 0
+
+ def exception_info(self):
+ """If run() terminated on an uncaught exception, return it here
+ ((type, value, traceback) tuple).
+ Returns None if run() terminated normally. Meant to be called after
+ joining this thread."""
+ return self._exception_info
+
+ def id(self):
+ """Return a thread identifier."""
+ return self._thread_id
+
+ def next_timeout(self):
+ """Return the time the test is supposed to finish by."""
+ return self._next_timeout
+
+
+class TestShellThread(WatchableThread):
+ def __init__(self, port, options, filename_list_queue, result_queue,
+ test_types, test_args):
+ """Initialize all the local state for this DumpRenderTree thread.
+
+ Args:
+ port: interface to port-specific hooks
+ options: command line options argument from optparse
+ filename_list_queue: A thread safe Queue class that contains lists
+ of tuples of (filename, uri) pairs.
+ result_queue: A thread safe Queue class that will contain
+ serialized TestResult objects.
+ test_types: A list of TestType objects to run the test output
+ against.
+ test_args: A TestArguments object to pass to each TestType.
+ """
+ WatchableThread.__init__(self)
+ self._port = port
+ self._options = options
+ self._filename_list_queue = filename_list_queue
+ self._result_queue = result_queue
+ self._filename_list = []
+ self._test_types = test_types
+ self._test_args = test_args
+ self._driver = None
+ self._test_group_timing_stats = {}
+ self._test_results = []
+ self._num_tests = 0
+ self._start_time = 0
+ self._stop_time = 0
+ self._have_http_lock = False
+ self._http_lock_wait_begin = 0
+ self._http_lock_wait_end = 0
+
+ # Current group of tests we're running.
+ self._current_group = None
+ # Number of tests in self._current_group.
+ self._num_tests_in_current_group = None
+ # Time at which we started running tests from self._current_group.
+ self._current_group_start_time = None
+
+ def get_test_group_timing_stats(self):
+ """Returns a dictionary mapping test group to a tuple of
+ (number of tests in that group, time to run the tests)"""
+ return self._test_group_timing_stats
+
+ def get_test_results(self):
+ """Return the list of all tests run on this thread.
+
+ This is used to calculate per-thread statistics.
+
+ """
+ return self._test_results
+
+ def get_total_time(self):
+ return max(self._stop_time - self._start_time -
+ self._http_lock_wait_time(), 0.0)
+
+ def get_num_tests(self):
+ return self._num_tests
+
+ def run(self):
+ """Delegate main work to a helper method and watch for uncaught
+ exceptions."""
+ self._covered_run()
+
+ def _covered_run(self):
+ # FIXME: this is a separate routine to work around a bug
+ # in coverage: see http://bitbucket.org/ned/coveragepy/issue/85.
+ self._thread_id = thread.get_ident()
+ self._start_time = time.time()
+ self._num_tests = 0
+ try:
+ _log.debug('%s starting' % (self.getName()))
+ self._run(test_runner=None, result_summary=None)
+ _log.debug('%s done (%d tests)' % (self.getName(),
+ self.get_num_tests()))
+ except KeyboardInterrupt:
+ self._exception_info = sys.exc_info()
+ _log.debug("%s interrupted" % self.getName())
+ except:
+ # Save the exception for our caller to see.
+ self._exception_info = sys.exc_info()
+ self._stop_time = time.time()
+ _log.error('%s dying, exception raised' % self.getName())
+
+ self._stop_time = time.time()
+
+ def run_in_main_thread(self, test_runner, result_summary):
+ """This hook allows us to run the tests from the main thread if
+ --num-test-shells==1, instead of having to always run two or more
+ threads. This allows us to debug the test harness without having to
+ do multi-threaded debugging."""
+ self._run(test_runner, result_summary)
+
+ def cancel(self):
+ """Clean up http lock and set a flag telling this thread to quit."""
+ self._stop_servers_with_lock()
+ WatchableThread.cancel(self)
+
+ def next_timeout(self):
+ """Return the time the test is supposed to finish by."""
+ if self._next_timeout:
+ return self._next_timeout + self._http_lock_wait_time()
+ return self._next_timeout
+
+ def _http_lock_wait_time(self):
+ """Return the time what http locking takes."""
+ if self._http_lock_wait_begin == 0:
+ return 0
+ if self._http_lock_wait_end == 0:
+ return time.time() - self._http_lock_wait_begin
+ return self._http_lock_wait_end - self._http_lock_wait_begin
+
+ def _run(self, test_runner, result_summary):
+ """Main work entry point of the thread. Basically we pull urls from the
+ filename queue and run the tests until we run out of urls.
+
+ If test_runner is not None, then we call test_runner.UpdateSummary()
+ with the results of each test."""
+ batch_size = self._options.batch_size
+ batch_count = 0
+
+ # Append tests we're running to the existing tests_run.txt file.
+ # This is created in run_webkit_tests.py:_PrepareListsAndPrintOutput.
+ tests_run_filename = os.path.join(self._options.results_directory,
+ "tests_run.txt")
+ tests_run_file = codecs.open(tests_run_filename, "a", "utf-8")
+
+ while True:
+ if self._canceled:
+ _log.debug('Testing cancelled')
+ tests_run_file.close()
+ return
+
+ if len(self._filename_list) is 0:
+ if self._current_group is not None:
+ self._test_group_timing_stats[self._current_group] = \
+ (self._num_tests_in_current_group,
+ time.time() - self._current_group_start_time)
+
+ try:
+ self._current_group, self._filename_list = \
+ self._filename_list_queue.get_nowait()
+ except Queue.Empty:
+ self._stop_servers_with_lock()
+ self._kill_dump_render_tree()
+ tests_run_file.close()
+ return
+
+ if self._current_group == "tests_to_http_lock":
+ self._start_servers_with_lock()
+ elif self._have_http_lock:
+ self._stop_servers_with_lock()
+
+ self._num_tests_in_current_group = len(self._filename_list)
+ self._current_group_start_time = time.time()
+
+ test_input = self._filename_list.pop()
+
+ # We have a url, run tests.
+ batch_count += 1
+ self._num_tests += 1
+ if self._options.run_singly:
+ result = self._run_test_singly(test_input)
+ else:
+ result = self._run_test(test_input)
+
+ filename = test_input.filename
+ tests_run_file.write(filename + "\n")
+ if result.failures:
+ # Check and kill DumpRenderTree if we need to.
+ if len([1 for f in result.failures
+ if f.should_kill_dump_render_tree()]):
+ self._kill_dump_render_tree()
+ # Reset the batch count since the shell just bounced.
+ batch_count = 0
+ # Print the error message(s).
+ error_str = '\n'.join([' ' + f.message() for
+ f in result.failures])
+ _log.debug("%s %s failed:\n%s" % (self.getName(),
+ self._port.relative_test_filename(filename),
+ error_str))
+ else:
+ _log.debug("%s %s passed" % (self.getName(),
+ self._port.relative_test_filename(filename)))
+ self._result_queue.put(result.dumps())
+
+ if batch_size > 0 and batch_count >= batch_size:
+ # Bounce the shell and reset count.
+ self._kill_dump_render_tree()
+ batch_count = 0
+
+ if test_runner:
+ test_runner.update_summary(result_summary)
+
+ def _run_test_singly(self, test_input):
+ """Run a test in a separate thread, enforcing a hard time limit.
+
+ Since we can only detect the termination of a thread, not any internal
+ state or progress, we can only run per-test timeouts when running test
+ files singly.
+
+ Args:
+ test_input: Object containing the test filename and timeout
+
+ Returns:
+ A TestResult
+
+ """
+ worker = SingleTestThread(self._port,
+ self._options,
+ test_input,
+ self._test_types,
+ self._test_args)
+
+ worker.start()
+
+ thread_timeout = _milliseconds_to_seconds(
+ _pad_timeout(int(test_input.timeout)))
+ thread._next_timeout = time.time() + thread_timeout
+ worker.join(thread_timeout)
+ if worker.isAlive():
+ # If join() returned with the thread still running, the
+ # DumpRenderTree is completely hung and there's nothing
+ # more we can do with it. We have to kill all the
+ # DumpRenderTrees to free it up. If we're running more than
+ # one DumpRenderTree thread, we'll end up killing the other
+ # DumpRenderTrees too, introducing spurious crashes. We accept
+ # that tradeoff in order to avoid losing the rest of this
+ # thread's results.
+ _log.error('Test thread hung: killing all DumpRenderTrees')
+ if worker._driver:
+ worker._driver.stop()
+
+ try:
+ result = worker.get_test_result()
+ except AttributeError, e:
+ # This gets raised if the worker thread has already exited.
+ failures = []
+ _log.error('Cannot get results of test: %s' %
+ test_input.filename)
+ result = test_results.TestResult(test_input.filename, failures=[],
+ test_run_time=0, total_time_for_all_diffs=0, time_for_diffs=0)
+
+ return result
+
+ def _run_test(self, test_input):
+ """Run a single test file using a shared DumpRenderTree process.
+
+ Args:
+ test_input: Object containing the test filename, uri and timeout
+
+ Returns: a TestResult object.
+ """
+ self._ensure_dump_render_tree_is_running()
+ thread_timeout = _milliseconds_to_seconds(
+ _pad_timeout(int(test_input.timeout)))
+ self._next_timeout = time.time() + thread_timeout
+ test_result = _run_single_test(self._port, self._options, test_input,
+ self._test_types, self._test_args,
+ self._driver)
+ self._test_results.append(test_result)
+ return test_result
+
+ def _ensure_dump_render_tree_is_running(self):
+ """Start the shared DumpRenderTree, if it's not running.
+
+ This is not for use when running tests singly, since those each start
+ a separate DumpRenderTree in their own thread.
+
+ """
+ # poll() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
+ if (not self._driver or self._driver.poll() is not None):
+ self._driver = self._port.create_driver(self._test_args.png_path,
+ self._options)
+ self._driver.start()
+
+ def _start_servers_with_lock(self):
+ """Acquire http lock and start the servers."""
+ self._http_lock_wait_begin = time.time()
+ _log.debug('Acquire http lock ...')
+ self._port.acquire_http_lock()
+ _log.debug('Starting HTTP server ...')
+ self._port.start_http_server()
+ _log.debug('Starting WebSocket server ...')
+ self._port.start_websocket_server()
+ self._http_lock_wait_end = time.time()
+ self._have_http_lock = True
+
+ def _stop_servers_with_lock(self):
+ """Stop the servers and release http lock."""
+ if self._have_http_lock:
+ _log.debug('Stopping HTTP server ...')
+ self._port.stop_http_server()
+ _log.debug('Stopping WebSocket server ...')
+ self._port.stop_websocket_server()
+ _log.debug('Release http lock ...')
+ self._port.release_http_lock()
+ self._have_http_lock = False
+
+ def _kill_dump_render_tree(self):
+ """Kill the DumpRenderTree process if it's running."""
+ if self._driver:
+ self._driver.stop()
+ self._driver = None
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread_unittest.py
new file mode 100644
index 0000000..63f86d9
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread_unittest.py
@@ -0,0 +1,49 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+""""Tests code paths not covered by the regular unit tests."""
+
+import sys
+import unittest
+
+import dump_render_tree_thread
+
+
+class Test(unittest.TestCase):
+ def test_find_thread_stack_found(self):
+ id, stack = sys._current_frames().items()[0]
+ found_stack = dump_render_tree_thread.find_thread_stack(id)
+ self.assertNotEqual(found_stack, None)
+
+ def test_find_thread_stack_not_found(self):
+ found_stack = dump_render_tree_thread.find_thread_stack(0)
+ self.assertEqual(found_stack, None)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
index 520ab1f..101d30b 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -29,45 +28,52 @@
import logging
import os
-import simplejson
-from layout_package import json_results_generator
-from layout_package import test_expectations
-from layout_package import test_failures
+from webkitpy.layout_tests.layout_package import json_results_generator
+from webkitpy.layout_tests.layout_package import test_expectations
+from webkitpy.layout_tests.layout_package import test_failures
+import webkitpy.thirdparty.simplejson as simplejson
-class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGenerator):
+class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase):
"""A JSON results generator for layout tests."""
LAYOUT_TESTS_PATH = "LayoutTests"
# Additional JSON fields.
WONTFIX = "wontfixCounts"
- DEFERRED = "deferredCounts"
+
+ # Note that we omit test_expectations.FAIL from this list because
+ # it should never show up (it's a legacy input expectation, never
+ # an output expectation).
+ FAILURE_TO_CHAR = {test_expectations.CRASH: "C",
+ test_expectations.TIMEOUT: "T",
+ test_expectations.IMAGE: "I",
+ test_expectations.TEXT: "F",
+ test_expectations.MISSING: "O",
+ test_expectations.IMAGE_PLUS_TEXT: "Z"}
def __init__(self, port, builder_name, build_name, build_number,
results_file_base_path, builder_base_url,
- test_timings, expectations, result_summary, all_tests):
+ test_timings, expectations, result_summary, all_tests,
+ generate_incremental_results=False, test_results_server=None,
+ test_type="", master_name=""):
"""Modifies the results.json file. Grabs it off the archive directory
if it is not found locally.
Args:
result_summary: ResultsSummary object storing the summary of the test
results.
- (see the comment of JSONResultsGenerator.__init__ for other Args)
"""
+ super(JSONLayoutResultsGenerator, self).__init__(
+ builder_name, build_name, build_number, results_file_base_path,
+ builder_base_url, {}, port.test_repository_paths(),
+ generate_incremental_results, test_results_server,
+ test_type, master_name)
+
self._port = port
- self._builder_name = builder_name
- self._build_name = build_name
- self._build_number = build_number
- self._builder_base_url = builder_base_url
- self._results_file_path = os.path.join(results_file_base_path,
- self.RESULTS_FILENAME)
self._expectations = expectations
- # We don't use self._skipped_tests and self._passed_tests as we
- # override _InsertFailureSummaries.
-
# We want relative paths to LayoutTest root for JSON output.
path_to_name = self._get_path_relative_to_layout_test_root
self._result_summary = result_summary
@@ -79,7 +85,7 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGenerator):
(path_to_name(test_tuple.filename), test_tuple.test_run_time)
for test_tuple in test_timings)
- self._generate_json_output()
+ self.generate_json_output()
def _get_path_relative_to_layout_test_root(self, test):
"""Returns the path of the test relative to the layout test root.
@@ -102,6 +108,27 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGenerator):
return relativePath.replace('\\', '/')
# override
+ def _get_test_timing(self, test_name):
+ if test_name in self._test_timings:
+ # Floor for now to get time in seconds.
+ return int(self._test_timings[test_name])
+ return 0
+
+ # override
+ def _get_failed_test_names(self):
+ return set(self._failures.keys())
+
+ # override
+ def _get_modifier_char(self, test_name):
+ if test_name not in self._all_tests:
+ return self.NO_DATA_RESULT
+
+ if test_name in self._failures:
+ return self.FAILURE_TO_CHAR[self._failures[test_name]]
+
+ return self.PASS_RESULT
+
+ # override
def _convert_json_to_current_version(self, results_json):
archive_version = None
if self.VERSION_KEY in results_json:
@@ -141,9 +168,6 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGenerator):
len(self._expectations.get_tests_with_timeline(
test_expectations.NOW)), self.ALL_FIXABLE_COUNT)
self._insert_item_into_raw_list(results_for_builder,
- self._get_failure_summary_entry(test_expectations.DEFER),
- self.DEFERRED)
- self._insert_item_into_raw_list(results_for_builder,
self._get_failure_summary_entry(test_expectations.WONTFIX),
self.WONTFIX)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
index 84be0e1..3267718 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -27,35 +26,84 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from __future__ import with_statement
+
+import codecs
import logging
import os
-import simplejson
import subprocess
import sys
import time
import urllib2
import xml.dom.minidom
-from layout_package import test_expectations
+from webkitpy.layout_tests.layout_package import test_results_uploader
+
+import webkitpy.thirdparty.simplejson as simplejson
+
+# A JSON results generator for generic tests.
+# FIXME: move this code out of the layout_package directory.
+
+_log = logging.getLogger("webkitpy.layout_tests.layout_package.json_results_generator")
+
+class TestResult(object):
+ """A simple class that represents a single test result."""
+
+ # Test modifier constants.
+ (NONE, FAILS, FLAKY, DISABLED) = range(4)
+
+ def __init__(self, name, failed=False, elapsed_time=0):
+ self.name = name
+ self.failed = failed
+ self.time = elapsed_time
+
+ test_name = name
+ try:
+ test_name = name.split('.')[1]
+ except IndexError:
+ _log.warn("Invalid test name: %s.", name)
+ pass
+ if test_name.startswith('FAILS_'):
+ self.modifier = self.FAILS
+ elif test_name.startswith('FLAKY_'):
+ self.modifier = self.FLAKY
+ elif test_name.startswith('DISABLED_'):
+ self.modifier = self.DISABLED
+ else:
+ self.modifier = self.NONE
+
+ def fixable(self):
+ return self.failed or self.modifier == self.DISABLED
-class JSONResultsGenerator(object):
- MAX_NUMBER_OF_BUILD_RESULTS_TO_LOG = 750
+class JSONResultsGeneratorBase(object):
+ """A JSON results generator for generic tests."""
+
+ MAX_NUMBER_OF_BUILD_RESULTS_TO_LOG = 1500
# Min time (seconds) that will be added to the JSON.
MIN_TIME = 1
JSON_PREFIX = "ADD_RESULTS("
JSON_SUFFIX = ");"
+
+ # Note that in non-chromium tests those chars are used to indicate
+ # test modifiers (FAILS, FLAKY, etc) but not actual test results.
PASS_RESULT = "P"
SKIP_RESULT = "X"
+ FAIL_RESULT = "F"
+ FLAKY_RESULT = "L"
NO_DATA_RESULT = "N"
+
+ MODIFIER_TO_CHAR = {TestResult.NONE: PASS_RESULT,
+ TestResult.DISABLED: SKIP_RESULT,
+ TestResult.FAILS: FAIL_RESULT,
+ TestResult.FLAKY: FLAKY_RESULT}
+
VERSION = 3
VERSION_KEY = "version"
RESULTS = "results"
TIMES = "times"
BUILD_NUMBERS = "buildNumbers"
- WEBKIT_SVN = "webkitRevision"
- CHROME_SVN = "chromeRevision"
TIME = "secondsSinceEpoch"
TESTS = "tests"
@@ -63,22 +111,19 @@ class JSONResultsGenerator(object):
FIXABLE = "fixableCounts"
ALL_FIXABLE_COUNT = "allFixableCount"
- # Note that we omit test_expectations.FAIL from this list because
- # it should never show up (it's a legacy input expectation, never
- # an output expectation).
- FAILURE_TO_CHAR = {test_expectations.CRASH: "C",
- test_expectations.TIMEOUT: "T",
- test_expectations.IMAGE: "I",
- test_expectations.TEXT: "F",
- test_expectations.MISSING: "O",
- test_expectations.IMAGE_PLUS_TEXT: "Z"}
- FAILURE_CHARS = FAILURE_TO_CHAR.values()
-
RESULTS_FILENAME = "results.json"
+ INCREMENTAL_RESULTS_FILENAME = "incremental_results.json"
- def __init__(self, port, builder_name, build_name, build_number,
+ URL_FOR_TEST_LIST_JSON = \
+ "http://%s/testfile?builder=%s&name=%s&testlistjson=1&testtype=%s"
+
+ def __init__(self, builder_name, build_name, build_number,
results_file_base_path, builder_base_url,
- test_timings, failures, passed_tests, skipped_tests, all_tests):
+ test_results_map, svn_repositories=None,
+ generate_incremental_results=False,
+ test_results_server=None,
+ test_type="",
+ master_name=""):
"""Modifies the results.json file. Grabs it off the archive directory
if it is not found locally.
@@ -89,36 +134,178 @@ class JSONResultsGenerator(object):
results_file_base_path: Absolute path to the directory containing the
results json file.
builder_base_url: the URL where we have the archived test results.
- test_timings: Map of test name to a test_run-time.
- failures: Map of test name to a failure type (of test_expectations).
- passed_tests: A set containing all the passed tests.
- skipped_tests: A set containing all the skipped tests.
- all_tests: List of all the tests that were run. This should not
- include skipped tests.
+ If this is None no archived results will be retrieved.
+ test_results_map: A dictionary that maps test_name to TestResult.
+ svn_repositories: A (json_field_name, svn_path) pair for SVN
+ repositories that tests rely on. The SVN revision will be
+ included in the JSON with the given json_field_name.
+ generate_incremental_results: If true, generate incremental json file
+ from current run results.
+ test_results_server: server that hosts test results json.
+ test_type: test type string (e.g. 'layout-tests').
+ master_name: the name of the buildbot master.
"""
- self._port = port
self._builder_name = builder_name
self._build_name = build_name
self._build_number = build_number
self._builder_base_url = builder_base_url
+ self._results_directory = results_file_base_path
self._results_file_path = os.path.join(results_file_base_path,
self.RESULTS_FILENAME)
- self._test_timings = test_timings
- self._failures = failures
- self._passed_tests = passed_tests
- self._skipped_tests = skipped_tests
- self._all_tests = all_tests
+ self._incremental_results_file_path = os.path.join(
+ results_file_base_path, self.INCREMENTAL_RESULTS_FILENAME)
+
+ self._test_results_map = test_results_map
+ self._test_results = test_results_map.values()
+ self._generate_incremental_results = generate_incremental_results
- self._generate_json_output()
+ self._svn_repositories = svn_repositories
+ if not self._svn_repositories:
+ self._svn_repositories = {}
- def _generate_json_output(self):
+ self._test_results_server = test_results_server
+ self._test_type = test_type
+ self._master_name = master_name
+
+ self._json = None
+ self._archived_results = None
+
+ def generate_json_output(self):
"""Generates the JSON output file."""
- json = self._get_json()
- if json:
- results_file = open(self._results_file_path, "w")
- results_file.write(json)
- results_file.close()
+ # Generate the JSON output file that has full results.
+ # FIXME: stop writing out the full results file once all bots use
+ # incremental results.
+ if not self._json:
+ self._json = self.get_json()
+ if self._json:
+ self._generate_json_file(self._json, self._results_file_path)
+
+ # Generate the JSON output file that only has incremental results.
+ if self._generate_incremental_results:
+ json = self.get_json(incremental=True)
+ if json:
+ self._generate_json_file(
+ json, self._incremental_results_file_path)
+
+ def get_json(self, incremental=False):
+ """Gets the results for the results.json file."""
+ results_json = {}
+ if not incremental:
+ if self._json:
+ return self._json
+
+ if self._archived_results:
+ results_json = self._archived_results
+
+ if not results_json:
+ results_json, error = self._get_archived_json_results(incremental)
+ if error:
+ # If there was an error don't write a results.json
+ # file at all as it would lose all the information on the
+ # bot.
+ _log.error("Archive directory is inaccessible. Not "
+ "modifying or clobbering the results.json "
+ "file: " + str(error))
+ return None
+
+ builder_name = self._builder_name
+ if results_json and builder_name not in results_json:
+ _log.debug("Builder name (%s) is not in the results.json file."
+ % builder_name)
+
+ self._convert_json_to_current_version(results_json)
+
+ if builder_name not in results_json:
+ results_json[builder_name] = (
+ self._create_results_for_builder_json())
+
+ results_for_builder = results_json[builder_name]
+
+ self._insert_generic_metadata(results_for_builder)
+
+ self._insert_failure_summaries(results_for_builder)
+
+ # Update the all failing tests with result type and time.
+ tests = results_for_builder[self.TESTS]
+ all_failing_tests = self._get_failed_test_names()
+ all_failing_tests.update(tests.iterkeys())
+ for test in all_failing_tests:
+ self._insert_test_time_and_result(test, tests, incremental)
+
+ return results_json
+
+ def set_archived_results(self, archived_results):
+ self._archived_results = archived_results
+
+ def upload_json_files(self, json_files):
+ """Uploads the given json_files to the test_results_server (if the
+ test_results_server is given)."""
+ if not self._test_results_server:
+ return
+
+ if not self._master_name:
+ _log.error("--test-results-server was set, but --master-name was not. Not uploading JSON files.")
+ return
+
+ _log.info("Uploading JSON files for builder: %s", self._builder_name)
+ attrs = [("builder", self._builder_name),
+ ("testtype", self._test_type),
+ ("master", self._master_name)]
+
+ files = [(file, os.path.join(self._results_directory, file))
+ for file in json_files]
+
+ uploader = test_results_uploader.TestResultsUploader(
+ self._test_results_server)
+ try:
+ # Set uploading timeout in case appengine server is having problem.
+ # 120 seconds are more than enough to upload test results.
+ uploader.upload(attrs, files, 120)
+ except Exception, err:
+ _log.error("Upload failed: %s" % err)
+ return
+
+ _log.info("JSON files uploaded.")
+
+ def _generate_json_file(self, json, file_path):
+ # Specify separators in order to get compact encoding.
+ json_data = simplejson.dumps(json, separators=(',', ':'))
+ json_string = self.JSON_PREFIX + json_data + self.JSON_SUFFIX
+
+ results_file = codecs.open(file_path, "w", "utf-8")
+ results_file.write(json_string)
+ results_file.close()
+
+ def _get_test_timing(self, test_name):
+ """Returns test timing data (elapsed time) in second
+ for the given test_name."""
+ if test_name in self._test_results_map:
+ # Floor for now to get time in seconds.
+ return int(self._test_results_map[test_name].time)
+ return 0
+
+ def _get_failed_test_names(self):
+ """Returns a set of failed test names."""
+ return set([r.name for r in self._test_results if r.failed])
+
+ def _get_modifier_char(self, test_name):
+ """Returns a single char (e.g. SKIP_RESULT, FAIL_RESULT,
+ PASS_RESULT, NO_DATA_RESULT, etc) that indicates the test modifier
+ for the given test_name.
+ """
+ if test_name not in self._test_results_map:
+ return JSONResultsGenerator.NO_DATA_RESULT
+
+ test_result = self._test_results_map[test_name]
+ if test_result.modifier in self.MODIFIER_TO_CHAR.keys():
+ return self.MODIFIER_TO_CHAR[test_result.modifier]
+
+ return JSONResultsGenerator.PASS_RESULT
+
+ # FIXME: Callers should use scm.py instead.
+ # FIXME: Identify and fix the run-time errors that were observed on Windows
+ # chromium buildbot when we had updated this code to use scm.py once before.
def _get_svn_revision(self, in_directory):
"""Returns the svn revision for the given directory.
@@ -126,6 +313,7 @@ class JSONResultsGenerator(object):
in_directory: The directory where svn is to be run.
"""
if os.path.exists(os.path.join(in_directory, '.svn')):
+ # Note: Not thread safe: http://bugs.python.org/issue2320
output = subprocess.Popen(["svn", "info", "--xml"],
cwd=in_directory,
shell=(sys.platform == 'win32'),
@@ -138,24 +326,41 @@ class JSONResultsGenerator(object):
return ""
return ""
- def _get_archived_json_results(self):
+ def _get_archived_json_results(self, for_incremental=False):
"""Reads old results JSON file if it exists.
Returns (archived_results, error) tuple where error is None if results
were successfully read.
+
+ if for_incremental is True, download JSON file that only contains test
+ name list from test-results server. This is for generating incremental
+ JSON so the file generated has info for tests that failed before but
+ pass or are skipped from current run.
"""
results_json = {}
old_results = None
error = None
- if os.path.exists(self._results_file_path):
- old_results_file = open(self._results_file_path, "r")
- old_results = old_results_file.read()
- elif self._builder_base_url:
- # Check if we have the archived JSON file on the buildbot server.
- results_file_url = (self._builder_base_url +
- self._build_name + "/" + self.RESULTS_FILENAME)
- logging.error("Local results.json file does not exist. Grabbing "
- "it off the archive at " + results_file_url)
+ if os.path.exists(self._results_file_path) and not for_incremental:
+ with codecs.open(self._results_file_path, "r", "utf-8") as file:
+ old_results = file.read()
+ elif self._builder_base_url or for_incremental:
+ if for_incremental:
+ if not self._test_results_server:
+ # starting from fresh if no test results server specified.
+ return {}, None
+
+ results_file_url = (self.URL_FOR_TEST_LIST_JSON %
+ (urllib2.quote(self._test_results_server),
+ urllib2.quote(self._builder_name),
+ self.RESULTS_FILENAME,
+ urllib2.quote(self._test_type)))
+ else:
+ # Check if we have the archived JSON file on the buildbot
+ # server.
+ results_file_url = (self._builder_base_url +
+ self._build_name + "/" + self.RESULTS_FILENAME)
+ _log.error("Local results.json file does not exist. Grabbing "
+ "it off the archive at " + results_file_url)
try:
results_file = urllib2.urlopen(results_file_url)
@@ -177,85 +382,43 @@ class JSONResultsGenerator(object):
try:
results_json = simplejson.loads(old_results)
except:
- logging.debug("results.json was not valid JSON. Clobbering.")
+ _log.debug("results.json was not valid JSON. Clobbering.")
# The JSON file is not valid JSON. Just clobber the results.
results_json = {}
else:
- logging.debug('Old JSON results do not exist. Starting fresh.')
+ _log.debug('Old JSON results do not exist. Starting fresh.')
results_json = {}
return results_json, error
- def _get_json(self):
- """Gets the results for the results.json file."""
- results_json, error = self._get_archived_json_results()
- if error:
- # If there was an error don't write a results.json
- # file at all as it would lose all the information on the bot.
- logging.error("Archive directory is inaccessible. Not modifying "
- "or clobbering the results.json file: " + str(error))
- return None
-
- builder_name = self._builder_name
- if results_json and builder_name not in results_json:
- logging.debug("Builder name (%s) is not in the results.json file."
- % builder_name)
-
- self._convert_json_to_current_version(results_json)
-
- if builder_name not in results_json:
- results_json[builder_name] = (
- self._create_results_for_builder_json())
-
- results_for_builder = results_json[builder_name]
-
- self._insert_generic_metadata(results_for_builder)
-
- self._insert_failure_summaries(results_for_builder)
-
- # Update the all failing tests with result type and time.
- tests = results_for_builder[self.TESTS]
- all_failing_tests = set(self._failures.iterkeys())
- all_failing_tests.update(tests.iterkeys())
- for test in all_failing_tests:
- self._insert_test_time_and_result(test, tests)
-
- # Specify separators in order to get compact encoding.
- results_str = simplejson.dumps(results_json, separators=(',', ':'))
- return self.JSON_PREFIX + results_str + self.JSON_SUFFIX
-
def _insert_failure_summaries(self, results_for_builder):
"""Inserts aggregate pass/failure statistics into the JSON.
- This method reads self._skipped_tests, self._passed_tests and
- self._failures and inserts FIXABLE, FIXABLE_COUNT and ALL_FIXABLE_COUNT
- entries.
+ This method reads self._test_results and generates
+ FIXABLE, FIXABLE_COUNT and ALL_FIXABLE_COUNT entries.
Args:
results_for_builder: Dictionary containing the test results for a
single builder.
"""
- # Insert the number of tests that failed.
+ # Insert the number of tests that failed or skipped.
+ fixable_count = len([r for r in self._test_results if r.fixable()])
self._insert_item_into_raw_list(results_for_builder,
- len(set(self._failures.keys()) | self._skipped_tests),
- self.FIXABLE_COUNT)
+ fixable_count, self.FIXABLE_COUNT)
- # Create a pass/skip/failure summary dictionary.
+ # Create a test modifiers (FAILS, FLAKY etc) summary dictionary.
entry = {}
- entry[self.SKIP_RESULT] = len(self._skipped_tests)
- entry[self.PASS_RESULT] = len(self._passed_tests)
- get = entry.get
- for failure_type in self._failures.values():
- failure_char = self.FAILURE_TO_CHAR[failure_type]
- entry[failure_char] = get(failure_char, 0) + 1
+ for test_name in self._test_results_map.iterkeys():
+ result_char = self._get_modifier_char(test_name)
+ entry[result_char] = entry.get(result_char, 0) + 1
# Insert the pass/skip/failure summary dictionary.
self._insert_item_into_raw_list(results_for_builder, entry,
self.FIXABLE)
# Insert the number of all the tests that are supposed to pass.
+ all_test_count = len(self._test_results)
self._insert_item_into_raw_list(results_for_builder,
- len(self._skipped_tests | self._all_tests),
- self.ALL_FIXABLE_COUNT)
+ all_test_count, self.ALL_FIXABLE_COUNT)
def _insert_item_into_raw_list(self, results_for_builder, item, key):
"""Inserts the item into the list with the given key in the results for
@@ -304,51 +467,44 @@ class JSONResultsGenerator(object):
self._insert_item_into_raw_list(results_for_builder,
self._build_number, self.BUILD_NUMBERS)
- # These next two branches test to see which source repos we can
- # pull revisions from.
- if hasattr(self._port, 'path_from_webkit_base'):
- path_to_webkit = self._port.path_from_webkit_base()
+ # Include SVN revisions for the given repositories.
+ for (name, path) in self._svn_repositories:
self._insert_item_into_raw_list(results_for_builder,
- self._get_svn_revision(path_to_webkit),
- self.WEBKIT_SVN)
-
- if hasattr(self._port, 'path_from_chromium_base'):
- path_to_chrome = self._port.path_from_chromium_base()
- self._insert_item_into_raw_list(results_for_builder,
- self._get_svn_revision(path_to_chrome),
- self.CHROME_SVN)
+ self._get_svn_revision(path),
+ name + 'Revision')
self._insert_item_into_raw_list(results_for_builder,
int(time.time()),
self.TIME)
- def _insert_test_time_and_result(self, test_name, tests):
+ def _insert_test_time_and_result(self, test_name, tests, incremental=False):
""" Insert a test item with its results to the given tests dictionary.
Args:
tests: Dictionary containing test result entries.
"""
- result = JSONResultsGenerator.PASS_RESULT
- time = 0
-
- if test_name not in self._all_tests:
- result = JSONResultsGenerator.NO_DATA_RESULT
-
- if test_name in self._failures:
- result = self.FAILURE_TO_CHAR[self._failures[test_name]]
-
- if test_name in self._test_timings:
- # Floor for now to get time in seconds.
- time = int(self._test_timings[test_name])
+ result = self._get_modifier_char(test_name)
+ time = self._get_test_timing(test_name)
if test_name not in tests:
tests[test_name] = self._create_results_and_times_json()
thisTest = tests[test_name]
- self._insert_item_run_length_encoded(result, thisTest[self.RESULTS])
- self._insert_item_run_length_encoded(time, thisTest[self.TIMES])
- self._normalize_results_json(thisTest, test_name, tests)
+ if self.RESULTS in thisTest:
+ self._insert_item_run_length_encoded(result, thisTest[self.RESULTS])
+ else:
+ thisTest[self.RESULTS] = [[1, result]]
+
+ if self.TIMES in thisTest:
+ self._insert_item_run_length_encoded(time, thisTest[self.TIMES])
+ else:
+ thisTest[self.TIMES] = [[1, time]]
+
+ # Don't normalize the incremental results json because we need results
+ # for tests that pass or have no data from current run.
+ if not incremental:
+ self._normalize_results_json(thisTest, test_name, tests)
def _convert_json_to_current_version(self, results_json):
"""If the JSON does not match the current version, converts it to the
@@ -418,3 +574,71 @@ class JSONResultsGenerator(object):
"""Returns whether all the results are of the given type
(e.g. all passes)."""
return len(results) == 1 and results[0][1] == type
+
+
+# A wrapper class for JSONResultsGeneratorBase.
+# Note: There's a script outside the WebKit codebase calling this script.
+# FIXME: Please keep the interface until the other script is cleaned up.
+# (http://src.chromium.org/viewvc/chrome/trunk/src/webkit/tools/layout_tests/webkitpy/layout_tests/test_output_xml_to_json.py?view=markup)
+class JSONResultsGenerator(JSONResultsGeneratorBase):
+ # The flag is for backward compatibility.
+ output_json_in_init = True
+
+ def __init__(self, port, builder_name, build_name, build_number,
+ results_file_base_path, builder_base_url,
+ test_timings, failures, passed_tests, skipped_tests, all_tests,
+ test_results_server=None, test_type=None, master_name=None):
+ """Generates a JSON results file.
+
+ Args
+ builder_name: the builder name (e.g. Webkit).
+ build_name: the build name (e.g. webkit-rel).
+ build_number: the build number.
+ results_file_base_path: Absolute path to the directory containing the
+ results json file.
+ builder_base_url: the URL where we have the archived test results.
+ test_timings: Map of test name to a test_run-time.
+ failures: Map of test name to a failure type (of test_expectations).
+ passed_tests: A set containing all the passed tests.
+ skipped_tests: A set containing all the skipped tests.
+ all_tests: List of all the tests that were run. This should not
+ include skipped tests.
+ test_results_server: server that hosts test results json.
+ test_type: the test type.
+ master_name: the name of the buildbot master.
+ """
+
+ self._test_type = test_type
+ self._results_directory = results_file_base_path
+
+ # Create a map of (name, TestResult).
+ test_results_map = dict()
+ get = test_results_map.get
+ for (test, time) in test_timings.iteritems():
+ test_results_map[test] = TestResult(test, elapsed_time=time)
+ for test in failures.iterkeys():
+ test_results_map[test] = test_result = get(test, TestResult(test))
+ test_result.failed = True
+ for test in skipped_tests:
+ test_results_map[test] = test_result = get(test, TestResult(test))
+ for test in passed_tests:
+ test_results_map[test] = test_result = get(test, TestResult(test))
+ test_result.failed = False
+ for test in all_tests:
+ if test not in test_results_map:
+ test_results_map[test] = TestResult(test)
+
+ # Generate the JSON with incremental flag enabled.
+ # (This should also output the full result for now.)
+ super(JSONResultsGenerator, self).__init__(
+ builder_name, build_name, build_number,
+ results_file_base_path, builder_base_url, test_results_map,
+ svn_repositories=port.test_repository_paths(),
+ generate_incremental_results=True,
+ test_results_server=test_results_server,
+ test_type=test_type,
+ master_name=master_name)
+
+ if self.__class__.output_json_in_init:
+ self.generate_json_output()
+ self.upload_json_files([self.INCREMENTAL_RESULTS_FILENAME])
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
new file mode 100644
index 0000000..606a613
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator_unittest.py
@@ -0,0 +1,214 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for json_results_generator.py."""
+
+import unittest
+import optparse
+import random
+import shutil
+import tempfile
+
+from webkitpy.layout_tests.layout_package import json_results_generator
+from webkitpy.layout_tests.layout_package import test_expectations
+from webkitpy.layout_tests import port
+
+
+class JSONGeneratorTest(unittest.TestCase):
+ def setUp(self):
+ json_results_generator.JSONResultsGenerator.output_json_in_init = False
+ self.builder_name = 'DUMMY_BUILDER_NAME'
+ self.build_name = 'DUMMY_BUILD_NAME'
+ self.build_number = 'DUMMY_BUILDER_NUMBER'
+ self._json = None
+ self._num_runs = 0
+ self._tests_set = set([])
+ self._test_timings = {}
+ self._failed_tests = set([])
+
+ self._PASS_tests = set([])
+ self._DISABLED_tests = set([])
+ self._FLAKY_tests = set([])
+ self._FAILS_tests = set([])
+
+ def _get_test_modifier(self, test_name):
+ if test_name.startswith('DISABLED_'):
+ return json_results_generator.JSONResultsGenerator.SKIP_RESULT
+ elif test_name.startswith('FLAKY_'):
+ return json_results_generator.JSONResultsGenerator.FLAKY_RESULT
+ elif test_name.startswith('FAILS_'):
+ return json_results_generator.JSONResultsGenerator.FAIL_RESULT
+ return json_results_generator.JSONResultsGenerator.PASS_RESULT
+
+ def _test_json_generation(self, passed_tests_list, failed_tests_list):
+ tests_set = set(passed_tests_list) | set(failed_tests_list)
+
+ DISABLED_tests = set([t for t in tests_set
+ if t.startswith('DISABLED_')])
+ FLAKY_tests = set([t for t in tests_set
+ if t.startswith('FLAKY_')])
+ FAILS_tests = set([t for t in tests_set
+ if t.startswith('FAILS_')])
+ PASS_tests = tests_set ^ (DISABLED_tests | FLAKY_tests | FAILS_tests)
+
+ passed_tests = set(passed_tests_list) ^ DISABLED_tests
+ failed_tests = set(failed_tests_list)
+
+ test_timings = {}
+ i = 0
+ for test in tests_set:
+ test_timings[test] = float(self._num_runs * 100 + i)
+ i += 1
+
+ # For backward compatibility.
+ reason = test_expectations.TEXT
+ failed_tests_dict = dict([(name, reason) for name in failed_tests])
+
+ port_obj = port.get(None)
+ generator = json_results_generator.JSONResultsGenerator(port_obj,
+ self.builder_name, self.build_name, self.build_number,
+ '',
+ None, # don't fetch past json results archive
+ test_timings,
+ failed_tests_dict,
+ passed_tests,
+ (),
+ tests_set)
+
+ # Test incremental json results
+ incremental_json = generator.get_json(incremental=True)
+ self._verify_json_results(
+ tests_set,
+ test_timings,
+ failed_tests,
+ PASS_tests,
+ DISABLED_tests,
+ FLAKY_tests,
+ incremental_json,
+ 1)
+
+ # Test aggregated json results
+ generator.set_archived_results(self._json)
+ json = generator.get_json(incremental=False)
+ self._json = json
+ self._num_runs += 1
+ self._tests_set |= tests_set
+ self._test_timings.update(test_timings)
+ self._failed_tests.update(failed_tests)
+ self._PASS_tests |= PASS_tests
+ self._DISABLED_tests |= DISABLED_tests
+ self._FLAKY_tests |= FLAKY_tests
+ self._verify_json_results(
+ self._tests_set,
+ self._test_timings,
+ self._failed_tests,
+ self._PASS_tests,
+ self._DISABLED_tests,
+ self._FLAKY_tests,
+ self._json,
+ self._num_runs)
+
+ def _verify_json_results(self, tests_set, test_timings, failed_tests,
+ PASS_tests, DISABLED_tests, FLAKY_tests,
+ json, num_runs):
+ # Aliasing to a short name for better access to its constants.
+ JRG = json_results_generator.JSONResultsGenerator
+
+ self.assertTrue(JRG.VERSION_KEY in json)
+ self.assertTrue(self.builder_name in json)
+
+ buildinfo = json[self.builder_name]
+ self.assertTrue(JRG.FIXABLE in buildinfo)
+ self.assertTrue(JRG.TESTS in buildinfo)
+ self.assertEqual(len(buildinfo[JRG.BUILD_NUMBERS]), num_runs)
+ self.assertEqual(buildinfo[JRG.BUILD_NUMBERS][0], self.build_number)
+
+ if tests_set or DISABLED_tests:
+ fixable = {}
+ for fixable_items in buildinfo[JRG.FIXABLE]:
+ for (type, count) in fixable_items.iteritems():
+ if type in fixable:
+ fixable[type] = fixable[type] + count
+ else:
+ fixable[type] = count
+
+ if PASS_tests:
+ self.assertEqual(fixable[JRG.PASS_RESULT], len(PASS_tests))
+ else:
+ self.assertTrue(JRG.PASS_RESULT not in fixable or
+ fixable[JRG.PASS_RESULT] == 0)
+ if DISABLED_tests:
+ self.assertEqual(fixable[JRG.SKIP_RESULT], len(DISABLED_tests))
+ else:
+ self.assertTrue(JRG.SKIP_RESULT not in fixable or
+ fixable[JRG.SKIP_RESULT] == 0)
+ if FLAKY_tests:
+ self.assertEqual(fixable[JRG.FLAKY_RESULT], len(FLAKY_tests))
+ else:
+ self.assertTrue(JRG.FLAKY_RESULT not in fixable or
+ fixable[JRG.FLAKY_RESULT] == 0)
+
+ if failed_tests:
+ tests = buildinfo[JRG.TESTS]
+ for test_name in failed_tests:
+ self.assertTrue(test_name in tests)
+ test = tests[test_name]
+
+ failed = 0
+ modifier = self._get_test_modifier(test_name)
+ for result in test[JRG.RESULTS]:
+ if result[1] == modifier:
+ failed = result[0]
+ self.assertEqual(1, failed)
+
+ timing_count = 0
+ for timings in test[JRG.TIMES]:
+ if timings[1] == test_timings[test_name]:
+ timing_count = timings[0]
+ self.assertEqual(1, timing_count)
+
+ fixable_count = len(DISABLED_tests | failed_tests)
+ if DISABLED_tests or failed_tests:
+ self.assertEqual(sum(buildinfo[JRG.FIXABLE_COUNT]), fixable_count)
+
+ def test_json_generation(self):
+ self._test_json_generation([], [])
+ self._test_json_generation(['A1', 'B1'], [])
+ self._test_json_generation([], ['FAILS_A2', 'FAILS_B2'])
+ self._test_json_generation(['DISABLED_A3', 'DISABLED_B3'], [])
+ self._test_json_generation(['A4'], ['B4', 'FAILS_C4'])
+ self._test_json_generation(['DISABLED_C5', 'DISABLED_D5'], ['A5', 'B5'])
+ self._test_json_generation(
+ ['A6', 'B6', 'FAILS_C6', 'DISABLED_E6', 'DISABLED_F6'],
+ ['FAILS_D6'])
+ self._test_json_generation(
+ ['A7', 'FLAKY_B7', 'DISABLED_C7'],
+ ['FAILS_D7', 'FLAKY_D8'])
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream.py
index 72b30a1..20646a1 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream.py
@@ -32,23 +32,50 @@ Package that implements a stream wrapper that has 'meters' as well as
regular output. A 'meter' is a single line of text that can be erased
and rewritten repeatedly, without producing multiple lines of output. It
can be used to produce effects like progress bars.
+
+This package should only be called by the printing module in the layout_tests
+package.
"""
+import logging
+
+_log = logging.getLogger("webkitpy.layout_tests.metered_stream")
+
class MeteredStream:
"""This class is a wrapper around a stream that allows you to implement
- meters.
+ meters (progress bars, etc.).
+
+ It can be used directly as a stream, by calling write(), but provides
+ two other methods for output, update(), and progress().
+
+ In normal usage, update() will overwrite the output of the immediately
+ preceding update() (write() also will overwrite update()). So, calling
+ multiple update()s in a row can provide an updating status bar (note that
+ if an update string contains newlines, only the text following the last
+ newline will be overwritten/erased).
- It can be used like a stream, but calling update() will print
- the string followed by only a carriage return (instead of a carriage
- return and a line feed). This can be used to implement progress bars and
- other sorts of meters. Note that anything written by update() will be
- erased by a subsequent update(), write(), or flush()."""
+ If the MeteredStream is constructed in "verbose" mode (i.e., by passing
+ verbose=true), then update() no longer overwrite a previous update(), and
+ instead the call is equivalent to write(), although the text is
+ actually sent to the logger rather than to the stream passed
+ to the constructor.
+
+ progress() is just like update(), except that if you are in verbose mode,
+ progress messages are not output at all (they are dropped). This is
+ used for things like progress bars which are presumed to be unwanted in
+ verbose mode.
+
+ Note that the usual usage for this class is as a destination for
+ a logger that can also be written to directly (i.e., some messages go
+ through the logger, some don't). We thus have to dance around a
+ layering inversion in update() for things to work correctly.
+ """
def __init__(self, verbose, stream):
"""
Args:
- verbose: whether update is a no-op
+ verbose: whether progress is a no-op and updates() aren't overwritten
stream: output stream to write to
"""
self._dirty = False
@@ -57,40 +84,63 @@ class MeteredStream:
self._last_update = ""
def write(self, txt):
- """Write text directly to the stream, overwriting and resetting the
- meter."""
+ """Write to the stream, overwriting and resetting the meter."""
if self._dirty:
- self.update("")
+ self._write(txt)
self._dirty = False
- self._stream.write(txt)
+ self._last_update = ''
+ else:
+ self._stream.write(txt)
def flush(self):
"""Flush any buffered output."""
self._stream.flush()
- def update(self, str):
- """Write an update to the stream that will get overwritten by the next
- update() or by a write().
+ def progress(self, str):
+ """
+ Write a message to the stream that will get overwritten.
This is used for progress updates that don't need to be preserved in
- the log. Note that verbose disables this routine; we have this in
- case we are logging lots of output and the update()s will get lost
- or won't work properly (typically because verbose streams are
- redirected to files.
-
- TODO(dpranke): figure out if there is a way to detect if we're writing
- to a stream that handles CRs correctly (e.g., terminals). That might
- be a cleaner way of handling this.
+ the log. If the MeteredStream was initialized with verbose==True,
+ then this output is discarded. We have this in case we are logging
+ lots of output and the update()s will get lost or won't work
+ properly (typically because verbose streams are redirected to files).
+
"""
if self._verbose:
return
+ self._write(str)
+
+ def update(self, str):
+ """
+ Write a message that is also included when logging verbosely.
+
+ This routine preserves the same console logging behavior as progress(),
+ but will also log the message if verbose() was true.
+
+ """
+ # Note this is a separate routine that calls either into the logger
+ # or the metering stream. We have to be careful to avoid a layering
+ # inversion (stream calling back into the logger).
+ if self._verbose:
+ _log.info(str)
+ else:
+ self._write(str)
+
+ def _write(self, str):
+ """Actually write the message to the stream."""
+
+ # FIXME: Figure out if there is a way to detect if we're writing
+ # to a stream that handles CRs correctly (e.g., terminals). That might
+ # be a cleaner way of handling this.
# Print the necessary number of backspaces to erase the previous
# message.
- self._stream.write("\b" * len(self._last_update))
+ if len(self._last_update):
+ self._stream.write("\b" * len(self._last_update) +
+ " " * len(self._last_update) +
+ "\b" * len(self._last_update))
self._stream.write(str)
- num_remaining = len(self._last_update) - len(str)
- if num_remaining > 0:
- self._stream.write(" " * num_remaining + "\b" * num_remaining)
- self._last_update = str
+ last_newline = str.rfind("\n")
+ self._last_update = str[(last_newline + 1):]
self._dirty = True
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream_unittest.py
new file mode 100644
index 0000000..9421ff8
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/metered_stream_unittest.py
@@ -0,0 +1,115 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for metered_stream.py."""
+
+import os
+import optparse
+import pdb
+import sys
+import unittest
+
+from webkitpy.common.array_stream import ArrayStream
+from webkitpy.layout_tests.layout_package import metered_stream
+
+
+class TestMeteredStream(unittest.TestCase):
+ def test_regular(self):
+ a = ArrayStream()
+ m = metered_stream.MeteredStream(verbose=False, stream=a)
+ self.assertTrue(a.empty())
+
+ # basic test - note that the flush() is a no-op, but we include it
+ # for coverage.
+ m.write("foo")
+ m.flush()
+ exp = ['foo']
+ self.assertEquals(a.get(), exp)
+
+ # now check that a second write() does not overwrite the first.
+ m.write("bar")
+ exp.append('bar')
+ self.assertEquals(a.get(), exp)
+
+ m.update("batter")
+ exp.append('batter')
+ self.assertEquals(a.get(), exp)
+
+ # The next update() should overwrite the laste update() but not the
+ # other text. Note that the cursor is effectively positioned at the
+ # end of 'foo', even though we had to erase three more characters.
+ m.update("foo")
+ exp.append('\b\b\b\b\b\b \b\b\b\b\b\b')
+ exp.append('foo')
+ self.assertEquals(a.get(), exp)
+
+ m.progress("progress")
+ exp.append('\b\b\b \b\b\b')
+ exp.append('progress')
+ self.assertEquals(a.get(), exp)
+
+ # now check that a write() does overwrite the progress bar
+ m.write("foo")
+ exp.append('\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b')
+ exp.append('foo')
+ self.assertEquals(a.get(), exp)
+
+ # Now test that we only back up to the most recent newline.
+
+ # Note also that we do not back up to erase the most recent write(),
+ # i.e., write()s do not get erased.
+ a.reset()
+ m.update("foo\nbar")
+ m.update("baz")
+ self.assertEquals(a.get(), ['foo\nbar', '\b\b\b \b\b\b', 'baz'])
+
+ def test_verbose(self):
+ a = ArrayStream()
+ m = metered_stream.MeteredStream(verbose=True, stream=a)
+ self.assertTrue(a.empty())
+ m.write("foo")
+ self.assertEquals(a.get(), ['foo'])
+
+ import logging
+ b = ArrayStream()
+ logger = logging.getLogger()
+ handler = logging.StreamHandler(b)
+ logger.addHandler(handler)
+ m.update("bar")
+ logger.handlers.remove(handler)
+ self.assertEquals(a.get(), ['foo'])
+ self.assertEquals(b.get(), ['bar\n'])
+
+ m.progress("dropped")
+ self.assertEquals(a.get(), ['foo'])
+ self.assertEquals(b.get(), ['bar\n'])
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
new file mode 100644
index 0000000..fb9fe6d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing.py
@@ -0,0 +1,554 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Package that handles non-debug, non-file output for run-webkit-tests."""
+
+import logging
+import optparse
+import os
+import pdb
+
+from webkitpy.layout_tests.layout_package import metered_stream
+from webkitpy.layout_tests.layout_package import test_expectations
+
+_log = logging.getLogger("webkitpy.layout_tests.printer")
+
+TestExpectationsFile = test_expectations.TestExpectationsFile
+
+NUM_SLOW_TESTS_TO_LOG = 10
+
+PRINT_DEFAULT = ("misc,one-line-progress,one-line-summary,unexpected,"
+ "unexpected-results,updates")
+PRINT_EVERYTHING = ("actual,config,expected,misc,one-line-progress,"
+ "one-line-summary,slowest,timing,unexpected,"
+ "unexpected-results,updates")
+
+HELP_PRINTING = """
+Output for run-webkit-tests is controlled by a comma-separated list of
+values passed to --print. Values either influence the overall output, or
+the output at the beginning of the run, during the run, or at the end:
+
+Overall options:
+ nothing don't print anything. This overrides every other option
+ default include the default options. This is useful for logging
+ the default options plus additional settings.
+ everything print everything (except the trace-* options and the
+ detailed-progress option, see below for the full list )
+ misc print miscellaneous things like blank lines
+
+At the beginning of the run:
+ config print the test run configuration
+ expected print a summary of what is expected to happen
+ (# passes, # failures, etc.)
+
+During the run:
+ detailed-progress print one dot per test completed
+ one-line-progress print a one-line progress bar
+ unexpected print any unexpected results as they occur
+ updates print updates on which stage is executing
+ trace-everything print detailed info on every test's results
+ (baselines, expectation, time it took to run). If
+ this is specified it will override the '*-progress'
+ options, the 'trace-unexpected' option, and the
+ 'unexpected' option.
+ trace-unexpected like 'trace-everything', but only for tests with
+ unexpected results. If this option is specified,
+ it will override the 'unexpected' option.
+
+At the end of the run:
+ actual print a summary of the actual results
+ slowest print %(slowest)d slowest tests and the time they took
+ timing print timing statistics
+ unexpected-results print a list of the tests with unexpected results
+ one-line-summary print a one-line summary of the run
+
+Notes:
+ - 'detailed-progress' can only be used if running in a single thread
+ (using --child-processes=1) or a single queue of tests (using
+ --experimental-fully-parallel). If these conditions aren't true,
+ 'one-line-progress' will be used instead.
+ - If both 'detailed-progress' and 'one-line-progress' are specified (and
+ both are possible), 'detailed-progress' will be used.
+ - If 'nothing' is specified, it overrides all of the other options.
+ - Specifying --verbose is equivalent to --print everything plus it
+ changes the format of the log messages to add timestamps and other
+ information. If you specify --verbose and --print X, then X overrides
+ the --print everything implied by --verbose.
+
+--print 'everything' is equivalent to --print '%(everything)s'.
+
+The default (--print default) is equivalent to --print '%(default)s'.
+""" % {'slowest': NUM_SLOW_TESTS_TO_LOG, 'everything': PRINT_EVERYTHING,
+ 'default': PRINT_DEFAULT}
+
+
+def print_options():
+ return [
+ # Note: We use print_options rather than just 'print' because print
+ # is a reserved word.
+ # Note: Also, we don't specify a default value so we can detect when
+ # no flag is specified on the command line and use different defaults
+ # based on whether or not --verbose is specified (since --print
+ # overrides --verbose).
+ optparse.make_option("--print", dest="print_options",
+ help=("controls print output of test run. "
+ "Use --help-printing for more.")),
+ optparse.make_option("--help-printing", action="store_true",
+ help="show detailed help on controlling print output"),
+ optparse.make_option("-v", "--verbose", action="store_true",
+ default=False, help="include debug-level logging"),
+ ]
+
+
+
+def parse_print_options(print_options, verbose, child_processes,
+ is_fully_parallel):
+ """Parse the options provided to --print and dedup and rank them.
+
+ Returns
+ a set() of switches that govern how logging is done
+
+ """
+ if print_options:
+ switches = set(print_options.split(','))
+ elif verbose:
+ switches = set(PRINT_EVERYTHING.split(','))
+ else:
+ switches = set(PRINT_DEFAULT.split(','))
+
+ if 'nothing' in switches:
+ return set()
+
+ if (child_processes != 1 and not is_fully_parallel and
+ 'detailed-progress' in switches):
+ _log.warn("Can only print 'detailed-progress' if running "
+ "with --child-processes=1 or "
+ "with --experimental-fully-parallel. "
+ "Using 'one-line-progress' instead.")
+ switches.discard('detailed-progress')
+ switches.add('one-line-progress')
+
+ if 'everything' in switches:
+ switches.discard('everything')
+ switches.update(set(PRINT_EVERYTHING.split(',')))
+
+ if 'default' in switches:
+ switches.discard('default')
+ switches.update(set(PRINT_DEFAULT.split(',')))
+
+ if 'detailed-progress' in switches:
+ switches.discard('one-line-progress')
+
+ if 'trace-everything' in switches:
+ switches.discard('detailed-progress')
+ switches.discard('one-line-progress')
+ switches.discard('trace-unexpected')
+ switches.discard('unexpected')
+
+ if 'trace-unexpected' in switches:
+ switches.discard('unexpected')
+
+ return switches
+
+
+def _configure_logging(stream, verbose):
+ log_fmt = '%(message)s'
+ log_datefmt = '%y%m%d %H:%M:%S'
+ log_level = logging.INFO
+ if verbose:
+ log_fmt = ('%(asctime)s %(process)d %(filename)s:%(lineno)-4d %(levelname)s'
+ '%(message)s')
+ log_level = logging.DEBUG
+
+ root = logging.getLogger()
+ handler = logging.StreamHandler(stream)
+ handler.setFormatter(logging.Formatter(log_fmt, None))
+ root.addHandler(handler)
+ root.setLevel(log_level)
+ return handler
+
+
+def _restore_logging(handler_to_remove):
+ root = logging.getLogger()
+ root.handlers.remove(handler_to_remove)
+
+
+class Printer(object):
+ """Class handling all non-debug-logging printing done by run-webkit-tests.
+
+ Printing from run-webkit-tests falls into two buckets: general or
+ regular output that is read only by humans and can be changed at any
+ time, and output that is parsed by buildbots (and humans) and hence
+ must be changed more carefully and in coordination with the buildbot
+ parsing code (in chromium.org's buildbot/master.chromium/scripts/master/
+ log_parser/webkit_test_command.py script).
+
+ By default the buildbot-parsed code gets logged to stdout, and regular
+ output gets logged to stderr."""
+ def __init__(self, port, options, regular_output, buildbot_output,
+ child_processes, is_fully_parallel):
+ """
+ Args
+ port interface to port-specific routines
+ options OptionParser object with command line settings
+ regular_output stream to which output intended only for humans
+ should be written
+ buildbot_output stream to which output intended to be read by
+ the buildbots (and humans) should be written
+ child_processes number of parallel threads running (usually
+ controlled by --child-processes)
+ is_fully_parallel are the tests running in a single queue, or
+ in shards (usually controlled by
+ --experimental-fully-parallel)
+
+ Note that the last two args are separate rather than bundled into
+ the options structure so that this object does not assume any flags
+ set in options that weren't returned from logging_options(), above.
+ The two are used to determine whether or not we can sensibly use
+ the 'detailed-progress' option, or can only use 'one-line-progress'.
+ """
+ self._buildbot_stream = buildbot_output
+ self._options = options
+ self._port = port
+ self._stream = regular_output
+
+ # These are used for --print detailed-progress to track status by
+ # directory.
+ self._current_dir = None
+ self._current_progress_str = ""
+ self._current_test_number = 0
+
+ self._meter = metered_stream.MeteredStream(options.verbose,
+ regular_output)
+ self._logging_handler = _configure_logging(self._meter,
+ options.verbose)
+
+ self.switches = parse_print_options(options.print_options,
+ options.verbose, child_processes, is_fully_parallel)
+
+ def cleanup(self):
+ """Restore logging configuration to its initial settings."""
+ if self._logging_handler:
+ _restore_logging(self._logging_handler)
+ self._logging_handler = None
+
+ def __del__(self):
+ self.cleanup()
+
+ # These two routines just hide the implementation of the switches.
+ def disabled(self, option):
+ return not option in self.switches
+
+ def enabled(self, option):
+ return option in self.switches
+
+ def help_printing(self):
+ self._write(HELP_PRINTING)
+
+ def print_actual(self, msg):
+ if self.disabled('actual'):
+ return
+ self._buildbot_stream.write("%s\n" % msg)
+
+ def print_config(self, msg):
+ self.write(msg, 'config')
+
+ def print_expected(self, msg):
+ self.write(msg, 'expected')
+
+ def print_timing(self, msg):
+ self.write(msg, 'timing')
+
+ def print_one_line_summary(self, total, expected, unexpected):
+ """Print a one-line summary of the test run to stdout.
+
+ Args:
+ total: total number of tests run
+ expected: number of expected results
+ unexpected: number of unexpected results
+ """
+ if self.disabled('one-line-summary'):
+ return
+
+ incomplete = total - expected - unexpected
+ if incomplete:
+ self._write("")
+ incomplete_str = " (%d didn't run)" % incomplete
+ expected_str = str(expected)
+ else:
+ incomplete_str = ""
+ expected_str = "All %d" % expected
+
+ if unexpected == 0:
+ self._write("%s tests ran as expected%s." %
+ (expected_str, incomplete_str))
+ elif expected == 1:
+ self._write("1 test ran as expected, %d didn't%s:" %
+ (unexpected, incomplete_str))
+ else:
+ self._write("%d tests ran as expected, %d didn't%s:" %
+ (expected, unexpected, incomplete_str))
+ self._write("")
+
+ def print_test_result(self, result, expected, exp_str, got_str):
+ """Print the result of the test as determined by --print.
+
+ This routine is used to print the details of each test as it completes.
+
+ Args:
+ result - The actual TestResult object
+ expected - Whether the result we got was an expected result
+ exp_str - What we expected to get (used for tracing)
+ got_str - What we actually got (used for tracing)
+
+ Note that we need all of these arguments even though they seem
+ somewhat redundant, in order to keep this routine from having to
+ known anything about the set of expectations.
+ """
+ if (self.enabled('trace-everything') or
+ self.enabled('trace-unexpected') and not expected):
+ self._print_test_trace(result, exp_str, got_str)
+ elif (not expected and self.enabled('unexpected') and
+ self.disabled('detailed-progress')):
+ # Note: 'detailed-progress' handles unexpected results internally,
+ # so we skip it here.
+ self._print_unexpected_test_result(result)
+
+ def _print_test_trace(self, result, exp_str, got_str):
+ """Print detailed results of a test (triggered by --print trace-*).
+ For each test, print:
+ - location of the expected baselines
+ - expected results
+ - actual result
+ - timing info
+ """
+ filename = result.filename
+ test_name = self._port.relative_test_filename(filename)
+ self._write('trace: %s' % test_name)
+ txt_file = self._port.expected_filename(filename, '.txt')
+ if self._port.path_exists(txt_file):
+ self._write(' txt: %s' %
+ self._port.relative_test_filename(txt_file))
+ else:
+ self._write(' txt: <none>')
+ checksum_file = self._port.expected_filename(filename, '.checksum')
+ if self._port.path_exists(checksum_file):
+ self._write(' sum: %s' %
+ self._port.relative_test_filename(checksum_file))
+ else:
+ self._write(' sum: <none>')
+ png_file = self._port.expected_filename(filename, '.png')
+ if self._port.path_exists(png_file):
+ self._write(' png: %s' %
+ self._port.relative_test_filename(png_file))
+ else:
+ self._write(' png: <none>')
+ self._write(' exp: %s' % exp_str)
+ self._write(' got: %s' % got_str)
+ self._write(' took: %-.3f' % result.test_run_time)
+ self._write('')
+
+ def _print_unexpected_test_result(self, result):
+ """Prints one unexpected test result line."""
+ desc = TestExpectationsFile.EXPECTATION_DESCRIPTIONS[result.type][0]
+ self.write(" %s -> unexpected %s" %
+ (self._port.relative_test_filename(result.filename),
+ desc), "unexpected")
+
+ def print_progress(self, result_summary, retrying, test_list):
+ """Print progress through the tests as determined by --print."""
+ if self.enabled('detailed-progress'):
+ self._print_detailed_progress(result_summary, test_list)
+ elif self.enabled('one-line-progress'):
+ self._print_one_line_progress(result_summary, retrying)
+ else:
+ return
+
+ if result_summary.remaining == 0:
+ self._meter.update('')
+
+ def _print_one_line_progress(self, result_summary, retrying):
+ """Displays the progress through the test run."""
+ percent_complete = 100 * (result_summary.expected +
+ result_summary.unexpected) / result_summary.total
+ action = "Testing"
+ if retrying:
+ action = "Retrying"
+ self._meter.progress("%s (%d%%): %d ran as expected, %d didn't,"
+ " %d left" % (action, percent_complete, result_summary.expected,
+ result_summary.unexpected, result_summary.remaining))
+
+ def _print_detailed_progress(self, result_summary, test_list):
+ """Display detailed progress output where we print the directory name
+ and one dot for each completed test. This is triggered by
+ "--log detailed-progress"."""
+ if self._current_test_number == len(test_list):
+ return
+
+ next_test = test_list[self._current_test_number]
+ next_dir = os.path.dirname(
+ self._port.relative_test_filename(next_test))
+ if self._current_progress_str == "":
+ self._current_progress_str = "%s: " % (next_dir)
+ self._current_dir = next_dir
+
+ while next_test in result_summary.results:
+ if next_dir != self._current_dir:
+ self._meter.write("%s\n" % (self._current_progress_str))
+ self._current_progress_str = "%s: ." % (next_dir)
+ self._current_dir = next_dir
+ else:
+ self._current_progress_str += "."
+
+ if (next_test in result_summary.unexpected_results and
+ self.enabled('unexpected')):
+ self._meter.write("%s\n" % self._current_progress_str)
+ test_result = result_summary.results[next_test]
+ self._print_unexpected_test_result(test_result)
+ self._current_progress_str = "%s: " % self._current_dir
+
+ self._current_test_number += 1
+ if self._current_test_number == len(test_list):
+ break
+
+ next_test = test_list[self._current_test_number]
+ next_dir = os.path.dirname(
+ self._port.relative_test_filename(next_test))
+
+ if result_summary.remaining:
+ remain_str = " (%d)" % (result_summary.remaining)
+ self._meter.progress("%s%s" % (self._current_progress_str,
+ remain_str))
+ else:
+ self._meter.progress("%s" % (self._current_progress_str))
+
+ def print_unexpected_results(self, unexpected_results):
+ """Prints a list of the unexpected results to the buildbot stream."""
+ if self.disabled('unexpected-results'):
+ return
+
+ passes = {}
+ flaky = {}
+ regressions = {}
+
+ for test, results in unexpected_results['tests'].iteritems():
+ actual = results['actual'].split(" ")
+ expected = results['expected'].split(" ")
+ if actual == ['PASS']:
+ if 'CRASH' in expected:
+ _add_to_dict_of_lists(passes,
+ 'Expected to crash, but passed',
+ test)
+ elif 'TIMEOUT' in expected:
+ _add_to_dict_of_lists(passes,
+ 'Expected to timeout, but passed',
+ test)
+ else:
+ _add_to_dict_of_lists(passes,
+ 'Expected to fail, but passed',
+ test)
+ elif len(actual) > 1:
+ # We group flaky tests by the first actual result we got.
+ _add_to_dict_of_lists(flaky, actual[0], test)
+ else:
+ _add_to_dict_of_lists(regressions, results['actual'], test)
+
+ if len(passes) or len(flaky) or len(regressions):
+ self._buildbot_stream.write("\n")
+
+ if len(passes):
+ for key, tests in passes.iteritems():
+ self._buildbot_stream.write("%s: (%d)\n" % (key, len(tests)))
+ tests.sort()
+ for test in tests:
+ self._buildbot_stream.write(" %s\n" % test)
+ self._buildbot_stream.write("\n")
+ self._buildbot_stream.write("\n")
+
+ if len(flaky):
+ descriptions = TestExpectationsFile.EXPECTATION_DESCRIPTIONS
+ for key, tests in flaky.iteritems():
+ result = TestExpectationsFile.EXPECTATIONS[key.lower()]
+ self._buildbot_stream.write("Unexpected flakiness: %s (%d)\n"
+ % (descriptions[result][1], len(tests)))
+ tests.sort()
+
+ for test in tests:
+ result = unexpected_results['tests'][test]
+ actual = result['actual'].split(" ")
+ expected = result['expected'].split(" ")
+ result = TestExpectationsFile.EXPECTATIONS[key.lower()]
+ new_expectations_list = list(set(actual) | set(expected))
+ self._buildbot_stream.write(" %s = %s\n" %
+ (test, " ".join(new_expectations_list)))
+ self._buildbot_stream.write("\n")
+ self._buildbot_stream.write("\n")
+
+ if len(regressions):
+ descriptions = TestExpectationsFile.EXPECTATION_DESCRIPTIONS
+ for key, tests in regressions.iteritems():
+ result = TestExpectationsFile.EXPECTATIONS[key.lower()]
+ self._buildbot_stream.write(
+ "Regressions: Unexpected %s : (%d)\n" % (
+ descriptions[result][1], len(tests)))
+ tests.sort()
+ for test in tests:
+ self._buildbot_stream.write(" %s = %s\n" % (test, key))
+ self._buildbot_stream.write("\n")
+ self._buildbot_stream.write("\n")
+
+ if len(unexpected_results['tests']) and self._options.verbose:
+ self._buildbot_stream.write("%s\n" % ("-" * 78))
+
+ def print_update(self, msg):
+ if self.disabled('updates'):
+ return
+ self._meter.update(msg)
+
+ def write(self, msg, option="misc"):
+ if self.disabled(option):
+ return
+ self._write(msg)
+
+ def _write(self, msg):
+ # FIXME: we could probably get away with calling _log.info() all of
+ # the time, but there doesn't seem to be a good way to test the output
+ # from the logger :(.
+ if self._options.verbose:
+ _log.info(msg)
+ else:
+ self._meter.write("%s\n" % msg)
+
+#
+# Utility routines used by the Controller class
+#
+
+
+def _add_to_dict_of_lists(dict, key, value):
+ dict.setdefault(key, []).append(value)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
new file mode 100644
index 0000000..9a0f4ee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/printing_unittest.py
@@ -0,0 +1,610 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for printing.py."""
+
+import os
+import optparse
+import pdb
+import sys
+import unittest
+import logging
+
+from webkitpy.common import array_stream
+from webkitpy.common.system import logtesting
+from webkitpy.layout_tests import port
+from webkitpy.layout_tests.layout_package import printing
+from webkitpy.layout_tests.layout_package import test_results
+from webkitpy.layout_tests.layout_package import test_expectations
+from webkitpy.layout_tests.layout_package import test_failures
+from webkitpy.layout_tests import run_webkit_tests
+
+
+def get_options(args):
+ print_options = printing.print_options()
+ option_parser = optparse.OptionParser(option_list=print_options)
+ return option_parser.parse_args(args)
+
+
+class TestUtilityFunctions(unittest.TestCase):
+ def test_configure_logging(self):
+ options, args = get_options([])
+ stream = array_stream.ArrayStream()
+ handler = printing._configure_logging(stream, options.verbose)
+ logging.info("this should be logged")
+ self.assertFalse(stream.empty())
+
+ stream.reset()
+ logging.debug("this should not be logged")
+ self.assertTrue(stream.empty())
+
+ printing._restore_logging(handler)
+
+ stream.reset()
+ options, args = get_options(['--verbose'])
+ handler = printing._configure_logging(stream, options.verbose)
+ logging.debug("this should be logged")
+ self.assertFalse(stream.empty())
+ printing._restore_logging(handler)
+
+ def test_print_options(self):
+ options, args = get_options([])
+ self.assertTrue(options is not None)
+
+ def test_parse_print_options(self):
+ def test_switches(args, verbose, child_processes, is_fully_parallel,
+ expected_switches_str):
+ options, args = get_options(args)
+ if expected_switches_str:
+ expected_switches = set(expected_switches_str.split(','))
+ else:
+ expected_switches = set()
+ switches = printing.parse_print_options(options.print_options,
+ verbose,
+ child_processes,
+ is_fully_parallel)
+ self.assertEqual(expected_switches, switches)
+
+ # test that we default to the default set of switches
+ test_switches([], False, 1, False,
+ printing.PRINT_DEFAULT)
+
+ # test that verbose defaults to everything
+ test_switches([], True, 1, False,
+ printing.PRINT_EVERYTHING)
+
+ # test that --print default does what it's supposed to
+ test_switches(['--print', 'default'], False, 1, False,
+ printing.PRINT_DEFAULT)
+
+ # test that --print nothing does what it's supposed to
+ test_switches(['--print', 'nothing'], False, 1, False,
+ None)
+
+ # test that --print everything does what it's supposed to
+ test_switches(['--print', 'everything'], False, 1, False,
+ printing.PRINT_EVERYTHING)
+
+ # this tests that '--print X' overrides '--verbose'
+ test_switches(['--print', 'actual'], True, 1, False,
+ 'actual')
+
+
+class Testprinter(unittest.TestCase):
+ def get_printer(self, args=None, single_threaded=False,
+ is_fully_parallel=False):
+ printing_options = printing.print_options()
+ option_parser = optparse.OptionParser(option_list=printing_options)
+ options, args = option_parser.parse_args(args)
+ self._port = port.get('test', options)
+ nproc = 2
+ if single_threaded:
+ nproc = 1
+
+ regular_output = array_stream.ArrayStream()
+ buildbot_output = array_stream.ArrayStream()
+ printer = printing.Printer(self._port, options, regular_output,
+ buildbot_output, single_threaded,
+ is_fully_parallel)
+ return printer, regular_output, buildbot_output
+
+ def get_result(self, test, result_type=test_expectations.PASS, run_time=0):
+ failures = []
+ if result_type == test_expectations.TIMEOUT:
+ failures = [test_failures.FailureTimeout()]
+ elif result_type == test_expectations.CRASH:
+ failures = [test_failures.FailureCrash()]
+ path = os.path.join(self._port.layout_tests_dir(), test)
+ return test_results.TestResult(path, failures, run_time,
+ total_time_for_all_diffs=0,
+ time_for_diffs=0)
+
+ def get_result_summary(self, tests, expectations_str):
+ test_paths = [os.path.join(self._port.layout_tests_dir(), test) for
+ test in tests]
+ expectations = test_expectations.TestExpectations(
+ self._port, test_paths, expectations_str,
+ self._port.test_platform_name(), is_debug_mode=False,
+ is_lint_mode=False)
+
+ rs = run_webkit_tests.ResultSummary(expectations, test_paths)
+ return test_paths, rs, expectations
+
+ def test_help_printer(self):
+ # Here and below we'll call the "regular" printer err and the
+ # buildbot printer out; this corresponds to how things run on the
+ # bots with stderr and stdout.
+ printer, err, out = self.get_printer()
+
+ # This routine should print something to stdout. testing what it is
+ # is kind of pointless.
+ printer.help_printing()
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ def do_switch_tests(self, method_name, switch, to_buildbot,
+ message='hello', exp_err=None, exp_bot=None):
+ def do_helper(method_name, switch, message, exp_err, exp_bot):
+ printer, err, bot = self.get_printer(['--print', switch])
+ getattr(printer, method_name)(message)
+ self.assertEqual(err.get(), exp_err)
+ self.assertEqual(bot.get(), exp_bot)
+
+ if to_buildbot:
+ if exp_err is None:
+ exp_err = []
+ if exp_bot is None:
+ exp_bot = [message + "\n"]
+ else:
+ if exp_err is None:
+ exp_err = [message + "\n"]
+ if exp_bot is None:
+ exp_bot = []
+ do_helper(method_name, 'nothing', 'hello', [], [])
+ do_helper(method_name, switch, 'hello', exp_err, exp_bot)
+ do_helper(method_name, 'everything', 'hello', exp_err, exp_bot)
+
+ def test_configure_and_cleanup(self):
+ # This test verifies that calling cleanup repeatedly and deleting
+ # the object is safe.
+ printer, err, out = self.get_printer(['--print', 'everything'])
+ printer.cleanup()
+ printer.cleanup()
+ printer = None
+
+ def test_print_actual(self):
+ # Actual results need to be logged to the buildbot's stream.
+ self.do_switch_tests('print_actual', 'actual', to_buildbot=True)
+
+ def test_print_actual_buildbot(self):
+ # FIXME: Test that the format of the actual results matches what the
+ # buildbot is expecting.
+ pass
+
+ def test_print_config(self):
+ self.do_switch_tests('print_config', 'config', to_buildbot=False)
+
+ def test_print_expected(self):
+ self.do_switch_tests('print_expected', 'expected', to_buildbot=False)
+
+ def test_print_timing(self):
+ self.do_switch_tests('print_timing', 'timing', to_buildbot=False)
+
+ def test_print_update(self):
+ # Note that there shouldn't be a carriage return here; updates()
+ # are meant to be overwritten.
+ self.do_switch_tests('print_update', 'updates', to_buildbot=False,
+ message='hello', exp_err=['hello'])
+
+ def test_print_one_line_summary(self):
+ printer, err, out = self.get_printer(['--print', 'nothing'])
+ printer.print_one_line_summary(1, 1, 0)
+ self.assertTrue(err.empty())
+
+ printer, err, out = self.get_printer(['--print', 'one-line-summary'])
+ printer.print_one_line_summary(1, 1, 0)
+ self.assertEquals(err.get(), ["All 1 tests ran as expected.\n", "\n"])
+
+ printer, err, out = self.get_printer(['--print', 'everything'])
+ printer.print_one_line_summary(1, 1, 0)
+ self.assertEquals(err.get(), ["All 1 tests ran as expected.\n", "\n"])
+
+ err.reset()
+ printer.print_one_line_summary(2, 1, 1)
+ self.assertEquals(err.get(),
+ ["1 test ran as expected, 1 didn't:\n", "\n"])
+
+ err.reset()
+ printer.print_one_line_summary(3, 2, 1)
+ self.assertEquals(err.get(),
+ ["2 tests ran as expected, 1 didn't:\n", "\n"])
+
+ err.reset()
+ printer.print_one_line_summary(3, 2, 0)
+ self.assertEquals(err.get(),
+ ['\n', "2 tests ran as expected (1 didn't run).\n",
+ '\n'])
+
+
+ def test_print_test_result(self):
+ # Note here that we don't use meaningful exp_str and got_str values;
+ # the actual contents of the string are treated opaquely by
+ # print_test_result() when tracing, and usually we don't want
+ # to test what exactly is printed, just that something
+ # was printed (or that nothing was printed).
+ #
+ # FIXME: this is actually some goofy layering; it would be nice
+ # we could refactor it so that the args weren't redundant. Maybe
+ # the TestResult should contain what was expected, and the
+ # strings could be derived from the TestResult?
+ printer, err, out = self.get_printer(['--print', 'nothing'])
+ result = self.get_result('passes/image.html')
+ printer.print_test_result(result, expected=False, exp_str='',
+ got_str='')
+ self.assertTrue(err.empty())
+
+ printer, err, out = self.get_printer(['--print', 'unexpected'])
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ self.assertTrue(err.empty())
+ printer.print_test_result(result, expected=False, exp_str='',
+ got_str='')
+ self.assertEquals(err.get(),
+ [' passes/image.html -> unexpected pass\n'])
+
+ printer, err, out = self.get_printer(['--print', 'everything'])
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ self.assertTrue(err.empty())
+
+ printer.print_test_result(result, expected=False, exp_str='',
+ got_str='')
+ self.assertEquals(err.get(),
+ [' passes/image.html -> unexpected pass\n'])
+
+ printer, err, out = self.get_printer(['--print', 'nothing'])
+ printer.print_test_result(result, expected=False, exp_str='',
+ got_str='')
+ self.assertTrue(err.empty())
+
+ printer, err, out = self.get_printer(['--print',
+ 'trace-unexpected'])
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ self.assertTrue(err.empty())
+
+ printer, err, out = self.get_printer(['--print',
+ 'trace-unexpected'])
+ printer.print_test_result(result, expected=False, exp_str='',
+ got_str='')
+ self.assertFalse(err.empty())
+
+ printer, err, out = self.get_printer(['--print',
+ 'trace-unexpected'])
+ result = self.get_result("passes/text.html")
+ printer.print_test_result(result, expected=False, exp_str='',
+ got_str='')
+ self.assertFalse(err.empty())
+
+ err.reset()
+ printer.print_test_result(result, expected=False, exp_str='',
+ got_str='')
+ self.assertFalse(err.empty())
+
+ printer, err, out = self.get_printer(['--print', 'trace-everything'])
+ result = self.get_result('passes/image.html')
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ result = self.get_result('failures/expected/missing_text.html')
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ result = self.get_result('failures/expected/missing_check.html')
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ result = self.get_result('failures/expected/missing_image.html')
+ printer.print_test_result(result, expected=True, exp_str='',
+ got_str='')
+ self.assertFalse(err.empty())
+
+ err.reset()
+ printer.print_test_result(result, expected=False, exp_str='',
+ got_str='')
+
+ def test_print_progress(self):
+ expectations = ''
+
+ # test that we print nothing
+ printer, err, out = self.get_printer(['--print', 'nothing'])
+ tests = ['passes/text.html', 'failures/expected/timeout.html',
+ 'failures/expected/crash.html']
+ paths, rs, exp = self.get_result_summary(tests, expectations)
+
+ printer.print_progress(rs, False, paths)
+ self.assertTrue(out.empty())
+ self.assertTrue(err.empty())
+
+ printer.print_progress(rs, True, paths)
+ self.assertTrue(out.empty())
+ self.assertTrue(err.empty())
+
+ # test regular functionality
+ printer, err, out = self.get_printer(['--print',
+ 'one-line-progress'])
+ printer.print_progress(rs, False, paths)
+ self.assertTrue(out.empty())
+ self.assertFalse(err.empty())
+
+ err.reset()
+ out.reset()
+ printer.print_progress(rs, True, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ def test_print_progress__detailed(self):
+ tests = ['passes/text.html', 'failures/expected/timeout.html',
+ 'failures/expected/crash.html']
+ expectations = 'failures/expected/timeout.html = TIMEOUT'
+
+ # first, test that it is disabled properly
+ # should still print one-line-progress
+ printer, err, out = self.get_printer(
+ ['--print', 'detailed-progress'], single_threaded=False)
+ paths, rs, exp = self.get_result_summary(tests, expectations)
+ printer.print_progress(rs, False, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ # now test the enabled paths
+ printer, err, out = self.get_printer(
+ ['--print', 'detailed-progress'], single_threaded=True)
+ paths, rs, exp = self.get_result_summary(tests, expectations)
+ printer.print_progress(rs, False, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ err.reset()
+ out.reset()
+ printer.print_progress(rs, True, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ rs.add(self.get_result('passes/text.html', test_expectations.TIMEOUT), False)
+ rs.add(self.get_result('failures/expected/timeout.html'), True)
+ rs.add(self.get_result('failures/expected/crash.html', test_expectations.CRASH), True)
+ err.reset()
+ out.reset()
+ printer.print_progress(rs, False, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ # We only clear the meter when retrying w/ detailed-progress.
+ err.reset()
+ out.reset()
+ printer.print_progress(rs, True, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ printer, err, out = self.get_printer(
+ ['--print', 'detailed-progress,unexpected'], single_threaded=True)
+ paths, rs, exp = self.get_result_summary(tests, expectations)
+ printer.print_progress(rs, False, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ err.reset()
+ out.reset()
+ printer.print_progress(rs, True, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ rs.add(self.get_result('passes/text.html', test_expectations.TIMEOUT), False)
+ rs.add(self.get_result('failures/expected/timeout.html'), True)
+ rs.add(self.get_result('failures/expected/crash.html', test_expectations.CRASH), True)
+ err.reset()
+ out.reset()
+ printer.print_progress(rs, False, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ # We only clear the meter when retrying w/ detailed-progress.
+ err.reset()
+ out.reset()
+ printer.print_progress(rs, True, paths)
+ self.assertFalse(err.empty())
+ self.assertTrue(out.empty())
+
+ def test_write_nothing(self):
+ printer, err, out = self.get_printer(['--print', 'nothing'])
+ printer.write("foo")
+ self.assertTrue(err.empty())
+
+ def test_write_misc(self):
+ printer, err, out = self.get_printer(['--print', 'misc'])
+ printer.write("foo")
+ self.assertFalse(err.empty())
+ err.reset()
+ printer.write("foo", "config")
+ self.assertTrue(err.empty())
+
+ def test_write_everything(self):
+ printer, err, out = self.get_printer(['--print', 'everything'])
+ printer.write("foo")
+ self.assertFalse(err.empty())
+ err.reset()
+ printer.write("foo", "config")
+ self.assertFalse(err.empty())
+
+ def test_write_verbose(self):
+ printer, err, out = self.get_printer(['--verbose'])
+ printer.write("foo")
+ self.assertTrue(not err.empty() and "foo" in err.get()[0])
+ self.assertTrue(out.empty())
+
+ def test_print_unexpected_results(self):
+ # This routine is the only one that prints stuff that the bots
+ # care about.
+ #
+ # FIXME: there's some weird layering going on here. It seems
+ # like we shouldn't be both using an expectations string and
+ # having to specify whether or not the result was expected.
+ # This whole set of tests should probably be rewritten.
+ #
+ # FIXME: Plus, the fact that we're having to call into
+ # run_webkit_tests is clearly a layering inversion.
+ def get_unexpected_results(expected, passing, flaky):
+ """Return an unexpected results summary matching the input description.
+
+ There are a lot of different combinations of test results that
+ can be tested; this routine produces various combinations based
+ on the values of the input flags.
+
+ Args
+ expected: whether the tests ran as expected
+ passing: whether the tests should all pass
+ flaky: whether the tests should be flaky (if False, they
+ produce the same results on both runs; if True, they
+ all pass on the second run).
+
+ """
+ paths, rs, exp = self.get_result_summary(tests, expectations)
+ if expected:
+ rs.add(self.get_result('passes/text.html', test_expectations.PASS),
+ expected)
+ rs.add(self.get_result('failures/expected/timeout.html',
+ test_expectations.TIMEOUT), expected)
+ rs.add(self.get_result('failures/expected/crash.html', test_expectations.CRASH),
+ expected)
+ elif passing:
+ rs.add(self.get_result('passes/text.html'), expected)
+ rs.add(self.get_result('failures/expected/timeout.html'), expected)
+ rs.add(self.get_result('failures/expected/crash.html'), expected)
+ else:
+ rs.add(self.get_result('passes/text.html', test_expectations.TIMEOUT),
+ expected)
+ rs.add(self.get_result('failures/expected/timeout.html',
+ test_expectations.CRASH), expected)
+ rs.add(self.get_result('failures/expected/crash.html',
+ test_expectations.TIMEOUT),
+ expected)
+ retry = rs
+ if flaky:
+ paths, retry, exp = self.get_result_summary(tests,
+ expectations)
+ retry.add(self.get_result('passes/text.html'), True)
+ retry.add(self.get_result('failures/expected/timeout.html'), True)
+ retry.add(self.get_result('failures/expected/crash.html'), True)
+ unexpected_results = run_webkit_tests.summarize_unexpected_results(
+ self._port, exp, rs, retry)
+ return unexpected_results
+
+ tests = ['passes/text.html', 'failures/expected/timeout.html',
+ 'failures/expected/crash.html']
+ expectations = ''
+
+ printer, err, out = self.get_printer(['--print', 'nothing'])
+ ur = get_unexpected_results(expected=False, passing=False, flaky=False)
+ printer.print_unexpected_results(ur)
+ self.assertTrue(err.empty())
+ self.assertTrue(out.empty())
+
+ printer, err, out = self.get_printer(['--print',
+ 'unexpected-results'])
+
+ # test everything running as expected
+ ur = get_unexpected_results(expected=True, passing=False, flaky=False)
+ printer.print_unexpected_results(ur)
+ self.assertTrue(err.empty())
+ self.assertTrue(out.empty())
+
+ # test failures
+ err.reset()
+ out.reset()
+ ur = get_unexpected_results(expected=False, passing=False, flaky=False)
+ printer.print_unexpected_results(ur)
+ self.assertTrue(err.empty())
+ self.assertFalse(out.empty())
+
+ # test unexpected flaky results
+ err.reset()
+ out.reset()
+ ur = get_unexpected_results(expected=False, passing=True, flaky=False)
+ printer.print_unexpected_results(ur)
+ self.assertTrue(err.empty())
+ self.assertFalse(out.empty())
+
+ # test unexpected passes
+ err.reset()
+ out.reset()
+ ur = get_unexpected_results(expected=False, passing=False, flaky=True)
+ printer.print_unexpected_results(ur)
+ self.assertTrue(err.empty())
+ self.assertFalse(out.empty())
+
+ err.reset()
+ out.reset()
+ printer, err, out = self.get_printer(['--print', 'everything'])
+ ur = get_unexpected_results(expected=False, passing=False, flaky=False)
+ printer.print_unexpected_results(ur)
+ self.assertTrue(err.empty())
+ self.assertFalse(out.empty())
+
+ expectations = """
+failures/expected/crash.html = CRASH
+failures/expected/timeout.html = TIMEOUT
+"""
+ err.reset()
+ out.reset()
+ ur = get_unexpected_results(expected=False, passing=False, flaky=False)
+ printer.print_unexpected_results(ur)
+ self.assertTrue(err.empty())
+ self.assertFalse(out.empty())
+
+ err.reset()
+ out.reset()
+ ur = get_unexpected_results(expected=False, passing=True, flaky=False)
+ printer.print_unexpected_results(ur)
+ self.assertTrue(err.empty())
+ self.assertFalse(out.empty())
+
+ # Test handling of --verbose as well.
+ err.reset()
+ out.reset()
+ printer, err, out = self.get_printer(['--verbose'])
+ ur = get_unexpected_results(expected=False, passing=False, flaky=False)
+ printer.print_unexpected_results(ur)
+ self.assertTrue(err.empty())
+ self.assertFalse(out.empty())
+
+ def test_print_unexpected_results_buildbot(self):
+ # FIXME: Test that print_unexpected_results() produces the printer the
+ # buildbot is expecting.
+ pass
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
index a3650ed..67873a8 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations.py
@@ -35,23 +35,59 @@ import logging
import os
import re
import sys
-import time
-import simplejson
+import webkitpy.thirdparty.simplejson as simplejson
+
+_log = logging.getLogger("webkitpy.layout_tests.layout_package."
+ "test_expectations")
# Test expectation and modifier constants.
(PASS, FAIL, TEXT, IMAGE, IMAGE_PLUS_TEXT, TIMEOUT, CRASH, SKIP, WONTFIX,
- DEFER, SLOW, REBASELINE, MISSING, FLAKY, NOW, NONE) = range(16)
+ SLOW, REBASELINE, MISSING, FLAKY, NOW, NONE) = range(15)
# Test expectation file update action constants
(NO_CHANGE, REMOVE_TEST, REMOVE_PLATFORM, ADD_PLATFORMS_EXCEPT_THIS) = range(4)
+def result_was_expected(result, expected_results, test_needs_rebaselining,
+ test_is_skipped):
+ """Returns whether we got a result we were expecting.
+ Args:
+ result: actual result of a test execution
+ expected_results: set of results listed in test_expectations
+ test_needs_rebaselining: whether test was marked as REBASELINE
+ test_is_skipped: whether test was marked as SKIP"""
+ if result in expected_results:
+ return True
+ if result in (IMAGE, TEXT, IMAGE_PLUS_TEXT) and FAIL in expected_results:
+ return True
+ if result == MISSING and test_needs_rebaselining:
+ return True
+ if result == SKIP and test_is_skipped:
+ return True
+ return False
+
+
+def remove_pixel_failures(expected_results):
+ """Returns a copy of the expected results for a test, except that we
+ drop any pixel failures and return the remaining expectations. For example,
+ if we're not running pixel tests, then tests expected to fail as IMAGE
+ will PASS."""
+ expected_results = expected_results.copy()
+ if IMAGE in expected_results:
+ expected_results.remove(IMAGE)
+ expected_results.add(PASS)
+ if IMAGE_PLUS_TEXT in expected_results:
+ expected_results.remove(IMAGE_PLUS_TEXT)
+ expected_results.add(TEXT)
+ return expected_results
+
+
class TestExpectations:
TEST_LIST = "test_expectations.txt"
def __init__(self, port, tests, expectations, test_platform_name,
- is_debug_mode, is_lint_mode, tests_are_present=True):
+ is_debug_mode, is_lint_mode, overrides=None):
"""Loads and parses the test expectations given in the string.
Args:
port: handle to object containing platform-specific functionality
@@ -64,14 +100,14 @@ class TestExpectations:
in the expectations
is_lint_mode: If True, just parse the expectations string
looking for errors.
- tests_are_present: whether the test files exist in the file
- system and can be probed for. This is useful for distinguishing
- test files from directories, and is needed by the LTTF
- dashboard, where the files aren't actually locally present.
+ overrides: test expectations that are allowed to override any
+ entries in |expectations|. This is used by callers
+ that need to manage two sets of expectations (e.g., upstream
+ and downstream expectations).
"""
self._expected_failures = TestExpectationsFile(port, expectations,
tests, test_platform_name, is_debug_mode, is_lint_mode,
- tests_are_present=tests_are_present)
+ overrides=overrides)
# TODO(ojan): Allow for removing skipped tests when getting the list of
# tests to run, but not when getting metrics.
@@ -102,15 +138,16 @@ class TestExpectations:
retval = []
for expectation in expectations:
- for item in TestExpectationsFile.EXPECTATIONS.items():
- if item[1] == expectation:
- retval.append(item[0])
- break
+ retval.append(self.expectation_to_string(expectation))
- return " ".join(retval).upper()
+ return " ".join(retval)
- def get_timeline_for_test(self, test):
- return self._expected_failures.get_timeline_for_test(test)
+ def expectation_to_string(self, expectation):
+ """Return the uppercased string equivalent of a given expectation."""
+ for item in TestExpectationsFile.EXPECTATIONS.items():
+ if item[1] == expectation:
+ return item[0].upper()
+ raise ValueError(expectation)
def get_tests_with_result_type(self, result_type):
return self._expected_failures.get_tests_with_result_type(result_type)
@@ -118,14 +155,13 @@ class TestExpectations:
def get_tests_with_timeline(self, timeline):
return self._expected_failures.get_tests_with_timeline(timeline)
- def matches_an_expected_result(self, test, result):
- """Returns whether we got one of the expected results for this test."""
- return (result in self._expected_failures.get_expectations(test) or
- (result in (IMAGE, TEXT, IMAGE_PLUS_TEXT) and
- FAIL in self._expected_failures.get_expectations(test)) or
- result == MISSING and self.is_rebaselining(test) or
- result == SKIP and self._expected_failures.has_modifier(test,
- SKIP))
+ def matches_an_expected_result(self, test, result,
+ pixel_tests_are_enabled):
+ expected_results = self._expected_failures.get_expectations(test)
+ if not pixel_tests_are_enabled:
+ expected_results = remove_pixel_failures(expected_results)
+ return result_was_expected(result, expected_results,
+ self.is_rebaselining(test), self.has_modifier(test, SKIP))
def is_rebaselining(self, test):
return self._expected_failures.has_modifier(test, REBASELINE)
@@ -133,10 +169,9 @@ class TestExpectations:
def has_modifier(self, test, modifier):
return self._expected_failures.has_modifier(test, modifier)
- def remove_platform_from_file(self, tests, platform, backup=False):
- return self._expected_failures.remove_platform_from_file(tests,
- platform,
- backup)
+ def remove_platform_from_expectations(self, tests, platform):
+ return self._expected_failures.remove_platform_from_expectations(
+ tests, platform)
def strip_comments(line):
@@ -165,15 +200,15 @@ class ModifiersAndExpectations:
class ExpectationsJsonEncoder(simplejson.JSONEncoder):
- """JSON encoder that can handle ModifiersAndExpectations objects.
- """
-
+ """JSON encoder that can handle ModifiersAndExpectations objects."""
def default(self, obj):
- if isinstance(obj, ModifiersAndExpectations):
- return {"modifiers": obj.modifiers,
- "expectations": obj.expectations}
- else:
- return JSONEncoder.default(self, obj)
+ # A ModifiersAndExpectations object has two fields, each of which
+ # is a dict. Since JSONEncoders handle all the builtin types directly,
+ # the only time this routine should be called is on the top level
+ # object (i.e., the encoder shouldn't recurse).
+ assert isinstance(obj, ModifiersAndExpectations)
+ return {"modifiers": obj.modifiers,
+ "expectations": obj.expectations}
class TestExpectationsFile:
@@ -193,12 +228,11 @@ class TestExpectationsFile:
DEBUG : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
DEBUG SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
LINUX DEBUG SKIP : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
- DEFER LINUX WIN : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
+ LINUX WIN : LayoutTests/fast/js/no-good.js = TIMEOUT PASS
SKIP: Doesn't run the test.
SLOW: The test takes a long time to run, but does not timeout indefinitely.
WONTFIX: For tests that we never intend to pass on a given platform.
- DEFER: Test does not count in our statistics for the current release.
DEBUG: Expectations apply only to the debug build.
RELEASE: Expectations apply only to release build.
LINUX/WIN/WIN-XP/WIN-VISTA/WIN-7/MAC: Expectations apply only to these
@@ -206,7 +240,6 @@ class TestExpectationsFile:
Notes:
-A test cannot be both SLOW and TIMEOUT
- -A test cannot be both DEFER and WONTFIX
-A test should only be one of IMAGE, TEXT, IMAGE+TEXT, or FAIL. FAIL is
a migratory state that currently means either IMAGE, TEXT, or
IMAGE+TEXT. Once we have finished migrating the expectations, we will
@@ -214,7 +247,7 @@ class TestExpectationsFile:
identifier.
-A test can be included twice, but not via the same path.
-If a test is included twice, then the more precise path wins.
- -CRASH tests cannot be DEFER or WONTFIX
+ -CRASH tests cannot be WONTFIX
"""
EXPECTATIONS = {'pass': PASS,
@@ -234,8 +267,8 @@ class TestExpectationsFile:
IMAGE: ('image mismatch', 'image mismatch'),
IMAGE_PLUS_TEXT: ('image and text mismatch',
'image and text mismatch'),
- CRASH: ('test shell crash',
- 'test shell crashes'),
+ CRASH: ('DumpRenderTree crash',
+ 'DumpRenderTree crashes'),
TIMEOUT: ('test timed out', 'tests timed out'),
MISSING: ('no expected result found',
'no expected results found')}
@@ -247,14 +280,12 @@ class TestExpectationsFile:
MODIFIERS = {'skip': SKIP,
'wontfix': WONTFIX,
- 'defer': DEFER,
'slow': SLOW,
'rebaseline': REBASELINE,
'none': NONE}
TIMELINES = {'wontfix': WONTFIX,
- 'now': NOW,
- 'defer': DEFER}
+ 'now': NOW}
RESULT_TYPES = {'skip': SKIP,
'pass': PASS,
@@ -262,8 +293,7 @@ class TestExpectationsFile:
'flaky': FLAKY}
def __init__(self, port, expectations, full_test_list, test_platform_name,
- is_debug_mode, is_lint_mode, suppress_errors=False,
- tests_are_present=True):
+ is_debug_mode, is_lint_mode, suppress_errors=False, overrides=None):
"""
expectations: Contents of the expectations file
full_test_list: The list of all tests to be run pending processing of
@@ -274,9 +304,10 @@ class TestExpectationsFile:
is_debug_mode: Whether we testing a test_shell built debug mode.
is_lint_mode: Whether this is just linting test_expecatations.txt.
suppress_errors: Whether to suppress lint errors.
- tests_are_present: Whether the test files are present in the local
- filesystem. The LTTF Dashboard uses False here to avoid having to
- keep a local copy of the tree.
+ overrides: test expectations that are allowed to override any
+ entries in |expectations|. This is used by callers
+ that need to manage two sets of expectations (e.g., upstream
+ and downstream expectations).
"""
self._port = port
@@ -285,7 +316,7 @@ class TestExpectationsFile:
self._test_platform_name = test_platform_name
self._is_debug_mode = is_debug_mode
self._is_lint_mode = is_lint_mode
- self._tests_are_present = tests_are_present
+ self._overrides = overrides
self._suppress_errors = suppress_errors
self._errors = []
self._non_fatal_errors = []
@@ -313,7 +344,50 @@ class TestExpectationsFile:
self._timeline_to_tests = self._dict_of_sets(self.TIMELINES)
self._result_type_to_tests = self._dict_of_sets(self.RESULT_TYPES)
- self._read(self._get_iterable_expectations())
+ self._read(self._get_iterable_expectations(self._expectations),
+ overrides_allowed=False)
+
+ # List of tests that are in the overrides file (used for checking for
+ # duplicates inside the overrides file itself). Note that just because
+ # a test is in this set doesn't mean it's necessarily overridding a
+ # expectation in the regular expectations; the test might not be
+ # mentioned in the regular expectations file at all.
+ self._overridding_tests = set()
+
+ if overrides:
+ self._read(self._get_iterable_expectations(self._overrides),
+ overrides_allowed=True)
+
+ self._handle_any_read_errors()
+ self._process_tests_without_expectations()
+
+ def _handle_any_read_errors(self):
+ if not self._suppress_errors and (
+ len(self._errors) or len(self._non_fatal_errors)):
+ if self._is_debug_mode:
+ build_type = 'DEBUG'
+ else:
+ build_type = 'RELEASE'
+ _log.error('')
+ _log.error("FAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" %
+ (self._test_platform_name.upper(), build_type))
+
+ for error in self._non_fatal_errors:
+ _log.error(error)
+ _log.error('')
+
+ if len(self._errors):
+ raise SyntaxError('\n'.join(map(str, self._errors)))
+
+ def _process_tests_without_expectations(self):
+ expectations = set([PASS])
+ options = []
+ modifiers = []
+ if self._full_test_list:
+ for test in self._full_test_list:
+ if not test in self._test_list_paths:
+ self._add_test(test, modifiers, expectations, options,
+ overrides_allowed=False)
def _dict_of_sets(self, strings_to_constants):
"""Takes a dict of strings->constants and returns a dict mapping
@@ -323,12 +397,11 @@ class TestExpectationsFile:
d[c] = set()
return d
- def _get_iterable_expectations(self):
+ def _get_iterable_expectations(self, expectations_str):
"""Returns an object that can be iterated over. Allows for not caring
about whether we're iterating over a file or a new-line separated
string."""
- iterable = [x + "\n" for x in
- self._expectations.split("\n")]
+ iterable = [x + "\n" for x in expectations_str.split("\n")]
# Strip final entry if it's empty to avoid added in an extra
# newline.
if iterable[-1] == "\n":
@@ -370,11 +443,12 @@ class TestExpectationsFile:
return ExpectationsJsonEncoder(separators=(',', ':')).encode(
self._all_expectations)
- def contains(self, test):
- return test in self._test_to_expectations
+ def get_non_fatal_errors(self):
+ return self._non_fatal_errors
- def remove_platform_from_file(self, tests, platform, backup=False):
- """Remove the platform option from test expectations file.
+ def remove_platform_from_expectations(self, tests, platform):
+ """Returns a copy of the expectations with the tests matching the
+ platform removed.
If a test is in the test list and has an option that matches the given
platform, remove the matching platform and save the updated test back
@@ -384,24 +458,14 @@ class TestExpectationsFile:
Args:
tests: list of tests that need to update..
platform: which platform option to remove.
- backup: if true, the original test expectations file is saved as
- [self.TEST_LIST].orig.YYYYMMDDHHMMSS
Returns:
- no
+ the updated string.
"""
- # FIXME - remove_platform_from file worked by writing a new
- # test_expectations.txt file over the old one. Now that we're just
- # parsing strings, we need to change this to return the new
- # expectations string.
- raise NotImplementedException('remove_platform_from_file')
-
- new_file = self._path + '.new'
- logging.debug('Original file: "%s"', self._path)
- logging.debug('New file: "%s"', new_file)
- f_orig = self._get_iterable_expectations()
- f_new = open(new_file, 'w')
+ assert(platform)
+ f_orig = self._get_iterable_expectations(self._expectations)
+ f_new = []
tests_removed = 0
tests_updated = 0
@@ -410,22 +474,24 @@ class TestExpectationsFile:
lineno += 1
action = self._get_platform_update_action(line, lineno, tests,
platform)
+ assert(action in (NO_CHANGE, REMOVE_TEST, REMOVE_PLATFORM,
+ ADD_PLATFORMS_EXCEPT_THIS))
if action == NO_CHANGE:
# Save the original line back to the file
- logging.debug('No change to test: %s', line)
- f_new.write(line)
+ _log.debug('No change to test: %s', line)
+ f_new.append(line)
elif action == REMOVE_TEST:
tests_removed += 1
- logging.info('Test removed: %s', line)
+ _log.info('Test removed: %s', line)
elif action == REMOVE_PLATFORM:
parts = line.split(':')
new_options = parts[0].replace(platform.upper() + ' ', '', 1)
new_line = ('%s:%s' % (new_options, parts[1]))
- f_new.write(new_line)
+ f_new.append(new_line)
tests_updated += 1
- logging.info('Test updated: ')
- logging.info(' old: %s', line)
- logging.info(' new: %s', new_line)
+ _log.info('Test updated: ')
+ _log.info(' old: %s', line)
+ _log.info(' new: %s', new_line)
elif action == ADD_PLATFORMS_EXCEPT_THIS:
parts = line.split(':')
new_options = parts[0]
@@ -440,35 +506,16 @@ class TestExpectationsFile:
if not p in (platform.upper(), 'WIN-VISTA', 'WIN-7'):
new_options += p + ' '
new_line = ('%s:%s' % (new_options, parts[1]))
- f_new.write(new_line)
+ f_new.append(new_line)
tests_updated += 1
- logging.info('Test updated: ')
- logging.info(' old: %s', line)
- logging.info(' new: %s', new_line)
- else:
- logging.error('Unknown update action: %d; line: %s',
- action, line)
-
- logging.info('Total tests removed: %d', tests_removed)
- logging.info('Total tests updated: %d', tests_updated)
-
- f_orig.close()
- f_new.close()
-
- if backup:
- date_suffix = time.strftime('%Y%m%d%H%M%S',
- time.localtime(time.time()))
- backup_file = ('%s.orig.%s' % (self._path, date_suffix))
- if os.path.exists(backup_file):
- os.remove(backup_file)
- logging.info('Saving original file to "%s"', backup_file)
- os.rename(self._path, backup_file)
- else:
- os.remove(self._path)
+ _log.info('Test updated: ')
+ _log.info(' old: %s', line)
+ _log.info(' new: %s', new_line)
- logging.debug('Saving new file to "%s"', self._path)
- os.rename(new_file, self._path)
- return True
+ _log.info('Total tests removed: %d', tests_removed)
+ _log.info('Total tests updated: %d', tests_updated)
+
+ return "".join(f_new)
def parse_expectations_line(self, line, lineno):
"""Parses a line from test_expectations.txt and returns a tuple
@@ -570,10 +617,6 @@ class TestExpectationsFile:
if not self._is_debug_mode and 'release' not in options:
return False
- if 'wontfix' in options and 'defer' in options:
- self._add_error(lineno, 'Test cannot be both DEFER and WONTFIX.',
- test_and_expectations)
-
if self._is_lint_mode and 'rebaseline' in options:
self._add_error(lineno,
'REBASELINE should only be used for running rebaseline.py. '
@@ -602,7 +645,7 @@ class TestExpectationsFile:
self._all_expectations[test].append(
ModifiersAndExpectations(options, expectations))
- def _read(self, expectations):
+ def _read(self, expectations, overrides_allowed):
"""For each test in an expectations iterable, generate the
expectations for it."""
lineno = 0
@@ -638,8 +681,8 @@ class TestExpectationsFile:
# WebKit's way of skipping tests is to add a -disabled suffix.
# So we should consider the path existing if the path or the
# -disabled version exists.
- if (self._tests_are_present and not os.path.exists(full_path)
- and not os.path.exists(full_path + '-disabled')):
+ if (not self._port.path_exists(full_path)
+ and not self._port.path_exists(full_path + '-disabled')):
# Log a non fatal error here since you hit this case any
# time you update test_expectations.txt without syncing
# the LayoutTests directory
@@ -653,30 +696,7 @@ class TestExpectationsFile:
tests = self._expand_tests(test_list_path)
self._add_tests(tests, expectations, test_list_path, lineno,
- modifiers, options)
-
- if not self._suppress_errors and (
- len(self._errors) or len(self._non_fatal_errors)):
- if self._is_debug_mode:
- build_type = 'DEBUG'
- else:
- build_type = 'RELEASE'
- print "\nFAILURES FOR PLATFORM: %s, BUILD_TYPE: %s" \
- % (self._test_platform_name.upper(), build_type)
-
- for error in self._non_fatal_errors:
- logging.error(error)
- if len(self._errors):
- raise SyntaxError('\n'.join(map(str, self._errors)))
-
- # Now add in the tests that weren't present in the expectations file
- expectations = set([PASS])
- options = []
- modifiers = []
- if self._full_test_list:
- for test in self._full_test_list:
- if not test in self._test_list_paths:
- self._add_test(test, modifiers, expectations, options)
+ modifiers, options, overrides_allowed)
def _get_options_list(self, listString):
return [part.strip().lower() for part in listString.strip().split(' ')]
@@ -697,7 +717,8 @@ class TestExpectationsFile:
path and make sure directories end with the OS path separator."""
path = os.path.join(self._port.layout_tests_dir(), test_list_path)
path = os.path.normpath(path)
- path = self._fix_dir(path)
+ if self._port.path_isdir(path):
+ path = os.path.join(path, '')
result = []
for test in self._full_test_list:
@@ -705,30 +726,19 @@ class TestExpectationsFile:
result.append(test)
return result
- def _fix_dir(self, path):
- """Check to see if the path points to a directory, and if so, append
- the directory separator if necessary."""
- if self._tests_are_present:
- if os.path.isdir(path):
- path = os.path.join(path, '')
- else:
- # If we can't check the filesystem to see if this is a directory,
- # we assume that files w/o an extension are directories.
- # TODO(dpranke): What happens w/ LayoutTests/css2.1 ?
- if os.path.splitext(path)[1] == '':
- path = os.path.join(path, '')
- return path
-
def _add_tests(self, tests, expectations, test_list_path, lineno,
- modifiers, options):
+ modifiers, options, overrides_allowed):
for test in tests:
- if self._already_seen_test(test, test_list_path, lineno):
+ if self._already_seen_test(test, test_list_path, lineno,
+ overrides_allowed):
continue
self._clear_expectations_for_test(test, test_list_path)
- self._add_test(test, modifiers, expectations, options)
+ self._add_test(test, modifiers, expectations, options,
+ overrides_allowed)
- def _add_test(self, test, modifiers, expectations, options):
+ def _add_test(self, test, modifiers, expectations, options,
+ overrides_allowed):
"""Sets the expected state for a given test.
This routine assumes the test has not been added before. If it has,
@@ -739,7 +749,9 @@ class TestExpectationsFile:
test: test to add
modifiers: sequence of modifier keywords ('wontfix', 'slow', etc.)
expectations: sequence of expectations (PASS, IMAGE, etc.)
- options: sequence of keywords and bug identifiers."""
+ options: sequence of keywords and bug identifiers.
+ overrides_allowed: whether we're parsing the regular expectations
+ or the overridding expectations"""
self._test_to_expectations[test] = expectations
for expectation in expectations:
self._expectation_to_tests[expectation].add(test)
@@ -753,8 +765,6 @@ class TestExpectationsFile:
if 'wontfix' in modifiers:
self._timeline_to_tests[WONTFIX].add(test)
- elif 'defer' in modifiers:
- self._timeline_to_tests[DEFER].add(test)
else:
self._timeline_to_tests[NOW].add(test)
@@ -767,6 +777,9 @@ class TestExpectationsFile:
else:
self._result_type_to_tests[FAIL].add(test)
+ if overrides_allowed:
+ self._overridding_tests.add(test)
+
def _clear_expectations_for_test(self, test, test_list_path):
"""Remove prexisting expectations for this test.
This happens if we are seeing a more precise path
@@ -791,7 +804,8 @@ class TestExpectationsFile:
if test in set_of_tests:
set_of_tests.remove(test)
- def _already_seen_test(self, test, test_list_path, lineno):
+ def _already_seen_test(self, test, test_list_path, lineno,
+ allow_overrides):
"""Returns true if we've already seen a more precise path for this test
than the test_list_path.
"""
@@ -800,8 +814,19 @@ class TestExpectationsFile:
prev_base_path = self._test_list_paths[test]
if (prev_base_path == os.path.normpath(test_list_path)):
- self._add_error(lineno, 'Duplicate expectations.', test)
- return True
+ if (not allow_overrides or test in self._overridding_tests):
+ if allow_overrides:
+ expectation_source = "override"
+ else:
+ expectation_source = "expectation"
+ self._add_error(lineno, 'Duplicate %s.' % expectation_source,
+ test)
+ return True
+ else:
+ # We have seen this path, but that's okay because its
+ # in the overrides and the earlier path was in the
+ # expectations.
+ return False
# Check if we've already seen a more precise path.
return prev_base_path.startswith(os.path.normpath(test_list_path))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
new file mode 100644
index 0000000..55eaf99
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_expectations_unittest.py
@@ -0,0 +1,313 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for test_expectations.py."""
+
+import os
+import sys
+import unittest
+
+from webkitpy.layout_tests import port
+from webkitpy.layout_tests.layout_package.test_expectations import *
+
+class FunctionsTest(unittest.TestCase):
+ def test_result_was_expected(self):
+ # test basics
+ self.assertEquals(result_was_expected(PASS, set([PASS]),
+ False, False), True)
+ self.assertEquals(result_was_expected(TEXT, set([PASS]),
+ False, False), False)
+
+ # test handling of FAIL expectations
+ self.assertEquals(result_was_expected(IMAGE_PLUS_TEXT, set([FAIL]),
+ False, False), True)
+ self.assertEquals(result_was_expected(IMAGE, set([FAIL]),
+ False, False), True)
+ self.assertEquals(result_was_expected(TEXT, set([FAIL]),
+ False, False), True)
+ self.assertEquals(result_was_expected(CRASH, set([FAIL]),
+ False, False), False)
+
+ # test handling of SKIPped tests and results
+ self.assertEquals(result_was_expected(SKIP, set([CRASH]),
+ False, True), True)
+ self.assertEquals(result_was_expected(SKIP, set([CRASH]),
+ False, False), False)
+
+ # test handling of MISSING results and the REBASELINE modifier
+ self.assertEquals(result_was_expected(MISSING, set([PASS]),
+ True, False), True)
+ self.assertEquals(result_was_expected(MISSING, set([PASS]),
+ False, False), False)
+
+ def test_remove_pixel_failures(self):
+ self.assertEquals(remove_pixel_failures(set([TEXT])),
+ set([TEXT]))
+ self.assertEquals(remove_pixel_failures(set([PASS])),
+ set([PASS]))
+ self.assertEquals(remove_pixel_failures(set([IMAGE])),
+ set([PASS]))
+ self.assertEquals(remove_pixel_failures(set([IMAGE_PLUS_TEXT])),
+ set([TEXT]))
+ self.assertEquals(remove_pixel_failures(set([PASS, IMAGE, CRASH])),
+ set([PASS, CRASH]))
+
+
+class Base(unittest.TestCase):
+ def __init__(self, testFunc, setUp=None, tearDown=None, description=None):
+ self._port = port.get('test', None)
+ self._exp = None
+ unittest.TestCase.__init__(self, testFunc)
+
+ def get_test(self, test_name):
+ return os.path.join(self._port.layout_tests_dir(), test_name)
+
+ def get_basic_tests(self):
+ return [self.get_test('failures/expected/text.html'),
+ self.get_test('failures/expected/image_checksum.html'),
+ self.get_test('failures/expected/crash.html'),
+ self.get_test('failures/expected/missing_text.html'),
+ self.get_test('failures/expected/image.html'),
+ self.get_test('passes/text.html')]
+
+ def get_basic_expectations(self):
+ return """
+BUG_TEST : failures/expected/text.html = TEXT
+BUG_TEST WONTFIX SKIP : failures/expected/crash.html = CRASH
+BUG_TEST REBASELINE : failures/expected/missing_image.html = MISSING
+BUG_TEST WONTFIX : failures/expected/image_checksum.html = IMAGE
+BUG_TEST WONTFIX WIN : failures/expected/image.html = IMAGE
+"""
+
+ def parse_exp(self, expectations, overrides=None, is_lint_mode=False,
+ is_debug_mode=False):
+ self._exp = TestExpectations(self._port,
+ tests=self.get_basic_tests(),
+ expectations=expectations,
+ test_platform_name=self._port.test_platform_name(),
+ is_debug_mode=is_debug_mode,
+ is_lint_mode=is_lint_mode,
+ overrides=overrides)
+
+ def assert_exp(self, test, result):
+ self.assertEquals(self._exp.get_expectations(self.get_test(test)),
+ set([result]))
+
+
+class TestExpectationsTest(Base):
+ def test_basic(self):
+ self.parse_exp(self.get_basic_expectations())
+ self.assert_exp('failures/expected/text.html', TEXT)
+ self.assert_exp('failures/expected/image_checksum.html', IMAGE)
+ self.assert_exp('passes/text.html', PASS)
+ self.assert_exp('failures/expected/image.html', PASS)
+
+ def test_multiple_results(self):
+ self.parse_exp('BUGX : failures/expected/text.html = TEXT CRASH')
+ self.assertEqual(self._exp.get_expectations(
+ self.get_test('failures/expected/text.html')),
+ set([TEXT, CRASH]))
+
+ def test_precedence(self):
+ # This tests handling precedence of specific lines over directories
+ # and tests expectations covering entire directories.
+ exp_str = """
+BUGX : failures/expected/text.html = TEXT
+BUGX WONTFIX : failures/expected = IMAGE
+"""
+ self.parse_exp(exp_str)
+ self.assert_exp('failures/expected/text.html', TEXT)
+ self.assert_exp('failures/expected/crash.html', IMAGE)
+
+ def test_release_mode(self):
+ self.parse_exp('BUGX DEBUG : failures/expected/text.html = TEXT',
+ is_debug_mode=True)
+ self.assert_exp('failures/expected/text.html', TEXT)
+ self.parse_exp('BUGX RELEASE : failures/expected/text.html = TEXT',
+ is_debug_mode=True)
+ self.assert_exp('failures/expected/text.html', PASS)
+ self.parse_exp('BUGX DEBUG : failures/expected/text.html = TEXT',
+ is_debug_mode=False)
+ self.assert_exp('failures/expected/text.html', PASS)
+ self.parse_exp('BUGX RELEASE : failures/expected/text.html = TEXT',
+ is_debug_mode=False)
+ self.assert_exp('failures/expected/text.html', TEXT)
+
+ def test_get_options(self):
+ self.parse_exp(self.get_basic_expectations())
+ self.assertEqual(self._exp.get_options(
+ self.get_test('passes/text.html')), [])
+
+ def test_expectations_json_for_all_platforms(self):
+ self.parse_exp(self.get_basic_expectations())
+ json_str = self._exp.get_expectations_json_for_all_platforms()
+ # FIXME: test actual content?
+ self.assertTrue(json_str)
+
+ def test_get_expectations_string(self):
+ self.parse_exp(self.get_basic_expectations())
+ self.assertEquals(self._exp.get_expectations_string(
+ self.get_test('failures/expected/text.html')),
+ 'TEXT')
+
+ def test_expectation_to_string(self):
+ # Normal cases are handled by other tests.
+ self.parse_exp(self.get_basic_expectations())
+ self.assertRaises(ValueError, self._exp.expectation_to_string,
+ -1)
+
+ def test_get_test_set(self):
+ # Handle some corner cases for this routine not covered by other tests.
+ self.parse_exp(self.get_basic_expectations())
+ s = self._exp._expected_failures.get_test_set(WONTFIX)
+ self.assertEqual(s,
+ set([self.get_test('failures/expected/crash.html'),
+ self.get_test('failures/expected/image_checksum.html')]))
+ s = self._exp._expected_failures.get_test_set(WONTFIX, CRASH)
+ self.assertEqual(s,
+ set([self.get_test('failures/expected/crash.html')]))
+ s = self._exp._expected_failures.get_test_set(WONTFIX, CRASH,
+ include_skips=False)
+ self.assertEqual(s, set([]))
+
+ def test_syntax_missing_expectation(self):
+ # This is missing the expectation.
+ self.assertRaises(SyntaxError, self.parse_exp,
+ 'BUG_TEST: failures/expected/text.html',
+ is_debug_mode=True)
+
+ def test_syntax_invalid_option(self):
+ self.assertRaises(SyntaxError, self.parse_exp,
+ 'BUG_TEST FOO: failures/expected/text.html = PASS')
+
+ def test_syntax_invalid_expectation(self):
+ # This is missing the expectation.
+ self.assertRaises(SyntaxError, self.parse_exp,
+ 'BUG_TEST: failures/expected/text.html = FOO')
+
+ def test_syntax_missing_bugid(self):
+ # This should log a non-fatal error.
+ self.parse_exp('SLOW : failures/expected/text.html = TEXT')
+ self.assertEqual(
+ len(self._exp._expected_failures.get_non_fatal_errors()), 1)
+
+ def test_semantic_slow_and_timeout(self):
+ # A test cannot be SLOW and expected to TIMEOUT.
+ self.assertRaises(SyntaxError, self.parse_exp,
+ 'BUG_TEST SLOW : failures/expected/timeout.html = TIMEOUT')
+
+ def test_semantic_rebaseline(self):
+ # Can't lint a file w/ 'REBASELINE' in it.
+ self.assertRaises(SyntaxError, self.parse_exp,
+ 'BUG_TEST REBASELINE : failures/expected/text.html = TEXT',
+ is_lint_mode=True)
+
+ def test_semantic_duplicates(self):
+ self.assertRaises(SyntaxError, self.parse_exp, """
+BUG_TEST : failures/expected/text.html = TEXT
+BUG_TEST : failures/expected/text.html = IMAGE""")
+
+ self.assertRaises(SyntaxError, self.parse_exp,
+ self.get_basic_expectations(), """
+BUG_TEST : failures/expected/text.html = TEXT
+BUG_TEST : failures/expected/text.html = IMAGE""")
+
+ def test_semantic_missing_file(self):
+ # This should log a non-fatal error.
+ self.parse_exp('BUG_TEST : missing_file.html = TEXT')
+ self.assertEqual(
+ len(self._exp._expected_failures.get_non_fatal_errors()), 1)
+
+
+ def test_overrides(self):
+ self.parse_exp(self.get_basic_expectations(), """
+BUG_OVERRIDE : failures/expected/text.html = IMAGE""")
+ self.assert_exp('failures/expected/text.html', IMAGE)
+
+ def test_matches_an_expected_result(self):
+
+ def match(test, result, pixel_tests_enabled):
+ return self._exp.matches_an_expected_result(
+ self.get_test(test), result, pixel_tests_enabled)
+
+ self.parse_exp(self.get_basic_expectations())
+ self.assertTrue(match('failures/expected/text.html', TEXT, True))
+ self.assertTrue(match('failures/expected/text.html', TEXT, False))
+ self.assertFalse(match('failures/expected/text.html', CRASH, True))
+ self.assertFalse(match('failures/expected/text.html', CRASH, False))
+ self.assertTrue(match('failures/expected/image_checksum.html', IMAGE,
+ True))
+ self.assertTrue(match('failures/expected/image_checksum.html', PASS,
+ False))
+ self.assertTrue(match('failures/expected/crash.html', SKIP, False))
+ self.assertTrue(match('passes/text.html', PASS, False))
+
+
+class RebaseliningTest(Base):
+ """Test rebaselining-specific functionality."""
+ def assertRemove(self, platform, input_expectations, expected_expectations):
+ self.parse_exp(input_expectations)
+ test = self.get_test('failures/expected/text.html')
+ actual_expectations = self._exp.remove_platform_from_expectations(
+ test, platform)
+ self.assertEqual(expected_expectations, actual_expectations)
+
+ def test_no_get_rebaselining_failures(self):
+ self.parse_exp(self.get_basic_expectations())
+ self.assertEqual(len(self._exp.get_rebaselining_failures()), 0)
+
+ def test_get_rebaselining_failures_expand(self):
+ self.parse_exp("""
+BUG_TEST REBASELINE : failures/expected/text.html = TEXT
+""")
+ self.assertEqual(len(self._exp.get_rebaselining_failures()), 1)
+
+ def test_remove_expand(self):
+ self.assertRemove('mac',
+ 'BUGX REBASELINE : failures/expected/text.html = TEXT\n',
+ 'BUGX REBASELINE WIN : failures/expected/text.html = TEXT\n')
+
+ def test_remove_mac_win(self):
+ self.assertRemove('mac',
+ 'BUGX REBASELINE MAC WIN : failures/expected/text.html = TEXT\n',
+ 'BUGX REBASELINE WIN : failures/expected/text.html = TEXT\n')
+
+ def test_remove_mac_mac(self):
+ self.assertRemove('mac',
+ 'BUGX REBASELINE MAC : failures/expected/text.html = TEXT\n',
+ '')
+
+ def test_remove_nothing(self):
+ self.assertRemove('mac',
+ '\n\n',
+ '\n\n')
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
index 56d7b5a..6d55761 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures.py
@@ -32,6 +32,8 @@
import os
import test_expectations
+import cPickle
+
def determine_result_type(failure_list):
"""Takes a set of test_failures and returns which result type best fits
@@ -71,16 +73,31 @@ class TestFailure(object):
"""Abstract base class that defines the failure interface."""
@staticmethod
+ def loads(s):
+ """Creates a TestFailure object from the specified string."""
+ return cPickle.loads(s)
+
+ @staticmethod
def message():
"""Returns a string describing the failure in more detail."""
- raise NotImplemented
+ raise NotImplementedError
+
+ def __eq__(self, other):
+ return self.__class__.__name__ == other.__class__.__name__
+
+ def __ne__(self, other):
+ return self.__class__.__name__ != other.__class__.__name__
+
+ def dumps(self):
+ """Returns the string/JSON representation of a TestFailure."""
+ return cPickle.dumps(self)
def result_html_output(self, filename):
"""Returns an HTML string to be included on the results.html page."""
- raise NotImplemented
+ raise NotImplementedError
- def should_kill_test_shell(self):
- """Returns True if we should kill the test shell before the next
+ def should_kill_dump_render_tree(self):
+ """Returns True if we should kill DumpRenderTree before the next
test."""
return False
@@ -108,13 +125,11 @@ class FailureWithType(TestFailure):
use the standard OutputLinks.
"""
- def __init__(self, test_type):
+ def __init__(self):
TestFailure.__init__(self)
- # TODO(ojan): This class no longer needs to know the test_type.
- self._test_type = test_type
# Filename suffixes used by ResultHtmlOutput.
- OUT_FILENAMES = []
+ OUT_FILENAMES = ()
def output_links(self, filename, out_names):
"""Returns a string holding all applicable output file links.
@@ -127,6 +142,13 @@ class FailureWithType(TestFailure):
single item is the [actual] filename suffix.
If out_names is empty, returns the empty string.
"""
+ # FIXME: Seems like a bad idea to separate the display name data
+ # from the path data by hard-coding the display name here
+ # and passing in the path information via out_names.
+ #
+ # FIXME: Also, we don't know for sure that these files exist,
+ # and we shouldn't be creating links to files that don't exist
+ # (for example, if we don't actually have wdiff output).
links = ['']
uris = [self.relative_output_filename(filename, fn) for
fn in out_names]
@@ -138,6 +160,8 @@ class FailureWithType(TestFailure):
links.append("<a href='%s'>diff</a>" % uris[2])
if len(uris) > 3:
links.append("<a href='%s'>wdiff</a>" % uris[3])
+ if len(uris) > 4:
+ links.append("<a href='%s'>pretty diff</a>" % uris[4])
return ' '.join(links)
def result_html_output(self, filename):
@@ -145,7 +169,7 @@ class FailureWithType(TestFailure):
class FailureTimeout(TestFailure):
- """Test timed out. We also want to restart the test shell if this
+ """Test timed out. We also want to restart DumpRenderTree if this
happens."""
@staticmethod
@@ -155,7 +179,7 @@ class FailureTimeout(TestFailure):
def result_html_output(self, filename):
return "<strong>%s</strong>" % self.message()
- def should_kill_test_shell(self):
+ def should_kill_dump_render_tree(self):
return True
@@ -167,18 +191,18 @@ class FailureCrash(TestFailure):
return "Test shell crashed"
def result_html_output(self, filename):
- # TODO(tc): create a link to the minidump file
+ # FIXME: create a link to the minidump file
stack = self.relative_output_filename(filename, "-stack.txt")
return "<strong>%s</strong> <a href=%s>stack</a>" % (self.message(),
stack)
- def should_kill_test_shell(self):
+ def should_kill_dump_render_tree(self):
return True
class FailureMissingResult(FailureWithType):
"""Expected result was missing."""
- OUT_FILENAMES = ["-actual.txt"]
+ OUT_FILENAMES = ("-actual.txt",)
@staticmethod
def message():
@@ -192,14 +216,9 @@ class FailureMissingResult(FailureWithType):
class FailureTextMismatch(FailureWithType):
"""Text diff output failed."""
# Filename suffixes used by ResultHtmlOutput.
- OUT_FILENAMES = ["-actual.txt", "-expected.txt", "-diff.txt"]
- OUT_FILENAMES_WDIFF = ["-actual.txt", "-expected.txt", "-diff.txt",
- "-wdiff.html"]
-
- def __init__(self, test_type, has_wdiff):
- FailureWithType.__init__(self, test_type)
- if has_wdiff:
- self.OUT_FILENAMES = self.OUT_FILENAMES_WDIFF
+ # FIXME: Why don't we use the constants from TestTypeBase here?
+ OUT_FILENAMES = ("-actual.txt", "-expected.txt", "-diff.txt",
+ "-wdiff.html", "-pretty-diff.html")
@staticmethod
def message():
@@ -210,7 +229,6 @@ class FailureMissingImageHash(FailureWithType):
"""Actual result hash was missing."""
# Chrome doesn't know to display a .checksum file as text, so don't bother
# putting in a link to the actual result.
- OUT_FILENAMES = []
@staticmethod
def message():
@@ -222,7 +240,7 @@ class FailureMissingImageHash(FailureWithType):
class FailureMissingImage(FailureWithType):
"""Actual result image was missing."""
- OUT_FILENAMES = ["-actual.png"]
+ OUT_FILENAMES = ("-actual.png",)
@staticmethod
def message():
@@ -235,7 +253,7 @@ class FailureMissingImage(FailureWithType):
class FailureImageHashMismatch(FailureWithType):
"""Image hashes didn't match."""
- OUT_FILENAMES = ["-actual.png", "-expected.png", "-diff.png"]
+ OUT_FILENAMES = ("-actual.png", "-expected.png", "-diff.png")
@staticmethod
def message():
@@ -244,20 +262,10 @@ class FailureImageHashMismatch(FailureWithType):
return "Image mismatch"
-class FailureFuzzyFailure(FailureWithType):
- """Image hashes didn't match."""
- OUT_FILENAMES = ["-actual.png", "-expected.png"]
-
- @staticmethod
- def message():
- return "Fuzzy image match also failed"
-
-
class FailureImageHashIncorrect(FailureWithType):
"""Actual result hash is incorrect."""
# Chrome doesn't know to display a .checksum file as text, so don't bother
# putting in a link to the actual result.
- OUT_FILENAMES = []
@staticmethod
def message():
@@ -265,3 +273,10 @@ class FailureImageHashIncorrect(FailureWithType):
def result_html_output(self, filename):
return "<strong>%s</strong>" % self.message()
+
+# Convenient collection of all failure classes for anything that might
+# need to enumerate over them all.
+ALL_FAILURE_CLASSES = (FailureTimeout, FailureCrash, FailureMissingResult,
+ FailureTextMismatch, FailureMissingImageHash,
+ FailureMissingImage, FailureImageHashMismatch,
+ FailureImageHashIncorrect)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
new file mode 100644
index 0000000..3e3528d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_failures_unittest.py
@@ -0,0 +1,84 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+""""Tests code paths not covered by the regular unit tests."""
+
+import unittest
+
+from webkitpy.layout_tests.layout_package.test_failures import *
+
+
+class Test(unittest.TestCase):
+ def assertResultHtml(self, failure_obj):
+ self.assertNotEqual(failure_obj.result_html_output('foo'), None)
+
+ def assert_loads(self, cls):
+ failure_obj = cls()
+ s = failure_obj.dumps()
+ new_failure_obj = TestFailure.loads(s)
+ self.assertTrue(isinstance(new_failure_obj, cls))
+
+ self.assertEqual(failure_obj, new_failure_obj)
+
+ # Also test that != is implemented.
+ self.assertFalse(failure_obj != new_failure_obj)
+
+ def test_crash(self):
+ self.assertResultHtml(FailureCrash())
+
+ def test_hash_incorrect(self):
+ self.assertResultHtml(FailureImageHashIncorrect())
+
+ def test_missing(self):
+ self.assertResultHtml(FailureMissingResult())
+
+ def test_missing_image(self):
+ self.assertResultHtml(FailureMissingImage())
+
+ def test_missing_image_hash(self):
+ self.assertResultHtml(FailureMissingImageHash())
+
+ def test_timeout(self):
+ self.assertResultHtml(FailureTimeout())
+
+ def test_unknown_failure_type(self):
+ class UnknownFailure(TestFailure):
+ pass
+
+ failure_obj = UnknownFailure()
+ self.assertRaises(ValueError, determine_result_type, [failure_obj])
+ self.assertRaises(NotImplementedError, failure_obj.message)
+ self.assertRaises(NotImplementedError, failure_obj.result_html_output,
+ "foo.txt")
+
+ def test_loads(self):
+ for c in ALL_FAILURE_CLASSES:
+ self.assert_loads(c)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_output.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_output.py
new file mode 100644
index 0000000..e809be6
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_output.py
@@ -0,0 +1,56 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+class TestOutput(object):
+ """Groups information about a test output for easy passing of data.
+
+ This is used not only for a actual test output, but also for grouping
+ expected test output.
+ """
+
+ def __init__(self, text, image, image_hash,
+ crash=None, test_time=None, timeout=None, error=None):
+ """Initializes a TestOutput object.
+
+ Args:
+ text: a text output
+ image: an image output
+ image_hash: a string containing the checksum of the image
+ crash: a boolean indicating whether the driver crashed on the test
+ test_time: a time which the test has taken
+ timeout: a boolean indicating whehter the test timed out
+ error: any unexpected or additional (or error) text output
+ """
+ self.text = text
+ self.image = image
+ self.image_hash = image_hash
+ self.crash = crash
+ self.test_time = test_time
+ self.timeout = timeout
+ self.error = error
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
new file mode 100644
index 0000000..2417fb7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results.py
@@ -0,0 +1,61 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import cPickle
+
+import test_failures
+
+
+class TestResult(object):
+ """Data object containing the results of a single test."""
+
+ @staticmethod
+ def loads(str):
+ return cPickle.loads(str)
+
+ def __init__(self, filename, failures, test_run_time,
+ total_time_for_all_diffs, time_for_diffs):
+ self.failures = failures
+ self.filename = filename
+ self.test_run_time = test_run_time
+ self.time_for_diffs = time_for_diffs
+ self.total_time_for_all_diffs = total_time_for_all_diffs
+ self.type = test_failures.determine_result_type(failures)
+
+ def __eq__(self, other):
+ return (self.filename == other.filename and
+ self.failures == other.failures and
+ self.test_run_time == other.test_run_time and
+ self.time_for_diffs == other.time_for_diffs and
+ self.total_time_for_all_diffs == other.total_time_for_all_diffs)
+
+ def __ne__(self, other):
+ return not (self == other)
+
+ def dumps(self):
+ return cPickle.dumps(self)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
new file mode 100644
index 0000000..5921666
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_unittest.py
@@ -0,0 +1,52 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from test_results import TestResult
+
+
+class Test(unittest.TestCase):
+ def test_loads(self):
+ result = TestResult(filename='foo',
+ failures=[],
+ test_run_time=1.1,
+ total_time_for_all_diffs=0.5,
+ time_for_diffs=0.5)
+ s = result.dumps()
+ new_result = TestResult.loads(s)
+ self.assertTrue(isinstance(new_result, TestResult))
+
+ self.assertEqual(new_result, result)
+
+ # Also check that != is implemented.
+ self.assertFalse(new_result != result)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_uploader.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_uploader.py
new file mode 100644
index 0000000..680b848
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_results_uploader.py
@@ -0,0 +1,71 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import mimetypes
+import socket
+
+from webkitpy.common.net.networktransaction import NetworkTransaction
+from webkitpy.thirdparty.autoinstalled.mechanize import Browser
+
+
+def get_mime_type(filename):
+ return mimetypes.guess_type(filename)[0] or "text/plain"
+
+
+class TestResultsUploader:
+ def __init__(self, host):
+ self._host = host
+ self._browser = Browser()
+
+ def _upload_files(self, attrs, file_objs):
+ self._browser.open("http://%s/testfile/uploadform" % self._host)
+ self._browser.select_form("test_result_upload")
+ for (name, data) in attrs:
+ self._browser[name] = str(data)
+
+ for (filename, handle) in file_objs:
+ self._browser.add_file(handle, get_mime_type(filename), filename,
+ "file")
+
+ self._browser.submit()
+
+ def upload(self, params, files, timeout_seconds):
+ orig_timeout = socket.getdefaulttimeout()
+ file_objs = []
+ try:
+ file_objs = [(filename, open(path, "rb")) for (filename, path)
+ in files]
+
+ socket.setdefaulttimeout(timeout_seconds)
+ NetworkTransaction(timeout_seconds=timeout_seconds).run(
+ lambda: self._upload_files(params, file_objs))
+ finally:
+ socket.setdefaulttimeout(orig_timeout)
+ for (filename, handle) in file_objs:
+ handle.close()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py b/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py
deleted file mode 100644
index 3452035..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_shell_thread.py
+++ /dev/null
@@ -1,440 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""A Thread object for running the test shell and processing URLs from a
-shared queue.
-
-Each thread runs a separate instance of the test_shell binary and validates
-the output. When there are no more URLs to process in the shared queue, the
-thread exits.
-"""
-
-import copy
-import logging
-import os
-import Queue
-import signal
-import sys
-import thread
-import threading
-import time
-
-import test_failures
-
-
-def process_output(port, test_info, test_types, test_args, target, output_dir,
- crash, timeout, test_run_time, actual_checksum,
- output, error):
- """Receives the output from a test_shell process, subjects it to a number
- of tests, and returns a list of failure types the test produced.
-
- Args:
- port: port-specific hooks
- proc: an active test_shell process
- test_info: Object containing the test filename, uri and timeout
- test_types: list of test types to subject the output to
- test_args: arguments to be passed to each test
- target: Debug or Release
- output_dir: directory to put crash stack traces into
-
- Returns: a list of failure objects and times for the test being processed
- """
- failures = []
-
- # Some test args, such as the image hash, may be added or changed on a
- # test-by-test basis.
- local_test_args = copy.copy(test_args)
-
- local_test_args.hash = actual_checksum
-
- if crash:
- failures.append(test_failures.FailureCrash())
- if timeout:
- failures.append(test_failures.FailureTimeout())
-
- if crash:
- logging.debug("Stacktrace for %s:\n%s" % (test_info.filename, error))
- # Strip off "file://" since RelativeTestFilename expects
- # filesystem paths.
- filename = os.path.join(output_dir, test_info.filename)
- filename = os.path.splitext(filename)[0] + "-stack.txt"
- port.maybe_make_directory(os.path.split(filename)[0])
- open(filename, "wb").write(error)
- elif error:
- logging.debug("Previous test output extra lines after dump:\n%s" %
- error)
-
- # Check the output and save the results.
- start_time = time.time()
- time_for_diffs = {}
- for test_type in test_types:
- start_diff_time = time.time()
- new_failures = test_type.compare_output(port, test_info.filename,
- output, local_test_args,
- target)
- # Don't add any more failures if we already have a crash, so we don't
- # double-report those tests. We do double-report for timeouts since
- # we still want to see the text and image output.
- if not crash:
- failures.extend(new_failures)
- time_for_diffs[test_type.__class__.__name__] = (
- time.time() - start_diff_time)
-
- total_time_for_all_diffs = time.time() - start_diff_time
- return TestStats(test_info.filename, failures, test_run_time,
- total_time_for_all_diffs, time_for_diffs)
-
-
-class TestStats:
-
- def __init__(self, filename, failures, test_run_time,
- total_time_for_all_diffs, time_for_diffs):
- self.filename = filename
- self.failures = failures
- self.test_run_time = test_run_time
- self.total_time_for_all_diffs = total_time_for_all_diffs
- self.time_for_diffs = time_for_diffs
-
-
-class SingleTestThread(threading.Thread):
- """Thread wrapper for running a single test file."""
-
- def __init__(self, port, image_path, shell_args, test_info,
- test_types, test_args, target, output_dir):
- """
- Args:
- port: object implementing port-specific hooks
- test_info: Object containing the test filename, uri and timeout
- output_dir: Directory to put crash stacks into.
- See TestShellThread for documentation of the remaining arguments.
- """
-
- threading.Thread.__init__(self)
- self._port = port
- self._image_path = image_path
- self._shell_args = shell_args
- self._test_info = test_info
- self._test_types = test_types
- self._test_args = test_args
- self._target = target
- self._output_dir = output_dir
-
- def run(self):
- driver = self._port.start_test_driver(self._image_path,
- self._shell_args)
- start = time.time()
- crash, timeout, actual_checksum, output, error = \
- driver.run_test(test_info.uri.strip(), test_info.timeout,
- test_info.image_hash)
- end = time.time()
- self._test_stats = process_output(self._port,
- self._test_info, self._test_types, self._test_args,
- self._target, self._output_dir, crash, timeout, end - start,
- actual_checksum, output, error)
- driver.stop()
-
- def get_test_stats(self):
- return self._test_stats
-
-
-class TestShellThread(threading.Thread):
-
- def __init__(self, port, filename_list_queue, result_queue,
- test_types, test_args, image_path, shell_args, options):
- """Initialize all the local state for this test shell thread.
-
- Args:
- port: interface to port-specific hooks
- filename_list_queue: A thread safe Queue class that contains lists
- of tuples of (filename, uri) pairs.
- result_queue: A thread safe Queue class that will contain tuples of
- (test, failure lists) for the test results.
- test_types: A list of TestType objects to run the test output
- against.
- test_args: A TestArguments object to pass to each TestType.
- shell_args: Any extra arguments to be passed to test_shell.exe.
- options: A property dictionary as produced by optparse. The
- command-line options should match those expected by
- run_webkit_tests; they are typically passed via the
- run_webkit_tests.TestRunner class."""
- threading.Thread.__init__(self)
- self._port = port
- self._filename_list_queue = filename_list_queue
- self._result_queue = result_queue
- self._filename_list = []
- self._test_types = test_types
- self._test_args = test_args
- self._driver = None
- self._image_path = image_path
- self._shell_args = shell_args
- self._options = options
- self._canceled = False
- self._exception_info = None
- self._directory_timing_stats = {}
- self._test_stats = []
- self._num_tests = 0
- self._start_time = 0
- self._stop_time = 0
-
- # Current directory of tests we're running.
- self._current_dir = None
- # Number of tests in self._current_dir.
- self._num_tests_in_current_dir = None
- # Time at which we started running tests from self._current_dir.
- self._current_dir_start_time = None
-
- def get_directory_timing_stats(self):
- """Returns a dictionary mapping test directory to a tuple of
- (number of tests in that directory, time to run the tests)"""
- return self._directory_timing_stats
-
- def get_individual_test_stats(self):
- """Returns a list of (test_filename, time_to_run_test,
- total_time_for_all_diffs, time_for_diffs) tuples."""
- return self._test_stats
-
- def cancel(self):
- """Set a flag telling this thread to quit."""
- self._canceled = True
-
- def get_exception_info(self):
- """If run() terminated on an uncaught exception, return it here
- ((type, value, traceback) tuple).
- Returns None if run() terminated normally. Meant to be called after
- joining this thread."""
- return self._exception_info
-
- def get_total_time(self):
- return max(self._stop_time - self._start_time, 0.0)
-
- def get_num_tests(self):
- return self._num_tests
-
- def run(self):
- """Delegate main work to a helper method and watch for uncaught
- exceptions."""
- self._start_time = time.time()
- self._num_tests = 0
- try:
- logging.debug('%s starting' % (self.getName()))
- self._run(test_runner=None, result_summary=None)
- logging.debug('%s done (%d tests)' % (self.getName(),
- self.get_num_tests()))
- except:
- # Save the exception for our caller to see.
- self._exception_info = sys.exc_info()
- self._stop_time = time.time()
- # Re-raise it and die.
- logging.error('%s dying: %s' % (self.getName(),
- self._exception_info))
- raise
- self._stop_time = time.time()
-
- def run_in_main_thread(self, test_runner, result_summary):
- """This hook allows us to run the tests from the main thread if
- --num-test-shells==1, instead of having to always run two or more
- threads. This allows us to debug the test harness without having to
- do multi-threaded debugging."""
- self._run(test_runner, result_summary)
-
- def _run(self, test_runner, result_summary):
- """Main work entry point of the thread. Basically we pull urls from the
- filename queue and run the tests until we run out of urls.
-
- If test_runner is not None, then we call test_runner.UpdateSummary()
- with the results of each test."""
- batch_size = 0
- batch_count = 0
- if self._options.batch_size:
- try:
- batch_size = int(self._options.batch_size)
- except:
- logging.info("Ignoring invalid batch size '%s'" %
- self._options.batch_size)
-
- # Append tests we're running to the existing tests_run.txt file.
- # This is created in run_webkit_tests.py:_PrepareListsAndPrintOutput.
- tests_run_filename = os.path.join(self._options.results_directory,
- "tests_run.txt")
- tests_run_file = open(tests_run_filename, "a")
-
- while True:
- if self._canceled:
- logging.info('Testing canceled')
- tests_run_file.close()
- return
-
- if len(self._filename_list) is 0:
- if self._current_dir is not None:
- self._directory_timing_stats[self._current_dir] = \
- (self._num_tests_in_current_dir,
- time.time() - self._current_dir_start_time)
-
- try:
- self._current_dir, self._filename_list = \
- self._filename_list_queue.get_nowait()
- except Queue.Empty:
- self._kill_test_shell()
- tests_run_file.close()
- return
-
- self._num_tests_in_current_dir = len(self._filename_list)
- self._current_dir_start_time = time.time()
-
- test_info = self._filename_list.pop()
-
- # We have a url, run tests.
- batch_count += 1
- self._num_tests += 1
- if self._options.run_singly:
- failures = self._run_test_singly(test_info)
- else:
- failures = self._run_test(test_info)
-
- filename = test_info.filename
- tests_run_file.write(filename + "\n")
- if failures:
- # Check and kill test shell if we need too.
- if len([1 for f in failures if f.should_kill_test_shell()]):
- self._kill_test_shell()
- # Reset the batch count since the shell just bounced.
- batch_count = 0
- # Print the error message(s).
- error_str = '\n'.join([' ' + f.message() for f in failures])
- logging.debug("%s %s failed:\n%s" % (self.getName(),
- self._port.relative_test_filename(filename),
- error_str))
- else:
- logging.debug("%s %s passed" % (self.getName(),
- self._port.relative_test_filename(filename)))
- self._result_queue.put((filename, failures))
-
- if batch_size > 0 and batch_count > batch_size:
- # Bounce the shell and reset count.
- self._kill_test_shell()
- batch_count = 0
-
- if test_runner:
- test_runner.update_summary(result_summary)
-
- def _run_test_singly(self, test_info):
- """Run a test in a separate thread, enforcing a hard time limit.
-
- Since we can only detect the termination of a thread, not any internal
- state or progress, we can only run per-test timeouts when running test
- files singly.
-
- Args:
- test_info: Object containing the test filename, uri and timeout
-
- Return:
- A list of TestFailure objects describing the error.
- """
- worker = SingleTestThread(self._port, self._image_path,
- self._shell_args,
- test_info,
- self._test_types,
- self._test_args,
- self._options.target,
- self._options.results_directory)
-
- worker.start()
-
- # When we're running one test per test_shell process, we can enforce
- # a hard timeout. the test_shell watchdog uses 2.5x the timeout
- # We want to be larger than that.
- worker.join(int(test_info.timeout) * 3.0 / 1000.0)
- if worker.isAlive():
- # If join() returned with the thread still running, the
- # test_shell.exe is completely hung and there's nothing
- # more we can do with it. We have to kill all the
- # test_shells to free it up. If we're running more than
- # one test_shell thread, we'll end up killing the other
- # test_shells too, introducing spurious crashes. We accept that
- # tradeoff in order to avoid losing the rest of this thread's
- # results.
- logging.error('Test thread hung: killing all test_shells')
- worker._driver.stop()
-
- try:
- stats = worker.get_test_stats()
- self._test_stats.append(stats)
- failures = stats.failures
- except AttributeError, e:
- failures = []
- logging.error('Cannot get results of test: %s' %
- test_info.filename)
-
- return failures
-
- def _run_test(self, test_info):
- """Run a single test file using a shared test_shell process.
-
- Args:
- test_info: Object containing the test filename, uri and timeout
-
- Return:
- A list of TestFailure objects describing the error.
- """
- self._ensure_test_shell_is_running()
- # The pixel_hash is used to avoid doing an image dump if the
- # checksums match, so it should be set to a blank value if we
- # are generating a new baseline. (Otherwise, an image from a
- # previous run will be copied into the baseline.)
- image_hash = test_info.image_hash
- if image_hash and self._test_args.new_baseline:
- image_hash = ""
- start = time.time()
- crash, timeout, actual_checksum, output, error = \
- self._driver.run_test(test_info.uri, test_info.timeout, image_hash)
- end = time.time()
-
- stats = process_output(self._port, test_info, self._test_types,
- self._test_args, self._options.target,
- self._options.results_directory, crash,
- timeout, end - start, actual_checksum,
- output, error)
-
- self._test_stats.append(stats)
- return stats.failures
-
- def _ensure_test_shell_is_running(self):
- """Start the shared test shell, if it's not running. Not for use when
- running tests singly, since those each start a separate test shell in
- their own thread.
- """
- if (not self._driver or self._driver.poll() is not None):
- self._driver = self._port.start_driver(
- self._image_path, self._shell_args)
-
- def _kill_test_shell(self):
- """Kill the test shell process if it's running."""
- if self._driver:
- self._driver.stop()
- self._driver = None
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py
index 3509675..e3ad6f4 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/__init__.py
@@ -29,37 +29,4 @@
"""Port-specific entrypoints for the layout tests test infrastructure."""
-
-import sys
-
-
-def get(port_name=None, options=None):
- """Returns an object implementing the Port interface. If
- port_name is None, this routine attempts to guess at the most
- appropriate port on this platform."""
- port_to_use = port_name
- if port_to_use is None:
- if sys.platform == 'win32':
- port_to_use = 'chromium-win'
- elif sys.platform == 'linux2':
- port_to_use = 'chromium-linux'
- elif sys.platform == 'darwin':
- port_to_use = 'chromium-mac'
-
- if port_to_use == 'test':
- import test
- return test.TestPort(port_name, options)
- elif port_to_use.startswith('mac'):
- import mac
- return mac.MacPort(port_name, options)
- elif port_to_use.startswith('chromium-mac'):
- import chromium_mac
- return chromium_mac.ChromiumMacPort(port_name, options)
- elif port_to_use.startswith('chromium-linux'):
- import chromium_linux
- return chromium_linux.ChromiumLinuxPort(port_name, options)
- elif port_to_use.startswith('chromium-win'):
- import chromium_win
- return chromium_win.ChromiumWinPort(port_name, options)
-
- raise NotImplementedError('unsupported port: %s' % port_to_use)
+from factory import get
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
index 9ff3671..46617f6 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
@@ -29,6 +29,10 @@
"""A class to start/stop the apache http server used by layout tests."""
+
+from __future__ import with_statement
+
+import codecs
import logging
import optparse
import os
@@ -38,6 +42,8 @@ import sys
import http_server_base
+_log = logging.getLogger("webkitpy.layout_tests.port.apache_http_server")
+
class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
@@ -77,14 +83,15 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
error_log = self._cygwin_safe_join(output_dir, "error_log.txt")
document_root = self._cygwin_safe_join(test_dir, "http", "tests")
+ # FIXME: We shouldn't be calling a protected method of _port_obj!
executable = self._port_obj._path_to_apache()
if self._is_cygwin():
executable = self._get_cygwin_path(executable)
cmd = [executable,
- '-f', self._get_apache_config_file_path(test_dir, output_dir),
- '-C', "\'DocumentRoot %s\'" % document_root,
- '-c', "\'Alias /js-test-resources %s\'" % js_test_resources_dir,
+ '-f', "\"%s\"" % self._get_apache_config_file_path(test_dir, output_dir),
+ '-C', "\'DocumentRoot \"%s\"\'" % document_root,
+ '-c', "\'Alias /js-test-resources \"%s\"'" % js_test_resources_dir,
'-C', "\'Listen %s\'" % "127.0.0.1:8000",
'-C', "\'Listen %s\'" % "127.0.0.1:8081",
'-c', "\'TypesConfig \"%s\"\'" % mime_types_path,
@@ -148,7 +155,9 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
"""
httpd_config = self._port_obj._path_to_apache_config_file()
httpd_config_copy = os.path.join(output_dir, "httpd.conf")
- httpd_conf = open(httpd_config).read()
+ # httpd.conf is always utf-8 according to http://archive.apache.org/gnats/10125
+ with codecs.open(httpd_config, "r", "utf-8") as httpd_config_file:
+ httpd_conf = httpd_config_file.read()
if self._is_cygwin():
# This is a gross hack, but it lets us use the upstream .conf file
# and our checked in cygwin. This tells the server the root
@@ -161,9 +170,8 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
httpd_conf = httpd_conf.replace('ServerRoot "/usr"',
'ServerRoot "%s"' % self._get_cygwin_path(cygusr))
- f = open(httpd_config_copy, 'wb')
- f.write(httpd_conf)
- f.close()
+ with codecs.open(httpd_config_copy, "w", "utf-8") as file:
+ file.write(httpd_conf)
if self._is_cygwin():
return self._get_cygwin_path(httpd_config_copy)
@@ -174,7 +182,7 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
It will listen to 127.0.0.1 on each of the given port.
"""
return '\n'.join(('<VirtualHost 127.0.0.1:%s>' % port,
- 'DocumentRoot %s' % document_root,
+ 'DocumentRoot "%s"' % document_root,
ssl and 'SSLEngine On' or '',
'</VirtualHost>', ''))
@@ -183,12 +191,15 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
# Use shell=True because we join the arguments into a string for
# the sake of Window/Cygwin and it needs quoting that breaks
# shell=False.
+ # FIXME: We should not need to be joining shell arguments into strings.
+ # shell=True is a trail of tears.
+ # Note: Not thread safe: http://bugs.python.org/issue2320
self._httpd_proc = subprocess.Popen(self._start_cmd,
stderr=subprocess.PIPE,
shell=True)
err = self._httpd_proc.stderr.read()
if len(err):
- logging.debug(err)
+ _log.debug(err)
return False
return True
@@ -197,22 +208,23 @@ class LayoutTestApacheHttpd(http_server_base.HttpServerBase):
# Stop any currently running servers.
self.stop()
- logging.debug("Starting apache http server")
+ _log.debug("Starting apache http server")
server_started = self.wait_for_action(self._start_httpd_process)
if server_started:
- logging.debug("Apache started. Testing ports")
+ _log.debug("Apache started. Testing ports")
server_started = self.wait_for_action(
self.is_server_running_on_all_ports)
if server_started:
- logging.debug("Server successfully started")
+ _log.debug("Server successfully started")
else:
raise Exception('Failed to start http server')
def stop(self):
"""Stops the apache http server."""
- logging.debug("Shutting down any running http servers")
+ _log.debug("Shutting down any running http servers")
httpd_pid = None
if os.path.exists(self._pid_file):
httpd_pid = int(open(self._pid_file).readline())
+ # FIXME: We shouldn't be calling a protected method of _port_obj!
self._port_obj._shut_down_http_server(httpd_pid)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
index ce06b44..632806f 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
@@ -34,29 +34,98 @@ import cgi
import difflib
import errno
import os
-import subprocess
+import shlex
import sys
+import time
import apache_http_server
+import config as port_config
+import http_lock
import http_server
+import test_files
import websocket_server
-# Python bug workaround. See Port.wdiff_text() for an explanation.
-_wdiff_available = True
+from webkitpy.common import system
+from webkitpy.common.system import filesystem
+from webkitpy.common.system import logutils
+from webkitpy.common.system import path
+from webkitpy.common.system.executive import Executive, ScriptError
+from webkitpy.common.system.user import User
-# FIXME: This class should merge with webkitpy.webkit_port at some point.
-class Port(object):
- """Abstract class for Port-specific hooks for the layout_test package.
+_log = logutils.get_logger(__file__)
+
+
+class DummyOptions(object):
+ """Fake implementation of optparse.Values. Cloned from
+ webkitpy.tool.mocktool.MockOptions.
+
"""
- def __init__(self, port_name=None, options=None):
+ def __init__(self, **kwargs):
+ # The caller can set option values using keyword arguments. We don't
+ # set any values by default because we don't know how this
+ # object will be used. Generally speaking unit tests should
+ # subclass this or provider wrapper functions that set a common
+ # set of options.
+ for key, value in kwargs.items():
+ self.__dict__[key] = value
+
+
+# FIXME: This class should merge with webkitpy.webkit_port at some point.
+class Port(object):
+ """Abstract class for Port-specific hooks for the layout_test package."""
+
+ def __init__(self, port_name=None, options=None,
+ executive=None,
+ user=None,
+ filesystem=None,
+ config=None,
+ **kwargs):
self._name = port_name
self._options = options
+ if self._options is None:
+ # FIXME: Ideally we'd have a package-wide way to get a
+ # well-formed options object that had all of the necessary
+ # options defined on it.
+ self._options = DummyOptions()
+ self._executive = executive or Executive()
+ self._user = user or User()
+ self._filesystem = filesystem or system.filesystem.FileSystem()
+ self._config = config or port_config.Config(self._executive,
+ self._filesystem)
self._helper = None
self._http_server = None
self._webkit_base_dir = None
self._websocket_server = None
+ self._http_lock = None
+
+ # Python's Popen has a bug that causes any pipes opened to a
+ # process that can't be executed to be leaked. Since this
+ # code is specifically designed to tolerate exec failures
+ # to gracefully handle cases where wdiff is not installed,
+ # the bug results in a massive file descriptor leak. As a
+ # workaround, if an exec failure is ever experienced for
+ # wdiff, assume it's not available. This will leak one
+ # file descriptor but that's better than leaking each time
+ # wdiff would be run.
+ #
+ # http://mail.python.org/pipermail/python-list/
+ # 2008-August/505753.html
+ # http://bugs.python.org/issue3210
+ self._wdiff_available = True
+
+ self._pretty_patch_path = self.path_from_webkit_base("BugsSite",
+ "PrettyPatch", "prettify.rb")
+ self._pretty_patch_available = True
+ self.set_option_default('configuration', None)
+ if self._options.configuration is None:
+ self._options.configuration = self.default_configuration()
+
+ def default_child_processes(self):
+ """Return the number of DumpRenderTree instances to use for this
+ port."""
+ return self._executive.cpu_count()
def baseline_path(self):
"""Return the absolute path to the directory to store new baselines
@@ -68,60 +137,97 @@ class Port(object):
baselines. The directories are searched in order."""
raise NotImplementedError('Port.baseline_search_path')
- def check_sys_deps(self):
+ def check_build(self, needs_http):
+ """This routine is used to ensure that the build is up to date
+ and all the needed binaries are present."""
+ raise NotImplementedError('Port.check_build')
+
+ def check_sys_deps(self, needs_http):
"""If the port needs to do some runtime checks to ensure that the
- tests can be run successfully, they should be done here.
+ tests can be run successfully, it should override this routine.
+ This step can be skipped with --nocheck-sys-deps.
Returns whether the system is properly configured."""
- raise NotImplementedError('Port.check_sys_deps')
+ return True
- def compare_text(self, actual_text, expected_text):
+ def check_image_diff(self, override_step=None, logging=True):
+ """This routine is used to check whether image_diff binary exists."""
+ raise NotImplementedError('Port.check_image_diff')
+
+ def check_pretty_patch(self):
+ """Checks whether we can use the PrettyPatch ruby script."""
+
+ # check if Ruby is installed
+ try:
+ result = self._executive.run_command(['ruby', '--version'])
+ except OSError, e:
+ if e.errno in [errno.ENOENT, errno.EACCES, errno.ECHILD]:
+ _log.error("Ruby is not installed; "
+ "can't generate pretty patches.")
+ _log.error('')
+ return False
+
+ if not self.path_exists(self._pretty_patch_path):
+ _log.error('Unable to find %s .' % self._pretty_patch_path)
+ _log.error("Can't generate pretty patches.")
+ _log.error('')
+ return False
+
+ return True
+
+ def compare_text(self, expected_text, actual_text):
"""Return whether or not the two strings are *not* equal. This
routine is used to diff text output.
While this is a generic routine, we include it in the Port
interface so that it can be overriden for testing purposes."""
- return actual_text != expected_text
+ return expected_text != actual_text
- def diff_image(self, actual_filename, expected_filename, diff_filename):
- """Compare two image files and produce a delta image file.
+ def diff_image(self, expected_contents, actual_contents,
+ diff_filename=None, tolerance=0):
+ """Compare two images and produce a delta image file.
- Return 1 if the two files are different, 0 if they are the same.
+ Return True if the two images are different, False if they are the same.
Also produce a delta image of the two images and write that into
- |diff_filename|.
+ |diff_filename| if it is not None.
- While this is a generic routine, we include it in the Port
- interface so that it can be overriden for testing purposes."""
- executable = self._path_to_image_diff()
- cmd = [executable, '--diff', actual_filename, expected_filename,
- diff_filename]
- result = 1
- try:
- result = subprocess.call(cmd)
- except OSError, e:
- if e.errno == errno.ENOENT or e.errno == errno.EACCES:
- _compare_available = False
- else:
- raise e
- except ValueError:
- # work around a race condition in Python 2.4's implementation
- # of subprocess.Popen. See http://bugs.python.org/issue1199282 .
- pass
- return result
-
- def diff_text(self, actual_text, expected_text,
- actual_filename, expected_filename):
+ |tolerance| should be a percentage value (0.0 - 100.0).
+ If it is omitted, the port default tolerance value is used.
+
+ """
+ raise NotImplementedError('Port.diff_image')
+
+
+ def diff_text(self, expected_text, actual_text,
+ expected_filename, actual_filename):
"""Returns a string containing the diff of the two text strings
in 'unified diff' format.
While this is a generic routine, we include it in the Port
interface so that it can be overriden for testing purposes."""
+
+ # The filenames show up in the diff output, make sure they're
+ # raw bytes and not unicode, so that they don't trigger join()
+ # trying to decode the input.
+ def to_raw_bytes(str):
+ if isinstance(str, unicode):
+ return str.encode('utf-8')
+ return str
+ expected_filename = to_raw_bytes(expected_filename)
+ actual_filename = to_raw_bytes(actual_filename)
diff = difflib.unified_diff(expected_text.splitlines(True),
actual_text.splitlines(True),
expected_filename,
actual_filename)
return ''.join(diff)
+ def driver_name(self):
+ """Returns the name of the actual binary that is performing the test,
+ so that it can be referred to in log messages. In most cases this
+ will be DumpRenderTree, but if a port uses a binary with a different
+ name, it can be overridden here."""
+ return "DumpRenderTree"
+
def expected_baselines(self, filename, suffix, all_baselines=False):
"""Given a test name, finds where the baseline results are located.
@@ -157,7 +263,8 @@ class Port(object):
baselines = []
for platform_dir in baseline_search_path:
- if os.path.exists(os.path.join(platform_dir, baseline_filename)):
+ if self.path_exists(self._filesystem.join(platform_dir,
+ baseline_filename)):
baselines.append((platform_dir, baseline_filename))
if not all_baselines and baselines:
@@ -166,7 +273,8 @@ class Port(object):
# If it wasn't found in a platform directory, return the expected
# result in the test directory, even if no such file actually exists.
platform_dir = self.layout_tests_dir()
- if os.path.exists(os.path.join(platform_dir, baseline_filename)):
+ if self.path_exists(self._filesystem.join(platform_dir,
+ baseline_filename)):
baselines.append((platform_dir, baseline_filename))
if baselines:
@@ -196,26 +304,47 @@ class Port(object):
platform_dir, baseline_filename = self.expected_baselines(
filename, suffix)[0]
if platform_dir:
- return os.path.join(platform_dir, baseline_filename)
- return os.path.join(self.layout_tests_dir(), baseline_filename)
+ return self._filesystem.join(platform_dir, baseline_filename)
+ return self._filesystem.join(self.layout_tests_dir(), baseline_filename)
+
+ def expected_checksum(self, test):
+ """Returns the checksum of the image we expect the test to produce, or None if it is a text-only test."""
+ path = self.expected_filename(test, '.checksum')
+ if not self.path_exists(path):
+ return None
+ return self._filesystem.read_text_file(path)
+
+ def expected_image(self, test):
+ """Returns the image we expect the test to produce."""
+ path = self.expected_filename(test, '.png')
+ if not self.path_exists(path):
+ return None
+ return self._filesystem.read_binary_file(path)
+
+ def expected_text(self, test):
+ """Returns the text output we expect the test to produce."""
+ # FIXME: DRT output is actually utf-8, but since we don't decode the
+ # output from DRT (instead treating it as a binary string), we read the
+ # baselines as a binary string, too.
+ path = self.expected_filename(test, '.txt')
+ if not self.path_exists(path):
+ return ''
+ text = self._filesystem.read_binary_file(path)
+ return text.strip("\r\n").replace("\r\n", "\n") + "\n"
def filename_to_uri(self, filename):
- """Convert a test file to a URI."""
+ """Convert a test file (which is an absolute path) to a URI."""
LAYOUTTEST_HTTP_DIR = "http/tests/"
- LAYOUTTEST_WEBSOCKET_DIR = "websocket/tests/"
+ LAYOUTTEST_WEBSOCKET_DIR = "http/tests/websocket/tests/"
relative_path = self.relative_test_filename(filename)
port = None
use_ssl = False
- if relative_path.startswith(LAYOUTTEST_HTTP_DIR):
- # http/tests/ run off port 8000 and ssl/ off 8443
+ if (relative_path.startswith(LAYOUTTEST_WEBSOCKET_DIR)
+ or relative_path.startswith(LAYOUTTEST_HTTP_DIR)):
relative_path = relative_path[len(LAYOUTTEST_HTTP_DIR):]
port = 8000
- elif relative_path.startswith(LAYOUTTEST_WEBSOCKET_DIR):
- # websocket/tests/ run off port 8880 and 9323
- # Note: the root is /, not websocket/tests/
- port = 8880
# Make http/tests/local run as local files. This is to mimic the
# logic in run-webkit-tests.
@@ -230,28 +359,95 @@ class Port(object):
protocol = "http"
return "%s://127.0.0.1:%u/%s" % (protocol, port, relative_path)
- if sys.platform in ('cygwin', 'win32'):
- return "file:///" + self.get_absolute_path(filename)
- return "file://" + self.get_absolute_path(filename)
+ return path.abspath_to_uri(os.path.abspath(filename))
+
+ def tests(self, paths):
+ """Return the list of tests found (relative to layout_tests_dir()."""
+ return test_files.find(self, paths)
+
+ def test_dirs(self):
+ """Returns the list of top-level test directories.
+
+ Used by --clobber-old-results."""
+ layout_tests_dir = self.layout_tests_dir()
+ return filter(lambda x: self._filesystem.isdir(self._filesystem.join(layout_tests_dir, x)),
+ self._filesystem.listdir(layout_tests_dir))
+
+ def path_isdir(self, path):
+ """Return True if the path refers to a directory of tests."""
+ # Used by test_expectations.py to apply rules to whole directories.
+ return self._filesystem.isdir(path)
+
+ def path_exists(self, path):
+ """Return True if the path refers to an existing test or baseline."""
+ # Used by test_expectations.py to determine if an entry refers to a
+ # valid test and by printing.py to determine if baselines exist.
+ return self._filesystem.exists(path)
+
+ def update_baseline(self, path, data, encoding):
+ """Updates the baseline for a test.
+
+ Args:
+ path: the actual path to use for baseline, not the path to
+ the test. This function is used to update either generic or
+ platform-specific baselines, but we can't infer which here.
+ data: contents of the baseline.
+ encoding: file encoding to use for the baseline.
+ """
+ # FIXME: remove the encoding parameter in favor of text/binary
+ # functions.
+ if encoding is None:
+ self._filesystem.write_binary_file(path, data)
+ else:
+ self._filesystem.write_text_file(path, data)
+
+ def uri_to_test_name(self, uri):
+ """Return the base layout test name for a given URI.
+
+ This returns the test name for a given URI, e.g., if you passed in
+ "file:///src/LayoutTests/fast/html/keygen.html" it would return
+ "fast/html/keygen.html".
+
+ """
+ test = uri
+ if uri.startswith("file:///"):
+ prefix = path.abspath_to_uri(self.layout_tests_dir()) + "/"
+ return test[len(prefix):]
- def get_absolute_path(self, filename):
- """Return the absolute path in unix format for the given filename.
+ if uri.startswith("http://127.0.0.1:8880/"):
+ # websocket tests
+ return test.replace('http://127.0.0.1:8880/', '')
- This routine exists so that platforms that don't use unix filenames
- can convert accordingly."""
- return os.path.abspath(filename)
+ if uri.startswith("http://"):
+ # regular HTTP test
+ return test.replace('http://127.0.0.1:8000/', 'http/tests/')
+
+ if uri.startswith("https://"):
+ return test.replace('https://127.0.0.1:8443/', 'http/tests/')
+
+ raise NotImplementedError('unknown url type: %s' % uri)
def layout_tests_dir(self):
"""Return the absolute path to the top of the LayoutTests directory."""
return self.path_from_webkit_base('LayoutTests')
+ def skips_layout_test(self, test_name):
+ """Figures out if the givent test is being skipped or not.
+
+ Test categories are handled as well."""
+ for test_or_category in self.skipped_layout_tests():
+ if test_or_category == test_name:
+ return True
+ category = self._filesystem.join(self.layout_tests_dir(),
+ test_or_category)
+ if (self._filesystem.isdir(category) and
+ test_name.startswith(test_or_category)):
+ return True
+ return False
+
def maybe_make_directory(self, *path):
"""Creates the specified directory if it doesn't already exist."""
- try:
- os.makedirs(os.path.join(*path))
- except OSError, e:
- if e.errno != errno.EEXIST:
- raise
+ self._filesystem.maybe_make_directory(*path)
def name(self):
"""Return the name of the port (e.g., 'mac', 'chromium-win-xp').
@@ -260,128 +456,82 @@ class Port(object):
may be different (e.g., 'win-xp' instead of 'chromium-win-xp'."""
return self._name
- def num_cores(self):
- """Return the number of cores/cpus available on this machine.
+ def get_option(self, name, default_value=None):
+ # FIXME: Eventually we should not have to do a test for
+ # hasattr(), and we should be able to just do
+ # self.options.value. See additional FIXME in the constructor.
+ if hasattr(self._options, name):
+ return getattr(self._options, name)
+ return default_value
- This routine is used to determine the default amount of parallelism
- used by run-chromium-webkit-tests."""
- raise NotImplementedError('Port.num_cores')
+ def set_option_default(self, name, default_value):
+ if not hasattr(self._options, name):
+ return setattr(self._options, name, default_value)
def path_from_webkit_base(self, *comps):
"""Returns the full path to path made by joining the top of the
WebKit source tree and the list of path components in |*comps|."""
- if not self._webkit_base_dir:
- abspath = os.path.abspath(__file__)
- self._webkit_base_dir = abspath[0:abspath.find('WebKitTools')]
- return os.path.join(self._webkit_base_dir, *comps)
-
- def remove_directory(self, *path):
- """Recursively removes a directory, even if it's marked read-only.
-
- Remove the directory located at *path, if it exists.
-
- shutil.rmtree() doesn't work on Windows if any of the files
- or directories are read-only, which svn repositories and
- some .svn files are. We need to be able to force the files
- to be writable (i.e., deletable) as we traverse the tree.
-
- Even with all this, Windows still sometimes fails to delete a file,
- citing a permission error (maybe something to do with antivirus
- scans or disk indexing). The best suggestion any of the user
- forums had was to wait a bit and try again, so we do that too.
- It's hand-waving, but sometimes it works. :/
- """
- file_path = os.path.join(*path)
- if not os.path.exists(file_path):
- return
-
- win32 = False
- if sys.platform == 'win32':
- win32 = True
- # Some people don't have the APIs installed. In that case we'll do
- # without.
- try:
- win32api = __import__('win32api')
- win32con = __import__('win32con')
- except ImportError:
- win32 = False
-
- def remove_with_retry(rmfunc, path):
- os.chmod(path, stat.S_IWRITE)
- if win32:
- win32api.SetFileAttributes(path,
- win32con.FILE_ATTRIBUTE_NORMAL)
- try:
- return rmfunc(path)
- except EnvironmentError, e:
- if e.errno != errno.EACCES:
- raise
- print 'Failed to delete %s: trying again' % repr(path)
- time.sleep(0.1)
- return rmfunc(path)
- else:
-
- def remove_with_retry(rmfunc, path):
- if os.path.islink(path):
- return os.remove(path)
- else:
- return rmfunc(path)
+ return self._config.path_from_webkit_base(*comps)
- for root, dirs, files in os.walk(file_path, topdown=False):
- # For POSIX: making the directory writable guarantees
- # removability. Windows will ignore the non-read-only
- # bits in the chmod value.
- os.chmod(root, 0770)
- for name in files:
- remove_with_retry(os.remove, os.path.join(root, name))
- for name in dirs:
- remove_with_retry(os.rmdir, os.path.join(root, name))
+ def script_path(self, script_name):
+ return self._config.script_path(script_name)
- remove_with_retry(os.rmdir, file_path)
+ def path_to_test_expectations_file(self):
+ """Update the test expectations to the passed-in string.
- def test_platform_name(self):
- return self._name
+ This is used by the rebaselining tool. Raises NotImplementedError
+ if the port does not use expectations files."""
+ raise NotImplementedError('Port.path_to_test_expectations_file')
def relative_test_filename(self, filename):
"""Relative unix-style path for a filename under the LayoutTests
directory. Filenames outside the LayoutTests directory should raise
an error."""
+ #assert(filename.startswith(self.layout_tests_dir()))
return filename[len(self.layout_tests_dir()) + 1:]
def results_directory(self):
"""Absolute path to the place to store the test results."""
- raise NotImplemented('Port.results_directory')
+ raise NotImplementedError('Port.results_directory')
def setup_test_run(self):
- """This routine can be overridden to perform any port-specific
- work that shouuld be done at the beginning of a test run."""
+ """Perform port-specific work at the beginning of a test run."""
pass
- def show_html_results_file(self, results_filename):
+ def setup_environ_for_server(self):
+ """Perform port-specific work at the beginning of a server launch.
+
+ Returns:
+ Operating-system's environment.
+ """
+ return os.environ.copy()
+
+ def show_results_html_file(self, results_filename):
"""This routine should display the HTML file pointed at by
results_filename in a users' browser."""
- raise NotImplementedError('Port.show_html_results_file')
+ return self._user.open_url(results_filename)
- def start_driver(self, png_path, options):
- """Starts a new test Driver and returns a handle to the object."""
- raise NotImplementedError('Port.start_driver')
+ def create_driver(self, image_path, options):
+ """Return a newly created base.Driver subclass for starting/stopping
+ the test driver."""
+ raise NotImplementedError('Port.create_driver')
def start_helper(self):
- """Start a layout test helper if needed on this port. The test helper
- is used to reconfigure graphics settings and do other things that
- may be necessary to ensure a known test configuration."""
- raise NotImplementedError('Port.start_helper')
+ """If a port needs to reconfigure graphics settings or do other
+ things to ensure a known test configuration, it should override this
+ method."""
+ pass
def start_http_server(self):
"""Start a web server if it is available. Do nothing if
it isn't. This routine is allowed to (and may) fail if a server
is already running."""
- if self._options.use_apache:
+ if self.get_option('use_apache'):
self._http_server = apache_http_server.LayoutTestApacheHttpd(self,
- self._options.results_directory)
+ self.get_option('results_directory'))
else:
self._http_server = http_server.Lighttpd(self,
- self._options.results_directory)
+ self.get_option('results_directory'))
self._http_server.start()
def start_websocket_server(self):
@@ -389,13 +539,18 @@ class Port(object):
it isn't. This routine is allowed to (and may) fail if a server
is already running."""
self._websocket_server = websocket_server.PyWebSocket(self,
- self._options.results_directory)
+ self.get_option('results_directory'))
self._websocket_server.start()
+ def acquire_http_lock(self):
+ self._http_lock = http_lock.HttpLock(None)
+ self._http_lock.wait_for_httpd_lock()
+
def stop_helper(self):
"""Shut down the test helper if it is running. Do nothing if
- it isn't, or it isn't available."""
- raise NotImplementedError('Port.stop_helper')
+ it isn't, or it isn't available. If a port overrides start_helper()
+ it must override this routine as well."""
+ pass
def stop_http_server(self):
"""Shut down the http server if it is running. Do nothing if
@@ -409,6 +564,10 @@ class Port(object):
if self._websocket_server:
self._websocket_server.stop()
+ def release_http_lock(self):
+ if self._http_lock:
+ self._http_lock.cleanup_http_lock()
+
def test_expectations(self):
"""Returns the test expectations for this port.
@@ -416,6 +575,15 @@ class Port(object):
test_expectations file. See test_expectations.py for more details."""
raise NotImplementedError('Port.test_expectations')
+ def test_expectations_overrides(self):
+ """Returns an optional set of overrides for the test_expectations.
+
+ This is used by ports that have code in two repositories, and where
+ it is possible that you might need "downstream" expectations that
+ temporarily override the "upstream" expectations until the port can
+ sync up the two repos."""
+ return None
+
def test_base_platform_names(self):
"""Return a list of the 'base' platforms on your port. The base
platforms represent different architectures, operating systems,
@@ -444,6 +612,12 @@ class Port(object):
might return 'mac' as a test_platform name'."""
raise NotImplementedError('Port.platforms')
+ def test_platform_name_to_name(self, test_platform_name):
+ """Returns the Port platform name that corresponds to the name as
+ referenced in the expectations file. E.g., "mac" returns
+ "chromium-mac" on the Chromium ports."""
+ raise NotImplementedError('Port.test_platform_name_to_name')
+
def version(self):
"""Returns a string indicating the version of a given platform, e.g.
'-leopard' or '-xp'.
@@ -452,60 +626,97 @@ class Port(object):
expectations, determining search paths, and logging information."""
raise NotImplementedError('Port.version')
+ def test_repository_paths(self):
+ """Returns a list of (repository_name, repository_path) tuples
+ of its depending code base. By default it returns a list that only
+ contains a ('webkit', <webkitRepossitoryPath>) tuple.
+ """
+ return [('webkit', self.layout_tests_dir())]
+
+
+ _WDIFF_DEL = '##WDIFF_DEL##'
+ _WDIFF_ADD = '##WDIFF_ADD##'
+ _WDIFF_END = '##WDIFF_END##'
+
+ def _format_wdiff_output_as_html(self, wdiff):
+ wdiff = cgi.escape(wdiff)
+ wdiff = wdiff.replace(self._WDIFF_DEL, "<span class=del>")
+ wdiff = wdiff.replace(self._WDIFF_ADD, "<span class=add>")
+ wdiff = wdiff.replace(self._WDIFF_END, "</span>")
+ html = "<head><style>.del { background: #faa; } "
+ html += ".add { background: #afa; }</style></head>"
+ html += "<pre>%s</pre>" % wdiff
+ return html
+
+ def _wdiff_command(self, actual_filename, expected_filename):
+ executable = self._path_to_wdiff()
+ return [executable,
+ "--start-delete=%s" % self._WDIFF_DEL,
+ "--end-delete=%s" % self._WDIFF_END,
+ "--start-insert=%s" % self._WDIFF_ADD,
+ "--end-insert=%s" % self._WDIFF_END,
+ actual_filename,
+ expected_filename]
+
+ @staticmethod
+ def _handle_wdiff_error(script_error):
+ # Exit 1 means the files differed, any other exit code is an error.
+ if script_error.exit_code != 1:
+ raise script_error
+
+ def _run_wdiff(self, actual_filename, expected_filename):
+ """Runs wdiff and may throw exceptions.
+ This is mostly a hook for unit testing."""
+ # Diffs are treated as binary as they may include multiple files
+ # with conflicting encodings. Thus we do not decode the output.
+ command = self._wdiff_command(actual_filename, expected_filename)
+ wdiff = self._executive.run_command(command, decode_output=False,
+ error_handler=self._handle_wdiff_error)
+ return self._format_wdiff_output_as_html(wdiff)
+
def wdiff_text(self, actual_filename, expected_filename):
"""Returns a string of HTML indicating the word-level diff of the
contents of the two filenames. Returns an empty string if word-level
diffing isn't available."""
- executable = self._path_to_wdiff()
- cmd = [executable,
- '--start-delete=##WDIFF_DEL##',
- '--end-delete=##WDIFF_END##',
- '--start-insert=##WDIFF_ADD##',
- '--end-insert=##WDIFF_END##',
- expected_filename,
- actual_filename]
- global _wdiff_available
- result = ''
+ if not self._wdiff_available:
+ return ""
try:
- # Python's Popen has a bug that causes any pipes opened to a
- # process that can't be executed to be leaked. Since this
- # code is specifically designed to tolerate exec failures
- # to gracefully handle cases where wdiff is not installed,
- # the bug results in a massive file descriptor leak. As a
- # workaround, if an exec failure is ever experienced for
- # wdiff, assume it's not available. This will leak one
- # file descriptor but that's better than leaking each time
- # wdiff would be run.
- #
- # http://mail.python.org/pipermail/python-list/
- # 2008-August/505753.html
- # http://bugs.python.org/issue3210
- #
- # It also has a threading bug, so we don't output wdiff if
- # the Popen raises a ValueError.
- # http://bugs.python.org/issue1236
- if _wdiff_available:
- try:
- wdiff = subprocess.Popen(cmd,
- stdout=subprocess.PIPE).communicate()[0]
- except ValueError, e:
- # Working around a race in Python 2.4's implementation
- # of Popen().
- wdiff = ''
- wdiff = cgi.escape(wdiff)
- wdiff = wdiff.replace('##WDIFF_DEL##', '<span class=del>')
- wdiff = wdiff.replace('##WDIFF_ADD##', '<span class=add>')
- wdiff = wdiff.replace('##WDIFF_END##', '</span>')
- result = '<head><style>.del { background: #faa; } '
- result += '.add { background: #afa; }</style></head>'
- result += '<pre>' + wdiff + '</pre>'
+ # It's possible to raise a ScriptError we pass wdiff invalid paths.
+ return self._run_wdiff(actual_filename, expected_filename)
except OSError, e:
- if (e.errno == errno.ENOENT or e.errno == errno.EACCES or
- e.errno == errno.ECHILD):
- _wdiff_available = False
- else:
- raise e
- return result
+ if e.errno in [errno.ENOENT, errno.EACCES, errno.ECHILD]:
+ # Silently ignore cases where wdiff is missing.
+ self._wdiff_available = False
+ return ""
+ raise
+
+ # This is a class variable so we can test error output easily.
+ _pretty_patch_error_html = "Failed to run PrettyPatch, see error log."
+
+ def pretty_patch_text(self, diff_path):
+ if not self._pretty_patch_available:
+ return self._pretty_patch_error_html
+ command = ("ruby", "-I", os.path.dirname(self._pretty_patch_path),
+ self._pretty_patch_path, diff_path)
+ try:
+ # Diffs are treated as binary (we pass decode_output=False) as they
+ # may contain multiple files of conflicting encodings.
+ return self._executive.run_command(command, decode_output=False)
+ except OSError, e:
+ # If the system is missing ruby log the error and stop trying.
+ self._pretty_patch_available = False
+ _log.error("Failed to run PrettyPatch (%s): %s" % (command, e))
+ return self._pretty_patch_error_html
+ except ScriptError, e:
+ # If ruby failed to run for some reason, log the command
+ # output and stop trying.
+ self._pretty_patch_available = False
+ _log.error("Failed to run PrettyPatch (%s):\n%s" % (command,
+ e.message_with_output()))
+ return self._pretty_patch_error_html
+
+ def default_configuration(self):
+ return self._config.default_configuration()
#
# PROTECTED ROUTINES
@@ -513,13 +724,8 @@ class Port(object):
# The routines below should only be called by routines in this class
# or any of its subclasses.
#
-
- def _kill_process(self, pid):
- """Forcefully kill a process.
-
- This routine should not be used or needed generically, but can be
- used in helper files like http_server.py."""
- raise NotImplementedError('Port.kill_process')
+ def _webkit_build_directory(self, args):
+ return self._config.build_directory(args[0])
def _path_to_apache(self):
"""Returns the full path to the apache binary.
@@ -533,10 +739,14 @@ class Port(object):
This is needed only by ports that use the apache_http_server module."""
raise NotImplementedError('Port.path_to_apache_config_file')
- def _path_to_driver(self):
+ def _path_to_driver(self, configuration=None):
"""Returns the full path to the test driver (DumpRenderTree)."""
raise NotImplementedError('Port.path_to_driver')
+ def _path_to_webcore_library(self):
+ """Returns the full path to a built copy of WebCore."""
+ raise NotImplementedError('Port.path_to_webcore_library')
+
def _path_to_helper(self):
"""Returns the full path to the layout_test_helper binary, which
is used to help configure the system for the test run, or None
@@ -587,14 +797,14 @@ class Port(object):
def _webkit_baseline_path(self, platform):
"""Return the full path to the top of the baseline tree for a
given platform."""
- return os.path.join(self.layout_tests_dir(), 'platform',
- platform)
+ return self._filesystem.join(self.layout_tests_dir(), 'platform',
+ platform)
class Driver:
"""Abstract interface for the DumpRenderTree interface."""
- def __init__(self, port, png_path, options):
+ def __init__(self, port, png_path, options, executive):
"""Initialize a Driver to subsequently run tests.
Typically this routine will spawn DumpRenderTree in a config
@@ -604,7 +814,10 @@ class Driver:
png_path - an absolute path for the driver to write any image
data for a test (as a PNG). If no path is provided, that
indicates that pixel test results will not be checked.
- options - any port-specific driver options."""
+ options - command line options argument from optparse
+ executive - reference to the process-wide Executive object
+
+ """
raise NotImplementedError('Driver.__init__')
def run_test(self, uri, timeout, checksum):
@@ -619,27 +832,32 @@ class Driver:
checksum - if present, the expected checksum for the image for this
test
- Returns a tuple of the following:
- crash - a boolean indicating whether the driver crashed on the test
- timeout - a boolean indicating whehter the test timed out
- checksum - a string containing the checksum of the image, if
- present
- output - any text output
- error - any unexpected or additional (or error) text output
-
- Note that the image itself should be written to the path that was
- specified in the __init__() call."""
+ Returns a TestOutput object.
+ """
raise NotImplementedError('Driver.run_test')
+ # FIXME: This is static so we can test it w/o creating a Base instance.
+ @classmethod
+ def _command_wrapper(cls, wrapper_option):
+ # Hook for injecting valgrind or other runtime instrumentation,
+ # used by e.g. tools/valgrind/valgrind_tests.py.
+ wrapper = []
+ browser_wrapper = os.environ.get("BROWSER_WRAPPER", None)
+ if browser_wrapper:
+ # FIXME: There seems to be no reason to use BROWSER_WRAPPER over --wrapper.
+ # Remove this code any time after the date listed below.
+ _log.error("BROWSER_WRAPPER is deprecated, please use --wrapper instead.")
+ _log.error("BROWSER_WRAPPER will be removed any time after June 1st 2010 and your scripts will break.")
+ wrapper += [browser_wrapper]
+
+ if wrapper_option:
+ wrapper += shlex.split(wrapper_option)
+ return wrapper
+
def poll(self):
"""Returns None if the Driver is still running. Returns the returncode
if it has exited."""
raise NotImplementedError('Driver.poll')
- def returncode(self):
- """Returns the system-specific returncode if the Driver has stopped or
- exited."""
- raise NotImplementedError('Driver.returncode')
-
def stop(self):
raise NotImplementedError('Driver.stop')
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
new file mode 100644
index 0000000..1e9c2b7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/base_unittest.py
@@ -0,0 +1,315 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import optparse
+import os
+import sys
+import tempfile
+import unittest
+
+from webkitpy.common.system.executive import Executive, ScriptError
+from webkitpy.common.system import executive_mock
+from webkitpy.common.system import filesystem
+from webkitpy.common.system import outputcapture
+from webkitpy.common.system.path import abspath_to_uri
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool import mocktool
+
+import base
+import config
+import config_mock
+
+
+class PortTest(unittest.TestCase):
+ def test_format_wdiff_output_as_html(self):
+ output = "OUTPUT %s %s %s" % (base.Port._WDIFF_DEL, base.Port._WDIFF_ADD, base.Port._WDIFF_END)
+ html = base.Port()._format_wdiff_output_as_html(output)
+ expected_html = "<head><style>.del { background: #faa; } .add { background: #afa; }</style></head><pre>OUTPUT <span class=del> <span class=add> </span></pre>"
+ self.assertEqual(html, expected_html)
+
+ def test_wdiff_command(self):
+ port = base.Port()
+ port._path_to_wdiff = lambda: "/path/to/wdiff"
+ command = port._wdiff_command("/actual/path", "/expected/path")
+ expected_command = [
+ "/path/to/wdiff",
+ "--start-delete=##WDIFF_DEL##",
+ "--end-delete=##WDIFF_END##",
+ "--start-insert=##WDIFF_ADD##",
+ "--end-insert=##WDIFF_END##",
+ "/actual/path",
+ "/expected/path",
+ ]
+ self.assertEqual(command, expected_command)
+
+ def _file_with_contents(self, contents, encoding="utf-8"):
+ new_file = tempfile.NamedTemporaryFile()
+ new_file.write(contents.encode(encoding))
+ new_file.flush()
+ return new_file
+
+ def test_pretty_patch_os_error(self):
+ port = base.Port(executive=executive_mock.MockExecutive2(exception=OSError))
+ oc = outputcapture.OutputCapture()
+ oc.capture_output()
+ self.assertEqual(port.pretty_patch_text("patch.txt"),
+ port._pretty_patch_error_html)
+
+ # This tests repeated calls to make sure we cache the result.
+ self.assertEqual(port.pretty_patch_text("patch.txt"),
+ port._pretty_patch_error_html)
+ oc.restore_output()
+
+ def test_pretty_patch_script_error(self):
+ # FIXME: This is some ugly white-box test hacking ...
+ base._pretty_patch_available = True
+ port = base.Port(executive=executive_mock.MockExecutive2(exception=ScriptError))
+ self.assertEqual(port.pretty_patch_text("patch.txt"),
+ port._pretty_patch_error_html)
+
+ # This tests repeated calls to make sure we cache the result.
+ self.assertEqual(port.pretty_patch_text("patch.txt"),
+ port._pretty_patch_error_html)
+
+ def test_run_wdiff(self):
+ executive = Executive()
+ # This may fail on some systems. We could ask the port
+ # object for the wdiff path, but since we don't know what
+ # port object to use, this is sufficient for now.
+ try:
+ wdiff_path = executive.run_command(["which", "wdiff"]).rstrip()
+ except Exception, e:
+ wdiff_path = None
+
+ port = base.Port()
+ port._path_to_wdiff = lambda: wdiff_path
+
+ if wdiff_path:
+ # "with tempfile.NamedTemporaryFile() as actual" does not seem to work in Python 2.5
+ actual = self._file_with_contents(u"foo")
+ expected = self._file_with_contents(u"bar")
+ wdiff = port._run_wdiff(actual.name, expected.name)
+ expected_wdiff = "<head><style>.del { background: #faa; } .add { background: #afa; }</style></head><pre><span class=del>foo</span><span class=add>bar</span></pre>"
+ self.assertEqual(wdiff, expected_wdiff)
+ # Running the full wdiff_text method should give the same result.
+ port._wdiff_available = True # In case it's somehow already disabled.
+ wdiff = port.wdiff_text(actual.name, expected.name)
+ self.assertEqual(wdiff, expected_wdiff)
+ # wdiff should still be available after running wdiff_text with a valid diff.
+ self.assertTrue(port._wdiff_available)
+ actual.close()
+ expected.close()
+
+ # Bogus paths should raise a script error.
+ self.assertRaises(ScriptError, port._run_wdiff, "/does/not/exist", "/does/not/exist2")
+ self.assertRaises(ScriptError, port.wdiff_text, "/does/not/exist", "/does/not/exist2")
+ # wdiff will still be available after running wdiff_text with invalid paths.
+ self.assertTrue(port._wdiff_available)
+ base._wdiff_available = True
+
+ # If wdiff does not exist _run_wdiff should throw an OSError.
+ port._path_to_wdiff = lambda: "/invalid/path/to/wdiff"
+ self.assertRaises(OSError, port._run_wdiff, "foo", "bar")
+
+ # wdiff_text should not throw an error if wdiff does not exist.
+ self.assertEqual(port.wdiff_text("foo", "bar"), "")
+ # However wdiff should not be available after running wdiff_text if wdiff is missing.
+ self.assertFalse(port._wdiff_available)
+
+ def test_diff_text(self):
+ port = base.Port()
+ # Make sure that we don't run into decoding exceptions when the
+ # filenames are unicode, with regular or malformed input (expected or
+ # actual input is always raw bytes, not unicode).
+ port.diff_text('exp', 'act', 'exp.txt', 'act.txt')
+ port.diff_text('exp', 'act', u'exp.txt', 'act.txt')
+ port.diff_text('exp', 'act', u'a\xac\u1234\u20ac\U00008000', 'act.txt')
+
+ port.diff_text('exp' + chr(255), 'act', 'exp.txt', 'act.txt')
+ port.diff_text('exp' + chr(255), 'act', u'exp.txt', 'act.txt')
+
+ # Though expected and actual files should always be read in with no
+ # encoding (and be stored as str objects), test unicode inputs just to
+ # be safe.
+ port.diff_text(u'exp', 'act', 'exp.txt', 'act.txt')
+ port.diff_text(
+ u'a\xac\u1234\u20ac\U00008000', 'act', 'exp.txt', 'act.txt')
+
+ # And make sure we actually get diff output.
+ diff = port.diff_text('foo', 'bar', 'exp.txt', 'act.txt')
+ self.assertTrue('foo' in diff)
+ self.assertTrue('bar' in diff)
+ self.assertTrue('exp.txt' in diff)
+ self.assertTrue('act.txt' in diff)
+ self.assertFalse('nosuchthing' in diff)
+
+ def test_default_configuration_notfound(self):
+ # Test that we delegate to the config object properly.
+ port = base.Port(config=config_mock.MockConfig(default_configuration='default'))
+ self.assertEqual(port.default_configuration(), 'default')
+
+ def test_layout_tests_skipping(self):
+ port = base.Port()
+ port.skipped_layout_tests = lambda: ['foo/bar.html', 'media']
+ self.assertTrue(port.skips_layout_test('foo/bar.html'))
+ self.assertTrue(port.skips_layout_test('media/video-zoom.html'))
+ self.assertFalse(port.skips_layout_test('foo/foo.html'))
+
+ def test_setup_test_run(self):
+ port = base.Port()
+ # This routine is a no-op. We just test it for coverage.
+ port.setup_test_run()
+
+ def test_test_dirs(self):
+ port = base.Port()
+ dirs = port.test_dirs()
+ self.assertTrue('canvas' in dirs)
+ self.assertTrue('css2.1' in dirs)
+
+ def test_filename_to_uri(self):
+ port = base.Port()
+ layout_test_dir = port.layout_tests_dir()
+ test_file = os.path.join(layout_test_dir, "foo", "bar.html")
+
+ # On Windows, absolute paths are of the form "c:\foo.txt". However,
+ # all current browsers (except for Opera) normalize file URLs by
+ # prepending an additional "/" as if the absolute path was
+ # "/c:/foo.txt". This means that all file URLs end up with "file:///"
+ # at the beginning.
+ if sys.platform == 'win32':
+ prefix = "file:///"
+ path = test_file.replace("\\", "/")
+ else:
+ prefix = "file://"
+ path = test_file
+
+ self.assertEqual(port.filename_to_uri(test_file),
+ abspath_to_uri(test_file))
+
+ def test_get_option__set(self):
+ options, args = optparse.OptionParser().parse_args([])
+ options.foo = 'bar'
+ port = base.Port(options=options)
+ self.assertEqual(port.get_option('foo'), 'bar')
+
+ def test_get_option__unset(self):
+ port = base.Port()
+ self.assertEqual(port.get_option('foo'), None)
+
+ def test_get_option__default(self):
+ port = base.Port()
+ self.assertEqual(port.get_option('foo', 'bar'), 'bar')
+
+ def test_set_option_default__unset(self):
+ port = base.Port()
+ port.set_option_default('foo', 'bar')
+ self.assertEqual(port.get_option('foo'), 'bar')
+
+ def test_set_option_default__set(self):
+ options, args = optparse.OptionParser().parse_args([])
+ options.foo = 'bar'
+ port = base.Port(options=options)
+ # This call should have no effect.
+ port.set_option_default('foo', 'new_bar')
+ self.assertEqual(port.get_option('foo'), 'bar')
+
+ def test_name__unset(self):
+ port = base.Port()
+ self.assertEqual(port.name(), None)
+
+ def test_name__set(self):
+ port = base.Port(port_name='foo')
+ self.assertEqual(port.name(), 'foo')
+
+
+class VirtualTest(unittest.TestCase):
+ """Tests that various methods expected to be virtual are."""
+ def assertVirtual(self, method, *args, **kwargs):
+ self.assertRaises(NotImplementedError, method, *args, **kwargs)
+
+ def test_virtual_methods(self):
+ port = base.Port()
+ self.assertVirtual(port.baseline_path)
+ self.assertVirtual(port.baseline_search_path)
+ self.assertVirtual(port.check_build, None)
+ self.assertVirtual(port.check_image_diff)
+ self.assertVirtual(port.create_driver, None, None)
+ self.assertVirtual(port.diff_image, None, None)
+ self.assertVirtual(port.path_to_test_expectations_file)
+ self.assertVirtual(port.test_platform_name)
+ self.assertVirtual(port.results_directory)
+ self.assertVirtual(port.test_expectations)
+ self.assertVirtual(port.test_base_platform_names)
+ self.assertVirtual(port.test_platform_name)
+ self.assertVirtual(port.test_platforms)
+ self.assertVirtual(port.test_platform_name_to_name, None)
+ self.assertVirtual(port.version)
+ self.assertVirtual(port._path_to_apache)
+ self.assertVirtual(port._path_to_apache_config_file)
+ self.assertVirtual(port._path_to_driver)
+ self.assertVirtual(port._path_to_helper)
+ self.assertVirtual(port._path_to_image_diff)
+ self.assertVirtual(port._path_to_lighttpd)
+ self.assertVirtual(port._path_to_lighttpd_modules)
+ self.assertVirtual(port._path_to_lighttpd_php)
+ self.assertVirtual(port._path_to_wdiff)
+ self.assertVirtual(port._shut_down_http_server, None)
+
+ def test_virtual_driver_method(self):
+ self.assertRaises(NotImplementedError, base.Driver, base.Port(),
+ "", None, None)
+
+ def test_virtual_driver_methods(self):
+ class VirtualDriver(base.Driver):
+ def __init__(self):
+ pass
+
+ driver = VirtualDriver()
+ self.assertVirtual(driver.run_test, None, None, None)
+ self.assertVirtual(driver.poll)
+ self.assertVirtual(driver.stop)
+
+
+class DriverTest(unittest.TestCase):
+
+ def _assert_wrapper(self, wrapper_string, expected_wrapper):
+ wrapper = base.Driver._command_wrapper(wrapper_string)
+ self.assertEqual(wrapper, expected_wrapper)
+
+ def test_command_wrapper(self):
+ self._assert_wrapper(None, [])
+ self._assert_wrapper("valgrind", ["valgrind"])
+
+ # Validate that shlex works as expected.
+ command_with_spaces = "valgrind --smc-check=\"check with spaces!\" --foo"
+ expected_parse = ["valgrind", "--smc-check=check with spaces!", "--foo"]
+ self._assert_wrapper(command_with_spaces, expected_parse)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
index 70a8dea..3149290 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
@@ -29,118 +29,284 @@
"""Chromium implementations of the Port interface."""
+from __future__ import with_statement
+
+import codecs
import logging
import os
+import re
import shutil
import signal
import subprocess
import sys
+import tempfile
import time
+import webbrowser
+
+from webkitpy.common.system.executive import Executive
+from webkitpy.common.system.path import cygpath
+from webkitpy.layout_tests.layout_package import test_expectations
+from webkitpy.layout_tests.layout_package import test_output
import base
import http_server
+
+# Chromium DRT on OSX uses WebKitDriver.
+if sys.platform == 'darwin':
+ import webkit
+
import websocket_server
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium")
+
+
+# FIXME: This function doesn't belong in this package.
+def check_file_exists(path_to_file, file_description, override_step=None,
+ logging=True):
+ """Verify the file is present where expected or log an error.
+
+ Args:
+ file_name: The (human friendly) name or description of the file
+ you're looking for (e.g., "HTTP Server"). Used for error logging.
+ override_step: An optional string to be logged if the check fails.
+ logging: Whether or not log the error messages."""
+ if not os.path.exists(path_to_file):
+ if logging:
+ _log.error('Unable to find %s' % file_description)
+ _log.error(' at %s' % path_to_file)
+ if override_step:
+ _log.error(' %s' % override_step)
+ _log.error('')
+ return False
+ return True
+
class ChromiumPort(base.Port):
"""Abstract base class for Chromium implementations of the Port class."""
- def __init__(self, port_name=None, options=None):
- base.Port.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ base.Port.__init__(self, **kwargs)
self._chromium_base_dir = None
def baseline_path(self):
- return self._chromium_baseline_path(self._name)
+ return self._webkit_baseline_path(self._name)
- def check_sys_deps(self):
+ def check_build(self, needs_http):
result = True
- test_shell_binary_path = self._path_to_driver()
- if os.path.exists(test_shell_binary_path):
- proc = subprocess.Popen([test_shell_binary_path,
- '--check-layout-test-sys-deps'])
- if proc.wait() != 0:
- logging.error("Aborting because system dependencies check "
- "failed.")
- logging.error("To override, invoke with --nocheck-sys-deps")
- result = False
+
+ dump_render_tree_binary_path = self._path_to_driver()
+ result = check_file_exists(dump_render_tree_binary_path,
+ 'test driver') and result
+ if result and self.get_option('build'):
+ result = self._check_driver_build_up_to_date(
+ self.get_option('configuration'))
else:
- logging.error('test driver is not found at %s' %
- test_shell_binary_path)
- result = False
+ _log.error('')
+
+ helper_path = self._path_to_helper()
+ if helper_path:
+ result = check_file_exists(helper_path,
+ 'layout test helper') and result
+
+ if self.get_option('pixel_tests'):
+ result = self.check_image_diff(
+ 'To override, invoke with --no-pixel-tests') and result
+
+ # It's okay if pretty patch isn't available, but we will at
+ # least log a message.
+ self.check_pretty_patch()
+ return result
+
+ def check_sys_deps(self, needs_http):
+ cmd = [self._path_to_driver(), '--check-layout-test-sys-deps']
+ if self._executive.run_command(cmd, return_exit_code=True):
+ _log.error('System dependencies check failed.')
+ _log.error('To override, invoke with --nocheck-sys-deps')
+ _log.error('')
+ return False
+ return True
+
+ def check_image_diff(self, override_step=None, logging=True):
image_diff_path = self._path_to_image_diff()
- if (not os.path.exists(image_diff_path) and not
- self._options.no_pixel_tests):
- logging.error('image diff not found at %s' % image_diff_path)
- logging.error("To override, invoke with --no-pixel-tests")
- result = False
+ return check_file_exists(image_diff_path, 'image diff exe',
+ override_step, logging)
+
+ def diff_image(self, expected_contents, actual_contents,
+ diff_filename=None):
+ executable = self._path_to_image_diff()
+
+ tempdir = tempfile.mkdtemp()
+ expected_filename = os.path.join(tempdir, "expected.png")
+ with open(expected_filename, 'w+b') as file:
+ file.write(expected_contents)
+ actual_filename = os.path.join(tempdir, "actual.png")
+ with open(actual_filename, 'w+b') as file:
+ file.write(actual_contents)
+
+ if diff_filename:
+ cmd = [executable, '--diff', expected_filename,
+ actual_filename, diff_filename]
+ else:
+ cmd = [executable, expected_filename, actual_filename]
+ result = True
+ try:
+ exit_code = self._executive.run_command(cmd, return_exit_code=True)
+ if exit_code == 0:
+ # The images are the same.
+ result = False
+ elif exit_code != 1:
+ _log.error("image diff returned an exit code of "
+ + str(exit_code))
+ # Returning False here causes the script to think that we
+ # successfully created the diff even though we didn't. If
+ # we return True, we think that the images match but the hashes
+ # don't match.
+ # FIXME: Figure out why image_diff returns other values.
+ result = False
+ except OSError, e:
+ if e.errno == errno.ENOENT or e.errno == errno.EACCES:
+ _compare_available = False
+ else:
+ raise e
+ finally:
+ shutil.rmtree(tempdir, ignore_errors=True)
return result
- def compare_text(self, actual_text, expected_text):
- return actual_text != expected_text
+ def driver_name(self):
+ return "test_shell"
def path_from_chromium_base(self, *comps):
"""Returns the full path to path made by joining the top of the
Chromium source tree and the list of path components in |*comps|."""
if not self._chromium_base_dir:
abspath = os.path.abspath(__file__)
- self._chromium_base_dir = abspath[0:abspath.find('third_party')]
+ offset = abspath.find('third_party')
+ if offset == -1:
+ self._chromium_base_dir = os.path.join(
+ abspath[0:abspath.find('WebKitTools')],
+ 'WebKit', 'chromium')
+ else:
+ self._chromium_base_dir = abspath[0:offset]
return os.path.join(self._chromium_base_dir, *comps)
+ def path_to_test_expectations_file(self):
+ return self.path_from_webkit_base('LayoutTests', 'platform',
+ 'chromium', 'test_expectations.txt')
+
def results_directory(self):
- return self.path_from_chromium_base('webkit', self._options.target,
- self._options.results_directory)
+ try:
+ return self.path_from_chromium_base('webkit',
+ self.get_option('configuration'),
+ self.get_option('results_directory'))
+ except AssertionError:
+ return self._build_path(self.get_option('configuration'),
+ self.get_option('results_directory'))
def setup_test_run(self):
# Delete the disk cache if any to ensure a clean test run.
- test_shell_binary_path = self._path_to_driver()
- cachedir = os.path.split(test_shell_binary_path)[0]
+ dump_render_tree_binary_path = self._path_to_driver()
+ cachedir = os.path.split(dump_render_tree_binary_path)[0]
cachedir = os.path.join(cachedir, "cache")
if os.path.exists(cachedir):
shutil.rmtree(cachedir)
- def show_results_html_file(self, results_filename):
- subprocess.Popen([self._path_to_driver(),
- self.filename_to_uri(results_filename)])
-
- def start_driver(self, image_path, options):
+ def create_driver(self, image_path, options):
"""Starts a new Driver and returns a handle to it."""
- return ChromiumDriver(self, image_path, options)
+ if options.use_drt and sys.platform == 'darwin':
+ return webkit.WebKitDriver(self, image_path, options,
+ executive=self._executive)
+ return ChromiumDriver(self, image_path, options,
+ executive=self._executive)
def start_helper(self):
helper_path = self._path_to_helper()
if helper_path:
- logging.debug("Starting layout helper %s" % helper_path)
+ _log.debug("Starting layout helper %s" % helper_path)
+ # Note: Not thread safe: http://bugs.python.org/issue2320
self._helper = subprocess.Popen([helper_path],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None)
is_ready = self._helper.stdout.readline()
if not is_ready.startswith('ready'):
- logging.error("layout_test_helper failed to be ready")
+ _log.error("layout_test_helper failed to be ready")
def stop_helper(self):
if self._helper:
- logging.debug("Stopping layout test helper")
+ _log.debug("Stopping layout test helper")
self._helper.stdin.write("x\n")
self._helper.stdin.close()
+ # wait() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
self._helper.wait()
def test_base_platform_names(self):
return ('linux', 'mac', 'win')
- def test_expectations(self, options=None):
+ def test_expectations(self):
"""Returns the test expectations for this port.
Basically this string should contain the equivalent of a
test_expectations file. See test_expectations.py for more details."""
- expectations_file = self.path_from_chromium_base('webkit', 'tools',
- 'layout_tests', 'test_expectations.txt')
- return file(expectations_file, "r").read()
+ expectations_path = self.path_to_test_expectations_file()
+ with codecs.open(expectations_path, "r", "utf-8") as file:
+ return file.read()
+
+ def test_expectations_overrides(self):
+ # FIXME: This drt_overrides handling should be removed when we switch
+ # from tes_shell to DRT.
+ drt_overrides = ''
+ if self.get_option('use_drt'):
+ drt_overrides_path = self.path_from_webkit_base('LayoutTests',
+ 'platform', 'chromium', 'drt_expectations.txt')
+ if os.path.exists(drt_overrides_path):
+ with codecs.open(drt_overrides_path, "r", "utf-8") as file:
+ drt_overrides = file.read()
+
+ try:
+ overrides_path = self.path_from_chromium_base('webkit', 'tools',
+ 'layout_tests', 'test_expectations.txt')
+ except AssertionError:
+ return None
+ if not os.path.exists(overrides_path):
+ return None
+ with codecs.open(overrides_path, "r", "utf-8") as file:
+ return file.read() + drt_overrides
+
+ def skipped_layout_tests(self, extra_test_files=None):
+ expectations_str = self.test_expectations()
+ overrides_str = self.test_expectations_overrides()
+ test_platform_name = self.test_platform_name()
+ is_debug_mode = False
+
+ all_test_files = self.tests([])
+ if extra_test_files:
+ all_test_files.update(extra_test_files)
+
+ expectations = test_expectations.TestExpectations(
+ self, all_test_files, expectations_str, test_platform_name,
+ is_debug_mode, is_lint_mode=True, overrides=overrides_str)
+ tests_dir = self.layout_tests_dir()
+ return [self.relative_test_filename(test)
+ for test in expectations.get_tests_with_result_type(test_expectations.SKIP)]
def test_platform_names(self):
return self.test_base_platform_names() + ('win-xp',
'win-vista', 'win-7')
+ def test_platform_name_to_name(self, test_platform_name):
+ if test_platform_name in self.test_platform_names():
+ return 'chromium-' + test_platform_name
+ raise ValueError('Unsupported test_platform_name: %s' %
+ test_platform_name)
+
+ def test_repository_paths(self):
+ # Note: for JSON file's backward-compatibility we use 'chrome' rather
+ # than 'chromium' here.
+ repos = super(ChromiumPort, self).test_repository_paths()
+ repos.append(('chrome', self.path_from_chromium_base()))
+ return repos
+
#
# PROTECTED METHODS
#
@@ -148,46 +314,145 @@ class ChromiumPort(base.Port):
# or any subclasses.
#
+ def _check_driver_build_up_to_date(self, configuration):
+ if configuration in ('Debug', 'Release'):
+ try:
+ debug_path = self._path_to_driver('Debug')
+ release_path = self._path_to_driver('Release')
+
+ debug_mtime = os.stat(debug_path).st_mtime
+ release_mtime = os.stat(release_path).st_mtime
+
+ if (debug_mtime > release_mtime and configuration == 'Release' or
+ release_mtime > debug_mtime and configuration == 'Debug'):
+ _log.warning('You are not running the most '
+ 'recent DumpRenderTree binary. You need to '
+ 'pass --debug or not to select between '
+ 'Debug and Release.')
+ _log.warning('')
+ # This will fail if we don't have both a debug and release binary.
+ # That's fine because, in this case, we must already be running the
+ # most up-to-date one.
+ except OSError:
+ pass
+ return True
+
def _chromium_baseline_path(self, platform):
if platform is None:
platform = self.name()
- return self.path_from_chromium_base('webkit', 'data', 'layout_tests',
- 'platform', platform, 'LayoutTests')
+ return self.path_from_webkit_base('LayoutTests', 'platform', platform)
+
+ def _convert_path(self, path):
+ """Handles filename conversion for subprocess command line args."""
+ # See note above in diff_image() for why we need this.
+ if sys.platform == 'cygwin':
+ return cygpath(path)
+ return path
+
+ def _path_to_image_diff(self):
+ binary_name = 'image_diff'
+ if self.get_option('use_drt'):
+ binary_name = 'ImageDiff'
+ return self._build_path(self.get_option('configuration'), binary_name)
class ChromiumDriver(base.Driver):
- """Abstract interface for the DumpRenderTree interface."""
+ """Abstract interface for test_shell."""
- def __init__(self, port, image_path, options):
+ def __init__(self, port, image_path, options, executive=Executive()):
self._port = port
self._options = options
- self._target = port._options.target
self._image_path = image_path
+ self._executive = executive
+
+ def _driver_args(self):
+ driver_args = []
+ if self._image_path:
+ # See note above in diff_image() for why we need _convert_path().
+ driver_args.append("--pixel-tests=" +
+ self._port._convert_path(self._image_path))
+
+ if self._port.get_option('use_drt'):
+ driver_args.append('--test-shell')
+ else:
+ driver_args.append('--layout-tests')
+
+ if self._port.get_option('startup_dialog'):
+ driver_args.append('--testshell-startup-dialog')
+
+ if self._port.get_option('gp_fault_error_box'):
+ driver_args.append('--gp-fault-error-box')
+
+ if self._options.js_flags is not None:
+ driver_args.append('--js-flags="' + self._options.js_flags + '"')
- cmd = []
- # Hook for injecting valgrind or other runtime instrumentation,
- # used by e.g. tools/valgrind/valgrind_tests.py.
- wrapper = os.environ.get("BROWSER_WRAPPER", None)
- if wrapper != None:
- cmd += [wrapper]
- if self._port._options.wrapper:
- # This split() isn't really what we want -- it incorrectly will
- # split quoted strings within the wrapper argument -- but in
- # practice it shouldn't come up and the --help output warns
- # about it anyway.
- cmd += self._options.wrapper.split()
- cmd += [port._path_to_driver(), '--layout-tests']
- if options:
- cmd += options
+ if self._options.multiple_loads is not None and self._options.multiple_loads > 0:
+ driver_args.append('--multiple-loads=' + str(self._options.multiple_loads))
+
+ if self._port.get_option('accelerated_compositing'):
+ driver_args.append('--enable-accelerated-compositing')
+
+ if self._port.get_option('accelerated_2d_canvas'):
+ driver_args.append('--enable-accelerated-2d-canvas')
+ return driver_args
+
+ def start(self):
+ # FIXME: Should be an error to call this method twice.
+ cmd = self._command_wrapper(self._port.get_option('wrapper'))
+ cmd.append(self._port._path_to_driver())
+ cmd += self._driver_args()
+
+ # We need to pass close_fds=True to work around Python bug #2320
+ # (otherwise we can hang when we kill DumpRenderTree when we are running
+ # multiple threads). See http://bugs.python.org/issue2320 .
+ # Note that close_fds isn't supported on Windows, but this bug only
+ # shows up on Mac and Linux.
+ close_flag = sys.platform not in ('win32', 'cygwin')
self._proc = subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT)
+ stderr=subprocess.STDOUT,
+ close_fds=close_flag)
def poll(self):
+ # poll() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
return self._proc.poll()
- def returncode(self):
- return self._proc.returncode
+ def _write_command_and_read_line(self, input=None):
+ """Returns a tuple: (line, did_crash)"""
+ try:
+ if input:
+ if isinstance(input, unicode):
+ # TestShell expects utf-8
+ input = input.encode("utf-8")
+ self._proc.stdin.write(input)
+ # DumpRenderTree text output is always UTF-8. However some tests
+ # (e.g. webarchive) may spit out binary data instead of text so we
+ # don't bother to decode the output (for either DRT or test_shell).
+ line = self._proc.stdout.readline()
+ # We could assert() here that line correctly decodes as UTF-8.
+ return (line, False)
+ except IOError, e:
+ _log.error("IOError communicating w/ test_shell: " + str(e))
+ return (None, True)
+
+ def _test_shell_command(self, uri, timeoutms, checksum):
+ cmd = uri
+ if timeoutms:
+ cmd += ' ' + str(timeoutms)
+ if checksum:
+ cmd += ' ' + checksum
+ cmd += "\n"
+ return cmd
+
+ def _output_image(self):
+ """Returns the image output which driver generated."""
+ png_path = self._image_path
+ if png_path and os.path.isfile(png_path):
+ with open(png_path, 'rb') as image_file:
+ return image_file.read()
+ else:
+ return None
def run_test(self, uri, timeoutms, checksum):
output = []
@@ -198,21 +463,16 @@ class ChromiumDriver(base.Driver):
actual_checksum = None
start_time = time.time()
- cmd = uri
- if timeoutms:
- cmd += ' ' + str(timeoutms)
- if checksum:
- cmd += ' ' + checksum
- cmd += "\n"
- self._proc.stdin.write(cmd)
- line = self._proc.stdout.readline()
- while line.rstrip() != "#EOF":
+ cmd = self._test_shell_command(uri, timeoutms, checksum)
+ (line, crash) = self._write_command_and_read_line(input=cmd)
+
+ while not crash and line.rstrip() != "#EOF":
# Make sure we haven't crashed.
if line == '' and self.poll() is not None:
# This is hex code 0xc000001d, which is used for abrupt
# termination. This happens if we hit ctrl+c from the prompt
- # and we happen to be waiting on the test_shell.
+ # and we happen to be waiting on test_shell.
# sdoyon: Not sure for which OS and in what circumstances the
# above code is valid. What works for me under Linux to detect
# ctrl+c is for the subprocess returncode to be negative
@@ -227,9 +487,12 @@ class ChromiumDriver(base.Driver):
if line.startswith("#URL:"):
actual_uri = line.rstrip()[5:]
if uri != actual_uri:
- logging.fatal("Test got out of sync:\n|%s|\n|%s|" %
- (uri, actual_uri))
- raise AssertionError("test out of sync")
+ # GURL capitalizes the drive letter of a file URL.
+ if (not re.search("^file:///[a-z]:", uri) or
+ uri.lower() != actual_uri.lower()):
+ _log.fatal("Test got out of sync:\n|%s|\n|%s|" %
+ (uri, actual_uri))
+ raise AssertionError("test out of sync")
elif line.startswith("#MD5:"):
actual_checksum = line.rstrip()[5:]
elif line.startswith("#TEST_TIMED_OUT"):
@@ -240,10 +503,11 @@ class ChromiumDriver(base.Driver):
else:
error.append(line)
- line = self._proc.stdout.readline()
+ (line, crash) = self._write_command_and_read_line(input=None)
- return (crash, timeout, actual_checksum, ''.join(output),
- ''.join(error))
+ return test_output.TestOutput(
+ ''.join(output), self._output_image(), actual_checksum,
+ crash, time.time() - start_time, timeout, ''.join(error))
def stop(self):
if self._proc:
@@ -251,10 +515,21 @@ class ChromiumDriver(base.Driver):
self._proc.stdout.close()
if self._proc.stderr:
self._proc.stderr.close()
- if (sys.platform not in ('win32', 'cygwin') and
- not self._proc.poll()):
- # Closing stdin/stdout/stderr hangs sometimes on OS X.
- null = open(os.devnull, "w")
- subprocess.Popen(["kill", "-9",
- str(self._proc.pid)], stderr=null)
- null.close()
+ if sys.platform not in ('win32', 'cygwin'):
+ # Closing stdin/stdout/stderr hangs sometimes on OS X,
+ # (see __init__(), above), and anyway we don't want to hang
+ # the harness if test_shell is buggy, so we wait a couple
+ # seconds to give test_shell a chance to clean up, but then
+ # force-kill the process if necessary.
+ KILL_TIMEOUT = 3.0
+ timeout = time.time() + KILL_TIMEOUT
+ # poll() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
+ while self._proc.poll() is None and time.time() < timeout:
+ time.sleep(0.1)
+ # poll() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
+ if self._proc.poll() is None:
+ _log.warning('stopping test driver timed out, '
+ 'killing it')
+ self._executive.kill_process(self._proc.pid)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py
new file mode 100644
index 0000000..54a0fee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu.py
@@ -0,0 +1,154 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from __future__ import with_statement
+
+import codecs
+import os
+import sys
+
+import chromium_linux
+import chromium_mac
+import chromium_win
+
+
+def get(**kwargs):
+ """Some tests have slightly different results when run while using
+ hardware acceleration. In those cases, we prepend an additional directory
+ to the baseline paths."""
+ port_name = kwargs.get('port_name', None)
+ if port_name == 'chromium-gpu':
+ if sys.platform in ('cygwin', 'win32'):
+ port_name = 'chromium-gpu-win'
+ elif sys.platform == 'linux2':
+ port_name = 'chromium-gpu-linux'
+ elif sys.platform == 'darwin':
+ port_name = 'chromium-gpu-mac'
+ else:
+ raise NotImplementedError('unsupported platform: %s' %
+ sys.platform)
+
+ if port_name == 'chromium-gpu-linux':
+ return ChromiumGpuLinuxPort(**kwargs)
+
+ if port_name.startswith('chromium-gpu-mac'):
+ return ChromiumGpuMacPort(**kwargs)
+
+ if port_name.startswith('chromium-gpu-win'):
+ return ChromiumGpuWinPort(**kwargs)
+
+ raise NotImplementedError('unsupported port: %s' % port_name)
+
+
+def _set_gpu_options(options):
+ if options:
+ if options.accelerated_compositing is None:
+ options.accelerated_compositing = True
+ if options.accelerated_2d_canvas is None:
+ options.accelerated_2d_canvas = True
+ if options.use_drt is None:
+ options.use_drt = True
+
+ # FIXME: Remove this after http://codereview.chromium.org/5133001/ is enabled
+ # on the bots.
+ if options.builder_name is not None and not ' - GPU' in options.builder_name:
+ options.builder_name = options.builder_name + ' - GPU'
+
+
+def _gpu_overrides(port):
+ try:
+ overrides_path = port.path_from_chromium_base('webkit', 'tools',
+ 'layout_tests', 'test_expectations_gpu.txt')
+ except AssertionError:
+ return None
+ if not os.path.exists(overrides_path):
+ return None
+ with codecs.open(overrides_path, "r", "utf-8") as file:
+ return file.read()
+
+
+class ChromiumGpuLinuxPort(chromium_linux.ChromiumLinuxPort):
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-gpu-linux')
+ _set_gpu_options(kwargs.get('options'))
+ chromium_linux.ChromiumLinuxPort.__init__(self, **kwargs)
+
+ def baseline_search_path(self):
+ # Mimic the Linux -> Win expectations fallback in the ordinary Chromium port.
+ return (map(self._webkit_baseline_path, ['chromium-gpu-linux', 'chromium-gpu-win', 'chromium-gpu']) +
+ chromium_linux.ChromiumLinuxPort.baseline_search_path(self))
+
+ def default_child_processes(self):
+ return 1
+
+ def path_to_test_expectations_file(self):
+ return self.path_from_webkit_base('LayoutTests', 'platform',
+ 'chromium-gpu', 'test_expectations.txt')
+
+ def test_expectations_overrides(self):
+ return _gpu_overrides(self)
+
+
+class ChromiumGpuMacPort(chromium_mac.ChromiumMacPort):
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-gpu-mac')
+ _set_gpu_options(kwargs.get('options'))
+ chromium_mac.ChromiumMacPort.__init__(self, **kwargs)
+
+ def baseline_search_path(self):
+ return (map(self._webkit_baseline_path, ['chromium-gpu-mac', 'chromium-gpu']) +
+ chromium_mac.ChromiumMacPort.baseline_search_path(self))
+
+ def default_child_processes(self):
+ return 1
+
+ def path_to_test_expectations_file(self):
+ return self.path_from_webkit_base('LayoutTests', 'platform',
+ 'chromium-gpu', 'test_expectations.txt')
+
+ def test_expectations_overrides(self):
+ return _gpu_overrides(self)
+
+
+class ChromiumGpuWinPort(chromium_win.ChromiumWinPort):
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-gpu-win' + self.version())
+ _set_gpu_options(kwargs.get('options'))
+ chromium_win.ChromiumWinPort.__init__(self, **kwargs)
+
+ def baseline_search_path(self):
+ return (map(self._webkit_baseline_path, ['chromium-gpu-win', 'chromium-gpu']) +
+ chromium_win.ChromiumWinPort.baseline_search_path(self))
+
+ def default_child_processes(self):
+ return 1
+
+ def path_to_test_expectations_file(self):
+ return self.path_from_webkit_base('LayoutTests', 'platform',
+ 'chromium-gpu', 'test_expectations.txt')
+
+ def test_expectations_overrides(self):
+ return _gpu_overrides(self)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py
new file mode 100644
index 0000000..03bc98a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_gpu_unittest.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import unittest
+
+from webkitpy.tool import mocktool
+import chromium_gpu
+
+
+class ChromiumGpuTest(unittest.TestCase):
+ def test_get_chromium_gpu_linux(self):
+ self.assertOverridesWorked('chromium-gpu-linux')
+
+ def test_get_chromium_gpu_mac(self):
+ self.assertOverridesWorked('chromium-gpu-mac')
+
+ def test_get_chromium_gpu_win(self):
+ self.assertOverridesWorked('chromium-gpu-win')
+
+ def assertOverridesWorked(self, port_name):
+ # test that we got the right port
+ mock_options = mocktool.MockOptions(accelerated_compositing=None,
+ accelerated_2d_canvas=None,
+ builder_name='foo',
+ use_drt=None,
+ child_processes=None)
+ port = chromium_gpu.get(port_name=port_name, options=mock_options)
+ self.assertTrue(port._options.accelerated_compositing)
+ self.assertTrue(port._options.accelerated_2d_canvas)
+ self.assertTrue(port._options.use_drt)
+ self.assertEqual(port.default_child_processes(), 1)
+ self.assertEqual(port._options.builder_name, 'foo - GPU')
+
+ # we use startswith() instead of Equal to gloss over platform versions.
+ self.assertTrue(port.name().startswith(port_name))
+
+ # test that it has the right directories in front of the search path.
+ paths = port.baseline_search_path()
+ self.assertEqual(port._webkit_baseline_path(port_name), paths[0])
+ if port_name == 'chromium-gpu-linux':
+ self.assertEqual(port._webkit_baseline_path('chromium-gpu-win'), paths[1])
+ self.assertEqual(port._webkit_baseline_path('chromium-gpu'), paths[2])
+ else:
+ self.assertEqual(port._webkit_baseline_path('chromium-gpu'), paths[1])
+
+ # Test that we have the right expectations file.
+ self.assertTrue('chromium-gpu' in
+ port.path_to_test_expectations_file())
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
index 8fd5343..b26a6b5 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_linux.py
@@ -27,39 +27,43 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Chromium Mac implementation of the Port interface."""
+"""Chromium Linux implementation of the Port interface."""
+import logging
import os
-import platform
import signal
-import subprocess
import chromium
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_linux")
+
class ChromiumLinuxPort(chromium.ChromiumPort):
"""Chromium Linux implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'chromium-linux'
- chromium.ChromiumPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-linux')
+ chromium.ChromiumPort.__init__(self, **kwargs)
def baseline_search_path(self):
- return [self.baseline_path(),
- self._chromium_baseline_path('chromium-win'),
- self._webkit_baseline_path('win'),
- self._webkit_baseline_path('mac')]
-
- def check_sys_deps(self):
- # We have no platform-specific dependencies to check.
- return True
-
- def num_cores(self):
- num_cores = os.sysconf("SC_NPROCESSORS_ONLN")
- if isinstance(num_cores, int) and num_cores > 0:
- return num_cores
- return 1
+ port_names = ["chromium-linux", "chromium-win", "chromium", "win", "mac"]
+ return map(self._webkit_baseline_path, port_names)
+
+ def check_build(self, needs_http):
+ result = chromium.ChromiumPort.check_build(self, needs_http)
+ if needs_http:
+ if self.get_option('use_apache'):
+ result = self._check_apache_install() and result
+ else:
+ result = self._check_lighttpd_install() and result
+ result = self._check_wdiff_install() and result
+
+ if not result:
+ _log.error('For complete Linux build requirements, please see:')
+ _log.error('')
+ _log.error(' http://code.google.com/p/chromium/wiki/'
+ 'LinuxBuildInstructions')
+ return result
def test_platform_name(self):
# We use 'linux' instead of 'chromium-linux' in test_expectations.txt.
@@ -76,32 +80,61 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
def _build_path(self, *comps):
base = self.path_from_chromium_base()
if os.path.exists(os.path.join(base, 'sconsbuild')):
- return self.path_from_chromium_base('sconsbuild',
- self._options.target, *comps)
- else:
- return self.path_from_chromium_base('out',
- self._options.target, *comps)
-
- def _kill_process(self, pid):
- """Forcefully kill the process.
-
- Args:
- pid: The id of the process to be killed.
- """
- os.kill(pid, signal.SIGKILL)
-
- def _kill_all_process(self, process_name):
- null = open(os.devnull)
- subprocess.call(['killall', '-TERM', '-u', os.getenv('USER'),
- process_name], stderr=null)
- null.close()
+ return os.path.join(base, 'sconsbuild', *comps)
+ if os.path.exists(os.path.join(base, 'out', *comps)) or not self.get_option('use_drt'):
+ return os.path.join(base, 'out', *comps)
+ base = self.path_from_webkit_base()
+ if os.path.exists(os.path.join(base, 'sconsbuild')):
+ return os.path.join(base, 'sconsbuild', *comps)
+ return os.path.join(base, 'out', *comps)
+
+ def _check_apache_install(self):
+ result = chromium.check_file_exists(self._path_to_apache(),
+ "apache2")
+ result = chromium.check_file_exists(self._path_to_apache_config_file(),
+ "apache2 config file") and result
+ if not result:
+ _log.error(' Please install using: "sudo apt-get install '
+ 'apache2 libapache2-mod-php5"')
+ _log.error('')
+ return result
+
+ def _check_lighttpd_install(self):
+ result = chromium.check_file_exists(
+ self._path_to_lighttpd(), "LigHTTPd executable")
+ result = chromium.check_file_exists(self._path_to_lighttpd_php(),
+ "PHP CGI executable") and result
+ result = chromium.check_file_exists(self._path_to_lighttpd_modules(),
+ "LigHTTPd modules") and result
+ if not result:
+ _log.error(' Please install using: "sudo apt-get install '
+ 'lighttpd php5-cgi"')
+ _log.error('')
+ return result
+
+ def _check_wdiff_install(self):
+ result = chromium.check_file_exists(self._path_to_wdiff(), 'wdiff')
+ if not result:
+ _log.error(' Please install using: "sudo apt-get install '
+ 'wdiff"')
+ _log.error('')
+ # FIXME: The ChromiumMac port always returns True.
+ return result
def _path_to_apache(self):
- return '/usr/sbin/apache2'
+ if self._is_redhat_based():
+ return '/usr/sbin/httpd'
+ else:
+ return '/usr/sbin/apache2'
def _path_to_apache_config_file(self):
+ if self._is_redhat_based():
+ config_name = 'fedora-httpd.conf'
+ else:
+ config_name = 'apache2-debian-httpd.conf'
+
return os.path.join(self.layout_tests_dir(), 'http', 'conf',
- 'apache2-debian-httpd.conf')
+ config_name)
def _path_to_lighttpd(self):
return "/usr/sbin/lighttpd"
@@ -112,17 +145,25 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
def _path_to_lighttpd_php(self):
return "/usr/bin/php-cgi"
- def _path_to_driver(self):
- return self._build_path('test_shell')
+ def _path_to_driver(self, configuration=None):
+ if not configuration:
+ configuration = self.get_option('configuration')
+ binary_name = 'test_shell'
+ if self.get_option('use_drt'):
+ binary_name = 'DumpRenderTree'
+ return self._build_path(configuration, binary_name)
def _path_to_helper(self):
return None
- def _path_to_image_diff(self):
- return self._build_path('image_diff')
-
def _path_to_wdiff(self):
- return 'wdiff'
+ if self._is_redhat_based():
+ return '/usr/bin/dwdiff'
+ else:
+ return '/usr/bin/wdiff'
+
+ def _is_redhat_based(self):
+ return os.path.exists(os.path.join('/etc', 'redhat-release'))
def _shut_down_http_server(self, server_pid):
"""Shut down the lighttpd web server. Blocks until it's fully
@@ -136,8 +177,8 @@ class ChromiumLinuxPort(chromium.ChromiumPort):
# TODO(mmoss) This isn't ideal, since it could conflict with
# lighttpd processes not started by http_server.py,
# but good enough for now.
- self._kill_all_process('lighttpd')
- self._kill_all_process('apache2')
+ self._executive.kill_all("lighttpd")
+ self._executive.kill_all("apache2")
else:
try:
os.kill(server_pid, signal.SIGTERM)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
index 7e7b4ca..d1c383c 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac.py
@@ -29,40 +29,60 @@
"""Chromium Mac implementation of the Port interface."""
+import logging
import os
import platform
import signal
-import subprocess
import chromium
+from webkitpy.common.system.executive import Executive
+
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_mac")
+
class ChromiumMacPort(chromium.ChromiumPort):
"""Chromium Mac implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'chromium-mac'
- chromium.ChromiumPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-mac')
+ chromium.ChromiumPort.__init__(self, **kwargs)
def baseline_search_path(self):
- return [self.baseline_path(),
- self._webkit_baseline_path('mac' + self.version()),
- self._webkit_baseline_path('mac')]
-
- def check_sys_deps(self):
- # We have no specific platform dependencies.
- return True
-
- def num_cores(self):
- return int(subprocess.Popen(['sysctl','-n','hw.ncpu'],
- stdout=subprocess.PIPE).stdout.read())
+ port_names = ["chromium-mac", "chromium", "mac" + self.version(), "mac"]
+ return map(self._webkit_baseline_path, port_names)
+
+ def check_build(self, needs_http):
+ result = chromium.ChromiumPort.check_build(self, needs_http)
+ result = self._check_wdiff_install() and result
+ if not result:
+ _log.error('For complete Mac build requirements, please see:')
+ _log.error('')
+ _log.error(' http://code.google.com/p/chromium/wiki/'
+ 'MacBuildInstructions')
+ return result
+
+ def default_child_processes(self):
+ # FIXME: we need to run single-threaded for now. See
+ # https://bugs.webkit.org/show_bug.cgi?id=38553. Unfortunately this
+ # routine is called right before the logger is configured, so if we
+ # try to _log.warning(), it gets thrown away.
+ import sys
+ sys.stderr.write("Defaulting to one child - see https://bugs.webkit.org/show_bug.cgi?id=38553\n")
+ return 1
+
+ def driver_name(self):
+ """name for this port's equivalent of DumpRenderTree."""
+ if self.get_option('use_drt'):
+ return "DumpRenderTree"
+ return "TestShell"
def test_platform_name(self):
# We use 'mac' instead of 'chromium-mac'
return 'mac'
def version(self):
+ # FIXME: It's strange that this string is -version, not just version.
os_version_string = platform.mac_ver()[0] # e.g. "10.5.6"
if not os_version_string:
return '-leopard'
@@ -79,33 +99,25 @@ class ChromiumMacPort(chromium.ChromiumPort):
#
def _build_path(self, *comps):
- return self.path_from_chromium_base('xcodebuild', self._options.target,
- *comps)
+ path = self.path_from_chromium_base('xcodebuild', *comps)
+ if os.path.exists(path) or not self.get_option('use_drt'):
+ return path
+ return self.path_from_webkit_base('WebKit', 'chromium', 'xcodebuild',
+ *comps)
+
+ def _check_wdiff_install(self):
+ try:
+ # We're ignoring the return and always returning True
+ self._executive.run_command([self._path_to_wdiff()], error_handler=Executive.ignore_error)
+ except OSError:
+ _log.warning('wdiff not found. Install using MacPorts or some '
+ 'other means')
+ return True
def _lighttpd_path(self, *comps):
return self.path_from_chromium_base('third_party', 'lighttpd',
'mac', *comps)
- def _kill_process(self, pid):
- """Forcefully kill the process.
-
- Args:
- pid: The id of the process to be killed.
- """
- os.kill(pid, signal.SIGKILL)
-
- def _kill_all_process(self, process_name):
- """Kill any processes running under this name."""
- # On Mac OS X 10.6, killall has a new constraint: -SIGNALNAME or
- # -SIGNALNUMBER must come first. Example problem:
- # $ killall -u $USER -TERM lighttpd
- # killall: illegal option -- T
- # Use of the earlier -TERM placement is just fine on 10.5.
- null = open(os.devnull)
- subprocess.call(['killall', '-TERM', '-u', os.getenv('USER'),
- process_name], stderr=null)
- null.close()
-
def _path_to_apache(self):
return '/usr/sbin/httpd'
@@ -114,25 +126,27 @@ class ChromiumMacPort(chromium.ChromiumPort):
'apache2-httpd.conf')
def _path_to_lighttpd(self):
- return self._lighttp_path('bin', 'lighttp')
+ return self._lighttpd_path('bin', 'lighttpd')
def _path_to_lighttpd_modules(self):
- return self._lighttp_path('lib')
+ return self._lighttpd_path('lib')
def _path_to_lighttpd_php(self):
return self._lighttpd_path('bin', 'php-cgi')
- def _path_to_driver(self):
- # TODO(pinkerton): make |target| happy with case-sensitive file
+ def _path_to_driver(self, configuration=None):
+ # FIXME: make |configuration| happy with case-sensitive file
# systems.
- return self._build_path('TestShell.app', 'Contents', 'MacOS',
- 'TestShell')
+ if not configuration:
+ configuration = self.get_option('configuration')
+ return self._build_path(configuration, self.driver_name() + '.app',
+ 'Contents', 'MacOS', self.driver_name())
def _path_to_helper(self):
- return self._build_path('layout_test_helper')
-
- def _path_to_image_diff(self):
- return self._build_path('image_diff')
+ binary_name = 'layout_test_helper'
+ if self.get_option('use_drt'):
+ binary_name = 'LayoutTestHelper'
+ return self._build_path(self.get_option('configuration'), binary_name)
def _path_to_wdiff(self):
return 'wdiff'
@@ -149,8 +163,8 @@ class ChromiumMacPort(chromium.ChromiumPort):
# TODO(mmoss) This isn't ideal, since it could conflict with
# lighttpd processes not started by http_server.py,
# but good enough for now.
- self._kill_all_process('lighttpd')
- self._kill_all_process('httpd')
+ self._executive.kill_all('lighttpd')
+ self._executive.kill_all('httpd')
else:
try:
os.kill(server_pid, signal.SIGTERM)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
new file mode 100644
index 0000000..d63faa0
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_mac_unittest.py
@@ -0,0 +1,40 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import chromium_mac
+import unittest
+
+from webkitpy.thirdparty.mock import Mock
+
+
+class ChromiumMacPortTest(unittest.TestCase):
+
+ def test_check_wdiff_install(self):
+ port = chromium_mac.ChromiumMacPort()
+ # Currently is always true, just logs if missing.
+ self.assertTrue(port._check_wdiff_install())
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
new file mode 100644
index 0000000..92a31fb
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_unittest.py
@@ -0,0 +1,185 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import unittest
+import StringIO
+
+from webkitpy.tool import mocktool
+from webkitpy.thirdparty.mock import Mock
+
+import chromium
+import chromium_linux
+import chromium_mac
+import chromium_win
+
+class ChromiumDriverTest(unittest.TestCase):
+
+ def setUp(self):
+ mock_port = Mock()
+ self.driver = chromium.ChromiumDriver(mock_port, image_path=None, options=None)
+
+ def test_test_shell_command(self):
+ expected_command = "test.html 2 checksum\n"
+ self.assertEqual(self.driver._test_shell_command("test.html", 2, "checksum"), expected_command)
+
+ def _assert_write_command_and_read_line(self, input=None, expected_line=None, expected_stdin=None, expected_crash=False):
+ if not expected_stdin:
+ if input:
+ expected_stdin = input
+ else:
+ # We reset stdin, so we should expect stdin.getValue = ""
+ expected_stdin = ""
+ self.driver._proc.stdin = StringIO.StringIO()
+ line, did_crash = self.driver._write_command_and_read_line(input)
+ self.assertEqual(self.driver._proc.stdin.getvalue(), expected_stdin)
+ self.assertEqual(line, expected_line)
+ self.assertEqual(did_crash, expected_crash)
+
+ def test_write_command_and_read_line(self):
+ self.driver._proc = Mock()
+ # Set up to read 3 lines before we get an IOError
+ self.driver._proc.stdout = StringIO.StringIO("first\nsecond\nthird\n")
+
+ unicode_input = u"I \u2661 Unicode"
+ utf8_input = unicode_input.encode("utf-8")
+ # Test unicode input conversion to utf-8
+ self._assert_write_command_and_read_line(input=unicode_input, expected_stdin=utf8_input, expected_line="first\n")
+ # Test str() input.
+ self._assert_write_command_and_read_line(input="foo", expected_line="second\n")
+ # Test input=None
+ self._assert_write_command_and_read_line(expected_line="third\n")
+ # Test reading from a closed/empty stream.
+ # reading from a StringIO does not raise IOError like a real file would, so raise IOError manually.
+ def mock_readline():
+ raise IOError
+ self.driver._proc.stdout.readline = mock_readline
+ self._assert_write_command_and_read_line(expected_crash=True)
+
+
+class ChromiumPortTest(unittest.TestCase):
+ class TestMacPort(chromium_mac.ChromiumMacPort):
+ def __init__(self, options):
+ chromium_mac.ChromiumMacPort.__init__(self,
+ port_name='test-port',
+ options=options)
+
+ def default_configuration(self):
+ self.default_configuration_called = True
+ return 'default'
+
+ class TestLinuxPort(chromium_linux.ChromiumLinuxPort):
+ def __init__(self, options):
+ chromium_linux.ChromiumLinuxPort.__init__(self,
+ port_name='test-port',
+ options=options)
+
+ def default_configuration(self):
+ self.default_configuration_called = True
+ return 'default'
+
+ def test_path_to_image_diff(self):
+ mock_options = mocktool.MockOptions(use_drt=True)
+ port = ChromiumPortTest.TestLinuxPort(options=mock_options)
+ self.assertTrue(port._path_to_image_diff().endswith(
+ '/out/default/ImageDiff'), msg=port._path_to_image_diff())
+ port = ChromiumPortTest.TestMacPort(options=mock_options)
+ self.assertTrue(port._path_to_image_diff().endswith(
+ '/xcodebuild/default/ImageDiff'))
+ # FIXME: Figure out how this is going to work on Windows.
+ #port = chromium_win.ChromiumWinPort('test-port', options=MockOptions())
+
+ def test_skipped_layout_tests(self):
+ mock_options = mocktool.MockOptions(use_drt=True)
+ port = ChromiumPortTest.TestLinuxPort(options=mock_options)
+
+ fake_test = os.path.join(port.layout_tests_dir(), "fast/js/not-good.js")
+
+ port.test_expectations = lambda: """BUG_TEST SKIP : fast/js/not-good.js = TEXT
+LINUX WIN : fast/js/very-good.js = TIMEOUT PASS"""
+ port.test_expectations_overrides = lambda: ''
+ port.tests = lambda paths: set()
+ port.path_exists = lambda test: True
+
+ skipped_tests = port.skipped_layout_tests(extra_test_files=[fake_test, ])
+ self.assertTrue("fast/js/not-good.js" in skipped_tests)
+
+ def test_default_configuration(self):
+ mock_options = mocktool.MockOptions()
+ port = ChromiumPortTest.TestLinuxPort(options=mock_options)
+ self.assertEquals(mock_options.configuration, 'default')
+ self.assertTrue(port.default_configuration_called)
+
+ mock_options = mocktool.MockOptions(configuration=None)
+ port = ChromiumPortTest.TestLinuxPort(mock_options)
+ self.assertEquals(mock_options.configuration, 'default')
+ self.assertTrue(port.default_configuration_called)
+
+ def test_diff_image(self):
+ class TestPort(ChromiumPortTest.TestLinuxPort):
+ def _path_to_image_diff(self):
+ return "/path/to/image_diff"
+
+ class MockExecute:
+ def __init__(self, result):
+ self._result = result
+
+ def run_command(self,
+ args,
+ cwd=None,
+ input=None,
+ error_handler=None,
+ return_exit_code=False,
+ return_stderr=True,
+ decode_output=False):
+ if return_exit_code:
+ return self._result
+ return ''
+
+ mock_options = mocktool.MockOptions(use_drt=False)
+ port = ChromiumPortTest.TestLinuxPort(mock_options)
+
+ # Images are different.
+ port._executive = MockExecute(0)
+ self.assertEquals(False, port.diff_image("EXPECTED", "ACTUAL"))
+
+ # Images are the same.
+ port._executive = MockExecute(1)
+ self.assertEquals(True, port.diff_image("EXPECTED", "ACTUAL"))
+
+ # There was some error running image_diff.
+ port._executive = MockExecute(2)
+ exception_raised = False
+ try:
+ port.diff_image("EXPECTED", "ACTUAL")
+ except ValueError, e:
+ exception_raised = True
+ self.assertFalse(exception_raised)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
index 352916c..69b529a 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.py
@@ -29,45 +29,58 @@
"""Chromium Win implementation of the Port interface."""
+import logging
import os
-import platform
-import signal
-import subprocess
import sys
import chromium
+_log = logging.getLogger("webkitpy.layout_tests.port.chromium_win")
+
class ChromiumWinPort(chromium.ChromiumPort):
"""Chromium Win implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'chromium-win' + self.version()
- chromium.ChromiumPort.__init__(self, port_name, options)
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'chromium-win' + self.version())
+ chromium.ChromiumPort.__init__(self, **kwargs)
+
+ def setup_environ_for_server(self):
+ env = chromium.ChromiumPort.setup_environ_for_server(self)
+ # Put the cygwin directory first in the path to find cygwin1.dll.
+ env["PATH"] = "%s;%s" % (
+ self.path_from_chromium_base("third_party", "cygwin", "bin"),
+ env["PATH"])
+ # Configure the cygwin directory so that pywebsocket finds proper
+ # python executable to run cgi program.
+ env["CYGWIN_PATH"] = self.path_from_chromium_base(
+ "third_party", "cygwin", "bin")
+ if (sys.platform == "win32" and self.get_option('register_cygwin')):
+ setup_mount = self.path_from_chromium_base("third_party",
+ "cygwin",
+ "setup_mount.bat")
+ self._executive.run_command([setup_mount])
+ return env
def baseline_search_path(self):
- dirs = []
- if self._name == 'chromium-win-xp':
- dirs.append(self._chromium_baseline_path(self._name))
- if self._name in ('chromium-win-xp', 'chromium-win-vista'):
- dirs.append(self._chromium_baseline_path('chromium-win-vista'))
- dirs.append(self._chromium_baseline_path('chromium-win'))
- dirs.append(self._webkit_baseline_path('win'))
- dirs.append(self._webkit_baseline_path('mac'))
- return dirs
-
- def check_sys_deps(self):
- # TODO(dpranke): implement this
- return True
-
- def get_absolute_path(self, filename):
- """Return the absolute path in unix format for the given filename."""
- abspath = os.path.abspath(filename)
- return abspath.replace('\\', '/')
-
- def num_cores(self):
- return int(os.environ.get('NUMBER_OF_PROCESSORS', 1))
+ port_names = []
+ if self._name.endswith('-win-xp'):
+ port_names.append("chromium-win-xp")
+ if self._name.endswith('-win-xp') or self._name.endswith('-win-vista'):
+ port_names.append("chromium-win-vista")
+ # FIXME: This may need to include mac-snowleopard like win.py.
+ port_names.extend(["chromium-win", "chromium", "win", "mac"])
+ return map(self._webkit_baseline_path, port_names)
+
+ def check_build(self, needs_http):
+ result = chromium.ChromiumPort.check_build(self, needs_http)
+ if not result:
+ _log.error('For complete Windows build requirements, please '
+ 'see:')
+ _log.error('')
+ _log.error(' http://dev.chromium.org/developers/how-tos/'
+ 'build-instructions-windows')
+ return result
def relative_test_filename(self, filename):
path = filename[len(self.layout_tests_dir()) + 1:]
@@ -78,6 +91,8 @@ class ChromiumWinPort(chromium.ChromiumPort):
return 'win' + self.version()
def version(self):
+ if not hasattr(sys, 'getwindowsversion'):
+ return ''
winver = sys.getwindowsversion()
if winver[0] == 6 and (winver[1] == 1):
return '-7'
@@ -92,24 +107,19 @@ class ChromiumWinPort(chromium.ChromiumPort):
#
def _build_path(self, *comps):
- # FIXME(dpranke): allow for builds under 'chrome' as well.
- return self.path_from_chromium_base('webkit', self._options.target,
- *comps)
+ p = self.path_from_chromium_base('webkit', *comps)
+ if os.path.exists(p):
+ return p
+ p = self.path_from_chromium_base('chrome', *comps)
+ if os.path.exists(p) or not self.get_option('use_drt'):
+ return p
+ return os.path.join(self.path_from_webkit_base(), 'WebKit', 'chromium',
+ *comps)
def _lighttpd_path(self, *comps):
return self.path_from_chromium_base('third_party', 'lighttpd', 'win',
*comps)
- def _kill_process(self, pid):
- """Forcefully kill the process.
-
- Args:
- pid: The id of the process to be killed.
- """
- subprocess.call(('taskkill.exe', '/f', '/pid', str(pid)),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
-
def _path_to_apache(self):
return self.path_from_chromium_base('third_party', 'cygwin', 'usr',
'sbin', 'httpd')
@@ -127,14 +137,25 @@ class ChromiumWinPort(chromium.ChromiumPort):
def _path_to_lighttpd_php(self):
return self._lighttpd_path('php5', 'php-cgi.exe')
- def _path_to_driver(self):
- return self._build_path('test_shell.exe')
+ def _path_to_driver(self, configuration=None):
+ if not configuration:
+ configuration = self.get_option('configuration')
+ binary_name = 'test_shell.exe'
+ if self.get_option('use_drt'):
+ binary_name = 'DumpRenderTree.exe'
+ return self._build_path(configuration, binary_name)
def _path_to_helper(self):
- return self._build_path('layout_test_helper.exe')
+ binary_name = 'layout_test_helper.exe'
+ if self.get_option('use_drt'):
+ binary_name = 'LayoutTestHelper.exe'
+ return self._build_path(self.get_option('configuration'), binary_name)
def _path_to_image_diff(self):
- return self._build_path('image_diff.exe')
+ binary_name = 'image_diff.exe'
+ if self.get_option('use_drt'):
+ binary_name = 'ImageDiff.exe'
+ return self._build_path(self.get_option('configuration'), binary_name)
def _path_to_wdiff(self):
return self.path_from_chromium_base('third_party', 'cygwin', 'bin',
@@ -147,9 +168,7 @@ class ChromiumWinPort(chromium.ChromiumPort):
Args:
server_pid: The process ID of the running server.
"""
- subprocess.Popen(('taskkill.exe', '/f', '/im', 'LightTPD.exe'),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).wait()
- subprocess.Popen(('taskkill.exe', '/f', '/im', 'httpd.exe'),
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).wait()
+ # FIXME: Why are we ignoring server_pid and calling
+ # _kill_all instead of Executive.kill_process(pid)?
+ self._executive.kill_all("LightTPD.exe")
+ self._executive.kill_all("httpd.exe")
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
new file mode 100644
index 0000000..36f3c6b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win_unittest.py
@@ -0,0 +1,74 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import sys
+import unittest
+import chromium_win
+from webkitpy.common.system import outputcapture
+from webkitpy.tool import mocktool
+
+
+class ChromiumWinTest(unittest.TestCase):
+
+ class RegisterCygwinOption(object):
+ def __init__(self):
+ self.register_cygwin = True
+
+ def setUp(self):
+ self.orig_platform = sys.platform
+
+ def tearDown(self):
+ sys.platform = self.orig_platform
+
+ def _mock_path_from_chromium_base(self, *comps):
+ return os.path.join("/chromium/src", *comps)
+
+ def test_setup_environ_for_server(self):
+ port = chromium_win.ChromiumWinPort()
+ port._executive = mocktool.MockExecutive(should_log=True)
+ port.path_from_chromium_base = self._mock_path_from_chromium_base
+ output = outputcapture.OutputCapture()
+ orig_environ = os.environ.copy()
+ env = output.assert_outputs(self, port.setup_environ_for_server)
+ self.assertEqual(orig_environ["PATH"], os.environ["PATH"])
+ self.assertNotEqual(env["PATH"], os.environ["PATH"])
+
+ def test_setup_environ_for_server_register_cygwin(self):
+ sys.platform = "win32"
+ port = chromium_win.ChromiumWinPort(
+ options=ChromiumWinTest.RegisterCygwinOption())
+ port._executive = mocktool.MockExecutive(should_log=True)
+ port.path_from_chromium_base = self._mock_path_from_chromium_base
+ setup_mount = self._mock_path_from_chromium_base("third_party",
+ "cygwin",
+ "setup_mount.bat")
+ expected_stderr = "MOCK run_command: %s\n" % [setup_mount]
+ output = outputcapture.OutputCapture()
+ output.assert_outputs(self, port.setup_environ_for_server,
+ expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py
new file mode 100644
index 0000000..cad5e37
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/config.py
@@ -0,0 +1,170 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Wrapper objects for WebKit-specific utility routines."""
+
+# FIXME: This file needs to be unified with common/checkout/scm.py and
+# common/config/ports.py .
+
+import os
+
+from webkitpy.common.system import logutils
+from webkitpy.common.system import executive
+
+
+_log = logutils.get_logger(__file__)
+
+#
+# FIXME: This is used to record if we've already hit the filesystem to look
+# for a default configuration. We cache this to speed up the unit tests,
+# but this can be reset with clear_cached_configuration(). This should be
+# replaced with us consistently using MockConfigs() for tests that don't
+# hit the filesystem at all and provide a reliable value.
+#
+_have_determined_configuration = False
+_configuration = "Release"
+
+
+def clear_cached_configuration():
+ global _have_determined_configuration, _configuration
+ _have_determined_configuration = False
+ _configuration = "Release"
+
+
+class Config(object):
+ _FLAGS_FROM_CONFIGURATIONS = {
+ "Debug": "--debug",
+ "Release": "--release",
+ }
+
+ def __init__(self, executive, filesystem):
+ self._executive = executive
+ self._filesystem = filesystem
+ self._webkit_base_dir = None
+ self._default_configuration = None
+ self._build_directories = {}
+
+ def build_directory(self, configuration):
+ """Returns the path to the build directory for the configuration."""
+ if configuration:
+ flags = ["--configuration",
+ self._FLAGS_FROM_CONFIGURATIONS[configuration]]
+ configuration = ""
+ else:
+ configuration = ""
+ flags = ["--top-level"]
+
+ if not self._build_directories.get(configuration):
+ args = ["perl", self._script_path("webkit-build-directory")] + flags
+ self._build_directories[configuration] = (
+ self._executive.run_command(args).rstrip())
+
+ return self._build_directories[configuration]
+
+ def build_dumprendertree(self, configuration):
+ """Builds DRT in the given configuration.
+
+ Returns True if the build was successful and up-to-date."""
+ flag = self._FLAGS_FROM_CONFIGURATIONS[configuration]
+ exit_code = self._executive.run_command([
+ self._script_path("build-dumprendertree"), flag],
+ return_exit_code=True)
+ if exit_code != 0:
+ _log.error("Failed to build DumpRenderTree")
+ return False
+ return True
+
+ def default_configuration(self):
+ """Returns the default configuration for the user.
+
+ Returns the value set by 'set-webkit-configuration', or "Release"
+ if that has not been set. This mirrors the logic in webkitdirs.pm."""
+ if not self._default_configuration:
+ self._default_configuration = self._determine_configuration()
+ if not self._default_configuration:
+ self._default_configuration = 'Release'
+ if self._default_configuration not in self._FLAGS_FROM_CONFIGURATIONS:
+ _log.warn("Configuration \"%s\" is not a recognized value.\n" %
+ self._default_configuration)
+ _log.warn("Scripts may fail. "
+ "See 'set-webkit-configuration --help'.")
+ return self._default_configuration
+
+ def path_from_webkit_base(self, *comps):
+ return self._filesystem.join(self.webkit_base_dir(), *comps)
+
+ def webkit_base_dir(self):
+ """Returns the absolute path to the top of the WebKit tree.
+
+ Raises an AssertionError if the top dir can't be determined."""
+ # Note: this code somewhat duplicates the code in
+ # scm.find_checkout_root(). However, that code only works if the top
+ # of the SCM repository also matches the top of the WebKit tree. The
+ # Chromium ports, for example, only check out subdirectories like
+ # WebKitTools/Scripts, and so we still have to do additional work
+ # to find the top of the tree.
+ #
+ # This code will also work if there is no SCM system at all.
+ if not self._webkit_base_dir:
+ abspath = os.path.abspath(__file__)
+ self._webkit_base_dir = abspath[0:abspath.find('WebKitTools')]
+ return self._webkit_base_dir
+
+ def _script_path(self, script_name):
+ return self._filesystem.join(self.webkit_base_dir(), "WebKitTools",
+ "Scripts", script_name)
+
+ def _determine_configuration(self):
+ # This mirrors the logic in webkitdirs.pm:determineConfiguration().
+ #
+ # FIXME: See the comment at the top of the file regarding unit tests
+ # and our use of global mutable static variables.
+ global _have_determined_configuration, _configuration
+ if not _have_determined_configuration:
+ contents = self._read_configuration()
+ if not contents:
+ contents = "Release"
+ if contents == "Deployment":
+ contents = "Release"
+ if contents == "Development":
+ contents = "Debug"
+ _configuration = contents
+ _have_determined_configuration = True
+ return _configuration
+
+ def _read_configuration(self):
+ try:
+ configuration_path = self._filesystem.join(self.build_directory(None),
+ "Configuration")
+ if not self._filesystem.exists(configuration_path):
+ return None
+ except (OSError, executive.ScriptError):
+ return None
+
+ return self._filesystem.read_text_file(configuration_path).rstrip()
diff --git a/WebKitTools/Scripts/run-chromium-webkit-tests b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_mock.py
index 221b5aa..af71fa3 100755..100644
--- a/WebKitTools/Scripts/run-chromium-webkit-tests
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_mock.py
@@ -27,15 +27,24 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Wrapper around webkitpy/layout_tests/run-chromium-webkit-tests.py"""
-import os
-import sys
-
-sys.path.append(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])),
- "webkitpy", "layout_tests"))
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0]))))
-import run_chromium_webkit_tests
-
-if __name__ == '__main__':
- options, args = run_chromium_webkit_tests.parse_args()
- run_chromium_webkit_tests.main(options, args)
+"""Wrapper objects for WebKit-specific utility routines."""
+
+
+class MockConfig(object):
+ def __init__(self, default_configuration='Release'):
+ self._default_configuration = default_configuration
+
+ def build_directory(self, configuration):
+ return "/build"
+
+ def build_dumprendertree(self, configuration):
+ return True
+
+ def default_configuration(self):
+ return self._default_configuration
+
+ def path_from_webkit_base(self, *comps):
+ return "/" + "/".join(list(comps))
+
+ def webkit_base_dir(self):
+ return "/"
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/config_standalone.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_standalone.py
new file mode 100644
index 0000000..3dec3b9
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_standalone.py
@@ -0,0 +1,70 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""FIXME: This script is used by
+config_unittest.test_default_configuration__standalone() to read the
+default configuration to work around any possible caching / reset bugs. See
+https://bugs.webkit.org/show_bug?id=49360 for the motivation. We can remove
+this test when we remove the global configuration cache in config.py."""
+
+import os
+import unittest
+import sys
+
+
+# Ensure that webkitpy is in PYTHONPATH.
+this_dir = os.path.abspath(sys.path[0])
+up = os.path.dirname
+script_dir = up(up(up(this_dir)))
+if script_dir not in sys.path:
+ sys.path.append(script_dir)
+
+from webkitpy.common.system import executive
+from webkitpy.common.system import executive_mock
+from webkitpy.common.system import filesystem
+from webkitpy.common.system import filesystem_mock
+
+import config
+
+
+def main(argv=None):
+ if not argv:
+ argv = sys.argv
+
+ if len(argv) == 3 and argv[1] == '--mock':
+ e = executive_mock.MockExecutive2(output='foo')
+ fs = filesystem_mock.MockFileSystem({'foo/Configuration': argv[2]})
+ else:
+ e = executive.Executive()
+ fs = filesystem.FileSystem()
+
+ c = config.Config(e, fs)
+ print c.default_configuration()
+
+if __name__ == '__main__':
+ main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py
new file mode 100644
index 0000000..9bea014
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/config_unittest.py
@@ -0,0 +1,183 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import sys
+import unittest
+
+from webkitpy.common.system import executive
+from webkitpy.common.system import executive_mock
+from webkitpy.common.system import filesystem
+from webkitpy.common.system import filesystem_mock
+from webkitpy.common.system import outputcapture
+
+import config
+
+class ConfigTest(unittest.TestCase):
+ def tearDown(self):
+ config.clear_cached_configuration()
+
+ def make_config(self, output='', files={}, exit_code=0, exception=None):
+ e = executive_mock.MockExecutive2(output=output, exit_code=exit_code,
+ exception=exception)
+ fs = filesystem_mock.MockFileSystem(files)
+ return config.Config(e, fs)
+
+ def assert_configuration(self, contents, expected):
+ # This tests that a configuration file containing
+ # _contents_ ends up being interpreted as _expected_.
+ c = self.make_config('foo', {'foo/Configuration': contents})
+ self.assertEqual(c.default_configuration(), expected)
+
+ def test_build_directory_toplevel(self):
+ c = self.make_config('toplevel')
+ self.assertEqual(c.build_directory(None), 'toplevel')
+
+ # Test again to check caching
+ self.assertEqual(c.build_directory(None), 'toplevel')
+
+ def test_build_directory__release(self):
+ c = self.make_config('release')
+ self.assertEqual(c.build_directory('Release'), 'release')
+
+ def test_build_directory__debug(self):
+ c = self.make_config('debug')
+ self.assertEqual(c.build_directory('Debug'), 'debug')
+
+ def test_build_directory__unknown(self):
+ c = self.make_config("unknown")
+ self.assertRaises(KeyError, c.build_directory, 'Unknown')
+
+ def test_build_dumprendertree__success(self):
+ c = self.make_config(exit_code=0)
+ self.assertTrue(c.build_dumprendertree("Debug"))
+ self.assertTrue(c.build_dumprendertree("Release"))
+ self.assertRaises(KeyError, c.build_dumprendertree, "Unknown")
+
+ def test_build_dumprendertree__failure(self):
+ c = self.make_config(exit_code=-1)
+
+ # FIXME: Build failures should log errors. However, the message we
+ # get depends on how we're being called; as a standalone test,
+ # we'll get the "no handlers found" message. As part of
+ # test-webkitpy, we get the actual message. Really, we need
+ # outputcapture to install its own handler.
+ oc = outputcapture.OutputCapture()
+ oc.capture_output()
+ self.assertFalse(c.build_dumprendertree('Debug'))
+ oc.restore_output()
+
+ oc.capture_output()
+ self.assertFalse(c.build_dumprendertree('Release'))
+ oc.restore_output()
+
+ def test_default_configuration__release(self):
+ self.assert_configuration('Release', 'Release')
+
+ def test_default_configuration__debug(self):
+ self.assert_configuration('Debug', 'Debug')
+
+ def test_default_configuration__deployment(self):
+ self.assert_configuration('Deployment', 'Release')
+
+ def test_default_configuration__development(self):
+ self.assert_configuration('Development', 'Debug')
+
+ def test_default_configuration__notfound(self):
+ # This tests what happens if the default configuration file
+ # doesn't exist.
+ c = self.make_config(output='foo', files={'foo/Configuration': None})
+ self.assertEqual(c.default_configuration(), "Release")
+
+ def test_default_configuration__unknown(self):
+ # Ignore the warning about an unknown configuration value.
+ oc = outputcapture.OutputCapture()
+ oc.capture_output()
+ self.assert_configuration('Unknown', 'Unknown')
+ oc.restore_output()
+
+ def test_default_configuration__standalone(self):
+ # FIXME: This test runs a standalone python script to test
+ # reading the default configuration to work around any possible
+ # caching / reset bugs. See https://bugs.webkit.org/show_bug?id=49360
+ # for the motivation. We can remove this test when we remove the
+ # global configuration cache in config.py.
+ e = executive.Executive()
+ fs = filesystem.FileSystem()
+ c = config.Config(e, fs)
+ script = c.path_from_webkit_base('WebKitTools', 'Scripts',
+ 'webkitpy', 'layout_tests', 'port', 'config_standalone.py')
+
+ # Note: don't use 'Release' here, since that's the normal default.
+ expected = 'Debug'
+
+ args = [sys.executable, script, '--mock', expected]
+ actual = e.run_command(args).rstrip()
+ self.assertEqual(actual, expected)
+
+ def test_default_configuration__no_perl(self):
+ # We need perl to run webkit-build-directory to find out where the
+ # default configuration file is. See what happens if perl isn't
+ # installed. (We should get the default value, 'Release').
+ c = self.make_config(exception=OSError)
+ actual = c.default_configuration()
+ self.assertEqual(actual, 'Release')
+
+ def test_default_configuration__scripterror(self):
+ # We run webkit-build-directory to find out where the default
+ # configuration file is. See what happens if that script fails.
+ # (We should get the default value, 'Release').
+ c = self.make_config(exception=executive.ScriptError())
+ actual = c.default_configuration()
+ self.assertEqual(actual, 'Release')
+
+ def test_path_from_webkit_base(self):
+ # FIXME: We use a real filesystem here. Should this move to a
+ # mocked one?
+ c = config.Config(executive.Executive(), filesystem.FileSystem())
+ self.assertTrue(c.path_from_webkit_base('foo'))
+
+ def test_webkit_base_dir(self):
+ # FIXME: We use a real filesystem here. Should this move to a
+ # mocked one?
+ c = config.Config(executive.Executive(), filesystem.FileSystem())
+ base_dir = c.webkit_base_dir()
+ self.assertTrue(base_dir)
+
+ orig_cwd = os.getcwd()
+ os.chdir(os.environ['HOME'])
+ c = config.Config(executive.Executive(), filesystem.FileSystem())
+ try:
+ base_dir_2 = c.webkit_base_dir()
+ self.assertEqual(base_dir, base_dir_2)
+ finally:
+ os.chdir(orig_cwd)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
new file mode 100644
index 0000000..96d0d55
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/dryrun.py
@@ -0,0 +1,133 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the Google name nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""This is a test implementation of the Port interface that generates the
+ correct output for every test. It can be used for perf testing, because
+ it is pretty much a lower limit on how fast a port can possibly run.
+
+ This implementation acts as a wrapper around a real port (the real port
+ is held as a delegate object). To specify which port, use the port name
+ 'dryrun-XXX' (e.g., 'dryrun-chromium-mac-leopard'). If you use just
+ 'dryrun', it uses the default port.
+
+ Note that because this is really acting as a wrapper around the underlying
+ port, you must be able to run the underlying port as well
+ (check_build() and check_sys_deps() must pass and auxiliary binaries
+ like layout_test_helper and httpd must work).
+
+ This implementation also modifies the test expectations so that all
+ tests are either SKIPPED or expected to PASS."""
+
+from __future__ import with_statement
+
+import os
+import sys
+import time
+
+from webkitpy.layout_tests.layout_package import test_output
+
+import base
+import factory
+
+
+class DryRunPort(object):
+ """DryRun implementation of the Port interface."""
+
+ def __init__(self, **kwargs):
+ pfx = 'dryrun-'
+ if 'port_name' in kwargs:
+ if kwargs['port_name'].startswith(pfx):
+ kwargs['port_name'] = kwargs['port_name'][len(pfx):]
+ else:
+ kwargs['port_name'] = None
+ self.__delegate = factory.get(**kwargs)
+
+ def __getattr__(self, name):
+ return getattr(self.__delegate, name)
+
+ def check_build(self, needs_http):
+ return True
+
+ def check_sys_deps(self, needs_http):
+ return True
+
+ def start_helper(self):
+ pass
+
+ def start_http_server(self):
+ pass
+
+ def start_websocket_server(self):
+ pass
+
+ def stop_helper(self):
+ pass
+
+ def stop_http_server(self):
+ pass
+
+ def stop_websocket_server(self):
+ pass
+
+ def create_driver(self, image_path, options):
+ return DryrunDriver(self, image_path, options, executive=None)
+
+
+class DryrunDriver(base.Driver):
+ """Dryrun implementation of the DumpRenderTree / Driver interface."""
+
+ def __init__(self, port, image_path, options, executive):
+ self._port = port
+ self._image_path = image_path
+ self._executive = executive
+ self._layout_tests_dir = None
+
+ def poll(self):
+ return None
+
+ def run_test(self, uri, timeoutms, image_hash):
+ start_time = time.time()
+ test_name = self._port.uri_to_test_name(uri)
+ path = os.path.join(self._port.layout_tests_dir(), test_name)
+ text_output = self._port.expected_text(path)
+
+ if image_hash is not None:
+ image = self._port.expected_image(path)
+ hash = self._port.expected_checksum(path)
+ else:
+ image = None
+ hash = None
+ return test_output.TestOutput(text_output, image, hash, False,
+ time.time() - start_time, False, None)
+
+ def start(self):
+ pass
+
+ def stop(self):
+ pass
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
new file mode 100644
index 0000000..6935744
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -0,0 +1,113 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Factory method to retrieve the appropriate port implementation."""
+
+
+import sys
+
+ALL_PORT_NAMES = ['test', 'dryrun', 'mac', 'win', 'gtk', 'qt', 'chromium-mac',
+ 'chromium-linux', 'chromium-win', 'google-chrome-win',
+ 'google-chrome-mac', 'google-chrome-linux32', 'google-chrome-linux64']
+
+
+def get(port_name=None, options=None, **kwargs):
+ """Returns an object implementing the Port interface. If
+ port_name is None, this routine attempts to guess at the most
+ appropriate port on this platform."""
+ # Wrapped for backwards-compatibility
+ if port_name:
+ kwargs['port_name'] = port_name
+ if options:
+ kwargs['options'] = options
+ return _get_kwargs(**kwargs)
+
+
+def _get_kwargs(**kwargs):
+ port_to_use = kwargs.get('port_name', None)
+ options = kwargs.get('options', None)
+ if port_to_use is None:
+ if sys.platform == 'win32' or sys.platform == 'cygwin':
+ if options and hasattr(options, 'chromium') and options.chromium:
+ port_to_use = 'chromium-win'
+ else:
+ port_to_use = 'win'
+ elif sys.platform == 'linux2':
+ port_to_use = 'chromium-linux'
+ elif sys.platform == 'darwin':
+ if options and hasattr(options, 'chromium') and options.chromium:
+ port_to_use = 'chromium-mac'
+ else:
+ port_to_use = 'mac'
+
+ if port_to_use is None:
+ raise NotImplementedError('unknown port; sys.platform = "%s"' %
+ sys.platform)
+
+ if port_to_use == 'test':
+ import test
+ maker = test.TestPort
+ elif port_to_use.startswith('dryrun'):
+ import dryrun
+ maker = dryrun.DryRunPort
+ elif port_to_use.startswith('mac'):
+ import mac
+ maker = mac.MacPort
+ elif port_to_use.startswith('win'):
+ import win
+ maker = win.WinPort
+ elif port_to_use.startswith('gtk'):
+ import gtk
+ maker = gtk.GtkPort
+ elif port_to_use.startswith('qt'):
+ import qt
+ maker = qt.QtPort
+ elif port_to_use.startswith('chromium-gpu'):
+ import chromium_gpu
+ maker = chromium_gpu.get
+ elif port_to_use.startswith('chromium-mac'):
+ import chromium_mac
+ maker = chromium_mac.ChromiumMacPort
+ elif port_to_use.startswith('chromium-linux'):
+ import chromium_linux
+ maker = chromium_linux.ChromiumLinuxPort
+ elif port_to_use.startswith('chromium-win'):
+ import chromium_win
+ maker = chromium_win.ChromiumWinPort
+ elif port_to_use.startswith('google-chrome'):
+ import google_chrome
+ maker = google_chrome.GetGoogleChromePort
+ else:
+ raise NotImplementedError('unsupported port: %s' % port_to_use)
+ return maker(**kwargs)
+
+def get_all(options=None):
+ """Returns all the objects implementing the Port interface."""
+ return dict([(port_name, get(port_name, options=options))
+ for port_name in ALL_PORT_NAMES])
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/factory_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
new file mode 100644
index 0000000..978a557
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/factory_unittest.py
@@ -0,0 +1,188 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import sys
+import unittest
+
+from webkitpy.tool import mocktool
+
+import chromium_gpu
+import chromium_linux
+import chromium_mac
+import chromium_win
+import dryrun
+import factory
+import google_chrome
+import gtk
+import mac
+import qt
+import test
+import win
+
+
+class FactoryTest(unittest.TestCase):
+ """Test factory creates proper port object for the target.
+
+ Target is specified by port_name, sys.platform and options.
+
+ """
+ # FIXME: The ports themselves should expose what options they require,
+ # instead of passing generic "options".
+
+ def setUp(self):
+ self.real_sys_platform = sys.platform
+ self.webkit_options = mocktool.MockOptions(pixel_tests=False)
+ self.chromium_options = mocktool.MockOptions(pixel_tests=False,
+ chromium=True)
+
+ def tearDown(self):
+ sys.platform = self.real_sys_platform
+
+ def assert_port(self, port_name, expected_port, port_obj=None):
+ """Helper assert for port_name.
+
+ Args:
+ port_name: port name to get port object.
+ expected_port: class of expected port object.
+ port_obj: optional port object
+ """
+ port_obj = port_obj or factory.get(port_name=port_name)
+ self.assertTrue(isinstance(port_obj, expected_port))
+
+ def assert_platform_port(self, platform, options, expected_port):
+ """Helper assert for platform and options.
+
+ Args:
+ platform: sys.platform.
+ options: options to get port object.
+ expected_port: class of expected port object.
+
+ """
+ orig_platform = sys.platform
+ sys.platform = platform
+ self.assertTrue(isinstance(factory.get(options=options),
+ expected_port))
+ sys.platform = orig_platform
+
+ def test_test(self):
+ self.assert_port("test", test.TestPort)
+
+ def test_dryrun(self):
+ self.assert_port("dryrun-test", dryrun.DryRunPort)
+ self.assert_port("dryrun-mac", dryrun.DryRunPort)
+
+ def test_mac(self):
+ self.assert_port("mac", mac.MacPort)
+ self.assert_platform_port("darwin", None, mac.MacPort)
+ self.assert_platform_port("darwin", self.webkit_options, mac.MacPort)
+
+ def test_win(self):
+ self.assert_port("win", win.WinPort)
+ self.assert_platform_port("win32", None, win.WinPort)
+ self.assert_platform_port("win32", self.webkit_options, win.WinPort)
+ self.assert_platform_port("cygwin", None, win.WinPort)
+ self.assert_platform_port("cygwin", self.webkit_options, win.WinPort)
+
+ def test_google_chrome(self):
+ # The actual Chrome class names aren't available so we test that the
+ # objects we get are at least subclasses of the Chromium versions.
+ self.assert_port("google-chrome-linux32",
+ chromium_linux.ChromiumLinuxPort)
+ self.assert_port("google-chrome-linux64",
+ chromium_linux.ChromiumLinuxPort)
+ self.assert_port("google-chrome-win",
+ chromium_win.ChromiumWinPort)
+ self.assert_port("google-chrome-mac",
+ chromium_mac.ChromiumMacPort)
+
+ def test_gtk(self):
+ self.assert_port("gtk", gtk.GtkPort)
+
+ def test_qt(self):
+ self.assert_port("qt", qt.QtPort)
+
+ def test_chromium_gpu_linux(self):
+ self.assert_port("chromium-gpu-linux", chromium_gpu.ChromiumGpuLinuxPort)
+
+ def test_chromium_gpu_mac(self):
+ self.assert_port("chromium-gpu-mac", chromium_gpu.ChromiumGpuMacPort)
+
+ def test_chromium_gpu_win(self):
+ self.assert_port("chromium-gpu-win", chromium_gpu.ChromiumGpuWinPort)
+
+ def test_chromium_mac(self):
+ self.assert_port("chromium-mac", chromium_mac.ChromiumMacPort)
+ self.assert_platform_port("darwin", self.chromium_options,
+ chromium_mac.ChromiumMacPort)
+
+ def test_chromium_linux(self):
+ self.assert_port("chromium-linux", chromium_linux.ChromiumLinuxPort)
+ self.assert_platform_port("linux2", self.chromium_options,
+ chromium_linux.ChromiumLinuxPort)
+
+ def test_chromium_win(self):
+ self.assert_port("chromium-win", chromium_win.ChromiumWinPort)
+ self.assert_platform_port("win32", self.chromium_options,
+ chromium_win.ChromiumWinPort)
+ self.assert_platform_port("cygwin", self.chromium_options,
+ chromium_win.ChromiumWinPort)
+
+ def test_get_all_ports(self):
+ ports = factory.get_all()
+ for name in factory.ALL_PORT_NAMES:
+ self.assertTrue(name in ports.keys())
+ self.assert_port("test", test.TestPort, ports["test"])
+ self.assert_port("dryrun-test", dryrun.DryRunPort, ports["dryrun"])
+ self.assert_port("dryrun-mac", dryrun.DryRunPort, ports["dryrun"])
+ self.assert_port("mac", mac.MacPort, ports["mac"])
+ self.assert_port("win", win.WinPort, ports["win"])
+ self.assert_port("gtk", gtk.GtkPort, ports["gtk"])
+ self.assert_port("qt", qt.QtPort, ports["qt"])
+ self.assert_port("chromium-mac", chromium_mac.ChromiumMacPort,
+ ports["chromium-mac"])
+ self.assert_port("chromium-linux", chromium_linux.ChromiumLinuxPort,
+ ports["chromium-linux"])
+ self.assert_port("chromium-win", chromium_win.ChromiumWinPort,
+ ports["chromium-win"])
+
+ def test_unknown_specified(self):
+ # Test what happens when you specify an unknown port.
+ orig_platform = sys.platform
+ self.assertRaises(NotImplementedError, factory.get,
+ port_name='unknown')
+
+ def test_unknown_default(self):
+ # Test what happens when you're running on an unknown platform.
+ orig_platform = sys.platform
+ sys.platform = 'unknown'
+ self.assertRaises(NotImplementedError, factory.get)
+ sys.platform = orig_platform
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
new file mode 100644
index 0000000..8d94bb5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome.py
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from __future__ import with_statement
+
+import codecs
+import os
+
+
+def _test_expectations_overrides(port, super):
+ # The chrome ports use the regular overrides plus anything in the
+ # official test_expectations as well. Hopefully we don't get collisions.
+ chromium_overrides = super.test_expectations_overrides(port)
+
+ # FIXME: It used to be that AssertionError would get raised by
+ # path_from_chromium_base() if we weren't in a Chromium checkout, but
+ # this changed in r60427. This should probably be changed back.
+ overrides_path = port.path_from_chromium_base('webkit', 'tools',
+ 'layout_tests', 'test_expectations_chrome.txt')
+ if not os.path.exists(overrides_path):
+ return chromium_overrides
+
+ with codecs.open(overrides_path, "r", "utf-8") as file:
+ if chromium_overrides:
+ return chromium_overrides + file.read()
+ else:
+ return file.read()
+
+def GetGoogleChromePort(**kwargs):
+ """Some tests have slightly different results when compiled as Google
+ Chrome vs Chromium. In those cases, we prepend an additional directory to
+ to the baseline paths."""
+ port_name = kwargs['port_name']
+ del kwargs['port_name']
+ if port_name == 'google-chrome-linux32':
+ import chromium_linux
+
+ class GoogleChromeLinux32Port(chromium_linux.ChromiumLinuxPort):
+ def baseline_search_path(self):
+ paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(
+ self)
+ paths.insert(0, self._webkit_baseline_path(
+ 'google-chrome-linux32'))
+ return paths
+
+ def test_expectations_overrides(self):
+ return _test_expectations_overrides(self,
+ chromium_linux.ChromiumLinuxPort)
+
+ return GoogleChromeLinux32Port(**kwargs)
+ elif port_name == 'google-chrome-linux64':
+ import chromium_linux
+
+ class GoogleChromeLinux64Port(chromium_linux.ChromiumLinuxPort):
+ def baseline_search_path(self):
+ paths = chromium_linux.ChromiumLinuxPort.baseline_search_path(
+ self)
+ paths.insert(0, self._webkit_baseline_path(
+ 'google-chrome-linux64'))
+ return paths
+
+ def test_expectations_overrides(self):
+ return _test_expectations_overrides(self,
+ chromium_linux.ChromiumLinuxPort)
+
+ return GoogleChromeLinux64Port(**kwargs)
+ elif port_name.startswith('google-chrome-mac'):
+ import chromium_mac
+
+ class GoogleChromeMacPort(chromium_mac.ChromiumMacPort):
+ def baseline_search_path(self):
+ paths = chromium_mac.ChromiumMacPort.baseline_search_path(
+ self)
+ paths.insert(0, self._webkit_baseline_path(
+ 'google-chrome-mac'))
+ return paths
+
+ def test_expectations_overrides(self):
+ return _test_expectations_overrides(self,
+ chromium_mac.ChromiumMacPort)
+
+ return GoogleChromeMacPort(**kwargs)
+ elif port_name.startswith('google-chrome-win'):
+ import chromium_win
+
+ class GoogleChromeWinPort(chromium_win.ChromiumWinPort):
+ def baseline_search_path(self):
+ paths = chromium_win.ChromiumWinPort.baseline_search_path(
+ self)
+ paths.insert(0, self._webkit_baseline_path(
+ 'google-chrome-win'))
+ return paths
+
+ def test_expectations_overrides(self):
+ return _test_expectations_overrides(self,
+ chromium_win.ChromiumWinPort)
+
+ return GoogleChromeWinPort(**kwargs)
+ raise NotImplementedError('unsupported port: %s' % port_name)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
new file mode 100644
index 0000000..e60c274
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import codecs
+import os
+import unittest
+
+from webkitpy.common import newstringio
+
+import factory
+import google_chrome
+
+
+class GetGoogleChromePortTest(unittest.TestCase):
+ def test_get_google_chrome_port(self):
+ test_ports = ('google-chrome-linux32', 'google-chrome-linux64',
+ 'google-chrome-mac', 'google-chrome-win')
+ for port in test_ports:
+ self._verify_baseline_path(port, port)
+ self._verify_expectations_overrides(port)
+
+ self._verify_baseline_path('google-chrome-mac', 'google-chrome-mac-leopard')
+ self._verify_baseline_path('google-chrome-win', 'google-chrome-win-xp')
+ self._verify_baseline_path('google-chrome-win', 'google-chrome-win-vista')
+
+ def _verify_baseline_path(self, expected_path, port_name):
+ port = google_chrome.GetGoogleChromePort(port_name=port_name,
+ options=None)
+ path = port.baseline_search_path()[0]
+ self.assertEqual(expected_path, os.path.split(path)[1])
+
+ def _verify_expectations_overrides(self, port_name):
+ # FIXME: make this more robust when we have the Tree() abstraction.
+ # we should be able to test for the files existing or not, and
+ # be able to control the contents better.
+
+ chromium_port = factory.get("chromium-mac")
+ chromium_overrides = chromium_port.test_expectations_overrides()
+ port = google_chrome.GetGoogleChromePort(port_name=port_name,
+ options=None)
+
+ orig_exists = os.path.exists
+ orig_open = codecs.open
+ expected_string = "// hello, world\n"
+
+ def mock_exists_chrome_not_found(path):
+ if 'test_expectations_chrome.txt' in path:
+ return False
+ return orig_exists(path)
+
+ def mock_exists_chrome_found(path):
+ if 'test_expectations_chrome.txt' in path:
+ return True
+ return orig_exists(path)
+
+ def mock_open(path, mode, encoding):
+ if 'test_expectations_chrome.txt' in path:
+ return newstringio.StringIO(expected_string)
+ return orig_open(path, mode, encoding)
+
+ try:
+ os.path.exists = mock_exists_chrome_not_found
+ chrome_overrides = port.test_expectations_overrides()
+ self.assertEqual(chromium_overrides, chrome_overrides)
+
+ os.path.exists = mock_exists_chrome_found
+ codecs.open = mock_open
+ chrome_overrides = port.test_expectations_overrides()
+ if chromium_overrides:
+ self.assertEqual(chrome_overrides,
+ chromium_overrides + expected_string)
+ else:
+ self.assertEqual(chrome_overrides, expected_string)
+ finally:
+ os.path.exists = orig_exists
+ codecs.open = orig_open
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py
new file mode 100644
index 0000000..c60909e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/gtk.py
@@ -0,0 +1,83 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the Google name nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""WebKit Gtk implementation of the Port interface."""
+
+import logging
+import os
+
+from webkitpy.layout_tests.port.webkit import WebKitPort
+
+_log = logging.getLogger("webkitpy.layout_tests.port.gtk")
+
+
+class GtkPort(WebKitPort):
+ """WebKit Gtk implementation of the Port class."""
+
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'gtk')
+ WebKitPort.__init__(self, **kwargs)
+
+ def _tests_for_other_platforms(self):
+ # FIXME: This list could be dynamic based on platform name and
+ # pushed into base.Port.
+ # This really need to be automated.
+ return [
+ "platform/chromium",
+ "platform/win",
+ "platform/qt",
+ "platform/mac",
+ ]
+
+ def _path_to_apache_config_file(self):
+ # FIXME: This needs to detect the distribution and change config files.
+ return os.path.join(self.layout_tests_dir(), 'http', 'conf',
+ 'apache2-debian-httpd.conf')
+
+ def _shut_down_http_server(self, server_pid):
+ """Shut down the httpd web server. Blocks until it's fully
+ shut down.
+
+ Args:
+ server_pid: The process ID of the running server.
+ """
+ # server_pid is not set when "http_server.py stop" is run manually.
+ if server_pid is None:
+ # FIXME: This isn't ideal, since it could conflict with
+ # lighttpd processes not started by http_server.py,
+ # but good enough for now.
+ self._executive.kill_all('apache2')
+ else:
+ try:
+ os.kill(server_pid, signal.SIGTERM)
+ # TODO(mmoss) Maybe throw in a SIGKILL just to be sure?
+ except OSError:
+ # Sometimes we get a bad PID (e.g. from a stale httpd.pid
+ # file), so if kill fails on the given PID, just try to
+ # 'killall' web servers.
+ self._shut_down_http_server(None)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
new file mode 100644
index 0000000..8995b21
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
@@ -0,0 +1,132 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
+# Copyright (C) 2010 Andras Becsi (abecsi@inf.u-szeged.hu), University of Szeged
+#
+# 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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.
+
+"""This class helps to block NRWT threads when more NRWTs run
+http and websocket tests in a same time."""
+
+import glob
+import logging
+import os
+import sys
+import tempfile
+import time
+
+from webkitpy.common.system.executive import Executive
+from webkitpy.common.system.file_lock import FileLock
+
+
+_log = logging.getLogger("webkitpy.layout_tests.port.http_lock")
+
+
+class HttpLock(object):
+
+ def __init__(self, lock_path, lock_file_prefix="WebKitHttpd.lock.",
+ guard_lock="WebKit.lock"):
+ self._lock_path = lock_path
+ if not self._lock_path:
+ self._lock_path = tempfile.gettempdir()
+ self._lock_file_prefix = lock_file_prefix
+ self._lock_file_path_prefix = os.path.join(self._lock_path,
+ self._lock_file_prefix)
+ self._guard_lock_file = os.path.join(self._lock_path, guard_lock)
+ self._guard_lock = FileLock(self._guard_lock_file)
+ self._process_lock_file_name = ""
+ self._executive = Executive()
+
+ def cleanup_http_lock(self):
+ """Delete the lock file if exists."""
+ if os.path.exists(self._process_lock_file_name):
+ _log.debug("Removing lock file: %s" % self._process_lock_file_name)
+ os.unlink(self._process_lock_file_name)
+
+ def _extract_lock_number(self, lock_file_name):
+ """Return the lock number from lock file."""
+ prefix_length = len(self._lock_file_path_prefix)
+ return int(lock_file_name[prefix_length:])
+
+ def _lock_file_list(self):
+ """Return the list of lock files sequentially."""
+ lock_list = glob.glob(self._lock_file_path_prefix + '*')
+ lock_list.sort(key=self._extract_lock_number)
+ return lock_list
+
+ def _next_lock_number(self):
+ """Return the next available lock number."""
+ lock_list = self._lock_file_list()
+ if not lock_list:
+ return 0
+ return self._extract_lock_number(lock_list[-1]) + 1
+
+ def _curent_lock_pid(self):
+ """Return with the current lock pid. If the lock is not valid
+ it deletes the lock file."""
+ lock_list = self._lock_file_list()
+ if not lock_list:
+ return
+ try:
+ current_lock_file = open(lock_list[0], 'r')
+ current_pid = current_lock_file.readline()
+ current_lock_file.close()
+ if not (current_pid and self._executive.check_running_pid(int(current_pid))):
+ _log.debug("Removing stuck lock file: %s" % lock_list[0])
+ os.unlink(lock_list[0])
+ return
+ except (IOError, OSError):
+ return
+ return int(current_pid)
+
+ def _create_lock_file(self):
+ """The lock files are used to schedule the running test sessions in first
+ come first served order. The guard lock ensures that the lock numbers are
+ sequential."""
+ if not os.path.exists(self._lock_path):
+ _log.debug("Lock directory does not exist: %s" % self._lock_path)
+ return False
+
+ if not self._guard_lock.acquire_lock():
+ _log.debug("Guard lock timed out!")
+ return False
+
+ self._process_lock_file_name = (self._lock_file_path_prefix +
+ str(self._next_lock_number()))
+ _log.debug("Creating lock file: %s" % self._process_lock_file_name)
+ lock_file = open(self._process_lock_file_name, 'w')
+ lock_file.write(str(os.getpid()))
+ lock_file.close()
+ self._guard_lock.release_lock()
+ return True
+
+
+ def wait_for_httpd_lock(self):
+ """Create a lock file and wait until it's turn comes. If something goes wrong
+ it wont do any locking."""
+ if not self._create_lock_file():
+ _log.debug("Warning, http locking failed!")
+ return
+
+ while self._curent_lock_pid() != os.getpid():
+ time.sleep(1)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock_unittest.py
new file mode 100644
index 0000000..85c760a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock_unittest.py
@@ -0,0 +1,111 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
+#
+# 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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.
+
+import glob
+import http_lock
+import os
+import unittest
+
+
+class HttpLockTest(unittest.TestCase):
+
+ def __init__(self, testFunc):
+ self.http_lock_obj = http_lock.HttpLock(None, "WebKitTestHttpd.lock.", "WebKitTest.lock")
+ self.lock_file_path_prefix = os.path.join(self.http_lock_obj._lock_path,
+ self.http_lock_obj._lock_file_prefix)
+ self.lock_file_name = self.lock_file_path_prefix + "0"
+ self.guard_lock_file = self.http_lock_obj._guard_lock_file
+ self.clean_all_lockfile()
+ unittest.TestCase.__init__(self, testFunc)
+
+ def clean_all_lockfile(self):
+ if os.path.exists(self.guard_lock_file):
+ os.unlink(self.guard_lock_file)
+ lock_list = glob.glob(self.lock_file_path_prefix + '*')
+ for file_name in lock_list:
+ os.unlink(file_name)
+
+ def assertEqual(self, first, second):
+ if first != second:
+ self.clean_all_lockfile()
+ unittest.TestCase.assertEqual(self, first, second)
+
+ def _check_lock_file(self):
+ if os.path.exists(self.lock_file_name):
+ pid = os.getpid()
+ lock_file = open(self.lock_file_name, 'r')
+ lock_file_pid = lock_file.readline()
+ lock_file.close()
+ self.assertEqual(pid, int(lock_file_pid))
+ return True
+ return False
+
+ def test_lock_lifecycle(self):
+ self.http_lock_obj._create_lock_file()
+
+ self.assertEqual(True, self._check_lock_file())
+ self.assertEqual(1, self.http_lock_obj._next_lock_number())
+
+ self.http_lock_obj.cleanup_http_lock()
+
+ self.assertEqual(False, self._check_lock_file())
+ self.assertEqual(0, self.http_lock_obj._next_lock_number())
+
+ def test_extract_lock_number(self,):
+ lock_file_list = (
+ self.lock_file_path_prefix + "00",
+ self.lock_file_path_prefix + "9",
+ self.lock_file_path_prefix + "001",
+ self.lock_file_path_prefix + "021",
+ )
+
+ expected_number_list = (0, 9, 1, 21)
+
+ for lock_file, expected in zip(lock_file_list, expected_number_list):
+ self.assertEqual(self.http_lock_obj._extract_lock_number(lock_file), expected)
+
+ def test_lock_file_list(self):
+ lock_file_list = [
+ self.lock_file_path_prefix + "6",
+ self.lock_file_path_prefix + "1",
+ self.lock_file_path_prefix + "4",
+ self.lock_file_path_prefix + "3",
+ ]
+
+ expected_file_list = [
+ self.lock_file_path_prefix + "1",
+ self.lock_file_path_prefix + "3",
+ self.lock_file_path_prefix + "4",
+ self.lock_file_path_prefix + "6",
+ ]
+
+ for file_name in lock_file_list:
+ open(file_name, 'w')
+
+ self.assertEqual(self.http_lock_obj._lock_file_list(), expected_file_list)
+
+ for file_name in lock_file_list:
+ os.unlink(file_name)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
index 0315704..0f8a21e 100755
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
@@ -29,7 +29,9 @@
"""A class to help start/stop the lighttpd server used by layout tests."""
+from __future__ import with_statement
+import codecs
import logging
import optparse
import os
@@ -40,8 +42,11 @@ import tempfile
import time
import urllib
+import factory
import http_server_base
+_log = logging.getLogger("webkitpy.layout_tests.port.http_server")
+
class HttpdNotStarted(Exception):
pass
@@ -50,7 +55,7 @@ class HttpdNotStarted(Exception):
class Lighttpd(http_server_base.HttpServerBase):
def __init__(self, port_obj, output_dir, background=False, port=None,
- root=None, register_cygwin=None, run_background=None):
+ root=None, run_background=None):
"""Args:
output_dir: the absolute path to the layout test result directory
"""
@@ -60,7 +65,6 @@ class Lighttpd(http_server_base.HttpServerBase):
self._process = None
self._port = port
self._root = root
- self._register_cygwin = register_cygwin
self._run_background = run_background
if self._port:
self._port = int(self._port)
@@ -111,11 +115,14 @@ class Lighttpd(http_server_base.HttpServerBase):
self.remove_log_files(self._output_dir, "error.log-")
# Write out the config
- f = file(base_conf_file, 'rb')
- base_conf = f.read()
- f.close()
-
- f = file(out_conf_file, 'wb')
+ with codecs.open(base_conf_file, "r", "utf-8") as file:
+ base_conf = file.read()
+
+ # FIXME: This should be re-worked so that this block can
+ # use with open() instead of a manual file.close() call.
+ # lighttpd.conf files seem to be UTF-8 without BOM:
+ # http://redmine.lighttpd.net/issues/992
+ f = codecs.open(out_conf_file, "w", "utf-8")
f.write(base_conf)
# Write out our cgi handlers. Run perl through env so that it
@@ -191,20 +198,9 @@ class Lighttpd(http_server_base.HttpServerBase):
shutil.copyfile(os.path.join(module_path, lib_file),
os.path.join(tmp_module_path, lib_file))
- # Put the cygwin directory first in the path to find cygwin1.dll
- env = os.environ
- if sys.platform in ('cygwin', 'win32'):
- env['PATH'] = '%s;%s' % (
- self._port_obj.path_from_chromium_base('third_party',
- 'cygwin', 'bin'),
- env['PATH'])
-
- if sys.platform == 'win32' and self._register_cygwin:
- setup_mount = port.path_from_chromium_base('third_party',
- 'cygwin', 'setup_mount.bat')
- subprocess.Popen(setup_mount).wait()
-
- logging.debug('Starting http server')
+ env = self._port_obj.setup_environ_for_server()
+ _log.debug('Starting http server')
+ # FIXME: Should use Executive.run_command
self._process = subprocess.Popen(start_cmd, env=env)
# Wait for server to start.
@@ -216,7 +212,7 @@ class Lighttpd(http_server_base.HttpServerBase):
if not server_started or self._process.returncode != None:
raise google.httpd_utils.HttpdNotStarted('Failed to start httpd.')
- logging.debug("Server successfully started")
+ _log.debug("Server successfully started")
# TODO(deanm): Find a nicer way to shutdown cleanly. Our log files are
# probably not being flushed, etc... why doesn't our python have os.kill ?
@@ -231,42 +227,7 @@ class Lighttpd(http_server_base.HttpServerBase):
self._port_obj._shut_down_http_server(httpd_pid)
if self._process:
+ # wait() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
self._process.wait()
self._process = None
-
-if '__main__' == __name__:
- # Provide some command line params for starting/stopping the http server
- # manually. Also used in ui_tests to run http layout tests in a browser.
- option_parser = optparse.OptionParser()
- option_parser.add_option('-k', '--server',
- help='Server action (start|stop)')
- option_parser.add_option('-p', '--port',
- help='Port to listen on (overrides layout test ports)')
- option_parser.add_option('-r', '--root',
- help='Absolute path to DocumentRoot (overrides layout test roots)')
- option_parser.add_option('--register_cygwin', action="store_true",
- dest="register_cygwin", help='Register Cygwin paths (on Win try bots)')
- option_parser.add_option('--run_background', action="store_true",
- dest="run_background",
- help='Run on background (for running as UI test)')
- options, args = option_parser.parse_args()
-
- if not options.server:
- print ('Usage: %s --server {start|stop} [--root=root_dir]'
- ' [--port=port_number]' % sys.argv[0])
- else:
- if (options.root is None) and (options.port is not None):
- # specifying root but not port means we want httpd on default
- # set of ports that LayoutTest use, but pointing to a different
- # source of tests. Specifying port but no root does not seem
- # meaningful.
- raise 'Specifying port requires also a root.'
- httpd = Lighttpd(tempfile.gettempdir(),
- port=options.port,
- root=options.root,
- register_cygwin=options.register_cygwin,
- run_background=options.run_background)
- if 'start' == options.server:
- httpd.start()
- else:
- httpd.stop(force=True)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
index e82943e..2745cce 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server_base.py
@@ -34,6 +34,8 @@ import os
import time
import urllib
+_log = logging.getLogger("webkitpy.layout_tests.port.http_server_base")
+
class HttpServerBase(object):
@@ -47,6 +49,7 @@ class HttpServerBase(object):
while time.time() - start_time < 20:
if action():
return True
+ _log.debug("Waiting for action: %s" % action)
time.sleep(1)
return False
@@ -63,9 +66,9 @@ class HttpServerBase(object):
try:
response = urllib.urlopen(url)
- logging.debug("Server running at %s" % url)
- except IOError:
- logging.debug("Server NOT running at %s" % url)
+ _log.debug("Server running at %s" % url)
+ except IOError, e:
+ _log.debug("Server NOT running at %s: %s" % (url, e))
return False
return True
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/lighttpd.conf b/WebKitTools/Scripts/webkitpy/layout_tests/port/lighttpd.conf
index d3150dd..26ca22f 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/lighttpd.conf
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/lighttpd.conf
@@ -21,7 +21,8 @@ mimetype.assign = (
".html" => "text/html",
".htm" => "text/html",
".xhtml" => "application/xhtml+xml",
- ".js" => "text/javascript",
+ ".xhtmlmp" => "application/vnd.wap.xhtml+xml",
+ ".js" => "application/x-javascript",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
index 4b73cec..696e339 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -29,137 +28,62 @@
"""WebKit Mac implementation of the Port interface."""
-import fcntl
import logging
import os
-import pdb
import platform
-import select
import signal
-import subprocess
-import sys
-import time
-import webbrowser
-import base
+import webkitpy.common.system.ospath as ospath
+import webkitpy.layout_tests.port.server_process as server_process
+from webkitpy.layout_tests.port.webkit import WebKitPort, WebKitDriver
-import webkitpy
-from webkitpy import executive
+_log = logging.getLogger("webkitpy.layout_tests.port.mac")
-class MacPort(base.Port):
+
+class MacPort(WebKitPort):
"""WebKit Mac implementation of the Port class."""
- def __init__(self, port_name=None, options=None):
- if port_name is None:
- port_name = 'mac' + self.version()
- base.Port.__init__(self, port_name, options)
- self._cached_build_root = None
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'mac' + self.version())
+ WebKitPort.__init__(self, **kwargs)
+
+ def default_child_processes(self):
+ # FIXME: new-run-webkit-tests is unstable on Mac running more than
+ # four threads in parallel.
+ # See https://bugs.webkit.org/show_bug.cgi?id=36622
+ child_processes = WebKitPort.default_child_processes(self)
+ if child_processes > 4:
+ return 4
+ return child_processes
def baseline_search_path(self):
- dirs = []
+ port_names = []
if self._name == 'mac-tiger':
- dirs.append(self._webkit_baseline_path(self._name))
+ port_names.append("mac-tiger")
if self._name in ('mac-tiger', 'mac-leopard'):
- dirs.append(self._webkit_baseline_path('mac-leopard'))
+ port_names.append("mac-leopard")
if self._name in ('mac-tiger', 'mac-leopard', 'mac-snowleopard'):
- dirs.append(self._webkit_baseline_path('mac-snowleopard'))
- dirs.append(self._webkit_baseline_path('mac'))
- return dirs
-
- def check_sys_deps(self):
- # FIXME: This should run build-dumprendertree.
- # This should also validate that all of the tool paths are valid.
- return True
-
- def num_cores(self):
- return int(os.popen2("sysctl -n hw.ncpu")[1].read())
-
- def results_directory(self):
- return ('/tmp/run-chromium-webkit-tests-' +
- self._options.results_directory)
-
- def setup_test_run(self):
- # This port doesn't require any specific configuration.
- pass
+ port_names.append("mac-snowleopard")
+ port_names.append("mac")
+ return map(self._webkit_baseline_path, port_names)
- def show_results_html_file(self, results_filename):
- uri = self.filename_to_uri(results_filename)
- webbrowser.open(uri, new=1)
+ def path_to_test_expectations_file(self):
+ return self.path_from_webkit_base('LayoutTests', 'platform',
+ 'mac', 'test_expectations.txt')
- def start_driver(self, image_path, options):
- """Starts a new Driver and returns a handle to it."""
- return MacDriver(self, image_path, options)
-
- def start_helper(self):
- # This port doesn't use a helper process.
- pass
-
- def stop_helper(self):
- # This port doesn't use a helper process.
- pass
-
- def test_base_platform_names(self):
- # At the moment we don't use test platform names, but we have
- # to return something.
- return ('mac',)
-
- def test_expectations(self):
- #
- # The WebKit mac port uses 'Skipped' files at the moment. Each
- # file contains a list of files or directories to be skipped during
- # the test run. The total list of tests to skipped is given by the
- # contents of the generic Skipped file found in platform/X plus
- # a version-specific file found in platform/X-version. Duplicate
- # entries are allowed. This routine reads those files and turns
- # contents into the format expected by test_expectations.
- expectations = []
+ def _skipped_file_paths(self):
+ # FIXME: This method will need to be made work for non-mac
+ # platforms and moved into base.Port.
skipped_files = []
if self._name in ('mac-tiger', 'mac-leopard', 'mac-snowleopard'):
skipped_files.append(os.path.join(
self._webkit_baseline_path(self._name), 'Skipped'))
skipped_files.append(os.path.join(self._webkit_baseline_path('mac'),
'Skipped'))
- for filename in skipped_files:
- if os.path.exists(filename):
- f = file(filename)
- for l in f.readlines():
- l = l.strip()
- if not l.startswith('#') and len(l):
- l = 'BUG_SKIPPED SKIP : ' + l + ' = FAIL'
- if l not in expectations:
- expectations.append(l)
- f.close()
-
- # TODO - figure out how to check for these dynamically
- expectations.append('BUG_SKIPPED SKIP : fast/wcss = FAIL')
- expectations.append('BUG_SKIPPED SKIP : fast/xhtmlmp = FAIL')
- expectations.append('BUG_SKIPPED SKIP : http/tests/wml = FAIL')
- expectations.append('BUG_SKIPPED SKIP : mathml = FAIL')
- expectations.append('BUG_SKIPPED SKIP : platform/chromium = FAIL')
- expectations.append('BUG_SKIPPED SKIP : platform/gtk = FAIL')
- expectations.append('BUG_SKIPPED SKIP : platform/qt = FAIL')
- expectations.append('BUG_SKIPPED SKIP : platform/win = FAIL')
- expectations.append('BUG_SKIPPED SKIP : wml = FAIL')
-
- # TODO - figure out how to handle webarchive tests
- expectations.append('BUG_SKIPPED SKIP : webarchive = PASS')
- expectations.append('BUG_SKIPPED SKIP : svg/webarchive = PASS')
- expectations.append('BUG_SKIPPED SKIP : http/tests/webarchive = PASS')
- expectations.append('BUG_SKIPPED SKIP : svg/custom/'
- 'image-with-prefix-in-webarchive.svg = PASS')
-
- expectations_str = '\n'.join(expectations)
- return expectations_str
+ return skipped_files
def test_platform_name(self):
- # At the moment we don't use test platform names, but we have
- # to return something.
- return 'mac'
-
- def test_platform_names(self):
- # At the moment we don't use test platform names, but we have
- # to return something.
- return ('mac',)
+ return 'mac' + self.version()
def version(self):
os_version_string = platform.mac_ver()[0] # e.g. "10.5.6"
@@ -174,53 +98,36 @@ class MacPort(base.Port):
return '-snowleopard'
return ''
- #
- # PROTECTED METHODS
- #
-
- def _build_path(self, *comps):
- if not self._cached_build_root:
- self._cached_build_root = executive.run_command(["webkit-build-directory", "--base"]).rstrip()
- return os.path.join(self._cached_build_root, self._options.target, *comps)
-
- def _kill_process(self, pid):
- """Forcefully kill the process.
-
- Args:
- pid: The id of the process to be killed.
- """
- os.kill(pid, signal.SIGKILL)
-
- def _kill_all_process(self, process_name):
- # On Mac OS X 10.6, killall has a new constraint: -SIGNALNAME or
- # -SIGNALNUMBER must come first. Example problem:
- # $ killall -u $USER -TERM lighttpd
- # killall: illegal option -- T
- # Use of the earlier -TERM placement is just fine on 10.5.
- null = open(os.devnull)
- subprocess.call(['killall', '-TERM', '-u', os.getenv('USER'),
- process_name], stderr=null)
- null.close()
+ def _build_java_test_support(self):
+ java_tests_path = os.path.join(self.layout_tests_dir(), "java")
+ build_java = ["/usr/bin/make", "-C", java_tests_path]
+ if self._executive.run_command(build_java, return_exit_code=True):
+ _log.error("Failed to build Java support files: %s" % build_java)
+ return False
+ return True
- def _path_to_apache(self):
- return '/usr/sbin/httpd'
+ def _check_port_build(self):
+ return self._build_java_test_support()
+
+ def _tests_for_other_platforms(self):
+ # The original run-webkit-tests builds up a "whitelist" of tests to
+ # run, and passes that to DumpRenderTree. new-run-webkit-tests assumes
+ # we run *all* tests and test_expectations.txt functions as a
+ # blacklist.
+ # FIXME: This list could be dynamic based on platform name and
+ # pushed into base.Port.
+ return [
+ "platform/chromium",
+ "platform/gtk",
+ "platform/qt",
+ "platform/win",
+ ]
def _path_to_apache_config_file(self):
return os.path.join(self.layout_tests_dir(), 'http', 'conf',
'apache2-httpd.conf')
- def _path_to_driver(self):
- return self._build_path('DumpRenderTree')
-
- def _path_to_helper(self):
- return None
-
- def _path_to_image_diff(self):
- return self._build_path('image_diff') # FIXME: This is wrong and should be "ImageDiff", but having the correct path causes other parts of the script to hang.
-
- def _path_to_wdiff(self):
- return 'wdiff' # FIXME: This does not exist on a default Mac OS X Leopard install.
-
+ # FIXME: This doesn't have anything to do with WebKit.
def _shut_down_http_server(self, server_pid):
"""Shut down the lighttpd web server. Blocks until it's fully
shut down.
@@ -230,210 +137,16 @@ class MacPort(base.Port):
"""
# server_pid is not set when "http_server.py stop" is run manually.
if server_pid is None:
- # TODO(mmoss) This isn't ideal, since it could conflict with
+ # FIXME: This isn't ideal, since it could conflict with
# lighttpd processes not started by http_server.py,
# but good enough for now.
- self._kill_all_process('httpd')
+ self._executive.kill_all('httpd')
else:
try:
os.kill(server_pid, signal.SIGTERM)
- # TODO(mmoss) Maybe throw in a SIGKILL just to be sure?
+ # FIXME: Maybe throw in a SIGKILL just to be sure?
except OSError:
# Sometimes we get a bad PID (e.g. from a stale httpd.pid
# file), so if kill fails on the given PID, just try to
# 'killall' web servers.
self._shut_down_http_server(None)
-
-
-class MacDriver(base.Driver):
- """implementation of the DumpRenderTree interface."""
-
- def __init__(self, port, image_path, driver_options):
- self._port = port
- self._driver_options = driver_options
- self._target = port._options.target
- self._image_path = image_path
- self._stdout_fd = None
- self._cmd = None
- self._env = None
- self._proc = None
- self._read_buffer = ''
-
- cmd = []
- # Hook for injecting valgrind or other runtime instrumentation,
- # used by e.g. tools/valgrind/valgrind_tests.py.
- wrapper = os.environ.get("BROWSER_WRAPPER", None)
- if wrapper != None:
- cmd += [wrapper]
- if self._port._options.wrapper:
- # This split() isn't really what we want -- it incorrectly will
- # split quoted strings within the wrapper argument -- but in
- # practice it shouldn't come up and the --help output warns
- # about it anyway.
- cmd += self._options.wrapper.split()
- # FIXME: Using arch here masks any possible file-not-found errors from a non-existant driver executable.
- cmd += ['arch', '-i386', port._path_to_driver(), '-']
-
- # FIXME: This is a hack around our lack of ImageDiff support for now.
- if not self._port._options.no_pixel_tests:
- logging.warn("This port does not yet support pixel tests.")
- self._port._options.no_pixel_tests = True
- #cmd.append('--pixel-tests')
-
- #if driver_options:
- # cmd += driver_options
- env = os.environ
- env['DYLD_FRAMEWORK_PATH'] = self._port._build_path()
- self._cmd = cmd
- self._env = env
- self.restart()
-
- def poll(self):
- return self._proc.poll()
-
- def restart(self):
- self.stop()
- self._proc = subprocess.Popen(self._cmd, stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- env=self._env)
-
- def returncode(self):
- return self._proc.returncode
-
- def run_test(self, uri, timeoutms, image_hash):
- output = []
- error = []
- image = ''
- crash = False
- timeout = False
- actual_uri = None
- actual_image_hash = None
-
- if uri.startswith("file:///"):
- cmd = uri[7:]
- else:
- cmd = uri
-
- if image_hash:
- cmd += "'" + image_hash
- cmd += "\n"
-
- self._proc.stdin.write(cmd)
- self._stdout_fd = self._proc.stdout.fileno()
- fl = fcntl.fcntl(self._stdout_fd, fcntl.F_GETFL)
- fcntl.fcntl(self._stdout_fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
-
- stop_time = time.time() + (int(timeoutms) / 1000.0)
- resp = ''
- (timeout, line) = self._read_line(timeout, stop_time)
- resp += line
- have_seen_content_type = False
- while not timeout and line.rstrip() != "#EOF":
- # Make sure we haven't crashed.
- if line == '' and self.poll() is not None:
- # This is hex code 0xc000001d, which is used for abrupt
- # termination. This happens if we hit ctrl+c from the prompt
- # and we happen to be waiting on the test_shell.
- # sdoyon: Not sure for which OS and in what circumstances the
- # above code is valid. What works for me under Linux to detect
- # ctrl+c is for the subprocess returncode to be negative
- # SIGINT. And that agrees with the subprocess documentation.
- if (-1073741510 == self.returncode() or
- - signal.SIGINT == self.returncode()):
- raise KeyboardInterrupt
- crash = True
- break
-
- elif (line.startswith('Content-Type:') and not
- have_seen_content_type):
- have_seen_content_type = True
- pass
- else:
- output.append(line)
-
- (timeout, line) = self._read_line(timeout, stop_time)
- resp += line
-
- # Now read a second block of text for the optional image data
- image_length = 0
- (timeout, line) = self._read_line(timeout, stop_time)
- resp += line
- HASH_HEADER = 'ActualHash: '
- LENGTH_HEADER = 'Content-Length: '
- while not timeout and not crash and line.rstrip() != "#EOF":
- if line == '' and self.poll() is not None:
- if (-1073741510 == self.returncode() or
- - signal.SIGINT == self.returncode()):
- raise KeyboardInterrupt
- crash = True
- break
- elif line.startswith(HASH_HEADER):
- actual_image_hash = line[len(HASH_HEADER):].strip()
- elif line.startswith('Content-Type:'):
- pass
- elif line.startswith(LENGTH_HEADER):
- image_length = int(line[len(LENGTH_HEADER):])
- elif image_length:
- image += line
-
- (timeout, line) = self._read_line(timeout, stop_time, image_length)
- resp += line
-
- if timeout:
- self.restart()
-
- if self._image_path and len(self._image_path):
- image_file = file(self._image_path, "wb")
- image_file.write(image)
- image_file.close()
-
- return (crash, timeout, actual_image_hash,
- ''.join(output), ''.join(error))
- pass
-
- def stop(self):
- if self._proc:
- self._proc.stdin.close()
- self._proc.stdout.close()
- if self._proc.stderr:
- self._proc.stderr.close()
- if (sys.platform not in ('win32', 'cygwin') and
- not self._proc.poll()):
- # Closing stdin/stdout/stderr hangs sometimes on OS X.
- null = open(os.devnull, "w")
- subprocess.Popen(["kill", "-9",
- str(self._proc.pid)], stderr=null)
- null.close()
-
- def _read_line(self, timeout, stop_time, image_length=0):
- now = time.time()
- read_fds = []
-
- # first check to see if we have a line already read or if we've
- # read the entire image
- if image_length and len(self._read_buffer) >= image_length:
- out = self._read_buffer[0:image_length]
- self._read_buffer = self._read_buffer[image_length:]
- return (timeout, out)
-
- idx = self._read_buffer.find('\n')
- if not image_length and idx != -1:
- out = self._read_buffer[0:idx + 1]
- self._read_buffer = self._read_buffer[idx + 1:]
- return (timeout, out)
-
- # If we've timed out, return just what we have, if anything
- if timeout or now >= stop_time:
- out = self._read_buffer
- self._read_buffer = ''
- return (True, out)
-
- (read_fds, write_fds, err_fds) = select.select(
- [self._stdout_fd], [], [], stop_time - now)
- try:
- if timeout or len(read_fds) == 1:
- self._read_buffer += self._proc.stdout.read()
- except IOError, e:
- read = []
- return self._read_line(timeout, stop_time)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/mac_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac_unittest.py
new file mode 100644
index 0000000..d383a4c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/mac_unittest.py
@@ -0,0 +1,81 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import StringIO
+import sys
+import unittest
+
+import mac
+import port_testcase
+
+
+class MacTest(port_testcase.PortTestCase):
+ def make_port(self, options=port_testcase.mock_options):
+ if sys.platform != 'darwin':
+ return None
+ port_obj = mac.MacPort(options=options)
+ port_obj._options.results_directory = port_obj.results_directory()
+ port_obj._options.configuration = 'Release'
+ return port_obj
+
+ def test_skipped_file_paths(self):
+ port = self.make_port()
+ if not port:
+ return
+ skipped_paths = port._skipped_file_paths()
+ # FIXME: _skipped_file_paths should return WebKit-relative paths.
+ # So to make it unit testable, we strip the WebKit directory from the path.
+ relative_paths = [path[len(port.path_from_webkit_base()):] for path in skipped_paths]
+ self.assertEqual(relative_paths, ['LayoutTests/platform/mac-leopard/Skipped', 'LayoutTests/platform/mac/Skipped'])
+
+ example_skipped_file = u"""
+# <rdar://problem/5647952> fast/events/mouseout-on-window.html needs mac DRT to issue mouse out events
+fast/events/mouseout-on-window.html
+
+# <rdar://problem/5643675> window.scrollTo scrolls a window with no scrollbars
+fast/events/attempt-scroll-with-no-scrollbars.html
+
+# see bug <rdar://problem/5646437> REGRESSION (r28015): svg/batik/text/smallFonts fails
+svg/batik/text/smallFonts.svg
+"""
+ example_skipped_tests = [
+ "fast/events/mouseout-on-window.html",
+ "fast/events/attempt-scroll-with-no-scrollbars.html",
+ "svg/batik/text/smallFonts.svg",
+ ]
+
+ def test_skipped_file_paths(self):
+ port = self.make_port()
+ if not port:
+ return
+ skipped_file = StringIO.StringIO(self.example_skipped_file)
+ self.assertEqual(port._tests_from_skipped_file(skipped_file), self.example_skipped_tests)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py
new file mode 100644
index 0000000..04ada50
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/port_testcase.py
@@ -0,0 +1,89 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit testing base class for Port implementations."""
+
+import os
+import tempfile
+import unittest
+
+from webkitpy.tool import mocktool
+mock_options = mocktool.MockOptions(results_directory='layout-test-results',
+ use_apache=True,
+ configuration='Release')
+
+
+class PortTestCase(unittest.TestCase):
+ """Tests the WebKit port implementation."""
+ def make_port(self, options=mock_options):
+ """Override in subclass."""
+ raise NotImplementedError()
+
+ def test_http_server(self):
+ port = self.make_port()
+ if not port:
+ return
+ port.start_http_server()
+ port.stop_http_server()
+
+ def test_image_diff(self):
+ port = self.make_port()
+ if not port:
+ return
+
+ # FIXME: not sure why this shouldn't always be True
+ #self.assertTrue(port.check_image_diff())
+ if not port.check_image_diff():
+ return
+
+ dir = port.layout_tests_dir()
+ file1 = os.path.join(dir, 'fast', 'css', 'button_center.png')
+ fh1 = file(file1)
+ contents1 = fh1.read()
+ file2 = os.path.join(dir, 'fast', 'css',
+ 'remove-shorthand-expected.png')
+ fh2 = file(file2)
+ contents2 = fh2.read()
+ tmpfile = tempfile.mktemp()
+
+ self.assertFalse(port.diff_image(contents1, contents1))
+ self.assertTrue(port.diff_image(contents1, contents2))
+
+ self.assertTrue(port.diff_image(contents1, contents2, tmpfile))
+ fh1.close()
+ fh2.close()
+ # FIXME: this may not be being written?
+ # self.assertTrue(os.path.exists(tmpfile))
+ # os.remove(tmpfile)
+
+ def test_websocket_server(self):
+ port = self.make_port()
+ if not port:
+ return
+ port.start_websocket_server()
+ port.stop_websocket_server()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
new file mode 100644
index 0000000..af94acc
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/qt.py
@@ -0,0 +1,119 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the Google name nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""QtWebKit implementation of the Port interface."""
+
+import logging
+import os
+import signal
+import sys
+
+import webkit
+
+from webkitpy.layout_tests.port.webkit import WebKitPort
+
+_log = logging.getLogger("webkitpy.layout_tests.port.qt")
+
+
+class QtPort(WebKitPort):
+ """QtWebKit implementation of the Port class."""
+
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'qt')
+ WebKitPort.__init__(self, **kwargs)
+
+ def baseline_search_path(self):
+ port_names = []
+ if sys.platform == 'linux2':
+ port_names.append("qt-linux")
+ elif sys.platform in ('win32', 'cygwin'):
+ port_names.append("qt-win")
+ elif sys.platform == 'darwin':
+ port_names.append("qt-mac")
+ port_names.append("qt")
+ return map(self._webkit_baseline_path, port_names)
+
+ def _tests_for_other_platforms(self):
+ # FIXME: This list could be dynamic based on platform name and
+ # pushed into base.Port.
+ # This really need to be automated.
+ return [
+ "platform/chromium",
+ "platform/win",
+ "platform/gtk",
+ "platform/mac",
+ ]
+
+ def _path_to_apache_config_file(self):
+ # FIXME: This needs to detect the distribution and change config files.
+ return os.path.join(self.layout_tests_dir(), 'http', 'conf',
+ 'apache2-debian-httpd.conf')
+
+ def _shut_down_http_server(self, server_pid):
+ """Shut down the httpd web server. Blocks until it's fully
+ shut down.
+
+ Args:
+ server_pid: The process ID of the running server.
+ """
+ # server_pid is not set when "http_server.py stop" is run manually.
+ if server_pid is None:
+ # FIXME: This isn't ideal, since it could conflict with
+ # lighttpd processes not started by http_server.py,
+ # but good enough for now.
+ self._executive.kill_all('apache2')
+ else:
+ try:
+ os.kill(server_pid, signal.SIGTERM)
+ # TODO(mmoss) Maybe throw in a SIGKILL just to be sure?
+ except OSError:
+ # Sometimes we get a bad PID (e.g. from a stale httpd.pid
+ # file), so if kill fails on the given PID, just try to
+ # 'killall' web servers.
+ self._shut_down_http_server(None)
+
+ def _build_driver(self):
+ # The Qt port builds DRT as part of the main build step
+ return True
+
+ def _path_to_driver(self):
+ return self._build_path('bin/DumpRenderTree')
+
+ def _path_to_image_diff(self):
+ return self._build_path('bin/ImageDiff')
+
+ def _path_to_webcore_library(self):
+ return self._build_path('lib/libQtWebKit.so')
+
+ def _runtime_feature_list(self):
+ return None
+
+ def setup_environ_for_server(self):
+ env = webkit.WebKitPort.setup_environ_for_server(self)
+ env['QTWEBKIT_PLUGIN_PATH'] = self._build_path('lib/plugins')
+ return env
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py
new file mode 100644
index 0000000..5a0a40c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py
@@ -0,0 +1,225 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the Google name nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Package that implements the ServerProcess wrapper class"""
+
+import logging
+import os
+import select
+import signal
+import subprocess
+import sys
+import time
+if sys.platform != 'win32':
+ import fcntl
+
+from webkitpy.common.system.executive import Executive
+
+_log = logging.getLogger("webkitpy.layout_tests.port.server_process")
+
+
+class ServerProcess:
+ """This class provides a wrapper around a subprocess that
+ implements a simple request/response usage model. The primary benefit
+ is that reading responses takes a timeout, so that we don't ever block
+ indefinitely. The class also handles transparently restarting processes
+ as necessary to keep issuing commands."""
+
+ def __init__(self, port_obj, name, cmd, env=None, executive=Executive()):
+ self._port = port_obj
+ self._name = name
+ self._cmd = cmd
+ self._env = env
+ self._reset()
+ self._executive = executive
+
+ def _reset(self):
+ self._proc = None
+ self._output = ''
+ self.crashed = False
+ self.timed_out = False
+ self.error = ''
+
+ def _start(self):
+ if self._proc:
+ raise ValueError("%s already running" % self._name)
+ self._reset()
+ # close_fds is a workaround for http://bugs.python.org/issue2320
+ close_fds = sys.platform not in ('win32', 'cygwin')
+ self._proc = subprocess.Popen(self._cmd, stdin=subprocess.PIPE,
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ close_fds=close_fds,
+ env=self._env)
+ fd = self._proc.stdout.fileno()
+ fl = fcntl.fcntl(fd, fcntl.F_GETFL)
+ fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
+ fd = self._proc.stderr.fileno()
+ fl = fcntl.fcntl(fd, fcntl.F_GETFL)
+ fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
+
+ def handle_interrupt(self):
+ """This routine checks to see if the process crashed or exited
+ because of a keyboard interrupt and raises KeyboardInterrupt
+ accordingly."""
+ if self.crashed:
+ # This is hex code 0xc000001d, which is used for abrupt
+ # termination. This happens if we hit ctrl+c from the prompt
+ # and we happen to be waiting on the DumpRenderTree.
+ # sdoyon: Not sure for which OS and in what circumstances the
+ # above code is valid. What works for me under Linux to detect
+ # ctrl+c is for the subprocess returncode to be negative
+ # SIGINT. And that agrees with the subprocess documentation.
+ if (-1073741510 == self._proc.returncode or
+ - signal.SIGINT == self._proc.returncode):
+ raise KeyboardInterrupt
+ return
+
+ def poll(self):
+ """Check to see if the underlying process is running; returns None
+ if it still is (wrapper around subprocess.poll)."""
+ if self._proc:
+ # poll() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
+ return self._proc.poll()
+ return None
+
+ def write(self, input):
+ """Write a request to the subprocess. The subprocess is (re-)start()'ed
+ if is not already running."""
+ if not self._proc:
+ self._start()
+ self._proc.stdin.write(input)
+
+ def read_line(self, timeout):
+ """Read a single line from the subprocess, waiting until the deadline.
+ If the deadline passes, the call times out. Note that even if the
+ subprocess has crashed or the deadline has passed, if there is output
+ pending, it will be returned.
+
+ Args:
+ timeout: floating-point number of seconds the call is allowed
+ to block for. A zero or negative number will attempt to read
+ any existing data, but will not block. There is no way to
+ block indefinitely.
+ Returns:
+ output: data returned, if any. If no data is available and the
+ call times out or crashes, an empty string is returned. Note
+ that the returned string includes the newline ('\n')."""
+ return self._read(timeout, size=0)
+
+ def read(self, timeout, size):
+ """Attempts to read size characters from the subprocess, waiting until
+ the deadline passes. If the deadline passes, any available data will be
+ returned. Note that even if the deadline has passed or if the
+ subprocess has crashed, any available data will still be returned.
+
+ Args:
+ timeout: floating-point number of seconds the call is allowed
+ to block for. A zero or negative number will attempt to read
+ any existing data, but will not block. There is no way to
+ block indefinitely.
+ size: amount of data to read. Must be a postive integer.
+ Returns:
+ output: data returned, if any. If no data is available, an empty
+ string is returned.
+ """
+ if size <= 0:
+ raise ValueError('ServerProcess.read() called with a '
+ 'non-positive size: %d ' % size)
+ return self._read(timeout, size)
+
+ def _read(self, timeout, size):
+ """Internal routine that actually does the read."""
+ index = -1
+ out_fd = self._proc.stdout.fileno()
+ err_fd = self._proc.stderr.fileno()
+ select_fds = (out_fd, err_fd)
+ deadline = time.time() + timeout
+ while not self.timed_out and not self.crashed:
+ # poll() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
+ if self._proc.poll() != None:
+ self.crashed = True
+ self.handle_interrupt()
+
+ now = time.time()
+ if now > deadline:
+ self.timed_out = True
+
+ # Check to see if we have any output we can return.
+ if size and len(self._output) >= size:
+ index = size
+ elif size == 0:
+ index = self._output.find('\n') + 1
+
+ if index > 0 or self.crashed or self.timed_out:
+ output = self._output[0:index]
+ self._output = self._output[index:]
+ return output
+
+ # Nope - wait for more data.
+ (read_fds, write_fds, err_fds) = select.select(select_fds, [],
+ select_fds,
+ deadline - now)
+ try:
+ if out_fd in read_fds:
+ self._output += self._proc.stdout.read()
+ if err_fd in read_fds:
+ self.error += self._proc.stderr.read()
+ except IOError, e:
+ pass
+
+ def stop(self):
+ """Stop (shut down) the subprocess), if it is running."""
+ pid = self._proc.pid
+ self._proc.stdin.close()
+ self._proc.stdout.close()
+ if self._proc.stderr:
+ self._proc.stderr.close()
+ if sys.platform not in ('win32', 'cygwin'):
+ # Closing stdin/stdout/stderr hangs sometimes on OS X,
+ # (see restart(), above), and anyway we don't want to hang
+ # the harness if DumpRenderTree is buggy, so we wait a couple
+ # seconds to give DumpRenderTree a chance to clean up, but then
+ # force-kill the process if necessary.
+ KILL_TIMEOUT = 3.0
+ timeout = time.time() + KILL_TIMEOUT
+ # poll() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
+ while self._proc.poll() is None and time.time() < timeout:
+ time.sleep(0.1)
+ # poll() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
+ if self._proc.poll() is None:
+ _log.warning('stopping %s timed out, killing it' %
+ self._name)
+ self._executive.kill_process(self._proc.pid)
+ _log.warning('killed')
+ self._reset()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
index 0bc6e7c..0a27821 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test.py
@@ -28,63 +28,206 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Dummy Port implementation used for testing."""
+from __future__ import with_statement
+import codecs
+import fnmatch
import os
+import sys
import time
+from webkitpy.layout_tests.layout_package import test_output
+
import base
+# This sets basic expectations for a test. Each individual expectation
+# can be overridden by a keyword argument in TestList.add().
+class TestInstance:
+ def __init__(self, name):
+ self.name = name
+ self.base = name[(name.rfind("/") + 1):name.rfind(".html")]
+ self.crash = False
+ self.exception = False
+ self.hang = False
+ self.keyboard = False
+ self.error = ''
+ self.timeout = False
+ self.actual_text = self.base + '-txt\n'
+ self.actual_checksum = self.base + '-checksum\n'
+ self.actual_image = self.base + '-png\n'
+ self.expected_text = self.actual_text
+ self.expected_checksum = self.actual_checksum
+ self.expected_image = self.actual_image
+
+
+# This is an in-memory list of tests, what we want them to produce, and
+# what we want to claim are the expected results.
+class TestList:
+ def __init__(self, port):
+ self.port = port
+ self.tests = {}
+
+ def add(self, name, **kwargs):
+ test = TestInstance(name)
+ for key, value in kwargs.items():
+ test.__dict__[key] = value
+ self.tests[name] = test
+
+ def keys(self):
+ return self.tests.keys()
+
+ def __contains__(self, item):
+ return item in self.tests
+
+ def __getitem__(self, item):
+ return self.tests[item]
+
+
class TestPort(base.Port):
"""Test implementation of the Port interface."""
- def __init__(self, port_name=None, options=None):
- base.Port.__init__(self, port_name, options)
-
- def base_platforms(self):
- return ('test',)
+ def __init__(self, **kwargs):
+ base.Port.__init__(self, **kwargs)
+ tests = TestList(self)
+ tests.add('passes/image.html')
+ tests.add('passes/text.html')
+ tests.add('failures/expected/checksum.html',
+ actual_checksum='checksum_fail-checksum')
+ tests.add('failures/expected/crash.html', crash=True)
+ tests.add('failures/expected/exception.html', exception=True)
+ tests.add('failures/expected/timeout.html', timeout=True)
+ tests.add('failures/expected/hang.html', hang=True)
+ tests.add('failures/expected/missing_text.html',
+ expected_text=None)
+ tests.add('failures/expected/image.html',
+ actual_image='image_fail-png',
+ expected_image='image-png')
+ tests.add('failures/expected/image_checksum.html',
+ actual_checksum='image_checksum_fail-checksum',
+ actual_image='image_checksum_fail-png')
+ tests.add('failures/expected/keyboard.html',
+ keyboard=True)
+ tests.add('failures/expected/missing_check.html',
+ expected_checksum=None)
+ tests.add('failures/expected/missing_image.html',
+ expected_image=None)
+ tests.add('failures/expected/missing_text.html',
+ expected_text=None)
+ tests.add('failures/expected/text.html',
+ actual_text='text_fail-png')
+ tests.add('failures/unexpected/text-image-checksum.html',
+ actual_text='text-image-checksum_fail-txt',
+ actual_checksum='text-image-checksum_fail-checksum')
+ tests.add('http/tests/passes/text.html')
+ tests.add('http/tests/ssl/text.html')
+ tests.add('passes/error.html', error='stuff going to stderr')
+ tests.add('passes/image.html')
+ tests.add('passes/platform_image.html')
+ tests.add('passes/text.html')
+ tests.add('websocket/tests/passes/text.html')
+ self._tests = tests
def baseline_path(self):
- curdir = os.path.abspath(__file__)
- self.topdir = curdir[0:curdir.index("WebKitTools")]
- return os.path.join(self.topdir, 'LayoutTests', 'platform', 'test')
+ return os.path.join(self.layout_tests_dir(), 'platform',
+ self.name() + self.version())
def baseline_search_path(self):
return [self.baseline_path()]
- def check_sys_deps(self):
+ def check_build(self, needs_http):
return True
- def diff_image(self, actual_filename, expected_filename, diff_filename):
+ def diff_image(self, expected_contents, actual_contents,
+ diff_filename=None):
+ diffed = actual_contents != expected_contents
+ if diffed and diff_filename:
+ with codecs.open(diff_filename, "w", "utf-8") as diff_fh:
+ diff_fh.write("< %s\n---\n> %s\n" %
+ (expected_contents, actual_contents))
+ return diffed
+
+ def expected_checksum(self, test):
+ test = self.relative_test_filename(test)
+ return self._tests[test].expected_checksum
+
+ def expected_image(self, test):
+ test = self.relative_test_filename(test)
+ return self._tests[test].expected_image
+
+ def expected_text(self, test):
+ test = self.relative_test_filename(test)
+ text = self._tests[test].expected_text
+ if not text:
+ text = ''
+ return text
+
+ def tests(self, paths):
+ # Test the idea of port-specific overrides for test lists. Also
+ # keep in memory to speed up the test harness.
+ if not paths:
+ paths = ['*']
+
+ matched_tests = []
+ for p in paths:
+ if self.path_isdir(p):
+ matched_tests.extend(fnmatch.filter(self._tests.keys(), p + '*'))
+ else:
+ matched_tests.extend(fnmatch.filter(self._tests.keys(), p))
+ layout_tests_dir = self.layout_tests_dir()
+ return set([os.path.join(layout_tests_dir, p) for p in matched_tests])
+
+ def path_exists(self, path):
+ # used by test_expectations.py and printing.py
+ rpath = self.relative_test_filename(path)
+ if rpath in self._tests:
+ return True
+ if self.path_isdir(rpath):
+ return True
+ if rpath.endswith('-expected.txt'):
+ test = rpath.replace('-expected.txt', '.html')
+ return (test in self._tests and
+ self._tests[test].expected_text)
+ if rpath.endswith('-expected.checksum'):
+ test = rpath.replace('-expected.checksum', '.html')
+ return (test in self._tests and
+ self._tests[test].expected_checksum)
+ if rpath.endswith('-expected.png'):
+ test = rpath.replace('-expected.png', '.html')
+ return (test in self._tests and
+ self._tests[test].expected_image)
return False
- def compare_text(self, actual_text, expected_text):
- return False
+ def layout_tests_dir(self):
+ return self.path_from_webkit_base('WebKitTools', 'Scripts',
+ 'webkitpy', 'layout_tests', 'data')
- def diff_text(self, actual_text, expected_text,
- actual_filename, expected_filename):
- return ''
+ def path_isdir(self, path):
+ # Used by test_expectations.py
+ #
+ # We assume that a path is a directory if we have any tests that
+ # whose prefix matches the path plus a directory modifier.
+ if path[-1] != '/':
+ path += '/'
+ return any([t.startswith(path) for t in self._tests.keys()])
+
+ def test_dirs(self):
+ return ['passes', 'failures']
def name(self):
return self._name
- def num_cores(self):
- return int(os.popen2("sysctl -n hw.ncpu")[1].read())
-
- def options(self):
- return self._options
+ def _path_to_wdiff(self):
+ return None
def results_directory(self):
- return '/tmp' + self._options.results_directory
+ return '/tmp/' + self.get_option('results_directory')
def setup_test_run(self):
pass
- def show_results_html_file(self, filename):
- pass
-
- def start_driver(self, image_path, options):
- return TestDriver(image_path, options, self)
+ def create_driver(self, image_path, options):
+ return TestDriver(self, image_path, options, executive=None)
def start_http_server(self):
pass
@@ -92,53 +235,78 @@ class TestPort(base.Port):
def start_websocket_server(self):
pass
- def start_helper(self):
- pass
-
def stop_http_server(self):
pass
def stop_websocket_server(self):
pass
- def stop_helper(self):
- pass
-
def test_expectations(self):
- return ''
+ """Returns the test expectations for this port.
+
+ Basically this string should contain the equivalent of a
+ test_expectations file. See test_expectations.py for more details."""
+ return """
+WONTFIX : failures/expected/checksum.html = IMAGE
+WONTFIX : failures/expected/crash.html = CRASH
+// This one actually passes because the checksums will match.
+WONTFIX : failures/expected/image.html = PASS
+WONTFIX : failures/expected/image_checksum.html = IMAGE
+WONTFIX : failures/expected/missing_check.html = MISSING PASS
+WONTFIX : failures/expected/missing_image.html = MISSING PASS
+WONTFIX : failures/expected/missing_text.html = MISSING PASS
+WONTFIX : failures/expected/text.html = TEXT
+WONTFIX : failures/expected/timeout.html = TIMEOUT
+WONTFIX SKIP : failures/expected/hang.html = TIMEOUT
+WONTFIX SKIP : failures/expected/keyboard.html = CRASH
+WONTFIX SKIP : failures/expected/exception.html = CRASH
+"""
def test_base_platform_names(self):
- return ('test',)
+ return ('mac', 'win')
def test_platform_name(self):
- return 'test'
+ return 'mac'
def test_platform_names(self):
return self.test_base_platform_names()
- def version():
- return ''
+ def test_platform_name_to_name(self, test_platform_name):
+ return test_platform_name
- def wdiff_text(self, actual_filename, expected_filename):
+ def version(self):
return ''
class TestDriver(base.Driver):
"""Test/Dummy implementation of the DumpRenderTree interface."""
- def __init__(self, image_path, test_driver_options, port):
- self._driver_options = test_driver_options
- self._image_path = image_path
+ def __init__(self, port, image_path, options, executive):
self._port = port
+ self._image_path = image_path
+ self._executive = executive
+ self._image_written = False
def poll(self):
return True
- def returncode(self):
- return 0
-
def run_test(self, uri, timeoutms, image_hash):
- return (False, False, image_hash, '', None)
+ start_time = time.time()
+ test_name = self._port.uri_to_test_name(uri)
+ test = self._port._tests[test_name]
+ if test.keyboard:
+ raise KeyboardInterrupt
+ if test.exception:
+ raise ValueError('exception from ' + test_name)
+ if test.hang:
+ time.sleep((float(timeoutms) * 4) / 1000.0)
+ return test_output.TestOutput(test.actual_text, test.actual_image,
+ test.actual_checksum, test.crash,
+ time.time() - start_time, test.timeout,
+ test.error)
+
+ def start(self):
+ pass
def stop(self):
pass
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files.py
index 3c087c0..3fa0fb3 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/layout_package/test_files.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files.py
@@ -27,33 +27,42 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""This module is used to find all of the layout test files used by Chromium
-(across all platforms). It exposes one public function - GatherTestFiles() -
+"""This module is used to find all of the layout test files used by
+run-webkit-tests. It exposes one public function - find() -
which takes an optional list of paths. If a list is passed in, the returned
list of test files is constrained to those found under the paths passed in,
-i.e. calling GatherTestFiles(["LayoutTests/fast"]) will only return files
+i.e. calling find(["LayoutTests/fast"]) will only return files
under that directory."""
import glob
import os
+import time
+
+from webkitpy.common.system import logutils
+
+
+_log = logutils.get_logger(__file__)
+
# When collecting test cases, we include any file with these extensions.
-_supported_file_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.pl',
+_supported_file_extensions = set(['.html', '.shtml', '.xml', '.xhtml', '.xhtmlmp', '.pl',
'.php', '.svg'])
# When collecting test cases, skip these directories
_skipped_directories = set(['.svn', '_svn', 'resources', 'script-tests'])
-def gather_test_files(port, paths):
- """Generate a set of test files and return them.
+def find(port, paths):
+ """Finds the set of tests under port.layout_tests_dir().
Args:
- paths: a list of command line paths relative to the webkit/tests
- directory. glob patterns are ok.
+ paths: a list of command line paths relative to the layout_tests_dir()
+ to limit the search to. glob patterns are ok.
"""
+ gather_start_time = time.time()
paths_to_walk = set()
# if paths is empty, provide a pre-defined list.
if paths:
+ _log.debug("Gathering tests from: %s relative to %s" % (paths, port.layout_tests_dir()))
for path in paths:
# If there's an * in the name, assume it's a glob pattern.
path = os.path.join(port.layout_tests_dir(), path)
@@ -63,6 +72,7 @@ def gather_test_files(port, paths):
else:
paths_to_walk.add(path)
else:
+ _log.debug("Gathering tests from: %s" % port.layout_tests_dir())
paths_to_walk.add(port.layout_tests_dir())
# Now walk all the paths passed in on the command line and get filenames
@@ -73,10 +83,16 @@ def gather_test_files(port, paths):
continue
for root, dirs, files in os.walk(path):
- # don't walk skipped directories and sub directories
+ # Don't walk skipped directories or their sub-directories.
if os.path.basename(root) in _skipped_directories:
del dirs[:]
continue
+ # This copy and for-in is slightly inefficient, but
+ # the extra walk avoidance consistently shaves .5 seconds
+ # off of total walk() time on my MacBook Pro.
+ for directory in dirs[:]:
+ if directory in _skipped_directories:
+ dirs.remove(directory)
for filename in files:
if _has_supported_extension(filename):
@@ -84,6 +100,9 @@ def gather_test_files(port, paths):
filename = os.path.normpath(filename)
test_files.add(filename)
+ gather_time = time.time() - gather_start_time
+ _log.debug("Test gathering took %f seconds" % gather_time)
+
return test_files
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py
new file mode 100644
index 0000000..c37eb92
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/test_files_unittest.py
@@ -0,0 +1,68 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import unittest
+
+import base
+import test_files
+
+
+class TestFilesTest(unittest.TestCase):
+ def test_find_no_paths_specified(self):
+ port = base.Port()
+ layout_tests_dir = port.layout_tests_dir()
+ port.layout_tests_dir = lambda: os.path.join(layout_tests_dir,
+ 'fast', 'html')
+ tests = test_files.find(port, [])
+ self.assertNotEqual(tests, 0)
+
+ def test_find_one_test(self):
+ port = base.Port()
+ # This is just a test picked at random but known to exist.
+ tests = test_files.find(port, ['fast/html/keygen.html'])
+ self.assertEqual(len(tests), 1)
+
+ def test_find_glob(self):
+ port = base.Port()
+ tests = test_files.find(port, ['fast/html/key*'])
+ self.assertEqual(len(tests), 1)
+
+ def test_find_with_skipped_directories(self):
+ port = base.Port()
+ tests = port.tests('userscripts')
+ self.assertTrue('userscripts/resources/frame1.html' not in tests)
+
+ def test_find_with_skipped_directories_2(self):
+ port = base.Port()
+ tests = test_files.find(port, ['userscripts/resources'])
+ self.assertEqual(tests, set([]))
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
new file mode 100644
index 0000000..06797c6
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit.py
@@ -0,0 +1,510 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2010 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>, University of Szeged
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the Google name nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""WebKit implementations of the Port interface."""
+
+
+from __future__ import with_statement
+
+import codecs
+import logging
+import os
+import re
+import shutil
+import signal
+import sys
+import time
+import webbrowser
+import operator
+import tempfile
+import shutil
+
+from webkitpy.common.system.executive import Executive
+
+import webkitpy.common.system.ospath as ospath
+import webkitpy.layout_tests.layout_package.test_output as test_output
+import webkitpy.layout_tests.port.base as base
+import webkitpy.layout_tests.port.server_process as server_process
+
+_log = logging.getLogger("webkitpy.layout_tests.port.webkit")
+
+
+class WebKitPort(base.Port):
+ """WebKit implementation of the Port class."""
+
+ def __init__(self, **kwargs):
+ base.Port.__init__(self, **kwargs)
+ self._cached_apache_path = None
+
+ # FIXME: disable pixel tests until they are run by default on the
+ # build machines.
+ self.set_option_default('pixel_tests', False)
+
+ def baseline_path(self):
+ return self._webkit_baseline_path(self._name)
+
+ def baseline_search_path(self):
+ return [self._webkit_baseline_path(self._name)]
+
+ def path_to_test_expectations_file(self):
+ return os.path.join(self._webkit_baseline_path(self._name),
+ 'test_expectations.txt')
+
+ # Only needed by ports which maintain versioned test expectations (like mac-tiger vs. mac-leopard)
+ def version(self):
+ return ''
+
+ def _build_driver(self):
+ configuration = self.get_option('configuration')
+ return self._config.build_dumprendertree(configuration)
+
+ def _check_driver(self):
+ driver_path = self._path_to_driver()
+ if not os.path.exists(driver_path):
+ _log.error("DumpRenderTree was not found at %s" % driver_path)
+ return False
+ return True
+
+ def check_build(self, needs_http):
+ if self.get_option('build') and not self._build_driver():
+ return False
+ if not self._check_driver():
+ return False
+ if self.get_option('pixel_tests'):
+ if not self.check_image_diff():
+ return False
+ if not self._check_port_build():
+ return False
+ return True
+
+ def _check_port_build(self):
+ # Ports can override this method to do additional checks.
+ return True
+
+ def check_image_diff(self, override_step=None, logging=True):
+ image_diff_path = self._path_to_image_diff()
+ if not os.path.exists(image_diff_path):
+ _log.error("ImageDiff was not found at %s" % image_diff_path)
+ return False
+ return True
+
+ def diff_image(self, expected_contents, actual_contents,
+ diff_filename=None):
+ """Return True if the two files are different. Also write a delta
+ image of the two images into |diff_filename| if it is not None."""
+
+ # Handle the case where the test didn't actually generate an image.
+ if not actual_contents:
+ return True
+
+ sp = self._diff_image_request(expected_contents, actual_contents)
+ return self._diff_image_reply(sp, diff_filename)
+
+ def _diff_image_request(self, expected_contents, actual_contents):
+ # FIXME: use self.get_option('tolerance') and
+ # self.set_option_default('tolerance', 0.1) once that behaves correctly
+ # with default values.
+ if self.get_option('tolerance') is not None:
+ tolerance = self.get_option('tolerance')
+ else:
+ tolerance = 0.1
+ command = [self._path_to_image_diff(), '--tolerance', str(tolerance)]
+ sp = server_process.ServerProcess(self, 'ImageDiff', command)
+
+ sp.write('Content-Length: %d\n%sContent-Length: %d\n%s' %
+ (len(actual_contents), actual_contents,
+ len(expected_contents), expected_contents))
+
+ return sp
+
+ def _diff_image_reply(self, sp, diff_filename):
+ timeout = 2.0
+ deadline = time.time() + timeout
+ output = sp.read_line(timeout)
+ while not sp.timed_out and not sp.crashed and output:
+ if output.startswith('Content-Length'):
+ m = re.match('Content-Length: (\d+)', output)
+ content_length = int(m.group(1))
+ timeout = deadline - time.time()
+ output = sp.read(timeout, content_length)
+ break
+ elif output.startswith('diff'):
+ break
+ else:
+ timeout = deadline - time.time()
+ output = sp.read_line(deadline)
+
+ result = True
+ if output.startswith('diff'):
+ m = re.match('diff: (.+)% (passed|failed)', output)
+ if m.group(2) == 'passed':
+ result = False
+ elif output and diff_filename:
+ with open(diff_filename, 'w') as file:
+ file.write(output)
+ elif sp.timed_out:
+ _log.error("ImageDiff timed out")
+ elif sp.crashed:
+ _log.error("ImageDiff crashed")
+ sp.stop()
+ return result
+
+ def results_directory(self):
+ # Results are store relative to the built products to make it easy
+ # to have multiple copies of webkit checked out and built.
+ return self._build_path(self.get_option('results_directory'))
+
+ def setup_test_run(self):
+ # This port doesn't require any specific configuration.
+ pass
+
+ def create_driver(self, image_path, options):
+ return WebKitDriver(self, image_path, options,
+ executive=self._executive)
+
+ def test_base_platform_names(self):
+ # At the moment we don't use test platform names, but we have
+ # to return something.
+ return ('mac', 'win')
+
+ def _tests_for_other_platforms(self):
+ raise NotImplementedError('WebKitPort._tests_for_other_platforms')
+ # The original run-webkit-tests builds up a "whitelist" of tests to
+ # run, and passes that to DumpRenderTree. new-run-webkit-tests assumes
+ # we run *all* tests and test_expectations.txt functions as a
+ # blacklist.
+ # FIXME: This list could be dynamic based on platform name and
+ # pushed into base.Port.
+ return [
+ "platform/chromium",
+ "platform/gtk",
+ "platform/qt",
+ "platform/win",
+ ]
+
+ def _runtime_feature_list(self):
+ """Return the supported features of DRT. If a port doesn't support
+ this DRT switch, it has to override this method to return None"""
+ driver_path = self._path_to_driver()
+ feature_list = ' '.join(os.popen(driver_path + " --print-supported-features 2>&1").readlines())
+ if "SupportedFeatures:" in feature_list:
+ return feature_list
+ return None
+
+ def _supported_symbol_list(self):
+ """Return the supported symbols of WebCore."""
+ webcore_library_path = self._path_to_webcore_library()
+ if not webcore_library_path:
+ return None
+ symbol_list = ' '.join(os.popen("nm " + webcore_library_path).readlines())
+ return symbol_list
+
+ def _directories_for_features(self):
+ """Return the supported feature dictionary. The keys are the
+ features and the values are the directories in lists."""
+ directories_for_features = {
+ "Accelerated Compositing": ["compositing"],
+ "3D Rendering": ["animations/3d", "transforms/3d"],
+ }
+ return directories_for_features
+
+ def _directories_for_symbols(self):
+ """Return the supported feature dictionary. The keys are the
+ symbols and the values are the directories in lists."""
+ directories_for_symbol = {
+ "MathMLElement": ["mathml"],
+ "GraphicsLayer": ["compositing"],
+ "WebCoreHas3DRendering": ["animations/3d", "transforms/3d"],
+ "WebGLShader": ["fast/canvas/webgl", "compositing/webgl", "http/tests/canvas/webgl"],
+ "WMLElement": ["http/tests/wml", "fast/wml", "wml"],
+ "parseWCSSInputProperty": ["fast/wcss"],
+ "isXHTMLMPDocument": ["fast/xhtmlmp"],
+ }
+ return directories_for_symbol
+
+ def _skipped_tests_for_unsupported_features(self):
+ """Return the directories of unsupported tests. Search for the
+ symbols in the symbol_list, if found add the corresponding
+ directories to the skipped directory list."""
+ feature_list = self._runtime_feature_list()
+ directories = self._directories_for_features()
+
+ # if DRT feature detection not supported
+ if not feature_list:
+ feature_list = self._supported_symbol_list()
+ directories = self._directories_for_symbols()
+
+ if not feature_list:
+ return []
+
+ skipped_directories = [directories[feature]
+ for feature in directories.keys()
+ if feature not in feature_list]
+ return reduce(operator.add, skipped_directories)
+
+ def _tests_for_disabled_features(self):
+ # FIXME: This should use the feature detection from
+ # webkitperl/features.pm to match run-webkit-tests.
+ # For now we hard-code a list of features known to be disabled on
+ # the Mac platform.
+ disabled_feature_tests = [
+ "fast/xhtmlmp",
+ "http/tests/wml",
+ "mathml",
+ "wml",
+ ]
+ # FIXME: webarchive tests expect to read-write from
+ # -expected.webarchive files instead of .txt files.
+ # This script doesn't know how to do that yet, so pretend they're
+ # just "disabled".
+ webarchive_tests = [
+ "webarchive",
+ "svg/webarchive",
+ "http/tests/webarchive",
+ "svg/custom/image-with-prefix-in-webarchive.svg",
+ ]
+ unsupported_feature_tests = self._skipped_tests_for_unsupported_features()
+ return disabled_feature_tests + webarchive_tests + unsupported_feature_tests
+
+ def _tests_from_skipped_file(self, skipped_file):
+ tests_to_skip = []
+ for line in skipped_file.readlines():
+ line = line.strip()
+ if line.startswith('#') or not len(line):
+ continue
+ tests_to_skip.append(line)
+ return tests_to_skip
+
+ def _skipped_file_paths(self):
+ return [os.path.join(self._webkit_baseline_path(self._name),
+ 'Skipped')]
+
+ def _expectations_from_skipped_files(self):
+ tests_to_skip = []
+ for filename in self._skipped_file_paths():
+ if not os.path.exists(filename):
+ _log.warn("Failed to open Skipped file: %s" % filename)
+ continue
+ with codecs.open(filename, "r", "utf-8") as skipped_file:
+ tests_to_skip.extend(self._tests_from_skipped_file(skipped_file))
+ return tests_to_skip
+
+ def test_expectations(self):
+ # The WebKit mac port uses a combination of a test_expectations file
+ # and 'Skipped' files.
+ expectations_path = self.path_to_test_expectations_file()
+ with codecs.open(expectations_path, "r", "utf-8") as file:
+ return file.read() + self._skips()
+
+ def _skips(self):
+ # Each Skipped file contains a list of files
+ # or directories to be skipped during the test run. The total list
+ # of tests to skipped is given by the contents of the generic
+ # Skipped file found in platform/X plus a version-specific file
+ # found in platform/X-version. Duplicate entries are allowed.
+ # This routine reads those files and turns contents into the
+ # format expected by test_expectations.
+
+ tests_to_skip = self.skipped_layout_tests()
+ skip_lines = map(lambda test_path: "BUG_SKIPPED SKIP : %s = FAIL" %
+ test_path, tests_to_skip)
+ return "\n".join(skip_lines)
+
+ def skipped_layout_tests(self):
+ # Use a set to allow duplicates
+ tests_to_skip = set(self._expectations_from_skipped_files())
+ tests_to_skip.update(self._tests_for_other_platforms())
+ tests_to_skip.update(self._tests_for_disabled_features())
+ return tests_to_skip
+
+ def test_platform_name(self):
+ return self._name + self.version()
+
+ def test_platform_names(self):
+ return self.test_base_platform_names() + (
+ 'mac-tiger', 'mac-leopard', 'mac-snowleopard')
+
+ def _build_path(self, *comps):
+ return self._filesystem.join(self._config.build_directory(
+ self.get_option('configuration')), *comps)
+
+ def _path_to_driver(self):
+ return self._build_path('DumpRenderTree')
+
+ def _path_to_webcore_library(self):
+ return None
+
+ def _path_to_helper(self):
+ return None
+
+ def _path_to_image_diff(self):
+ return self._build_path('ImageDiff')
+
+ def _path_to_wdiff(self):
+ # FIXME: This does not exist on a default Mac OS X Leopard install.
+ return 'wdiff'
+
+ def _path_to_apache(self):
+ if not self._cached_apache_path:
+ # The Apache binary path can vary depending on OS and distribution
+ # See http://wiki.apache.org/httpd/DistrosDefaultLayout
+ for path in ["/usr/sbin/httpd", "/usr/sbin/apache2"]:
+ if os.path.exists(path):
+ self._cached_apache_path = path
+ break
+
+ if not self._cached_apache_path:
+ _log.error("Could not find apache. Not installed or unknown path.")
+
+ return self._cached_apache_path
+
+
+class WebKitDriver(base.Driver):
+ """WebKit implementation of the DumpRenderTree interface."""
+
+ def __init__(self, port, image_path, options, executive=Executive()):
+ self._port = port
+ self._image_path = image_path
+ self._executive = executive
+ self._driver_tempdir = tempfile.mkdtemp(prefix='DumpRenderTree-')
+
+ def __del__(self):
+ shutil.rmtree(self._driver_tempdir)
+
+ def _driver_args(self):
+ driver_args = []
+
+ if self._image_path:
+ driver_args.append('--pixel-tests')
+
+ if self._port.get_option('use_drt'):
+ if self._port.get_option('accelerated_compositing'):
+ driver_args.append('--enable-accelerated-compositing')
+
+ if self._port.get_option('accelerated_2d_canvas'):
+ driver_args.append('--enable-accelerated-2d-canvas')
+
+ return driver_args
+
+ def start(self):
+ command = self._command_wrapper(self._port.get_option('wrapper'))
+ command += [self._port._path_to_driver(), '-']
+ command += self._driver_args()
+
+ environment = self._port.setup_environ_for_server()
+ environment['DYLD_FRAMEWORK_PATH'] = self._port._build_path()
+ environment['DUMPRENDERTREE_TEMP'] = self._driver_tempdir
+ self._server_process = server_process.ServerProcess(self._port,
+ "DumpRenderTree", command, environment)
+
+ def poll(self):
+ return self._server_process.poll()
+
+ def restart(self):
+ self._server_process.stop()
+ self._server_process.start()
+ return
+
+ # FIXME: This function is huge.
+ def run_test(self, uri, timeoutms, image_hash):
+ if uri.startswith("file:///"):
+ command = uri[7:]
+ else:
+ command = uri
+
+ if image_hash:
+ command += "'" + image_hash
+ command += "\n"
+
+ start_time = time.time()
+ self._server_process.write(command)
+
+ have_seen_content_type = False
+ actual_image_hash = None
+ output = str() # Use a byte array for output, even though it should be UTF-8.
+ image = str()
+
+ timeout = int(timeoutms) / 1000.0
+ deadline = time.time() + timeout
+ line = self._server_process.read_line(timeout)
+ while (not self._server_process.timed_out
+ and not self._server_process.crashed
+ and line.rstrip() != "#EOF"):
+ if (line.startswith('Content-Type:') and not
+ have_seen_content_type):
+ have_seen_content_type = True
+ else:
+ # Note: Text output from DumpRenderTree is always UTF-8.
+ # However, some tests (e.g. webarchives) spit out binary
+ # data instead of text. So to make things simple, we
+ # always treat the output as binary.
+ output += line
+ line = self._server_process.read_line(timeout)
+ timeout = deadline - time.time()
+
+ # Now read a second block of text for the optional image data
+ remaining_length = -1
+ HASH_HEADER = 'ActualHash: '
+ LENGTH_HEADER = 'Content-Length: '
+ line = self._server_process.read_line(timeout)
+ while (not self._server_process.timed_out
+ and not self._server_process.crashed
+ and line.rstrip() != "#EOF"):
+ if line.startswith(HASH_HEADER):
+ actual_image_hash = line[len(HASH_HEADER):].strip()
+ elif line.startswith('Content-Type:'):
+ pass
+ elif line.startswith(LENGTH_HEADER):
+ timeout = deadline - time.time()
+ content_length = int(line[len(LENGTH_HEADER):])
+ image = self._server_process.read(timeout, content_length)
+ timeout = deadline - time.time()
+ line = self._server_process.read_line(timeout)
+
+ error_lines = self._server_process.error.splitlines()
+ # FIXME: This is a hack. It is unclear why sometimes
+ # we do not get any error lines from the server_process
+ # probably we are not flushing stderr.
+ if error_lines and error_lines[-1] == "#EOF":
+ error_lines.pop() # Remove the expected "#EOF"
+ error = "\n".join(error_lines)
+ # FIXME: This seems like the wrong section of code to be doing
+ # this reset in.
+ self._server_process.error = ""
+ return test_output.TestOutput(output, image, actual_image_hash,
+ self._server_process.crashed,
+ time.time() - start_time,
+ self._server_process.timed_out,
+ error)
+
+ def stop(self):
+ if self._server_process:
+ self._server_process.stop()
+ self._server_process = None
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
new file mode 100644
index 0000000..7b68310
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/webkit_unittest.py
@@ -0,0 +1,68 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Gabor Rapcsanyi <rgabor@inf.u-szeged.hu>, University of Szeged
+#
+# 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 UNIVERSITY OF SZEGED ``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 UNIVERSITY OF SZEGED 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.
+
+import unittest
+
+from webkitpy.layout_tests.port.webkit import WebKitPort
+
+
+class TestWebKitPort(WebKitPort):
+ def __init__(self, symbol_list=None, feature_list=None):
+ self.symbol_list = symbol_list
+ self.feature_list = feature_list
+
+ def _runtime_feature_list(self):
+ return self.feature_list
+
+ def _supported_symbol_list(self):
+ return self.symbol_list
+
+ def _tests_for_other_platforms(self):
+ return ["media", ]
+
+ def _tests_for_disabled_features(self):
+ return ["accessibility", ]
+
+ def _skipped_file_paths(self):
+ return []
+
+class WebKitPortTest(unittest.TestCase):
+
+ def test_skipped_directories_for_symbols(self):
+ supported_symbols = ["GraphicsLayer", "WebCoreHas3DRendering", "isXHTMLMPDocument", "fooSymbol"]
+ expected_directories = set(["mathml", "fast/canvas/webgl", "compositing/webgl", "http/tests/canvas/webgl", "http/tests/wml", "fast/wml", "wml", "fast/wcss"])
+ result_directories = set(TestWebKitPort(supported_symbols, None)._skipped_tests_for_unsupported_features())
+ self.assertEqual(result_directories, expected_directories)
+
+ def test_skipped_directories_for_features(self):
+ supported_features = ["Accelerated Compositing", "Foo Feature"]
+ expected_directories = set(["animations/3d", "transforms/3d"])
+ result_directories = set(TestWebKitPort(None, supported_features)._skipped_tests_for_unsupported_features())
+ self.assertEqual(result_directories, expected_directories)
+
+ def test_skipped_layout_tests(self):
+ self.assertEqual(TestWebKitPort(None, None).skipped_layout_tests(),
+ set(["media", "accessibility"]))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
index ba8a5e9..926bc04 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
@@ -30,6 +30,9 @@
"""A class to help start/stop the PyWebSocket server used by layout tests."""
+from __future__ import with_statement
+
+import codecs
import logging
import optparse
import os
@@ -39,8 +42,15 @@ import tempfile
import time
import urllib
+import factory
import http_server
+from webkitpy.common.system.executive import Executive
+from webkitpy.thirdparty.autoinstalled.pywebsocket import mod_pywebsocket
+
+
+_log = logging.getLogger("webkitpy.layout_tests.port.websocket_server")
+
_WS_LOG_PREFIX = 'pywebsocket.ws.log-'
_WSS_LOG_PREFIX = 'pywebsocket.wss.log-'
@@ -50,7 +60,7 @@ _DEFAULT_WSS_PORT = 9323
def url_is_alive(url):
"""Checks to see if we get an http response from |url|.
- We poll the url 5 times with a 1 second delay. If we don't
+ We poll the url 20 times with a 0.5 second delay. If we don't
get a reply in that time, we give up and assume the httpd
didn't start properly.
@@ -59,7 +69,8 @@ def url_is_alive(url):
Return:
True if the url is alive.
"""
- wait_time = 5
+ sleep_time = 0.5
+ wait_time = 10
while wait_time > 0:
try:
response = urllib.urlopen(url)
@@ -67,9 +78,9 @@ def url_is_alive(url):
return True
except IOError:
pass
- wait_time -= 1
- # Wait a second and try again.
- time.sleep(1)
+ # Wait for sleep_time before trying again.
+ wait_time -= sleep_time
+ time.sleep(sleep_time)
return False
@@ -86,15 +97,13 @@ class PyWebSocket(http_server.Lighttpd):
def __init__(self, port_obj, output_dir, port=_DEFAULT_WS_PORT,
root=None, use_tls=False,
- register_cygwin=None,
pidfile=None):
"""Args:
output_dir: the absolute path to the layout test result directory
"""
http_server.Lighttpd.__init__(self, port_obj, output_dir,
port=_DEFAULT_WS_PORT,
- root=root,
- register_cygwin=register_cygwin)
+ root=root)
self._output_dir = output_dir
self._process = None
self._port = port
@@ -115,18 +124,19 @@ class PyWebSocket(http_server.Lighttpd):
if self._root:
self._layout_tests = os.path.abspath(self._root)
self._web_socket_tests = os.path.abspath(
- os.path.join(self._root, 'websocket', 'tests'))
+ os.path.join(self._root, 'http', 'tests',
+ 'websocket', 'tests'))
else:
try:
self._layout_tests = self._port_obj.layout_tests_dir()
self._web_socket_tests = os.path.join(self._layout_tests,
- 'websocket', 'tests')
+ 'http', 'tests', 'websocket', 'tests')
except:
self._web_socket_tests = None
def start(self):
if not self._web_socket_tests:
- logging.info('No need to start %s server.' % self._server_name)
+ _log.info('No need to start %s server.' % self._server_name)
return
if self.is_running():
raise PyWebSocketNotStarted('%s is already running.' %
@@ -145,74 +155,66 @@ class PyWebSocket(http_server.Lighttpd):
error_log = os.path.join(self._output_dir, log_file_name + "-err.txt")
output_log = os.path.join(self._output_dir, log_file_name + "-out.txt")
- self._wsout = open(output_log, "w")
+ self._wsout = codecs.open(output_log, "w", "utf-8")
python_interp = sys.executable
pywebsocket_base = os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(
- os.path.dirname(os.path.dirname(
- os.path.abspath(__file__)))))), 'pywebsocket')
+ os.path.abspath(__file__)))), 'thirdparty',
+ 'autoinstalled', 'pywebsocket')
pywebsocket_script = os.path.join(pywebsocket_base, 'mod_pywebsocket',
'standalone.py')
start_cmd = [
- python_interp, pywebsocket_script,
- '-p', str(self._port),
- '-d', self._layout_tests,
- '-s', self._web_socket_tests,
- '-l', error_log,
+ python_interp, '-u', pywebsocket_script,
+ '--server-host', '127.0.0.1',
+ '--port', str(self._port),
+ '--document-root', os.path.join(self._layout_tests, 'http', 'tests'),
+ '--scan-dir', self._web_socket_tests,
+ '--cgi-paths', '/websocket/tests',
+ '--log-file', error_log,
]
handler_map_file = os.path.join(self._web_socket_tests,
'handler_map.txt')
if os.path.exists(handler_map_file):
- logging.debug('Using handler_map_file: %s' % handler_map_file)
- start_cmd.append('-m')
+ _log.debug('Using handler_map_file: %s' % handler_map_file)
+ start_cmd.append('--websock-handlers-map-file')
start_cmd.append(handler_map_file)
else:
- logging.warning('No handler_map_file found')
+ _log.warning('No handler_map_file found')
if self._use_tls:
start_cmd.extend(['-t', '-k', self._private_key,
'-c', self._certificate])
- # Put the cygwin directory first in the path to find cygwin1.dll
- env = os.environ
- if sys.platform in ('cygwin', 'win32'):
- env['PATH'] = '%s;%s' % (
- self._port_obj.path_from_chromium_base('third_party',
- 'cygwin', 'bin'),
- env['PATH'])
-
- if sys.platform == 'win32' and self._register_cygwin:
- setup_mount = self._port_obj.path_from_chromium_base(
- 'third_party', 'cygwin', 'setup_mount.bat')
- subprocess.Popen(setup_mount).wait()
-
+ env = self._port_obj.setup_environ_for_server()
env['PYTHONPATH'] = (pywebsocket_base + os.path.pathsep +
env.get('PYTHONPATH', ''))
- logging.debug('Starting %s server on %d.' % (
- self._server_name, self._port))
- logging.debug('cmdline: %s' % ' '.join(start_cmd))
- self._process = subprocess.Popen(start_cmd, stdout=self._wsout,
+ _log.debug('Starting %s server on %d.' % (
+ self._server_name, self._port))
+ _log.debug('cmdline: %s' % ' '.join(start_cmd))
+ # FIXME: We should direct this call through Executive for testing.
+ # Note: Not thread safe: http://bugs.python.org/issue2320
+ self._process = subprocess.Popen(start_cmd,
+ stdin=open(os.devnull, 'r'),
+ stdout=self._wsout,
stderr=subprocess.STDOUT,
env=env)
- # Wait a bit before checking the liveness of the server.
- time.sleep(0.5)
-
if self._use_tls:
url = 'https'
else:
url = 'http'
url = url + '://127.0.0.1:%d/' % self._port
if not url_is_alive(url):
- fp = open(output_log)
- try:
+ if self._process.returncode == None:
+ # FIXME: We should use a non-static Executive for easier
+ # testing.
+ Executive().kill_process(self._process.pid)
+ with codecs.open(output_log, "r", "utf-8") as fp:
for line in fp:
- logging.error(line)
- finally:
- fp.close()
+ _log.error(line)
raise PyWebSocketNotStarted(
'Failed to start %s server on port %s.' %
(self._server_name, self._port))
@@ -222,82 +224,34 @@ class PyWebSocket(http_server.Lighttpd):
raise PyWebSocketNotStarted(
'Failed to start %s server.' % self._server_name)
if self._pidfile:
- f = open(self._pidfile, 'w')
- f.write("%d" % self._process.pid)
- f.close()
+ with codecs.open(self._pidfile, "w", "ascii") as file:
+ file.write("%d" % self._process.pid)
def stop(self, force=False):
if not force and not self.is_running():
return
+ pid = None
if self._process:
pid = self._process.pid
elif self._pidfile:
- f = open(self._pidfile)
- pid = int(f.read().strip())
- f.close()
+ with codecs.open(self._pidfile, "r", "ascii") as file:
+ pid = int(file.read().strip())
if not pid:
raise PyWebSocketNotFound(
'Failed to find %s server pid.' % self._server_name)
- logging.debug('Shutting down %s server %d.' % (self._server_name, pid))
- self._port_obj._kill_process(pid)
+ _log.debug('Shutting down %s server %d.' % (self._server_name, pid))
+ # FIXME: We should use a non-static Executive for easier testing.
+ Executive().kill_process(pid)
if self._process:
+ # wait() is not threadsafe and can throw OSError due to:
+ # http://bugs.python.org/issue1731717
self._process.wait()
self._process = None
if self._wsout:
self._wsout.close()
self._wsout = None
-
-
-if '__main__' == __name__:
- # Provide some command line params for starting the PyWebSocket server
- # manually.
- option_parser = optparse.OptionParser()
- option_parser.add_option('--server', type='choice',
- choices=['start', 'stop'], default='start',
- help='Server action (start|stop)')
- option_parser.add_option('-p', '--port', dest='port',
- default=None, help='Port to listen on')
- option_parser.add_option('-r', '--root',
- help='Absolute path to DocumentRoot '
- '(overrides layout test roots)')
- option_parser.add_option('-t', '--tls', dest='use_tls',
- action='store_true',
- default=False, help='use TLS (wss://)')
- option_parser.add_option('-k', '--private_key', dest='private_key',
- default='', help='TLS private key file.')
- option_parser.add_option('-c', '--certificate', dest='certificate',
- default='', help='TLS certificate file.')
- option_parser.add_option('--register_cygwin', action="store_true",
- dest="register_cygwin",
- help='Register Cygwin paths (on Win try bots)')
- option_parser.add_option('--pidfile', help='path to pid file.')
- options, args = option_parser.parse_args()
-
- if not options.port:
- if options.use_tls:
- options.port = _DEFAULT_WSS_PORT
- else:
- options.port = _DEFAULT_WS_PORT
-
- kwds = {'port': options.port, 'use_tls': options.use_tls}
- if options.root:
- kwds['root'] = options.root
- if options.private_key:
- kwds['private_key'] = options.private_key
- if options.certificate:
- kwds['certificate'] = options.certificate
- kwds['register_cygwin'] = options.register_cygwin
- if options.pidfile:
- kwds['pidfile'] = options.pidfile
-
- pywebsocket = PyWebSocket(tempfile.gettempdir(), **kwds)
-
- if 'start' == options.server:
- pywebsocket.start()
- else:
- pywebsocket.stop(force=True)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py
new file mode 100644
index 0000000..9e30155
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/win.py
@@ -0,0 +1,75 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the Google name nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""WebKit Win implementation of the Port interface."""
+
+import logging
+import os
+
+from webkitpy.layout_tests.port.webkit import WebKitPort
+
+_log = logging.getLogger("webkitpy.layout_tests.port.win")
+
+
+class WinPort(WebKitPort):
+ """WebKit Win implementation of the Port class."""
+
+ def __init__(self, **kwargs):
+ kwargs.setdefault('port_name', 'win')
+ WebKitPort.__init__(self, **kwargs)
+
+ def baseline_search_path(self):
+ # Based on code from old-run-webkit-tests expectedDirectoryForTest()
+ port_names = ["win", "mac-snowleopard", "mac"]
+ return map(self._webkit_baseline_path, port_names)
+
+ def _tests_for_other_platforms(self):
+ # FIXME: This list could be dynamic based on platform name and
+ # pushed into base.Port.
+ # This really need to be automated.
+ return [
+ "platform/chromium",
+ "platform/gtk",
+ "platform/qt",
+ "platform/mac",
+ ]
+
+ def _path_to_apache_config_file(self):
+ return os.path.join(self.layout_tests_dir(), 'http', 'conf',
+ 'cygwin-httpd.conf')
+
+ def _shut_down_http_server(self, server_pid):
+ """Shut down the httpd web server. Blocks until it's fully
+ shut down.
+
+ Args:
+ server_pid: The process ID of the running server.
+ """
+ # Looks like we ignore server_pid.
+ # Copy/pasted from chromium-win.
+ self._executive.kill_all("httpd.exe")
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
index 83cf99de..55c4558 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py
@@ -41,6 +41,10 @@ The script does the following for each platform specified:
At the end, the script generates a html that compares old and new baselines.
"""
+from __future__ import with_statement
+
+import codecs
+import copy
import logging
import optparse
import os
@@ -51,24 +55,26 @@ import sys
import tempfile
import time
import urllib
-import webbrowser
import zipfile
-from layout_package import path_utils
+from webkitpy.common.system import path
+from webkitpy.common.system import user
+from webkitpy.common.system.executive import Executive, ScriptError
+import webkitpy.common.checkout.scm as scm
+
+import port
from layout_package import test_expectations
-from test_types import image_diff
-from test_types import text_diff
-# Repository type constants.
-REPO_SVN, REPO_UNKNOWN = range(2)
+_log = logging.getLogger("webkitpy.layout_tests."
+ "rebaseline_chromium_webkit_tests")
BASELINE_SUFFIXES = ['.txt', '.png', '.checksum']
REBASELINE_PLATFORM_ORDER = ['mac', 'win', 'win-xp', 'win-vista', 'linux']
-ARCHIVE_DIR_NAME_DICT = {'win': 'webkit-rel',
+ARCHIVE_DIR_NAME_DICT = {'win': 'Webkit_Win',
'win-vista': 'webkit-dbg-vista',
- 'win-xp': 'webkit-rel',
- 'mac': 'webkit-rel-mac5',
- 'linux': 'webkit-rel-linux',
+ 'win-xp': 'Webkit_Win',
+ 'mac': 'Webkit_Mac10_5',
+ 'linux': 'webkit-rel-linux64',
'win-canary': 'webkit-rel-webkit-org',
'win-vista-canary': 'webkit-dbg-vista',
'win-xp-canary': 'webkit-rel-webkit-org',
@@ -76,56 +82,6 @@ ARCHIVE_DIR_NAME_DICT = {'win': 'webkit-rel',
'linux-canary': 'webkit-rel-linux-webkit-org'}
-# FIXME: Should be rolled into webkitpy.Executive
-def run_shell_with_return_code(command, print_output=False):
- """Executes a command and returns the output and process return code.
-
- Args:
- command: program and arguments.
- print_output: if true, print the command results to standard output.
-
- Returns:
- command output, return code
- """
-
- # Use a shell for subcommands on Windows to get a PATH search.
- use_shell = sys.platform.startswith('win')
- p = subprocess.Popen(command, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT, shell=use_shell)
- if print_output:
- output_array = []
- while True:
- line = p.stdout.readline()
- if not line:
- break
- if print_output:
- print line.strip('\n')
- output_array.append(line)
- output = ''.join(output_array)
- else:
- output = p.stdout.read()
- p.wait()
- p.stdout.close()
-
- return output, p.returncode
-
-
-# FIXME: Should be rolled into webkitpy.Executive
-def run_shell(command, print_output=False):
- """Executes a command and returns the output.
-
- Args:
- command: program and arguments.
- print_output: if true, print the command results to standard output.
-
- Returns:
- command output
- """
-
- output, return_code = run_shell_with_return_code(command, print_output)
- return output
-
-
def log_dashed_string(text, platform, logging_level=logging.INFO):
"""Log text message with dashes on both sides."""
@@ -137,11 +93,11 @@ def log_dashed_string(text, platform, logging_level=logging.INFO):
msg = '%s %s %s' % (dashes, msg, dashes)
if logging_level == logging.ERROR:
- logging.error(msg)
+ _log.error(msg)
elif logging_level == logging.WARNING:
- logging.warn(msg)
+ _log.warn(msg)
else:
- logging.info(msg)
+ _log.info(msg)
def setup_html_directory(html_directory):
@@ -163,11 +119,11 @@ def setup_html_directory(html_directory):
os.mkdir(html_directory)
html_directory = os.path.join(html_directory, 'rebaseline_html')
- logging.info('Html directory: "%s"', html_directory)
+ _log.info('Html directory: "%s"', html_directory)
if os.path.exists(html_directory):
shutil.rmtree(html_directory, True)
- logging.info('Deleted file at html directory: "%s"', html_directory)
+ _log.info('Deleted file at html directory: "%s"', html_directory)
if not os.path.exists(html_directory):
os.mkdir(html_directory)
@@ -191,7 +147,7 @@ def get_result_file_fullpath(html_directory, baseline_filename, platform,
base, ext = os.path.splitext(baseline_filename)
result_filename = '%s-%s-%s%s' % (base, platform, result_type, ext)
fullpath = os.path.join(html_directory, result_filename)
- logging.debug(' Result file full path: "%s".', fullpath)
+ _log.debug(' Result file full path: "%s".', fullpath)
return fullpath
@@ -200,11 +156,21 @@ class Rebaseliner(object):
REVISION_REGEX = r'<a href=\"(\d+)/\">'
- def __init__(self, platform, options):
- self._file_dir = path_utils.path_from_base('webkit', 'tools',
- 'layout_tests')
+ def __init__(self, running_port, target_port, platform, options):
+ """
+ Args:
+ running_port: the Port the script is running on.
+ target_port: the Port the script uses to find port-specific
+ configuration information like the test_expectations.txt
+ file location and the list of test platforms.
+ platform: the test platform to rebaseline
+ options: the command-line options object."""
self._platform = platform
self._options = options
+ self._port = running_port
+ self._target_port = target_port
+ self._rebaseline_port = port.get(
+ self._target_port.test_platform_name_to_name(platform), options)
self._rebaselining_tests = []
self._rebaselined_tests = []
@@ -212,14 +178,15 @@ class Rebaseliner(object):
# -. compile list of tests that need rebaselining.
# -. update the tests in test_expectations file after rebaseline
# is done.
+ expectations_str = self._rebaseline_port.test_expectations()
self._test_expectations = \
- test_expectations.TestExpectations(None,
- self._file_dir,
- platform,
+ test_expectations.TestExpectations(self._rebaseline_port,
+ None,
+ expectations_str,
+ self._platform,
False,
False)
-
- self._repo_type = self._get_repo_type()
+ self._scm = scm.default_scm()
def run(self, backup):
"""Run rebaseline process."""
@@ -230,9 +197,9 @@ class Rebaseliner(object):
log_dashed_string('Downloading archive', self._platform)
archive_file = self._download_buildbot_archive()
- logging.info('')
+ _log.info('')
if not archive_file:
- logging.error('No archive found.')
+ _log.error('No archive found.')
return False
log_dashed_string('Extracting and adding new baselines',
@@ -243,34 +210,25 @@ class Rebaseliner(object):
log_dashed_string('Updating rebaselined tests in file',
self._platform)
self._update_rebaselined_tests_in_file(backup)
- logging.info('')
+ _log.info('')
if len(self._rebaselining_tests) != len(self._rebaselined_tests):
- logging.warning('NOT ALL TESTS THAT NEED REBASELINING HAVE BEEN '
- 'REBASELINED.')
- logging.warning(' Total tests needing rebaselining: %d',
- len(self._rebaselining_tests))
- logging.warning(' Total tests rebaselined: %d',
- len(self._rebaselined_tests))
+ _log.warning('NOT ALL TESTS THAT NEED REBASELINING HAVE BEEN '
+ 'REBASELINED.')
+ _log.warning(' Total tests needing rebaselining: %d',
+ len(self._rebaselining_tests))
+ _log.warning(' Total tests rebaselined: %d',
+ len(self._rebaselined_tests))
return False
- logging.warning('All tests needing rebaselining were successfully '
- 'rebaselined.')
+ _log.warning('All tests needing rebaselining were successfully '
+ 'rebaselined.')
return True
def get_rebaselining_tests(self):
return self._rebaselining_tests
- def _get_repo_type(self):
- """Get the repository type that client is using."""
- output, return_code = run_shell_with_return_code(['svn', 'info'],
- False)
- if return_code == 0:
- return REPO_SVN
-
- return REPO_UNKNOWN
-
def _compile_rebaselining_tests(self):
"""Compile list of tests that need rebaselining for the platform.
@@ -282,16 +240,16 @@ class Rebaseliner(object):
self._rebaselining_tests = \
self._test_expectations.get_rebaselining_failures()
if not self._rebaselining_tests:
- logging.warn('No tests found that need rebaselining.')
+ _log.warn('No tests found that need rebaselining.')
return None
- logging.info('Total number of tests needing rebaselining '
- 'for "%s": "%d"', self._platform,
- len(self._rebaselining_tests))
+ _log.info('Total number of tests needing rebaselining '
+ 'for "%s": "%d"', self._platform,
+ len(self._rebaselining_tests))
test_no = 1
for test in self._rebaselining_tests:
- logging.info(' %d: %s', test_no, test)
+ _log.info(' %d: %s', test_no, test)
test_no += 1
return self._rebaselining_tests
@@ -307,7 +265,7 @@ class Rebaseliner(object):
None on failure.
"""
- logging.debug('Url to retrieve revision: "%s"', url)
+ _log.debug('Url to retrieve revision: "%s"', url)
f = urllib.urlopen(url)
content = f.read()
@@ -315,11 +273,11 @@ class Rebaseliner(object):
revisions = re.findall(self.REVISION_REGEX, content)
if not revisions:
- logging.error('Failed to find revision, content: "%s"', content)
+ _log.error('Failed to find revision, content: "%s"', content)
return None
revisions.sort(key=int)
- logging.info('Latest revision: "%s"', revisions[len(revisions) - 1])
+ _log.info('Latest revision: "%s"', revisions[len(revisions) - 1])
return revisions[len(revisions) - 1]
def _get_archive_dir_name(self, platform, webkit_canary):
@@ -336,8 +294,8 @@ class Rebaseliner(object):
if platform in ARCHIVE_DIR_NAME_DICT:
return ARCHIVE_DIR_NAME_DICT[platform]
else:
- logging.error('Cannot find platform key %s in archive '
- 'directory name dictionary', platform)
+ _log.error('Cannot find platform key %s in archive '
+ 'directory name dictionary', platform)
return None
def _get_archive_url(self):
@@ -348,21 +306,23 @@ class Rebaseliner(object):
None on failure
"""
+ if self._options.force_archive_url:
+ return self._options.force_archive_url
+
dir_name = self._get_archive_dir_name(self._platform,
self._options.webkit_canary)
if not dir_name:
return None
- logging.debug('Buildbot platform dir name: "%s"', dir_name)
+ _log.debug('Buildbot platform dir name: "%s"', dir_name)
url_base = '%s/%s/' % (self._options.archive_url, dir_name)
latest_revision = self._get_latest_revision(url_base)
if latest_revision is None or latest_revision <= 0:
return None
-
archive_url = ('%s%s/layout-test-results.zip' % (url_base,
latest_revision))
- logging.info('Archive url: "%s"', archive_url)
+ _log.info('Archive url: "%s"', archive_url)
return archive_url
def _download_buildbot_archive(self):
@@ -378,7 +338,7 @@ class Rebaseliner(object):
return None
fn = urllib.urlretrieve(url)[0]
- logging.info('Archive downloaded and saved to file: "%s"', fn)
+ _log.info('Archive downloaded and saved to file: "%s"', fn)
return fn
def _extract_and_add_new_baselines(self, archive_file):
@@ -395,32 +355,33 @@ class Rebaseliner(object):
zip_file = zipfile.ZipFile(archive_file, 'r')
zip_namelist = zip_file.namelist()
- logging.debug('zip file namelist:')
+ _log.debug('zip file namelist:')
for name in zip_namelist:
- logging.debug(' ' + name)
+ _log.debug(' ' + name)
- platform = path_utils.platform_name(self._platform)
- logging.debug('Platform dir: "%s"', platform)
+ platform = self._rebaseline_port.test_platform_name_to_name(
+ self._platform)
+ _log.debug('Platform dir: "%s"', platform)
test_no = 1
self._rebaselined_tests = []
for test in self._rebaselining_tests:
- logging.info('Test %d: %s', test_no, test)
+ _log.info('Test %d: %s', test_no, test)
found = False
- svn_error = False
+ scm_error = False
test_basename = os.path.splitext(test)[0]
for suffix in BASELINE_SUFFIXES:
archive_test_name = ('layout-test-results/%s-actual%s' %
- (test_basename, suffix))
- logging.debug(' Archive test file name: "%s"',
- archive_test_name)
+ (test_basename, suffix))
+ _log.debug(' Archive test file name: "%s"',
+ archive_test_name)
if not archive_test_name in zip_namelist:
- logging.info(' %s file not in archive.', suffix)
+ _log.info(' %s file not in archive.', suffix)
continue
found = True
- logging.info(' %s file found in archive.', suffix)
+ _log.info(' %s file found in archive.', suffix)
# Extract new baseline from archive and save it to a temp file.
data = zip_file.read(archive_test_name)
@@ -431,11 +392,10 @@ class Rebaseliner(object):
expected_filename = '%s-expected%s' % (test_basename, suffix)
expected_fullpath = os.path.join(
- path_utils.chromium_baseline_path(platform),
- expected_filename)
+ self._rebaseline_port.baseline_path(), expected_filename)
expected_fullpath = os.path.normpath(expected_fullpath)
- logging.debug(' Expected file full path: "%s"',
- expected_fullpath)
+ _log.debug(' Expected file full path: "%s"',
+ expected_fullpath)
# TODO(victorw): for now, the rebaselining tool checks whether
# or not THIS baseline is duplicate and should be skipped.
@@ -443,33 +403,34 @@ class Rebaseliner(object):
# and lower
# levels and remove all duplicated baselines.
if self._is_dup_baseline(temp_name,
- expected_fullpath,
- test,
- suffix,
- self._platform):
+ expected_fullpath,
+ test,
+ suffix,
+ self._platform):
os.remove(temp_name)
self._delete_baseline(expected_fullpath)
continue
# Create the new baseline directory if it doesn't already
# exist.
- path_utils.maybe_make_directory(
+ self._port.maybe_make_directory(
os.path.dirname(expected_fullpath))
shutil.move(temp_name, expected_fullpath)
- if not self._svn_add(expected_fullpath):
- svn_error = True
+ if 0 != self._scm.add(expected_fullpath, return_exit_code=True):
+ # FIXME: print detailed diagnose messages
+ scm_error = True
elif suffix != '.checksum':
self._create_html_baseline_files(expected_fullpath)
if not found:
- logging.warn(' No new baselines found in archive.')
+ _log.warn(' No new baselines found in archive.')
else:
- if svn_error:
- logging.warn(' Failed to add baselines to SVN.')
+ if scm_error:
+ _log.warn(' Failed to add baselines to your repository.')
else:
- logging.info(' Rebaseline succeeded.')
+ _log.info(' Rebaseline succeeded.')
self._rebaselined_tests.append(test)
test_no += 1
@@ -497,48 +458,47 @@ class Rebaseliner(object):
True if the baseline is unnecessary.
False otherwise.
"""
- test_filepath = os.path.join(path_utils.layout_tests_dir(), test)
- all_baselines = path_utils.expected_baselines(test_filepath,
- suffix, platform, True)
+ test_filepath = os.path.join(self._target_port.layout_tests_dir(),
+ test)
+ all_baselines = self._rebaseline_port.expected_baselines(
+ test_filepath, suffix, True)
for (fallback_dir, fallback_file) in all_baselines:
if fallback_dir and fallback_file:
fallback_fullpath = os.path.normpath(
os.path.join(fallback_dir, fallback_file))
if fallback_fullpath.lower() != baseline_path.lower():
- if not self._diff_baselines(new_baseline,
- fallback_fullpath):
- logging.info(' Found same baseline at %s',
- fallback_fullpath)
+ with codecs.open(new_baseline, "r",
+ None) as file_handle1:
+ new_output = file_handle1.read()
+ with codecs.open(fallback_fullpath, "r",
+ None) as file_handle2:
+ fallback_output = file_handle2.read()
+ is_image = baseline_path.lower().endswith('.png')
+ if not self._diff_baselines(new_output, fallback_output,
+ is_image):
+ _log.info(' Found same baseline at %s',
+ fallback_fullpath)
return True
else:
return False
return False
- def _diff_baselines(self, file1, file2):
+ def _diff_baselines(self, output1, output2, is_image):
"""Check whether two baselines are different.
Args:
- file1, file2: full paths of the baselines to compare.
+ output1, output2: contents of the baselines to compare.
Returns:
True if two files are different or have different extensions.
False otherwise.
"""
- ext1 = os.path.splitext(file1)[1].upper()
- ext2 = os.path.splitext(file2)[1].upper()
- if ext1 != ext2:
- logging.warn('Files to compare have different ext. '
- 'File1: %s; File2: %s', file1, file2)
- return True
-
- if ext1 == '.PNG':
- return image_diff.ImageDiff(self._platform, '').diff_files(file1,
- file2)
+ if is_image:
+ return self._port.diff_image(output1, output2, None)
else:
- return text_diff.TestTextDiff(self._platform, '').diff_files(file1,
- file2)
+ return self._port.compare_text(output1, output2)
def _delete_baseline(self, filename):
"""Remove the file from repository and delete it from disk.
@@ -549,15 +509,7 @@ class Rebaseliner(object):
if not filename or not os.path.isfile(filename):
return
-
- if self._repo_type == REPO_SVN:
- parent_dir, basename = os.path.split(filename)
- original_dir = os.getcwd()
- os.chdir(parent_dir)
- run_shell(['svn', 'delete', '--force', basename], False)
- os.chdir(original_dir)
- else:
- os.remove(filename)
+ self._scm.delete(filename)
def _update_rebaselined_tests_in_file(self, backup):
"""Update the rebaselined tests in test expectations file.
@@ -570,91 +522,25 @@ class Rebaseliner(object):
"""
if self._rebaselined_tests:
- self._test_expectations.remove_platform_from_file(
- self._rebaselined_tests, self._platform, backup)
+ new_expectations = (
+ self._test_expectations.remove_platform_from_expectations(
+ self._rebaselined_tests, self._platform))
+ path = self._target_port.path_to_test_expectations_file()
+ if backup:
+ date_suffix = time.strftime('%Y%m%d%H%M%S',
+ time.localtime(time.time()))
+ backup_file = ('%s.orig.%s' % (path, date_suffix))
+ if os.path.exists(backup_file):
+ os.remove(backup_file)
+ _log.info('Saving original file to "%s"', backup_file)
+ os.rename(path, backup_file)
+ # FIXME: What encoding are these files?
+ # Or is new_expectations always a byte array?
+ with open(path, "w") as file:
+ file.write(new_expectations)
+ # self._scm.add(path)
else:
- logging.info('No test was rebaselined so nothing to remove.')
-
- def _svn_add(self, filename):
- """Add the file to SVN repository.
-
- Args:
- filename: full path of the file to add.
-
- Returns:
- True if the file already exists in SVN or is sucessfully added
- to SVN.
- False otherwise.
- """
-
- if not filename:
- return False
-
- parent_dir, basename = os.path.split(filename)
- if self._repo_type != REPO_SVN or parent_dir == filename:
- logging.info("No svn checkout found, skip svn add.")
- return True
-
- original_dir = os.getcwd()
- os.chdir(parent_dir)
- status_output = run_shell(['svn', 'status', basename], False)
- os.chdir(original_dir)
- output = status_output.upper()
- if output.startswith('A') or output.startswith('M'):
- logging.info(' File already added to SVN: "%s"', filename)
- return True
-
- if output.find('IS NOT A WORKING COPY') >= 0:
- logging.info(' File is not a working copy, add its parent: "%s"',
- parent_dir)
- return self._svn_add(parent_dir)
-
- os.chdir(parent_dir)
- add_output = run_shell(['svn', 'add', basename], True)
- os.chdir(original_dir)
- output = add_output.upper().rstrip()
- if output.startswith('A') and output.find(basename.upper()) >= 0:
- logging.info(' Added new file: "%s"', filename)
- self._svn_prop_set(filename)
- return True
-
- if (not status_output) and (add_output.upper().find(
- 'ALREADY UNDER VERSION CONTROL') >= 0):
- logging.info(' File already under SVN and has no change: "%s"',
- filename)
- return True
-
- logging.warn(' Failed to add file to SVN: "%s"', filename)
- logging.warn(' Svn status output: "%s"', status_output)
- logging.warn(' Svn add output: "%s"', add_output)
- return False
-
- def _svn_prop_set(self, filename):
- """Set the baseline property
-
- Args:
- filename: full path of the file to add.
-
- Returns:
- True if the file already exists in SVN or is sucessfully added
- to SVN.
- False otherwise.
- """
- ext = os.path.splitext(filename)[1].upper()
- if ext != '.TXT' and ext != '.PNG' and ext != '.CHECKSUM':
- return
-
- parent_dir, basename = os.path.split(filename)
- original_dir = os.getcwd()
- os.chdir(parent_dir)
- if ext == '.PNG':
- cmd = ['svn', 'pset', 'svn:mime-type', 'image/png', basename]
- else:
- cmd = ['svn', 'pset', 'svn:eol-style', 'LF', basename]
-
- logging.debug(' Set svn prop: %s', ' '.join(cmd))
- run_shell(cmd, False)
- os.chdir(original_dir)
+ _log.info('No test was rebaselined so nothing to remove.')
def _create_html_baseline_files(self, baseline_fullpath):
"""Create baseline files (old, new and diff) in html directory.
@@ -674,61 +560,40 @@ class Rebaseliner(object):
baseline_filename, self._platform,
'new')
shutil.copyfile(baseline_fullpath, new_file)
- logging.info(' Html: copied new baseline file from "%s" to "%s".',
- baseline_fullpath, new_file)
+ _log.info(' Html: copied new baseline file from "%s" to "%s".',
+ baseline_fullpath, new_file)
+
+ # Get the old baseline from the repository and save to the html directory.
+ try:
+ output = self._scm.show_head(baseline_fullpath)
+ except ScriptError, e:
+ _log.info(e)
+ output = ""
- # Get the old baseline from SVN and save to the html directory.
- output = run_shell(['svn', 'cat', '-r', 'BASE', baseline_fullpath])
if (not output) or (output.upper().rstrip().endswith(
'NO SUCH FILE OR DIRECTORY')):
- logging.info(' No base file: "%s"', baseline_fullpath)
+ _log.info(' No base file: "%s"', baseline_fullpath)
return
base_file = get_result_file_fullpath(self._options.html_directory,
baseline_filename, self._platform,
'old')
- f = open(base_file, 'wb')
- f.write(output)
- f.close()
- logging.info(' Html: created old baseline file: "%s".',
- base_file)
+ # We should be using an explicit encoding here.
+ with open(base_file, "wb") as file:
+ file.write(output)
+ _log.info(' Html: created old baseline file: "%s".',
+ base_file)
# Get the diff between old and new baselines and save to the html dir.
if baseline_filename.upper().endswith('.TXT'):
- # If the user specified a custom diff command in their svn config
- # file, then it'll be used when we do svn diff, which we don't want
- # to happen since we want the unified diff. Using --diff-cmd=diff
- # doesn't always work, since they can have another diff executable
- # in their path that gives different line endings. So we use a
- # bogus temp directory as the config directory, which gets
- # around these problems.
- if sys.platform.startswith("win"):
- parent_dir = tempfile.gettempdir()
- else:
- parent_dir = sys.path[0] # tempdir is not secure.
- bogus_dir = os.path.join(parent_dir, "temp_svn_config")
- logging.debug(' Html: temp config dir: "%s".', bogus_dir)
- if not os.path.exists(bogus_dir):
- os.mkdir(bogus_dir)
- delete_bogus_dir = True
- else:
- delete_bogus_dir = False
-
- output = run_shell(["svn", "diff", "--config-dir", bogus_dir,
- baseline_fullpath])
+ output = self._scm.diff_for_file(baseline_fullpath, log=_log)
if output:
diff_file = get_result_file_fullpath(
self._options.html_directory, baseline_filename,
self._platform, 'diff')
- f = open(diff_file, 'wb')
- f.write(output)
- f.close()
- logging.info(' Html: created baseline diff file: "%s".',
- diff_file)
-
- if delete_bogus_dir:
- shutil.rmtree(bogus_dir, True)
- logging.debug(' Html: removed temp config dir: "%s".',
- bogus_dir)
+ with open(diff_file, 'wb') as file:
+ file.write(output)
+ _log.info(' Html: created baseline diff file: "%s".',
+ diff_file)
class HtmlGenerator(object):
@@ -777,17 +642,24 @@ class HtmlGenerator(object):
'<img style="width: 200" src="%(uri)s" /></a></td>')
HTML_TR = '<tr>%s</tr>'
- def __init__(self, options, platforms, rebaselining_tests):
+ def __init__(self, target_port, options, platforms, rebaselining_tests,
+ executive):
self._html_directory = options.html_directory
+ self._target_port = target_port
self._platforms = platforms
self._rebaselining_tests = rebaselining_tests
+ self._executive = executive
self._html_file = os.path.join(options.html_directory,
'rebaseline.html')
+ def abspath_to_uri(self, filename):
+ """Converts an absolute path to a file: URI."""
+ return path.abspath_to_uri(filename, self._executive)
+
def generate_html(self):
"""Generate html file for rebaselining result comparison."""
- logging.info('Generating html file')
+ _log.info('Generating html file')
html_body = ''
if not self._rebaselining_tests:
@@ -798,29 +670,25 @@ class HtmlGenerator(object):
test_no = 1
for test in tests:
- logging.info('Test %d: %s', test_no, test)
+ _log.info('Test %d: %s', test_no, test)
html_body += self._generate_html_for_one_test(test)
html = self.HTML_REBASELINE % ({'time': time.asctime(),
'body': html_body})
- logging.debug(html)
+ _log.debug(html)
- f = open(self._html_file, 'w')
- f.write(html)
- f.close()
+ with codecs.open(self._html_file, "w", "utf-8") as file:
+ file.write(html)
- logging.info('Baseline comparison html generated at "%s"',
- self._html_file)
+ _log.info('Baseline comparison html generated at "%s"',
+ self._html_file)
def show_html(self):
"""Launch the rebaselining html in brwoser."""
- logging.info('Launching html: "%s"', self._html_file)
-
- html_uri = path_utils.filename_to_uri(self._html_file)
- webbrowser.open(html_uri, 1)
-
- logging.info('Html launched.')
+ _log.info('Launching html: "%s"', self._html_file)
+ user.User().open_url(self._html_file)
+ _log.info('Html launched.')
def _generate_baseline_links(self, test_basename, suffix, platform):
"""Generate links for baseline results (old, new and diff).
@@ -835,18 +703,18 @@ class HtmlGenerator(object):
"""
baseline_filename = '%s-expected%s' % (test_basename, suffix)
- logging.debug(' baseline filename: "%s"', baseline_filename)
+ _log.debug(' baseline filename: "%s"', baseline_filename)
new_file = get_result_file_fullpath(self._html_directory,
baseline_filename, platform, 'new')
- logging.info(' New baseline file: "%s"', new_file)
+ _log.info(' New baseline file: "%s"', new_file)
if not os.path.exists(new_file):
- logging.info(' No new baseline file: "%s"', new_file)
+ _log.info(' No new baseline file: "%s"', new_file)
return ''
old_file = get_result_file_fullpath(self._html_directory,
baseline_filename, platform, 'old')
- logging.info(' Old baseline file: "%s"', old_file)
+ _log.info(' Old baseline file: "%s"', old_file)
if suffix == '.png':
html_td_link = self.HTML_TD_LINK_IMG
else:
@@ -855,24 +723,24 @@ class HtmlGenerator(object):
links = ''
if os.path.exists(old_file):
links += html_td_link % {
- 'uri': path_utils.filename_to_uri(old_file),
+ 'uri': self.abspath_to_uri(old_file),
'name': baseline_filename}
else:
- logging.info(' No old baseline file: "%s"', old_file)
+ _log.info(' No old baseline file: "%s"', old_file)
links += self.HTML_TD_NOLINK % ''
- links += html_td_link % {'uri': path_utils.filename_to_uri(new_file),
+ links += html_td_link % {'uri': self.abspath_to_uri(new_file),
'name': baseline_filename}
diff_file = get_result_file_fullpath(self._html_directory,
baseline_filename, platform,
'diff')
- logging.info(' Baseline diff file: "%s"', diff_file)
+ _log.info(' Baseline diff file: "%s"', diff_file)
if os.path.exists(diff_file):
- links += html_td_link % {'uri': path_utils.filename_to_uri(
- diff_file), 'name': 'Diff'}
+ links += html_td_link % {'uri': self.abspath_to_uri(diff_file),
+ 'name': 'Diff'}
else:
- logging.info(' No baseline diff file: "%s"', diff_file)
+ _log.info(' No baseline diff file: "%s"', diff_file)
links += self.HTML_TD_NOLINK % ''
return links
@@ -888,13 +756,13 @@ class HtmlGenerator(object):
"""
test_basename = os.path.basename(os.path.splitext(test)[0])
- logging.info(' basename: "%s"', test_basename)
+ _log.info(' basename: "%s"', test_basename)
rows = []
for suffix in BASELINE_SUFFIXES:
if suffix == '.checksum':
continue
- logging.info(' Checking %s files', suffix)
+ _log.info(' Checking %s files', suffix)
for platform in self._platforms:
links = self._generate_baseline_links(test_basename, suffix,
platform)
@@ -903,17 +771,17 @@ class HtmlGenerator(object):
suffix)
row += self.HTML_TD_NOLINK % platform
row += links
- logging.debug(' html row: %s', row)
+ _log.debug(' html row: %s', row)
rows.append(self.HTML_TR % row)
if rows:
- test_path = os.path.join(path_utils.layout_tests_dir(), test)
- html = self.HTML_TR_TEST % (path_utils.filename_to_uri(test_path),
- test)
+ test_path = os.path.join(self._target_port.layout_tests_dir(),
+ test)
+ html = self.HTML_TR_TEST % (self.abspath_to_uri(test_path), test)
html += self.HTML_TEST_DETAIL % ' '.join(rows)
- logging.debug(' html for test: %s', html)
+ _log.debug(' html for test: %s', html)
return self.HTML_TABLE_TEST % html
return ''
@@ -929,15 +797,40 @@ class HtmlGenerator(object):
return 'Other'
-def main():
- """Main function to produce new baselines."""
+def get_host_port_object(options):
+ """Return a port object for the platform we're running on."""
+ # The only thing we really need on the host is a way to diff
+ # text files and image files, which means we need to check that some
+ # version of ImageDiff has been built. We will look for either Debug
+ # or Release versions of the default port on the platform.
+ options.configuration = "Release"
+ port_obj = port.get(None, options)
+ if not port_obj.check_image_diff(override_step=None, logging=False):
+ _log.debug('No release version of the image diff binary was found.')
+ options.configuration = "Debug"
+ port_obj = port.get(None, options)
+ if not port_obj.check_image_diff(override_step=None, logging=False):
+ _log.error('No version of image diff was found. Check your build.')
+ return None
+ else:
+ _log.debug('Found the debug version of the image diff binary.')
+ else:
+ _log.debug('Found the release version of the image diff binary.')
+ return port_obj
+
+def parse_options(args):
+ """Parse options and return a pair of host options and target options."""
option_parser = optparse.OptionParser()
option_parser.add_option('-v', '--verbose',
action='store_true',
default=False,
help='include debug-level logging.')
+ option_parser.add_option('-q', '--quiet',
+ action='store_true',
+ help='Suppress result HTML viewing')
+
option_parser.add_option('-p', '--platforms',
default='mac,win,win-xp,win-vista,linux',
help=('Comma delimited list of platforms '
@@ -948,6 +841,9 @@ def main():
'layout_test_results'),
help=('Url to find the layout test result archive'
' file.'))
+ option_parser.add_option('-U', '--force_archive_url',
+ help=('Url of result zip file. This option is for debugging '
+ 'purposes'))
option_parser.add_option('-w', '--webkit_canary',
action='store_true',
@@ -963,10 +859,42 @@ def main():
option_parser.add_option('-d', '--html_directory',
default='',
- help=('The directory that stores the results for'
- ' rebaselining comparison.'))
+ help=('The directory that stores the results for '
+ 'rebaselining comparison.'))
+
+ option_parser.add_option('', '--use_drt',
+ action='store_true',
+ default=False,
+ help=('Use ImageDiff from DumpRenderTree instead '
+ 'of image_diff for pixel tests.'))
+
+ option_parser.add_option('', '--target-platform',
+ default='chromium',
+ help=('The target platform to rebaseline '
+ '("mac", "chromium", "qt", etc.). Defaults '
+ 'to "chromium".'))
+ options = option_parser.parse_args(args)[0]
- options = option_parser.parse_args()[0]
+ target_options = copy.copy(options)
+ if options.target_platform == 'chromium':
+ target_options.chromium = True
+ options.tolerance = 0
+
+ return (options, target_options)
+
+
+def main(executive=Executive()):
+ """Main function to produce new baselines."""
+
+ (options, target_options) = parse_options(sys.argv[1:])
+
+ # We need to create three different Port objects over the life of this
+ # script. |target_port_obj| is used to determine configuration information:
+ # location of the expectations file, names of ports to rebaseline, etc.
+ # |port_obj| is used for runtime functionality like actually diffing
+ # Then we create a rebaselining port to actual find and manage the
+ # baselines.
+ target_port_obj = port.get(None, target_options)
# Set up our logging format.
log_level = logging.INFO
@@ -977,15 +905,19 @@ def main():
'%(levelname)s %(message)s'),
datefmt='%y%m%d %H:%M:%S')
- # Verify 'platforms' option is valid
+ host_port_obj = get_host_port_object(options)
+ if not host_port_obj:
+ sys.exit(1)
+
+ # Verify 'platforms' option is valid.
if not options.platforms:
- logging.error('Invalid "platforms" option. --platforms must be '
- 'specified in order to rebaseline.')
+ _log.error('Invalid "platforms" option. --platforms must be '
+ 'specified in order to rebaseline.')
sys.exit(1)
platforms = [p.strip().lower() for p in options.platforms.split(',')]
for platform in platforms:
if not platform in REBASELINE_PLATFORM_ORDER:
- logging.error('Invalid platform: "%s"' % (platform))
+ _log.error('Invalid platform: "%s"' % (platform))
sys.exit(1)
# Adjust the platform order so rebaseline tool is running at the order of
@@ -1002,9 +934,10 @@ def main():
rebaselining_tests = set()
backup = options.backup
for platform in rebaseline_platforms:
- rebaseliner = Rebaseliner(platform, options)
+ rebaseliner = Rebaseliner(host_port_obj, target_port_obj,
+ platform, options)
- logging.info('')
+ _log.info('')
log_dashed_string('Rebaseline started', platform)
if rebaseliner.run(backup):
# Only need to backup one original copy of test expectation file.
@@ -1015,13 +948,16 @@ def main():
rebaselining_tests |= set(rebaseliner.get_rebaselining_tests())
- logging.info('')
+ _log.info('')
log_dashed_string('Rebaselining result comparison started', None)
- html_generator = HtmlGenerator(options,
+ html_generator = HtmlGenerator(target_port_obj,
+ options,
rebaseline_platforms,
- rebaselining_tests)
+ rebaselining_tests,
+ executive=executive)
html_generator.generate_html()
- html_generator.show_html()
+ if not options.quiet:
+ html_generator.show_html()
log_dashed_string('Rebaselining result comparison done', None)
sys.exit(0)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py
new file mode 100644
index 0000000..7c55b94
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests_unittest.py
@@ -0,0 +1,157 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for rebaseline_chromium_webkit_tests.py."""
+
+import os
+import sys
+import unittest
+
+from webkitpy.tool import mocktool
+from webkitpy.layout_tests import port
+from webkitpy.layout_tests import rebaseline_chromium_webkit_tests
+from webkitpy.common.system.executive import Executive, ScriptError
+
+
+class MockPort(object):
+ def __init__(self, image_diff_exists):
+ self.image_diff_exists = image_diff_exists
+
+ def check_image_diff(self, override_step, logging):
+ return self.image_diff_exists
+
+
+def get_mock_get(config_expectations):
+ def mock_get(port_name, options):
+ return MockPort(config_expectations[options.configuration])
+ return mock_get
+
+
+class TestGetHostPortObject(unittest.TestCase):
+ def assert_result(self, release_present, debug_present, valid_port_obj):
+ # Tests whether we get a valid port object returned when we claim
+ # that Image diff is (or isn't) present in the two configs.
+ port.get = get_mock_get({'Release': release_present,
+ 'Debug': debug_present})
+ options = mocktool.MockOptions(configuration=None,
+ html_directory=None)
+ port_obj = rebaseline_chromium_webkit_tests.get_host_port_object(
+ options)
+ if valid_port_obj:
+ self.assertNotEqual(port_obj, None)
+ else:
+ self.assertEqual(port_obj, None)
+
+ def test_get_host_port_object(self):
+ # Save the normal port.get() function for future testing.
+ old_get = port.get
+
+ # Test whether we get a valid port object back for the four
+ # possible cases of having ImageDiffs built. It should work when
+ # there is at least one binary present.
+ self.assert_result(False, False, False)
+ self.assert_result(True, False, True)
+ self.assert_result(False, True, True)
+ self.assert_result(True, True, True)
+
+ # Restore the normal port.get() function.
+ port.get = old_get
+
+
+class TestRebaseliner(unittest.TestCase):
+ def make_rebaseliner(self):
+ options = mocktool.MockOptions(configuration=None,
+ html_directory=None)
+ host_port_obj = port.get('test', options)
+ target_options = options
+ target_port_obj = port.get('test', target_options)
+ platform = 'test'
+ return rebaseline_chromium_webkit_tests.Rebaseliner(
+ host_port_obj, target_port_obj, platform, options)
+
+ def test_parse_options(self):
+ (options, target_options) = rebaseline_chromium_webkit_tests.parse_options([])
+ self.assertTrue(target_options.chromium)
+ self.assertEqual(options.tolerance, 0)
+
+ (options, target_options) = rebaseline_chromium_webkit_tests.parse_options(['--target-platform', 'qt'])
+ self.assertFalse(hasattr(target_options, 'chromium'))
+ self.assertEqual(options.tolerance, 0)
+
+ def test_noop(self):
+ # this method tests that was can at least instantiate an object, even
+ # if there is nothing to do.
+ rebaseliner = self.make_rebaseliner()
+ self.assertNotEqual(rebaseliner, None)
+
+ def test_diff_baselines_txt(self):
+ rebaseliner = self.make_rebaseliner()
+ output = rebaseliner._port.expected_text(
+ os.path.join(rebaseliner._port.layout_tests_dir(),
+ 'passes/text.html'))
+ self.assertFalse(rebaseliner._diff_baselines(output, output,
+ is_image=False))
+
+ def test_diff_baselines_png(self):
+ rebaseliner = self.make_rebaseliner()
+ image = rebaseliner._port.expected_image(
+ os.path.join(rebaseliner._port.layout_tests_dir(),
+ 'passes/image.html'))
+ self.assertFalse(rebaseliner._diff_baselines(image, image,
+ is_image=True))
+
+
+class TestHtmlGenerator(unittest.TestCase):
+ def make_generator(self, tests):
+ return rebaseline_chromium_webkit_tests.HtmlGenerator(
+ target_port=None,
+ options=mocktool.MockOptions(configuration=None,
+ html_directory='/tmp'),
+ platforms=['mac'],
+ rebaselining_tests=tests,
+ executive=Executive())
+
+ def test_generate_baseline_links(self):
+ orig_platform = sys.platform
+ orig_exists = os.path.exists
+
+ try:
+ sys.platform = 'darwin'
+ os.path.exists = lambda x: True
+ generator = self.make_generator(["foo.txt"])
+ links = generator._generate_baseline_links("foo", ".txt", "mac")
+ expected_links = '<td align=center><a href="file:///tmp/foo-expected-mac-old.txt">foo-expected.txt</a></td><td align=center><a href="file:///tmp/foo-expected-mac-new.txt">foo-expected.txt</a></td><td align=center><a href="file:///tmp/foo-expected-mac-diff.txt">Diff</a></td>'
+ self.assertEqual(links, expected_links)
+ finally:
+ sys.platform = orig_platform
+ os.path.exists = orig_exists
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py
deleted file mode 100755
index f0b68ee..0000000
--- a/WebKitTools/Scripts/webkitpy/layout_tests/run_chromium_webkit_tests.py
+++ /dev/null
@@ -1,1624 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Run layout tests using the test_shell.
-
-This is a port of the existing webkit test script run-webkit-tests.
-
-The TestRunner class runs a series of tests (TestType interface) against a set
-of test files. If a test file fails a TestType, it returns a list TestFailure
-objects to the TestRunner. The TestRunner then aggregates the TestFailures to
-create a final report.
-
-This script reads several files, if they exist in the test_lists subdirectory
-next to this script itself. Each should contain a list of paths to individual
-tests or entire subdirectories of tests, relative to the outermost test
-directory. Entire lines starting with '//' (comments) will be ignored.
-
-For details of the files' contents and purposes, see test_lists/README.
-"""
-
-import errno
-import glob
-import logging
-import math
-import optparse
-import os
-import Queue
-import random
-import re
-import shutil
-import sys
-import time
-import traceback
-
-import simplejson
-
-from layout_package import test_expectations
-from layout_package import json_layout_results_generator
-from layout_package import metered_stream
-from layout_package import test_failures
-from layout_package import test_shell_thread
-from layout_package import test_files
-from test_types import fuzzy_image_diff
-from test_types import image_diff
-from test_types import test_type_base
-from test_types import text_diff
-
-import port
-
-# Indicates that we want detailed progress updates in the output (prints
-# directory-by-directory feedback).
-LOG_DETAILED_PROGRESS = 'detailed-progress'
-
-# Log any unexpected results while running (instead of just at the end).
-LOG_UNEXPECTED = 'unexpected'
-
-# Builder base URL where we have the archived test results.
-BUILDER_BASE_URL = "http://build.chromium.org/buildbot/layout_test_results/"
-
-TestExpectationsFile = test_expectations.TestExpectationsFile
-
-
-class TestInfo:
- """Groups information about a test for easy passing of data."""
-
- def __init__(self, port, filename, timeout):
- """Generates the URI and stores the filename and timeout for this test.
- Args:
- filename: Full path to the test.
- timeout: Timeout for running the test in TestShell.
- """
- self.filename = filename
- self.uri = port.filename_to_uri(filename)
- self.timeout = timeout
- expected_hash_file = port.expected_filename(filename, '.checksum')
- try:
- self.image_hash = open(expected_hash_file, "r").read()
- except IOError, e:
- if errno.ENOENT != e.errno:
- raise
- self.image_hash = None
-
-
-class ResultSummary(object):
- """A class for partitioning the test results we get into buckets.
-
- This class is basically a glorified struct and it's private to this file
- so we don't bother with any information hiding."""
-
- def __init__(self, expectations, test_files):
- self.total = len(test_files)
- self.remaining = self.total
- self.expectations = expectations
- self.expected = 0
- self.unexpected = 0
- self.tests_by_expectation = {}
- self.tests_by_timeline = {}
- self.results = {}
- self.unexpected_results = {}
- self.failures = {}
- self.tests_by_expectation[test_expectations.SKIP] = set()
- for expectation in TestExpectationsFile.EXPECTATIONS.values():
- self.tests_by_expectation[expectation] = set()
- for timeline in TestExpectationsFile.TIMELINES.values():
- self.tests_by_timeline[timeline] = (
- expectations.get_tests_with_timeline(timeline))
-
- def add(self, test, failures, result, expected):
- """Add a result into the appropriate bin.
-
- Args:
- test: test file name
- failures: list of failure objects from test execution
- result: result of test (PASS, IMAGE, etc.).
- expected: whether the result was what we expected it to be.
- """
-
- self.tests_by_expectation[result].add(test)
- self.results[test] = result
- self.remaining -= 1
- if len(failures):
- self.failures[test] = failures
- if expected:
- self.expected += 1
- else:
- self.unexpected_results[test] = result
- self.unexpected += 1
-
-
-class TestRunner:
- """A class for managing running a series of tests on a series of layout
- test files."""
-
- HTTP_SUBDIR = os.sep.join(['', 'http', ''])
- WEBSOCKET_SUBDIR = os.sep.join(['', 'websocket', ''])
-
- # The per-test timeout in milliseconds, if no --time-out-ms option was
- # given to run_webkit_tests. This should correspond to the default timeout
- # in test_shell.exe.
- DEFAULT_TEST_TIMEOUT_MS = 6 * 1000
-
- NUM_RETRY_ON_UNEXPECTED_FAILURE = 1
-
- def __init__(self, port, options, meter):
- """Initialize test runner data structures.
-
- Args:
- port: an object implementing port-specific
- options: a dictionary of command line options
- meter: a MeteredStream object to record updates to.
- """
- self._port = port
- self._options = options
- self._meter = meter
-
- # disable wss server. need to install pyOpenSSL on buildbots.
- # self._websocket_secure_server = websocket_server.PyWebSocket(
- # options.results_directory, use_tls=True, port=9323)
-
- # a list of TestType objects
- self._test_types = []
-
- # a set of test files, and the same tests as a list
- self._test_files = set()
- self._test_files_list = None
- self._result_queue = Queue.Queue()
-
- # These are used for --log detailed-progress to track status by
- # directory.
- self._current_dir = None
- self._current_progress_str = ""
- self._current_test_number = 0
-
- def __del__(self):
- logging.debug("flushing stdout")
- sys.stdout.flush()
- logging.debug("flushing stderr")
- sys.stderr.flush()
- logging.debug("stopping http server")
- self._port.stop_http_server()
- logging.debug("stopping websocket server")
- self._port.stop_websocket_server()
-
- def gather_file_paths(self, paths):
- """Find all the files to test.
-
- Args:
- paths: a list of globs to use instead of the defaults."""
- self._test_files = test_files.gather_test_files(self._port, paths)
-
- def parse_expectations(self, test_platform_name, is_debug_mode):
- """Parse the expectations from the test_list files and return a data
- structure holding them. Throws an error if the test_list files have
- invalid syntax."""
- if self._options.lint_test_files:
- test_files = None
- else:
- test_files = self._test_files
-
- try:
- expectations_str = self._port.test_expectations()
- self._expectations = test_expectations.TestExpectations(
- self._port, test_files, expectations_str, test_platform_name,
- is_debug_mode, self._options.lint_test_files)
- return self._expectations
- except Exception, err:
- if self._options.lint_test_files:
- print str(err)
- else:
- raise err
-
- def prepare_lists_and_print_output(self, write):
- """Create appropriate subsets of test lists and returns a
- ResultSummary object. Also prints expected test counts.
-
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- """
-
- # Remove skipped - both fixable and ignored - files from the
- # top-level list of files to test.
- num_all_test_files = len(self._test_files)
- write("Found: %d tests" % (len(self._test_files)))
- skipped = set()
- if num_all_test_files > 1 and not self._options.force:
- skipped = self._expectations.get_tests_with_result_type(
- test_expectations.SKIP)
- self._test_files -= skipped
-
- # Create a sorted list of test files so the subset chunk,
- # if used, contains alphabetically consecutive tests.
- self._test_files_list = list(self._test_files)
- if self._options.randomize_order:
- random.shuffle(self._test_files_list)
- else:
- self._test_files_list.sort()
-
- # If the user specifies they just want to run a subset of the tests,
- # just grab a subset of the non-skipped tests.
- if self._options.run_chunk or self._options.run_part:
- chunk_value = self._options.run_chunk or self._options.run_part
- test_files = self._test_files_list
- try:
- (chunk_num, chunk_len) = chunk_value.split(":")
- chunk_num = int(chunk_num)
- assert(chunk_num >= 0)
- test_size = int(chunk_len)
- assert(test_size > 0)
- except:
- logging.critical("invalid chunk '%s'" % chunk_value)
- sys.exit(1)
-
- # Get the number of tests
- num_tests = len(test_files)
-
- # Get the start offset of the slice.
- if self._options.run_chunk:
- chunk_len = test_size
- # In this case chunk_num can be really large. We need
- # to make the slave fit in the current number of tests.
- slice_start = (chunk_num * chunk_len) % num_tests
- else:
- # Validate the data.
- assert(test_size <= num_tests)
- assert(chunk_num <= test_size)
-
- # To count the chunk_len, and make sure we don't skip
- # some tests, we round to the next value that fits exactly
- # all the parts.
- rounded_tests = num_tests
- if rounded_tests % test_size != 0:
- rounded_tests = (num_tests + test_size -
- (num_tests % test_size))
-
- chunk_len = rounded_tests / test_size
- slice_start = chunk_len * (chunk_num - 1)
- # It does not mind if we go over test_size.
-
- # Get the end offset of the slice.
- slice_end = min(num_tests, slice_start + chunk_len)
-
- files = test_files[slice_start:slice_end]
-
- tests_run_msg = 'Running: %d tests (chunk slice [%d:%d] of %d)' % (
- (slice_end - slice_start), slice_start, slice_end, num_tests)
- write(tests_run_msg)
-
- # If we reached the end and we don't have enough tests, we run some
- # from the beginning.
- if (self._options.run_chunk and
- (slice_end - slice_start < chunk_len)):
- extra = 1 + chunk_len - (slice_end - slice_start)
- extra_msg = (' last chunk is partial, appending [0:%d]' %
- extra)
- write(extra_msg)
- tests_run_msg += "\n" + extra_msg
- files.extend(test_files[0:extra])
- tests_run_filename = os.path.join(self._options.results_directory,
- "tests_run.txt")
- tests_run_file = open(tests_run_filename, "w")
- tests_run_file.write(tests_run_msg + "\n")
- tests_run_file.close()
-
- len_skip_chunk = int(len(files) * len(skipped) /
- float(len(self._test_files)))
- skip_chunk_list = list(skipped)[0:len_skip_chunk]
- skip_chunk = set(skip_chunk_list)
-
- # Update expectations so that the stats are calculated correctly.
- # We need to pass a list that includes the right # of skipped files
- # to ParseExpectations so that ResultSummary() will get the correct
- # stats. So, we add in the subset of skipped files, and then
- # subtract them back out.
- self._test_files_list = files + skip_chunk_list
- self._test_files = set(self._test_files_list)
-
- self._expectations = self.parse_expectations(
- self._port.test_platform_name(),
- self._options.target == 'Debug')
-
- self._test_files = set(files)
- self._test_files_list = files
- else:
- skip_chunk = skipped
-
- result_summary = ResultSummary(self._expectations,
- self._test_files | skip_chunk)
- self._print_expected_results_of_type(write, result_summary,
- test_expectations.PASS, "passes")
- self._print_expected_results_of_type(write, result_summary,
- test_expectations.FAIL, "failures")
- self._print_expected_results_of_type(write, result_summary,
- test_expectations.FLAKY, "flaky")
- self._print_expected_results_of_type(write, result_summary,
- test_expectations.SKIP, "skipped")
-
-
- if self._options.force:
- write('Running all tests, including skips (--force)')
- else:
- # Note that we don't actually run the skipped tests (they were
- # subtracted out of self._test_files, above), but we stub out the
- # results here so the statistics can remain accurate.
- for test in skip_chunk:
- result_summary.add(test, [], test_expectations.SKIP,
- expected=True)
- write("")
-
- return result_summary
-
- def add_test_type(self, test_type):
- """Add a TestType to the TestRunner."""
- self._test_types.append(test_type)
-
- def _get_dir_for_test_file(self, test_file):
- """Returns the highest-level directory by which to shard the given
- test file."""
- index = test_file.rfind(os.sep + 'LayoutTests' + os.sep)
-
- test_file = test_file[index + len('LayoutTests/'):]
- test_file_parts = test_file.split(os.sep, 1)
- directory = test_file_parts[0]
- test_file = test_file_parts[1]
-
- # The http tests are very stable on mac/linux.
- # TODO(ojan): Make the http server on Windows be apache so we can
- # turn shard the http tests there as well. Switching to apache is
- # what made them stable on linux/mac.
- return_value = directory
- while ((directory != 'http' or sys.platform in ('darwin', 'linux2'))
- and test_file.find(os.sep) >= 0):
- test_file_parts = test_file.split(os.sep, 1)
- directory = test_file_parts[0]
- return_value = os.path.join(return_value, directory)
- test_file = test_file_parts[1]
-
- return return_value
-
- def _get_test_info_for_file(self, test_file):
- """Returns the appropriate TestInfo object for the file. Mostly this
- is used for looking up the timeout value (in ms) to use for the given
- test."""
- if self._expectations.has_modifier(test_file, test_expectations.SLOW):
- return TestInfo(self._port, test_file,
- self._options.slow_time_out_ms)
- return TestInfo(self._port, test_file, self._options.time_out_ms)
-
- def _get_test_file_queue(self, test_files):
- """Create the thread safe queue of lists of (test filenames, test URIs)
- tuples. Each TestShellThread pulls a list from this queue and runs
- those tests in order before grabbing the next available list.
-
- Shard the lists by directory. This helps ensure that tests that depend
- on each other (aka bad tests!) continue to run together as most
- cross-tests dependencies tend to occur within the same directory.
-
- Return:
- The Queue of lists of TestInfo objects.
- """
-
- if (self._options.experimental_fully_parallel or
- self._is_single_threaded()):
- filename_queue = Queue.Queue()
- for test_file in test_files:
- filename_queue.put(
- ('.', [self._get_test_info_for_file(test_file)]))
- return filename_queue
-
- tests_by_dir = {}
- for test_file in test_files:
- directory = self._get_dir_for_test_file(test_file)
- tests_by_dir.setdefault(directory, [])
- tests_by_dir[directory].append(
- self._get_test_info_for_file(test_file))
-
- # Sort by the number of tests in the dir so that the ones with the
- # most tests get run first in order to maximize parallelization.
- # Number of tests is a good enough, but not perfect, approximation
- # of how long that set of tests will take to run. We can't just use
- # a PriorityQueue until we move # to Python 2.6.
- test_lists = []
- http_tests = None
- for directory in tests_by_dir:
- test_list = tests_by_dir[directory]
- # Keep the tests in alphabetical order.
- # TODO: Remove once tests are fixed so they can be run in any
- # order.
- test_list.reverse()
- test_list_tuple = (directory, test_list)
- if directory == 'LayoutTests' + os.sep + 'http':
- http_tests = test_list_tuple
- else:
- test_lists.append(test_list_tuple)
- test_lists.sort(lambda a, b: cmp(len(b[1]), len(a[1])))
-
- # Put the http tests first. There are only a couple hundred of them,
- # but each http test takes a very long time to run, so sorting by the
- # number of tests doesn't accurately capture how long they take to run.
- if http_tests:
- test_lists.insert(0, http_tests)
-
- filename_queue = Queue.Queue()
- for item in test_lists:
- filename_queue.put(item)
- return filename_queue
-
- def _get_test_shell_args(self, index):
- """Returns the tuple of arguments for tests and for test_shell."""
- shell_args = []
- test_args = test_type_base.TestArguments()
- png_path = None
- if not self._options.no_pixel_tests:
- png_path = os.path.join(self._options.results_directory,
- "png_result%s.png" % index)
- shell_args.append("--pixel-tests=" + png_path)
- test_args.png_path = png_path
-
- test_args.new_baseline = self._options.new_baseline
-
- test_args.show_sources = self._options.sources
-
- if self._options.startup_dialog:
- shell_args.append('--testshell-startup-dialog')
-
- if self._options.gp_fault_error_box:
- shell_args.append('--gp-fault-error-box')
-
- return test_args, png_path, shell_args
-
- def _contains_tests(self, subdir):
- for test_file in self._test_files_list:
- if test_file.find(subdir) >= 0:
- return True
- return False
-
- def _instantiate_test_shell_threads(self, test_files, result_summary):
- """Instantitates and starts the TestShellThread(s).
-
- Return:
- The list of threads.
- """
- filename_queue = self._get_test_file_queue(test_files)
-
- # Instantiate TestShellThreads and start them.
- threads = []
- for i in xrange(int(self._options.num_test_shells)):
- # Create separate TestTypes instances for each thread.
- test_types = []
- for t in self._test_types:
- test_types.append(t(self._port, self._options.platform,
- self._options.results_directory))
-
- test_args, png_path, shell_args = self._get_test_shell_args(i)
- thread = test_shell_thread.TestShellThread(self._port,
- filename_queue,
- self._result_queue,
- test_types,
- test_args,
- png_path,
- shell_args,
- self._options)
- if self._is_single_threaded():
- thread.run_in_main_thread(self, result_summary)
- else:
- thread.start()
- threads.append(thread)
-
- return threads
-
- def _is_single_threaded(self):
- """Returns whether we should run all the tests in the main thread."""
- return int(self._options.num_test_shells) == 1
-
- def _run_tests(self, file_list, result_summary):
- """Runs the tests in the file_list.
-
- Return: A tuple (failures, thread_timings, test_timings,
- individual_test_timings)
- failures is a map from test to list of failure types
- thread_timings is a list of dicts with the total runtime
- of each thread with 'name', 'num_tests', 'total_time' properties
- test_timings is a list of timings for each sharded subdirectory
- of the form [time, directory_name, num_tests]
- individual_test_timings is a list of run times for each test
- in the form {filename:filename, test_run_time:test_run_time}
- result_summary: summary object to populate with the results
- """
- threads = self._instantiate_test_shell_threads(file_list,
- result_summary)
-
- # Wait for the threads to finish and collect test failures.
- failures = {}
- test_timings = {}
- individual_test_timings = []
- thread_timings = []
- try:
- for thread in threads:
- while thread.isAlive():
- # Let it timeout occasionally so it can notice a
- # KeyboardInterrupt. Actually, the timeout doesn't
- # really matter: apparently it suffices to not use
- # an indefinite blocking join for it to
- # be interruptible by KeyboardInterrupt.
- thread.join(0.1)
- self.update_summary(result_summary)
- thread_timings.append({'name': thread.getName(),
- 'num_tests': thread.get_num_tests(),
- 'total_time': thread.get_total_time()})
- test_timings.update(thread.get_directory_timing_stats())
- individual_test_timings.extend(
- thread.get_individual_test_stats())
- except KeyboardInterrupt:
- for thread in threads:
- thread.cancel()
- self._port.stop_helper()
- raise
- for thread in threads:
- # Check whether a TestShellThread died before normal completion.
- exception_info = thread.get_exception_info()
- if exception_info is not None:
- # Re-raise the thread's exception here to make it clear that
- # testing was aborted. Otherwise, the tests that did not run
- # would be assumed to have passed.
- raise exception_info[0], exception_info[1], exception_info[2]
-
- # Make sure we pick up any remaining tests.
- self.update_summary(result_summary)
- return (thread_timings, test_timings, individual_test_timings)
-
- def run(self, result_summary):
- """Run all our tests on all our test files.
-
- For each test file, we run each test type. If there are any failures,
- we collect them for reporting.
-
- Args:
- result_summary: a summary object tracking the test results.
-
- Return:
- We return nonzero if there are regressions compared to the last run.
- """
- if not self._test_files:
- return 0
- start_time = time.time()
-
- # Start up any helper needed
- if not self._options.no_pixel_tests:
- self._port.start_helper()
-
- if self._contains_tests(self.HTTP_SUBDIR):
- self._port.start_http_server()
-
- if self._contains_tests(self.WEBSOCKET_SUBDIR):
- self._port.start_websocket_server()
- # self._websocket_secure_server.Start()
-
- thread_timings, test_timings, individual_test_timings = (
- self._run_tests(self._test_files_list, result_summary))
-
- # We exclude the crashes from the list of results to retry, because
- # we want to treat even a potentially flaky crash as an error.
- failures = self._get_failures(result_summary, include_crashes=False)
- retries = 0
- retry_summary = result_summary
- while (retries < self.NUM_RETRY_ON_UNEXPECTED_FAILURE and
- len(failures)):
- logging.debug("Retrying %d unexpected failure(s)" % len(failures))
- retries += 1
- retry_summary = ResultSummary(self._expectations, failures.keys())
- self._run_tests(failures.keys(), retry_summary)
- failures = self._get_failures(retry_summary, include_crashes=True)
-
- self._port.stop_helper()
- end_time = time.time()
-
- write = create_logging_writer(self._options, 'timing')
- self._print_timing_statistics(write, end_time - start_time,
- thread_timings, test_timings,
- individual_test_timings,
- result_summary)
-
- self._meter.update("")
-
- if self._options.verbose:
- # We write this block to stdout for compatibility with the
- # buildbot log parser, which only looks at stdout, not stderr :(
- write = lambda s: sys.stdout.write("%s\n" % s)
- else:
- write = create_logging_writer(self._options, 'actual')
-
- self._print_result_summary(write, result_summary)
-
- sys.stdout.flush()
- sys.stderr.flush()
-
- if (LOG_DETAILED_PROGRESS in self._options.log or
- (LOG_UNEXPECTED in self._options.log and
- result_summary.total != result_summary.expected)):
- print
-
- # This summary data gets written to stdout regardless of log level
- self._print_one_line_summary(result_summary.total,
- result_summary.expected)
-
- unexpected_results = self._summarize_unexpected_results(result_summary,
- retry_summary)
- self._print_unexpected_results(unexpected_results)
-
- # Write the same data to log files.
- self._write_json_files(unexpected_results, result_summary,
- individual_test_timings)
-
- # Write the summary to disk (results.html) and maybe open the
- # test_shell to this file.
- wrote_results = self._write_results_html_file(result_summary)
- if not self._options.noshow_results and wrote_results:
- self._show_results_html_file()
-
- # Ignore flaky failures and unexpected passes so we don't turn the
- # bot red for those.
- return unexpected_results['num_regressions']
-
- def update_summary(self, result_summary):
- """Update the summary while running tests."""
- while True:
- try:
- (test, fail_list) = self._result_queue.get_nowait()
- result = test_failures.determine_result_type(fail_list)
- expected = self._expectations.matches_an_expected_result(test,
- result)
- result_summary.add(test, fail_list, result, expected)
- if (LOG_DETAILED_PROGRESS in self._options.log and
- (self._options.experimental_fully_parallel or
- self._is_single_threaded())):
- self._display_detailed_progress(result_summary)
- else:
- if not expected and LOG_UNEXPECTED in self._options.log:
- self._print_unexpected_test_result(test, result)
- self._display_one_line_progress(result_summary)
- except Queue.Empty:
- return
-
- def _display_one_line_progress(self, result_summary):
- """Displays the progress through the test run."""
- self._meter.update("Testing: %d ran as expected, %d didn't, %d left" %
- (result_summary.expected, result_summary.unexpected,
- result_summary.remaining))
-
- def _display_detailed_progress(self, result_summary):
- """Display detailed progress output where we print the directory name
- and one dot for each completed test. This is triggered by
- "--log detailed-progress"."""
- if self._current_test_number == len(self._test_files_list):
- return
-
- next_test = self._test_files_list[self._current_test_number]
- next_dir = os.path.dirname(
- self._port.relative_test_filename(next_test))
- if self._current_progress_str == "":
- self._current_progress_str = "%s: " % (next_dir)
- self._current_dir = next_dir
-
- while next_test in result_summary.results:
- if next_dir != self._current_dir:
- self._meter.write("%s\n" % (self._current_progress_str))
- self._current_progress_str = "%s: ." % (next_dir)
- self._current_dir = next_dir
- else:
- self._current_progress_str += "."
-
- if (next_test in result_summary.unexpected_results and
- LOG_UNEXPECTED in self._options.log):
- result = result_summary.unexpected_results[next_test]
- self._meter.write("%s\n" % self._current_progress_str)
- self._print_unexpected_test_result(next_test, result)
- self._current_progress_str = "%s: " % self._current_dir
-
- self._current_test_number += 1
- if self._current_test_number == len(self._test_files_list):
- break
-
- next_test = self._test_files_list[self._current_test_number]
- next_dir = os.path.dirname(
- self._port.relative_test_filename(next_test))
-
- if result_summary.remaining:
- remain_str = " (%d)" % (result_summary.remaining)
- self._meter.update("%s%s" %
- (self._current_progress_str, remain_str))
- else:
- self._meter.write("%s\n" % (self._current_progress_str))
-
- def _get_failures(self, result_summary, include_crashes):
- """Filters a dict of results and returns only the failures.
-
- Args:
- result_summary: the results of the test run
- include_crashes: whether crashes are included in the output.
- We use False when finding the list of failures to retry
- to see if the results were flaky. Although the crashes may also be
- flaky, we treat them as if they aren't so that they're not ignored.
- Returns:
- a dict of files -> results
- """
- failed_results = {}
- for test, result in result_summary.unexpected_results.iteritems():
- if (result == test_expectations.PASS or
- result == test_expectations.CRASH and not include_crashes):
- continue
- failed_results[test] = result
-
- return failed_results
-
- def _summarize_unexpected_results(self, result_summary, retry_summary):
- """Summarize any unexpected results as a dict.
-
- TODO(dpranke): split this data structure into a separate class?
-
- Args:
- result_summary: summary object from initial test runs
- retry_summary: summary object from final test run of retried tests
- Returns:
- A dictionary containing a summary of the unexpected results from the
- run, with the following fields:
- 'version': a version indicator (1 in this version)
- 'fixable': # of fixable tests (NOW - PASS)
- 'skipped': # of skipped tests (NOW & SKIPPED)
- 'num_regressions': # of non-flaky failures
- 'num_flaky': # of flaky failures
- 'num_passes': # of unexpected passes
- 'tests': a dict of tests -> {'expected': '...', 'actual': '...'}
- """
- results = {}
- results['version'] = 1
-
- tbe = result_summary.tests_by_expectation
- tbt = result_summary.tests_by_timeline
- results['fixable'] = len(tbt[test_expectations.NOW] -
- tbe[test_expectations.PASS])
- results['skipped'] = len(tbt[test_expectations.NOW] &
- tbe[test_expectations.SKIP])
-
- num_passes = 0
- num_flaky = 0
- num_regressions = 0
- keywords = {}
- for k, v in TestExpectationsFile.EXPECTATIONS.iteritems():
- keywords[v] = k.upper()
-
- tests = {}
- for filename, result in result_summary.unexpected_results.iteritems():
- # Note that if a test crashed in the original run, we ignore
- # whether or not it crashed when we retried it (if we retried it),
- # and always consider the result not flaky.
- test = self._port.relative_test_filename(filename)
- expected = self._expectations.get_expectations_string(filename)
- actual = [keywords[result]]
-
- if result == test_expectations.PASS:
- num_passes += 1
- elif result == test_expectations.CRASH:
- num_regressions += 1
- else:
- if filename not in retry_summary.unexpected_results:
- actual.extend(
- self._expectations.get_expectations_string(
- filename).split(" "))
- num_flaky += 1
- else:
- retry_result = retry_summary.unexpected_results[filename]
- if result != retry_result:
- actual.append(keywords[retry_result])
- num_flaky += 1
- else:
- num_regressions += 1
-
- tests[test] = {}
- tests[test]['expected'] = expected
- tests[test]['actual'] = " ".join(actual)
-
- results['tests'] = tests
- results['num_passes'] = num_passes
- results['num_flaky'] = num_flaky
- results['num_regressions'] = num_regressions
-
- return results
-
- def _write_json_files(self, unexpected_results, result_summary,
- individual_test_timings):
- """Writes the results of the test run as JSON files into the results
- dir.
-
- There are three different files written into the results dir:
- unexpected_results.json: A short list of any unexpected results.
- This is used by the buildbots to display results.
- expectations.json: This is used by the flakiness dashboard.
- results.json: A full list of the results - used by the flakiness
- dashboard and the aggregate results dashboard.
-
- Args:
- unexpected_results: dict of unexpected results
- result_summary: full summary object
- individual_test_timings: list of test times (used by the flakiness
- dashboard).
- """
- logging.debug("Writing JSON files in %s." %
- self._options.results_directory)
- unexpected_file = open(os.path.join(self._options.results_directory,
- "unexpected_results.json"), "w")
- unexpected_file.write(simplejson.dumps(unexpected_results,
- sort_keys=True, indent=2))
- unexpected_file.close()
-
- # Write a json file of the test_expectations.txt file for the layout
- # tests dashboard.
- expectations_file = open(os.path.join(self._options.results_directory,
- "expectations.json"), "w")
- expectations_json = \
- self._expectations.get_expectations_json_for_all_platforms()
- expectations_file.write("ADD_EXPECTATIONS(" + expectations_json + ");")
- expectations_file.close()
-
- json_layout_results_generator.JSONLayoutResultsGenerator(
- self._port, self._options.builder_name, self._options.build_name,
- self._options.build_number, self._options.results_directory,
- BUILDER_BASE_URL, individual_test_timings,
- self._expectations, result_summary, self._test_files_list)
-
- logging.debug("Finished writing JSON files.")
-
- def _print_expected_results_of_type(self, write, result_summary,
- result_type, result_type_str):
- """Print the number of the tests in a given result class.
-
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- result_summary - the object containing all the results to report on
- result_type - the particular result type to report in the summary.
- result_type_str - a string description of the result_type.
- """
- tests = self._expectations.get_tests_with_result_type(result_type)
- now = result_summary.tests_by_timeline[test_expectations.NOW]
- wontfix = result_summary.tests_by_timeline[test_expectations.WONTFIX]
- defer = result_summary.tests_by_timeline[test_expectations.DEFER]
-
- # We use a fancy format string in order to print the data out in a
- # nicely-aligned table.
- fmtstr = ("Expect: %%5d %%-8s (%%%dd now, %%%dd defer, %%%dd wontfix)"
- % (self._num_digits(now), self._num_digits(defer),
- self._num_digits(wontfix)))
- write(fmtstr % (len(tests), result_type_str, len(tests & now),
- len(tests & defer), len(tests & wontfix)))
-
- def _num_digits(self, num):
- """Returns the number of digits needed to represent the length of a
- sequence."""
- ndigits = 1
- if len(num):
- ndigits = int(math.log10(len(num))) + 1
- return ndigits
-
- def _print_timing_statistics(self, write, total_time, thread_timings,
- directory_test_timings, individual_test_timings,
- result_summary):
- """Record timing-specific information for the test run.
-
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- total_time: total elapsed time (in seconds) for the test run
- thread_timings: wall clock time each thread ran for
- directory_test_timings: timing by directory
- individual_test_timings: timing by file
- result_summary: summary object for the test run
- """
- write("Test timing:")
- write(" %6.2f total testing time" % total_time)
- write("")
- write("Thread timing:")
- cuml_time = 0
- for t in thread_timings:
- write(" %10s: %5d tests, %6.2f secs" %
- (t['name'], t['num_tests'], t['total_time']))
- cuml_time += t['total_time']
- write(" %6.2f cumulative, %6.2f optimal" %
- (cuml_time, cuml_time / int(self._options.num_test_shells)))
- write("")
-
- self._print_aggregate_test_statistics(write, individual_test_timings)
- self._print_individual_test_times(write, individual_test_timings,
- result_summary)
- self._print_directory_timings(write, directory_test_timings)
-
- def _print_aggregate_test_statistics(self, write, individual_test_timings):
- """Prints aggregate statistics (e.g. median, mean, etc.) for all tests.
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- individual_test_timings: List of test_shell_thread.TestStats for all
- tests.
- """
- test_types = individual_test_timings[0].time_for_diffs.keys()
- times_for_test_shell = []
- times_for_diff_processing = []
- times_per_test_type = {}
- for test_type in test_types:
- times_per_test_type[test_type] = []
-
- for test_stats in individual_test_timings:
- times_for_test_shell.append(test_stats.test_run_time)
- times_for_diff_processing.append(
- test_stats.total_time_for_all_diffs)
- time_for_diffs = test_stats.time_for_diffs
- for test_type in test_types:
- times_per_test_type[test_type].append(
- time_for_diffs[test_type])
-
- self._print_statistics_for_test_timings(write,
- "PER TEST TIME IN TESTSHELL (seconds):", times_for_test_shell)
- self._print_statistics_for_test_timings(write,
- "PER TEST DIFF PROCESSING TIMES (seconds):",
- times_for_diff_processing)
- for test_type in test_types:
- self._print_statistics_for_test_timings(write,
- "PER TEST TIMES BY TEST TYPE: %s" % test_type,
- times_per_test_type[test_type])
-
- def _print_individual_test_times(self, write, individual_test_timings,
- result_summary):
- """Prints the run times for slow, timeout and crash tests.
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- individual_test_timings: List of test_shell_thread.TestStats for all
- tests.
- result_summary: summary object for test run
- """
- # Reverse-sort by the time spent in test_shell.
- individual_test_timings.sort(lambda a, b:
- cmp(b.test_run_time, a.test_run_time))
-
- num_printed = 0
- slow_tests = []
- timeout_or_crash_tests = []
- unexpected_slow_tests = []
- for test_tuple in individual_test_timings:
- filename = test_tuple.filename
- is_timeout_crash_or_slow = False
- if self._expectations.has_modifier(filename,
- test_expectations.SLOW):
- is_timeout_crash_or_slow = True
- slow_tests.append(test_tuple)
-
- if filename in result_summary.failures:
- result = result_summary.results[filename]
- if (result == test_expectations.TIMEOUT or
- result == test_expectations.CRASH):
- is_timeout_crash_or_slow = True
- timeout_or_crash_tests.append(test_tuple)
-
- if (not is_timeout_crash_or_slow and
- num_printed < self._options.num_slow_tests_to_log):
- num_printed = num_printed + 1
- unexpected_slow_tests.append(test_tuple)
-
- write("")
- self._print_test_list_timing(write, "%s slowest tests that are not "
- "marked as SLOW and did not timeout/crash:" %
- self._options.num_slow_tests_to_log, unexpected_slow_tests)
- write("")
- self._print_test_list_timing(write, "Tests marked as SLOW:",
- slow_tests)
- write("")
- self._print_test_list_timing(write, "Tests that timed out or crashed:",
- timeout_or_crash_tests)
- write("")
-
- def _print_test_list_timing(self, write, title, test_list):
- """Print timing info for each test.
-
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- title: section heading
- test_list: tests that fall in this section
- """
- write(title)
- for test_tuple in test_list:
- filename = test_tuple.filename[len(
- self._port.layout_tests_dir()) + 1:]
- filename = filename.replace('\\', '/')
- test_run_time = round(test_tuple.test_run_time, 1)
- write(" %s took %s seconds" % (filename, test_run_time))
-
- def _print_directory_timings(self, write, directory_test_timings):
- """Print timing info by directory for any directories that
- take > 10 seconds to run.
-
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- directory_test_timing: time info for each directory
- """
- timings = []
- for directory in directory_test_timings:
- num_tests, time_for_directory = directory_test_timings[directory]
- timings.append((round(time_for_directory, 1), directory,
- num_tests))
- timings.sort()
-
- write("Time to process slowest subdirectories:")
- min_seconds_to_print = 10
- for timing in timings:
- if timing[0] > min_seconds_to_print:
- write(" %s took %s seconds to run %s tests." % (timing[1],
- timing[0], timing[2]))
- write("")
-
- def _print_statistics_for_test_timings(self, write, title, timings):
- """Prints the median, mean and standard deviation of the values in
- timings.
-
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- title: Title for these timings.
- timings: A list of floats representing times.
- """
- write(title)
- timings.sort()
-
- num_tests = len(timings)
- percentile90 = timings[int(.9 * num_tests)]
- percentile99 = timings[int(.99 * num_tests)]
-
- if num_tests % 2 == 1:
- median = timings[((num_tests - 1) / 2) - 1]
- else:
- lower = timings[num_tests / 2 - 1]
- upper = timings[num_tests / 2]
- median = (float(lower + upper)) / 2
-
- mean = sum(timings) / num_tests
-
- for time in timings:
- sum_of_deviations = math.pow(time - mean, 2)
-
- std_deviation = math.sqrt(sum_of_deviations / num_tests)
- write(" Median: %6.3f" % median)
- write(" Mean: %6.3f" % mean)
- write(" 90th percentile: %6.3f" % percentile90)
- write(" 99th percentile: %6.3f" % percentile99)
- write(" Standard dev: %6.3f" % std_deviation)
- write("")
-
- def _print_result_summary(self, write, result_summary):
- """Print a short summary about how many tests passed.
-
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- result_summary: information to log
- """
- failed = len(result_summary.failures)
- skipped = len(
- result_summary.tests_by_expectation[test_expectations.SKIP])
- total = result_summary.total
- passed = total - failed - skipped
- pct_passed = 0.0
- if total > 0:
- pct_passed = float(passed) * 100 / total
-
- write("")
- write("=> Results: %d/%d tests passed (%.1f%%)" %
- (passed, total, pct_passed))
- write("")
- self._print_result_summary_entry(write, result_summary,
- test_expectations.NOW, "Tests to be fixed for the current release")
-
- write("")
- self._print_result_summary_entry(write, result_summary,
- test_expectations.DEFER,
- "Tests we'll fix in the future if they fail (DEFER)")
-
- write("")
- self._print_result_summary_entry(write, result_summary,
- test_expectations.WONTFIX,
- "Tests that will only be fixed if they crash (WONTFIX)")
-
- def _print_result_summary_entry(self, write, result_summary, timeline,
- heading):
- """Print a summary block of results for a particular timeline of test.
-
- Args:
- write: A callback to write info to (e.g., a LoggingWriter) or
- sys.stdout.write.
- result_summary: summary to print results for
- timeline: the timeline to print results for (NOT, WONTFIX, etc.)
- heading: a textual description of the timeline
- """
- total = len(result_summary.tests_by_timeline[timeline])
- not_passing = (total -
- len(result_summary.tests_by_expectation[test_expectations.PASS] &
- result_summary.tests_by_timeline[timeline]))
- write("=> %s (%d):" % (heading, not_passing))
-
- for result in TestExpectationsFile.EXPECTATION_ORDER:
- if result == test_expectations.PASS:
- continue
- results = (result_summary.tests_by_expectation[result] &
- result_summary.tests_by_timeline[timeline])
- desc = TestExpectationsFile.EXPECTATION_DESCRIPTIONS[result]
- if not_passing and len(results):
- pct = len(results) * 100.0 / not_passing
- write(" %5d %-24s (%4.1f%%)" % (len(results),
- desc[len(results) != 1], pct))
-
- def _print_one_line_summary(self, total, expected):
- """Print a one-line summary of the test run to stdout.
-
- Args:
- total: total number of tests run
- expected: number of expected results
- """
- unexpected = total - expected
- if unexpected == 0:
- print "All %d tests ran as expected." % expected
- elif expected == 1:
- print "1 test ran as expected, %d didn't:" % unexpected
- else:
- print "%d tests ran as expected, %d didn't:" % (expected,
- unexpected)
-
- def _print_unexpected_results(self, unexpected_results):
- """Prints any unexpected results in a human-readable form to stdout."""
- passes = {}
- flaky = {}
- regressions = {}
-
- if len(unexpected_results['tests']):
- print ""
-
- for test, results in unexpected_results['tests'].iteritems():
- actual = results['actual'].split(" ")
- expected = results['expected'].split(" ")
- if actual == ['PASS']:
- if 'CRASH' in expected:
- _add_to_dict_of_lists(passes,
- 'Expected to crash, but passed',
- test)
- elif 'TIMEOUT' in expected:
- _add_to_dict_of_lists(passes,
- 'Expected to timeout, but passed',
- test)
- else:
- _add_to_dict_of_lists(passes,
- 'Expected to fail, but passed',
- test)
- elif len(actual) > 1:
- # We group flaky tests by the first actual result we got.
- _add_to_dict_of_lists(flaky, actual[0], test)
- else:
- _add_to_dict_of_lists(regressions, results['actual'], test)
-
- if len(passes):
- for key, tests in passes.iteritems():
- print "%s: (%d)" % (key, len(tests))
- tests.sort()
- for test in tests:
- print " %s" % test
- print
-
- if len(flaky):
- descriptions = TestExpectationsFile.EXPECTATION_DESCRIPTIONS
- for key, tests in flaky.iteritems():
- result = TestExpectationsFile.EXPECTATIONS[key.lower()]
- print "Unexpected flakiness: %s (%d)" % (
- descriptions[result][1], len(tests))
- tests.sort()
-
- for test in tests:
- result = unexpected_results['tests'][test]
- actual = result['actual'].split(" ")
- expected = result['expected'].split(" ")
- result = TestExpectationsFile.EXPECTATIONS[key.lower()]
- new_expectations_list = list(set(actual) | set(expected))
- print " %s = %s" % (test, " ".join(new_expectations_list))
- print
-
- if len(regressions):
- descriptions = TestExpectationsFile.EXPECTATION_DESCRIPTIONS
- for key, tests in regressions.iteritems():
- result = TestExpectationsFile.EXPECTATIONS[key.lower()]
- print "Regressions: Unexpected %s : (%d)" % (
- descriptions[result][1], len(tests))
- tests.sort()
- for test in tests:
- print " %s = %s" % (test, key)
- print
-
- if len(unexpected_results['tests']) and self._options.verbose:
- print "-" * 78
-
- def _print_unexpected_test_result(self, test, result):
- """Prints one unexpected test result line."""
- desc = TestExpectationsFile.EXPECTATION_DESCRIPTIONS[result][0]
- self._meter.write(" %s -> unexpected %s\n" %
- (self._port.relative_test_filename(test), desc))
-
- def _write_results_html_file(self, result_summary):
- """Write results.html which is a summary of tests that failed.
-
- Args:
- result_summary: a summary of the results :)
-
- Returns:
- True if any results were written (since expected failures may be
- omitted)
- """
- # test failures
- if self._options.full_results_html:
- test_files = result_summary.failures.keys()
- else:
- unexpected_failures = self._get_failures(result_summary,
- include_crashes=True)
- test_files = unexpected_failures.keys()
- if not len(test_files):
- return False
-
- out_filename = os.path.join(self._options.results_directory,
- "results.html")
- out_file = open(out_filename, 'w')
- # header
- if self._options.full_results_html:
- h2 = "Test Failures"
- else:
- h2 = "Unexpected Test Failures"
- out_file.write("<html><head><title>Layout Test Results (%(time)s)"
- "</title></head><body><h2>%(h2)s (%(time)s)</h2>\n"
- % {'h2': h2, 'time': time.asctime()})
-
- test_files.sort()
- for test_file in test_files:
- test_failures = result_summary.failures.get(test_file, [])
- out_file.write("<p><a href='%s'>%s</a><br />\n"
- % (self._port.filename_to_uri(test_file),
- self._port.relative_test_filename(test_file)))
- for failure in test_failures:
- out_file.write("&nbsp;&nbsp;%s<br/>"
- % failure.result_html_output(
- self._port.relative_test_filename(test_file)))
- out_file.write("</p>\n")
-
- # footer
- out_file.write("</body></html>\n")
- return True
-
- def _show_results_html_file(self):
- """Launches the test shell open to the results.html page."""
- results_filename = os.path.join(self._options.results_directory,
- "results.html")
- self._port.show_results_html_file(results_filename)
-
-
-def _add_to_dict_of_lists(dict, key, value):
- dict.setdefault(key, []).append(value)
-
-
-def read_test_files(files):
- tests = []
- for file in files:
- for line in open(file):
- line = test_expectations.strip_comments(line)
- if line:
- tests.append(line)
- return tests
-
-
-def create_logging_writer(options, log_option):
- """Returns a write() function that will write the string to logging.info()
- if comp was specified in --log or if --verbose is true. Otherwise the
- message is dropped.
-
- Args:
- options: list of command line options from optparse
- log_option: option to match in options.log in order for the messages
- to be logged (e.g., 'actual' or 'expected')
- """
- if options.verbose or log_option in options.log.split(","):
- return logging.info
- return lambda str: 1
-
-
-def main(options, args):
- """Run the tests. Will call sys.exit when complete.
-
- Args:
- options: a dictionary of command line options
- args: a list of sub directories or files to test
- """
-
- if options.sources:
- options.verbose = True
-
- # Set up our logging format.
- meter = metered_stream.MeteredStream(options.verbose, sys.stderr)
- log_fmt = '%(message)s'
- log_datefmt = '%y%m%d %H:%M:%S'
- log_level = logging.INFO
- if options.verbose:
- log_fmt = ('%(asctime)s %(filename)s:%(lineno)-4d %(levelname)s '
- '%(message)s')
- log_level = logging.DEBUG
- logging.basicConfig(level=log_level, format=log_fmt, datefmt=log_datefmt,
- stream=meter)
-
- if not options.target:
- if options.debug:
- options.target = "Debug"
- else:
- options.target = "Release"
-
- port_obj = port.get(options.platform, options)
-
- if not options.use_apache:
- options.use_apache = sys.platform in ('darwin', 'linux2')
-
- if options.results_directory.startswith("/"):
- # Assume it's an absolute path and normalize.
- options.results_directory = port_obj.get_absolute_path(
- options.results_directory)
- else:
- # If it's a relative path, make the output directory relative to
- # Debug or Release.
- options.results_directory = port_obj.results_directory()
-
- if options.clobber_old_results:
- # Just clobber the actual test results directories since the other
- # files in the results directory are explicitly used for cross-run
- # tracking.
- path = os.path.join(options.results_directory, 'LayoutTests')
- if os.path.exists(path):
- shutil.rmtree(path)
-
- if not options.num_test_shells:
- # TODO(ojan): Investigate perf/flakiness impact of using numcores + 1.
- options.num_test_shells = port_obj.num_cores()
-
- write = create_logging_writer(options, 'config')
- write("Running %s test_shells in parallel" % options.num_test_shells)
-
- if not options.time_out_ms:
- if options.target == "Debug":
- options.time_out_ms = str(2 * TestRunner.DEFAULT_TEST_TIMEOUT_MS)
- else:
- options.time_out_ms = str(TestRunner.DEFAULT_TEST_TIMEOUT_MS)
-
- options.slow_time_out_ms = str(5 * int(options.time_out_ms))
- write("Regular timeout: %s, slow test timeout: %s" %
- (options.time_out_ms, options.slow_time_out_ms))
-
- # Include all tests if none are specified.
- new_args = []
- for arg in args:
- if arg and arg != '':
- new_args.append(arg)
-
- paths = new_args
- if not paths:
- paths = []
- if options.test_list:
- paths += read_test_files(options.test_list)
-
- # Create the output directory if it doesn't already exist.
- port_obj.maybe_make_directory(options.results_directory)
- meter.update("Gathering files ...")
-
- test_runner = TestRunner(port_obj, options, meter)
- test_runner.gather_file_paths(paths)
-
- if options.lint_test_files:
- # Creating the expecations for each platform/target pair does all the
- # test list parsing and ensures it's correct syntax (e.g. no dupes).
- for platform in port_obj.test_platform_names():
- test_runner.parse_expectations(platform, is_debug_mode=True)
- test_runner.parse_expectations(platform, is_debug_mode=False)
- print ("If there are no fail messages, errors or exceptions, then the "
- "lint succeeded.")
- sys.exit(0)
-
- # Check that the system dependencies (themes, fonts, ...) are correct.
- if not options.nocheck_sys_deps:
- if not port_obj.check_sys_deps():
- sys.exit(1)
-
- write = create_logging_writer(options, "config")
- write("Using port '%s'" % port_obj.name())
- write("Placing test results in %s" % options.results_directory)
- if options.new_baseline:
- write("Placing new baselines in %s" % port_obj.baseline_path())
- write("Using %s build" % options.target)
- if options.no_pixel_tests:
- write("Not running pixel tests")
- write("")
-
- meter.update("Parsing expectations ...")
- test_runner.parse_expectations(port_obj.test_platform_name(),
- options.target == 'Debug')
-
- meter.update("Preparing tests ...")
- write = create_logging_writer(options, "expected")
- result_summary = test_runner.prepare_lists_and_print_output(write)
-
- port_obj.setup_test_run()
-
- test_runner.add_test_type(text_diff.TestTextDiff)
- if not options.no_pixel_tests:
- test_runner.add_test_type(image_diff.ImageDiff)
- if options.fuzzy_pixel_tests:
- test_runner.add_test_type(fuzzy_image_diff.FuzzyImageDiff)
-
- meter.update("Starting ...")
- has_new_failures = test_runner.run(result_summary)
-
- logging.debug("Exit status: %d" % has_new_failures)
- sys.exit(has_new_failures)
-
-
-def parse_args(args=None):
- """Provides a default set of command line args.
-
- Returns a tuple of options, args from optparse"""
- option_parser = optparse.OptionParser()
- option_parser.add_option("", "--no-pixel-tests", action="store_true",
- default=False,
- help="disable pixel-to-pixel PNG comparisons")
- option_parser.add_option("", "--fuzzy-pixel-tests", action="store_true",
- default=False,
- help="Also use fuzzy matching to compare pixel "
- "test outputs.")
- option_parser.add_option("", "--results-directory",
- default="layout-test-results",
- help="Output results directory source dir,"
- " relative to Debug or Release")
- option_parser.add_option("", "--new-baseline", action="store_true",
- default=False,
- help="save all generated results as new baselines"
- " into the platform directory, overwriting "
- "whatever's already there.")
- option_parser.add_option("", "--noshow-results", action="store_true",
- default=False, help="don't launch the test_shell"
- " with results after the tests are done")
- option_parser.add_option("", "--full-results-html", action="store_true",
- default=False, help="show all failures in "
- "results.html, rather than only regressions")
- option_parser.add_option("", "--clobber-old-results", action="store_true",
- default=False, help="Clobbers test results from "
- "previous runs.")
- option_parser.add_option("", "--lint-test-files", action="store_true",
- default=False, help="Makes sure the test files "
- "parse for all configurations. Does not run any "
- "tests.")
- option_parser.add_option("", "--force", action="store_true",
- default=False,
- help="Run all tests, even those marked SKIP "
- "in the test list")
- option_parser.add_option("", "--num-test-shells",
- help="Number of testshells to run in parallel.")
- option_parser.add_option("", "--use-apache", action="store_true",
- default=False,
- help="Whether to use apache instead of lighttpd.")
- option_parser.add_option("", "--time-out-ms", default=None,
- help="Set the timeout for each test")
- option_parser.add_option("", "--run-singly", action="store_true",
- default=False,
- help="run a separate test_shell for each test")
- option_parser.add_option("", "--debug", action="store_true", default=False,
- help="use the debug binary instead of the release"
- " binary")
- option_parser.add_option("", "--num-slow-tests-to-log", default=50,
- help="Number of slow tests whose timings "
- "to print.")
- option_parser.add_option("", "--platform",
- help="Override the platform for expected results")
- option_parser.add_option("", "--target", default="",
- help="Set the build target configuration "
- "(overrides --debug)")
- option_parser.add_option("", "--log", action="store",
- default="detailed-progress,unexpected",
- help="log various types of data. The param should"
- " be a comma-separated list of values from: "
- "actual,config," + LOG_DETAILED_PROGRESS +
- ",expected,timing," + LOG_UNEXPECTED + " "
- "(defaults to " +
- "--log detailed-progress,unexpected)")
- option_parser.add_option("-v", "--verbose", action="store_true",
- default=False, help="include debug-level logging")
- option_parser.add_option("", "--sources", action="store_true",
- help="show expected result file path for each "
- "test (implies --verbose)")
- option_parser.add_option("", "--startup-dialog", action="store_true",
- default=False,
- help="create a dialog on test_shell.exe startup")
- option_parser.add_option("", "--gp-fault-error-box", action="store_true",
- default=False,
- help="enable Windows GP fault error box")
- option_parser.add_option("", "--wrapper",
- help="wrapper command to insert before "
- "invocations of test_shell; option is split "
- "on whitespace before running. (Example: "
- "--wrapper='valgrind --smc-check=all')")
- option_parser.add_option("", "--test-list", action="append",
- help="read list of tests to run from file",
- metavar="FILE")
- option_parser.add_option("", "--nocheck-sys-deps", action="store_true",
- default=False,
- help="Don't check the system dependencies "
- "(themes)")
- option_parser.add_option("", "--randomize-order", action="store_true",
- default=False,
- help=("Run tests in random order (useful for "
- "tracking down corruption)"))
- option_parser.add_option("", "--run-chunk",
- default=None,
- help=("Run a specified chunk (n:l), the "
- "nth of len l, of the layout tests"))
- option_parser.add_option("", "--run-part",
- default=None,
- help=("Run a specified part (n:m), the nth of m"
- " parts, of the layout tests"))
- option_parser.add_option("", "--batch-size",
- default=None,
- help=("Run a the tests in batches (n), after "
- "every n tests, the test shell is "
- "relaunched."))
- option_parser.add_option("", "--builder-name",
- default="DUMMY_BUILDER_NAME",
- help=("The name of the builder shown on the "
- "waterfall running this script e.g. "
- "WebKit."))
- option_parser.add_option("", "--build-name",
- default="DUMMY_BUILD_NAME",
- help=("The name of the builder used in its path, "
- "e.g. webkit-rel."))
- option_parser.add_option("", "--build-number",
- default="DUMMY_BUILD_NUMBER",
- help=("The build number of the builder running"
- "this script."))
- option_parser.add_option("", "--experimental-fully-parallel",
- action="store_true", default=False,
- help="run all tests in parallel")
- return option_parser.parse_args(args)
-
-if '__main__' == __name__:
- options, args = parse_args()
- main(options, args)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
new file mode 100755
index 0000000..119de8c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -0,0 +1,1691 @@
+#!/usr/bin/env python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Run layout tests.
+
+This is a port of the existing webkit test script run-webkit-tests.
+
+The TestRunner class runs a series of tests (TestType interface) against a set
+of test files. If a test file fails a TestType, it returns a list TestFailure
+objects to the TestRunner. The TestRunner then aggregates the TestFailures to
+create a final report.
+
+This script reads several files, if they exist in the test_lists subdirectory
+next to this script itself. Each should contain a list of paths to individual
+tests or entire subdirectories of tests, relative to the outermost test
+directory. Entire lines starting with '//' (comments) will be ignored.
+
+For details of the files' contents and purposes, see test_lists/README.
+"""
+
+from __future__ import with_statement
+
+import codecs
+import errno
+import glob
+import logging
+import math
+import optparse
+import os
+import platform
+import Queue
+import random
+import re
+import shutil
+import signal
+import sys
+import time
+import traceback
+
+from layout_package import dump_render_tree_thread
+from layout_package import json_layout_results_generator
+from layout_package import printing
+from layout_package import test_expectations
+from layout_package import test_failures
+from layout_package import test_results
+from layout_package import test_results_uploader
+from test_types import image_diff
+from test_types import text_diff
+from test_types import test_type_base
+
+from webkitpy.common.system import user
+from webkitpy.thirdparty import simplejson
+
+import port
+
+_log = logging.getLogger("webkitpy.layout_tests.run_webkit_tests")
+
+# Builder base URL where we have the archived test results.
+BUILDER_BASE_URL = "http://build.chromium.org/buildbot/layout_test_results/"
+
+LAYOUT_TESTS_DIRECTORY = "LayoutTests" + os.sep
+
+TestExpectationsFile = test_expectations.TestExpectationsFile
+
+
+class TestInput:
+ """Groups information about a test for easy passing of data."""
+
+ def __init__(self, filename, timeout):
+ """Holds the input parameters for a test.
+ Args:
+ filename: Full path to the test.
+ timeout: Timeout in msecs the driver should use while running the test
+ """
+ # FIXME: filename should really be test_name as a relative path.
+ self.filename = filename
+ self.timeout = timeout
+
+
+class ResultSummary(object):
+ """A class for partitioning the test results we get into buckets.
+
+ This class is basically a glorified struct and it's private to this file
+ so we don't bother with any information hiding."""
+
+ def __init__(self, expectations, test_files):
+ self.total = len(test_files)
+ self.remaining = self.total
+ self.expectations = expectations
+ self.expected = 0
+ self.unexpected = 0
+ self.tests_by_expectation = {}
+ self.tests_by_timeline = {}
+ self.results = {}
+ self.unexpected_results = {}
+ self.failures = {}
+ self.tests_by_expectation[test_expectations.SKIP] = set()
+ for expectation in TestExpectationsFile.EXPECTATIONS.values():
+ self.tests_by_expectation[expectation] = set()
+ for timeline in TestExpectationsFile.TIMELINES.values():
+ self.tests_by_timeline[timeline] = (
+ expectations.get_tests_with_timeline(timeline))
+
+ def add(self, result, expected):
+ """Add a TestResult into the appropriate bin.
+
+ Args:
+ result: TestResult from dump_render_tree_thread.
+ expected: whether the result was what we expected it to be.
+ """
+
+ self.tests_by_expectation[result.type].add(result.filename)
+ self.results[result.filename] = result
+ self.remaining -= 1
+ if len(result.failures):
+ self.failures[result.filename] = result.failures
+ if expected:
+ self.expected += 1
+ else:
+ self.unexpected_results[result.filename] = result.type
+ self.unexpected += 1
+
+
+def summarize_unexpected_results(port_obj, expectations, result_summary,
+ retry_summary):
+ """Summarize any unexpected results as a dict.
+
+ FIXME: split this data structure into a separate class?
+
+ Args:
+ port_obj: interface to port-specific hooks
+ expectations: test_expectations.TestExpectations object
+ result_summary: summary object from initial test runs
+ retry_summary: summary object from final test run of retried tests
+ Returns:
+ A dictionary containing a summary of the unexpected results from the
+ run, with the following fields:
+ 'version': a version indicator (1 in this version)
+ 'fixable': # of fixable tests (NOW - PASS)
+ 'skipped': # of skipped tests (NOW & SKIPPED)
+ 'num_regressions': # of non-flaky failures
+ 'num_flaky': # of flaky failures
+ 'num_passes': # of unexpected passes
+ 'tests': a dict of tests -> {'expected': '...', 'actual': '...'}
+ """
+ results = {}
+ results['version'] = 1
+
+ tbe = result_summary.tests_by_expectation
+ tbt = result_summary.tests_by_timeline
+ results['fixable'] = len(tbt[test_expectations.NOW] -
+ tbe[test_expectations.PASS])
+ results['skipped'] = len(tbt[test_expectations.NOW] &
+ tbe[test_expectations.SKIP])
+
+ num_passes = 0
+ num_flaky = 0
+ num_regressions = 0
+ keywords = {}
+ for k, v in TestExpectationsFile.EXPECTATIONS.iteritems():
+ keywords[v] = k.upper()
+
+ tests = {}
+ for filename, result in result_summary.unexpected_results.iteritems():
+ # Note that if a test crashed in the original run, we ignore
+ # whether or not it crashed when we retried it (if we retried it),
+ # and always consider the result not flaky.
+ test = port_obj.relative_test_filename(filename)
+ expected = expectations.get_expectations_string(filename)
+ actual = [keywords[result]]
+
+ if result == test_expectations.PASS:
+ num_passes += 1
+ elif result == test_expectations.CRASH:
+ num_regressions += 1
+ else:
+ if filename not in retry_summary.unexpected_results:
+ actual.extend(expectations.get_expectations_string(
+ filename).split(" "))
+ num_flaky += 1
+ else:
+ retry_result = retry_summary.unexpected_results[filename]
+ if result != retry_result:
+ actual.append(keywords[retry_result])
+ num_flaky += 1
+ else:
+ num_regressions += 1
+
+ tests[test] = {}
+ tests[test]['expected'] = expected
+ tests[test]['actual'] = " ".join(actual)
+
+ results['tests'] = tests
+ results['num_passes'] = num_passes
+ results['num_flaky'] = num_flaky
+ results['num_regressions'] = num_regressions
+
+ return results
+
+
+class TestRunner:
+ """A class for managing running a series of tests on a series of layout
+ test files."""
+
+ HTTP_SUBDIR = os.sep.join(['', 'http', ''])
+ WEBSOCKET_SUBDIR = os.sep.join(['', 'websocket', ''])
+
+ # The per-test timeout in milliseconds, if no --time-out-ms option was
+ # given to run_webkit_tests. This should correspond to the default timeout
+ # in DumpRenderTree.
+ DEFAULT_TEST_TIMEOUT_MS = 6 * 1000
+
+ def __init__(self, port, options, printer):
+ """Initialize test runner data structures.
+
+ Args:
+ port: an object implementing port-specific
+ options: a dictionary of command line options
+ printer: a Printer object to record updates to.
+ """
+ self._port = port
+ self._options = options
+ self._printer = printer
+
+ # disable wss server. need to install pyOpenSSL on buildbots.
+ # self._websocket_secure_server = websocket_server.PyWebSocket(
+ # options.results_directory, use_tls=True, port=9323)
+
+ # a list of TestType objects
+ self._test_types = [text_diff.TestTextDiff]
+ if options.pixel_tests:
+ self._test_types.append(image_diff.ImageDiff)
+
+ # a set of test files, and the same tests as a list
+ self._test_files = set()
+ self._test_files_list = None
+ self._result_queue = Queue.Queue()
+ self._retrying = False
+
+ def collect_tests(self, args, last_unexpected_results):
+ """Find all the files to test.
+
+ Args:
+ args: list of test arguments from the command line
+ last_unexpected_results: list of unexpected results to retest, if any
+
+ """
+ paths = [self._strip_test_dir_prefix(arg) for arg in args if arg and arg != '']
+ paths += last_unexpected_results
+ if self._options.test_list:
+ paths += read_test_files(self._options.test_list)
+ self._test_files = self._port.tests(paths)
+
+ def _strip_test_dir_prefix(self, path):
+ if path.startswith(LAYOUT_TESTS_DIRECTORY):
+ return path[len(LAYOUT_TESTS_DIRECTORY):]
+ return path
+
+ def lint(self):
+ # Creating the expecations for each platform/configuration pair does
+ # all the test list parsing and ensures it's correct syntax (e.g. no
+ # dupes).
+ for platform_name in self._port.test_platform_names():
+ self.parse_expectations(platform_name, is_debug_mode=True)
+ self.parse_expectations(platform_name, is_debug_mode=False)
+ self._printer.write("")
+ _log.info("If there are no fail messages, errors or exceptions, "
+ "then the lint succeeded.")
+ return 0
+
+ def parse_expectations(self, test_platform_name, is_debug_mode):
+ """Parse the expectations from the test_list files and return a data
+ structure holding them. Throws an error if the test_list files have
+ invalid syntax."""
+ if self._options.lint_test_files:
+ test_files = None
+ else:
+ test_files = self._test_files
+
+ try:
+ expectations_str = self._port.test_expectations()
+ overrides_str = self._port.test_expectations_overrides()
+ self._expectations = test_expectations.TestExpectations(
+ self._port, test_files, expectations_str, test_platform_name,
+ is_debug_mode, self._options.lint_test_files,
+ overrides=overrides_str)
+ return self._expectations
+ except SyntaxError, err:
+ if self._options.lint_test_files:
+ print str(err)
+ else:
+ raise err
+
+ def prepare_lists_and_print_output(self):
+ """Create appropriate subsets of test lists and returns a
+ ResultSummary object. Also prints expected test counts.
+ """
+
+ # Remove skipped - both fixable and ignored - files from the
+ # top-level list of files to test.
+ num_all_test_files = len(self._test_files)
+ self._printer.print_expected("Found: %d tests" %
+ (len(self._test_files)))
+ if not num_all_test_files:
+ _log.critical('No tests to run.')
+ return None
+
+ skipped = set()
+ if num_all_test_files > 1 and not self._options.force:
+ skipped = self._expectations.get_tests_with_result_type(
+ test_expectations.SKIP)
+ self._test_files -= skipped
+
+ # Create a sorted list of test files so the subset chunk,
+ # if used, contains alphabetically consecutive tests.
+ self._test_files_list = list(self._test_files)
+ if self._options.randomize_order:
+ random.shuffle(self._test_files_list)
+ else:
+ self._test_files_list.sort()
+
+ # If the user specifies they just want to run a subset of the tests,
+ # just grab a subset of the non-skipped tests.
+ if self._options.run_chunk or self._options.run_part:
+ chunk_value = self._options.run_chunk or self._options.run_part
+ test_files = self._test_files_list
+ try:
+ (chunk_num, chunk_len) = chunk_value.split(":")
+ chunk_num = int(chunk_num)
+ assert(chunk_num >= 0)
+ test_size = int(chunk_len)
+ assert(test_size > 0)
+ except:
+ _log.critical("invalid chunk '%s'" % chunk_value)
+ return None
+
+ # Get the number of tests
+ num_tests = len(test_files)
+
+ # Get the start offset of the slice.
+ if self._options.run_chunk:
+ chunk_len = test_size
+ # In this case chunk_num can be really large. We need
+ # to make the slave fit in the current number of tests.
+ slice_start = (chunk_num * chunk_len) % num_tests
+ else:
+ # Validate the data.
+ assert(test_size <= num_tests)
+ assert(chunk_num <= test_size)
+
+ # To count the chunk_len, and make sure we don't skip
+ # some tests, we round to the next value that fits exactly
+ # all the parts.
+ rounded_tests = num_tests
+ if rounded_tests % test_size != 0:
+ rounded_tests = (num_tests + test_size -
+ (num_tests % test_size))
+
+ chunk_len = rounded_tests / test_size
+ slice_start = chunk_len * (chunk_num - 1)
+ # It does not mind if we go over test_size.
+
+ # Get the end offset of the slice.
+ slice_end = min(num_tests, slice_start + chunk_len)
+
+ files = test_files[slice_start:slice_end]
+
+ tests_run_msg = 'Running: %d tests (chunk slice [%d:%d] of %d)' % (
+ (slice_end - slice_start), slice_start, slice_end, num_tests)
+ self._printer.print_expected(tests_run_msg)
+
+ # If we reached the end and we don't have enough tests, we run some
+ # from the beginning.
+ if slice_end - slice_start < chunk_len:
+ extra = chunk_len - (slice_end - slice_start)
+ extra_msg = (' last chunk is partial, appending [0:%d]' %
+ extra)
+ self._printer.print_expected(extra_msg)
+ tests_run_msg += "\n" + extra_msg
+ files.extend(test_files[0:extra])
+ tests_run_filename = os.path.join(self._options.results_directory,
+ "tests_run.txt")
+ with codecs.open(tests_run_filename, "w", "utf-8") as file:
+ file.write(tests_run_msg + "\n")
+
+ len_skip_chunk = int(len(files) * len(skipped) /
+ float(len(self._test_files)))
+ skip_chunk_list = list(skipped)[0:len_skip_chunk]
+ skip_chunk = set(skip_chunk_list)
+
+ # Update expectations so that the stats are calculated correctly.
+ # We need to pass a list that includes the right # of skipped files
+ # to ParseExpectations so that ResultSummary() will get the correct
+ # stats. So, we add in the subset of skipped files, and then
+ # subtract them back out.
+ self._test_files_list = files + skip_chunk_list
+ self._test_files = set(self._test_files_list)
+
+ self._expectations = self.parse_expectations(
+ self._port.test_platform_name(),
+ self._options.configuration == 'Debug')
+
+ self._test_files = set(files)
+ self._test_files_list = files
+ else:
+ skip_chunk = skipped
+
+ result_summary = ResultSummary(self._expectations,
+ self._test_files | skip_chunk)
+ self._print_expected_results_of_type(result_summary,
+ test_expectations.PASS, "passes")
+ self._print_expected_results_of_type(result_summary,
+ test_expectations.FAIL, "failures")
+ self._print_expected_results_of_type(result_summary,
+ test_expectations.FLAKY, "flaky")
+ self._print_expected_results_of_type(result_summary,
+ test_expectations.SKIP, "skipped")
+
+ if self._options.force:
+ self._printer.print_expected('Running all tests, including '
+ 'skips (--force)')
+ else:
+ # Note that we don't actually run the skipped tests (they were
+ # subtracted out of self._test_files, above), but we stub out the
+ # results here so the statistics can remain accurate.
+ for test in skip_chunk:
+ result = test_results.TestResult(test,
+ failures=[], test_run_time=0, total_time_for_all_diffs=0,
+ time_for_diffs=0)
+ result.type = test_expectations.SKIP
+ result_summary.add(result, expected=True)
+ self._printer.print_expected('')
+
+ return result_summary
+
+ def _get_dir_for_test_file(self, test_file):
+ """Returns the highest-level directory by which to shard the given
+ test file."""
+ index = test_file.rfind(os.sep + LAYOUT_TESTS_DIRECTORY)
+
+ test_file = test_file[index + len(LAYOUT_TESTS_DIRECTORY):]
+ test_file_parts = test_file.split(os.sep, 1)
+ directory = test_file_parts[0]
+ test_file = test_file_parts[1]
+
+ # The http tests are very stable on mac/linux.
+ # TODO(ojan): Make the http server on Windows be apache so we can
+ # turn shard the http tests there as well. Switching to apache is
+ # what made them stable on linux/mac.
+ return_value = directory
+ while ((directory != 'http' or sys.platform in ('darwin', 'linux2'))
+ and test_file.find(os.sep) >= 0):
+ test_file_parts = test_file.split(os.sep, 1)
+ directory = test_file_parts[0]
+ return_value = os.path.join(return_value, directory)
+ test_file = test_file_parts[1]
+
+ return return_value
+
+ def _get_test_input_for_file(self, test_file):
+ """Returns the appropriate TestInput object for the file. Mostly this
+ is used for looking up the timeout value (in ms) to use for the given
+ test."""
+ if self._expectations.has_modifier(test_file, test_expectations.SLOW):
+ return TestInput(test_file, self._options.slow_time_out_ms)
+ return TestInput(test_file, self._options.time_out_ms)
+
+ def _test_requires_lock(self, test_file):
+ """Return True if the test needs to be locked when
+ running multiple copies of NRWTs."""
+ split_path = test_file.split(os.sep)
+ return 'http' in split_path or 'websocket' in split_path
+
+ def _get_test_file_queue(self, test_files):
+ """Create the thread safe queue of lists of (test filenames, test URIs)
+ tuples. Each TestShellThread pulls a list from this queue and runs
+ those tests in order before grabbing the next available list.
+
+ Shard the lists by directory. This helps ensure that tests that depend
+ on each other (aka bad tests!) continue to run together as most
+ cross-tests dependencies tend to occur within the same directory.
+
+ Return:
+ The Queue of lists of TestInput objects.
+ """
+
+ test_lists = []
+ tests_to_http_lock = []
+ if (self._options.experimental_fully_parallel or
+ self._is_single_threaded()):
+ for test_file in test_files:
+ test_input = self._get_test_input_for_file(test_file)
+ if self._test_requires_lock(test_file):
+ tests_to_http_lock.append(test_input)
+ else:
+ test_lists.append((".", [test_input]))
+ else:
+ tests_by_dir = {}
+ for test_file in test_files:
+ directory = self._get_dir_for_test_file(test_file)
+ test_input = self._get_test_input_for_file(test_file)
+ if self._test_requires_lock(test_file):
+ tests_to_http_lock.append(test_input)
+ else:
+ tests_by_dir.setdefault(directory, [])
+ tests_by_dir[directory].append(test_input)
+ # Sort by the number of tests in the dir so that the ones with the
+ # most tests get run first in order to maximize parallelization.
+ # Number of tests is a good enough, but not perfect, approximation
+ # of how long that set of tests will take to run. We can't just use
+ # a PriorityQueue until we move to Python 2.6.
+ for directory in tests_by_dir:
+ test_list = tests_by_dir[directory]
+ # Keep the tests in alphabetical order.
+ # FIXME: Remove once tests are fixed so they can be run in any
+ # order.
+ test_list.reverse()
+ test_list_tuple = (directory, test_list)
+ test_lists.append(test_list_tuple)
+ test_lists.sort(lambda a, b: cmp(len(b[1]), len(a[1])))
+
+ # Put the http tests first. There are only a couple hundred of them,
+ # but each http test takes a very long time to run, so sorting by the
+ # number of tests doesn't accurately capture how long they take to run.
+ if tests_to_http_lock:
+ tests_to_http_lock.reverse()
+ test_lists.insert(0, ("tests_to_http_lock", tests_to_http_lock))
+
+ filename_queue = Queue.Queue()
+ for item in test_lists:
+ filename_queue.put(item)
+ return filename_queue
+
+ def _get_test_args(self, index):
+ """Returns the tuple of arguments for tests and for DumpRenderTree."""
+ test_args = test_type_base.TestArguments()
+ test_args.png_path = None
+ if self._options.pixel_tests:
+ png_path = os.path.join(self._options.results_directory,
+ "png_result%s.png" % index)
+ test_args.png_path = png_path
+ test_args.new_baseline = self._options.new_baseline
+ test_args.reset_results = self._options.reset_results
+
+ return test_args
+
+ def _contains_tests(self, subdir):
+ for test_file in self._test_files:
+ if test_file.find(subdir) >= 0:
+ return True
+ return False
+
+ def _instantiate_dump_render_tree_threads(self, test_files,
+ result_summary):
+ """Instantitates and starts the TestShellThread(s).
+
+ Return:
+ The list of threads.
+ """
+ filename_queue = self._get_test_file_queue(test_files)
+
+ # Instantiate TestShellThreads and start them.
+ threads = []
+ for i in xrange(int(self._options.child_processes)):
+ # Create separate TestTypes instances for each thread.
+ test_types = []
+ for test_type in self._test_types:
+ test_types.append(test_type(self._port,
+ self._options.results_directory))
+
+ test_args = self._get_test_args(i)
+ thread = dump_render_tree_thread.TestShellThread(self._port,
+ self._options, filename_queue, self._result_queue,
+ test_types, test_args)
+ if self._is_single_threaded():
+ thread.run_in_main_thread(self, result_summary)
+ else:
+ thread.start()
+ threads.append(thread)
+
+ return threads
+
+ def _is_single_threaded(self):
+ """Returns whether we should run all the tests in the main thread."""
+ return int(self._options.child_processes) == 1
+
+ def _run_tests(self, file_list, result_summary):
+ """Runs the tests in the file_list.
+
+ Return: A tuple (keyboard_interrupted, thread_timings, test_timings,
+ individual_test_timings)
+ keyboard_interrupted is whether someone typed Ctrl^C
+ thread_timings is a list of dicts with the total runtime
+ of each thread with 'name', 'num_tests', 'total_time' properties
+ test_timings is a list of timings for each sharded subdirectory
+ of the form [time, directory_name, num_tests]
+ individual_test_timings is a list of run times for each test
+ in the form {filename:filename, test_run_time:test_run_time}
+ result_summary: summary object to populate with the results
+ """
+ # FIXME: We should use webkitpy.tool.grammar.pluralize here.
+ plural = ""
+ if not self._is_single_threaded():
+ plural = "s"
+ self._printer.print_update('Starting %s%s ...' %
+ (self._port.driver_name(), plural))
+ threads = self._instantiate_dump_render_tree_threads(file_list,
+ result_summary)
+ self._printer.print_update("Starting testing ...")
+
+ keyboard_interrupted = self._wait_for_threads_to_finish(threads,
+ result_summary)
+ (thread_timings, test_timings, individual_test_timings) = \
+ self._collect_timing_info(threads)
+
+ return (keyboard_interrupted, thread_timings, test_timings,
+ individual_test_timings)
+
+ def _wait_for_threads_to_finish(self, threads, result_summary):
+ keyboard_interrupted = False
+ try:
+ # Loop through all the threads waiting for them to finish.
+ some_thread_is_alive = True
+ while some_thread_is_alive:
+ some_thread_is_alive = False
+ t = time.time()
+ for thread in threads:
+ exception_info = thread.exception_info()
+ if exception_info is not None:
+ # Re-raise the thread's exception here to make it
+ # clear that testing was aborted. Otherwise,
+ # the tests that did not run would be assumed
+ # to have passed.
+ raise exception_info[0], exception_info[1], exception_info[2]
+
+ if thread.isAlive():
+ some_thread_is_alive = True
+ next_timeout = thread.next_timeout()
+ if (next_timeout and t > next_timeout):
+ _log_wedged_thread(thread)
+ thread.clear_next_timeout()
+
+ self.update_summary(result_summary)
+
+ if some_thread_is_alive:
+ time.sleep(0.01)
+
+ except KeyboardInterrupt:
+ keyboard_interrupted = True
+ for thread in threads:
+ thread.cancel()
+
+ return keyboard_interrupted
+
+ def _collect_timing_info(self, threads):
+ test_timings = {}
+ individual_test_timings = []
+ thread_timings = []
+
+ for thread in threads:
+ thread_timings.append({'name': thread.getName(),
+ 'num_tests': thread.get_num_tests(),
+ 'total_time': thread.get_total_time()})
+ test_timings.update(thread.get_test_group_timing_stats())
+ individual_test_timings.extend(thread.get_test_results())
+
+ return (thread_timings, test_timings, individual_test_timings)
+
+ def needs_http(self):
+ """Returns whether the test runner needs an HTTP server."""
+ return self._contains_tests(self.HTTP_SUBDIR)
+
+ def needs_websocket(self):
+ """Returns whether the test runner needs a WEBSOCKET server."""
+ return self._contains_tests(self.WEBSOCKET_SUBDIR)
+
+ def set_up_run(self):
+ """Configures the system to be ready to run tests.
+
+ Returns a ResultSummary object if we should continue to run tests,
+ or None if we should abort.
+
+ """
+ # This must be started before we check the system dependencies,
+ # since the helper may do things to make the setup correct.
+ self._printer.print_update("Starting helper ...")
+ self._port.start_helper()
+
+ # Check that the system dependencies (themes, fonts, ...) are correct.
+ if not self._options.nocheck_sys_deps:
+ self._printer.print_update("Checking system dependencies ...")
+ if not self._port.check_sys_deps(self.needs_http()):
+ self._port.stop_helper()
+ return None
+
+ if self._options.clobber_old_results:
+ self._clobber_old_results()
+
+ # Create the output directory if it doesn't already exist.
+ self._port.maybe_make_directory(self._options.results_directory)
+
+ self._port.setup_test_run()
+
+ self._printer.print_update("Preparing tests ...")
+ result_summary = self.prepare_lists_and_print_output()
+ if not result_summary:
+ return None
+
+ return result_summary
+
+ def run(self, result_summary):
+ """Run all our tests on all our test files.
+
+ For each test file, we run each test type. If there are any failures,
+ we collect them for reporting.
+
+ Args:
+ result_summary: a summary object tracking the test results.
+
+ Return:
+ The number of unexpected results (0 == success)
+ """
+ # gather_test_files() must have been called first to initialize us.
+ # If we didn't find any files to test, we've errored out already in
+ # prepare_lists_and_print_output().
+ assert(len(self._test_files))
+
+ start_time = time.time()
+
+ keyboard_interrupted, thread_timings, test_timings, \
+ individual_test_timings = (
+ self._run_tests(self._test_files_list, result_summary))
+
+ # We exclude the crashes from the list of results to retry, because
+ # we want to treat even a potentially flaky crash as an error.
+ failures = self._get_failures(result_summary, include_crashes=False)
+ retry_summary = result_summary
+ while (len(failures) and self._options.retry_failures and
+ not self._retrying and not keyboard_interrupted):
+ _log.info('')
+ _log.info("Retrying %d unexpected failure(s) ..." % len(failures))
+ _log.info('')
+ self._retrying = True
+ retry_summary = ResultSummary(self._expectations, failures.keys())
+ # Note that we intentionally ignore the return value here.
+ self._run_tests(failures.keys(), retry_summary)
+ failures = self._get_failures(retry_summary, include_crashes=True)
+
+ end_time = time.time()
+
+ self._print_timing_statistics(end_time - start_time,
+ thread_timings, test_timings,
+ individual_test_timings,
+ result_summary)
+
+ self._print_result_summary(result_summary)
+
+ sys.stdout.flush()
+ sys.stderr.flush()
+
+ self._printer.print_one_line_summary(result_summary.total,
+ result_summary.expected,
+ result_summary.unexpected)
+
+ unexpected_results = summarize_unexpected_results(self._port,
+ self._expectations, result_summary, retry_summary)
+ self._printer.print_unexpected_results(unexpected_results)
+
+ if self._options.record_results:
+ # Write the same data to log files and upload generated JSON files
+ # to appengine server.
+ self._upload_json_files(unexpected_results, result_summary,
+ individual_test_timings)
+
+ # Write the summary to disk (results.html) and display it if requested.
+ wrote_results = self._write_results_html_file(result_summary)
+ if self._options.show_results and wrote_results:
+ self._show_results_html_file()
+
+ # Now that we've completed all the processing we can, we re-raise
+ # a KeyboardInterrupt if necessary so the caller can handle it.
+ if keyboard_interrupted:
+ raise KeyboardInterrupt
+
+ # Ignore flaky failures and unexpected passes so we don't turn the
+ # bot red for those.
+ return unexpected_results['num_regressions']
+
+ def clean_up_run(self):
+ """Restores the system after we're done running tests."""
+
+ _log.debug("flushing stdout")
+ sys.stdout.flush()
+ _log.debug("flushing stderr")
+ sys.stderr.flush()
+ _log.debug("stopping helper")
+ self._port.stop_helper()
+
+ def update_summary(self, result_summary):
+ """Update the summary and print results with any completed tests."""
+ while True:
+ try:
+ result = test_results.TestResult.loads(self._result_queue.get_nowait())
+ except Queue.Empty:
+ return
+
+ expected = self._expectations.matches_an_expected_result(
+ result.filename, result.type, self._options.pixel_tests)
+ result_summary.add(result, expected)
+ exp_str = self._expectations.get_expectations_string(
+ result.filename)
+ got_str = self._expectations.expectation_to_string(result.type)
+ self._printer.print_test_result(result, expected, exp_str, got_str)
+ self._printer.print_progress(result_summary, self._retrying,
+ self._test_files_list)
+
+ def _clobber_old_results(self):
+ # Just clobber the actual test results directories since the other
+ # files in the results directory are explicitly used for cross-run
+ # tracking.
+ self._printer.print_update("Clobbering old results in %s" %
+ self._options.results_directory)
+ layout_tests_dir = self._port.layout_tests_dir()
+ possible_dirs = self._port.test_dirs()
+ for dirname in possible_dirs:
+ if os.path.isdir(os.path.join(layout_tests_dir, dirname)):
+ shutil.rmtree(os.path.join(self._options.results_directory,
+ dirname),
+ ignore_errors=True)
+
+ def _get_failures(self, result_summary, include_crashes):
+ """Filters a dict of results and returns only the failures.
+
+ Args:
+ result_summary: the results of the test run
+ include_crashes: whether crashes are included in the output.
+ We use False when finding the list of failures to retry
+ to see if the results were flaky. Although the crashes may also be
+ flaky, we treat them as if they aren't so that they're not ignored.
+ Returns:
+ a dict of files -> results
+ """
+ failed_results = {}
+ for test, result in result_summary.unexpected_results.iteritems():
+ if (result == test_expectations.PASS or
+ result == test_expectations.CRASH and not include_crashes):
+ continue
+ failed_results[test] = result
+
+ return failed_results
+
+ def _upload_json_files(self, unexpected_results, result_summary,
+ individual_test_timings):
+ """Writes the results of the test run as JSON files into the results
+ dir and upload the files to the appengine server.
+
+ There are three different files written into the results dir:
+ unexpected_results.json: A short list of any unexpected results.
+ This is used by the buildbots to display results.
+ expectations.json: This is used by the flakiness dashboard.
+ results.json: A full list of the results - used by the flakiness
+ dashboard and the aggregate results dashboard.
+
+ Args:
+ unexpected_results: dict of unexpected results
+ result_summary: full summary object
+ individual_test_timings: list of test times (used by the flakiness
+ dashboard).
+ """
+ results_directory = self._options.results_directory
+ _log.debug("Writing JSON files in %s." % results_directory)
+ unexpected_json_path = os.path.join(results_directory, "unexpected_results.json")
+ with codecs.open(unexpected_json_path, "w", "utf-8") as file:
+ simplejson.dump(unexpected_results, file, sort_keys=True, indent=2)
+
+ # Write a json file of the test_expectations.txt file for the layout
+ # tests dashboard.
+ expectations_path = os.path.join(results_directory, "expectations.json")
+ expectations_json = \
+ self._expectations.get_expectations_json_for_all_platforms()
+ with codecs.open(expectations_path, "w", "utf-8") as file:
+ file.write(u"ADD_EXPECTATIONS(%s);" % expectations_json)
+
+ generator = json_layout_results_generator.JSONLayoutResultsGenerator(
+ self._port, self._options.builder_name, self._options.build_name,
+ self._options.build_number, self._options.results_directory,
+ BUILDER_BASE_URL, individual_test_timings,
+ self._expectations, result_summary, self._test_files_list,
+ not self._options.upload_full_results,
+ self._options.test_results_server,
+ "layout-tests",
+ self._options.master_name)
+
+ _log.debug("Finished writing JSON files.")
+
+ json_files = ["expectations.json"]
+ if self._options.upload_full_results:
+ json_files.append("results.json")
+ else:
+ json_files.append("incremental_results.json")
+
+ generator.upload_json_files(json_files)
+
+ def _print_config(self):
+ """Prints the configuration for the test run."""
+ p = self._printer
+ p.print_config("Using port '%s'" % self._port.name())
+ p.print_config("Placing test results in %s" %
+ self._options.results_directory)
+ if self._options.new_baseline:
+ p.print_config("Placing new baselines in %s" %
+ self._port.baseline_path())
+ p.print_config("Using %s build" % self._options.configuration)
+ if self._options.pixel_tests:
+ p.print_config("Pixel tests enabled")
+ else:
+ p.print_config("Pixel tests disabled")
+
+ p.print_config("Regular timeout: %s, slow test timeout: %s" %
+ (self._options.time_out_ms,
+ self._options.slow_time_out_ms))
+
+ if self._is_single_threaded():
+ p.print_config("Running one %s" % self._port.driver_name())
+ else:
+ p.print_config("Running %s %ss in parallel" %
+ (self._options.child_processes,
+ self._port.driver_name()))
+ p.print_config("")
+
+ def _print_expected_results_of_type(self, result_summary,
+ result_type, result_type_str):
+ """Print the number of the tests in a given result class.
+
+ Args:
+ result_summary - the object containing all the results to report on
+ result_type - the particular result type to report in the summary.
+ result_type_str - a string description of the result_type.
+ """
+ tests = self._expectations.get_tests_with_result_type(result_type)
+ now = result_summary.tests_by_timeline[test_expectations.NOW]
+ wontfix = result_summary.tests_by_timeline[test_expectations.WONTFIX]
+
+ # We use a fancy format string in order to print the data out in a
+ # nicely-aligned table.
+ fmtstr = ("Expect: %%5d %%-8s (%%%dd now, %%%dd wontfix)"
+ % (self._num_digits(now), self._num_digits(wontfix)))
+ self._printer.print_expected(fmtstr %
+ (len(tests), result_type_str, len(tests & now), len(tests & wontfix)))
+
+ def _num_digits(self, num):
+ """Returns the number of digits needed to represent the length of a
+ sequence."""
+ ndigits = 1
+ if len(num):
+ ndigits = int(math.log10(len(num))) + 1
+ return ndigits
+
+ def _print_timing_statistics(self, total_time, thread_timings,
+ directory_test_timings, individual_test_timings,
+ result_summary):
+ """Record timing-specific information for the test run.
+
+ Args:
+ total_time: total elapsed time (in seconds) for the test run
+ thread_timings: wall clock time each thread ran for
+ directory_test_timings: timing by directory
+ individual_test_timings: timing by file
+ result_summary: summary object for the test run
+ """
+ self._printer.print_timing("Test timing:")
+ self._printer.print_timing(" %6.2f total testing time" % total_time)
+ self._printer.print_timing("")
+ self._printer.print_timing("Thread timing:")
+ cuml_time = 0
+ for t in thread_timings:
+ self._printer.print_timing(" %10s: %5d tests, %6.2f secs" %
+ (t['name'], t['num_tests'], t['total_time']))
+ cuml_time += t['total_time']
+ self._printer.print_timing(" %6.2f cumulative, %6.2f optimal" %
+ (cuml_time, cuml_time / int(self._options.child_processes)))
+ self._printer.print_timing("")
+
+ self._print_aggregate_test_statistics(individual_test_timings)
+ self._print_individual_test_times(individual_test_timings,
+ result_summary)
+ self._print_directory_timings(directory_test_timings)
+
+ def _print_aggregate_test_statistics(self, individual_test_timings):
+ """Prints aggregate statistics (e.g. median, mean, etc.) for all tests.
+ Args:
+ individual_test_timings: List of dump_render_tree_thread.TestStats
+ for all tests.
+ """
+ test_types = [] # Unit tests don't actually produce any timings.
+ if individual_test_timings:
+ test_types = individual_test_timings[0].time_for_diffs.keys()
+ times_for_dump_render_tree = []
+ times_for_diff_processing = []
+ times_per_test_type = {}
+ for test_type in test_types:
+ times_per_test_type[test_type] = []
+
+ for test_stats in individual_test_timings:
+ times_for_dump_render_tree.append(test_stats.test_run_time)
+ times_for_diff_processing.append(
+ test_stats.total_time_for_all_diffs)
+ time_for_diffs = test_stats.time_for_diffs
+ for test_type in test_types:
+ times_per_test_type[test_type].append(
+ time_for_diffs[test_type])
+
+ self._print_statistics_for_test_timings(
+ "PER TEST TIME IN TESTSHELL (seconds):",
+ times_for_dump_render_tree)
+ self._print_statistics_for_test_timings(
+ "PER TEST DIFF PROCESSING TIMES (seconds):",
+ times_for_diff_processing)
+ for test_type in test_types:
+ self._print_statistics_for_test_timings(
+ "PER TEST TIMES BY TEST TYPE: %s" % test_type,
+ times_per_test_type[test_type])
+
+ def _print_individual_test_times(self, individual_test_timings,
+ result_summary):
+ """Prints the run times for slow, timeout and crash tests.
+ Args:
+ individual_test_timings: List of dump_render_tree_thread.TestStats
+ for all tests.
+ result_summary: summary object for test run
+ """
+ # Reverse-sort by the time spent in DumpRenderTree.
+ individual_test_timings.sort(lambda a, b:
+ cmp(b.test_run_time, a.test_run_time))
+
+ num_printed = 0
+ slow_tests = []
+ timeout_or_crash_tests = []
+ unexpected_slow_tests = []
+ for test_tuple in individual_test_timings:
+ filename = test_tuple.filename
+ is_timeout_crash_or_slow = False
+ if self._expectations.has_modifier(filename,
+ test_expectations.SLOW):
+ is_timeout_crash_or_slow = True
+ slow_tests.append(test_tuple)
+
+ if filename in result_summary.failures:
+ result = result_summary.results[filename].type
+ if (result == test_expectations.TIMEOUT or
+ result == test_expectations.CRASH):
+ is_timeout_crash_or_slow = True
+ timeout_or_crash_tests.append(test_tuple)
+
+ if (not is_timeout_crash_or_slow and
+ num_printed < printing.NUM_SLOW_TESTS_TO_LOG):
+ num_printed = num_printed + 1
+ unexpected_slow_tests.append(test_tuple)
+
+ self._printer.print_timing("")
+ self._print_test_list_timing("%s slowest tests that are not "
+ "marked as SLOW and did not timeout/crash:" %
+ printing.NUM_SLOW_TESTS_TO_LOG, unexpected_slow_tests)
+ self._printer.print_timing("")
+ self._print_test_list_timing("Tests marked as SLOW:", slow_tests)
+ self._printer.print_timing("")
+ self._print_test_list_timing("Tests that timed out or crashed:",
+ timeout_or_crash_tests)
+ self._printer.print_timing("")
+
+ def _print_test_list_timing(self, title, test_list):
+ """Print timing info for each test.
+
+ Args:
+ title: section heading
+ test_list: tests that fall in this section
+ """
+ if self._printer.disabled('slowest'):
+ return
+
+ self._printer.print_timing(title)
+ for test_tuple in test_list:
+ filename = test_tuple.filename[len(
+ self._port.layout_tests_dir()) + 1:]
+ filename = filename.replace('\\', '/')
+ test_run_time = round(test_tuple.test_run_time, 1)
+ self._printer.print_timing(" %s took %s seconds" %
+ (filename, test_run_time))
+
+ def _print_directory_timings(self, directory_test_timings):
+ """Print timing info by directory for any directories that
+ take > 10 seconds to run.
+
+ Args:
+ directory_test_timing: time info for each directory
+ """
+ timings = []
+ for directory in directory_test_timings:
+ num_tests, time_for_directory = directory_test_timings[directory]
+ timings.append((round(time_for_directory, 1), directory,
+ num_tests))
+ timings.sort()
+
+ self._printer.print_timing("Time to process slowest subdirectories:")
+ min_seconds_to_print = 10
+ for timing in timings:
+ if timing[0] > min_seconds_to_print:
+ self._printer.print_timing(
+ " %s took %s seconds to run %s tests." % (timing[1],
+ timing[0], timing[2]))
+ self._printer.print_timing("")
+
+ def _print_statistics_for_test_timings(self, title, timings):
+ """Prints the median, mean and standard deviation of the values in
+ timings.
+
+ Args:
+ title: Title for these timings.
+ timings: A list of floats representing times.
+ """
+ self._printer.print_timing(title)
+ timings.sort()
+
+ num_tests = len(timings)
+ if not num_tests:
+ return
+ percentile90 = timings[int(.9 * num_tests)]
+ percentile99 = timings[int(.99 * num_tests)]
+
+ if num_tests % 2 == 1:
+ median = timings[((num_tests - 1) / 2) - 1]
+ else:
+ lower = timings[num_tests / 2 - 1]
+ upper = timings[num_tests / 2]
+ median = (float(lower + upper)) / 2
+
+ mean = sum(timings) / num_tests
+
+ for time in timings:
+ sum_of_deviations = math.pow(time - mean, 2)
+
+ std_deviation = math.sqrt(sum_of_deviations / num_tests)
+ self._printer.print_timing(" Median: %6.3f" % median)
+ self._printer.print_timing(" Mean: %6.3f" % mean)
+ self._printer.print_timing(" 90th percentile: %6.3f" % percentile90)
+ self._printer.print_timing(" 99th percentile: %6.3f" % percentile99)
+ self._printer.print_timing(" Standard dev: %6.3f" % std_deviation)
+ self._printer.print_timing("")
+
+ def _print_result_summary(self, result_summary):
+ """Print a short summary about how many tests passed.
+
+ Args:
+ result_summary: information to log
+ """
+ failed = len(result_summary.failures)
+ skipped = len(
+ result_summary.tests_by_expectation[test_expectations.SKIP])
+ total = result_summary.total
+ passed = total - failed - skipped
+ pct_passed = 0.0
+ if total > 0:
+ pct_passed = float(passed) * 100 / total
+
+ self._printer.print_actual("")
+ self._printer.print_actual("=> Results: %d/%d tests passed (%.1f%%)" %
+ (passed, total, pct_passed))
+ self._printer.print_actual("")
+ self._print_result_summary_entry(result_summary,
+ test_expectations.NOW, "Tests to be fixed")
+
+ self._printer.print_actual("")
+ self._print_result_summary_entry(result_summary,
+ test_expectations.WONTFIX,
+ "Tests that will only be fixed if they crash (WONTFIX)")
+ self._printer.print_actual("")
+
+ def _print_result_summary_entry(self, result_summary, timeline,
+ heading):
+ """Print a summary block of results for a particular timeline of test.
+
+ Args:
+ result_summary: summary to print results for
+ timeline: the timeline to print results for (NOT, WONTFIX, etc.)
+ heading: a textual description of the timeline
+ """
+ total = len(result_summary.tests_by_timeline[timeline])
+ not_passing = (total -
+ len(result_summary.tests_by_expectation[test_expectations.PASS] &
+ result_summary.tests_by_timeline[timeline]))
+ self._printer.print_actual("=> %s (%d):" % (heading, not_passing))
+
+ for result in TestExpectationsFile.EXPECTATION_ORDER:
+ if result == test_expectations.PASS:
+ continue
+ results = (result_summary.tests_by_expectation[result] &
+ result_summary.tests_by_timeline[timeline])
+ desc = TestExpectationsFile.EXPECTATION_DESCRIPTIONS[result]
+ if not_passing and len(results):
+ pct = len(results) * 100.0 / not_passing
+ self._printer.print_actual(" %5d %-24s (%4.1f%%)" %
+ (len(results), desc[len(results) != 1], pct))
+
+ def _results_html(self, test_files, failures, title="Test Failures", override_time=None):
+ """
+ test_files = a list of file paths
+ failures = dictionary mapping test paths to failure objects
+ title = title printed at top of test
+ override_time = current time (used by unit tests)
+ """
+ page = """<html>
+ <head>
+ <title>Layout Test Results (%(time)s)</title>
+ </head>
+ <body>
+ <h2>%(title)s (%(time)s)</h2>
+ """ % {'title': title, 'time': override_time or time.asctime()}
+
+ for test_file in sorted(test_files):
+ test_name = self._port.relative_test_filename(test_file)
+ test_url = self._port.filename_to_uri(test_file)
+ page += u"<p><a href='%s'>%s</a><br />\n" % (test_url, test_name)
+ test_failures = failures.get(test_file, [])
+ for failure in test_failures:
+ page += (u"&nbsp;&nbsp;%s<br/>" %
+ failure.result_html_output(test_name))
+ page += "</p>\n"
+ page += "</body></html>\n"
+ return page
+
+ def _write_results_html_file(self, result_summary):
+ """Write results.html which is a summary of tests that failed.
+
+ Args:
+ result_summary: a summary of the results :)
+
+ Returns:
+ True if any results were written (since expected failures may be
+ omitted)
+ """
+ # test failures
+ if self._options.full_results_html:
+ results_title = "Test Failures"
+ test_files = result_summary.failures.keys()
+ else:
+ results_title = "Unexpected Test Failures"
+ unexpected_failures = self._get_failures(result_summary,
+ include_crashes=True)
+ test_files = unexpected_failures.keys()
+ if not len(test_files):
+ return False
+
+ out_filename = os.path.join(self._options.results_directory,
+ "results.html")
+ with codecs.open(out_filename, "w", "utf-8") as results_file:
+ html = self._results_html(test_files, result_summary.failures, results_title)
+ results_file.write(html)
+
+ return True
+
+ def _show_results_html_file(self):
+ """Shows the results.html page."""
+ results_filename = os.path.join(self._options.results_directory,
+ "results.html")
+ self._port.show_results_html_file(results_filename)
+
+
+def read_test_files(files):
+ tests = []
+ for file in files:
+ try:
+ with codecs.open(file, 'r', 'utf-8') as file_contents:
+ # FIXME: This could be cleaner using a list comprehension.
+ for line in file_contents:
+ line = test_expectations.strip_comments(line)
+ if line:
+ tests.append(line)
+ except IOError, e:
+ if e.errno == errno.ENOENT:
+ _log.critical('')
+ _log.critical('--test-list file "%s" not found' % file)
+ raise
+ return tests
+
+
+def run(port, options, args, regular_output=sys.stderr,
+ buildbot_output=sys.stdout):
+ """Run the tests.
+
+ Args:
+ port: Port object for port-specific behavior
+ options: a dictionary of command line options
+ args: a list of sub directories or files to test
+ regular_output: a stream-like object that we can send logging/debug
+ output to
+ buildbot_output: a stream-like object that we can write all output that
+ is intended to be parsed by the buildbot to
+ Returns:
+ the number of unexpected results that occurred, or -1 if there is an
+ error.
+
+ """
+ _set_up_derived_options(port, options)
+
+ printer = printing.Printer(port, options, regular_output, buildbot_output,
+ int(options.child_processes), options.experimental_fully_parallel)
+ if options.help_printing:
+ printer.help_printing()
+ printer.cleanup()
+ return 0
+
+ last_unexpected_results = _gather_unexpected_results(options)
+ if options.print_last_failures:
+ printer.write("\n".join(last_unexpected_results) + "\n")
+ printer.cleanup()
+ return 0
+
+ # We wrap any parts of the run that are slow or likely to raise exceptions
+ # in a try/finally to ensure that we clean up the logging configuration.
+ num_unexpected_results = -1
+ try:
+ test_runner = TestRunner(port, options, printer)
+ test_runner._print_config()
+
+ printer.print_update("Collecting tests ...")
+ try:
+ test_runner.collect_tests(args, last_unexpected_results)
+ except IOError, e:
+ if e.errno == errno.ENOENT:
+ return -1
+ raise
+
+ printer.print_update("Parsing expectations ...")
+ if options.lint_test_files:
+ return test_runner.lint()
+ test_runner.parse_expectations(port.test_platform_name(),
+ options.configuration == 'Debug')
+
+ printer.print_update("Checking build ...")
+ if not port.check_build(test_runner.needs_http()):
+ _log.error("Build check failed")
+ return -1
+
+ result_summary = test_runner.set_up_run()
+ if result_summary:
+ num_unexpected_results = test_runner.run(result_summary)
+ test_runner.clean_up_run()
+ _log.debug("Testing completed, Exit status: %d" %
+ num_unexpected_results)
+ finally:
+ printer.cleanup()
+
+ return num_unexpected_results
+
+
+def _set_up_derived_options(port_obj, options):
+ """Sets the options values that depend on other options values."""
+
+ if not options.child_processes:
+ # FIXME: Investigate perf/flakiness impact of using cpu_count + 1.
+ options.child_processes = os.environ.get("WEBKIT_TEST_CHILD_PROCESSES",
+ str(port_obj.default_child_processes()))
+
+ if not options.configuration:
+ options.configuration = port_obj.default_configuration()
+
+ if options.pixel_tests is None:
+ options.pixel_tests = True
+
+ if not options.use_apache:
+ options.use_apache = sys.platform in ('darwin', 'linux2')
+
+ if not os.path.isabs(options.results_directory):
+ # This normalizes the path to the build dir.
+ # FIXME: how this happens is not at all obvious; this is a dumb
+ # interface and should be cleaned up.
+ options.results_directory = port_obj.results_directory()
+
+ if not options.time_out_ms:
+ if options.configuration == "Debug":
+ options.time_out_ms = str(2 * TestRunner.DEFAULT_TEST_TIMEOUT_MS)
+ else:
+ options.time_out_ms = str(TestRunner.DEFAULT_TEST_TIMEOUT_MS)
+
+ options.slow_time_out_ms = str(5 * int(options.time_out_ms))
+
+
+def _gather_unexpected_results(options):
+ """Returns the unexpected results from the previous run, if any."""
+ last_unexpected_results = []
+ if options.print_last_failures or options.retest_last_failures:
+ unexpected_results_filename = os.path.join(
+ options.results_directory, "unexpected_results.json")
+ with codecs.open(unexpected_results_filename, "r", "utf-8") as file:
+ results = simplejson.load(file)
+ last_unexpected_results = results['tests'].keys()
+ return last_unexpected_results
+
+
+def _compat_shim_callback(option, opt_str, value, parser):
+ print "Ignoring unsupported option: %s" % opt_str
+
+
+def _compat_shim_option(option_name, **kwargs):
+ return optparse.make_option(option_name, action="callback",
+ callback=_compat_shim_callback,
+ help="Ignored, for old-run-webkit-tests compat only.", **kwargs)
+
+
+def parse_args(args=None):
+ """Provides a default set of command line args.
+
+ Returns a tuple of options, args from optparse"""
+
+ # FIXME: All of these options should be stored closer to the code which
+ # FIXME: actually uses them. configuration_options should move
+ # FIXME: to WebKitPort and be shared across all scripts.
+ configuration_options = [
+ optparse.make_option("-t", "--target", dest="configuration",
+ help="(DEPRECATED)"),
+ # FIXME: --help should display which configuration is default.
+ optparse.make_option('--debug', action='store_const', const='Debug',
+ dest="configuration",
+ help='Set the configuration to Debug'),
+ optparse.make_option('--release', action='store_const',
+ const='Release', dest="configuration",
+ help='Set the configuration to Release'),
+ # old-run-webkit-tests also accepts -c, --configuration CONFIGURATION.
+ ]
+
+ print_options = printing.print_options()
+
+ # FIXME: These options should move onto the ChromiumPort.
+ chromium_options = [
+ optparse.make_option("--chromium", action="store_true", default=False,
+ help="use the Chromium port"),
+ optparse.make_option("--startup-dialog", action="store_true",
+ default=False, help="create a dialog on DumpRenderTree startup"),
+ optparse.make_option("--gp-fault-error-box", action="store_true",
+ default=False, help="enable Windows GP fault error box"),
+ optparse.make_option("--multiple-loads",
+ type="int", help="turn on multiple loads of each test"),
+ optparse.make_option("--js-flags",
+ type="string", help="JavaScript flags to pass to tests"),
+ optparse.make_option("--nocheck-sys-deps", action="store_true",
+ default=False,
+ help="Don't check the system dependencies (themes)"),
+ optparse.make_option("--use-drt", action="store_true",
+ default=None,
+ help="Use DumpRenderTree instead of test_shell"),
+ optparse.make_option("--accelerated-compositing",
+ action="store_true",
+ help="Use hardware-accelated compositing for rendering"),
+ optparse.make_option("--no-accelerated-compositing",
+ action="store_false",
+ dest="accelerated_compositing",
+ help="Don't use hardware-accelerated compositing for rendering"),
+ optparse.make_option("--accelerated-2d-canvas",
+ action="store_true",
+ help="Use hardware-accelerated 2D Canvas calls"),
+ optparse.make_option("--no-accelerated-2d-canvas",
+ action="store_false",
+ dest="accelerated_2d_canvas",
+ help="Don't use hardware-accelerated 2D Canvas calls"),
+ ]
+
+ # Missing Mac-specific old-run-webkit-tests options:
+ # FIXME: Need: -g, --guard for guard malloc support on Mac.
+ # FIXME: Need: -l --leaks Enable leaks checking.
+ # FIXME: Need: --sample-on-timeout Run sample on timeout
+
+ old_run_webkit_tests_compat = [
+ # NRWT doesn't generate results by default anyway.
+ _compat_shim_option("--no-new-test-results"),
+ # NRWT doesn't sample on timeout yet anyway.
+ _compat_shim_option("--no-sample-on-timeout"),
+ # FIXME: NRWT needs to support remote links eventually.
+ _compat_shim_option("--use-remote-links-to-tests"),
+ # FIXME: NRWT doesn't need this option as much since failures are
+ # designed to be cheap. We eventually plan to add this support.
+ _compat_shim_option("--exit-after-n-failures", nargs=1, type="int"),
+ ]
+
+ results_options = [
+ # NEED for bots: --use-remote-links-to-tests Link to test files
+ # within the SVN repository in the results.
+ optparse.make_option("-p", "--pixel-tests", action="store_true",
+ dest="pixel_tests", help="Enable pixel-to-pixel PNG comparisons"),
+ optparse.make_option("--no-pixel-tests", action="store_false",
+ dest="pixel_tests", help="Disable pixel-to-pixel PNG comparisons"),
+ optparse.make_option("--tolerance",
+ help="Ignore image differences less than this percentage (some "
+ "ports may ignore this option)", type="float"),
+ optparse.make_option("--results-directory",
+ default="layout-test-results",
+ help="Output results directory source dir, relative to Debug or "
+ "Release"),
+ optparse.make_option("--new-baseline", action="store_true",
+ default=False, help="Save all generated results as new baselines "
+ "into the platform directory, overwriting whatever's "
+ "already there."),
+ optparse.make_option("--reset-results", action="store_true",
+ default=False, help="Reset any existing baselines to the "
+ "generated results"),
+ optparse.make_option("--no-show-results", action="store_false",
+ default=True, dest="show_results",
+ help="Don't launch a browser with results after the tests "
+ "are done"),
+ # FIXME: We should have a helper function to do this sort of
+ # deprectated mapping and automatically log, etc.
+ optparse.make_option("--noshow-results", action="store_false",
+ dest="show_results",
+ help="Deprecated, same as --no-show-results."),
+ optparse.make_option("--no-launch-safari", action="store_false",
+ dest="show_results",
+ help="old-run-webkit-tests compat, same as --noshow-results."),
+ # old-run-webkit-tests:
+ # --[no-]launch-safari Launch (or do not launch) Safari to display
+ # test results (default: launch)
+ optparse.make_option("--full-results-html", action="store_true",
+ default=False,
+ help="Show all failures in results.html, rather than only "
+ "regressions"),
+ optparse.make_option("--clobber-old-results", action="store_true",
+ default=False, help="Clobbers test results from previous runs."),
+ optparse.make_option("--platform",
+ help="Override the platform for expected results"),
+ optparse.make_option("--no-record-results", action="store_false",
+ default=True, dest="record_results",
+ help="Don't record the results."),
+ # old-run-webkit-tests also has HTTP toggle options:
+ # --[no-]http Run (or do not run) http tests
+ # (default: run)
+ ]
+
+ test_options = [
+ optparse.make_option("--build", dest="build",
+ action="store_true", default=True,
+ help="Check to ensure the DumpRenderTree build is up-to-date "
+ "(default)."),
+ optparse.make_option("--no-build", dest="build",
+ action="store_false", help="Don't check to see if the "
+ "DumpRenderTree build is up-to-date."),
+ # old-run-webkit-tests has --valgrind instead of wrapper.
+ optparse.make_option("--wrapper",
+ help="wrapper command to insert before invocations of "
+ "DumpRenderTree; option is split on whitespace before "
+ "running. (Example: --wrapper='valgrind --smc-check=all')"),
+ # old-run-webkit-tests:
+ # -i|--ignore-tests Comma-separated list of directories
+ # or tests to ignore
+ optparse.make_option("--test-list", action="append",
+ help="read list of tests to run from file", metavar="FILE"),
+ # old-run-webkit-tests uses --skipped==[default|ignore|only]
+ # instead of --force:
+ optparse.make_option("--force", action="store_true", default=False,
+ help="Run all tests, even those marked SKIP in the test list"),
+ optparse.make_option("--use-apache", action="store_true",
+ default=False, help="Whether to use apache instead of lighttpd."),
+ optparse.make_option("--time-out-ms",
+ help="Set the timeout for each test"),
+ # old-run-webkit-tests calls --randomize-order --random:
+ optparse.make_option("--randomize-order", action="store_true",
+ default=False, help=("Run tests in random order (useful "
+ "for tracking down corruption)")),
+ optparse.make_option("--run-chunk",
+ help=("Run a specified chunk (n:l), the nth of len l, "
+ "of the layout tests")),
+ optparse.make_option("--run-part", help=("Run a specified part (n:m), "
+ "the nth of m parts, of the layout tests")),
+ # old-run-webkit-tests calls --batch-size: --nthly n
+ # Restart DumpRenderTree every n tests (default: 1000)
+ optparse.make_option("--batch-size",
+ help=("Run a the tests in batches (n), after every n tests, "
+ "DumpRenderTree is relaunched."), type="int", default=0),
+ # old-run-webkit-tests calls --run-singly: -1|--singly
+ # Isolate each test case run (implies --nthly 1 --verbose)
+ optparse.make_option("--run-singly", action="store_true",
+ default=False, help="run a separate DumpRenderTree for each test"),
+ optparse.make_option("--child-processes",
+ help="Number of DumpRenderTrees to run in parallel."),
+ # FIXME: Display default number of child processes that will run.
+ optparse.make_option("--experimental-fully-parallel",
+ action="store_true", default=False,
+ help="run all tests in parallel"),
+ # FIXME: Need --exit-after-n-failures N
+ # Exit after the first N failures instead of running all tests
+ # FIXME: Need --exit-after-n-crashes N
+ # Exit after the first N crashes instead of running all tests
+ # FIXME: consider: --iterations n
+ # Number of times to run the set of tests (e.g. ABCABCABC)
+ optparse.make_option("--print-last-failures", action="store_true",
+ default=False, help="Print the tests in the last run that "
+ "had unexpected failures (or passes)."),
+ optparse.make_option("--retest-last-failures", action="store_true",
+ default=False, help="re-test the tests in the last run that "
+ "had unexpected failures (or passes)."),
+ optparse.make_option("--retry-failures", action="store_true",
+ default=True,
+ help="Re-try any tests that produce unexpected results (default)"),
+ optparse.make_option("--no-retry-failures", action="store_false",
+ dest="retry_failures",
+ help="Don't re-try any tests that produce unexpected results."),
+ ]
+
+ misc_options = [
+ optparse.make_option("--lint-test-files", action="store_true",
+ default=False, help=("Makes sure the test files parse for all "
+ "configurations. Does not run any tests.")),
+ ]
+
+ # FIXME: Move these into json_results_generator.py
+ results_json_options = [
+ optparse.make_option("--master-name", help="The name of the buildbot master."),
+ optparse.make_option("--builder-name", default="DUMMY_BUILDER_NAME",
+ help=("The name of the builder shown on the waterfall running "
+ "this script e.g. WebKit.")),
+ optparse.make_option("--build-name", default="DUMMY_BUILD_NAME",
+ help=("The name of the builder used in its path, e.g. "
+ "webkit-rel.")),
+ optparse.make_option("--build-number", default="DUMMY_BUILD_NUMBER",
+ help=("The build number of the builder running this script.")),
+ optparse.make_option("--test-results-server", default="",
+ help=("If specified, upload results json files to this appengine "
+ "server.")),
+ optparse.make_option("--upload-full-results",
+ action="store_true",
+ default=False,
+ help="If true, upload full json results to server."),
+ ]
+
+ option_list = (configuration_options + print_options +
+ chromium_options + results_options + test_options +
+ misc_options + results_json_options +
+ old_run_webkit_tests_compat)
+ option_parser = optparse.OptionParser(option_list=option_list)
+
+ options, args = option_parser.parse_args(args)
+
+ return options, args
+
+
+def _log_wedged_thread(thread):
+ """Log information about the given thread state."""
+ id = thread.id()
+ stack = dump_render_tree_thread.find_thread_stack(id)
+ assert(stack is not None)
+ _log.error("")
+ _log.error("thread %s (%d) is wedged" % (thread.getName(), id))
+ dump_render_tree_thread.log_stack(stack)
+ _log.error("")
+
+
+def main():
+ options, args = parse_args()
+ port_obj = port.get(options.platform, options)
+ return run(port_obj, options, args)
+
+if '__main__' == __name__:
+ try:
+ sys.exit(main())
+ except KeyboardInterrupt:
+ # this mirrors what the shell normally does
+ sys.exit(signal.SIGINT + 128)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
new file mode 100644
index 0000000..54e1dc0
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -0,0 +1,633 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Szeged
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for run_webkit_tests."""
+
+import codecs
+import itertools
+import logging
+import os
+import Queue
+import shutil
+import sys
+import tempfile
+import thread
+import time
+import threading
+import unittest
+
+from webkitpy.common import array_stream
+from webkitpy.common.system import outputcapture
+from webkitpy.common.system import user
+from webkitpy.layout_tests import port
+from webkitpy.layout_tests import run_webkit_tests
+from webkitpy.layout_tests.layout_package import dump_render_tree_thread
+from webkitpy.layout_tests.port.test import TestPort, TestDriver
+from webkitpy.python24.versioning import compare_version
+from webkitpy.test.skip import skip_if
+
+from webkitpy.thirdparty.mock import Mock
+
+
+class MockUser():
+ def __init__(self):
+ self.url = None
+
+ def open_url(self, url):
+ self.url = url
+
+
+def passing_run(extra_args=None, port_obj=None, record_results=False,
+ tests_included=False):
+ extra_args = extra_args or []
+ args = ['--print', 'nothing']
+ if not '--platform' in extra_args:
+ args.extend(['--platform', 'test'])
+ if not record_results:
+ args.append('--no-record-results')
+ args.extend(extra_args)
+ if not tests_included:
+ # We use the glob to test that globbing works.
+ args.extend(['passes',
+ 'http/tests',
+ 'http/tests/websocket/tests',
+ 'failures/expected/*'])
+ options, parsed_args = run_webkit_tests.parse_args(args)
+ if not port_obj:
+ port_obj = port.get(port_name=options.platform, options=options,
+ user=MockUser())
+ res = run_webkit_tests.run(port_obj, options, parsed_args)
+ return res == 0
+
+
+def logging_run(extra_args=None, port_obj=None, tests_included=False):
+ extra_args = extra_args or []
+ args = ['--no-record-results']
+ if not '--platform' in extra_args:
+ args.extend(['--platform', 'test'])
+ args.extend(extra_args)
+ if not tests_included:
+ args.extend(['passes',
+ 'http/tests',
+ 'http/tests/websocket/tests',
+ 'failures/expected/*'])
+ options, parsed_args = run_webkit_tests.parse_args(args)
+ user = MockUser()
+ if not port_obj:
+ port_obj = port.get(port_name=options.platform, options=options, user=user)
+ buildbot_output = array_stream.ArrayStream()
+ regular_output = array_stream.ArrayStream()
+ res = run_webkit_tests.run(port_obj, options, parsed_args,
+ buildbot_output=buildbot_output,
+ regular_output=regular_output)
+ return (res, buildbot_output, regular_output, user)
+
+
+def get_tests_run(extra_args=None, tests_included=False, flatten_batches=False):
+ extra_args = extra_args or []
+ args = [
+ '--print', 'nothing',
+ '--platform', 'test',
+ '--no-record-results',
+ '--child-processes', '1']
+ args.extend(extra_args)
+ if not tests_included:
+ # Not including http tests since they get run out of order (that
+ # behavior has its own test, see test_get_test_file_queue)
+ args.extend(['passes', 'failures'])
+ options, parsed_args = run_webkit_tests.parse_args(args)
+ user = MockUser()
+
+ test_batches = []
+
+ class RecordingTestDriver(TestDriver):
+ def __init__(self, port, image_path, options):
+ TestDriver.__init__(self, port, image_path, options, executive=None)
+ self._current_test_batch = None
+
+ def poll(self):
+ # So that we don't create a new driver for every test
+ return None
+
+ def stop(self):
+ self._current_test_batch = None
+
+ def run_test(self, uri, timeoutms, image_hash):
+ if self._current_test_batch is None:
+ self._current_test_batch = []
+ test_batches.append(self._current_test_batch)
+ self._current_test_batch.append(self._port.uri_to_test_name(uri))
+ return TestDriver.run_test(self, uri, timeoutms, image_hash)
+
+ class RecordingTestPort(TestPort):
+ def create_driver(self, image_path, options):
+ return RecordingTestDriver(self, image_path, options)
+
+ recording_port = RecordingTestPort(options=options, user=user)
+ logging_run(extra_args=args, port_obj=recording_port, tests_included=True)
+
+ if flatten_batches:
+ return list(itertools.chain(*test_batches))
+
+ return test_batches
+
+class MainTest(unittest.TestCase):
+ def test_accelerated_compositing(self):
+ # This just tests that we recognize the command line args
+ self.assertTrue(passing_run(['--accelerated-compositing']))
+ self.assertTrue(passing_run(['--no-accelerated-compositing']))
+
+ def test_accelerated_2d_canvas(self):
+ # This just tests that we recognize the command line args
+ self.assertTrue(passing_run(['--accelerated-2d-canvas']))
+ self.assertTrue(passing_run(['--no-accelerated-2d-canvas']))
+
+ def test_basic(self):
+ self.assertTrue(passing_run())
+
+ def test_batch_size(self):
+ batch_tests_run = get_tests_run(['--batch-size', '2'])
+ for batch in batch_tests_run:
+ self.assertTrue(len(batch) <= 2, '%s had too many tests' % ', '.join(batch))
+
+ def test_child_process_1(self):
+ (res, buildbot_output, regular_output, user) = logging_run(
+ ['--print', 'config', '--child-processes', '1'])
+ self.assertTrue('Running one DumpRenderTree\n'
+ in regular_output.get())
+
+ def test_child_processes_2(self):
+ (res, buildbot_output, regular_output, user) = logging_run(
+ ['--print', 'config', '--child-processes', '2'])
+ self.assertTrue('Running 2 DumpRenderTrees in parallel\n'
+ in regular_output.get())
+
+ def test_exception_raised(self):
+ self.assertRaises(ValueError, logging_run,
+ ['failures/expected/exception.html'], tests_included=True)
+
+ def test_full_results_html(self):
+ # FIXME: verify html?
+ self.assertTrue(passing_run(['--full-results-html']))
+
+ def test_help_printing(self):
+ res, out, err, user = logging_run(['--help-printing'])
+ self.assertEqual(res, 0)
+ self.assertTrue(out.empty())
+ self.assertFalse(err.empty())
+
+ def test_hung_thread(self):
+ res, out, err, user = logging_run(['--run-singly', '--time-out-ms=50',
+ 'failures/expected/hang.html'],
+ tests_included=True)
+ self.assertEqual(res, 0)
+ self.assertFalse(out.empty())
+ self.assertFalse(err.empty())
+
+ def test_keyboard_interrupt(self):
+ # Note that this also tests running a test marked as SKIP if
+ # you specify it explicitly.
+ self.assertRaises(KeyboardInterrupt, passing_run,
+ ['failures/expected/keyboard.html'], tests_included=True)
+
+ def test_last_results(self):
+ passing_run(['--clobber-old-results'], record_results=True)
+ (res, buildbot_output, regular_output, user) = logging_run(
+ ['--print-last-failures'])
+ self.assertEqual(regular_output.get(), ['\n\n'])
+ self.assertEqual(buildbot_output.get(), [])
+
+ def test_lint_test_files(self):
+ # FIXME: add errors?
+ res, out, err, user = logging_run(['--lint-test-files'],
+ tests_included=True)
+ self.assertEqual(res, 0)
+ self.assertTrue(out.empty())
+ self.assertTrue(any(['lint succeeded' in msg for msg in err.get()]))
+
+ def test_no_tests_found(self):
+ res, out, err, user = logging_run(['resources'], tests_included=True)
+ self.assertEqual(res, -1)
+ self.assertTrue(out.empty())
+ self.assertTrue('No tests to run.\n' in err.get())
+
+ def test_no_tests_found_2(self):
+ res, out, err, user = logging_run(['foo'], tests_included=True)
+ self.assertEqual(res, -1)
+ self.assertTrue(out.empty())
+ self.assertTrue('No tests to run.\n' in err.get())
+
+ def test_randomize_order(self):
+ # FIXME: verify order was shuffled
+ self.assertTrue(passing_run(['--randomize-order']))
+
+ def test_run_chunk(self):
+ # Test that we actually select the right chunk
+ all_tests_run = get_tests_run(flatten_batches=True)
+ chunk_tests_run = get_tests_run(['--run-chunk', '1:4'], flatten_batches=True)
+ self.assertEquals(all_tests_run[4:8], chunk_tests_run)
+
+ # Test that we wrap around if the number of tests is not evenly divisible by the chunk size
+ tests_to_run = ['passes/error.html', 'passes/image.html', 'passes/platform_image.html', 'passes/text.html']
+ chunk_tests_run = get_tests_run(['--run-chunk', '1:3'] + tests_to_run, tests_included=True, flatten_batches=True)
+ self.assertEquals(['passes/text.html', 'passes/error.html', 'passes/image.html'], chunk_tests_run)
+
+ def test_run_force(self):
+ # This raises an exception because we run
+ # failures/expected/exception.html, which is normally SKIPped.
+ self.assertRaises(ValueError, logging_run, ['--force'])
+
+ def test_run_part(self):
+ # Test that we actually select the right part
+ tests_to_run = ['passes/error.html', 'passes/image.html', 'passes/platform_image.html', 'passes/text.html']
+ tests_run = get_tests_run(['--run-part', '1:2'] + tests_to_run, tests_included=True, flatten_batches=True)
+ self.assertEquals(['passes/error.html', 'passes/image.html'], tests_run)
+
+ # Test that we wrap around if the number of tests is not evenly divisible by the chunk size
+ # (here we end up with 3 parts, each with 2 tests, and we only have 4 tests total, so the
+ # last part repeats the first two tests).
+ chunk_tests_run = get_tests_run(['--run-part', '3:3'] + tests_to_run, tests_included=True, flatten_batches=True)
+ self.assertEquals(['passes/error.html', 'passes/image.html'], chunk_tests_run)
+
+ def test_run_singly(self):
+ batch_tests_run = get_tests_run(['--run-singly'])
+ for batch in batch_tests_run:
+ self.assertEquals(len(batch), 1, '%s had too many tests' % ', '.join(batch))
+
+ def test_single_file(self):
+ tests_run = get_tests_run(['passes/text.html'], tests_included=True, flatten_batches=True)
+ self.assertEquals(['passes/text.html'], tests_run)
+
+ def test_test_list(self):
+ filename = tempfile.mktemp()
+ tmpfile = file(filename, mode='w+')
+ tmpfile.write('passes/text.html')
+ tmpfile.close()
+ tests_run = get_tests_run(['--test-list=%s' % filename], tests_included=True, flatten_batches=True)
+ self.assertEquals(['passes/text.html'], tests_run)
+ os.remove(filename)
+ res, out, err, user = logging_run(['--test-list=%s' % filename],
+ tests_included=True)
+ self.assertEqual(res, -1)
+ self.assertFalse(err.empty())
+
+ def test_unexpected_failures(self):
+ # Run tests including the unexpected failures.
+ self._url_opened = None
+ res, out, err, user = logging_run(tests_included=True)
+ self.assertEqual(res, 1)
+ self.assertFalse(out.empty())
+ self.assertFalse(err.empty())
+ self.assertEqual(user.url, '/tmp/layout-test-results/results.html')
+
+ def test_results_directory_absolute(self):
+ # We run a configuration that should fail, to generate output, then
+ # look for what the output results url was.
+
+ tmpdir = tempfile.mkdtemp()
+ res, out, err, user = logging_run(['--results-directory=' + tmpdir],
+ tests_included=True)
+ self.assertEqual(user.url, os.path.join(tmpdir, 'results.html'))
+ shutil.rmtree(tmpdir, ignore_errors=True)
+
+ def test_results_directory_default(self):
+ # We run a configuration that should fail, to generate output, then
+ # look for what the output results url was.
+
+ # This is the default location.
+ res, out, err, user = logging_run(tests_included=True)
+ self.assertEqual(user.url, '/tmp/layout-test-results/results.html')
+
+ def test_results_directory_relative(self):
+ # We run a configuration that should fail, to generate output, then
+ # look for what the output results url was.
+
+ res, out, err, user = logging_run(['--results-directory=foo'],
+ tests_included=True)
+ self.assertEqual(user.url, '/tmp/foo/results.html')
+
+ def test_tolerance(self):
+ class ImageDiffTestPort(TestPort):
+ def diff_image(self, expected_contents, actual_contents,
+ diff_filename=None):
+ self.tolerance_used_for_diff_image = self._options.tolerance
+ return True
+
+ def get_port_for_run(args):
+ options, parsed_args = run_webkit_tests.parse_args(args)
+ test_port = ImageDiffTestPort(options=options, user=MockUser())
+ passing_run(args, port_obj=test_port, tests_included=True)
+ return test_port
+
+ base_args = ['--pixel-tests', 'failures/expected/*']
+
+ # If we pass in an explicit tolerance argument, then that will be used.
+ test_port = get_port_for_run(base_args + ['--tolerance', '.1'])
+ self.assertEqual(0.1, test_port.tolerance_used_for_diff_image)
+ test_port = get_port_for_run(base_args + ['--tolerance', '0'])
+ self.assertEqual(0, test_port.tolerance_used_for_diff_image)
+
+ # Otherwise the port's default tolerance behavior (including ignoring it)
+ # should be used.
+ test_port = get_port_for_run(base_args)
+ self.assertEqual(None, test_port.tolerance_used_for_diff_image)
+
+MainTest = skip_if(MainTest, sys.platform == 'cygwin' and compare_version(sys, '2.6')[0] < 0, 'new-run-webkit-tests tests hang on Cygwin Python 2.5.2')
+
+
+def _mocked_open(original_open, file_list):
+ def _wrapper(name, mode, encoding):
+ if name.find("-expected.") != -1 and mode.find("w") != -1:
+ # we don't want to actually write new baselines, so stub these out
+ name.replace('\\', '/')
+ file_list.append(name)
+ return original_open(os.devnull, mode, encoding)
+ return original_open(name, mode, encoding)
+ return _wrapper
+
+
+class RebaselineTest(unittest.TestCase):
+ def assertBaselines(self, file_list, file):
+ "assert that the file_list contains the baselines."""
+ for ext in [".txt", ".png", ".checksum"]:
+ baseline = file + "-expected" + ext
+ self.assertTrue(any(f.find(baseline) != -1 for f in file_list))
+
+ # FIXME: Add tests to ensure that we're *not* writing baselines when we're not
+ # supposed to be.
+
+ def disabled_test_reset_results(self):
+ # FIXME: This test is disabled until we can rewrite it to use a
+ # mock filesystem.
+ #
+ # Test that we update expectations in place. If the expectation
+ # is missing, update the expected generic location.
+ file_list = []
+ passing_run(['--pixel-tests',
+ '--reset-results',
+ 'passes/image.html',
+ 'failures/expected/missing_image.html'],
+ tests_included=True)
+ self.assertEqual(len(file_list), 6)
+ self.assertBaselines(file_list,
+ "data/passes/image")
+ self.assertBaselines(file_list,
+ "data/failures/expected/missing_image")
+
+ def disabled_test_new_baseline(self):
+ # FIXME: This test is disabled until we can rewrite it to use a
+ # mock filesystem.
+ #
+ # Test that we update the platform expectations. If the expectation
+ # is mssing, then create a new expectation in the platform dir.
+ file_list = []
+ original_open = codecs.open
+ try:
+ # Test that we update the platform expectations. If the expectation
+ # is mssing, then create a new expectation in the platform dir.
+ file_list = []
+ codecs.open = _mocked_open(original_open, file_list)
+ passing_run(['--pixel-tests',
+ '--new-baseline',
+ 'passes/image.html',
+ 'failures/expected/missing_image.html'],
+ tests_included=True)
+ self.assertEqual(len(file_list), 6)
+ self.assertBaselines(file_list,
+ "data/platform/test/passes/image")
+ self.assertBaselines(file_list,
+ "data/platform/test/failures/expected/missing_image")
+ finally:
+ codecs.open = original_open
+
+
+class TestRunnerWrapper(run_webkit_tests.TestRunner):
+ def _get_test_input_for_file(self, test_file):
+ return test_file
+
+
+class TestRunnerTest(unittest.TestCase):
+ def test_results_html(self):
+ mock_port = Mock()
+ mock_port.relative_test_filename = lambda name: name
+ mock_port.filename_to_uri = lambda name: name
+
+ runner = run_webkit_tests.TestRunner(port=mock_port, options=Mock(), printer=Mock())
+ expected_html = u"""<html>
+ <head>
+ <title>Layout Test Results (time)</title>
+ </head>
+ <body>
+ <h2>Title (time)</h2>
+ <p><a href='test_path'>test_path</a><br />
+</p>
+</body></html>
+"""
+ html = runner._results_html(["test_path"], {}, "Title", override_time="time")
+ self.assertEqual(html, expected_html)
+
+ def queue_to_list(self, queue):
+ queue_list = []
+ while(True):
+ try:
+ queue_list.append(queue.get_nowait())
+ except Queue.Empty:
+ break
+ return queue_list
+
+ def test_get_test_file_queue(self):
+ # Test that _get_test_file_queue in run_webkit_tests.TestRunner really
+ # put the http tests first in the queue.
+ runner = TestRunnerWrapper(port=Mock(), options=Mock(), printer=Mock())
+ runner._options.experimental_fully_parallel = False
+
+ test_list = [
+ "LayoutTests/websocket/tests/unicode.htm",
+ "LayoutTests/animations/keyframes.html",
+ "LayoutTests/http/tests/security/view-source-no-refresh.html",
+ "LayoutTests/websocket/tests/websocket-protocol-ignored.html",
+ "LayoutTests/fast/css/display-none-inline-style-change-crash.html",
+ "LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types.html",
+ "LayoutTests/dom/html/level2/html/HTMLAnchorElement03.html",
+ "LayoutTests/ietestcenter/Javascript/11.1.5_4-4-c-1.html",
+ "LayoutTests/dom/html/level2/html/HTMLAnchorElement06.html",
+ ]
+
+ expected_tests_to_http_lock = set([
+ 'LayoutTests/websocket/tests/unicode.htm',
+ 'LayoutTests/http/tests/security/view-source-no-refresh.html',
+ 'LayoutTests/websocket/tests/websocket-protocol-ignored.html',
+ 'LayoutTests/http/tests/xmlhttprequest/supported-xml-content-types.html',
+ ])
+
+ runner._options.child_processes = 1
+ test_queue_for_single_thread = runner._get_test_file_queue(test_list)
+ runner._options.child_processes = 2
+ test_queue_for_multi_thread = runner._get_test_file_queue(test_list)
+
+ single_thread_results = self.queue_to_list(test_queue_for_single_thread)
+ multi_thread_results = self.queue_to_list(test_queue_for_multi_thread)
+
+ self.assertEqual("tests_to_http_lock", single_thread_results[0][0])
+ self.assertEqual(expected_tests_to_http_lock, set(single_thread_results[0][1]))
+ self.assertEqual("tests_to_http_lock", multi_thread_results[0][0])
+ self.assertEqual(expected_tests_to_http_lock, set(multi_thread_results[0][1]))
+
+class DryrunTest(unittest.TestCase):
+ # FIXME: it's hard to know which platforms are safe to test; the
+ # chromium platforms require a chromium checkout, and the mac platform
+ # requires fcntl, so it can't be tested on win32, etc. There is
+ # probably a better way of handling this.
+ def test_darwin(self):
+ if sys.platform != "darwin":
+ return
+
+ self.assertTrue(passing_run(['--platform', 'test']))
+ self.assertTrue(passing_run(['--platform', 'dryrun',
+ 'fast/html']))
+ self.assertTrue(passing_run(['--platform', 'dryrun-mac',
+ 'fast/html']))
+
+ def test_test(self):
+ self.assertTrue(passing_run(['--platform', 'dryrun-test',
+ '--pixel-tests']))
+
+
+class TestThread(dump_render_tree_thread.WatchableThread):
+ def __init__(self, started_queue, stopping_queue):
+ dump_render_tree_thread.WatchableThread.__init__(self)
+ self._started_queue = started_queue
+ self._stopping_queue = stopping_queue
+ self._timeout = False
+ self._timeout_queue = Queue.Queue()
+
+ def run(self):
+ self._covered_run()
+
+ def _covered_run(self):
+ # FIXME: this is a separate routine to work around a bug
+ # in coverage: see http://bitbucket.org/ned/coveragepy/issue/85.
+ self._thread_id = thread.get_ident()
+ try:
+ self._started_queue.put('')
+ msg = self._stopping_queue.get()
+ if msg == 'KeyboardInterrupt':
+ raise KeyboardInterrupt
+ elif msg == 'Exception':
+ raise ValueError()
+ elif msg == 'Timeout':
+ self._timeout = True
+ self._timeout_queue.get()
+ except:
+ self._exception_info = sys.exc_info()
+
+ def next_timeout(self):
+ if self._timeout:
+ self._timeout_queue.put('done')
+ return time.time() - 10
+ return time.time()
+
+
+class TestHandler(logging.Handler):
+ def __init__(self, astream):
+ logging.Handler.__init__(self)
+ self._stream = astream
+
+ def emit(self, record):
+ self._stream.write(self.format(record))
+
+
+class WaitForThreadsToFinishTest(unittest.TestCase):
+ class MockTestRunner(run_webkit_tests.TestRunner):
+ def __init__(self):
+ pass
+
+ def __del__(self):
+ pass
+
+ def update_summary(self, result_summary):
+ pass
+
+ def run_one_thread(self, msg):
+ runner = self.MockTestRunner()
+ starting_queue = Queue.Queue()
+ stopping_queue = Queue.Queue()
+ child_thread = TestThread(starting_queue, stopping_queue)
+ child_thread.start()
+ started_msg = starting_queue.get()
+ stopping_queue.put(msg)
+ threads = [child_thread]
+ return runner._wait_for_threads_to_finish(threads, None)
+
+ def test_basic(self):
+ interrupted = self.run_one_thread('')
+ self.assertFalse(interrupted)
+
+ def test_interrupt(self):
+ interrupted = self.run_one_thread('KeyboardInterrupt')
+ self.assertTrue(interrupted)
+
+ def test_timeout(self):
+ oc = outputcapture.OutputCapture()
+ oc.capture_output()
+ interrupted = self.run_one_thread('Timeout')
+ self.assertFalse(interrupted)
+ oc.restore_output()
+
+ def test_exception(self):
+ self.assertRaises(ValueError, self.run_one_thread, 'Exception')
+
+
+class StandaloneFunctionsTest(unittest.TestCase):
+ def test_log_wedged_thread(self):
+ oc = outputcapture.OutputCapture()
+ oc.capture_output()
+ logger = run_webkit_tests._log
+ astream = array_stream.ArrayStream()
+ handler = TestHandler(astream)
+ logger.addHandler(handler)
+
+ starting_queue = Queue.Queue()
+ stopping_queue = Queue.Queue()
+ child_thread = TestThread(starting_queue, stopping_queue)
+ child_thread.start()
+ msg = starting_queue.get()
+
+ run_webkit_tests._log_wedged_thread(child_thread)
+ stopping_queue.put('')
+ child_thread.join(timeout=1.0)
+
+ self.assertFalse(astream.empty())
+ self.assertFalse(child_thread.isAlive())
+ oc.restore_output()
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
index 1df7ca3..41fe9bd 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/image_diff.py
@@ -34,164 +34,113 @@ match, returns FailureImageHashMismatch and outputs both hashes into the layout
test results directory.
"""
+from __future__ import with_statement
+
+import codecs
import errno
import logging
import os
import shutil
-from layout_package import test_failures
-from test_types import test_type_base
+from webkitpy.layout_tests.layout_package import test_failures
+from webkitpy.layout_tests.test_types import test_type_base
# Cache whether we have the image_diff executable available.
_compare_available = True
_compare_msg_printed = False
+_log = logging.getLogger("webkitpy.layout_tests.test_types.image_diff")
-class ImageDiff(test_type_base.TestTypeBase):
-
- def _copy_output_png(self, test_filename, source_image, extension):
- """Copies result files into the output directory with appropriate
- names.
-
- Args:
- test_filename: the test filename
- source_file: path to the image file (either actual or expected)
- extension: extension to indicate -actual.png or -expected.png
- """
- self._make_output_directory(test_filename)
- dest_image = self.output_filename(test_filename, extension)
- try:
- shutil.copyfile(source_image, dest_image)
- except IOError, e:
- # A missing expected PNG has already been recorded as an error.
- if errno.ENOENT != e.errno:
- raise
+class ImageDiff(test_type_base.TestTypeBase):
- def _save_baseline_files(self, filename, png_path, checksum):
+ def _save_baseline_files(self, filename, image, image_hash,
+ generate_new_baseline):
"""Saves new baselines for the PNG and checksum.
Args:
filename: test filename
- png_path: path to the actual PNG result file
- checksum: value of the actual checksum result
+ image: a image output
+ image_hash: a checksum of the image
+ generate_new_baseline: whether to generate a new, platform-specific
+ baseline, or update the existing one
"""
- png_file = open(png_path, "rb")
- png_data = png_file.read()
- png_file.close()
- self._save_baseline_data(filename, png_data, ".png")
- self._save_baseline_data(filename, checksum, ".checksum")
-
- def _create_image_diff(self, port, filename, target):
+ self._save_baseline_data(filename, image, ".png", encoding=None,
+ generate_new_baseline=generate_new_baseline)
+ self._save_baseline_data(filename, image_hash, ".checksum",
+ encoding="ascii",
+ generate_new_baseline=generate_new_baseline)
+
+ def _copy_image(self, filename, actual_image, expected_image):
+ self.write_output_files(filename, '.png',
+ output=actual_image, expected=expected_image,
+ encoding=None, print_text_diffs=False)
+
+ def _copy_image_hash(self, filename, actual_image_hash, expected_image_hash):
+ self.write_output_files(filename, '.checksum',
+ actual_image_hash, expected_image_hash,
+ encoding="ascii", print_text_diffs=False)
+
+ def _create_diff_image(self, port, filename, actual_image, expected_image):
"""Creates the visual diff of the expected/actual PNGs.
- Args:
- filename: the name of the test
- target: Debug or Release
+ Returns True if the images are different.
"""
diff_filename = self.output_filename(filename,
- self.FILENAME_SUFFIX_COMPARE)
- actual_filename = self.output_filename(filename,
- self.FILENAME_SUFFIX_ACTUAL + '.png')
- expected_filename = self.output_filename(filename,
- self.FILENAME_SUFFIX_EXPECTED + '.png')
-
- try:
- _compare_available = True
- result = port.diff_image(actual_filename, expected_filename,
- diff_filename)
- except ValueError:
- _compare_available = False
-
- global _compare_msg_printed
- if not _compare_available and not _compare_msg_printed:
- _compare_msg_printed = True
- print('image_diff not found. Make sure you have a ' + target +
- ' build of the image_diff executable.')
-
- return result
-
- def compare_output(self, port, filename, output, test_args, target):
+ self.FILENAME_SUFFIX_COMPARE)
+ return port.diff_image(actual_image, expected_image, diff_filename)
+
+ def compare_output(self, port, filename, test_args, actual_test_output,
+ expected_test_output):
"""Implementation of CompareOutput that checks the output image and
checksum against the expected files from the LayoutTest directory.
"""
failures = []
# If we didn't produce a hash file, this test must be text-only.
- if test_args.hash is None:
+ if actual_test_output.image_hash is None:
return failures
# If we're generating a new baseline, we pass.
- if test_args.new_baseline:
- self._save_baseline_files(filename, test_args.png_path,
- test_args.hash)
+ if test_args.new_baseline or test_args.reset_results:
+ self._save_baseline_files(filename, actual_test_output.image_hash,
+ actual_test_output.image,
+ test_args.new_baseline)
return failures
- # Compare hashes.
- expected_hash_file = self._port.expected_filename(filename,
- '.checksum')
- expected_png_file = self._port.expected_filename(filename, '.png')
-
- if test_args.show_sources:
- logging.debug('Using %s' % expected_hash_file)
- logging.debug('Using %s' % expected_png_file)
-
- try:
- expected_hash = open(expected_hash_file, "r").read()
- except IOError, e:
- if errno.ENOENT != e.errno:
- raise
- expected_hash = ''
-
-
- if not os.path.isfile(expected_png_file):
+ if not expected_test_output.image:
# Report a missing expected PNG file.
- self.write_output_files(port, filename, '', '.checksum',
- test_args.hash, expected_hash,
- diff=False, wdiff=False)
- self._copy_output_png(filename, test_args.png_path, '-actual.png')
- failures.append(test_failures.FailureMissingImage(self))
+ self._copy_image(filename, actual_test_output.image, expected_image=None)
+ self._copy_image_hash(filename, actual_test_output.image_hash,
+ expected_test_output.image_hash)
+ failures.append(test_failures.FailureMissingImage())
return failures
- elif test_args.hash == expected_hash:
- # Hash matched (no diff needed, okay to return).
+ if not expected_test_output.image_hash:
+ # Report a missing expected checksum file.
+ self._copy_image(filename, actual_test_output.image,
+ expected_test_output.image)
+ self._copy_image_hash(filename, actual_test_output.image_hash,
+ expected_image_hash=None)
+ failures.append(test_failures.FailureMissingImageHash())
return failures
+ if actual_test_output.image_hash == expected_test_output.image_hash:
+ # Hash matched (no diff needed, okay to return).
+ return failures
- self.write_output_files(port, filename, '', '.checksum',
- test_args.hash, expected_hash,
- diff=False, wdiff=False)
- self._copy_output_png(filename, test_args.png_path, '-actual.png')
- self._copy_output_png(filename, expected_png_file, '-expected.png')
+ self._copy_image(filename, actual_test_output.image,
+ expected_test_output.image)
+ self._copy_image_hash(filename, actual_test_output.image_hash,
+ expected_test_output.image_hash)
- # Even though we only use result in one codepath below but we
+ # Even though we only use the result in one codepath below but we
# still need to call CreateImageDiff for other codepaths.
- result = self._create_image_diff(port, filename, target)
- if expected_hash == '':
- failures.append(test_failures.FailureMissingImageHash(self))
- elif test_args.hash != expected_hash:
- # Hashes don't match, so see if the images match. If they do, then
- # the hash is wrong.
- if result == 0:
- failures.append(test_failures.FailureImageHashIncorrect(self))
- else:
- failures.append(test_failures.FailureImageHashMismatch(self))
+ images_are_different = self._create_diff_image(port, filename,
+ actual_test_output.image,
+ expected_test_output.image)
+ if not images_are_different:
+ failures.append(test_failures.FailureImageHashIncorrect())
+ else:
+ failures.append(test_failures.FailureImageHashMismatch())
return failures
-
- def diff_files(self, port, file1, file2):
- """Diff two image files.
-
- Args:
- file1, file2: full paths of the files to compare.
-
- Returns:
- True if two files are different.
- False otherwise.
- """
-
- try:
- result = port.diff_image(file1, file2)
- except ValueError, e:
- return True
-
- return result == 1
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
index efa2e8c..4b96b3a 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base.py
@@ -32,11 +32,16 @@
Also defines the TestArguments "struct" to pass them additional arguments.
"""
+from __future__ import with_statement
+
+import codecs
import cgi
import errno
import logging
import os.path
+_log = logging.getLogger("webkitpy.layout_tests.test_types.test_type_base")
+
class TestArguments(object):
"""Struct-like wrapper for additional arguments needed by
@@ -53,9 +58,6 @@ class TestArguments(object):
# Whether to use wdiff to generate by-word diffs.
wdiff = False
- # Whether to report the locations of the expected result files used.
- show_sources = False
-
# Python bug workaround. See the wdiff code in WriteOutputFiles for an
# explanation.
_wdiff_available = True
@@ -68,19 +70,18 @@ class TestTypeBase(object):
FILENAME_SUFFIX_EXPECTED = "-expected"
FILENAME_SUFFIX_DIFF = "-diff"
FILENAME_SUFFIX_WDIFF = "-wdiff.html"
+ FILENAME_SUFFIX_PRETTY_PATCH = "-pretty-diff.html"
FILENAME_SUFFIX_COMPARE = "-diff.png"
- def __init__(self, port, platform, root_output_dir):
+ def __init__(self, port, root_output_dir):
"""Initialize a TestTypeBase object.
Args:
- platform: the platform (e.g., 'chromium-mac-leopard')
- identifying the platform-specific results to be used.
+ port: object implementing port-specific information and methods
root_output_dir: The unix style path to the output dir.
"""
self._root_output_dir = root_output_dir
self._port = port
- self._platform = platform
def _make_output_directory(self, filename):
"""Creates the output directory (if needed) for a given test
@@ -89,8 +90,9 @@ class TestTypeBase(object):
self._port.relative_test_filename(filename))
self._port.maybe_make_directory(os.path.split(output_filename)[0])
- def _save_baseline_data(self, filename, data, modifier):
- """Saves a new baseline file into the platform directory.
+ def _save_baseline_data(self, filename, data, modifier, encoding,
+ generate_new_baseline=True):
+ """Saves a new baseline file into the port's baseline directory.
The file will be named simply "<test>-expected<modifier>", suitable for
use as the expected results in a later run.
@@ -99,18 +101,26 @@ class TestTypeBase(object):
filename: path to the test file
data: result to be saved as the new baseline
modifier: type of the result file, e.g. ".txt" or ".png"
+ encoding: file encoding (none, "utf-8", etc.)
+ generate_new_baseline: whether to enerate a new, platform-specific
+ baseline, or update the existing one
"""
- relative_dir = os.path.dirname(
- self._port.relative_test_filename(filename))
- output_dir = os.path.join(
- self._port.chromium_baseline_path(self._platform), relative_dir)
- output_file = os.path.basename(os.path.splitext(filename)[0] +
- self.FILENAME_SUFFIX_EXPECTED + modifier)
- self._port.maybe_make_directory(output_dir)
- output_path = os.path.join(output_dir, output_file)
- logging.debug('writing new baseline to "%s"' % (output_path))
- open(output_path, "wb").write(data)
+ if generate_new_baseline:
+ relative_dir = os.path.dirname(
+ self._port.relative_test_filename(filename))
+ baseline_path = self._port.baseline_path()
+ output_dir = os.path.join(baseline_path, relative_dir)
+ output_file = os.path.basename(os.path.splitext(filename)[0] +
+ self.FILENAME_SUFFIX_EXPECTED + modifier)
+ self._port.maybe_make_directory(output_dir)
+ output_path = os.path.join(output_dir, output_file)
+ _log.debug('writing new baseline result "%s"' % (output_path))
+ else:
+ output_path = self._port.expected_filename(filename, modifier)
+ _log.debug('resetting baseline result "%s"' % output_path)
+
+ self._port.update_baseline(output_path, data, encoding)
def output_filename(self, filename, modifier):
"""Returns a filename inside the output dir that contains modifier.
@@ -130,67 +140,84 @@ class TestTypeBase(object):
self._port.relative_test_filename(filename))
return os.path.splitext(output_filename)[0] + modifier
- def compare_output(self, port, filename, output, test_args, target):
+ def compare_output(self, port, filename, test_args, actual_test_output,
+ expected_test_output):
"""Method that compares the output from the test with the
expected value.
This is an abstract method to be implemented by all sub classes.
Args:
+ port: object implementing port-specific information and methods
filename: absolute filename to test file
- output: a string containing the output of the test
test_args: a TestArguments object holding optional additional
arguments
- target: Debug or Release
+ actual_test_output: a TestOutput object which represents actual test
+ output
+ expected_test_output: a TestOutput object which represents a expected
+ test output
Return:
a list of TestFailure objects, empty if the test passes
"""
- raise NotImplemented
-
- def write_output_files(self, port, filename, test_type, file_type,
- output, expected, diff=True, wdiff=False):
+ raise NotImplementedError
+
+ def _write_into_file_at_path(self, file_path, contents, encoding):
+ """This method assumes that byte_array is already encoded
+ into the right format."""
+ open_mode = 'w'
+ if encoding is None:
+ open_mode = 'w+b'
+ with codecs.open(file_path, open_mode, encoding=encoding) as file:
+ file.write(contents)
+
+ def write_output_files(self, filename, file_type,
+ output, expected, encoding,
+ print_text_diffs=False):
"""Writes the test output, the expected output and optionally the diff
between the two to files in the results directory.
The full output filename of the actual, for example, will be
- <filename><test_type>-actual<file_type>
+ <filename>-actual<file_type>
For instance,
- my_test-simp-actual.txt
+ my_test-actual.txt
Args:
filename: The test filename
- test_type: A string describing the test type, e.g. "simp"
file_type: A string describing the test output file type, e.g. ".txt"
output: A string containing the test output
expected: A string containing the expected test output
- diff: if True, write a file containing the diffs too. This should be
- False for results that are not text
- wdiff: if True, write an HTML file containing word-by-word diffs
+ print_text_diffs: True for text diffs. (FIXME: We should be able to get this from the file type?)
"""
self._make_output_directory(filename)
- actual_filename = self.output_filename(filename,
- test_type + self.FILENAME_SUFFIX_ACTUAL + file_type)
- expected_filename = self.output_filename(filename,
- test_type + self.FILENAME_SUFFIX_EXPECTED + file_type)
+ actual_filename = self.output_filename(filename, self.FILENAME_SUFFIX_ACTUAL + file_type)
+ expected_filename = self.output_filename(filename, self.FILENAME_SUFFIX_EXPECTED + file_type)
+ # FIXME: This function is poorly designed. We should be passing in some sort of
+ # encoding information from the callers.
if output:
- open(actual_filename, "wb").write(output)
+ self._write_into_file_at_path(actual_filename, output, encoding)
if expected:
- open(expected_filename, "wb").write(expected)
+ self._write_into_file_at_path(expected_filename, expected, encoding)
if not output or not expected:
return
- if diff:
- diff = port.diff_text(expected, output, expected_filename,
- actual_filename)
- diff_filename = self.output_filename(filename,
- test_type + self.FILENAME_SUFFIX_DIFF + file_type)
- open(diff_filename, "wb").write(diff)
-
- if wdiff:
- # Shell out to wdiff to get colored inline diffs.
- wdiff = port.wdiff_text(expected_filename, actual_filename)
- filename = self.output_filename(filename, test_type +
- self.FILENAME_SUFFIX_WDIFF)
- out = open(filename, 'wb').write(wdiff)
+ if not print_text_diffs:
+ return
+
+ # Note: We pass encoding=None for all diff writes, as we treat diff
+ # output as binary. Diff output may contain multiple files in
+ # conflicting encodings.
+ diff = self._port.diff_text(expected, output, expected_filename, actual_filename)
+ diff_filename = self.output_filename(filename, self.FILENAME_SUFFIX_DIFF + file_type)
+ self._write_into_file_at_path(diff_filename, diff, encoding=None)
+
+ # Shell out to wdiff to get colored inline diffs.
+ wdiff = self._port.wdiff_text(expected_filename, actual_filename)
+ wdiff_filename = self.output_filename(filename, self.FILENAME_SUFFIX_WDIFF)
+ self._write_into_file_at_path(wdiff_filename, wdiff, encoding=None)
+
+ # Use WebKit's PrettyPatch.rb to get an HTML diff.
+ pretty_patch = self._port.pretty_patch_text(diff_filename)
+ pretty_patch_filename = self.output_filename(filename, self.FILENAME_SUFFIX_PRETTY_PATCH)
+ self._write_into_file_at_path(pretty_patch_filename, pretty_patch, encoding=None)
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py
new file mode 100644
index 0000000..5dbfcb6
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/test_type_base_unittest.py
@@ -0,0 +1,47 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+""""Tests stray tests not covered by regular code paths."""
+
+import test_type_base
+import unittest
+
+from webkitpy.thirdparty.mock import Mock
+
+
+class Test(unittest.TestCase):
+
+ def test_compare_output_notimplemented(self):
+ test_type = test_type_base.TestTypeBase(None, None)
+ self.assertRaises(NotImplementedError, test_type.compare_output,
+ None, "foo.txt", '',
+ test_type_base.TestArguments(), 'Debug')
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
index 54b332b..66e42ba 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/test_types/text_diff.py
@@ -33,89 +33,58 @@ If the output doesn't match, returns FailureTextMismatch and outputs the diff
files into the layout test results directory.
"""
+from __future__ import with_statement
+
+import codecs
import errno
import logging
import os.path
-from layout_package import test_failures
-from test_types import test_type_base
-
+from webkitpy.layout_tests.layout_package import test_failures
+from webkitpy.layout_tests.test_types import test_type_base
-def is_render_tree_dump(data):
- """Returns true if data appears to be a render tree dump as opposed to a
- plain text dump."""
- return data.find("RenderView at (0,0)") != -1
+_log = logging.getLogger("webkitpy.layout_tests.test_types.text_diff")
class TestTextDiff(test_type_base.TestTypeBase):
- def get_normalized_output_text(self, output):
+ def _get_normalized_output_text(self, output):
# Some tests produce "\r\n" explicitly. Our system (Python/Cygwin)
# helpfully changes the "\n" to "\r\n", resulting in "\r\r\n".
norm = output.replace("\r\r\n", "\r\n").strip("\r\n").replace(
"\r\n", "\n")
return norm + "\n"
- def get_normalized_expected_text(self, filename, show_sources):
- """Given the filename of the test, read the expected output from a file
- and normalize the text. Returns a string with the expected text, or ''
- if the expected output file was not found."""
- # Read the port-specific expected text.
- expected_filename = self._port.expected_filename(filename, '.txt')
- if show_sources:
- logging.debug('Using %s' % expected_filename)
-
- return self.get_normalized_text(expected_filename)
-
- def get_normalized_text(self, filename):
- try:
- text = open(filename).read()
- except IOError, e:
- if errno.ENOENT != e.errno:
- raise
- return ''
-
- # Normalize line endings
- return text.strip("\r\n").replace("\r\n", "\n") + "\n"
-
- def compare_output(self, port, filename, output, test_args, target):
+ def compare_output(self, port, filename, test_args, actual_test_output,
+ expected_test_output):
"""Implementation of CompareOutput that checks the output text against
the expected text from the LayoutTest directory."""
failures = []
# If we're generating a new baseline, we pass.
- if test_args.new_baseline:
- self._save_baseline_data(filename, output, ".txt")
+ if test_args.new_baseline or test_args.reset_results:
+ # Although all test_shell/DumpRenderTree output should be utf-8,
+ # we do not ever decode it inside run-webkit-tests. For some tests
+ # DumpRenderTree may not output utf-8 text (e.g. webarchives).
+ self._save_baseline_data(filename, output, ".txt", encoding=None,
+ generate_new_baseline=test_args.new_baseline)
return failures
# Normalize text to diff
- output = self.get_normalized_output_text(output)
- expected = self.get_normalized_expected_text(filename,
- test_args.show_sources)
+ actual_text = self._get_normalized_output_text(actual_test_output.text)
+ # Assuming expected_text is already normalized.
+ expected_text = expected_test_output.text
# Write output files for new tests, too.
- if port.compare_text(output, expected):
+ if port.compare_text(actual_text, expected_text):
# Text doesn't match, write output files.
- self.write_output_files(port, filename, "", ".txt", output,
- expected, diff=True, wdiff=True)
+ self.write_output_files(filename, ".txt", actual_text,
+ expected_text, encoding=None,
+ print_text_diffs=True)
- if expected == '':
- failures.append(test_failures.FailureMissingResult(self))
+ if expected_text == '':
+ failures.append(test_failures.FailureMissingResult())
else:
- failures.append(test_failures.FailureTextMismatch(self, True))
+ failures.append(test_failures.FailureTextMismatch())
return failures
-
- def diff_files(self, port, file1, file2):
- """Diff two text files.
-
- Args:
- file1, file2: full paths of the files to compare.
-
- Returns:
- True if two files are different.
- False otherwise.
- """
-
- return port.compare_text(self.get_normalized_text(file1),
- self.get_normalized_text(file2))
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py b/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py
new file mode 100755
index 0000000..f4c8098
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests.py
@@ -0,0 +1,160 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 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 COMPUTER, 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 COMPUTER, 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.
+
+from __future__ import with_statement
+
+import glob
+import logging
+import optparse
+import os
+import re
+import sys
+import webkitpy.common.checkout.scm as scm
+
+_log = logging.getLogger("webkitpy.layout_tests."
+ "update-webgl-conformance-tests")
+
+
+def remove_first_line_comment(text):
+ return re.compile(r'^<!--.*?-->\s*', re.DOTALL).sub('', text)
+
+
+def translate_includes(text):
+ # Mapping of single filename to relative path under WebKit root.
+ # Assumption: these filenames are globally unique.
+ include_mapping = {
+ "js-test-style.css": "../../js/resources",
+ "js-test-pre.js": "../../js/resources",
+ "js-test-post.js": "../../js/resources",
+ "desktop-gl-constants.js": "resources",
+ }
+
+ for filename, path in include_mapping.items():
+ search = r'(?:[^"\'= ]*/)?' + re.escape(filename)
+ replace = os.path.join(path, filename)
+ text = re.sub(search, replace, text)
+
+ return text
+
+
+def translate_khronos_test(text):
+ """
+ This method translates the contents of a Khronos test to a WebKit test.
+ """
+
+ translateFuncs = [
+ remove_first_line_comment,
+ translate_includes,
+ ]
+
+ for f in translateFuncs:
+ text = f(text)
+
+ return text
+
+
+def update_file(in_filename, out_dir):
+ # check in_filename exists
+ # check out_dir exists
+ out_filename = os.path.join(out_dir, os.path.basename(in_filename))
+
+ _log.debug("Processing " + in_filename)
+ with open(in_filename, 'r') as in_file:
+ with open(out_filename, 'w') as out_file:
+ out_file.write(translate_khronos_test(in_file.read()))
+
+
+def update_directory(in_dir, out_dir):
+ for filename in glob.glob(os.path.join(in_dir, '*.html')):
+ update_file(os.path.join(in_dir, filename), out_dir)
+
+
+def default_out_dir():
+ current_scm = scm.detect_scm_system(os.path.dirname(sys.argv[0]))
+ if not current_scm:
+ return os.getcwd()
+ root_dir = current_scm.checkout_root
+ if not root_dir:
+ return os.getcwd()
+ out_dir = os.path.join(root_dir, "LayoutTests/fast/canvas/webgl")
+ if os.path.isdir(out_dir):
+ return out_dir
+ return os.getcwd()
+
+
+def configure_logging(options):
+ """Configures the logging system."""
+ log_fmt = '%(levelname)s: %(message)s'
+ log_datefmt = '%y%m%d %H:%M:%S'
+ log_level = logging.INFO
+ if options.verbose:
+ log_fmt = ('%(asctime)s %(filename)s:%(lineno)-4d %(levelname)s '
+ '%(message)s')
+ log_level = logging.DEBUG
+ logging.basicConfig(level=log_level, format=log_fmt,
+ datefmt=log_datefmt)
+
+
+def option_parser():
+ usage = "usage: %prog [options] (input file or directory)"
+ parser = optparse.OptionParser(usage=usage)
+ parser.add_option('-v', '--verbose',
+ action='store_true',
+ default=False,
+ help='include debug-level logging')
+ parser.add_option('-o', '--output',
+ action='store',
+ type='string',
+ default=default_out_dir(),
+ metavar='DIR',
+ help='specify an output directory to place files '
+ 'in [default: %default]')
+ return parser
+
+
+def main():
+ parser = option_parser()
+ (options, args) = parser.parse_args()
+ configure_logging(options)
+
+ if len(args) == 0:
+ _log.error("Must specify an input directory or filename.")
+ parser.print_help()
+ return 1
+
+ in_name = args[0]
+ if os.path.isfile(in_name):
+ update_file(in_name, options.output)
+ elif os.path.isdir(in_name):
+ update_directory(in_name, options.output)
+ else:
+ _log.error("'%s' is not a directory or a file.", in_name)
+ return 2
+
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py b/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py
new file mode 100644
index 0000000..7393b70
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/update_webgl_conformance_tests_unittest.py
@@ -0,0 +1,102 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for update_webgl_conformance_tests."""
+
+import unittest
+from webkitpy.layout_tests import update_webgl_conformance_tests as webgl
+
+
+def construct_script(name):
+ return "<script src=\"" + name + "\"></script>\n"
+
+
+def construct_style(name):
+ return "<link rel=\"stylesheet\" href=\"" + name + "\">"
+
+
+class TestTranslation(unittest.TestCase):
+ def assert_unchanged(self, text):
+ self.assertEqual(text, webgl.translate_khronos_test(text))
+
+ def assert_translate(self, input, output):
+ self.assertEqual(output, webgl.translate_khronos_test(input))
+
+ def test_simple_unchanged(self):
+ self.assert_unchanged("")
+ self.assert_unchanged("<html></html>")
+
+ def test_header_strip(self):
+ single_line_header = "<!-- single line header. -->"
+ multi_line_header = """<!-- this is a multi-line
+ header. it should all be removed too.
+ -->"""
+ text = "<html></html>"
+ self.assert_translate(single_line_header, "")
+ self.assert_translate(single_line_header + text, text)
+ self.assert_translate(multi_line_header + text, text)
+
+ def dont_strip_other_headers(self):
+ self.assert_unchanged("<html>\n<!-- don't remove comments on other lines. -->\n</html>")
+
+ def test_include_rewriting(self):
+ # Mappings to None are unchanged
+ styles = {
+ "../resources/js-test-style.css": "../../js/resources/js-test-style.css",
+ "fail.css": None,
+ "resources/stylesheet.css": None,
+ "../resources/style.css": None,
+ }
+ scripts = {
+ "../resources/js-test-pre.js": "../../js/resources/js-test-pre.js",
+ "../resources/js-test-post.js": "../../js/resources/js-test-post.js",
+ "../resources/desktop-gl-constants.js": "resources/desktop-gl-constants.js",
+
+ "resources/shadow-offset.js": None,
+ "../resources/js-test-post-async.js": None,
+ }
+
+ input_text = ""
+ output_text = ""
+ for input, output in styles.items():
+ input_text += construct_style(input)
+ output_text += construct_style(output if output else input)
+ for input, output in scripts.items():
+ input_text += construct_script(input)
+ output_text += construct_script(output if output else input)
+
+ head = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">\n<html>\n<head>\n'
+ foot = '</head>\n<body>\n</body>\n</html>'
+ input_text = head + input_text + foot
+ output_text = head + output_text + foot
+ self.assert_translate(input_text, output_text)
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/mock.pyc b/WebKitTools/Scripts/webkitpy/mock.pyc
deleted file mode 100644
index c39d3f4..0000000
--- a/WebKitTools/Scripts/webkitpy/mock.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py b/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py
deleted file mode 100644
index f522e40..0000000
--- a/WebKitTools/Scripts/webkitpy/mock_bugzillatool.py
+++ /dev/null
@@ -1,368 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-
-from webkitpy.bugzilla import Bug, Attachment
-from webkitpy.committers import CommitterList, Reviewer
-from webkitpy.mock import Mock
-from webkitpy.scm import CommitMessage
-from webkitpy.webkit_logging import log
-
-
-def _id_to_object_dictionary(*objects):
- dictionary = {}
- for thing in objects:
- dictionary[thing["id"]] = thing
- return dictionary
-
-
-# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
-
-
-_patch1 = {
- "id": 197,
- "bug_id": 42,
- "url": "http://example.com/197",
- "is_obsolete": False,
- "is_patch": True,
- "review": "+",
- "reviewer_email": "foo@bar.com",
- "commit-queue": "+",
- "committer_email": "foo@bar.com",
- "attacher_email": "Contributer1",
-}
-
-
-_patch2 = {
- "id": 128,
- "bug_id": 42,
- "url": "http://example.com/128",
- "is_obsolete": False,
- "is_patch": True,
- "review": "+",
- "reviewer_email": "foo@bar.com",
- "commit-queue": "+",
- "committer_email": "non-committer@example.com",
- "attacher_email": "eric@webkit.org",
-}
-
-
-_patch3 = {
- "id": 103,
- "bug_id": 75,
- "url": "http://example.com/103",
- "is_obsolete": False,
- "is_patch": True,
- "review": "?",
- "attacher_email": "eric@webkit.org",
-}
-
-
-_patch4 = {
- "id": 104,
- "bug_id": 77,
- "url": "http://example.com/103",
- "is_obsolete": False,
- "is_patch": True,
- "review": "+",
- "commit-queue": "?",
- "reviewer_email": "foo@bar.com",
- "attacher_email": "Contributer2",
-}
-
-
-_patch5 = {
- "id": 105,
- "bug_id": 77,
- "url": "http://example.com/103",
- "is_obsolete": False,
- "is_patch": True,
- "review": "+",
- "reviewer_email": "foo@bar.com",
- "attacher_email": "eric@webkit.org",
-}
-
-
-_patch6 = { # Valid committer, but no reviewer.
- "id": 106,
- "bug_id": 77,
- "url": "http://example.com/103",
- "is_obsolete": False,
- "is_patch": True,
- "commit-queue": "+",
- "committer_email": "foo@bar.com",
- "attacher_email": "eric@webkit.org",
-}
-
-
-_patch7 = { # Valid review, patch is marked obsolete.
- "id": 107,
- "bug_id": 76,
- "url": "http://example.com/103",
- "is_obsolete": True,
- "is_patch": True,
- "review": "+",
- "reviewer_email": "foo@bar.com",
- "attacher_email": "eric@webkit.org",
-}
-
-
-# This must be defined before we define the bugs, thus we don't use
-# MockBugzilla.unassigned_email directly.
-_unassigned_email = "unassigned@example.com"
-
-
-# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
-
-
-_bug1 = {
- "id": 42,
- "title": "Bug with two r+'d and cq+'d patches, one of which has an "
- "invalid commit-queue setter.",
- "assigned_to_email": _unassigned_email,
- "attachments": [_patch1, _patch2],
-}
-
-
-_bug2 = {
- "id": 75,
- "title": "Bug with a patch needing review.",
- "assigned_to_email": "foo@foo.com",
- "attachments": [_patch3],
-}
-
-
-_bug3 = {
- "id": 76,
- "title": "The third bug",
- "assigned_to_email": _unassigned_email,
- "attachments": [_patch7],
-}
-
-
-_bug4 = {
- "id": 77,
- "title": "The fourth bug",
- "assigned_to_email": "foo@foo.com",
- "attachments": [_patch4, _patch5, _patch6],
-}
-
-
-class MockBugzillaQueries(Mock):
-
- def __init__(self, bugzilla):
- Mock.__init__(self)
- self._bugzilla = bugzilla
-
- def _all_bugs(self):
- return map(lambda bug_dictionary: Bug(bug_dictionary, self._bugzilla),
- self._bugzilla.bug_cache.values())
-
- def fetch_bug_ids_from_commit_queue(self):
- bugs_with_commit_queued_patches = filter(
- lambda bug: bug.commit_queued_patches(),
- self._all_bugs())
- return map(lambda bug: bug.id(), bugs_with_commit_queued_patches)
-
- def fetch_attachment_ids_from_review_queue(self):
- unreviewed_patches = sum([bug.unreviewed_patches()
- for bug in self._all_bugs()], [])
- return map(lambda patch: patch.id(), unreviewed_patches)
-
- def fetch_patches_from_commit_queue(self):
- return sum([bug.commit_queued_patches()
- for bug in self._all_bugs()], [])
-
- def fetch_bug_ids_from_pending_commit_list(self):
- bugs_with_reviewed_patches = filter(lambda bug: bug.reviewed_patches(),
- self._all_bugs())
- bug_ids = map(lambda bug: bug.id(), bugs_with_reviewed_patches)
- # NOTE: This manual hack here is to allow testing logging in
- # test_assign_to_committer the real pending-commit query on bugzilla
- # will return bugs with patches which have r+, but are also obsolete.
- return bug_ids + [76]
-
- def fetch_patches_from_pending_commit_list(self):
- return sum([bug.reviewed_patches() for bug in self._all_bugs()], [])
-
-
-# FIXME: Bugzilla is the wrong Mock-point. Once we have a BugzillaNetwork
-# class we should mock that instead.
-# Most of this class is just copy/paste from Bugzilla.
-
-
-class MockBugzilla(Mock):
-
- bug_server_url = "http://example.com"
-
- unassigned_email = _unassigned_email
-
- bug_cache = _id_to_object_dictionary(_bug1, _bug2, _bug3, _bug4)
-
- attachment_cache = _id_to_object_dictionary(_patch1,
- _patch2,
- _patch3,
- _patch4,
- _patch5,
- _patch6,
- _patch7)
-
- def __init__(self):
- Mock.__init__(self)
- self.queries = MockBugzillaQueries(self)
- self.committers = CommitterList(reviewers=[Reviewer("Foo Bar",
- "foo@bar.com")])
-
- def fetch_bug(self, bug_id):
- return Bug(self.bug_cache.get(bug_id), self)
-
- def fetch_attachment(self, attachment_id):
- # This could be changed to .get() if we wish to allow failed lookups.
- attachment_dictionary = self.attachment_cache[attachment_id]
- bug = self.fetch_bug(attachment_dictionary["bug_id"])
- for attachment in bug.attachments(include_obsolete=True):
- if attachment.id() == int(attachment_id):
- return attachment
-
- def bug_url_for_bug_id(self, bug_id):
- return "%s/%s" % (self.bug_server_url, bug_id)
-
- def fetch_bug_dictionary(self, bug_id):
- return self.bug_cache.get(bug_id)
-
- def attachment_url_for_id(self, attachment_id, action="view"):
- action_param = ""
- if action and action != "view":
- action_param = "&action=%s" % action
- return "%s/%s%s" % (self.bug_server_url, attachment_id, action_param)
-
-
-class MockBuildBot(Mock):
-
- def builder_statuses(self):
- return [{
- "name": "Builder1",
- "is_green": True,
- }, {
- "name": "Builder2",
- "is_green": True,
- }]
-
- def red_core_builders_names(self):
- return []
-
-
-class MockSCM(Mock):
-
- def __init__(self):
- Mock.__init__(self)
- self.checkout_root = os.getcwd()
-
- def create_patch(self):
- return "Patch1"
-
- def commit_ids_from_commitish_arguments(self, args):
- return ["Commitish1", "Commitish2"]
-
- def commit_message_for_local_commit(self, commit_id):
- if commit_id == "Commitish1":
- return CommitMessage("CommitMessage1\n" \
- "https://bugs.example.org/show_bug.cgi?id=42\n")
- if commit_id == "Commitish2":
- return CommitMessage("CommitMessage2\n" \
- "https://bugs.example.org/show_bug.cgi?id=75\n")
- raise Exception("Bogus commit_id in commit_message_for_local_commit.")
-
- def create_patch_from_local_commit(self, commit_id):
- if commit_id == "Commitish1":
- return "Patch1"
- if commit_id == "Commitish2":
- return "Patch2"
- raise Exception("Bogus commit_id in commit_message_for_local_commit.")
-
- def diff_for_revision(self, revision):
- return "DiffForRevision%s\n" \
- "http://bugs.webkit.org/show_bug.cgi?id=12345" % revision
-
- def svn_revision_from_commit_text(self, commit_text):
- return "49824"
-
- def modified_changelogs(self):
- # Ideally we'd return something more interesting here. The problem is
- # that LandDiff will try to actually read the path from disk!
- return []
-
-
-class MockUser(object):
-
- @staticmethod
- def prompt(message, repeat=1, raw_input=raw_input):
- return "Mock user response"
-
- def edit(self, files):
- pass
-
- def page(self, message):
- pass
-
- def confirm(self, message=None):
- return True
-
- def open_url(self, url):
- log("MOCK: user.open_url: %s" % url)
- pass
-
-
-class MockStatusServer(object):
-
- def __init__(self):
- self.host = "example.com"
-
- def patch_status(self, queue_name, patch_id):
- return None
-
- def update_status(self, queue_name, status, patch=None, results_file=None):
- return 187
-
-
-class MockBugzillaTool():
-
- def __init__(self):
- self.bugs = MockBugzilla()
- self.buildbot = MockBuildBot()
- self.executive = Mock()
- self.user = MockUser()
- self._scm = MockSCM()
- self.status_server = MockStatusServer()
-
- def scm(self):
- return self._scm
-
- def path(self):
- return "echo"
diff --git a/WebKitTools/Scripts/webkitpy/multicommandtool.pyc b/WebKitTools/Scripts/webkitpy/multicommandtool.pyc
deleted file mode 100644
index 4584643..0000000
--- a/WebKitTools/Scripts/webkitpy/multicommandtool.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/networktransaction.pyc b/WebKitTools/Scripts/webkitpy/networktransaction.pyc
deleted file mode 100644
index fb45bcb..0000000
--- a/WebKitTools/Scripts/webkitpy/networktransaction.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/patchcollection.py b/WebKitTools/Scripts/webkitpy/patchcollection.py
deleted file mode 100644
index 7e8603c..0000000
--- a/WebKitTools/Scripts/webkitpy/patchcollection.py
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-class PersistentPatchCollectionDelegate:
- def collection_name(self):
- raise NotImplementedError, "subclasses must implement"
-
- def fetch_potential_patch_ids(self):
- raise NotImplementedError, "subclasses must implement"
-
- def status_server(self):
- raise NotImplementedError, "subclasses must implement"
-
- def is_terminal_status(self, status):
- raise NotImplementedError, "subclasses must implement"
-
-
-class PersistentPatchCollection:
- def __init__(self, delegate):
- self._delegate = delegate
- self._name = self._delegate.collection_name()
- self._status = self._delegate.status_server()
- self._status_cache = {}
-
- def _cached_status(self, patch_id):
- cached = self._status_cache.get(patch_id)
- if cached:
- return cached
- status = self._status.patch_status(self._name, patch_id)
- if status and self._delegate.is_terminal_status(status):
- self._status_cache[patch_id] = status
- return status
-
- def next(self):
- patch_ids = self._delegate.fetch_potential_patch_ids()
- for patch_id in patch_ids:
- status = self._cached_status(patch_id)
- if not status or not self._delegate.is_terminal_status(status):
- return patch_id
diff --git a/WebKitTools/Scripts/webkitpy/patchcollection.pyc b/WebKitTools/Scripts/webkitpy/patchcollection.pyc
deleted file mode 100644
index 18058d3..0000000
--- a/WebKitTools/Scripts/webkitpy/patchcollection.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/python24/__init__.py b/WebKitTools/Scripts/webkitpy/python24/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/python24/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/python24/versioning.py b/WebKitTools/Scripts/webkitpy/python24/versioning.py
new file mode 100644
index 0000000..8b1f21b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/python24/versioning.py
@@ -0,0 +1,133 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Supports Python version checking."""
+
+import logging
+import sys
+
+_log = logging.getLogger("webkitpy.python24.versioning")
+
+# The minimum Python version the webkitpy package supports.
+_MINIMUM_SUPPORTED_PYTHON_VERSION = "2.5"
+
+
+def compare_version(sysmodule=None, target_version=None):
+ """Compare the current Python version with a target version.
+
+ Args:
+ sysmodule: An object with version and version_info data attributes
+ used to detect the current Python version. The attributes
+ should have the same semantics as sys.version and
+ sys.version_info. This parameter should only be used
+ for unit testing. Defaults to sys.
+ target_version: A string representing the Python version to compare
+ the current version against. The string should have
+ one of the following three forms: 2, 2.5, or 2.5.3.
+ Defaults to the minimum version that the webkitpy
+ package supports.
+
+ Returns:
+ A triple of (comparison, current_version, target_version).
+
+ comparison: An integer representing the result of comparing the
+ current version with the target version. A positive
+ number means the current version is greater than the
+ target, 0 means they are the same, and a negative number
+ means the current version is less than the target.
+ This method compares version information only up
+ to the precision of the given target version. For
+ example, if the target version is 2.6 and the current
+ version is 2.5.3, this method uses 2.5 for the purposes
+ of comparing with the target.
+ current_version: A string representing the current Python version, for
+ example 2.5.3.
+ target_version: A string representing the version that the current
+ version was compared against, for example 2.5.
+
+ """
+ if sysmodule is None:
+ sysmodule = sys
+ if target_version is None:
+ target_version = _MINIMUM_SUPPORTED_PYTHON_VERSION
+
+ # The number of version parts to compare.
+ precision = len(target_version.split("."))
+
+ # We use sys.version_info rather than sys.version since its first
+ # three elements are guaranteed to be integers.
+ current_version_info_to_compare = sysmodule.version_info[:precision]
+ # Convert integers to strings.
+ current_version_info_to_compare = map(str, current_version_info_to_compare)
+ current_version_to_compare = ".".join(current_version_info_to_compare)
+
+ # Compare version strings lexicographically.
+ if current_version_to_compare > target_version:
+ comparison = 1
+ elif current_version_to_compare == target_version:
+ comparison = 0
+ else:
+ comparison = -1
+
+ # The version number portion of the current version string, for
+ # example "2.6.4".
+ current_version = sysmodule.version.split()[0]
+
+ return (comparison, current_version, target_version)
+
+
+# FIXME: Add a logging level parameter to allow the version message
+# to be logged at levels other than WARNING, for example CRITICAL.
+def check_version(log=None, sysmodule=None, target_version=None):
+ """Check the current Python version against a target version.
+
+ Logs a warning message if the current version is less than the
+ target version.
+
+ Args:
+ log: A logging.logger instance to use when logging the version warning.
+ Defaults to the logger of this module.
+ sysmodule: See the compare_version() docstring.
+ target_version: See the compare_version() docstring.
+
+ Returns:
+ A boolean value of whether the current version is greater than
+ or equal to the target version.
+
+ """
+ if log is None:
+ log = _log
+
+ (comparison, current_version, target_version) = \
+ compare_version(sysmodule, target_version)
+
+ if comparison >= 0:
+ # Then the current version is at least the minimum version.
+ return True
+
+ message = ("WebKit Python scripts do not support your current Python "
+ "version (%s). The minimum supported version is %s.\n"
+ " See the following page to upgrade your Python version:\n\n"
+ " http://trac.webkit.org/wiki/PythonGuidelines\n"
+ % (current_version, target_version))
+ log.warn(message)
+ return False
diff --git a/WebKitTools/Scripts/webkitpy/python24/versioning_unittest.py b/WebKitTools/Scripts/webkitpy/python24/versioning_unittest.py
new file mode 100644
index 0000000..6939e2d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/python24/versioning_unittest.py
@@ -0,0 +1,134 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Contains unit tests for versioning.py."""
+
+import logging
+import unittest
+
+from webkitpy.common.system.logtesting import LogTesting
+from webkitpy.python24.versioning import check_version
+from webkitpy.python24.versioning import compare_version
+
+class MockSys(object):
+
+ """A mock sys module for passing to version-checking methods."""
+
+ def __init__(self, current_version):
+ """Create an instance.
+
+ current_version: A version string with major, minor, and micro
+ version parts.
+
+ """
+ version_info = current_version.split(".")
+ version_info = map(int, version_info)
+
+ self.version = current_version + " Version details."
+ self.version_info = version_info
+
+
+class CompareVersionTest(unittest.TestCase):
+
+ """Tests compare_version()."""
+
+ def _mock_sys(self, current_version):
+ return MockSys(current_version)
+
+ def test_default_minimum_version(self):
+ """Test the configured minimum version that webkitpy supports."""
+ (comparison, current_version, min_version) = compare_version()
+ self.assertEquals(min_version, "2.5")
+
+ def compare_version(self, target_version, current_version=None):
+ """Call compare_version()."""
+ if current_version is None:
+ current_version = "2.5.3"
+ mock_sys = self._mock_sys(current_version)
+ return compare_version(mock_sys, target_version)
+
+ def compare(self, target_version, current_version=None):
+ """Call compare_version(), and return the comparison."""
+ return self.compare_version(target_version, current_version)[0]
+
+ def test_returned_current_version(self):
+ """Test the current_version return value."""
+ current_version = self.compare_version("2.5")[1]
+ self.assertEquals(current_version, "2.5.3")
+
+ def test_returned_target_version(self):
+ """Test the current_version return value."""
+ target_version = self.compare_version("2.5")[2]
+ self.assertEquals(target_version, "2.5")
+
+ def test_target_version_major(self):
+ """Test major version for target."""
+ self.assertEquals(-1, self.compare("3"))
+ self.assertEquals(0, self.compare("2"))
+ self.assertEquals(1, self.compare("2", "3.0.0"))
+
+ def test_target_version_minor(self):
+ """Test minor version for target."""
+ self.assertEquals(-1, self.compare("2.6"))
+ self.assertEquals(0, self.compare("2.5"))
+ self.assertEquals(1, self.compare("2.4"))
+
+ def test_target_version_micro(self):
+ """Test minor version for target."""
+ self.assertEquals(-1, self.compare("2.5.4"))
+ self.assertEquals(0, self.compare("2.5.3"))
+ self.assertEquals(1, self.compare("2.5.2"))
+
+
+class CheckVersionTest(unittest.TestCase):
+
+ """Tests check_version()."""
+
+ def setUp(self):
+ self._log = LogTesting.setUp(self)
+
+ def tearDown(self):
+ self._log.tearDown()
+
+ def _check_version(self, minimum_version):
+ """Call check_version()."""
+ mock_sys = MockSys("2.5.3")
+ return check_version(sysmodule=mock_sys, target_version=minimum_version)
+
+ def test_true_return_value(self):
+ """Test the configured minimum version that webkitpy supports."""
+ is_current = self._check_version("2.4")
+ self.assertEquals(True, is_current)
+ self._log.assertMessages([]) # No warning was logged.
+
+ def test_false_return_value(self):
+ """Test the configured minimum version that webkitpy supports."""
+ is_current = self._check_version("2.6")
+ self.assertEquals(False, is_current)
+ expected_message = ('WARNING: WebKit Python scripts do not support '
+ 'your current Python version (2.5.3). '
+ 'The minimum supported version is 2.6.\n '
+ 'See the following page to upgrade your Python '
+ 'version:\n\n '
+ 'http://trac.webkit.org/wiki/PythonGuidelines\n\n')
+ self._log.assertMessages([expected_message])
+
diff --git a/WebKitTools/Scripts/webkitpy/queueengine.pyc b/WebKitTools/Scripts/webkitpy/queueengine.pyc
deleted file mode 100644
index 635bb57..0000000
--- a/WebKitTools/Scripts/webkitpy/queueengine.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/scm.py b/WebKitTools/Scripts/webkitpy/scm.py
deleted file mode 100644
index 743f3fe..0000000
--- a/WebKitTools/Scripts/webkitpy/scm.py
+++ /dev/null
@@ -1,513 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-# Copyright (c) 2009 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:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Python module for interacting with an SCM system (like SVN or Git)
-
-import os
-import re
-import subprocess
-
-# Import WebKit-specific modules.
-from webkitpy.changelogs import ChangeLog
-from webkitpy.executive import Executive, run_command, ScriptError
-from webkitpy.webkit_logging import error, log
-
-def detect_scm_system(path):
- if SVN.in_working_directory(path):
- return SVN(cwd=path)
-
- if Git.in_working_directory(path):
- return Git(cwd=path)
-
- return None
-
-def first_non_empty_line_after_index(lines, index=0):
- first_non_empty_line = index
- for line in lines[index:]:
- if re.match("^\s*$", line):
- first_non_empty_line += 1
- else:
- break
- return first_non_empty_line
-
-
-class CommitMessage:
- def __init__(self, message):
- self.message_lines = message[first_non_empty_line_after_index(message, 0):]
-
- def body(self, lstrip=False):
- lines = self.message_lines[first_non_empty_line_after_index(self.message_lines, 1):]
- if lstrip:
- lines = [line.lstrip() for line in lines]
- return "\n".join(lines) + "\n"
-
- def description(self, lstrip=False, strip_url=False):
- line = self.message_lines[0]
- if lstrip:
- line = line.lstrip()
- if strip_url:
- line = re.sub("^(\s*)<.+> ", "\1", line)
- return line
-
- def message(self):
- return "\n".join(self.message_lines) + "\n"
-
-
-class CheckoutNeedsUpdate(ScriptError):
- def __init__(self, script_args, exit_code, output, cwd):
- ScriptError.__init__(self, script_args=script_args, exit_code=exit_code, output=output, cwd=cwd)
-
-
-def commit_error_handler(error):
- if re.search("resource out of date", error.output):
- raise CheckoutNeedsUpdate(script_args=error.script_args, exit_code=error.exit_code, output=error.output, cwd=error.cwd)
- Executive.default_error_handler(error)
-
-
-class SCM:
- def __init__(self, cwd, dryrun=False):
- self.cwd = cwd
- self.checkout_root = self.find_checkout_root(self.cwd)
- self.dryrun = dryrun
-
- def scripts_directory(self):
- return os.path.join(self.checkout_root, "WebKitTools", "Scripts")
-
- def script_path(self, script_name):
- return os.path.join(self.scripts_directory(), script_name)
-
- def ensure_clean_working_directory(self, force_clean):
- if not force_clean and not self.working_directory_is_clean():
- print run_command(self.status_command(), error_handler=Executive.ignore_error)
- raise ScriptError(message="Working directory has modifications, pass --force-clean or --no-clean to continue.")
-
- log("Cleaning working directory")
- self.clean_working_directory()
-
- def ensure_no_local_commits(self, force):
- if not self.supports_local_commits():
- return
- commits = self.local_commits()
- if not len(commits):
- return
- if not force:
- error("Working directory has local commits, pass --force-clean to continue.")
- self.discard_local_commits()
-
- def apply_patch(self, patch, force=False):
- # It's possible that the patch was not made from the root directory.
- # We should detect and handle that case.
- # FIXME: scm.py should not deal with fetching Attachment data. Attachment should just have a .data() accessor.
- curl_process = subprocess.Popen(['curl', '--location', '--silent', '--show-error', patch.url()], stdout=subprocess.PIPE)
- args = [self.script_path('svn-apply')]
- if patch.reviewer():
- args += ['--reviewer', patch.reviewer().full_name]
- if force:
- args.append('--force')
-
- run_command(args, input=curl_process.stdout)
-
- def run_status_and_extract_filenames(self, status_command, status_regexp):
- filenames = []
- for line in run_command(status_command).splitlines():
- match = re.search(status_regexp, line)
- if not match:
- continue
- # status = match.group('status')
- filename = match.group('filename')
- filenames.append(filename)
- return filenames
-
- def strip_r_from_svn_revision(self, svn_revision):
- match = re.match("^r(?P<svn_revision>\d+)", svn_revision)
- if (match):
- return match.group('svn_revision')
- return svn_revision
-
- def svn_revision_from_commit_text(self, commit_text):
- match = re.search(self.commit_success_regexp(), commit_text, re.MULTILINE)
- return match.group('svn_revision')
-
- # ChangeLog-specific code doesn't really belong in scm.py, but this function is very useful.
- def modified_changelogs(self):
- changelog_paths = []
- paths = self.changed_files()
- for path in paths:
- if os.path.basename(path) == "ChangeLog":
- changelog_paths.append(path)
- return changelog_paths
-
- # FIXME: Requires unit test
- # FIXME: commit_message_for_this_commit and modified_changelogs don't
- # really belong here. We should have a separate module for
- # handling ChangeLogs.
- def commit_message_for_this_commit(self):
- changelog_paths = self.modified_changelogs()
- if not len(changelog_paths):
- raise ScriptError(message="Found no modified ChangeLogs, cannot create a commit message.\n"
- "All changes require a ChangeLog. See:\n"
- "http://webkit.org/coding/contributing.html")
-
- changelog_messages = []
- for changelog_path in changelog_paths:
- log("Parsing ChangeLog: %s" % changelog_path)
- changelog_entry = ChangeLog(changelog_path).latest_entry()
- if not changelog_entry:
- raise ScriptError(message="Failed to parse ChangeLog: " + os.path.abspath(changelog_path))
- changelog_messages.append(changelog_entry)
-
- # FIXME: We should sort and label the ChangeLog messages like commit-log-editor does.
- return CommitMessage("".join(changelog_messages).splitlines())
-
- @staticmethod
- def in_working_directory(path):
- raise NotImplementedError, "subclasses must implement"
-
- @staticmethod
- def find_checkout_root(path):
- raise NotImplementedError, "subclasses must implement"
-
- @staticmethod
- def commit_success_regexp():
- raise NotImplementedError, "subclasses must implement"
-
- def working_directory_is_clean(self):
- raise NotImplementedError, "subclasses must implement"
-
- def clean_working_directory(self):
- raise NotImplementedError, "subclasses must implement"
-
- def status_command(self):
- raise NotImplementedError, "subclasses must implement"
-
- def changed_files(self):
- raise NotImplementedError, "subclasses must implement"
-
- def display_name(self):
- raise NotImplementedError, "subclasses must implement"
-
- def create_patch(self):
- raise NotImplementedError, "subclasses must implement"
-
- def diff_for_revision(self, revision):
- raise NotImplementedError, "subclasses must implement"
-
- def apply_reverse_diff(self, revision):
- raise NotImplementedError, "subclasses must implement"
-
- def revert_files(self, file_paths):
- raise NotImplementedError, "subclasses must implement"
-
- def commit_with_message(self, message):
- raise NotImplementedError, "subclasses must implement"
-
- def svn_commit_log(self, svn_revision):
- raise NotImplementedError, "subclasses must implement"
-
- def last_svn_commit_log(self):
- raise NotImplementedError, "subclasses must implement"
-
- # Subclasses must indicate if they support local commits,
- # but the SCM baseclass will only call local_commits methods when this is true.
- @staticmethod
- def supports_local_commits():
- raise NotImplementedError, "subclasses must implement"
-
- def create_patch_from_local_commit(self, commit_id):
- error("Your source control manager does not support creating a patch from a local commit.")
-
- def create_patch_since_local_commit(self, commit_id):
- error("Your source control manager does not support creating a patch from a local commit.")
-
- def commit_locally_with_message(self, message):
- error("Your source control manager does not support local commits.")
-
- def discard_local_commits(self):
- pass
-
- def local_commits(self):
- return []
-
-
-class SVN(SCM):
- def __init__(self, cwd, dryrun=False):
- SCM.__init__(self, cwd, dryrun)
- self.cached_version = None
-
- @staticmethod
- def in_working_directory(path):
- return os.path.isdir(os.path.join(path, '.svn'))
-
- @classmethod
- def find_uuid(cls, path):
- if not cls.in_working_directory(path):
- return None
- return cls.value_from_svn_info(path, 'Repository UUID')
-
- @classmethod
- def value_from_svn_info(cls, path, field_name):
- svn_info_args = ['svn', 'info', path]
- info_output = run_command(svn_info_args).rstrip()
- match = re.search("^%s: (?P<value>.+)$" % field_name, info_output, re.MULTILINE)
- if not match:
- raise ScriptError(script_args=svn_info_args, message='svn info did not contain a %s.' % field_name)
- return match.group('value')
-
- @staticmethod
- def find_checkout_root(path):
- uuid = SVN.find_uuid(path)
- # If |path| is not in a working directory, we're supposed to return |path|.
- if not uuid:
- return path
- # Search up the directory hierarchy until we find a different UUID.
- last_path = None
- while True:
- if uuid != SVN.find_uuid(path):
- return last_path
- last_path = path
- (path, last_component) = os.path.split(path)
- if last_path == path:
- return None
-
- @staticmethod
- def commit_success_regexp():
- return "^Committed revision (?P<svn_revision>\d+)\.$"
-
- def svn_version(self):
- if not self.cached_version:
- self.cached_version = run_command(['svn', '--version', '--quiet'])
-
- return self.cached_version
-
- def working_directory_is_clean(self):
- return run_command(['svn', 'diff']) == ""
-
- def clean_working_directory(self):
- run_command(['svn', 'revert', '-R', '.'])
-
- def status_command(self):
- return ['svn', 'status']
-
- def changed_files(self):
- if self.svn_version() > "1.6":
- status_regexp = "^(?P<status>[ACDMR]).{6} (?P<filename>.+)$"
- else:
- status_regexp = "^(?P<status>[ACDMR]).{5} (?P<filename>.+)$"
- return self.run_status_and_extract_filenames(self.status_command(), status_regexp)
-
- @staticmethod
- def supports_local_commits():
- return False
-
- def display_name(self):
- return "svn"
-
- def create_patch(self):
- return run_command(self.script_path("svn-create-patch"), cwd=self.checkout_root, return_stderr=False)
-
- def diff_for_revision(self, revision):
- return run_command(['svn', 'diff', '-c', str(revision)])
-
- def _repository_url(self):
- return self.value_from_svn_info(self.checkout_root, 'URL')
-
- def apply_reverse_diff(self, revision):
- # '-c -revision' applies the inverse diff of 'revision'
- svn_merge_args = ['svn', 'merge', '--non-interactive', '-c', '-%s' % revision, self._repository_url()]
- log("WARNING: svn merge has been known to take more than 10 minutes to complete. It is recommended you use git for rollouts.")
- log("Running '%s'" % " ".join(svn_merge_args))
- run_command(svn_merge_args)
-
- def revert_files(self, file_paths):
- run_command(['svn', 'revert'] + file_paths)
-
- def commit_with_message(self, message):
- if self.dryrun:
- # Return a string which looks like a commit so that things which parse this output will succeed.
- return "Dry run, no commit.\nCommitted revision 0."
- return run_command(['svn', 'commit', '-m', message], error_handler=commit_error_handler)
-
- def svn_commit_log(self, svn_revision):
- svn_revision = self.strip_r_from_svn_revision(str(svn_revision))
- return run_command(['svn', 'log', '--non-interactive', '--revision', svn_revision]);
-
- def last_svn_commit_log(self):
- # BASE is the checkout revision, HEAD is the remote repository revision
- # http://svnbook.red-bean.com/en/1.0/ch03s03.html
- return self.svn_commit_log('BASE')
-
-# All git-specific logic should go here.
-class Git(SCM):
- def __init__(self, cwd, dryrun=False):
- SCM.__init__(self, cwd, dryrun)
-
- @classmethod
- def in_working_directory(cls, path):
- return run_command(['git', 'rev-parse', '--is-inside-work-tree'], cwd=path, error_handler=Executive.ignore_error).rstrip() == "true"
-
- @classmethod
- def find_checkout_root(cls, path):
- # "git rev-parse --show-cdup" would be another way to get to the root
- (checkout_root, dot_git) = os.path.split(run_command(['git', 'rev-parse', '--git-dir'], cwd=path))
- # If we were using 2.6 # checkout_root = os.path.relpath(checkout_root, path)
- if not os.path.isabs(checkout_root): # Sometimes git returns relative paths
- checkout_root = os.path.join(path, checkout_root)
- return checkout_root
-
- @staticmethod
- def commit_success_regexp():
- return "^Committed r(?P<svn_revision>\d+)$"
-
-
- def discard_local_commits(self):
- run_command(['git', 'reset', '--hard', 'trunk'])
-
- def local_commits(self):
- return run_command(['git', 'log', '--pretty=oneline', 'HEAD...trunk']).splitlines()
-
- def rebase_in_progress(self):
- return os.path.exists(os.path.join(self.checkout_root, '.git/rebase-apply'))
-
- def working_directory_is_clean(self):
- return run_command(['git', 'diff-index', 'HEAD']) == ""
-
- def clean_working_directory(self):
- # Could run git clean here too, but that wouldn't match working_directory_is_clean
- run_command(['git', 'reset', '--hard', 'HEAD'])
- # Aborting rebase even though this does not match working_directory_is_clean
- if self.rebase_in_progress():
- run_command(['git', 'rebase', '--abort'])
-
- def status_command(self):
- return ['git', 'status']
-
- def changed_files(self):
- status_command = ['git', 'diff', '-r', '--name-status', '-C', '-M', 'HEAD']
- status_regexp = '^(?P<status>[ADM])\t(?P<filename>.+)$'
- return self.run_status_and_extract_filenames(status_command, status_regexp)
-
- @staticmethod
- def supports_local_commits():
- return True
-
- def display_name(self):
- return "git"
-
- def create_patch(self):
- return run_command(['git', 'diff', '--binary', 'HEAD'])
-
- @classmethod
- def git_commit_from_svn_revision(cls, revision):
- # git svn find-rev always exits 0, even when the revision is not found.
- return run_command(['git', 'svn', 'find-rev', 'r%s' % revision]).rstrip()
-
- def diff_for_revision(self, revision):
- git_commit = self.git_commit_from_svn_revision(revision)
- return self.create_patch_from_local_commit(git_commit)
-
- def apply_reverse_diff(self, revision):
- # Assume the revision is an svn revision.
- git_commit = self.git_commit_from_svn_revision(revision)
- if not git_commit:
- raise ScriptError(message='Failed to find git commit for revision %s, git svn log output: "%s"' % (revision, git_commit))
-
- # I think this will always fail due to ChangeLogs.
- # FIXME: We need to detec specific failure conditions and handle them.
- run_command(['git', 'revert', '--no-commit', git_commit], error_handler=Executive.ignore_error)
-
- # Fix any ChangeLogs if necessary.
- changelog_paths = self.modified_changelogs()
- if len(changelog_paths):
- run_command([self.script_path('resolve-ChangeLogs')] + changelog_paths)
-
- def revert_files(self, file_paths):
- run_command(['git', 'checkout', 'HEAD'] + file_paths)
-
- def commit_with_message(self, message):
- self.commit_locally_with_message(message)
- return self.push_local_commits_to_server()
-
- def svn_commit_log(self, svn_revision):
- svn_revision = self.strip_r_from_svn_revision(svn_revision)
- return run_command(['git', 'svn', 'log', '-r', svn_revision])
-
- def last_svn_commit_log(self):
- return run_command(['git', 'svn', 'log', '--limit=1'])
-
- # Git-specific methods:
-
- def create_patch_from_local_commit(self, commit_id):
- return run_command(['git', 'diff', '--binary', commit_id + "^.." + commit_id])
-
- def create_patch_since_local_commit(self, commit_id):
- return run_command(['git', 'diff', '--binary', commit_id])
-
- def commit_locally_with_message(self, message):
- run_command(['git', 'commit', '--all', '-F', '-'], input=message)
-
- def push_local_commits_to_server(self):
- if self.dryrun:
- # Return a string which looks like a commit so that things which parse this output will succeed.
- return "Dry run, no remote commit.\nCommitted r0"
- return run_command(['git', 'svn', 'dcommit'], error_handler=commit_error_handler)
-
- # This function supports the following argument formats:
- # no args : rev-list trunk..HEAD
- # A..B : rev-list A..B
- # A...B : error!
- # A B : [A, B] (different from git diff, which would use "rev-list A..B")
- def commit_ids_from_commitish_arguments(self, args):
- if not len(args):
- # FIXME: trunk is not always the remote branch name, need a way to detect the name.
- args.append('trunk..HEAD')
-
- commit_ids = []
- for commitish in args:
- if '...' in commitish:
- raise ScriptError(message="'...' is not supported (found in '%s'). Did you mean '..'?" % commitish)
- elif '..' in commitish:
- commit_ids += reversed(run_command(['git', 'rev-list', commitish]).splitlines())
- else:
- # Turn single commits or branch or tag names into commit ids.
- commit_ids += run_command(['git', 'rev-parse', '--revs-only', commitish]).splitlines()
- return commit_ids
-
- def commit_message_for_local_commit(self, commit_id):
- commit_lines = run_command(['git', 'cat-file', 'commit', commit_id]).splitlines()
-
- # Skip the git headers.
- first_line_after_headers = 0
- for line in commit_lines:
- first_line_after_headers += 1
- if line == "":
- break
- return CommitMessage(commit_lines[first_line_after_headers:])
-
- def files_changed_summary_for_commit(self, commit_id):
- return run_command(['git', 'diff-tree', '--shortstat', '--no-commit-id', commit_id])
diff --git a/WebKitTools/Scripts/webkitpy/scm.pyc b/WebKitTools/Scripts/webkitpy/scm.pyc
deleted file mode 100644
index 520f611..0000000
--- a/WebKitTools/Scripts/webkitpy/scm.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/scm_unittest.py b/WebKitTools/Scripts/webkitpy/scm_unittest.py
deleted file mode 100644
index 73faf40..0000000
--- a/WebKitTools/Scripts/webkitpy/scm_unittest.py
+++ /dev/null
@@ -1,595 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-# Copyright (C) 2009 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:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import base64
-import os
-import os.path
-import re
-import stat
-import subprocess
-import tempfile
-import unittest
-import urllib
-
-from datetime import date
-from webkitpy.executive import Executive, run_command, ScriptError
-from webkitpy.scm import detect_scm_system, SCM, CheckoutNeedsUpdate, commit_error_handler
-from webkitpy.bugzilla import Attachment # FIXME: This should not be needed
-
-# Eventually we will want to write tests which work for both scms. (like update_webkit, changed_files, etc.)
-# Perhaps through some SCMTest base-class which both SVNTest and GitTest inherit from.
-
-# FIXME: This should be unified into one of the executive.py commands!
-def run_silent(args, cwd=None):
- process = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
- process.communicate() # ignore output
- exit_code = process.wait()
- if exit_code:
- raise ScriptError('Failed to run "%s" exit_code: %d cwd: %s' % (args, exit_code, cwd))
-
-def write_into_file_at_path(file_path, contents):
- file = open(file_path, 'w')
- file.write(contents)
- file.close()
-
-def read_from_path(file_path):
- file = open(file_path, 'r')
- contents = file.read()
- file.close()
- return contents
-
-# Exists to share svn repository creation code between the git and svn tests
-class SVNTestRepository:
- @staticmethod
- def _setup_test_commits(test_object):
- # Add some test commits
- os.chdir(test_object.svn_checkout_path)
- test_file = open('test_file', 'w')
- test_file.write("test1")
- test_file.flush()
-
- run_command(['svn', 'add', 'test_file'])
- run_command(['svn', 'commit', '--quiet', '--message', 'initial commit'])
-
- test_file.write("test2")
- test_file.flush()
-
- run_command(['svn', 'commit', '--quiet', '--message', 'second commit'])
-
- test_file.write("test3\n")
- test_file.flush()
-
- run_command(['svn', 'commit', '--quiet', '--message', 'third commit'])
-
- test_file.write("test4\n")
- test_file.close()
-
- run_command(['svn', 'commit', '--quiet', '--message', 'fourth commit'])
-
- # svn does not seem to update after commit as I would expect.
- run_command(['svn', 'update'])
-
- @classmethod
- def setup(cls, test_object):
- # Create an test SVN repository
- test_object.svn_repo_path = tempfile.mkdtemp(suffix="svn_test_repo")
- test_object.svn_repo_url = "file://%s" % test_object.svn_repo_path # Not sure this will work on windows
- # git svn complains if we don't pass --pre-1.5-compatible, not sure why:
- # Expected FS format '2'; found format '3' at /usr/local/libexec/git-core//git-svn line 1477
- run_command(['svnadmin', 'create', '--pre-1.5-compatible', test_object.svn_repo_path])
-
- # Create a test svn checkout
- test_object.svn_checkout_path = tempfile.mkdtemp(suffix="svn_test_checkout")
- run_command(['svn', 'checkout', '--quiet', test_object.svn_repo_url, test_object.svn_checkout_path])
-
- cls._setup_test_commits(test_object)
-
- @classmethod
- def tear_down(cls, test_object):
- run_command(['rm', '-rf', test_object.svn_repo_path])
- run_command(['rm', '-rf', test_object.svn_checkout_path])
-
-# For testing the SCM baseclass directly.
-class SCMClassTests(unittest.TestCase):
- def setUp(self):
- self.dev_null = open(os.devnull, "w") # Used to make our Popen calls quiet.
-
- def tearDown(self):
- self.dev_null.close()
-
- def test_run_command_with_pipe(self):
- input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null)
- self.assertEqual(run_command(['grep', 'bar'], input=input_process.stdout), "bar\n")
-
- # Test the non-pipe case too:
- self.assertEqual(run_command(['grep', 'bar'], input="foo\nbar"), "bar\n")
-
- command_returns_non_zero = ['/bin/sh', '--invalid-option']
- # Test when the input pipe process fails.
- input_process = subprocess.Popen(command_returns_non_zero, stdout=subprocess.PIPE, stderr=self.dev_null)
- self.assertTrue(input_process.poll() != 0)
- self.assertRaises(ScriptError, run_command, ['grep', 'bar'], input=input_process.stdout)
-
- # Test when the run_command process fails.
- input_process = subprocess.Popen(['echo', 'foo\nbar'], stdout=subprocess.PIPE, stderr=self.dev_null) # grep shows usage and calls exit(2) when called w/o arguments.
- self.assertRaises(ScriptError, run_command, command_returns_non_zero, input=input_process.stdout)
-
- def test_error_handlers(self):
- git_failure_message="Merge conflict during commit: Your file or directory 'WebCore/ChangeLog' is probably out-of-date: resource out of date; try updating at /usr/local/libexec/git-core//git-svn line 469"
- svn_failure_message="""svn: Commit failed (details follow):
-svn: File or directory 'ChangeLog' is out of date; try updating
-svn: resource out of date; try updating
-"""
- command_does_not_exist = ['does_not_exist', 'invalid_option']
- self.assertRaises(OSError, run_command, command_does_not_exist)
- self.assertRaises(OSError, run_command, command_does_not_exist, error_handler=Executive.ignore_error)
-
- command_returns_non_zero = ['/bin/sh', '--invalid-option']
- self.assertRaises(ScriptError, run_command, command_returns_non_zero)
- # Check if returns error text:
- self.assertTrue(run_command(command_returns_non_zero, error_handler=Executive.ignore_error))
-
- self.assertRaises(CheckoutNeedsUpdate, commit_error_handler, ScriptError(output=git_failure_message))
- self.assertRaises(CheckoutNeedsUpdate, commit_error_handler, ScriptError(output=svn_failure_message))
- self.assertRaises(ScriptError, commit_error_handler, ScriptError(output='blah blah blah'))
-
-
-# GitTest and SVNTest inherit from this so any test_ methods here will be run once for this class and then once for each subclass.
-class SCMTest(unittest.TestCase):
- def _create_patch(self, patch_contents):
- patch_path = os.path.join(self.svn_checkout_path, 'patch.diff')
- write_into_file_at_path(patch_path, patch_contents)
- patch = {}
- patch['reviewer'] = 'Joe Cool'
- patch['bug_id'] = '12345'
- patch['url'] = 'file://%s' % urllib.pathname2url(patch_path)
- return Attachment(patch, None) # FIXME: This is a hack, scm.py shouldn't be fetching attachment data.
-
- def _setup_webkittools_scripts_symlink(self, local_scm):
- webkit_scm = detect_scm_system(os.path.dirname(os.path.abspath(__file__)))
- webkit_scripts_directory = webkit_scm.scripts_directory()
- local_scripts_directory = local_scm.scripts_directory()
- os.mkdir(os.path.dirname(local_scripts_directory))
- os.symlink(webkit_scripts_directory, local_scripts_directory)
-
- # Tests which both GitTest and SVNTest should run.
- # FIXME: There must be a simpler way to add these w/o adding a wrapper method to both subclasses
- def _shared_test_commit_with_message(self):
- write_into_file_at_path('test_file', 'more test content')
- commit_text = self.scm.commit_with_message('another test commit')
- self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '5')
-
- self.scm.dryrun = True
- write_into_file_at_path('test_file', 'still more test content')
- commit_text = self.scm.commit_with_message('yet another test commit')
- self.assertEqual(self.scm.svn_revision_from_commit_text(commit_text), '0')
-
- def _shared_test_reverse_diff(self):
- self._setup_webkittools_scripts_symlink(self.scm) # Git's apply_reverse_diff uses resolve-ChangeLogs
- # Only test the simple case, as any other will end up with conflict markers.
- self.scm.apply_reverse_diff('4')
- self.assertEqual(read_from_path('test_file'), "test1test2test3\n")
-
- def _shared_test_diff_for_revision(self):
- # Patch formats are slightly different between svn and git, so just regexp for things we know should be there.
- r3_patch = self.scm.diff_for_revision(3)
- self.assertTrue(re.search('test3', r3_patch))
- self.assertFalse(re.search('test4', r3_patch))
- self.assertTrue(re.search('test2', r3_patch))
- self.assertTrue(re.search('test2', self.scm.diff_for_revision(2)))
-
- def _shared_test_svn_apply_git_patch(self):
- self._setup_webkittools_scripts_symlink(self.scm)
- git_binary_addition = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
-new file mode 100644
-index 0000000000000000000000000000000000000000..64a9532e7794fcd791f6f12157406d90
-60151690
-GIT binary patch
-literal 512
-zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?
-zhJP##HdZC#4K}7F68@!1jfWQg2daCm-gs#3|JREDT>c+pG4L<_2;w##WMO#ysPPap
-zLqpAf1OE938xAsSp4!5f-o><?VKe(#0jEcwfHGF4%M1^kRs14oVBp2ZEL{E1N<-zJ
-zsfLmOtKta;2_;2c#^S1-8cf<nb!QnGl>c!Xe6RXvrEtAWBvSDTgTO1j3vA31Puw!A
-zs(87q)j_mVDTqBo-P+03-P5mHCEnJ+x}YdCuS7#bCCyePUe(ynK+|4b-3qK)T?Z&)
-zYG+`tl4h?GZv_$t82}X4*DTE|$;{DEiPyF@)U-1+FaX++T9H{&%cag`W1|zVP@`%b
-zqiSkp6{BTpWTkCr!=<C6Q=?#~R8^JfrliAF6Q^gV9Iup8RqCXqqhqC`qsyhk<-nlB
-z00f{QZvfK&|Nm#oZ0TQl`Yr$BIa6A@16O26ud7H<QM=xl`toLKnz-3h@9c9q&wm|X
-z{89I|WPyD!*M?gv?q`;L=2YFeXrJQNti4?}s!zFo=5CzeBxC69xA<zrjP<wUcCRh4
-ptUl-ZG<%a~#LwkIWv&q!KSCH7tQ8cJDiw+|GV?MN)RjY50RTb-xvT&H
-
-literal 0
-HcmV?d00001
-
-"""
- self.scm.apply_patch(self._create_patch(git_binary_addition))
- added = read_from_path('fizzbuzz7.gif')
- self.assertEqual(512, len(added))
- self.assertTrue(added.startswith('GIF89a'))
- self.assertTrue('fizzbuzz7.gif' in self.scm.changed_files())
-
- # The file already exists.
- self.assertRaises(ScriptError, self.scm.apply_patch, self._create_patch(git_binary_addition))
-
- git_binary_modification = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
-index 64a9532e7794fcd791f6f12157406d9060151690..323fae03f4606ea9991df8befbb2fca7
-GIT binary patch
-literal 7
-OcmYex&reD$;sO8*F9L)B
-
-literal 512
-zcmZ?wbhEHbRAx|MU|?iW{Kxc~?KofD;ckY;H+&5HnHl!!GQMD7h+sU{_)e9f^V3c?
-zhJP##HdZC#4K}7F68@!1jfWQg2daCm-gs#3|JREDT>c+pG4L<_2;w##WMO#ysPPap
-zLqpAf1OE938xAsSp4!5f-o><?VKe(#0jEcwfHGF4%M1^kRs14oVBp2ZEL{E1N<-zJ
-zsfLmOtKta;2_;2c#^S1-8cf<nb!QnGl>c!Xe6RXvrEtAWBvSDTgTO1j3vA31Puw!A
-zs(87q)j_mVDTqBo-P+03-P5mHCEnJ+x}YdCuS7#bCCyePUe(ynK+|4b-3qK)T?Z&)
-zYG+`tl4h?GZv_$t82}X4*DTE|$;{DEiPyF@)U-1+FaX++T9H{&%cag`W1|zVP@`%b
-zqiSkp6{BTpWTkCr!=<C6Q=?#~R8^JfrliAF6Q^gV9Iup8RqCXqqhqC`qsyhk<-nlB
-z00f{QZvfK&|Nm#oZ0TQl`Yr$BIa6A@16O26ud7H<QM=xl`toLKnz-3h@9c9q&wm|X
-z{89I|WPyD!*M?gv?q`;L=2YFeXrJQNti4?}s!zFo=5CzeBxC69xA<zrjP<wUcCRh4
-ptUl-ZG<%a~#LwkIWv&q!KSCH7tQ8cJDiw+|GV?MN)RjY50RTb-xvT&H
-
-"""
- self.scm.apply_patch(self._create_patch(git_binary_modification))
- modified = read_from_path('fizzbuzz7.gif')
- self.assertEqual('foobar\n', modified)
- self.assertTrue('fizzbuzz7.gif' in self.scm.changed_files())
-
- # Applying the same modification should fail.
- self.assertRaises(ScriptError, self.scm.apply_patch, self._create_patch(git_binary_modification))
-
- git_binary_deletion = """diff --git a/fizzbuzz7.gif b/fizzbuzz7.gif
-deleted file mode 100644
-index 323fae0..0000000
-GIT binary patch
-literal 0
-HcmV?d00001
-
-literal 7
-OcmYex&reD$;sO8*F9L)B
-
-"""
- self.scm.apply_patch(self._create_patch(git_binary_deletion))
- self.assertFalse(os.path.exists('fizzbuzz7.gif'))
- self.assertFalse('fizzbuzz7.gif' in self.scm.changed_files())
-
- # Cannot delete again.
- self.assertRaises(ScriptError, self.scm.apply_patch, self._create_patch(git_binary_deletion))
-
-
-class SVNTest(SCMTest):
-
- @staticmethod
- def _set_date_and_reviewer(changelog_entry):
- # Joe Cool matches the reviewer set in SCMTest._create_patch
- changelog_entry = changelog_entry.replace('REVIEWER_HERE', 'Joe Cool')
- # svn-apply will update ChangeLog entries with today's date.
- return changelog_entry.replace('DATE_HERE', date.today().isoformat())
-
- def test_svn_apply(self):
- first_entry = """2009-10-26 Eric Seidel <eric@webkit.org>
-
- Reviewed by Foo Bar.
-
- Most awesome change ever.
-
- * scm_unittest.py:
-"""
- intermediate_entry = """2009-10-27 Eric Seidel <eric@webkit.org>
-
- Reviewed by Baz Bar.
-
- A more awesomer change yet!
-
- * scm_unittest.py:
-"""
- one_line_overlap_patch = """Index: ChangeLog
-===================================================================
---- ChangeLog (revision 5)
-+++ ChangeLog (working copy)
-@@ -1,5 +1,13 @@
- 2009-10-26 Eric Seidel <eric@webkit.org>
-
-+ Reviewed by NOBODY (OOPS!).
-+
-+ Second most awsome change ever.
-+
-+ * scm_unittest.py:
-+
-+2009-10-26 Eric Seidel <eric@webkit.org>
-+
- Reviewed by Foo Bar.
-
- Most awesome change ever.
-"""
- one_line_overlap_entry = """DATE_HERE Eric Seidel <eric@webkit.org>
-
- Reviewed by REVIEWER_HERE.
-
- Second most awsome change ever.
-
- * scm_unittest.py:
-"""
- two_line_overlap_patch = """Index: ChangeLog
-===================================================================
---- ChangeLog (revision 5)
-+++ ChangeLog (working copy)
-@@ -2,6 +2,14 @@
-
- Reviewed by Foo Bar.
-
-+ Second most awsome change ever.
-+
-+ * scm_unittest.py:
-+
-+2009-10-26 Eric Seidel <eric@webkit.org>
-+
-+ Reviewed by Foo Bar.
-+
- Most awesome change ever.
-
- * scm_unittest.py:
-"""
- two_line_overlap_entry = """DATE_HERE Eric Seidel <eric@webkit.org>
-
- Reviewed by Foo Bar.
-
- Second most awsome change ever.
-
- * scm_unittest.py:
-"""
- write_into_file_at_path('ChangeLog', first_entry)
- run_command(['svn', 'add', 'ChangeLog'])
- run_command(['svn', 'commit', '--quiet', '--message', 'ChangeLog commit'])
-
- # Patch files were created against just 'first_entry'.
- # Add a second commit to make svn-apply have to apply the patches with fuzz.
- changelog_contents = "%s\n%s" % (intermediate_entry, first_entry)
- write_into_file_at_path('ChangeLog', changelog_contents)
- run_command(['svn', 'commit', '--quiet', '--message', 'Intermediate commit'])
-
- self._setup_webkittools_scripts_symlink(self.scm)
- self.scm.apply_patch(self._create_patch(one_line_overlap_patch))
- expected_changelog_contents = "%s\n%s" % (self._set_date_and_reviewer(one_line_overlap_entry), changelog_contents)
- self.assertEquals(read_from_path('ChangeLog'), expected_changelog_contents)
-
- self.scm.revert_files(['ChangeLog'])
- self.scm.apply_patch(self._create_patch(two_line_overlap_patch))
- expected_changelog_contents = "%s\n%s" % (self._set_date_and_reviewer(two_line_overlap_entry), changelog_contents)
- self.assertEquals(read_from_path('ChangeLog'), expected_changelog_contents)
-
- def setUp(self):
- SVNTestRepository.setup(self)
- os.chdir(self.svn_checkout_path)
- self.scm = detect_scm_system(self.svn_checkout_path)
-
- def tearDown(self):
- SVNTestRepository.tear_down(self)
-
- def test_create_patch_is_full_patch(self):
- test_dir_path = os.path.join(self.svn_checkout_path, 'test_dir')
- os.mkdir(test_dir_path)
- test_file_path = os.path.join(test_dir_path, 'test_file2')
- write_into_file_at_path(test_file_path, 'test content')
- run_command(['svn', 'add', 'test_dir'])
-
- # create_patch depends on 'svn-create-patch', so make a dummy version.
- scripts_path = os.path.join(self.svn_checkout_path, 'WebKitTools', 'Scripts')
- os.makedirs(scripts_path)
- create_patch_path = os.path.join(scripts_path, 'svn-create-patch')
- write_into_file_at_path(create_patch_path, '#!/bin/sh\necho $PWD') # We could pass -n to prevent the \n, but not all echo accept -n.
- os.chmod(create_patch_path, stat.S_IXUSR | stat.S_IRUSR)
-
- # Change into our test directory and run the create_patch command.
- os.chdir(test_dir_path)
- scm = detect_scm_system(test_dir_path)
- self.assertEqual(scm.checkout_root, self.svn_checkout_path) # Sanity check that detection worked right.
- patch_contents = scm.create_patch()
- # Our fake 'svn-create-patch' returns $PWD instead of a patch, check that it was executed from the root of the repo.
- self.assertEqual("%s\n" % os.path.realpath(scm.checkout_root), patch_contents) # Add a \n because echo adds a \n.
-
- def test_detection(self):
- scm = detect_scm_system(self.svn_checkout_path)
- self.assertEqual(scm.display_name(), "svn")
- self.assertEqual(scm.supports_local_commits(), False)
-
- def test_apply_small_binary_patch(self):
- patch_contents = """Index: test_file.swf
-===================================================================
-Cannot display: file marked as a binary type.
-svn:mime-type = application/octet-stream
-
-Property changes on: test_file.swf
-___________________________________________________________________
-Name: svn:mime-type
- + application/octet-stream
-
-
-Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==
-"""
- expected_contents = base64.b64decode("Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==")
- self._setup_webkittools_scripts_symlink(self.scm)
- patch_file = self._create_patch(patch_contents)
- self.scm.apply_patch(patch_file)
- actual_contents = read_from_path("test_file.swf")
- self.assertEqual(actual_contents, expected_contents)
-
- def test_apply_svn_patch(self):
- scm = detect_scm_system(self.svn_checkout_path)
- patch = self._create_patch(run_command(['svn', 'diff', '-r4:3']))
- self._setup_webkittools_scripts_symlink(scm)
- scm.apply_patch(patch)
-
- def test_apply_svn_patch_force(self):
- scm = detect_scm_system(self.svn_checkout_path)
- patch = self._create_patch(run_command(['svn', 'diff', '-r2:4']))
- self._setup_webkittools_scripts_symlink(scm)
- self.assertRaises(ScriptError, scm.apply_patch, patch, force=True)
-
- def test_commit_logs(self):
- # Commits have dates and usernames in them, so we can't just direct compare.
- self.assertTrue(re.search('fourth commit', self.scm.last_svn_commit_log()))
- self.assertTrue(re.search('second commit', self.scm.svn_commit_log(2)))
-
- def test_commit_text_parsing(self):
- self._shared_test_commit_with_message()
-
- def test_reverse_diff(self):
- self._shared_test_reverse_diff()
-
- def test_diff_for_revision(self):
- self._shared_test_diff_for_revision()
-
- def test_svn_apply_git_patch(self):
- self._shared_test_svn_apply_git_patch()
-
-class GitTest(SCMTest):
-
- def _setup_git_clone_of_svn_repository(self):
- self.git_checkout_path = tempfile.mkdtemp(suffix="git_test_checkout")
- # --quiet doesn't make git svn silent, so we use run_silent to redirect output
- run_silent(['git', 'svn', '--quiet', 'clone', self.svn_repo_url, self.git_checkout_path])
-
- def _tear_down_git_clone_of_svn_repository(self):
- run_command(['rm', '-rf', self.git_checkout_path])
-
- def setUp(self):
- SVNTestRepository.setup(self)
- self._setup_git_clone_of_svn_repository()
- os.chdir(self.git_checkout_path)
- self.scm = detect_scm_system(self.git_checkout_path)
-
- def tearDown(self):
- SVNTestRepository.tear_down(self)
- self._tear_down_git_clone_of_svn_repository()
-
- def test_detection(self):
- scm = detect_scm_system(self.git_checkout_path)
- self.assertEqual(scm.display_name(), "git")
- self.assertEqual(scm.supports_local_commits(), True)
-
- def test_rebase_in_progress(self):
- svn_test_file = os.path.join(self.svn_checkout_path, 'test_file')
- write_into_file_at_path(svn_test_file, "svn_checkout")
- run_command(['svn', 'commit', '--message', 'commit to conflict with git commit'], cwd=self.svn_checkout_path)
-
- git_test_file = os.path.join(self.git_checkout_path, 'test_file')
- write_into_file_at_path(git_test_file, "git_checkout")
- run_command(['git', 'commit', '-a', '-m', 'commit to be thrown away by rebase abort'])
-
- # --quiet doesn't make git svn silent, so use run_silent to redirect output
- self.assertRaises(ScriptError, run_silent, ['git', 'svn', '--quiet', 'rebase']) # Will fail due to a conflict leaving us mid-rebase.
-
- scm = detect_scm_system(self.git_checkout_path)
- self.assertTrue(scm.rebase_in_progress())
-
- # Make sure our cleanup works.
- scm.clean_working_directory()
- self.assertFalse(scm.rebase_in_progress())
-
- # Make sure cleanup doesn't throw when no rebase is in progress.
- scm.clean_working_directory()
-
- def test_commitish_parsing(self):
- scm = detect_scm_system(self.git_checkout_path)
-
- # Multiple revisions are cherry-picked.
- self.assertEqual(len(scm.commit_ids_from_commitish_arguments(['HEAD~2'])), 1)
- self.assertEqual(len(scm.commit_ids_from_commitish_arguments(['HEAD', 'HEAD~2'])), 2)
-
- # ... is an invalid range specifier
- self.assertRaises(ScriptError, scm.commit_ids_from_commitish_arguments, ['trunk...HEAD'])
-
- def test_commitish_order(self):
- scm = detect_scm_system(self.git_checkout_path)
-
- commit_range = 'HEAD~3..HEAD'
-
- actual_commits = scm.commit_ids_from_commitish_arguments([commit_range])
- expected_commits = []
- expected_commits += reversed(run_command(['git', 'rev-list', commit_range]).splitlines())
-
- self.assertEqual(actual_commits, expected_commits)
-
- def test_apply_git_patch(self):
- scm = detect_scm_system(self.git_checkout_path)
- patch = self._create_patch(run_command(['git', 'diff', 'HEAD..HEAD^']))
- self._setup_webkittools_scripts_symlink(scm)
- scm.apply_patch(patch)
-
- def test_apply_git_patch_force(self):
- scm = detect_scm_system(self.git_checkout_path)
- patch = self._create_patch(run_command(['git', 'diff', 'HEAD~2..HEAD']))
- self._setup_webkittools_scripts_symlink(scm)
- self.assertRaises(ScriptError, scm.apply_patch, patch, force=True)
-
- def test_commit_text_parsing(self):
- self._shared_test_commit_with_message()
-
- def test_reverse_diff(self):
- self._shared_test_reverse_diff()
-
- def test_diff_for_revision(self):
- self._shared_test_diff_for_revision()
-
- def test_svn_apply_git_patch(self):
- self._shared_test_svn_apply_git_patch()
-
- def test_create_binary_patch(self):
- # Create a git binary patch and check the contents.
- scm = detect_scm_system(self.git_checkout_path)
- test_file_name = 'binary_file'
- test_file_path = os.path.join(self.git_checkout_path, test_file_name)
- file_contents = ''.join(map(chr, range(256)))
- write_into_file_at_path(test_file_path, file_contents)
- run_command(['git', 'add', test_file_name])
- patch = scm.create_patch()
- self.assertTrue(re.search(r'\nliteral 0\n', patch))
- self.assertTrue(re.search(r'\nliteral 256\n', patch))
-
- # Check if we can apply the created patch.
- run_command(['git', 'rm', '-f', test_file_name])
- self._setup_webkittools_scripts_symlink(scm)
- self.scm.apply_patch(self._create_patch(patch))
- self.assertEqual(file_contents, read_from_path(test_file_path))
-
- # Check if we can create a patch from a local commit.
- write_into_file_at_path(test_file_path, file_contents)
- run_command(['git', 'add', test_file_name])
- run_command(['git', 'commit', '-m', 'binary diff'])
- patch_from_local_commit = scm.create_patch_from_local_commit('HEAD')
- self.assertTrue(re.search(r'\nliteral 0\n', patch_from_local_commit))
- self.assertTrue(re.search(r'\nliteral 256\n', patch_from_local_commit))
- patch_since_local_commit = scm.create_patch_since_local_commit('HEAD^1')
- self.assertTrue(re.search(r'\nliteral 0\n', patch_since_local_commit))
- self.assertTrue(re.search(r'\nliteral 256\n', patch_since_local_commit))
- self.assertEqual(patch_from_local_commit, patch_since_local_commit)
-
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/statusserver.py b/WebKitTools/Scripts/webkitpy/statusserver.py
deleted file mode 100644
index ff0ddfa..0000000
--- a/WebKitTools/Scripts/webkitpy/statusserver.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright (C) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-from webkitpy.networktransaction import NetworkTransaction
-from webkitpy.webkit_logging import log
-from mechanize import Browser
-
-# WebKit includes a built copy of BeautifulSoup in Scripts/webkitpy
-# so this import should always succeed.
-from .BeautifulSoup import BeautifulSoup
-
-import urllib2
-
-
-class StatusServer:
- default_host = "webkit-commit-queue.appspot.com"
-
- def __init__(self, host=default_host):
- self.set_host(host)
- self.browser = Browser()
-
- def set_host(self, host):
- self.host = host
- self.url = "http://%s" % self.host
-
- def results_url_for_status(self, status_id):
- return "%s/results/%s" % (self.url, status_id)
-
- def _add_patch(self, patch):
- if not patch:
- return
- if patch.bug_id():
- self.browser["bug_id"] = str(patch.bug_id())
- if patch.id():
- self.browser["patch_id"] = str(patch.id())
-
- def _add_results_file(self, results_file):
- if not results_file:
- return
- self.browser.add_file(results_file, "text/plain", "results.txt", 'results_file')
-
- def _post_to_server(self, queue_name, status, patch, results_file):
- if results_file:
- # We might need to re-wind the file if we've already tried to post it.
- results_file.seek(0)
-
- update_status_url = "%s/update-status" % self.url
- self.browser.open(update_status_url)
- self.browser.select_form(name="update_status")
- self.browser['queue_name'] = queue_name
- self._add_patch(patch)
- self.browser['status'] = status
- self._add_results_file(results_file)
- return self.browser.submit().read() # This is the id of the newly created status object.
-
- def update_status(self, queue_name, status, patch=None, results_file=None):
- # During unit testing, host is None
- if not self.host:
- return
-
- log(status)
- return NetworkTransaction().run(lambda: self._post_to_server(queue_name, status, patch, results_file))
-
- def patch_status(self, queue_name, patch_id):
- update_status_url = "%s/patch-status/%s/%s" % (self.url, queue_name, patch_id)
- try:
- return urllib2.urlopen(update_status_url).read()
- except urllib2.HTTPError, e:
- if e.code == 404:
- return None
- raise e
diff --git a/WebKitTools/Scripts/webkitpy/statusserver.pyc b/WebKitTools/Scripts/webkitpy/statusserver.pyc
deleted file mode 100644
index 2ba11b0..0000000
--- a/WebKitTools/Scripts/webkitpy/statusserver.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/__init__.py b/WebKitTools/Scripts/webkitpy/steps/__init__.py
deleted file mode 100644
index 5ae4bea..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/__init__.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# FIXME: Is this the right way to do this?
-from webkitpy.steps.applypatch import ApplyPatch
-from webkitpy.steps.applypatchwithlocalcommit import ApplyPatchWithLocalCommit
-from webkitpy.steps.build import Build
-from webkitpy.steps.checkstyle import CheckStyle
-from webkitpy.steps.cleanworkingdirectory import CleanWorkingDirectory
-from webkitpy.steps.cleanworkingdirectorywithlocalcommits import CleanWorkingDirectoryWithLocalCommits
-from webkitpy.steps.closebug import CloseBug
-from webkitpy.steps.closebugforlanddiff import CloseBugForLandDiff
-from webkitpy.steps.closepatch import ClosePatch
-from webkitpy.steps.commit import Commit
-from webkitpy.steps.completerollout import CompleteRollout
-from webkitpy.steps.confirmdiff import ConfirmDiff
-from webkitpy.steps.createbug import CreateBug
-from webkitpy.steps.editchangelog import EditChangeLog
-from webkitpy.steps.ensurebuildersaregreen import EnsureBuildersAreGreen
-from webkitpy.steps.ensurelocalcommitifneeded import EnsureLocalCommitIfNeeded
-from webkitpy.steps.obsoletepatches import ObsoletePatches
-from webkitpy.steps.options import Options
-from webkitpy.steps.postdiff import PostDiff
-from webkitpy.steps.postdiffforcommit import PostDiffForCommit
-from webkitpy.steps.preparechangelogforrevert import PrepareChangeLogForRevert
-from webkitpy.steps.preparechangelog import PrepareChangeLog
-from webkitpy.steps.promptforbugortitle import PromptForBugOrTitle
-from webkitpy.steps.revertrevision import RevertRevision
-from webkitpy.steps.runtests import RunTests
-from webkitpy.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
-from webkitpy.steps.update import Update
diff --git a/WebKitTools/Scripts/webkitpy/steps/__init__.pyc b/WebKitTools/Scripts/webkitpy/steps/__init__.pyc
deleted file mode 100644
index ccf513b..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/__init__.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/abstractstep.pyc b/WebKitTools/Scripts/webkitpy/steps/abstractstep.pyc
deleted file mode 100644
index d172c92..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/abstractstep.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/applypatch.pyc b/WebKitTools/Scripts/webkitpy/steps/applypatch.pyc
deleted file mode 100644
index 0c5212d..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/applypatch.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.pyc b/WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.pyc
deleted file mode 100644
index 67afd10..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/build.pyc b/WebKitTools/Scripts/webkitpy/steps/build.pyc
deleted file mode 100644
index 8e9e5ee..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/build.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/checkstyle.pyc b/WebKitTools/Scripts/webkitpy/steps/checkstyle.pyc
deleted file mode 100644
index 561036b..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/checkstyle.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.pyc b/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.pyc
deleted file mode 100644
index 11383f2..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.pyc b/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.pyc
deleted file mode 100644
index 757d19a..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/closebug.pyc b/WebKitTools/Scripts/webkitpy/steps/closebug.pyc
deleted file mode 100644
index 356f430..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/closebug.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.pyc b/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.pyc
deleted file mode 100644
index 2dd3814..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/closepatch.pyc b/WebKitTools/Scripts/webkitpy/steps/closepatch.pyc
deleted file mode 100644
index 3a2a75b..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/closepatch.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/commit.pyc b/WebKitTools/Scripts/webkitpy/steps/commit.pyc
deleted file mode 100644
index fe9ef1a..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/commit.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/completerollout.pyc b/WebKitTools/Scripts/webkitpy/steps/completerollout.pyc
deleted file mode 100644
index 47312b8..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/completerollout.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/confirmdiff.pyc b/WebKitTools/Scripts/webkitpy/steps/confirmdiff.pyc
deleted file mode 100644
index d3fc1d4..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/confirmdiff.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/createbug.pyc b/WebKitTools/Scripts/webkitpy/steps/createbug.pyc
deleted file mode 100644
index e27f5ec..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/createbug.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/editchangelog.pyc b/WebKitTools/Scripts/webkitpy/steps/editchangelog.pyc
deleted file mode 100644
index 2ca5dbf..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/editchangelog.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.pyc b/WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.pyc
deleted file mode 100644
index dd98935..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.pyc b/WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.pyc
deleted file mode 100644
index 18ce98a..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/metastep.pyc b/WebKitTools/Scripts/webkitpy/steps/metastep.pyc
deleted file mode 100644
index 21d2bf6..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/metastep.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/obsoletepatches.pyc b/WebKitTools/Scripts/webkitpy/steps/obsoletepatches.pyc
deleted file mode 100644
index 4586950..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/obsoletepatches.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/options.pyc b/WebKitTools/Scripts/webkitpy/steps/options.pyc
deleted file mode 100644
index 7634605..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/options.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/postdiff.pyc b/WebKitTools/Scripts/webkitpy/steps/postdiff.pyc
deleted file mode 100644
index 82f1c09..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/postdiff.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/preparechangelog.pyc b/WebKitTools/Scripts/webkitpy/steps/preparechangelog.pyc
deleted file mode 100644
index 2f6edbd..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/preparechangelog.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.pyc b/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.pyc
deleted file mode 100644
index c1f0ca4..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.pyc b/WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.pyc
deleted file mode 100644
index fdca409..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/revertrevision.pyc b/WebKitTools/Scripts/webkitpy/steps/revertrevision.pyc
deleted file mode 100644
index ec08b1f..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/revertrevision.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/runtests.pyc b/WebKitTools/Scripts/webkitpy/steps/runtests.pyc
deleted file mode 100644
index 16908fb..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/runtests.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/update.pyc b/WebKitTools/Scripts/webkitpy/steps/update.pyc
deleted file mode 100644
index 0b9e7e9..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/update.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.pyc b/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.pyc
deleted file mode 100644
index 6c9b7fd..0000000
--- a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/stepsequence.pyc b/WebKitTools/Scripts/webkitpy/stepsequence.pyc
deleted file mode 100644
index 4b3505e..0000000
--- a/WebKitTools/Scripts/webkitpy/stepsequence.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/style/checker.py b/WebKitTools/Scripts/webkitpy/style/checker.py
index fbda8cb..e10eec5 100644
--- a/WebKitTools/Scripts/webkitpy/style/checker.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker.py
@@ -1,5 +1,6 @@
# Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+# Copyright (C) 2010 ProFUSION embedded systems
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -29,25 +30,27 @@
"""Front end of some style-checker modules."""
-import codecs
-import getopt
+import logging
import os.path
import sys
-from .. style_references import parse_patch
+from checkers.common import categories as CommonCategories
+from checkers.common import CarriageReturnChecker
+from checkers.cpp import CppChecker
+from checkers.python import PythonChecker
+from checkers.test_expectations import TestExpectationsChecker
+from checkers.text import TextChecker
from error_handlers import DefaultStyleErrorHandler
-from error_handlers import PatchStyleErrorHandler
-from filter import validate_filter_rules
from filter import FilterConfiguration
-from processors.common import check_no_carriage_return
-from processors.common import categories as CommonCategories
-from processors.cpp import CppProcessor
-from processors.text import TextProcessor
+from optparser import ArgumentParser
+from optparser import DefaultCommandOptionValues
+from webkitpy.style_references import configure_logging as _configure_logging
+_log = logging.getLogger("webkitpy.style.checker")
-# These defaults are used by check-webkit-style.
-WEBKIT_DEFAULT_VERBOSITY = 1
-WEBKIT_DEFAULT_OUTPUT_FORMAT = 'emacs'
+# These are default option values for the command-line option parser.
+_DEFAULT_MIN_CONFIDENCE = 1
+_DEFAULT_OUTPUT_FORMAT = 'emacs'
# FIXME: For style categories we will never want to have, remove them.
@@ -55,14 +58,16 @@ WEBKIT_DEFAULT_OUTPUT_FORMAT = 'emacs'
# modify the implementation and enable them.
#
# Throughout this module, we use "filter rule" rather than "filter"
-# for an individual boolean filter flag like "+foo". This allows us to
+# for an individual boolean filter flag like "+foo". This allows us to
# reserve "filter" for what one gets by collectively applying all of
# the filter rules.
#
-# The _WEBKIT_FILTER_RULES are prepended to any user-specified filter
-# rules. Since by default all errors are on, only include rules that
-# begin with a - sign.
-WEBKIT_DEFAULT_FILTER_RULES = [
+# The base filter rules are the filter rules that begin the list of
+# filter rules used to check style. For example, these rules precede
+# any user-specified filter rules. Since by default all categories are
+# checked, this list should normally include only rules that begin
+# with a "-" sign.
+_BASE_FILTER_RULES = [
'-build/endif_comment',
'-build/include_what_you_use', # <string> for std::string
'-build/storage_class', # const static
@@ -83,548 +88,359 @@ WEBKIT_DEFAULT_FILTER_RULES = [
'-whitespace/blank_line',
'-whitespace/end_of_line',
'-whitespace/labels',
+ # List Python pep8 categories last.
+ #
+ # Because much of WebKit's Python code base does not abide by the
+ # PEP8 79 character limit, we ignore the 79-character-limit category
+ # pep8/E501 for now.
+ #
+ # FIXME: Consider bringing WebKit's Python code base into conformance
+ # with the 79 character limit, or some higher limit that is
+ # agreeable to the WebKit project.
+ '-pep8/E501',
]
-# FIXME: Change the second value of each tuple from a tuple to a list,
-# and alter the filter code so it accepts lists instead. (The
-# filter code will need to convert incoming values from a list
-# to a tuple prior to caching). This will make this
-# configuration setting a bit simpler since tuples have an
-# unusual syntax case.
-#
# The path-specific filter rules.
#
# This list is order sensitive. Only the first path substring match
# is used. See the FilterConfiguration documentation in filter.py
# for more information on this list.
+#
+# Each string appearing in this nested list should have at least
+# one associated unit test assertion. These assertions are located,
+# for example, in the test_path_rules_specifier() unit test method of
+# checker_unittest.py.
_PATH_RULES_SPECIFIER = [
# Files in these directories are consumers of the WebKit
# API and therefore do not follow the same header including
# discipline as WebCore.
- (["WebKitTools/WebKitAPITest/",
- "WebKit/qt/QGVLauncher/"],
- ("-build/include",
- "-readability/streams")),
- ([# The GTK+ APIs use GTK+ naming style, which includes
- # lower-cased, underscore-separated values.
- "WebKit/gtk/webkit/",
+
+ ([# TestNetscapePlugIn has no config.h and uses funny names like
+ # NPP_SetWindow.
+ "WebKitTools/DumpRenderTree/TestNetscapePlugIn/",
+ # The API test harnesses have no config.h and use funny macros like
+ # TEST_CLASS_NAME.
+ "WebKitTools/WebKitAPITest/",
+ "WebKitTools/TestWebKitAPI/"],
+ ["-build/include",
+ "-readability/naming"]),
+ ([# The EFL APIs use EFL naming style, which includes
+ # both lower-cased and camel-cased, underscore-sparated
+ # values.
+ "WebKit/efl/ewk/",
# There is no clean way to avoid "yy_*" names used by flex.
"WebCore/css/CSSParser.cpp",
- # There is no clean way to avoid "xxx_data" methods inside
- # Qt's autotests since they are called automatically by the
- # QtTest module.
+ # Qt code uses '_' in some places (such as private slots
+ # and on test xxx_data methos on tests)
+ "JavaScriptCore/qt/api/",
+ "WebKit/qt/Api/",
"WebKit/qt/tests/",
- "JavaScriptCore/qt/tests"],
- ("-readability/naming",)),
- # These are test file patterns.
- (["_test.cpp",
- "_unittest.cpp",
- "_regtest.cpp"],
- ("-readability/streams", # Many unit tests use cout.
- "-runtime/rtti")),
+ "WebKit/qt/declarative/",
+ "WebKit/qt/examples/"],
+ ["-readability/naming"]),
+ ([# The GTK+ APIs use GTK+ naming style, which includes
+ # lower-cased, underscore-separated values.
+ # Also, GTK+ allows the use of NULL.
+ "WebCore/bindings/scripts/test/GObject",
+ "WebKit/gtk/webkit/",
+ "WebKitTools/DumpRenderTree/gtk/"],
+ ["-readability/naming",
+ "-readability/null"]),
+ ([# Header files in ForwardingHeaders have no header guards or
+ # exceptional header guards (e.g., WebCore_FWD_Debugger_h).
+ "/ForwardingHeaders/"],
+ ["-build/header_guard"]),
+ ([# assembler has lots of opcodes that use underscores, so
+ # we don't check for underscores in that directory.
+ "/JavaScriptCore/assembler/"],
+ ["-readability/naming"]),
+
+ # WebKit2 rules:
+ # WebKit2 doesn't use config.h, and certain directories have other
+ # idiosyncracies.
+ ([# NPAPI has function names with underscores.
+ "WebKit2/WebProcess/Plugins/Netscape"],
+ ["-build/include_order",
+ "-readability/naming"]),
+ ([# The WebKit2 C API has names with underscores and whitespace-aligned
+ # struct members.
+ "WebKit2/UIProcess/API/C/",
+ "WebKit2/WebProcess/InjectedBundle/API/c/"],
+ ["-build/include_order",
+ "-readability/naming",
+ "-whitespace/declaration"]),
+ ([# Nothing in WebKit2 uses config.h.
+ "WebKit2/"],
+ ["-build/include_order"]),
+
+ # For third-party Python code, keep only the following checks--
+ #
+ # No tabs: to avoid having to set the SVN allow-tabs property.
+ # No trailing white space: since this is easy to correct.
+ # No carriage-return line endings: since this is easy to correct.
+ #
+ (["webkitpy/thirdparty/"],
+ ["-",
+ "+pep8/W191", # Tabs
+ "+pep8/W291", # Trailing white space
+ "+whitespace/carriage_return"]),
]
+_CPP_FILE_EXTENSIONS = [
+ 'c',
+ 'cpp',
+ 'h',
+ ]
+
+_PYTHON_FILE_EXTENSION = 'py'
+
+# FIXME: Include 'vcproj' files as text files after creating a mechanism
+# for exempting them from the carriage-return checker (since they
+# are Windows-only files).
+_TEXT_FILE_EXTENSIONS = [
+ 'ac',
+ 'cc',
+ 'cgi',
+ 'css',
+ 'exp',
+ 'flex',
+ 'gyp',
+ 'gypi',
+ 'html',
+ 'idl',
+ 'in',
+ 'js',
+ 'mm',
+ 'php',
+ 'pl',
+ 'pm',
+ 'pri',
+ 'pro',
+ 'rb',
+ 'sh',
+ 'txt',
+# 'vcproj', # See FIXME above.
+ 'wm',
+ 'xhtml',
+ 'y',
+ ]
+
+
+# Files to skip that are less obvious.
+#
# Some files should be skipped when checking style. For example,
# WebKit maintains some files in Mozilla style on purpose to ease
# future merges.
-#
-# Include a warning for skipped files that are less obvious.
-SKIPPED_FILES_WITH_WARNING = [
- # The Qt API and tests do not follow WebKit style.
- # They follow Qt style. :)
+_SKIPPED_FILES_WITH_WARNING = [
"gtk2drawing.c", # WebCore/platform/gtk/gtk2drawing.c
- "gtk2drawing.h", # WebCore/platform/gtk/gtk2drawing.h
- "JavaScriptCore/qt/api/",
+ "gtkdrawing.h", # WebCore/platform/gtk/gtkdrawing.h
"WebKit/gtk/tests/",
- "WebKit/qt/Api/",
- "WebKit/qt/tests/",
+ # Soup API that is still being cooked, will be removed from WebKit
+ # in a few months when it is merged into soup proper. The style
+ # follows the libsoup style completely.
+ "WebCore/platform/network/soup/cache/",
]
-# Don't include a warning for skipped files that are more common
-# and more obvious.
-SKIPPED_FILES_WITHOUT_WARNING = [
- "LayoutTests/"
+# Files to skip that are more common or obvious.
+#
+# This list should be in addition to files with FileType.NONE. Files
+# with FileType.NONE are automatically skipped without warning.
+_SKIPPED_FILES_WITHOUT_WARNING = [
+ "LayoutTests/",
]
# The maximum number of errors to report per file, per category.
# If a category is not a key, then it has no maximum.
-MAX_REPORTS_PER_CATEGORY = {
+_MAX_REPORTS_PER_CATEGORY = {
"whitespace/carriage_return": 1
}
-def style_categories():
+def _all_categories():
"""Return the set of all categories used by check-webkit-style."""
- # Take the union across all processors.
- return CommonCategories.union(CppProcessor.categories)
-
-
-def webkit_argument_defaults():
- """Return the DefaultArguments instance for use by check-webkit-style."""
- return ArgumentDefaults(WEBKIT_DEFAULT_OUTPUT_FORMAT,
- WEBKIT_DEFAULT_VERBOSITY,
- WEBKIT_DEFAULT_FILTER_RULES)
-
-
-def _create_usage(defaults):
- """Return the usage string to display for command help.
+ # Take the union across all checkers.
+ categories = CommonCategories.union(CppChecker.categories)
+ categories = categories.union(TestExpectationsChecker.categories)
- Args:
- defaults: An ArgumentDefaults instance.
-
- """
- usage = """
-Syntax: %(program_name)s [--verbose=#] [--git-commit=<SingleCommit>] [--output=vs7]
- [--filter=-x,+y,...] [file] ...
-
- The style guidelines this tries to follow are here:
- http://webkit.org/coding/coding-style.html
-
- Every style error is given a confidence score from 1-5, with 5 meaning
- we are certain of the problem, and 1 meaning it could be a legitimate
- construct. This can miss some errors and does not substitute for
- code review.
-
- To prevent specific lines from being linted, add a '// NOLINT' comment to the
- end of the line.
-
- Linted extensions are .cpp, .c and .h. Other file types are ignored.
-
- The file parameter is optional and accepts multiple files. Leaving
- out the file parameter applies the check to all files considered changed
- by your source control management system.
-
- Flags:
-
- verbose=#
- A number 1-5 that restricts output to errors with a confidence
- score at or above this value. In particular, the value 1 displays
- all errors. The default is %(default_verbosity)s.
-
- git-commit=<SingleCommit>
- Checks the style of everything from the given commit to the local tree.
+ # FIXME: Consider adding all of the pep8 categories. Since they
+ # are not too meaningful for documentation purposes, for
+ # now we add only the categories needed for the unit tests
+ # (which validate the consistency of the configuration
+ # settings against the known categories, etc).
+ categories = categories.union(["pep8/W191", "pep8/W291", "pep8/E501"])
- output=vs7
- The output format, which may be one of
- emacs : to ease emacs parsing
- vs7 : compatible with Visual Studio
- Defaults to "%(default_output_format)s". Other formats are unsupported.
+ return categories
- filter=-x,+y,...
- A comma-separated list of boolean filter rules used to filter
- which categories of style guidelines to check. The script checks
- a category if the category passes the filter rules, as follows.
- Any webkit category starts out passing. All filter rules are then
- evaluated left to right, with later rules taking precedence. For
- example, the rule "+foo" passes any category that starts with "foo",
- and "-foo" fails any such category. The filter input "-whitespace,
- +whitespace/braces" fails the category "whitespace/tab" and passes
- "whitespace/braces".
-
- Examples: --filter=-whitespace,+whitespace/braces
- --filter=-whitespace,-runtime/printf,+runtime/printf_format
- --filter=-,+build/include_what_you_use
-
- Category names appear in error messages in brackets, for example
- [whitespace/indent]. To see a list of all categories available to
- %(program_name)s, along with which are enabled by default, pass
- the empty filter as follows:
- --filter=
-""" % {'program_name': os.path.basename(sys.argv[0]),
- 'default_verbosity': defaults.verbosity,
- 'default_output_format': defaults.output_format}
-
- return usage
-
-
-# FIXME: Eliminate support for "extra_flag_values".
-#
-# FIXME: Remove everything from ProcessorOptions except for the
-# information that can be passed via the command line, and
-# rename to something like CheckWebKitStyleOptions. This
-# includes, but is not limited to, removing the
-# max_reports_per_error attribute and the is_reportable()
-# method. See also the FIXME below to create a new class
-# called something like CheckerConfiguration.
-#
-# This class should not have knowledge of the flag key names.
-class ProcessorOptions(object):
-
- """A container to store options passed via the command line.
-
- Attributes:
- extra_flag_values: A string-string dictionary of all flag key-value
- pairs that are not otherwise represented by this
- class. The default is the empty dictionary.
+def _check_webkit_style_defaults():
+ """Return the default command-line options for check-webkit-style."""
+ return DefaultCommandOptionValues(min_confidence=_DEFAULT_MIN_CONFIDENCE,
+ output_format=_DEFAULT_OUTPUT_FORMAT)
- filter_configuration: A FilterConfiguration instance. The default
- is the "empty" filter configuration, which
- means that all errors should be checked.
- git_commit: A string representing the git commit to check.
- The default is None.
+# This function assists in optparser not having to import from checker.
+def check_webkit_style_parser():
+ all_categories = _all_categories()
+ default_options = _check_webkit_style_defaults()
+ return ArgumentParser(all_categories=all_categories,
+ base_filter_rules=_BASE_FILTER_RULES,
+ default_options=default_options)
- max_reports_per_error: The maximum number of errors to report
- per file, per category.
- output_format: A string that is the output format. The supported
- output formats are "emacs" which emacs can parse
- and "vs7" which Microsoft Visual Studio 7 can parse.
+def check_webkit_style_configuration(options):
+ """Return a StyleProcessorConfiguration instance for check-webkit-style.
- verbosity: An integer between 1-5 inclusive that restricts output
- to errors with a confidence score at or above this value.
- The default is 1, which reports all errors.
+ Args:
+ options: A CommandOptionValues instance.
"""
- def __init__(self,
- extra_flag_values=None,
- filter_configuration = None,
- git_commit=None,
- max_reports_per_category=None,
- output_format="emacs",
- verbosity=1):
- if extra_flag_values is None:
- extra_flag_values = {}
- if filter_configuration is None:
- filter_configuration = FilterConfiguration()
- if max_reports_per_category is None:
- max_reports_per_category = {}
-
- if output_format not in ("emacs", "vs7"):
- raise ValueError('Invalid "output_format" parameter: '
- 'value must be "emacs" or "vs7". '
- 'Value given: "%s".' % output_format)
-
- if (verbosity < 1) or (verbosity > 5):
- raise ValueError('Invalid "verbosity" parameter: '
- "value must be an integer between 1-5 inclusive. "
- 'Value given: "%s".' % verbosity)
-
- self.extra_flag_values = extra_flag_values
- self.filter_configuration = filter_configuration
- self.git_commit = git_commit
- self.max_reports_per_category = max_reports_per_category
- self.output_format = output_format
- self.verbosity = verbosity
+ filter_configuration = FilterConfiguration(
+ base_rules=_BASE_FILTER_RULES,
+ path_specific=_PATH_RULES_SPECIFIER,
+ user_rules=options.filter_rules)
- # Useful for unit testing.
- def __eq__(self, other):
- """Return whether this ProcessorOptions instance is equal to another."""
- if self.extra_flag_values != other.extra_flag_values:
- return False
- if self.filter_configuration != other.filter_configuration:
- return False
- if self.git_commit != other.git_commit:
- return False
- if self.max_reports_per_category != other.max_reports_per_category:
- return False
- if self.output_format != other.output_format:
- return False
- if self.verbosity != other.verbosity:
- return False
-
- return True
-
- # Useful for unit testing.
- def __ne__(self, other):
- # Python does not automatically deduce this from __eq__().
- return not self.__eq__(other)
-
- def is_reportable(self, category, confidence_in_error, path):
- """Return whether an error is reportable.
-
- An error is reportable if the confidence in the error
- is at least the current verbosity level, and if the current
- filter says that the category should be checked for the
- given path.
-
- Args:
- category: A string that is a style category.
- confidence_in_error: An integer between 1 and 5, inclusive, that
- represents the application's confidence in
- the error. A higher number signifies greater
- confidence.
- path: The path of the file being checked
-
- """
- if confidence_in_error < self.verbosity:
- return False
+ return StyleProcessorConfiguration(filter_configuration=filter_configuration,
+ max_reports_per_category=_MAX_REPORTS_PER_CATEGORY,
+ min_confidence=options.min_confidence,
+ output_format=options.output_format,
+ stderr_write=sys.stderr.write)
- return self.filter_configuration.should_check(category, path)
+def _create_log_handlers(stream):
+ """Create and return a default list of logging.Handler instances.
-# This class should not have knowledge of the flag key names.
-class ArgumentDefaults(object):
+ Format WARNING messages and above to display the logging level, and
+ messages strictly below WARNING not to display it.
- """A container to store default argument values.
-
- Attributes:
- output_format: A string that is the default output format.
- verbosity: An integer that is the default verbosity level.
- base_filter_rules: A list of strings that are boolean filter rules
- to prepend to any user-specified rules.
+ Args:
+ stream: See the configure_logging() docstring.
"""
+ # Handles logging.WARNING and above.
+ error_handler = logging.StreamHandler(stream)
+ error_handler.setLevel(logging.WARNING)
+ formatter = logging.Formatter("%(levelname)s: %(message)s")
+ error_handler.setFormatter(formatter)
- def __init__(self, default_output_format, default_verbosity,
- default_base_filter_rules):
- self.output_format = default_output_format
- self.verbosity = default_verbosity
- self.base_filter_rules = default_base_filter_rules
-
-
-class ArgumentPrinter(object):
-
- """Supports the printing of check-webkit-style command arguments."""
-
- def _flag_pair_to_string(self, flag_key, flag_value):
- return '--%(key)s=%(val)s' % {'key': flag_key, 'val': flag_value }
-
- def to_flag_string(self, options):
- """Return a flag string yielding the given ProcessorOptions instance.
-
- This method orders the flag values alphabetically by the flag key.
-
- Args:
- options: A ProcessorOptions instance.
-
- """
- flags = options.extra_flag_values.copy()
-
- flags['output'] = options.output_format
- flags['verbose'] = options.verbosity
- # Only include the filter flag if user-provided rules are present.
- user_rules = options.filter_configuration.user_rules
- if user_rules:
- flags['filter'] = ",".join(user_rules)
- if options.git_commit:
- flags['git-commit'] = options.git_commit
-
- flag_string = ''
- # Alphabetizing lets us unit test this method.
- for key in sorted(flags.keys()):
- flag_string += self._flag_pair_to_string(key, flags[key]) + ' '
+ # Create a logging.Filter instance that only accepts messages
+ # below WARNING (i.e. filters out anything WARNING or above).
+ non_error_filter = logging.Filter()
+ # The filter method accepts a logging.LogRecord instance.
+ non_error_filter.filter = lambda record: record.levelno < logging.WARNING
- return flag_string.strip()
+ non_error_handler = logging.StreamHandler(stream)
+ non_error_handler.addFilter(non_error_filter)
+ formatter = logging.Formatter("%(message)s")
+ non_error_handler.setFormatter(formatter)
+ return [error_handler, non_error_handler]
-class ArgumentParser(object):
- """Supports the parsing of check-webkit-style command arguments.
+def _create_debug_log_handlers(stream):
+ """Create and return a list of logging.Handler instances for debugging.
- Attributes:
- defaults: An ArgumentDefaults instance.
- create_usage: A function that accepts an ArgumentDefaults instance
- and returns a string of usage instructions.
- This defaults to the function used to generate the
- usage string for check-webkit-style.
- doc_print: A function that accepts a string parameter and that is
- called to display help messages. This defaults to
- sys.stderr.write().
+ Args:
+ stream: See the configure_logging() docstring.
"""
+ handler = logging.StreamHandler(stream)
+ formatter = logging.Formatter("%(name)s: %(levelname)-8s %(message)s")
+ handler.setFormatter(formatter)
- def __init__(self, argument_defaults, create_usage=None, doc_print=None):
- if create_usage is None:
- create_usage = _create_usage
- if doc_print is None:
- doc_print = sys.stderr.write
+ return [handler]
- self.defaults = argument_defaults
- self.create_usage = create_usage
- self.doc_print = doc_print
- def _exit_with_usage(self, error_message=''):
- """Exit and print a usage string with an optional error message.
+def configure_logging(stream, logger=None, is_verbose=False):
+ """Configure logging, and return the list of handlers added.
- Args:
- error_message: A string that is an error message to print.
+ Returns:
+ A list of references to the logging handlers added to the root
+ logger. This allows the caller to later remove the handlers
+ using logger.removeHandler. This is useful primarily during unit
+ testing where the caller may want to configure logging temporarily
+ and then undo the configuring.
- """
- usage = self.create_usage(self.defaults)
- self.doc_print(usage)
- if error_message:
- sys.exit('\nFATAL ERROR: ' + error_message)
- else:
- sys.exit(1)
-
- def _exit_with_categories(self):
- """Exit and print the style categories and default filter rules."""
- self.doc_print('\nAll categories:\n')
- categories = style_categories()
- for category in sorted(categories):
- self.doc_print(' ' + category + '\n')
-
- self.doc_print('\nDefault filter rules**:\n')
- for filter_rule in sorted(self.defaults.base_filter_rules):
- self.doc_print(' ' + filter_rule + '\n')
- self.doc_print('\n**The command always evaluates the above rules, '
- 'and before any --filter flag.\n\n')
-
- sys.exit(0)
-
- def _parse_filter_flag(self, flag_value):
- """Parse the --filter flag, and return a list of filter rules.
-
- Args:
- flag_value: A string of comma-separated filter rules, for
- example "-whitespace,+whitespace/indent".
-
- """
- filters = []
- for uncleaned_filter in flag_value.split(','):
- filter = uncleaned_filter.strip()
- if not filter:
- continue
- filters.append(filter)
- return filters
-
- def parse(self, args, extra_flags=None):
- """Parse the command line arguments to check-webkit-style.
-
- Args:
- args: A list of command-line arguments as returned by sys.argv[1:].
- extra_flags: A list of flags whose values we want to extract, but
- are not supported by the ProcessorOptions class.
- An example flag "new_flag=". This defaults to the
- empty list.
-
- Returns:
- A tuple of (filenames, options)
-
- filenames: The list of filenames to check.
- options: A ProcessorOptions instance.
-
- """
- if extra_flags is None:
- extra_flags = []
-
- output_format = self.defaults.output_format
- verbosity = self.defaults.verbosity
- base_rules = self.defaults.base_filter_rules
-
- # The flags already supported by the ProcessorOptions class.
- flags = ['help', 'output=', 'verbose=', 'filter=', 'git-commit=']
-
- for extra_flag in extra_flags:
- if extra_flag in flags:
- raise ValueError('Flag \'%(extra_flag)s is duplicated '
- 'or already supported.' %
- {'extra_flag': extra_flag})
- flags.append(extra_flag)
-
- try:
- (opts, filenames) = getopt.getopt(args, '', flags)
- except getopt.GetoptError:
- # FIXME: Settle on an error handling approach: come up
- # with a consistent guideline as to when and whether
- # a ValueError should be raised versus calling
- # sys.exit when needing to interrupt execution.
- self._exit_with_usage('Invalid arguments.')
-
- extra_flag_values = {}
- git_commit = None
- user_rules = []
-
- for (opt, val) in opts:
- if opt == '--help':
- self._exit_with_usage()
- elif opt == '--output':
- output_format = val
- elif opt == '--verbose':
- verbosity = val
- elif opt == '--git-commit':
- git_commit = val
- elif opt == '--filter':
- if not val:
- self._exit_with_categories()
- # Prepend the defaults.
- user_rules = self._parse_filter_flag(val)
- else:
- extra_flag_values[opt] = val
-
- # Check validity of resulting values.
- if filenames and (git_commit != None):
- self._exit_with_usage('It is not possible to check files and a '
- 'specific commit at the same time.')
-
- if output_format not in ('emacs', 'vs7'):
- raise ValueError('Invalid --output value "%s": The only '
- 'allowed output formats are emacs and vs7.' %
- output_format)
-
- all_categories = style_categories()
- validate_filter_rules(user_rules, all_categories)
-
- verbosity = int(verbosity)
- if (verbosity < 1) or (verbosity > 5):
- raise ValueError('Invalid --verbose value %s: value must '
- 'be between 1-5.' % verbosity)
-
- filter_configuration = FilterConfiguration(base_rules=base_rules,
- path_specific=_PATH_RULES_SPECIFIER,
- user_rules=user_rules)
-
- options = ProcessorOptions(extra_flag_values=extra_flag_values,
- filter_configuration=filter_configuration,
- git_commit=git_commit,
- max_reports_per_category=MAX_REPORTS_PER_CATEGORY,
- output_format=output_format,
- verbosity=verbosity)
+ Args:
+ stream: A file-like object to which to log. The stream must
+ define an "encoding" data attribute, or else logging
+ raises an error.
+ logger: A logging.logger instance to configure. This parameter
+ should be used only in unit tests. Defaults to the
+ root logger.
+ is_verbose: A boolean value of whether logging should be verbose.
- return (filenames, options)
+ """
+ # If the stream does not define an "encoding" data attribute, the
+ # logging module can throw an error like the following:
+ #
+ # Traceback (most recent call last):
+ # File "/System/Library/Frameworks/Python.framework/Versions/2.6/...
+ # lib/python2.6/logging/__init__.py", line 761, in emit
+ # self.stream.write(fs % msg.encode(self.stream.encoding))
+ # LookupError: unknown encoding: unknown
+ if logger is None:
+ logger = logging.getLogger()
+
+ if is_verbose:
+ logging_level = logging.DEBUG
+ handlers = _create_debug_log_handlers(stream)
+ else:
+ logging_level = logging.INFO
+ handlers = _create_log_handlers(stream)
+
+ handlers = _configure_logging(logging_level=logging_level, logger=logger,
+ handlers=handlers)
+
+ return handlers
# Enum-like idiom
class FileType:
- NONE = 1
+ NONE = 0 # FileType.NONE evaluates to False.
# Alphabetize remaining types
- CPP = 2
+ CPP = 1
+ PYTHON = 2
TEXT = 3
-class ProcessorDispatcher(object):
+class CheckerDispatcher(object):
"""Supports determining whether and how to check style, based on path."""
- cpp_file_extensions = (
- 'c',
- 'cpp',
- 'h',
- )
-
- text_file_extensions = (
- 'css',
- 'html',
- 'idl',
- 'js',
- 'mm',
- 'php',
- 'pm',
- 'py',
- 'txt',
- )
-
def _file_extension(self, file_path):
"""Return the file extension without the leading dot."""
return os.path.splitext(file_path)[1].lstrip(".")
def should_skip_with_warning(self, file_path):
"""Return whether the given file should be skipped with a warning."""
- for skipped_file in SKIPPED_FILES_WITH_WARNING:
+ for skipped_file in _SKIPPED_FILES_WITH_WARNING:
if file_path.find(skipped_file) >= 0:
return True
return False
def should_skip_without_warning(self, file_path):
"""Return whether the given file should be skipped without a warning."""
- for skipped_file in SKIPPED_FILES_WITHOUT_WARNING:
+ if not self._file_type(file_path): # FileType.NONE.
+ return True
+ # Since "LayoutTests" is in _SKIPPED_FILES_WITHOUT_WARNING, make
+ # an exception to prevent files like "LayoutTests/ChangeLog" and
+ # "LayoutTests/ChangeLog-2009-06-16" from being skipped.
+ # Files like 'test_expectations.txt' and 'drt_expectations.txt'
+ # are also should not be skipped.
+ #
+ # FIXME: Figure out a good way to avoid having to add special logic
+ # for this special case.
+ basename = os.path.basename(file_path)
+ if basename.startswith('ChangeLog'):
+ return False
+ elif basename == 'test_expectations.txt' or basename == 'drt_expectations.txt':
+ return False
+ for skipped_file in _SKIPPED_FILES_WITHOUT_WARNING:
if file_path.find(skipped_file) >= 0:
return True
return False
@@ -633,7 +449,7 @@ class ProcessorDispatcher(object):
"""Return the file type corresponding to the given file."""
file_extension = self._file_extension(file_path)
- if (file_extension in self.cpp_file_extensions) or (file_path == '-'):
+ if (file_extension in _CPP_FILE_EXTENSIONS) or (file_path == '-'):
# FIXME: Do something about the comment below and the issue it
# raises since cpp_style already relies on the extension.
#
@@ -641,22 +457,32 @@ class ProcessorDispatcher(object):
# reading from stdin, cpp_style tests should not rely on
# the extension.
return FileType.CPP
- elif ("ChangeLog" in file_path
- or "WebKitTools/Scripts/" in file_path
- or file_extension in self.text_file_extensions):
+ elif file_extension == _PYTHON_FILE_EXTENSION:
+ return FileType.PYTHON
+ elif (os.path.basename(file_path).startswith('ChangeLog') or
+ (not file_extension and "WebKitTools/Scripts/" in file_path) or
+ file_extension in _TEXT_FILE_EXTENSIONS):
return FileType.TEXT
else:
return FileType.NONE
- def _create_processor(self, file_type, file_path, handle_style_error, verbosity):
- """Instantiate and return a style processor based on file type."""
+ def _create_checker(self, file_type, file_path, handle_style_error,
+ min_confidence):
+ """Instantiate and return a style checker based on file type."""
if file_type == FileType.NONE:
- processor = None
+ checker = None
elif file_type == FileType.CPP:
file_extension = self._file_extension(file_path)
- processor = CppProcessor(file_path, file_extension, handle_style_error, verbosity)
+ checker = CppChecker(file_path, file_extension,
+ handle_style_error, min_confidence)
+ elif file_type == FileType.PYTHON:
+ checker = PythonChecker(file_path, handle_style_error)
elif file_type == FileType.TEXT:
- processor = TextProcessor(file_path, handle_style_error)
+ basename = os.path.basename(file_path)
+ if basename == 'test_expectations.txt' or basename == 'drt_expectations.txt':
+ checker = TestExpectationsChecker(file_path, handle_style_error)
+ else:
+ checker = TextChecker(file_path, handle_style_error)
else:
raise ValueError('Invalid file type "%(file_type)s": the only valid file types '
"are %(NONE)s, %(CPP)s, and %(TEXT)s."
@@ -665,164 +491,249 @@ class ProcessorDispatcher(object):
"CPP": FileType.CPP,
"TEXT": FileType.TEXT})
- return processor
+ return checker
- def dispatch_processor(self, file_path, handle_style_error, verbosity):
- """Instantiate and return a style processor based on file path."""
+ def dispatch(self, file_path, handle_style_error, min_confidence):
+ """Instantiate and return a style checker based on file path."""
file_type = self._file_type(file_path)
- processor = self._create_processor(file_type,
- file_path,
- handle_style_error,
- verbosity)
- return processor
+ checker = self._create_checker(file_type,
+ file_path,
+ handle_style_error,
+ min_confidence)
+ return checker
-# FIXME: When creating the new CheckWebKitStyleOptions class as
-# described in a FIXME above, add a new class here called
-# something like CheckerConfiguration. The class should contain
-# attributes for options needed to process a file. This includes
-# a subset of the CheckWebKitStyleOptions attributes, a
-# FilterConfiguration attribute, an stderr_write attribute, a
-# max_reports_per_category attribute, etc. It can also include
-# the is_reportable() method. The StyleChecker should accept
-# an instance of this class rather than a ProcessorOptions
-# instance.
+# FIXME: Remove the stderr_write attribute from this class and replace
+# its use with calls to a logging module logger.
+class StyleProcessorConfiguration(object):
+ """Stores configuration values for the StyleProcessor class.
-class StyleChecker(object):
+ Attributes:
+ min_confidence: An integer between 1 and 5 inclusive that is the
+ minimum confidence level of style errors to report.
- """Supports checking style in files and patches.
+ max_reports_per_category: The maximum number of errors to report
+ per category, per file.
- Attributes:
- error_count: An integer that is the total number of reported
- errors for the lifetime of this StyleChecker
- instance.
- options: A ProcessorOptions instance that controls the behavior
- of style checking.
+ stderr_write: A function that takes a string as a parameter and
+ serves as stderr.write.
"""
- def __init__(self, options, stderr_write=None):
- """Create a StyleChecker instance.
+ def __init__(self,
+ filter_configuration,
+ max_reports_per_category,
+ min_confidence,
+ output_format,
+ stderr_write):
+ """Create a StyleProcessorConfiguration instance.
Args:
- options: See options attribute.
- stderr_write: A function that takes a string as a parameter
- and that is called when a style error occurs.
- Defaults to sys.stderr.write. This should be
- used only for unit tests.
+ filter_configuration: A FilterConfiguration instance. The default
+ is the "empty" filter configuration, which
+ means that all errors should be checked.
+
+ max_reports_per_category: The maximum number of errors to report
+ per category, per file.
+
+ min_confidence: An integer between 1 and 5 inclusive that is the
+ minimum confidence level of style errors to report.
+ The default is 1, which reports all style errors.
+
+ output_format: A string that is the output format. The supported
+ output formats are "emacs" which emacs can parse
+ and "vs7" which Microsoft Visual Studio 7 can parse.
+
+ stderr_write: A function that takes a string as a parameter and
+ serves as stderr.write.
"""
- if stderr_write is None:
- stderr_write = sys.stderr.write
+ self._filter_configuration = filter_configuration
+ self._output_format = output_format
- self._stderr_write = stderr_write
- self.error_count = 0
- self.options = options
-
- def _increment_error_count(self):
- """Increment the total count of reported errors."""
- self.error_count += 1
-
- def _process_file(self, processor, file_path, handle_style_error):
- """Process the file using the given processor."""
- try:
- # Support the UNIX convention of using "-" for stdin. Note that
- # we are not opening the file with universal newline support
- # (which codecs doesn't support anyway), so the resulting lines do
- # contain trailing '\r' characters if we are reading a file that
- # has CRLF endings.
- # If after the split a trailing '\r' is present, it is removed
- # below. If it is not expected to be present (i.e. os.linesep !=
- # '\r\n' as in Windows), a warning is issued below if this file
- # is processed.
- if file_path == '-':
- file = codecs.StreamReaderWriter(sys.stdin,
- codecs.getreader('utf8'),
- codecs.getwriter('utf8'),
- 'replace')
- else:
- file = codecs.open(file_path, 'r', 'utf8', 'replace')
+ self.max_reports_per_category = max_reports_per_category
+ self.min_confidence = min_confidence
+ self.stderr_write = stderr_write
- contents = file.read()
+ def is_reportable(self, category, confidence_in_error, file_path):
+ """Return whether an error is reportable.
- except IOError:
- self._stderr_write("Skipping input '%s': Can't open for reading\n" % file_path)
- return
+ An error is reportable if both the confidence in the error is
+ at least the minimum confidence level and the current filter
+ says the category should be checked for the given path.
- lines = contents.split("\n")
+ Args:
+ category: A string that is a style category.
+ confidence_in_error: An integer between 1 and 5 inclusive that is
+ the application's confidence in the error.
+ A higher number means greater confidence.
+ file_path: The path of the file being checked
+
+ """
+ if confidence_in_error < self.min_confidence:
+ return False
+
+ return self._filter_configuration.should_check(category, file_path)
+
+ def write_style_error(self,
+ category,
+ confidence_in_error,
+ file_path,
+ line_number,
+ message):
+ """Write a style error to the configured stderr."""
+ if self._output_format == 'vs7':
+ format_string = "%s(%s): %s [%s] [%d]\n"
+ else:
+ format_string = "%s:%s: %s [%s] [%d]\n"
+
+ self.stderr_write(format_string % (file_path,
+ line_number,
+ message,
+ category,
+ confidence_in_error))
- for line_number in range(len(lines)):
- # FIXME: We should probably use the SVN "eol-style" property
- # or a white list to decide whether or not to do
- # the carriage-return check. Originally, we did the
- # check only if (os.linesep != '\r\n').
- #
- # FIXME: As a minor optimization, we can have
- # check_no_carriage_return() return whether
- # the line ends with "\r".
- check_no_carriage_return(lines[line_number], line_number,
- handle_style_error)
- if lines[line_number].endswith("\r"):
- lines[line_number] = lines[line_number].rstrip("\r")
- processor.process(lines)
+class ProcessorBase(object):
+
+ """The base class for processors of lists of lines."""
+
+ def should_process(self, file_path):
+ """Return whether the file at file_path should be processed.
+
+ The TextFileReader class calls this method prior to reading in
+ the lines of a file. Use this method, for example, to prevent
+ the style checker from reading binary files into memory.
+
+ """
+ raise NotImplementedError('Subclasses should implement.')
- def check_file(self, file_path, handle_style_error=None, process_file=None):
- """Check style in the given file.
+ def process(self, lines, file_path, **kwargs):
+ """Process lines of text read from a file.
Args:
- file_path: A string that is the path of the file to process.
- handle_style_error: The function to call when a style error
- occurs. This parameter is meant for internal
- use within this class. Defaults to a
- DefaultStyleErrorHandler instance.
- process_file: The function to call to process the file. This
- parameter should be used only for unit tests.
- Defaults to the file processing method of this class.
+ lines: A list of lines of text to process.
+ file_path: The path from which the lines were read.
+ **kwargs: This argument signifies that the process() method of
+ subclasses of ProcessorBase may support additional
+ keyword arguments.
+ For example, a style checker's check() method
+ may support a "reportable_lines" parameter that represents
+ the line numbers of the lines for which style errors
+ should be reported.
"""
- if handle_style_error is None:
- handle_style_error = DefaultStyleErrorHandler(file_path,
- self.options,
- self._increment_error_count,
- self._stderr_write)
- if process_file is None:
- process_file = self._process_file
-
- dispatcher = ProcessorDispatcher()
-
- if dispatcher.should_skip_without_warning(file_path):
- return
- if dispatcher.should_skip_with_warning(file_path):
- self._stderr_write('Ignoring "%s": this file is exempt from the '
- "style guide.\n" % file_path)
- return
-
- verbosity = self.options.verbosity
- processor = dispatcher.dispatch_processor(file_path,
- handle_style_error,
- verbosity)
- if processor is None:
- return
-
- process_file(processor, file_path, handle_style_error)
-
- def check_patch(self, patch_string):
- """Check style in the given patch.
+ raise NotImplementedError('Subclasses should implement.')
+
+
+class StyleProcessor(ProcessorBase):
+
+ """A ProcessorBase for checking style.
+
+ Attributes:
+ error_count: An integer that is the total number of reported
+ errors for the lifetime of this instance.
+
+ """
+
+ def __init__(self, configuration, mock_dispatcher=None,
+ mock_increment_error_count=None,
+ mock_carriage_checker_class=None):
+ """Create an instance.
Args:
- patch_string: A string that is a patch string.
+ configuration: A StyleProcessorConfiguration instance.
+ mock_dispatcher: A mock CheckerDispatcher instance. This
+ parameter is for unit testing. Defaults to a
+ CheckerDispatcher instance.
+ mock_increment_error_count: A mock error-count incrementer.
+ mock_carriage_checker_class: A mock class for checking and
+ transforming carriage returns.
+ This parameter is for unit testing.
+ Defaults to CarriageReturnChecker.
"""
- patch_files = parse_patch(patch_string)
- for file_path, diff in patch_files.iteritems():
- style_error_handler = PatchStyleErrorHandler(diff,
- file_path,
- self.options,
- self._increment_error_count,
- self._stderr_write)
+ if mock_dispatcher is None:
+ dispatcher = CheckerDispatcher()
+ else:
+ dispatcher = mock_dispatcher
+
+ if mock_increment_error_count is None:
+ # The following blank line is present to avoid flagging by pep8.py.
+
+ def increment_error_count():
+ """Increment the total count of reported errors."""
+ self.error_count += 1
+ else:
+ increment_error_count = mock_increment_error_count
+
+ if mock_carriage_checker_class is None:
+ # This needs to be a class rather than an instance since the
+ # process() method instantiates one using parameters.
+ carriage_checker_class = CarriageReturnChecker
+ else:
+ carriage_checker_class = mock_carriage_checker_class
+
+ self.error_count = 0
+
+ self._carriage_checker_class = carriage_checker_class
+ self._configuration = configuration
+ self._dispatcher = dispatcher
+ self._increment_error_count = increment_error_count
+
+ def should_process(self, file_path):
+ """Return whether the file should be checked for style."""
+ if self._dispatcher.should_skip_without_warning(file_path):
+ return False
+ if self._dispatcher.should_skip_with_warning(file_path):
+ _log.warn('File exempt from style guide. Skipping: "%s"'
+ % file_path)
+ return False
+ return True
+
+ def process(self, lines, file_path, line_numbers=None):
+ """Check the given lines for style.
+
+ Arguments:
+ lines: A list of all lines in the file to check.
+ file_path: The path of the file to process. If possible, the path
+ should be relative to the source root. Otherwise,
+ path-specific logic may not behave as expected.
+ line_numbers: A list of line numbers of the lines for which
+ style errors should be reported, or None if errors
+ for all lines should be reported. When not None, this
+ list normally contains the line numbers corresponding
+ to the modified lines of a patch.
+
+ """
+ _log.debug("Checking style: " + file_path)
+
+ style_error_handler = DefaultStyleErrorHandler(
+ configuration=self._configuration,
+ file_path=file_path,
+ increment_error_count=self._increment_error_count,
+ line_numbers=line_numbers)
+
+ carriage_checker = self._carriage_checker_class(style_error_handler)
+
+ # FIXME: We should probably use the SVN "eol-style" property
+ # or a white list to decide whether or not to do
+ # the carriage-return check. Originally, we did the
+ # check only if (os.linesep != '\r\n').
+ #
+ # Check for and remove trailing carriage returns ("\r").
+ lines = carriage_checker.check(lines)
+
+ min_confidence = self._configuration.min_confidence
+ checker = self._dispatcher.dispatch(file_path,
+ style_error_handler,
+ min_confidence)
+
+ if checker is None:
+ raise AssertionError("File should not be checked: '%s'" % file_path)
- self.check_file(file_path, style_error_handler)
+ _log.debug("Using class: " + checker.__class__.__name__)
+ checker.check(lines)
diff --git a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
index e1c9baf..94d2c29 100755
--- a/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checker_unittest.py
@@ -34,103 +34,119 @@
"""Unit tests for style.py."""
+import logging
+import os
import unittest
import checker as style
+from webkitpy.style_references import LogTesting
+from webkitpy.style_references import TestLogStream
+from checker import _BASE_FILTER_RULES
+from checker import _MAX_REPORTS_PER_CATEGORY
from checker import _PATH_RULES_SPECIFIER as PATH_RULES_SPECIFIER
-from checker import style_categories
-from checker import ProcessorDispatcher
-from checker import ProcessorOptions
-from checker import StyleChecker
+from checker import _all_categories
+from checker import check_webkit_style_configuration
+from checker import check_webkit_style_parser
+from checker import configure_logging
+from checker import CheckerDispatcher
+from checker import ProcessorBase
+from checker import StyleProcessor
+from checker import StyleProcessorConfiguration
+from checkers.cpp import CppChecker
+from checkers.python import PythonChecker
+from checkers.text import TextChecker
+from error_handlers import DefaultStyleErrorHandler
from filter import validate_filter_rules
from filter import FilterConfiguration
-from processors.cpp import CppProcessor
-from processors.text import TextProcessor
+from optparser import ArgumentParser
+from optparser import CommandOptionValues
+from webkitpy.common.system.logtesting import LoggingTestCase
+from webkitpy.style.filereader import TextFileReader
-class ProcessorOptionsTest(unittest.TestCase):
+class ConfigureLoggingTestBase(unittest.TestCase):
- """Tests ProcessorOptions class."""
+ """Base class for testing configure_logging().
- def test_init(self):
- """Test __init__ constructor."""
- # Check default parameters.
- options = ProcessorOptions()
- self.assertEquals(options.extra_flag_values, {})
- self.assertEquals(options.filter_configuration, FilterConfiguration())
- self.assertEquals(options.git_commit, None)
- self.assertEquals(options.max_reports_per_category, {})
- self.assertEquals(options.output_format, "emacs")
- self.assertEquals(options.verbosity, 1)
-
- # Check argument validation.
- self.assertRaises(ValueError, ProcessorOptions, output_format="bad")
- ProcessorOptions(output_format="emacs") # No ValueError: works
- ProcessorOptions(output_format="vs7") # works
- self.assertRaises(ValueError, ProcessorOptions, verbosity=0)
- self.assertRaises(ValueError, ProcessorOptions, verbosity=6)
- ProcessorOptions(verbosity=1) # works
- ProcessorOptions(verbosity=5) # works
-
- # Check attributes.
- filter_configuration = FilterConfiguration(base_rules=["+"])
- options = ProcessorOptions(extra_flag_values={"extra_value" : 2},
- filter_configuration=filter_configuration,
- git_commit="commit",
- max_reports_per_category={"category": 3},
- output_format="vs7",
- verbosity=3)
- self.assertEquals(options.extra_flag_values, {"extra_value" : 2})
- self.assertEquals(options.filter_configuration, filter_configuration)
- self.assertEquals(options.git_commit, "commit")
- self.assertEquals(options.max_reports_per_category, {"category": 3})
- self.assertEquals(options.output_format, "vs7")
- self.assertEquals(options.verbosity, 3)
-
- def test_eq(self):
- """Test __eq__ equality function."""
- # == calls __eq__.
- self.assertTrue(ProcessorOptions() == ProcessorOptions())
-
- # Verify that a difference in any argument causes equality to fail.
- filter_configuration = FilterConfiguration(base_rules=["+"])
- options = ProcessorOptions(extra_flag_values={"extra_value" : 1},
- filter_configuration=filter_configuration,
- git_commit="commit",
- max_reports_per_category={"category": 3},
- output_format="vs7",
- verbosity=1)
- self.assertFalse(options == ProcessorOptions(extra_flag_values={"extra_value" : 2}))
- new_config = FilterConfiguration(base_rules=["-"])
- self.assertFalse(options ==
- ProcessorOptions(filter_configuration=new_config))
- self.assertFalse(options == ProcessorOptions(git_commit="commit2"))
- self.assertFalse(options == ProcessorOptions(max_reports_per_category=
- {"category": 2}))
- self.assertFalse(options == ProcessorOptions(output_format="emacs"))
- self.assertFalse(options == ProcessorOptions(verbosity=2))
-
- def test_ne(self):
- """Test __ne__ inequality function."""
- # != calls __ne__.
- # By default, __ne__ always returns true on different objects.
- # Thus, just check the distinguishing case to verify that the
- # code defines __ne__.
- self.assertFalse(ProcessorOptions() != ProcessorOptions())
+ Sub-classes should implement:
- def test_is_reportable(self):
- """Test is_reportable()."""
- filter_configuration = FilterConfiguration(base_rules=["-xyz"])
- options = ProcessorOptions(filter_configuration=filter_configuration,
- verbosity=3)
+ is_verbose: The is_verbose value to pass to configure_logging().
+
+ """
+
+ def setUp(self):
+ is_verbose = self.is_verbose
+
+ log_stream = TestLogStream(self)
+
+ # Use a logger other than the root logger or one prefixed with
+ # webkit so as not to conflict with test-webkitpy logging.
+ logger = logging.getLogger("unittest")
+
+ # Configure the test logger not to pass messages along to the
+ # root logger. This prevents test messages from being
+ # propagated to loggers used by test-webkitpy logging (e.g.
+ # the root logger).
+ logger.propagate = False
+
+ self._handlers = configure_logging(stream=log_stream, logger=logger,
+ is_verbose=is_verbose)
+ self._log = logger
+ self._log_stream = log_stream
+
+ def tearDown(self):
+ """Reset logging to its original state.
+
+ This method ensures that the logging configuration set up
+ for a unit test does not affect logging in other unit tests.
+
+ """
+ logger = self._log
+ for handler in self._handlers:
+ logger.removeHandler(handler)
+
+ def assert_log_messages(self, messages):
+ """Assert that the logged messages equal the given messages."""
+ self._log_stream.assertMessages(messages)
+
+
+class ConfigureLoggingTest(ConfigureLoggingTestBase):
+
+ """Tests the configure_logging() function."""
+
+ is_verbose = False
+
+ def test_warning_message(self):
+ self._log.warn("test message")
+ self.assert_log_messages(["WARNING: test message\n"])
+
+ def test_below_warning_message(self):
+ # We test the boundary case of a logging level equal to 29.
+ # In practice, we will probably only be calling log.info(),
+ # which corresponds to a logging level of 20.
+ level = logging.WARNING - 1 # Equals 29.
+ self._log.log(level, "test message")
+ self.assert_log_messages(["test message\n"])
+
+ def test_debug_message(self):
+ self._log.debug("test message")
+ self.assert_log_messages([])
+
+ def test_two_messages(self):
+ self._log.info("message1")
+ self._log.info("message2")
+ self.assert_log_messages(["message1\n", "message2\n"])
+
+
+class ConfigureLoggingVerboseTest(ConfigureLoggingTestBase):
- # Test verbosity
- self.assertTrue(options.is_reportable("abc", 3, "foo.h"))
- self.assertFalse(options.is_reportable("abc", 2, "foo.h"))
+ """Tests the configure_logging() function with is_verbose True."""
- # Test filter
- self.assertTrue(options.is_reportable("xy", 3, "foo.h"))
- self.assertFalse(options.is_reportable("xyz", 3, "foo.h"))
+ is_verbose = True
+
+ def test_debug_message(self):
+ self._log.debug("test message")
+ self.assert_log_messages(["unittest: DEBUG test message\n"])
class GlobalVariablesTest(unittest.TestCase):
@@ -138,18 +154,18 @@ class GlobalVariablesTest(unittest.TestCase):
"""Tests validity of the global variables."""
def _all_categories(self):
- return style.style_categories()
+ return _all_categories()
def defaults(self):
- return style.webkit_argument_defaults()
+ return style._check_webkit_style_defaults()
- def test_filter_rules(self):
+ def test_webkit_base_filter_rules(self):
+ base_filter_rules = _BASE_FILTER_RULES
defaults = self.defaults()
already_seen = []
- validate_filter_rules(defaults.base_filter_rules,
- self._all_categories())
+ validate_filter_rules(base_filter_rules, self._all_categories())
# Also do some additional checks.
- for rule in defaults.base_filter_rules:
+ for rule in base_filter_rules:
# Check no leading or trailing white space.
self.assertEquals(rule, rule.strip())
# All categories are on by default, so defaults should
@@ -161,274 +177,196 @@ class GlobalVariablesTest(unittest.TestCase):
def test_defaults(self):
"""Check that default arguments are valid."""
- defaults = self.defaults()
+ default_options = self.defaults()
# FIXME: We should not need to call parse() to determine
# whether the default arguments are valid.
- parser = style.ArgumentParser(defaults)
+ parser = ArgumentParser(all_categories=self._all_categories(),
+ base_filter_rules=[],
+ default_options=default_options)
# No need to test the return value here since we test parse()
# on valid arguments elsewhere.
- parser.parse([]) # arguments valid: no error or SystemExit
+ #
+ # The default options are valid: no error or SystemExit.
+ parser.parse(args=[])
def test_path_rules_specifier(self):
- all_categories = style_categories()
+ all_categories = self._all_categories()
for (sub_paths, path_rules) in PATH_RULES_SPECIFIER:
- self.assertTrue(isinstance(path_rules, tuple),
- "Checking: " + str(path_rules))
validate_filter_rules(path_rules, self._all_categories())
- # Try using the path specifier (as an "end-to-end" check).
config = FilterConfiguration(path_specific=PATH_RULES_SPECIFIER)
- self.assertTrue(config.should_check("xxx_any_category",
- "xxx_non_matching_path"))
- self.assertTrue(config.should_check("xxx_any_category",
- "WebKitTools/WebKitAPITest/"))
- self.assertFalse(config.should_check("build/include",
- "WebKitTools/WebKitAPITest/"))
- self.assertFalse(config.should_check("readability/naming",
- "WebKit/qt/tests/qwebelement/tst_qwebelement.cpp"))
+
+ def assertCheck(path, category):
+ """Assert that the given category should be checked."""
+ message = ('Should check category "%s" for path "%s".'
+ % (category, path))
+ self.assertTrue(config.should_check(category, path))
+
+ def assertNoCheck(path, category):
+ """Assert that the given category should not be checked."""
+ message = ('Should not check category "%s" for path "%s".'
+ % (category, path))
+ self.assertFalse(config.should_check(category, path), message)
+
+ assertCheck("random_path.cpp",
+ "build/include")
+ assertNoCheck("WebKitTools/WebKitAPITest/main.cpp",
+ "build/include")
+ assertCheck("random_path.cpp",
+ "readability/naming")
+ assertNoCheck("WebKit/gtk/webkit/webkit.h",
+ "readability/naming")
+ assertNoCheck("WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp",
+ "readability/null")
+ assertNoCheck("WebKit/efl/ewk/ewk_view.h",
+ "readability/naming")
+ assertNoCheck("WebCore/css/CSSParser.cpp",
+ "readability/naming")
+
+ # Test if Qt exceptions are indeed working
+ assertCheck("JavaScriptCore/qt/api/qscriptengine.cpp",
+ "readability/braces")
+ assertCheck("WebKit/qt/Api/qwebpage.cpp",
+ "readability/braces")
+ assertCheck("WebKit/qt/tests/qwebelement/tst_qwebelement.cpp",
+ "readability/braces")
+ assertCheck("WebKit/qt/declarative/platformplugin/WebPlugin.cpp",
+ "readability/braces")
+ assertCheck("WebKit/qt/examples/platformplugin/WebPlugin.cpp",
+ "readability/braces")
+ assertNoCheck("JavaScriptCore/qt/api/qscriptengine.cpp",
+ "readability/naming")
+ assertNoCheck("WebKit/qt/Api/qwebpage.cpp",
+ "readability/naming")
+ assertNoCheck("WebKit/qt/tests/qwebelement/tst_qwebelement.cpp",
+ "readability/naming")
+ assertNoCheck("WebKit/qt/declarative/platformplugin/WebPlugin.cpp",
+ "readability/naming")
+ assertNoCheck("WebKit/qt/examples/platformplugin/WebPlugin.cpp",
+ "readability/naming")
+
+ assertNoCheck("WebCore/ForwardingHeaders/debugger/Debugger.h",
+ "build/header_guard")
+
+ # Third-party Python code: webkitpy/thirdparty
+ path = "WebKitTools/Scripts/webkitpy/thirdparty/mock.py"
+ assertNoCheck(path, "build/include")
+ assertNoCheck(path, "pep8/E401") # A random pep8 category.
+ assertCheck(path, "pep8/W191")
+ assertCheck(path, "pep8/W291")
+ assertCheck(path, "whitespace/carriage_return")
def test_max_reports_per_category(self):
- """Check that MAX_REPORTS_PER_CATEGORY is valid."""
+ """Check that _MAX_REPORTS_PER_CATEGORY is valid."""
all_categories = self._all_categories()
- for category in style.MAX_REPORTS_PER_CATEGORY.iterkeys():
+ for category in _MAX_REPORTS_PER_CATEGORY.iterkeys():
self.assertTrue(category in all_categories,
'Key "%s" is not a category' % category)
-class ArgumentPrinterTest(unittest.TestCase):
-
- """Tests the ArgumentPrinter class."""
-
- _printer = style.ArgumentPrinter()
-
- def _create_options(self,
- output_format='emacs',
- verbosity=3,
- user_rules=[],
- git_commit=None,
- extra_flag_values={}):
- filter_configuration = FilterConfiguration(user_rules=user_rules)
- return style.ProcessorOptions(extra_flag_values=extra_flag_values,
- filter_configuration=filter_configuration,
- git_commit=git_commit,
- output_format=output_format,
- verbosity=verbosity)
+class CheckWebKitStyleFunctionTest(unittest.TestCase):
+
+ """Tests the functions with names of the form check_webkit_style_*."""
+
+ def test_check_webkit_style_configuration(self):
+ # Exercise the code path to make sure the function does not error out.
+ option_values = CommandOptionValues()
+ configuration = check_webkit_style_configuration(option_values)
- def test_to_flag_string(self):
- options = self._create_options('vs7', 5, ['+foo', '-bar'], 'git',
- {'a': 0, 'z': 1})
- self.assertEquals('--a=0 --filter=+foo,-bar --git-commit=git '
- '--output=vs7 --verbose=5 --z=1',
- self._printer.to_flag_string(options))
-
- # This is to check that --filter and --git-commit do not
- # show up when not user-specified.
- options = self._create_options()
- self.assertEquals('--output=emacs --verbose=3',
- self._printer.to_flag_string(options))
-
-
-class ArgumentParserTest(unittest.TestCase):
-
- """Test the ArgumentParser class."""
-
- def _parse(self):
- """Return a default parse() function for testing."""
- return self._create_parser().parse
-
- def _create_defaults(self, default_output_format='vs7',
- default_verbosity=3,
- default_filter_rules=['-', '+whitespace']):
- """Return a default ArgumentDefaults instance for testing."""
- return style.ArgumentDefaults(default_output_format,
- default_verbosity,
- default_filter_rules)
-
- def _create_parser(self, defaults=None):
- """Return an ArgumentParser instance for testing."""
- def create_usage(_defaults):
- """Return a usage string for testing."""
- return "usage"
-
- def doc_print(message):
- # We do not want the usage string or style categories
- # to print during unit tests, so print nothing.
- return
-
- if defaults is None:
- defaults = self._create_defaults()
-
- return style.ArgumentParser(defaults, create_usage, doc_print)
-
- def test_parse_documentation(self):
- parse = self._parse()
-
- # FIXME: Test both the printing of the usage string and the
- # filter categories help.
-
- # Request the usage string.
- self.assertRaises(SystemExit, parse, ['--help'])
- # Request default filter rules and available style categories.
- self.assertRaises(SystemExit, parse, ['--filter='])
-
- def test_parse_bad_values(self):
- parse = self._parse()
-
- # Pass an unsupported argument.
- self.assertRaises(SystemExit, parse, ['--bad'])
-
- self.assertRaises(ValueError, parse, ['--verbose=bad'])
- self.assertRaises(ValueError, parse, ['--verbose=0'])
- self.assertRaises(ValueError, parse, ['--verbose=6'])
- parse(['--verbose=1']) # works
- parse(['--verbose=5']) # works
-
- self.assertRaises(ValueError, parse, ['--output=bad'])
- parse(['--output=vs7']) # works
-
- # Pass a filter rule not beginning with + or -.
- self.assertRaises(ValueError, parse, ['--filter=build'])
- parse(['--filter=+build']) # works
- # Pass files and git-commit at the same time.
- self.assertRaises(SystemExit, parse, ['--git-commit=', 'file.txt'])
- # Pass an extra flag already supported.
- self.assertRaises(ValueError, parse, [], ['filter='])
- parse([], ['extra=']) # works
- # Pass an extra flag with typo.
- self.assertRaises(SystemExit, parse, ['--extratypo='], ['extra='])
- parse(['--extra='], ['extra=']) # works
- self.assertRaises(ValueError, parse, [], ['extra=', 'extra='])
-
-
- def test_parse_default_arguments(self):
- parse = self._parse()
-
- (files, options) = parse([])
-
- self.assertEquals(files, [])
-
- self.assertEquals(options.output_format, 'vs7')
- self.assertEquals(options.verbosity, 3)
- self.assertEquals(options.filter_configuration,
- FilterConfiguration(base_rules=["-", "+whitespace"],
- path_specific=PATH_RULES_SPECIFIER))
- self.assertEquals(options.git_commit, None)
-
- def test_parse_explicit_arguments(self):
- parse = self._parse()
-
- # Pass non-default explicit values.
- (files, options) = parse(['--output=emacs'])
- self.assertEquals(options.output_format, 'emacs')
- (files, options) = parse(['--verbose=4'])
- self.assertEquals(options.verbosity, 4)
- (files, options) = parse(['--git-commit=commit'])
- self.assertEquals(options.git_commit, 'commit')
+ def test_check_webkit_style_parser(self):
+ # Exercise the code path to make sure the function does not error out.
+ parser = check_webkit_style_parser()
- # Pass user_rules.
- (files, options) = parse(['--filter=+build,-whitespace'])
- config = options.filter_configuration
- self.assertEquals(options.filter_configuration,
- FilterConfiguration(base_rules=["-", "+whitespace"],
- path_specific=PATH_RULES_SPECIFIER,
- user_rules=["+build", "-whitespace"]))
-
- # Pass spurious white space in user rules.
- (files, options) = parse(['--filter=+build, -whitespace'])
- self.assertEquals(options.filter_configuration,
- FilterConfiguration(base_rules=["-", "+whitespace"],
- path_specific=PATH_RULES_SPECIFIER,
- user_rules=["+build", "-whitespace"]))
-
- # Pass extra flag values.
- (files, options) = parse(['--extra'], ['extra'])
- self.assertEquals(options.extra_flag_values, {'--extra': ''})
- (files, options) = parse(['--extra='], ['extra='])
- self.assertEquals(options.extra_flag_values, {'--extra': ''})
- (files, options) = parse(['--extra=x'], ['extra='])
- self.assertEquals(options.extra_flag_values, {'--extra': 'x'})
-
- def test_parse_files(self):
- parse = self._parse()
-
- (files, options) = parse(['foo.cpp'])
- self.assertEquals(files, ['foo.cpp'])
- # Pass multiple files.
- (files, options) = parse(['--output=emacs', 'foo.cpp', 'bar.cpp'])
- self.assertEquals(files, ['foo.cpp', 'bar.cpp'])
+class CheckerDispatcherSkipTest(unittest.TestCase):
+ """Tests the "should skip" methods of the CheckerDispatcher class."""
+
+ def setUp(self):
+ self._dispatcher = CheckerDispatcher()
-class ProcessorDispatcherSkipTest(unittest.TestCase):
-
- """Tests the "should skip" methods of the ProcessorDispatcher class."""
-
def test_should_skip_with_warning(self):
"""Test should_skip_with_warning()."""
- dispatcher = ProcessorDispatcher()
-
# Check a non-skipped file.
- self.assertFalse(dispatcher.should_skip_with_warning("foo.txt"))
+ self.assertFalse(self._dispatcher.should_skip_with_warning("foo.txt"))
# Check skipped files.
paths_to_skip = [
"gtk2drawing.c",
- "gtk2drawing.h",
- "JavaScriptCore/qt/api/qscriptengine_p.h",
+ "gtkdrawing.h",
"WebCore/platform/gtk/gtk2drawing.c",
- "WebCore/platform/gtk/gtk2drawing.h",
+ "WebCore/platform/gtk/gtkdrawing.h",
"WebKit/gtk/tests/testatk.c",
- "WebKit/qt/Api/qwebpage.h",
- "WebKit/qt/tests/qwebsecurityorigin/tst_qwebsecurityorigin.cpp",
]
for path in paths_to_skip:
- self.assertTrue(dispatcher.should_skip_with_warning(path),
+ self.assertTrue(self._dispatcher.should_skip_with_warning(path),
"Checking: " + path)
- def test_should_skip_without_warning(self):
- """Test should_skip_without_warning()."""
- dispatcher = ProcessorDispatcher()
-
- # Check a non-skipped file.
- self.assertFalse(dispatcher.should_skip_without_warning("foo.txt"))
-
- # Check skipped files.
- paths_to_skip = [
- # LayoutTests folder
- "LayoutTests/foo.txt",
- ]
+ def _assert_should_skip_without_warning(self, path, is_checker_none,
+ expected):
+ # Check the file type before asserting the return value.
+ checker = self._dispatcher.dispatch(file_path=path,
+ handle_style_error=None,
+ min_confidence=3)
+ message = 'while checking: %s' % path
+ self.assertEquals(checker is None, is_checker_none, message)
+ self.assertEquals(self._dispatcher.should_skip_without_warning(path),
+ expected, message)
+
+ def test_should_skip_without_warning__true(self):
+ """Test should_skip_without_warning() for True return values."""
+ # Check a file with NONE file type.
+ path = 'foo.asdf' # Non-sensical file extension.
+ self._assert_should_skip_without_warning(path,
+ is_checker_none=True,
+ expected=True)
+
+ # Check files with non-NONE file type. These examples must be
+ # drawn from the _SKIPPED_FILES_WITHOUT_WARNING configuration
+ # variable.
+ path = os.path.join('LayoutTests', 'foo.txt')
+ self._assert_should_skip_without_warning(path,
+ is_checker_none=False,
+ expected=True)
+
+ def test_should_skip_without_warning__false(self):
+ """Test should_skip_without_warning() for False return values."""
+ paths = ['foo.txt',
+ os.path.join('LayoutTests', 'ChangeLog'),
+ ]
- for path in paths_to_skip:
- self.assertTrue(dispatcher.should_skip_without_warning(path),
- "Checking: " + path)
+ for path in paths:
+ self._assert_should_skip_without_warning(path,
+ is_checker_none=False,
+ expected=False)
-class ProcessorDispatcherDispatchTest(unittest.TestCase):
+class CheckerDispatcherDispatchTest(unittest.TestCase):
- """Tests dispatch_processor() method of ProcessorDispatcher class."""
+ """Tests dispatch() method of CheckerDispatcher class."""
def mock_handle_style_error(self):
pass
- def dispatch_processor(self, file_path):
- """Call dispatch_processor() with the given file path."""
- dispatcher = ProcessorDispatcher()
- processor = dispatcher.dispatch_processor(file_path,
- self.mock_handle_style_error,
- verbosity=3)
- return processor
-
- def assert_processor_none(self, file_path):
- """Assert that the dispatched processor is None."""
- processor = self.dispatch_processor(file_path)
- self.assertTrue(processor is None, 'Checking: "%s"' % file_path)
-
- def assert_processor(self, file_path, expected_class):
- """Assert the type of the dispatched processor."""
- processor = self.dispatch_processor(file_path)
- got_class = processor.__class__
+ def dispatch(self, file_path):
+ """Call dispatch() with the given file path."""
+ dispatcher = CheckerDispatcher()
+ checker = dispatcher.dispatch(file_path,
+ self.mock_handle_style_error,
+ min_confidence=3)
+ return checker
+
+ def assert_checker_none(self, file_path):
+ """Assert that the dispatched checker is None."""
+ checker = self.dispatch(file_path)
+ self.assertTrue(checker is None, 'Checking: "%s"' % file_path)
+
+ def assert_checker(self, file_path, expected_class):
+ """Assert the type of the dispatched checker."""
+ checker = self.dispatch(file_path)
+ got_class = checker.__class__
self.assertEquals(got_class, expected_class,
'For path "%(file_path)s" got %(got_class)s when '
"expecting %(expected_class)s."
@@ -436,13 +374,17 @@ class ProcessorDispatcherDispatchTest(unittest.TestCase):
"got_class": got_class,
"expected_class": expected_class})
- def assert_processor_cpp(self, file_path):
- """Assert that the dispatched processor is a CppProcessor."""
- self.assert_processor(file_path, CppProcessor)
+ def assert_checker_cpp(self, file_path):
+ """Assert that the dispatched checker is a CppChecker."""
+ self.assert_checker(file_path, CppChecker)
+
+ def assert_checker_python(self, file_path):
+ """Assert that the dispatched checker is a PythonChecker."""
+ self.assert_checker(file_path, PythonChecker)
- def assert_processor_text(self, file_path):
- """Assert that the dispatched processor is a TextProcessor."""
- self.assert_processor(file_path, TextProcessor)
+ def assert_checker_text(self, file_path):
+ """Assert that the dispatched checker is a TextChecker."""
+ self.assert_checker(file_path, TextChecker)
def test_cpp_paths(self):
"""Test paths that should be checked as C++."""
@@ -454,228 +396,384 @@ class ProcessorDispatcherDispatchTest(unittest.TestCase):
]
for path in paths:
- self.assert_processor_cpp(path)
+ self.assert_checker_cpp(path)
- # Check processor attributes on a typical input.
+ # Check checker attributes on a typical input.
file_base = "foo"
file_extension = "c"
file_path = file_base + "." + file_extension
- self.assert_processor_cpp(file_path)
- processor = self.dispatch_processor(file_path)
- self.assertEquals(processor.file_extension, file_extension)
- self.assertEquals(processor.file_path, file_path)
- self.assertEquals(processor.handle_style_error, self.mock_handle_style_error)
- self.assertEquals(processor.verbosity, 3)
+ self.assert_checker_cpp(file_path)
+ checker = self.dispatch(file_path)
+ self.assertEquals(checker.file_extension, file_extension)
+ self.assertEquals(checker.file_path, file_path)
+ self.assertEquals(checker.handle_style_error, self.mock_handle_style_error)
+ self.assertEquals(checker.min_confidence, 3)
# Check "-" for good measure.
file_base = "-"
file_extension = ""
file_path = file_base
- self.assert_processor_cpp(file_path)
- processor = self.dispatch_processor(file_path)
- self.assertEquals(processor.file_extension, file_extension)
- self.assertEquals(processor.file_path, file_path)
+ self.assert_checker_cpp(file_path)
+ checker = self.dispatch(file_path)
+ self.assertEquals(checker.file_extension, file_extension)
+ self.assertEquals(checker.file_path, file_path)
+
+ def test_python_paths(self):
+ """Test paths that should be checked as Python."""
+ paths = [
+ "foo.py",
+ "WebKitTools/Scripts/modules/text_style.py",
+ ]
+
+ for path in paths:
+ self.assert_checker_python(path)
+
+ # Check checker attributes on a typical input.
+ file_base = "foo"
+ file_extension = "css"
+ file_path = file_base + "." + file_extension
+ self.assert_checker_text(file_path)
+ checker = self.dispatch(file_path)
+ self.assertEquals(checker.file_path, file_path)
+ self.assertEquals(checker.handle_style_error,
+ self.mock_handle_style_error)
def test_text_paths(self):
"""Test paths that should be checked as text."""
paths = [
"ChangeLog",
+ "ChangeLog-2009-06-16",
+ "foo.ac",
+ "foo.cc",
+ "foo.cgi",
"foo.css",
+ "foo.exp",
+ "foo.flex",
+ "foo.gyp",
+ "foo.gypi",
"foo.html",
"foo.idl",
+ "foo.in",
"foo.js",
"foo.mm",
"foo.php",
+ "foo.pl",
"foo.pm",
- "foo.py",
+ "foo.pri",
+ "foo.pro",
+ "foo.rb",
+ "foo.sh",
"foo.txt",
- "FooChangeLog.bak",
- "WebCore/ChangeLog",
- "WebCore/inspector/front-end/inspector.js",
- "WebKitTools/Scripts/check-webkit=style",
- "WebKitTools/Scripts/modules/text_style.py",
- ]
+ "foo.wm",
+ "foo.xhtml",
+ "foo.y",
+ os.path.join("WebCore", "ChangeLog"),
+ os.path.join("WebCore", "inspector", "front-end", "inspector.js"),
+ os.path.join("WebKitTools", "Scripts", "check-webkit-style"),
+ ]
for path in paths:
- self.assert_processor_text(path)
+ self.assert_checker_text(path)
- # Check processor attributes on a typical input.
+ # Check checker attributes on a typical input.
file_base = "foo"
file_extension = "css"
file_path = file_base + "." + file_extension
- self.assert_processor_text(file_path)
- processor = self.dispatch_processor(file_path)
- self.assertEquals(processor.file_path, file_path)
- self.assertEquals(processor.handle_style_error, self.mock_handle_style_error)
+ self.assert_checker_text(file_path)
+ checker = self.dispatch(file_path)
+ self.assertEquals(checker.file_path, file_path)
+ self.assertEquals(checker.handle_style_error, self.mock_handle_style_error)
def test_none_paths(self):
"""Test paths that have no file type.."""
paths = [
"Makefile",
+ "foo.asdf", # Non-sensical file extension.
"foo.png",
"foo.exe",
+ "foo.vcproj",
]
for path in paths:
- self.assert_processor_none(path)
+ self.assert_checker_none(path)
-class StyleCheckerTest(unittest.TestCase):
+class StyleProcessorConfigurationTest(unittest.TestCase):
- """Test the StyleChecker class.
+ """Tests the StyleProcessorConfiguration class."""
- Attributes:
- error_messages: A string containing all of the warning messages
- written to the mock_stderr_write method of
- this class.
-
- """
+ def setUp(self):
+ self._error_messages = []
+ """The messages written to _mock_stderr_write() of this class."""
def _mock_stderr_write(self, message):
- pass
+ self._error_messages.append(message)
+
+ def _style_checker_configuration(self, output_format="vs7"):
+ """Return a StyleProcessorConfiguration instance for testing."""
+ base_rules = ["-whitespace", "+whitespace/tab"]
+ filter_configuration = FilterConfiguration(base_rules=base_rules)
- def _style_checker(self, options):
- return StyleChecker(options, self._mock_stderr_write)
+ return StyleProcessorConfiguration(
+ filter_configuration=filter_configuration,
+ max_reports_per_category={"whitespace/newline": 1},
+ min_confidence=3,
+ output_format=output_format,
+ stderr_write=self._mock_stderr_write)
+
+ def test_init(self):
+ """Test the __init__() method."""
+ configuration = self._style_checker_configuration()
+
+ # Check that __init__ sets the "public" data attributes correctly.
+ self.assertEquals(configuration.max_reports_per_category,
+ {"whitespace/newline": 1})
+ self.assertEquals(configuration.stderr_write, self._mock_stderr_write)
+ self.assertEquals(configuration.min_confidence, 3)
+
+ def test_is_reportable(self):
+ """Test the is_reportable() method."""
+ config = self._style_checker_configuration()
+
+ self.assertTrue(config.is_reportable("whitespace/tab", 3, "foo.txt"))
+
+ # Test the confidence check code path by varying the confidence.
+ self.assertFalse(config.is_reportable("whitespace/tab", 2, "foo.txt"))
+
+ # Test the category check code path by varying the category.
+ self.assertFalse(config.is_reportable("whitespace/line", 4, "foo.txt"))
+
+ def _call_write_style_error(self, output_format):
+ config = self._style_checker_configuration(output_format=output_format)
+ config.write_style_error(category="whitespace/tab",
+ confidence_in_error=5,
+ file_path="foo.h",
+ line_number=100,
+ message="message")
+
+ def test_write_style_error_emacs(self):
+ """Test the write_style_error() method."""
+ self._call_write_style_error("emacs")
+ self.assertEquals(self._error_messages,
+ ["foo.h:100: message [whitespace/tab] [5]\n"])
+
+ def test_write_style_error_vs7(self):
+ """Test the write_style_error() method."""
+ self._call_write_style_error("vs7")
+ self.assertEquals(self._error_messages,
+ ["foo.h(100): message [whitespace/tab] [5]\n"])
+
+
+class StyleProcessor_EndToEndTest(LoggingTestCase):
+
+ """Test the StyleProcessor class with an emphasis on end-to-end tests."""
+
+ def setUp(self):
+ LoggingTestCase.setUp(self)
+ self._messages = []
+
+ def _mock_stderr_write(self, message):
+ """Save a message so it can later be asserted."""
+ self._messages.append(message)
def test_init(self):
"""Test __init__ constructor."""
- options = ProcessorOptions()
- style_checker = self._style_checker(options)
+ configuration = StyleProcessorConfiguration(
+ filter_configuration=FilterConfiguration(),
+ max_reports_per_category={},
+ min_confidence=3,
+ output_format="vs7",
+ stderr_write=self._mock_stderr_write)
+ processor = StyleProcessor(configuration)
- self.assertEquals(style_checker.error_count, 0)
- self.assertEquals(style_checker.options, options)
+ self.assertEquals(processor.error_count, 0)
+ self.assertEquals(self._messages, [])
+ def test_process(self):
+ configuration = StyleProcessorConfiguration(
+ filter_configuration=FilterConfiguration(),
+ max_reports_per_category={},
+ min_confidence=3,
+ output_format="vs7",
+ stderr_write=self._mock_stderr_write)
+ processor = StyleProcessor(configuration)
-class StyleCheckerCheckFileTest(unittest.TestCase):
+ processor.process(lines=['line1', 'Line with tab:\t'],
+ file_path='foo.txt')
+ self.assertEquals(processor.error_count, 1)
+ expected_messages = ['foo.txt(2): Line contains tab character. '
+ '[whitespace/tab] [5]\n']
+ self.assertEquals(self._messages, expected_messages)
- """Test the check_file() method of the StyleChecker class.
- The check_file() method calls its process_file parameter when
- given a file that should not be skipped.
+class StyleProcessor_CodeCoverageTest(LoggingTestCase):
- The "got_*" attributes of this class are the parameters passed
- to process_file by calls to check_file() made by this test
- class. These attributes allow us to check the parameter values
- passed internally to the process_file function.
+ """Test the StyleProcessor class with an emphasis on code coverage.
- Attributes:
- got_file_path: The file_path parameter passed by check_file()
- to its process_file parameter.
- got_handle_style_error: The handle_style_error parameter passed
- by check_file() to its process_file
- parameter.
- got_processor: The processor parameter passed by check_file() to
- its process_file parameter.
- warning_messages: A string containing all of the warning messages
- written to the mock_stderr_write method of
- this class.
+ This class makes heavy use of mock objects.
"""
- def setUp(self):
- self.got_file_path = None
- self.got_handle_style_error = None
- self.got_processor = None
- self.warning_messages = ""
- def mock_stderr_write(self, warning_message):
- self.warning_messages += warning_message
+ class MockDispatchedChecker(object):
- def mock_handle_style_error(self):
+ """A mock checker dispatched by the MockDispatcher."""
+
+ def __init__(self, file_path, min_confidence, style_error_handler):
+ self.file_path = file_path
+ self.min_confidence = min_confidence
+ self.style_error_handler = style_error_handler
+
+ def check(self, lines):
+ self.lines = lines
+
+ class MockDispatcher(object):
+
+ """A mock CheckerDispatcher class."""
+
+ def __init__(self):
+ self.dispatched_checker = None
+
+ def should_skip_with_warning(self, file_path):
+ return file_path.endswith('skip_with_warning.txt')
+
+ def should_skip_without_warning(self, file_path):
+ return file_path.endswith('skip_without_warning.txt')
+
+ def dispatch(self, file_path, style_error_handler, min_confidence):
+ if file_path.endswith('do_not_process.txt'):
+ return None
+
+ checker = StyleProcessor_CodeCoverageTest.MockDispatchedChecker(
+ file_path,
+ min_confidence,
+ style_error_handler)
+
+ # Save the dispatched checker so the current test case has a
+ # way to access and check it.
+ self.dispatched_checker = checker
+
+ return checker
+
+ def setUp(self):
+ LoggingTestCase.setUp(self)
+ # We can pass an error-message swallower here because error message
+ # output is tested instead in the end-to-end test case above.
+ configuration = StyleProcessorConfiguration(
+ filter_configuration=FilterConfiguration(),
+ max_reports_per_category={"whitespace/newline": 1},
+ min_confidence=3,
+ output_format="vs7",
+ stderr_write=self._swallow_stderr_message)
+
+ mock_carriage_checker_class = self._create_carriage_checker_class()
+ mock_dispatcher = self.MockDispatcher()
+ # We do not need to use a real incrementer here because error-count
+ # incrementing is tested instead in the end-to-end test case above.
+ mock_increment_error_count = self._do_nothing
+
+ processor = StyleProcessor(configuration=configuration,
+ mock_carriage_checker_class=mock_carriage_checker_class,
+ mock_dispatcher=mock_dispatcher,
+ mock_increment_error_count=mock_increment_error_count)
+
+ self._configuration = configuration
+ self._mock_dispatcher = mock_dispatcher
+ self._processor = processor
+
+ def _do_nothing(self):
+ # We provide this function so the caller can pass it to the
+ # StyleProcessor constructor. This lets us assert the equality of
+ # the DefaultStyleErrorHandler instance generated by the process()
+ # method with an expected instance.
pass
- def mock_process_file(self, processor, file_path, handle_style_error):
- """A mock _process_file().
+ def _swallow_stderr_message(self, message):
+ """Swallow a message passed to stderr.write()."""
+ # This is a mock stderr.write() for passing to the constructor
+ # of the StyleProcessorConfiguration class.
+ pass
- See the documentation for this class for more information
- on this function.
+ def _create_carriage_checker_class(self):
- """
- self.got_file_path = file_path
- self.got_handle_style_error = handle_style_error
- self.got_processor = processor
-
- def assert_attributes(self,
- expected_file_path,
- expected_handle_style_error,
- expected_processor,
- expected_warning_messages):
- """Assert that the attributes of this class equal the given values."""
- self.assertEquals(self.got_file_path, expected_file_path)
- self.assertEquals(self.got_handle_style_error, expected_handle_style_error)
- self.assertEquals(self.got_processor, expected_processor)
- self.assertEquals(self.warning_messages, expected_warning_messages)
-
- def call_check_file(self, file_path):
- """Call the check_file() method of a test StyleChecker instance."""
- # Confirm that the attributes are reset.
- self.assert_attributes(None, None, None, "")
-
- # Create a test StyleChecker instance.
- #
- # The verbosity attribute is the only ProcessorOptions
- # attribute that needs to be checked in this test.
- # This is because it is the only option is directly
- # passed to the constructor of a style processor.
- options = ProcessorOptions(verbosity=3)
+ # Create a reference to self with a new name so its name does not
+ # conflict with the self introduced below.
+ test_case = self
- style_checker = StyleChecker(options, self.mock_stderr_write)
+ class MockCarriageChecker(object):
- style_checker.check_file(file_path,
- self.mock_handle_style_error,
- self.mock_process_file)
+ """A mock carriage-return checker."""
- def test_check_file_on_skip_without_warning(self):
- """Test check_file() for a skipped-without-warning file."""
+ def __init__(self, style_error_handler):
+ self.style_error_handler = style_error_handler
- file_path = "LayoutTests/foo.txt"
+ # This gives the current test case access to the
+ # instantiated carriage checker.
+ test_case.carriage_checker = self
- dispatcher = ProcessorDispatcher()
- # Confirm that the input file is truly a skipped-without-warning file.
- self.assertTrue(dispatcher.should_skip_without_warning(file_path))
+ def check(self, lines):
+ # Save the lines so the current test case has a way to access
+ # and check them.
+ self.lines = lines
- # Check the outcome.
- self.call_check_file(file_path)
- self.assert_attributes(None, None, None, "")
+ return lines
- def test_check_file_on_skip_with_warning(self):
- """Test check_file() for a skipped-with-warning file."""
+ return MockCarriageChecker
- file_path = "gtk2drawing.c"
+ def test_should_process__skip_without_warning(self):
+ """Test should_process() for a skip-without-warning file."""
+ file_path = "foo/skip_without_warning.txt"
- dispatcher = ProcessorDispatcher()
- # Check that the input file is truly a skipped-with-warning file.
- self.assertTrue(dispatcher.should_skip_with_warning(file_path))
+ self.assertFalse(self._processor.should_process(file_path))
- # Check the outcome.
- self.call_check_file(file_path)
- self.assert_attributes(None, None, None,
- 'Ignoring "gtk2drawing.c": this file is exempt from the style guide.\n')
+ def test_should_process__skip_with_warning(self):
+ """Test should_process() for a skip-with-warning file."""
+ file_path = "foo/skip_with_warning.txt"
- def test_check_file_on_non_skipped(self):
+ self.assertFalse(self._processor.should_process(file_path))
- # We use a C++ file since by using a CppProcessor, we can check
- # that all of the possible information is getting passed to
- # process_file (in particular, the verbosity).
- file_base = "foo"
- file_extension = "cpp"
- file_path = file_base + "." + file_extension
+ self.assertLog(['WARNING: File exempt from style guide. '
+ 'Skipping: "foo/skip_with_warning.txt"\n'])
+
+ def test_should_process__true_result(self):
+ """Test should_process() for a file that should be processed."""
+ file_path = "foo/skip_process.txt"
- dispatcher = ProcessorDispatcher()
- # Check that the input file is truly a C++ file.
- self.assertEquals(dispatcher._file_type(file_path), style.FileType.CPP)
+ self.assertTrue(self._processor.should_process(file_path))
- # Check the outcome.
- self.call_check_file(file_path)
+ def test_process__checker_dispatched(self):
+ """Test the process() method for a path with a dispatched checker."""
+ file_path = 'foo.txt'
+ lines = ['line1', 'line2']
+ line_numbers = [100]
- expected_processor = CppProcessor(file_path, file_extension, self.mock_handle_style_error, 3)
+ expected_error_handler = DefaultStyleErrorHandler(
+ configuration=self._configuration,
+ file_path=file_path,
+ increment_error_count=self._do_nothing,
+ line_numbers=line_numbers)
- self.assert_attributes(file_path,
- self.mock_handle_style_error,
- expected_processor,
- "")
+ self._processor.process(lines=lines,
+ file_path=file_path,
+ line_numbers=line_numbers)
+ # Check that the carriage-return checker was instantiated correctly
+ # and was passed lines correctly.
+ carriage_checker = self.carriage_checker
+ self.assertEquals(carriage_checker.style_error_handler,
+ expected_error_handler)
+ self.assertEquals(carriage_checker.lines, ['line1', 'line2'])
-if __name__ == '__main__':
- import sys
+ # Check that the style checker was dispatched correctly and was
+ # passed lines correctly.
+ checker = self._mock_dispatcher.dispatched_checker
+ self.assertEquals(checker.file_path, 'foo.txt')
+ self.assertEquals(checker.min_confidence, 3)
+ self.assertEquals(checker.style_error_handler, expected_error_handler)
- unittest.main()
+ self.assertEquals(checker.lines, ['line1', 'line2'])
+ def test_process__no_checker_dispatched(self):
+ """Test the process() method for a path with no dispatched checker."""
+ path = os.path.join('foo', 'do_not_process.txt')
+ self.assertRaises(AssertionError, self._processor.process,
+ lines=['line1', 'line2'], file_path=path,
+ line_numbers=[100])
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/__init__.py b/WebKitTools/Scripts/webkitpy/style/checkers/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/common.py b/WebKitTools/Scripts/webkitpy/style/checkers/common.py
index dbf4bea..76aa956 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/common.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/common.py
@@ -20,40 +20,55 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Supports style checking not specific to any one processor."""
+"""Supports style checking not specific to any one file type."""
-# FIXME: Test this list in the same way that the list of CppProcessor
+# FIXME: Test this list in the same way that the list of CppChecker
# categories is tested, for example by checking that all of its
# elements appear in the unit tests. This should probably be done
# after moving the relevant cpp_unittest.ErrorCollector code
# into a shared location and refactoring appropriately.
categories = set([
"whitespace/carriage_return",
-])
+ "whitespace/tab"])
-def check_no_carriage_return(line, line_number, error):
- """Check that a line does not end with a carriage return.
+class CarriageReturnChecker(object):
- Returns true if the check is successful (i.e. if the line does not
- end with a carriage return), and false otherwise.
+ """Supports checking for and handling carriage returns."""
- Args:
- line: A string that is the line to check.
- line_number: The line number.
- error: The function to call with any errors found.
+ def __init__(self, handle_style_error):
+ self._handle_style_error = handle_style_error
- """
+ def check(self, lines):
+ """Check for and strip trailing carriage returns from lines."""
+ for line_number in range(len(lines)):
+ if not lines[line_number].endswith("\r"):
+ continue
- if line.endswith("\r"):
- error(line_number,
- "whitespace/carriage_return",
- 1,
- "One or more unexpected \\r (^M) found; "
- "better to use only a \\n")
- return False
+ self._handle_style_error(line_number + 1, # Correct for offset.
+ "whitespace/carriage_return",
+ 1,
+ "One or more unexpected \\r (^M) found; "
+ "better to use only a \\n")
- return True
+ lines[line_number] = lines[line_number].rstrip("\r")
+ return lines
+
+class TabChecker(object):
+
+ """Supports checking for and handling tabs."""
+
+ def __init__(self, file_path, handle_style_error):
+ self.file_path = file_path
+ self.handle_style_error = handle_style_error
+
+ def check(self, lines):
+ # FIXME: share with cpp_style.
+ for line_number, line in enumerate(lines):
+ if "\t" in line:
+ self.handle_style_error(line_number + 1,
+ "whitespace/tab", 5,
+ "Line contains tab character.")
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/common_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/common_unittest.py
new file mode 100644
index 0000000..1fe1263
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/common_unittest.py
@@ -0,0 +1,124 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Unit tests for common.py."""
+
+import unittest
+
+from common import CarriageReturnChecker
+from common import TabChecker
+
+# FIXME: The unit tests for the cpp, text, and common checkers should
+# share supporting test code. This can include, for example, the
+# mock style error handling code and the code to check that all
+# of a checker's categories are covered by the unit tests.
+# Such shared code can be located in a shared test file, perhaps
+# even this file.
+class CarriageReturnCheckerTest(unittest.TestCase):
+
+ """Tests check_no_carriage_return()."""
+
+ _category = "whitespace/carriage_return"
+ _confidence = 1
+ _expected_message = ("One or more unexpected \\r (^M) found; "
+ "better to use only a \\n")
+
+ def setUp(self):
+ self._style_errors = [] # The list of accumulated style errors.
+
+ def _mock_style_error_handler(self, line_number, category, confidence,
+ message):
+ """Append the error information to the list of style errors."""
+ error = (line_number, category, confidence, message)
+ self._style_errors.append(error)
+
+ def assert_carriage_return(self, input_lines, expected_lines, error_lines):
+ """Process the given line and assert that the result is correct."""
+ handle_style_error = self._mock_style_error_handler
+
+ checker = CarriageReturnChecker(handle_style_error)
+ output_lines = checker.check(input_lines)
+
+ # Check both the return value and error messages.
+ self.assertEquals(output_lines, expected_lines)
+
+ expected_errors = [(line_number, self._category, self._confidence,
+ self._expected_message)
+ for line_number in error_lines]
+ self.assertEquals(self._style_errors, expected_errors)
+
+ def test_ends_with_carriage(self):
+ self.assert_carriage_return(["carriage return\r"],
+ ["carriage return"],
+ [1])
+
+ def test_ends_with_nothing(self):
+ self.assert_carriage_return(["no carriage return"],
+ ["no carriage return"],
+ [])
+
+ def test_ends_with_newline(self):
+ self.assert_carriage_return(["no carriage return\n"],
+ ["no carriage return\n"],
+ [])
+
+ def test_carriage_in_middle(self):
+ # The CarriageReturnChecker checks only the final character
+ # of each line.
+ self.assert_carriage_return(["carriage\r in a string"],
+ ["carriage\r in a string"],
+ [])
+
+ def test_multiple_errors(self):
+ self.assert_carriage_return(["line1", "line2\r", "line3\r"],
+ ["line1", "line2", "line3"],
+ [2, 3])
+
+
+class TabCheckerTest(unittest.TestCase):
+
+ """Tests for TabChecker."""
+
+ def assert_tab(self, input_lines, error_lines):
+ """Assert when the given lines contain tabs."""
+ self._error_lines = []
+
+ def style_error_handler(line_number, category, confidence, message):
+ self.assertEqual(category, 'whitespace/tab')
+ self.assertEqual(confidence, 5)
+ self.assertEqual(message, 'Line contains tab character.')
+ self._error_lines.append(line_number)
+
+ checker = TabChecker('', style_error_handler)
+ checker.check(input_lines)
+ self.assertEquals(self._error_lines, error_lines)
+
+ def test_notab(self):
+ self.assert_tab([''], [])
+ self.assert_tab(['foo', 'bar'], [])
+
+ def test_tab(self):
+ self.assert_tab(['\tfoo'], [1])
+ self.assert_tab(['line1', '\tline2', 'line3\t'], [2, 3])
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
index 182c967..590bba9 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
@@ -152,6 +152,38 @@ def subn(pattern, replacement, s):
return _regexp_compile_cache[pattern].subn(replacement, s)
+def iteratively_replace_matches_with_char(pattern, char_replacement, s):
+ """Returns the string with replacement done.
+
+ Every character in the match is replaced with char.
+ Due to the iterative nature, pattern should not match char or
+ there will be an infinite loop.
+
+ Example:
+ pattern = r'<[^>]>' # template parameters
+ char_replacement = '_'
+ s = 'A<B<C, D>>'
+ Returns 'A_________'
+
+ Args:
+ pattern: The regex to match.
+ char_replacement: The character to put in place of every
+ character of the match.
+ s: The string on which to do the replacements.
+
+ Returns:
+ True, if the given line is blank.
+ """
+ while True:
+ matched = search(pattern, s)
+ if not matched:
+ return s
+ start_match_index = matched.start(0)
+ end_match_index = matched.end(0)
+ match_length = end_match_index - start_match_index
+ s = s[:start_match_index] + char_replacement * match_length + s[end_match_index:]
+
+
def up_to_unmatched_closing_paren(s):
"""Splits a string into two parts up to first unmatched ')'.
@@ -161,7 +193,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 ')'
@@ -272,32 +304,39 @@ class _FunctionState(object):
"""Tracks current function name and the number of lines in its body.
Attributes:
- verbosity: The verbosity level to use while checking style.
+ min_confidence: The minimum confidence level to use while checking style.
"""
_NORMAL_TRIGGER = 250 # for --v=0, 500 for --v=1, etc.
_TEST_TRIGGER = 400 # about 50% more than _NORMAL_TRIGGER.
- def __init__(self, verbosity):
- self.verbosity = verbosity
+ def __init__(self, min_confidence):
+ self.min_confidence = min_confidence
+ self.current_function = ''
self.in_a_function = False
self.lines_in_function = 0
- self.current_function = ''
+ # Make sure these will not be mistaken for real lines (even when a
+ # small amount is added to them).
+ self.body_start_line_number = -1000
+ self.ending_line_number = -1000
- def begin(self, function_name):
+ def begin(self, function_name, body_start_line_number, ending_line_number):
"""Start analyzing function body.
Args:
function_name: The name of the function being tracked.
+ ending_line_number: The line number where the function ends.
"""
self.in_a_function = True
self.lines_in_function = 0
self.current_function = function_name
+ self.body_start_line_number = body_start_line_number
+ self.ending_line_number = ending_line_number
- def count(self):
+ def count(self, line_number):
"""Count line in current function body."""
- if self.in_a_function:
+ if self.in_a_function and line_number >= self.body_start_line_number:
self.lines_in_function += 1
def check(self, error, line_number):
@@ -311,7 +350,7 @@ class _FunctionState(object):
base_trigger = self._TEST_TRIGGER
else:
base_trigger = self._NORMAL_TRIGGER
- trigger = base_trigger * 2 ** self.verbosity
+ trigger = base_trigger * 2 ** self.min_confidence
if self.lines_in_function > trigger:
error_level = int(math.log(self.lines_in_function / base_trigger, 2))
@@ -325,7 +364,7 @@ class _FunctionState(object):
self.current_function, self.lines_in_function, trigger))
def end(self):
- """Stop analizing function body."""
+ """Stop analyzing function body."""
self.in_a_function = False
@@ -577,8 +616,8 @@ class CleansedLines(object):
def close_expression(clean_lines, line_number, pos):
"""If input points to ( or { or [, finds the position that closes it.
- If lines[line_number][pos] points to a '(' or '{' or '[', finds the the
- line_number/pos that correspond to the closing of the expression.
+ If clean_lines.elided[line_number][pos] points to a '(' or '{' or '[', finds
+ the line_number/pos that correspond to the closing of the expression.
Args:
clean_lines: A CleansedLines instance containing the file.
@@ -587,8 +626,8 @@ def close_expression(clean_lines, line_number, pos):
Returns:
A tuple (line, line_number, pos) pointer *past* the closing brace, or
- (line, len(lines), -1) if we never find a close. Note we ignore
- strings and comments when matching; and the line we return is the
+ ('', len(clean_lines.elided), -1) if we never find a close. Note we
+ ignore strings and comments when matching; and the line we return is the
'cleansed' line at line_number.
"""
@@ -604,8 +643,10 @@ def close_expression(clean_lines, line_number, pos):
end_character = '}'
num_open = line.count(start_character) - line.count(end_character)
- while line_number < clean_lines.num_lines() and num_open > 0:
+ while num_open > 0:
line_number += 1
+ if line_number >= clean_lines.num_lines():
+ return ('', len(clean_lines.elided), -1)
line = clean_lines.elided[line_number]
num_open += line.count(start_character) - line.count(end_character)
# OK, now find the end_character that actually got us back to even
@@ -642,6 +683,10 @@ def get_header_guard_cpp_variable(filename):
"""
+ # Restores original filename in case that style checker is invoked from Emacs's
+ # flymake.
+ filename = re.sub(r'_flymake\.h$', '.h', filename)
+
return sub(r'[-.\s]', '_', os.path.basename(filename))
@@ -1105,17 +1150,85 @@ def is_blank_line(line):
return not line or line.isspace()
+def detect_functions(clean_lines, line_number, function_state, error):
+ """Finds where functions start and end.
+
+ Uses a simplistic algorithm assuming other style guidelines
+ (especially spacing) are followed.
+ Trivial bodies are unchecked, so constructors with huge initializer lists
+ may be missed.
+
+ Args:
+ clean_lines: A CleansedLines instance containing the file.
+ line_number: The number of the line to check.
+ function_state: Current function name and lines in body so far.
+ error: The function to call with any errors found.
+ """
+ # Are we now past the end of a function?
+ if function_state.ending_line_number + 1 == line_number:
+ function_state.end()
+
+ # If we're in a function, don't try to detect a new one.
+ if function_state.in_a_function:
+ return
+
+ lines = clean_lines.lines
+ line = lines[line_number]
+ raw = clean_lines.raw_lines
+ raw_line = raw[line_number]
+
+ regexp = r'\s*(\w(\w|::|\*|\&|\s|<|>|,|~)*)\(' # decls * & space::name( ...
+ match_result = match(regexp, line)
+ if not match_result:
+ return
+
+ # If the name is all caps and underscores, figure it's a macro and
+ # ignore it, unless it's TEST or TEST_F.
+ function_name = match_result.group(1).split()[-1]
+ if function_name != 'TEST' and function_name != 'TEST_F' and match(r'[A-Z_]+$', function_name):
+ return
+
+ joined_line = ''
+ for start_line_number in xrange(line_number, clean_lines.num_lines()):
+ start_line = lines[start_line_number]
+ joined_line += ' ' + start_line.lstrip()
+ if search(r'(;|})', start_line): # Declarations and trivial functions
+ return # ... ignore
+
+ if search(r'{', start_line):
+ # Replace template constructs with _ so that no spaces remain in the function name,
+ # while keeping the column numbers of other characters the same as "line".
+ line_with_no_templates = iteratively_replace_matches_with_char(r'<[^<>]*>', '_', line)
+ match_function = search(r'((\w|:|<|>|,|~)*)\(', line_with_no_templates)
+ if not match_function:
+ return # The '(' must have been inside of a template.
+
+ # Use the column numbers from the modified line to find the
+ # function name in the original line.
+ function = line[match_function.start(1):match_function.end(1)]
+
+ if match(r'TEST', function): # Handle TEST... macros
+ parameter_regexp = search(r'(\(.*\))', joined_line)
+ if parameter_regexp: # Ignore bad syntax
+ function += parameter_regexp.group(1)
+ else:
+ function += '()'
+ open_brace_index = start_line.find('{')
+ ending_line_number = close_expression(clean_lines, start_line_number, open_brace_index)[1]
+ function_state.begin(function, start_line_number + 1, ending_line_number)
+ return
+
+ # No body for the function (or evidence of a non-function) was found.
+ error(line_number, 'readability/fn_size', 5,
+ 'Lint failed to find start of function body.')
+
+
def check_for_function_lengths(clean_lines, line_number, function_state, error):
"""Reports for long function bodies.
For an overview why this is done, see:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
- Uses a simplistic algorithm assuming other style guidelines
- (especially spacing) are followed.
- Only checks unindented functions, so class members are unchecked.
- Trivial bodies are unchecked, so constructors with huge initializer lists
- may be missed.
Blank/comment lines are not counted so as to avoid encouraging the removal
of vertical space and commments just to get through a lint check.
NOLINT *on the last line of a function* disables this check.
@@ -1130,47 +1243,38 @@ def check_for_function_lengths(clean_lines, line_number, function_state, error):
line = lines[line_number]
raw = clean_lines.raw_lines
raw_line = raw[line_number]
- joined_line = ''
- starting_func = False
- regexp = r'(\w(\w|::|\*|\&|\s)*)\(' # decls * & space::name( ...
- match_result = match(regexp, line)
- if match_result:
- # If the name is all caps and underscores, figure it's a macro and
- # ignore it, unless it's TEST or TEST_F.
- function_name = match_result.group(1).split()[-1]
- if function_name == 'TEST' or function_name == 'TEST_F' or (not match(r'[A-Z_]+$', function_name)):
- starting_func = True
-
- if starting_func:
- body_found = False
- for start_line_number in xrange(line_number, clean_lines.num_lines()):
- start_line = lines[start_line_number]
- joined_line += ' ' + start_line.lstrip()
- if search(r'(;|})', start_line): # Declarations and trivial functions
- body_found = True
- break # ... ignore
- if search(r'{', start_line):
- body_found = True
- function = search(r'((\w|:)*)\(', line).group(1)
- if match(r'TEST', function): # Handle TEST... macros
- parameter_regexp = search(r'(\(.*\))', joined_line)
- if parameter_regexp: # Ignore bad syntax
- function += parameter_regexp.group(1)
- else:
- function += '()'
- function_state.begin(function)
- break
- if not body_found:
- # No body for the function (or evidence of a non-function) was found.
- error(line_number, 'readability/fn_size', 5,
- 'Lint failed to find start of function body.')
- elif match(r'^\}\s*$', line): # function end
+ if function_state.ending_line_number == line_number: # last line
if not search(r'\bNOLINT\b', raw_line):
function_state.check(error, line_number)
- function_state.end()
elif not match(r'^\s*$', line):
- function_state.count() # Count non-blank/non-comment lines.
+ function_state.count(line_number) # Count non-blank/non-comment lines.
+
+
+def check_pass_ptr_usage(clean_lines, line_number, function_state, error):
+ """Check for proper usage of Pass*Ptr.
+
+ Currently this is limited to detecting declarations of Pass*Ptr
+ variables inside of functions.
+
+ Args:
+ clean_lines: A CleansedLines instance containing the file.
+ line_number: The number of the line to check.
+ function_state: Current function name and lines in body so far.
+ error: The function to call with any errors found.
+ """
+ if not function_state.in_a_function:
+ return
+
+ lines = clean_lines.lines
+ line = lines[line_number]
+ if line_number >= function_state.body_start_line_number:
+ matched_pass_ptr = match(r'^\s*Pass([A-Z][A-Za-z]*)Ptr<', line)
+ if matched_pass_ptr:
+ type_name = 'Pass%sPtr' % matched_pass_ptr.group(1)
+ error(line_number, 'readability/pass_ptr', 5,
+ 'Local variables should never be %s (see '
+ 'http://webkit.org/coding/RefPtr.html).' % type_name)
def check_spacing(file_extension, clean_lines, line_number, error):
@@ -1289,7 +1393,7 @@ def check_spacing(file_extension, clean_lines, line_number, error):
line = clean_lines.elided[line_number] # get rid of comments and strings
# Don't try to do spacing checks for operator methods
- line = sub(r'operator(==|!=|<|<<|<=|>=|>>|>)\(', 'operator\(', line)
+ line = sub(r'operator(==|!=|<|<<|<=|>=|>>|>|\+=|-=|\*=|/=|%=|&=|\|=|^=|<<=|>>=)\(', 'operator\(', line)
# Don't try to do spacing checks for #include or #import statements at
# minimum because it messes up checks for spacing around /
if match(r'\s*#\s*(?:include|import)', line):
@@ -1333,26 +1437,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)
@@ -1365,9 +1468,14 @@ 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)\s+(?P<pointer_operator>\*|\&)\w+', line)
+ matched = match(r'\s*\w+(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\w+', line)
if matched:
error(line_number, 'whitespace/declaration', 3,
'Declaration has space between type name and %s in %s' % (matched.group('pointer_operator'), matched.group(0).strip()))
@@ -1652,7 +1760,7 @@ def check_braces(clean_lines, line_number, error):
# We check if a closed brace has started a line to see if a
# one line control statement was previous.
previous_line = clean_lines.elided[line_number - 2]
- if (previous_line.find('{') > 0
+ if (previous_line.find('{') > 0 and previous_line.find('}') < 0
and search(r'\b(if|for|foreach|while|else)\b', previous_line)):
error(line_number, 'whitespace/braces', 4,
'One line control clauses should not use braces.')
@@ -1864,8 +1972,20 @@ def check_for_null(file_extension, clean_lines, line_number, error):
line = clean_lines.elided[line_number]
- # Don't warn about NULL usage in g_object_{get,set}(). See Bug 32858
- if search(r'\bg_object_[sg]et\b', line):
+ # Don't warn about NULL usage in g_*(). See Bug 32858 and 39372.
+ if search(r'\bg(_[a-z]+)+\b', line):
+ return
+
+ # Don't warn about NULL usage in gst_*_many(). See Bug 39740
+ if search(r'\bgst_\w+_many\b', line):
+ return
+
+ # Don't warn about NULL usage in g_str{join,concat}(). See Bug 34834
+ if search(r'\bg_str(join|concat)\b', line):
+ return
+
+ # Don't warn about NULL usage in gdk_pixbuf_save_to_*{join,concat}(). See Bug 43090.
+ if search(r'\bgdk_pixbuf_save_to\w+\b', line):
return
if search(r'\bNULL\b', line):
@@ -1900,7 +2020,7 @@ def get_line_width(line):
return len(line)
-def check_style(clean_lines, line_number, file_extension, file_state, error):
+def check_style(clean_lines, line_number, file_extension, class_state, file_state, error):
"""Checks rules from the 'C++ style rules' section of cppguide.html.
Most of these rules are hard to test (naming, comment style), but we
@@ -1911,6 +2031,8 @@ def check_style(clean_lines, line_number, file_extension, file_state, error):
clean_lines: A CleansedLines instance containing the file.
line_number: The number of the line to check.
file_extension: The extension (without the dot) of the filename.
+ class_state: A _ClassState instance which maintains information about
+ the current stack of nested class declarations being parsed.
file_state: A _FileState instance which maintains information about
the state of things in the file.
error: The function to call with any errors found.
@@ -1971,6 +2093,10 @@ def check_style(clean_lines, line_number, file_extension, file_state, error):
and not ((cleansed_line.find('case ') != -1
or cleansed_line.find('default:') != -1)
and cleansed_line.find('break;') != -1)
+ # Also it's ok to have many commands in trivial single-line accessors in class definitions.
+ and not (match(r'.*\(.*\).*{.*.}', line)
+ and class_state.classinfo_stack
+ and line.count('{') == line.count('}'))
and not cleansed_line.startswith('#define ')):
error(line_number, 'whitespace/newline', 4,
'More than one command on the same line')
@@ -2421,7 +2547,12 @@ def check_identifier_name_in_declaration(filename, line_number, line, error):
# Convert "long long", "long double", and "long long int" to
# simple types, but don't remove simple "long".
line = sub(r'long (long )?(?=long|double|int)', '', line)
- line = sub(r'\b(unsigned|signed|inline|using|static|const|volatile|auto|register|extern|typedef|restrict|struct|class|virtual)(?=\W)', '', line)
+ # Convert unsigned/signed types to simple types, too.
+ line = sub(r'(unsigned|signed) (?=char|short|int|long)', '', line)
+ line = sub(r'\b(inline|using|static|const|volatile|auto|register|extern|typedef|restrict|struct|class|virtual)(?=\W)', '', line)
+
+ # Remove "new" and "new (expr)" to simplify, too.
+ line = sub(r'new\s*(\([^)]*\))?', '', line)
# Remove all template parameters by removing matching < and >.
# Loop until no templates are removed to remove nested templates.
@@ -2449,8 +2580,9 @@ def check_identifier_name_in_declaration(filename, line_number, line, error):
# Detect variable and functions.
type_regexp = r'\w([\w]|\s*[*&]\s*|::)+'
identifier_regexp = r'(?P<identifier>[\w:]+)'
+ maybe_bitfield_regexp = r'(:\s*\d+\s*)?'
character_after_identifier_regexp = r'(?P<character_after_identifier>[[;()=,])(?!=)'
- declaration_without_type_regexp = r'\s*' + identifier_regexp + r'\s*' + character_after_identifier_regexp
+ declaration_without_type_regexp = r'\s*' + identifier_regexp + r'\s*' + maybe_bitfield_regexp + character_after_identifier_regexp
declaration_with_type_regexp = r'\s*' + type_regexp + r'\s' + declaration_without_type_regexp
is_function_arguments = False
number_of_identifiers = 0
@@ -2480,14 +2612,23 @@ def check_identifier_name_in_declaration(filename, line_number, line, error):
modified_identifier = sub(r'(^|(?<=::))[ms]_', '', identifier)
if modified_identifier.find('_') >= 0:
# Various exceptions to the rule: JavaScript op codes functions, const_iterator.
- if (not (filename.find('JavaScriptCore') >= 0 and modified_identifier.find('_op_') >= 0)
+ if (not (filename.find('JavaScriptCore') >= 0 and modified_identifier.find('op_') >= 0)
and not modified_identifier.startswith('tst_')
and not modified_identifier.startswith('webkit_dom_object_')
+ and not modified_identifier.startswith('NPN_')
+ and not modified_identifier.startswith('NPP_')
+ and not modified_identifier.startswith('NP_')
and not modified_identifier.startswith('qt_')
+ and not modified_identifier.startswith('cairo_')
and not modified_identifier.find('::qt_') >= 0
- and not modified_identifier == "const_iterator"):
+ and not modified_identifier == "const_iterator"
+ and not modified_identifier == "vm_throw"):
error(line_number, 'readability/naming', 4, identifier + " is incorrectly named. Don't use underscores in your identifier names.")
+ # Check for variables named 'l', these are too easy to confuse with '1' in some fonts
+ if modified_identifier == 'l':
+ error(line_number, 'readability/naming', 4, identifier + " is incorrectly named. Don't use the single letter 'l' as an identifier name.")
+
# There can be only one declaration in non-for-control statements.
if control_statement:
return
@@ -2500,7 +2641,6 @@ def check_identifier_name_in_declaration(filename, line_number, line, error):
number_of_identifiers += 1
line = line[matched.end():]
-
def check_c_style_cast(line_number, line, raw_line, cast_type, pattern,
error):
"""Checks for a C-style cast by looking for the pattern.
@@ -2762,9 +2902,7 @@ def check_for_include_what_you_use(filename, clean_lines, include_state, error,
# found.
# e.g. If the file name is 'foo_flymake.cpp', we should search for 'foo.h'
# instead of 'foo_flymake.h'
- emacs_flymake_suffix = '_flymake.cpp'
- if abs_filename.endswith(emacs_flymake_suffix):
- abs_filename = abs_filename[:-len(emacs_flymake_suffix)] + '.cpp'
+ abs_filename = re.sub(r'_flymake\.cpp$', '.cpp', abs_filename)
# include_state is modified during iteration, so we iterate over a copy of
# the keys.
@@ -2817,11 +2955,13 @@ def process_line(filename, file_extension,
"""
raw_lines = clean_lines.raw_lines
+ detect_functions(clean_lines, line, function_state, error)
check_for_function_lengths(clean_lines, line, function_state, error)
if search(r'\bNOLINT\b', raw_lines[line]): # ignore nolint lines
return
+ check_pass_ptr_usage(clean_lines, line, function_state, error)
check_for_multiline_comments_and_strings(clean_lines, line, error)
- check_style(clean_lines, line, file_extension, file_state, error)
+ check_style(clean_lines, line, file_extension, class_state, file_state, error)
check_language(filename, clean_lines, line, file_extension, include_state,
error)
check_for_non_standard_constructs(clean_lines, line, class_state, error)
@@ -2829,7 +2969,7 @@ def process_line(filename, file_extension,
check_invalid_increment(clean_lines, line, error)
-def _process_lines(filename, file_extension, lines, error, verbosity):
+def _process_lines(filename, file_extension, lines, error, min_confidence):
"""Performs lint checks and reports any errors to the given error function.
Args:
@@ -2843,7 +2983,7 @@ def _process_lines(filename, file_extension, lines, error, verbosity):
['// marker so line numbers end in a known way'])
include_state = _IncludeState()
- function_state = _FunctionState(verbosity)
+ function_state = _FunctionState(min_confidence)
class_state = _ClassState()
file_state = _FileState()
@@ -2868,7 +3008,7 @@ def _process_lines(filename, file_extension, lines, error, verbosity):
check_for_new_line_at_eof(lines, error)
-class CppProcessor(object):
+class CppChecker(object):
"""Processes C++ lines for checking style."""
@@ -2904,6 +3044,7 @@ class CppProcessor(object):
'readability/multiline_string',
'readability/naming',
'readability/null',
+ 'readability/pass_ptr',
'readability/streams',
'readability/todo',
'readability/utf8',
@@ -2941,8 +3082,9 @@ class CppProcessor(object):
'whitespace/todo',
])
- def __init__(self, file_path, file_extension, handle_style_error, verbosity):
- """Create a CppProcessor instance.
+ def __init__(self, file_path, file_extension, handle_style_error,
+ min_confidence):
+ """Create a CppChecker instance.
Args:
file_extension: A string that is the file extension, without
@@ -2952,18 +3094,18 @@ class CppProcessor(object):
self.file_extension = file_extension
self.file_path = file_path
self.handle_style_error = handle_style_error
- self.verbosity = verbosity
+ self.min_confidence = min_confidence
# Useful for unit testing.
def __eq__(self, other):
- """Return whether this CppProcessor instance is equal to another."""
+ """Return whether this CppChecker instance is equal to another."""
if self.file_extension != other.file_extension:
return False
if self.file_path != other.file_path:
return False
if self.handle_style_error != other.handle_style_error:
return False
- if self.verbosity != other.verbosity:
+ if self.min_confidence != other.min_confidence:
return False
return True
@@ -2973,13 +3115,12 @@ class CppProcessor(object):
# Python does not automatically deduce __ne__() from __eq__().
return not self.__eq__(other)
- def process(self, lines):
+ def check(self, lines):
_process_lines(self.file_path, self.file_extension, lines,
- self.handle_style_error, self.verbosity)
+ self.handle_style_error, self.min_confidence)
# FIXME: Remove this function (requires refactoring unit tests).
-def process_file_data(filename, file_extension, lines, error, verbosity):
- processor = CppProcessor(filename, file_extension, error, verbosity)
- processor.process(lines)
-
+def process_file_data(filename, file_extension, lines, error, min_confidence):
+ checker = CppChecker(filename, file_extension, error, min_confidence)
+ checker.check(lines)
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index fb5a487..13b053c 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -42,13 +42,13 @@ import random
import re
import unittest
import cpp as cpp_style
-from cpp import CppProcessor
+from cpp import CppChecker
# This class works as an error collector and replaces cpp_style.Error
# function for the unit tests. We also verify each category we see
# is in STYLE_CATEGORIES, to help keep that list up to date.
class ErrorCollector:
- _all_style_categories = CppProcessor.categories
+ _all_style_categories = CppChecker.categories
# This is a list including all categories seen in any unit test.
_seen_style_categories = {}
@@ -119,20 +119,21 @@ class CppStyleTestBase(unittest.TestCase):
"""Provides some useful helper functions for cpp_style tests.
Attributes:
- verbosity: An integer that is the current verbosity level for
- the tests.
+ min_confidence: An integer that is the current minimum confidence
+ level for the tests.
"""
- # FIXME: Refactor the unit tests so the verbosity level is passed
+ # FIXME: Refactor the unit tests so the confidence level is passed
# explicitly, just like it is in the real code.
- verbosity = 1;
+ min_confidence = 1;
- # Helper function to avoid needing to explicitly pass verbosity
+ # Helper function to avoid needing to explicitly pass confidence
# in all the unit test calls to cpp_style.process_file_data().
def process_file_data(self, filename, file_extension, lines, error):
- """Call cpp_style.process_file_data() with the current verbosity."""
- return cpp_style.process_file_data(filename, file_extension, lines, error, self.verbosity)
+ """Call cpp_style.process_file_data() with the min_confidence."""
+ return cpp_style.process_file_data(filename, file_extension, lines,
+ error, self.min_confidence)
# Perform lint on single line of input and return the error message.
def perform_single_line_lint(self, code, file_name):
@@ -141,7 +142,7 @@ class CppStyleTestBase(unittest.TestCase):
cpp_style.remove_multi_line_comments(lines, error_collector)
clean_lines = cpp_style.CleansedLines(lines)
include_state = cpp_style._IncludeState()
- function_state = cpp_style._FunctionState(self.verbosity)
+ function_state = cpp_style._FunctionState(self.min_confidence)
ext = file_name[file_name.rfind('.') + 1:]
class_state = cpp_style._ClassState()
file_state = cpp_style._FileState()
@@ -163,7 +164,7 @@ class CppStyleTestBase(unittest.TestCase):
class_state = cpp_style._ClassState()
file_state = cpp_style._FileState()
for i in xrange(lines.num_lines()):
- cpp_style.check_style(lines, i, file_extension, file_state, error_collector)
+ cpp_style.check_style(lines, i, file_extension, class_state, file_state, error_collector)
cpp_style.check_for_non_standard_constructs(lines, i, class_state,
error_collector)
class_state.check_finished(error_collector)
@@ -199,15 +200,32 @@ class CppStyleTestBase(unittest.TestCase):
The accumulated errors.
"""
error_collector = ErrorCollector(self.assert_)
- function_state = cpp_style._FunctionState(self.verbosity)
+ function_state = cpp_style._FunctionState(self.min_confidence)
lines = code.split('\n')
cpp_style.remove_multi_line_comments(lines, error_collector)
lines = cpp_style.CleansedLines(lines)
for i in xrange(lines.num_lines()):
+ cpp_style.detect_functions(lines, i,
+ function_state, error_collector)
cpp_style.check_for_function_lengths(lines, i,
function_state, error_collector)
return error_collector.results()
+ # Similar to perform_function_lengths_check, but calls check_pass_ptr_usage
+ # instead of check_for_function_lengths.
+ def perform_pass_ptr_check(self, code):
+ error_collector = ErrorCollector(self.assert_)
+ function_state = cpp_style._FunctionState(self.min_confidence)
+ lines = code.split('\n')
+ cpp_style.remove_multi_line_comments(lines, error_collector)
+ lines = cpp_style.CleansedLines(lines)
+ for i in xrange(lines.num_lines()):
+ cpp_style.detect_functions(lines, i,
+ function_state, error_collector)
+ cpp_style.check_pass_ptr_usage(lines, i,
+ function_state, error_collector)
+ return error_collector.results()
+
def perform_include_what_you_use(self, code, filename='foo.h', io=codecs):
# First, build up the include state.
error_collector = ErrorCollector(self.assert_)
@@ -238,7 +256,7 @@ class CppStyleTestBase(unittest.TestCase):
if re.search(expected_message_re, message):
return
- self.assertEquals(expected_message, messages)
+ self.assertEquals(expected_message_re, messages)
def assert_multi_line_lint(self, code, expected_message, file_name='foo.h'):
file_extension = file_name[file_name.rfind('.') + 1:]
@@ -1163,28 +1181,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) {', '')
@@ -1310,6 +1330,19 @@ class CppStyleTest(CppStyleTestBase):
self.assert_multi_line_lint('#include "config.h"\n#import <foo/bar.h>\n',
'')
+ def test_operator_methods(self):
+ self.assert_lint('String operator+(const String&, const String&);', '')
+ self.assert_lint('bool operator==(const String&, const String&);', '')
+ self.assert_lint('String& operator-=(const String&, const String&);', '')
+ self.assert_lint('String& operator+=(const String&, const String&);', '')
+ self.assert_lint('String& operator*=(const String&, const String&);', '')
+ self.assert_lint('String& operator%=(const String&, const String&);', '')
+ self.assert_lint('String& operator&=(const String&, const String&);', '')
+ self.assert_lint('String& operator<<=(const String&, const String&);', '')
+ self.assert_lint('String& operator>>=(const String&, const String&);', '')
+ self.assert_lint('String& operator|=(const String&, const String&);', '')
+ self.assert_lint('String& operator^=(const String&, const String&);', '')
+
def test_spacing_before_last_semicolon(self):
self.assert_lint('call_function() ;',
'Extra space before last semicolon. If this should be an '
@@ -1541,12 +1574,20 @@ 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;',
'Declaration has space between type name and * in int *b [whitespace/declaration] [3]',
'foo.cpp')
self.assert_lint('return *b;', '', 'foo.cpp')
+ self.assert_lint('delete *b;', '', 'foo.cpp')
self.assert_lint('int *b;', '', 'foo.c')
self.assert_lint('int* b;',
'Declaration has space between * and variable name in int* b [whitespace/declaration] [3]',
@@ -1734,6 +1775,26 @@ class CppStyleTest(CppStyleTestBase):
' [build/header_guard] [5]' % expected_guard),
error_collector.result_list())
+ # Special case for flymake
+ error_collector = ErrorCollector(self.assert_)
+ self.process_file_data('mydir/Foo_flymake.h', 'h',
+ ['#ifndef %s' % expected_guard,
+ '#define %s' % expected_guard,
+ '#endif // %s' % expected_guard],
+ error_collector)
+ for line in error_collector.result_list():
+ if line.find('build/header_guard') != -1:
+ self.fail('Unexpected error: %s' % line)
+
+ error_collector = ErrorCollector(self.assert_)
+ self.process_file_data('mydir/Foo_flymake.h', 'h', [], error_collector)
+ self.assertEquals(
+ 1,
+ error_collector.result_list().count(
+ 'No #ifndef header guard found, suggested CPP variable is: %s'
+ ' [build/header_guard] [5]' % expected_guard),
+ error_collector.result_list())
+
def test_build_printf_format(self):
self.assert_lint(
r'printf("\%%d", value);',
@@ -2227,11 +2288,11 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
cpp_style._FunctionState._TEST_TRIGGER = self.old_test_trigger
# FIXME: Eliminate the need for this function.
- def set_verbosity(self, verbosity):
- """Set new test verbosity and return old test verbosity."""
- old_verbosity = self.verbosity
- self.verbosity = verbosity
- return old_verbosity
+ def set_min_confidence(self, min_confidence):
+ """Set new test confidence and return old test confidence."""
+ old_min_confidence = self.min_confidence
+ self.min_confidence = min_confidence
+ return old_min_confidence
def assert_function_lengths_check(self, code, expected_message):
"""Check warnings for long function bodies are as expected.
@@ -2272,7 +2333,7 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
lines: Number of lines to generate.
error_level: --v setting for cpp_style.
"""
- trigger_level = self.trigger_lines(self.verbosity)
+ trigger_level = self.trigger_lines(self.min_confidence)
self.assert_function_lengths_check(
'void test(int x)' + self.function_body(lines),
('Small and focused functions are preferred: '
@@ -2355,29 +2416,29 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
'')
def test_function_length_check_definition_below_severity0(self):
- old_verbosity = self.set_verbosity(0)
+ old_min_confidence = self.set_min_confidence(0)
self.assert_function_length_check_definition_ok(self.trigger_lines(0) - 1)
- self.set_verbosity(old_verbosity)
+ self.set_min_confidence(old_min_confidence)
def test_function_length_check_definition_at_severity0(self):
- old_verbosity = self.set_verbosity(0)
+ old_min_confidence = self.set_min_confidence(0)
self.assert_function_length_check_definition_ok(self.trigger_lines(0))
- self.set_verbosity(old_verbosity)
+ self.set_min_confidence(old_min_confidence)
def test_function_length_check_definition_above_severity0(self):
- old_verbosity = self.set_verbosity(0)
+ old_min_confidence = self.set_min_confidence(0)
self.assert_function_length_check_above_error_level(0)
- self.set_verbosity(old_verbosity)
+ self.set_min_confidence(old_min_confidence)
def test_function_length_check_definition_below_severity1v0(self):
- old_verbosity = self.set_verbosity(0)
+ old_min_confidence = self.set_min_confidence(0)
self.assert_function_length_check_below_error_level(1)
- self.set_verbosity(old_verbosity)
+ self.set_min_confidence(old_min_confidence)
def test_function_length_check_definition_at_severity1v0(self):
- old_verbosity = self.set_verbosity(0)
+ old_min_confidence = self.set_min_confidence(0)
self.assert_function_length_check_at_error_level(1)
- self.set_verbosity(old_verbosity)
+ self.set_min_confidence(old_min_confidence)
def test_function_length_check_definition_below_severity1(self):
self.assert_function_length_check_definition_ok(self.trigger_lines(1) - 1)
@@ -2388,10 +2449,24 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
def test_function_length_check_definition_above_severity1(self):
self.assert_function_length_check_above_error_level(1)
+ def test_function_length_check_definition_severity1_plus_indented(self):
+ error_level = 1
+ error_lines = self.trigger_lines(error_level) + 1
+ trigger_level = self.trigger_lines(self.min_confidence)
+ indent_spaces = ' '
+ self.assert_function_lengths_check(
+ re.sub(r'(?m)^(.)', indent_spaces + r'\1',
+ 'void test_indent(int x)\n' + self.function_body(error_lines)),
+ ('Small and focused functions are preferred: '
+ 'test_indent() has %d non-comment lines '
+ '(error triggered by exceeding %d lines).'
+ ' [readability/fn_size] [%d]')
+ % (error_lines, trigger_level, error_level))
+
def test_function_length_check_definition_severity1_plus_blanks(self):
error_level = 1
error_lines = self.trigger_lines(error_level) + 1
- trigger_level = self.trigger_lines(self.verbosity)
+ trigger_level = self.trigger_lines(self.min_confidence)
self.assert_function_lengths_check(
'void test_blanks(int x)' + self.function_body(error_lines),
('Small and focused functions are preferred: '
@@ -2403,13 +2478,13 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
def test_function_length_check_complex_definition_severity1(self):
error_level = 1
error_lines = self.trigger_lines(error_level) + 1
- trigger_level = self.trigger_lines(self.verbosity)
+ trigger_level = self.trigger_lines(self.min_confidence)
self.assert_function_lengths_check(
- ('my_namespace::my_other_namespace::MyVeryLongTypeName*\n'
- 'my_namespace::my_other_namespace::MyFunction(int arg1, char* arg2)'
+ ('my_namespace::my_other_namespace::MyVeryLongTypeName<Type1, bool func(const Element*)>*\n'
+ 'my_namespace::my_other_namespace<Type3, Type4>::~MyFunction<Type5<Type6, Type7> >(int arg1, char* arg2)'
+ self.function_body(error_lines)),
('Small and focused functions are preferred: '
- 'my_namespace::my_other_namespace::MyFunction()'
+ 'my_namespace::my_other_namespace<Type3, Type4>::~MyFunction<Type5<Type6, Type7> >()'
' has %d non-comment lines '
'(error triggered by exceeding %d lines).'
' [readability/fn_size] [%d]')
@@ -2418,7 +2493,7 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
def test_function_length_check_definition_severity1_for_test(self):
error_level = 1
error_lines = self.trigger_test_lines(error_level) + 1
- trigger_level = self.trigger_test_lines(self.verbosity)
+ trigger_level = self.trigger_test_lines(self.min_confidence)
self.assert_function_lengths_check(
'TEST_F(Test, Mutator)' + self.function_body(error_lines),
('Small and focused functions are preferred: '
@@ -2430,7 +2505,7 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
def test_function_length_check_definition_severity1_for_split_line_test(self):
error_level = 1
error_lines = self.trigger_test_lines(error_level) + 1
- trigger_level = self.trigger_test_lines(self.verbosity)
+ trigger_level = self.trigger_test_lines(self.min_confidence)
self.assert_function_lengths_check(
('TEST_F(GoogleUpdateRecoveryRegistryProtectedTest,\n'
' FixGoogleUpdate_AllValues_MachineApp)' # note: 4 spaces
@@ -2440,12 +2515,12 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
'FixGoogleUpdate_AllValues_MachineApp) has %d non-comment lines '
'(error triggered by exceeding %d lines).'
' [readability/fn_size] [%d]')
- % (error_lines+1, trigger_level, error_level))
+ % (error_lines, trigger_level, error_level))
def test_function_length_check_definition_severity1_for_bad_test_doesnt_break(self):
error_level = 1
error_lines = self.trigger_test_lines(error_level) + 1
- trigger_level = self.trigger_test_lines(self.verbosity)
+ trigger_level = self.trigger_test_lines(self.min_confidence)
self.assert_function_lengths_check(
('TEST_F('
+ self.function_body(error_lines)),
@@ -2458,7 +2533,7 @@ class CheckForFunctionLengthsTest(CppStyleTestBase):
def test_function_length_check_definition_severity1_with_embedded_no_lints(self):
error_level = 1
error_lines = self.trigger_lines(error_level) + 1
- trigger_level = self.trigger_lines(self.verbosity)
+ trigger_level = self.trigger_lines(self.min_confidence)
self.assert_function_lengths_check(
'void test(int x)' + self.function_body_with_no_lints(error_lines),
('Small and focused functions are preferred: '
@@ -2563,6 +2638,19 @@ class NoNonVirtualDestructorsTest(CppStyleTestBase):
self.assert_multi_line_lint(
'class Foo { void foo(); };',
'More than one command on the same line [whitespace/newline] [4]')
+ self.assert_multi_line_lint(
+ 'class MyClass {\n'
+ ' int getIntValue() { ASSERT(m_ptr); return *m_ptr; }\n'
+ '};\n',
+ '')
+ self.assert_multi_line_lint(
+ 'class MyClass {\n'
+ ' int getIntValue()\n'
+ ' {\n'
+ ' ASSERT(m_ptr); return *m_ptr;\n'
+ ' }\n'
+ '};\n',
+ 'More than one command on the same line [whitespace/newline] [4]')
self.assert_multi_line_lint(
'''class Qualified::Goo : public Foo {
@@ -2657,6 +2745,65 @@ class NoNonVirtualDestructorsTest(CppStyleTestBase):
'virtual method(s), one declared at line 2. [runtime/virtual] [4]'])
+class PassPtrTest(CppStyleTestBase):
+ # For http://webkit.org/coding/RefPtr.html
+
+ def assert_pass_ptr_check(self, code, expected_message):
+ """Check warnings for Pass*Ptr are as expected.
+
+ Args:
+ code: C++ source code expected to generate a warning message.
+ expected_message: Message expected to be generated by the C++ code.
+ """
+ self.assertEquals(expected_message,
+ self.perform_pass_ptr_check(code))
+
+ def test_pass_ref_ptr_in_function(self):
+ # Local variables should never be PassRefPtr.
+ self.assert_pass_ptr_check(
+ 'int myFunction()\n'
+ '{\n'
+ ' PassRefPtr<Type1> variable = variable2;\n'
+ '}',
+ 'Local variables should never be PassRefPtr (see '
+ 'http://webkit.org/coding/RefPtr.html). [readability/pass_ptr] [5]')
+
+ def test_pass_own_ptr_in_function(self):
+ # Local variables should never be PassRefPtr.
+ self.assert_pass_ptr_check(
+ 'int myFunction()\n'
+ '{\n'
+ ' PassOwnPtr<Type1> variable = variable2;\n'
+ '}',
+ 'Local variables should never be PassOwnPtr (see '
+ 'http://webkit.org/coding/RefPtr.html). [readability/pass_ptr] [5]')
+
+ def test_pass_other_type_ptr_in_function(self):
+ # Local variables should never be PassRefPtr.
+ self.assert_pass_ptr_check(
+ 'int myFunction()\n'
+ '{\n'
+ ' PassOtherTypePtr<Type1> variable;\n'
+ '}',
+ 'Local variables should never be PassOtherTypePtr (see '
+ 'http://webkit.org/coding/RefPtr.html). [readability/pass_ptr] [5]')
+
+ def test_pass_ref_ptr_return_value(self):
+ self.assert_pass_ptr_check(
+ 'PassRefPtr<Type1>\n'
+ 'myFunction(int)\n'
+ '{\n'
+ '}',
+ '')
+
+ def test_pass_ref_ptr_parameter_value(self):
+ self.assert_pass_ptr_check(
+ 'int myFunction(PassRefPtr<Type1>)\n'
+ '{\n'
+ '}',
+ '')
+
+
class WebKitStyleTest(CppStyleTestBase):
# for http://webkit.org/coding/coding-style.html
@@ -3037,7 +3184,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',
@@ -3063,6 +3210,20 @@ class WebKitStyleTest(CppStyleTestBase):
'}\n',
['More than one command on the same line in if [whitespace/parens] [4]',
'One line control clauses should not use braces. [whitespace/braces] [4]'])
+ self.assert_multi_line_lint(
+ 'void func()\n'
+ '{\n'
+ ' while (condition) { }\n'
+ ' return 0;\n'
+ '}\n',
+ '')
+ self.assert_multi_line_lint(
+ 'void func()\n'
+ '{\n'
+ ' for (i = 0; i < 42; i++) { foobar(); }\n'
+ ' return 0;\n'
+ '}\n',
+ 'More than one command on the same line in for [whitespace/parens] [4]')
# 3. An else if statement should be written as an if statement
# when the prior if concludes with a return statement.
@@ -3392,13 +3553,50 @@ class WebKitStyleTest(CppStyleTestBase):
'',
'foo.m')
- # Make sure that the NULL check does not apply to g_object_{set,get}
+ # Make sure that the NULL check does not apply to g_object_{set,get} and
+ # g_str{join,concat}
self.assert_lint(
'g_object_get(foo, "prop", &bar, NULL);',
'')
self.assert_lint(
'g_object_set(foo, "prop", bar, NULL);',
'')
+ self.assert_lint(
+ 'g_build_filename(foo, bar, NULL);',
+ '')
+ self.assert_lint(
+ 'gst_bin_add_many(foo, bar, boo, NULL);',
+ '')
+ self.assert_lint(
+ 'gst_bin_remove_many(foo, bar, boo, NULL);',
+ '')
+ self.assert_lint(
+ 'gst_element_link_many(foo, bar, boo, NULL);',
+ '')
+ self.assert_lint(
+ 'gst_element_unlink_many(foo, bar, boo, NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = g_strconcat("part1", "part2", "part3", NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = g_strconcat("part1", NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = g_strjoin(",", "part1", "part2", "part3", NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = g_strjoin(",", "part1", NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = gdk_pixbuf_save_to_callback(pixbuf, function, data, type, error, NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = gdk_pixbuf_save_to_buffer(pixbuf, function, data, type, error, NULL);',
+ '')
+ self.assert_lint(
+ 'gchar* result = gdk_pixbuf_save_to_stream(pixbuf, function, data, type, error, NULL);',
+ '')
# 2. C++ and C bool values should be written as true and
# false. Objective-C BOOL values should be written as YES and NO.
@@ -3489,7 +3687,8 @@ class WebKitStyleTest(CppStyleTestBase):
'foo.h')
def test_names(self):
- name_error_message = " is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4]"
+ name_underscore_error_message = " is incorrectly named. Don't use underscores in your identifier names. [readability/naming] [4]"
+ name_tooshort_error_message = " is incorrectly named. Don't use the single letter 'l' as an identifier name. [readability/naming] [4]"
# Basic cases from WebKit style guide.
self.assert_lint('struct Data;', '')
@@ -3497,54 +3696,65 @@ class WebKitStyleTest(CppStyleTestBase):
self.assert_lint('class HTMLDocument;', '')
self.assert_lint('String mimeType();', '')
self.assert_lint('size_t buffer_size;',
- 'buffer_size' + name_error_message)
+ 'buffer_size' + name_underscore_error_message)
self.assert_lint('short m_length;', '')
self.assert_lint('short _length;',
- '_length' + name_error_message)
+ '_length' + name_underscore_error_message)
self.assert_lint('short length_;',
- 'length_' + name_error_message)
+ 'length_' + name_underscore_error_message)
+ self.assert_lint('unsigned _length;',
+ '_length' + name_underscore_error_message)
+ self.assert_lint('unsigned int _length;',
+ '_length' + name_underscore_error_message)
+ self.assert_lint('unsigned long long _length;',
+ '_length' + name_underscore_error_message)
+
+ # Variable name 'l' is easy to confuse with '1'
+ self.assert_lint('int l;', 'l' + name_tooshort_error_message)
+ self.assert_lint('size_t l;', 'l' + name_tooshort_error_message)
+ self.assert_lint('long long l;', 'l' + name_tooshort_error_message)
# Pointers, references, functions, templates, and adjectives.
self.assert_lint('char* under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('const int UNDER_SCORE;',
- 'UNDER_SCORE' + name_error_message)
+ 'UNDER_SCORE' + name_underscore_error_message)
self.assert_lint('static inline const char const& const under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('WebCore::RenderObject* under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('int func_name();',
- 'func_name' + name_error_message)
+ 'func_name' + name_underscore_error_message)
self.assert_lint('RefPtr<RenderObject*> under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('WTF::Vector<WTF::RefPtr<const RenderObject* const> > under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('int under_score[];',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('struct dirent* under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('long under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('long long under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('long double under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('long long int under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
# Declarations in control statement.
self.assert_lint('if (int under_score = 42) {',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('else if (int under_score = 42) {',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('for (int under_score = 42; cond; i++) {',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('while (foo & under_score = bar) {',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('for (foo * under_score = p; cond; i++) {',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('for (foo * under_score; cond; i++) {',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('while (foo & value_in_thirdparty_library) {', '')
self.assert_lint('while (foo * value_in_thirdparty_library) {', '')
self.assert_lint('if (mli && S_OK == mli->foo()) {', '')
@@ -3552,38 +3762,39 @@ class WebKitStyleTest(CppStyleTestBase):
# More member variables and functions.
self.assert_lint('int SomeClass::s_validName', '')
self.assert_lint('int m_under_score;',
- 'm_under_score' + name_error_message)
+ 'm_under_score' + name_underscore_error_message)
self.assert_lint('int SomeClass::s_under_score = 0;',
- 'SomeClass::s_under_score' + name_error_message)
+ 'SomeClass::s_under_score' + name_underscore_error_message)
self.assert_lint('int SomeClass::under_score = 0;',
- 'SomeClass::under_score' + name_error_message)
+ 'SomeClass::under_score' + name_underscore_error_message)
# Other statements.
self.assert_lint('return INT_MAX;', '')
self.assert_lint('return_t under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('goto under_score;',
- 'under_score' + name_error_message)
+ 'under_score' + name_underscore_error_message)
self.assert_lint('delete static_cast<Foo*>(p);', '')
# Multiple variables in one line.
self.assert_lint('void myFunction(int variable1, int another_variable);',
- 'another_variable' + name_error_message)
+ 'another_variable' + name_underscore_error_message)
self.assert_lint('int variable1, another_variable;',
- 'another_variable' + name_error_message)
+ 'another_variable' + name_underscore_error_message)
self.assert_lint('int first_variable, secondVariable;',
- 'first_variable' + name_error_message)
+ 'first_variable' + name_underscore_error_message)
self.assert_lint('void my_function(int variable_1, int variable_2);',
- ['my_function' + name_error_message,
- 'variable_1' + name_error_message,
- 'variable_2' + name_error_message])
+ ['my_function' + name_underscore_error_message,
+ 'variable_1' + name_underscore_error_message,
+ 'variable_2' + name_underscore_error_message])
self.assert_lint('for (int variable_1, variable_2;;) {',
- ['variable_1' + name_error_message,
- 'variable_2' + name_error_message])
+ ['variable_1' + name_underscore_error_message,
+ 'variable_2' + name_underscore_error_message])
# There is an exception for op code functions but only in the JavaScriptCore directory.
self.assert_lint('void this_op_code(int var1, int var2)', '', 'JavaScriptCore/foo.cpp')
- self.assert_lint('void this_op_code(int var1, int var2)', 'this_op_code' + name_error_message)
+ self.assert_lint('void op_code(int var1, int var2)', '', 'JavaScriptCore/foo.cpp')
+ self.assert_lint('void this_op_code(int var1, int var2)', 'this_op_code' + name_underscore_error_message)
# GObject requires certain magical names in class declarations.
self.assert_lint('void webkit_dom_object_init();', '')
@@ -3596,9 +3807,32 @@ class WebKitStyleTest(CppStyleTestBase):
self.assert_lint('void QTFrame::qt_drt_is_awesome(int var1, int var2)', '')
self.assert_lint('void qt_drt_is_awesome(int var1, int var2);', '')
+ # Cairo forward-declarations should not be a failure.
+ self.assert_lint('typedef struct _cairo cairo_t;', '')
+ self.assert_lint('typedef struct _cairo_surface cairo_surface_t;', '')
+ self.assert_lint('typedef struct _cairo_scaled_font cairo_scaled_font_t;', '')
+
+ # NPAPI functions that start with NPN_, NPP_ or NP_ are allowed.
+ self.assert_lint('void NPN_Status(NPP, const char*)', '')
+ self.assert_lint('NPError NPP_SetWindow(NPP instance, NPWindow *window)', '')
+ self.assert_lint('NPObject* NP_Allocate(NPP, NPClass*)', '')
+
# const_iterator is allowed as well.
self.assert_lint('typedef VectorType::const_iterator const_iterator;', '')
+ # vm_throw is allowed as well.
+ self.assert_lint('int vm_throw;', '')
+
+ # Bitfields.
+ self.assert_lint('unsigned _fillRule : 1;',
+ '_fillRule' + name_underscore_error_message)
+
+ # new operators in initialization.
+ self.assert_lint('OwnPtr<uint32_t> variable(new uint32_t);', '')
+ self.assert_lint('OwnPtr<uint32_t> variable(new (expr) uint32_t);', '')
+ self.assert_lint('OwnPtr<uint32_t> under_score(new uint32_t);',
+ 'under_score' + name_underscore_error_message)
+
def test_comments(self):
# A comment at the beginning of a line is ok.
@@ -3614,52 +3848,52 @@ class WebKitStyleTest(CppStyleTestBase):
pass
-class CppProcessorTest(unittest.TestCase):
+class CppCheckerTest(unittest.TestCase):
- """Tests CppProcessor class."""
+ """Tests CppChecker class."""
def mock_handle_style_error(self):
pass
- def _processor(self):
- return CppProcessor("foo", "h", self.mock_handle_style_error, 3)
+ def _checker(self):
+ return CppChecker("foo", "h", self.mock_handle_style_error, 3)
def test_init(self):
"""Test __init__ constructor."""
- processor = self._processor()
- self.assertEquals(processor.file_extension, "h")
- self.assertEquals(processor.file_path, "foo")
- self.assertEquals(processor.handle_style_error, self.mock_handle_style_error)
- self.assertEquals(processor.verbosity, 3)
+ checker = self._checker()
+ self.assertEquals(checker.file_extension, "h")
+ self.assertEquals(checker.file_path, "foo")
+ self.assertEquals(checker.handle_style_error, self.mock_handle_style_error)
+ self.assertEquals(checker.min_confidence, 3)
def test_eq(self):
"""Test __eq__ equality function."""
- processor1 = self._processor()
- processor2 = self._processor()
+ checker1 = self._checker()
+ checker2 = self._checker()
# == calls __eq__.
- self.assertTrue(processor1 == processor2)
+ self.assertTrue(checker1 == checker2)
def mock_handle_style_error2(self):
pass
# Verify that a difference in any argument cause equality to fail.
- processor = CppProcessor("foo", "h", self.mock_handle_style_error, 3)
- self.assertFalse(processor == CppProcessor("bar", "h", self.mock_handle_style_error, 3))
- self.assertFalse(processor == CppProcessor("foo", "c", self.mock_handle_style_error, 3))
- self.assertFalse(processor == CppProcessor("foo", "h", mock_handle_style_error2, 3))
- self.assertFalse(processor == CppProcessor("foo", "h", self.mock_handle_style_error, 4))
+ checker = CppChecker("foo", "h", self.mock_handle_style_error, 3)
+ self.assertFalse(checker == CppChecker("bar", "h", self.mock_handle_style_error, 3))
+ self.assertFalse(checker == CppChecker("foo", "c", self.mock_handle_style_error, 3))
+ self.assertFalse(checker == CppChecker("foo", "h", mock_handle_style_error2, 3))
+ self.assertFalse(checker == CppChecker("foo", "h", self.mock_handle_style_error, 4))
def test_ne(self):
"""Test __ne__ inequality function."""
- processor1 = self._processor()
- processor2 = self._processor()
+ checker1 = self._checker()
+ checker2 = self._checker()
# != calls __ne__.
# By default, __ne__ always returns true on different objects.
# Thus, just check the distinguishing case to verify that the
# code defines __ne__.
- self.assertFalse(processor1 != processor2)
+ self.assertFalse(checker1 != checker2)
def tearDown():
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/python.py b/WebKitTools/Scripts/webkitpy/style/checkers/python.py
new file mode 100644
index 0000000..70d4450
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/python.py
@@ -0,0 +1,56 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Supports checking WebKit style in Python files."""
+
+from ...style_references import pep8
+
+
+class PythonChecker(object):
+
+ """Processes text lines for checking style."""
+
+ def __init__(self, file_path, handle_style_error):
+ self._file_path = file_path
+ self._handle_style_error = handle_style_error
+
+ def check(self, lines):
+ # Initialize pep8.options, which is necessary for
+ # Checker.check_all() to execute.
+ pep8.process_options(arglist=[self._file_path])
+
+ checker = pep8.Checker(self._file_path)
+
+ def _pep8_handle_error(line_number, offset, text, check):
+ # FIXME: Incorporate the character offset into the error output.
+ # This will require updating the error handler __call__
+ # signature to include an optional "offset" parameter.
+ pep8_code = text[:4]
+ pep8_message = text[5:]
+
+ category = "pep8/" + pep8_code
+
+ self._handle_style_error(line_number, category, 5, pep8_message)
+
+ checker.report_error = _pep8_handle_error
+
+ errors = checker.check_all()
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/python_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/python_unittest.py
new file mode 100644
index 0000000..e003eb8
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/python_unittest.py
@@ -0,0 +1,62 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Unit tests for python.py."""
+
+import os
+import unittest
+
+from python import PythonChecker
+
+
+class PythonCheckerTest(unittest.TestCase):
+
+ """Tests the PythonChecker class."""
+
+ def test_init(self):
+ """Test __init__() method."""
+ def _mock_handle_style_error(self):
+ pass
+
+ checker = PythonChecker("foo.txt", _mock_handle_style_error)
+ self.assertEquals(checker._file_path, "foo.txt")
+ self.assertEquals(checker._handle_style_error,
+ _mock_handle_style_error)
+
+ def test_check(self):
+ """Test check() method."""
+ errors = []
+
+ def _mock_handle_style_error(line_number, category, confidence,
+ message):
+ error = (line_number, category, confidence, message)
+ errors.append(error)
+
+ current_dir = os.path.dirname(__file__)
+ file_path = os.path.join(current_dir, "python_unittest_input.py")
+
+ checker = PythonChecker(file_path, _mock_handle_style_error)
+ checker.check(lines=[])
+
+ self.assertEquals(len(errors), 1)
+ self.assertEquals(errors[0],
+ (2, "pep8/W291", 5, "trailing whitespace"))
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/python_unittest_input.py b/WebKitTools/Scripts/webkitpy/style/checkers/python_unittest_input.py
new file mode 100644
index 0000000..9f1d118
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/python_unittest_input.py
@@ -0,0 +1,2 @@
+# This file is sample input for python_unittest.py and includes a single
+# error which is an extra space at the end of this line.
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py
new file mode 100644
index 0000000..d2d67f3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations.py
@@ -0,0 +1,123 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Checks WebKit style for test_expectations files."""
+
+import logging
+import os
+import re
+import sys
+
+from common import TabChecker
+from webkitpy.style_references import port
+from webkitpy.style_references import test_expectations
+
+_log = logging.getLogger("webkitpy.style.checkers.test_expectations")
+
+
+class ChromiumOptions(object):
+ """A mock object for creating chromium port object.
+
+ port.get() requires an options object which has 'chromium' attribute to create
+ chromium port object for each platform. This class mocks such object.
+ """
+ def __init__(self):
+ self.chromium = True
+ self.use_drt = True
+
+
+class TestExpectationsChecker(object):
+ """Processes test_expectations.txt lines for validating the syntax."""
+
+ categories = set(['test/expectations'])
+
+ def __init__(self, file_path, handle_style_error):
+ self._file_path = file_path
+ self._handle_style_error = handle_style_error
+ self._tab_checker = TabChecker(file_path, handle_style_error)
+ self._output_regex = re.compile('Line:(?P<line>\d+)\s*(?P<message>.+)')
+ # Determining the port of this expectations.
+ try:
+ port_name = self._file_path.split(os.sep)[-2]
+ if port_name == "chromium":
+ options = ChromiumOptions()
+ self._port_obj = port.get(port_name=None, options=options)
+ else:
+ self._port_obj = port.get(port_name=port_name)
+ except:
+ # Using 'test' port when we couldn't determine the port for this
+ # expectations.
+ _log.warn("Could not determine the port for %s. "
+ "Using 'test' port, but platform-specific expectations "
+ "will fail the check." % self._file_path)
+ self._port_obj = port.get('test')
+ self._port_to_check = self._port_obj.test_platform_name()
+ # Suppress error messages of test_expectations module since they will be
+ # reported later.
+ log = logging.getLogger("webkitpy.layout_tests.layout_package."
+ "test_expectations")
+ log.setLevel(logging.CRITICAL)
+
+ def _handle_error_message(self, lineno, message, confidence):
+ pass
+
+ def check_test_expectations(self, expectations_str, tests=None, overrides=None):
+ errors = []
+ expectations = None
+ try:
+ expectations = test_expectations.TestExpectationsFile(
+ port=self._port_obj, expectations=expectations_str, full_test_list=tests,
+ test_platform_name=self._port_to_check, is_debug_mode=False,
+ is_lint_mode=True, suppress_errors=False, overrides=overrides)
+ except SyntaxError, error:
+ errors = str(error).splitlines()
+
+ for error in errors:
+ matched = self._output_regex.match(error)
+ if matched:
+ lineno, message = matched.group('line', 'message')
+ self._handle_style_error(int(lineno), 'test/expectations', 5, message)
+
+ if expectations:
+ for error in expectations.get_non_fatal_errors():
+ matched = self._output_regex.match(error)
+ if matched:
+ lineno, message = matched.group('line', 'message')
+ self._handle_style_error(int(lineno), 'test/expectations', 2, message)
+
+ def check_tabs(self, lines):
+ self._tab_checker.check(lines)
+
+ def check(self, lines):
+ overrides = self._port_obj.test_expectations_overrides()
+ expectations = '\n'.join(lines)
+ self.check_test_expectations(expectations_str=expectations,
+ tests=None,
+ overrides=overrides)
+ # Warn tabs in lines as well
+ self.check_tabs(lines)
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
new file mode 100644
index 0000000..31f0b40
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py
@@ -0,0 +1,168 @@
+#!/usr/bin/python
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Unit tests for test_expectations.py."""
+
+import os
+import sys
+import unittest
+
+# We need following workaround hack to run this unit tests in stand-alone.
+try:
+ d = os.path.dirname(__file__)
+except NameError:
+ d = os.path.dirname(sys.argv[0])
+sys.path.append(os.path.abspath(os.path.join(d, '../../../')))
+
+from test_expectations import TestExpectationsChecker
+from webkitpy.style_references import port
+from webkitpy.style_references import test_expectations as test_expectations_style
+
+
+class ErrorCollector(object):
+ """An error handler class for unit tests."""
+
+ def __init__(self):
+ self._errors = []
+
+ def __call__(self, lineno, category, confidence, message):
+ self._errors.append('%s [%s] [%d]' % (message, category, confidence))
+
+ def get_errors(self):
+ return ''.join(self._errors)
+
+ def reset_errors(self):
+ self._errors = []
+
+
+class TestExpectationsTestCase(unittest.TestCase):
+ """TestCase for test_expectations.py"""
+
+ def setUp(self):
+ self._error_collector = ErrorCollector()
+ port_obj = port.get('test')
+ self._test_file = os.path.join(port_obj.layout_tests_dir(), 'passes/text.html')
+
+ def process_expectations(self, expectations, overrides=None):
+ self._checker = TestExpectationsChecker()
+
+ def assert_lines_lint(self, lines, expected):
+ self._error_collector.reset_errors()
+ checker = TestExpectationsChecker('test/test_expectations.txt',
+ self._error_collector)
+ checker.check_test_expectations(expectations_str='\n'.join(lines),
+ tests=[self._test_file],
+ overrides=None)
+ checker.check_tabs(lines)
+ self.assertEqual(expected, self._error_collector.get_errors())
+
+ def test_valid_expectations(self):
+ self.assert_lines_lint(
+ ["passes/text.html = PASS"],
+ "")
+ self.assert_lines_lint(
+ ["passes/text.html = FAIL PASS"],
+ "")
+ self.assert_lines_lint(
+ ["passes/text.html = CRASH TIMEOUT FAIL PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 MAC : passes/text.html = PASS FAIL"],
+ "")
+ self.assert_lines_lint(
+ ["SKIP BUG1234 : passes/text.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 DEBUG : passes/text.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 DEBUG SKIP : passes/text.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 MAC DEBUG SKIP : passes/text.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["BUG1234 DEBUG MAC : passes/text.html = TIMEOUT PASS"],
+ "")
+ self.assert_lines_lint(
+ ["SLOW BUG1234 : passes/text.html = PASS"],
+ "")
+ self.assert_lines_lint(
+ ["WONTFIX SKIP : passes/text.html = TIMEOUT"],
+ "")
+
+ def test_valid_modifiers(self):
+ self.assert_lines_lint(
+ ["INVALID-MODIFIER : passes/text.html = PASS"],
+ "Invalid modifier for test: invalid-modifier "
+ "passes/text.html [test/expectations] [5]")
+ self.assert_lines_lint(
+ ["SKIP : passes/text.html = PASS"],
+ "Test lacks BUG modifier. "
+ "passes/text.html [test/expectations] [2]")
+
+ def test_expectation_errors(self):
+ self.assert_lines_lint(
+ ["missing expectations"],
+ "Missing expectations. ['missing expectations'] [test/expectations] [5]")
+ self.assert_lines_lint(
+ ["SLOW : passes/text.html = TIMEOUT"],
+ "A test can not be both slow and timeout. "
+ "If it times out indefinitely, then it should be just timeout. "
+ "passes/text.html [test/expectations] [5]")
+ self.assert_lines_lint(
+ ["does/not/exist.html = FAIL"],
+ "Path does not exist. does/not/exist.html [test/expectations] [2]")
+
+ def test_parse_expectations(self):
+ self.assert_lines_lint(
+ ["passes/text.html = PASS"],
+ "")
+ self.assert_lines_lint(
+ ["passes/text.html = UNSUPPORTED"],
+ "Unsupported expectation: unsupported "
+ "passes/text.html [test/expectations] [5]")
+ self.assert_lines_lint(
+ ["passes/text.html = PASS UNSUPPORTED"],
+ "Unsupported expectation: unsupported "
+ "passes/text.html [test/expectations] [5]")
+
+ def test_already_seen_test(self):
+ self.assert_lines_lint(
+ ["passes/text.html = PASS",
+ "passes/text.html = TIMEOUT"],
+ "Duplicate expectation. %s [test/expectations] [5]" % self._test_file)
+
+ def test_tab(self):
+ self.assert_lines_lint(
+ ["\tpasses/text.html = PASS"],
+ "Line contains tab character. [whitespace/tab] [5]")
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/text.py b/WebKitTools/Scripts/webkitpy/style/checkers/text.py
index 307e5b8..1147658 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/text.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/text.py
@@ -29,28 +29,23 @@
"""Checks WebKit style for text files."""
+from common import TabChecker
-class TextProcessor(object):
+class TextChecker(object):
"""Processes text lines for checking style."""
def __init__(self, file_path, handle_style_error):
self.file_path = file_path
self.handle_style_error = handle_style_error
+ self._tab_checker = TabChecker(file_path, handle_style_error)
- def process(self, lines):
- lines = (["// adjust line numbers to make the first line 1."] + lines)
-
- # FIXME: share with cpp_style.
- for line_number, line in enumerate(lines):
- if "\t" in line:
- self.handle_style_error(line_number,
- "whitespace/tab", 5,
- "Line contains tab character.")
+ def check(self, lines):
+ self._tab_checker.check(lines)
# FIXME: Remove this function (requires refactoring unit tests).
def process_file_data(filename, lines, error):
- processor = TextProcessor(filename, error)
- processor.process(lines)
+ checker = TextChecker(filename, error)
+ checker.check(lines)
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/text_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/text_unittest.py
index 62f825b..ced49a9 100644
--- a/WebKitTools/Scripts/webkitpy/style/processors/text_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/text_unittest.py
@@ -32,7 +32,7 @@
import unittest
import text as text_style
-from text import TextProcessor
+from text import TextChecker
class TextStyleTestCase(unittest.TestCase):
"""TestCase for text_style.py"""
@@ -76,18 +76,18 @@ class TextStyleTestCase(unittest.TestCase):
'\tReviewed by NOBODY.'], 3)
-class TextProcessorTest(unittest.TestCase):
+class TextCheckerTest(unittest.TestCase):
- """Tests TextProcessor class."""
+ """Tests TextChecker class."""
def mock_handle_style_error(self):
pass
def test_init(self):
"""Test __init__ constructor."""
- processor = TextProcessor("foo.txt", self.mock_handle_style_error)
- self.assertEquals(processor.file_path, "foo.txt")
- self.assertEquals(processor.handle_style_error, self.mock_handle_style_error)
+ checker = TextChecker("foo.txt", self.mock_handle_style_error)
+ self.assertEquals(checker.file_path, "foo.txt")
+ self.assertEquals(checker.handle_style_error, self.mock_handle_style_error)
if __name__ == '__main__':
diff --git a/WebKitTools/Scripts/webkitpy/style/error_handlers.py b/WebKitTools/Scripts/webkitpy/style/error_handlers.py
index 1940e03..0bede24 100644
--- a/WebKitTools/Scripts/webkitpy/style/error_handlers.py
+++ b/WebKitTools/Scripts/webkitpy/style/error_handlers.py
@@ -40,10 +40,10 @@ Methods:
line_number: The integer line number of the line containing the error.
category: The name of the category of the error, for example
"whitespace/newline".
- confidence: An integer between 1-5 that represents the level of
- confidence in the error. The value 5 means that we are
- certain of the problem, and the value 1 means that it
- could be a legitimate construct.
+ confidence: An integer between 1 and 5 inclusive that represents the
+ application's level of confidence in the error. The value
+ 5 means that we are certain of the problem, and the
+ value 1 means that it could be a legitimate construct.
message: The error message to report.
"""
@@ -56,35 +56,55 @@ class DefaultStyleErrorHandler(object):
"""The default style error handler."""
- def __init__(self, file_path, options, increment_error_count,
- stderr_write=None):
+ def __init__(self, file_path, configuration, increment_error_count,
+ line_numbers=None):
"""Create a default style error handler.
Args:
file_path: The path to the file containing the error. This
is used for reporting to the user.
- options: A ProcessorOptions instance.
+ configuration: A StyleProcessorConfiguration instance.
increment_error_count: A function that takes no arguments and
increments the total count of reportable
errors.
- stderr_write: A function that takes a string as a parameter
- and that is called when a style error occurs.
- Defaults to sys.stderr.write. This should be
- used only for unit tests.
+ line_numbers: An array of line numbers of the lines for which
+ style errors should be reported, or None if errors
+ for all lines should be reported. When it is not
+ None, this array normally contains the line numbers
+ corresponding to the modified lines of a patch.
"""
- if stderr_write is None:
- stderr_write = sys.stderr.write
+ if line_numbers is not None:
+ line_numbers = set(line_numbers)
self._file_path = file_path
+ self._configuration = configuration
self._increment_error_count = increment_error_count
- self._options = options
- self._stderr_write = stderr_write
+ self._line_numbers = line_numbers
# A string to integer dictionary cache of the number of reportable
# errors per category passed to this instance.
self._category_totals = {}
+ # Useful for unit testing.
+ def __eq__(self, other):
+ """Return whether this instance is equal to another."""
+ if self._configuration != other._configuration:
+ return False
+ if self._file_path != other._file_path:
+ return False
+ if self._increment_error_count != other._increment_error_count:
+ return False
+ if self._line_numbers != other._line_numbers:
+ return False
+
+ return True
+
+ # Useful for unit testing.
+ def __ne__(self, other):
+ # Python does not automatically deduce __ne__ from __eq__.
+ return not self.__eq__(other)
+
def _add_reportable_error(self, category):
"""Increment the error count and return the new category total."""
self._increment_error_count() # Increment the total.
@@ -99,9 +119,9 @@ class DefaultStyleErrorHandler(object):
def _max_reports(self, category):
"""Return the maximum number of errors to report."""
- if not category in self._options.max_reports_per_category:
+ if not category in self._configuration.max_reports_per_category:
return None
- return self._options.max_reports_per_category[category]
+ return self._configuration.max_reports_per_category[category]
def __call__(self, line_number, category, confidence, message):
"""Handle the occurrence of a style error.
@@ -109,9 +129,15 @@ class DefaultStyleErrorHandler(object):
See the docstring of this module for more information.
"""
- if not self._options.is_reportable(category,
- confidence,
- self._file_path):
+ if (self._line_numbers is not None and
+ line_number not in self._line_numbers):
+ # Then the error occurred in a line that was not modified, so
+ # the error is not reportable.
+ return
+
+ if not self._configuration.is_reportable(category=category,
+ confidence_in_error=confidence,
+ file_path=self._file_path):
return
category_total = self._add_reportable_error(category)
@@ -122,69 +148,12 @@ class DefaultStyleErrorHandler(object):
# Then suppress displaying the error.
return
- if self._options.output_format == 'vs7':
- format_string = "%s(%s): %s [%s] [%d]\n"
- else:
- format_string = "%s:%s: %s [%s] [%d]\n"
+ self._configuration.write_style_error(category=category,
+ confidence_in_error=confidence,
+ file_path=self._file_path,
+ line_number=line_number,
+ message=message)
if category_total == max_reports:
- format_string += ("Suppressing further [%s] reports for this "
- "file.\n" % category)
-
- self._stderr_write(format_string % (self._file_path,
- line_number,
- message,
- category,
- confidence))
-
-
-class PatchStyleErrorHandler(object):
-
- """The style error function for patch files."""
-
- def __init__(self, diff, file_path, options, increment_error_count,
- stderr_write):
- """Create a patch style error handler for the given path.
-
- Args:
- diff: A DiffFile instance.
- Other arguments: see the DefaultStyleErrorHandler.__init__()
- documentation for the other arguments.
-
- """
- self._diff = diff
- self._default_error_handler = DefaultStyleErrorHandler(file_path,
- options,
- increment_error_count,
- stderr_write)
-
- # The line numbers of the modified lines. This is set lazily.
- self._line_numbers = set()
-
- def _get_line_numbers(self):
- """Return the line numbers of the modified lines."""
- if not self._line_numbers:
- for line in self._diff.lines:
- # When deleted line is not set, it means that
- # the line is newly added (or modified).
- if not line[0]:
- self._line_numbers.add(line[1])
-
- return self._line_numbers
-
- def __call__(self, line_number, category, confidence, message):
- """Handle the occurrence of a style error.
-
- This function does not report errors occurring in lines not
- marked as modified or added in the patch.
-
- See the docstring of this module for more information.
-
- """
- if line_number not in self._get_line_numbers():
- # Then the error is not reportable.
- return
-
- self._default_error_handler(line_number, category, confidence,
- message)
-
+ self._configuration.stderr_write("Suppressing further [%s] reports "
+ "for this file.\n" % category)
diff --git a/WebKitTools/Scripts/webkitpy/style/error_handlers_unittest.py b/WebKitTools/Scripts/webkitpy/style/error_handlers_unittest.py
index 1d7e998..23619cc 100644
--- a/WebKitTools/Scripts/webkitpy/style/error_handlers_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/error_handlers_unittest.py
@@ -25,172 +25,163 @@
import unittest
-from .. style_references import parse_patch
-from checker import ProcessorOptions
+from checker import StyleProcessorConfiguration
from error_handlers import DefaultStyleErrorHandler
-from error_handlers import PatchStyleErrorHandler
+from filter import FilterConfiguration
-class StyleErrorHandlerTestBase(unittest.TestCase):
+class DefaultStyleErrorHandlerTest(unittest.TestCase):
+
+ """Tests the DefaultStyleErrorHandler class."""
def setUp(self):
- self._error_messages = ""
+ self._error_messages = []
self._error_count = 0
- def _mock_increment_error_count(self):
- self._error_count += 1
-
- def _mock_stderr_write(self, message):
- self._error_messages += message
-
-
-class DefaultStyleErrorHandlerTest(StyleErrorHandlerTestBase):
-
- """Tests DefaultStyleErrorHandler class."""
+ _category = "whitespace/tab"
+ """The category name for the tests in this class."""
_file_path = "foo.h"
+ """The file path for the tests in this class."""
- _category = "whitespace/tab"
+ def _mock_increment_error_count(self):
+ self._error_count += 1
- def _error_handler(self, options):
- return DefaultStyleErrorHandler(self._file_path,
- options,
- self._mock_increment_error_count,
- self._mock_stderr_write)
+ def _mock_stderr_write(self, message):
+ self._error_messages.append(message)
+
+ def _style_checker_configuration(self):
+ """Return a StyleProcessorConfiguration instance for testing."""
+ base_rules = ["-whitespace", "+whitespace/tab"]
+ filter_configuration = FilterConfiguration(base_rules=base_rules)
+
+ return StyleProcessorConfiguration(
+ filter_configuration=filter_configuration,
+ max_reports_per_category={"whitespace/tab": 2},
+ min_confidence=3,
+ output_format="vs7",
+ stderr_write=self._mock_stderr_write)
+
+ def _error_handler(self, configuration, line_numbers=None):
+ return DefaultStyleErrorHandler(configuration=configuration,
+ file_path=self._file_path,
+ increment_error_count=self._mock_increment_error_count,
+ line_numbers=line_numbers)
def _check_initialized(self):
"""Check that count and error messages are initialized."""
self.assertEquals(0, self._error_count)
- self.assertEquals("", self._error_messages)
-
- def _call(self, handle_error, options, confidence):
- """Handle an error with the given error handler."""
- line_number = 100
- message = "message"
-
- handle_error(line_number, self._category, confidence, message)
-
- def _call_error_handler(self, options, confidence):
- """Handle an error using a new error handler."""
- handle_error = self._error_handler(options)
- self._call(handle_error, options, confidence)
-
- def test_call_non_reportable(self):
- """Test __call__() method with a non-reportable error."""
- confidence = 1
- options = ProcessorOptions(verbosity=3)
+ self.assertEquals(0, len(self._error_messages))
+
+ def _call_error_handler(self, handle_error, confidence, line_number=100):
+ """Call the given error handler with a test error."""
+ handle_error(line_number=line_number,
+ category=self._category,
+ confidence=confidence,
+ message="message")
+
+ def test_eq__true_return_value(self):
+ """Test the __eq__() method for the return value of True."""
+ handler1 = self._error_handler(configuration=None)
+ handler2 = self._error_handler(configuration=None)
+
+ self.assertTrue(handler1.__eq__(handler2))
+
+ def test_eq__false_return_value(self):
+ """Test the __eq__() method for the return value of False."""
+ def make_handler(configuration=self._style_checker_configuration(),
+ file_path='foo.txt', increment_error_count=lambda: True,
+ line_numbers=[100]):
+ return DefaultStyleErrorHandler(configuration=configuration,
+ file_path=file_path,
+ increment_error_count=increment_error_count,
+ line_numbers=line_numbers)
+
+ handler = make_handler()
+
+ # Establish a baseline for our comparisons below.
+ self.assertTrue(handler.__eq__(make_handler()))
+
+ # Verify that a difference in any argument causes equality to fail.
+ self.assertFalse(handler.__eq__(make_handler(configuration=None)))
+ self.assertFalse(handler.__eq__(make_handler(file_path='bar.txt')))
+ self.assertFalse(handler.__eq__(make_handler(increment_error_count=None)))
+ self.assertFalse(handler.__eq__(make_handler(line_numbers=[50])))
+
+ def test_ne(self):
+ """Test the __ne__() method."""
+ # By default, __ne__ always returns true on different objects.
+ # Thus, check just the distinguishing case to verify that the
+ # code defines __ne__.
+ handler1 = self._error_handler(configuration=None)
+ handler2 = self._error_handler(configuration=None)
+
+ self.assertFalse(handler1.__ne__(handler2))
+
+ def test_non_reportable_error(self):
+ """Test __call__() with a non-reportable error."""
self._check_initialized()
+ configuration = self._style_checker_configuration()
+ confidence = 1
# Confirm the error is not reportable.
- self.assertFalse(options.is_reportable(self._category,
- confidence,
- self._file_path))
-
- self._call_error_handler(options, confidence)
+ self.assertFalse(configuration.is_reportable(self._category,
+ confidence,
+ self._file_path))
+ error_handler = self._error_handler(configuration)
+ self._call_error_handler(error_handler, confidence)
self.assertEquals(0, self._error_count)
- self.assertEquals("", self._error_messages)
-
- def test_call_reportable_emacs(self):
- """Test __call__() method with a reportable error and emacs format."""
- confidence = 5
- options = ProcessorOptions(verbosity=3, output_format="emacs")
- self._check_initialized()
-
- self._call_error_handler(options, confidence)
-
- self.assertEquals(1, self._error_count)
- self.assertEquals(self._error_messages,
- "foo.h:100: message [whitespace/tab] [5]\n")
+ self.assertEquals([], self._error_messages)
- def test_call_reportable_vs7(self):
- """Test __call__() method with a reportable error and vs7 format."""
- confidence = 5
- options = ProcessorOptions(verbosity=3, output_format="vs7")
+ # Also serves as a reportable error test.
+ def test_max_reports_per_category(self):
+ """Test error report suppression in __call__() method."""
self._check_initialized()
+ configuration = self._style_checker_configuration()
+ error_handler = self._error_handler(configuration)
- self._call_error_handler(options, confidence)
-
- self.assertEquals(1, self._error_count)
- self.assertEquals(self._error_messages,
- "foo.h(100): message [whitespace/tab] [5]\n")
-
- def test_call_max_reports_per_category(self):
- """Test error report suppression in __call__() method."""
confidence = 5
- options = ProcessorOptions(verbosity=3,
- max_reports_per_category={self._category: 2})
- error_handler = self._error_handler(options)
-
- self._check_initialized()
# First call: usual reporting.
- self._call(error_handler, options, confidence)
+ self._call_error_handler(error_handler, confidence)
self.assertEquals(1, self._error_count)
+ self.assertEquals(1, len(self._error_messages))
self.assertEquals(self._error_messages,
- "foo.h:100: message [whitespace/tab] [5]\n")
+ ["foo.h(100): message [whitespace/tab] [5]\n"])
# Second call: suppression message reported.
- self._error_messages = ""
- self._call(error_handler, options, confidence)
+ self._call_error_handler(error_handler, confidence)
+ # The "Suppressing further..." message counts as an additional
+ # message (but not as an addition to the error count).
self.assertEquals(2, self._error_count)
- self.assertEquals(self._error_messages,
- "foo.h:100: message [whitespace/tab] [5]\n"
- "Suppressing further [%s] reports for this file.\n"
- % self._category)
+ self.assertEquals(3, len(self._error_messages))
+ self.assertEquals(self._error_messages[-2],
+ "foo.h(100): message [whitespace/tab] [5]\n")
+ self.assertEquals(self._error_messages[-1],
+ "Suppressing further [whitespace/tab] reports "
+ "for this file.\n")
# Third call: no report.
- self._error_messages = ""
- self._call(error_handler, options, confidence)
+ self._call_error_handler(error_handler, confidence)
self.assertEquals(3, self._error_count)
- self.assertEquals(self._error_messages, "")
-
-
-class PatchStyleErrorHandlerTest(StyleErrorHandlerTestBase):
+ self.assertEquals(3, len(self._error_messages))
- """Tests PatchStyleErrorHandler class."""
-
- _file_path = "__init__.py"
-
- _patch_string = """diff --git a/__init__.py b/__init__.py
-index ef65bee..e3db70e 100644
---- a/__init__.py
-+++ b/__init__.py
-@@ -1 +1,2 @@
- # Required for Python to search this directory for module files
-+# New line
-
-"""
-
- def test_call(self):
- patch_files = parse_patch(self._patch_string)
- diff = patch_files[self._file_path]
-
- options = ProcessorOptions(verbosity=3)
-
- handle_error = PatchStyleErrorHandler(diff,
- self._file_path,
- options,
- self._mock_increment_error_count,
- self._mock_stderr_write)
-
- category = "whitespace/tab"
+ def test_line_numbers(self):
+ """Test the line_numbers parameter."""
+ self._check_initialized()
+ configuration = self._style_checker_configuration()
+ error_handler = self._error_handler(configuration,
+ line_numbers=[50])
confidence = 5
- message = "message"
-
- # Confirm error is reportable.
- self.assertTrue(options.is_reportable(category,
- confidence,
- self._file_path))
-
- # Confirm error count initialized to zero.
- self.assertEquals(0, self._error_count)
- # Test error in unmodified line (error count does not increment).
- handle_error(1, category, confidence, message)
+ # Error on non-modified line: no error.
+ self._call_error_handler(error_handler, confidence, line_number=60)
self.assertEquals(0, self._error_count)
+ self.assertEquals([], self._error_messages)
- # Test error in modified line (error count increments).
- handle_error(2, category, confidence, message)
+ # Error on modified line: error.
+ self._call_error_handler(error_handler, confidence, line_number=50)
self.assertEquals(1, self._error_count)
-
+ self.assertEquals(self._error_messages,
+ ["foo.h(50): message [whitespace/tab] [5]\n"])
diff --git a/WebKitTools/Scripts/webkitpy/style/filereader.py b/WebKitTools/Scripts/webkitpy/style/filereader.py
new file mode 100644
index 0000000..1a24cb5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/filereader.py
@@ -0,0 +1,162 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+# Copyright (C) 2010 ProFUSION embedded systems
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Supports reading and processing text files."""
+
+import codecs
+import logging
+import os
+import sys
+
+
+_log = logging.getLogger(__name__)
+
+
+class TextFileReader(object):
+
+ """Supports reading and processing text files.
+
+ Attributes:
+ file_count: The total number of files passed to this instance
+ for processing, including non-text files and files
+ that should be skipped.
+ delete_only_file_count: The total number of files that are not
+ processed this instance actually because
+ the files don't have any modified lines
+ but should be treated as processed.
+
+ """
+
+ def __init__(self, processor):
+ """Create an instance.
+
+ Arguments:
+ processor: A ProcessorBase instance.
+
+ """
+ self._processor = processor
+ self.file_count = 0
+ self.delete_only_file_count = 0
+
+ def _read_lines(self, file_path):
+ """Read the file at a path, and return its lines.
+
+ Raises:
+ IOError: If the file does not exist or cannot be read.
+
+ """
+ # Support the UNIX convention of using "-" for stdin.
+ if file_path == '-':
+ file = codecs.StreamReaderWriter(sys.stdin,
+ codecs.getreader('utf8'),
+ codecs.getwriter('utf8'),
+ 'replace')
+ else:
+ # We do not open the file with universal newline support
+ # (codecs does not support it anyway), so the resulting
+ # lines contain trailing "\r" characters if we are reading
+ # a file with CRLF endings.
+ file = codecs.open(file_path, 'r', 'utf8', 'replace')
+
+ try:
+ contents = file.read()
+ finally:
+ file.close()
+
+ lines = contents.split('\n')
+ return lines
+
+ def process_file(self, file_path, **kwargs):
+ """Process the given file by calling the processor's process() method.
+
+ Args:
+ file_path: The path of the file to process.
+ **kwargs: Any additional keyword parameters that should be passed
+ to the processor's process() method. The process()
+ method should support these keyword arguments.
+
+ Raises:
+ SystemExit: If no file at file_path exists.
+
+ """
+ self.file_count += 1
+
+ if not os.path.exists(file_path) and file_path != "-":
+ _log.error("File does not exist: '%s'" % file_path)
+ sys.exit(1)
+
+ if not self._processor.should_process(file_path):
+ _log.debug("Skipping file: '%s'" % file_path)
+ return
+ _log.debug("Processing file: '%s'" % file_path)
+
+ try:
+ lines = self._read_lines(file_path)
+ except IOError, err:
+ message = ("Could not read file. Skipping: '%s'\n %s"
+ % (file_path, err))
+ _log.warn(message)
+ return
+
+ self._processor.process(lines, file_path, **kwargs)
+
+ def _process_directory(self, directory):
+ """Process all files in the given directory, recursively.
+
+ Args:
+ directory: A directory path.
+
+ """
+ for dir_path, dir_names, file_names in os.walk(directory):
+ for file_name in file_names:
+ file_path = os.path.join(dir_path, file_name)
+ self.process_file(file_path)
+
+ def process_paths(self, paths):
+ """Process the given file and directory paths.
+
+ Args:
+ paths: A list of file and directory paths.
+
+ """
+ for path in paths:
+ if os.path.isdir(path):
+ self._process_directory(directory=path)
+ else:
+ self.process_file(path)
+
+ def count_delete_only_file(self):
+ """Count up files that contains only deleted lines.
+
+ Files which has no modified or newly-added lines don't need
+ to check style, but should be treated as checked. For that
+ purpose, we just count up the number of such files.
+ """
+ self.delete_only_file_count += 1
diff --git a/WebKitTools/Scripts/webkitpy/style/filereader_unittest.py b/WebKitTools/Scripts/webkitpy/style/filereader_unittest.py
new file mode 100644
index 0000000..6328337
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/filereader_unittest.py
@@ -0,0 +1,166 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Contains unit tests for filereader.py."""
+
+from __future__ import with_statement
+
+import codecs
+import os
+import shutil
+import tempfile
+import unittest
+
+from webkitpy.common.system.logtesting import LoggingTestCase
+from webkitpy.style.checker import ProcessorBase
+from webkitpy.style.filereader import TextFileReader
+
+
+class TextFileReaderTest(LoggingTestCase):
+
+ class MockProcessor(ProcessorBase):
+
+ """A processor for test purposes.
+
+ This processor simply records the parameters passed to its process()
+ method for later checking by the unittest test methods.
+
+ """
+
+ def __init__(self):
+ self.processed = []
+ """The parameters passed for all calls to the process() method."""
+
+ def should_process(self, file_path):
+ return not file_path.endswith('should_not_process.txt')
+
+ def process(self, lines, file_path, test_kwarg=None):
+ self.processed.append((lines, file_path, test_kwarg))
+
+ def setUp(self):
+ LoggingTestCase.setUp(self)
+ processor = TextFileReaderTest.MockProcessor()
+
+ temp_dir = tempfile.mkdtemp()
+
+ self._file_reader = TextFileReader(processor)
+ self._processor = processor
+ self._temp_dir = temp_dir
+
+ def tearDown(self):
+ LoggingTestCase.tearDown(self)
+ shutil.rmtree(self._temp_dir)
+
+ def _create_file(self, rel_path, text, encoding="utf-8"):
+ """Create a file with given text and return the path to the file."""
+ # FIXME: There are better/more secure APIs for creatin tmp file paths.
+ file_path = os.path.join(self._temp_dir, rel_path)
+ with codecs.open(file_path, "w", encoding) as file:
+ file.write(text)
+ return file_path
+
+ def _passed_to_processor(self):
+ """Return the parameters passed to MockProcessor.process()."""
+ return self._processor.processed
+
+ def _assert_file_reader(self, passed_to_processor, file_count):
+ """Assert the state of the file reader."""
+ self.assertEquals(passed_to_processor, self._passed_to_processor())
+ self.assertEquals(file_count, self._file_reader.file_count)
+
+ def test_process_file__does_not_exist(self):
+ try:
+ self._file_reader.process_file('does_not_exist.txt')
+ except SystemExit, err:
+ self.assertEquals(str(err), '1')
+ else:
+ self.fail('No Exception raised.')
+ self._assert_file_reader([], 1)
+ self.assertLog(["ERROR: File does not exist: 'does_not_exist.txt'\n"])
+
+ def test_process_file__is_dir(self):
+ temp_dir = os.path.join(self._temp_dir, 'test_dir')
+ os.mkdir(temp_dir)
+
+ self._file_reader.process_file(temp_dir)
+
+ # Because the log message below contains exception text, it is
+ # possible that the text varies across platforms. For this reason,
+ # we check only the portion of the log message that we control,
+ # namely the text at the beginning.
+ log_messages = self.logMessages()
+ # We remove the message we are looking at to prevent the tearDown()
+ # from raising an exception when it asserts that no log messages
+ # remain.
+ message = log_messages.pop()
+
+ self.assertTrue(message.startswith('WARNING: Could not read file. '
+ "Skipping: '%s'\n " % temp_dir))
+
+ self._assert_file_reader([], 1)
+
+ def test_process_file__should_not_process(self):
+ file_path = self._create_file('should_not_process.txt', 'contents')
+
+ self._file_reader.process_file(file_path)
+ self._assert_file_reader([], 1)
+
+ def test_process_file__multiple_lines(self):
+ file_path = self._create_file('foo.txt', 'line one\r\nline two\n')
+
+ self._file_reader.process_file(file_path)
+ processed = [(['line one\r', 'line two', ''], file_path, None)]
+ self._assert_file_reader(processed, 1)
+
+ def test_process_file__file_stdin(self):
+ file_path = self._create_file('-', 'file contents')
+
+ self._file_reader.process_file(file_path=file_path, test_kwarg='foo')
+ processed = [(['file contents'], file_path, 'foo')]
+ self._assert_file_reader(processed, 1)
+
+ def test_process_file__with_kwarg(self):
+ file_path = self._create_file('foo.txt', 'file contents')
+
+ self._file_reader.process_file(file_path=file_path, test_kwarg='foo')
+ processed = [(['file contents'], file_path, 'foo')]
+ self._assert_file_reader(processed, 1)
+
+ def test_process_paths(self):
+ # We test a list of paths that contains both a file and a directory.
+ dir = os.path.join(self._temp_dir, 'foo_dir')
+ os.mkdir(dir)
+
+ file_path1 = self._create_file('file1.txt', 'foo')
+
+ rel_path = os.path.join('foo_dir', 'file2.txt')
+ file_path2 = self._create_file(rel_path, 'bar')
+
+ self._file_reader.process_paths([dir, file_path1])
+ processed = [(['bar'], file_path2, None),
+ (['foo'], file_path1, None)]
+ self._assert_file_reader(processed, 2)
+
+ def test_count_delete_only_file(self):
+ self._file_reader.count_delete_only_file()
+ delete_only_file_count = self._file_reader.delete_only_file_count
+ self.assertEquals(delete_only_file_count, 1)
diff --git a/WebKitTools/Scripts/webkitpy/style/filter.py b/WebKitTools/Scripts/webkitpy/style/filter.py
index 19c2f4d..608a9e6 100644
--- a/WebKitTools/Scripts/webkitpy/style/filter.py
+++ b/WebKitTools/Scripts/webkitpy/style/filter.py
@@ -139,12 +139,8 @@ class FilterConfiguration(object):
are appended. The first substring match takes
precedence, i.e. only the first match triggers
an append.
- The "path_rules" value is the tuple of filter
+ The "path_rules" value is a list of filter
rules that can be appended to the base rules.
- The value is a tuple rather than a list so it
- can be used as a dictionary key. The dictionary
- is for caching purposes in the implementation of
- this class.
user_rules: A list of filter rules that is always appended
to the base rules and any path rules. In other
@@ -165,11 +161,7 @@ class FilterConfiguration(object):
self._path_specific_lower = None
"""The backing store for self._get_path_specific_lower()."""
- # FIXME: Make user rules internal after the FilterConfiguration
- # attribute is removed from ProcessorOptions (since at
- # that point ArgumentPrinter will no longer need to
- # access FilterConfiguration.user_rules).
- self.user_rules = user_rules
+ self._user_rules = user_rules
self._path_rules_to_filter = {}
"""Cached dictionary of path rules to CategoryFilter instance."""
@@ -188,7 +180,7 @@ class FilterConfiguration(object):
return False
if self._path_specific != other._path_specific:
return False
- if self.user_rules != other.user_rules:
+ if self._user_rules != other._user_rules:
return False
return True
@@ -210,22 +202,34 @@ class FilterConfiguration(object):
return self._path_specific_lower
def _path_rules_from_path(self, path):
- """Determine the path-specific rules to use, and return as a tuple."""
+ """Determine the path-specific rules to use, and return as a tuple.
+
+ This method returns a tuple rather than a list so the return
+ value can be passed to _filter_from_path_rules() without change.
+
+ """
path = path.lower()
for (sub_paths, path_rules) in self._get_path_specific_lower():
for sub_path in sub_paths:
if path.find(sub_path) > -1:
- return path_rules
+ return tuple(path_rules)
return () # Default to the empty tuple.
def _filter_from_path_rules(self, path_rules):
- """Return the CategoryFilter associated to a path rules tuple."""
+ """Return the CategoryFilter associated to the given path rules.
+
+ Args:
+ path_rules: A tuple of path rules. We require a tuple rather
+ than a list so the value can be used as a dictionary
+ key in self._path_rules_to_filter.
+
+ """
# We reuse the same CategoryFilter where possible to take
# advantage of the caching they do.
if path_rules not in self._path_rules_to_filter:
rules = list(self._base_rules) # Make a copy
rules.extend(path_rules)
- rules.extend(self.user_rules)
+ rules.extend(self._user_rules)
self._path_rules_to_filter[path_rules] = _CategoryFilter(rules)
return self._path_rules_to_filter[path_rules]
diff --git a/WebKitTools/Scripts/webkitpy/style/filter_unittest.py b/WebKitTools/Scripts/webkitpy/style/filter_unittest.py
index 84760a5..7b8a5402 100644
--- a/WebKitTools/Scripts/webkitpy/style/filter_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/filter_unittest.py
@@ -157,14 +157,14 @@ class FilterConfigurationTest(unittest.TestCase):
# Test that the attributes are getting set correctly.
# We use parameter values that are different from the defaults.
base_rules = ["-"]
- path_specific = [(["path"], ("+a",))]
+ path_specific = [(["path"], ["+a"])]
user_rules = ["+"]
config = self._config(base_rules, path_specific, user_rules)
self.assertEquals(base_rules, config._base_rules)
self.assertEquals(path_specific, config._path_specific)
- self.assertEquals(user_rules, config.user_rules)
+ self.assertEquals(user_rules, config._user_rules)
def test_default_arguments(self):
# Test that the attributes are getting set correctly to the defaults.
@@ -172,7 +172,7 @@ class FilterConfigurationTest(unittest.TestCase):
self.assertEquals([], config._base_rules)
self.assertEquals([], config._path_specific)
- self.assertEquals([], config.user_rules)
+ self.assertEquals([], config._user_rules)
def test_eq(self):
"""Test __eq__ method."""
@@ -185,7 +185,7 @@ class FilterConfigurationTest(unittest.TestCase):
# These parameter values are different from the defaults.
base_rules = ["-"]
- path_specific = [(["path"], ("+a",))]
+ path_specific = [(["path"], ["+a"])]
user_rules = ["+"]
self.assertFalse(config.__eq__(FilterConfiguration(
@@ -219,8 +219,8 @@ class FilterConfigurationTest(unittest.TestCase):
def test_path_specific(self):
"""Test effect of path_rules_specifier on should_check()."""
base_rules = ["-"]
- path_specific = [(["path1"], ("+b",)),
- (["path2"], ("+c",))]
+ path_specific = [(["path1"], ["+b"]),
+ (["path2"], ["+c"])]
user_rules = []
config = self._config(base_rules, path_specific, user_rules)
@@ -233,7 +233,7 @@ class FilterConfigurationTest(unittest.TestCase):
def test_path_with_different_case(self):
"""Test a path that differs only in case."""
base_rules = ["-"]
- path_specific = [(["Foo/"], ("+whitespace",))]
+ path_specific = [(["Foo/"], ["+whitespace"])]
user_rules = []
config = self._config(base_rules, path_specific, user_rules)
diff --git a/WebKitTools/Scripts/webkitpy/style/main.py b/WebKitTools/Scripts/webkitpy/style/main.py
new file mode 100644
index 0000000..c933c6d
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/main.py
@@ -0,0 +1,130 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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 logging
+import os
+import sys
+
+from webkitpy.common.system.ospath import relpath as _relpath
+
+
+_log = logging.getLogger(__name__)
+
+
+def change_directory(checkout_root, paths, mock_os=None):
+ """Change the working directory to the WebKit checkout root, if possible.
+
+ If every path in the paths parameter is below the checkout root (or if
+ the paths parameter is empty or None), this method changes the current
+ working directory to the checkout root and converts the paths parameter
+ as described below.
+ This allows the paths being checked to be displayed relative to the
+ checkout root, and for path-specific style checks to work as expected.
+ Path-specific checks include whether files should be skipped, whether
+ custom style rules should apply to certain files, etc.
+ If the checkout root is None or the empty string, this method returns
+ the paths parameter unchanged.
+
+ Returns:
+ paths: A copy of the paths parameter -- possibly converted, as follows.
+ If this method changed the current working directory to the
+ checkout root, then the list is the paths parameter converted to
+ normalized paths relative to the checkout root. Otherwise, the
+ paths are not converted.
+
+ Args:
+ paths: A list of paths to the files that should be checked for style.
+ This argument can be None or the empty list if a git commit
+ or all changes under the checkout root should be checked.
+ checkout_root: The path to the root of the WebKit checkout, or None or
+ the empty string if no checkout could be detected.
+ mock_os: A replacement module for unit testing. Defaults to os.
+
+ """
+ os_module = os if mock_os is None else mock_os
+
+ if paths is not None:
+ paths = list(paths)
+
+ if not checkout_root:
+ if not paths:
+ raise Exception("The paths parameter must be non-empty if "
+ "there is no checkout root.")
+
+ # FIXME: Consider trying to detect the checkout root for each file
+ # being checked rather than only trying to detect the checkout
+ # root for the current working directory. This would allow
+ # files to be checked correctly even if the script is being
+ # run from outside any WebKit checkout.
+ #
+ # Moreover, try to find the "source root" for each file
+ # using path-based heuristics rather than using only the
+ # presence of a WebKit checkout. For example, we could
+ # examine parent directories until a directory is found
+ # containing JavaScriptCore, WebCore, WebKit, WebKitSite,
+ # and WebKitTools.
+ # Then log an INFO message saying that a source root not
+ # in a WebKit checkout was found. This will allow us to check
+ # the style of non-scm copies of the source tree (e.g.
+ # nightlies).
+ _log.warn("WebKit checkout root not found:\n"
+ " Path-dependent style checks may not work correctly.\n"
+ " See the help documentation for more info.")
+
+ return paths
+
+ if paths:
+ # Then try converting all of the paths to paths relative to
+ # the checkout root.
+ rel_paths = []
+ for path in paths:
+ rel_path = _relpath(path, checkout_root)
+ if rel_path is None:
+ # Then the path is not below the checkout root. Since all
+ # paths should be interpreted relative to the same root,
+ # do not interpret any of the paths as relative to the
+ # checkout root. Interpret all of them relative to the
+ # current working directory, and do not change the current
+ # working directory.
+ _log.warn(
+"""Path-dependent style checks may not work correctly:
+
+ One of the given paths is outside the WebKit checkout of the current
+ working directory:
+
+ Path: %s
+ Checkout root: %s
+
+ Pass only files below the checkout root to ensure correct results.
+ See the help documentation for more info.
+"""
+ % (path, checkout_root))
+
+ return paths
+ rel_paths.append(rel_path)
+ # If we got here, the conversion was successful.
+ paths = rel_paths
+
+ _log.debug("Changing to checkout root: " + checkout_root)
+ os_module.chdir(checkout_root)
+
+ return paths
diff --git a/WebKitTools/Scripts/webkitpy/style/main_unittest.py b/WebKitTools/Scripts/webkitpy/style/main_unittest.py
new file mode 100644
index 0000000..fe448f5
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/main_unittest.py
@@ -0,0 +1,124 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Unit tests for main.py."""
+
+import os
+import unittest
+
+from main import change_directory
+from webkitpy.style_references import LogTesting
+
+
+class ChangeDirectoryTest(unittest.TestCase):
+
+ """Tests change_directory()."""
+
+ _original_directory = "/original"
+ _checkout_root = "/WebKit"
+
+ class _MockOs(object):
+
+ """A mock os module for unit testing."""
+
+ def __init__(self, test_case):
+ self._test_case = test_case
+ self._current_directory = \
+ ChangeDirectoryTest._original_directory
+
+ def chdir(self, current_directory):
+ self._current_directory = current_directory
+
+ def assertCurrentDirectory(self, expected_directory):
+ self._test_case.assertEquals(expected_directory,
+ self._current_directory)
+
+ def setUp(self):
+ self._log = LogTesting.setUp(self)
+ self._mock_os = self._MockOs(self)
+
+ def tearDown(self):
+ self._log.tearDown()
+
+ # This method is a convenient wrapper for change_working_directory() that
+ # passes the mock_os for this unit testing class.
+ def _change_directory(self, paths, checkout_root):
+ return change_directory(paths=paths,
+ checkout_root=checkout_root,
+ mock_os=self._mock_os)
+
+ def _assert_result(self, actual_return_value, expected_return_value,
+ expected_log_messages, expected_current_directory):
+ self.assertEquals(actual_return_value, expected_return_value)
+ self._log.assertMessages(expected_log_messages)
+ self._mock_os.assertCurrentDirectory(expected_current_directory)
+
+ def test_checkout_root_none_paths_none(self):
+ self.assertRaises(Exception, self._change_directory,
+ checkout_root=None, paths=None)
+ self._log.assertMessages([])
+ self._mock_os.assertCurrentDirectory(self._original_directory)
+
+ def test_checkout_root_none(self):
+ paths = self._change_directory(checkout_root=None,
+ paths=["path1"])
+ log_messages = [
+"""WARNING: WebKit checkout root not found:
+ Path-dependent style checks may not work correctly.
+ See the help documentation for more info.
+"""]
+ self._assert_result(paths, ["path1"], log_messages,
+ self._original_directory)
+
+ def test_paths_none(self):
+ paths = self._change_directory(checkout_root=self._checkout_root,
+ paths=None)
+ self._assert_result(paths, None, [], self._checkout_root)
+
+ def test_paths_convertible(self):
+ paths=["/WebKit/foo1.txt",
+ "/WebKit/foo2.txt"]
+ paths = self._change_directory(checkout_root=self._checkout_root,
+ paths=paths)
+ self._assert_result(paths, ["foo1.txt", "foo2.txt"], [],
+ self._checkout_root)
+
+ def test_with_scm_paths_unconvertible(self):
+ paths=["/WebKit/foo1.txt",
+ "/outside/foo2.txt"]
+ paths = self._change_directory(checkout_root=self._checkout_root,
+ paths=paths)
+ log_messages = [
+"""WARNING: Path-dependent style checks may not work correctly:
+
+ One of the given paths is outside the WebKit checkout of the current
+ working directory:
+
+ Path: /outside/foo2.txt
+ Checkout root: /WebKit
+
+ Pass only files below the checkout root to ensure correct results.
+ See the help documentation for more info.
+
+"""]
+ self._assert_result(paths, paths, log_messages,
+ self._original_directory)
diff --git a/WebKitTools/Scripts/webkitpy/style/optparser.py b/WebKitTools/Scripts/webkitpy/style/optparser.py
new file mode 100644
index 0000000..f4e9923
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/optparser.py
@@ -0,0 +1,457 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Supports the parsing of command-line options for check-webkit-style."""
+
+import logging
+from optparse import OptionParser
+import os.path
+import sys
+
+from filter import validate_filter_rules
+# This module should not import anything from checker.py.
+
+_log = logging.getLogger(__name__)
+
+_USAGE = """usage: %prog [--help] [options] [path1] [path2] ...
+
+Overview:
+ Check coding style according to WebKit style guidelines:
+
+ http://webkit.org/coding/coding-style.html
+
+ Path arguments can be files and directories. If neither a git commit nor
+ paths are passed, then all changes in your source control working directory
+ are checked.
+
+Style errors:
+ This script assigns to every style error a confidence score from 1-5 and
+ a category name. A confidence score of 5 means the error is certainly
+ a problem, and 1 means it could be fine.
+
+ Category names appear in error messages in brackets, for example
+ [whitespace/indent]. See the options section below for an option that
+ displays all available categories and which are reported by default.
+
+Filters:
+ Use filters to configure what errors to report. Filters are specified using
+ a comma-separated list of boolean filter rules. The script reports errors
+ in a category if the category passes the filter, as described below.
+
+ All categories start out passing. Boolean filter rules are then evaluated
+ from left to right, with later rules taking precedence. For example, the
+ rule "+foo" passes any category that starts with "foo", and "-foo" fails
+ any such category. The filter input "-whitespace,+whitespace/braces" fails
+ the category "whitespace/tab" and passes "whitespace/braces".
+
+ Examples: --filter=-whitespace,+whitespace/braces
+ --filter=-whitespace,-runtime/printf,+runtime/printf_format
+ --filter=-,+build/include_what_you_use
+
+Paths:
+ Certain style-checking behavior depends on the paths relative to
+ the WebKit source root of the files being checked. For example,
+ certain types of errors may be handled differently for files in
+ WebKit/gtk/webkit/ (e.g. by suppressing "readability/naming" errors
+ for files in this directory).
+
+ Consequently, if the path relative to the source root cannot be
+ determined for a file being checked, then style checking may not
+ work correctly for that file. This can occur, for example, if no
+ WebKit checkout can be found, or if the source root can be detected,
+ but one of the files being checked lies outside the source tree.
+
+ If a WebKit checkout can be detected and all files being checked
+ are in the source tree, then all paths will automatically be
+ converted to paths relative to the source root prior to checking.
+ This is also useful for display purposes.
+
+ Currently, this command can detect the source root only if the
+ command is run from within a WebKit checkout (i.e. if the current
+ working directory is below the root of a checkout). In particular,
+ it is not recommended to run this script from a directory outside
+ a checkout.
+
+ Running this script from a top-level WebKit source directory and
+ checking only files in the source tree will ensure that all style
+ checking behaves correctly -- whether or not a checkout can be
+ detected. This is because all file paths will already be relative
+ to the source root and so will not need to be converted."""
+
+_EPILOG = ("This script can miss errors and does not substitute for "
+ "code review.")
+
+
+# This class should not have knowledge of the flag key names.
+class DefaultCommandOptionValues(object):
+
+ """Stores the default check-webkit-style command-line options.
+
+ Attributes:
+ output_format: A string that is the default output format.
+ min_confidence: An integer that is the default minimum confidence level.
+
+ """
+
+ def __init__(self, min_confidence, output_format):
+ self.min_confidence = min_confidence
+ self.output_format = output_format
+
+
+# This class should not have knowledge of the flag key names.
+class CommandOptionValues(object):
+
+ """Stores the option values passed by the user via the command line.
+
+ Attributes:
+ is_verbose: A boolean value of whether verbose logging is enabled.
+
+ filter_rules: The list of filter rules provided by the user.
+ These rules are appended to the base rules and
+ path-specific rules and so take precedence over
+ the base filter rules, etc.
+
+ git_commit: A string representing the git commit to check.
+ The default is None.
+
+ min_confidence: An integer between 1 and 5 inclusive that is the
+ minimum confidence level of style errors to report.
+ The default is 1, which reports all errors.
+
+ output_format: A string that is the output format. The supported
+ output formats are "emacs" which emacs can parse
+ and "vs7" which Microsoft Visual Studio 7 can parse.
+
+ """
+ def __init__(self,
+ filter_rules=None,
+ git_commit=None,
+ diff_files=None,
+ is_verbose=False,
+ min_confidence=1,
+ output_format="emacs"):
+ if filter_rules is None:
+ filter_rules = []
+
+ if (min_confidence < 1) or (min_confidence > 5):
+ raise ValueError('Invalid "min_confidence" parameter: value '
+ "must be an integer between 1 and 5 inclusive. "
+ 'Value given: "%s".' % min_confidence)
+
+ if output_format not in ("emacs", "vs7"):
+ raise ValueError('Invalid "output_format" parameter: '
+ 'value must be "emacs" or "vs7". '
+ 'Value given: "%s".' % output_format)
+
+ self.filter_rules = filter_rules
+ self.git_commit = git_commit
+ self.diff_files = diff_files
+ self.is_verbose = is_verbose
+ self.min_confidence = min_confidence
+ self.output_format = output_format
+
+ # Useful for unit testing.
+ def __eq__(self, other):
+ """Return whether this instance is equal to another."""
+ if self.filter_rules != other.filter_rules:
+ return False
+ if self.git_commit != other.git_commit:
+ return False
+ if self.diff_files != other.diff_files:
+ return False
+ if self.is_verbose != other.is_verbose:
+ return False
+ if self.min_confidence != other.min_confidence:
+ return False
+ if self.output_format != other.output_format:
+ return False
+
+ return True
+
+ # Useful for unit testing.
+ def __ne__(self, other):
+ # Python does not automatically deduce this from __eq__().
+ return not self.__eq__(other)
+
+
+class ArgumentPrinter(object):
+
+ """Supports the printing of check-webkit-style command arguments."""
+
+ def _flag_pair_to_string(self, flag_key, flag_value):
+ return '--%(key)s=%(val)s' % {'key': flag_key, 'val': flag_value }
+
+ def to_flag_string(self, options):
+ """Return a flag string of the given CommandOptionValues instance.
+
+ This method orders the flag values alphabetically by the flag key.
+
+ Args:
+ options: A CommandOptionValues instance.
+
+ """
+ flags = {}
+ flags['min-confidence'] = options.min_confidence
+ flags['output'] = options.output_format
+ # Only include the filter flag if user-provided rules are present.
+ filter_rules = options.filter_rules
+ if filter_rules:
+ flags['filter'] = ",".join(filter_rules)
+ if options.git_commit:
+ flags['git-commit'] = options.git_commit
+ if options.diff_files:
+ flags['diff_files'] = options.diff_files
+
+ flag_string = ''
+ # Alphabetizing lets us unit test this method.
+ for key in sorted(flags.keys()):
+ flag_string += self._flag_pair_to_string(key, flags[key]) + ' '
+
+ return flag_string.strip()
+
+
+class ArgumentParser(object):
+
+ # FIXME: Move the documentation of the attributes to the __init__
+ # docstring after making the attributes internal.
+ """Supports the parsing of check-webkit-style command arguments.
+
+ Attributes:
+ create_usage: A function that accepts a DefaultCommandOptionValues
+ instance and returns a string of usage instructions.
+ Defaults to the function that generates the usage
+ string for check-webkit-style.
+ default_options: A DefaultCommandOptionValues instance that provides
+ the default values for options not explicitly
+ provided by the user.
+ stderr_write: A function that takes a string as a parameter and
+ serves as stderr.write. Defaults to sys.stderr.write.
+ This parameter should be specified only for unit tests.
+
+ """
+
+ def __init__(self,
+ all_categories,
+ default_options,
+ base_filter_rules=None,
+ mock_stderr=None,
+ usage=None):
+ """Create an ArgumentParser instance.
+
+ Args:
+ all_categories: The set of all available style categories.
+ default_options: See the corresponding attribute in the class
+ docstring.
+ Keyword Args:
+ base_filter_rules: The list of filter rules at the beginning of
+ the list of rules used to check style. This
+ list has the least precedence when checking
+ style and precedes any user-provided rules.
+ The class uses this parameter only for display
+ purposes to the user. Defaults to the empty list.
+ create_usage: See the documentation of the corresponding
+ attribute in the class docstring.
+ stderr_write: See the documentation of the corresponding
+ attribute in the class docstring.
+
+ """
+ if base_filter_rules is None:
+ base_filter_rules = []
+ stderr = sys.stderr if mock_stderr is None else mock_stderr
+ if usage is None:
+ usage = _USAGE
+
+ self._all_categories = all_categories
+ self._base_filter_rules = base_filter_rules
+
+ # FIXME: Rename these to reflect that they are internal.
+ self.default_options = default_options
+ self.stderr_write = stderr.write
+
+ self._parser = self._create_option_parser(stderr=stderr,
+ usage=usage,
+ default_min_confidence=self.default_options.min_confidence,
+ default_output_format=self.default_options.output_format)
+
+ def _create_option_parser(self, stderr, usage,
+ default_min_confidence, default_output_format):
+ # Since the epilog string is short, it is not necessary to replace
+ # the epilog string with a mock epilog string when testing.
+ # For this reason, we use _EPILOG directly rather than passing it
+ # as an argument like we do for the usage string.
+ parser = OptionParser(usage=usage, epilog=_EPILOG)
+
+ filter_help = ('set a filter to control what categories of style '
+ 'errors to report. Specify a filter using a comma-'
+ 'delimited list of boolean filter rules, for example '
+ '"--filter -whitespace,+whitespace/braces". To display '
+ 'all categories and which are enabled by default, pass '
+ """no value (e.g. '-f ""' or '--filter=').""")
+ parser.add_option("-f", "--filter-rules", metavar="RULES",
+ dest="filter_value", help=filter_help)
+
+ git_commit_help = ("check all changes in the given commit. "
+ "Use 'commit_id..' to check all changes after commmit_id")
+ parser.add_option("-g", "--git-diff", "--git-commit",
+ metavar="COMMIT", dest="git_commit", help=git_commit_help,)
+
+ diff_files_help = "diff the files passed on the command line rather than checking the style of every line"
+ parser.add_option("--diff-files", action="store_true", dest="diff_files", default=False, help=diff_files_help)
+
+ min_confidence_help = ("set the minimum confidence of style errors "
+ "to report. Can be an integer 1-5, with 1 "
+ "displaying all errors. Defaults to %default.")
+ parser.add_option("-m", "--min-confidence", metavar="INT",
+ type="int", dest="min_confidence",
+ default=default_min_confidence,
+ help=min_confidence_help)
+
+ output_format_help = ('set the output format, which can be "emacs" '
+ 'or "vs7" (for Visual Studio). '
+ 'Defaults to "%default".')
+ parser.add_option("-o", "--output-format", metavar="FORMAT",
+ choices=["emacs", "vs7"],
+ dest="output_format", default=default_output_format,
+ help=output_format_help)
+
+ verbose_help = "enable verbose logging."
+ parser.add_option("-v", "--verbose", dest="is_verbose", default=False,
+ action="store_true", help=verbose_help)
+
+ # Override OptionParser's error() method so that option help will
+ # also display when an error occurs. Normally, just the usage
+ # string displays and not option help.
+ parser.error = self._parse_error
+
+ # Override OptionParser's print_help() method so that help output
+ # does not render to the screen while running unit tests.
+ print_help = parser.print_help
+ parser.print_help = lambda: print_help(file=stderr)
+
+ return parser
+
+ def _parse_error(self, error_message):
+ """Print the help string and an error message, and exit."""
+ # The method format_help() includes both the usage string and
+ # the flag options.
+ help = self._parser.format_help()
+ # Separate help from the error message with a single blank line.
+ self.stderr_write(help + "\n")
+ if error_message:
+ _log.error(error_message)
+
+ # Since we are using this method to replace/override the Python
+ # module optparse's OptionParser.error() method, we match its
+ # behavior and exit with status code 2.
+ #
+ # As additional background, Python documentation says--
+ #
+ # "Unix programs generally use 2 for command line syntax errors
+ # and 1 for all other kind of errors."
+ #
+ # (from http://docs.python.org/library/sys.html#sys.exit )
+ sys.exit(2)
+
+ def _exit_with_categories(self):
+ """Exit and print the style categories and default filter rules."""
+ self.stderr_write('\nAll categories:\n')
+ for category in sorted(self._all_categories):
+ self.stderr_write(' ' + category + '\n')
+
+ self.stderr_write('\nDefault filter rules**:\n')
+ for filter_rule in sorted(self._base_filter_rules):
+ self.stderr_write(' ' + filter_rule + '\n')
+ self.stderr_write('\n**The command always evaluates the above rules, '
+ 'and before any --filter flag.\n\n')
+
+ sys.exit(0)
+
+ def _parse_filter_flag(self, flag_value):
+ """Parse the --filter flag, and return a list of filter rules.
+
+ Args:
+ flag_value: A string of comma-separated filter rules, for
+ example "-whitespace,+whitespace/indent".
+
+ """
+ filters = []
+ for uncleaned_filter in flag_value.split(','):
+ filter = uncleaned_filter.strip()
+ if not filter:
+ continue
+ filters.append(filter)
+ return filters
+
+ def parse(self, args):
+ """Parse the command line arguments to check-webkit-style.
+
+ Args:
+ args: A list of command-line arguments as returned by sys.argv[1:].
+
+ Returns:
+ A tuple of (paths, options)
+
+ paths: The list of paths to check.
+ options: A CommandOptionValues instance.
+
+ """
+ (options, paths) = self._parser.parse_args(args=args)
+
+ filter_value = options.filter_value
+ git_commit = options.git_commit
+ diff_files = options.diff_files
+ is_verbose = options.is_verbose
+ min_confidence = options.min_confidence
+ output_format = options.output_format
+
+ if filter_value is not None and not filter_value:
+ # Then the user explicitly passed no filter, for
+ # example "-f ''" or "--filter=".
+ self._exit_with_categories()
+
+ # Validate user-provided values.
+
+ min_confidence = int(min_confidence)
+ if (min_confidence < 1) or (min_confidence > 5):
+ self._parse_error('option --min-confidence: invalid integer: '
+ '%s: value must be between 1 and 5'
+ % min_confidence)
+
+ if filter_value:
+ filter_rules = self._parse_filter_flag(filter_value)
+ else:
+ filter_rules = []
+
+ try:
+ validate_filter_rules(filter_rules, self._all_categories)
+ except ValueError, err:
+ self._parse_error(err)
+
+ options = CommandOptionValues(filter_rules=filter_rules,
+ git_commit=git_commit,
+ diff_files=diff_files,
+ is_verbose=is_verbose,
+ min_confidence=min_confidence,
+ output_format=output_format)
+
+ return (paths, options)
+
diff --git a/WebKitTools/Scripts/webkitpy/style/optparser_unittest.py b/WebKitTools/Scripts/webkitpy/style/optparser_unittest.py
new file mode 100644
index 0000000..a6b64da
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/optparser_unittest.py
@@ -0,0 +1,258 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Unit tests for parser.py."""
+
+import unittest
+
+from webkitpy.common.system.logtesting import LoggingTestCase
+from webkitpy.style.optparser import ArgumentParser
+from webkitpy.style.optparser import ArgumentPrinter
+from webkitpy.style.optparser import CommandOptionValues as ProcessorOptions
+from webkitpy.style.optparser import DefaultCommandOptionValues
+
+
+class ArgumentPrinterTest(unittest.TestCase):
+
+ """Tests the ArgumentPrinter class."""
+
+ _printer = ArgumentPrinter()
+
+ def _create_options(self,
+ output_format='emacs',
+ min_confidence=3,
+ filter_rules=[],
+ git_commit=None):
+ return ProcessorOptions(filter_rules=filter_rules,
+ git_commit=git_commit,
+ min_confidence=min_confidence,
+ output_format=output_format)
+
+ def test_to_flag_string(self):
+ options = self._create_options('vs7', 5, ['+foo', '-bar'], 'git')
+ self.assertEquals('--filter=+foo,-bar --git-commit=git '
+ '--min-confidence=5 --output=vs7',
+ self._printer.to_flag_string(options))
+
+ # This is to check that --filter and --git-commit do not
+ # show up when not user-specified.
+ options = self._create_options()
+ self.assertEquals('--min-confidence=3 --output=emacs',
+ self._printer.to_flag_string(options))
+
+
+class ArgumentParserTest(LoggingTestCase):
+
+ """Test the ArgumentParser class."""
+
+ class _MockStdErr(object):
+
+ def write(self, message):
+ # We do not want the usage string or style categories
+ # to print during unit tests, so print nothing.
+ return
+
+ def _parse(self, args):
+ """Call a test parser.parse()."""
+ parser = self._create_parser()
+ return parser.parse(args)
+
+ def _create_defaults(self):
+ """Return a DefaultCommandOptionValues instance for testing."""
+ base_filter_rules = ["-", "+whitespace"]
+ return DefaultCommandOptionValues(min_confidence=3,
+ output_format="vs7")
+
+ def _create_parser(self):
+ """Return an ArgumentParser instance for testing."""
+ default_options = self._create_defaults()
+
+ all_categories = ["build" ,"whitespace"]
+
+ mock_stderr = self._MockStdErr()
+
+ return ArgumentParser(all_categories=all_categories,
+ base_filter_rules=[],
+ default_options=default_options,
+ mock_stderr=mock_stderr,
+ usage="test usage")
+
+ def test_parse_documentation(self):
+ parse = self._parse
+
+ # FIXME: Test both the printing of the usage string and the
+ # filter categories help.
+
+ # Request the usage string.
+ self.assertRaises(SystemExit, parse, ['--help'])
+ # Request default filter rules and available style categories.
+ self.assertRaises(SystemExit, parse, ['--filter='])
+
+ def test_parse_bad_values(self):
+ parse = self._parse
+
+ # Pass an unsupported argument.
+ self.assertRaises(SystemExit, parse, ['--bad'])
+ self.assertLog(['ERROR: no such option: --bad\n'])
+
+ self.assertRaises(SystemExit, parse, ['--min-confidence=bad'])
+ self.assertLog(['ERROR: option --min-confidence: '
+ "invalid integer value: 'bad'\n"])
+ self.assertRaises(SystemExit, parse, ['--min-confidence=0'])
+ self.assertLog(['ERROR: option --min-confidence: invalid integer: 0: '
+ 'value must be between 1 and 5\n'])
+ self.assertRaises(SystemExit, parse, ['--min-confidence=6'])
+ self.assertLog(['ERROR: option --min-confidence: invalid integer: 6: '
+ 'value must be between 1 and 5\n'])
+ parse(['--min-confidence=1']) # works
+ parse(['--min-confidence=5']) # works
+
+ self.assertRaises(SystemExit, parse, ['--output=bad'])
+ self.assertLog(['ERROR: option --output-format: invalid choice: '
+ "'bad' (choose from 'emacs', 'vs7')\n"])
+ parse(['--output=vs7']) # works
+
+ # Pass a filter rule not beginning with + or -.
+ self.assertRaises(SystemExit, parse, ['--filter=build'])
+ self.assertLog(['ERROR: Invalid filter rule "build": '
+ 'every rule must start with + or -.\n'])
+ parse(['--filter=+build']) # works
+
+ def test_parse_default_arguments(self):
+ parse = self._parse
+
+ (files, options) = parse([])
+
+ self.assertEquals(files, [])
+
+ self.assertEquals(options.filter_rules, [])
+ self.assertEquals(options.git_commit, None)
+ self.assertEquals(options.diff_files, False)
+ self.assertEquals(options.is_verbose, False)
+ self.assertEquals(options.min_confidence, 3)
+ self.assertEquals(options.output_format, 'vs7')
+
+ def test_parse_explicit_arguments(self):
+ parse = self._parse
+
+ # Pass non-default explicit values.
+ (files, options) = parse(['--min-confidence=4'])
+ self.assertEquals(options.min_confidence, 4)
+ (files, options) = parse(['--output=emacs'])
+ self.assertEquals(options.output_format, 'emacs')
+ (files, options) = parse(['-g', 'commit'])
+ self.assertEquals(options.git_commit, 'commit')
+ (files, options) = parse(['--git-commit=commit'])
+ self.assertEquals(options.git_commit, 'commit')
+ (files, options) = parse(['--git-diff=commit'])
+ self.assertEquals(options.git_commit, 'commit')
+ (files, options) = parse(['--verbose'])
+ self.assertEquals(options.is_verbose, True)
+ (files, options) = parse(['--diff-files', 'file.txt'])
+ self.assertEquals(options.diff_files, True)
+
+ # Pass user_rules.
+ (files, options) = parse(['--filter=+build,-whitespace'])
+ self.assertEquals(options.filter_rules,
+ ["+build", "-whitespace"])
+
+ # Pass spurious white space in user rules.
+ (files, options) = parse(['--filter=+build, -whitespace'])
+ self.assertEquals(options.filter_rules,
+ ["+build", "-whitespace"])
+
+ def test_parse_files(self):
+ parse = self._parse
+
+ (files, options) = parse(['foo.cpp'])
+ self.assertEquals(files, ['foo.cpp'])
+
+ # Pass multiple files.
+ (files, options) = parse(['--output=emacs', 'foo.cpp', 'bar.cpp'])
+ self.assertEquals(files, ['foo.cpp', 'bar.cpp'])
+
+
+class CommandOptionValuesTest(unittest.TestCase):
+
+ """Tests CommandOptionValues class."""
+
+ def test_init(self):
+ """Test __init__ constructor."""
+ # Check default parameters.
+ options = ProcessorOptions()
+ self.assertEquals(options.filter_rules, [])
+ self.assertEquals(options.git_commit, None)
+ self.assertEquals(options.is_verbose, False)
+ self.assertEquals(options.min_confidence, 1)
+ self.assertEquals(options.output_format, "emacs")
+
+ # Check argument validation.
+ self.assertRaises(ValueError, ProcessorOptions, output_format="bad")
+ ProcessorOptions(output_format="emacs") # No ValueError: works
+ ProcessorOptions(output_format="vs7") # works
+ self.assertRaises(ValueError, ProcessorOptions, min_confidence=0)
+ self.assertRaises(ValueError, ProcessorOptions, min_confidence=6)
+ ProcessorOptions(min_confidence=1) # works
+ ProcessorOptions(min_confidence=5) # works
+
+ # Check attributes.
+ options = ProcessorOptions(filter_rules=["+"],
+ git_commit="commit",
+ is_verbose=True,
+ min_confidence=3,
+ output_format="vs7")
+ self.assertEquals(options.filter_rules, ["+"])
+ self.assertEquals(options.git_commit, "commit")
+ self.assertEquals(options.is_verbose, True)
+ self.assertEquals(options.min_confidence, 3)
+ self.assertEquals(options.output_format, "vs7")
+
+ def test_eq(self):
+ """Test __eq__ equality function."""
+ self.assertTrue(ProcessorOptions().__eq__(ProcessorOptions()))
+
+ # Also verify that a difference in any argument causes equality to fail.
+
+ # Explicitly create a ProcessorOptions instance with all default
+ # values. We do this to be sure we are assuming the right default
+ # values in our self.assertFalse() calls below.
+ options = ProcessorOptions(filter_rules=[],
+ git_commit=None,
+ is_verbose=False,
+ min_confidence=1,
+ output_format="emacs")
+ # Verify that we created options correctly.
+ self.assertTrue(options.__eq__(ProcessorOptions()))
+
+ self.assertFalse(options.__eq__(ProcessorOptions(filter_rules=["+"])))
+ self.assertFalse(options.__eq__(ProcessorOptions(git_commit="commit")))
+ self.assertFalse(options.__eq__(ProcessorOptions(is_verbose=True)))
+ self.assertFalse(options.__eq__(ProcessorOptions(min_confidence=2)))
+ self.assertFalse(options.__eq__(ProcessorOptions(output_format="vs7")))
+
+ def test_ne(self):
+ """Test __ne__ inequality function."""
+ # By default, __ne__ always returns true on different objects.
+ # Thus, just check the distinguishing case to verify that the
+ # code defines __ne__.
+ self.assertFalse(ProcessorOptions().__ne__(ProcessorOptions()))
+
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py b/WebKitTools/Scripts/webkitpy/style/patchreader.py
index 89dd192..f44839d 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/test_types/fuzzy_image_diff.py
+++ b/WebKitTools/Scripts/webkitpy/style/patchreader.py
@@ -1,5 +1,6 @@
-#!/usr/bin/env python
# Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+# Copyright (C) 2010 ProFUSION embedded systems
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -27,43 +28,39 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Compares the image output of a test to the expected image output using
-fuzzy matching.
-"""
-
-import errno
import logging
-import os
-import shutil
-from layout_package import test_failures
-from test_types import test_type_base
+from webkitpy.common.checkout.diff_parser import DiffParser
-class FuzzyImageDiff(test_type_base.TestTypeBase):
+_log = logging.getLogger("webkitpy.style.patchreader")
- def compare_output(self, filename, output, test_args, target):
- """Implementation of CompareOutput that checks the output image and
- checksum against the expected files from the LayoutTest directory.
- """
- failures = []
- # If we didn't produce a hash file, this test must be text-only.
- if test_args.hash is None:
- return failures
+class PatchReader(object):
+ """Supports checking style in patches."""
+
+ def __init__(self, text_file_reader):
+ """Create a PatchReader instance.
- expected_png_file = self._port.expected_filename(filename, '.png')
+ Args:
+ text_file_reader: A TextFileReader instance.
+
+ """
+ self._text_file_reader = text_file_reader
- if test_args.show_sources:
- logging.debug('Using %s' % expected_png_file)
+ def check(self, patch_string):
+ """Check style in the given patch."""
+ patch_files = DiffParser(patch_string.splitlines()).files
- # Also report a missing expected PNG file.
- if not os.path.isfile(expected_png_file):
- failures.append(test_failures.FailureMissingImage(self))
+ for path, diff_file in patch_files.iteritems():
+ line_numbers = diff_file.added_or_modified_line_numbers()
+ _log.debug('Found %s new or modified lines in: %s' % (len(line_numbers), path))
- # Run the fuzzymatcher
- r = port.fuzzy_diff(test_args.png_path, expected_png_file)
- if r != 0:
- failures.append(test_failures.FailureFuzzyFailure(self))
+ if not line_numbers:
+ # Don't check files which contain only deleted lines
+ # as they can never add style errors. However, mark them as
+ # processed so that we count up number of such files.
+ self._text_file_reader.count_delete_only_file()
+ continue
- return failures
+ self._text_file_reader.process_file(file_path=path, line_numbers=line_numbers)
diff --git a/WebKitTools/Scripts/webkitpy/style/patchreader_unittest.py b/WebKitTools/Scripts/webkitpy/style/patchreader_unittest.py
new file mode 100644
index 0000000..b121082
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/style/patchreader_unittest.py
@@ -0,0 +1,92 @@
+#!/usr/bin/python
+#
+# Copyright (C) 2010 Google Inc. All rights reserved.
+# Copyright (C) 2009 Torch Mobile Inc.
+# Copyright (C) 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com)
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.style.patchreader import PatchReader
+
+
+class PatchReaderTest(unittest.TestCase):
+
+ """Test the PatchReader class."""
+
+ class MockTextFileReader(object):
+
+ def __init__(self):
+ self.passed_to_process_file = []
+ """A list of (file_path, line_numbers) pairs."""
+ self.delete_only_file_count = 0
+ """A number of times count_delete_only_file() called"""
+
+ def process_file(self, file_path, line_numbers):
+ self.passed_to_process_file.append((file_path, line_numbers))
+
+ def count_delete_only_file(self):
+ self.delete_only_file_count += 1
+
+ def setUp(self):
+ file_reader = self.MockTextFileReader()
+ self._file_reader = file_reader
+ self._patch_checker = PatchReader(file_reader)
+
+ def _call_check_patch(self, patch_string):
+ self._patch_checker.check(patch_string)
+
+ def _assert_checked(self, passed_to_process_file, delete_only_file_count):
+ self.assertEquals(self._file_reader.passed_to_process_file,
+ passed_to_process_file)
+ self.assertEquals(self._file_reader.delete_only_file_count,
+ delete_only_file_count)
+
+ def test_check_patch(self):
+ # The modified line_numbers array for this patch is: [2].
+ self._call_check_patch("""diff --git a/__init__.py b/__init__.py
+index ef65bee..e3db70e 100644
+--- a/__init__.py
++++ b/__init__.py
+@@ -1,1 +1,2 @@
+ # Required for Python to search this directory for module files
++# New line
+""")
+ self._assert_checked([("__init__.py", [2])], 0)
+
+ def test_check_patch_with_deletion(self):
+ self._call_check_patch("""Index: __init__.py
+===================================================================
+--- __init__.py (revision 3593)
++++ __init__.py (working copy)
+@@ -1 +0,0 @@
+-foobar
+""")
+ # _mock_check_file should not be called for the deletion patch.
+ self._assert_checked([], 1)
diff --git a/WebKitTools/Scripts/webkitpy/style/processors/common_unittest.py b/WebKitTools/Scripts/webkitpy/style/processors/common_unittest.py
deleted file mode 100644
index 9362b65..0000000
--- a/WebKitTools/Scripts/webkitpy/style/processors/common_unittest.py
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
-#
-# 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.
-
-"""Unit tests for common.py."""
-
-
-import unittest
-
-from common import check_no_carriage_return
-
-
-# FIXME: The unit tests for the cpp, text, and common processors should
-# share supporting test code. This can include, for example, the
-# mock style error handling code and the code to check that all
-# of a processor's categories are covered by the unit tests.
-# Such shared code can be located in a shared test file, perhaps
-# ilke this one.
-class CarriageReturnTest(unittest.TestCase):
-
- """Tests check_no_carriage_return()."""
-
- _category = "whitespace/carriage_return"
- _confidence = 1
-
- def setUp(self):
- self._style_errors = [] # The list of accumulated style errors.
-
- def _mock_style_error_handler(self, line_number, category, confidence,
- message):
- """Append the error information to the list of style errors."""
- error = (line_number, category, confidence, message)
- self._style_errors.append(error)
-
- def assert_carriage_return(self, line, is_error):
- """Call check_no_carriage_return() and assert the result."""
- line_number = 100
- handle_style_error = self._mock_style_error_handler
-
- check_no_carriage_return(line, line_number, handle_style_error)
-
- expected_message = ("One or more unexpected \\r (^M) found; "
- "better to use only a \\n")
-
- if is_error:
- expected_errors = [(line_number, self._category, self._confidence,
- expected_message)]
- self.assertEquals(self._style_errors, expected_errors)
- else:
- self.assertEquals(self._style_errors, [])
-
- def test_ends_with_carriage(self):
- self.assert_carriage_return("carriage return\r", is_error=True)
-
- def test_ends_with_nothing(self):
- self.assert_carriage_return("no carriage return", is_error=False)
-
- def test_ends_with_newline(self):
- self.assert_carriage_return("no carriage return\n", is_error=False)
-
- def test_ends_with_carriage_newline(self):
- # Check_no_carriage_return only() checks the final character.
- self.assert_carriage_return("carriage\r in a string", is_error=False)
-
diff --git a/WebKitTools/Scripts/webkitpy/style_references.py b/WebKitTools/Scripts/webkitpy/style_references.py
index 2528c4d..a21e931 100644
--- a/WebKitTools/Scripts/webkitpy/style_references.py
+++ b/WebKitTools/Scripts/webkitpy/style_references.py
@@ -40,33 +40,35 @@
import os
-from diff_parser import DiffParser
-from scm import detect_scm_system
+from webkitpy.common.checkout.diff_parser import DiffParser
+from webkitpy.common.system.logtesting import LogTesting
+from webkitpy.common.system.logtesting import TestLogStream
+from webkitpy.common.system.logutils import configure_logging
+from webkitpy.common.checkout.scm import detect_scm_system
+from webkitpy.layout_tests import port
+from webkitpy.layout_tests.layout_package import test_expectations
+from webkitpy.thirdparty.autoinstalled import pep8
-def parse_patch(patch_string):
+def detect_checkout():
+ """Return a WebKitCheckout instance, or None if it cannot be found."""
+ cwd = os.path.abspath(os.curdir)
+ scm = detect_scm_system(cwd)
- """Parse a patch string and return the affected files."""
+ return None if scm is None else WebKitCheckout(scm)
- patch = DiffParser(patch_string.splitlines())
- return patch.files
+class WebKitCheckout(object):
-class SimpleScm(object):
+ """Simple facade to the SCM class for use by style package."""
- """Simple facade to SCM for use by style package."""
+ def __init__(self, scm):
+ self._scm = scm
- def __init__(self):
- cwd = os.path.abspath('.')
- self._scm = detect_scm_system(cwd)
-
- def checkout_root(self):
- """Return the source control root as an absolute path."""
+ def root_path(self):
+ """Return the checkout root as an absolute path."""
return self._scm.checkout_root
- def create_patch(self):
- return self._scm.create_patch()
-
- def create_patch_since_local_commit(self, commit):
- return self._scm.create_patch_since_local_commit(commit)
-
+ def create_patch(self, git_commit, changed_files=None):
+ # FIXME: SCM.create_patch should understand how to handle None.
+ return self._scm.create_patch(git_commit, changed_files=changed_files or [])
diff --git a/WebKitTools/Scripts/webkitpy/test/__init__.py b/WebKitTools/Scripts/webkitpy/test/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/test/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/test/cat.py b/WebKitTools/Scripts/webkitpy/test/cat.py
new file mode 100644
index 0000000..ae1e143
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/test/cat.py
@@ -0,0 +1,42 @@
+# 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 os.path
+import sys
+
+# Add WebKitTools/Scripts to the path to ensure we can find webkitpy.
+sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
+
+from webkitpy.common.system import fileutils
+
+
+def command_arguments(*args):
+ return ['python', __file__] + list(args)
+
+
+def main():
+ fileutils.make_stdout_binary()
+ sys.stdout.write(sys.stdin.read())
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/WebKitTools/Scripts/webkitpy/test/cat_unittest.py b/WebKitTools/Scripts/webkitpy/test/cat_unittest.py
new file mode 100644
index 0000000..4ed1f67
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/test/cat_unittest.py
@@ -0,0 +1,52 @@
+# 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 StringIO
+import os.path
+import sys
+import unittest
+
+from webkitpy.common.system import executive, outputcapture
+from webkitpy.test import cat
+
+
+class CatTest(outputcapture.OutputCaptureTestCaseBase):
+ def assert_cat(self, input):
+ saved_stdin = sys.stdin
+ sys.stdin = StringIO.StringIO(input)
+ cat.main()
+ self.assertStdout(input)
+ sys.stdin = saved_stdin
+
+ def test_basic(self):
+ self.assert_cat('foo bar baz\n')
+
+ def test_no_newline(self):
+ self.assert_cat('foo bar baz')
+
+ def test_unicode(self):
+ self.assert_cat(u'WebKit \u2661 Tor Arne Vestb\u00F8!')
+
+ def test_as_command(self):
+ input = 'foo bar baz\n'
+ output = executive.Executive().run_command(cat.command_arguments(), input=input)
+ self.assertEqual(input, output)
diff --git a/WebKitTools/Scripts/webkitpy/test/echo.py b/WebKitTools/Scripts/webkitpy/test/echo.py
new file mode 100644
index 0000000..f7468f7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/test/echo.py
@@ -0,0 +1,52 @@
+# 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 os.path
+import sys
+
+# Add WebKitTools/Scripts to the path to ensure we can find webkitpy.
+sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
+
+from webkitpy.common.system import fileutils
+
+
+def command_arguments(*args):
+ return ['python', __file__] + list(args)
+
+
+def main(args=None):
+ if args is None:
+ args = sys.argv[1:]
+
+ fileutils.make_stdout_binary()
+
+ print_newline = True
+ if len(args) and args[0] == '-n':
+ print_newline = False
+ del args[0]
+ sys.stdout.write(' '.join(args))
+ if print_newline:
+ sys.stdout.write('\n')
+ return 0
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/WebKitTools/Scripts/webkitpy/test/echo_unittest.py b/WebKitTools/Scripts/webkitpy/test/echo_unittest.py
new file mode 100644
index 0000000..bc13b5e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/test/echo_unittest.py
@@ -0,0 +1,64 @@
+# 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 os.path
+import sys
+import unittest
+
+from webkitpy.common.system import executive, outputcapture
+from webkitpy.test import echo
+
+
+class EchoTest(outputcapture.OutputCaptureTestCaseBase):
+ def test_basic(self):
+ echo.main(['foo', 'bar', 'baz'])
+ self.assertStdout('foo bar baz\n')
+
+ def test_no_newline(self):
+ echo.main(['-n', 'foo', 'bar', 'baz'])
+ self.assertStdout('foo bar baz')
+
+ def test_unicode(self):
+ echo.main([u'WebKit \u2661', 'Tor Arne', u'Vestb\u00F8!'])
+ self.assertStdout(u'WebKit \u2661 Tor Arne Vestb\u00F8!\n')
+
+ def test_argument_order(self):
+ echo.main(['foo', '-n', 'bar'])
+ self.assertStdout('foo -n bar\n')
+
+ def test_empty_arguments(self):
+ old_argv = sys.argv
+ sys.argv = ['echo.py', 'foo', 'bar', 'baz']
+ echo.main([])
+ self.assertStdout('\n')
+ sys.argv = old_argv
+
+ def test_no_arguments(self):
+ old_argv = sys.argv
+ sys.argv = ['echo.py', 'foo', 'bar', 'baz']
+ echo.main()
+ self.assertStdout('foo bar baz\n')
+ sys.argv = old_argv
+
+ def test_as_command(self):
+ output = executive.Executive().run_command(echo.command_arguments('foo', 'bar', 'baz'))
+ self.assertEqual(output, 'foo bar baz\n')
diff --git a/WebKitTools/Scripts/webkitpy/test/main.py b/WebKitTools/Scripts/webkitpy/test/main.py
new file mode 100644
index 0000000..1038d82
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/test/main.py
@@ -0,0 +1,140 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+"""Contains the entry method for test-webkitpy."""
+
+import logging
+import os
+import sys
+import unittest
+
+import webkitpy
+
+
+_log = logging.getLogger(__name__)
+
+
+class Tester(object):
+
+ """Discovers and runs webkitpy unit tests."""
+
+ def _find_unittest_files(self, webkitpy_dir):
+ """Return a list of paths to all unit-test files."""
+ unittest_paths = [] # Return value.
+
+ for dir_path, dir_names, file_names in os.walk(webkitpy_dir):
+ for file_name in file_names:
+ if not file_name.endswith("_unittest.py"):
+ continue
+ unittest_path = os.path.join(dir_path, file_name)
+ unittest_paths.append(unittest_path)
+
+ return unittest_paths
+
+ def _modules_from_paths(self, package_root, paths):
+ """Return a list of fully-qualified module names given paths."""
+ package_path = os.path.abspath(package_root)
+ root_package_name = os.path.split(package_path)[1] # Equals "webkitpy".
+
+ prefix_length = len(package_path)
+
+ modules = []
+ for path in paths:
+ path = os.path.abspath(path)
+ # This gives us, for example: /common/config/ports_unittest.py
+ rel_path = path[prefix_length:]
+ # This gives us, for example: /common/config/ports_unittest
+ rel_path = os.path.splitext(rel_path)[0]
+
+ parts = []
+ while True:
+ (rel_path, tail) = os.path.split(rel_path)
+ if not tail:
+ break
+ parts.insert(0, tail)
+ # We now have, for example: common.config.ports_unittest
+ # FIXME: This is all a hack around the fact that we always prefix webkitpy includes with "webkitpy."
+ parts.insert(0, root_package_name) # Put "webkitpy" at the beginning.
+ module = ".".join(parts)
+ modules.append(module)
+
+ return modules
+
+ def run_tests(self, sys_argv, external_package_paths=None):
+ """Run the unit tests in all *_unittest.py modules in webkitpy.
+
+ This method excludes "webkitpy.common.checkout.scm_unittest" unless
+ the --all option is the second element of sys_argv.
+
+ Args:
+ sys_argv: A reference to sys.argv.
+
+ """
+ if external_package_paths is None:
+ external_package_paths = []
+ else:
+ # FIXME: We should consider moving webkitpy off of using "webkitpy." to prefix
+ # all includes. If we did that, then this would use path instead of dirname(path).
+ # QueueStatusServer.__init__ has a sys.path import hack due to this code.
+ sys.path.extend(set(os.path.dirname(path) for path in external_package_paths))
+
+ if len(sys_argv) > 1 and not sys_argv[-1].startswith("-"):
+ # Then explicit modules or test names were provided, which
+ # the unittest module is equipped to handle.
+ unittest.main(argv=sys_argv, module=None)
+ # No need to return since unitttest.main() exits.
+
+ # Otherwise, auto-detect all unit tests.
+
+ # FIXME: This should be combined with the external_package_paths code above.
+ webkitpy_dir = os.path.dirname(webkitpy.__file__)
+
+ modules = []
+ for path in [webkitpy_dir] + external_package_paths:
+ modules.extend(self._modules_from_paths(path, self._find_unittest_files(path)))
+ modules.sort()
+
+ # This is a sanity check to ensure that the unit-test discovery
+ # methods are working.
+ if len(modules) < 1:
+ raise Exception("No unit-test modules found.")
+
+ for module in modules:
+ _log.debug("Found: %s" % module)
+
+ # FIXME: This is a hack, but I'm tired of commenting out the test.
+ # See https://bugs.webkit.org/show_bug.cgi?id=31818
+ if len(sys_argv) > 1 and sys.argv[1] == "--all":
+ sys.argv.remove("--all")
+ else:
+ excluded_module = "webkitpy.common.checkout.scm_unittest"
+ _log.info("Excluding: %s (use --all to include)" % excluded_module)
+ modules.remove(excluded_module)
+
+ sys_argv.extend(modules)
+
+ # We pass None for the module because we do not want the unittest
+ # module to resolve module names relative to a given module.
+ # (This would require importing all of the unittest modules from
+ # this module.) See the loadTestsFromName() method of the
+ # unittest.TestLoader class for more details on this parameter.
+ unittest.main(argv=sys_argv, module=None)
diff --git a/WebKitTools/Scripts/webkitpy/test/skip.py b/WebKitTools/Scripts/webkitpy/test/skip.py
new file mode 100644
index 0000000..8587d56
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/test/skip.py
@@ -0,0 +1,52 @@
+# 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 logging
+
+_log = logging.getLogger(__name__)
+
+
+def skip_if(klass, condition, message=None, logger=None):
+ """Makes all test_* methods in a given class no-ops if the given condition
+ is False. Backported from Python 3.1+'s unittest.skipIf decorator."""
+ if not logger:
+ logger = _log
+ if not condition:
+ return klass
+ for name in dir(klass):
+ attr = getattr(klass, name)
+ if not callable(attr):
+ continue
+ if not name.startswith('test_'):
+ continue
+ setattr(klass, name, _skipped_method(attr, message, logger))
+ klass._printed_skipped_message = False
+ return klass
+
+
+def _skipped_method(method, message, logger):
+ def _skip(*args):
+ if method.im_class._printed_skipped_message:
+ return
+ method.im_class._printed_skipped_message = True
+ logger.info('Skipping %s.%s: %s' % (method.__module__, method.im_class.__name__, message))
+ return _skip
diff --git a/WebKitTools/Scripts/webkitpy/test/skip_unittest.py b/WebKitTools/Scripts/webkitpy/test/skip_unittest.py
new file mode 100644
index 0000000..f61a1bb
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/test/skip_unittest.py
@@ -0,0 +1,77 @@
+# 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 StringIO
+import logging
+import unittest
+
+from webkitpy.test.skip import skip_if
+
+
+class SkipTest(unittest.TestCase):
+ def setUp(self):
+ self.logger = logging.getLogger(__name__)
+
+ self.old_level = self.logger.level
+ self.logger.setLevel(logging.INFO)
+
+ self.old_propagate = self.logger.propagate
+ self.logger.propagate = False
+
+ self.log_stream = StringIO.StringIO()
+ self.handler = logging.StreamHandler(self.log_stream)
+ self.logger.addHandler(self.handler)
+
+ self.foo_was_called = False
+
+ def tearDown(self):
+ self.logger.removeHandler(self.handler)
+ self.propagate = self.old_propagate
+ self.logger.setLevel(self.old_level)
+
+ def create_fixture_class(self):
+ class TestSkipFixture(object):
+ def __init__(self, callback):
+ self.callback = callback
+
+ def test_foo(self):
+ self.callback()
+
+ return TestSkipFixture
+
+ def foo_callback(self):
+ self.foo_was_called = True
+
+ def test_skip_if_false(self):
+ klass = skip_if(self.create_fixture_class(), False, 'Should not see this message.', logger=self.logger)
+ klass(self.foo_callback).test_foo()
+ self.assertEqual(self.log_stream.getvalue(), '')
+ self.assertTrue(self.foo_was_called)
+
+ def test_skip_if_true(self):
+ klass = skip_if(self.create_fixture_class(), True, 'Should see this message.', logger=self.logger)
+ klass(self.foo_callback).test_foo()
+ self.assertEqual(self.log_stream.getvalue(), 'Skipping webkitpy.test.skip_unittest.TestSkipFixture: Should see this message.\n')
+ self.assertFalse(self.foo_was_called)
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/BeautifulSoup.py b/WebKitTools/Scripts/webkitpy/thirdparty/BeautifulSoup.py
index 34204e7..34204e7 100644
--- a/WebKitTools/Scripts/webkitpy/BeautifulSoup.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/BeautifulSoup.py
diff --git a/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py b/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
new file mode 100644
index 0000000..c2249c2
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/__init__.py
@@ -0,0 +1,98 @@
+# Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
+#
+# 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.
+
+# This module is required for Python to treat this directory as a package.
+
+"""Autoinstalls third-party code required by WebKit."""
+
+from __future__ import with_statement
+
+import codecs
+import os
+
+from webkitpy.common.system.autoinstall import AutoInstaller
+
+# Putting the autoinstall code into webkitpy/thirdparty/__init__.py
+# ensures that no autoinstalling occurs until a caller imports from
+# webkitpy.thirdparty. This is useful if the caller wants to configure
+# logging prior to executing autoinstall code.
+
+# FIXME: Ideally, a package should be autoinstalled only if the caller
+# attempts to import from that individual package. This would
+# make autoinstalling lazier than it is currently. This can
+# perhaps be done using Python's import hooks as the original
+# autoinstall implementation did.
+
+# FIXME: If any of these servers is offline, webkit-patch breaks (and maybe
+# other scripts do, too). See <http://webkit.org/b/42080>.
+
+# We put auto-installed third-party modules in this directory--
+#
+# webkitpy/thirdparty/autoinstalled
+thirdparty_dir = os.path.dirname(__file__)
+autoinstalled_dir = os.path.join(thirdparty_dir, "autoinstalled")
+
+# We need to download ClientForm since the mechanize package that we download
+# below requires it. The mechanize package uses ClientForm, for example,
+# in _html.py. Since mechanize imports ClientForm in the following way,
+#
+# > import sgmllib, ClientForm
+#
+# the search path needs to include ClientForm. We put ClientForm in
+# its own directory so that we can include it in the search path without
+# including other modules as a side effect.
+clientform_dir = os.path.join(autoinstalled_dir, "clientform")
+installer = AutoInstaller(append_to_search_path=True,
+ target_dir=clientform_dir)
+installer.install(url="http://pypi.python.org/packages/source/C/ClientForm/ClientForm-0.2.10.zip",
+ url_subpath="ClientForm.py")
+
+# The remaining packages do not need to be in the search path, so we create
+# a new AutoInstaller instance that does not append to the search path.
+installer = AutoInstaller(target_dir=autoinstalled_dir)
+
+installer.install(url="http://pypi.python.org/packages/source/m/mechanize/mechanize-0.1.11.zip",
+ url_subpath="mechanize")
+installer.install(url="http://pypi.python.org/packages/source/p/pep8/pep8-0.5.0.tar.gz#md5=512a818af9979290cd619cce8e9c2e2b",
+ url_subpath="pep8-0.5.0/pep8.py")
+installer.install(url="http://www.adambarth.com/webkit/eliza",
+ target_name="eliza.py")
+
+# Since irclib and ircbot are two top-level packages, we need to import
+# them separately. We group them into an irc package for better
+# organization purposes.
+irc_dir = os.path.join(autoinstalled_dir, "irc")
+installer = AutoInstaller(target_dir=irc_dir)
+installer.install(url="http://downloads.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip", url_subpath="irclib.py")
+installer.install(url="http://downloads.sourceforge.net/project/python-irclib/python-irclib/0.4.8/python-irclib-0.4.8.zip", url_subpath="ircbot.py")
+
+pywebsocket_dir = os.path.join(autoinstalled_dir, "pywebsocket")
+installer = AutoInstaller(target_dir=pywebsocket_dir)
+installer.install(url="http://pywebsocket.googlecode.com/files/mod_pywebsocket-0.5.2.tar.gz",
+ url_subpath="pywebsocket-0.5.2/src/mod_pywebsocket")
+
+readme_path = os.path.join(autoinstalled_dir, "README")
+if not os.path.exists(readme_path):
+ with codecs.open(readme_path, "w", "ascii") as file:
+ file.write("This directory is auto-generated by WebKit and is "
+ "safe to delete.\nIt contains needed third-party Python "
+ "packages automatically downloaded from the web.")
diff --git a/WebKitTools/Scripts/webkitpy/mock.py b/WebKitTools/Scripts/webkitpy/thirdparty/mock.py
index f6f328e..015c19e 100644
--- a/WebKitTools/Scripts/webkitpy/mock.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/mock.py
@@ -1,309 +1,309 @@
-# mock.py
-# Test tools for mocking and patching.
-# Copyright (C) 2007-2009 Michael Foord
-# E-mail: fuzzyman AT voidspace DOT org DOT uk
-
-# mock 0.6.0
-# http://www.voidspace.org.uk/python/mock/
-
-# Released subject to the BSD License
-# Please see http://www.voidspace.org.uk/python/license.shtml
-
-# 2009-11-25: Licence downloaded from above URL.
-# BEGIN DOWNLOADED LICENSE
-#
-# Copyright (c) 2003-2009, Michael Foord
-# All rights reserved.
-# E-mail : fuzzyman AT voidspace DOT org DOT uk
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following
-# disclaimer in the documentation and/or other materials provided
-# with the distribution.
-#
-# * Neither the name of Michael Foord nor the name of Voidspace
-# may be used to endorse or promote products derived from this
-# software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# END DOWNLOADED LICENSE
-
-# Scripts maintained at http://www.voidspace.org.uk/python/index.shtml
-# Comments, suggestions and bug reports welcome.
-
-
-__all__ = (
- 'Mock',
- 'patch',
- 'patch_object',
- 'sentinel',
- 'DEFAULT'
-)
-
-__version__ = '0.6.0'
-
-class SentinelObject(object):
- def __init__(self, name):
- self.name = name
-
- def __repr__(self):
- return '<SentinelObject "%s">' % self.name
-
-
-class Sentinel(object):
- def __init__(self):
- self._sentinels = {}
-
- def __getattr__(self, name):
- return self._sentinels.setdefault(name, SentinelObject(name))
-
-
-sentinel = Sentinel()
-
-DEFAULT = sentinel.DEFAULT
-
-class OldStyleClass:
- pass
-ClassType = type(OldStyleClass)
-
-def _is_magic(name):
- return '__%s__' % name[2:-2] == name
-
-def _copy(value):
- if type(value) in (dict, list, tuple, set):
- return type(value)(value)
- return value
-
-
-class Mock(object):
-
- def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,
- name=None, parent=None, wraps=None):
- self._parent = parent
- self._name = name
- if spec is not None and not isinstance(spec, list):
- spec = [member for member in dir(spec) if not _is_magic(member)]
-
- self._methods = spec
- self._children = {}
- self._return_value = return_value
- self.side_effect = side_effect
- self._wraps = wraps
-
- self.reset_mock()
-
-
- def reset_mock(self):
- self.called = False
- self.call_args = None
- self.call_count = 0
- self.call_args_list = []
- self.method_calls = []
- for child in self._children.itervalues():
- child.reset_mock()
- if isinstance(self._return_value, Mock):
- self._return_value.reset_mock()
-
-
- def __get_return_value(self):
- if self._return_value is DEFAULT:
- self._return_value = Mock()
- return self._return_value
-
- def __set_return_value(self, value):
- self._return_value = value
-
- return_value = property(__get_return_value, __set_return_value)
-
-
- def __call__(self, *args, **kwargs):
- self.called = True
- self.call_count += 1
- self.call_args = (args, kwargs)
- self.call_args_list.append((args, kwargs))
-
- parent = self._parent
- name = self._name
- while parent is not None:
- parent.method_calls.append((name, args, kwargs))
- if parent._parent is None:
- break
- name = parent._name + '.' + name
- parent = parent._parent
-
- ret_val = DEFAULT
- if self.side_effect is not None:
- if (isinstance(self.side_effect, Exception) or
- isinstance(self.side_effect, (type, ClassType)) and
- issubclass(self.side_effect, Exception)):
- raise self.side_effect
-
- ret_val = self.side_effect(*args, **kwargs)
- if ret_val is DEFAULT:
- ret_val = self.return_value
-
- if self._wraps is not None and self._return_value is DEFAULT:
- return self._wraps(*args, **kwargs)
- if ret_val is DEFAULT:
- ret_val = self.return_value
- return ret_val
-
-
- def __getattr__(self, name):
- if self._methods is not None:
- if name not in self._methods:
- raise AttributeError("Mock object has no attribute '%s'" % name)
- elif _is_magic(name):
- raise AttributeError(name)
-
- if name not in self._children:
- wraps = None
- if self._wraps is not None:
- wraps = getattr(self._wraps, name)
- self._children[name] = Mock(parent=self, name=name, wraps=wraps)
-
- return self._children[name]
-
-
- def assert_called_with(self, *args, **kwargs):
- assert self.call_args == (args, kwargs), 'Expected: %s\nCalled with: %s' % ((args, kwargs), self.call_args)
-
-
-def _dot_lookup(thing, comp, import_path):
- try:
- return getattr(thing, comp)
- except AttributeError:
- __import__(import_path)
- return getattr(thing, comp)
-
-
-def _importer(target):
- components = target.split('.')
- import_path = components.pop(0)
- thing = __import__(import_path)
-
- for comp in components:
- import_path += ".%s" % comp
- thing = _dot_lookup(thing, comp, import_path)
- return thing
-
-
-class _patch(object):
- def __init__(self, target, attribute, new, spec, create):
- self.target = target
- self.attribute = attribute
- self.new = new
- self.spec = spec
- self.create = create
- self.has_local = False
-
-
- def __call__(self, func):
- if hasattr(func, 'patchings'):
- func.patchings.append(self)
- return func
-
- def patched(*args, **keywargs):
- # don't use a with here (backwards compatability with 2.5)
- extra_args = []
- for patching in patched.patchings:
- arg = patching.__enter__()
- if patching.new is DEFAULT:
- extra_args.append(arg)
- args += tuple(extra_args)
- try:
- return func(*args, **keywargs)
- finally:
- for patching in getattr(patched, 'patchings', []):
- patching.__exit__()
-
- patched.patchings = [self]
- patched.__name__ = func.__name__
- patched.compat_co_firstlineno = getattr(func, "compat_co_firstlineno",
- func.func_code.co_firstlineno)
- return patched
-
-
- def get_original(self):
- target = self.target
- name = self.attribute
- create = self.create
-
- original = DEFAULT
- if _has_local_attr(target, name):
- try:
- original = target.__dict__[name]
- except AttributeError:
- # for instances of classes with slots, they have no __dict__
- original = getattr(target, name)
- elif not create and not hasattr(target, name):
- raise AttributeError("%s does not have the attribute %r" % (target, name))
- return original
-
-
- def __enter__(self):
- new, spec, = self.new, self.spec
- original = self.get_original()
- if new is DEFAULT:
- # XXXX what if original is DEFAULT - shouldn't use it as a spec
- inherit = False
- if spec == True:
- # set spec to the object we are replacing
- spec = original
- if isinstance(spec, (type, ClassType)):
- inherit = True
- new = Mock(spec=spec)
- if inherit:
- new.return_value = Mock(spec=spec)
- self.temp_original = original
- setattr(self.target, self.attribute, new)
- return new
-
-
- def __exit__(self, *_):
- if self.temp_original is not DEFAULT:
- setattr(self.target, self.attribute, self.temp_original)
- else:
- delattr(self.target, self.attribute)
- del self.temp_original
-
-
-def patch_object(target, attribute, new=DEFAULT, spec=None, create=False):
- return _patch(target, attribute, new, spec, create)
-
-
-def patch(target, new=DEFAULT, spec=None, create=False):
- try:
- target, attribute = target.rsplit('.', 1)
- except (TypeError, ValueError):
- raise TypeError("Need a valid target to patch. You supplied: %r" % (target,))
- target = _importer(target)
- return _patch(target, attribute, new, spec, create)
-
-
-
-def _has_local_attr(obj, name):
- try:
- return name in vars(obj)
- except TypeError:
- # objects without a __dict__
- return hasattr(obj, name)
+# mock.py
+# Test tools for mocking and patching.
+# Copyright (C) 2007-2009 Michael Foord
+# E-mail: fuzzyman AT voidspace DOT org DOT uk
+
+# mock 0.6.0
+# http://www.voidspace.org.uk/python/mock/
+
+# Released subject to the BSD License
+# Please see http://www.voidspace.org.uk/python/license.shtml
+
+# 2009-11-25: Licence downloaded from above URL.
+# BEGIN DOWNLOADED LICENSE
+#
+# Copyright (c) 2003-2009, Michael Foord
+# All rights reserved.
+# E-mail : fuzzyman AT voidspace DOT org DOT uk
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following
+# disclaimer in the documentation and/or other materials provided
+# with the distribution.
+#
+# * Neither the name of Michael Foord nor the name of Voidspace
+# may be used to endorse or promote products derived from this
+# software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# END DOWNLOADED LICENSE
+
+# Scripts maintained at http://www.voidspace.org.uk/python/index.shtml
+# Comments, suggestions and bug reports welcome.
+
+
+__all__ = (
+ 'Mock',
+ 'patch',
+ 'patch_object',
+ 'sentinel',
+ 'DEFAULT'
+)
+
+__version__ = '0.6.0'
+
+class SentinelObject(object):
+ def __init__(self, name):
+ self.name = name
+
+ def __repr__(self):
+ return '<SentinelObject "%s">' % self.name
+
+
+class Sentinel(object):
+ def __init__(self):
+ self._sentinels = {}
+
+ def __getattr__(self, name):
+ return self._sentinels.setdefault(name, SentinelObject(name))
+
+
+sentinel = Sentinel()
+
+DEFAULT = sentinel.DEFAULT
+
+class OldStyleClass:
+ pass
+ClassType = type(OldStyleClass)
+
+def _is_magic(name):
+ return '__%s__' % name[2:-2] == name
+
+def _copy(value):
+ if type(value) in (dict, list, tuple, set):
+ return type(value)(value)
+ return value
+
+
+class Mock(object):
+
+ def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,
+ name=None, parent=None, wraps=None):
+ self._parent = parent
+ self._name = name
+ if spec is not None and not isinstance(spec, list):
+ spec = [member for member in dir(spec) if not _is_magic(member)]
+
+ self._methods = spec
+ self._children = {}
+ self._return_value = return_value
+ self.side_effect = side_effect
+ self._wraps = wraps
+
+ self.reset_mock()
+
+
+ def reset_mock(self):
+ self.called = False
+ self.call_args = None
+ self.call_count = 0
+ self.call_args_list = []
+ self.method_calls = []
+ for child in self._children.itervalues():
+ child.reset_mock()
+ if isinstance(self._return_value, Mock):
+ self._return_value.reset_mock()
+
+
+ def __get_return_value(self):
+ if self._return_value is DEFAULT:
+ self._return_value = Mock()
+ return self._return_value
+
+ def __set_return_value(self, value):
+ self._return_value = value
+
+ return_value = property(__get_return_value, __set_return_value)
+
+
+ def __call__(self, *args, **kwargs):
+ self.called = True
+ self.call_count += 1
+ self.call_args = (args, kwargs)
+ self.call_args_list.append((args, kwargs))
+
+ parent = self._parent
+ name = self._name
+ while parent is not None:
+ parent.method_calls.append((name, args, kwargs))
+ if parent._parent is None:
+ break
+ name = parent._name + '.' + name
+ parent = parent._parent
+
+ ret_val = DEFAULT
+ if self.side_effect is not None:
+ if (isinstance(self.side_effect, Exception) or
+ isinstance(self.side_effect, (type, ClassType)) and
+ issubclass(self.side_effect, Exception)):
+ raise self.side_effect
+
+ ret_val = self.side_effect(*args, **kwargs)
+ if ret_val is DEFAULT:
+ ret_val = self.return_value
+
+ if self._wraps is not None and self._return_value is DEFAULT:
+ return self._wraps(*args, **kwargs)
+ if ret_val is DEFAULT:
+ ret_val = self.return_value
+ return ret_val
+
+
+ def __getattr__(self, name):
+ if self._methods is not None:
+ if name not in self._methods:
+ raise AttributeError("Mock object has no attribute '%s'" % name)
+ elif _is_magic(name):
+ raise AttributeError(name)
+
+ if name not in self._children:
+ wraps = None
+ if self._wraps is not None:
+ wraps = getattr(self._wraps, name)
+ self._children[name] = Mock(parent=self, name=name, wraps=wraps)
+
+ return self._children[name]
+
+
+ def assert_called_with(self, *args, **kwargs):
+ assert self.call_args == (args, kwargs), 'Expected: %s\nCalled with: %s' % ((args, kwargs), self.call_args)
+
+
+def _dot_lookup(thing, comp, import_path):
+ try:
+ return getattr(thing, comp)
+ except AttributeError:
+ __import__(import_path)
+ return getattr(thing, comp)
+
+
+def _importer(target):
+ components = target.split('.')
+ import_path = components.pop(0)
+ thing = __import__(import_path)
+
+ for comp in components:
+ import_path += ".%s" % comp
+ thing = _dot_lookup(thing, comp, import_path)
+ return thing
+
+
+class _patch(object):
+ def __init__(self, target, attribute, new, spec, create):
+ self.target = target
+ self.attribute = attribute
+ self.new = new
+ self.spec = spec
+ self.create = create
+ self.has_local = False
+
+
+ def __call__(self, func):
+ if hasattr(func, 'patchings'):
+ func.patchings.append(self)
+ return func
+
+ def patched(*args, **keywargs):
+ # don't use a with here (backwards compatability with 2.5)
+ extra_args = []
+ for patching in patched.patchings:
+ arg = patching.__enter__()
+ if patching.new is DEFAULT:
+ extra_args.append(arg)
+ args += tuple(extra_args)
+ try:
+ return func(*args, **keywargs)
+ finally:
+ for patching in getattr(patched, 'patchings', []):
+ patching.__exit__()
+
+ patched.patchings = [self]
+ patched.__name__ = func.__name__
+ patched.compat_co_firstlineno = getattr(func, "compat_co_firstlineno",
+ func.func_code.co_firstlineno)
+ return patched
+
+
+ def get_original(self):
+ target = self.target
+ name = self.attribute
+ create = self.create
+
+ original = DEFAULT
+ if _has_local_attr(target, name):
+ try:
+ original = target.__dict__[name]
+ except AttributeError:
+ # for instances of classes with slots, they have no __dict__
+ original = getattr(target, name)
+ elif not create and not hasattr(target, name):
+ raise AttributeError("%s does not have the attribute %r" % (target, name))
+ return original
+
+
+ def __enter__(self):
+ new, spec, = self.new, self.spec
+ original = self.get_original()
+ if new is DEFAULT:
+ # XXXX what if original is DEFAULT - shouldn't use it as a spec
+ inherit = False
+ if spec == True:
+ # set spec to the object we are replacing
+ spec = original
+ if isinstance(spec, (type, ClassType)):
+ inherit = True
+ new = Mock(spec=spec)
+ if inherit:
+ new.return_value = Mock(spec=spec)
+ self.temp_original = original
+ setattr(self.target, self.attribute, new)
+ return new
+
+
+ def __exit__(self, *_):
+ if self.temp_original is not DEFAULT:
+ setattr(self.target, self.attribute, self.temp_original)
+ else:
+ delattr(self.target, self.attribute)
+ del self.temp_original
+
+
+def patch_object(target, attribute, new=DEFAULT, spec=None, create=False):
+ return _patch(target, attribute, new, spec, create)
+
+
+def patch(target, new=DEFAULT, spec=None, create=False):
+ try:
+ target, attribute = target.rsplit('.', 1)
+ except (TypeError, ValueError):
+ raise TypeError("Need a valid target to patch. You supplied: %r" % (target,))
+ target = _importer(target)
+ return _patch(target, attribute, new, spec, create)
+
+
+
+def _has_local_attr(obj, name):
+ try:
+ return name in vars(obj)
+ except TypeError:
+ # objects without a __dict__
+ return hasattr(obj, name)
diff --git a/WebKitTools/simplejson/LICENSE.txt b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/LICENSE.txt
index ad95f29..ad95f29 100644
--- a/WebKitTools/simplejson/LICENSE.txt
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/LICENSE.txt
diff --git a/WebKitTools/simplejson/README.txt b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/README.txt
index 7f726ce..7f726ce 100644
--- a/WebKitTools/simplejson/README.txt
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/README.txt
diff --git a/WebKitTools/simplejson/__init__.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/__init__.py
index 38d6229..38d6229 100644
--- a/WebKitTools/simplejson/__init__.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/__init__.py
diff --git a/WebKitTools/simplejson/_speedups.c b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/_speedups.c
index 8f290bb..8f290bb 100644
--- a/WebKitTools/simplejson/_speedups.c
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/_speedups.c
diff --git a/WebKitTools/simplejson/decoder.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py
index a1b53b2..63f70cb 100644
--- a/WebKitTools/simplejson/decoder.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/decoder.py
@@ -3,7 +3,7 @@ Implementation of JSONDecoder
"""
import re
-from simplejson.scanner import Scanner, pattern
+from scanner import Scanner, pattern
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
diff --git a/WebKitTools/simplejson/encoder.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/encoder.py
index d29919a..d29919a 100644
--- a/WebKitTools/simplejson/encoder.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/encoder.py
diff --git a/WebKitTools/simplejson/jsonfilter.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/jsonfilter.py
index 01ca21d..01ca21d 100644
--- a/WebKitTools/simplejson/jsonfilter.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/jsonfilter.py
diff --git a/WebKitTools/simplejson/scanner.py b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/scanner.py
index 64f4999..64f4999 100644
--- a/WebKitTools/simplejson/scanner.py
+++ b/WebKitTools/Scripts/webkitpy/thirdparty/simplejson/scanner.py
diff --git a/WebKitTools/Scripts/webkitpy/tool/__init__.py b/WebKitTools/Scripts/webkitpy/tool/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/__init__.py b/WebKitTools/Scripts/webkitpy/tool/bot/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py
new file mode 100644
index 0000000..ea12702
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask.py
@@ -0,0 +1,196 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.net.layouttestresults import LayoutTestResults
+
+
+class CommitQueueTaskDelegate(object):
+ def run_command(self, command):
+ raise NotImplementedError("subclasses must implement")
+
+ def command_passed(self, message, patch):
+ raise NotImplementedError("subclasses must implement")
+
+ def command_failed(self, message, script_error, patch):
+ raise NotImplementedError("subclasses must implement")
+
+ def refetch_patch(self, patch):
+ raise NotImplementedError("subclasses must implement")
+
+ def layout_test_results(self):
+ raise NotImplementedError("subclasses must implement")
+
+ def report_flaky_tests(self, patch, flaky_tests):
+ raise NotImplementedError("subclasses must implement")
+
+
+class CommitQueueTask(object):
+ def __init__(self, delegate, patch):
+ self._delegate = delegate
+ self._patch = patch
+ self._script_error = None
+
+ def _validate(self):
+ # Bugs might get closed, or patches might be obsoleted or r-'d while the
+ # commit-queue is processing.
+ self._patch = self._delegate.refetch_patch(self._patch)
+ if self._patch.is_obsolete():
+ return False
+ if self._patch.bug().is_closed():
+ return False
+ if not self._patch.committer():
+ return False
+ # Reviewer is not required. Missing reviewers will be caught during
+ # the ChangeLog check during landing.
+ return True
+
+ def _run_command(self, command, success_message, failure_message):
+ try:
+ self._delegate.run_command(command)
+ self._delegate.command_passed(success_message, patch=self._patch)
+ return True
+ except ScriptError, e:
+ self._script_error = e
+ self.failure_status_id = self._delegate.command_failed(failure_message, script_error=self._script_error, patch=self._patch)
+ return False
+
+ def _apply(self):
+ return self._run_command([
+ "apply-attachment",
+ "--force-clean",
+ "--non-interactive",
+ self._patch.id(),
+ ],
+ "Applied patch",
+ "Patch does not apply")
+
+ def _build(self):
+ return self._run_command([
+ "build",
+ "--no-clean",
+ "--no-update",
+ "--build-style=both",
+ ],
+ "Built patch",
+ "Patch does not build")
+
+ def _build_without_patch(self):
+ return self._run_command([
+ "build",
+ "--force-clean",
+ "--no-update",
+ "--build-style=both",
+ ],
+ "Able to build without patch",
+ "Unable to build without patch")
+
+ def _test(self):
+ return self._run_command([
+ "build-and-test",
+ "--no-clean",
+ "--no-update",
+ # Notice that we don't pass --build, which means we won't build!
+ "--test",
+ "--non-interactive",
+ ],
+ "Passed tests",
+ "Patch does not pass tests")
+
+ def _build_and_test_without_patch(self):
+ return self._run_command([
+ "build-and-test",
+ "--force-clean",
+ "--no-update",
+ "--build",
+ "--test",
+ "--non-interactive",
+ ],
+ "Able to pass tests without patch",
+ "Unable to pass tests without patch (tree is red?)")
+
+ def _failing_tests_from_last_run(self):
+ results = self._delegate.layout_test_results()
+ if not results:
+ return None
+ return results.failing_tests()
+
+ def _land(self):
+ # Unclear if this should pass --quiet or not. If --parent-command always does the reporting, then it should.
+ return self._run_command([
+ "land-attachment",
+ "--force-clean",
+ "--ignore-builders",
+ "--non-interactive",
+ "--parent-command=commit-queue",
+ self._patch.id(),
+ ],
+ "Landed patch",
+ "Unable to land patch")
+
+ def _report_flaky_tests(self, flaky_tests):
+ self._delegate.report_flaky_tests(self._patch, flaky_tests)
+
+ def _test_patch(self):
+ if self._patch.is_rollout():
+ return True
+ if self._test():
+ return True
+
+ first_failing_tests = self._failing_tests_from_last_run()
+ if self._test():
+ self._report_flaky_tests(first_failing_tests)
+ return True
+
+ second_failing_tests = self._failing_tests_from_last_run()
+ if first_failing_tests != second_failing_tests:
+ self._report_flaky_tests(first_failing_tests + second_failing_tests)
+ return False
+
+ if self._build_and_test_without_patch():
+ raise self._script_error # The error from the previous ._test() run is real, report it.
+ return False # Tree must be red, just retry later.
+
+ def run(self):
+ if not self._validate():
+ return False
+ if not self._apply():
+ raise self._script_error
+ if not self._build():
+ if not self._build_without_patch():
+ return False
+ raise self._script_error
+ if not self._test_patch():
+ return False
+ # Make sure the patch is still valid before landing (e.g., make sure
+ # no one has set commit-queue- since we started working on the patch.)
+ if not self._validate():
+ return False
+ if not self._land():
+ raise self._script_error
+ return True
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
new file mode 100644
index 0000000..15a4a6b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py
@@ -0,0 +1,204 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from datetime import datetime
+import unittest
+
+from webkitpy.common.system.deprecated_logging import error, log
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.bot.commitqueuetask import *
+from webkitpy.tool.mocktool import MockTool
+
+
+class MockCommitQueue(CommitQueueTaskDelegate):
+ def __init__(self, error_plan):
+ self._error_plan = error_plan
+
+ def run_command(self, command):
+ log("run_webkit_patch: %s" % command)
+ if self._error_plan:
+ error = self._error_plan.pop(0)
+ if error:
+ raise error
+
+ def command_passed(self, success_message, patch):
+ log("command_passed: success_message='%s' patch='%s'" % (
+ success_message, patch.id()))
+
+ def command_failed(self, failure_message, script_error, patch):
+ log("command_failed: failure_message='%s' script_error='%s' patch='%s'" % (
+ failure_message, script_error, patch.id()))
+ return 3947
+
+ def refetch_patch(self, patch):
+ return patch
+
+ def layout_test_results(self):
+ return None
+
+ def report_flaky_tests(self, patch, flaky_tests):
+ log("report_flaky_tests: patch='%s' flaky_tests='%s'" % (patch.id(), flaky_tests))
+
+
+class CommitQueueTaskTest(unittest.TestCase):
+ def _run_through_task(self, commit_queue, expected_stderr, expected_exception=None):
+ tool = MockTool(log_executive=True)
+ patch = tool.bugs.fetch_attachment(197)
+ task = CommitQueueTask(commit_queue, patch)
+ OutputCapture().assert_outputs(self, task.run, expected_stderr=expected_stderr, expected_exception=expected_exception)
+
+ def test_success_case(self):
+ commit_queue = MockCommitQueue([])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_passed: success_message='Passed tests' patch='197'
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
+command_passed: success_message='Landed patch' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
+ def test_apply_failure(self):
+ commit_queue = MockCommitQueue([
+ ScriptError("MOCK apply failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
+command_failed: failure_message='Patch does not apply' script_error='MOCK apply failure' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr, ScriptError)
+
+ def test_build_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ ScriptError("MOCK build failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
+command_failed: failure_message='Patch does not build' script_error='MOCK build failure' patch='197'
+run_webkit_patch: ['build', '--force-clean', '--no-update', '--build-style=both']
+command_passed: success_message='Able to build without patch' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr, ScriptError)
+
+ def test_red_build_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ ScriptError("MOCK build failure"),
+ ScriptError("MOCK clean build failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
+command_failed: failure_message='Patch does not build' script_error='MOCK build failure' patch='197'
+run_webkit_patch: ['build', '--force-clean', '--no-update', '--build-style=both']
+command_failed: failure_message='Unable to build without patch' script_error='MOCK clean build failure' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
+ def test_flaky_test_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ None,
+ ScriptError("MOCK tests failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK tests failure' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_passed: success_message='Passed tests' patch='197'
+report_flaky_tests: patch='197' flaky_tests='None'
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
+command_passed: success_message='Landed patch' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
+ def test_test_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ None,
+ ScriptError("MOCK test failure"),
+ ScriptError("MOCK test failure again"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure again' patch='197'
+run_webkit_patch: ['build-and-test', '--force-clean', '--no-update', '--build', '--test', '--non-interactive']
+command_passed: success_message='Able to pass tests without patch' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr, ScriptError)
+
+ def test_red_test_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ None,
+ ScriptError("MOCK test failure"),
+ ScriptError("MOCK test failure again"),
+ ScriptError("MOCK clean test failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_failed: failure_message='Patch does not pass tests' script_error='MOCK test failure again' patch='197'
+run_webkit_patch: ['build-and-test', '--force-clean', '--no-update', '--build', '--test', '--non-interactive']
+command_failed: failure_message='Unable to pass tests without patch (tree is red?)' script_error='MOCK clean test failure' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr)
+
+ def test_land_failure(self):
+ commit_queue = MockCommitQueue([
+ None,
+ None,
+ None,
+ ScriptError("MOCK land failure"),
+ ])
+ expected_stderr = """run_webkit_patch: ['apply-attachment', '--force-clean', '--non-interactive', 197]
+command_passed: success_message='Applied patch' patch='197'
+run_webkit_patch: ['build', '--no-clean', '--no-update', '--build-style=both']
+command_passed: success_message='Built patch' patch='197'
+run_webkit_patch: ['build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+command_passed: success_message='Passed tests' patch='197'
+run_webkit_patch: ['land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
+command_failed: failure_message='Unable to land patch' script_error='MOCK land failure' patch='197'
+"""
+ self._run_through_task(commit_queue, expected_stderr, ScriptError)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py b/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py
new file mode 100644
index 0000000..046c4c1
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/feeders.py
@@ -0,0 +1,90 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from webkitpy.common.config.committervalidator import CommitterValidator
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.tool.grammar import pluralize
+
+
+class AbstractFeeder(object):
+ def __init__(self, tool):
+ self._tool = tool
+
+ def feed(self):
+ raise NotImplementedError("subclasses must implement")
+
+
+class CommitQueueFeeder(AbstractFeeder):
+ queue_name = "commit-queue"
+
+ def __init__(self, tool):
+ AbstractFeeder.__init__(self, tool)
+ self.committer_validator = CommitterValidator(self._tool.bugs)
+
+ def _update_work_items(self, item_ids):
+ # FIXME: This is the last use of update_work_items, the commit-queue
+ # should move to feeding patches one at a time like the EWS does.
+ self._tool.status_server.update_work_items(self.queue_name, item_ids)
+ log("Feeding %s items %s" % (self.queue_name, item_ids))
+
+ def feed(self):
+ patches = self._validate_patches()
+ patches = sorted(patches, self._patch_cmp)
+ patch_ids = [patch.id() for patch in patches]
+ self._update_work_items(patch_ids)
+
+ def _patches_for_bug(self, bug_id):
+ return self._tool.bugs.fetch_bug(bug_id).commit_queued_patches(include_invalid=True)
+
+ def _validate_patches(self):
+ # Not using BugzillaQueries.fetch_patches_from_commit_queue() so we can reject patches with invalid committers/reviewers.
+ bug_ids = self._tool.bugs.queries.fetch_bug_ids_from_commit_queue()
+ all_patches = sum([self._patches_for_bug(bug_id) for bug_id in bug_ids], [])
+ return self.committer_validator.patches_after_rejecting_invalid_commiters_and_reviewers(all_patches)
+
+ def _patch_cmp(self, a, b):
+ # Sort first by is_rollout, then by attach_date.
+ # Reversing the order so that is_rollout is first.
+ rollout_cmp = cmp(b.is_rollout(), a.is_rollout())
+ if rollout_cmp != 0:
+ return rollout_cmp
+ return cmp(a.attach_date(), b.attach_date())
+
+
+class EWSFeeder(AbstractFeeder):
+ def __init__(self, tool):
+ self._ids_sent_to_server = set()
+ AbstractFeeder.__init__(self, tool)
+
+ def feed(self):
+ ids_needing_review = set(self._tool.bugs.queries.fetch_attachment_ids_from_review_queue())
+ new_ids = ids_needing_review.difference(self._ids_sent_to_server)
+ log("Feeding EWS (%s, %s new)" % (pluralize("r? patch", len(ids_needing_review)), len(new_ids)))
+ for attachment_id in new_ids: # Order doesn't really matter for the EWS.
+ self._tool.status_server.submit_to_ews(attachment_id)
+ self._ids_sent_to_server.add(attachment_id)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/feeders_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/feeders_unittest.py
new file mode 100644
index 0000000..5ce00b4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/feeders_unittest.py
@@ -0,0 +1,70 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from datetime import datetime
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.bot.feeders import *
+from webkitpy.tool.mocktool import MockTool
+
+
+class FeedersTest(unittest.TestCase):
+ def test_commit_queue_feeder(self):
+ feeder = CommitQueueFeeder(MockTool())
+ expected_stderr = u"""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.
+
+- 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). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.'
+MOCK: update_work_items: commit-queue [106, 197]
+Feeding commit-queue items [106, 197]
+"""
+ OutputCapture().assert_outputs(self, feeder.feed, expected_stderr=expected_stderr)
+
+ def _mock_attachment(self, is_rollout, attach_date):
+ attachment = Mock()
+ attachment.is_rollout = lambda: is_rollout
+ attachment.attach_date = lambda: attach_date
+ return attachment
+
+ def test_patch_cmp(self):
+ long_ago_date = datetime(1900, 1, 21)
+ recent_date = datetime(2010, 1, 21)
+ attachment1 = self._mock_attachment(is_rollout=False, attach_date=recent_date)
+ attachment2 = self._mock_attachment(is_rollout=False, attach_date=long_ago_date)
+ attachment3 = self._mock_attachment(is_rollout=True, attach_date=recent_date)
+ attachment4 = self._mock_attachment(is_rollout=True, attach_date=long_ago_date)
+ attachments = [attachment1, attachment2, attachment3, attachment4]
+ expected_sort = [attachment4, attachment3, attachment2, attachment1]
+ queue = CommitQueueFeeder(MockTool())
+ attachments.sort(queue._patch_cmp)
+ self.assertEqual(attachments, expected_sort)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py
new file mode 100644
index 0000000..a848472
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py
@@ -0,0 +1,109 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import random
+import webkitpy.common.config.irc as config_irc
+
+from webkitpy.common.checkout.changelog import view_source_url
+from webkitpy.tool.bot.queueengine import TerminateQueue
+from webkitpy.common.net.bugzilla import parse_bug_id
+from webkitpy.common.system.executive import ScriptError
+
+# FIXME: Merge with Command?
+class IRCCommand(object):
+ def execute(self, nick, args, tool, sheriff):
+ raise NotImplementedError, "subclasses must implement"
+
+
+class LastGreenRevision(IRCCommand):
+ def execute(self, nick, args, tool, sheriff):
+ return "%s: %s" % (nick,
+ view_source_url(tool.buildbot.last_green_revision()))
+
+
+class Restart(IRCCommand):
+ def execute(self, nick, args, tool, sheriff):
+ tool.irc().post("Restarting...")
+ raise TerminateQueue()
+
+
+class Rollout(IRCCommand):
+ def execute(self, nick, args, tool, sheriff):
+ if len(args) < 2:
+ tool.irc().post("%s: Usage: SVN_REVISION REASON" % nick)
+ return
+ svn_revision = args[0].lstrip("r")
+ rollout_reason = " ".join(args[1:])
+ tool.irc().post("Preparing rollout for r%s..." % svn_revision)
+ try:
+ complete_reason = "%s (Requested by %s on %s)." % (
+ rollout_reason, nick, config_irc.channel)
+ bug_id = sheriff.post_rollout_patch(svn_revision, complete_reason)
+ bug_url = tool.bugs.bug_url_for_bug_id(bug_id)
+ tool.irc().post("%s: Created rollout: %s" % (nick, bug_url))
+ except ScriptError, e:
+ tool.irc().post("%s: Failed to create rollout patch:" % nick)
+ tool.irc().post("%s" % e)
+ bug_id = parse_bug_id(e.output)
+ if bug_id:
+ tool.irc().post("Ugg... Might have created %s" %
+ tool.bugs.bug_url_for_bug_id(bug_id))
+
+
+class Help(IRCCommand):
+ def execute(self, nick, args, tool, sheriff):
+ return "%s: Available commands: %s" % (nick, ", ".join(commands.keys()))
+
+
+class Hi(IRCCommand):
+ def execute(self, nick, args, tool, sheriff):
+ quips = tool.bugs.quips()
+ quips.append('"Only you can prevent forest fires." -- Smokey the Bear')
+ return random.choice(quips)
+
+
+class Eliza(IRCCommand):
+ therapist = None
+
+ def __init__(self):
+ if not self.therapist:
+ import webkitpy.thirdparty.autoinstalled.eliza as eliza
+ Eliza.therapist = eliza.eliza()
+
+ def execute(self, nick, args, tool, sheriff):
+ return "%s: %s" % (nick, self.therapist.respond(" ".join(args)))
+
+
+# FIXME: Lame. We should have an auto-registering CommandCenter.
+commands = {
+ "last-green-revision": LastGreenRevision,
+ "restart": Restart,
+ "rollout": Rollout,
+ "help": Help,
+ "hi": Hi,
+}
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/irc_command_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command_unittest.py
new file mode 100644
index 0000000..7aeb6a0
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command_unittest.py
@@ -0,0 +1,38 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.tool.bot.irc_command import *
+
+
+class IRCCommandTest(unittest.TestCase):
+ def test_eliza(self):
+ eliza = Eliza()
+ eliza.execute("tom", "hi", None, None)
+ eliza.execute("tom", "bye", None, None)
diff --git a/WebKitTools/Scripts/webkitpy/queueengine.py b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
index d14177d..8b016e8 100644
--- a/WebKitTools/Scripts/webkitpy/queueengine.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine.py
@@ -1,5 +1,4 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -34,9 +33,13 @@ import traceback
from datetime import datetime, timedelta
-from webkitpy.executive import ScriptError
-from webkitpy.webkit_logging import log, OutputTee
-from webkitpy.statusserver import StatusServer
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.system.deprecated_logging import log, OutputTee
+
+
+class TerminateQueue(Exception):
+ pass
+
class QueueEngineDelegate:
def queue_log_path(self):
@@ -66,14 +69,15 @@ class QueueEngineDelegate:
class QueueEngine:
- def __init__(self, name, delegate):
+ def __init__(self, name, delegate, wakeup_event):
self._name = name
self._delegate = delegate
+ self._wakeup_event = wakeup_event
self._output_tee = OutputTee()
log_date_format = "%Y-%m-%d %H:%M:%S"
- sleep_duration_text = "5 mins"
- seconds_to_sleep = 300
+ sleep_duration_text = "2 mins" # This could be generated from seconds_to_sleep
+ seconds_to_sleep = 120
handled_error_code = 2
# Child processes exit with a special code to the parent queue process can detect the error was handled.
@@ -101,23 +105,35 @@ class QueueEngine:
# This looks fixed, no?
self._open_work_log(work_item)
try:
- self._delegate.process_work_item(work_item)
+ if not self._delegate.process_work_item(work_item):
+ log("Unable to process work item.")
+ continue
except ScriptError, e:
# Use a special exit code to indicate that the error was already
# handled in the child process and we should just keep looping.
if e.exit_code == self.handled_error_code:
continue
- message = "Unexpected failure when landing patch! Please file a bug against webkit-patch.\n%s" % e.message_with_output()
+ message = "Unexpected failure when processing patch! Please file a bug against webkit-patch.\n%s" % e.message_with_output()
self._delegate.handle_unexpected_error(work_item, message)
+ except TerminateQueue, e:
+ self._stopping("TerminateQueue exception received.")
+ return 0
except KeyboardInterrupt, e:
- log("\nUser terminated queue.")
+ self._stopping("User terminated queue.")
return 1
except Exception, e:
traceback.print_exc()
# Don't try tell the status bot, in case telling it causes an exception.
self._sleep("Exception while preparing queue")
- # Never reached.
+ self._stopping("Delegate terminated queue.")
+ return 0
+
+ def _stopping(self, message):
+ log("\n%s" % message)
+ self._delegate.stop_work_queue(message)
+ # Be careful to shut down our OutputTee or the unit tests will be unhappy.
self._ensure_work_log_closed()
+ self._output_tee.remove_log(self._queue_log)
def _begin_logging(self):
self._queue_log = self._output_tee.add_log(self._delegate.queue_log_path())
@@ -125,6 +141,8 @@ class QueueEngine:
def _open_work_log(self, work_item):
work_item_log_path = self._delegate.work_item_log_path(work_item)
+ if not work_item_log_path:
+ return
self._work_log = self._output_tee.add_log(work_item_log_path)
def _ensure_work_log_closed(self):
@@ -133,12 +151,15 @@ class QueueEngine:
self._output_tee.remove_log(self._work_log)
self._work_log = None
- @classmethod
- def _sleep_message(cls, message):
- wake_time = datetime.now() + timedelta(seconds=cls.seconds_to_sleep)
- return "%s Sleeping until %s (%s)." % (message, wake_time.strftime(cls.log_date_format), cls.sleep_duration_text)
+ def _now(self):
+ """Overriden by the unit tests to allow testing _sleep_message"""
+ return datetime.now()
- @classmethod
- def _sleep(cls, message):
- log(cls._sleep_message(message))
- time.sleep(cls.seconds_to_sleep)
+ def _sleep_message(self, message):
+ wake_time = self._now() + timedelta(seconds=self.seconds_to_sleep)
+ return "%s Sleeping until %s (%s)." % (message, wake_time.strftime(self.log_date_format), self.sleep_duration_text)
+
+ def _sleep(self, message):
+ log(self._sleep_message(message))
+ self._wakeup_event.wait(self.seconds_to_sleep)
+ self._wakeup_event.clear()
diff --git a/WebKitTools/Scripts/webkitpy/queueengine_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
index a4036ea..37d8502 100644
--- a/WebKitTools/Scripts/webkitpy/queueengine_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/queueengine_unittest.py
@@ -1,5 +1,4 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -27,19 +26,24 @@
# (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 datetime
import os
import shutil
import tempfile
+import threading
import unittest
-from webkitpy.executive import ScriptError
-from webkitpy.queueengine import QueueEngine, QueueEngineDelegate
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.bot.queueengine import QueueEngine, QueueEngineDelegate, TerminateQueue
+
class LoggingDelegate(QueueEngineDelegate):
def __init__(self, test):
self._test = test
self._callbacks = []
self._run_before = False
+ self.stop_message = None
expected_callbacks = [
'queue_log_path',
@@ -49,7 +53,8 @@ class LoggingDelegate(QueueEngineDelegate):
'should_proceed_with_work_item',
'work_item_log_path',
'process_work_item',
- 'should_continue_work_queue'
+ 'should_continue_work_queue',
+ 'stop_work_queue',
]
def record(self, method_name):
@@ -86,20 +91,25 @@ class LoggingDelegate(QueueEngineDelegate):
def process_work_item(self, work_item):
self.record("process_work_item")
self._test.assertEquals(work_item, "work_item")
+ return True
def handle_unexpected_error(self, work_item, message):
self.record("handle_unexpected_error")
self._test.assertEquals(work_item, "work_item")
+ def stop_work_queue(self, message):
+ self.record("stop_work_queue")
+ self.stop_message = message
+
-class ThrowErrorDelegate(LoggingDelegate):
- def __init__(self, test, error_code):
+class RaisingDelegate(LoggingDelegate):
+ def __init__(self, test, exception):
LoggingDelegate.__init__(self, test)
- self.error_code = error_code
+ self._exception = exception
def process_work_item(self, work_item):
self.record("process_work_item")
- raise ScriptError(exit_code=self.error_code)
+ raise self._exception
class NotSafeToProceedDelegate(LoggingDelegate):
@@ -111,7 +121,7 @@ class NotSafeToProceedDelegate(LoggingDelegate):
class FastQueueEngine(QueueEngine):
def __init__(self, delegate):
- QueueEngine.__init__(self, "fast-queue", delegate)
+ QueueEngine.__init__(self, "fast-queue", delegate, threading.Event())
# No sleep for the wicked.
seconds_to_sleep = 0
@@ -123,16 +133,15 @@ class FastQueueEngine(QueueEngine):
class QueueEngineTest(unittest.TestCase):
def test_trivial(self):
delegate = LoggingDelegate(self)
- work_queue = QueueEngine("trivial-queue", delegate)
- work_queue.run()
+ self._run_engine(delegate)
+ self.assertEquals(delegate.stop_message, "Delegate terminated queue.")
self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks)
self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "queue_log_path")))
self.assertTrue(os.path.exists(os.path.join(self.temp_dir, "work_log_path", "work_item.log")))
def test_unexpected_error(self):
- delegate = ThrowErrorDelegate(self, 3)
- work_queue = QueueEngine("error-queue", delegate)
- work_queue.run()
+ delegate = RaisingDelegate(self, ScriptError(exit_code=3))
+ self._run_engine(delegate)
expected_callbacks = LoggingDelegate.expected_callbacks[:]
work_item_index = expected_callbacks.index('process_work_item')
# The unexpected error should be handled right after process_work_item starts
@@ -141,24 +150,54 @@ class QueueEngineTest(unittest.TestCase):
self.assertEquals(delegate._callbacks, expected_callbacks)
def test_handled_error(self):
- delegate = ThrowErrorDelegate(self, QueueEngine.handled_error_code)
- work_queue = QueueEngine("handled-error-queue", delegate)
- work_queue.run()
+ delegate = RaisingDelegate(self, ScriptError(exit_code=QueueEngine.handled_error_code))
+ self._run_engine(delegate)
self.assertEquals(delegate._callbacks, LoggingDelegate.expected_callbacks)
+ def _run_engine(self, delegate, engine=None, termination_message=None):
+ if not engine:
+ engine = QueueEngine("test-queue", delegate, threading.Event())
+ if not termination_message:
+ termination_message = "Delegate terminated queue."
+ expected_stderr = "\n%s\n" % termination_message
+ OutputCapture().assert_outputs(self, engine.run, [], expected_stderr=expected_stderr)
+
+ def _test_terminating_queue(self, exception, termination_message):
+ work_item_index = LoggingDelegate.expected_callbacks.index('process_work_item')
+ # The terminating error should be handled right after process_work_item.
+ # There should be no other callbacks after stop_work_queue.
+ expected_callbacks = LoggingDelegate.expected_callbacks[:work_item_index + 1]
+ expected_callbacks.append("stop_work_queue")
+
+ delegate = RaisingDelegate(self, exception)
+ self._run_engine(delegate, termination_message=termination_message)
+
+ self.assertEquals(delegate._callbacks, expected_callbacks)
+ self.assertEquals(delegate.stop_message, termination_message)
+
+ def test_terminating_error(self):
+ self._test_terminating_queue(KeyboardInterrupt(), "User terminated queue.")
+ self._test_terminating_queue(TerminateQueue(), "TerminateQueue exception received.")
+
def test_not_safe_to_proceed(self):
delegate = NotSafeToProceedDelegate(self)
- work_queue = FastQueueEngine(delegate)
- work_queue.run()
+ self._run_engine(delegate, engine=FastQueueEngine(delegate))
expected_callbacks = LoggingDelegate.expected_callbacks[:]
- next_work_item_index = expected_callbacks.index('next_work_item')
- # We slice out the common part of the expected callbacks.
- # We add 2 here to include should_proceed_with_work_item, which is
- # a pain to search for directly because it occurs twice.
- expected_callbacks = expected_callbacks[:next_work_item_index + 2]
- expected_callbacks.append('should_continue_work_queue')
+ expected_callbacks.remove('work_item_log_path')
+ expected_callbacks.remove('process_work_item')
self.assertEquals(delegate._callbacks, expected_callbacks)
+ def test_now(self):
+ """Make sure there are no typos in the QueueEngine.now() method."""
+ engine = QueueEngine("test", None, None)
+ self.assertTrue(isinstance(engine._now(), datetime.datetime))
+
+ def test_sleep_message(self):
+ engine = QueueEngine("test", None, None)
+ engine._now = lambda: datetime.datetime(2010, 1, 1)
+ expected_sleep_message = "MESSAGE Sleeping until 2010-01-01 00:02:00 (2 mins)."
+ self.assertEqual(engine._sleep_message("MESSAGE"), expected_sleep_message)
+
def setUp(self):
self.temp_dir = tempfile.mkdtemp(suffix="work_queue_test_logs")
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriff.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriff.py
new file mode 100644
index 0000000..da506bc
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriff.py
@@ -0,0 +1,91 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from webkitpy.common.checkout.changelog import view_source_url
+from webkitpy.common.net.bugzilla import parse_bug_id
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.grammar import join_with_separators
+
+
+class Sheriff(object):
+ def __init__(self, tool, sheriffbot):
+ self._tool = tool
+ self._sheriffbot = sheriffbot
+
+ def post_irc_warning(self, commit_info, builders):
+ irc_nicknames = sorted([party.irc_nickname for
+ party in commit_info.responsible_parties()
+ if party.irc_nickname])
+ irc_prefix = ": " if irc_nicknames else ""
+ irc_message = "%s%s%s might have broken %s" % (
+ ", ".join(irc_nicknames),
+ irc_prefix,
+ view_source_url(commit_info.revision()),
+ join_with_separators([builder.name() for builder in builders]))
+
+ self._tool.irc().post(irc_message)
+
+ def post_rollout_patch(self, svn_revision, rollout_reason):
+ # Ensure that svn_revision is a number (and not an option to
+ # create-rollout).
+ try:
+ svn_revision = int(svn_revision)
+ except:
+ raise ScriptError(message="Invalid svn revision number \"%s\"."
+ % svn_revision)
+
+ if rollout_reason.startswith("-"):
+ raise ScriptError(message="The rollout reason may not begin "
+ "with - (\"%s\")." % rollout_reason)
+
+ output = self._sheriffbot.run_webkit_patch([
+ "create-rollout",
+ "--force-clean",
+ # In principle, we should pass --non-interactive here, but it
+ # turns out that create-rollout doesn't need it yet. We can't
+ # pass it prophylactically because we reject unrecognized command
+ # line switches.
+ "--parent-command=sheriff-bot",
+ svn_revision,
+ rollout_reason,
+ ])
+ return parse_bug_id(output)
+
+ def post_blame_comment_on_bug(self, commit_info, builders, tests):
+ if not commit_info.bug_id():
+ return
+ comment = "%s might have broken %s" % (
+ view_source_url(commit_info.revision()),
+ join_with_separators([builder.name() for builder in builders]))
+ if tests:
+ comment += "\nThe following tests are not passing:\n"
+ comment += "\n".join(tests)
+ self._tool.bugs.post_comment_to_bug(commit_info.bug_id(),
+ comment,
+ cc=self._sheriffbot.watchers)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriff_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriff_unittest.py
new file mode 100644
index 0000000..690af1f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriff_unittest.py
@@ -0,0 +1,90 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import unittest
+
+from webkitpy.common.net.buildbot import Builder
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.bot.sheriff import Sheriff
+from webkitpy.tool.mocktool import MockTool
+
+
+class MockSheriffBot(object):
+ name = "mock-sheriff-bot"
+ watchers = [
+ "watcher@example.com",
+ ]
+
+ def run_webkit_patch(self, args):
+ return "Created bug https://bugs.webkit.org/show_bug.cgi?id=36936\n"
+
+
+class SheriffTest(unittest.TestCase):
+ def test_post_blame_comment_on_bug(self):
+ def run():
+ sheriff = Sheriff(MockTool(), MockSheriffBot())
+ builders = [
+ Builder("Foo", None),
+ Builder("Bar", None),
+ ]
+ commit_info = Mock()
+ commit_info.bug_id = lambda: None
+ commit_info.revision = lambda: 4321
+ # Should do nothing with no bug_id
+ sheriff.post_blame_comment_on_bug(commit_info, builders, [])
+ sheriff.post_blame_comment_on_bug(commit_info, builders, ["mock-test-1", "mock-test-2"])
+ # Should try to post a comment to the bug, but MockTool.bugs does nothing.
+ commit_info.bug_id = lambda: 1234
+ sheriff.post_blame_comment_on_bug(commit_info, builders, [])
+ sheriff.post_blame_comment_on_bug(commit_info, builders, ["mock-test-1"])
+ sheriff.post_blame_comment_on_bug(commit_info, builders, ["mock-test-1", "mock-test-2"])
+
+ expected_stderr = u"""MOCK bug comment: bug_id=1234, cc=['watcher@example.com']
+--- Begin comment ---
+http://trac.webkit.org/changeset/4321 might have broken Foo and Bar
+--- End comment ---
+
+MOCK bug comment: bug_id=1234, cc=['watcher@example.com']
+--- Begin comment ---
+http://trac.webkit.org/changeset/4321 might have broken Foo and Bar
+The following tests are not passing:
+mock-test-1
+--- End comment ---
+
+MOCK bug comment: bug_id=1234, cc=['watcher@example.com']
+--- Begin comment ---
+http://trac.webkit.org/changeset/4321 might have broken Foo and Bar
+The following tests are not passing:
+mock-test-1
+mock-test-2
+--- End comment ---
+
+"""
+ OutputCapture().assert_outputs(self, run, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot.py
new file mode 100644
index 0000000..de77222
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot.py
@@ -0,0 +1,83 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import webkitpy.tool.bot.irc_command as irc_command
+
+from webkitpy.common.net.irc.ircbot import IRCBotDelegate
+from webkitpy.common.thread.threadedmessagequeue import ThreadedMessageQueue
+
+
+class _IRCThreadTearoff(IRCBotDelegate):
+ def __init__(self, password, message_queue, wakeup_event):
+ self._password = password
+ self._message_queue = message_queue
+ self._wakeup_event = wakeup_event
+
+ # IRCBotDelegate methods
+
+ def irc_message_received(self, nick, message):
+ self._message_queue.post([nick, message])
+ self._wakeup_event.set()
+
+ def irc_nickname(self):
+ return "sheriffbot"
+
+ def irc_password(self):
+ return self._password
+
+
+class SheriffIRCBot(object):
+ def __init__(self, tool, sheriff):
+ self._tool = tool
+ self._sheriff = sheriff
+ self._message_queue = ThreadedMessageQueue()
+
+ def irc_delegate(self):
+ return _IRCThreadTearoff(self._tool.irc_password,
+ self._message_queue,
+ self._tool.wakeup_event)
+
+ def process_message(self, message):
+ (nick, request) = message
+ tokenized_request = request.strip().split(" ")
+ if not tokenized_request:
+ return
+ command = irc_command.commands.get(tokenized_request[0])
+ args = tokenized_request[1:]
+ if not command:
+ # Give the peoples someone to talk with.
+ command = irc_command.Eliza
+ args = tokenized_request
+ response = command().execute(nick, args, self._tool, self._sheriff)
+ if response:
+ self._tool.irc().post(response)
+
+ def process_pending_messages(self):
+ (messages, is_running) = self._message_queue.take_all()
+ for message in messages:
+ self.process_message(message)
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py
new file mode 100644
index 0000000..08023bd
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py
@@ -0,0 +1,95 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+import random
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.bot.sheriff import Sheriff
+from webkitpy.tool.bot.sheriffircbot import SheriffIRCBot
+from webkitpy.tool.bot.sheriff_unittest import MockSheriffBot
+from webkitpy.tool.mocktool import MockTool
+
+
+def run(message):
+ tool = MockTool()
+ tool.ensure_irc_connected(None)
+ bot = SheriffIRCBot(tool, Sheriff(tool, MockSheriffBot()))
+ bot._message_queue.post(["mock_nick", message])
+ bot.process_pending_messages()
+
+
+class SheriffIRCBotTest(unittest.TestCase):
+ def test_hi(self):
+ random.seed(23324)
+ expected_stderr = 'MOCK: irc.post: "Only you can prevent forest fires." -- Smokey the Bear\n'
+ OutputCapture().assert_outputs(self, run, args=["hi"], expected_stderr=expected_stderr)
+
+ def test_help(self):
+ expected_stderr = "MOCK: irc.post: mock_nick: Available commands: rollout, hi, help, restart, last-green-revision\n"
+ OutputCapture().assert_outputs(self, run, args=["help"], expected_stderr=expected_stderr)
+
+ def test_lgr(self):
+ expected_stderr = "MOCK: irc.post: mock_nick: http://trac.webkit.org/changeset/9479\n"
+ OutputCapture().assert_outputs(self, run, args=["last-green-revision"], expected_stderr=expected_stderr)
+
+ def test_rollout(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 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)
+
+ def test_rollout_invalidate_revision(self):
+ expected_stderr = ("MOCK: irc.post: Preparing rollout for r--component=Tools...\n"
+ "MOCK: irc.post: mock_nick: Failed to create rollout patch:\n"
+ "MOCK: irc.post: Invalid svn revision number \"--component=Tools\".\n")
+ OutputCapture().assert_outputs(self, run,
+ args=["rollout "
+ "--component=Tools 21654"],
+ expected_stderr=expected_stderr)
+
+ def test_rollout_invalidate_reason(self):
+ expected_stderr = ("MOCK: irc.post: Preparing rollout for "
+ "r21654...\nMOCK: irc.post: mock_nick: Failed to "
+ "create rollout patch:\nMOCK: irc.post: The rollout"
+ " reason may not begin with - (\"-bad (Requested "
+ "by mock_nick on #webkit).\").\n")
+ OutputCapture().assert_outputs(self, run,
+ args=["rollout "
+ "21654 -bad"],
+ expected_stderr=expected_stderr)
+
+ def test_rollout_no_reason(self):
+ expected_stderr = "MOCK: irc.post: mock_nick: Usage: SVN_REVISION REASON\n"
+ OutputCapture().assert_outputs(self, run, args=["rollout 21654"], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py b/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
new file mode 100644
index 0000000..d2aa503
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/__init__.py
@@ -0,0 +1,12 @@
+# Required for Python to search this directory for module files
+
+from webkitpy.tool.commands.download import *
+from webkitpy.tool.commands.earlywarningsystem import *
+from webkitpy.tool.commands.openbugs import OpenBugs
+from webkitpy.tool.commands.prettydiff import PrettyDiff
+from webkitpy.tool.commands.queries import *
+from webkitpy.tool.commands.queues import *
+from webkitpy.tool.commands.rebaseline import Rebaseline
+from webkitpy.tool.commands.rebaselineserver import RebaselineServer
+from webkitpy.tool.commands.sheriffbot import *
+from webkitpy.tool.commands.upload import *
diff --git a/WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.py b/WebKitTools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py
index 53af5b1..fc5a794 100644
--- a/WebKitTools/Scripts/webkitpy/commands/abstractsequencedcommand.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/abstractsequencedcommand.py
@@ -26,8 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-from webkitpy.stepsequence import StepSequence
+from webkitpy.tool.commands.stepsequence import StepSequence
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
class AbstractSequencedCommand(AbstractDeclarativeCommand):
diff --git a/WebKitTools/Scripts/webkitpy/commands/commandtest.py b/WebKitTools/Scripts/webkitpy/tool/commands/commandtest.py
index a56cb05..adc6d81 100644
--- a/WebKitTools/Scripts/webkitpy/commands/commandtest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/commandtest.py
@@ -28,11 +28,21 @@
import unittest
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockOptions, MockTool
class CommandsTest(unittest.TestCase):
- def assert_execute_outputs(self, command, args, expected_stdout="", expected_stderr="", options=Mock(), tool=MockBugzillaTool()):
+ def assert_execute_outputs(self, command, args, expected_stdout="", expected_stderr="", options=MockOptions(), tool=MockTool()):
+ options.blocks = True
+ options.cc = 'MOCK cc'
+ options.component = 'MOCK component'
+ options.confirm = True
+ options.email = 'MOCK email'
+ options.git_commit = 'MOCK git commit'
+ options.obsolete_patches = True
+ options.open_bug = True
+ options.port = 'MOCK port'
+ options.quiet = True
+ options.reviewer = 'MOCK reviewer'
command.bind_to_tool(tool)
OutputCapture().assert_outputs(self, command.execute, [options, args, tool], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/index.html b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/index.html
new file mode 100644
index 0000000..8cc48c1
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/index.html
@@ -0,0 +1,139 @@
+<!DOCTYPE html>
+<!--
+ Copyright (c) 2010 Google Inc. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following disclaimer
+ in the documentation and/or other materials provided with the
+ distribution.
+ * Neither the name of Google Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<html>
+<head>
+ <title>Layout Test Rebaseline Server</title>
+ <link rel="stylesheet" href="/main.css" type="text/css">
+ <script src="/util.js"></script>
+ <script src="/loupe.js"></script>
+ <script src="/main.js"></script>
+</head>
+<body class="loading">
+
+<div id="header">
+ <div id="controls">
+ <!-- Add a dummy <select> node so that this lines up with the text on the left -->
+ <select style="visibility: hidden"></select>
+ <a href="/quitquitquit">Exit</a>
+ </div>
+
+ <span id="selectors">
+ <label>
+ Failure type:
+ <select id="failure-type-selector"></select>
+ </label>
+
+ <label>
+ Directory:
+ <select id="directory-selector"></select>
+ </label>
+
+ <label>
+ Test:
+ <select id="test-selector"></select>
+ </label>
+ </span>
+
+ <a id="test-link">View test</a>
+
+ <span id="nav-buttons">
+ <button id="previous-test">&laquo;</button>
+ <span id="test-index"></span> of <span id="test-count"></span>
+ <button id="next-test">&raquo;</button>
+ </span>
+</div>
+
+<table id="test-output">
+ <thead id="labels">
+ <tr>
+ <th>Expected</th>
+ <th>Actual</th>
+ <th>Diff</th>
+ </tr>
+ </thead>
+ <tbody id="image-outputs" style="display: none">
+ <tr>
+ <td colspan="3"><h2>Image</h2></td>
+ </tr>
+ <tr>
+ <td><img id="expected-image"></td>
+ <td><img id="actual-image"></td>
+ <td><canvas id="diff-canvas" width="800" height="600"></canvas></td>
+ </tr>
+ </tbody>
+ <tbody id="text-outputs" style="display: none">
+ <tr>
+ <td colspan="3"><h2>Text</h2></td>
+ </tr>
+ <tr>
+ <td><pre id="expected-text"></pre></td>
+ <td><pre id="actual-text"></pre></td>
+ <td><pre id="diff-text"><pre></td>
+ </tr>
+ </tbody>
+</table>
+
+<table id="loupe" style="display: none">
+ <tr>
+ <td colspan="3" id="loupe-info">
+ <span id="loupe-close" class="link">Close</span>
+ <label>Coordinate: <span id="loupe-coordinate"></span></label>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div class="loupe-container">
+ <canvas id="expected-loupe" width="210" height="210"></canvas>
+ <div class="center-highlight"></div>
+ </div>
+ </td>
+ <td>
+ <div class="loupe-container">
+ <canvas id="actual-loupe" width="210" height="210"></canvas>
+ <div class="center-highlight"></div>
+ </div>
+ </td>
+ <td>
+ <div class="loupe-container">
+ <canvas id="diff-loupe" width="210" height="210"></canvas>
+ <div class="center-highlight"></div>
+ </div>
+ </td>
+ </tr>
+ <tr id="loupe-colors">
+ <td><label>Exp. color: <span id="expected-loupe-color"></span></label></td>
+ <td><label>Actual color: <span id="actual-loupe-color"></span></label></td>
+ <td><label>Diff color: <span id="diff-loupe-color"></span></label></td>
+ </tr>
+</table>
+
+</body>
+</html>
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/loupe.js b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/loupe.js
new file mode 100644
index 0000000..41f977a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/loupe.js
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+var LOUPE_MAGNIFICATION_FACTOR = 10;
+
+function Loupe()
+{
+ this._node = $('loupe');
+ this._currentCornerX = -1;
+ this._currentCornerY = -1;
+
+ var self = this;
+
+ function handleOutputClick(event) { self._handleOutputClick(event); }
+ $('expected-image').addEventListener('click', handleOutputClick);
+ $('actual-image').addEventListener('click', handleOutputClick);
+ $('diff-canvas').addEventListener('click', handleOutputClick);
+
+ function handleLoupeClick(event) { self._handleLoupeClick(event); }
+ $('expected-loupe').addEventListener('click', handleLoupeClick);
+ $('actual-loupe').addEventListener('click', handleLoupeClick);
+ $('diff-loupe').addEventListener('click', handleLoupeClick);
+
+ function hide(event) { self.hide(); }
+ $('loupe-close').addEventListener('click', hide);
+}
+
+Loupe.prototype._handleOutputClick = function(event)
+{
+ // The -1 compensates for the border around the image/canvas.
+ this._showFor(event.offsetX - 1, event.offsetY - 1);
+};
+
+Loupe.prototype._handleLoupeClick = function(event)
+{
+ var deltaX = Math.floor(event.offsetX/LOUPE_MAGNIFICATION_FACTOR);
+ var deltaY = Math.floor(event.offsetY/LOUPE_MAGNIFICATION_FACTOR);
+
+ this._showFor(
+ this._currentCornerX + deltaX, this._currentCornerY + deltaY);
+}
+
+Loupe.prototype.hide = function()
+{
+ this._node.style.display = 'none';
+};
+
+Loupe.prototype._showFor = function(x, y)
+{
+ this._fillFromImage(x, y, 'expected', $('expected-image'));
+ this._fillFromImage(x, y, 'actual', $('actual-image'));
+ this._fillFromCanvas(x, y, 'diff', $('diff-canvas'));
+
+ this._node.style.display = '';
+};
+
+Loupe.prototype._fillFromImage = function(x, y, type, sourceImage)
+{
+ var tempCanvas = document.createElement('canvas');
+ tempCanvas.width = sourceImage.width;
+ tempCanvas.height = sourceImage.height;
+ var tempContext = tempCanvas.getContext('2d');
+
+ tempContext.drawImage(sourceImage, 0, 0);
+
+ this._fillFromCanvas(x, y, type, tempCanvas);
+};
+
+Loupe.prototype._fillFromCanvas = function(x, y, type, canvas)
+{
+ var context = canvas.getContext('2d');
+ var sourceImageData =
+ context.getImageData(0, 0, canvas.width, canvas.height);
+
+ var targetCanvas = $(type + '-loupe');
+ var targetContext = targetCanvas.getContext('2d');
+ targetContext.fillStyle = 'rgba(255, 255, 255, 1)';
+ targetContext.fillRect(0, 0, targetCanvas.width, targetCanvas.height);
+
+ var sourceXOffset = (targetCanvas.width/LOUPE_MAGNIFICATION_FACTOR - 1)/2;
+ var sourceYOffset = (targetCanvas.height/LOUPE_MAGNIFICATION_FACTOR - 1)/2;
+
+ function readPixelComponent(x, y, component) {
+ var offset = (y * sourceImageData.width + x) * 4 + component;
+ return sourceImageData.data[offset];
+ }
+
+ for (var i = -sourceXOffset; i <= sourceXOffset; i++) {
+ for (var j = -sourceYOffset; j <= sourceYOffset; j++) {
+ var sourceX = x + i;
+ var sourceY = y + j;
+
+ var sourceR = readPixelComponent(sourceX, sourceY, 0);
+ var sourceG = readPixelComponent(sourceX, sourceY, 1);
+ var sourceB = readPixelComponent(sourceX, sourceY, 2);
+ var sourceA = readPixelComponent(sourceX, sourceY, 3)/255;
+ sourceA = Math.round(sourceA * 10)/10;
+
+ var targetX = (i + sourceXOffset) * LOUPE_MAGNIFICATION_FACTOR;
+ var targetY = (j + sourceYOffset) * LOUPE_MAGNIFICATION_FACTOR;
+ var colorString =
+ sourceR + ', ' + sourceG + ', ' + sourceB + ', ' + sourceA;
+ targetContext.fillStyle = 'rgba(' + colorString + ')';
+ targetContext.fillRect(
+ targetX, targetY,
+ LOUPE_MAGNIFICATION_FACTOR, LOUPE_MAGNIFICATION_FACTOR);
+
+ if (i == 0 && j == 0) {
+ $('loupe-coordinate').textContent = sourceX + ', ' + sourceY;
+ $(type + '-loupe-color').textContent = colorString;
+ }
+ }
+ }
+
+ this._currentCornerX = x - sourceXOffset;
+ this._currentCornerY = y - sourceYOffset;
+};
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css
new file mode 100644
index 0000000..6e90fe4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.css
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+body {
+ font-size: 12px;
+ font-family: Helvetica, Arial, sans-serif;
+ padding: 0;
+ margin: 0;
+}
+
+.loading {
+ opacity: 0.5;
+}
+
+div {
+ margin: 0;
+}
+
+a, .link {
+ color: #aaf;
+ text-decoration: underline;
+ cursor: pointer;
+}
+
+.link.selected {
+ color: #fff;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+#header {
+ padding: .5em 1em;
+ background: #333;
+ color: #fff;
+ -webkit-box-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
+ margin-bottom: 1em;
+}
+
+#header label {
+ padding-right: 1em;
+ color: #ccc;
+}
+
+#test-link {
+ margin-right: 1em;
+}
+
+#header label span {
+ color: #fff;
+ font-weight: bold;
+}
+
+#nav-buttons {
+ white-space: nowrap;
+}
+
+#nav-buttons button {
+ background: #fff;
+ border: 0;
+ border-radius: 10px;
+}
+
+#nav-buttons button:active {
+ -webkit-box-shadow: 0 0 5px #33f inset;
+ background: #aaa;
+}
+
+#nav-buttons button[disabled] {
+ opacity: .5;
+}
+
+#controls {
+ float: right;
+}
+
+#test-output {
+ border-spacing: 0;
+ border-collapse: collapse;
+ margin: 0 auto;
+ width: 100%;
+}
+
+#test-output td,
+#test-output th {
+ padding: 0;
+ vertical-align: top;
+}
+
+#image-outputs img,
+#image-outputs canvas {
+ width: 800px;
+ height: 600px;
+ border: solid 1px #ddd;
+ -webkit-user-select: none;
+ -webkit-user-drag: none;
+ cursor: crosshair;
+}
+
+#image-outputs img.loading,
+#image-outputs canvas.loading {
+ opacity: .5;
+}
+
+#image-outputs #actual-image {
+ margin: 0 1em;
+}
+
+#test-output #labels th {
+ text-align: center;
+ color: #666;
+}
+
+#text-outputs pre {
+ height: 600px;
+ width: 800px;
+ overflow: auto;
+}
+
+#test-output h2 {
+ border-bottom: solid 1px #ccc;
+ font-weight: bold;
+ margin: 0;
+ background: #eee;
+}
+
+#loupe {
+ -webkit-box-shadow: 2px 2px 5px rgba(0, 0, 0, .5);
+ position: absolute;
+ width: 634px;
+ top: 50%;
+ left: 50%;
+ margin-left: -151px;
+ margin-top: -50px;
+ background: #fff;
+ border-spacing: 0;
+ border-collapse: collapse;
+}
+
+#loupe td {
+ padding: 0;
+ border: solid 1px #ccc;
+}
+
+#loupe label {
+ color: #999;
+ padding-right: 1em;
+}
+
+#loupe span {
+ color: #000;
+ font-weight: bold;
+}
+
+#loupe canvas {
+ cursor: crosshair;
+}
+
+#loupe #loupe-close {
+ float: right;
+}
+
+#loupe #loupe-info {
+ background: #eee;
+ padding: .3em .5em;
+}
+
+#loupe #loupe-colors td {
+ text-align: center;
+}
+
+#loupe .loupe-container {
+ position: relative;
+ width: 210px;
+ height: 210px;
+}
+
+#loupe .center-highlight {
+ position: absolute;
+ width: 10px;
+ height: 10px;
+ top: 50%;
+ left: 50%;
+ margin-left: -5px;
+ margin-top: -5px;
+ outline: solid 1px #999;
+}
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js
new file mode 100644
index 0000000..fa037b3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/main.js
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+var ALL_DIRECTORY_PATH = '[all]';
+
+var results;
+var testsByFailureType = {};
+var testsByDirectory = {};
+var selectedTests = [];
+var loupe;
+
+function main()
+{
+ $('failure-type-selector').addEventListener('change', selectFailureType);
+ $('directory-selector').addEventListener('change', selectDirectory);
+ $('test-selector').addEventListener('change', selectTest);
+ $('next-test').addEventListener('click', nextTest);
+ $('previous-test').addEventListener('click', previousTest);
+
+ loupe = new Loupe();
+
+ document.addEventListener('keydown', function(event) {
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
+ return;
+ }
+
+ switch (event.keyIdentifier) {
+ case 'Left':
+ event.preventDefault();
+ previousTest();
+ break;
+ case 'Right':
+ event.preventDefault();
+ nextTest();
+ break;
+ }
+ });
+
+ loadText('/results.json', function(text) {
+ results = JSON.parse(text);
+ displayResults();
+ });
+}
+
+/**
+ * Groups test results by failure type.
+ */
+function displayResults()
+{
+ var failureTypeSelector = $('failure-type-selector');
+ var failureTypes = [];
+
+ for (var testName in results.tests) {
+ var test = results.tests[testName];
+ if (test.actual == 'PASS') {
+ continue;
+ }
+ var failureType = test.actual + ' (expected ' + test.expected + ')';
+ if (!(failureType in testsByFailureType)) {
+ testsByFailureType[failureType] = [];
+ failureTypes.push(failureType);
+ }
+ testsByFailureType[failureType].push(testName);
+ }
+
+ // Sort by number of failures
+ failureTypes.sort(function(a, b) {
+ return testsByFailureType[b].length - testsByFailureType[a].length;
+ });
+
+ for (var i = 0, failureType; failureType = failureTypes[i]; i++) {
+ var failureTypeOption = document.createElement('option');
+ failureTypeOption.value = failureType;
+ failureTypeOption.textContent = failureType + ' - ' + testsByFailureType[failureType].length + ' tests';
+ failureTypeSelector.appendChild(failureTypeOption);
+ }
+
+ selectFailureType();
+
+ document.body.classList.remove('loading');
+}
+
+/**
+ * For a given failure type, gets all the tests and groups them by directory
+ * (populating the directory selector with them).
+ */
+function selectFailureType()
+{
+ var selectedFailureType = getSelectValue('failure-type-selector');
+ var tests = testsByFailureType[selectedFailureType];
+
+ testsByDirectory = {}
+ var displayDirectoryNamesByDirectory = {};
+ var directories = [];
+
+ // Include a special option for all tests
+ testsByDirectory[ALL_DIRECTORY_PATH] = tests;
+ displayDirectoryNamesByDirectory[ALL_DIRECTORY_PATH] = 'all';
+ directories.push(ALL_DIRECTORY_PATH);
+
+ // Roll up tests by ancestor directories
+ tests.forEach(function(test) {
+ var pathPieces = test.split('/');
+ var pathDirectories = pathPieces.slice(0, pathPieces.length -1);
+ var ancestorDirectory = '';
+
+ pathDirectories.forEach(function(pathDirectory, index) {
+ ancestorDirectory += pathDirectory + '/';
+ if (!(ancestorDirectory in testsByDirectory)) {
+ testsByDirectory[ancestorDirectory] = [];
+ var displayDirectoryName = new Array(index * 6).join('&nbsp;') + pathDirectory;
+ displayDirectoryNamesByDirectory[ancestorDirectory] = displayDirectoryName;
+ directories.push(ancestorDirectory);
+ }
+
+ testsByDirectory[ancestorDirectory].push(test);
+ });
+ });
+
+ directories.sort();
+
+ var directorySelector = $('directory-selector');
+ directorySelector.innerHTML = '';
+
+ directories.forEach(function(directory) {
+ var directoryOption = document.createElement('option');
+ directoryOption.value = directory;
+ directoryOption.innerHTML =
+ displayDirectoryNamesByDirectory[directory] + ' - ' +
+ testsByDirectory[directory].length + ' tests';
+ directorySelector.appendChild(directoryOption);
+ });
+
+ selectDirectory();
+}
+
+/**
+ * For a given failure type and directory and failure type, gets all the tests
+ * in that directory and populatest the test selector with them.
+ */
+function selectDirectory()
+{
+ var selectedDirectory = getSelectValue('directory-selector');
+ selectedTests = testsByDirectory[selectedDirectory];
+
+ selectedTests.sort();
+
+ var testSelector = $('test-selector');
+ testSelector.innerHTML = '';
+
+ selectedTests.forEach(function(testName) {
+ var testOption = document.createElement('option');
+ testOption.value = testName;
+ var testDisplayName = testName;
+ if (testName.lastIndexOf(selectedDirectory) == 0) {
+ testDisplayName = testName.substring(selectedDirectory.length);
+ }
+ testOption.innerHTML = '&nbsp;&nbsp;' + testDisplayName;
+ testSelector.appendChild(testOption);
+ });
+
+ selectTest();
+}
+
+function getSelectedTest()
+{
+ return getSelectValue('test-selector');
+}
+
+function selectTest()
+{
+ var selectedTest = getSelectedTest();
+
+ if (results.tests[selectedTest].actual.indexOf('IMAGE') != -1) {
+ $('image-outputs').style.display = '';
+ displayImageResults(selectedTest);
+ } else {
+ $('image-outputs').style.display = 'none';
+ }
+
+ if (results.tests[selectedTest].actual.indexOf('TEXT') != -1) {
+ $('text-outputs').style.display = '';
+ displayTextResults(selectedTest);
+ } else {
+ $('text-outputs').style.display = 'none';
+ }
+
+ updateState();
+ loupe.hide();
+}
+
+function updateState()
+{
+ var testName = getSelectedTest();
+ var testIndex = selectedTests.indexOf(testName);
+ var testCount = selectedTests.length
+ $('test-index').textContent = testIndex + 1;
+ $('test-count').textContent = testCount;
+
+ $('next-test').disabled = testIndex == testCount - 1;
+ $('previous-test').disabled = testIndex == 0;
+
+ $('test-link').href =
+ 'http://trac.webkit.org/browser/trunk/LayoutTests/' + testName;
+}
+
+function getTestResultUrl(testName, mode)
+{
+ return '/test_result?test=' + testName + '&mode=' + mode;
+}
+
+var currentExpectedImageTest;
+var currentActualImageTest;
+
+function displayImageResults(testName)
+{
+ if (currentExpectedImageTest == currentActualImageTest
+ && currentExpectedImageTest == testName) {
+ return;
+ }
+
+ function displayImageResult(mode, callback) {
+ var image = $(mode);
+ image.className = 'loading';
+ image.src = getTestResultUrl(testName, mode);
+ image.onload = function() {
+ image.className = '';
+ callback();
+ updateImageDiff();
+ };
+ }
+
+ displayImageResult(
+ 'expected-image',
+ function() { currentExpectedImageTest = testName; });
+ displayImageResult(
+ 'actual-image',
+ function() { currentActualImageTest = testName; });
+
+ $('diff-canvas').className = 'loading';
+ $('diff-canvas').style.display = '';
+}
+
+/**
+ * Computes a graphical a diff between the expected and actual images by
+ * rendering each to a canvas, getting the image data, and comparing the RGBA
+ * components of each pixel. The output is put into the diff canvas, with
+ * identical pixels appearing at 12.5% opacity and different pixels being
+ * highlighted in red.
+ */
+function updateImageDiff() {
+ if (currentExpectedImageTest != currentActualImageTest)
+ return;
+
+ var expectedImage = $('expected-image');
+ var actualImage = $('actual-image');
+
+ function getImageData(image) {
+ var imageCanvas = document.createElement('canvas');
+ imageCanvas.width = image.width;
+ imageCanvas.height = image.height;
+ imageCanvasContext = imageCanvas.getContext('2d');
+
+ imageCanvasContext.fillStyle = 'rgba(255, 255, 255, 1)';
+ imageCanvasContext.fillRect(
+ 0, 0, image.width, image.height);
+
+ imageCanvasContext.drawImage(image, 0, 0);
+ return imageCanvasContext.getImageData(
+ 0, 0, image.width, image.height);
+ }
+
+ var expectedImageData = getImageData(expectedImage);
+ var actualImageData = getImageData(actualImage);
+
+ var diffCanvas = $('diff-canvas');
+ var diffCanvasContext = diffCanvas.getContext('2d');
+ var diffImageData =
+ diffCanvasContext.createImageData(diffCanvas.width, diffCanvas.height);
+
+ // Avoiding property lookups for all these during the per-pixel loop below
+ // provides a significant performance benefit.
+ var expectedWidth = expectedImage.width;
+ var expectedHeight = expectedImage.height;
+ var expected = expectedImageData.data;
+
+ var actualWidth = actualImage.width;
+ var actual = actualImageData.data;
+
+ var diffWidth = diffImageData.width;
+ var diff = diffImageData.data;
+
+ for (var x = 0; x < expectedWidth; x++) {
+ for (var y = 0; y < expectedHeight; y++) {
+ var expectedOffset = (y * expectedWidth + x) * 4;
+ var actualOffset = (y * actualWidth + x) * 4;
+ var diffOffset = (y * diffWidth + x) * 4;
+ if (expected[expectedOffset] != actual[actualOffset] ||
+ expected[expectedOffset + 1] != actual[actualOffset + 1] ||
+ expected[expectedOffset + 2] != actual[actualOffset + 2] ||
+ expected[expectedOffset + 3] != actual[actualOffset + 3]) {
+ diff[diffOffset] = 255;
+ diff[diffOffset + 1] = 0;
+ diff[diffOffset + 2] = 0;
+ diff[diffOffset + 3] = 255;
+ } else {
+ diff[diffOffset] = expected[expectedOffset];
+ diff[diffOffset + 1] = expected[expectedOffset + 1];
+ diff[diffOffset + 2] = expected[expectedOffset + 2];
+ diff[diffOffset + 3] = 32;
+ }
+ }
+ }
+
+ diffCanvasContext.putImageData(
+ diffImageData,
+ 0, 0,
+ 0, 0,
+ diffImageData.width, diffImageData.height);
+ diffCanvas.className = '';
+}
+
+function displayTextResults(testName)
+{
+ function loadTextResult(mode) {
+ loadText(getTestResultUrl(testName, mode), function(text) {
+ $(mode).textContent = text;
+ });
+ }
+
+ loadTextResult('expected-text');
+ loadTextResult('actual-text');
+ loadTextResult('diff-text');
+}
+
+function nextTest()
+{
+ var testSelector = $('test-selector');
+ var nextTestIndex = testSelector.selectedIndex + 1;
+ while (true) {
+ if (nextTestIndex == testSelector.options.length) {
+ return;
+ }
+ if (testSelector.options[nextTestIndex].disabled) {
+ nextTestIndex++;
+ } else {
+ testSelector.selectedIndex = nextTestIndex;
+ selectTest();
+ return;
+ }
+ }
+}
+
+function previousTest()
+{
+ var testSelector = $('test-selector');
+ var previousTestIndex = testSelector.selectedIndex - 1;
+ while (true) {
+ if (previousTestIndex == -1) {
+ return;
+ }
+ if (testSelector.options[previousTestIndex].disabled) {
+ previousTestIndex--;
+ } else {
+ testSelector.selectedIndex = previousTestIndex;
+ selectTest();
+ return
+ }
+ }
+}
+
+window.addEventListener('DOMContentLoaded', main);
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js
new file mode 100644
index 0000000..1c8782b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/data/rebaselineserver/util.js
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+var results;
+var testsByFailureType = {};
+var testsByDirectory = {};
+var selectedTests = [];
+
+function $(id)
+{
+ return document.getElementById(id);
+}
+
+function getSelectValue(id)
+{
+ var select = $(id);
+ if (select.selectedIndex == -1) {
+ return null;
+ } else {
+ return select.options[select.selectedIndex].value;
+ }
+}
+
+function loadText(url, callback)
+{
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', url);
+ xhr.addEventListener('load', function() { callback(xhr.responseText); });
+ xhr.send();
+}
diff --git a/WebKitTools/Scripts/webkitpy/commands/download.py b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
index 49a6862..457c050 100644
--- a/WebKitTools/Scripts/webkitpy/commands/download.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -29,20 +29,36 @@
import os
-from optparse import make_option
+import webkitpy.tool.steps as steps
-import webkitpy.steps as steps
+from webkitpy.common.checkout.changelog import ChangeLog, view_source_url
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
+from webkitpy.tool.commands.stepsequence import StepSequence
+from webkitpy.tool.comments import bug_comment_from_commit_text
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+from webkitpy.common.system.deprecated_logging import error, log
-from webkitpy.bugzilla import parse_bug_id
-# We could instead use from modules import buildsteps and then prefix every buildstep with "buildsteps."
-from webkitpy.changelogs import ChangeLog
-from webkitpy.commands.abstractsequencedcommand import AbstractSequencedCommand
-from webkitpy.comments import bug_comment_from_commit_text
-from webkitpy.executive import ScriptError
-from webkitpy.grammar import pluralize
-from webkitpy.webkit_logging import error, log
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-from webkitpy.stepsequence import StepSequence
+
+class Clean(AbstractSequencedCommand):
+ name = "clean"
+ help_text = "Clean the working copy"
+ steps = [
+ steps.CleanWorkingDirectory,
+ ]
+
+ def _prepare_state(self, options, args, tool):
+ options.force_clean = True
+
+
+class Update(AbstractSequencedCommand):
+ name = "update"
+ help_text = "Update working copy (used internally)"
+ steps = [
+ steps.CleanWorkingDirectory,
+ steps.Update,
+ ]
class Build(AbstractSequencedCommand):
@@ -54,6 +70,9 @@ class Build(AbstractSequencedCommand):
steps.Build,
]
+ def _prepare_state(self, options, args, tool):
+ options.build = True
+
class BuildAndTest(AbstractSequencedCommand):
name = "build-and-test"
@@ -74,22 +93,37 @@ class Land(AbstractSequencedCommand):
steps = [
steps.EnsureBuildersAreGreen,
steps.UpdateChangeLogsWithReviewer,
- steps.EnsureBuildersAreGreen,
+ steps.ValidateReviewer,
steps.Build,
steps.RunTests,
steps.Commit,
steps.CloseBugForLandDiff,
]
long_help = """land commits the current working copy diff (just as svn or git commit would).
-land will build and run the tests before committing.
+land will NOT build and run the tests before committing, but you can use the --build option for that.
If a bug id is provided, or one can be found in the ChangeLog land will update the bug after committing."""
def _prepare_state(self, options, args, tool):
+ changed_files = self._tool.scm().changed_files(options.git_commit)
return {
- "bug_id" : (args and args[0]) or parse_bug_id(tool.scm().create_patch()),
+ "changed_files": changed_files,
+ "bug_id": (args and args[0]) or tool.checkout().bug_id_for_this_commit(options.git_commit, changed_files),
}
+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.
@@ -174,6 +208,19 @@ class BuildAttachment(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
]
+class BuildAndTestAttachment(AbstractPatchSequencingCommand, ProcessAttachmentsMixin):
+ name = "build-and-test-attachment"
+ help_text = "Apply, build, and test patches from bugzilla"
+ argument_names = "ATTACHMENT_ID [ATTACHMENT_IDS]"
+ main_steps = [
+ steps.CleanWorkingDirectory,
+ steps.Update,
+ steps.ApplyPatch,
+ steps.Build,
+ steps.RunTests,
+ ]
+
+
class AbstractPatchApplyingCommand(AbstractPatchSequencingCommand):
prepare_steps = [
steps.EnsureLocalCommitIfNeeded,
@@ -209,7 +256,7 @@ class AbstractPatchLandingCommand(AbstractPatchSequencingCommand):
steps.CleanWorkingDirectory,
steps.Update,
steps.ApplyPatch,
- steps.EnsureBuildersAreGreen,
+ steps.ValidateReviewer,
steps.Build,
steps.RunTests,
steps.Commit,
@@ -240,11 +287,94 @@ class LandFromBug(AbstractPatchLandingCommand, ProcessBugsMixin):
show_in_main_help = True
-class Rollout(AbstractSequencedCommand):
+class AbstractRolloutPrepCommand(AbstractSequencedCommand):
+ argument_names = "REVISION REASON"
+
+ def _commit_info(self, revision):
+ commit_info = self._tool.checkout().commit_info_for_revision(revision)
+ if commit_info and commit_info.bug_id():
+ # Note: Don't print a bug URL here because it will confuse the
+ # SheriffBot because the SheriffBot just greps the output
+ # of create-rollout for bug URLs. It should do better
+ # parsing instead.
+ log("Preparing rollout for bug %s." % commit_info.bug_id())
+ else:
+ log("Unable to parse bug number from diff.")
+ return commit_info
+
+ def _prepare_state(self, options, args, tool):
+ revision = args[0]
+ commit_info = self._commit_info(revision)
+ cc_list = sorted([party.bugzilla_email()
+ for party in commit_info.responsible_parties()
+ if party.bugzilla_email()])
+ return {
+ "revision": revision,
+ "bug_id": commit_info.bug_id(),
+ # FIXME: We should used the list as the canonical representation.
+ "bug_cc": ",".join(cc_list),
+ "reason": args[1],
+ }
+
+
+class PrepareRollout(AbstractRolloutPrepCommand):
+ name = "prepare-rollout"
+ help_text = "Revert the given revision in the working copy and prepare ChangeLogs with revert reason"
+ long_help = """Updates the working copy.
+Applies the inverse diff for the provided revision.
+Creates an appropriate rollout ChangeLog, including a trac link and bug link.
+"""
+ steps = [
+ steps.CleanWorkingDirectory,
+ steps.Update,
+ steps.RevertRevision,
+ steps.PrepareChangeLogForRevert,
+ ]
+
+
+class CreateRollout(AbstractRolloutPrepCommand):
+ name = "create-rollout"
+ help_text = "Creates a bug to track a broken SVN revision and uploads a rollout patch."
+ steps = [
+ steps.CleanWorkingDirectory,
+ steps.Update,
+ steps.RevertRevision,
+ steps.CreateBug,
+ steps.PrepareChangeLogForRevert,
+ steps.PostDiffForRevert,
+ ]
+
+ def _prepare_state(self, options, args, tool):
+ state = AbstractRolloutPrepCommand._prepare_state(self, options, args, tool)
+ # Currently, state["bug_id"] points to the bug that caused the
+ # regression. We want to create a new bug that blocks the old bug
+ # so we move state["bug_id"] to state["bug_blocked"] and delete the
+ # old state["bug_id"] so that steps.CreateBug will actually create
+ # the new bug that we want (and subsequently store its bug id into
+ # state["bug_id"])
+ state["bug_blocked"] = state["bug_id"]
+ del state["bug_id"]
+ state["bug_title"] = "REGRESSION(r%s): %s" % (state["revision"], state["reason"])
+ state["bug_description"] = "%s broke the build:\n%s" % (view_source_url(state["revision"]), state["reason"])
+ # FIXME: If we had more context here, we could link to other open bugs
+ # that mention the test that regressed.
+ if options.parent_command == "sheriff-bot":
+ state["bug_description"] += """
+
+This is an automatic bug report generated by the sheriff-bot. If this bug
+report was created because of a flaky test, please file a bug for the flaky
+test (if we don't already have one on file) and dup this bug against that bug
+so that we can track how often these flaky tests case pain.
+
+"Only you can prevent forest fires." -- Smokey the Bear
+"""
+ return state
+
+
+class Rollout(AbstractRolloutPrepCommand):
name = "rollout"
show_in_main_help = True
help_text = "Revert the given revision in the working copy and optionally commit the revert and re-open the original bug"
- argument_names = "REVISION REASON"
long_help = """Updates the working copy.
Applies the inverse diff for the provided revision.
Creates an appropriate rollout ChangeLog, including a trac link and bug link.
@@ -258,27 +388,7 @@ Commits the revert and updates the bug (including re-opening the bug if necessar
steps.PrepareChangeLogForRevert,
steps.EditChangeLog,
steps.ConfirmDiff,
- steps.CompleteRollout,
+ steps.Build,
+ steps.Commit,
+ steps.ReopenBugAfterRollout,
]
-
- @staticmethod
- def _parse_bug_id_from_revision_diff(tool, revision):
- original_diff = tool.scm().diff_for_revision(revision)
- return parse_bug_id(original_diff)
-
- def execute(self, options, args, tool):
- revision = args[0]
- reason = args[1]
- bug_id = self._parse_bug_id_from_revision_diff(tool, revision)
- if options.complete_rollout:
- if bug_id:
- log("Will re-open bug %s after rollout." % bug_id)
- else:
- log("Failed to parse bug number from diff. No bugs will be updated/reopened after the rollout.")
-
- state = {
- "revision" : revision,
- "bug_id" : bug_id,
- "reason" : reason,
- }
- self._sequence.run_and_handle_errors(tool, options, state)
diff --git a/WebKitTools/Scripts/webkitpy/commands/download_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py
index f60c5b8..9ca343b 100644
--- a/WebKitTools/Scripts/webkitpy/commands/download_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/download_unittest.py
@@ -26,23 +26,50 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.download import *
-from webkitpy.mock import Mock
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.download import *
+from webkitpy.tool.mocktool import MockOptions, MockTool
+
+
+class AbstractRolloutPrepCommandTest(unittest.TestCase):
+ def test_commit_info(self):
+ command = AbstractRolloutPrepCommand()
+ tool = MockTool()
+ command.bind_to_tool(tool)
+ output = OutputCapture()
+
+ expected_stderr = "Preparing rollout for bug 42.\n"
+ commit_info = output.assert_outputs(self, command._commit_info, [1234], expected_stderr=expected_stderr)
+ self.assertTrue(commit_info)
+
+ mock_commit_info = Mock()
+ mock_commit_info.bug_id = lambda: None
+ tool._checkout.commit_info_for_revision = lambda revision: mock_commit_info
+ expected_stderr = "Unable to parse bug number from diff.\n"
+ commit_info = output.assert_outputs(self, command._commit_info, [1234], expected_stderr=expected_stderr)
+ self.assertEqual(commit_info, mock_commit_info)
+
class DownloadCommandsTest(CommandsTest):
def _default_options(self):
- options = Mock()
- options.force_clean = False
- options.clean = True
+ options = MockOptions()
+ options.build = True
+ options.build_style = True
options.check_builders = True
- options.quiet = False
+ options.check_style = True
+ options.clean = True
+ options.close_bug = True
+ options.force_clean = False
+ options.force_patch = True
options.non_interactive = False
- options.update = True
- options.build = True
+ options.parent_command = 'MOCK parent command'
+ options.quiet = False
options.test = True
- options.close_bug = True
- options.complete_rollout = False
+ options.update = True
return options
def test_build(self):
@@ -68,8 +95,20 @@ class DownloadCommandsTest(CommandsTest):
self.assert_execute_outputs(ApplyFromBug(), [42], options=options, expected_stderr=expected_stderr)
def test_land_diff(self):
- expected_stderr = "Building WebKit\nRunning Python unit tests\nRunning Perl unit tests\nRunning JavaScriptCore tests\nRunning run-webkit-tests\nUpdating bug 42\n"
- self.assert_execute_outputs(Land(), [42], options=self._default_options(), expected_stderr=expected_stderr)
+ expected_stderr = "Building WebKit\nRunning Python unit tests\nRunning Perl unit tests\nRunning JavaScriptCore tests\nRunning run-webkit-tests\nCommitted r49824: <http://trac.webkit.org/changeset/49824>\nUpdating bug 42\n"
+ mock_tool = MockTool()
+ mock_tool.scm().create_patch = Mock()
+ mock_tool.checkout().modified_changelogs = Mock(return_value=[])
+ self.assert_execute_outputs(Land(), [42], options=self._default_options(), expected_stderr=expected_stderr, tool=mock_tool)
+ # Make sure we're not calling expensive calls too often.
+ self.assertEqual(mock_tool.scm().create_patch.call_count, 0)
+ self.assertEqual(mock_tool.checkout().modified_changelogs.call_count, 1)
+
+ def test_land_red_builders(self):
+ expected_stderr = '\nWARNING: Builders ["Builder2"] are red, please watch your commit carefully.\nSee http://dummy_buildbot_host/console?category=core\n\nBuilding WebKit\nRunning Python unit tests\nRunning Perl unit tests\nRunning JavaScriptCore tests\nRunning run-webkit-tests\nCommitted r49824: <http://trac.webkit.org/changeset/49824>\nUpdating bug 42\n'
+ mock_tool = MockTool()
+ mock_tool.buildbot.light_tree_on_fire()
+ self.assert_execute_outputs(Land(), [42], options=self._default_options(), expected_stderr=expected_stderr, tool=mock_tool)
def test_check_style(self):
expected_stderr = "Processing 1 patch from 1 bug.\nUpdating working directory\nProcessing patch 197 from bug 42.\nRunning check-webkit-style\n"
@@ -89,6 +128,7 @@ Running Python unit tests
Running Perl unit tests
Running JavaScriptCore tests
Running run-webkit-tests
+Committed r49824: <http://trac.webkit.org/changeset/49824>
Not closing bug 42 as attachment 197 has review=+. Assuming there are more patches to land from this bug.
"""
self.assert_execute_outputs(LandAttachment(), [197], options=self._default_options(), expected_stderr=expected_stderr)
@@ -104,6 +144,7 @@ Running Python unit tests
Running Perl unit tests
Running JavaScriptCore tests
Running run-webkit-tests
+Committed r49824: <http://trac.webkit.org/changeset/49824>
Not closing bug 42 as attachment 197 has review=+. Assuming there are more patches to land from this bug.
Updating working directory
Processing patch 128 from bug 42.
@@ -112,16 +153,38 @@ Running Python unit tests
Running Perl unit tests
Running JavaScriptCore tests
Running run-webkit-tests
+Committed r49824: <http://trac.webkit.org/changeset/49824>
Not closing bug 42 as attachment 197 has review=+. Assuming there are more patches to land from this bug.
"""
self.assert_execute_outputs(LandFromBug(), [42], options=self._default_options(), expected_stderr=expected_stderr)
+ def test_prepare_rollout(self):
+ expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\nRunning prepare-ChangeLog\n"
+ self.assert_execute_outputs(PrepareRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+
+ def test_create_rollout(self):
+ expected_stderr = """Preparing rollout for bug 42.
+Updating working directory
+MOCK create_bug
+bug_title: REGRESSION(r852): Reason
+bug_description: http://trac.webkit.org/changeset/852 broke the build:
+Reason
+Running prepare-ChangeLog
+MOCK add_patch_to_bug: bug_id=None, description=ROLLOUT of r852, mark_for_review=False, mark_for_commit_queue=True, mark_for_landing=False
+-- Begin comment --
+Any committer can land this patch automatically by marking it commit-queue+. The commit-queue will build and test the patch before landing to ensure that the rollout will be successful. This process takes approximately 15 minutes.
+
+If you would like to land the rollout faster, you can use the following command:
+
+ webkit-patch land-attachment ATTACHMENT_ID --ignore-builders
+
+where ATTACHMENT_ID is the ID of this attachment.
+-- End comment --
+"""
+ self.assert_execute_outputs(CreateRollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+
def test_rollout(self):
- expected_stderr = "Updating working directory\nRunning prepare-ChangeLog\n\nNOTE: Rollout support is experimental.\nPlease verify the rollout diff and use \"webkit-patch land 12345\" to commit the rollout.\n"
- self.assert_execute_outputs(Rollout(), [852, "Reason"], options=self._default_options(), expected_stderr=expected_stderr)
+ expected_stderr = "Preparing rollout for bug 42.\nUpdating working directory\nRunning prepare-ChangeLog\nMOCK: user.open_url: file://...\nBuilding WebKit\nCommitted r49824: <http://trac.webkit.org/changeset/49824>\n"
+ expected_stdout = "Was that diff correct?\n"
+ self.assert_execute_outputs(Rollout(), [852, "Reason"], options=self._default_options(), expected_stdout=expected_stdout, expected_stderr=expected_stderr)
- def test_complete_rollout(self):
- options = self._default_options()
- options.complete_rollout = True
- expected_stderr = "Will re-open bug 12345 after rollout.\nUpdating working directory\nRunning prepare-ChangeLog\nBuilding WebKit\n"
- self.assert_execute_outputs(Rollout(), [852, "Reason"], options=options, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/commands/early_warning_system.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
index e3e14dd..3b53d1a 100644
--- a/WebKitTools/Scripts/webkitpy/commands/early_warning_system.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
@@ -1,5 +1,4 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -27,13 +26,11 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from StringIO import StringIO
-
-from webkitpy.commands.queues import AbstractReviewQueue
-from webkitpy.committers import CommitterList
-from webkitpy.executive import ScriptError
-from webkitpy.webkitport import WebKitPort
-from webkitpy.queueengine import QueueEngine
+from webkitpy.tool.commands.queues import AbstractReviewQueue
+from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.config.ports import WebKitPort
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.bot.queueengine import QueueEngine
class AbstractEarlyWarningSystem(AbstractReviewQueue):
@@ -44,30 +41,58 @@ class AbstractEarlyWarningSystem(AbstractReviewQueue):
self.port = WebKitPort.port(self.port_name)
def should_proceed_with_work_item(self, patch):
+ return True
+
+ def _can_build(self):
try:
self.run_webkit_patch([
"build",
self.port.flag(),
"--build-style=%s" % self._build_style,
"--force-clean",
- "--quiet"])
- self._update_status("Building", patch)
+ "--no-update"])
+ return True
except ScriptError, e:
- self._update_status("Unable to perform a build")
+ failure_log = self._log_from_script_error_for_upload(e)
+ self._update_status("Unable to perform a build", results_file=failure_log)
return False
- return True
- def _review_patch(self, patch):
- self.run_webkit_patch([
- "build-attachment",
- self.port.flag(),
- "--build-style=%s" % self._build_style,
- "--force-clean",
- "--quiet",
- "--non-interactive",
- "--parent-command=%s" % self.name,
- "--no-update",
- patch.id()])
+ def _build(self, patch, first_run=False):
+ try:
+ args = [
+ "build-attachment",
+ self.port.flag(),
+ "--build",
+ "--build-style=%s" % self._build_style,
+ "--force-clean",
+ "--quiet",
+ "--non-interactive",
+ patch.id()]
+ if not first_run:
+ # See commit-queue for an explanation of what we're doing here.
+ args.append("--no-update")
+ args.append("--parent-command=%s" % self.name)
+ self.run_webkit_patch(args)
+ return True
+ except ScriptError, e:
+ if first_run:
+ return False
+ raise
+
+ def review_patch(self, patch):
+ if patch.is_obsolete():
+ self._did_error(patch, "%s does not process obsolete patches." % self.name)
+ return False
+
+ if patch.bug().is_closed():
+ self._did_error(patch, "%s does not process patches on closed bugs." % self.name)
+ return False
+
+ if not self._build(patch, first_run=True):
+ if not self._can_build():
+ return False
+ self._build(patch)
+ return True
@classmethod
def handle_script_error(cls, tool, state, script_error):
@@ -90,19 +115,46 @@ class GtkEWS(AbstractEarlyWarningSystem):
]
+class EflEWS(AbstractEarlyWarningSystem):
+ name = "efl-ews"
+ port_name = "efl"
+ watchers = AbstractEarlyWarningSystem.watchers + [
+ "leandro@profusion.mobi",
+ "antognolli@profusion.mobi",
+ "lucas.demarchi@profusion.mobi",
+ ]
+
+
class QtEWS(AbstractEarlyWarningSystem):
name = "qt-ews"
port_name = "qt"
-class ChromiumEWS(AbstractEarlyWarningSystem):
- name = "chromium-ews"
+class WinEWS(AbstractEarlyWarningSystem):
+ name = "win-ews"
+ port_name = "win"
+ # Use debug, the Apple Win port fails to link Release on 32-bit Windows.
+ # https://bugs.webkit.org/show_bug.cgi?id=39197
+ _build_style = "debug"
+
+
+class AbstractChromiumEWS(AbstractEarlyWarningSystem):
port_name = "chromium"
watchers = AbstractEarlyWarningSystem.watchers + [
"dglazkov@chromium.org",
]
+class ChromiumLinuxEWS(AbstractChromiumEWS):
+ # FIXME: We should rename this command to cr-linux-ews, but that requires
+ # a database migration. :(
+ name = "chromium-ews"
+
+
+class ChromiumWindowsEWS(AbstractChromiumEWS):
+ name = "cr-win-ews"
+
+
# For platforms that we can't run inside a VM (like Mac OS X), we require
# patches to be uploaded by committers, who are generally trustworthy folk. :)
class AbstractCommitterOnlyEWS(AbstractEarlyWarningSystem):
@@ -113,8 +165,16 @@ class AbstractCommitterOnlyEWS(AbstractEarlyWarningSystem):
def process_work_item(self, patch):
if not self._committers.committer_by_email(patch.attacher_email()):
self._did_error(patch, "%s cannot process patches from non-committers :(" % self.name)
- return
- AbstractEarlyWarningSystem.process_work_item(self, patch)
+ return False
+ return AbstractEarlyWarningSystem.process_work_item(self, patch)
+
+
+# FIXME: Inheriting from AbstractCommitterOnlyEWS is kinda a hack, but it
+# happens to work because AbstractChromiumEWS and AbstractCommitterOnlyEWS
+# provide disjoint sets of functionality, and Python is otherwise smart
+# enough to handle the diamond inheritance.
+class ChromiumMacEWS(AbstractChromiumEWS, AbstractCommitterOnlyEWS):
+ name = "cr-mac-ews"
class MacEWS(AbstractCommitterOnlyEWS):
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
new file mode 100644
index 0000000..830e11c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
@@ -0,0 +1,132 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.bot.queueengine import QueueEngine
+from webkitpy.tool.commands.earlywarningsystem import *
+from webkitpy.tool.commands.queuestest import QueuesTest
+from webkitpy.tool.mocktool import MockTool, MockOptions
+
+
+class AbstractEarlyWarningSystemTest(QueuesTest):
+ def test_can_build(self):
+ # Needed to define port_name, used in AbstractEarlyWarningSystem.__init__
+ class TestEWS(AbstractEarlyWarningSystem):
+ port_name = "win" # Needs to be a port which port/factory understands.
+
+ queue = TestEWS()
+ queue.bind_to_tool(MockTool(log_executive=True))
+ queue._options = MockOptions(port=None)
+ expected_stderr = "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--port=win', '--build-style=release', '--force-clean', '--no-update']\n"
+ OutputCapture().assert_outputs(self, queue._can_build, [], expected_stderr=expected_stderr)
+
+ def mock_run_webkit_patch(args):
+ raise ScriptError("MOCK script error")
+
+ queue.run_webkit_patch = mock_run_webkit_patch
+ expected_stderr = "MOCK: update_status: None Unable to perform a build\n"
+ OutputCapture().assert_outputs(self, queue._can_build, [], expected_stderr=expected_stderr)
+
+ # FIXME: This belongs on an AbstractReviewQueueTest object in queues_unittest.py
+ def test_subprocess_handled_error(self):
+ queue = AbstractReviewQueue()
+ queue.bind_to_tool(MockTool())
+
+ def mock_review_patch(patch):
+ raise ScriptError('MOCK script error', exit_code=QueueEngine.handled_error_code)
+
+ queue.review_patch = mock_review_patch
+ mock_patch = queue._tool.bugs.fetch_attachment(197)
+ expected_stderr = "MOCK: release_work_item: None 197\n"
+ OutputCapture().assert_outputs(self, queue.process_work_item, [mock_patch], expected_stderr=expected_stderr, expected_exception=ScriptError)
+
+
+class EarlyWarningSytemTest(QueuesTest):
+ def test_failed_builds(self):
+ ews = ChromiumLinuxEWS()
+ ews.bind_to_tool(MockTool())
+ ews._build = lambda patch, first_run=False: False
+ ews._can_build = lambda: True
+ mock_patch = ews._tool.bugs.fetch_attachment(197)
+ ews.review_patch(mock_patch)
+
+ def _default_expected_stderr(self, ews):
+ string_replacemnts = {
+ "name": ews.name,
+ "port": ews.port_name,
+ "watchers": ews.watchers,
+ }
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr(ews.name, ews._tool.scm().checkout_root),
+ "handle_unexpected_error": "Mock error message\n",
+ "next_work_item": "",
+ "process_work_item": "MOCK: update_status: %(name)s Pass\nMOCK: release_work_item: %(name)s 197\n" % string_replacemnts,
+ "handle_script_error": "MOCK: update_status: %(name)s ScriptError error message\nMOCK bug comment: bug_id=42, cc=%(watchers)s\n--- Begin comment ---\nAttachment 197 did not build on %(port)s:\nBuild output: http://dummy_url\n--- End comment ---\n\n" % string_replacemnts,
+ }
+ return expected_stderr
+
+ def _test_ews(self, ews):
+ ews.bind_to_tool(MockTool())
+ expected_exceptions = {
+ "handle_script_error": SystemExit,
+ }
+ self.assert_queue_outputs(ews, expected_stderr=self._default_expected_stderr(ews), expected_exceptions=expected_exceptions)
+
+ def _test_committer_only_ews(self, ews):
+ ews.bind_to_tool(MockTool())
+ expected_stderr = self._default_expected_stderr(ews)
+ string_replacemnts = {"name": ews.name}
+ expected_stderr["process_work_item"] = "MOCK: update_status: %(name)s Error: %(name)s cannot process patches from non-committers :(\nMOCK: release_work_item: %(name)s 197\n" % string_replacemnts
+ expected_exceptions = {"handle_script_error": SystemExit}
+ self.assert_queue_outputs(ews, expected_stderr=expected_stderr, expected_exceptions=expected_exceptions)
+
+ # FIXME: If all EWSes are going to output the same text, we
+ # could test them all in one method with a for loop over an array.
+ def test_chromium_linux_ews(self):
+ self._test_ews(ChromiumLinuxEWS())
+
+ def test_chromium_windows_ews(self):
+ self._test_ews(ChromiumWindowsEWS())
+
+ def test_qt_ews(self):
+ self._test_ews(QtEWS())
+
+ def test_gtk_ews(self):
+ self._test_ews(GtkEWS())
+
+ def test_efl_ews(self):
+ self._test_ews(EflEWS())
+
+ def test_mac_ews(self):
+ self._test_committer_only_ews(MacEWS())
+
+ def test_chromium_mac_ews(self):
+ self._test_committer_only_ews(ChromiumMacEWS())
diff --git a/WebKitTools/Scripts/webkitpy/commands/openbugs.py b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py
index 25bdefc..1b51c9f 100644
--- a/WebKitTools/Scripts/webkitpy/commands/openbugs.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs.py
@@ -29,8 +29,8 @@
import re
import sys
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-from webkitpy.webkit_logging import log
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+from webkitpy.common.system.deprecated_logging import log
class OpenBugs(AbstractDeclarativeCommand):
@@ -41,8 +41,8 @@ class OpenBugs(AbstractDeclarativeCommand):
def _open_bugs(self, bug_ids):
for bug_id in bug_ids:
- bug_url = self.tool.bugs.bug_url_for_bug_id(bug_id)
- self.tool.user.open_url(bug_url)
+ bug_url = self._tool.bugs.bug_url_for_bug_id(bug_id)
+ self._tool.user.open_url(bug_url)
# _find_bugs_in_string mostly exists for easy unit testing.
def _find_bugs_in_string(self, string):
diff --git a/WebKitTools/Scripts/webkitpy/commands/openbugs_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs_unittest.py
index 71fefd2..40a6e1b 100644
--- a/WebKitTools/Scripts/webkitpy/commands/openbugs_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/openbugs_unittest.py
@@ -26,8 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.openbugs import OpenBugs
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.openbugs import OpenBugs
class OpenBugsTest(CommandsTest):
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/plain_wsh.py b/WebKitTools/Scripts/webkitpy/tool/commands/prettydiff.py
index db3ff69..e3fc00c 100644
--- a/WebKitTools/pywebsocket/test/testdata/handlers/sub/plain_wsh.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/prettydiff.py
@@ -1,5 +1,4 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
+# Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -27,14 +26,13 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
+import webkitpy.tool.steps as steps
-def web_socket_do_extra_handshake(request):
- pass
-
-def web_socket_transfer_data(request):
- request.connection.write('sub/plain_wsh.py is called for %s, %s' %
- (request.ws_resource, request.ws_protocol))
-
-
-# vi:sts=4 sw=4 et
+class PrettyDiff(AbstractSequencedCommand):
+ name = "pretty-diff"
+ help_text = "Shows the pretty diff in the default browser"
+ steps = [
+ steps.ConfirmDiff,
+ ]
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queries.py b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
new file mode 100644
index 0000000..16ddc2c
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queries.py
@@ -0,0 +1,393 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+from optparse import make_option
+
+import webkitpy.tool.steps as steps
+
+from webkitpy.common.checkout.commitinfo import CommitInfo
+from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.net.buildbot import BuildBot
+from webkitpy.common.net.regressionwindow import RegressionWindow
+from webkitpy.common.system.user import User
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.layout_tests import port
+
+
+class SuggestReviewers(AbstractDeclarativeCommand):
+ name = "suggest-reviewers"
+ help_text = "Suggest reviewers for a patch based on recent changes to the modified files."
+
+ def __init__(self):
+ options = [
+ steps.Options.git_commit,
+ ]
+ AbstractDeclarativeCommand.__init__(self, options=options)
+
+ def execute(self, options, args, tool):
+ reviewers = tool.checkout().suggested_reviewers(options.git_commit)
+ print "\n".join([reviewer.full_name for reviewer in reviewers])
+
+
+class BugsToCommit(AbstractDeclarativeCommand):
+ name = "bugs-to-commit"
+ help_text = "List bugs in the commit-queue"
+
+ def execute(self, options, args, tool):
+ # FIXME: This command is poorly named. It's fetching the commit-queue list here. The name implies it's fetching pending-commit (all r+'d patches).
+ bug_ids = tool.bugs.queries.fetch_bug_ids_from_commit_queue()
+ for bug_id in bug_ids:
+ print "%s" % bug_id
+
+
+class PatchesInCommitQueue(AbstractDeclarativeCommand):
+ name = "patches-in-commit-queue"
+ help_text = "List patches in the commit-queue"
+
+ def execute(self, options, args, tool):
+ patches = tool.bugs.queries.fetch_patches_from_commit_queue()
+ log("Patches in commit queue:")
+ for patch in patches:
+ print patch.url()
+
+
+class PatchesToCommitQueue(AbstractDeclarativeCommand):
+ name = "patches-to-commit-queue"
+ help_text = "Patches which should be added to the commit queue"
+ def __init__(self):
+ options = [
+ make_option("--bugs", action="store_true", dest="bugs", help="Output bug links instead of patch links"),
+ ]
+ AbstractDeclarativeCommand.__init__(self, options=options)
+
+ @staticmethod
+ def _needs_commit_queue(patch):
+ if patch.commit_queue() == "+": # If it's already cq+, ignore the patch.
+ log("%s already has cq=%s" % (patch.id(), patch.commit_queue()))
+ return False
+
+ # We only need to worry about patches from contributers who are not yet committers.
+ committer_record = CommitterList().committer_by_email(patch.attacher_email())
+ if committer_record:
+ log("%s committer = %s" % (patch.id(), committer_record))
+ return not committer_record
+
+ def execute(self, options, args, tool):
+ patches = tool.bugs.queries.fetch_patches_from_pending_commit_list()
+ patches_needing_cq = filter(self._needs_commit_queue, patches)
+ if options.bugs:
+ bugs_needing_cq = map(lambda patch: patch.bug_id(), patches_needing_cq)
+ bugs_needing_cq = sorted(set(bugs_needing_cq))
+ for bug_id in bugs_needing_cq:
+ print "%s" % tool.bugs.bug_url_for_bug_id(bug_id)
+ else:
+ for patch in patches_needing_cq:
+ print "%s" % tool.bugs.attachment_url_for_id(patch.id(), action="edit")
+
+
+class PatchesToReview(AbstractDeclarativeCommand):
+ name = "patches-to-review"
+ help_text = "List patches that are pending review"
+
+ def execute(self, options, args, tool):
+ patch_ids = tool.bugs.queries.fetch_attachment_ids_from_review_queue()
+ log("Patches pending review:")
+ for patch_id in patch_ids:
+ print patch_id
+
+
+class LastGreenRevision(AbstractDeclarativeCommand):
+ name = "last-green-revision"
+ help_text = "Prints the last known good revision"
+
+ def execute(self, options, args, tool):
+ print self._tool.buildbot.last_green_revision()
+
+
+class WhatBroke(AbstractDeclarativeCommand):
+ name = "what-broke"
+ help_text = "Print failing buildbots (%s) and what revisions broke them" % BuildBot.default_host
+
+ def _print_builder_line(self, builder_name, max_name_width, status_message):
+ print "%s : %s" % (builder_name.ljust(max_name_width), status_message)
+
+ def _print_blame_information_for_builder(self, builder_status, name_width, avoid_flakey_tests=True):
+ builder = self._tool.buildbot.builder_with_name(builder_status["name"])
+ red_build = builder.build(builder_status["build_number"])
+ regression_window = builder.find_regression_window(red_build)
+ if not regression_window.failing_build():
+ self._print_builder_line(builder.name(), name_width, "FAIL (error loading build information)")
+ return
+ if not regression_window.build_before_failure():
+ self._print_builder_line(builder.name(), name_width, "FAIL (blame-list: sometime before %s?)" % regression_window.failing_build().revision())
+ return
+
+ revisions = regression_window.revisions()
+ first_failure_message = ""
+ if (regression_window.failing_build() == builder.build(builder_status["build_number"])):
+ first_failure_message = " FIRST FAILURE, possibly a flaky test"
+ self._print_builder_line(builder.name(), name_width, "FAIL (blame-list: %s%s)" % (revisions, first_failure_message))
+ for revision in revisions:
+ commit_info = self._tool.checkout().commit_info_for_revision(revision)
+ if commit_info:
+ print commit_info.blame_string(self._tool.bugs)
+ else:
+ print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
+
+ def execute(self, options, args, tool):
+ builder_statuses = tool.buildbot.builder_statuses()
+ longest_builder_name = max(map(len, map(lambda builder: builder["name"], builder_statuses)))
+ failing_builders = 0
+ for builder_status in builder_statuses:
+ # If the builder is green, print OK, exit.
+ if builder_status["is_green"]:
+ continue
+ self._print_blame_information_for_builder(builder_status, name_width=longest_builder_name)
+ failing_builders += 1
+ if failing_builders:
+ print "%s of %s are failing" % (failing_builders, pluralize("builder", len(builder_statuses)))
+ else:
+ print "All builders are passing!"
+
+
+class ResultsFor(AbstractDeclarativeCommand):
+ name = "results-for"
+ help_text = "Print a list of failures for the passed revision from bots on %s" % BuildBot.default_host
+ argument_names = "REVISION"
+
+ def _print_layout_test_results(self, results):
+ if not results:
+ print " No results."
+ return
+ for title, files in results.parsed_results().items():
+ print " %s" % title
+ for filename in files:
+ print " %s" % filename
+
+ def execute(self, options, args, tool):
+ builders = self._tool.buildbot.builders()
+ for builder in builders:
+ print "%s:" % builder.name()
+ build = builder.build_for_revision(args[0], allow_failed_lookups=True)
+ self._print_layout_test_results(build.layout_test_results())
+
+
+class FailureReason(AbstractDeclarativeCommand):
+ name = "failure-reason"
+ help_text = "Lists revisions where individual test failures started at %s" % BuildBot.default_host
+
+ def _blame_line_for_revision(self, revision):
+ try:
+ commit_info = self._tool.checkout().commit_info_for_revision(revision)
+ except Exception, e:
+ return "FAILED to fetch CommitInfo for r%s, exception: %s" % (revision, e)
+ if not commit_info:
+ return "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
+ return commit_info.blame_string(self._tool.bugs)
+
+ def _print_blame_information_for_transition(self, regression_window, failing_tests):
+ red_build = regression_window.failing_build()
+ print "SUCCESS: Build %s (r%s) was the first to show failures: %s" % (red_build._number, red_build.revision(), failing_tests)
+ print "Suspect revisions:"
+ for revision in regression_window.revisions():
+ print self._blame_line_for_revision(revision)
+
+ def _explain_failures_for_builder(self, builder, start_revision):
+ print "Examining failures for \"%s\", starting at r%s" % (builder.name(), start_revision)
+ revision_to_test = start_revision
+ build = builder.build_for_revision(revision_to_test, allow_failed_lookups=True)
+ layout_test_results = build.layout_test_results()
+ if not layout_test_results:
+ # FIXME: This could be made more user friendly.
+ print "Failed to load layout test results; can't continue. (start revision = r%s)" % start_revision
+ return 1
+
+ results_to_explain = set(layout_test_results.failing_tests())
+ last_build_with_results = build
+ print "Starting at %s" % revision_to_test
+ while results_to_explain:
+ revision_to_test -= 1
+ new_build = builder.build_for_revision(revision_to_test, allow_failed_lookups=True)
+ if not new_build:
+ print "No build for %s" % revision_to_test
+ continue
+ build = new_build
+ latest_results = build.layout_test_results()
+ if not latest_results:
+ print "No results build %s (r%s)" % (build._number, build.revision())
+ continue
+ failures = set(latest_results.failing_tests())
+ if len(failures) >= 20:
+ # FIXME: We may need to move this logic into the LayoutTestResults class.
+ # The buildbot stops runs after 20 failures so we don't have full results to work with here.
+ print "Too many failures in build %s (r%s), ignoring." % (build._number, build.revision())
+ continue
+ fixed_results = results_to_explain - failures
+ if not fixed_results:
+ print "No change in build %s (r%s), %s unexplained failures (%s in this build)" % (build._number, build.revision(), len(results_to_explain), len(failures))
+ last_build_with_results = build
+ continue
+ regression_window = RegressionWindow(build, last_build_with_results)
+ self._print_blame_information_for_transition(regression_window, fixed_results)
+ last_build_with_results = build
+ results_to_explain -= fixed_results
+ if results_to_explain:
+ print "Failed to explain failures: %s" % results_to_explain
+ return 1
+ print "Explained all results for %s" % builder.name()
+ return 0
+
+ def _builder_to_explain(self):
+ builder_statuses = self._tool.buildbot.builder_statuses()
+ red_statuses = [status for status in builder_statuses if not status["is_green"]]
+ print "%s failing" % (pluralize("builder", len(red_statuses)))
+ builder_choices = [status["name"] for status in red_statuses]
+ # We could offer an "All" choice here.
+ chosen_name = User.prompt_with_list("Which builder to diagnose:", builder_choices)
+ # FIXME: prompt_with_list should really take a set of objects and a set of names and then return the object.
+ for status in red_statuses:
+ if status["name"] == chosen_name:
+ return (self._tool.buildbot.builder_with_name(chosen_name), status["built_revision"])
+
+ def execute(self, options, args, tool):
+ (builder, latest_revision) = self._builder_to_explain()
+ start_revision = self._tool.user.prompt("Revision to walk backwards from? [%s] " % latest_revision) or latest_revision
+ if not start_revision:
+ print "Revision required."
+ return 1
+ return self._explain_failures_for_builder(builder, start_revision=int(start_revision))
+
+
+class FindFlakyTests(AbstractDeclarativeCommand):
+ name = "find-flaky-tests"
+ help_text = "Lists tests that often fail for a single build at %s" % BuildBot.default_host
+
+ def _find_failures(self, builder, revision):
+ build = builder.build_for_revision(revision, allow_failed_lookups=True)
+ if not build:
+ print "No build for %s" % revision
+ return (None, None)
+ results = build.layout_test_results()
+ if not results:
+ print "No results build %s (r%s)" % (build._number, build.revision())
+ return (None, None)
+ failures = set(results.failing_tests())
+ if len(failures) >= 20:
+ # FIXME: We may need to move this logic into the LayoutTestResults class.
+ # The buildbot stops runs after 20 failures so we don't have full results to work with here.
+ print "Too many failures in build %s (r%s), ignoring." % (build._number, build.revision())
+ return (None, None)
+ return (build, failures)
+
+ def _increment_statistics(self, flaky_tests, flaky_test_statistics):
+ for test in flaky_tests:
+ count = flaky_test_statistics.get(test, 0)
+ flaky_test_statistics[test] = count + 1
+
+ def _print_statistics(self, statistics):
+ print "=== Results ==="
+ print "Occurances Test name"
+ for value, key in sorted([(value, key) for key, value in statistics.items()]):
+ print "%10d %s" % (value, key)
+
+ def _walk_backwards_from(self, builder, start_revision, limit):
+ flaky_test_statistics = {}
+ all_previous_failures = set([])
+ one_time_previous_failures = set([])
+ previous_build = None
+ for i in range(limit):
+ revision = start_revision - i
+ print "Analyzing %s ... " % revision,
+ (build, failures) = self._find_failures(builder, revision)
+ if failures == None:
+ # Notice that we don't loop on the empty set!
+ continue
+ print "has %s failures" % len(failures)
+ flaky_tests = one_time_previous_failures - failures
+ if flaky_tests:
+ print "Flaky tests: %s %s" % (sorted(flaky_tests),
+ previous_build.results_url())
+ self._increment_statistics(flaky_tests, flaky_test_statistics)
+ one_time_previous_failures = failures - all_previous_failures
+ all_previous_failures = failures
+ previous_build = build
+ self._print_statistics(flaky_test_statistics)
+
+ def _builder_to_analyze(self):
+ statuses = self._tool.buildbot.builder_statuses()
+ choices = [status["name"] for status in statuses]
+ chosen_name = User.prompt_with_list("Which builder to analyze:", choices)
+ for status in statuses:
+ if status["name"] == chosen_name:
+ return (self._tool.buildbot.builder_with_name(chosen_name), status["built_revision"])
+
+ def execute(self, options, args, tool):
+ (builder, latest_revision) = self._builder_to_analyze()
+ limit = self._tool.user.prompt("How many revisions to look through? [10000] ") or 10000
+ return self._walk_backwards_from(builder, latest_revision, limit=int(limit))
+
+
+class TreeStatus(AbstractDeclarativeCommand):
+ name = "tree-status"
+ help_text = "Print the status of the %s buildbots" % BuildBot.default_host
+ long_help = """Fetches build status from http://build.webkit.org/one_box_per_builder
+and displayes the status of each builder."""
+
+ def execute(self, options, args, tool):
+ for builder in tool.buildbot.builder_statuses():
+ status_string = "ok" if builder["is_green"] else "FAIL"
+ print "%s : %s" % (status_string.ljust(4), builder["name"])
+
+
+class SkippedPorts(AbstractDeclarativeCommand):
+ name = "skipped-ports"
+ help_text = "Print the list of ports skipping the given layout test(s)"
+ long_help = """Scans the the Skipped file of each port and figure
+out what ports are skipping the test(s). Categories are taken in account too."""
+ argument_names = "TEST_NAME"
+
+ def execute(self, options, args, tool):
+ class Options:
+ # Required for chromium port.
+ use_drt = True
+
+ results = dict([(test_name, []) for test_name in args])
+ for port_name, port_object in tool.port_factory.get_all(options=Options).iteritems():
+ for test_name in args:
+ if port_object.skips_layout_test(test_name):
+ results[test_name].append(port_name)
+
+ for test_name, ports in results.iteritems():
+ if ports:
+ print "Ports skipping test %r: %s" % (test_name, ', '.join(ports))
+ else:
+ print "Test %r is not skipped by any port." % test_name
diff --git a/WebKitTools/Scripts/webkitpy/commands/queries_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py
index b858777..05a4a5c 100644
--- a/WebKitTools/Scripts/webkitpy/commands/queries_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queries_unittest.py
@@ -26,11 +26,14 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.bugzilla import Bugzilla
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.queries import *
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
+import unittest
+
+from webkitpy.common.net.bugzilla import Bugzilla
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.queries import *
+from webkitpy.tool.mocktool import MockTool
+
class QueryCommandsTest(CommandsTest):
def test_bugs_to_commit(self):
@@ -61,3 +64,27 @@ class QueryCommandsTest(CommandsTest):
def test_tree_status(self):
expected_stdout = "ok : Builder1\nok : Builder2\n"
self.assert_execute_outputs(TreeStatus(), None, expected_stdout)
+
+ def test_skipped_ports(self):
+ expected_stdout = "Ports skipping test 'media/foo/bar.html': test_port1, test_port2\n"
+ self.assert_execute_outputs(SkippedPorts(), ("media/foo/bar.html",), expected_stdout)
+
+ expected_stdout = "Ports skipping test 'foo': test_port1\n"
+ self.assert_execute_outputs(SkippedPorts(), ("foo",), expected_stdout)
+
+ expected_stdout = "Test 'media' is not skipped by any port.\n"
+ self.assert_execute_outputs(SkippedPorts(), ("media",), expected_stdout)
+
+
+class FailureReasonTest(unittest.TestCase):
+ def test_blame_line_for_revision(self):
+ tool = MockTool()
+ command = FailureReason()
+ command.bind_to_tool(tool)
+ # This is an artificial example, mostly to test the CommitInfo lookup failure case.
+ self.assertEquals(command._blame_line_for_revision(None), "FAILED to fetch CommitInfo for rNone, likely missing ChangeLog")
+
+ def raising_mock(self):
+ raise Exception("MESSAGE")
+ tool.checkout().commit_info_for_revision = raising_mock
+ self.assertEquals(command._blame_line_for_revision(None), "FAILED to fetch CommitInfo for rNone, exception: MESSAGE")
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
new file mode 100644
index 0000000..bfaeb08
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -0,0 +1,417 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from __future__ import with_statement
+
+import codecs
+import time
+import traceback
+import os
+
+from datetime import datetime
+from optparse import make_option
+from StringIO import StringIO
+
+from webkitpy.common.config.committervalidator import CommitterValidator
+from webkitpy.common.net.bugzilla import Attachment
+from webkitpy.common.net.layouttestresults import path_for_layout_test, LayoutTestResults
+from webkitpy.common.net.statusserver import StatusServer
+from webkitpy.common.system.deprecated_logging import error, log
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.bot.commitqueuetask import CommitQueueTask, CommitQueueTaskDelegate
+from webkitpy.tool.bot.feeders import CommitQueueFeeder, EWSFeeder
+from webkitpy.tool.bot.queueengine import QueueEngine, QueueEngineDelegate
+from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
+from webkitpy.tool.grammar import pluralize, join_with_separators
+from webkitpy.tool.multicommandtool import Command, TryAgain
+
+
+class AbstractQueue(Command, QueueEngineDelegate):
+ watchers = [
+ ]
+
+ _pass_status = "Pass"
+ _fail_status = "Fail"
+ _retry_status = "Retry"
+ _error_status = "Error"
+
+ def __init__(self, options=None): # Default values should never be collections (like []) as default values are shared between invocations
+ options_list = (options or []) + [
+ make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Do not ask the user for confirmation before running the queue. Dangerous!"),
+ make_option("--exit-after-iteration", action="store", type="int", dest="iterations", default=None, help="Stop running the queue after iterating this number of times."),
+ ]
+ Command.__init__(self, "Run the %s" % self.name, options=options_list)
+ self._iteration_count = 0
+
+ def _cc_watchers(self, bug_id):
+ try:
+ self._tool.bugs.add_cc_to_bug(bug_id, self.watchers)
+ except Exception, e:
+ traceback.print_exc()
+ log("Failed to CC watchers.")
+
+ def run_webkit_patch(self, args):
+ webkit_patch_args = [self._tool.path()]
+ # FIXME: This is a hack, we should have a more general way to pass global options.
+ # FIXME: We must always pass global options and their value in one argument
+ # because our global option code looks for the first argument which does
+ # not begin with "-" and assumes that is the command name.
+ webkit_patch_args += ["--status-host=%s" % self._tool.status_server.host]
+ if self._tool.status_server.bot_id:
+ webkit_patch_args += ["--bot-id=%s" % self._tool.status_server.bot_id]
+ if self._options.port:
+ webkit_patch_args += ["--port=%s" % self._options.port]
+ webkit_patch_args.extend(args)
+ # FIXME: There is probably no reason to use run_and_throw_if_fail anymore.
+ # run_and_throw_if_fail was invented to support tee'd output
+ # (where we write both to a log file and to the console at once),
+ # but the queues don't need live-progress, a dump-of-output at the
+ # end should be sufficient.
+ return self._tool.executive.run_and_throw_if_fail(webkit_patch_args)
+
+ def _log_directory(self):
+ return "%s-logs" % self.name
+
+ # QueueEngineDelegate methods
+
+ def queue_log_path(self):
+ return os.path.join(self._log_directory(), "%s.log" % self.name)
+
+ def work_item_log_path(self, work_item):
+ raise NotImplementedError, "subclasses must implement"
+
+ def begin_work_queue(self):
+ log("CAUTION: %s will discard all local changes in \"%s\"" % (self.name, self._tool.scm().checkout_root))
+ if self._options.confirm:
+ response = self._tool.user.prompt("Are you sure? Type \"yes\" to continue: ")
+ if (response != "yes"):
+ error("User declined.")
+ log("Running WebKit %s." % self.name)
+ self._tool.status_server.update_status(self.name, "Starting Queue")
+
+ def stop_work_queue(self, reason):
+ self._tool.status_server.update_status(self.name, "Stopping Queue, reason: %s" % reason)
+
+ def should_continue_work_queue(self):
+ self._iteration_count += 1
+ return not self._options.iterations or self._iteration_count <= self._options.iterations
+
+ def next_work_item(self):
+ raise NotImplementedError, "subclasses must implement"
+
+ def should_proceed_with_work_item(self, work_item):
+ raise NotImplementedError, "subclasses must implement"
+
+ def process_work_item(self, work_item):
+ raise NotImplementedError, "subclasses must implement"
+
+ def handle_unexpected_error(self, work_item, message):
+ raise NotImplementedError, "subclasses must implement"
+
+ # Command methods
+
+ def execute(self, options, args, tool, engine=QueueEngine):
+ self._options = options # FIXME: This code is wrong. Command.options is a list, this assumes an Options element!
+ self._tool = tool # FIXME: This code is wrong too! Command.bind_to_tool handles this!
+ return engine(self.name, self, self._tool.wakeup_event).run()
+
+ @classmethod
+ def _log_from_script_error_for_upload(cls, script_error, output_limit=None):
+ # We have seen request timeouts with app engine due to large
+ # log uploads. Trying only the last 512k.
+ if not output_limit:
+ output_limit = 512 * 1024 # 512k
+ output = script_error.message_with_output(output_limit=output_limit)
+ # We pre-encode the string to a byte array before passing it
+ # to status_server, because ClientForm (part of mechanize)
+ # wants a file-like object with pre-encoded data.
+ return StringIO(output.encode("utf-8"))
+
+ @classmethod
+ def _update_status_for_script_error(cls, tool, state, script_error, is_error=False):
+ message = str(script_error)
+ if is_error:
+ message = "Error: %s" % message
+ failure_log = cls._log_from_script_error_for_upload(script_error)
+ return tool.status_server.update_status(cls.name, message, state["patch"], failure_log)
+
+
+class FeederQueue(AbstractQueue):
+ name = "feeder-queue"
+
+ _sleep_duration = 30 # seconds
+
+ # AbstractPatchQueue methods
+
+ def begin_work_queue(self):
+ AbstractQueue.begin_work_queue(self)
+ self.feeders = [
+ CommitQueueFeeder(self._tool),
+ EWSFeeder(self._tool),
+ ]
+
+ def next_work_item(self):
+ # This really show inherit from some more basic class that doesn't
+ # understand work items, but the base class in the heirarchy currently
+ # understands work items.
+ return "synthetic-work-item"
+
+ def should_proceed_with_work_item(self, work_item):
+ return True
+
+ def process_work_item(self, work_item):
+ for feeder in self.feeders:
+ feeder.feed()
+ time.sleep(self._sleep_duration)
+ return True
+
+ def work_item_log_path(self, work_item):
+ return None
+
+ def handle_unexpected_error(self, work_item, message):
+ log(message)
+
+
+class AbstractPatchQueue(AbstractQueue):
+ def _update_status(self, message, patch=None, results_file=None):
+ return self._tool.status_server.update_status(self.name, message, patch, results_file)
+
+ def _next_patch(self):
+ patch_id = self._tool.status_server.next_work_item(self.name)
+ if not patch_id:
+ return None
+ patch = self._tool.bugs.fetch_attachment(patch_id)
+ if not patch:
+ # FIXME: Using a fake patch because release_work_item has the wrong API.
+ # We also don't really need to release the lock (although that's fine),
+ # mostly we just need to remove this bogus patch from our queue.
+ # If for some reason bugzilla is just down, then it will be re-fed later.
+ patch = Attachment({'id': patch_id}, None)
+ self._release_work_item(patch)
+ return None
+ return patch
+
+ def _release_work_item(self, patch):
+ self._tool.status_server.release_work_item(self.name, patch)
+
+ def _did_pass(self, patch):
+ self._update_status(self._pass_status, patch)
+ self._release_work_item(patch)
+
+ def _did_fail(self, patch):
+ self._update_status(self._fail_status, patch)
+ self._release_work_item(patch)
+
+ def _did_retry(self, patch):
+ self._update_status(self._retry_status, patch)
+ self._release_work_item(patch)
+
+ def _did_error(self, patch, reason):
+ message = "%s: %s" % (self._error_status, reason)
+ self._update_status(message, patch)
+ self._release_work_item(patch)
+
+ def work_item_log_path(self, patch):
+ return os.path.join(self._log_directory(), "%s.log" % patch.bug_id())
+
+
+class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler, CommitQueueTaskDelegate):
+ name = "commit-queue"
+
+ # AbstractPatchQueue methods
+
+ def begin_work_queue(self):
+ AbstractPatchQueue.begin_work_queue(self)
+ self.committer_validator = CommitterValidator(self._tool.bugs)
+
+ def next_work_item(self):
+ return self._next_patch()
+
+ def should_proceed_with_work_item(self, patch):
+ patch_text = "rollout patch" if patch.is_rollout() else "patch"
+ self._update_status("Processing %s" % patch_text, patch)
+ return True
+
+ def process_work_item(self, patch):
+ self._cc_watchers(patch.bug_id())
+ task = CommitQueueTask(self, patch)
+ try:
+ if task.run():
+ self._did_pass(patch)
+ return True
+ self._did_retry(patch)
+ except ScriptError, e:
+ validator = CommitterValidator(self._tool.bugs)
+ validator.reject_patch_from_commit_queue(patch.id(), self._error_message_for_bug(task.failure_status_id, e))
+ self._did_fail(patch)
+
+ def _error_message_for_bug(self, status_id, script_error):
+ if not script_error.output:
+ return script_error.message_with_output()
+ results_link = self._tool.status_server.results_url_for_status(status_id)
+ return "%s\nFull output: %s" % (script_error.message_with_output(), results_link)
+
+ def handle_unexpected_error(self, patch, message):
+ self.committer_validator.reject_patch_from_commit_queue(patch.id(), message)
+
+ # CommitQueueTaskDelegate methods
+
+ def run_command(self, command):
+ self.run_webkit_patch(command)
+
+ def command_passed(self, message, patch):
+ self._update_status(message, patch=patch)
+
+ def command_failed(self, message, script_error, patch):
+ failure_log = self._log_from_script_error_for_upload(script_error)
+ return self._update_status(message, patch=patch, results_file=failure_log)
+
+ # FIXME: This exists for mocking, but should instead be mocked via
+ # some sort of tool.filesystem() object.
+ def _read_file_contents(self, path):
+ try:
+ with codecs.open(path, "r", "utf-8") as open_file:
+ return open_file.read()
+ except OSError, e: # File does not exist or can't be read.
+ return None
+
+ # FIXME: This may belong on the Port object.
+ def layout_test_results(self):
+ results_path = self._tool.port().layout_tests_results_path()
+ results_html = self._read_file_contents(results_path)
+ if not results_html:
+ return None
+ return LayoutTestResults.results_from_string(results_html)
+
+ def refetch_patch(self, patch):
+ return self._tool.bugs.fetch_attachment(patch.id())
+
+ def _author_emails_for_tests(self, flaky_tests):
+ test_paths = map(path_for_layout_test, flaky_tests)
+ commit_infos = self._tool.checkout().recent_commit_infos_for_files(test_paths)
+ return set([commit_info.author().bugzilla_email() for commit_info in commit_infos if commit_info.author()])
+
+ def report_flaky_tests(self, patch, flaky_tests):
+ message = "The %s encountered the following flaky tests while processing attachment %s:" % (self.name, patch.id())
+ message += "\n\n%s\n\n" % ("\n".join(flaky_tests))
+ message += "Please file bugs against the tests. "
+ author_emails = self._author_emails_for_tests(flaky_tests)
+ if author_emails:
+ message += "These tests were authored by %s. " % (join_with_separators(sorted(author_emails)))
+ message += "The commit-queue is continuing to process your patch."
+ self._tool.bugs.post_comment_to_bug(patch.bug_id(), message)
+
+ # StepSequenceErrorHandler methods
+
+ def handle_script_error(cls, tool, state, script_error):
+ # Hitting this error handler should be pretty rare. It does occur,
+ # however, when a patch no longer applies to top-of-tree in the final
+ # land step.
+ log(script_error.message_with_output())
+
+ @classmethod
+ def handle_checkout_needs_update(cls, tool, state, options, error):
+ message = "Tests passed, but commit failed (checkout out of date). Updating, then landing without building or re-running tests."
+ tool.status_server.update_status(cls.name, message, state["patch"])
+ # The only time when we find out that out checkout needs update is
+ # when we were ready to actually pull the trigger and land the patch.
+ # Rather than spinning in the master process, we retry without
+ # building or testing, which is much faster.
+ options.build = False
+ options.test = False
+ options.update = True
+ raise TryAgain()
+
+
+class AbstractReviewQueue(AbstractPatchQueue, StepSequenceErrorHandler):
+ """This is the base-class for the EWS queues and the style-queue."""
+ def __init__(self, options=None):
+ AbstractPatchQueue.__init__(self, options)
+
+ def review_patch(self, patch):
+ raise NotImplementedError("subclasses must implement")
+
+ # AbstractPatchQueue methods
+
+ def begin_work_queue(self):
+ AbstractPatchQueue.begin_work_queue(self)
+
+ def next_work_item(self):
+ return self._next_patch()
+
+ def should_proceed_with_work_item(self, patch):
+ raise NotImplementedError("subclasses must implement")
+
+ def process_work_item(self, patch):
+ try:
+ if not self.review_patch(patch):
+ return False
+ self._did_pass(patch)
+ return True
+ except ScriptError, e:
+ if e.exit_code != QueueEngine.handled_error_code:
+ self._did_fail(patch)
+ else:
+ # The subprocess handled the error, but won't have released the patch, so we do.
+ # FIXME: We need to simplify the rules by which _release_work_item is called.
+ self._release_work_item(patch)
+ raise e
+
+ def handle_unexpected_error(self, patch, message):
+ log(message)
+
+ # StepSequenceErrorHandler methods
+
+ @classmethod
+ def handle_script_error(cls, tool, state, script_error):
+ log(script_error.message_with_output())
+
+
+class StyleQueue(AbstractReviewQueue):
+ name = "style-queue"
+ def __init__(self):
+ AbstractReviewQueue.__init__(self)
+
+ def should_proceed_with_work_item(self, patch):
+ self._update_status("Checking style", patch)
+ return True
+
+ def review_patch(self, patch):
+ self.run_webkit_patch(["check-style", "--force-clean", "--non-interactive", "--parent-command=style-queue", patch.id()])
+ return True
+
+ @classmethod
+ def handle_script_error(cls, tool, state, script_error):
+ is_svn_apply = script_error.command_name() == "svn-apply"
+ status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply)
+ if is_svn_apply:
+ QueueEngine.exit_after_handled_error(script_error)
+ message = "Attachment %s did not pass %s:\n\n%s\n\nIf any of these errors are false positives, please file a bug against check-webkit-style." % (state["patch"].id(), cls.name, script_error.message_with_output(output_limit=3*1024))
+ tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers)
+ exit(1)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
new file mode 100644
index 0000000..b45db7b
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -0,0 +1,378 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+
+from webkitpy.common.checkout.scm import CheckoutNeedsUpdate
+from webkitpy.common.config.committers import Committer
+from webkitpy.common.net.bugzilla import Attachment
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.queues import *
+from webkitpy.tool.commands.queuestest import QueuesTest
+from webkitpy.tool.commands.stepsequence import StepSequence
+from webkitpy.tool.mocktool import MockTool, MockSCM, MockStatusServer
+
+
+class TestQueue(AbstractPatchQueue):
+ name = "test-queue"
+
+
+class TestReviewQueue(AbstractReviewQueue):
+ name = "test-review-queue"
+
+
+class TestFeederQueue(FeederQueue):
+ _sleep_duration = 0
+
+
+class AbstractQueueTest(CommandsTest):
+ def test_log_directory(self):
+ self.assertEquals(TestQueue()._log_directory(), "test-queue-logs")
+
+ def _assert_run_webkit_patch(self, run_args, port=None):
+ queue = TestQueue()
+ tool = MockTool()
+ tool.status_server.bot_id = "gort"
+ tool.executive = Mock()
+ queue.bind_to_tool(tool)
+ queue._options = Mock()
+ queue._options.port = port
+
+ queue.run_webkit_patch(run_args)
+ expected_run_args = ["echo", "--status-host=example.com", "--bot-id=gort"]
+ if port:
+ expected_run_args.append("--port=%s" % port)
+ expected_run_args.extend(run_args)
+ tool.executive.run_and_throw_if_fail.assert_called_with(expected_run_args)
+
+ def test_run_webkit_patch(self):
+ self._assert_run_webkit_patch([1])
+ self._assert_run_webkit_patch(["one", 2])
+ self._assert_run_webkit_patch([1], port="mockport")
+
+ def test_iteration_count(self):
+ queue = TestQueue()
+ queue._options = Mock()
+ queue._options.iterations = 3
+ self.assertTrue(queue.should_continue_work_queue())
+ self.assertTrue(queue.should_continue_work_queue())
+ self.assertTrue(queue.should_continue_work_queue())
+ self.assertFalse(queue.should_continue_work_queue())
+
+ def test_no_iteration_count(self):
+ queue = TestQueue()
+ queue._options = Mock()
+ self.assertTrue(queue.should_continue_work_queue())
+ self.assertTrue(queue.should_continue_work_queue())
+ self.assertTrue(queue.should_continue_work_queue())
+ self.assertTrue(queue.should_continue_work_queue())
+
+ def _assert_log_message(self, script_error, log_message):
+ failure_log = AbstractQueue._log_from_script_error_for_upload(script_error, output_limit=10)
+ self.assertTrue(failure_log.read(), log_message)
+
+ def test_log_from_script_error_for_upload(self):
+ self._assert_log_message(ScriptError("test"), "test")
+ # In python 2.5 unicode(Exception) is busted. See:
+ # http://bugs.python.org/issue2517
+ # With no good workaround, we just ignore these tests.
+ if not hasattr(Exception, "__unicode__"):
+ return
+
+ unicode_tor = u"WebKit \u2661 Tor Arne Vestb\u00F8!"
+ utf8_tor = unicode_tor.encode("utf-8")
+ self._assert_log_message(ScriptError(unicode_tor), utf8_tor)
+ script_error = ScriptError(unicode_tor, output=unicode_tor)
+ expected_output = "%s\nLast %s characters of output:\n%s" % (utf8_tor, 10, utf8_tor[-10:])
+ self._assert_log_message(script_error, expected_output)
+
+
+class FeederQueueTest(QueuesTest):
+ def test_feeder_queue(self):
+ queue = TestFeederQueue()
+ tool = MockTool(log_executive=True)
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr("feeder-queue", MockSCM.fake_checkout_root),
+ "should_proceed_with_work_item": "",
+ "next_work_item": "",
+ "process_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.
+
+- 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). The commit-queue restarts itself every 2 hours. After restart the commit-queue will correctly respect your committer rights.'
+MOCK: update_work_items: commit-queue [106, 197]
+Feeding commit-queue items [106, 197]
+Feeding EWS (1 r? patch, 1 new)
+MOCK: submit_to_ews: 103
+""",
+ "handle_unexpected_error": "Mock error message\n",
+ }
+ self.assert_queue_outputs(queue, tool=tool, expected_stderr=expected_stderr)
+
+
+class AbstractPatchQueueTest(CommandsTest):
+ def test_next_patch(self):
+ queue = AbstractPatchQueue()
+ tool = MockTool()
+ queue.bind_to_tool(tool)
+ queue._options = Mock()
+ queue._options.port = None
+ self.assertEquals(queue._next_patch(), None)
+ tool.status_server = MockStatusServer(work_items=[2, 197])
+ expected_stdout = "MOCK: fetch_attachment: 2 is not a known attachment id\n" # A mock-only message to prevent us from making mistakes.
+ expected_stderr = "MOCK: release_work_item: None 2\n"
+ patch_id = OutputCapture().assert_outputs(self, queue._next_patch, [], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
+ self.assertEquals(patch_id, None) # 2 is an invalid patch id
+ self.assertEquals(queue._next_patch().id(), 197)
+
+
+class NeedsUpdateSequence(StepSequence):
+ def _run(self, tool, options, state):
+ raise CheckoutNeedsUpdate([], 1, "", None)
+
+
+class AlwaysCommitQueueTool(object):
+ def __init__(self):
+ self.status_server = MockStatusServer()
+
+ def command_by_name(self, name):
+ return CommitQueue
+
+
+class SecondThoughtsCommitQueue(CommitQueue):
+ def __init__(self):
+ self._reject_patch = False
+ CommitQueue.__init__(self)
+
+ def run_command(self, command):
+ # We want to reject the patch after the first validation,
+ # so wait to reject it until after some other command has run.
+ self._reject_patch = True
+ return CommitQueue.run_command(self, command)
+
+ def refetch_patch(self, patch):
+ if not self._reject_patch:
+ return self._tool.bugs.fetch_attachment(patch.id())
+
+ attachment_dictionary = {
+ "id": patch.id(),
+ "bug_id": patch.bug_id(),
+ "name": "Rejected",
+ "is_obsolete": True,
+ "is_patch": False,
+ "review": "-",
+ "reviewer_email": "foo@bar.com",
+ "commit-queue": "-",
+ "committer_email": "foo@bar.com",
+ "attacher_email": "Contributer1",
+ }
+ return Attachment(attachment_dictionary, None)
+
+
+# Creating fake CommitInfos is a pain, so we use a mock one here.
+class MockCommitInfo(object):
+ def __init__(self, author_email):
+ self._author_email = author_email
+
+ def author(self):
+ # It's definitely possible to have commits with authors who
+ # are not in our committers.py list.
+ if not self._author_email:
+ return None
+ return Committer("Mock Committer", self._author_email)
+
+
+class CommitQueueTest(QueuesTest):
+ def test_commit_queue(self):
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
+ "should_proceed_with_work_item": "MOCK: update_status: commit-queue Processing patch\n",
+ "next_work_item": "",
+ "process_work_item": """MOCK: update_status: commit-queue Applied patch
+MOCK: update_status: commit-queue Built patch
+MOCK: update_status: commit-queue Passed tests
+MOCK: update_status: commit-queue Landed patch
+MOCK: update_status: commit-queue Pass
+MOCK: release_work_item: commit-queue 197
+""",
+ "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
+ "handle_script_error": "ScriptError error message\n",
+ }
+ self.assert_queue_outputs(CommitQueue(), expected_stderr=expected_stderr)
+
+ def test_commit_queue_failure(self):
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
+ "should_proceed_with_work_item": "MOCK: update_status: commit-queue Processing patch\n",
+ "next_work_item": "",
+ "process_work_item": """MOCK: update_status: commit-queue Patch does not apply
+MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'MOCK script error'
+MOCK: update_status: commit-queue Fail
+MOCK: release_work_item: commit-queue 197
+""",
+ "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
+ "handle_script_error": "ScriptError error message\n",
+ }
+ queue = CommitQueue()
+
+ def mock_run_webkit_patch(command):
+ raise ScriptError('MOCK script error')
+
+ queue.run_webkit_patch = mock_run_webkit_patch
+ self.assert_queue_outputs(queue, expected_stderr=expected_stderr)
+
+ def test_rollout(self):
+ tool = MockTool(log_executive=True)
+ tool.buildbot.light_tree_on_fire()
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
+ "should_proceed_with_work_item": "MOCK: update_status: commit-queue Processing patch\n",
+ "next_work_item": "",
+ "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--force-clean', '--non-interactive', 197]
+MOCK: update_status: commit-queue Applied patch
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build-style=both']
+MOCK: update_status: commit-queue Built patch
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build-and-test', '--no-clean', '--no-update', '--test', '--non-interactive']
+MOCK: update_status: commit-queue Passed tests
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 197]
+MOCK: update_status: commit-queue Landed patch
+MOCK: update_status: commit-queue Pass
+MOCK: release_work_item: commit-queue 197
+""",
+ "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '197' with comment 'Rejecting patch 197 from commit-queue.' and additional comment 'Mock error message'\n",
+ "handle_script_error": "ScriptError error message\n",
+ }
+ self.assert_queue_outputs(CommitQueue(), tool=tool, expected_stderr=expected_stderr)
+
+ def test_rollout_lands(self):
+ tool = MockTool(log_executive=True)
+ tool.buildbot.light_tree_on_fire()
+ rollout_patch = tool.bugs.fetch_attachment(106) # _patch6, a rollout patch.
+ assert(rollout_patch.is_rollout())
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr("commit-queue", MockSCM.fake_checkout_root),
+ "should_proceed_with_work_item": "MOCK: update_status: commit-queue Processing rollout patch\n",
+ "next_work_item": "",
+ "process_work_item": """MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'apply-attachment', '--force-clean', '--non-interactive', 106]
+MOCK: update_status: commit-queue Applied patch
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'build', '--no-clean', '--no-update', '--build-style=both']
+MOCK: update_status: commit-queue Built patch
+MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--ignore-builders', '--non-interactive', '--parent-command=commit-queue', 106]
+MOCK: update_status: commit-queue Landed patch
+MOCK: update_status: commit-queue Pass
+MOCK: release_work_item: commit-queue 106
+""",
+ "handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '106' with comment 'Rejecting patch 106 from commit-queue.' and additional comment 'Mock error message'\n",
+ "handle_script_error": "ScriptError error message\n",
+ }
+ self.assert_queue_outputs(CommitQueue(), tool=tool, work_item=rollout_patch, expected_stderr=expected_stderr)
+
+ def test_auto_retry(self):
+ queue = CommitQueue()
+ options = Mock()
+ options.parent_command = "commit-queue"
+ tool = AlwaysCommitQueueTool()
+ sequence = NeedsUpdateSequence(None)
+
+ expected_stderr = "Commit failed because the checkout is out of date. Please update and try again.\nMOCK: update_status: commit-queue Tests passed, but commit failed (checkout out of date). Updating, then landing without building or re-running tests.\n"
+ state = {'patch': None}
+ OutputCapture().assert_outputs(self, sequence.run_and_handle_errors, [tool, options, state], expected_exception=TryAgain, expected_stderr=expected_stderr)
+
+ self.assertEquals(options.update, True)
+ self.assertEquals(options.build, False)
+ self.assertEquals(options.test, False)
+
+ def test_manual_reject_during_processing(self):
+ queue = SecondThoughtsCommitQueue()
+ queue.bind_to_tool(MockTool())
+ queue._options = Mock()
+ queue._options.port = None
+ expected_stderr = """MOCK: update_status: commit-queue Applied patch
+MOCK: update_status: commit-queue Built patch
+MOCK: update_status: commit-queue Passed tests
+MOCK: update_status: commit-queue Retry
+MOCK: release_work_item: commit-queue 197
+"""
+ OutputCapture().assert_outputs(self, queue.process_work_item, [QueuesTest.mock_work_item], expected_stderr=expected_stderr)
+
+ def _assert_emails_for_tests(self, emails):
+ queue = CommitQueue()
+ tool = MockTool()
+ queue.bind_to_tool(tool)
+ commit_infos = [MockCommitInfo(email) for email in emails]
+ tool.checkout().recent_commit_infos_for_files = lambda paths: set(commit_infos)
+ self.assertEqual(queue._author_emails_for_tests([]), set(emails))
+
+ def test_author_emails_for_tests(self):
+ self._assert_emails_for_tests([])
+ self._assert_emails_for_tests(["test1@test.com", "test1@test.com"])
+ self._assert_emails_for_tests(["test1@test.com", "test2@test.com"])
+
+ def test_report_flaky_tests(self):
+ queue = CommitQueue()
+ queue.bind_to_tool(MockTool())
+ expected_stderr = """MOCK bug comment: bug_id=42, cc=None
+--- Begin comment ---
+The commit-queue encountered the following flaky tests while processing attachment 197:
+
+foo/bar.html
+bar/baz.html
+
+Please file bugs against the tests. These tests were authored by abarth@webkit.org. The commit-queue is continuing to process your patch.
+--- End comment ---
+
+"""
+ OutputCapture().assert_outputs(self, queue.report_flaky_tests, [QueuesTest.mock_work_item, ["foo/bar.html", "bar/baz.html"]], expected_stderr=expected_stderr)
+
+ def test_layout_test_results(self):
+ queue = CommitQueue()
+ queue.bind_to_tool(MockTool())
+ queue._read_file_contents = lambda path: None
+ self.assertEquals(queue.layout_test_results(), None)
+ queue._read_file_contents = lambda path: ""
+ self.assertEquals(queue.layout_test_results(), None)
+
+
+class StyleQueueTest(QueuesTest):
+ def test_style_queue(self):
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr("style-queue", MockSCM.fake_checkout_root),
+ "next_work_item": "",
+ "should_proceed_with_work_item": "MOCK: update_status: style-queue Checking style\n",
+ "process_work_item": "MOCK: update_status: style-queue Pass\nMOCK: release_work_item: style-queue 197\n",
+ "handle_unexpected_error": "Mock error message\n",
+ "handle_script_error": "MOCK: update_status: style-queue ScriptError error message\nMOCK bug comment: bug_id=42, cc=[]\n--- Begin comment ---\nAttachment 197 did not pass style-queue:\n\nScriptError error message\n\nIf any of these errors are false positives, please file a bug against check-webkit-style.\n--- End comment ---\n\n",
+ }
+ expected_exceptions = {
+ "handle_script_error": SystemExit,
+ }
+ self.assert_queue_outputs(StyleQueue(), expected_stderr=expected_stderr, expected_exceptions=expected_exceptions)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
new file mode 100644
index 0000000..6455617
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queuestest.py
@@ -0,0 +1,95 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.net.bugzilla import Attachment
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
+from webkitpy.tool.mocktool import MockTool
+
+
+class MockQueueEngine(object):
+ def __init__(self, name, queue, wakeup_event):
+ pass
+
+ def run(self):
+ pass
+
+
+class QueuesTest(unittest.TestCase):
+ # This is _patch1 in mocktool.py
+ mock_work_item = MockTool().bugs.fetch_attachment(197)
+
+ def assert_outputs(self, func, func_name, args, expected_stdout, expected_stderr, expected_exceptions):
+ exception = None
+ if expected_exceptions and func_name in expected_exceptions:
+ exception = expected_exceptions[func_name]
+
+ OutputCapture().assert_outputs(self,
+ func,
+ args=args,
+ expected_stdout=expected_stdout.get(func_name, ""),
+ expected_stderr=expected_stderr.get(func_name, ""),
+ expected_exception=exception)
+
+ def _default_begin_work_queue_stderr(self, name, checkout_dir):
+ string_replacements = {"name": name, 'checkout_dir': checkout_dir}
+ return "CAUTION: %(name)s will discard all local changes in \"%(checkout_dir)s\"\nRunning WebKit %(name)s.\nMOCK: update_status: %(name)s Starting Queue\n" % string_replacements
+
+ def assert_queue_outputs(self, queue, args=None, work_item=None, expected_stdout=None, expected_stderr=None, expected_exceptions=None, options=None, tool=None):
+ if not tool:
+ tool = MockTool()
+ if not expected_stdout:
+ expected_stdout = {}
+ if not expected_stderr:
+ expected_stderr = {}
+ if not args:
+ args = []
+ if not options:
+ options = Mock()
+ options.port = None
+ if not work_item:
+ work_item = self.mock_work_item
+ tool.user.prompt = lambda message: "yes"
+
+ queue.execute(options, args, tool, engine=MockQueueEngine)
+
+ self.assert_outputs(queue.queue_log_path, "queue_log_path", [], expected_stdout, expected_stderr, expected_exceptions)
+ self.assert_outputs(queue.work_item_log_path, "work_item_log_path", [work_item], expected_stdout, expected_stderr, expected_exceptions)
+ self.assert_outputs(queue.begin_work_queue, "begin_work_queue", [], expected_stdout, expected_stderr, expected_exceptions)
+ self.assert_outputs(queue.should_continue_work_queue, "should_continue_work_queue", [], expected_stdout, expected_stderr, expected_exceptions)
+ self.assert_outputs(queue.next_work_item, "next_work_item", [], expected_stdout, expected_stderr, expected_exceptions)
+ self.assert_outputs(queue.should_proceed_with_work_item, "should_proceed_with_work_item", [work_item], expected_stdout, expected_stderr, expected_exceptions)
+ self.assert_outputs(queue.process_work_item, "process_work_item", [work_item], expected_stdout, expected_stderr, expected_exceptions)
+ self.assert_outputs(queue.handle_unexpected_error, "handle_unexpected_error", [work_item, "Mock error message"], expected_stdout, expected_stderr, expected_exceptions)
+ # Should we have a different function for testing StepSequenceErrorHandlers?
+ if isinstance(queue, StepSequenceErrorHandler):
+ self.assert_outputs(queue.handle_script_error, "handle_script_error", [tool, {"patch": self.mock_work_item}, ScriptError(message="ScriptError error message", script_args="MockErrorCommand")], expected_stdout, expected_stderr, expected_exceptions)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py
new file mode 100644
index 0000000..abfa850
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -0,0 +1,114 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os.path
+import re
+import shutil
+import urllib
+
+from webkitpy.common.net.buildbot import BuildBot, LayoutTestResults
+from webkitpy.common.system.user import User
+from webkitpy.layout_tests.port import factory
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+
+
+# FIXME: I'm not sure where this logic should go in the end.
+# For now it's here, until we have a second need for it.
+class BuilderToPort(object):
+ _builder_name_to_port_name = {
+ r"SnowLeopard": "mac-snowleopard",
+ r"Leopard": "mac-leopard",
+ r"Tiger": "mac-tiger",
+ r"Windows": "win",
+ r"GTK": "gtk",
+ r"Qt": "qt",
+ r"Chromium Mac": "chromium-mac",
+ r"Chromium Linux": "chromium-linux",
+ r"Chromium Win": "chromium-win",
+ }
+
+ def _port_name_for_builder_name(self, builder_name):
+ for regexp, port_name in self._builder_name_to_port_name.items():
+ if re.match(regexp, builder_name):
+ return port_name
+
+ def port_for_builder(self, builder_name):
+ port_name = self._port_name_for_builder_name(builder_name)
+ assert(port_name) # Need to update _builder_name_to_port_name
+ port = factory.get(port_name)
+ assert(port) # Need to update _builder_name_to_port_name
+ return port
+
+
+class Rebaseline(AbstractDeclarativeCommand):
+ name = "rebaseline"
+ help_text = "Replaces local expected.txt files with new results from build bots"
+
+ # FIXME: This should share more code with FailureReason._builder_to_explain
+ def _builder_to_pull_from(self):
+ builder_statuses = self._tool.buildbot.builder_statuses()
+ red_statuses = [status for status in builder_statuses if not status["is_green"]]
+ print "%s failing" % (pluralize("builder", len(red_statuses)))
+ builder_choices = [status["name"] for status in red_statuses]
+ chosen_name = self._tool.user.prompt_with_list("Which builder to pull results from:", builder_choices)
+ # FIXME: prompt_with_list should really take a set of objects and a set of names and then return the object.
+ for status in red_statuses:
+ if status["name"] == chosen_name:
+ return (self._tool.buildbot.builder_with_name(chosen_name), status["build_number"])
+
+ def _replace_expectation_with_remote_result(self, local_file, remote_file):
+ (downloaded_file, headers) = urllib.urlretrieve(remote_file)
+ shutil.move(downloaded_file, local_file)
+
+ def _tests_to_update(self, build):
+ parsed_results = build.layout_test_results().parsed_results()
+ # FIXME: This probably belongs as API on LayoutTestResults
+ # but .failing_tests() already means something else.
+ failing_tests = parsed_results[LayoutTestResults.fail_key]
+ return self._tool.user.prompt_with_list("Which test(s) to rebaseline:", failing_tests, can_choose_multiple=True)
+
+ def _results_url_for_test(self, build, test):
+ test_base = os.path.splitext(test)[0]
+ actual_path = test_base + "-actual.txt"
+ return build.results_url() + "/" + actual_path
+
+ def execute(self, options, args, tool):
+ builder, build_number = self._builder_to_pull_from()
+ build = builder.build(build_number)
+ port = BuilderToPort().port_for_builder(builder.name())
+
+ for test in self._tests_to_update(build):
+ results_url = self._results_url_for_test(build, test)
+ # Port operates with absolute paths.
+ absolute_path = os.path.join(port.layout_tests_dir(), test)
+ expected_file = port.expected_filename(absolute_path, ".txt")
+ print test
+ self._replace_expectation_with_remote_result(expected_file, results_url)
+
+ # FIXME: We should handle new results too.
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
new file mode 100644
index 0000000..d6582a7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.tool.commands.rebaseline import BuilderToPort
+
+
+class BuilderToPortTest(unittest.TestCase):
+ def test_port_for_builder(self):
+ converter = BuilderToPort()
+ port = converter.port_for_builder("Leopard Intel Debug (Tests)")
+ self.assertEqual(port.name(), "mac-leopard")
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
new file mode 100644
index 0000000..abb2af4
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/rebaselineserver.py
@@ -0,0 +1,200 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""Starts a local HTTP server which displays layout test failures (given a test
+results directory), provides comparisons of expected and actual results (both
+images and text) and allows one-click rebaselining of tests."""
+from __future__ import with_statement
+
+import codecs
+import datetime
+import mimetypes
+import os
+import os.path
+import shutil
+import threading
+import time
+import urlparse
+import BaseHTTPServer
+
+from optparse import make_option
+from wsgiref.handlers import format_date_time
+
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+import webkitpy.thirdparty.simplejson as simplejson
+
+class RebaselineHTTPServer(BaseHTTPServer.HTTPServer):
+ def __init__(self, httpd_port, results_directory, results_json):
+ BaseHTTPServer.HTTPServer.__init__(self, ("", httpd_port), RebaselineHTTPRequestHandler)
+ self.results_directory = results_directory
+ self.results_json = results_json
+
+
+class RebaselineHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
+ STATIC_FILE_NAMES = frozenset([
+ "index.html",
+ "loupe.js",
+ "main.js",
+ "main.css",
+ "util.js",
+ ])
+
+ STATIC_FILE_DIRECTORY = os.path.join(
+ os.path.dirname(__file__), "data", "rebaselineserver")
+
+ def do_GET(self):
+ self._handle_request()
+
+ def do_POST(self):
+ self._handle_request()
+
+ def _handle_request(self):
+ # Parse input.
+ if "?" in self.path:
+ path, query_string = self.path.split("?", 1)
+ self.query = urlparse.parse_qs(query_string)
+ else:
+ path = self.path
+ self.query = {}
+ function_or_file_name = path[1:] or "index.html"
+
+ # See if a static file matches.
+ if function_or_file_name in RebaselineHTTPRequestHandler.STATIC_FILE_NAMES:
+ self._serve_static_file(function_or_file_name)
+ return
+
+ # See if a class method matches.
+ function_name = function_or_file_name.replace(".", "_")
+ if not hasattr(self, function_name):
+ self.send_error(404, "Unknown function %s" % function_name)
+ return
+ if function_name[0] == "_":
+ self.send_error(
+ 401, "Not allowed to invoke private or protected methods")
+ return
+ function = getattr(self, function_name)
+ function()
+
+ def _serve_static_file(self, static_path):
+ self._serve_file(os.path.join(
+ RebaselineHTTPRequestHandler.STATIC_FILE_DIRECTORY, static_path))
+
+ def quitquitquit(self):
+ self.send_response(200)
+ self.send_header("Content-type", "text/plain")
+ self.end_headers()
+ self.wfile.write("Quit.\n")
+
+ # Shutdown has to happen on another thread from the server's thread,
+ # otherwise there's a deadlock
+ threading.Thread(target=lambda: self.server.shutdown()).start()
+
+ def test_result(self):
+ test_name, _ = os.path.splitext(self.query['test'][0])
+ mode = self.query['mode'][0]
+ if mode == 'expected-image':
+ file_name = test_name + '-expected.png'
+ elif mode == 'actual-image':
+ file_name = test_name + '-actual.png'
+ if mode == 'expected-checksum':
+ file_name = test_name + '-expected.checksum'
+ elif mode == 'actual-checksum':
+ file_name = test_name + '-actual.checksum'
+ elif mode == 'diff-image':
+ file_name = test_name + '-diff.png'
+ if mode == 'expected-text':
+ file_name = test_name + '-expected.txt'
+ elif mode == 'actual-text':
+ file_name = test_name + '-actual.txt'
+ elif mode == 'diff-text':
+ file_name = test_name + '-diff.txt'
+
+ file_path = os.path.join(self.server.results_directory, file_name)
+
+ # Let results be cached for 60 seconds, so that they can be pre-fetched
+ # by the UI
+ self._serve_file(file_path, cacheable_seconds=60)
+
+ def results_json(self):
+ self.send_response(200)
+ self.send_header('Content-type', 'application/json')
+ self.end_headers()
+ simplejson.dump(self.server.results_json, self.wfile)
+
+ def _serve_file(self, file_path, cacheable_seconds=0):
+ if not os.path.exists(file_path):
+ self.send_error(404, "File not found")
+ return
+ with codecs.open(file_path, "rb") as static_file:
+ self.send_response(200)
+ self.send_header("Content-Length", os.path.getsize(file_path))
+ mime_type, encoding = mimetypes.guess_type(file_path)
+ if mime_type:
+ self.send_header("Content-type", mime_type)
+
+ if cacheable_seconds:
+ expires_time = (datetime.datetime.now() +
+ datetime.timedelta(0, cacheable_seconds))
+ expires_formatted = format_date_time(
+ time.mktime(expires_time.timetuple()))
+ self.send_header("Expires", expires_formatted)
+ self.end_headers()
+
+ shutil.copyfileobj(static_file, self.wfile)
+
+
+class RebaselineServer(AbstractDeclarativeCommand):
+ name = "rebaseline-server"
+ help_text = __doc__
+ argument_names = "/path/to/results/directory"
+
+ def __init__(self):
+ options = [
+ make_option("--httpd-port", action="store", type="int", default=8127, help="Port to use for the the rebaseline HTTP server"),
+ ]
+ AbstractDeclarativeCommand.__init__(self, options=options)
+
+ def execute(self, options, args, tool):
+ results_directory = args[0]
+
+ print 'Parsing unexpected_results.json...'
+ results_json_path = os.path.join(
+ results_directory, 'unexpected_results.json')
+ with codecs.open(results_json_path, "r") as results_json_file:
+ results_json_file = file(results_json_path)
+ results_json = simplejson.load(results_json_file)
+
+ print "Starting server at http://localhost:%d/" % options.httpd_port
+ print ("Use the 'Exit' link in the UI, http://localhost:%d/"
+ "quitquitquit or Ctrl-C to stop") % options.httpd_port
+
+ httpd = RebaselineHTTPServer(
+ httpd_port=options.httpd_port,
+ results_directory=results_directory,
+ results_json=results_json)
+ httpd.serve_forever()
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
new file mode 100644
index 0000000..145f485
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot.py
@@ -0,0 +1,106 @@
+# Copyright (c) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.config.ports import WebKitPort
+from webkitpy.tool.bot.sheriff import Sheriff
+from webkitpy.tool.bot.sheriffircbot import SheriffIRCBot
+from webkitpy.tool.commands.queues import AbstractQueue
+from webkitpy.tool.commands.stepsequence import StepSequenceErrorHandler
+
+
+class SheriffBot(AbstractQueue, StepSequenceErrorHandler):
+ name = "sheriff-bot"
+ watchers = AbstractQueue.watchers + [
+ "abarth@webkit.org",
+ "eric@webkit.org",
+ ]
+
+ def _update(self):
+ self.run_webkit_patch(["update", "--force-clean", "--quiet"])
+
+ # AbstractQueue methods
+
+ def begin_work_queue(self):
+ AbstractQueue.begin_work_queue(self)
+ self._sheriff = Sheriff(self._tool, self)
+ self._irc_bot = SheriffIRCBot(self._tool, self._sheriff)
+ self._tool.ensure_irc_connected(self._irc_bot.irc_delegate())
+
+ def work_item_log_path(self, failure_map):
+ return None
+
+ def _is_old_failure(self, revision):
+ return self._tool.status_server.svn_revision(revision)
+
+ def next_work_item(self):
+ self._irc_bot.process_pending_messages()
+ self._update()
+
+ # FIXME: We need to figure out how to provoke_flaky_builders.
+
+ failure_map = self._tool.buildbot.failure_map()
+ failure_map.filter_out_old_failures(self._is_old_failure)
+ if failure_map.is_empty():
+ return None
+ return failure_map
+
+ def should_proceed_with_work_item(self, failure_map):
+ # Currently, we don't have any reasons not to proceed with work items.
+ return True
+
+ def process_work_item(self, failure_map):
+ failing_revisions = failure_map.failing_revisions()
+ for revision in failing_revisions:
+ builders = failure_map.builders_failing_for(revision)
+ tests = failure_map.tests_failing_for(revision)
+ try:
+ commit_info = self._tool.checkout().commit_info_for_revision(revision)
+ if not commit_info:
+ print "FAILED to fetch CommitInfo for r%s, likely missing ChangeLog" % revision
+ continue
+ self._sheriff.post_irc_warning(commit_info, builders)
+ self._sheriff.post_blame_comment_on_bug(commit_info, builders, tests)
+
+ finally:
+ for builder in builders:
+ self._tool.status_server.update_svn_revision(revision, builder.name())
+ return True
+
+ def handle_unexpected_error(self, failure_map, message):
+ log(message)
+
+ # StepSequenceErrorHandler methods
+
+ @classmethod
+ def handle_script_error(cls, tool, state, script_error):
+ # Ideally we would post some information to IRC about what went wrong
+ # here, but we don't have the IRC password in the child process.
+ pass
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
new file mode 100644
index 0000000..4db463e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/sheriffbot_unittest.py
@@ -0,0 +1,57 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+
+from webkitpy.tool.commands.queuestest import QueuesTest
+from webkitpy.tool.commands.sheriffbot import SheriffBot
+from webkitpy.tool.mocktool import *
+
+
+class SheriffBotTest(QueuesTest):
+ builder1 = MockBuilder("Builder1")
+ builder2 = MockBuilder("Builder2")
+
+ def test_sheriff_bot(self):
+ tool = MockTool()
+ mock_work_item = MockFailureMap(tool.buildbot)
+ expected_stderr = {
+ "begin_work_queue": self._default_begin_work_queue_stderr("sheriff-bot", tool.scm().checkout_root),
+ "next_work_item": "",
+ "process_work_item": """MOCK: irc.post: abarth, darin, eseidel: http://trac.webkit.org/changeset/29837 might have broken Builder1
+MOCK bug comment: bug_id=42, cc=['abarth@webkit.org', 'eric@webkit.org']
+--- Begin comment ---
+http://trac.webkit.org/changeset/29837 might have broken Builder1
+The following tests are not passing:
+mock-test-1
+--- End comment ---
+
+""",
+ "handle_unexpected_error": "Mock error message\n"
+ }
+ self.assert_queue_outputs(SheriffBot(), work_item=mock_work_item, expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/stepsequence.py b/WebKitTools/Scripts/webkitpy/tool/commands/stepsequence.py
index 008b366..be2ed4c 100644
--- a/WebKitTools/Scripts/webkitpy/stepsequence.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/stepsequence.py
@@ -26,12 +26,12 @@
# (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 webkitpy.steps as steps
+import webkitpy.tool.steps as steps
-from webkitpy.executive import ScriptError
-from webkitpy.webkit_logging import log
-from webkitpy.scm import CheckoutNeedsUpdate
-from webkitpy.queueengine import QueueEngine
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.checkout.scm import CheckoutNeedsUpdate
+from webkitpy.tool.bot.queueengine import QueueEngine
+from webkitpy.common.system.deprecated_logging import log
class StepSequenceErrorHandler():
@@ -39,6 +39,10 @@ class StepSequenceErrorHandler():
def handle_script_error(cls, tool, patch, script_error):
raise NotImplementedError, "subclasses must implement"
+ @classmethod
+ def handle_checkout_needs_update(cls, tool, state, options, error):
+ raise NotImplementedError, "subclasses must implement"
+
class StepSequence(object):
def __init__(self, steps):
@@ -66,7 +70,9 @@ class StepSequence(object):
self._run(tool, options, state)
except CheckoutNeedsUpdate, e:
log("Commit failed because the checkout is out of date. Please update and try again.")
- log("You can pass --no-build to skip building/testing after update if you believe the new commits did not affect the results.")
+ if options.parent_command:
+ command = tool.command_by_name(options.parent_command)
+ command.handle_checkout_needs_update(tool, state, options, e)
QueueEngine.exit_after_handled_error(e)
except ScriptError, e:
if not options.quiet:
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
index 15bdfbb..e12c8e2 100644
--- a/WebKitTools/Scripts/webkitpy/commands/upload.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009, 2010 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -30,30 +30,38 @@
import os
import re
-import StringIO
import sys
from optparse import make_option
-import webkitpy.steps as steps
+import webkitpy.tool.steps as steps
+
+from webkitpy.common.config.committers import CommitterList
+from webkitpy.common.net.bugzilla import parse_bug_id
+from webkitpy.common.system.user import User
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.abstractsequencedcommand import AbstractSequencedCommand
+from webkitpy.tool.grammar import pluralize, join_with_separators
+from webkitpy.tool.comments import bug_comment_from_svn_revision
+from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
+from webkitpy.common.system.deprecated_logging import error, log
-from webkitpy.bugzilla import parse_bug_id
-from webkitpy.commands.abstractsequencedcommand import AbstractSequencedCommand
-from webkitpy.comments import bug_comment_from_svn_revision
-from webkitpy.committers import CommitterList
-from webkitpy.grammar import pluralize, join_with_separators
-from webkitpy.webkit_logging import error, log
-from webkitpy.mock import Mock
-from webkitpy.multicommandtool import AbstractDeclarativeCommand
-from webkitpy.user import User
class CommitMessageForCurrentDiff(AbstractDeclarativeCommand):
name = "commit-message"
help_text = "Print a commit message suitable for the uncommitted changes"
+ def __init__(self):
+ options = [
+ steps.Options.git_commit,
+ ]
+ AbstractDeclarativeCommand.__init__(self, options=options)
+
def execute(self, options, args, tool):
- os.chdir(tool.scm().checkout_root)
- print "%s" % tool.scm().commit_message_for_this_commit().message()
+ # This command is a useful test to make sure commit_message_for_this_commit
+ # always returns the right value regardless of the current working directory.
+ print "%s" % tool.checkout().commit_message_for_this_commit(options.git_commit).message()
+
class CleanPendingCommit(AbstractDeclarativeCommand):
name = "clean-pending-commit"
@@ -74,14 +82,40 @@ class CleanPendingCommit(AbstractDeclarativeCommand):
def execute(self, options, args, tool):
committers = CommitterList()
for bug_id in tool.bugs.queries.fetch_bug_ids_from_pending_commit_list():
- bug = self.tool.bugs.fetch_bug(bug_id)
+ bug = self._tool.bugs.fetch_bug(bug_id)
patches = bug.patches(include_obsolete=True)
for patch in patches:
flags_to_clear = self._flags_to_clear_on_patch(patch)
if not flags_to_clear:
continue
message = "Cleared %s from obsolete attachment %s so that this bug does not appear in http://webkit.org/pending-commit." % (flags_to_clear, patch.id())
- self.tool.bugs.obsolete_attachment(patch.id(), message)
+ self._tool.bugs.obsolete_attachment(patch.id(), message)
+
+
+# FIXME: This should be share more logic with AssignToCommitter and CleanPendingCommit
+class CleanReviewQueue(AbstractDeclarativeCommand):
+ name = "clean-review-queue"
+ help_text = "Clear r? on obsolete patches so they do not appear in the pending-commit list."
+
+ def execute(self, options, args, tool):
+ queue_url = "http://webkit.org/pending-review"
+ # We do this inefficient dance to be more like webkit.org/pending-review
+ # bugs.queries.fetch_bug_ids_from_review_queue() doesn't return
+ # closed bugs, but folks using /pending-review will see them. :(
+ for patch_id in tool.bugs.queries.fetch_attachment_ids_from_review_queue():
+ patch = self._tool.bugs.fetch_attachment(patch_id)
+ if not patch.review() == "?":
+ continue
+ attachment_obsolete_modifier = ""
+ if patch.is_obsolete():
+ attachment_obsolete_modifier = "obsolete "
+ elif patch.bug().is_closed():
+ bug_closed_explanation = " If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again)."
+ else:
+ # Neither the patch was obsolete or the bug was closed, next patch...
+ continue
+ message = "Cleared review? from %sattachment %s so that this bug does not appear in %s.%s" % (attachment_obsolete_modifier, patch.id(), queue_url, bug_closed_explanation)
+ self._tool.bugs.obsolete_attachment(patch.id(), message)
class AssignToCommitter(AbstractDeclarativeCommand):
@@ -96,9 +130,9 @@ class AssignToCommitter(AbstractDeclarativeCommand):
def _assign_bug_to_last_patch_attacher(self, bug_id):
committers = CommitterList()
- bug = self.tool.bugs.fetch_bug(bug_id)
- assigned_to_email = bug.assigned_to_email()
- if assigned_to_email != self.tool.bugs.unassigned_email:
+ bug = self._tool.bugs.fetch_bug(bug_id)
+ if not bug.is_unassigned():
+ assigned_to_email = bug.assigned_to_email()
log("Bug %s is already assigned to %s (%s)." % (bug_id, assigned_to_email, committers.committer_by_email(assigned_to_email)))
return
@@ -120,7 +154,7 @@ class AssignToCommitter(AbstractDeclarativeCommand):
return
reassign_message = "Attachment %s was posted by a committer and has review+, assigning to %s for commit." % (latest_patch.id(), committer.full_name)
- self.tool.bugs.reassign_bug(bug_id, committer.bugzilla_email(), reassign_message)
+ self._tool.bugs.reassign_bug(bug_id, committer.bugzilla_email(), reassign_message)
def execute(self, options, args, tool):
for bug_id in tool.bugs.queries.fetch_bug_ids_from_pending_commit_list():
@@ -140,19 +174,20 @@ class ObsoleteAttachments(AbstractSequencedCommand):
class AbstractPatchUploadingCommand(AbstractSequencedCommand):
- def _bug_id(self, args, tool, state):
+ def _bug_id(self, options, args, tool, state):
# Perfer a bug id passed as an argument over a bug url in the diff (i.e. ChangeLogs).
bug_id = args and args[0]
if not bug_id:
- state["diff"] = tool.scm().create_patch()
- bug_id = parse_bug_id(state["diff"])
+ changed_files = self._tool.scm().changed_files(options.git_commit)
+ state["changed_files"] = changed_files
+ bug_id = tool.checkout().bug_id_for_this_commit(options.git_commit, changed_files)
return bug_id
def _prepare_state(self, options, args, tool):
state = {}
- state["bug_id"] = self._bug_id(args, tool, state)
+ state["bug_id"] = self._bug_id(options, args, tool, state)
if not state["bug_id"]:
- error("No bug id passed and no bug url found in diff.")
+ error("No bug id passed and no bug url found in ChangeLogs.")
return state
@@ -160,19 +195,24 @@ class Post(AbstractPatchUploadingCommand):
name = "post"
help_text = "Attach the current working directory diff to a bug as a patch file"
argument_names = "[BUGID]"
- show_in_main_help = True
steps = [
steps.CheckStyle,
steps.ConfirmDiff,
steps.ObsoletePatches,
+ steps.SuggestReviewers,
steps.PostDiff,
]
class LandSafely(AbstractPatchUploadingCommand):
name = "land-safely"
- help_text = "Land the current diff via the commit-queue (Experimental)"
+ help_text = "Land the current diff via the commit-queue"
argument_names = "[BUGID]"
+ long_help = """land-safely updates the ChangeLog with the reviewer listed
+ in bugs.webkit.org for BUGID (or the bug ID detected from the ChangeLog).
+ The command then uploads the current diff to the bug and marks it for
+ commit by the commit-queue."""
+ show_in_main_help = True
steps = [
steps.UpdateChangeLogsWithReviewer,
steps.ObsoletePatches,
@@ -184,7 +224,6 @@ class Prepare(AbstractSequencedCommand):
name = "prepare"
help_text = "Creates a bug (or prompts for an existing bug) and prepares the ChangeLogs"
argument_names = "[BUGID]"
- show_in_main_help = True
steps = [
steps.PromptForBugOrTitle,
steps.CreateBug,
@@ -209,6 +248,7 @@ class Upload(AbstractPatchUploadingCommand):
steps.EditChangeLog,
steps.ConfirmDiff,
steps.ObsoletePatches,
+ steps.SuggestReviewers,
steps.PostDiff,
]
long_help = """upload uploads the current diff to bugs.webkit.org.
@@ -221,7 +261,7 @@ class Upload(AbstractPatchUploadingCommand):
def _prepare_state(self, options, args, tool):
state = {}
- state["bug_id"] = self._bug_id(args, tool, state)
+ state["bug_id"] = self._bug_id(options, args, tool, state)
return state
@@ -258,10 +298,6 @@ class PostCommits(AbstractDeclarativeCommand):
comment_text += tool.scm().files_changed_summary_for_commit(commit_id)
return comment_text
- def _diff_file_for_commit(self, tool, commit_id):
- diff = tool.scm().create_patch_from_local_commit(commit_id)
- return StringIO.StringIO(diff) # add_patch_to_bug expects a file-like object
-
def execute(self, options, args, tool):
commit_ids = tool.scm().commit_ids_from_commitish_arguments(args)
if len(commit_ids) > 10: # We could lower this limit, 10 is too many for one bug as-is.
@@ -272,7 +308,7 @@ class PostCommits(AbstractDeclarativeCommand):
commit_message = tool.scm().commit_message_for_local_commit(commit_id)
# Prefer --bug-id=, then a bug url in the commit message, then a bug url in the entire commit diff (i.e. ChangeLogs).
- bug_id = options.bug_id or parse_bug_id(commit_message.message()) or parse_bug_id(tool.scm().create_patch_from_local_commit(commit_id))
+ bug_id = options.bug_id or parse_bug_id(commit_message.message()) or parse_bug_id(tool.scm().create_patch(git_commit=commit_id))
if not bug_id:
log("Skipping %s: No bug id found in commit or specified with --bug-id." % commit_id)
continue
@@ -282,12 +318,13 @@ class PostCommits(AbstractDeclarativeCommand):
steps.ObsoletePatches(tool, options).run(state)
have_obsoleted_patches.add(bug_id)
- diff_file = self._diff_file_for_commit(tool, commit_id)
+ diff = tool.scm().create_patch(git_commit=commit_id)
description = options.description or commit_message.description(lstrip=True, strip_url=True)
comment_text = self._comment_text_for_commit(options, commit_message, tool, commit_id)
- tool.bugs.add_patch_to_bug(bug_id, diff_file, description, comment_text, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
+ tool.bugs.add_patch_to_bug(bug_id, diff, description, comment_text, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
+# FIXME: This command needs to be brought into the modern age with steps and CommitInfo.
class MarkBugFixed(AbstractDeclarativeCommand):
name = "mark-bug-fixed"
help_text = "Mark the specified bug as fixed"
@@ -301,6 +338,7 @@ class MarkBugFixed(AbstractDeclarativeCommand):
]
AbstractDeclarativeCommand.__init__(self, options=options)
+ # FIXME: We should be using checkout().changelog_entries_for_revision(...) instead here.
def _fetch_commit_log(self, tool, svn_revision):
if not svn_revision:
return tool.scm().last_svn_commit_log()
@@ -399,9 +437,8 @@ class CreateBug(AbstractDeclarativeCommand):
comment_text += "---\n"
comment_text += tool.scm().files_changed_summary_for_commit(commit_id)
- diff = tool.scm().create_patch_from_local_commit(commit_id)
- diff_file = StringIO.StringIO(diff) # create_bug expects a file-like object
- bug_id = tool.bugs.create_bug(bug_title, comment_text, options.component, diff_file, "Patch", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
+ diff = tool.scm().create_patch(git_commit=commit_id)
+ bug_id = tool.bugs.create_bug(bug_title, comment_text, options.component, diff, "Patch", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
if bug_id and len(commit_ids) > 1:
options.bug_id = bug_id
@@ -415,13 +452,12 @@ class CreateBug(AbstractDeclarativeCommand):
if options.prompt:
(bug_title, comment_text) = self.prompt_for_bug_title_and_comment()
else:
- commit_message = tool.scm().commit_message_for_this_commit()
+ commit_message = tool.checkout().commit_message_for_this_commit(options.git_commit)
bug_title = commit_message.description(lstrip=True, strip_url=True)
comment_text = commit_message.body(lstrip=True)
- diff = tool.scm().create_patch()
- diff_file = StringIO.StringIO(diff) # create_bug expects a file-like object
- bug_id = tool.bugs.create_bug(bug_title, comment_text, options.component, diff_file, "Patch", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
+ diff = tool.scm().create_patch(options.git_commit)
+ bug_id = tool.bugs.create_bug(bug_title, comment_text, options.component, diff, "Patch", cc=options.cc, mark_for_review=options.review, mark_for_commit_queue=options.request_commit)
def prompt_for_bug_title_and_comment(self):
bug_title = User.prompt("Bug title: ")
diff --git a/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
index 7fa8797..bd1fbd6 100644
--- a/WebKitTools/Scripts/webkitpy/commands/upload_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/upload_unittest.py
@@ -26,25 +26,22 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.commands.commandtest import CommandsTest
-from webkitpy.commands.upload import *
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.tool.commands.commandtest import CommandsTest
+from webkitpy.tool.commands.upload import *
+from webkitpy.tool.mocktool import MockOptions, MockTool
class UploadCommandsTest(CommandsTest):
def test_commit_message_for_current_diff(self):
- tool = MockBugzillaTool()
- mock_commit_message_for_this_commit = Mock()
- mock_commit_message_for_this_commit.message = lambda: "Mock message"
- tool._scm.commit_message_for_this_commit = lambda: mock_commit_message_for_this_commit
- expected_stdout = "Mock message\n"
+ tool = MockTool()
+ expected_stdout = "This is a fake commit message that is at least 50 characters.\n"
self.assert_execute_outputs(CommitMessageForCurrentDiff(), [], expected_stdout=expected_stdout, tool=tool)
def test_clean_pending_commit(self):
self.assert_execute_outputs(CleanPendingCommit(), [])
def test_assign_to_committer(self):
- tool = MockBugzillaTool()
+ tool = MockTool()
expected_stderr = "Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)\nBug 77 is already assigned to foo@foo.com (None).\nBug 76 has no non-obsolete patches, ignoring.\n"
self.assert_execute_outputs(AssignToCommitter(), [], expected_stderr=expected_stderr, tool=tool)
tool.bugs.reassign_bug.assert_called_with(42, "eric@webkit.org", "Attachment 128 was posted by a committer and has review+, assigning to Eric Seidel for commit.")
@@ -54,34 +51,67 @@ class UploadCommandsTest(CommandsTest):
self.assert_execute_outputs(ObsoleteAttachments(), [42], expected_stderr=expected_stderr)
def test_post(self):
- expected_stderr = "Running check-webkit-style\nObsoleting 2 old patches on bug 42\n"
- self.assert_execute_outputs(Post(), [42], expected_stderr=expected_stderr)
+ options = MockOptions()
+ options.cc = None
+ options.check_style = True
+ options.comment = None
+ options.description = "MOCK description"
+ options.request_commit = False
+ options.review = True
+ options.suggest_reviewers = False
+ expected_stderr = """Running check-webkit-style
+MOCK: user.open_url: file://...
+Obsoleting 2 old patches on bug 42
+MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
+-- Begin comment --
+None
+-- End comment --
+MOCK: user.open_url: http://example.com/42
+"""
+ expected_stdout = "Was that diff correct?\n"
+ self.assert_execute_outputs(Post(), [42], options=options, expected_stdout=expected_stdout, expected_stderr=expected_stderr)
- def test_post(self):
- expected_stderr = "Obsoleting 2 old patches on bug 42\n"
+ def test_land_safely(self):
+ expected_stderr = "Obsoleting 2 old patches on bug 42\nMOCK add_patch_to_bug: bug_id=42, description=Patch for landing, mark_for_review=False, mark_for_commit_queue=False, mark_for_landing=True\n-- Begin comment --\nNone\n-- End comment --\n"
self.assert_execute_outputs(LandSafely(), [42], expected_stderr=expected_stderr)
def test_prepare_diff_with_arg(self):
self.assert_execute_outputs(Prepare(), [42])
def test_prepare(self):
- self.assert_execute_outputs(Prepare(), [])
+ expected_stderr = "MOCK create_bug\nbug_title: Mock user response\nbug_description: Mock user response\n"
+ self.assert_execute_outputs(Prepare(), [], expected_stderr=expected_stderr)
def test_upload(self):
- expected_stderr = "Running check-webkit-style\nObsoleting 2 old patches on bug 42\nMOCK: user.open_url: http://example.com/42\n"
- self.assert_execute_outputs(Upload(), [42], expected_stderr=expected_stderr)
+ options = MockOptions()
+ options.cc = None
+ options.check_style = True
+ options.comment = None
+ options.description = "MOCK description"
+ options.request_commit = False
+ options.review = True
+ options.suggest_reviewers = False
+ expected_stderr = """Running check-webkit-style
+MOCK: user.open_url: file://...
+Obsoleting 2 old patches on bug 42
+MOCK add_patch_to_bug: bug_id=42, description=MOCK description, mark_for_review=True, mark_for_commit_queue=False, mark_for_landing=False
+-- Begin comment --
+None
+-- End comment --
+MOCK: user.open_url: http://example.com/42
+"""
+ expected_stdout = "Was that diff correct?\n"
+ self.assert_execute_outputs(Upload(), [42], options=options, expected_stdout=expected_stdout, expected_stderr=expected_stderr)
def test_mark_bug_fixed(self):
- tool = MockBugzillaTool()
+ tool = MockTool()
tool._scm.last_svn_commit_log = lambda: "r9876 |"
options = Mock()
options.bug_id = 42
- expected_stderr = """Bug: <http://example.com/42> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.
-Revision: 9876
-MOCK: user.open_url: http://example.com/42
-Adding comment to Bug 42.
-"""
- self.assert_execute_outputs(MarkBugFixed(), [], expected_stderr=expected_stderr, tool=tool, options=options)
+ options.comment = "MOCK comment"
+ expected_stderr = "Bug: <http://example.com/42> Bug with two r+'d and cq+'d patches, one of which has an invalid commit-queue setter.\nRevision: 9876\nMOCK: user.open_url: http://example.com/42\nAdding comment to Bug 42.\nMOCK bug comment: bug_id=42, cc=None\n--- Begin comment ---\nMOCK comment\n\nCommitted r9876: <http://trac.webkit.org/changeset/9876>\n--- End comment ---\n\n"
+ expected_stdout = "Is this correct?\n"
+ self.assert_execute_outputs(MarkBugFixed(), [], expected_stdout=expected_stdout, expected_stderr=expected_stderr, tool=tool, options=options)
def test_edit_changelog(self):
self.assert_execute_outputs(EditChangeLogs(), [])
diff --git a/WebKitTools/Scripts/webkitpy/comments.py b/WebKitTools/Scripts/webkitpy/tool/comments.py
index 77ad239..83f2be8 100755
--- a/WebKitTools/Scripts/webkitpy/comments.py
+++ b/WebKitTools/Scripts/webkitpy/tool/comments.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -30,7 +30,7 @@
# A tool for automating dealing with bugzilla, posting patches, committing
# patches, etc.
-from webkitpy.changelogs import view_source_url
+from webkitpy.common.checkout.changelog import view_source_url
def bug_comment_from_svn_revision(svn_revision):
diff --git a/WebKitTools/Scripts/webkitpy/grammar.py b/WebKitTools/Scripts/webkitpy/tool/grammar.py
index 651bbc9..8db9826 100644
--- a/WebKitTools/Scripts/webkitpy/grammar.py
+++ b/WebKitTools/Scripts/webkitpy/tool/grammar.py
@@ -1,5 +1,4 @@
-#!/usr/bin/env python
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -45,9 +44,11 @@ def pluralize(noun, count):
return "%d %s" % (count, noun)
-def join_with_separators(list_of_strings, separator=', ', last_separator=', and '):
+def join_with_separators(list_of_strings, separator=', ', only_two_separator=" and ", last_separator=', and '):
if not list_of_strings:
return ""
if len(list_of_strings) == 1:
return list_of_strings[0]
+ if len(list_of_strings) == 2:
+ return only_two_separator.join(list_of_strings)
return "%s%s%s" % (separator.join(list_of_strings[:-1]), last_separator, list_of_strings[-1])
diff --git a/WebKitTools/Scripts/webkitpy/grammar_unittest.py b/WebKitTools/Scripts/webkitpy/tool/grammar_unittest.py
index 3d8b179..cab71db 100644
--- a/WebKitTools/Scripts/webkitpy/grammar_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/grammar_unittest.py
@@ -27,11 +27,14 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import unittest
-from webkitpy.grammar import join_with_separators
+
+from webkitpy.tool.grammar import join_with_separators
class GrammarTest(unittest.TestCase):
def test_join_with_separators(self):
+ self.assertEqual(join_with_separators(["one"]), "one")
+ self.assertEqual(join_with_separators(["one", "two"]), "one and two")
self.assertEqual(join_with_separators(["one", "two", "three"]), "one, two, and three")
if __name__ == '__main__':
diff --git a/WebKitTools/Scripts/webkitpy/tool/main.py b/WebKitTools/Scripts/webkitpy/tool/main.py
new file mode 100755
index 0000000..7b1d7f3
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/main.py
@@ -0,0 +1,133 @@
+# Copyright (c) 2010 Google Inc. All rights reserved.
+# Copyright (c) 2009 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:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# A tool for automating dealing with bugzilla, posting patches, committing patches, etc.
+
+from optparse import make_option
+import os
+import threading
+
+from webkitpy.common.checkout.api import Checkout
+from webkitpy.common.checkout.scm import default_scm
+from webkitpy.common.config.ports import WebKitPort
+from webkitpy.common.net.bugzilla import Bugzilla
+from webkitpy.common.net.buildbot import BuildBot
+from webkitpy.common.net.irc.ircproxy import IRCProxy
+from webkitpy.common.net.statusserver import StatusServer
+from webkitpy.common.system.executive import Executive
+from webkitpy.common.system.user import User
+from webkitpy.layout_tests import port
+from webkitpy.tool.multicommandtool import MultiCommandTool
+import webkitpy.tool.commands as commands
+
+
+class WebKitPatch(MultiCommandTool):
+ global_options = [
+ make_option("-v", "--verbose", action="store_true", dest="verbose", default=False, help="enable all logging"),
+ make_option("--dry-run", action="store_true", dest="dry_run", default=False, help="do not touch remote servers"),
+ make_option("--status-host", action="store", dest="status_host", type="string", help="Hostname (e.g. localhost or commit.webkit.org) where status updates should be posted."),
+ make_option("--bot-id", action="store", dest="bot_id", type="string", help="Identifier for this bot (if multiple bots are running for a queue)"),
+ make_option("--irc-password", action="store", dest="irc_password", type="string", help="Password to use when communicating via IRC."),
+ make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...)."),
+ ]
+
+ def __init__(self, path):
+ MultiCommandTool.__init__(self)
+
+ self._path = path
+ self.wakeup_event = threading.Event()
+ self.bugs = Bugzilla()
+ self.buildbot = BuildBot()
+ self.executive = Executive()
+ self._irc = None
+ self._port = None
+ self.user = User()
+ self._scm = None
+ self._checkout = None
+ self.status_server = StatusServer()
+ self.port_factory = port.factory
+
+ def scm(self):
+ # Lazily initialize SCM to not error-out before command line parsing (or when running non-scm commands).
+ if not self._scm:
+ self._scm = default_scm()
+ return self._scm
+
+ def checkout(self):
+ if not self._checkout:
+ self._checkout = Checkout(self.scm())
+ return self._checkout
+
+ def port(self):
+ return self._port
+
+ def ensure_irc_connected(self, irc_delegate):
+ if not self._irc:
+ self._irc = IRCProxy(irc_delegate)
+
+ def irc(self):
+ # We don't automatically construct IRCProxy here because constructing
+ # IRCProxy actually connects to IRC. We want clients to explicitly
+ # connect to IRC.
+ return self._irc
+
+ def path(self):
+ return self._path
+
+ def command_completed(self):
+ if self._irc:
+ self._irc.disconnect()
+
+ def should_show_in_main_help(self, command):
+ if not command.show_in_main_help:
+ return False
+ if command.requires_local_commits:
+ return self.scm().supports_local_commits()
+ return True
+
+ # FIXME: This may be unnecessary since we pass global options to all commands during execute() as well.
+ def handle_global_options(self, options):
+ self._options = options
+ if options.dry_run:
+ self.scm().dryrun = True
+ self.bugs.dryrun = True
+ if options.status_host:
+ self.status_server.set_host(options.status_host)
+ if options.bot_id:
+ self.status_server.set_bot_id(options.bot_id)
+ if options.irc_password:
+ self.irc_password = options.irc_password
+ # If options.port is None, we'll get the default port for this platform.
+ self._port = WebKitPort.port(options.port)
+
+ def should_execute_command(self, command):
+ if command.requires_local_commits and not self.scm().supports_local_commits():
+ failure_reason = "%s requires local commits using %s in %s." % (command.name, self.scm().display_name(), self.scm().checkout_root)
+ return (False, failure_reason)
+ return (True, None)
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool.py b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
new file mode 100644
index 0000000..719f9b1
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool.py
@@ -0,0 +1,676 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import threading
+
+from webkitpy.common.config.committers import CommitterList, Reviewer
+from webkitpy.common.checkout.commitinfo import CommitInfo
+from webkitpy.common.checkout.scm import CommitMessage
+from webkitpy.common.net.bugzilla import Bug, Attachment
+from webkitpy.thirdparty.mock import Mock
+from webkitpy.common.system.deprecated_logging import log
+
+
+def _id_to_object_dictionary(*objects):
+ dictionary = {}
+ for thing in objects:
+ dictionary[thing["id"]] = thing
+ return dictionary
+
+# Testing
+
+# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
+
+
+_patch1 = {
+ "id": 197,
+ "bug_id": 42,
+ "url": "http://example.com/197",
+ "name": "Patch1",
+ "is_obsolete": False,
+ "is_patch": True,
+ "review": "+",
+ "reviewer_email": "foo@bar.com",
+ "commit-queue": "+",
+ "committer_email": "foo@bar.com",
+ "attacher_email": "Contributer1",
+}
+
+
+_patch2 = {
+ "id": 128,
+ "bug_id": 42,
+ "url": "http://example.com/128",
+ "name": "Patch2",
+ "is_obsolete": False,
+ "is_patch": True,
+ "review": "+",
+ "reviewer_email": "foo@bar.com",
+ "commit-queue": "+",
+ "committer_email": "non-committer@example.com",
+ "attacher_email": "eric@webkit.org",
+}
+
+
+_patch3 = {
+ "id": 103,
+ "bug_id": 75,
+ "url": "http://example.com/103",
+ "name": "Patch3",
+ "is_obsolete": False,
+ "is_patch": True,
+ "review": "?",
+ "attacher_email": "eric@webkit.org",
+}
+
+
+_patch4 = {
+ "id": 104,
+ "bug_id": 77,
+ "url": "http://example.com/103",
+ "name": "Patch3",
+ "is_obsolete": False,
+ "is_patch": True,
+ "review": "+",
+ "commit-queue": "?",
+ "reviewer_email": "foo@bar.com",
+ "attacher_email": "Contributer2",
+}
+
+
+_patch5 = {
+ "id": 105,
+ "bug_id": 77,
+ "url": "http://example.com/103",
+ "name": "Patch5",
+ "is_obsolete": False,
+ "is_patch": True,
+ "review": "+",
+ "reviewer_email": "foo@bar.com",
+ "attacher_email": "eric@webkit.org",
+}
+
+
+_patch6 = { # Valid committer, but no reviewer.
+ "id": 106,
+ "bug_id": 77,
+ "url": "http://example.com/103",
+ "name": "ROLLOUT of r3489",
+ "is_obsolete": False,
+ "is_patch": True,
+ "commit-queue": "+",
+ "committer_email": "foo@bar.com",
+ "attacher_email": "eric@webkit.org",
+}
+
+
+_patch7 = { # Valid review, patch is marked obsolete.
+ "id": 107,
+ "bug_id": 76,
+ "url": "http://example.com/103",
+ "name": "Patch7",
+ "is_obsolete": True,
+ "is_patch": True,
+ "review": "+",
+ "reviewer_email": "foo@bar.com",
+ "attacher_email": "eric@webkit.org",
+}
+
+
+# This matches one of Bug.unassigned_emails
+_unassigned_email = "webkit-unassigned@lists.webkit.org"
+
+
+# FIXME: The ids should be 1, 2, 3 instead of crazy numbers.
+
+
+_bug1 = {
+ "id": 42,
+ "title": "Bug with two r+'d and cq+'d patches, one of which has an "
+ "invalid commit-queue setter.",
+ "assigned_to_email": _unassigned_email,
+ "attachments": [_patch1, _patch2],
+ "bug_status": "UNCONFIRMED",
+}
+
+
+_bug2 = {
+ "id": 75,
+ "title": "Bug with a patch needing review.",
+ "assigned_to_email": "foo@foo.com",
+ "attachments": [_patch3],
+ "bug_status": "ASSIGNED",
+}
+
+
+_bug3 = {
+ "id": 76,
+ "title": "The third bug",
+ "assigned_to_email": _unassigned_email,
+ "attachments": [_patch7],
+ "bug_status": "NEW",
+}
+
+
+_bug4 = {
+ "id": 77,
+ "title": "The fourth bug",
+ "assigned_to_email": "foo@foo.com",
+ "attachments": [_patch4, _patch5, _patch6],
+ "bug_status": "REOPENED",
+}
+
+
+# FIXME: This should not inherit from Mock
+class MockBugzillaQueries(Mock):
+
+ def __init__(self, bugzilla):
+ Mock.__init__(self)
+ self._bugzilla = bugzilla
+
+ def _all_bugs(self):
+ return map(lambda bug_dictionary: Bug(bug_dictionary, self._bugzilla),
+ self._bugzilla.bug_cache.values())
+
+ def fetch_bug_ids_from_commit_queue(self):
+ bugs_with_commit_queued_patches = filter(
+ lambda bug: bug.commit_queued_patches(),
+ self._all_bugs())
+ return map(lambda bug: bug.id(), bugs_with_commit_queued_patches)
+
+ def fetch_attachment_ids_from_review_queue(self):
+ unreviewed_patches = sum([bug.unreviewed_patches()
+ for bug in self._all_bugs()], [])
+ return map(lambda patch: patch.id(), unreviewed_patches)
+
+ def fetch_patches_from_commit_queue(self):
+ return sum([bug.commit_queued_patches()
+ for bug in self._all_bugs()], [])
+
+ def fetch_bug_ids_from_pending_commit_list(self):
+ bugs_with_reviewed_patches = filter(lambda bug: bug.reviewed_patches(),
+ self._all_bugs())
+ bug_ids = map(lambda bug: bug.id(), bugs_with_reviewed_patches)
+ # NOTE: This manual hack here is to allow testing logging in
+ # test_assign_to_committer the real pending-commit query on bugzilla
+ # will return bugs with patches which have r+, but are also obsolete.
+ return bug_ids + [76]
+
+ def fetch_patches_from_pending_commit_list(self):
+ return sum([bug.reviewed_patches() for bug in self._all_bugs()], [])
+
+
+_mock_reviewer = Reviewer("Foo Bar", "foo@bar.com")
+
+
+# FIXME: Bugzilla is the wrong Mock-point. Once we have a BugzillaNetwork
+# class we should mock that instead.
+# Most of this class is just copy/paste from Bugzilla.
+# FIXME: This should not inherit from Mock
+class MockBugzilla(Mock):
+
+ bug_server_url = "http://example.com"
+
+ bug_cache = _id_to_object_dictionary(_bug1, _bug2, _bug3, _bug4)
+
+ attachment_cache = _id_to_object_dictionary(_patch1,
+ _patch2,
+ _patch3,
+ _patch4,
+ _patch5,
+ _patch6,
+ _patch7)
+
+ def __init__(self):
+ Mock.__init__(self)
+ self.queries = MockBugzillaQueries(self)
+ self.committers = CommitterList(reviewers=[_mock_reviewer])
+ self._override_patch = None
+
+ def create_bug(self,
+ bug_title,
+ bug_description,
+ component=None,
+ diff=None,
+ patch_description=None,
+ cc=None,
+ blocked=None,
+ mark_for_review=False,
+ mark_for_commit_queue=False):
+ log("MOCK create_bug")
+ log("bug_title: %s" % bug_title)
+ log("bug_description: %s" % bug_description)
+
+ def quips(self):
+ return ["Good artists copy. Great artists steal. - Pablo Picasso"]
+
+ def fetch_bug(self, bug_id):
+ return Bug(self.bug_cache.get(bug_id), self)
+
+ def set_override_patch(self, patch):
+ self._override_patch = patch
+
+ def fetch_attachment(self, attachment_id):
+ if self._override_patch:
+ return self._override_patch
+
+ attachment_dictionary = self.attachment_cache.get(attachment_id)
+ if not attachment_dictionary:
+ print "MOCK: fetch_attachment: %s is not a known attachment id" % attachment_id
+ return None
+ bug = self.fetch_bug(attachment_dictionary["bug_id"])
+ for attachment in bug.attachments(include_obsolete=True):
+ if attachment.id() == int(attachment_id):
+ return attachment
+
+ def bug_url_for_bug_id(self, bug_id):
+ return "%s/%s" % (self.bug_server_url, bug_id)
+
+ def fetch_bug_dictionary(self, bug_id):
+ return self.bug_cache.get(bug_id)
+
+ def attachment_url_for_id(self, attachment_id, action="view"):
+ action_param = ""
+ if action and action != "view":
+ action_param = "&action=%s" % action
+ return "%s/%s%s" % (self.bug_server_url, attachment_id, action_param)
+
+ def set_flag_on_attachment(self,
+ attachment_id,
+ flag_name,
+ flag_value,
+ comment_text=None,
+ additional_comment_text=None):
+ log("MOCK setting flag '%s' to '%s' on attachment '%s' with comment '%s' and additional comment '%s'" % (
+ flag_name, flag_value, attachment_id, comment_text, additional_comment_text))
+
+ def post_comment_to_bug(self, bug_id, comment_text, cc=None):
+ log("MOCK bug comment: bug_id=%s, cc=%s\n--- Begin comment ---\n%s\n--- End comment ---\n" % (
+ bug_id, cc, comment_text))
+
+ def add_patch_to_bug(self,
+ bug_id,
+ diff,
+ description,
+ comment_text=None,
+ mark_for_review=False,
+ mark_for_commit_queue=False,
+ mark_for_landing=False):
+ log("MOCK add_patch_to_bug: bug_id=%s, description=%s, mark_for_review=%s, mark_for_commit_queue=%s, mark_for_landing=%s" %
+ (bug_id, description, mark_for_review, mark_for_commit_queue, mark_for_landing))
+ log("-- Begin comment --")
+ log(comment_text)
+ log("-- End comment --")
+
+
+class MockBuilder(object):
+ def __init__(self, name):
+ self._name = name
+
+ def name(self):
+ return self._name
+
+ def results_url(self):
+ return "http://example.com/builders/%s/results/" % self.name()
+
+ def force_build(self, username, comments):
+ log("MOCK: force_build: name=%s, username=%s, comments=%s" % (
+ self._name, username, comments))
+
+
+class MockFailureMap(object):
+ def __init__(self, buildbot):
+ self._buildbot = buildbot
+
+ def is_empty(self):
+ return False
+
+ def filter_out_old_failures(self, is_old_revision):
+ pass
+
+ def failing_revisions(self):
+ return [29837]
+
+ def builders_failing_for(self, revision):
+ return [self._buildbot.builder_with_name("Builder1")]
+
+ def tests_failing_for(self, revision):
+ return ["mock-test-1"]
+
+
+class MockBuildBot(object):
+ buildbot_host = "dummy_buildbot_host"
+ def __init__(self):
+ self._mock_builder1_status = {
+ "name": "Builder1",
+ "is_green": True,
+ "activity": "building",
+ }
+ self._mock_builder2_status = {
+ "name": "Builder2",
+ "is_green": True,
+ "activity": "idle",
+ }
+
+ def builder_with_name(self, name):
+ return MockBuilder(name)
+
+ def builder_statuses(self):
+ return [
+ self._mock_builder1_status,
+ self._mock_builder2_status,
+ ]
+
+ def red_core_builders_names(self):
+ if not self._mock_builder2_status["is_green"]:
+ return [self._mock_builder2_status["name"]]
+ return []
+
+ def red_core_builders(self):
+ if not self._mock_builder2_status["is_green"]:
+ return [self._mock_builder2_status]
+ return []
+
+ def idle_red_core_builders(self):
+ if not self._mock_builder2_status["is_green"]:
+ return [self._mock_builder2_status]
+ return []
+
+ def last_green_revision(self):
+ return 9479
+
+ def light_tree_on_fire(self):
+ self._mock_builder2_status["is_green"] = False
+
+ def failure_map(self):
+ return MockFailureMap(self)
+
+
+# FIXME: This should not inherit from Mock
+class MockSCM(Mock):
+
+ fake_checkout_root = os.path.realpath("/tmp") # realpath is needed to allow for Mac OS X's /private/tmp
+
+ def __init__(self):
+ Mock.__init__(self)
+ # FIXME: We should probably use real checkout-root detection logic here.
+ # os.getcwd() can't work here because other parts of the code assume that "checkout_root"
+ # will actually be the root. Since getcwd() is wrong, use a globally fake root for now.
+ self.checkout_root = self.fake_checkout_root
+
+ def changed_files(self, git_commit=None):
+ return ["MockFile1"]
+
+ def create_patch(self, git_commit, changed_files=None):
+ return "Patch1"
+
+ def commit_ids_from_commitish_arguments(self, args):
+ return ["Commitish1", "Commitish2"]
+
+ def commit_message_for_local_commit(self, commit_id):
+ if commit_id == "Commitish1":
+ return CommitMessage("CommitMessage1\n" \
+ "https://bugs.example.org/show_bug.cgi?id=42\n")
+ if commit_id == "Commitish2":
+ return CommitMessage("CommitMessage2\n" \
+ "https://bugs.example.org/show_bug.cgi?id=75\n")
+ raise Exception("Bogus commit_id in commit_message_for_local_commit.")
+
+ def diff_for_revision(self, revision):
+ return "DiffForRevision%s\n" \
+ "http://bugs.webkit.org/show_bug.cgi?id=12345" % revision
+
+ def svn_revision_from_commit_text(self, commit_text):
+ return "49824"
+
+
+class MockCheckout(object):
+
+ _committer_list = CommitterList()
+
+ def commit_info_for_revision(self, svn_revision):
+ # The real Checkout would probably throw an exception, but this is the only way tests have to get None back at the moment.
+ if not svn_revision:
+ return None
+ return CommitInfo(svn_revision, "eric@webkit.org", {
+ "bug_id": 42,
+ "author_name": "Adam Barth",
+ "author_email": "abarth@webkit.org",
+ "author": self._committer_list.committer_by_email("abarth@webkit.org"),
+ "reviewer_text": "Darin Adler",
+ "reviewer": self._committer_list.committer_by_name("Darin Adler"),
+ })
+
+ def bug_id_for_revision(self, svn_revision):
+ return 12345
+
+ def recent_commit_infos_for_files(self, paths):
+ return [self.commit_info_for_revision(32)]
+
+ def modified_changelogs(self, git_commit, changed_files=None):
+ # Ideally we'd return something more interesting here. The problem is
+ # that LandDiff will try to actually read the patch from disk!
+ return []
+
+ def commit_message_for_this_commit(self, git_commit, changed_files=None):
+ commit_message = Mock()
+ commit_message.message = lambda:"This is a fake commit message that is at least 50 characters."
+ return commit_message
+
+ def apply_patch(self, patch, force=False):
+ pass
+
+ def apply_reverse_diff(self, revision):
+ pass
+
+ def suggested_reviewers(self, git_commit, changed_files=None):
+ return [_mock_reviewer]
+
+
+class MockUser(object):
+
+ @staticmethod
+ def prompt(message, repeat=1, raw_input=raw_input):
+ return "Mock user response"
+
+ def edit(self, files):
+ pass
+
+ def edit_changelog(self, files):
+ pass
+
+ def page(self, message):
+ pass
+
+ def confirm(self, message=None, default='y'):
+ print message
+ return default == 'y'
+
+ def can_open_url(self):
+ return True
+
+ def open_url(self, url):
+ if url.startswith("file://"):
+ log("MOCK: user.open_url: file://...")
+ return
+ log("MOCK: user.open_url: %s" % url)
+
+
+class MockIRC(object):
+
+ def post(self, message):
+ log("MOCK: irc.post: %s" % message)
+
+ def disconnect(self):
+ log("MOCK: irc.disconnect")
+
+
+class MockStatusServer(object):
+
+ def __init__(self, bot_id=None, work_items=None):
+ self.host = "example.com"
+ self.bot_id = bot_id
+ self._work_items = work_items or []
+
+ def patch_status(self, queue_name, patch_id):
+ return None
+
+ def svn_revision(self, svn_revision):
+ return None
+
+ def next_work_item(self, queue_name):
+ if not self._work_items:
+ return None
+ return self._work_items.pop(0)
+
+ def release_work_item(self, queue_name, patch):
+ log("MOCK: release_work_item: %s %s" % (queue_name, patch.id()))
+
+ def update_work_items(self, queue_name, work_items):
+ self._work_items = work_items
+ log("MOCK: update_work_items: %s %s" % (queue_name, work_items))
+
+ def submit_to_ews(self, patch_id):
+ log("MOCK: submit_to_ews: %s" % (patch_id))
+
+ def update_status(self, queue_name, status, patch=None, results_file=None):
+ log("MOCK: update_status: %s %s" % (queue_name, status))
+ return 187
+
+ def update_svn_revision(self, svn_revision, broken_bot):
+ return 191
+
+ def results_url_for_status(self, status_id):
+ return "http://dummy_url"
+
+
+# FIXME: This should not inherit from Mock
+# FIXME: Unify with common.system.executive_mock.MockExecutive.
+class MockExecutive(Mock):
+ def __init__(self, should_log):
+ self._should_log = should_log
+
+ def run_and_throw_if_fail(self, args, quiet=False):
+ if self._should_log:
+ log("MOCK run_and_throw_if_fail: %s" % args)
+ return "MOCK output of child process"
+
+ def run_command(self,
+ args,
+ cwd=None,
+ input=None,
+ error_handler=None,
+ return_exit_code=False,
+ return_stderr=True,
+ decode_output=False):
+ if self._should_log:
+ log("MOCK run_command: %s" % args)
+ return "MOCK output of child process"
+
+
+class MockOptions(object):
+ """Mock implementation of optparse.Values."""
+
+ def __init__(self, **kwargs):
+ # The caller can set option values using keyword arguments. We don't
+ # set any values by default because we don't know how this
+ # object will be used. Generally speaking unit tests should
+ # subclass this or provider wrapper functions that set a common
+ # set of options.
+ for key, value in kwargs.items():
+ self.__dict__[key] = value
+
+
+class MockTestPort1(object):
+
+ def skips_layout_test(self, test_name):
+ return test_name in ["media/foo/bar.html", "foo"]
+
+
+class MockTestPort2(object):
+
+ def skips_layout_test(self, test_name):
+ return test_name == "media/foo/bar.html"
+
+
+class MockPortFactory(object):
+
+ def get_all(self, options=None):
+ return {"test_port1": MockTestPort1(), "test_port2": MockTestPort2()}
+
+
+class MockTool(object):
+
+ def __init__(self, log_executive=False):
+ self.wakeup_event = threading.Event()
+ self.bugs = MockBugzilla()
+ self.buildbot = MockBuildBot()
+ self.executive = MockExecutive(should_log=log_executive)
+ self._irc = None
+ self.user = MockUser()
+ self._scm = MockSCM()
+ self._checkout = MockCheckout()
+ self.status_server = MockStatusServer()
+ self.irc_password = "MOCK irc password"
+ self.port_factory = MockPortFactory()
+
+ def scm(self):
+ return self._scm
+
+ def checkout(self):
+ return self._checkout
+
+ def ensure_irc_connected(self, delegate):
+ if not self._irc:
+ self._irc = MockIRC()
+
+ def irc(self):
+ return self._irc
+
+ def path(self):
+ return "echo"
+
+ def port(self):
+ return Mock()
+
+
+class MockBrowser(object):
+ params = {}
+
+ def open(self, url):
+ pass
+
+ def select_form(self, name):
+ pass
+
+ def __setitem__(self, key, value):
+ self.params[key] = value
+
+ def submit(self):
+ return Mock(file)
diff --git a/WebKitTools/Scripts/webkitpy/tool/mocktool_unittest.py b/WebKitTools/Scripts/webkitpy/tool/mocktool_unittest.py
new file mode 100644
index 0000000..cceaa2e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/mocktool_unittest.py
@@ -0,0 +1,59 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from mocktool import MockOptions
+
+
+class MockOptionsTest(unittest.TestCase):
+ # MockOptions() should implement the same semantics that
+ # optparse.Values does.
+
+ def test_get__set(self):
+ # Test that we can still set options after we construct the
+ # object.
+ options = MockOptions()
+ options.foo = 'bar'
+ self.assertEqual(options.foo, 'bar')
+
+ def test_get__unset(self):
+ # Test that unset options raise an exception (regular Mock
+ # objects return an object and hence are different from
+ # optparse.Values()).
+ options = MockOptions()
+ self.assertRaises(AttributeError, lambda: options.foo)
+
+ def test_kwarg__set(self):
+ # Test that keyword arguments work in the constructor.
+ options = MockOptions(foo='bar')
+ self.assertEqual(options.foo, 'bar')
+
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/Scripts/webkitpy/multicommandtool.py b/WebKitTools/Scripts/webkitpy/tool/multicommandtool.py
index 10cf426..4848ae5 100644
--- a/WebKitTools/Scripts/webkitpy/multicommandtool.py
+++ b/WebKitTools/Scripts/webkitpy/tool/multicommandtool.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -35,8 +35,12 @@ import sys
from optparse import OptionParser, IndentedHelpFormatter, SUPPRESS_USAGE, make_option
-from webkitpy.grammar import pluralize
-from webkitpy.webkit_logging import log
+from webkitpy.tool.grammar import pluralize
+from webkitpy.common.system.deprecated_logging import log
+
+
+class TryAgain(Exception):
+ pass
class Command(object):
@@ -49,7 +53,7 @@ class Command(object):
self.required_arguments = self._parse_required_arguments(argument_names)
self.options = options
self.requires_local_commits = requires_local_commits
- self.tool = None
+ self._tool = None
# option_parser can be overriden by the tool using set_option_parser
# This default parser will be used for standalone_help printing.
self.option_parser = HelpPrintingOptionParser(usage=SUPPRESS_USAGE, add_help_option=False, option_list=self.options)
@@ -69,9 +73,9 @@ class Command(object):
# The tool calls bind_to_tool on each Command after adding it to its list.
def bind_to_tool(self, tool):
# Command instances can only be bound to one tool at a time.
- if self.tool and tool != self.tool:
+ if self._tool and tool != self._tool:
raise Exception("Command already bound to tool!")
- self.tool = tool
+ self._tool = tool
@staticmethod
def _parse_required_arguments(argument_names):
@@ -175,17 +179,17 @@ class HelpCommand(AbstractDeclarativeCommand):
# Only show commands which are relevant to this checkout's SCM system. Might this be confusing to some users?
if self.show_all_commands:
epilog = "All %prog commands:\n"
- relevant_commands = self.tool.commands[:]
+ relevant_commands = self._tool.commands[:]
else:
epilog = "Common %prog commands:\n"
- relevant_commands = filter(self.tool.should_show_in_main_help, self.tool.commands)
+ relevant_commands = filter(self._tool.should_show_in_main_help, self._tool.commands)
longest_name_length = max(map(lambda command: len(command.name), relevant_commands))
relevant_commands.sort(lambda a, b: cmp(a.name, b.name))
command_help_texts = map(lambda command: " %s %s\n" % (command.name.ljust(longest_name_length), command.help_text), relevant_commands)
epilog += "%s\n" % "".join(command_help_texts)
epilog += "See '%prog help --all-commands' to list all commands.\n"
epilog += "See '%prog help COMMAND' for more information on a specific command.\n"
- return epilog.replace("%prog", self.tool.name()) # Use of %prog here mimics OptionParser.expand_prog_name().
+ return epilog.replace("%prog", self._tool.name()) # Use of %prog here mimics OptionParser.expand_prog_name().
# FIXME: This is a hack so that we don't show --all-commands as a global option:
def _remove_help_options(self):
@@ -194,7 +198,7 @@ class HelpCommand(AbstractDeclarativeCommand):
def execute(self, options, args, tool):
if args:
- command = self.tool.command_by_name(args[0])
+ command = self._tool.command_by_name(args[0])
if command:
print command.standalone_help()
return 0
@@ -263,6 +267,9 @@ class MultiCommandTool(object):
def path(self):
raise NotImplementedError, "subclasses must implement"
+ def command_completed(self):
+ pass
+
def should_show_in_main_help(self, command):
return command.show_in_main_help
@@ -296,4 +303,12 @@ class MultiCommandTool(object):
log(failure_reason)
return 0 # FIXME: Should this really be 0?
- return command.check_arguments_and_execute(options, args, self)
+ while True:
+ try:
+ result = command.check_arguments_and_execute(options, args, self)
+ break
+ except TryAgain, e:
+ pass
+
+ self.command_completed()
+ return result
diff --git a/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py b/WebKitTools/Scripts/webkitpy/tool/multicommandtool_unittest.py
index ae77e73..c19095c 100644
--- a/WebKitTools/Scripts/webkitpy/multicommandtool_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/multicommandtool_unittest.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
+# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -28,11 +28,13 @@
import sys
import unittest
-from multicommandtool import MultiCommandTool, Command
-from webkitpy.outputcapture import OutputCapture
from optparse import make_option
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.multicommandtool import MultiCommandTool, Command, TryAgain
+
+
class TrivialCommand(Command):
name = "trivial"
show_in_main_help = True
@@ -42,10 +44,26 @@ class TrivialCommand(Command):
def execute(self, options, args, tool):
pass
+
class UncommonCommand(TrivialCommand):
name = "uncommon"
show_in_main_help = False
+
+class LikesToRetry(Command):
+ name = "likes-to-retry"
+ show_in_main_help = True
+
+ def __init__(self, **kwargs):
+ Command.__init__(self, "help text", **kwargs)
+ self.execute_count = 0
+
+ def execute(self, options, args, tool):
+ self.execute_count += 1
+ if self.execute_count < 2:
+ raise TryAgain()
+
+
class CommandTest(unittest.TestCase):
def test_name_with_arguments(self):
command_with_args = TrivialCommand(argument_names="ARG1 ARG2")
@@ -72,7 +90,7 @@ class TrivialTool(MultiCommandTool):
def __init__(self, commands=None):
MultiCommandTool.__init__(self, name="trivial-tool", commands=commands)
- def path():
+ def path(self):
return __file__
def should_execute_command(self, command):
@@ -107,6 +125,12 @@ class MultiCommandToolTest(unittest.TestCase):
exit_code = OutputCapture().assert_outputs(self, tool.main, [main_args], expected_stdout=expected_stdout, expected_stderr=expected_stderr)
self.assertEqual(exit_code, expected_exit_code)
+ def test_retry(self):
+ likes_to_retry = LikesToRetry()
+ tool = TrivialTool(commands=[likes_to_retry])
+ tool.main(["tool", "likes-to-retry"])
+ self.assertEqual(likes_to_retry.execute_count, 2)
+
def test_global_help(self):
tool = TrivialTool(commands=[TrivialCommand(), UncommonCommand()])
expected_common_commands_help = """Usage: trivial-tool [options] COMMAND [ARGS]
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py b/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py
new file mode 100644
index 0000000..64d9d05
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/__init__.py
@@ -0,0 +1,59 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# FIXME: Is this the right way to do this?
+from webkitpy.tool.steps.applypatch import ApplyPatch
+from webkitpy.tool.steps.applypatchwithlocalcommit import ApplyPatchWithLocalCommit
+from webkitpy.tool.steps.build import Build
+from webkitpy.tool.steps.checkstyle import CheckStyle
+from webkitpy.tool.steps.cleanworkingdirectory import CleanWorkingDirectory
+from webkitpy.tool.steps.cleanworkingdirectorywithlocalcommits import CleanWorkingDirectoryWithLocalCommits
+from webkitpy.tool.steps.closebug import CloseBug
+from webkitpy.tool.steps.closebugforlanddiff import CloseBugForLandDiff
+from webkitpy.tool.steps.closepatch import ClosePatch
+from webkitpy.tool.steps.commit import Commit
+from webkitpy.tool.steps.confirmdiff import ConfirmDiff
+from webkitpy.tool.steps.createbug import CreateBug
+from webkitpy.tool.steps.editchangelog import EditChangeLog
+from webkitpy.tool.steps.ensurebuildersaregreen import EnsureBuildersAreGreen
+from webkitpy.tool.steps.ensurelocalcommitifneeded import EnsureLocalCommitIfNeeded
+from webkitpy.tool.steps.obsoletepatches import ObsoletePatches
+from webkitpy.tool.steps.options import Options
+from webkitpy.tool.steps.postdiff import PostDiff
+from webkitpy.tool.steps.postdiffforcommit import PostDiffForCommit
+from webkitpy.tool.steps.postdiffforrevert import PostDiffForRevert
+from webkitpy.tool.steps.preparechangelogforrevert import PrepareChangeLogForRevert
+from webkitpy.tool.steps.preparechangelog import PrepareChangeLog
+from webkitpy.tool.steps.promptforbugortitle import PromptForBugOrTitle
+from webkitpy.tool.steps.reopenbugafterrollout import ReopenBugAfterRollout
+from webkitpy.tool.steps.revertrevision import RevertRevision
+from webkitpy.tool.steps.runtests import RunTests
+from webkitpy.tool.steps.suggestreviewers import SuggestReviewers
+from webkitpy.tool.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
+from webkitpy.tool.steps.update import Update
+from webkitpy.tool.steps.validatereviewer import ValidateReviewer
diff --git a/WebKitTools/Scripts/webkitpy/steps/abstractstep.py b/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py
index 639cf55..5525ea0 100644
--- a/WebKitTools/Scripts/webkitpy/steps/abstractstep.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/abstractstep.py
@@ -26,31 +26,33 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.webkit_logging import log
-from webkitpy.webkitport import WebKitPort
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.config.ports import WebKitPort
+from webkitpy.tool.steps.options import Options
class AbstractStep(object):
def __init__(self, tool, options):
self._tool = tool
self._options = options
- self._port = None
- def _run_script(self, script_name, quiet=False, port=WebKitPort):
+ # FIXME: This should use tool.port()
+ def _run_script(self, script_name, args=None, quiet=False, port=WebKitPort):
log("Running %s" % script_name)
- # FIXME: This should use self.port()
- self._tool.executive.run_and_throw_if_fail(port.script_path(script_name), quiet)
+ command = [port.script_path(script_name)]
+ if args:
+ command.extend(args)
+ self._tool.executive.run_and_throw_if_fail(command, quiet)
- # FIXME: The port should live on the tool.
- def port(self):
- if self._port:
- return self._port
- self._port = WebKitPort.port(self._options.port)
- return self._port
+ def _changed_files(self, state):
+ return self.cached_lookup(state, "changed_files")
_well_known_keys = {
- "diff" : lambda self: self._tool.scm().create_patch(),
- "changelogs" : lambda self: self._tool.scm().modified_changelogs(),
+ "bug_title": lambda self, state: self._tool.bugs.fetch_bug(state["bug_id"]).title(),
+ "changed_files": lambda self, state: self._tool.scm().changed_files(self._options.git_commit),
+ "diff": lambda self, state: self._tool.scm().create_patch(self._options.git_commit, changed_files=self._changed_files(state)),
+ "changelogs": lambda self, state: self._tool.checkout().modified_changelogs(self._options.git_commit, changed_files=self._changed_files(state)),
}
def cached_lookup(self, state, key, promise=None):
@@ -58,12 +60,20 @@ class AbstractStep(object):
return state[key]
if not promise:
promise = self._well_known_keys.get(key)
- state[key] = promise(self)
+ state[key] = promise(self, state)
return state[key]
+ def did_modify_checkout(self, state):
+ state["diff"] = None
+ state["changelogs"] = None
+ state["changed_files"] = None
+
@classmethod
def options(cls):
- return []
+ return [
+ # We need this option here because cached_lookup uses it. :(
+ Options.git_commit,
+ ]
def run(self, state):
raise NotImplementedError, "subclasses must implement"
diff --git a/WebKitTools/Scripts/webkitpy/steps/applypatch.py b/WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py
index aba81ae..327ac09 100644
--- a/WebKitTools/Scripts/webkitpy/steps/applypatch.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/applypatch.py
@@ -26,17 +26,18 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
class ApplyPatch(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.non_interactive,
+ Options.force_patch,
]
def run(self, state):
log("Processing patch %s from bug %s." % (state["patch"].id(), state["patch"].bug_id()))
- self._tool.scm().apply_patch(state["patch"], force=self._options.non_interactive)
+ self._tool.checkout().apply_patch(state["patch"], force=self._options.non_interactive or self._options.force_patch)
diff --git a/WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.py b/WebKitTools/Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py
index bfaf52a..3dcd8d9 100644
--- a/WebKitTools/Scripts/webkitpy/steps/applypatchwithlocalcommit.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/applypatchwithlocalcommit.py
@@ -26,18 +26,18 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.applypatch import ApplyPatch
-from webkitpy.steps.options import Options
+from webkitpy.tool.steps.applypatch import ApplyPatch
+from webkitpy.tool.steps.options import Options
class ApplyPatchWithLocalCommit(ApplyPatch):
@classmethod
def options(cls):
- return [
+ return ApplyPatch.options() + [
Options.local_commit,
- ] + ApplyPatch.options()
+ ]
def run(self, state):
ApplyPatch.run(self, state)
if self._options.local_commit:
- commit_message = self._tool.scm().commit_message_for_this_commit()
+ commit_message = self._tool.checkout().commit_message_for_this_commit(git_commit=None)
self._tool.scm().commit_locally_with_message(commit_message.message() or state["patch"].name())
diff --git a/WebKitTools/Scripts/webkitpy/steps/build.py b/WebKitTools/Scripts/webkitpy/tool/steps/build.py
index 1823cff..0990b8b 100644
--- a/WebKitTools/Scripts/webkitpy/steps/build.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/build.py
@@ -26,22 +26,22 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
class Build(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.build,
Options.quiet,
Options.build_style,
]
def build(self, build_style):
- self._tool.executive.run_and_throw_if_fail(self.port().build_webkit_command(build_style=build_style), self._options.quiet)
+ self._tool.executive.run_and_throw_if_fail(self._tool.port().build_webkit_command(build_style=build_style), self._options.quiet)
def run(self, state):
if not self._options.build:
diff --git a/WebKitTools/Scripts/webkitpy/steps/checkstyle.py b/WebKitTools/Scripts/webkitpy/tool/steps/checkstyle.py
index c8e20f8..af66c50 100644
--- a/WebKitTools/Scripts/webkitpy/steps/checkstyle.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/checkstyle.py
@@ -28,25 +28,35 @@
import os
-from webkitpy.executive import ScriptError
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import error
class CheckStyle(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.non_interactive,
Options.check_style,
+ Options.git_commit,
]
def run(self, state):
if not self._options.check_style:
return
os.chdir(self._tool.scm().checkout_root)
+
+ args = []
+ if self._options.git_commit:
+ args.append("--git-commit")
+ args.append(self._options.git_commit)
+
+ args.append("--diff-files")
+ args.extend(self._changed_files(state))
+
try:
- self._run_script("check-webkit-style")
+ self._run_script("check-webkit-style", args)
except ScriptError, e:
if self._options.non_interactive:
# We need to re-raise the exception here to have the
diff --git a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.py b/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectory.py
index 88e38f5..e13fbc2 100644
--- a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectory.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectory.py
@@ -28,8 +28,8 @@
import os
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
class CleanWorkingDirectory(AbstractStep):
@@ -39,7 +39,7 @@ class CleanWorkingDirectory(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.force_clean,
Options.clean,
]
diff --git a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py b/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectorywithlocalcommits.py
index cabeba2..f06f94e 100644
--- a/WebKitTools/Scripts/webkitpy/steps/cleanworkingdirectorywithlocalcommits.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/cleanworkingdirectorywithlocalcommits.py
@@ -26,7 +26,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.cleanworkingdirectory import CleanWorkingDirectory
+from webkitpy.tool.steps.cleanworkingdirectory import CleanWorkingDirectory
class CleanWorkingDirectoryWithLocalCommits(CleanWorkingDirectory):
def __init__(self, tool, options):
diff --git a/WebKitTools/Scripts/webkitpy/steps/closebug.py b/WebKitTools/Scripts/webkitpy/tool/steps/closebug.py
index 2640ee3..e77bc24 100644
--- a/WebKitTools/Scripts/webkitpy/steps/closebug.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/closebug.py
@@ -26,15 +26,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
class CloseBug(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.close_bug,
]
diff --git a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.py b/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff.py
index 43a0c66..e5a68db 100644
--- a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff.py
@@ -26,16 +26,16 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.comments import bug_comment_from_commit_text
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
+from webkitpy.tool.comments import bug_comment_from_commit_text
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
class CloseBugForLandDiff(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.close_bug,
]
diff --git a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py
index 73561ab..0a56564 100644
--- a/WebKitTools/Scripts/webkitpy/steps/closebugforlanddiff_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/closebugforlanddiff_unittest.py
@@ -28,14 +28,13 @@
import unittest
-from webkitpy.steps.closebugforlanddiff import CloseBugForLandDiff
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockOptions, MockTool
+from webkitpy.tool.steps.closebugforlanddiff import CloseBugForLandDiff
class CloseBugForLandDiffTest(unittest.TestCase):
def test_empty_state(self):
capture = OutputCapture()
- step = CloseBugForLandDiff(MockBugzillaTool(), Mock())
+ step = CloseBugForLandDiff(MockTool(), MockOptions())
expected_stderr = "Committed r49824: <http://trac.webkit.org/changeset/49824>\nNo bug id provided.\n"
capture.assert_outputs(self, step.run, [{"commit_text" : "Mock commit text"}], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/steps/closepatch.py b/WebKitTools/Scripts/webkitpy/tool/steps/closepatch.py
index f20fe7e..ff94df8 100644
--- a/WebKitTools/Scripts/webkitpy/steps/closepatch.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/closepatch.py
@@ -26,8 +26,8 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.comments import bug_comment_from_commit_text
-from webkitpy.steps.abstractstep import AbstractStep
+from webkitpy.tool.comments import bug_comment_from_commit_text
+from webkitpy.tool.steps.abstractstep import AbstractStep
class ClosePatch(AbstractStep):
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/commit.py b/WebKitTools/Scripts/webkitpy/tool/steps/commit.py
new file mode 100644
index 0000000..5c6bdb7
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/commit.py
@@ -0,0 +1,81 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from webkitpy.common.checkout.changelog import view_source_url
+from webkitpy.common.checkout.scm import AuthenticationError, AmbiguousCommitError
+from webkitpy.common.system.deprecated_logging import log
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.common.system.user import User
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+
+
+class Commit(AbstractStep):
+ @classmethod
+ def options(cls):
+ return AbstractStep.options() + [
+ Options.git_commit,
+ ]
+
+ def _commit_warning(self, error):
+ working_directory_message = "" if error.working_directory_is_clean else " and working copy changes"
+ return ('There are %s local commits%s. Everything will be committed as a single commit. '
+ 'To avoid this prompt, set "git config webkit-patch.commit-should-always-squash true".' % (
+ error.num_local_commits, working_directory_message))
+
+ def run(self, state):
+ self._commit_message = self._tool.checkout().commit_message_for_this_commit(self._options.git_commit).message()
+ if len(self._commit_message) < 50:
+ raise Exception("Attempted to commit with a commit message shorter than 50 characters. Either your patch is missing a ChangeLog or webkit-patch may have a bug.")
+
+ self._state = state
+
+ username = None
+ force_squash = False
+
+ num_tries = 0
+ while num_tries < 3:
+ num_tries += 1
+
+ try:
+ scm = self._tool.scm()
+ commit_text = scm.commit_with_message(self._commit_message, git_commit=self._options.git_commit, username=username, force_squash=force_squash)
+ svn_revision = scm.svn_revision_from_commit_text(commit_text)
+ log("Committed r%s: <%s>" % (svn_revision, view_source_url(svn_revision)))
+ self._state["commit_text"] = commit_text
+ break;
+ except AmbiguousCommitError, e:
+ if self._tool.user.confirm(self._commit_warning(e)):
+ force_squash = True
+ else:
+ # This will correctly interrupt the rest of the commit process.
+ raise ScriptError(message="Did not commit")
+ except AuthenticationError, e:
+ username = self._tool.user.prompt("%s login: " % e.server_host, repeat=5)
+ if not username:
+ raise ScriptError("You need to specify the username on %s to perform the commit as." % self.svn_server_host)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/confirmdiff.py b/WebKitTools/Scripts/webkitpy/tool/steps/confirmdiff.py
new file mode 100644
index 0000000..7e8e348
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/confirmdiff.py
@@ -0,0 +1,77 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import urllib
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.prettypatch import PrettyPatch
+from webkitpy.common.system import logutils
+from webkitpy.common.system.executive import ScriptError
+
+
+_log = logutils.get_logger(__file__)
+
+
+class ConfirmDiff(AbstractStep):
+ @classmethod
+ def options(cls):
+ return AbstractStep.options() + [
+ Options.confirm,
+ ]
+
+ def _show_pretty_diff(self, diff):
+ if not self._tool.user.can_open_url():
+ return None
+
+ try:
+ pretty_patch = PrettyPatch(self._tool.executive,
+ self._tool.scm().checkout_root)
+ pretty_diff_file = pretty_patch.pretty_diff_file(diff)
+ url = "file://%s" % urllib.quote(pretty_diff_file.name)
+ self._tool.user.open_url(url)
+ # We return the pretty_diff_file here because we need to keep the
+ # file alive until the user has had a chance to confirm the diff.
+ return pretty_diff_file
+ except ScriptError, e:
+ _log.warning("PrettyPatch failed. :(")
+ except OSError, e:
+ _log.warning("PrettyPatch unavailable.")
+
+ def run(self, state):
+ if not self._options.confirm:
+ return
+ diff = self.cached_lookup(state, "diff")
+ pretty_diff_file = self._show_pretty_diff(diff)
+ if not pretty_diff_file:
+ self._tool.user.page(diff)
+ diff_correct = self._tool.user.confirm("Was that diff correct?")
+ if pretty_diff_file:
+ pretty_diff_file.close()
+ if not diff_correct:
+ exit(1)
diff --git a/WebKitTools/Scripts/webkitpy/steps/createbug.py b/WebKitTools/Scripts/webkitpy/tool/steps/createbug.py
index 75bf17f..0ab6f68 100644
--- a/WebKitTools/Scripts/webkitpy/steps/createbug.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/createbug.py
@@ -26,20 +26,27 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
class CreateBug(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.cc,
Options.component,
+ Options.blocks,
]
def run(self, state):
# No need to create a bug if we already have one.
if state.get("bug_id"):
return
- state["bug_id"] = self._tool.bugs.create_bug(state["bug_title"], state["bug_description"], component=self._options.component, cc=self._options.cc)
+ cc = self._options.cc
+ if not cc:
+ cc = state.get("bug_cc")
+ blocks = self._options.blocks
+ if not blocks:
+ blocks = state.get("bug_blocked")
+ state["bug_id"] = self._tool.bugs.create_bug(state["bug_title"], state["bug_description"], blocked=blocks, component=self._options.component, cc=cc)
diff --git a/WebKitTools/Scripts/webkitpy/steps/editchangelog.py b/WebKitTools/Scripts/webkitpy/tool/steps/editchangelog.py
index d545c72..4d9646f 100644
--- a/WebKitTools/Scripts/webkitpy/steps/editchangelog.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/editchangelog.py
@@ -28,10 +28,11 @@
import os
-from webkitpy.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.abstractstep import AbstractStep
class EditChangeLog(AbstractStep):
def run(self, state):
os.chdir(self._tool.scm().checkout_root)
- self._tool.user.edit(self.cached_lookup(state, "changelogs"))
+ self._tool.user.edit_changelog(self.cached_lookup(state, "changelogs"))
+ self.did_modify_checkout(state)
diff --git a/WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.py b/WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py
index 96f265a..a4fc174 100644
--- a/WebKitTools/Scripts/webkitpy/steps/ensurebuildersaregreen.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/ensurebuildersaregreen.py
@@ -26,15 +26,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log, error
class EnsureBuildersAreGreen(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.check_builders,
]
@@ -45,4 +45,4 @@ class EnsureBuildersAreGreen(AbstractStep):
if not red_builders_names:
return
red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names.
- error("Builders [%s] are red, please do not commit.\nSee http://%s.\nPass --ignore-builders to bypass this check." % (", ".join(red_builders_names), self._tool.buildbot.buildbot_host))
+ log("\nWARNING: Builders [%s] are red, please watch your commit carefully.\nSee http://%s/console?category=core\n" % (", ".join(red_builders_names), self._tool.buildbot.buildbot_host))
diff --git a/WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.py b/WebKitTools/Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py
index cecf891..d0cda46 100644
--- a/WebKitTools/Scripts/webkitpy/steps/ensurelocalcommitifneeded.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/ensurelocalcommitifneeded.py
@@ -26,15 +26,15 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import error
class EnsureLocalCommitIfNeeded(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.local_commit,
]
diff --git a/WebKitTools/Scripts/webkitpy/steps/metastep.py b/WebKitTools/Scripts/webkitpy/tool/steps/metastep.py
index 9f368de..7cbd1c5 100644
--- a/WebKitTools/Scripts/webkitpy/steps/metastep.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/metastep.py
@@ -26,7 +26,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.abstractstep import AbstractStep
# FIXME: Unify with StepSequence? I'm not sure yet which is the better design.
diff --git a/WebKitTools/Scripts/webkitpy/steps/obsoletepatches.py b/WebKitTools/Scripts/webkitpy/tool/steps/obsoletepatches.py
index dbdbabd..de508c6 100644
--- a/WebKitTools/Scripts/webkitpy/steps/obsoletepatches.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/obsoletepatches.py
@@ -26,16 +26,16 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.grammar import pluralize
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
class ObsoletePatches(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.obsolete_patches,
]
diff --git a/WebKitTools/Scripts/webkitpy/steps/options.py b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
index 8b28f27..4f17dd3 100644
--- a/WebKitTools/Scripts/webkitpy/steps/options.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/options.py
@@ -29,28 +29,31 @@
from optparse import make_option
class Options(object):
- build = make_option("--no-build", action="store_false", dest="build", default=True, help="Commit without building first, implies --no-test.")
+ blocks = make_option("--blocks", action="store", dest="blocks", default=None, help="Bug number which the created bug blocks.")
+ build = make_option("--build", action="store_true", dest="build", default=False, help="Build and run run-webkit-tests before committing.")
build_style = make_option("--build-style", action="store", dest="build_style", default=None, help="Whether to build debug, release, or both.")
cc = make_option("--cc", action="store", type="string", dest="cc", help="Comma-separated list of email addresses to carbon-copy.")
check_builders = make_option("--ignore-builders", action="store_false", dest="check_builders", default=True, help="Don't check to see if the build.webkit.org builders are green before landing.")
check_style = make_option("--ignore-style", action="store_false", dest="check_style", default=True, help="Don't check to see if the patch has proper style before uploading.")
clean = make_option("--no-clean", action="store_false", dest="clean", default=True, help="Don't check if the working directory is clean before applying patches")
close_bug = make_option("--no-close", action="store_false", dest="close_bug", default=True, help="Leave bug open after landing.")
- complete_rollout = make_option("--complete-rollout", action="store_true", dest="complete_rollout", help="Commit the revert and re-open the original bug.")
+ comment = make_option("--comment", action="store", type="string", dest="comment", help="Comment to post to bug.")
component = make_option("--component", action="store", type="string", dest="component", help="Component for the new bug.")
confirm = make_option("--no-confirm", action="store_false", dest="confirm", default=True, help="Skip confirmation steps.")
description = make_option("-m", "--description", action="store", type="string", dest="description", help="Description string for the attachment (default: \"patch\")")
email = make_option("--email", action="store", type="string", dest="email", help="Email address to use in ChangeLogs.")
force_clean = make_option("--force-clean", action="store_true", dest="force_clean", default=False, help="Clean working directory before applying patches (removes local changes and commits)")
+ force_patch = make_option("--force-patch", action="store_true", dest="force_patch", default=False, help="Forcefully applies the patch, continuing past errors.")
+ git_commit = make_option("-g", "--git-commit", action="store", dest="git_commit", help="Operate on a local commit. If a range, the commits are squashed into one. HEAD.. operates on working copy changes only.")
local_commit = make_option("--local-commit", action="store_true", dest="local_commit", default=False, help="Make a local commit for each applied patch")
non_interactive = make_option("--non-interactive", action="store_true", dest="non_interactive", default=False, help="Never prompt the user, fail as fast as possible.")
obsolete_patches = make_option("--no-obsolete", action="store_false", dest="obsolete_patches", default=True, help="Do not obsolete old patches before posting this one.")
open_bug = make_option("--open-bug", action="store_true", dest="open_bug", default=False, help="Opens the associated bug in a browser.")
parent_command = make_option("--parent-command", action="store", dest="parent_command", default=None, help="(Internal) The command that spawned this instance.")
- port = make_option("--port", action="store", dest="port", default=None, help="Specify a port (e.g., mac, qt, gtk, ...).")
quiet = make_option("--quiet", action="store_true", dest="quiet", default=False, help="Produce less console output.")
request_commit = make_option("--request-commit", action="store_true", dest="request_commit", default=False, help="Mark the patch as needing auto-commit after review.")
review = make_option("--no-review", action="store_false", dest="review", default=True, help="Do not mark the patch for review.")
reviewer = make_option("-r", "--reviewer", action="store", type="string", dest="reviewer", help="Update ChangeLogs to say Reviewed by REVIEWER.")
- test = make_option("--no-test", action="store_false", dest="test", default=True, help="Commit without running run-webkit-tests.")
+ suggest_reviewers = make_option("--suggest-reviewers", action="store_true", default=False, help="Offer to CC appropriate reviewers.")
+ test = make_option("--test", action="store_true", dest="test", default=False, help="Run run-webkit-tests before committing.")
update = make_option("--no-update", action="store_false", dest="update", default=True, help="Don't update the working directory.")
diff --git a/WebKitTools/Scripts/webkitpy/steps/postdiff.py b/WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py
index a5ba2a4..c40b6ff 100644
--- a/WebKitTools/Scripts/webkitpy/steps/postdiff.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/postdiff.py
@@ -26,17 +26,16 @@
# (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 StringIO
-
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
class PostDiff(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.description,
+ Options.comment,
Options.review,
Options.request_commit,
Options.open_bug,
@@ -44,8 +43,8 @@ class PostDiff(AbstractStep):
def run(self, state):
diff = self.cached_lookup(state, "diff")
- diff_file = StringIO.StringIO(diff) # add_patch_to_bug expects a file-like object
description = self._options.description or "Patch"
- self._tool.bugs.add_patch_to_bug(state["bug_id"], diff_file, description, mark_for_review=self._options.review, mark_for_commit_queue=self._options.request_commit)
+ comment_text = self._options.comment
+ self._tool.bugs.add_patch_to_bug(state["bug_id"], diff, description, comment_text=comment_text, mark_for_review=self._options.review, mark_for_commit_queue=self._options.request_commit)
if self._options.open_bug:
self._tool.user.open_url(self._tool.bugs.bug_url_for_bug_id(state["bug_id"]))
diff --git a/WebKitTools/Scripts/webkitpy/steps/postdiffforcommit.py b/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforcommit.py
index 449381c..13bc00c 100644
--- a/WebKitTools/Scripts/webkitpy/steps/postdiffforcommit.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforcommit.py
@@ -26,16 +26,14 @@
# (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 StringIO
-
-from webkitpy.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.abstractstep import AbstractStep
class PostDiffForCommit(AbstractStep):
def run(self, state):
self._tool.bugs.add_patch_to_bug(
state["bug_id"],
- StringIO.StringIO(self.cached_lookup(state, "diff")),
+ self.cached_lookup(state, "diff"),
"Patch for landing",
mark_for_review=False,
mark_for_landing=True)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforrevert.py b/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforrevert.py
new file mode 100644
index 0000000..bfa631f
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/postdiffforrevert.py
@@ -0,0 +1,49 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from webkitpy.common.net.bugzilla import Attachment
+from webkitpy.tool.steps.abstractstep import AbstractStep
+
+
+class PostDiffForRevert(AbstractStep):
+ def run(self, state):
+ comment_text = "Any committer can land this patch automatically by \
+marking it commit-queue+. The commit-queue will build and test \
+the patch before landing to ensure that the rollout will be \
+successful. This process takes approximately 15 minutes.\n\n\
+If you would like to land the rollout faster, you can use the \
+following command:\n\n\
+ webkit-patch land-attachment ATTACHMENT_ID --ignore-builders\n\n\
+where ATTACHMENT_ID is the ID of this attachment."
+ self._tool.bugs.add_patch_to_bug(
+ state["bug_id"],
+ self.cached_lookup(state, "diff"),
+ "%s%s" % (Attachment.rollout_preamble, state["revision"]),
+ comment_text=comment_text,
+ mark_for_review=False,
+ mark_for_commit_queue=True)
diff --git a/WebKitTools/Scripts/webkitpy/steps/preparechangelog.py b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
index bd41f0b..099dfe3 100644
--- a/WebKitTools/Scripts/webkitpy/steps/preparechangelog.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
@@ -28,32 +28,50 @@
import os
-from webkitpy.executive import ScriptError
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
+from webkitpy.common.checkout.changelog import ChangeLog
+from webkitpy.common.system.executive import ScriptError
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import error
class PrepareChangeLog(AbstractStep):
@classmethod
def options(cls):
- return [
- Options.port,
+ return AbstractStep.options() + [
Options.quiet,
Options.email,
+ Options.git_commit,
]
+ def _ensure_bug_url(self, state):
+ if not state.get("bug_id"):
+ return
+ bug_id = state.get("bug_id")
+ changelogs = self.cached_lookup(state, "changelogs")
+ for changelog_path in changelogs:
+ changelog = ChangeLog(changelog_path)
+ if not changelog.latest_entry().bug_id():
+ changelog.set_short_description_and_bug_url(
+ self.cached_lookup(state, "bug_title"),
+ self._tool.bugs.bug_url_for_bug_id(bug_id))
+
def run(self, state):
if self.cached_lookup(state, "changelogs"):
+ self._ensure_bug_url(state)
return
os.chdir(self._tool.scm().checkout_root)
- args = [self.port().script_path("prepare-ChangeLog")]
- if state["bug_id"]:
+ args = [self._tool.port().script_path("prepare-ChangeLog")]
+ if state.get("bug_id"):
args.append("--bug=%s" % state["bug_id"])
if self._options.email:
args.append("--email=%s" % self._options.email)
+
+ if self._tool.scm().supports_local_commits():
+ args.append("--merge-base=%s" % self._tool.scm().merge_base(self._options.git_commit))
+
try:
self._tool.executive.run_and_throw_if_fail(args, self._options.quiet)
except ScriptError, e:
error("Unable to prepare ChangeLogs.")
- state["diff"] = None # We've changed the diff
+ self.did_modify_checkout(state)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py
new file mode 100644
index 0000000..eceffdf
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog_unittest.py
@@ -0,0 +1,54 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import unittest
+
+from webkitpy.common.checkout.changelog_unittest import ChangeLogTest
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockOptions, MockTool
+from webkitpy.tool.steps.preparechangelog import PrepareChangeLog
+
+
+class PrepareChangeLogTest(ChangeLogTest):
+ def test_ensure_bug_url(self):
+ capture = OutputCapture()
+ step = PrepareChangeLog(MockTool(), MockOptions())
+ changelog_contents = u"%s\n%s" % (self._new_entry_boilerplate, self._example_changelog)
+ changelog_path = self._write_tmp_file_with_contents(changelog_contents.encode("utf-8"))
+ state = {
+ "bug_title": "Example title",
+ "bug_id": 1234,
+ "changelogs": [changelog_path],
+ }
+ capture.assert_outputs(self, step.run, [state])
+ actual_contents = self._read_file_contents(changelog_path, "utf-8")
+ expected_message = "Example title\n http://example.com/1234"
+ expected_contents = changelog_contents.replace("Need a short description and bug URL (OOPS!)", expected_message)
+ os.remove(changelog_path)
+ self.assertEquals(actual_contents, expected_contents)
diff --git a/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
index 88e5134..0e78bc2 100644
--- a/WebKitTools/Scripts/webkitpy/steps/preparechangelogforrevert.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelogforrevert.py
@@ -28,20 +28,15 @@
import os
-from webkitpy.changelogs import ChangeLog
-from webkitpy.steps.abstractstep import AbstractStep
+from webkitpy.common.checkout.changelog import ChangeLog
+from webkitpy.tool.steps.abstractstep import AbstractStep
class PrepareChangeLogForRevert(AbstractStep):
def run(self, state):
- # First, discard the ChangeLog changes from the rollout.
- os.chdir(self._tool.scm().checkout_root)
- changelog_paths = self._tool.scm().modified_changelogs()
- self._tool.scm().revert_files(changelog_paths)
-
- # Second, make new ChangeLog entries for this rollout.
# This could move to prepare-ChangeLog by adding a --revert= option.
self._run_script("prepare-ChangeLog")
+ changelog_paths = self._tool.checkout().modified_changelogs(git_commit=None)
bug_url = self._tool.bugs.bug_url_for_bug_id(state["bug_id"]) if state["bug_id"] else None
for changelog_path in changelog_paths:
# FIXME: Seems we should prepare the message outside of changelogs.py and then just pass in
diff --git a/WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.py b/WebKitTools/Scripts/webkitpy/tool/steps/promptforbugortitle.py
index fb2f877..31c913c 100644
--- a/WebKitTools/Scripts/webkitpy/steps/promptforbugortitle.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/promptforbugortitle.py
@@ -26,7 +26,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.abstractstep import AbstractStep
class PromptForBugOrTitle(AbstractStep):
diff --git a/WebKitTools/Scripts/webkitpy/steps/confirmdiff.py b/WebKitTools/Scripts/webkitpy/tool/steps/reopenbugafterrollout.py
index fc28f8f..f369ca9 100644
--- a/WebKitTools/Scripts/webkitpy/steps/confirmdiff.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/reopenbugafterrollout.py
@@ -26,22 +26,19 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import error
+from webkitpy.tool.comments import bug_comment_from_commit_text
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.common.system.deprecated_logging import log
-class ConfirmDiff(AbstractStep):
- @classmethod
- def options(cls):
- return [
- Options.confirm,
- ]
-
+class ReopenBugAfterRollout(AbstractStep):
def run(self, state):
- if not self._options.confirm:
+ commit_comment = bug_comment_from_commit_text(self._tool.scm(), state["commit_text"])
+ comment_text = "Reverted r%s for reason:\n\n%s\n\n%s" % (state["revision"], state["reason"], commit_comment)
+
+ bug_id = state["bug_id"]
+ if not bug_id:
+ log(comment_text)
+ log("No bugs were updated.")
return
- diff = self.cached_lookup(state, "diff")
- self._tool.user.page(diff)
- if not self._tool.user.confirm("Was that diff correct?"):
- exit(1)
+ self._tool.bugs.reopen_bug(bug_id, comment_text)
diff --git a/WebKitTools/Scripts/webkitpy/steps/revertrevision.py b/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py
index ce6c263..bbb794c 100644
--- a/WebKitTools/Scripts/webkitpy/steps/revertrevision.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/revertrevision.py
@@ -26,9 +26,10 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.abstractstep import AbstractStep
class RevertRevision(AbstractStep):
def run(self, state):
- self._tool.scm().apply_reverse_diff(state["revision"])
+ self._tool.checkout().apply_reverse_diff(state["revision"])
+ self.did_modify_checkout(state)
diff --git a/WebKitTools/Scripts/webkitpy/steps/runtests.py b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
index ebe809f..282e381 100644
--- a/WebKitTools/Scripts/webkitpy/steps/runtests.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/runtests.py
@@ -26,40 +26,55 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
class RunTests(AbstractStep):
@classmethod
def options(cls):
- return [
- Options.build,
+ return AbstractStep.options() + [
Options.test,
Options.non_interactive,
Options.quiet,
- Options.port,
]
def run(self, state):
- if not self._options.build:
- return
if not self._options.test:
return
# Run the scripting unit tests first because they're quickest.
log("Running Python unit tests")
- self._tool.executive.run_and_throw_if_fail(self.port().run_python_unittests_command())
+ self._tool.executive.run_and_throw_if_fail(self._tool.port().run_python_unittests_command())
log("Running Perl unit tests")
- self._tool.executive.run_and_throw_if_fail(self.port().run_perl_unittests_command())
- log("Running JavaScriptCore tests")
- self._tool.executive.run_and_throw_if_fail(self.port().run_javascriptcore_tests_command(), quiet=True)
+ self._tool.executive.run_and_throw_if_fail(self._tool.port().run_perl_unittests_command())
+
+ javascriptcore_tests_command = self._tool.port().run_javascriptcore_tests_command()
+ if javascriptcore_tests_command:
+ log("Running JavaScriptCore tests")
+ self._tool.executive.run_and_throw_if_fail(javascriptcore_tests_command, quiet=True)
log("Running run-webkit-tests")
- args = self.port().run_webkit_tests_command()
+ args = self._tool.port().run_webkit_tests_command()
if self._options.non_interactive:
+ args.append("--no-new-test-results")
args.append("--no-launch-safari")
args.append("--exit-after-n-failures=1")
+ args.append("--wait-for-httpd")
+ # FIXME: Hack to work around https://bugs.webkit.org/show_bug.cgi?id=38912
+ # when running the commit-queue on a mac leopard machine since compositing
+ # does not work reliably on Leopard due to various graphics driver/system bugs.
+ if self._tool.port().name() == "Mac" and self._tool.port().is_leopard():
+ tests_to_ignore = []
+ tests_to_ignore.append("compositing")
+
+ # media tests are also broken on mac leopard due to
+ # a separate CoreVideo bug which causes random crashes/hangs
+ # https://bugs.webkit.org/show_bug.cgi?id=38912
+ tests_to_ignore.append("media")
+
+ args.extend(["--ignore-tests", ",".join(tests_to_ignore)])
+
if self._options.quiet:
args.append("--quiet")
self._tool.executive.run_and_throw_if_fail(args)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
new file mode 100644
index 0000000..eabb656
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/steps_unittest.py
@@ -0,0 +1,92 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.common.config.ports import WebKitPort
+from webkitpy.tool.mocktool import MockOptions, MockTool
+from webkitpy.tool.steps.update import Update
+from webkitpy.tool.steps.runtests import RunTests
+from webkitpy.tool.steps.promptforbugortitle import PromptForBugOrTitle
+
+
+class StepsTest(unittest.TestCase):
+ def _step_options(self):
+ options = MockOptions()
+ options.non_interactive = True
+ options.port = 'MOCK port'
+ options.quiet = True
+ options.test = True
+ return options
+
+ def _run_step(self, step, tool=None, options=None, state=None):
+ if not tool:
+ tool = MockTool()
+ if not options:
+ options = self._step_options()
+ if not state:
+ state = {}
+ step(tool, options).run(state)
+
+ def test_update_step(self):
+ tool = MockTool()
+ options = self._step_options()
+ options.update = True
+ expected_stderr = "Updating working directory\n"
+ OutputCapture().assert_outputs(self, self._run_step, [Update, tool, options], expected_stderr=expected_stderr)
+
+ def test_prompt_for_bug_or_title_step(self):
+ tool = MockTool()
+ tool.user.prompt = lambda message: 42
+ self._run_step(PromptForBugOrTitle, tool=tool)
+
+ def test_runtests_leopard_commit_queue_hack_step(self):
+ expected_stderr = "Running Python unit tests\nRunning Perl unit tests\nRunning JavaScriptCore tests\nRunning run-webkit-tests\n"
+ OutputCapture().assert_outputs(self, self._run_step, [RunTests], expected_stderr=expected_stderr)
+
+ def test_runtests_leopard_commit_queue_hack_command(self):
+ mock_options = self._step_options()
+ step = RunTests(MockTool(log_executive=True), mock_options)
+ # FIXME: We shouldn't use a real port-object here, but there is too much to mock at the moment.
+ mock_port = WebKitPort()
+ mock_port.name = lambda: "Mac"
+ mock_port.is_leopard = lambda: True
+ tool = MockTool(log_executive=True)
+ tool.port = lambda: mock_port
+ step = RunTests(tool, mock_options)
+ expected_stderr = """Running Python unit tests
+MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/test-webkitpy']
+Running Perl unit tests
+MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/test-webkitperl']
+Running JavaScriptCore tests
+MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-javascriptcore-tests']
+Running run-webkit-tests
+MOCK run_and_throw_if_fail: ['WebKitTools/Scripts/run-webkit-tests', '--no-new-test-results', '--no-launch-safari', '--exit-after-n-failures=1', '--wait-for-httpd', '--ignore-tests', 'compositing,media', '--quiet']
+"""
+ OutputCapture().assert_outputs(self, step.run, [{}], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers.py b/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers.py
new file mode 100644
index 0000000..76bef35
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers.py
@@ -0,0 +1,51 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+
+
+class SuggestReviewers(AbstractStep):
+ @classmethod
+ def options(cls):
+ return AbstractStep.options() + [
+ Options.git_commit,
+ Options.suggest_reviewers,
+ ]
+
+ def run(self, state):
+ if not self._options.suggest_reviewers:
+ return
+
+ reviewers = self._tool.checkout().suggested_reviewers(self._options.git_commit, self._changed_files(state))
+ print "The following reviewers have recently modified files in your patch:"
+ print "\n".join([reviewer.full_name for reviewer in reviewers])
+ if not self._tool.user.confirm("Would you like to CC them?"):
+ return
+ reviewer_emails = [reviewer.bugzilla_email() for reviewer in reviewers]
+ self._tool.bugs.add_cc_to_bug(state['bug_id'], reviewer_emails)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers_unittest.py
new file mode 100644
index 0000000..0c86535
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/suggestreviewers_unittest.py
@@ -0,0 +1,45 @@
+# Copyright (C) 2009 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockOptions, MockTool
+from webkitpy.tool.steps.suggestreviewers import SuggestReviewers
+
+
+class SuggestReviewersTest(unittest.TestCase):
+ def test_disabled(self):
+ step = SuggestReviewers(MockTool(), MockOptions(suggest_reviewers=False))
+ OutputCapture().assert_outputs(self, step.run, [{}])
+
+ def test_basic(self):
+ capture = OutputCapture()
+ step = SuggestReviewers(MockTool(), MockOptions(suggest_reviewers=True, git_commit=None))
+ expected_stdout = "The following reviewers have recently modified files in your patch:\nFoo Bar\nWould you like to CC them?\n"
+ capture.assert_outputs(self, step.run, [{"bug_id": "123"}], expected_stdout=expected_stdout)
diff --git a/WebKitTools/Scripts/webkitpy/steps/update.py b/WebKitTools/Scripts/webkitpy/tool/steps/update.py
index 0f45671..cd1d4d8 100644
--- a/WebKitTools/Scripts/webkitpy/steps/update.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/update.py
@@ -26,21 +26,20 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log
class Update(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
Options.update,
- Options.port,
]
def run(self, state):
if not self._options.update:
return
log("Updating working directory")
- self._tool.executive.run_and_throw_if_fail(self.port().update_webkit_command(), quiet=True)
+ self._tool.executive.run_and_throw_if_fail(self._tool.port().update_webkit_command(), quiet=True)
diff --git a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py b/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py
index 102a454..b475378 100644
--- a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreview_unittests.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreview_unittest.py
@@ -28,19 +28,21 @@
import unittest
-from webkitpy.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
-from webkitpy.mock import Mock
-from webkitpy.mock_bugzillatool import MockBugzillaTool
-from webkitpy.outputcapture import OutputCapture
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockOptions, MockTool
+from webkitpy.tool.steps.updatechangelogswithreviewer import UpdateChangeLogsWithReviewer
class UpdateChangeLogsWithReviewerTest(unittest.TestCase):
def test_guess_reviewer_from_bug(self):
capture = OutputCapture()
- step = UpdateChangeLogsWithReviewer(MockBugzillaTool(), Mock())
+ step = UpdateChangeLogsWithReviewer(MockTool(), MockOptions())
expected_stderr = "0 reviewed patches on bug 75, cannot infer reviewer.\n"
capture.assert_outputs(self, step._guess_reviewer_from_bug, [75], expected_stderr=expected_stderr)
def test_empty_state(self):
capture = OutputCapture()
- step = UpdateChangeLogsWithReviewer(MockBugzillaTool(), Mock())
+ options = MockOptions()
+ options.reviewer = 'MOCK reviewer'
+ options.git_commit = 'MOCK git commit'
+ step = UpdateChangeLogsWithReviewer(MockTool(), options)
capture.assert_outputs(self, step.run, [{}])
diff --git a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py b/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py
index 90fdc35..e46b790 100644
--- a/WebKitTools/Scripts/webkitpy/steps/updatechangelogswithreviewer.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/updatechangelogswithreviewer.py
@@ -28,16 +28,17 @@
import os
-from webkitpy.changelogs import ChangeLog
-from webkitpy.grammar import pluralize
-from webkitpy.steps.abstractstep import AbstractStep
-from webkitpy.steps.options import Options
-from webkitpy.webkit_logging import log, error
+from webkitpy.common.checkout.changelog import ChangeLog
+from webkitpy.tool.grammar import pluralize
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import log, error
class UpdateChangeLogsWithReviewer(AbstractStep):
@classmethod
def options(cls):
- return [
+ return AbstractStep.options() + [
+ Options.git_commit,
Options.reviewer,
]
@@ -67,5 +68,5 @@ class UpdateChangeLogsWithReviewer(AbstractStep):
return
os.chdir(self._tool.scm().checkout_root)
- for changelog_path in self._tool.scm().modified_changelogs():
+ for changelog_path in self.cached_lookup(state, "changelogs"):
ChangeLog(changelog_path).set_reviewer(reviewer)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py b/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py
new file mode 100644
index 0000000..bdf729e
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py
@@ -0,0 +1,71 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import os
+import re
+
+from webkitpy.common.checkout.changelog import ChangeLog
+from webkitpy.tool.steps.abstractstep import AbstractStep
+from webkitpy.tool.steps.options import Options
+from webkitpy.common.system.deprecated_logging import error, log
+
+
+# FIXME: Some of this logic should probably be unified with CommitterValidator?
+class ValidateReviewer(AbstractStep):
+ @classmethod
+ def options(cls):
+ return AbstractStep.options() + [
+ Options.git_commit,
+ ]
+
+ # FIXME: This should probably move onto ChangeLogEntry
+ def _has_valid_reviewer(self, changelog_entry):
+ if changelog_entry.reviewer():
+ return True
+ if re.search("unreviewed", changelog_entry.contents(), re.IGNORECASE):
+ return True
+ if re.search("rubber[ -]stamp", changelog_entry.contents(), re.IGNORECASE):
+ return True
+ return False
+
+ def run(self, state):
+ # FIXME: For now we disable this check when a user is driving the script
+ # this check is too draconian (and too poorly tested) to foist upon users.
+ if not self._options.non_interactive:
+ return
+ # FIXME: We should figure out how to handle the current working
+ # directory issue more globally.
+ os.chdir(self._tool.scm().checkout_root)
+ for changelog_path in self.cached_lookup(state, "changelogs"):
+ changelog_entry = ChangeLog(changelog_path).latest_entry()
+ if self._has_valid_reviewer(changelog_entry):
+ continue
+ reviewer_text = changelog_entry.reviewer_text()
+ if reviewer_text:
+ log("%s found in %s does not appear to be a valid reviewer according to committers.py." % (reviewer_text, changelog_path))
+ error('%s neither lists a valid reviewer nor contains the string "Unreviewed" or "Rubber stamp" (case insensitive).' % changelog_path)
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer_unittest.py b/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer_unittest.py
new file mode 100644
index 0000000..d9b856a
--- /dev/null
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer_unittest.py
@@ -0,0 +1,57 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import unittest
+
+from webkitpy.common.checkout.changelog import ChangeLogEntry
+from webkitpy.common.system.outputcapture import OutputCapture
+from webkitpy.tool.mocktool import MockOptions, MockTool
+from webkitpy.tool.steps.validatereviewer import ValidateReviewer
+
+class ValidateReviewerTest(unittest.TestCase):
+ _boilerplate_entry = '''2009-08-19 Eric Seidel <eric@webkit.org>
+
+ REVIEW_LINE
+
+ * Scripts/bugzilla-tool:
+'''
+
+ def _test_review_text(self, step, text, expected):
+ contents = self._boilerplate_entry.replace("REVIEW_LINE", text)
+ entry = ChangeLogEntry(contents)
+ self.assertEqual(step._has_valid_reviewer(entry), expected)
+
+ def test_has_valid_reviewer(self):
+ step = ValidateReviewer(MockTool(), MockOptions())
+ self._test_review_text(step, "Reviewed by Eric Seidel.", True)
+ self._test_review_text(step, "Reviewed by Eric Seidel", True) # Not picky about the '.'
+ self._test_review_text(step, "Reviewed by Eric.", False)
+ self._test_review_text(step, "Reviewed by Eric C Seidel.", False)
+ self._test_review_text(step, "Rubber-stamped by Eric.", True)
+ self._test_review_text(step, "Rubber stamped by Eric.", True)
+ self._test_review_text(step, "Unreviewed build fix.", True)
diff --git a/WebKitTools/Scripts/webkitpy/user.py b/WebKitTools/Scripts/webkitpy/user.py
deleted file mode 100644
index b2ec19e..0000000
--- a/WebKitTools/Scripts/webkitpy/user.py
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright (c) 2009, Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import shlex
-import subprocess
-import webbrowser
-
-class User(object):
- @staticmethod
- def prompt(message, repeat=1, raw_input=raw_input):
- response = None
- while (repeat and not response):
- repeat -= 1
- response = raw_input(message)
- return response
-
- def edit(self, files):
- editor = os.environ.get("EDITOR") or "vi"
- args = shlex.split(editor)
- subprocess.call(args + files)
-
- def page(self, message):
- pager = os.environ.get("PAGER") or "less"
- try:
- child_process = subprocess.Popen([pager], stdin=subprocess.PIPE)
- child_process.communicate(input=message)
- except IOError, e:
- pass
-
- def confirm(self, message=None):
- if not message:
- message = "Continue?"
- response = raw_input("%s [Y/n]: " % message)
- return not response or response.lower() == "y"
-
- def open_url(self, url):
- webbrowser.open(url)
diff --git a/WebKitTools/Scripts/webkitpy/user.pyc b/WebKitTools/Scripts/webkitpy/user.pyc
deleted file mode 100644
index 7d6b687..0000000
--- a/WebKitTools/Scripts/webkitpy/user.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/webkit_logging.pyc b/WebKitTools/Scripts/webkitpy/webkit_logging.pyc
deleted file mode 100644
index 137f042..0000000
--- a/WebKitTools/Scripts/webkitpy/webkit_logging.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/Scripts/webkitpy/webkitport.pyc b/WebKitTools/Scripts/webkitpy/webkitport.pyc
deleted file mode 100644
index e344aca..0000000
--- a/WebKitTools/Scripts/webkitpy/webkitport.pyc
+++ /dev/null
Binary files differ
diff --git a/WebKitTools/TestResultServer/app.yaml b/WebKitTools/TestResultServer/app.yaml
new file mode 100644
index 0000000..e51af84
--- /dev/null
+++ b/WebKitTools/TestResultServer/app.yaml
@@ -0,0 +1,19 @@
+application: test-results
+version: 1
+runtime: python
+api_version: 1
+
+handlers:
+- url: /stylesheets
+ static_dir: stylesheets
+
+- url: /testfile/delete
+ script: main.py
+ login: admin
+
+- url: /dashboards/delete
+ script: main.py
+ login: admin
+
+- url: /.*
+ script: main.py
diff --git a/WebKitTools/TestResultServer/handlers/__init__.py b/WebKitTools/TestResultServer/handlers/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/TestResultServer/handlers/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/TestResultServer/handlers/dashboardhandler.py b/WebKitTools/TestResultServer/handlers/dashboardhandler.py
new file mode 100644
index 0000000..c8b5ace
--- /dev/null
+++ b/WebKitTools/TestResultServer/handlers/dashboardhandler.py
@@ -0,0 +1,123 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import logging
+import mimetypes
+import urllib2
+
+from google.appengine.api import users
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
+
+from model.dashboardfile import DashboardFile
+
+PARAM_FILE = "file"
+
+
+def get_content_type(filename):
+ return mimetypes.guess_type(filename)[0] or "application/octet-stream"
+
+
+class GetDashboardFile(webapp.RequestHandler):
+ def get(self, resource):
+ if not resource:
+ logging.debug("Getting dashboard file list.")
+ return self._get_file_list()
+
+ filename = str(urllib2.unquote(resource))
+
+ logging.debug("Getting dashboard file: %s", filename)
+
+ files = DashboardFile.get_files(filename)
+ if not files:
+ logging.error("Failed to find dashboard file: %s, request: %s",
+ filename, self.request)
+ self.response.set_status(404)
+ return
+
+ content_type = "%s; charset=utf-8" % get_content_type(filename)
+ logging.info("content type: %s", content_type)
+ self.response.headers["Content-Type"] = content_type
+ self.response.out.write(files[0].data)
+
+ def _get_file_list(self):
+ logging.info("getting dashboard file list.")
+
+ files = DashboardFile.get_files("", 100)
+ if not files:
+ logging.info("Failed to find dashboard files.")
+ self.response.set_status(404)
+ return
+
+ template_values = {
+ "admin": users.is_current_user_admin(),
+ "files": files,
+ }
+ self.response.out.write(
+ template.render("templates/dashboardfilelist.html",
+ template_values))
+
+
+class UpdateDashboardFile(webapp.RequestHandler):
+ def get(self):
+ files = self.request.get_all(PARAM_FILE)
+ if not files:
+ files = ["flakiness_dashboard.html",
+ "dashboard_base.js",
+ "aggregate_results.html",
+ "dygraph-combined.js",
+ "timeline_explorer.html"]
+
+ errors = []
+ for file in files:
+ if not DashboardFile.update_file(file):
+ errors.append("Failed to update file: %s" % file)
+
+ if errors:
+ messages = "; ".join(errors)
+ logging.warning(messages)
+ self.response.set_status(500, messages)
+ self.response.out.write("FAIL")
+ else:
+ self.response.set_status(200)
+ self.response.out.write("OK")
+
+
+class DeleteDashboardFile(webapp.RequestHandler):
+ def get(self):
+ files = self.request.get_all(PARAM_FILE)
+ if not files:
+ logging.warning("No dashboard file to delete.")
+ self.response.set_status(400)
+ return
+
+ for file in files:
+ DashboardFile.delete_file(file)
+
+ # Display dashboard file list after deleting the file.
+ self.redirect("/dashboards/")
diff --git a/WebKitTools/TestResultServer/handlers/menu.py b/WebKitTools/TestResultServer/handlers/menu.py
new file mode 100644
index 0000000..f2f3855
--- /dev/null
+++ b/WebKitTools/TestResultServer/handlers/menu.py
@@ -0,0 +1,63 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from google.appengine.api import users
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
+
+menu = [
+ ["List of test files", "/testfile"],
+ ["List of results.json files", "/testfile?name=results.json"],
+ ["List of expectations.json files", "/testfile?name=expectations.json"],
+ ["Upload test file", "/testfile/uploadform"],
+ ["List of dashboard files", "/dashboards/"],
+ ["Update dashboard files", "/dashboards/update"],
+]
+
+
+class Menu(webapp.RequestHandler):
+ def get(self):
+ user = users.get_current_user()
+ if user:
+ user_email = user.email()
+ login_text = "Sign out"
+ login_url = users.create_logout_url(self.request.uri)
+ else:
+ user_email = ""
+ login_text = "Sign in"
+ login_url = users.create_login_url(self.request.uri)
+
+ template_values = {
+ "user_email": user_email,
+ "login_text": login_text,
+ "login_url": login_url,
+ "menu": menu,
+ }
+
+ self.response.out.write(
+ template.render("templates/menu.html", template_values))
diff --git a/WebKitTools/TestResultServer/handlers/testfilehandler.py b/WebKitTools/TestResultServer/handlers/testfilehandler.py
new file mode 100644
index 0000000..d817890
--- /dev/null
+++ b/WebKitTools/TestResultServer/handlers/testfilehandler.py
@@ -0,0 +1,229 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+import logging
+import urllib
+
+from google.appengine.api import users
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp import template
+
+from model.jsonresults import JsonResults
+from model.testfile import TestFile
+
+PARAM_MASTER = "master"
+PARAM_BUILDER = "builder"
+PARAM_DIR = "dir"
+PARAM_FILE = "file"
+PARAM_NAME = "name"
+PARAM_KEY = "key"
+PARAM_TEST_TYPE = "testtype"
+PARAM_INCREMENTAL = "incremental"
+PARAM_TEST_LIST_JSON = "testlistjson"
+
+
+class DeleteFile(webapp.RequestHandler):
+ """Delete test file for a given builder and name from datastore."""
+
+ def get(self):
+ key = self.request.get(PARAM_KEY)
+ master = self.request.get(PARAM_MASTER)
+ builder = self.request.get(PARAM_BUILDER)
+ test_type = self.request.get(PARAM_TEST_TYPE)
+ name = self.request.get(PARAM_NAME)
+
+ logging.debug(
+ "Deleting File, master: %s, builder: %s, test_type: %s, name: %s, key: %s.",
+ master, builder, test_type, name, key)
+
+ TestFile.delete_file(key, master, builder, test_type, name, 100)
+
+ # Display file list after deleting the file.
+ self.redirect("/testfile?master=%s&builder=%s&testtype=%s&name=%s"
+ % (master, builder, test_type, name))
+
+
+class GetFile(webapp.RequestHandler):
+ """Get file content or list of files for given builder and name."""
+
+ def _get_file_list(self, master, builder, test_type, name):
+ """Get and display a list of files that matches builder and file name.
+
+ Args:
+ builder: builder name
+ test_type: type of the test
+ name: file name
+ """
+
+ files = TestFile.get_files(
+ master, builder, test_type, name, load_data=False, limit=100)
+ if not files:
+ logging.info("File not found, master: %s, builder: %s, test_type: %s, name: %s.",
+ master, builder, test_type, name)
+ self.response.out.write("File not found")
+ return
+
+ template_values = {
+ "admin": users.is_current_user_admin(),
+ "master": master,
+ "builder": builder,
+ "test_type": test_type,
+ "name": name,
+ "files": files,
+ }
+ self.response.out.write(template.render("templates/showfilelist.html",
+ template_values))
+
+ def _get_file_content(self, master, builder, test_type, name):
+ """Return content of the file that matches builder and file name.
+
+ Args:
+ builder: builder name
+ test_type: type of the test
+ name: file name
+ """
+
+ files = TestFile.get_files(
+ master, builder, test_type, name, load_data=True, limit=1)
+ if not files:
+ logging.info("File not found, master %s, builder: %s, test_type: %s, name: %s.",
+ master, builder, test_type, name)
+ return None
+
+ return files[0].data
+
+ def _get_test_list_json(self, master, builder, test_type):
+ """Return json file with test name list only, do not include test
+ results and other non-test-data .
+
+ Args:
+ builder: builder name.
+ test_type: type of test results.
+ """
+
+ json = self._get_file_content(master, builder, test_type, "results.json")
+ if not json:
+ return None
+
+ return JsonResults.get_test_list(builder, json)
+
+ def get(self):
+ master = self.request.get(PARAM_MASTER)
+ builder = self.request.get(PARAM_BUILDER)
+ test_type = self.request.get(PARAM_TEST_TYPE)
+ name = self.request.get(PARAM_NAME)
+ dir = self.request.get(PARAM_DIR)
+ test_list_json = self.request.get(PARAM_TEST_LIST_JSON)
+
+ logging.debug(
+ "Getting files, master %s, builder: %s, test_type: %s, name: %s.",
+ master, builder, test_type, name)
+
+ # If parameter "dir" is specified or there is no builder or filename
+ # specified in the request, return list of files, otherwise, return
+ # file content.
+ if dir or not builder or not name:
+ return self._get_file_list(master, builder, test_type, name)
+
+ if name == "results.json" and test_list_json:
+ json = self._get_test_list_json(master, builder, test_type)
+ else:
+ json = self._get_file_content(master, builder, test_type, name)
+
+ if json:
+ self.response.headers["Content-Type"] = "text/plain; charset=utf-8"
+ self.response.out.write(json)
+
+
+class Upload(webapp.RequestHandler):
+ """Upload test results file to datastore."""
+
+ def post(self):
+ file_params = self.request.POST.getall(PARAM_FILE)
+ if not file_params:
+ self.response.out.write("FAIL: missing upload file field.")
+ return
+
+ builder = self.request.get(PARAM_BUILDER)
+ if not builder:
+ self.response.out.write("FAIL: missing builder parameter.")
+ return
+
+ master = self.request.get(PARAM_MASTER)
+ test_type = self.request.get(PARAM_TEST_TYPE)
+ incremental = self.request.get(PARAM_INCREMENTAL)
+
+ logging.debug(
+ "Processing upload request, master: %s, builder: %s, test_type: %s.",
+ master, builder, test_type)
+
+ # There are two possible types of each file_params in the request:
+ # one file item or a list of file items.
+ # Normalize file_params to a file item list.
+ files = []
+ logging.debug("test: %s, type:%s", file_params, type(file_params))
+ for item in file_params:
+ if not isinstance(item, list) and not isinstance(item, tuple):
+ item = [item]
+ files.extend(item)
+
+ errors = []
+ for file in files:
+ filename = file.filename.lower()
+ if ((incremental and filename == "results.json") or
+ (filename == "incremental_results.json")):
+ # Merge incremental json results.
+ saved_file = JsonResults.update(master, builder, test_type, file.value)
+ else:
+ saved_file = TestFile.update(
+ master, builder, test_type, file.filename, file.value)
+
+ if not saved_file:
+ errors.append(
+ "Upload failed, master: %s, builder: %s, test_type: %s, name: %s." %
+ (master, builder, test_type, file.filename))
+
+ if errors:
+ messages = "FAIL: " + "; ".join(errors)
+ logging.warning(messages)
+ self.response.set_status(500, messages)
+ self.response.out.write("FAIL")
+ else:
+ self.response.set_status(200)
+ self.response.out.write("OK")
+
+
+class UploadForm(webapp.RequestHandler):
+ """Show a form so user can upload a file."""
+
+ def get(self):
+ template_values = {
+ "upload_url": "/testfile/upload",
+ }
+ self.response.out.write(template.render("templates/uploadform.html",
+ template_values))
diff --git a/WebKitTools/TestResultServer/index.yaml b/WebKitTools/TestResultServer/index.yaml
new file mode 100644
index 0000000..a7d3e48
--- /dev/null
+++ b/WebKitTools/TestResultServer/index.yaml
@@ -0,0 +1,65 @@
+indexes:
+
+# AUTOGENERATED
+
+# This index.yaml is automatically updated whenever the dev_appserver
+# detects that a new type of query is run. If you want to manage the
+# index.yaml file manually, remove the above marker line (the line
+# saying "# AUTOGENERATED"). If you want to manage some indexes
+# manually, move them above the marker line. The index.yaml file is
+# automatically uploaded to the admin console when you next deploy
+# your application using appcfg.py.
+
+- kind: DashboardFile
+ properties:
+ - name: name
+ - name: date
+ direction: desc
+
+- kind: TestFile
+ properties:
+ - name: builder
+ - name: date
+ direction: desc
+
+- kind: TestFile
+ properties:
+ - name: builder
+ - name: master
+ - name: name
+ - name: test_type
+ - name: date
+ direction: desc
+
+- kind: TestFile
+ properties:
+ - name: builder
+ - name: name
+ - name: date
+ direction: desc
+
+- kind: TestFile
+ properties:
+ - name: builder
+ - name: name
+ - name: test_type
+ - name: date
+ direction: desc
+
+- kind: TestFile
+ properties:
+ - name: master
+ - name: date
+ direction: desc
+
+- kind: TestFile
+ properties:
+ - name: name
+ - name: date
+ direction: desc
+
+- kind: TestFile
+ properties:
+ - name: test_type
+ - name: date
+ direction: desc
diff --git a/WebKitTools/TestResultServer/main.py b/WebKitTools/TestResultServer/main.py
new file mode 100644
index 0000000..aa6e432
--- /dev/null
+++ b/WebKitTools/TestResultServer/main.py
@@ -0,0 +1,58 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Request a modern Django
+from google.appengine.dist import use_library
+use_library('django', '1.1')
+
+from google.appengine.ext import webapp
+from google.appengine.ext.webapp.util import run_wsgi_app
+
+from handlers import dashboardhandler
+from handlers import menu
+from handlers import testfilehandler
+
+routes = [
+ ('/dashboards/delete', dashboardhandler.DeleteDashboardFile),
+ ('/dashboards/update', dashboardhandler.UpdateDashboardFile),
+ ('/dashboards/([^?]+)?', dashboardhandler.GetDashboardFile),
+ ('/testfile/delete', testfilehandler.DeleteFile),
+ ('/testfile/upload', testfilehandler.Upload),
+ ('/testfile/uploadform', testfilehandler.UploadForm),
+ ('/testfile/?', testfilehandler.GetFile),
+ ('/*|/menu', menu.Menu),
+]
+
+application = webapp.WSGIApplication(routes, debug=True)
+
+
+def main():
+ run_wsgi_app(application)
+
+if __name__ == "__main__":
+ main()
diff --git a/WebKitTools/TestResultServer/model/__init__.py b/WebKitTools/TestResultServer/model/__init__.py
new file mode 100644
index 0000000..ef65bee
--- /dev/null
+++ b/WebKitTools/TestResultServer/model/__init__.py
@@ -0,0 +1 @@
+# Required for Python to search this directory for module files
diff --git a/WebKitTools/TestResultServer/model/dashboardfile.py b/WebKitTools/TestResultServer/model/dashboardfile.py
new file mode 100644
index 0000000..57d3f6f
--- /dev/null
+++ b/WebKitTools/TestResultServer/model/dashboardfile.py
@@ -0,0 +1,117 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from datetime import datetime
+import logging
+import urllib
+import urllib2
+
+from google.appengine.ext import db
+
+SVN_PATH_DASHBOARD = ("http://src.chromium.org/viewvc/chrome/trunk/tools/"
+ "dashboards/")
+
+
+class DashboardFile(db.Model):
+ name = db.StringProperty()
+ data = db.BlobProperty()
+ date = db.DateTimeProperty(auto_now_add=True)
+
+ @classmethod
+ def get_files(cls, name, limit=1):
+ query = DashboardFile.all()
+ if name:
+ query = query.filter("name =", name)
+ return query.order("-date").fetch(limit)
+
+ @classmethod
+ def add_file(cls, name, data):
+ file = DashboardFile()
+ file.name = name
+ file.data = db.Blob(data)
+ file.put()
+
+ logging.debug("Dashboard file saved, name: %s.", name)
+
+ return file
+
+ @classmethod
+ def grab_file_from_svn(cls, name):
+ logging.debug("Grab file from SVN, name: %s.", name)
+
+ url = SVN_PATH_DASHBOARD + urllib.quote_plus(name)
+
+ logging.info("Grab file from SVN, url: %s.", url)
+ try:
+ file = urllib2.urlopen(url)
+ if not file:
+ logging.error("Failed to grab dashboard file: %s.", url)
+ return None
+
+ return file.read()
+ except urllib2.HTTPError, e:
+ logging.error("Failed to grab dashboard file: %s", str(e))
+ except urllib2.URLError, e:
+ logging.error("Failed to grab dashboard file: %s", str(e))
+
+ return None
+
+ @classmethod
+ def update_file(cls, name):
+ data = cls.grab_file_from_svn(name)
+ if not data:
+ return None
+
+ logging.info("Got file from SVN.")
+
+ files = cls.get_files(name)
+ if not files:
+ logging.info("No existing file, added as new file.")
+ return cls.add_file(name, data)
+
+ logging.debug("Updating existing file.")
+ file = files[0]
+ file.data = data
+ file.date = datetime.now()
+ file.put()
+
+ logging.info("Dashboard file replaced, name: %s.", name)
+
+ return file
+
+ @classmethod
+ def delete_file(cls, name):
+ files = cls.get_files(name)
+ if not files:
+ logging.warning("File not found, name: %s.", name)
+ return False
+
+ for file in files:
+ file.delete()
+
+ return True
diff --git a/WebKitTools/TestResultServer/model/datastorefile.py b/WebKitTools/TestResultServer/model/datastorefile.py
new file mode 100755
index 0000000..ac28d64
--- /dev/null
+++ b/WebKitTools/TestResultServer/model/datastorefile.py
@@ -0,0 +1,150 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from datetime import datetime
+import logging
+
+from google.appengine.ext import db
+
+MAX_DATA_ENTRY_PER_FILE = 10
+MAX_ENTRY_LEN = 1000 * 1000
+
+
+class DataEntry(db.Model):
+ """Datastore entry that stores one segmant of file data
+ (<1000*1000 bytes).
+ """
+
+ data = db.BlobProperty()
+
+ @classmethod
+ def get(cls, key):
+ return db.get(key)
+
+ def get_data(self, key):
+ return db.get(key)
+
+
+class DataStoreFile(db.Model):
+ """This class stores file in datastore.
+ If a file is oversize (>1000*1000 bytes), the file is split into
+ multiple segments and stored in multiple datastore entries.
+ """
+
+ name = db.StringProperty()
+ data_keys = db.ListProperty(db.Key)
+ # keys to the data store entries that can be reused for new data.
+ # If it is emtpy, create new DataEntry.
+ new_data_keys = db.ListProperty(db.Key)
+ date = db.DateTimeProperty(auto_now_add=True)
+
+ data = None
+
+ def delete_data(self, keys=None):
+ if not keys:
+ keys = self.data_keys
+
+ for key in keys:
+ data_entry = DataEntry.get(key)
+ if data_entry:
+ data_entry.delete()
+
+ def save_data(self, data):
+ if not data:
+ logging.warning("No data to save.")
+ return False
+
+ if len(data) > (MAX_DATA_ENTRY_PER_FILE * MAX_ENTRY_LEN):
+ logging.error("File too big, can't save to datastore: %dK",
+ len(data) / 1024)
+ return False
+
+ start = 0
+ # Use the new_data_keys to store new data. If all new data are saved
+ # successfully, swap new_data_keys and data_keys so we can reuse the
+ # data_keys entries in next run. If unable to save new data for any
+ # reason, only the data pointed by new_data_keys may be corrupted,
+ # the existing data_keys data remains untouched. The corrupted data
+ # in new_data_keys will be overwritten in next update.
+ keys = self.new_data_keys
+ self.new_data_keys = []
+
+ while start < len(data):
+ if keys:
+ key = keys[0]
+ data_entry = DataEntry.get(key)
+ if not data_entry:
+ logging.warning("Found key, but no data entry: %s", key)
+ data_entry = DataEntry()
+ else:
+ data_entry = DataEntry()
+
+ data_entry.data = db.Blob(data[start: start + MAX_ENTRY_LEN])
+ try:
+ data_entry.put()
+ except Exception, err:
+ logging.error("Failed to save data store entry: %s", err)
+ if keys:
+ self.delete_data(keys)
+ return False
+
+ logging.info("Data saved: %s.", data_entry.key())
+ self.new_data_keys.append(data_entry.key())
+ if keys:
+ keys.pop(0)
+
+ start = start + MAX_ENTRY_LEN
+
+ if keys:
+ self.delete_data(keys)
+
+ temp_keys = self.data_keys
+ self.data_keys = self.new_data_keys
+ self.new_data_keys = temp_keys
+ self.data = data
+
+ return True
+
+ def load_data(self):
+ if not self.data_keys:
+ logging.warning("No data to load.")
+ return None
+
+ data = []
+ for key in self.data_keys:
+ logging.info("Loading data for key: %s.", key)
+ data_entry = DataEntry.get(key)
+ if not data_entry:
+ logging.error("No data found for key: %s.", key)
+ return None
+
+ data.append(data_entry.data)
+
+ self.data = "".join(data)
+
+ return self.data
diff --git a/WebKitTools/TestResultServer/model/jsonresults.py b/WebKitTools/TestResultServer/model/jsonresults.py
new file mode 100755
index 0000000..97b277a
--- /dev/null
+++ b/WebKitTools/TestResultServer/model/jsonresults.py
@@ -0,0 +1,468 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from datetime import datetime
+from django.utils import simplejson
+import logging
+
+from model.testfile import TestFile
+
+JSON_RESULTS_FILE = "results.json"
+JSON_RESULTS_FILE_SMALL = "results-small.json"
+JSON_RESULTS_PREFIX = "ADD_RESULTS("
+JSON_RESULTS_SUFFIX = ");"
+JSON_RESULTS_VERSION_KEY = "version"
+JSON_RESULTS_BUILD_NUMBERS = "buildNumbers"
+JSON_RESULTS_TESTS = "tests"
+JSON_RESULTS_RESULTS = "results"
+JSON_RESULTS_TIMES = "times"
+JSON_RESULTS_PASS = "P"
+JSON_RESULTS_NO_DATA = "N"
+JSON_RESULTS_MIN_TIME = 1
+JSON_RESULTS_VERSION = 3
+JSON_RESULTS_MAX_BUILDS = 1500
+JSON_RESULTS_MAX_BUILDS_SMALL = 200
+
+
+class JsonResults(object):
+ @classmethod
+ def _strip_prefix_suffix(cls, data):
+ """Strip out prefix and suffix of json results string.
+
+ Args:
+ data: json file content.
+
+ Returns:
+ json string without prefix and suffix.
+ """
+
+ assert(data.startswith(JSON_RESULTS_PREFIX))
+ assert(data.endswith(JSON_RESULTS_SUFFIX))
+
+ return data[len(JSON_RESULTS_PREFIX):
+ len(data) - len(JSON_RESULTS_SUFFIX)]
+
+ @classmethod
+ def _generate_file_data(cls, json, sort_keys=False):
+ """Given json string, generate file content data by adding
+ prefix and suffix.
+
+ Args:
+ json: json string without prefix and suffix.
+
+ Returns:
+ json file data.
+ """
+
+ data = simplejson.dumps(json, separators=(',', ':'),
+ sort_keys=sort_keys)
+ return JSON_RESULTS_PREFIX + data + JSON_RESULTS_SUFFIX
+
+ @classmethod
+ def _load_json(cls, file_data):
+ """Load json file to a python object.
+
+ Args:
+ file_data: json file content.
+
+ Returns:
+ json object or
+ None on failure.
+ """
+
+ json_results_str = cls._strip_prefix_suffix(file_data)
+ if not json_results_str:
+ logging.warning("No json results data.")
+ return None
+
+ try:
+ return simplejson.loads(json_results_str)
+ except Exception, err:
+ logging.debug(json_results_str)
+ logging.error("Failed to load json results: %s", str(err))
+ return None
+
+ @classmethod
+ def _merge_json(cls, aggregated_json, incremental_json, num_runs):
+ """Merge incremental json into aggregated json results.
+
+ Args:
+ aggregated_json: aggregated json object.
+ incremental_json: incremental json object.
+
+ Returns:
+ True if merge succeeds or
+ False on failure.
+ """
+
+ # Merge non tests property data.
+ # Tests properties are merged in _merge_tests.
+ if not cls._merge_non_test_data(aggregated_json, incremental_json, num_runs):
+ return False
+
+ # Merge tests results and times
+ incremental_tests = incremental_json[JSON_RESULTS_TESTS]
+ if incremental_tests:
+ aggregated_tests = aggregated_json[JSON_RESULTS_TESTS]
+ cls._merge_tests(aggregated_tests, incremental_tests, num_runs)
+
+ return True
+
+ @classmethod
+ def _merge_non_test_data(cls, aggregated_json, incremental_json, num_runs):
+ """Merge incremental non tests property data into aggregated json results.
+
+ Args:
+ aggregated_json: aggregated json object.
+ incremental_json: incremental json object.
+
+ Returns:
+ True if merge succeeds or
+ False on failure.
+ """
+
+ incremental_builds = incremental_json[JSON_RESULTS_BUILD_NUMBERS]
+ aggregated_builds = aggregated_json[JSON_RESULTS_BUILD_NUMBERS]
+ aggregated_build_number = int(aggregated_builds[0])
+ # Loop through all incremental builds, start from the oldest run.
+ for index in reversed(range(len(incremental_builds))):
+ build_number = int(incremental_builds[index])
+ logging.debug("Merging build %s, incremental json index: %d.",
+ build_number, index)
+
+ # Return if not all build numbers in the incremental json results
+ # are newer than the most recent build in the aggregated results.
+ # FIXME: make this case work.
+ if build_number < aggregated_build_number:
+ logging.warning(("Build %d in incremental json is older than "
+ "the most recent build in aggregated results: %d"),
+ build_number, aggregated_build_number)
+ return False
+
+ # Return if the build number is duplicated.
+ # FIXME: skip the duplicated build and merge rest of the results.
+ # Need to be careful on skiping the corresponding value in
+ # _merge_tests because the property data for each test could
+ # be accumulated.
+ if build_number == aggregated_build_number:
+ logging.warning("Duplicate build %d in incremental json",
+ build_number)
+ return False
+
+ # Merge this build into aggreagated results.
+ cls._merge_one_build(aggregated_json, incremental_json, index, num_runs)
+
+ return True
+
+ @classmethod
+ def _merge_one_build(cls, aggregated_json, incremental_json,
+ incremental_index, num_runs):
+ """Merge one build of incremental json into aggregated json results.
+
+ Args:
+ aggregated_json: aggregated json object.
+ incremental_json: incremental json object.
+ incremental_index: index of the incremental json results to merge.
+ """
+
+ for key in incremental_json.keys():
+ # Merge json results except "tests" properties (results, times etc).
+ # "tests" properties will be handled separately.
+ if key == JSON_RESULTS_TESTS:
+ continue
+
+ if key in aggregated_json:
+ aggregated_json[key].insert(
+ 0, incremental_json[key][incremental_index])
+ aggregated_json[key] = \
+ aggregated_json[key][:num_runs]
+ else:
+ aggregated_json[key] = incremental_json[key]
+
+ @classmethod
+ def _merge_tests(cls, aggregated_json, incremental_json, num_runs):
+ """Merge "tests" properties:results, times.
+
+ Args:
+ aggregated_json: aggregated json object.
+ incremental_json: incremental json object.
+ """
+
+ all_tests = (set(aggregated_json.iterkeys()) |
+ set(incremental_json.iterkeys()))
+ for test_name in all_tests:
+ if test_name in aggregated_json:
+ aggregated_test = aggregated_json[test_name]
+ if test_name in incremental_json:
+ incremental_test = incremental_json[test_name]
+ results = incremental_test[JSON_RESULTS_RESULTS]
+ times = incremental_test[JSON_RESULTS_TIMES]
+ else:
+ results = [[1, JSON_RESULTS_NO_DATA]]
+ times = [[1, 0]]
+
+ cls._insert_item_run_length_encoded(
+ results, aggregated_test[JSON_RESULTS_RESULTS], num_runs)
+ cls._insert_item_run_length_encoded(
+ times, aggregated_test[JSON_RESULTS_TIMES], num_runs)
+ cls._normalize_results_json(test_name, aggregated_json)
+ else:
+ aggregated_json[test_name] = incremental_json[test_name]
+
+ @classmethod
+ def _insert_item_run_length_encoded(cls, incremental_item, aggregated_item, num_runs):
+ """Inserts the incremental run-length encoded results into the aggregated
+ run-length encoded results.
+
+ Args:
+ incremental_item: incremental run-length encoded results.
+ aggregated_item: aggregated run-length encoded results.
+ """
+
+ for item in incremental_item:
+ if len(aggregated_item) and item[1] == aggregated_item[0][1]:
+ aggregated_item[0][0] = min(
+ aggregated_item[0][0] + item[0], num_runs)
+ else:
+ aggregated_item.insert(0, item)
+
+ @classmethod
+ def _normalize_results_json(cls, test_name, aggregated_json):
+ """ Prune tests where all runs pass or tests that no longer exist and
+ truncate all results to JSON_RESULTS_MAX_BUILDS.
+
+ Args:
+ test_name: Name of the test.
+ aggregated_json: The JSON object with all the test results for
+ this builder.
+ """
+
+ aggregated_test = aggregated_json[test_name]
+ aggregated_test[JSON_RESULTS_RESULTS] = \
+ cls._remove_items_over_max_number_of_builds(
+ aggregated_test[JSON_RESULTS_RESULTS])
+ aggregated_test[JSON_RESULTS_TIMES] = \
+ cls._remove_items_over_max_number_of_builds(
+ aggregated_test[JSON_RESULTS_TIMES])
+
+ is_all_pass = cls._is_results_all_of_type(
+ aggregated_test[JSON_RESULTS_RESULTS], JSON_RESULTS_PASS)
+ is_all_no_data = cls._is_results_all_of_type(
+ aggregated_test[JSON_RESULTS_RESULTS], JSON_RESULTS_NO_DATA)
+
+ max_time = max(
+ [time[1] for time in aggregated_test[JSON_RESULTS_TIMES]])
+ # Remove all passes/no-data from the results to reduce noise and
+ # filesize. If a test passes every run, but
+ # takes >= JSON_RESULTS_MIN_TIME to run, don't throw away the data.
+ if (is_all_no_data or
+ (is_all_pass and max_time < JSON_RESULTS_MIN_TIME)):
+ del aggregated_json[test_name]
+
+ @classmethod
+ def _remove_items_over_max_number_of_builds(cls, encoded_list):
+ """Removes items from the run-length encoded list after the final
+ item that exceeds the max number of builds to track.
+
+ Args:
+ encoded_results: run-length encoded results. An array of arrays, e.g.
+ [[3,'A'],[1,'Q']] encodes AAAQ.
+ """
+ num_builds = 0
+ index = 0
+ for result in encoded_list:
+ num_builds = num_builds + result[0]
+ index = index + 1
+ if num_builds > JSON_RESULTS_MAX_BUILDS:
+ return encoded_list[:index]
+
+ return encoded_list
+
+ @classmethod
+ def _is_results_all_of_type(cls, results, type):
+ """Returns whether all the results are of the given type
+ (e.g. all passes).
+ """
+
+ return len(results) == 1 and results[0][1] == type
+
+ @classmethod
+ def _check_json(cls, builder, json):
+ """Check whether the given json is valid.
+
+ Args:
+ builder: builder name this json is for.
+ json: json object to check.
+
+ Returns:
+ True if the json is valid or
+ False otherwise.
+ """
+
+ version = json[JSON_RESULTS_VERSION_KEY]
+ if version > JSON_RESULTS_VERSION:
+ logging.error("Results JSON version '%s' is not supported.",
+ version)
+ return False
+
+ if not builder in json:
+ logging.error("Builder '%s' is not in json results.", builder)
+ return False
+
+ results_for_builder = json[builder]
+ if not JSON_RESULTS_BUILD_NUMBERS in results_for_builder:
+ logging.error("Missing build number in json results.")
+ return False
+
+ return True
+
+ @classmethod
+ def merge(cls, builder, aggregated, incremental, num_runs, sort_keys=False):
+ """Merge incremental json file data with aggregated json file data.
+
+ Args:
+ builder: builder name.
+ aggregated: aggregated json file data.
+ incremental: incremental json file data.
+ sort_key: whether or not to sort key when dumping json results.
+
+ Returns:
+ Merged json file data if merge succeeds or
+ None on failure.
+ """
+
+ if not incremental:
+ logging.warning("Nothing to merge.")
+ return None
+
+ logging.info("Loading incremental json...")
+ incremental_json = cls._load_json(incremental)
+ if not incremental_json:
+ return None
+
+ logging.info("Checking incremental json...")
+ if not cls._check_json(builder, incremental_json):
+ return None
+
+ logging.info("Loading existing aggregated json...")
+ aggregated_json = cls._load_json(aggregated)
+ if not aggregated_json:
+ return incremental
+
+ logging.info("Checking existing aggregated json...")
+ if not cls._check_json(builder, aggregated_json):
+ return incremental
+
+ logging.info("Merging json results...")
+ try:
+ if not cls._merge_json(aggregated_json[builder], incremental_json[builder], num_runs):
+ return None
+ except Exception, err:
+ logging.error("Failed to merge json results: %s", str(err))
+ return None
+
+ aggregated_json[JSON_RESULTS_VERSION_KEY] = JSON_RESULTS_VERSION
+
+ return cls._generate_file_data(aggregated_json, sort_keys)
+
+ @classmethod
+ def update(cls, master, builder, test_type, incremental):
+ """Update datastore json file data by merging it with incremental json
+ file. Writes the large file and a small file. The small file just stores
+ fewer runs.
+
+ Args:
+ master: master name.
+ builder: builder name.
+ test_type: type of test results.
+ incremental: incremental json file data to merge.
+
+ Returns:
+ Large TestFile object if update succeeds or
+ None on failure.
+ """
+ small_file = cls.update_file(master, builder, test_type, incremental, JSON_RESULTS_FILE_SMALL, JSON_RESULTS_MAX_BUILDS_SMALL)
+ large_file = cls.update_file(master, builder, test_type, incremental, JSON_RESULTS_FILE, JSON_RESULTS_MAX_BUILDS)
+
+ if small_file and large_file:
+ return large_file
+ return None
+
+ @classmethod
+ def update_file(cls, master, builder, test_type, incremental, filename, num_runs):
+ files = TestFile.get_files(master, builder, test_type, filename)
+ if files:
+ file = files[0]
+ new_results = cls.merge(builder, file.data, incremental, num_runs)
+ else:
+ # Use the incremental data if there is no aggregated file to merge.
+ file = TestFile()
+ file.master = master
+ file.builder = builder
+ file.test_type = test_type
+ file.name = filename
+ new_results = incremental
+ logging.info("No existing json results, incremental json is saved.")
+
+ if not new_results or not file.save(new_results):
+ logging.info(
+ "Update failed, master: %s, builder: %s, test_type: %s, name: %s." %
+ (master, builder, test_type, filename))
+ return None
+
+ return file
+
+ @classmethod
+ def get_test_list(cls, builder, json_file_data):
+ """Get list of test names from aggregated json file data.
+
+ Args:
+ json_file_data: json file data that has all test-data and
+ non-test-data.
+
+ Returns:
+ json file with test name list only. The json format is the same
+ as the one saved in datastore, but all non-test-data and test detail
+ results are removed.
+ """
+
+ logging.debug("Loading test results json...")
+ json = cls._load_json(json_file_data)
+ if not json:
+ return None
+
+ logging.debug("Checking test results json...")
+ if not cls._check_json(builder, json):
+ return None
+
+ test_list_json = {}
+ tests = json[builder][JSON_RESULTS_TESTS]
+ test_list_json[builder] = {
+ "tests": dict.fromkeys(tests, {})}
+
+ return cls._generate_file_data(test_list_json)
diff --git a/WebKitTools/TestResultServer/model/jsonresults_unittest.py b/WebKitTools/TestResultServer/model/jsonresults_unittest.py
new file mode 100755
index 0000000..c70b90c
--- /dev/null
+++ b/WebKitTools/TestResultServer/model/jsonresults_unittest.py
@@ -0,0 +1,322 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+try:
+ import jsonresults
+ from jsonresults import JsonResults
+except ImportError:
+ print "ERROR: Add the TestResultServer, google_appengine and yaml/lib directories to your PYTHONPATH"
+
+import unittest
+
+
+JSON_RESULTS_TEMPLATE = (
+ '{"Webkit":{'
+ '"allFixableCount":[[TESTDATA_COUNT]],'
+ '"buildNumbers":[[TESTDATA_BUILDNUMBERS]],'
+ '"chromeRevision":[[TESTDATA_CHROMEREVISION]],'
+ '"deferredCounts":[[TESTDATA_COUNTS]],'
+ '"fixableCount":[[TESTDATA_COUNT]],'
+ '"fixableCounts":[[TESTDATA_COUNTS]],'
+ '"secondsSinceEpoch":[[TESTDATA_TIMES]],'
+ '"tests":{[TESTDATA_TESTS]},'
+ '"webkitRevision":[[TESTDATA_WEBKITREVISION]],'
+ '"wontfixCounts":[[TESTDATA_COUNTS]]'
+ '},'
+ '"version":3'
+ '}')
+
+JSON_RESULTS_COUNTS_TEMPLATE = (
+ '{'
+ '"C":[TESTDATA],'
+ '"F":[TESTDATA],'
+ '"I":[TESTDATA],'
+ '"O":[TESTDATA],'
+ '"P":[TESTDATA],'
+ '"T":[TESTDATA],'
+ '"X":[TESTDATA],'
+ '"Z":[TESTDATA]}')
+
+JSON_RESULTS_TESTS_TEMPLATE = (
+ '"[TESTDATA_TEST_NAME]":{'
+ '"results":[[TESTDATA_TEST_RESULTS]],'
+ '"times":[[TESTDATA_TEST_TIMES]]}')
+
+JSON_RESULTS_PREFIX = "ADD_RESULTS("
+JSON_RESULTS_SUFFIX = ");"
+
+JSON_RESULTS_TEST_LIST_TEMPLATE = (
+ '{"Webkit":{"tests":{[TESTDATA_TESTS]}}}')
+
+
+class JsonResultsTest(unittest.TestCase):
+ def setUp(self):
+ self._builder = "Webkit"
+
+ def _make_test_json(self, test_data):
+ if not test_data:
+ return JSON_RESULTS_PREFIX + JSON_RESULTS_SUFFIX
+
+ (builds, tests) = test_data
+ if not builds or not tests:
+ return JSON_RESULTS_PREFIX + JSON_RESULTS_SUFFIX
+
+ json = JSON_RESULTS_TEMPLATE
+
+ counts = []
+ build_numbers = []
+ webkit_revision = []
+ chrome_revision = []
+ times = []
+ for build in builds:
+ counts.append(JSON_RESULTS_COUNTS_TEMPLATE.replace("[TESTDATA]", build))
+ build_numbers.append("1000%s" % build)
+ webkit_revision.append("2000%s" % build)
+ chrome_revision.append("3000%s" % build)
+ times.append("100000%s000" % build)
+
+ json = json.replace("[TESTDATA_COUNTS]", ",".join(counts))
+ json = json.replace("[TESTDATA_COUNT]", ",".join(builds))
+ json = json.replace("[TESTDATA_BUILDNUMBERS]", ",".join(build_numbers))
+ json = json.replace("[TESTDATA_WEBKITREVISION]", ",".join(webkit_revision))
+ json = json.replace("[TESTDATA_CHROMEREVISION]", ",".join(chrome_revision))
+ json = json.replace("[TESTDATA_TIMES]", ",".join(times))
+
+ json_tests = []
+ for test in tests:
+ t = JSON_RESULTS_TESTS_TEMPLATE.replace("[TESTDATA_TEST_NAME]", test[0])
+ t = t.replace("[TESTDATA_TEST_RESULTS]", test[1])
+ t = t.replace("[TESTDATA_TEST_TIMES]", test[2])
+ json_tests.append(t)
+
+ json = json.replace("[TESTDATA_TESTS]", ",".join(json_tests))
+
+ return JSON_RESULTS_PREFIX + json + JSON_RESULTS_SUFFIX
+
+ def _test_merge(self, aggregated_data, incremental_data, expected_data):
+ aggregated_results = self._make_test_json(aggregated_data)
+ incremental_results = self._make_test_json(incremental_data)
+ merged_results = JsonResults.merge(self._builder,
+ aggregated_results, incremental_results, jsonresults.JSON_RESULTS_MAX_BUILDS,
+ sort_keys=True)
+
+ if expected_data:
+ expected_results = self._make_test_json(expected_data)
+ self.assertEquals(merged_results, expected_results)
+ else:
+ self.assertFalse(merged_results)
+
+ def _test_get_test_list(self, input_data, expected_data):
+ input_results = self._make_test_json(input_data)
+
+ json_tests = []
+ for test in expected_data:
+ json_tests.append("\"" + test + "\":{}")
+
+ expected_results = JSON_RESULTS_PREFIX + \
+ JSON_RESULTS_TEST_LIST_TEMPLATE.replace(
+ "[TESTDATA_TESTS]", ",".join(json_tests)) + \
+ JSON_RESULTS_SUFFIX
+
+ actual_results = JsonResults.get_test_list(self._builder, input_results)
+ self.assertEquals(actual_results, expected_results)
+
+ def test(self):
+ # Empty incremental results json.
+ # Nothing to merge.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
+ # Incremental results
+ None,
+ # Expect no merge happens.
+ None)
+
+ # No actual incremental test results (only prefix and suffix) to merge.
+ # Nothing to merge.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
+ # Incremental results
+ ([], []),
+ # Expected no merge happens.
+ None)
+
+ # No existing aggregated results.
+ # Merged results == new incremental results.
+ self._test_merge(
+ # Aggregated results
+ None,
+ # Incremental results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
+ # Expected results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]))
+
+ # Single test for single run.
+ # Incremental results has the latest build and same test results for
+ # that run.
+ # Insert the incremental results at the first place and sum number
+ # of runs for "P" (200 + 1) to get merged results.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"F\"]", "[1,0]"]]),
+ # Expected results
+ (["3", "2", "1"], [["001.html", "[201,\"F\"]", "[201,0]"]]))
+
+ # Single test for single run.
+ # Incremental results has the latest build but different test results
+ # for that run.
+ # Insert the incremental results at the first place.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1, \"I\"]", "[1,1]"]]),
+ # Expected results
+ (["3", "2", "1"], [["001.html", "[1,\"I\"],[200,\"F\"]", "[1,1],[200,0]"]]))
+
+ # Single test for single run.
+ # Incremental results has the latest build but different test results
+ # for that run.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"],[10,\"I\"]", "[200,0],[10,1]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"I\"]", "[1,1]"]]),
+ # Expected results
+ (["3", "2", "1"], [["001.html", "[1,\"I\"],[200,\"F\"],[10,\"I\"]", "[1,1],[200,0],[10,1]"]]))
+
+ # Multiple tests for single run.
+ # All tests have incremental updates.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"], ["002.html", "[100,\"I\"]", "[100,1]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"F\"]", "[1,0]"], ["002.html", "[1,\"I\"]", "[1,1]"]]),
+ # Expected results
+ (["3", "2", "1"], [["001.html", "[201,\"F\"]", "[201,0]"], ["002.html", "[101,\"I\"]", "[101,1]"]]))
+
+ # Multiple tests for single run.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"], ["002.html", "[100,\"I\"]", "[100,1]"]]),
+ # Incremental results
+ (["3"], [["002.html", "[1,\"I\"]", "[1,1]"]]),
+ # Expected results
+ (["3", "2", "1"], [["001.html", "[1,\"N\"],[200,\"F\"]", "[201,0]"], ["002.html", "[101,\"I\"]", "[101,1]"]]))
+
+ # Single test for multiple runs.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
+ # Incremental results
+ (["4", "3"], [["001.html", "[2, \"I\"]", "[2,2]"]]),
+ # Expected results
+ (["4", "3", "2", "1"], [["001.html", "[2,\"I\"],[200,\"F\"]", "[2,2],[200,0]"]]))
+
+ # Multiple tests for multiple runs.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"], ["002.html", "[10,\"Z\"]", "[10,0]"]]),
+ # Incremental results
+ (["4", "3"], [["001.html", "[2, \"I\"]", "[2,2]"], ["002.html", "[1,\"C\"]", "[1,1]"]]),
+ # Expected results
+ (["4", "3", "2", "1"], [["001.html", "[2,\"I\"],[200,\"F\"]", "[2,2],[200,0]"], ["002.html", "[1,\"C\"],[10,\"Z\"]", "[1,1],[10,0]"]]))
+
+ # Test the build in incremental results is older than the most recent
+ # build in aggregated results.
+ # The incremental results should be dropped and no merge happens.
+ self._test_merge(
+ # Aggregated results
+ (["3", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
+ # Incremental results
+ (["2"], [["001.html", "[1, \"F\"]", "[1,0]"]]),
+ # Expected no merge happens.
+ None)
+
+ # Test the build in incremental results is same as the build in
+ # aggregated results.
+ # The incremental results should be dropped and no merge happens.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"F\"]", "[200,0]"]]),
+ # Incremental results
+ (["3", "2"], [["001.html", "[2, \"F\"]", "[2,0]"]]),
+ # Expected no merge happens.
+ None)
+
+ # Remove test where there is no data in all runs.
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"N\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"N\"]", "[1,0]"], ["002.html", "[1,\"P\"]", "[1,0]"]]),
+ # Expected results
+ (["3", "2", "1"], [["002.html", "[1,\"P\"],[10,\"F\"]", "[11,0]"]]))
+
+ # Remove test where all run pass and max running time < 1 seconds
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"P\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"P\"]", "[1,0]"], ["002.html", "[1,\"P\"]", "[1,0]"]]),
+ # Expected results
+ (["3", "2", "1"], [["002.html", "[1,\"P\"],[10,\"F\"]", "[11,0]"]]))
+
+ # Do not remove test where all run pass but max running time >= 1 seconds
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[200,\"P\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"P\"]", "[1,1]"], ["002.html", "[1,\"P\"]", "[1,0]"]]),
+ # Expected results
+ (["3", "2", "1"], [["001.html", "[201,\"P\"]", "[1,1],[200,0]"], ["002.html", "[1,\"P\"],[10,\"F\"]", "[11,0]"]]))
+
+ # Remove items from test results and times that exceeds the max number
+ # of builds to track.
+ max_builds = str(jsonresults.JSON_RESULTS_MAX_BUILDS)
+ self._test_merge(
+ # Aggregated results
+ (["2", "1"], [["001.html", "[" + max_builds + ",\"F\"],[1,\"I\"]", "[" + max_builds + ",0],[1,1]"]]),
+ # Incremental results
+ (["3"], [["001.html", "[1,\"T\"]", "[1,1]"]]),
+ # Expected results
+ (["3", "2", "1"], [["001.html", "[1,\"T\"],[" + max_builds + ",\"F\"]", "[1,1],[" + max_builds + ",0]"]]))
+
+ # Get test name list only. Don't include non-test-list data and
+ # of test result details.
+ self._test_get_test_list(
+ # Input results
+ (["3", "2", "1"], [["001.html", "[200,\"P\"]", "[200,0]"], ["002.html", "[10,\"F\"]", "[10,0]"]]),
+ # Expected results
+ ["001.html", "002.html"])
+
+if __name__ == '__main__':
+ unittest.main()
diff --git a/WebKitTools/TestResultServer/model/testfile.py b/WebKitTools/TestResultServer/model/testfile.py
new file mode 100644
index 0000000..e600c99
--- /dev/null
+++ b/WebKitTools/TestResultServer/model/testfile.py
@@ -0,0 +1,127 @@
+# Copyright (C) 2010 Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+from datetime import datetime
+import logging
+
+from google.appengine.ext import db
+
+from model.datastorefile import DataStoreFile
+
+
+class TestFile(DataStoreFile):
+ master = db.StringProperty()
+ builder = db.StringProperty()
+ test_type = db.StringProperty()
+
+ @classmethod
+ def delete_file(cls, key, master, builder, test_type, name, limit):
+ if key:
+ file = db.get(key)
+ if not file:
+ logging.warning("File not found, key: %s.", key)
+ return False
+
+ file._delete_all()
+ else:
+ files = cls.get_files(master, builder, test_type, name, limit)
+ if not files:
+ logging.warning(
+ "File not found, master: %s, builder: %s, test_type:%s, name: %s.",
+ builder, test_type, name)
+ return False
+
+ for file in files:
+ file._delete_all()
+
+ return True
+
+ @classmethod
+ def get_files(cls, master, builder, test_type, name, load_data=True, limit=1):
+ query = TestFile.all()
+ if master:
+ query = query.filter("master =", master)
+ if builder:
+ query = query.filter("builder =", builder)
+ if test_type:
+ query = query.filter("test_type =", test_type)
+ if name:
+ query = query.filter("name =", name)
+
+ files = query.order("-date").fetch(limit)
+ if load_data:
+ for file in files:
+ file.load_data()
+
+ return files
+
+ @classmethod
+ def add_file(cls, master, builder, test_type, name, data):
+ file = TestFile()
+ file.master = master
+ file.builder = builder
+ file.test_type = test_type
+ file.name = name
+
+ if not file.save(data):
+ return None
+
+ logging.info(
+ "File saved, master: %s, builder: %s, test_type: %s, name: %s, key: %s.",
+ master, builder, test_type, file.name, str(file.data_keys))
+
+ return file
+
+ @classmethod
+ def update(cls, master, builder, test_type, name, data):
+ files = cls.get_files(master, builder, test_type, name)
+ if not files:
+ return cls.add_file(master, builder, test_type, name, data)
+
+ file = files[0]
+ if not file.save(data):
+ return None
+
+ logging.info(
+ "File replaced, master: %s, builder: %s, test_type: %s, name: %s, data key: %s.",
+ master, builder, test_type, file.name, str(file.data_keys))
+
+ return file
+
+ def save(self, data):
+ if not self.save_data(data):
+ return False
+
+ self.date = datetime.now()
+ self.put()
+
+ return True
+
+ def _delete_all(self):
+ self.delete_data()
+ self.delete()
diff --git a/WebKitTools/TestResultServer/stylesheets/dashboardfile.css b/WebKitTools/TestResultServer/stylesheets/dashboardfile.css
new file mode 100644
index 0000000..1b0921c
--- /dev/null
+++ b/WebKitTools/TestResultServer/stylesheets/dashboardfile.css
@@ -0,0 +1,30 @@
+body {
+ font-family: Verdana, Helvetica, sans-serif;
+ padding: 0px;
+ color: #444;
+}
+h1 {
+ color: #444;
+ font-size: 14pt;
+ font-style: italic;
+ margin: 0px;
+ padding: 5px;
+}
+table {
+ border-spacing: 0px;
+}
+th {
+ background-color: #AAA;
+ color: white;
+ text-align: left;
+ padding: 5px;
+ font-size: 12pt;
+}
+td {
+ font-size: 11pt;
+ padding: 3px;
+ text-align: left;
+}
+tr:hover {
+ background-color: #EEE;
+}
diff --git a/WebKitTools/TestResultServer/stylesheets/form.css b/WebKitTools/TestResultServer/stylesheets/form.css
new file mode 100644
index 0000000..b8f367d
--- /dev/null
+++ b/WebKitTools/TestResultServer/stylesheets/form.css
@@ -0,0 +1,26 @@
+body {
+ font-family: Verdana;
+ padding: 0px;
+ color: #444;
+}
+h1 {
+ color: #444;
+ font-size: 14pt;
+ font-style: italic;
+ margin: 0px;
+ padding: 5px;
+}
+.label {
+ margin: 1px;
+ padding: 5px;
+ font-size: 11pt;
+ width: 90px;
+}
+.inputtext {
+ font-size: 11pt;
+}
+.button {
+ margin: 1px;
+ padding: 1px;
+ font-size: 11pt;
+}
diff --git a/WebKitTools/TestResultServer/stylesheets/menu.css b/WebKitTools/TestResultServer/stylesheets/menu.css
new file mode 100644
index 0000000..9948605
--- /dev/null
+++ b/WebKitTools/TestResultServer/stylesheets/menu.css
@@ -0,0 +1,28 @@
+body {
+ font-family: Verdana, Helvetica, sans-serif;
+}
+h1 {
+ background-color: #EEE;
+ color: #444;
+ font-size: 14pt;
+ font-style: italic;
+ margin: 0px;
+ padding: 5px;
+}
+ul {
+ margin: 0px;
+ padding: 20px;
+ list-style: none;
+}
+li {
+ padding: 5px;
+}
+li:hover {
+ background-color: #EEE;
+}
+.login {
+ font-size: 8pt;
+ text-align: right;
+ width: 100%;
+}
+
diff --git a/WebKitTools/TestResultServer/stylesheets/testfile.css b/WebKitTools/TestResultServer/stylesheets/testfile.css
new file mode 100644
index 0000000..1b0921c
--- /dev/null
+++ b/WebKitTools/TestResultServer/stylesheets/testfile.css
@@ -0,0 +1,30 @@
+body {
+ font-family: Verdana, Helvetica, sans-serif;
+ padding: 0px;
+ color: #444;
+}
+h1 {
+ color: #444;
+ font-size: 14pt;
+ font-style: italic;
+ margin: 0px;
+ padding: 5px;
+}
+table {
+ border-spacing: 0px;
+}
+th {
+ background-color: #AAA;
+ color: white;
+ text-align: left;
+ padding: 5px;
+ font-size: 12pt;
+}
+td {
+ font-size: 11pt;
+ padding: 3px;
+ text-align: left;
+}
+tr:hover {
+ background-color: #EEE;
+}
diff --git a/WebKitTools/TestResultServer/templates/dashboardfilelist.html b/WebKitTools/TestResultServer/templates/dashboardfilelist.html
new file mode 100644
index 0000000..818cb91
--- /dev/null
+++ b/WebKitTools/TestResultServer/templates/dashboardfilelist.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Dashboard Files</title>
+<link type="text/css" rel="stylesheet" href="/stylesheets/dashboardfile.css" />
+</head>
+<body>
+<h1>Dashboard Files
+</h1>
+<div>
+ <table>
+ <tr>
+ <th>File</th>
+ <th>Date</th>
+ {% if admin %}
+ <th></th>
+ {% endif %}
+ {% for file in files %}
+ <tr>{% if file.name %}
+ <td><a href="/dashboards/{{ file.name }}" >
+ {{ file.name }}
+ </a>
+ </td>
+ <td>{{ file.date|date:"d-M-Y H:i:s" }}
+ </td>
+ {% if admin %}
+ <td><a href="/dashboards/delete?file={{ file.name }}" >
+ Delete
+ </a>
+ </td>
+ {% endif %}
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+</div>
+</body>
+</html>
diff --git a/WebKitTools/TestResultServer/templates/menu.html b/WebKitTools/TestResultServer/templates/menu.html
new file mode 100644
index 0000000..1ad9f4d
--- /dev/null
+++ b/WebKitTools/TestResultServer/templates/menu.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test Result Server</title>
+<table class=login>
+ <tr>
+ <td>
+ {% if user_email %}
+ <span>{{ user_email }}</span>
+ {% endif %}
+ <span><a href="{{ login_url }}">{{ login_text }}</a></span>
+ </td>
+ </tr>
+</table>
+<link type="text/css" rel="stylesheet" href="/stylesheets/menu.css" />
+</head>
+<body>
+<h1>Test Result Server</h1>
+<div>
+ <ul>{% for title,link in menu %}
+ <li>
+ <a href="{{ link }}" >{{ title }}</a>
+ </li>{% endfor %}
+ </ul>
+</div>
+</body>
+</html>
diff --git a/WebKitTools/TestResultServer/templates/showfilelist.html b/WebKitTools/TestResultServer/templates/showfilelist.html
new file mode 100644
index 0000000..d292fe2
--- /dev/null
+++ b/WebKitTools/TestResultServer/templates/showfilelist.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test Results</title>
+<link type="text/css" rel="stylesheet" href="/stylesheets/testfile.css" />
+</head>
+<body>
+<h1>Test Results
+{% if builder or test_type or name %}
+- {{ builder }} {{test_type }} {{ name }}
+{% endif %}
+</h1>
+<div>
+ <table>
+ <tr>
+ <th>Master</th>
+ <th>Builder</th>
+ <th>Test Type</th>
+ <th>File</th>
+ <th>Date</th>
+ {% if admin %}
+ <th></th>
+ {% endif %}
+ {% for file in files %}
+ <tr>{% if file.builder and file.name %}
+ <td><a href="/testfile?master={{ file.master }}" >
+ {{ file.master }}
+ </a>
+ </td>
+ <td><a href="/testfile?builder={{ file.builder }}" >
+ {{ file.builder }}
+ </a>
+ </td>
+ <td>{% if file.test_type %}
+ <a href="/testfile?testtype={{ file.test_type }}" >
+ {{ file.test_type }}
+ </a>
+ {% endif %}
+ </td>
+ <td><a href="/testfile?builder={{ file.builder }}&name={{ file.name }}" >
+ {{ file.name }}
+ </a>
+ </td>
+ <td>{{ file.date|date:"d-M-Y H:i:s" }}
+ </td>
+ {% if admin %}
+ <td><a href="/testfile/delete?key={{ file.key }}&builder={{ builder }}&name={{ name }}" >
+ Delete
+ </a>
+ </td>
+ {% endif %}
+ {% endif %}
+ </tr>
+ {% endfor %}
+ </table>
+</div>
+</body>
+</html>
diff --git a/WebKitTools/TestResultServer/templates/uploadform.html b/WebKitTools/TestResultServer/templates/uploadform.html
new file mode 100644
index 0000000..9974a24
--- /dev/null
+++ b/WebKitTools/TestResultServer/templates/uploadform.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Upload Test Result File</title>
+<link type="text/css" rel="stylesheet" href="/stylesheets/form.css" />
+</head>
+<body>
+<h1>Upload Test Result File</h1>
+<form id="uploadForm" name="test_result_upload" accept="text/html" action="{{ upload_url }}" enctype="multipart/form-data" method="post">
+ <br>
+ <table>
+ <tr>
+ <td class=label><label>Master:</label></td>
+ <td><input class=inputtext type="text" name="master" placeholder="Chromium"/></td>
+ </tr>
+ <tr>
+ <td class=label><label>Builder:</label></td>
+ <td><input class=inputtext type="text" name="builder" placeholder="Webkit"/></td>
+ </tr>
+ <tr>
+ <td class=label><label>Test Type:</label></td>
+ <td><input class=inputtext type="text" name="testtype" placeholder="layout-tests"/></td>
+ </tr>
+ </table>
+ <br>
+ <div><input class=button type="checkbox" name="incremental">Incremental results, merge with server file.</div>
+ <br>
+ <div><input class=button type="file" name="file" multiple></div>
+ <br>
+ <div><input class=button type="submit" value="Upload"></div>
+</form>
+</body>
+</html>
diff --git a/WebKitTools/TestWebKitAPI/Configurations/Base.xcconfig b/WebKitTools/TestWebKitAPI/Configurations/Base.xcconfig
new file mode 100644
index 0000000..feabe9a
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Configurations/Base.xcconfig
@@ -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. ``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 = $(WEBCORE_PRIVATE_HEADERS_DIR)/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;
+
+WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
+WEBCORE_PRIVATE_HEADERS_DIR = $(WEBKIT_UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
diff --git a/WebKitTools/TestWebKitAPI/Configurations/DebugRelease.xcconfig b/WebKitTools/TestWebKitAPI/Configurations/DebugRelease.xcconfig
new file mode 100644
index 0000000..41600b1
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Configurations/DebugRelease.xcconfig
@@ -0,0 +1,42 @@
+// 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;
+
+WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(BUILT_PRODUCTS_DIR);
diff --git a/WebKitTools/TestWebKitAPI/Configurations/InjectedBundle.xcconfig b/WebKitTools/TestWebKitAPI/Configurations/InjectedBundle.xcconfig
new file mode 100644
index 0000000..6bf31b2
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/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 = InjectedBundleTestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig b/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig
new file mode 100644
index 0000000..5e69d0e
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPI.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 = TestWebKitAPI
+GCC_ENABLE_OBJC_EXCEPTIONS = YES
+GCC_PREFIX_HEADER = TestWebKitAPIPrefix.h
diff --git a/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICFLite.vsprops b/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICFLite.vsprops
new file mode 100644
index 0000000..61b6614
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICFLite.vsprops
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="TestWebKitAPICFLite"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="CFLite$(LibraryConfigSuffix).lib"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops b/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops
new file mode 100644
index 0000000..1de3506
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICommon.vsprops
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="TestWebKitAPICommon"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\include&quot;;&quot;$(WebKitOutputDir)\include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
+ ForcedIncludeFiles="TestWebKitAPIPrefix.h"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="WebKit$(WebKitDLLConfigSuffix).lib JavaScriptCore$(WebKitDLLConfigSuffix).lib"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
+ />
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICoreFoundation.vsprops b/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICoreFoundation.vsprops
new file mode 100644
index 0000000..ee139c0
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Configurations/TestWebKitAPICoreFoundation.vsprops
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="TestWebKitAPICoreFoundation"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="CoreFoundation$(LibraryConfigSuffix).lib"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/TestWebKitAPI/InjectedBundle-Info.plist b/WebKitTools/TestWebKitAPI/InjectedBundle-Info.plist
new file mode 100644
index 0000000..c285a47
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/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.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/TestWebKitAPI/InjectedBundleController.cpp b/WebKitTools/TestWebKitAPI/InjectedBundleController.cpp
new file mode 100644
index 0000000..5942ec8
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/InjectedBundleController.cpp
@@ -0,0 +1,114 @@
+/*
+ * 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 "InjectedBundleController.h"
+
+#include "InjectedBundleTest.h"
+#include "PlatformUtilities.h"
+#include <WebKit2/WebKit2.h>
+#include <algorithm>
+#include <assert.h>
+
+namespace TestWebKitAPI {
+
+InjectedBundleController& InjectedBundleController::shared()
+{
+ static InjectedBundleController& shared = *new InjectedBundleController;
+ return shared;
+}
+
+InjectedBundleController::InjectedBundleController()
+ : m_bundle(0)
+ , m_currentTest(0)
+{
+}
+
+void InjectedBundleController::initialize(WKBundleRef bundle, WKTypeRef initializationUserData)
+{
+ m_bundle = bundle;
+
+ WKBundleClient client = {
+ 0,
+ this,
+ didCreatePage,
+ willDestroyPage,
+ didReceiveMessage
+ };
+ WKBundleSetClient(m_bundle, &client);
+
+ // Initialize the test from the "initializationUserData".
+ assert(WKGetTypeID(initializationUserData) == WKStringGetTypeID());
+ WKStringRef testName = static_cast<WKStringRef>(initializationUserData);
+
+ initializeTestNamed(bundle, Util::toSTD(testName));
+}
+
+void InjectedBundleController::didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+ InjectedBundleController* self = static_cast<InjectedBundleController*>(const_cast<void*>(clientInfo));
+ assert(self->m_currentTest);
+ self->m_currentTest->didCreatePage(bundle, page);
+}
+
+void InjectedBundleController::willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+ InjectedBundleController* self = static_cast<InjectedBundleController*>(const_cast<void*>(clientInfo));
+ assert(self->m_currentTest);
+ self->m_currentTest->willDestroyPage(bundle, page);
+}
+
+void InjectedBundleController::didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
+{
+ InjectedBundleController* self = static_cast<InjectedBundleController*>(const_cast<void*>(clientInfo));
+ assert(self->m_currentTest);
+ self->m_currentTest->didReceiveMessage(bundle, messageName, messageBody);
+}
+
+void InjectedBundleController::dumpTestNames()
+{
+ std::map<std::string, CreateInjectedBundleTestFunction>::const_iterator it = m_createInjectedBundleTestFunctions.begin();
+ std::map<std::string, CreateInjectedBundleTestFunction>::const_iterator end = m_createInjectedBundleTestFunctions.end();
+ for (; it != end; ++it)
+ printf("%s\n", (*it).first.c_str());
+}
+
+void InjectedBundleController::initializeTestNamed(WKBundleRef bundle, const std::string& identifier)
+{
+ CreateInjectedBundleTestFunction createTestFunction = m_createInjectedBundleTestFunctions[identifier];
+ if (!createTestFunction) {
+ printf("ERROR: InjectedBundle test not found - %s\n", identifier.c_str());
+ exit(1);
+ }
+
+ m_currentTest = createTestFunction(identifier);
+ m_currentTest->initialize(bundle);
+}
+
+void InjectedBundleController::registerCreateInjectedBundleTestFunction(const std::string& identifier, CreateInjectedBundleTestFunction function)
+{
+ m_createInjectedBundleTestFunctions[identifier] = function;
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/InjectedBundleController.h b/WebKitTools/TestWebKitAPI/InjectedBundleController.h
new file mode 100644
index 0000000..91c571e
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/InjectedBundleController.h
@@ -0,0 +1,64 @@
+/*
+ * 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 InjectedBundleController_h
+#define InjectedBundleController_h
+
+#include <WebKit2/WKBundle.h>
+#include <map>
+#include <string>
+
+namespace TestWebKitAPI {
+
+class InjectedBundleTest;
+
+class InjectedBundleController {
+public:
+ static InjectedBundleController& shared();
+
+ void initialize(WKBundleRef, WKTypeRef);
+
+ void dumpTestNames();
+ void initializeTestNamed(WKBundleRef bundle, const std::string&);
+
+ typedef InjectedBundleTest* (*CreateInjectedBundleTestFunction)(const std::string&);
+ void registerCreateInjectedBundleTestFunction(const std::string&, CreateInjectedBundleTestFunction);
+
+private:
+ InjectedBundleController();
+ ~InjectedBundleController();
+
+ static void didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
+ static void willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo);
+ static void didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo);
+
+ std::map<std::string, CreateInjectedBundleTestFunction> m_createInjectedBundleTestFunctions;
+ WKBundleRef m_bundle;
+ InjectedBundleTest* m_currentTest;
+};
+
+} // namespace TestWebKitAPI
+
+#endif // InjectedBundleController_h
diff --git a/WebKitTools/TestWebKitAPI/InjectedBundleMain.cpp b/WebKitTools/TestWebKitAPI/InjectedBundleMain.cpp
new file mode 100644
index 0000000..355c35b
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/InjectedBundleMain.cpp
@@ -0,0 +1,37 @@
+/*
+ * 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 "InjectedBundleController.h"
+#include <WebKit2/WKBundleInitialize.h>
+
+#if defined(WIN32) || defined(_WIN32)
+extern "C" __declspec(dllexport)
+#else
+extern "C"
+#endif
+void WKBundleInitialize(WKBundleRef bundle, WKTypeRef initializationUserData)
+{
+ TestWebKitAPI::InjectedBundleController::shared().initialize(bundle, initializationUserData);
+}
diff --git a/WebKitTools/TestWebKitAPI/InjectedBundleTest.h b/WebKitTools/TestWebKitAPI/InjectedBundleTest.h
new file mode 100644
index 0000000..b0224f2
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/InjectedBundleTest.h
@@ -0,0 +1,70 @@
+/*
+ * 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 InjectedBundleTest_h
+#define InjectedBundleTest_h
+
+#include "InjectedBundleController.h"
+
+namespace TestWebKitAPI {
+
+class InjectedBundleTest {
+public:
+ virtual ~InjectedBundleTest() { }
+
+ virtual void initialize(WKBundleRef) { }
+
+ virtual void didCreatePage(WKBundleRef, WKBundlePageRef) { }
+ virtual void willDestroyPage(WKBundleRef, WKBundlePageRef) { }
+ virtual void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody) { }
+
+ std::string name() const { return m_identifier; }
+
+ template<typename TestClassTy> class Register {
+ public:
+ Register(const std::string& test)
+ {
+ InjectedBundleController::shared().registerCreateInjectedBundleTestFunction(test, Register::create);
+ }
+
+ private:
+ static InjectedBundleTest* create(const std::string& identifier)
+ {
+ return new TestClassTy(identifier);
+ }
+ };
+
+protected:
+ InjectedBundleTest(const std::string& identifier)
+ : m_identifier(identifier)
+ {
+ }
+
+ std::string m_identifier;
+};
+
+} // namespace TestWebKitAPI
+
+#endif // InjectedBundleTest_h
diff --git a/WebKitTools/TestWebKitAPI/Makefile b/WebKitTools/TestWebKitAPI/Makefile
new file mode 100644
index 0000000..ed01cce
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Makefile
@@ -0,0 +1,21 @@
+# Build TestWebKitAPI only on Snow Leopard and later.
+
+OSX_VERSION ?= $(shell sw_vers -productVersion | cut -d. -f 2)
+BUILD_TESTWEBKITAPI = $(shell (( $(OSX_VERSION) >= 6 )) && echo "YES" )
+
+ifeq "$(BUILD_TESTWEBKITAPI)" "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/TestWebKitAPI/PlatformUtilities.cpp b/WebKitTools/TestWebKitAPI/PlatformUtilities.cpp
new file mode 100644
index 0000000..281fb13
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/PlatformUtilities.cpp
@@ -0,0 +1,56 @@
+/*
+ * 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 "PlatformUtilities.h"
+
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WebKit2.h>
+#include <wtf/OwnArrayPtr.h>
+#include <wtf/PassOwnArrayPtr.h>
+
+namespace TestWebKitAPI {
+namespace Util {
+
+WKContextRef createContextForInjectedBundleTest(const std::string& testName)
+{
+ WKRetainPtr<WKStringRef> injectedBundlePath(AdoptWK, createInjectedBundlePath());
+ WKContextRef context = WKContextCreateWithInjectedBundlePath(injectedBundlePath.get());
+
+ WKRetainPtr<WKStringRef> testNameString(AdoptWK, WKStringCreateWithUTF8CString(testName.c_str()));
+ WKContextSetInitializationUserDataForInjectedBundle(context, testNameString.get());
+
+ return context;
+}
+
+std::string toSTD(WKStringRef string)
+{
+ size_t bufferSize = WKStringGetMaximumUTF8CStringSize(string);
+ OwnArrayPtr<char> buffer = adoptArrayPtr(new char[bufferSize]);
+ size_t stringLength = WKStringGetUTF8CString(string, buffer.get(), bufferSize);
+ return std::string(buffer.get(), stringLength - 1);
+}
+
+} // namespace Util
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/PlatformUtilities.h b/WebKitTools/TestWebKitAPI/PlatformUtilities.h
new file mode 100644
index 0000000..8ae347c
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/PlatformUtilities.h
@@ -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.
+ */
+
+#ifndef PlatformUtilities_h
+#define PlatformUtilities_h
+
+#include <WebKit2/WebKit2.h>
+#include <string>
+
+namespace TestWebKitAPI {
+namespace Util {
+
+// Runs a platform runloop until the 'done' is true.
+void run(bool* done);
+
+WKContextRef createContextForInjectedBundleTest(const std::string&);
+
+WKStringRef createInjectedBundlePath();
+WKURLRef createURLForResource(const char* resource, const char* extension);
+WKURLRef URLForNonExistentResource();
+
+bool isKeyDown(WKNativeEventPtr);
+
+std::string toSTD(WKStringRef string);
+
+} // namespace Util
+} // namespace TestWebKitAPI
+
+#endif // PlatformUtilities_h
diff --git a/WebKitTools/TestWebKitAPI/PlatformWebView.h b/WebKitTools/TestWebKitAPI/PlatformWebView.h
new file mode 100644
index 0000000..7f4f057
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/PlatformWebView.h
@@ -0,0 +1,85 @@
+/*
+ * 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
+
+#include <wtf/Platform.h>
+
+#ifdef __APPLE__
+#ifdef __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 TestWebKitAPI {
+
+#if PLATFORM(WIN)
+class WindowMessageObserver;
+#endif
+
+class PlatformWebView {
+public:
+ PlatformWebView(WKPageNamespaceRef);
+ ~PlatformWebView();
+
+ WKPageRef page();
+ PlatformWKView platformView() const { return m_view; }
+ void resizeTo(unsigned width, unsigned height);
+ void focus();
+
+ void simulateSpacebarKeyPress();
+ void simulateAltKeyPress();
+
+#if PLATFORM(WIN)
+ void setParentWindowMessageObserver(WindowMessageObserver* observer) { m_parentWindowMessageObserver = observer; }
+#endif
+
+private:
+#if PLATFORM(WIN)
+ static void registerWindowClass();
+ static LRESULT CALLBACK wndProc(HWND, UINT message, WPARAM, LPARAM);
+#endif
+
+ PlatformWKView m_view;
+ PlatformWindow m_window;
+
+#if PLATFORM(WIN)
+ WindowMessageObserver* m_parentWindowMessageObserver;
+#endif
+};
+
+} // namespace TestWebKitAPI
+
+#endif // PlatformWebView_h
diff --git a/WebKitTools/TestWebKitAPI/Test.h b/WebKitTools/TestWebKitAPI/Test.h
new file mode 100644
index 0000000..93bfd8b
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Test.h
@@ -0,0 +1,86 @@
+/*
+ * 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 Test_h
+#define Test_h
+
+#include "TestsController.h"
+
+namespace TestWebKitAPI {
+
+// Abstract base class that all tests inherit from.
+class Test {
+public:
+ virtual ~Test() { }
+
+ virtual void run() = 0;
+ std::string name() const { return m_identifier; }
+
+ template<typename TestClassTy> class Register {
+ public:
+ Register(const std::string& testSuite, const std::string& testCase)
+ {
+ TestsController::shared().registerCreateTestFunction(testSuite + "/" + testCase, Register::create);
+ }
+
+ private:
+ static Test* create(const std::string& identifier)
+ {
+ return new TestClassTy(identifier);
+ }
+ };
+
+protected:
+ Test(const std::string& identifier)
+ : m_identifier(identifier)
+ {
+ }
+
+ std::string m_identifier;
+};
+
+#define TEST_CLASS_NAME(testSuite, testCaseName) testSuite##testCaseName##_Test
+#define TEST_REGISTRAR_NAME(testSuite, testCaseName) testSuite##testCaseName##_Registrar
+
+// Use this to define a new test.
+#define TEST(testSuite, testCaseName) \
+ class TEST_CLASS_NAME(testSuite, testCaseName) : public Test { \
+ public: \
+ TEST_CLASS_NAME(testSuite, testCaseName)(const std::string& identifier) \
+ : Test(identifier) \
+ { \
+ } \
+ virtual void run(); \
+ }; \
+ \
+ static Test::Register<TEST_CLASS_NAME(testSuite, testCaseName)> TEST_REGISTRAR_NAME(testSuite, testCaseName)(#testSuite, #testCaseName); \
+ \
+ void TEST_CLASS_NAME(testSuite, testCaseName)::run()
+
+#define TEST_ASSERT(expression) do { if (!(expression)) { TestsController::shared().testFailed(__FILE__, __LINE__, #expression); return; } } while (0)
+
+} // namespace TestWebKitAPI
+
+#endif // Test_h
diff --git a/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..ef55b28
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
@@ -0,0 +1,489 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 1A02C84F125D4A8400E3F4BD /* Find.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A02C84E125D4A8400E3F4BD /* Find.cpp */; };
+ 1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1A02C84B125D4A5E00E3F4BD /* find.html */; };
+ 1A5FEFDD1270E2A3000E2921 /* EvaluateJavaScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */; };
+ 333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */; };
+ BC131885117114B600B69727 /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; };
+ BC131A9B1171316900B69727 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131A9A1171316900B69727 /* main.mm */; };
+ BC131AA9117131FC00B69727 /* TestsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC131AA8117131FC00B69727 /* TestsController.cpp */; };
+ BC575A90126E74D3006F0F12 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB9E9F011235BDE00A137E0 /* Cocoa.framework */; };
+ BC575A91126E74D3006F0F12 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCA61DB411700EFD00460D1E /* WebKit2.framework */; };
+ BC575A92126E74D3006F0F12 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC90964D1255620C00083756 /* JavaScriptCore.framework */; };
+ BC575A97126E74F1006F0F12 /* InjectedBundleMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC575946126E7351006F0F12 /* InjectedBundleMain.cpp */; };
+ BC575AA2126E7660006F0F12 /* InjectedBundleController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC575AA0126E7657006F0F12 /* InjectedBundleController.cpp */; };
+ BC575AAD126E83B9006F0F12 /* InjectedBundleBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC575AAC126E83B9006F0F12 /* InjectedBundleBasic.cpp */; };
+ BC575AB0126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC575AAF126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp */; };
+ BC575BC0126F5752006F0F12 /* PlatformUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC575BBF126F5752006F0F12 /* PlatformUtilities.cpp */; };
+ BC575BD9126F58E2006F0F12 /* PlatformUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC575BBF126F5752006F0F12 /* PlatformUtilities.cpp */; };
+ BC575BE0126F590D006F0F12 /* PlatformUtilitiesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */; };
+ BC90955D125548AA00083756 /* PlatformWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC90955C125548AA00083756 /* PlatformWebViewMac.mm */; };
+ BC90964C125561BF00083756 /* VectorBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC90964B125561BF00083756 /* VectorBasic.cpp */; };
+ BC90964E1255620C00083756 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC90964D1255620C00083756 /* JavaScriptCore.framework */; };
+ BC90977A125571AB00083756 /* PageLoadBasic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC909779125571AB00083756 /* PageLoadBasic.cpp */; };
+ BC909784125571CF00083756 /* simple.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = BC909778125571AB00083756 /* simple.html */; };
+ BC90995E12567BC100083756 /* WKString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC90995D12567BC100083756 /* WKString.cpp */; };
+ BC9099941256ACF100083756 /* WKStringJSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC9099931256ACF100083756 /* WKStringJSString.cpp */; };
+ BCA61DB511700EFD00460D1E /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCA61DB411700EFD00460D1E /* WebKit2.framework */; };
+ BCB68040126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */; };
+ BCB68042126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */; };
+ BCB9E9F111235BDE00A137E0 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCB9E9F011235BDE00A137E0 /* Cocoa.framework */; };
+ BCBD3710125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */; };
+ BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */ = {isa = PBXBuildFile; fileRef = BCBD372E125ABBE600D2C29F /* icon.png */; };
+ BCBD3761125ABCFE00D2C29F /* FrameMIMETypePNG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */; };
+ BCC8B95B12611F4700DE46A4 /* FailedLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */; };
+ C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C02B7882126615410026BF0F /* spacebar-scrolling.html */; };
+ C02B77F2126612140026BF0F /* SpacebarScrolling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */; };
+ C02B7854126613AE0026BF0F /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C02B7853126613AE0026BF0F /* Carbon.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ BC575A95126E74E7006F0F12 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BC57597F126E74AF006F0F12;
+ remoteInfo = InjectedBundle;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 8DD76F9E0486AA7600D96B5E /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /usr/share/man/man1/;
+ dstSubfolderSpec = 0;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+ BCB9F4FB112384C000A137E0 /* Copy Resources */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 7;
+ files = (
+ BCBD3737125ABBEB00D2C29F /* icon.png in Copy Resources */,
+ 1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */,
+ BC909784125571CF00083756 /* simple.html in Copy Resources */,
+ C01A23F21266156700C9ED55 /* spacebar-scrolling.html in Copy Resources */,
+ );
+ name = "Copy Resources";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 1A02C84B125D4A5E00E3F4BD /* find.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = find.html; sourceTree = "<group>"; };
+ 1A02C84E125D4A8400E3F4BD /* Find.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Find.cpp; sourceTree = "<group>"; };
+ 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EvaluateJavaScript.cpp; sourceTree = "<group>"; };
+ 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; };
+ 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebKitAPI; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC131883117114A800B69727 /* PlatformUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformUtilities.h; sourceTree = "<group>"; };
+ BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformUtilitiesMac.mm; sourceTree = "<group>"; };
+ BC131A9A1171316900B69727 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
+ BC131A9E1171317C00B69727 /* TestWebKitAPIPrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestWebKitAPIPrefix.h; sourceTree = "<group>"; };
+ BC131AA8117131FC00B69727 /* TestsController.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = TestsController.cpp; sourceTree = "<group>"; };
+ BC575946126E7351006F0F12 /* InjectedBundleMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMain.cpp; sourceTree = "<group>"; };
+ BC575980126E74AF006F0F12 /* InjectedBundleTestWebKitAPI.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InjectedBundleTestWebKitAPI.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC575981126E74AF006F0F12 /* InjectedBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InjectedBundle-Info.plist"; sourceTree = "<group>"; };
+ BC575A9E126E75FB006F0F12 /* InjectedBundleTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleTest.h; sourceTree = "<group>"; };
+ BC575A9F126E7657006F0F12 /* InjectedBundleController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleController.h; sourceTree = "<group>"; };
+ BC575AA0126E7657006F0F12 /* InjectedBundleController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleController.cpp; sourceTree = "<group>"; };
+ BC575AAC126E83B9006F0F12 /* InjectedBundleBasic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleBasic.cpp; sourceTree = "<group>"; };
+ BC575AAF126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleBasic_Bundle.cpp; sourceTree = "<group>"; };
+ BC575AE2126E88B1006F0F12 /* InjectedBundle.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = InjectedBundle.xcconfig; sourceTree = "<group>"; };
+ BC575BBF126F5752006F0F12 /* PlatformUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformUtilities.cpp; sourceTree = "<group>"; };
+ BC90951B125533D700083756 /* PlatformWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformWebView.h; sourceTree = "<group>"; };
+ BC90955C125548AA00083756 /* PlatformWebViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformWebViewMac.mm; sourceTree = "<group>"; };
+ BC90957E12554CF900083756 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
+ BC90957F12554CF900083756 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
+ BC90958012554CF900083756 /* TestWebKitAPI.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = TestWebKitAPI.xcconfig; sourceTree = "<group>"; };
+ BC90964B125561BF00083756 /* VectorBasic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VectorBasic.cpp; path = WTF/VectorBasic.cpp; sourceTree = "<group>"; };
+ BC90964D1255620C00083756 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC909778125571AB00083756 /* simple.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = simple.html; sourceTree = "<group>"; };
+ BC909779125571AB00083756 /* PageLoadBasic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageLoadBasic.cpp; sourceTree = "<group>"; };
+ BC90995D12567BC100083756 /* WKString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKString.cpp; sourceTree = "<group>"; };
+ BC9099931256ACF100083756 /* WKStringJSString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKStringJSString.cpp; sourceTree = "<group>"; };
+ BCA61DB411700EFD00460D1E /* WebKit2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentStartUserScriptAlertCrash.cpp; sourceTree = "<group>"; };
+ BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentStartUserScriptAlertCrash_Bundle.cpp; sourceTree = "<group>"; };
+ BCB9E7C711234E3A00A137E0 /* TestsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestsController.h; sourceTree = "<group>"; };
+ BCB9E7FA112359A300A137E0 /* Test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Test.h; sourceTree = "<group>"; };
+ BCB9E9F011235BDE00A137E0 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameMIMETypeHTML.cpp; sourceTree = "<group>"; };
+ BCBD372E125ABBE600D2C29F /* icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = icon.png; sourceTree = "<group>"; };
+ BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameMIMETypePNG.cpp; sourceTree = "<group>"; };
+ BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FailedLoad.cpp; sourceTree = "<group>"; };
+ C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpacebarScrolling.cpp; sourceTree = "<group>"; };
+ C02B7853126613AE0026BF0F /* Carbon.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Carbon.framework; sourceTree = SDKROOT; };
+ C02B7882126615410026BF0F /* spacebar-scrolling.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "spacebar-scrolling.html"; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8DD76F9B0486AA7600D96B5E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BCB9E9F111235BDE00A137E0 /* Cocoa.framework in Frameworks */,
+ BCA61DB511700EFD00460D1E /* WebKit2.framework in Frameworks */,
+ BC90964E1255620C00083756 /* JavaScriptCore.framework in Frameworks */,
+ C02B7854126613AE0026BF0F /* Carbon.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BC57597E126E74AF006F0F12 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC575A90126E74D3006F0F12 /* Cocoa.framework in Frameworks */,
+ BC575A91126E74D3006F0F12 /* WebKit2.framework in Frameworks */,
+ BC575A92126E74D3006F0F12 /* JavaScriptCore.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 08FB7794FE84155DC02AAC07 /* TestWebKitAPI */ = {
+ isa = PBXGroup;
+ children = (
+ 08FB7795FE84155DC02AAC07 /* Source */,
+ BCB9EB66112366D800A137E0 /* Tests */,
+ BC90957D12554CEA00083756 /* Configurations */,
+ 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
+ BC575981126E74AF006F0F12 /* InjectedBundle-Info.plist */,
+ );
+ name = TestWebKitAPI;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 /* Source */ = {
+ isa = PBXGroup;
+ children = (
+ BCA61C3A11700B9400460D1E /* mac */,
+ BC575944126E733C006F0F12 /* InjectedBundle */,
+ BC131A9E1171317C00B69727 /* TestWebKitAPIPrefix.h */,
+ BC575BBF126F5752006F0F12 /* PlatformUtilities.cpp */,
+ BC131883117114A800B69727 /* PlatformUtilities.h */,
+ BC90951B125533D700083756 /* PlatformWebView.h */,
+ BCB9E7FA112359A300A137E0 /* Test.h */,
+ BC131AA8117131FC00B69727 /* TestsController.cpp */,
+ BCB9E7C711234E3A00A137E0 /* TestsController.h */,
+ );
+ name = Source;
+ sourceTree = "<group>";
+ };
+ 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
+ isa = PBXGroup;
+ children = (
+ BCB9E9F011235BDE00A137E0 /* Cocoa.framework */,
+ BC90964D1255620C00083756 /* JavaScriptCore.framework */,
+ BCA61DB411700EFD00460D1E /* WebKit2.framework */,
+ C02B7853126613AE0026BF0F /* Carbon.framework */,
+ );
+ name = "External Frameworks and Libraries";
+ sourceTree = "<group>";
+ };
+ 1AB674ADFE9D54B511CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */,
+ BC575980126E74AF006F0F12 /* InjectedBundleTestWebKitAPI.bundle */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ BC575944126E733C006F0F12 /* InjectedBundle */ = {
+ isa = PBXGroup;
+ children = (
+ BC575946126E7351006F0F12 /* InjectedBundleMain.cpp */,
+ BC575A9E126E75FB006F0F12 /* InjectedBundleTest.h */,
+ BC575A9F126E7657006F0F12 /* InjectedBundleController.h */,
+ BC575AA0126E7657006F0F12 /* InjectedBundleController.cpp */,
+ );
+ name = InjectedBundle;
+ sourceTree = "<group>";
+ };
+ BC90957D12554CEA00083756 /* Configurations */ = {
+ isa = PBXGroup;
+ children = (
+ BC90957E12554CF900083756 /* Base.xcconfig */,
+ BC90957F12554CF900083756 /* DebugRelease.xcconfig */,
+ BC575AE2126E88B1006F0F12 /* InjectedBundle.xcconfig */,
+ BC90958012554CF900083756 /* TestWebKitAPI.xcconfig */,
+ );
+ path = Configurations;
+ sourceTree = "<group>";
+ };
+ BC9096411255616000083756 /* WebKit2 */ = {
+ isa = PBXGroup;
+ children = (
+ BC90977B125571AE00083756 /* Resources */,
+ 1A5FEFDC1270E2A3000E2921 /* EvaluateJavaScript.cpp */,
+ 1A02C84E125D4A8400E3F4BD /* Find.cpp */,
+ BCBD370F125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp */,
+ BCBD3760125ABCFE00D2C29F /* FrameMIMETypePNG.cpp */,
+ BC909779125571AB00083756 /* PageLoadBasic.cpp */,
+ 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */,
+ C02B77F1126612140026BF0F /* SpacebarScrolling.cpp */,
+ BC90995D12567BC100083756 /* WKString.cpp */,
+ BC9099931256ACF100083756 /* WKStringJSString.cpp */,
+ BCC8B95A12611F4700DE46A4 /* FailedLoad.cpp */,
+ BC575AAC126E83B9006F0F12 /* InjectedBundleBasic.cpp */,
+ BC575AAF126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp */,
+ BCB6803F126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp */,
+ BCB68041126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp */,
+ );
+ path = WebKit2;
+ sourceTree = "<group>";
+ };
+ BC9096461255618900083756 /* WTF */ = {
+ isa = PBXGroup;
+ children = (
+ BC90964B125561BF00083756 /* VectorBasic.cpp */,
+ );
+ name = WTF;
+ sourceTree = "<group>";
+ };
+ BC90977B125571AE00083756 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 1A02C84B125D4A5E00E3F4BD /* find.html */,
+ BCBD372E125ABBE600D2C29F /* icon.png */,
+ BC909778125571AB00083756 /* simple.html */,
+ C02B7882126615410026BF0F /* spacebar-scrolling.html */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ BCA61C3A11700B9400460D1E /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ BC131A9A1171316900B69727 /* main.mm */,
+ BC131884117114B600B69727 /* PlatformUtilitiesMac.mm */,
+ BC90955C125548AA00083756 /* PlatformWebViewMac.mm */,
+ );
+ path = mac;
+ sourceTree = "<group>";
+ };
+ BCB9EB66112366D800A137E0 /* Tests */ = {
+ isa = PBXGroup;
+ children = (
+ BC9096411255616000083756 /* WebKit2 */,
+ BC9096461255618900083756 /* WTF */,
+ );
+ path = Tests;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8DD76F960486AA7600D96B5E /* TestWebKitAPI */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "TestWebKitAPI" */;
+ buildPhases = (
+ 8DD76F990486AA7600D96B5E /* Sources */,
+ 8DD76F9B0486AA7600D96B5E /* Frameworks */,
+ 8DD76F9E0486AA7600D96B5E /* CopyFiles */,
+ BCB9F4FB112384C000A137E0 /* Copy Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BC575A96126E74E7006F0F12 /* PBXTargetDependency */,
+ );
+ name = TestWebKitAPI;
+ productInstallPath = "$(HOME)/bin";
+ productName = TestWebKitAPI;
+ productReference = 8DD76FA10486AA7600D96B5E /* TestWebKitAPI */;
+ productType = "com.apple.product-type.tool";
+ };
+ BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget "InjectedBundleTestWebKitAPI" */;
+ buildPhases = (
+ BC57597C126E74AF006F0F12 /* Resources */,
+ BC57597D126E74AF006F0F12 /* Sources */,
+ BC57597E126E74AF006F0F12 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = InjectedBundleTestWebKitAPI;
+ productName = InjectedBundle;
+ productReference = BC575980126E74AF006F0F12 /* InjectedBundleTestWebKitAPI.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 "TestWebKitAPI" */;
+ compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 08FB7794FE84155DC02AAC07 /* TestWebKitAPI */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8DD76F960486AA7600D96B5E /* TestWebKitAPI */,
+ BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ BC57597C126E74AF006F0F12 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8DD76F990486AA7600D96B5E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC131885117114B600B69727 /* PlatformUtilitiesMac.mm in Sources */,
+ BC131A9B1171316900B69727 /* main.mm in Sources */,
+ BC131AA9117131FC00B69727 /* TestsController.cpp in Sources */,
+ BC90955D125548AA00083756 /* PlatformWebViewMac.mm in Sources */,
+ BC90964C125561BF00083756 /* VectorBasic.cpp in Sources */,
+ BC90977A125571AB00083756 /* PageLoadBasic.cpp in Sources */,
+ BC90995E12567BC100083756 /* WKString.cpp in Sources */,
+ BC9099941256ACF100083756 /* WKStringJSString.cpp in Sources */,
+ BCBD3710125AA2EB00D2C29F /* FrameMIMETypeHTML.cpp in Sources */,
+ BCBD3761125ABCFE00D2C29F /* FrameMIMETypePNG.cpp in Sources */,
+ 1A02C84F125D4A8400E3F4BD /* Find.cpp in Sources */,
+ BCC8B95B12611F4700DE46A4 /* FailedLoad.cpp in Sources */,
+ C02B77F2126612140026BF0F /* SpacebarScrolling.cpp in Sources */,
+ BC575AAD126E83B9006F0F12 /* InjectedBundleBasic.cpp in Sources */,
+ BC575BC0126F5752006F0F12 /* PlatformUtilities.cpp in Sources */,
+ BCB68040126FBFE100642A61 /* DocumentStartUserScriptAlertCrash.cpp in Sources */,
+ 1A5FEFDD1270E2A3000E2921 /* EvaluateJavaScript.cpp in Sources */,
+ 333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BC57597D126E74AF006F0F12 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC575A97126E74F1006F0F12 /* InjectedBundleMain.cpp in Sources */,
+ BC575AA2126E7660006F0F12 /* InjectedBundleController.cpp in Sources */,
+ BC575AB0126E83C8006F0F12 /* InjectedBundleBasic_Bundle.cpp in Sources */,
+ BC575BD9126F58E2006F0F12 /* PlatformUtilities.cpp in Sources */,
+ BC575BE0126F590D006F0F12 /* PlatformUtilitiesMac.mm in Sources */,
+ BCB68042126FBFF100642A61 /* DocumentStartUserScriptAlertCrash_Bundle.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ BC575A96126E74E7006F0F12 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BC57597F126E74AF006F0F12 /* InjectedBundleTestWebKitAPI */;
+ targetProxy = BC575A95126E74E7006F0F12 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 1DEB927508733DD40010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC90958012554CF900083756 /* TestWebKitAPI.xcconfig */;
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+ };
+ name = Debug;
+ };
+ 1DEB927608733DD40010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC90958012554CF900083756 /* TestWebKitAPI.xcconfig */;
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+ };
+ name = Release;
+ };
+ 1DEB927908733DD40010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC90957F12554CF900083756 /* DebugRelease.xcconfig */;
+ buildSettings = {
+ GCC_OPTIMIZATION_LEVEL = 0;
+ };
+ name = Debug;
+ };
+ 1DEB927A08733DD40010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC90957F12554CF900083756 /* DebugRelease.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+ BC575984126E74AF006F0F12 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC575AE2126E88B1006F0F12 /* InjectedBundle.xcconfig */;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ BC575985126E74AF006F0F12 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC575AE2126E88B1006F0F12 /* InjectedBundle.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "TestWebKitAPI" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB927508733DD40010E9CD /* Debug */,
+ 1DEB927608733DD40010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "TestWebKitAPI" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB927908733DD40010E9CD /* Debug */,
+ 1DEB927A08733DD40010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ BC575986126E74AF006F0F12 /* Build configuration list for PBXNativeTarget "InjectedBundleTestWebKitAPI" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ BC575984126E74AF006F0F12 /* Debug */,
+ BC575985126E74AF006F0F12 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
diff --git a/WebKitTools/TestWebKitAPI/TestWebKitAPIPrefix.h b/WebKitTools/TestWebKitAPI/TestWebKitAPIPrefix.h
new file mode 100644
index 0000000..00e14ad
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/TestWebKitAPIPrefix.h
@@ -0,0 +1,41 @@
+/*
+ * 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.
+ */
+
+
+#if __APPLE__
+
+#ifdef __OBJC__
+#import <Cocoa/Cocoa.h>
+#endif
+
+#elif defined(WIN32) || defined(_WIN32)
+
+#define NOMINMAX
+
+#endif
+
+#include <stdint.h>
+
+#include <WebKit2/WebKit2.h>
diff --git a/WebKitTools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp b/WebKitTools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp
new file mode 100644
index 0000000..012fa27
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WTF/VectorBasic.cpp
@@ -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.
+ */
+
+#include "Test.h"
+
+#include <JavaScriptCore/Vector.h>
+
+namespace TestWebKitAPI {
+
+TEST(WTF, VectorBasic)
+{
+ Vector<int> intVector;
+ TEST_ASSERT(intVector.isEmpty());
+ TEST_ASSERT(intVector.size() == 0);
+ TEST_ASSERT(intVector.capacity() == 0);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp
new file mode 100644
index 0000000..5e0655e
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp
@@ -0,0 +1,65 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool done;
+
+static void runJavaScriptAlert(WKPageRef page, WKStringRef alertText, WKFrameRef frame, const void* clientInfo)
+{
+ TEST_ASSERT(frame);
+ TEST_ASSERT(WKFrameGetPage(frame) == page);
+ TEST_ASSERT(WKStringIsEqualToUTF8CString(alertText, "an alert"));
+
+ done = true;
+}
+
+TEST(WebKit2, DocumentStartUserScriptAlertCrashTest)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("DocumentStartUserScriptAlertCrashTest"));
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageUIClient uiClient;
+ memset(&uiClient, 0, sizeof(uiClient));
+ uiClient.version = 0;
+ uiClient.clientInfo = 0;
+ uiClient.runJavaScriptAlert = runJavaScriptAlert;
+ WKPageSetPageUIClient(webView.page(), &uiClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&done);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
new file mode 100644
index 0000000..a96bef2
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
@@ -0,0 +1,50 @@
+/*
+ * 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 "InjectedBundleTest.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKBundlePrivate.h>
+#include <WebKit2/WKBundleScriptWorld.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+class DocumentStartUserScriptAlertCrashTest : public InjectedBundleTest {
+public:
+ DocumentStartUserScriptAlertCrashTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+ {
+ }
+
+ virtual void initialize(WKBundleRef bundle)
+ {
+ WKRetainPtr<WKStringRef> source(AdoptWK, WKStringCreateWithUTF8CString("alert('an alert');"));
+ WKBundleAddUserScript(bundle, WKBundleScriptWorldNormalWorld(), source.get(), 0, 0, 0, kWKInjectAtDocumentStart, kWKInjectInAllFrames);
+ }
+};
+
+static InjectedBundleTest::Register<DocumentStartUserScriptAlertCrashTest> registrar("DocumentStartUserScriptAlertCrashTest");
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp
new file mode 100644
index 0000000..bbdece3
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp
@@ -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.
+ */
+
+#include "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WebKit2.h>
+
+namespace TestWebKitAPI {
+
+static bool testDone;
+
+static void didRunJavaScript(WKStringRef resultString, WKErrorRef error, void* context)
+{
+ TEST_ASSERT(context == reinterpret_cast<void*>(0x1234578));
+ TEST_ASSERT(WKStringIsEmpty(resultString));
+
+ // FIXME: We should also check the error, but right now it's always null.
+ // Assert that it's null so we can revisit when this changes.
+ TEST_ASSERT(!error);
+
+ testDone = true;
+}
+
+TEST(WebKit2, EvaluateJavaScriptThatThrowsAnException)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ PlatformWebView webView(pageNamespace.get());
+
+ WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("throw 'Hello'"));
+ WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), reinterpret_cast<void*>(0x1234578), didRunJavaScript);
+
+ Util::run(&testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp
new file mode 100644
index 0000000..0ccee5a
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp
@@ -0,0 +1,69 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+// FIXME: This should also test the that the load state after didFailLoadWithErrorForFrame is kWKFrameLoadStateFinished
+
+static bool testDone;
+
+static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
+{
+ TEST_ASSERT(WKFrameGetFrameLoadState(frame) == kWKFrameLoadStateFinished);
+
+ WKURLRef url = WKFrameCopyProvisionalURL(frame);
+ TEST_ASSERT(!url);
+
+ testDone = true;
+}
+
+TEST(WebKit2, FailedLoad)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.version = 0;
+ loaderClient.clientInfo = 0;
+ loaderClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::URLForNonExistentResource());
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/Find.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/Find.cpp
new file mode 100644
index 0000000..63bcea8
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/Find.cpp
@@ -0,0 +1,83 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WebKit2.h>
+
+namespace TestWebKitAPI {
+
+static bool didFinishLoad = false;
+static bool didCallCountStringMatches = false;
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ didFinishLoad = true;
+}
+
+static void didCountStringMatches(WKPageRef page, WKStringRef string, unsigned numMatches, const void* clientInfo)
+{
+ TEST_ASSERT(WKStringIsEqualToUTF8CString(string, "Hello"));
+ TEST_ASSERT(numMatches == 3);
+
+ didCallCountStringMatches = true;
+}
+
+TEST(WebKit2, Find)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.version = 0;
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKPageFindClient findClient;
+ memset(&findClient, 0, sizeof(findClient));
+
+ findClient.version = 0;
+ findClient.didCountStringMatches = didCountStringMatches;
+ WKPageSetPageFindClient(webView.page(), &findClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("find", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&didFinishLoad);
+
+ WKRetainPtr<WKStringRef> findString(AdoptWK, WKStringCreateWithUTF8CString("Hello"));
+ WKPageCountStringMatches(webView.page(), findString.get(), true, 100);
+
+ Util::run(&didCallCountStringMatches);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp
new file mode 100644
index 0000000..a270357
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp
@@ -0,0 +1,79 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool testDone;
+
+static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ WKRetainPtr<WKStringRef> wkMIME(AdoptWK, WKFrameCopyMIMEType(frame));
+ TEST_ASSERT(WKStringIsEmpty(wkMIME.get()));
+}
+
+static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ WKRetainPtr<WKStringRef> wkMIME(AdoptWK, WKFrameCopyMIMEType(frame));
+ TEST_ASSERT(WKStringIsEqualToUTF8CString(wkMIME.get(), "text/html"));
+}
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ WKRetainPtr<WKStringRef> wkMIME(AdoptWK, WKFrameCopyMIMEType(frame));
+ TEST_ASSERT(WKStringIsEqualToUTF8CString(wkMIME.get(), "text/html"));
+
+ testDone = true;
+}
+
+TEST(WebKit2, FrameMIMETypeHTML)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.version = 0;
+ loaderClient.clientInfo = 0;
+ loaderClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
+ loaderClient.didCommitLoadForFrame = didCommitLoadForFrame;
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp
new file mode 100644
index 0000000..3588940
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp
@@ -0,0 +1,79 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool testDone;
+
+static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ WKRetainPtr<WKStringRef> wkMIME(AdoptWK, WKFrameCopyMIMEType(frame));
+ TEST_ASSERT(WKStringIsEmpty(wkMIME.get()));
+}
+
+static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ WKRetainPtr<WKStringRef> wkMIME(AdoptWK, WKFrameCopyMIMEType(frame));
+ TEST_ASSERT(WKStringIsEqualToUTF8CString(wkMIME.get(), "image/png"));
+}
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ WKRetainPtr<WKStringRef> wkMIME(AdoptWK, WKFrameCopyMIMEType(frame));
+ TEST_ASSERT(WKStringIsEqualToUTF8CString(wkMIME.get(), "image/png"));
+
+ testDone = true;
+}
+
+TEST(WebKit2, FrameMIMETypePNG)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.version = 0;
+ loaderClient.clientInfo = 0;
+ loaderClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
+ loaderClient.didCommitLoadForFrame = didCommitLoadForFrame;
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("icon", "png"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp
new file mode 100644
index 0000000..1f4cce6
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp
@@ -0,0 +1,80 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool done;
+static bool loadDone;
+static bool messageReceived;
+
+void didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
+{
+ messageReceived = true;
+ if (loadDone)
+ done = true;
+}
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ loadDone = true;
+ if (messageReceived)
+ done = true;
+}
+
+TEST(WebKit2, InjectedBundleBasic)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, Util::createContextForInjectedBundleTest("InjectedBundleBasicTest"));
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+
+ WKContextInjectedBundleClient injectedBundleClient;
+ memset(&injectedBundleClient, 0, sizeof(injectedBundleClient));
+ injectedBundleClient.version = 0;
+ injectedBundleClient.clientInfo = 0;
+ injectedBundleClient.didReceiveMessageFromInjectedBundle = didReceiveMessageFromInjectedBundle;
+ WKContextSetInjectedBundleClient(context.get(), &injectedBundleClient);
+
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+ loaderClient.version = 0;
+ loaderClient.clientInfo = 0;
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&done);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
new file mode 100644
index 0000000..67c062b
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
@@ -0,0 +1,49 @@
+/*
+ * 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 "InjectedBundleTest.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+class InjectedBundleBasicTest : public InjectedBundleTest {
+public:
+ InjectedBundleBasicTest(const std::string& identifier)
+ : InjectedBundleTest(identifier)
+ {
+ }
+
+ virtual void didCreatePage(WKBundleRef bundle, WKBundlePageRef page)
+ {
+ WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithUTF8CString("DoneMessageName"));
+ WKRetainPtr<WKStringRef> doneMessageBody(AdoptWK, WKStringCreateWithUTF8CString("DoneMessageBody"));
+ WKBundlePostMessage(bundle, doneMessageName.get(), doneMessageBody.get());
+ }
+};
+
+static InjectedBundleTest::Register<InjectedBundleBasicTest> registrar("InjectedBundleBasicTest");
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
new file mode 100644
index 0000000..c3af543
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp
@@ -0,0 +1,146 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool test1Done;
+
+struct State {
+ State()
+ : didDecidePolicyForNavigationAction(false)
+ , didStartProvisionalLoadForFrame(false)
+ , didCommitLoadForFrame(false)
+ {
+ }
+
+ bool didDecidePolicyForNavigationAction;
+ bool didStartProvisionalLoadForFrame;
+ bool didCommitLoadForFrame;
+};
+
+static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo));
+ TEST_ASSERT(state->didDecidePolicyForNavigationAction);
+ TEST_ASSERT(!state->didCommitLoadForFrame);
+
+ // The commited URL should be null.
+ TEST_ASSERT(!WKFrameCopyURL(frame));
+
+ TEST_ASSERT(!state->didStartProvisionalLoadForFrame);
+
+
+ state->didStartProvisionalLoadForFrame = true;
+}
+
+static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo));
+ TEST_ASSERT(state->didDecidePolicyForNavigationAction);
+ TEST_ASSERT(state->didStartProvisionalLoadForFrame);
+
+ // The provisional URL should be null.
+ TEST_ASSERT(!WKFrameCopyProvisionalURL(frame));
+
+ state->didCommitLoadForFrame = true;
+}
+
+static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+{
+ State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo));
+ TEST_ASSERT(state->didDecidePolicyForNavigationAction);
+ TEST_ASSERT(state->didStartProvisionalLoadForFrame);
+ TEST_ASSERT(state->didCommitLoadForFrame);
+
+ // The provisional URL should be null.
+ TEST_ASSERT(!WKFrameCopyProvisionalURL(frame));
+
+ test1Done = true;
+}
+
+static void decidePolicyForNavigationAction(WKPageRef page, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void* clientInfo)
+{
+ State* state = reinterpret_cast<State*>(const_cast<void*>(clientInfo));
+ TEST_ASSERT(!state->didStartProvisionalLoadForFrame);
+ TEST_ASSERT(!state->didCommitLoadForFrame);
+
+ state->didDecidePolicyForNavigationAction = true;
+
+ WKFramePolicyListenerUse(listener);
+}
+
+static void decidePolicyForNewWindowAction(WKPageRef page, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void* clientInfo)
+{
+ WKFramePolicyListenerUse(listener);
+}
+
+static void decidePolicyForMIMEType(WKPageRef page, WKStringRef MIMEType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void* clientInfo)
+{
+ WKFramePolicyListenerUse(listener);
+}
+
+TEST(WebKit2, PageLoadBasic)
+{
+ State state;
+
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.version = 0;
+ loaderClient.clientInfo = &state;
+ loaderClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
+ loaderClient.didCommitLoadForFrame = didCommitLoadForFrame;
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKPagePolicyClient policyClient;
+ memset(&policyClient, 0, sizeof(policyClient));
+
+ policyClient.version = 0;
+ policyClient.clientInfo = &state;
+ policyClient.decidePolicyForNavigationAction = decidePolicyForNavigationAction;
+ policyClient.decidePolicyForNewWindowAction = decidePolicyForNewWindowAction;
+ policyClient.decidePolicyForMIMEType = decidePolicyForMIMEType;
+ WKPageSetPagePolicyClient(webView.page(), &policyClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("simple", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+
+ Util::run(&test1Done);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp
new file mode 100644
index 0000000..af3ed12
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp
@@ -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.
+ */
+
+#include "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WebKit2.h>
+
+namespace TestWebKitAPI {
+
+static bool testDone;
+
+static void didRunJavaScript(WKStringRef resultString, WKErrorRef error, void* context)
+{
+ TEST_ASSERT(context == reinterpret_cast<void*>(0x1234578));
+
+ // Make sure that the result of navigator.userAgent isn't empty, even if we set the custom
+ // user agent to the empty string.
+ TEST_ASSERT(!WKStringIsEmpty(resultString));
+
+ testDone = true;
+}
+
+TEST(WebKit2, PreventEmptyUserAgent)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageSetCustomUserAgent(webView.page(), WKStringCreateWithUTF8CString(""));
+ WKRetainPtr<WKStringRef> javaScriptString(AdoptWK, WKStringCreateWithUTF8CString("navigator.userAgent"));
+ WKPageRunJavaScriptInMainFrame(webView.page(), javaScriptString.get(), reinterpret_cast<void*>(0x1234578), didRunJavaScript);
+
+ Util::run(&testDone);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp
new file mode 100644
index 0000000..a88db9f
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp
@@ -0,0 +1,134 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+struct JavaScriptCallbackContext {
+ JavaScriptCallbackContext(const char* expectedString) : didFinish(false), expectedString(expectedString), didMatchExpectedString(false) { }
+
+ bool didFinish;
+ const char* expectedString;
+ bool didMatchExpectedString;
+};
+
+static bool didFinishLoad;
+static bool didNotHandleKeyDownEvent;
+
+static void didFinishLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void*)
+{
+ didFinishLoad = true;
+}
+
+static void didNotHandleKeyEventCallback(WKPageRef, WKNativeEventPtr event, const void*)
+{
+ if (Util::isKeyDown(event))
+ didNotHandleKeyDownEvent = true;
+}
+
+static void javaScriptCallback(WKStringRef string, WKErrorRef error, void* ctx)
+{
+ JavaScriptCallbackContext* context = static_cast<JavaScriptCallbackContext*>(ctx);
+
+ context->didFinish = true;
+ context->didMatchExpectedString = WKStringIsEqualToUTF8CString(string, context->expectedString);
+
+ TEST_ASSERT(!error);
+}
+
+static WKRetainPtr<WKStringRef> wk(const char* utf8String)
+{
+ return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithUTF8CString(utf8String));
+}
+
+static bool runJSTest(WKPageRef page, const char* script, const char* expectedResult)
+{
+ JavaScriptCallbackContext context(expectedResult);
+ WKPageRunJavaScriptInMainFrame(page, wk(script).get(), &context, javaScriptCallback);
+ Util::run(&context.didFinish);
+ return context.didMatchExpectedString;
+}
+
+TEST(WebKit2, SpacebarScrolling)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageLoaderClient loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.version = 0;
+ loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
+ WKPageSetPageLoaderClient(webView.page(), &loaderClient);
+
+ WKPageUIClient uiClient;
+ memset(&uiClient, 0, sizeof(uiClient));
+
+ uiClient.didNotHandleKeyEvent = didNotHandleKeyEventCallback;
+ WKPageSetPageUIClient(webView.page(), &uiClient);
+
+ WKRetainPtr<WKURLRef> url(AdoptWK, Util::createURLForResource("spacebar-scrolling", "html"));
+ WKPageLoadURL(webView.page(), url.get());
+ Util::run(&didFinishLoad);
+
+ TEST_ASSERT(runJSTest(webView.page(), "isDocumentScrolled()", "false"));
+ TEST_ASSERT(runJSTest(webView.page(), "textFieldContainsSpace()", "false"));
+
+ webView.simulateSpacebarKeyPress();
+
+ TEST_ASSERT(runJSTest(webView.page(), "isDocumentScrolled()", "false"));
+ TEST_ASSERT(runJSTest(webView.page(), "textFieldContainsSpace()", "true"));
+
+ // On Mac, a key down event represents both a raw key down and a key press. On Windows, a key
+ // down event only represents a raw key down. We expect the key press to be handled (because it
+ // inserts text into the text field). But the raw key down should not be handled.
+#if PLATFORM(MAC)
+ TEST_ASSERT(!didNotHandleKeyDownEvent);
+#elif PLATFORM(WIN)
+ TEST_ASSERT(didNotHandleKeyDownEvent);
+#endif
+
+ TEST_ASSERT(runJSTest(webView.page(), "blurTextField()", "undefined"));
+
+ didNotHandleKeyDownEvent = false;
+ webView.simulateSpacebarKeyPress();
+
+ TEST_ASSERT(runJSTest(webView.page(), "isDocumentScrolled()", "true"));
+ TEST_ASSERT(runJSTest(webView.page(), "textFieldContainsSpace()", "true"));
+#if PLATFORM(MAC)
+ TEST_ASSERT(!didNotHandleKeyDownEvent);
+#elif PLATFORM(WIN)
+ TEST_ASSERT(didNotHandleKeyDownEvent);
+#endif
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp
new file mode 100644
index 0000000..b0b133d
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKString.cpp
@@ -0,0 +1,52 @@
+/*
+ * 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 "Test.h"
+
+#include <WebKit2/WKString.h>
+
+namespace TestWebKitAPI {
+
+TEST(WebKit2, WKString)
+{
+ WKStringRef string = WKStringCreateWithUTF8CString("hello");
+ TEST_ASSERT(!WKStringIsEmpty(string));
+ TEST_ASSERT(WKStringIsEqual(string, string));
+ TEST_ASSERT(WKStringIsEqualToUTF8CString(string, "hello"));
+ TEST_ASSERT(WKStringGetMaximumUTF8CStringSize(string) == 16);
+
+ size_t maxSize = WKStringGetMaximumUTF8CStringSize(string);
+ char* buffer = new char[maxSize];
+
+ size_t actualSize = WKStringGetUTF8CString(string, buffer, maxSize);
+ TEST_ASSERT(actualSize == 6);
+ TEST_ASSERT(strcmp(buffer, "hello") == 0);
+
+ delete[] buffer;
+
+ WKRelease(string);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp
new file mode 100644
index 0000000..0d6eca3
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp
@@ -0,0 +1,52 @@
+/*
+ * 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 "Test.h"
+
+#include <WebKit2/WKString.h>
+#include <WebKit2/WKStringPrivate.h>
+#include <JavaScriptCore/JSStringRef.h>
+
+namespace TestWebKitAPI {
+
+TEST(WebKit2, WKStringJSString)
+{
+ WKStringRef wkString = WKStringCreateWithUTF8CString("hello");
+ JSStringRef jsString = JSStringCreateWithUTF8CString("hello");
+
+ WKStringRef convertedJSString = WKStringCreateWithJSString(jsString);
+ TEST_ASSERT(WKStringIsEqual(wkString, convertedJSString));
+
+ JSStringRef convertedWKString = WKStringCopyJSString(wkString);
+ TEST_ASSERT(JSStringIsEqual(jsString, convertedWKString));
+
+ WKRelease(wkString);
+ WKRelease(convertedJSString);
+
+ JSStringRelease(jsString);
+ JSStringRelease(convertedWKString);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/find.html b/WebKitTools/TestWebKitAPI/Tests/WebKit2/find.html
new file mode 100644
index 0000000..d965911
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/find.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+ Test search. Hello Hello Hello!
+</body>
+</html>
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/icon.png b/WebKitTools/TestWebKitAPI/Tests/WebKit2/icon.png
new file mode 100644
index 0000000..79e4598
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/icon.png
Binary files differ
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/simple.html b/WebKitTools/TestWebKitAPI/Tests/WebKit2/simple.html
new file mode 100644
index 0000000..12cf873
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/simple.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+ Simple HTML file.
+</body>
+</html>
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/spacebar-scrolling.html b/WebKitTools/TestWebKitAPI/Tests/WebKit2/spacebar-scrolling.html
new file mode 100644
index 0000000..8da08b3
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/spacebar-scrolling.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script>
+ function textFieldContainsSpace()
+ {
+ return document.querySelector("input").value === " ";
+ }
+
+ function blurTextField()
+ {
+ document.querySelector("input").blur();
+ }
+
+ function isDocumentScrolled()
+ {
+ return scrollY !== 0;
+ }
+
+ function loaded()
+ {
+ document.querySelector("input").focus();
+ }
+
+ addEventListener("load", loaded);
+</script>
+<input>
+<div style="height: 3000px;"></div>
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/AltKeyGeneratesWMSysCommand.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/AltKeyGeneratesWMSysCommand.cpp
new file mode 100644
index 0000000..c463cf0
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/AltKeyGeneratesWMSysCommand.cpp
@@ -0,0 +1,88 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include "WindowMessageObserver.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+class WMSysCommandObserver : public WindowMessageObserver {
+public:
+ WMSysCommandObserver() : m_windowDidReceiveWMSysCommand(false) { }
+
+ bool windowDidReceiveWMSysCommand() const { return m_windowDidReceiveWMSysCommand; }
+
+private:
+ virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM)
+ {
+ if (message == WM_SYSCOMMAND)
+ m_windowDidReceiveWMSysCommand = true;
+ }
+
+ bool m_windowDidReceiveWMSysCommand;
+};
+
+static bool didNotHandleWMSysKeyUp;
+
+static void didNotHandleKeyEventCallback(WKPageRef, WKNativeEventPtr event, const void*)
+{
+ if (event->message != WM_SYSKEYUP)
+ return;
+
+ didNotHandleWMSysKeyUp = true;
+}
+
+TEST(WebKit2, AltKeyGeneratesWMSysCommand)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageUIClient uiClient;
+ memset(&uiClient, 0, sizeof(uiClient));
+
+ uiClient.didNotHandleKeyEvent = didNotHandleKeyEventCallback;
+ WKPageSetPageUIClient(webView.page(), &uiClient);
+
+ WMSysCommandObserver observer;
+ webView.setParentWindowMessageObserver(&observer);
+
+ webView.simulateAltKeyPress();
+
+ Util::run(&didNotHandleWMSysKeyUp);
+
+ webView.setParentWindowMessageObserver(0);
+
+ // The WM_SYSKEYUP message should have generated a WM_SYSCOMMAND message that was sent to the
+ // WKView's parent window.
+ TEST_ASSERT(observer.windowDidReceiveWMSysCommand());
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp b/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp
new file mode 100644
index 0000000..a019f08
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp
@@ -0,0 +1,59 @@
+/*
+ * 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 "Test.h"
+
+#include "PlatformUtilities.h"
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+
+namespace TestWebKitAPI {
+
+static bool didReceiveClose;
+
+static void close(WKPageRef, const void*)
+{
+ didReceiveClose = true;
+}
+
+TEST(WebKit2, WMCloseCallsUIClientClose)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+
+ PlatformWebView webView(pageNamespace.get());
+
+ WKPageUIClient uiClient;
+ memset(&uiClient, 0, sizeof(uiClient));
+
+ uiClient.close = close;
+ WKPageSetPageUIClient(webView.page(), &uiClient);
+
+ ::SendMessageW(WKViewGetWindow(webView.platformView()), WM_CLOSE, 0, 0);
+
+ Util::run(&didReceiveClose);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/TestsController.cpp b/WebKitTools/TestWebKitAPI/TestsController.cpp
new file mode 100644
index 0000000..3499f2c
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/TestsController.cpp
@@ -0,0 +1,82 @@
+/*
+ * 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 "TestsController.h"
+
+#include "Test.h"
+#include <algorithm>
+#include <assert.h>
+
+namespace TestWebKitAPI {
+
+TestsController& TestsController::shared()
+{
+ static TestsController& shared = *new TestsController;
+ return shared;
+}
+
+TestsController::TestsController()
+ : m_testFailed(false)
+ , m_currentTest(0)
+{
+}
+
+void TestsController::dumpTestNames()
+{
+ std::map<std::string, CreateTestFunction>::const_iterator it = m_createTestFunctions.begin();
+ std::map<std::string, CreateTestFunction>::const_iterator end = m_createTestFunctions.end();
+ for (; it != end; ++it)
+ printf("%s\n", (*it).first.c_str());
+}
+
+bool TestsController::runTestNamed(const std::string& identifier)
+{
+ CreateTestFunction createTestFunction = m_createTestFunctions[identifier];
+ if (!createTestFunction) {
+ printf("ERROR: Test not found - %s\n", identifier.c_str());
+ return false;
+ }
+
+ m_currentTest = createTestFunction(identifier);
+ m_currentTest->run();
+
+ delete m_currentTest;
+ m_currentTest = 0;
+
+ return !m_testFailed;
+}
+
+void TestsController::testFailed(const char* file, int line, const char* message)
+{
+ m_testFailed = true;
+ printf("FAIL: %s\n\t%s (%s:%d)\n", m_currentTest->name().c_str(), message, file, line);
+}
+
+void TestsController::registerCreateTestFunction(const std::string& identifier, CreateTestFunction createTestFunction)
+{
+ m_createTestFunctions[identifier] = createTestFunction;
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/TestsController.h b/WebKitTools/TestWebKitAPI/TestsController.h
new file mode 100644
index 0000000..0ff1fc7
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/TestsController.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 TestsController_h
+#define TestsController_h
+
+#include <map>
+#include <string>
+
+namespace TestWebKitAPI {
+
+class Test;
+
+class TestsController {
+public:
+ static TestsController& shared();
+
+ void dumpTestNames();
+ bool runTestNamed(const std::string&);
+
+ // Called by the tests themselves.
+ void testFailed(const char* file, int line, const char* message);
+
+ typedef Test* (*CreateTestFunction)(const std::string&);
+ void registerCreateTestFunction(const std::string&, CreateTestFunction);
+
+private:
+ TestsController();
+ ~TestsController();
+
+ bool m_testFailed;
+ Test* m_currentTest;
+
+ std::map<std::string, CreateTestFunction> m_createTestFunctions;
+};
+
+} // namespace TestWebKitAPI
+
+#endif // TestsController_h
diff --git a/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm b/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
new file mode 100644
index 0000000..474278f
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/mac/PlatformUtilitiesMac.mm
@@ -0,0 +1,66 @@
+/*
+ * 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 "PlatformUtilities.h"
+
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WKStringCF.h>
+#include <WebKit2/WKURLCF.h>
+#include <WebKit2/WebKit2.h>
+
+namespace TestWebKitAPI {
+namespace Util {
+
+void run(bool* done)
+{
+ while (!*done)
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
+}
+
+WKStringRef createInjectedBundlePath()
+{
+ NSString *nsString = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"InjectedBundleTestWebKitAPI.bundle"];
+ return WKStringCreateWithCFString((CFStringRef)nsString);
+}
+
+WKURLRef createURLForResource(const char* resource, const char* extension)
+{
+ NSURL *nsURL = [[NSBundle mainBundle] URLForResource:[NSString stringWithUTF8String:resource] withExtension:[NSString stringWithUTF8String:extension]];
+ return WKURLCreateWithCFURL((CFURLRef)nsURL);
+}
+
+WKURLRef URLForNonExistentResource()
+{
+ NSURL *nsURL = [NSURL URLWithString:@"file:///does-not-exist.html"];
+ return WKURLCreateWithCFURL((CFURLRef)nsURL);
+}
+
+bool isKeyDown(WKNativeEventPtr event)
+{
+ return [event type] == NSKeyDown;
+}
+
+} // namespace Util
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/mac/PlatformWebViewMac.mm b/WebKitTools/TestWebKitAPI/mac/PlatformWebViewMac.mm
new file mode 100644
index 0000000..d4c31eb
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/mac/PlatformWebViewMac.mm
@@ -0,0 +1,97 @@
+/*
+ * 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"
+
+#import <Carbon/Carbon.h>
+
+namespace TestWebKitAPI {
+
+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];
+ [m_window setReleasedWhenClosed:NO];
+}
+
+void PlatformWebView::resizeTo(unsigned width, unsigned height)
+{
+ [m_view setFrame:NSMakeRect(0, 0, width, height)];
+}
+
+PlatformWebView::~PlatformWebView()
+{
+ [m_window close];
+ [m_window release];
+ [m_view release];
+}
+
+WKPageRef PlatformWebView::page()
+{
+ return [m_view pageRef];
+}
+
+void PlatformWebView::focus()
+{
+ // Implement.
+}
+
+void PlatformWebView::simulateSpacebarKeyPress()
+{
+ NSEvent *event = [NSEvent keyEventWithType:NSKeyDown
+ location:NSMakePoint(5, 5)
+ modifierFlags:0
+ timestamp:GetCurrentEventTime()
+ windowNumber:[m_window windowNumber]
+ context:[NSGraphicsContext currentContext]
+ characters:@" "
+ charactersIgnoringModifiers:@" "
+ isARepeat:NO
+ keyCode:0x31];
+
+ [m_view keyDown:event];
+
+ event = [NSEvent keyEventWithType:NSKeyUp
+ location:NSMakePoint(5, 5)
+ modifierFlags:0
+ timestamp:GetCurrentEventTime()
+ windowNumber:[m_window windowNumber]
+ context:[NSGraphicsContext currentContext]
+ characters:@" "
+ charactersIgnoringModifiers:@" "
+ isARepeat:NO
+ keyCode:0x31];
+
+ [m_view keyUp:event];
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/mac/main.mm b/WebKitTools/TestWebKitAPI/mac/main.mm
new file mode 100644
index 0000000..e6dd4a6
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/mac/main.mm
@@ -0,0 +1,45 @@
+/*
+ * 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 "TestsController.h"
+
+int main(int argc, const char* argv[])
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ [NSApplication sharedApplication];
+
+ bool passed = true;
+
+ std::string argument(argv[1]);
+ if (argument == "--dump-tests")
+ TestWebKitAPI::TestsController::shared().dumpTestNames();
+ else
+ passed = TestWebKitAPI::TestsController::shared().runTestNamed(argument);
+
+ [pool drain];
+
+ return passed ? EXIT_SUCCESS : EXIT_FAILURE;
+}
diff --git a/WebKitTools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp b/WebKitTools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp
new file mode 100644
index 0000000..17d8dad
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/win/PlatformUtilitiesWin.cpp
@@ -0,0 +1,85 @@
+/*
+ * 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 "PlatformUtilities.h"
+
+#include <WebKit2/WKStringCF.h>
+#include <WebKit2/WKURLCF.h>
+#include <wtf/RetainPtr.h>
+
+namespace TestWebKitAPI {
+namespace Util {
+
+#if !defined(NDEBUG) && (!defined(DEBUG_INTERNAL) || defined(DEBUG_ALL))
+const char* injectedBundleDLL = "\\InjectedBundle_debug.dll";
+#else
+const char* injectedBundleDLL = "\\InjectedBundle.dll";
+#endif
+
+void run(bool* done)
+{
+ while (!*done) {
+ MSG msg;
+ BOOL result = ::GetMessageW(&msg, 0, 0, 0);
+ if (!result || result == -1)
+ break;
+ ::TranslateMessage(&msg);
+ ::DispatchMessage(&msg);
+ }
+}
+
+RetainPtr<CFStringRef> cf(const char* utf8String)
+{
+ return RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithCString(kCFAllocatorDefault, utf8String, kCFStringEncodingUTF8));
+}
+
+WKStringRef createInjectedBundlePath()
+{
+ RetainPtr<CFURLRef> executableURL(AdoptCF, CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
+ RetainPtr<CFURLRef> executableContainerURL(AdoptCF, CFURLCreateCopyDeletingLastPathComponent(0, executableURL.get()));
+ RetainPtr<CFStringRef> dllFilename(AdoptCF, CFStringCreateWithCStringNoCopy(0, injectedBundleDLL, kCFStringEncodingWindowsLatin1, 0));
+ RetainPtr<CFURLRef> bundleURL(AdoptCF, CFURLCreateCopyAppendingPathComponent(0, executableContainerURL.get(), dllFilename.get(), false));
+ RetainPtr<CFStringRef> bundlePath(AdoptCF, CFURLCopyFileSystemPath(bundleURL.get(), kCFURLWindowsPathStyle));
+ return WKStringCreateWithCFString(bundlePath.get());
+}
+
+WKURLRef createURLForResource(const char* resource, const char* extension)
+{
+ RetainPtr<CFURLRef> url(AdoptCF, CFBundleCopyResourceURL(CFBundleGetMainBundle(), cf(resource).get(), cf(extension).get(), 0));
+ return WKURLCreateWithCFURL(url.get());
+}
+
+WKURLRef URLForNonExistentResource()
+{
+ return WKURLCreateWithUTF8CString("file:///does-not-exist.html");
+}
+
+bool isKeyDown(WKNativeEventPtr event)
+{
+ return event->message == WM_KEYDOWN;
+}
+
+} // namespace Util
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/win/PlatformWebViewWin.cpp b/WebKitTools/TestWebKitAPI/win/PlatformWebViewWin.cpp
new file mode 100644
index 0000000..65bdbc6
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/win/PlatformWebViewWin.cpp
@@ -0,0 +1,118 @@
+/*
+ * 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"
+
+#include "WindowMessageObserver.h"
+
+namespace TestWebKitAPI {
+
+static const wchar_t* hostWindowClassName = L"org.WebKit.TestWebKitAPI.PlatformWebViewHostWindow";
+static const wchar_t* webViewPointerProperty = L"org.WebKit.TestWebKitAPI.PlatformWebView.InstancePointer";
+
+// These offsets come from rom <http://msdn.microsoft.com/en-us/library/ms646280(VS.85).aspx>.
+static const size_t repeatCountBitOffset = 0;
+static const size_t scanCodeBitOffset = 16;
+static const size_t contextCodeBitOffset = 29;
+static const size_t previousStateBitOffset = 30;
+static const size_t transitionStateBitOffset = 31;
+
+void PlatformWebView::registerWindowClass()
+{
+ static bool initialized;
+ if (initialized)
+ return;
+ initialized = true;
+
+ WNDCLASSEXW wndClass = {0};
+ wndClass.cbSize = sizeof(wndClass);
+ wndClass.style = CS_HREDRAW | CS_VREDRAW;
+ wndClass.lpfnWndProc = wndProc;
+ wndClass.hCursor = LoadCursor(0, IDC_ARROW);
+ wndClass.lpszClassName = hostWindowClassName;
+
+ ::RegisterClassExW(&wndClass);
+}
+
+PlatformWebView::PlatformWebView(WKPageNamespaceRef namespaceRef)
+ : m_parentWindowMessageObserver(0)
+{
+ registerWindowClass();
+
+ RECT viewRect = {0, 0, 800, 600};
+ m_window = CreateWindowExW(0, hostWindowClassName, L"TestWebKitAPI", WS_OVERLAPPEDWINDOW, viewRect.left, viewRect.top, viewRect.right, viewRect.bottom, 0, 0, 0, this);
+ m_view = WKViewCreate(viewRect, namespaceRef, m_window);
+}
+
+PlatformWebView::~PlatformWebView()
+{
+ ::DestroyWindow(m_window);
+ WKRelease(m_view);
+}
+
+WKPageRef PlatformWebView::page()
+{
+ return WKViewGetPage(m_view);
+}
+
+void PlatformWebView::simulateSpacebarKeyPress()
+{
+ HWND window = WKViewGetWindow(m_view);
+
+ // These values match what happens when you press the spacebar in Notepad, as observed by Spy++.
+ ::SendMessageW(window, WM_KEYDOWN, VK_SPACE, (1 << repeatCountBitOffset) | (39 << scanCodeBitOffset));
+ ::SendMessageW(window, WM_CHAR, ' ', (1 << repeatCountBitOffset) | (39 << scanCodeBitOffset));
+ ::SendMessageW(window, WM_KEYUP, VK_SPACE, (1 << repeatCountBitOffset) | (39 << scanCodeBitOffset) | (1 << previousStateBitOffset) | (1 << transitionStateBitOffset));
+}
+
+void PlatformWebView::simulateAltKeyPress()
+{
+ HWND window = WKViewGetWindow(m_view);
+
+ // These values match what happens when you press the Alt key in Notepad, as observed by Spy++.
+ ::SendMessageW(window, WM_SYSKEYDOWN, VK_MENU, (1 << repeatCountBitOffset) | (38 << scanCodeBitOffset) | (1 << contextCodeBitOffset));
+ ::SendMessageW(window, WM_SYSKEYUP, VK_MENU, (1 << repeatCountBitOffset) | (38 << scanCodeBitOffset) | (1 << previousStateBitOffset) | (1 << transitionStateBitOffset));
+}
+
+LRESULT PlatformWebView::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ PlatformWebView* webView;
+ if (message == WM_CREATE) {
+ CREATESTRUCT* createStruct = reinterpret_cast<CREATESTRUCT*>(lParam);
+ webView = static_cast<PlatformWebView*>(createStruct->lpCreateParams);
+ ::SetPropW(hWnd, webViewPointerProperty, webView);
+ } else
+ webView = reinterpret_cast<PlatformWebView*>(::GetPropW(hWnd, webViewPointerProperty));
+
+ if (webView && webView->m_parentWindowMessageObserver)
+ webView->m_parentWindowMessageObserver->windowReceivedMessage(hWnd, message, wParam, lParam);
+
+ if (message == WM_NCDESTROY)
+ ::RemovePropW(hWnd, webViewPointerProperty);
+
+ return ::DefWindowProcW(hWnd, message, wParam, lParam);
+}
+
+} // namespace TestWebKitAPI
diff --git a/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.sln b/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.sln
new file mode 100644
index 0000000..e323372
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.sln
@@ -0,0 +1,54 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestWebKitAPI", "TestWebKitAPI.vcproj", "{3E48AB23-D249-488F-A1C4-43CDF52FBD28}"
+ ProjectSection(ProjectDependencies) = postProject
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86} = {45C45411-7F0E-404D-919A-4EE9BB60BE86}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestWebKitAPIGenerated", "TestWebKitAPIGenerated.vcproj", "{45C45411-7F0E-404D-919A-4EE9BB60BE86}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ all|Win32 = all|Win32
+ Debug_All|Win32 = Debug_All|Win32
+ Debug_CFLite|Win32 = Debug_CFLite|Win32
+ Debug_Internal|Win32 = Debug_Internal|Win32
+ Debug|Win32 = Debug|Win32
+ Release_CFLite|Win32 = Release_CFLite|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.all|Win32.ActiveCfg = Release_CFLite|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.all|Win32.Build.0 = Release_CFLite|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_All|Win32.Build.0 = Debug_All|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_CFLite|Win32.ActiveCfg = Debug_CFLite|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_CFLite|Win32.Build.0 = Debug_CFLite|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_Internal|Win32.ActiveCfg = Debug_Internal|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug_Internal|Win32.Build.0 = Debug_Internal|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Debug|Win32.Build.0 = Debug|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release_CFLite|Win32.ActiveCfg = Release_CFLite|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release_CFLite|Win32.Build.0 = Release_CFLite|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release|Win32.ActiveCfg = Release|Win32
+ {3E48AB23-D249-488F-A1C4-43CDF52FBD28}.Release|Win32.Build.0 = Release|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.all|Win32.ActiveCfg = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.all|Win32.Build.0 = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_All|Win32.ActiveCfg = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_All|Win32.Build.0 = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_CFLite|Win32.ActiveCfg = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_CFLite|Win32.Build.0 = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_Internal|Win32.ActiveCfg = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug_Internal|Win32.Build.0 = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug|Win32.ActiveCfg = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Debug|Win32.Build.0 = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release_CFLite|Win32.ActiveCfg = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release_CFLite|Win32.Build.0 = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release|Win32.ActiveCfg = all|Win32
+ {45C45411-7F0E-404D-919A-4EE9BB60BE86}.Release|Win32.Build.0 = all|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj b/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj
new file mode 100644
index 0000000..2041155
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/win/TestWebKitAPI.vcproj
@@ -0,0 +1,585 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="TestWebKitAPI"
+ ProjectGUID="{3E48AB23-D249-488F-A1C4-43CDF52FBD28}"
+ RootNamespace="TestWebKitAPI"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_Internal|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_All|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_CFLite|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICFLite.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_CFLite|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICFLite.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;..\Configurations\TestWebKitAPICommon.vsprops;..\Configurations\TestWebKitAPICoreFoundation.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="win"
+ >
+ <File
+ RelativePath=".\main.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\PlatformUtilitiesWin.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\PlatformWebViewWin.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\WindowMessageObserver.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Tests"
+ >
+ <Filter
+ Name="WebKit2"
+ >
+ <File
+ RelativePath="..\Tests\WebKit2\EvaluateJavaScript.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\FailedLoad.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\Find.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\find.html"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\FrameMIMETypeHTML.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\FrameMIMETypePNG.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\icon.png"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\PageLoadBasic.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\PreventEmptyUserAgent.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\simple.html"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\spacebar-scrolling.html"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\SpacebarScrolling.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\WKString.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\WKStringJSString.cpp"
+ >
+ </File>
+ <Filter
+ Name="win"
+ >
+ <File
+ RelativePath="..\Tests\WebKit2\win\AltKeyGeneratesWMSysCommand.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\Tests\WebKit2\win\WMCloseCallsUIClientClose.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <Filter
+ Name="WTF"
+ >
+ <File
+ RelativePath="..\Tests\WTF\VectorBasic.cpp"
+ >
+ </File>
+ </Filter>
+ </Filter>
+ <File
+ RelativePath="..\PlatformUtilities.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\PlatformUtilities.h"
+ >
+ </File>
+ <File
+ RelativePath="..\PlatformWebView.h"
+ >
+ </File>
+ <File
+ RelativePath="..\Test.h"
+ >
+ </File>
+ <File
+ RelativePath="..\TestsController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\TestsController.h"
+ >
+ </File>
+ <File
+ RelativePath="..\TestWebKitAPIPrefix.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/WebKitTools/TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj b/WebKitTools/TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj
new file mode 100644
index 0000000..ce5afeb
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/win/TestWebKitAPIGenerated.vcproj
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="TestWebKitAPIGenerated"
+ ProjectGUID="{45C45411-7F0E-404D-919A-4EE9BB60BE86}"
+ Keyword="MakeFileProj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="all|Win32"
+ ConfigurationType="0"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="copy-resources.cmd"
+ ReBuildCommandLine="copy-resources.cmd rebuild"
+ CleanCommandLine="copy-resources.cmd clean"
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\copy-resources.cmd"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/WebKitTools/TestWebKitAPI/win/WindowMessageObserver.h b/WebKitTools/TestWebKitAPI/win/WindowMessageObserver.h
new file mode 100644
index 0000000..3388816
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/win/WindowMessageObserver.h
@@ -0,0 +1,41 @@
+/*
+ * 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 WindowMessageObserver_h
+#define WindowMessageObserver_h
+
+namespace TestWebKitAPI {
+
+class WindowMessageObserver {
+public:
+ virtual void windowReceivedMessage(HWND, UINT message, WPARAM, LPARAM) = 0;
+
+protected:
+ virtual ~WindowMessageObserver() { }
+};
+
+} // namespace TestWebKitAPI
+
+#endif // WindowMessageObserver_h
diff --git a/WebKitTools/TestWebKitAPI/win/copy-resources.cmd b/WebKitTools/TestWebKitAPI/win/copy-resources.cmd
new file mode 100755
index 0000000..a5b8406
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/win/copy-resources.cmd
@@ -0,0 +1,24 @@
+@echo off
+
+set ResourcesDirectory=%WebKitOutputDir%\bin\TestWebKitAPI.resources
+
+if "%1" EQU "clean" goto :clean
+if "%1" EQU "rebuild" call :clean
+
+echo Copying resources...
+mkdir 2>NUL "%ResourcesDirectory%"
+for %%f in (
+ ..\Tests\WebKit2\find.html
+ ..\Tests\WebKit2\icon.png
+ ..\Tests\WebKit2\simple.html
+ ..\Tests\WebKit2\spacebar-scrolling.html
+) do (
+ xcopy /y /d %%f "%ResourcesDirectory%"
+)
+
+goto :EOF
+
+:clean
+
+echo Deleting resources...
+del /s /q "%ResourcesDirectory%"
diff --git a/WebKitTools/TestWebKitAPI/win/main.cpp b/WebKitTools/TestWebKitAPI/win/main.cpp
new file mode 100644
index 0000000..3091819
--- /dev/null
+++ b/WebKitTools/TestWebKitAPI/win/main.cpp
@@ -0,0 +1,39 @@
+/*
+ * 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 "TestsController.h"
+
+int main(int argc, const char* argv[])
+{
+ bool passed = true;
+
+ std::string argument(argv[1]);
+ if (argument == "--dump-tests")
+ TestWebKitAPI::TestsController::shared().dumpTestNames();
+ else
+ passed = TestWebKitAPI::TestsController::shared().runTestNamed(argument);
+
+ return passed ? EXIT_SUCCESS : EXIT_FAILURE;
+}
diff --git a/WebKitTools/WebKitAPITest/TestsController.cpp b/WebKitTools/WebKitAPITest/TestsController.cpp
index 52ceabf..08b193a 100644
--- a/WebKitTools/WebKitAPITest/TestsController.cpp
+++ b/WebKitTools/WebKitAPITest/TestsController.cpp
@@ -71,7 +71,7 @@ bool TestsController::runAllTests()
void TestsController::addTest(PassOwnPtr<Test> test)
{
- m_tests.append(test.release());
+ m_tests.append(test.leakPtr());
runNextTestSoon();
}
diff --git a/WebKitTools/WebKitAPITest/WebKitAPITest.vcproj b/WebKitTools/WebKitAPITest/WebKitAPITest.vcproj
index 5473f10..12a46be 100644
--- a/WebKitTools/WebKitAPITest/WebKitAPITest.vcproj
+++ b/WebKitTools/WebKitAPITest/WebKitAPITest.vcproj
@@ -49,6 +49,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
/>
<Tool
Name="VCALinkTool"
@@ -110,6 +111,7 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
/>
<Tool
Name="VCALinkTool"
@@ -171,6 +173,71 @@
/>
<Tool
Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_Cairo|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;.\WebKitAPITestCommon.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
/>
<Tool
Name="VCALinkTool"
diff --git a/WebKitTools/WebKitAPITest/WebKitAPITestCommon.vsprops b/WebKitTools/WebKitAPITest/WebKitAPITestCommon.vsprops
index bac1f6a..1a2ae95 100644
--- a/WebKitTools/WebKitAPITest/WebKitAPITestCommon.vsprops
+++ b/WebKitTools/WebKitAPITest/WebKitAPITestCommon.vsprops
@@ -11,7 +11,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
+ AdditionalDependencies="user32.lib ole32.lib JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
SubSystem="1"
/>
<Tool
diff --git a/WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj b/WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj
index 36eacc5..c130f45 100644
--- a/WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj
+++ b/WebKitTools/WebKitLauncher/WebKitLauncher.xcodeproj/project.pbxproj
@@ -239,7 +239,14 @@
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "WebKitLauncher" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 29B97314FDCFA39411CA2CEA /* WebKit */;
projectDirPath = "";
projectRoot = "";
diff --git a/WebKitTools/WebKitLauncherWin/WebKitLauncherWin.vcproj b/WebKitTools/WebKitLauncherWin/WebKitLauncherWin.vcproj
index bf99228..792bfb3 100644
--- a/WebKitTools/WebKitLauncherWin/WebKitLauncherWin.vcproj
+++ b/WebKitTools/WebKitLauncherWin/WebKitLauncherWin.vcproj
@@ -18,7 +18,68 @@
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\WebKitLauncherWinCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\WebKitLauncherWinCommon.vsprops"
CharacterSet="1"
WholeProgramOptimization="1"
>
@@ -51,8 +112,6 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="shlwapi.lib"
- OutputFile="$(OutDir)\WebKit$(WebKitConfigSuffix).exe"
/>
<Tool
Name="VCALinkTool"
diff --git a/WebKitTools/WebKitLauncherWin/WebKitLauncherWinCommon.vsprops b/WebKitTools/WebKitLauncherWin/WebKitLauncherWinCommon.vsprops
new file mode 100644
index 0000000..b597d20
--- /dev/null
+++ b/WebKitTools/WebKitLauncherWin/WebKitLauncherWinCommon.vsprops
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="WebKitLauncherWinCommon"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="shlwapi.lib"
+ OutputFile="$(OutDir)\WebKit$(WebKitConfigSuffix).exe"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig
new file mode 100644
index 0000000..feabe9a
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig
@@ -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. ``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 = $(WEBCORE_PRIVATE_HEADERS_DIR)/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;
+
+WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(NEXT_ROOT)$(SYSTEM_LIBRARY_DIR)/Frameworks/WebKit.framework/Versions/A/Frameworks;
+WEBCORE_PRIVATE_HEADERS_DIR = $(WEBKIT_UMBRELLA_FRAMEWORKS_DIR)/WebCore.framework/PrivateHeaders;
diff --git a/WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
new file mode 100644
index 0000000..41600b1
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
@@ -0,0 +1,42 @@
+// 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;
+
+WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(BUILT_PRODUCTS_DIR);
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig
new file mode 100644
index 0000000..dcf4be0
--- /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 = WebKitTestRunnerInjectedBundle
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops
new file mode 100644
index 0000000..03c7501
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCFLite.vsprops
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="InjectedBundleCFLite"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CFLite$(LibraryConfigSuffix).lib"
+ OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).dll"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops
new file mode 100644
index 0000000..4e7b84e
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="InjectedBundleCommon"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\InjectedBundle\&quot;;&quot;$(ProjectDir)\..\InjectedBundle\Bindings&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\InjectedBundle\DerivedSources\&quot;"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
+ />
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCoreFoundation.vsprops b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCoreFoundation.vsprops
new file mode 100644
index 0000000..d58b221
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundleCoreFoundation.vsprops
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="InjectedBundleCoreFoundation"
+ >
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ OutputFile="$(OutDir)\$(ProjectName)$(WebKitConfigSuffix).dll"
+ />
+</VisualStudioPropertySheet>
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/DerivedSources.make b/WebKitTools/WebKitTestRunner/DerivedSources.make
new file mode 100644
index 0000000..c308a8a
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/DerivedSources.make
@@ -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.
+
+VPATH = \
+ $(WebKitTestRunner)/InjectedBundle/Bindings \
+#
+
+INTERFACES = \
+ EventSendingController \
+ GCController \
+ LayoutTestController \
+#
+
+SCRIPTS = \
+ $(WebCoreScripts)/CodeGenerator.pm \
+ $(WebKitTestRunner)/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm \
+ $(WebCoreScripts)/IDLParser.pm \
+ $(WebCoreScripts)/IDLStructure.pm \
+ $(WebCoreScripts)/generate-bindings.pl \
+#
+
+.PHONY : all
+
+JS%.h JS%.cpp : %.idl $(SCRIPTS)
+ @echo Generating bindings for $*...
+ @perl -I $(WebCoreScripts) -I $(WebKitTestRunner)/InjectedBundle/Bindings $(WebCoreScripts)/generate-bindings.pl --defines "" --include InjectedBundle/Bindings --outputDir . --generator TestRunner $<
+
+all : \
+ $(INTERFACES:%=JS%.h) \
+ $(INTERFACES:%=JS%.cpp) \
+#
diff --git a/WebKitTools/WebKitTestRunner/DerivedSources.pro b/WebKitTools/WebKitTestRunner/DerivedSources.pro
new file mode 100644
index 0000000..bab70cc
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/DerivedSources.pro
@@ -0,0 +1,57 @@
+# DerivedSources - qmake build info
+
+CONFIG -= debug_and_release
+
+TEMPLATE = lib
+TARGET = dummy
+
+QMAKE_EXTRA_TARGETS += generated_files
+
+GENERATED_SOURCES_DIR = generated
+
+IDL_BINDINGS += \
+ InjectedBundle/Bindings/EventSendingController.idl \
+ InjectedBundle/Bindings/GCController.idl \
+ InjectedBundle/Bindings/LayoutTestController.idl \
+
+defineTest(addExtraCompiler) {
+ eval($${1}.CONFIG = target_predeps no_link)
+ eval($${1}.variable_out =)
+ eval($${1}.dependency_type = TYPE_C)
+
+ wkScript = $$eval($${1}.wkScript)
+ eval($${1}.depends += $$wkScript)
+
+ export($${1}.CONFIG)
+ export($${1}.variable_out)
+ export($${1}.dependency_type)
+ export($${1}.depends)
+
+ QMAKE_EXTRA_COMPILERS += $$1
+ generated_files.depends += compiler_$${1}_make_all
+ export(QMAKE_EXTRA_COMPILERS)
+ export(generated_files.depends)
+ return(true)
+}
+
+SRC_ROOT_DIR = $$replace(PWD, /WebKitTools/WebKitTestRunner, /)
+
+# Make sure forwarded headers needed by this project are present
+fwheader_generator.commands = perl $${SRC_ROOT_DIR}/WebKitTools/Scripts/generate-forwarding-headers.pl $${SRC_ROOT_DIR}/WebKitTools/WebKitTestRunner $${OUTPUT_DIR}/include qt
+fwheader_generator.depends = $${SRC_ROOT_DIR}/WebKitTools/Scripts/generate-forwarding-headers.pl
+generated_files.depends += fwheader_generator
+QMAKE_EXTRA_TARGETS += fwheader_generator
+
+# GENERATOR 1: IDL compiler
+idl.output = $${GENERATED_SOURCES_DIR}/JS${QMAKE_FILE_BASE}.cpp
+idl.input = IDL_BINDINGS
+idl.wkScript = $$PWD/../../WebCore/bindings/scripts/generate-bindings.pl
+idl.commands = perl -I$$PWD/../../WebCore/bindings/scripts -I$$PWD/InjectedBundle/Bindings $$idl.wkScript --defines \"\" --generator TestRunner --include $$PWD/InjectedBundle/Bindings --outputDir $$GENERATED_SOURCES_DIR --preprocessor \"$${QMAKE_MOC} -E\" ${QMAKE_FILE_NAME}
+idl.depends = $$PWD/../../WebCore/bindings/scripts/CodeGenerator.pm \
+ $$PWD/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm \
+ $$PWD/../../WebCore/bindings/scripts/IDLParser.pm \
+ $$PWD/../../WebCore/bindings/scripts/IDLStructure.pm \
+ $$PWD/../../WebCore/bindings/scripts/InFilesParser.pm \
+ $$PWD/../../WebCore/bindings/scripts/generate-bindings.pl
+addExtraCompiler(idl)
+
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/ActivateFonts.h b/WebKitTools/WebKitTestRunner/InjectedBundle/ActivateFonts.h
new file mode 100644
index 0000000..5ee1276
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/ActivateFonts.h
@@ -0,0 +1,35 @@
+/*
+ * 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 ActivateFonts_h
+#define ActivateFonts_h
+
+namespace WTR {
+
+void activateFonts();
+
+} // namespace WTR
+
+#endif // ActivateFonts_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
new file mode 100644
index 0000000..0de2fd0
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/CodeGeneratorTestRunner.pm
@@ -0,0 +1,530 @@
+# 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.
+
+use strict;
+use warnings;
+use File::Spec;
+
+package CodeGeneratorTestRunner;
+
+sub new
+{
+ my ($class, $codeGenerator, $outputDir) = @_;
+
+ my $reference = {
+ codeGenerator => $codeGenerator,
+ outputDir => $outputDir,
+ };
+
+ bless($reference, $class);
+ return $reference;
+}
+
+sub GenerateModule
+{
+}
+
+sub GenerateInterface
+{
+ my ($self, $interface, $defines) = @_;
+
+ foreach my $file ($self->_generateHeaderFile($interface), $self->_generateImplementationFile($interface)) {
+ open(FILE, ">", File::Spec->catfile($$self{outputDir}, $$file{name})) or die "Failed to open $$file{name} for writing: $!";
+ print FILE @{$$file{contents}};
+ close(FILE) or die "Failed to close $$file{name} after writing: $!";
+ }
+}
+
+sub finish
+{
+}
+
+sub _className
+{
+ my ($idlType) = @_;
+
+ return "JS" . _implementationClassName($idlType);
+}
+
+sub _classRefGetter
+{
+ my ($self, $idlType) = @_;
+ return $$self{codeGenerator}->WK_lcfirst(_implementationClassName($idlType)) . "Class";
+}
+
+sub _fileHeaderString
+{
+ my ($filename) = @_;
+
+ # FIXME: We should pull header out of the IDL file to get the copyright
+ # year(s) right.
+ return <<EOF;
+/*
+ * 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.
+ */
+EOF
+}
+
+sub _generateHeaderFile
+{
+ my ($self, $interface) = @_;
+
+ my @contents = ();
+
+ my $idlType = $interface->name;
+ my $className = _className($idlType);
+ my $implementationClassName = _implementationClassName($idlType);
+ my $filename = $className . ".h";
+
+ push(@contents, _fileHeaderString($filename));
+
+ my $parentClassName = _parentClassName($interface);
+
+ push(@contents, <<EOF);
+
+#ifndef ${className}_h
+#define ${className}_h
+
+#include "${parentClassName}.h"
+EOF
+ push(@contents, <<EOF);
+
+namespace WTR {
+
+class ${implementationClassName};
+
+class ${className} : public ${parentClassName} {
+public:
+ static JSClassRef @{[$self->_classRefGetter($idlType)]}();
+
+private:
+ static const JSStaticFunction* staticFunctions();
+ static const JSStaticValue* staticValues();
+EOF
+
+ if (my @functions = @{$interface->functions}) {
+ push(@contents, "\n // Functions\n\n");
+ foreach my $function (@functions) {
+ push(@contents, " static JSValueRef @{[$function->signature->name]}(JSContextRef, JSObjectRef, JSObjectRef, size_t, const JSValueRef[], JSValueRef*);\n");
+ }
+ }
+
+ if (my @attributes = @{$interface->attributes}) {
+ push(@contents, "\n // Attributes\n\n");
+ foreach my $attribute (@attributes) {
+ push(@contents, " static JSValueRef @{[$self->_getterName($attribute)]}(JSContextRef, JSObjectRef, JSStringRef, JSValueRef*);\n");
+ push(@contents, " static bool @{[$self->_setterName($attribute)]}(JSContextRef, JSObjectRef, JSStringRef, JSValueRef, JSValueRef*);\n") unless $attribute->type =~ /^readonly/;
+ }
+ }
+
+ push(@contents, <<EOF);
+};
+
+${implementationClassName}* to${implementationClassName}(JSContextRef, JSValueRef);
+
+} // namespace WTR
+
+#endif // ${className}_h
+EOF
+
+ return { name => $filename, contents => \@contents };
+}
+
+sub _generateImplementationFile
+{
+ my ($self, $interface) = @_;
+
+ my @contentsPrefix = ();
+ my %contentsIncludes = ();
+ my @contents = ();
+
+ my $idlType = $interface->name;
+ my $className = _className($idlType);
+ my $implementationClassName = _implementationClassName($idlType);
+ my $filename = $className . ".cpp";
+
+ push(@contentsPrefix, _fileHeaderString($filename));
+
+ my $classRefGetter = $self->_classRefGetter($idlType);
+ my $parentClassName = _parentClassName($interface);
+
+ $contentsIncludes{"${className}.h"} = 1;
+ $contentsIncludes{"${implementationClassName}.h"} = 1;
+
+ push(@contentsPrefix, <<EOF);
+
+EOF
+
+ push(@contents, <<EOF);
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <wtf/GetPtr.h>
+
+namespace WTR {
+
+${implementationClassName}* to${implementationClassName}(JSContextRef context, JSValueRef value)
+{
+ if (!context || !value || !${className}::${classRefGetter}() || !JSValueIsObjectOfClass(context, value, ${className}::${classRefGetter}()))
+ return 0;
+ return static_cast<${implementationClassName}*>(JSWrapper::unwrap(context, value));
+}
+
+JSClassRef ${className}::${classRefGetter}()
+{
+ static JSClassRef jsClass;
+ if (!jsClass) {
+ JSClassDefinition definition = kJSClassDefinitionEmpty;
+ definition.className = "${idlType}";
+ definition.parentClass = @{[$self->_parentClassRefGetterExpression($interface)]};
+ definition.staticValues = staticValues();
+ definition.staticFunctions = staticFunctions();
+EOF
+
+ push(@contents, " definition.initialize = initialize;\n") unless _parentInterface($interface);
+ push(@contents, " definition.finalize = finalize;\n") unless _parentInterface($interface);
+
+ push(@contents, <<EOF);
+ jsClass = JSClassCreate(&definition);
+ }
+ return jsClass;
+}
+
+EOF
+
+ push(@contents, $self->_staticFunctionsGetterImplementation($interface), "\n");
+ push(@contents, $self->_staticValuesGetterImplementation($interface));
+
+ if (my @functions = @{$interface->functions}) {
+ push(@contents, "\n// Functions\n");
+
+ foreach my $function (@functions) {
+ push(@contents, <<EOF);
+
+JSValueRef ${className}::@{[$function->signature->name]}(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ ${implementationClassName}* impl = to${implementationClassName}(context, thisObject);
+ if (!impl)
+ return JSValueMakeUndefined(context);
+
+EOF
+ my $functionCall;
+ if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
+ $functionCall = "impl->" . $function->signature->name . "(context, argumentCount, arguments, exception)";
+ } else {
+ my @parameters = ();
+ my @specifiedParameters = @{$function->parameters};
+
+ $self->_includeHeaders(\%contentsIncludes, $function->signature->type, $function->signature);
+
+ foreach my $i (0..$#specifiedParameters) {
+ my $parameter = $specifiedParameters[$i];
+
+ $self->_includeHeaders(\%contentsIncludes, $idlType, $parameter);
+
+ push(@contents, " " . $self->_platformTypeVariableDeclaration($parameter, $parameter->name, "arguments[$i]", "argumentCount > $i") . "\n");
+
+ push(@parameters, $self->_parameterExpression($parameter));
+ }
+
+ $functionCall = "impl->" . $function->signature->name . "(" . join(", ", @parameters) . ")";
+ }
+
+ push(@contents, " ${functionCall};\n\n") if $function->signature->type eq "void";
+ push(@contents, " return " . $self->_returnExpression($function->signature, $functionCall) . ";\n}\n");
+ }
+ }
+
+ if (my @attributes = @{$interface->attributes}) {
+ push(@contents, "\n// Attributes\n");
+ foreach my $attribute (@attributes) {
+ $self->_includeHeaders(\%contentsIncludes, $attribute->signature->type, $attribute->signature);
+
+ my $getterName = $self->_getterName($attribute);
+ my $getterExpression = "impl->${getterName}()";
+
+ push(@contents, <<EOF);
+
+JSValueRef ${className}::${getterName}(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef* exception)
+{
+ ${implementationClassName}* impl = to${implementationClassName}(context, object);
+ if (!impl)
+ return JSValueMakeUndefined(context);
+
+ return @{[$self->_returnExpression($attribute->signature, $getterExpression)]};
+}
+EOF
+
+ unless ($attribute->type =~ /^readonly/) {
+ push(@contents, <<EOF);
+
+bool ${className}::@{[$self->_setterName($attribute)]}(JSContextRef context, JSObjectRef object, JSStringRef, JSValueRef value, JSValueRef* exception)
+{
+ ${implementationClassName}* impl = to${implementationClassName}(context, object);
+ if (!impl)
+ return false;
+
+EOF
+
+ my $platformValue = $self->_platformTypeConstructor($attribute->signature, "value");
+
+ push(@contents, <<EOF);
+ impl->@{[$self->_setterName($attribute)]}(${platformValue});
+
+ return true;
+}
+EOF
+ }
+ }
+ }
+
+ push(@contents, <<EOF);
+
+} // namespace WTR
+
+EOF
+
+ unshift(@contents, map { "#include \"$_\"\n" } sort keys(%contentsIncludes));
+ unshift(@contents, @contentsPrefix);
+
+ return { name => $filename, contents => \@contents };
+}
+
+sub _getterName
+{
+ my ($self, $attribute) = @_;
+
+ my $signature = $attribute->signature;
+ my $name = $signature->name;
+
+ return $name;
+}
+
+sub _includeHeaders
+{
+ my ($self, $headers, $idlType, $signature) = @_;
+
+ return unless defined $idlType;
+ return if $idlType eq "boolean";
+ return if $idlType eq "object";
+ return if $$self{codeGenerator}->IsNonPointerType($idlType);
+ return if $$self{codeGenerator}->IsStringType($idlType);
+
+ $$headers{_className($idlType) . ".h"} = 1;
+ $$headers{_implementationClassName($idlType) . ".h"} = 1;
+}
+
+sub _implementationClassName
+{
+ my ($idlType) = @_;
+
+ return $idlType;
+}
+
+sub _parentClassName
+{
+ my ($interface) = @_;
+
+ my $parentInterface = _parentInterface($interface);
+ return $parentInterface ? _className($parentInterface) : "JSWrapper";
+}
+
+sub _parentClassRefGetterExpression
+{
+ my ($self, $interface) = @_;
+
+ my $parentInterface = _parentInterface($interface);
+ return $parentInterface ? $self->_classRefGetter($parentInterface) . "()" : "0";
+}
+
+sub _parentInterface
+{
+ my ($interface) = @_;
+ return $interface->parents->[0];
+}
+
+sub _platformType
+{
+ my ($self, $idlType, $signature) = @_;
+
+ return undef unless defined $idlType;
+
+ return "bool" if $idlType eq "boolean";
+ return "JSValueRef" if $idlType eq "object";
+ return "JSRetainPtr<JSStringRef>" if $$self{codeGenerator}->IsStringType($idlType);
+ return "double" if $$self{codeGenerator}->IsNonPointerType($idlType);
+ return _implementationClassName($idlType);
+}
+
+sub _platformTypeConstructor
+{
+ my ($self, $signature, $argumentName) = @_;
+
+ my $idlType = $signature->type;
+
+ return "JSValueToBoolean(context, $argumentName)" if $idlType eq "boolean";
+ return "$argumentName" if $idlType eq "object";
+ return "JSRetainPtr<JSStringRef>(Adopt, JSValueToStringCopy(context, $argumentName, 0))" if $$self{codeGenerator}->IsStringType($idlType);
+ return "JSValueToNumber(context, $argumentName, 0)" if $$self{codeGenerator}->IsNonPointerType($idlType);
+ return "to" . _implementationClassName($idlType) . "(context, $argumentName)";
+}
+
+sub _platformTypeVariableDeclaration
+{
+ my ($self, $signature, $variableName, $argumentName, $condition) = @_;
+
+ my $platformType = $self->_platformType($signature->type, $signature);
+ my $constructor = $self->_platformTypeConstructor($signature, $argumentName);
+
+ my %nonPointerTypes = (
+ "bool" => 1,
+ "double" => 1,
+ "JSRetainPtr<JSStringRef>" => 1,
+ "JSValueRef" => 1,
+ );
+
+ my $nullValue = "0";
+ $nullValue = "$platformType()" if defined $nonPointerTypes{$platformType} && $platformType ne "double";
+
+ $platformType .= "*" unless defined $nonPointerTypes{$platformType};
+
+ return "$platformType $variableName = $condition && $constructor;" if $condition && $platformType eq "bool";
+ return "$platformType $variableName = $condition ? $constructor : $nullValue;" if $condition;
+ return "$platformType $variableName = $constructor;";
+}
+
+sub _returnExpression
+{
+ my ($self, $signature, $expression) = @_;
+
+ my $returnIDLType = $signature->type;
+
+ return "JSValueMakeUndefined(context)" if $returnIDLType eq "void";
+ return "JSValueMakeBoolean(context, ${expression})" if $returnIDLType eq "boolean";
+ return "${expression}" if $returnIDLType eq "object";
+ return "JSValueMakeNumber(context, ${expression})" if $$self{codeGenerator}->IsNonPointerType($returnIDLType);
+ return "JSValueMakeStringOrNull(context, ${expression}.get())" if $$self{codeGenerator}->IsStringType($returnIDLType);
+ return "toJS(context, WTF::getPtr(${expression}))";
+}
+
+sub _parameterExpression
+{
+ my ($self, $parameter) = @_;
+
+ my $idlType = $parameter->type;
+ my $name = $parameter->name;
+
+ return "${name}.get()" if $$self{codeGenerator}->IsStringType($idlType);
+ return $name;
+}
+
+sub _setterName
+{
+ my ($self, $attribute) = @_;
+
+ my $name = $attribute->signature->name;
+
+ return "set" . $$self{codeGenerator}->WK_ucfirst($name);
+}
+
+sub _staticFunctionsGetterImplementation
+{
+ my ($self, $interface) = @_;
+
+ my $mapFunction = sub {
+ my $name = $_->signature->name;
+ my @attributes = qw(kJSPropertyAttributeDontDelete kJSPropertyAttributeReadOnly);
+ push(@attributes, "kJSPropertyAttributeDontEnum") if $_->signature->extendedAttributes->{"DontEnum"};
+
+ return "{ \"$name\", $name, " . join(" | ", @attributes) . " }";
+ };
+
+ return $self->_staticFunctionsOrValuesGetterImplementation($interface, "function", "{ 0, 0, 0 }", $mapFunction, $interface->functions);
+}
+
+sub _staticFunctionsOrValuesGetterImplementation
+{
+ my ($self, $interface, $functionOrValue, $arrayTerminator, $mapFunction, $functionsOrAttributes) = @_;
+
+ my $className = _className($interface->name);
+ my $uppercaseFunctionOrValue = $$self{codeGenerator}->WK_ucfirst($functionOrValue);
+
+ my $result = <<EOF;
+const JSStatic${uppercaseFunctionOrValue}* ${className}::static${uppercaseFunctionOrValue}s()
+{
+EOF
+
+ my @initializers = map(&$mapFunction, @{$functionsOrAttributes});
+ return $result . " return 0;\n}\n" unless @initializers;
+
+ $result .= <<EOF
+ static const JSStatic${uppercaseFunctionOrValue} ${functionOrValue}s[] = {
+ @{[join(",\n ", @initializers)]},
+ ${arrayTerminator}
+ };
+ return ${functionOrValue}s;
+}
+EOF
+}
+
+sub _staticValuesGetterImplementation
+{
+ my ($self, $interface) = @_;
+
+ my $mapFunction = sub {
+ return if $_->signature->extendedAttributes->{"NoImplementation"};
+
+ my $attributeName = $_->signature->name;
+ my $attributeIsReadonly = $_->type =~ /^readonly/;
+ my $getterName = $self->_getterName($_);
+ my $setterName = $attributeIsReadonly ? "0" : $self->_setterName($_);
+ my @attributes = qw(kJSPropertyAttributeDontDelete);
+ push(@attributes, "kJSPropertyAttributeReadOnly") if $attributeIsReadonly;
+ push(@attributes, "kJSPropertyAttributeDontEnum") if $_->signature->extendedAttributes->{"DontEnum"};
+
+ return "{ \"$attributeName\", $getterName, $setterName, " . join(" | ", @attributes) . " }";
+ };
+
+ return $self->_staticFunctionsOrValuesGetterImplementation($interface, "value", "{ 0, 0, 0, 0 }", $mapFunction, $interface->attributes);
+}
+
+1;
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
new file mode 100644
index 0000000..1e47772
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+module WTR {
+
+ interface EventSendingController {
+ [CustomArgumentHandling] void mouseDown();
+ [CustomArgumentHandling] void mouseUp();
+ [CustomArgumentHandling] void mouseMoveTo();
+ [CustomArgumentHandling] void keyDown();
+ [CustomArgumentHandling] void contextClick(); // CustomArgumentHandling only to throw exception while not implemented.
+ [CustomArgumentHandling] void leapForward(/*in unsigned long delay*/); // CustomArgumentHandling only to throw exception while not implemented.
+
+ // Zoom functions.
+ void textZoomIn();
+ void textZoomOut();
+ void zoomPageIn();
+ void zoomPageOut();
+ };
+
+}
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl
new file mode 100644
index 0000000..eb3ddee
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/GCController.idl
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+module WTR {
+
+ interface GCController {
+ void collect();
+ void collectOnAlternateThread(in boolean waitUntilDone);
+ unsigned long long getJSObjectCount();
+ };
+
+}
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h
new file mode 100644
index 0000000..5ec7197
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h
@@ -0,0 +1,47 @@
+/*
+ * 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 JSWrappable_h
+#define JSWrappable_h
+
+#include <JavaScriptCore/JavaScript.h>
+#include <wtf/RefCounted.h>
+
+namespace WTR {
+
+class JSWrappable : public RefCounted<JSWrappable> {
+public:
+ virtual ~JSWrappable() { }
+ virtual JSClassRef wrapperClass() = 0;
+};
+
+inline JSValueRef JSValueMakeStringOrNull(JSContextRef context, JSStringRef stringOrNull)
+{
+ return stringOrNull ? JSValueMakeString(context, stringOrNull) : JSValueMakeNull(context);
+}
+
+} // namespace WTR
+
+#endif // JSWrappable_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp
new file mode 100644
index 0000000..a62cb2e
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp
@@ -0,0 +1,79 @@
+/*
+ * 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 "JSWrapper.h"
+
+#include <JavaScriptCore/JSContextRefPrivate.h>
+
+namespace WTR {
+
+JSValueRef JSWrapper::wrap(JSContextRef context, JSWrappable* object)
+{
+ ASSERT_ARG(context, context);
+
+ if (!object)
+ return JSValueMakeNull(context);
+
+ JSClassRef objectClass = object->wrapperClass();
+ ASSERT(objectClass);
+ JSObjectRef wrapperObject = JSObjectMake(context, objectClass, object);
+ ASSERT(wrapperObject);
+
+ return wrapperObject;
+}
+
+JSWrappable* JSWrapper::unwrap(JSContextRef context, JSValueRef value)
+{
+ ASSERT_ARG(context, context);
+ ASSERT_ARG(value, value);
+ if (!context || !value)
+ return 0;
+ return static_cast<JSWrappable*>(JSObjectGetPrivate(JSValueToObject(context, value, 0)));
+}
+
+static JSWrappable* unwrapObject(JSObjectRef object)
+{
+ JSWrappable* wrappable = static_cast<JSWrappable*>(JSObjectGetPrivate(object));
+ ASSERT(wrappable);
+ return wrappable;
+}
+
+void JSWrapper::initialize(JSContextRef ctx, JSObjectRef object)
+{
+ JSWrappable* wrappable = unwrapObject(object);
+ if (!wrappable)
+ return;
+ wrappable->ref();
+}
+
+void JSWrapper::finalize(JSObjectRef object)
+{
+ JSWrappable* wrappable = unwrapObject(object);
+ if (!wrappable)
+ return;
+ wrappable->deref();
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h
new file mode 100644
index 0000000..d885801
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.h
@@ -0,0 +1,57 @@
+/*
+ * 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 JSWrapper_h
+#define JSWrapper_h
+
+#include "JSWrappable.h"
+#include <JavaScriptCore/JSRetainPtr.h>
+
+namespace WTR {
+
+// FIXME: If necessary, we can do wrapper caching here.
+class JSWrapper {
+public:
+ static JSValueRef wrap(JSContextRef context, JSWrappable* object);
+ static JSWrappable* unwrap(JSContextRef context, JSValueRef value);
+
+ static void initialize(JSContextRef, JSObjectRef);
+ static void finalize(JSObjectRef);
+};
+
+inline JSValueRef toJS(JSContextRef context, JSWrappable* impl)
+{
+ return JSWrapper::wrap(context, impl);
+}
+
+inline void setProperty(JSContextRef context, JSObjectRef object, const char* propertyName, JSWrappable* value, JSPropertyAttributes attributes, JSValueRef* exception)
+{
+ JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
+ JSObjectSetProperty(context, object, propertyNameString.get(), JSWrapper::wrap(context, value), attributes, exception);
+}
+
+} // namespace WTR
+
+#endif // JSWrapper_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
new file mode 100644
index 0000000..583eb0a
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+
+module WTR {
+
+ interface LayoutTestController {
+ // The basics.
+ void dumpAsText();
+ void dumpChildFramesAsText();
+ void waitUntilDone();
+ void notifyDone();
+
+ // Other dumping.
+ void dumpBackForwardList();
+ void dumpChildFrameScrollPositions();
+ void dumpEditingCallbacks();
+ void dumpSelectionRect();
+ void dumpStatusCallbacks();
+ void dumpTitleChanges();
+
+ // Special options.
+ void keepWebHistory();
+ void setAcceptsEditing(in boolean value);
+ void setCanOpenWindows(in boolean value);
+ void setCloseRemainingWindowsWhenComplete(in boolean value);
+ void setXSSAuditorEnabled(in boolean value);
+
+ // Special DOM functions.
+ void clearBackForwardList();
+ object computedStyleIncludingVisitedInfo(in object element);
+ DOMString counterValueForElementById(in DOMString elementId);
+ void execCommand(in DOMString name, in DOMString argument);
+ boolean isCommandEnabled(in DOMString name);
+ DOMString markerTextForListItem(in object element);
+ unsigned long windowCount();
+
+ // Repaint testing.
+ void testRepaint();
+ void repaintSweepHorizontally();
+ void display();
+
+ // Animation testing.
+ int numberOfActiveAnimations();
+ boolean pauseAnimationAtTimeOnElementWithId(in DOMString animationName, in double time, in DOMString elementId);
+ void suspendAnimations();
+ void resumeAnimations();
+
+ // UserContent testing.
+ void addUserScript(in DOMString source, in boolean runAtStart, in boolean allFrames);
+ void addUserStyleSheet(in DOMString source, in boolean allFrames);
+
+ // Compositing testing.
+ DOMString layerTreeAsText();
+ };
+
+}
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
new file mode 100644
index 0000000..73de45b
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.cpp
@@ -0,0 +1,136 @@
+/*
+ * 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 "EventSendingController.h"
+
+#include "InjectedBundle.h"
+#include "InjectedBundlePage.h"
+#include "JSEventSendingController.h"
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundlePagePrivate.h>
+#include <WebKit2/WKBundlePrivate.h>
+
+namespace WTR {
+
+static const float ZoomMultiplierRatio = 1.2f;
+
+PassRefPtr<EventSendingController> EventSendingController::create()
+{
+ return adoptRef(new EventSendingController);
+}
+
+EventSendingController::EventSendingController()
+{
+}
+
+EventSendingController::~EventSendingController()
+{
+}
+
+JSClassRef EventSendingController::wrapperClass()
+{
+ return JSEventSendingController::eventSendingControllerClass();
+}
+
+static void setExceptionForString(JSContextRef context, JSValueRef* exception, const char* string)
+{
+ JSRetainPtr<JSStringRef> exceptionString(Adopt, JSStringCreateWithUTF8CString(string));
+ *exception = JSValueMakeString(context, exceptionString.get());
+}
+
+void EventSendingController::mouseDown(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ setExceptionForString(context, exception, "EventSender.mouseDown is not yet supported.");
+}
+
+void EventSendingController::mouseUp(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ setExceptionForString(context, exception, "EventSender.mouseUp is not yet supported.");
+}
+
+void EventSendingController::mouseMoveTo(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ setExceptionForString(context, exception, "EventSender.mouseMoveTo is not yet supported.");
+}
+
+void EventSendingController::keyDown(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ setExceptionForString(context, exception, "EventSender.keyDown is not yet supported.");
+}
+
+void EventSendingController::contextClick(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ setExceptionForString(context, exception, "EventSender.contextClick is not yet supported.");
+}
+
+void EventSendingController::leapForward(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ setExceptionForString(context, exception, "EventSender.leapForward is not yet supported.");
+}
+
+void EventSendingController::textZoomIn()
+{
+ // Ensure page zoom is reset.
+ WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), 1);
+
+ double zoomFactor = WKBundlePageGetTextZoomFactor(InjectedBundle::shared().page()->page());
+ WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio);
+}
+
+void EventSendingController::textZoomOut()
+{
+ // Ensure page zoom is reset.
+ WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), 1);
+
+ double zoomFactor = WKBundlePageGetTextZoomFactor(InjectedBundle::shared().page()->page());
+ WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio);
+}
+
+void EventSendingController::zoomPageIn()
+{
+ // Ensure text zoom is reset.
+ WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), 1);
+
+ double zoomFactor = WKBundlePageGetPageZoomFactor(InjectedBundle::shared().page()->page());
+ WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor * ZoomMultiplierRatio);
+}
+
+void EventSendingController::zoomPageOut()
+{
+ // Ensure text zoom is reset.
+ WKBundlePageSetTextZoomFactor(InjectedBundle::shared().page()->page(), 1);
+
+ double zoomFactor = WKBundlePageGetPageZoomFactor(InjectedBundle::shared().page()->page());
+ WKBundlePageSetPageZoomFactor(InjectedBundle::shared().page()->page(), zoomFactor / ZoomMultiplierRatio);
+}
+
+// Object Creation
+
+void EventSendingController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
+{
+ setProperty(context, windowObject, "eventSender", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.h
new file mode 100644
index 0000000..400f60d
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/EventSendingController.h
@@ -0,0 +1,63 @@
+/*
+ * 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 EventSendingController_h
+#define EventSendingController_h
+
+#include "JSWrappable.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WTR {
+
+class EventSendingController : public JSWrappable {
+public:
+ static PassRefPtr<EventSendingController> create();
+ virtual ~EventSendingController();
+
+ void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
+
+ // JSWrappable
+ virtual JSClassRef wrapperClass();
+
+ void mouseDown(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+ void mouseUp(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+ void mouseMoveTo(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+ void keyDown(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+ void contextClick(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+ void leapForward(JSContextRef context, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception);
+
+ // Zoom functions.
+ void textZoomIn();
+ void textZoomOut();
+ void zoomPageIn();
+ void zoomPageOut();
+
+private:
+ EventSendingController();
+};
+
+} // namespace WTR
+
+#endif // EventSendingController_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.cpp
new file mode 100644
index 0000000..0eba2df
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.cpp
@@ -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.
+ */
+
+#include "GCController.h"
+
+#include "InjectedBundle.h"
+#include "JSGCController.h"
+#include <WebKit2/WKBundlePrivate.h>
+
+namespace WTR {
+
+PassRefPtr<GCController> GCController::create()
+{
+ return adoptRef(new GCController);
+}
+
+GCController::GCController()
+{
+}
+
+GCController::~GCController()
+{
+}
+
+JSClassRef GCController::wrapperClass()
+{
+ return JSGCController::gCControllerClass();
+}
+
+void GCController::collect()
+{
+ WKBundleGarbageCollectJavaScriptObjects(InjectedBundle::shared().bundle());
+}
+
+void GCController::collectOnAlternateThread(bool waitUntilDone)
+{
+ WKBundleGarbageCollectJavaScriptObjectsOnAlternateThreadForDebugging(InjectedBundle::shared().bundle(), waitUntilDone);
+}
+
+size_t GCController::getJSObjectCount()
+{
+ return WKBundleGetJavaScriptObjectsCount(InjectedBundle::shared().bundle());
+}
+
+// Object Creation
+
+void GCController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
+{
+ setProperty(context, windowObject, "GCController", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.h
new file mode 100644
index 0000000..760fbb1
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/GCController.h
@@ -0,0 +1,54 @@
+/*
+ * 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 GCController_h
+#define GCController_h
+
+#include "JSWrappable.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WTR {
+
+class GCController : public JSWrappable {
+public:
+ static PassRefPtr<GCController> create();
+ virtual ~GCController();
+
+ void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
+
+ // JSWrappable
+ virtual JSClassRef wrapperClass();
+
+ void collect();
+ void collectOnAlternateThread(bool waitUntilDone);
+ size_t getJSObjectCount();
+
+private:
+ GCController();
+};
+
+} // namespace WTR
+
+#endif // GCController_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
new file mode 100644
index 0000000..6bc1802
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -0,0 +1,177 @@
+/*
+ * 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 "InjectedBundle.h"
+
+#include "ActivateFonts.h"
+#include "InjectedBundlePage.h"
+#include "StringFunctions.h"
+#include <WebKit2/WKBundle.h>
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundlePagePrivate.h>
+#include <WebKit2/WKBundlePrivate.h>
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WebKit2.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace WTR {
+
+InjectedBundle& InjectedBundle::shared()
+{
+ static InjectedBundle& shared = *new InjectedBundle;
+ return shared;
+}
+
+InjectedBundle::InjectedBundle()
+ : m_bundle(0)
+ , m_state(Idle)
+{
+}
+
+void InjectedBundle::didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+ static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didCreatePage(page);
+}
+
+void InjectedBundle::willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+ static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->willDestroyPage(page);
+}
+
+void InjectedBundle::didReceiveMessage(WKBundleRef bundle, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo)
+{
+ static_cast<InjectedBundle*>(const_cast<void*>(clientInfo))->didReceiveMessage(messageName, messageBody);
+}
+
+void InjectedBundle::initialize(WKBundleRef bundle)
+{
+ m_bundle = bundle;
+
+ WKBundleClient client = {
+ 0,
+ this,
+ didCreatePage,
+ willDestroyPage,
+ didReceiveMessage
+ };
+ WKBundleSetClient(m_bundle, &client);
+
+ activateFonts();
+ WKBundleActivateMacFontAscentHack(m_bundle);
+}
+
+void InjectedBundle::didCreatePage(WKBundlePageRef page)
+{
+ m_pages.append(adoptPtr(new InjectedBundlePage(page)));
+}
+
+void InjectedBundle::willDestroyPage(WKBundlePageRef page)
+{
+ size_t size = m_pages.size();
+ for (size_t i = 0; i < size; ++i) {
+ if (m_pages[i]->page() == page) {
+ m_pages.remove(i);
+ break;
+ }
+ }
+}
+
+InjectedBundlePage* InjectedBundle::page() const
+{
+ // It might be better to have the UI process send over a reference to the main
+ // page instead of just assuming it's the first one.
+ return m_pages[0].get();
+}
+
+void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody)
+{
+ if (WKStringIsEqualToUTF8CString(messageName, "BeginTest")) {
+ ASSERT(!messageBody);
+
+ WKRetainPtr<WKStringRef> ackMessageName(AdoptWK, WKStringCreateWithUTF8CString("Ack"));
+ WKRetainPtr<WKStringRef> ackMessageBody(AdoptWK, WKStringCreateWithUTF8CString("BeginTest"));
+ WKBundlePostMessage(m_bundle, ackMessageName.get(), ackMessageBody.get());
+
+ beginTesting();
+ return;
+ }
+
+ WKRetainPtr<WKStringRef> errorMessageName(AdoptWK, WKStringCreateWithUTF8CString("Error"));
+ WKRetainPtr<WKStringRef> errorMessageBody(AdoptWK, WKStringCreateWithUTF8CString("Unknown"));
+ WKBundlePostMessage(m_bundle, errorMessageName.get(), errorMessageBody.get());
+}
+
+void InjectedBundle::beginTesting()
+{
+ m_state = Testing;
+
+ m_outputStream.str("");
+
+ m_layoutTestController = LayoutTestController::create();
+ m_gcController = GCController::create();
+ m_eventSendingController = EventSendingController::create();
+
+ WKBundleSetShouldTrackVisitedLinks(m_bundle, false);
+ WKBundleRemoveAllVisitedLinks(m_bundle);
+
+ WKBundleRemoveAllUserContent(m_bundle);
+
+ page()->reset();
+}
+
+void InjectedBundle::done()
+{
+ m_state = Stopping;
+
+ page()->stopLoading();
+
+ WKRetainPtr<WKStringRef> doneMessageName(AdoptWK, WKStringCreateWithUTF8CString("Done"));
+ WKRetainPtr<WKStringRef> doneMessageBody(AdoptWK, WKStringCreateWithUTF8CString(m_outputStream.str().c_str()));
+
+ WKBundlePostMessage(m_bundle, doneMessageName.get(), doneMessageBody.get());
+
+ m_state = Idle;
+}
+
+void InjectedBundle::closeOtherPages()
+{
+ Vector<WKBundlePageRef> pagesToClose;
+ size_t size = m_pages.size();
+ for (size_t i = 1; i < size; ++i)
+ pagesToClose.append(m_pages[i]->page());
+ size = pagesToClose.size();
+ for (size_t i = 0; i < size; ++i)
+ WKBundlePageClose(pagesToClose[i]);
+}
+
+void InjectedBundle::dumpBackForwardListsForAllPages()
+{
+ size_t size = m_pages.size();
+ for (size_t i = 0; i < size; ++i)
+ m_pages[i]->dumpBackForwardList();
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
new file mode 100644
index 0000000..2c6d14b
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -0,0 +1,100 @@
+/*
+ * 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 InjectedBundle_h
+#define InjectedBundle_h
+
+#include "EventSendingController.h"
+#include "GCController.h"
+#include "LayoutTestController.h"
+#include <WebKit2/WKBase.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+#include <sstream>
+
+namespace WTR {
+
+class InjectedBundlePage;
+
+class InjectedBundle {
+public:
+ static InjectedBundle& shared();
+
+ // Initialize the InjectedBundle.
+ void initialize(WKBundleRef);
+
+ WKBundleRef bundle() const { return m_bundle; }
+
+ LayoutTestController* layoutTestController() { return m_layoutTestController.get(); }
+ GCController* gcController() { return m_gcController.get(); }
+ EventSendingController* eventSendingController() { return m_eventSendingController.get(); }
+
+ InjectedBundlePage* page() const;
+ size_t pageCount() const { return m_pages.size(); }
+ void closeOtherPages();
+
+ void dumpBackForwardListsForAllPages();
+
+ void done();
+ std::ostringstream& os() { return m_outputStream; }
+
+ bool isTestRunning() { return m_state == Testing; }
+
+private:
+ InjectedBundle();
+ ~InjectedBundle();
+
+ static void didCreatePage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
+ static void willDestroyPage(WKBundleRef, WKBundlePageRef, const void* clientInfo);
+ static void didReceiveMessage(WKBundleRef, WKStringRef messageName, WKTypeRef messageBody, const void *clientInfo);
+
+ void didCreatePage(WKBundlePageRef);
+ void willDestroyPage(WKBundlePageRef);
+ void didReceiveMessage(WKStringRef messageName, WKTypeRef messageBody);
+
+ void beginTesting();
+
+ WKBundleRef m_bundle;
+ Vector<OwnPtr<InjectedBundlePage> > m_pages;
+
+ RefPtr<LayoutTestController> m_layoutTestController;
+ RefPtr<GCController> m_gcController;
+ RefPtr<EventSendingController> m_eventSendingController;
+
+ std::ostringstream m_outputStream;
+
+ enum State {
+ Idle,
+ Testing,
+ Stopping
+ };
+ State m_state;
+};
+
+} // namespace WTR
+
+#endif // InjectedBundle_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp
new file mode 100644
index 0000000..c4cf892
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp
@@ -0,0 +1,37 @@
+/*
+ * 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 "InjectedBundle.h"
+#include <WebKit2/WKBundleInitialize.h>
+
+#if defined(WIN32) || defined(_WIN32)
+extern "C" __declspec(dllexport)
+#else
+extern "C"
+#endif
+void WKBundleInitialize(WKBundleRef bundle, WKTypeRef initializationUserData)
+{
+ WTR::InjectedBundle::shared().initialize(bundle);
+}
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
new file mode 100644
index 0000000..d852dd2
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
@@ -0,0 +1,901 @@
+/*
+ * 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 "InjectedBundlePage.h"
+
+#include "InjectedBundle.h"
+#include "StringFunctions.h"
+#include <cmath>
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <WebKit2/WKArray.h>
+#include <WebKit2/WKBundle.h>
+#include <WebKit2/WKBundleBackForwardList.h>
+#include <WebKit2/WKBundleBackForwardListItem.h>
+#include <WebKit2/WKBundleFrame.h>
+#include <WebKit2/WKBundleFramePrivate.h>
+#include <WebKit2/WKBundlePagePrivate.h>
+
+using namespace std;
+
+namespace WTR {
+
+template<typename T> static inline WKRetainPtr<T> adoptWK(T item)
+{
+ return WKRetainPtr<T>(AdoptWK, item);
+}
+
+static bool hasPrefix(const string& searchString, const string& prefix)
+{
+ return searchString.length() >= prefix.length() && searchString.substr(0, prefix.length()) == prefix;
+}
+
+static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ if (!object)
+ return 0;
+ JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
+ return JSObjectGetProperty(context, object, propertyNameString.get(), 0);
+}
+
+static double propertyValueDouble(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ JSValueRef value = propertyValue(context, object, propertyName);
+ if (!value)
+ return 0;
+ return JSValueToNumber(context, value, 0);
+}
+
+static int propertyValueInt(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ return static_cast<int>(propertyValueDouble(context, object, propertyName));
+}
+
+static double numericWindowPropertyValue(WKBundleFrameRef frame, const char* propertyName)
+{
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+ return propertyValueDouble(context, JSContextGetGlobalObject(context), propertyName);
+}
+
+static string dumpPath(JSGlobalContextRef context, JSObjectRef nodeValue)
+{
+ JSValueRef nodeNameValue = propertyValue(context, nodeValue, "nodeName");
+ JSRetainPtr<JSStringRef> jsStringNodeName(Adopt, JSValueToStringCopy(context, nodeNameValue, 0));
+ WKRetainPtr<WKStringRef> nodeName = toWK(jsStringNodeName);
+
+ JSValueRef parentNode = propertyValue(context, nodeValue, "parentNode");
+
+ ostringstream out;
+ out << nodeName;
+
+ if (parentNode && JSValueIsObject(context, parentNode))
+ out << " > " << dumpPath(context, (JSObjectRef)parentNode);
+
+ return out.str();
+}
+
+static string dumpPath(WKBundlePageRef page, WKBundleScriptWorldRef world, WKBundleNodeHandleRef node)
+{
+ if (!node)
+ return "(null)";
+
+ WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);
+
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world);
+ JSValueRef nodeValue = WKBundleFrameGetJavaScriptWrapperForNodeForWorld(frame, node, world);
+ ASSERT(JSValueIsObject(context, nodeValue));
+ JSObjectRef nodeObject = (JSObjectRef)nodeValue;
+
+ return dumpPath(context, nodeObject);
+}
+
+static string toStr(WKBundlePageRef page, WKBundleScriptWorldRef world, WKBundleRangeHandleRef rangeRef)
+{
+ if (!rangeRef)
+ return "(null)";
+
+ WKBundleFrameRef frame = WKBundlePageGetMainFrame(page);
+
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world);
+ JSValueRef rangeValue = WKBundleFrameGetJavaScriptWrapperForRangeForWorld(frame, rangeRef, world);
+ ASSERT(JSValueIsObject(context, rangeValue));
+ JSObjectRef rangeObject = (JSObjectRef)rangeValue;
+
+ JSValueRef startNodeValue = propertyValue(context, rangeObject, "startContainer");
+ ASSERT(JSValueIsObject(context, startNodeValue));
+ JSObjectRef startNodeObject = (JSObjectRef)startNodeValue;
+
+ JSValueRef endNodeValue = propertyValue(context, rangeObject, "endContainer");
+ ASSERT(JSValueIsObject(context, endNodeValue));
+ JSObjectRef endNodeObject = (JSObjectRef)endNodeValue;
+
+ int startOffset = propertyValueInt(context, rangeObject, "startOffset");
+ int endOffset = propertyValueInt(context, rangeObject, "endOffset");
+
+ ostringstream out;
+ out << "range from " << startOffset << " of " << dumpPath(context, startNodeObject) << " to " << endOffset << " of " << dumpPath(context, endNodeObject);
+ return out.str();
+}
+
+static ostream& operator<<(ostream& out, WKBundleCSSStyleDeclarationRef style)
+{
+ // DumpRenderTree calls -[DOMCSSStyleDeclaration description], which just dumps class name and object address.
+ // No existing tests actually hit this code path at the time of this writing, because WebCore doesn't call
+ // the editing client if the styling operation source is CommandFromDOM or CommandFromDOMWithUserInterface.
+ out << "<DOMCSSStyleDeclaration ADDRESS>";
+ return out;
+}
+
+static ostream& operator<<(ostream& out, WKBundleFrameRef frame)
+{
+ WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
+ if (WKBundleFrameIsMainFrame(frame)) {
+ if (!WKStringIsEmpty(name.get()))
+ out << "main frame \"" << name << "\"";
+ else
+ out << "main frame";
+ } else {
+ if (!WKStringIsEmpty(name.get()))
+ out << "frame \"" << name << "\"";
+ else
+ out << "frame (anonymous)";
+ }
+
+ return out;
+}
+
+InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page)
+ : m_page(page)
+ , m_world(AdoptWK, WKBundleScriptWorldCreateWorld())
+ , m_isLoading(false)
+{
+ WKBundlePageLoaderClient loaderClient = {
+ 0,
+ this,
+ didStartProvisionalLoadForFrame,
+ didReceiveServerRedirectForProvisionalLoadForFrame,
+ didFailProvisionalLoadWithErrorForFrame,
+ didCommitLoadForFrame,
+ didFinishDocumentLoadForFrame,
+ didFinishLoadForFrame,
+ didFailLoadWithErrorForFrame,
+ didReceiveTitleForFrame,
+ 0,
+ 0,
+ 0,
+ didDisplayInsecureContentForFrame,
+ didRunInsecureContentForFrame,
+ didClearWindowForFrame,
+ didCancelClientRedirectForFrame,
+ willPerformClientRedirectForFrame,
+ didChangeLocationWithinPageForFrame,
+ didHandleOnloadEventsForFrame
+ };
+ WKBundlePageSetLoaderClient(m_page, &loaderClient);
+
+ WKBundlePageUIClient uiClient = {
+ 0,
+ this,
+ willAddMessageToConsole,
+ willSetStatusbarText,
+ willRunJavaScriptAlert,
+ willRunJavaScriptConfirm,
+ willRunJavaScriptPrompt,
+ 0, /*mouseDidMoveOverElement*/
+ 0, /*pageDidScroll*/
+ };
+ WKBundlePageSetUIClient(m_page, &uiClient);
+
+ WKBundlePageEditorClient editorClient = {
+ 0,
+ this,
+ shouldBeginEditing,
+ shouldEndEditing,
+ shouldInsertNode,
+ shouldInsertText,
+ shouldDeleteRange,
+ shouldChangeSelectedRange,
+ shouldApplyStyle,
+ didBeginEditing,
+ didEndEditing,
+ didChange,
+ didChangeSelection
+ };
+ WKBundlePageSetEditorClient(m_page, &editorClient);
+}
+
+InjectedBundlePage::~InjectedBundlePage()
+{
+}
+
+void InjectedBundlePage::stopLoading()
+{
+ WKBundlePageStopLoading(m_page);
+ m_isLoading = false;
+}
+
+void InjectedBundlePage::reset()
+{
+ WKBundlePageClearMainFrameName(m_page);
+
+ WKBundlePageSetPageZoomFactor(m_page, 1);
+ WKBundlePageSetTextZoomFactor(m_page, 1);
+
+ m_previousTestBackForwardListItem = adoptWK(WKBundleBackForwardListCopyItemAtIndex(WKBundlePageGetBackForwardList(m_page), 0));
+}
+
+// Loader Client Callbacks
+
+void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didStartProvisionalLoadForFrame(frame);
+}
+
+void InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReceiveServerRedirectForProvisionalLoadForFrame(frame);
+}
+
+void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef error, WKTypeRef*, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailProvisionalLoadWithErrorForFrame(frame, error);
+}
+
+void InjectedBundlePage::didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didCommitLoadForFrame(frame);
+}
+
+void InjectedBundlePage::didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishLoadForFrame(frame);
+}
+
+void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFinishDocumentLoadForFrame(frame);
+}
+
+void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKErrorRef error, WKTypeRef*, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didFailLoadWithErrorForFrame(frame, error);
+}
+
+void InjectedBundlePage::didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, WKTypeRef*, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didReceiveTitleForFrame(title, frame);
+}
+
+void InjectedBundlePage::didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKBundleScriptWorldRef world, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didClearWindowForFrame(frame, world);
+}
+
+void InjectedBundlePage::didCancelClientRedirectForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didCancelClientRedirectForFrame(frame);
+}
+
+void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKURLRef url, double delay, double date, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willPerformClientRedirectForFrame(frame, url, delay, date);
+}
+
+void InjectedBundlePage::didChangeLocationWithinPageForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChangeLocationWithinPageForFrame(frame);
+}
+
+void InjectedBundlePage::didHandleOnloadEventsForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didHandleOnloadEventsForFrame(frame);
+}
+
+void InjectedBundlePage::didDisplayInsecureContentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didDisplayInsecureContentForFrame(frame);
+}
+
+void InjectedBundlePage::didRunInsecureContentForFrame(WKBundlePageRef page, WKBundleFrameRef frame, WKTypeRef*, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didRunInsecureContentForFrame(frame);
+}
+
+
+void InjectedBundlePage::didStartProvisionalLoadForFrame(WKBundleFrameRef frame)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (frame == WKBundlePageGetMainFrame(m_page))
+ m_isLoading = true;
+}
+
+void InjectedBundlePage::didReceiveServerRedirectForProvisionalLoadForFrame(WKBundleFrameRef frame)
+{
+}
+
+void InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRef frame, WKErrorRef error)
+{
+}
+
+void InjectedBundlePage::didCommitLoadForFrame(WKBundleFrameRef frame)
+{
+}
+
+enum FrameNamePolicy { ShouldNotIncludeFrameName, ShouldIncludeFrameName };
+
+static void dumpFrameScrollPosition(WKBundleFrameRef frame, FrameNamePolicy shouldIncludeFrameName = ShouldNotIncludeFrameName)
+{
+ double x = numericWindowPropertyValue(frame, "pageXOffset");
+ double y = numericWindowPropertyValue(frame, "pageYOffset");
+ if (fabs(x) > 0.00000001 || fabs(y) > 0.00000001) {
+ if (shouldIncludeFrameName) {
+ WKRetainPtr<WKStringRef> name(AdoptWK, WKBundleFrameCopyName(frame));
+ InjectedBundle::shared().os() << "frame '" << name << "' ";
+ }
+ InjectedBundle::shared().os() << "scrolled to " << x << "," << y << "\n";
+ }
+}
+
+static void dumpDescendantFrameScrollPositions(WKBundleFrameRef frame)
+{
+ WKRetainPtr<WKArrayRef> childFrames(AdoptWK, WKBundleFrameCopyChildFrames(frame));
+ size_t size = WKArrayGetSize(childFrames.get());
+ for (size_t i = 0; i < size; ++i) {
+ WKBundleFrameRef subframe = static_cast<WKBundleFrameRef>(WKArrayGetItemAtIndex(childFrames.get(), i));
+ dumpFrameScrollPosition(subframe, ShouldIncludeFrameName);
+ dumpDescendantFrameScrollPositions(subframe);
+ }
+}
+
+void InjectedBundlePage::dumpAllFrameScrollPositions()
+{
+ WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page);
+ dumpFrameScrollPosition(frame);
+ dumpDescendantFrameScrollPositions(frame);
+}
+
+static JSRetainPtr<JSStringRef> toJS(const char* string)
+{
+ return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString(string));
+}
+
+static bool hasDocumentElement(WKBundleFrameRef frame)
+{
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+ JSObjectRef globalObject = JSContextGetGlobalObject(context);
+
+ JSValueRef documentValue = JSObjectGetProperty(context, globalObject, toJS("document").get(), 0);
+ if (!documentValue)
+ return false;
+
+ ASSERT(JSValueIsObject(context, documentValue));
+ JSObjectRef document = JSValueToObject(context, documentValue, 0);
+
+ JSValueRef documentElementValue = JSObjectGetProperty(context, document, toJS("documentElement").get(), 0);
+ if (!documentElementValue)
+ return false;
+
+ return JSValueToBoolean(context, documentElementValue);
+}
+
+static void dumpFrameText(WKBundleFrameRef frame)
+{
+ // If the frame doesn't have a document element, its inner text will be an empty string, so
+ // we'll end up just appending a single newline below. But DumpRenderTree doesn't append
+ // anything in this case, so we shouldn't either.
+ if (!hasDocumentElement(frame))
+ return;
+
+ WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyInnerText(frame));
+ InjectedBundle::shared().os() << text << "\n";
+}
+
+static void dumpDescendantFramesText(WKBundleFrameRef frame)
+{
+ WKRetainPtr<WKArrayRef> childFrames(AdoptWK, WKBundleFrameCopyChildFrames(frame));
+ size_t size = WKArrayGetSize(childFrames.get());
+ for (size_t i = 0; i < size; ++i) {
+ WKBundleFrameRef subframe = static_cast<WKBundleFrameRef>(WKArrayGetItemAtIndex(childFrames.get(), i));
+ WKRetainPtr<WKStringRef> subframeName(AdoptWK, WKBundleFrameCopyName(subframe));
+ InjectedBundle::shared().os() << "\n--------\nFrame: '" << subframeName << "'\n--------\n";
+ dumpFrameText(subframe);
+ dumpDescendantFramesText(subframe);
+ }
+}
+
+void InjectedBundlePage::dumpAllFramesText()
+{
+ WKBundleFrameRef frame = WKBundlePageGetMainFrame(m_page);
+ dumpFrameText(frame);
+ dumpDescendantFramesText(frame);
+}
+
+void InjectedBundlePage::dump()
+{
+ ASSERT(InjectedBundle::shared().isTestRunning());
+
+ InjectedBundle::shared().layoutTestController()->invalidateWaitToDumpWatchdogTimer();
+
+ switch (InjectedBundle::shared().layoutTestController()->whatToDump()) {
+ case LayoutTestController::RenderTree: {
+ WKRetainPtr<WKStringRef> text(AdoptWK, WKBundlePageCopyRenderTreeExternalRepresentation(m_page));
+ InjectedBundle::shared().os() << text;
+ break;
+ }
+ case LayoutTestController::MainFrameText:
+ dumpFrameText(WKBundlePageGetMainFrame(m_page));
+ break;
+ case LayoutTestController::AllFramesText:
+ dumpAllFramesText();
+ break;
+ }
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpAllFrameScrollPositions())
+ dumpAllFrameScrollPositions();
+ else if (InjectedBundle::shared().layoutTestController()->shouldDumpMainFrameScrollPosition())
+ dumpFrameScrollPosition(WKBundlePageGetMainFrame(m_page));
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpBackForwardListsForAllWindows())
+ InjectedBundle::shared().dumpBackForwardListsForAllPages();
+
+ InjectedBundle::shared().done();
+}
+
+void InjectedBundlePage::didFinishLoadForFrame(WKBundleFrameRef frame)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!WKBundleFrameIsMainFrame(frame))
+ return;
+
+ m_isLoading = false;
+
+ if (this != InjectedBundle::shared().page())
+ return;
+
+ if (InjectedBundle::shared().layoutTestController()->waitToDump())
+ return;
+
+ dump();
+}
+
+void InjectedBundlePage::didFailLoadWithErrorForFrame(WKBundleFrameRef frame, WKErrorRef)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!WKBundleFrameIsMainFrame(frame))
+ return;
+
+ m_isLoading = false;
+
+ if (this != InjectedBundle::shared().page())
+ return;
+
+ InjectedBundle::shared().done();
+}
+
+void InjectedBundlePage::didReceiveTitleForFrame(WKStringRef title, WKBundleFrameRef frame)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().layoutTestController()->shouldDumpTitleChanges())
+ return;
+
+ InjectedBundle::shared().os() << "TITLE CHANGED: " << title << "\n";
+}
+
+void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundleScriptWorldRef world)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (WKBundleScriptWorldNormalWorld() != world)
+ return;
+
+ JSGlobalContextRef context = WKBundleFrameGetJavaScriptContextForWorld(frame, world);
+ JSObjectRef window = JSContextGetGlobalObject(context);
+
+ JSValueRef exception = 0;
+ InjectedBundle::shared().layoutTestController()->makeWindowObject(context, window, &exception);
+ InjectedBundle::shared().gcController()->makeWindowObject(context, window, &exception);
+ InjectedBundle::shared().eventSendingController()->makeWindowObject(context, window, &exception);
+}
+
+void InjectedBundlePage::didCancelClientRedirectForFrame(WKBundleFrameRef frame)
+{
+}
+
+void InjectedBundlePage::willPerformClientRedirectForFrame(WKBundleFrameRef frame, WKURLRef url, double delay, double date)
+{
+}
+
+void InjectedBundlePage::didChangeLocationWithinPageForFrame(WKBundleFrameRef frame)
+{
+}
+
+void InjectedBundlePage::didFinishDocumentLoadForFrame(WKBundleFrameRef frame)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ unsigned pendingFrameUnloadEvents = WKBundleFrameGetPendingUnloadCount(frame);
+ if (pendingFrameUnloadEvents)
+ InjectedBundle::shared().os() << frame << " - has " << pendingFrameUnloadEvents << " onunload handler(s)\n";
+}
+
+void InjectedBundlePage::didHandleOnloadEventsForFrame(WKBundleFrameRef frame)
+{
+}
+
+void InjectedBundlePage::didDisplayInsecureContentForFrame(WKBundleFrameRef frame)
+{
+}
+
+void InjectedBundlePage::didRunInsecureContentForFrame(WKBundleFrameRef frame)
+{
+}
+
+// UI Client Callbacks
+
+void InjectedBundlePage::willAddMessageToConsole(WKBundlePageRef page, WKStringRef message, uint32_t lineNumber, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willAddMessageToConsole(message, lineNumber);
+}
+
+void InjectedBundlePage::willSetStatusbarText(WKBundlePageRef page, WKStringRef statusbarText, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willSetStatusbarText(statusbarText);
+}
+
+void InjectedBundlePage::willRunJavaScriptAlert(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willRunJavaScriptAlert(message, frame);
+}
+
+void InjectedBundlePage::willRunJavaScriptConfirm(WKBundlePageRef page, WKStringRef message, WKBundleFrameRef frame, const void *clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willRunJavaScriptConfirm(message, frame);
+}
+
+void InjectedBundlePage::willRunJavaScriptPrompt(WKBundlePageRef page, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void *clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->willRunJavaScriptPrompt(message, defaultValue, frame);
+}
+
+void InjectedBundlePage::willAddMessageToConsole(WKStringRef message, uint32_t lineNumber)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ // FIXME: Strip file: urls.
+ InjectedBundle::shared().os() << "CONSOLE MESSAGE: line " << lineNumber << ": " << message << "\n";
+}
+
+void InjectedBundlePage::willSetStatusbarText(WKStringRef statusbarText)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (!InjectedBundle::shared().layoutTestController()->shouldDumpStatusCallbacks())
+ return;
+
+ InjectedBundle::shared().os() << "UI DELEGATE STATUS CALLBACK: setStatusText:" << statusbarText << "\n";
+}
+
+void InjectedBundlePage::willRunJavaScriptAlert(WKStringRef message, WKBundleFrameRef)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ InjectedBundle::shared().os() << "ALERT: " << message << "\n";
+}
+
+void InjectedBundlePage::willRunJavaScriptConfirm(WKStringRef message, WKBundleFrameRef)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ InjectedBundle::shared().os() << "CONFIRM: " << message << "\n";
+}
+
+void InjectedBundlePage::willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef)
+{
+ InjectedBundle::shared().os() << "PROMPT: " << message << ", default text: " << defaultValue << "\n";
+}
+
+// Editor Client Callbacks
+
+bool InjectedBundlePage::shouldBeginEditing(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldBeginEditing(range);
+}
+
+bool InjectedBundlePage::shouldEndEditing(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldEndEditing(range);
+}
+
+bool InjectedBundlePage::shouldInsertNode(WKBundlePageRef page, WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertNode(node, rangeToReplace, action);
+}
+
+bool InjectedBundlePage::shouldInsertText(WKBundlePageRef page, WKStringRef text, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertText(text, rangeToReplace, action);
+}
+
+bool InjectedBundlePage::shouldDeleteRange(WKBundlePageRef page, WKBundleRangeHandleRef range, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldDeleteRange(range);
+}
+
+bool InjectedBundlePage::shouldChangeSelectedRange(WKBundlePageRef page, WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting);
+}
+
+bool InjectedBundlePage::shouldApplyStyle(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range, const void* clientInfo)
+{
+ return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldApplyStyle(style, range);
+}
+
+void InjectedBundlePage::didBeginEditing(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didBeginEditing(notificationName);
+}
+
+void InjectedBundlePage::didEndEditing(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didEndEditing(notificationName);
+}
+
+void InjectedBundlePage::didChange(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChange(notificationName);
+}
+
+void InjectedBundlePage::didChangeSelection(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo)
+{
+ static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChangeSelection(notificationName);
+}
+
+bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeHandleRef range)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldBeginEditingInDOMRange:" << toStr(m_page, m_world.get(), range) << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldEndEditing(WKBundleRangeHandleRef range)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldEndEditingInDOMRange:" << toStr(m_page, m_world.get(), range) << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldInsertNode(WKBundleNodeHandleRef node, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
+ static const char* insertactionstring[] = {
+ "WebViewInsertActionTyped",
+ "WebViewInsertActionPasted",
+ "WebViewInsertActionDropped",
+ };
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertNode:" << dumpPath(m_page, m_world.get(), node) << " replacingDOMRange:" << toStr(m_page, m_world.get(), rangeToReplace) << " givenAction:" << insertactionstring[action] << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType action)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
+ static const char *insertactionstring[] = {
+ "WebViewInsertActionTyped",
+ "WebViewInsertActionPasted",
+ "WebViewInsertActionDropped",
+ };
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertText:" << text << " replacingDOMRange:" << toStr(m_page, m_world.get(), rangeToReplace) << " givenAction:" << insertactionstring[action] << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeHandleRef range)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldDeleteDOMRange:" << toStr(m_page, m_world.get(), range) << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType affinity, bool stillSelecting)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
+ static const char *affinitystring[] = {
+ "NSSelectionAffinityUpstream",
+ "NSSelectionAffinityDownstream"
+ };
+ static const char *boolstring[] = {
+ "FALSE",
+ "TRUE"
+ };
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldChangeSelectedDOMRange:" << toStr(m_page, m_world.get(), fromRange) << " toDOMRange:" << toStr(m_page, m_world.get(), toRange) << " affinity:" << affinitystring[affinity] << " stillSelecting:" << boolstring[stillSelecting] << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return true;
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: shouldApplyStyle:" << style << " toElementsInDOMRange:" << toStr(m_page, m_world.get(), range) << "\n";
+ return InjectedBundle::shared().layoutTestController()->shouldAllowEditing();
+}
+
+void InjectedBundlePage::didBeginEditing(WKStringRef notificationName)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidBeginEditing:" << notificationName << "\n";
+}
+
+void InjectedBundlePage::didEndEditing(WKStringRef notificationName)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidEndEditing:" << notificationName << "\n";
+}
+
+void InjectedBundlePage::didChange(WKStringRef notificationName)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChange:" << notificationName << "\n";
+}
+
+void InjectedBundlePage::didChangeSelection(WKStringRef notificationName)
+{
+ if (!InjectedBundle::shared().isTestRunning())
+ return;
+
+ if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks())
+ InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChangeSelection:" << notificationName << "\n";
+}
+
+static bool compareByTargetName(WKBundleBackForwardListItemRef item1, WKBundleBackForwardListItemRef item2)
+{
+ return toSTD(adoptWK(WKBundleBackForwardListItemCopyTarget(item1))) < toSTD(adoptWK(WKBundleBackForwardListItemCopyTarget(item2)));
+}
+
+static void dumpBackForwardListItem(WKBundleBackForwardListItemRef item, unsigned indent, bool isCurrentItem)
+{
+ unsigned column = 0;
+ if (isCurrentItem) {
+ InjectedBundle::shared().os() << "curr->";
+ column = 6;
+ }
+ for (unsigned i = column; i < indent; i++)
+ InjectedBundle::shared().os() << ' ';
+
+ string url = toSTD(adoptWK(WKURLCopyString(adoptWK(WKBundleBackForwardListItemCopyURL(item)).get())));
+ if (hasPrefix(url, "file:")) {
+ string directoryName = "/LayoutTests/";
+ size_t start = url.find(directoryName);
+ if (start == string::npos)
+ start = 0;
+ else
+ start += directoryName.size();
+ InjectedBundle::shared().os() << "(file test):" << url.substr(start);
+ } else
+ InjectedBundle::shared().os() << url;
+
+ string target = toSTD(adoptWK(WKBundleBackForwardListItemCopyTarget(item)));
+ if (target.length())
+ InjectedBundle::shared().os() << " (in frame \"" << target << "\")";
+
+ // FIXME: Need WKBackForwardListItemIsTargetItem.
+ if (WKBundleBackForwardListItemIsTargetItem(item))
+ InjectedBundle::shared().os() << " **nav target**";
+
+ InjectedBundle::shared().os() << '\n';
+
+ if (WKRetainPtr<WKArrayRef> kids = adoptWK(WKBundleBackForwardListItemCopyChildren(item))) {
+ // Sort to eliminate arbitrary result ordering which defeats reproducible testing.
+ size_t size = WKArrayGetSize(kids.get());
+ Vector<WKBundleBackForwardListItemRef> sortedKids(size);
+ for (size_t i = 0; i < size; ++i)
+ sortedKids[i] = static_cast<WKBundleBackForwardListItemRef>(WKArrayGetItemAtIndex(kids.get(), i));
+ stable_sort(sortedKids.begin(), sortedKids.end(), compareByTargetName);
+ for (size_t i = 0; i < size; ++i)
+ dumpBackForwardListItem(sortedKids[i], indent + 4, false);
+ }
+}
+
+void InjectedBundlePage::dumpBackForwardList()
+{
+ InjectedBundle::shared().os() << "\n============== Back Forward List ==============\n";
+
+ WKBundleBackForwardListRef list = WKBundlePageGetBackForwardList(m_page);
+
+ // Print out all items in the list after m_previousTestBackForwardListItem.
+ // Gather items from the end of the list, then print them out from oldest to newest.
+ Vector<WKRetainPtr<WKBundleBackForwardListItemRef> > itemsToPrint;
+ for (unsigned i = WKBundleBackForwardListGetForwardListCount(list); i; --i) {
+ WKRetainPtr<WKBundleBackForwardListItemRef> item = adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, i));
+ // Something is wrong if the item from the last test is in the forward part of the list.
+ ASSERT(!WKBundleBackForwardListItemIsSame(item.get(), m_previousTestBackForwardListItem.get()));
+ itemsToPrint.append(item);
+ }
+
+ ASSERT(!WKBundleBackForwardListItemIsSame(adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, 0)).get(), m_previousTestBackForwardListItem.get()));
+
+ itemsToPrint.append(adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, 0)));
+
+ int currentItemIndex = itemsToPrint.size() - 1;
+
+ int backListCount = WKBundleBackForwardListGetBackListCount(list);
+ for (int i = -1; i >= -backListCount; --i) {
+ WKRetainPtr<WKBundleBackForwardListItemRef> item = adoptWK(WKBundleBackForwardListCopyItemAtIndex(list, i));
+ if (WKBundleBackForwardListItemIsSame(item.get(), m_previousTestBackForwardListItem.get()))
+ break;
+ itemsToPrint.append(item);
+ }
+
+ for (int i = itemsToPrint.size() - 1; i >= 0; i--)
+ dumpBackForwardListItem(itemsToPrint[i].get(), 8, i == currentItemIndex);
+
+ InjectedBundle::shared().os() << "===============================================\n";
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
new file mode 100644
index 0000000..b95744f9
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
@@ -0,0 +1,130 @@
+/*
+ * 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 InjectedBundlePage_h
+#define InjectedBundlePage_h
+
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundleScriptWorld.h>
+#include <WebKit2/WKRetainPtr.h>
+
+namespace WTR {
+
+class InjectedBundlePage {
+public:
+ InjectedBundlePage(WKBundlePageRef);
+ ~InjectedBundlePage();
+
+ WKBundlePageRef page() const { return m_page; }
+ void dump();
+
+ void stopLoading();
+ bool isLoading() { return m_isLoading; }
+
+ void reset();
+
+ void dumpBackForwardList();
+
+private:
+ // Loader Client
+ static void didStartProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, WKErrorRef, WKTypeRef*, const void*);
+ static void didCommitLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didFinishLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didFinishDocumentLoadForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didFailLoadWithErrorForFrame(WKBundlePageRef, WKBundleFrameRef, WKErrorRef, WKTypeRef*, const void*);
+ static void didReceiveTitleForFrame(WKBundlePageRef, WKStringRef title, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didClearWindowForFrame(WKBundlePageRef, WKBundleFrameRef, WKBundleScriptWorldRef, const void*);
+ static void didCancelClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
+ static void willPerformClientRedirectForFrame(WKBundlePageRef, WKBundleFrameRef, WKURLRef url, double delay, double date, const void*);
+ static void didChangeLocationWithinPageForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
+ static void didHandleOnloadEventsForFrame(WKBundlePageRef, WKBundleFrameRef, const void*);
+ static void didDisplayInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ static void didRunInsecureContentForFrame(WKBundlePageRef, WKBundleFrameRef, WKTypeRef*, const void*);
+ void didStartProvisionalLoadForFrame(WKBundleFrameRef);
+ void didReceiveServerRedirectForProvisionalLoadForFrame(WKBundleFrameRef);
+ void didFailProvisionalLoadWithErrorForFrame(WKBundleFrameRef, WKErrorRef);
+ void didCommitLoadForFrame(WKBundleFrameRef);
+ void didFinishLoadForFrame(WKBundleFrameRef);
+ void didFailLoadWithErrorForFrame(WKBundleFrameRef, WKErrorRef);
+ void didReceiveTitleForFrame(WKStringRef title, WKBundleFrameRef);
+ void didClearWindowForFrame(WKBundleFrameRef, WKBundleScriptWorldRef);
+ void didCancelClientRedirectForFrame(WKBundleFrameRef);
+ void willPerformClientRedirectForFrame(WKBundleFrameRef, WKURLRef url, double delay, double date);
+ void didChangeLocationWithinPageForFrame(WKBundleFrameRef);
+ void didFinishDocumentLoadForFrame(WKBundleFrameRef);
+ void didHandleOnloadEventsForFrame(WKBundleFrameRef);
+ void didDisplayInsecureContentForFrame(WKBundleFrameRef);
+ void didRunInsecureContentForFrame(WKBundleFrameRef);
+
+ // UI Client
+ static void willAddMessageToConsole(WKBundlePageRef, WKStringRef message, uint32_t lineNumber, const void* clientInfo);
+ static void willSetStatusbarText(WKBundlePageRef, WKStringRef statusbarText, const void* clientInfo);
+ static void willRunJavaScriptAlert(WKBundlePageRef, WKStringRef message, WKBundleFrameRef frame, const void* clientInfo);
+ static void willRunJavaScriptConfirm(WKBundlePageRef, WKStringRef message, WKBundleFrameRef frame, const void* clientInfo);
+ static void willRunJavaScriptPrompt(WKBundlePageRef, WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef frame, const void* clientInfo);
+ void willAddMessageToConsole(WKStringRef message, uint32_t lineNumber);
+ void willSetStatusbarText(WKStringRef statusbarText);
+ void willRunJavaScriptAlert(WKStringRef message, WKBundleFrameRef);
+ void willRunJavaScriptConfirm(WKStringRef message, WKBundleFrameRef);
+ void willRunJavaScriptPrompt(WKStringRef message, WKStringRef defaultValue, WKBundleFrameRef);
+
+ // Editor client
+ static bool shouldBeginEditing(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo);
+ static bool shouldEndEditing(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo);
+ static bool shouldInsertNode(WKBundlePageRef, WKBundleNodeHandleRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType, const void* clientInfo);
+ static bool shouldInsertText(WKBundlePageRef, WKStringRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType, const void* clientInfo);
+ static bool shouldDeleteRange(WKBundlePageRef, WKBundleRangeHandleRef, const void* clientInfo);
+ static bool shouldChangeSelectedRange(WKBundlePageRef, WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType, bool stillSelecting, const void* clientInfo);
+ static bool shouldApplyStyle(WKBundlePageRef, WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range, const void* clientInfo);
+ static void didBeginEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
+ static void didEndEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
+ static void didChange(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
+ static void didChangeSelection(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo);
+ bool shouldBeginEditing(WKBundleRangeHandleRef);
+ bool shouldEndEditing(WKBundleRangeHandleRef);
+ bool shouldInsertNode(WKBundleNodeHandleRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType);
+ bool shouldInsertText(WKStringRef, WKBundleRangeHandleRef rangeToReplace, WKInsertActionType);
+ bool shouldDeleteRange(WKBundleRangeHandleRef);
+ bool shouldChangeSelectedRange(WKBundleRangeHandleRef fromRange, WKBundleRangeHandleRef toRange, WKAffinityType, bool stillSelecting);
+ bool shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeHandleRef range);
+ void didBeginEditing(WKStringRef notificationName);
+ void didEndEditing(WKStringRef notificationName);
+ void didChange(WKStringRef notificationName);
+ void didChangeSelection(WKStringRef notificationName);
+
+ void dumpAllFramesText();
+ void dumpAllFrameScrollPositions();
+
+ WKBundlePageRef m_page;
+ WKRetainPtr<WKBundleScriptWorldRef> m_world;
+ WKRetainPtr<WKBundleBackForwardListItemRef> m_previousTestBackForwardListItem;
+ bool m_isLoading;
+};
+
+} // namespace WTR
+
+#endif // InjectedBundlePage_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
new file mode 100644
index 0000000..de37383
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp
@@ -0,0 +1,269 @@
+/*
+ * 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 "LayoutTestController.h"
+
+#include "InjectedBundle.h"
+#include "InjectedBundlePage.h"
+#include "JSLayoutTestController.h"
+#include "StringFunctions.h"
+#include <WebKit2/WKBundleBackForwardList.h>
+#include <WebKit2/WKBundleFrame.h>
+#include <WebKit2/WKBundleFramePrivate.h>
+#include <WebKit2/WKBundlePagePrivate.h>
+#include <WebKit2/WKBundleScriptWorld.h>
+#include <WebKit2/WKBundlePrivate.h>
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WebKit2.h>
+
+namespace WTR {
+
+// This is lower than DumpRenderTree's timeout, to make it easier to work through the failures
+// Eventually it should be changed to match.
+const double LayoutTestController::waitToDumpWatchdogTimerInterval = 6;
+
+static JSValueRef propertyValue(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ if (!object)
+ return 0;
+ JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSStringCreateWithUTF8CString(propertyName));
+ JSValueRef exception;
+ return JSObjectGetProperty(context, object, propertyNameString.get(), &exception);
+}
+
+static JSObjectRef propertyObject(JSContextRef context, JSObjectRef object, const char* propertyName)
+{
+ JSValueRef value = propertyValue(context, object, propertyName);
+ if (!value || !JSValueIsObject(context, value))
+ return 0;
+ return const_cast<JSObjectRef>(value);
+}
+
+static JSObjectRef getElementById(WKBundleFrameRef frame, JSStringRef elementId)
+{
+ JSContextRef context = WKBundleFrameGetJavaScriptContext(frame);
+ JSObjectRef document = propertyObject(context, JSContextGetGlobalObject(context), "document");
+ if (!document)
+ return 0;
+ JSValueRef getElementById = propertyObject(context, document, "getElementById");
+ if (!getElementById || !JSValueIsObject(context, getElementById))
+ return 0;
+ JSValueRef elementIdValue = JSValueMakeString(context, elementId);
+ JSValueRef exception;
+ JSValueRef element = JSObjectCallAsFunction(context, const_cast<JSObjectRef>(getElementById), document, 1, &elementIdValue, &exception);
+ if (!element || !JSValueIsObject(context, element))
+ return 0;
+ return const_cast<JSObjectRef>(element);
+}
+
+PassRefPtr<LayoutTestController> LayoutTestController::create()
+{
+ return adoptRef(new LayoutTestController);
+}
+
+LayoutTestController::LayoutTestController()
+ : m_whatToDump(RenderTree)
+ , m_shouldDumpAllFrameScrollPositions(false)
+ , m_shouldDumpBackForwardListsForAllWindows(false)
+ , m_shouldAllowEditing(true)
+ , m_shouldCloseExtraWindows(false)
+ , m_dumpEditingCallbacks(false)
+ , m_dumpStatusCallbacks(false)
+ , m_dumpTitleChanges(false)
+ , m_waitToDump(false)
+ , m_testRepaint(false)
+ , m_testRepaintSweepHorizontally(false)
+{
+ platformInitialize();
+}
+
+LayoutTestController::~LayoutTestController()
+{
+}
+
+JSClassRef LayoutTestController::wrapperClass()
+{
+ return JSLayoutTestController::layoutTestControllerClass();
+}
+
+void LayoutTestController::display()
+{
+ // FIXME: actually implement, once we want pixel tests
+}
+
+void LayoutTestController::waitUntilDone()
+{
+ m_waitToDump = true;
+ initializeWaitToDumpWatchdogTimerIfNeeded();
+}
+
+void LayoutTestController::waitToDumpWatchdogTimerFired()
+{
+ invalidateWaitToDumpWatchdogTimer();
+ const char* message = "FAIL: Timed out waiting for notifyDone to be called\n";
+ InjectedBundle::shared().os() << message << "\n";
+ InjectedBundle::shared().done();
+}
+
+void LayoutTestController::notifyDone()
+{
+ if (m_waitToDump && !InjectedBundle::shared().page()->isLoading())
+ InjectedBundle::shared().page()->dump();
+ m_waitToDump = false;
+}
+
+unsigned LayoutTestController::numberOfActiveAnimations() const
+{
+ // FIXME: Is it OK this works only for the main frame?
+ // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage?
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ return WKBundleFrameGetNumberOfActiveAnimations(mainFrame);
+}
+
+bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId)
+{
+ // FIXME: Is it OK this works only for the main frame?
+ // FIXME: If this is needed only for the main frame, then why is the function on WKBundleFrame instead of WKBundlePage?
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ return WKBundleFramePauseAnimationOnElementWithId(mainFrame, toWK(animationName).get(), toWK(elementId).get(), time);
+}
+
+void LayoutTestController::suspendAnimations()
+{
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ WKBundleFrameSuspendAnimations(mainFrame);
+}
+
+void LayoutTestController::resumeAnimations()
+{
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ WKBundleFrameResumeAnimations(mainFrame);
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const
+{
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyLayerTreeAsText(mainFrame));
+ return toJS(text);
+}
+
+void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames)
+{
+ WKRetainPtr<WKStringRef> sourceWK = toWK(source);
+ WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld());
+
+ WKBundleAddUserScript(InjectedBundle::shared().bundle(), scriptWorld.get(), sourceWK.get(), 0, 0, 0,
+ (runAtStart ? kWKInjectAtDocumentStart : kWKInjectAtDocumentEnd),
+ (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
+}
+
+void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames)
+{
+ WKRetainPtr<WKStringRef> sourceWK = toWK(source);
+ WKRetainPtr<WKBundleScriptWorldRef> scriptWorld(AdoptWK, WKBundleScriptWorldCreateWorld());
+
+ WKBundleAddUserStyleSheet(InjectedBundle::shared().bundle(), scriptWorld.get(), sourceWK.get(), 0, 0, 0,
+ (allFrames ? kWKInjectInAllFrames : kWKInjectInTopFrameOnly));
+}
+
+void LayoutTestController::keepWebHistory()
+{
+ WKBundleSetShouldTrackVisitedLinks(InjectedBundle::shared().bundle(), true);
+}
+
+JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSValueRef element)
+{
+ // FIXME: Is it OK this works only for the main frame?
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+ if (!JSValueIsObject(context, element))
+ return JSValueMakeUndefined(context);
+ JSValueRef value = WKBundleFrameGetComputedStyleIncludingVisitedInfo(mainFrame, const_cast<JSObjectRef>(element));
+ if (!value)
+ return JSValueMakeUndefined(context);
+ return value;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::counterValueForElementById(JSStringRef elementId)
+{
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ JSObjectRef element = getElementById(mainFrame, elementId);
+ if (!element)
+ return 0;
+ WKRetainPtr<WKStringRef> value(AdoptWK, WKBundleFrameCopyCounterValue(mainFrame, const_cast<JSObjectRef>(element)));
+ return toJS(value);
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSValueRef element)
+{
+ WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page());
+ JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+ if (!element || !JSValueIsObject(context, element))
+ return 0;
+ WKRetainPtr<WKStringRef> text(AdoptWK, WKBundleFrameCopyMarkerText(mainFrame, const_cast<JSObjectRef>(element)));
+ if (WKStringIsEmpty(text.get()))
+ return 0;
+ return toJS(text);
+}
+
+void LayoutTestController::execCommand(JSStringRef name, JSStringRef argument)
+{
+ WKBundlePageExecuteEditingCommand(InjectedBundle::shared().page()->page(), toWK(name).get(), toWK(argument).get());
+}
+
+bool LayoutTestController::isCommandEnabled(JSStringRef name)
+{
+ return WKBundlePageIsEditingCommandEnabled(InjectedBundle::shared().page()->page(), toWK(name).get());
+}
+
+void LayoutTestController::setCanOpenWindows(bool)
+{
+ // It's not clear if or why any tests require opening windows be forbidden.
+ // For now, just ignore this setting, and if we find later it's needed we can add it.
+}
+
+void LayoutTestController::setXSSAuditorEnabled(bool enabled)
+{
+ WKBundleOverrideXSSAuditorEnabledForTestRunner(InjectedBundle::shared().bundle(), true);
+}
+
+unsigned LayoutTestController::windowCount()
+{
+ return InjectedBundle::shared().pageCount();
+}
+
+void LayoutTestController::clearBackForwardList()
+{
+ WKBundleBackForwardListClear(WKBundlePageGetBackForwardList(InjectedBundle::shared().page()->page()));
+}
+
+// Object Creation
+
+void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
+{
+ setProperty(context, windowObject, "layoutTestController", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
new file mode 100644
index 0000000..427d05e
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
@@ -0,0 +1,149 @@
+/*
+ * 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 LayoutTestController_h
+#define LayoutTestController_h
+
+#include "JSWrappable.h"
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <string>
+#include <wtf/PassRefPtr.h>
+
+#if PLATFORM(MAC)
+#include <wtf/RetainPtr.h>
+typedef RetainPtr<CFRunLoopTimerRef> PlatformTimerRef;
+#elif PLATFORM(WIN)
+typedef UINT_PTR PlatformTimerRef;
+#elif PLATFORM(QT)
+#include <QTimer>
+typedef QTimer PlatformTimerRef;
+#endif
+
+namespace WTR {
+
+class LayoutTestController : public JSWrappable {
+public:
+ static PassRefPtr<LayoutTestController> create();
+ virtual ~LayoutTestController();
+
+ // JSWrappable
+ virtual JSClassRef wrapperClass();
+
+ void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
+
+ // The basics.
+ void dumpAsText() { m_whatToDump = MainFrameText; }
+ void dumpChildFramesAsText() { m_whatToDump = AllFramesText; }
+ void waitUntilDone();
+ void notifyDone();
+
+ // Other dumping.
+ void dumpBackForwardList() { m_shouldDumpBackForwardListsForAllWindows = true; }
+ void dumpChildFrameScrollPositions() { m_shouldDumpAllFrameScrollPositions = true; }
+ void dumpEditingCallbacks() { m_dumpEditingCallbacks = true; }
+ void dumpSelectionRect() { } // Will need to do something when we support pixel tests.
+ void dumpStatusCallbacks() { m_dumpStatusCallbacks = true; }
+ void dumpTitleChanges() { m_dumpTitleChanges = true; }
+
+ // Special options.
+ void keepWebHistory();
+ void setAcceptsEditing(bool value) { m_shouldAllowEditing = value; }
+ void setCanOpenWindows(bool);
+ void setCloseRemainingWindowsWhenComplete(bool value) { m_shouldCloseExtraWindows = value; }
+ void setXSSAuditorEnabled(bool);
+
+ // Special DOM functions.
+ JSValueRef computedStyleIncludingVisitedInfo(JSValueRef element);
+ JSRetainPtr<JSStringRef> counterValueForElementById(JSStringRef elementId);
+ void clearBackForwardList();
+ void execCommand(JSStringRef name, JSStringRef argument);
+ bool isCommandEnabled(JSStringRef name);
+ JSRetainPtr<JSStringRef> markerTextForListItem(JSValueRef element);
+ unsigned windowCount();
+
+ // Repaint testing.
+ void testRepaint() { m_testRepaint = true; }
+ void repaintSweepHorizontally() { m_testRepaintSweepHorizontally = true; }
+ void display();
+
+ // Animation testing.
+ unsigned numberOfActiveAnimations() const;
+ bool pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId);
+ void suspendAnimations();
+ void resumeAnimations();
+
+ // Compositing testing.
+ JSRetainPtr<JSStringRef> layerTreeAsText() const;
+
+ // UserContent testing.
+ void addUserScript(JSStringRef source, bool runAtStart, bool allFrames);
+ void addUserStyleSheet(JSStringRef source, bool allFrames);
+
+ enum WhatToDump { RenderTree, MainFrameText, AllFramesText };
+ WhatToDump whatToDump() const { return m_whatToDump; }
+
+ bool shouldDumpAllFrameScrollPositions() const { return m_shouldDumpAllFrameScrollPositions; }
+ bool shouldDumpBackForwardListsForAllWindows() const { return m_shouldDumpBackForwardListsForAllWindows; }
+ bool shouldDumpEditingCallbacks() const { return m_dumpEditingCallbacks; }
+ bool shouldDumpMainFrameScrollPosition() const { return m_whatToDump == RenderTree; }
+ bool shouldDumpStatusCallbacks() const { return m_dumpStatusCallbacks; }
+ bool shouldDumpTitleChanges() const { return m_dumpTitleChanges; }
+
+ bool waitToDump() const { return m_waitToDump; }
+ void waitToDumpWatchdogTimerFired();
+ void invalidateWaitToDumpWatchdogTimer();
+
+ bool shouldAllowEditing() const { return m_shouldAllowEditing; }
+
+ bool shouldCloseExtraWindowsAfterRunningTest() const { return m_shouldCloseExtraWindows; }
+
+private:
+ static const double waitToDumpWatchdogTimerInterval;
+
+ LayoutTestController();
+
+ void platformInitialize();
+ void initializeWaitToDumpWatchdogTimerIfNeeded();
+
+ WhatToDump m_whatToDump;
+ bool m_shouldDumpAllFrameScrollPositions;
+ bool m_shouldDumpBackForwardListsForAllWindows;
+
+ bool m_shouldAllowEditing;
+ bool m_shouldCloseExtraWindows;
+
+ bool m_dumpEditingCallbacks;
+ bool m_dumpStatusCallbacks;
+ bool m_dumpTitleChanges;
+ bool m_waitToDump; // True if waitUntilDone() has been called, but notifyDone() has not yet been called.
+ bool m_testRepaint;
+ bool m_testRepaintSweepHorizontally;
+
+ PlatformTimerRef m_waitToDumpWatchdogTimer;
+};
+
+} // namespace WTR
+
+#endif // LayoutTestController_h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm b/WebKitTools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm
new file mode 100644
index 0000000..b5bc4a1
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm
@@ -0,0 +1,75 @@
+/*
+ * 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 "ActivateFonts.h"
+
+#import <AppKit/AppKit.h>
+#import <CoreFoundation/CoreFoundation.h>
+#import <Foundation/Foundation.h>
+
+@interface WKTRFontActivatorDummyClass : NSObject
+@end
+
+@implementation WKTRFontActivatorDummyClass
+@end
+
+namespace WTR {
+
+void activateFonts()
+{
+ // Work around <rdar://problem/6698023> by activating fonts from disk
+
+ static const char* fontFileNames[] = {
+ "AHEM____.TTF",
+ "ColorBits.ttf",
+ "WebKitWeightWatcher100.ttf",
+ "WebKitWeightWatcher200.ttf",
+ "WebKitWeightWatcher300.ttf",
+ "WebKitWeightWatcher400.ttf",
+ "WebKitWeightWatcher500.ttf",
+ "WebKitWeightWatcher600.ttf",
+ "WebKitWeightWatcher700.ttf",
+ "WebKitWeightWatcher800.ttf",
+ "WebKitWeightWatcher900.ttf",
+ 0
+ };
+
+ NSMutableArray *fontURLs = [NSMutableArray array];
+ NSURL *resourcesDirectory = [[NSBundle bundleForClass:[WKTRFontActivatorDummyClass class]] resourceURL];
+ for (unsigned i = 0; fontFileNames[i]; ++i) {
+ NSURL *fontURL = [resourcesDirectory URLByAppendingPathComponent:[NSString stringWithUTF8String:fontFileNames[i]]];
+ [fontURLs addObject:[fontURL absoluteURL]];
+ }
+
+ CFArrayRef errors = 0;
+ if (!CTFontManagerRegisterFontsForURLs((CFArrayRef)fontURLs, kCTFontManagerScopeProcess, &errors)) {
+ NSLog(@"Failed to activate fonts: %@", errors);
+ CFRelease(errors);
+ exit(1);
+ }
+}
+
+}
+
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm b/WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm
new file mode 100644
index 0000000..2eb4d5b
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm
@@ -0,0 +1,59 @@
+/*
+ * 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 "LayoutTestController.h"
+
+#include "InjectedBundle.h"
+
+namespace WTR {
+
+void LayoutTestController::platformInitialize()
+{
+}
+
+void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+{
+ if (!m_waitToDumpWatchdogTimer)
+ return;
+
+ CFRunLoopTimerInvalidate(m_waitToDumpWatchdogTimer.get());
+ m_waitToDumpWatchdogTimer = 0;
+}
+
+static void waitUntilDoneWatchdogTimerFired(CFRunLoopTimerRef timer, void* info)
+{
+ InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+}
+
+void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+{
+ if (m_waitToDumpWatchdogTimer)
+ return;
+
+ m_waitToDumpWatchdogTimer.adoptCF(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogTimerInterval, 0, 0, 0, WTR::waitUntilDoneWatchdogTimerFired, NULL));
+ CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_waitToDumpWatchdogTimer.get(), kCFRunLoopCommonModes);
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp
new file mode 100644
index 0000000..ec920dc
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "ActivateFonts.h"
+
+#include <QByteArray>
+#include <QDir>
+
+#ifdef Q_WS_X11
+#include <fontconfig/fontconfig.h>
+#endif
+
+#include <limits.h>
+
+namespace WTR {
+
+void activateFonts()
+{
+#if defined(Q_WS_X11)
+ static int numFonts = -1;
+
+ // Some test cases may add or remove application fonts (via @font-face).
+ // Make sure to re-initialize the font set if necessary.
+ FcFontSet* appFontSet = FcConfigGetFonts(0, FcSetApplication);
+ if (appFontSet && numFonts >= 0 && appFontSet->nfont == numFonts)
+ return;
+
+ QByteArray fontDir = getenv("WEBKIT_TESTFONTS");
+ if (fontDir.isEmpty() || !QDir(fontDir).exists()) {
+ fprintf(stderr,
+ "\n\n"
+ "----------------------------------------------------------------------\n"
+ "WEBKIT_TESTFONTS environment variable is not set correctly.\n"
+ "This variable has to point to the directory containing the fonts\n"
+ "you can clone from git://gitorious.org/qtwebkit/testfonts.git\n"
+ "----------------------------------------------------------------------\n"
+ );
+ exit(1);
+ }
+ char currentPath[PATH_MAX+1];
+ if (!getcwd(currentPath, PATH_MAX))
+ qFatal("Couldn't get current working directory");
+ QByteArray configFile = currentPath;
+ FcConfig* config = FcConfigCreate();
+ configFile += "/WebKitTools/DumpRenderTree/qt/fonts.conf";
+ if (!FcConfigParseAndLoad (config, (FcChar8*) configFile.data(), true))
+ qFatal("Couldn't load font configuration file");
+ if (!FcConfigAppFontAddDir (config, (FcChar8*) fontDir.data()))
+ qFatal("Couldn't add font dir!");
+ FcConfigSetCurrent(config);
+
+ appFontSet = FcConfigGetFonts(config, FcSetApplication);
+ numFonts = appFontSet->nfont;
+#endif
+}
+
+}
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro b/WebKitTools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro
new file mode 100644
index 0000000..d596f33
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/qt/InjectedBundle.pro
@@ -0,0 +1,69 @@
+TEMPLATE = lib
+
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../../..
+
+SOURCES += \
+ ../InjectedBundle.cpp \
+ ../InjectedBundle.h \
+ ../InjectedBundleMain.cpp \
+ ../InjectedBundlePage.cpp \
+ ../InjectedBundlePage.h \
+ ../EventSendingController.cpp \
+ ../EventSendingController.h \
+ ../GCController.cpp \
+ ../GCController.h \
+ ../LayoutTestController.cpp \
+ ../LayoutTestController.h \
+ ../Bindings/JSWrapper.cpp \
+ ActivateFontsQt.cpp \
+ LayoutTestControllerQt.cpp \
+ $$OUTPUT_DIR/WebKitTools/WebKitTestRunner/generated/JSEventSendingController.cpp \
+ $$OUTPUT_DIR/WebKitTools/WebKitTestRunner/generated/JSGCController.cpp \
+ $$OUTPUT_DIR/WebKitTools/WebKitTestRunner/generated/JSLayoutTestController.cpp \
+
+HEADERS += \
+ ../ActivateFonts.h \
+ ../EventSendingController.h \
+ ../GCController.h \
+ ../InjectedBundle.h \
+ ../InjectedBundlePage.h \
+ ../LayoutTestController.h \
+
+!CONFIG(release, debug|release) {
+ OBJECTS_DIR = obj/debug
+} else { # Release
+ OBJECTS_DIR = obj/release
+}
+
+include(../../../../WebKit.pri)
+include(../../../../JavaScriptCore/JavaScriptCore.pri)
+addJavaScriptCoreLib(../../../../JavaScriptCore)
+include(../../../../WebKit2/WebKit2.pri)
+addWebKit2Lib(../../../../WebKit2)
+
+INCLUDEPATH += \
+ $$PWD \
+ $$PWD/.. \
+ $$PWD/../.. \
+ $$PWD/../Bindings \
+ $$PWD/../../../../JavaScriptCore \
+ $$PWD/../../../../JavaScriptCore/wtf \
+ $$PWD/../../../../WebKit2 \
+ $$PWD/../../../../WebKit2/Shared \
+ $$OUTPUT_DIR/WebKitTools/WebKitTestRunner/generated
+
+INCLUDEPATH += \
+ $$OUTPUT_DIR/include \
+ $$OUTPUT_DIR/WebCore/generated
+
+PREFIX_HEADER = $$PWD/../../WebKitTestRunnerPrefix.h
+QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
+
+unix:!mac {
+ CONFIG += link_pkgconfig
+ PKGCONFIG += fontconfig
+}
+
+TARGET = WTRInjectedBundle
+DESTDIR = $$OUTPUT_DIR/lib
+!CONFIG(standalone_package): CONFIG -= app_bundle
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp
new file mode 100644
index 0000000..b515326
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged. 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 "LayoutTestController.h"
+
+#include "InjectedBundle.h"
+#include <QObject>
+
+namespace WTR {
+
+class WatchdogTimerHelper : public QObject {
+ Q_OBJECT
+
+public:
+ static WatchdogTimerHelper* instance()
+ {
+ static WatchdogTimerHelper* theInstance = new WatchdogTimerHelper;
+ return theInstance;
+ }
+
+public slots:
+ void timerFired()
+ {
+ InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+ }
+
+private:
+ WatchdogTimerHelper() {}
+};
+
+void LayoutTestController::platformInitialize()
+{
+ QObject::connect(&m_waitToDumpWatchdogTimer, SIGNAL(timeout()), WatchdogTimerHelper::instance(), SLOT(timerFired()));
+}
+
+void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+{
+ m_waitToDumpWatchdogTimer.stop();
+}
+
+void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+{
+ if (m_waitToDumpWatchdogTimer.isActive())
+ return;
+
+ m_waitToDumpWatchdogTimer.start(waitToDumpWatchdogTimerInterval * 1000);
+}
+
+} // namespace WTR
+
+#include "LayoutTestControllerQt.moc"
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp
new file mode 100644
index 0000000..d9f08c9
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/win/ActivateFonts.cpp
@@ -0,0 +1,107 @@
+/*
+ * 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 "ActivateFonts.h"
+
+#include <string>
+#include <wtf/Vector.h>
+
+static LPCWSTR fontsEnvironmentVariable = L"WEBKIT_TESTFONTS";
+
+namespace WTR {
+
+using namespace std;
+
+static const wstring& fontsPath()
+{
+ static wstring path;
+ static bool initialized;
+
+ if (initialized)
+ return path;
+ initialized = true;
+
+ DWORD size = ::GetEnvironmentVariableW(fontsEnvironmentVariable, 0, 0);
+ Vector<WCHAR> buffer(size);
+ if (!::GetEnvironmentVariableW(fontsEnvironmentVariable, buffer.data(), buffer.size()))
+ return path;
+
+ path = buffer.data();
+ if (path[path.length() - 1] != '\\')
+ path.append(L"\\");
+
+ return path;
+}
+
+
+void activateFonts()
+{
+ static LPCWSTR fontsToInstall[] = {
+ TEXT("AHEM____.ttf"),
+ TEXT("Apple Chancery.ttf"),
+ TEXT("Courier Bold.ttf"),
+ TEXT("Courier.ttf"),
+ TEXT("Helvetica Bold Oblique.ttf"),
+ TEXT("Helvetica Bold.ttf"),
+ TEXT("Helvetica Oblique.ttf"),
+ TEXT("Helvetica.ttf"),
+ TEXT("Helvetica Neue Bold Italic.ttf"),
+ TEXT("Helvetica Neue Bold.ttf"),
+ TEXT("Helvetica Neue Condensed Black.ttf"),
+ TEXT("Helvetica Neue Condensed Bold.ttf"),
+ TEXT("Helvetica Neue Italic.ttf"),
+ TEXT("Helvetica Neue Light Italic.ttf"),
+ TEXT("Helvetica Neue Light.ttf"),
+ TEXT("Helvetica Neue UltraLight Italic.ttf"),
+ TEXT("Helvetica Neue UltraLight.ttf"),
+ TEXT("Helvetica Neue.ttf"),
+ TEXT("Lucida Grande.ttf"),
+ TEXT("Lucida Grande Bold.ttf"),
+ TEXT("Monaco.ttf"),
+ TEXT("Papyrus.ttf"),
+ TEXT("Times Bold Italic.ttf"),
+ TEXT("Times Bold.ttf"),
+ TEXT("Times Italic.ttf"),
+ TEXT("Times Roman.ttf"),
+ TEXT("WebKit Layout Tests 2.ttf"),
+ TEXT("WebKit Layout Tests.ttf"),
+ TEXT("WebKitWeightWatcher100.ttf"),
+ TEXT("WebKitWeightWatcher200.ttf"),
+ TEXT("WebKitWeightWatcher300.ttf"),
+ TEXT("WebKitWeightWatcher400.ttf"),
+ TEXT("WebKitWeightWatcher500.ttf"),
+ TEXT("WebKitWeightWatcher600.ttf"),
+ TEXT("WebKitWeightWatcher700.ttf"),
+ TEXT("WebKitWeightWatcher800.ttf"),
+ TEXT("WebKitWeightWatcher900.ttf")
+ };
+
+ wstring resourcesPath = fontsPath();
+
+ for (unsigned i = 0; i < ARRAYSIZE(fontsToInstall); ++i)
+ ::AddFontResourceExW(wstring(resourcesPath + fontsToInstall[i]).c_str(), FR_PRIVATE, 0);
+}
+
+}
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp
new file mode 100644
index 0000000..39cd727
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp
@@ -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.
+ */
+
+#include "LayoutTestController.h"
+
+#include "InjectedBundle.h"
+
+namespace WTR {
+
+void LayoutTestController::platformInitialize()
+{
+ m_waitToDumpWatchdogTimer = 0;
+}
+
+void LayoutTestController::invalidateWaitToDumpWatchdogTimer()
+{
+ if (!m_waitToDumpWatchdogTimer)
+ return;
+
+ ::KillTimer(0, m_waitToDumpWatchdogTimer);
+ m_waitToDumpWatchdogTimer = 0;
+}
+
+static void CALLBACK waitToDumpWatchdogTimerFired(HWND, UINT, UINT_PTR, DWORD)
+{
+ InjectedBundle::shared().layoutTestController()->waitToDumpWatchdogTimerFired();
+}
+
+static const UINT_PTR waitToDumpWatchdogTimerIdentifier = 1;
+
+void LayoutTestController::initializeWaitToDumpWatchdogTimerIfNeeded()
+{
+ if (m_waitToDumpWatchdogTimer)
+ return;
+
+ m_waitToDumpWatchdogTimer = ::SetTimer(0, waitToDumpWatchdogTimerIdentifier, waitToDumpWatchdogTimerInterval * 1000, WTR::waitToDumpWatchdogTimerFired);
+}
+
+} // namespace WTR
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..72de868
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/PlatformWebView.h
@@ -0,0 +1,73 @@
+/*
+ * 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 defined(BUILDING_QT__)
+namespace WTR {
+class WebView;
+}
+typedef WTR::WebView* PlatformWKView;
+class QMainWindow;
+typedef QMainWindow* PlatformWindow;
+#elif defined(__APPLE__) && __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; }
+ void resizeTo(unsigned width, unsigned height);
+ void focus();
+
+ WKRect windowFrame();
+ void setWindowFrame(WKRect);
+
+private:
+ PlatformWKView m_view;
+ PlatformWindow m_window;
+};
+
+} // namespace WTR
+
+#endif // PlatformWebView_h
diff --git a/WebKitTools/WebKitTestRunner/StringFunctions.h b/WebKitTools/WebKitTestRunner/StringFunctions.h
new file mode 100644
index 0000000..2d0ca72
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/StringFunctions.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged. 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 StringFunctions_h
+#define StringFunctions_h
+
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <JavaScriptCore/JavaScript.h>
+#include <sstream>
+#include <string>
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WKString.h>
+#include <WebKit2/WKStringPrivate.h>
+#include <WebKit2/WKURL.h>
+#include <wtf/OwnArrayPtr.h>
+#include <wtf/PassOwnArrayPtr.h>
+#include <wtf/Platform.h>
+#include <wtf/Vector.h>
+
+namespace WTR {
+
+// Conversion functions
+
+inline WKRetainPtr<WKStringRef> toWK(JSStringRef string)
+{
+ return WKRetainPtr<WKStringRef>(AdoptWK, WKStringCreateWithJSString(string));
+}
+
+inline WKRetainPtr<WKStringRef> toWK(JSRetainPtr<JSStringRef> string)
+{
+ return toWK(string.get());
+}
+
+inline JSRetainPtr<JSStringRef> toJS(WKStringRef string)
+{
+ return JSRetainPtr<JSStringRef>(Adopt, WKStringCopyJSString(string));
+}
+
+inline JSRetainPtr<JSStringRef> toJS(const WKRetainPtr<WKStringRef>& string)
+{
+ return toJS(string.get());
+}
+
+inline std::string toSTD(WKStringRef string)
+{
+ size_t bufferSize = WKStringGetMaximumUTF8CStringSize(string);
+ OwnArrayPtr<char> buffer = adoptArrayPtr(new char[bufferSize]);
+ size_t stringLength = WKStringGetUTF8CString(string, buffer.get(), bufferSize);
+ return std::string(buffer.get(), stringLength - 1);
+}
+
+inline std::string toSTD(const WKRetainPtr<WKStringRef>& string)
+{
+ return toSTD(string.get());
+}
+
+// Streaming functions
+
+inline std::ostream& operator<<(std::ostream& out, WKStringRef stringRef)
+{
+ if (!stringRef)
+ return out;
+
+ return out << toSTD(stringRef);
+}
+
+inline std::ostream& operator<<(std::ostream& out, const WKRetainPtr<WKStringRef>& stringRef)
+{
+ return out << stringRef.get();
+}
+
+} // namespace WTR
+
+#endif // StringFunctions_h
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
new file mode 100644
index 0000000..3fc92f2
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -0,0 +1,394 @@
+/*
+ * 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 "PlatformWebView.h"
+#include "StringFunctions.h"
+#include "TestInvocation.h"
+#include <cstdio>
+#include <WebKit2/WKContextPrivate.h>
+#include <WebKit2/WKPreferencesPrivate.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WTR {
+
+static const double defaultLongTimeout = 30;
+static const double defaultShortTimeout = 5;
+
+static WKURLRef blankURL()
+{
+ static WKURLRef staticBlankURL = WKURLCreateWithUTF8CString("about:blank");
+ return staticBlankURL;
+}
+
+static TestController* controller;
+
+TestController& TestController::shared()
+{
+ ASSERT(controller);
+ return *controller;
+}
+
+TestController::TestController(int argc, const char* argv[])
+ : m_dumpPixels(false)
+ , m_verbose(false)
+ , m_printSeparators(false)
+ , m_usingServerMode(false)
+ , m_state(Initial)
+ , m_doneResetting(false)
+ , m_longTimeout(defaultLongTimeout)
+ , m_shortTimeout(defaultShortTimeout)
+{
+ initialize(argc, argv);
+ controller = this;
+ run();
+ controller = 0;
+}
+
+TestController::~TestController()
+{
+}
+
+static WKRect getWindowFrameMainPage(WKPageRef page, const void* clientInfo)
+{
+ PlatformWebView* view = static_cast<TestController*>(const_cast<void*>(clientInfo))->mainWebView();
+ return view->windowFrame();
+}
+
+static void setWindowFrameMainPage(WKPageRef page, WKRect frame, const void* clientInfo)
+{
+ PlatformWebView* view = static_cast<TestController*>(const_cast<void*>(clientInfo))->mainWebView();
+ view->setWindowFrame(frame);
+}
+
+static WKRect getWindowFrameOtherPage(WKPageRef page, const void* clientInfo)
+{
+ PlatformWebView* view = static_cast<PlatformWebView*>(const_cast<void*>(clientInfo));
+ return view->windowFrame();
+}
+
+static void setWindowFrameOtherPage(WKPageRef page, WKRect frame, const void* clientInfo)
+{
+ PlatformWebView* view = static_cast<PlatformWebView*>(const_cast<void*>(clientInfo));
+ view->setWindowFrame(frame);
+}
+
+static void closeOtherPage(WKPageRef page, const void* clientInfo)
+{
+ WKPageClose(page);
+ const PlatformWebView* view = static_cast<const PlatformWebView*>(clientInfo);
+ delete view;
+}
+
+static WKPageRef createOtherPage(WKPageRef oldPage, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*)
+{
+ PlatformWebView* view = new PlatformWebView(WKPageGetPageNamespace(oldPage));
+ WKPageRef newPage = view->page();
+
+ view->resizeTo(800, 600);
+
+ WKPageUIClient otherPageUIClient = {
+ 0,
+ view,
+ createOtherPage,
+ 0, // showPage
+ closeOtherPage,
+ 0, // runJavaScriptAlert
+ 0, // runJavaScriptConfirm
+ 0, // runJavaScriptPrompt
+ 0, // setStatusText
+ 0, // mouseDidMoveOverElement
+ 0, // didNotHandleKeyEvent
+ 0, // toolbarsAreVisible
+ 0, // setToolbarsAreVisible
+ 0, // menuBarIsVisible
+ 0, // setMenuBarIsVisible
+ 0, // statusBarIsVisible
+ 0, // setStatusBarIsVisible
+ 0, // isResizable
+ 0, // setIsResizable
+ getWindowFrameOtherPage,
+ setWindowFrameOtherPage,
+ 0, // runBeforeUnloadConfirmPanel
+ 0, // didDraw
+ 0 // pageDidScroll
+ };
+ WKPageSetPageUIClient(newPage, &otherPageUIClient);
+
+ WKRetain(newPage);
+ return newPage;
+}
+
+void TestController::initialize(int argc, const char* argv[])
+{
+ platformInitialize();
+
+ bool printSupportedFeatures = false;
+
+ for (int i = 1; i < argc; ++i) {
+ std::string argument(argv[i]);
+
+ if (argument == "--timeout" && i + 1 < argc) {
+ m_longTimeout = atoi(argv[++i]);
+ // Scale up the short timeout to match.
+ m_shortTimeout = defaultShortTimeout * m_longTimeout / defaultLongTimeout;
+ continue;
+ }
+ if (argument == "--pixel-tests") {
+ m_dumpPixels = true;
+ continue;
+ }
+ if (argument == "--verbose") {
+ m_verbose = true;
+ continue;
+ }
+ if (argument == "--print-supported-features") {
+ printSupportedFeatures = true;
+ break;
+ }
+
+ // Skip any other arguments that begin with '--'.
+ if (argument.length() >= 2 && argument[0] == '-' && argument[1] == '-')
+ continue;
+
+ m_paths.push_back(argument);
+ }
+
+ if (printSupportedFeatures) {
+ // FIXME: On Windows, DumpRenderTree uses this to expose whether it supports 3d
+ // transforms and accelerated compositing. When we support those features, we
+ // should match DRT's behavior.
+ exit(0);
+ }
+
+ m_usingServerMode = (m_paths.size() == 1 && m_paths[0] == "-");
+ if (m_usingServerMode)
+ m_printSeparators = true;
+ else
+ m_printSeparators = m_paths.size() > 1;
+
+ initializeInjectedBundlePath();
+ initializeTestPluginDirectory();
+
+ m_context.adopt(WKContextCreateWithInjectedBundlePath(injectedBundlePath()));
+ platformInitializeContext();
+
+ WKContextInjectedBundleClient injectedBundleClient = {
+ 0,
+ this,
+ didReceiveMessageFromInjectedBundle,
+ didReceiveSynchronousMessageFromInjectedBundle
+ };
+ WKContextSetInjectedBundleClient(m_context.get(), &injectedBundleClient);
+
+ _WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory());
+
+ m_pageNamespace.adopt(WKPageNamespaceCreate(m_context.get()));
+ m_mainWebView = adoptPtr(new PlatformWebView(m_pageNamespace.get()));
+
+ WKPageUIClient pageUIClient = {
+ 0,
+ this,
+ createOtherPage,
+ 0, // showPage
+ 0, // close
+ 0, // runJavaScriptAlert
+ 0, // runJavaScriptConfirm
+ 0, // runJavaScriptPrompt
+ 0, // setStatusText
+ 0, // mouseDidMoveOverElement
+ 0, // didNotHandleKeyEvent
+ 0, // toolbarsAreVisible
+ 0, // setToolbarsAreVisible
+ 0, // menuBarIsVisible
+ 0, // setMenuBarIsVisible
+ 0, // statusBarIsVisible
+ 0, // setStatusBarIsVisible
+ 0, // isResizable
+ 0, // setIsResizable
+ getWindowFrameMainPage,
+ setWindowFrameMainPage,
+ 0, // runBeforeUnloadConfirmPanel
+ 0, // didDraw
+ 0 // pageDidScroll
+ };
+ WKPageSetPageUIClient(m_mainWebView->page(), &pageUIClient);
+
+ WKPageLoaderClient pageLoaderClient = {
+ 0,
+ this,
+ 0, // didStartProvisionalLoadForFrame
+ 0, // didReceiveServerRedirectForProvisionalLoadForFrame
+ 0, // didFailProvisionalLoadWithErrorForFrame
+ 0, // didCommitLoadForFrame
+ 0, // didFinishDocumentLoadForFrame
+ didFinishLoadForFrame,
+ 0, // didFailLoadWithErrorForFrame
+ 0, // didReceiveTitleForFrame
+ 0, // didFirstLayoutForFrame
+ 0, // didFirstVisuallyNonEmptyLayoutForFrame
+ 0, // didRemoveFrameFromHierarchy
+ 0, // didDisplayInsecureContentForFrame
+ 0, // didRunInsecureContentForFrame
+ 0, // didStartProgress
+ 0, // didChangeProgress
+ 0, // didFinishProgress
+ 0, // didBecomeUnresponsive
+ 0, // didBecomeResponsive
+ 0, // processDidExit
+ 0 // didChangeBackForwardList
+ };
+ WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);
+}
+
+bool TestController::resetStateToConsistentValues()
+{
+ m_state = Resetting;
+
+ // FIXME: This function should also ensure that there is only one page open.
+
+ // Reset preferences
+ WKPreferencesRef preferences = WKContextGetPreferences(m_context.get());
+ WKPreferencesSetOfflineWebApplicationCacheEnabled(preferences, true);
+ WKPreferencesSetFontSmoothingLevel(preferences, kWKFontSmoothingLevelNoSubpixelAntiAliasing);
+ WKPreferencesSetXSSAuditorEnabled(preferences, false);
+
+ static WKStringRef standardFontFamily = WKStringCreateWithUTF8CString("Times");
+ static WKStringRef cursiveFontFamily = WKStringCreateWithUTF8CString("Apple Chancery");
+ static WKStringRef fantasyFontFamily = WKStringCreateWithUTF8CString("Papyrus");
+ static WKStringRef fixedFontFamily = WKStringCreateWithUTF8CString("Courier");
+ static WKStringRef sansSerifFontFamily = WKStringCreateWithUTF8CString("Helvetica");
+ static WKStringRef serifFontFamily = WKStringCreateWithUTF8CString("Times");
+
+ WKPreferencesSetStandardFontFamily(preferences, standardFontFamily);
+ WKPreferencesSetCursiveFontFamily(preferences, cursiveFontFamily);
+ WKPreferencesSetFantasyFontFamily(preferences, fantasyFontFamily);
+ WKPreferencesSetFixedFontFamily(preferences, fixedFontFamily);
+ WKPreferencesSetSansSerifFontFamily(preferences, sansSerifFontFamily);
+ WKPreferencesSetSerifFontFamily(preferences, serifFontFamily);
+
+ m_mainWebView->focus();
+
+ // Reset main page back to about:blank
+ m_doneResetting = false;
+
+ WKPageLoadURL(m_mainWebView->page(), blankURL());
+ runUntil(m_doneResetting, ShortTimeout);
+ return m_doneResetting;
+}
+
+bool TestController::runTest(const char* test)
+{
+ if (!resetStateToConsistentValues())
+ return false;
+
+ m_state = RunningTest;
+ m_currentInvocation.set(new TestInvocation(test));
+ m_currentInvocation->invoke();
+ m_currentInvocation.clear();
+
+ return true;
+}
+
+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;
+
+ if (!runTest(filenameBuffer))
+ break;
+ }
+}
+
+void TestController::run()
+{
+ if (m_usingServerMode)
+ runTestingServerLoop();
+ else {
+ for (size_t i = 0; i < m_paths.size(); ++i) {
+ if (!runTest(m_paths[i].c_str()))
+ break;
+ }
+ }
+}
+
+void TestController::runUntil(bool& done, TimeoutDuration timeoutDuration)
+{
+ platformRunUntil(done, timeoutDuration == ShortTimeout ? m_shortTimeout : m_longTimeout);
+}
+
+// WKContextInjectedBundleClient
+
+void TestController::didReceiveMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, const void* clientInfo)
+{
+ static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveMessageFromInjectedBundle(messageName, messageBody);
+}
+
+void TestController::didReceiveSynchronousMessageFromInjectedBundle(WKContextRef context, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void* clientInfo)
+{
+ *returnData = static_cast<TestController*>(const_cast<void*>(clientInfo))->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody).leakRef();
+}
+
+void TestController::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
+{
+ m_currentInvocation->didReceiveMessageFromInjectedBundle(messageName, messageBody);
+}
+
+WKRetainPtr<WKTypeRef> TestController::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
+{
+ return m_currentInvocation->didReceiveSynchronousMessageFromInjectedBundle(messageName, messageBody);
+}
+
+// WKPageLoaderClient
+
+void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef, const void* clientInfo)
+{
+ static_cast<TestController*>(const_cast<void*>(clientInfo))->didFinishLoadForFrame(page, frame);
+}
+
+void TestController::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame)
+{
+ if (m_state != Resetting)
+ return;
+
+ if (!WKFrameIsMainFrame(frame))
+ return;
+
+ WKRetainPtr<WKURLRef> wkURL(AdoptWK, WKFrameCopyURL(frame));
+ if (!WKURLIsEqual(wkURL.get(), blankURL()))
+ return;
+
+ m_doneResetting = true;
+ shared().notifyDone();
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
new file mode 100644
index 0000000..4c05bf4
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -0,0 +1,115 @@
+/*
+ * 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>
+#include <wtf/OwnPtr.h>
+
+namespace WTR {
+
+class TestInvocation;
+class PlatformWebView;
+
+// FIXME: Rename this TestRunner?
+class TestController {
+public:
+ static TestController& shared();
+
+ TestController(int argc, const char* argv[]);
+ ~TestController();
+
+ bool verbose() const { return m_verbose; }
+
+ WKStringRef injectedBundlePath() { return m_injectedBundlePath.get(); }
+ WKStringRef testPluginDirectory() { return m_testPluginDirectory.get(); }
+
+ PlatformWebView* mainWebView() { return m_mainWebView.get(); }
+ WKPageNamespaceRef pageNamespace() { return m_pageNamespace.get(); }
+ WKContextRef context() { return m_context.get(); }
+
+ // Runs the run loop until `done` is true or the timeout elapses.
+ enum TimeoutDuration { ShortTimeout, LongTimeout };
+ void runUntil(bool& done, TimeoutDuration);
+ void notifyDone();
+
+private:
+ void initialize(int argc, const char* argv[]);
+ void run();
+
+ void runTestingServerLoop();
+ bool runTest(const char* pathOrURL);
+
+ void platformInitialize();
+ void platformInitializeContext();
+ void platformRunUntil(bool& done, double timeout);
+ void initializeInjectedBundlePath();
+ void initializeTestPluginDirectory();
+
+ bool resetStateToConsistentValues();
+
+ // WKContextInjectedBundleClient
+ static void didReceiveMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, const void*);
+ static void didReceiveSynchronousMessageFromInjectedBundle(WKContextRef, WKStringRef messageName, WKTypeRef messageBody, WKTypeRef* returnData, const void*);
+ void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
+ WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
+
+ // WKPageLoaderClient
+ static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void*);
+ void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame);
+
+
+ OwnPtr<TestInvocation> m_currentInvocation;
+
+ bool m_dumpPixels;
+ bool m_verbose;
+ bool m_printSeparators;
+ bool m_usingServerMode;
+ std::vector<std::string> m_paths;
+ WKRetainPtr<WKStringRef> m_injectedBundlePath;
+ WKRetainPtr<WKStringRef> m_testPluginDirectory;
+
+ OwnPtr<PlatformWebView> m_mainWebView;
+ WKRetainPtr<WKContextRef> m_context;
+ WKRetainPtr<WKPageNamespaceRef> m_pageNamespace;
+
+ enum State {
+ Initial,
+ Resetting,
+ RunningTest
+ };
+ State m_state;
+ bool m_doneResetting;
+
+ double m_longTimeout;
+ double m_shortTimeout;
+};
+
+} // namespace WTR
+
+#endif // TestController_h
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
new file mode 100644
index 0000000..26ecfc0
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
@@ -0,0 +1,202 @@
+/*
+ * 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 "PlatformWebView.h"
+#include "StringFunctions.h"
+#include "TestController.h"
+#include <climits>
+#include <cstdio>
+#include <WebKit2/WKContextPrivate.h>
+#include <WebKit2/WKRetainPtr.h>
+#include <wtf/OwnArrayPtr.h>
+#include <wtf/PassOwnArrayPtr.h>
+
+#if OS(WINDOWS)
+#include <direct.h> // For _getcwd.
+#define getcwd _getcwd // MSDN says getcwd is deprecated.
+#define PATH_MAX _MAX_PATH
+#endif
+
+using namespace WebKit;
+using namespace std;
+
+namespace WTR {
+
+static WKURLRef createWKURL(const char* pathOrURL)
+{
+ if (strstr(pathOrURL, "http://") || strstr(pathOrURL, "https://") || strstr(pathOrURL, "file://"))
+ return WKURLCreateWithUTF8CString(pathOrURL);
+
+ // Creating from filesytem path.
+ size_t length = strlen(pathOrURL);
+ if (!length)
+ return 0;
+
+ const char* filePrefix = "file://";
+ static const size_t prefixLength = strlen(filePrefix);
+#if OS(WINDOWS)
+ const char separator = '\\';
+ bool isAbsolutePath = length >= 3 && pathOrURL[1] == ':' && pathOrURL[2] == separator;
+#else
+ const char separator = '/';
+ bool isAbsolutePath = pathOrURL[0] == separator;
+#endif
+
+ OwnArrayPtr<char> buffer;
+ if (isAbsolutePath) {
+ buffer = adoptArrayPtr(new char[prefixLength + length + 1]);
+ strcpy(buffer.get(), filePrefix);
+ strcpy(buffer.get() + prefixLength, pathOrURL);
+ } else {
+ buffer = adoptArrayPtr(new char[prefixLength + PATH_MAX + length + 2]); // 1 for the separator
+ strcpy(buffer.get(), filePrefix);
+ if (!getcwd(buffer.get() + prefixLength, PATH_MAX))
+ return 0;
+ size_t numCharacters = strlen(buffer.get());
+ buffer[numCharacters] = separator;
+ strcpy(buffer.get() + numCharacters + 1, pathOrURL);
+ }
+
+ return WKURLCreateWithUTF8CString(buffer.get());
+}
+
+TestInvocation::TestInvocation(const char* pathOrURL)
+ : m_url(AdoptWK, createWKURL(pathOrURL))
+ , m_pathOrURL(fastStrDup(pathOrURL))
+ , m_gotInitialResponse(false)
+ , m_gotFinalMessage(false)
+ , m_error(false)
+{
+}
+
+TestInvocation::~TestInvocation()
+{
+ fastFree(m_pathOrURL);
+}
+
+static const unsigned w3cSVGWidth = 480;
+static const unsigned w3cSVGHeight = 360;
+static const unsigned normalWidth = 800;
+static const unsigned normalHeight = 600;
+
+static void sizeWebViewForCurrentTest(char* pathOrURL)
+{
+ bool isSVGW3CTest = strstr(pathOrURL, "svg/W3C-SVG-1.1") || strstr(pathOrURL, "svg\\W3C-SVG-1.1");
+
+ if (isSVGW3CTest)
+ TestController::shared().mainWebView()->resizeTo(w3cSVGWidth, w3cSVGHeight);
+ else
+ TestController::shared().mainWebView()->resizeTo(normalWidth, normalHeight);
+}
+
+void TestInvocation::invoke()
+{
+ sizeWebViewForCurrentTest(m_pathOrURL);
+
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("BeginTest"));
+ WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), 0);
+
+ TestController::shared().runUntil(m_gotInitialResponse, TestController::ShortTimeout);
+ if (!m_gotInitialResponse) {
+ dump("Timed out waiting for initial response from web process\n");
+ return;
+ }
+ if (m_error) {
+ dump("FAIL\n");
+ return;
+ }
+
+ WKPageLoadURL(TestController::shared().mainWebView()->page(), m_url.get());
+
+ TestController::shared().runUntil(m_gotFinalMessage, TestController::LongTimeout);
+ if (!m_gotFinalMessage) {
+ dump("Timed out waiting for final message from web process\n");
+ return;
+ }
+ if (m_error) {
+ dump("FAIL\n");
+ return;
+ }
+}
+
+void TestInvocation::dump(const char* stringToDump)
+{
+ printf("Content-Type: text/plain\n");
+ printf("%s", stringToDump);
+
+ fputs("#EOF\n", stdout);
+ fputs("#EOF\n", stdout);
+ fputs("#EOF\n", stderr);
+
+ fflush(stdout);
+ fflush(stderr);
+}
+
+void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody)
+{
+ if (WKStringIsEqualToUTF8CString(messageName, "Error")) {
+ // Set all states to true to stop spinning the runloop.
+ m_gotInitialResponse = true;
+ m_gotFinalMessage = true;
+ m_error = true;
+ TestController::shared().notifyDone();
+ return;
+ }
+
+ if (WKStringIsEqualToUTF8CString(messageName, "Ack")) {
+ ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
+ WKStringRef messageBodyString = static_cast<WKStringRef>(messageBody);
+ if (WKStringIsEqualToUTF8CString(messageBodyString, "BeginTest")) {
+ m_gotInitialResponse = true;
+ TestController::shared().notifyDone();
+ return;
+ }
+
+ ASSERT_NOT_REACHED();
+ }
+
+ if (WKStringIsEqualToUTF8CString(messageName, "Done")) {
+ ASSERT(WKGetTypeID(messageBody) == WKStringGetTypeID());
+ WKStringRef messageBodyString = static_cast<WKStringRef>(messageBody);
+
+ dump(toSTD(messageBodyString).c_str());
+
+ m_gotFinalMessage = true;
+ TestController::shared().notifyDone();
+ return;
+ }
+
+ ASSERT_NOT_REACHED();
+}
+
+WKRetainPtr<WKTypeRef> TestInvocation::didReceiveSynchronousMessageFromInjectedBundle(WKStringRef /*messageName*/, WKTypeRef /*messageBody*/)
+{
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.h b/WebKitTools/WebKitTestRunner/TestInvocation.h
new file mode 100644
index 0000000..fec1f7a
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.h
@@ -0,0 +1,57 @@
+/*
+ * 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 <WebKit2/WKRetainPtr.h>
+#include <wtf/Noncopyable.h>
+
+namespace WTR {
+
+class TestInvocation : public Noncopyable {
+public:
+ TestInvocation(const char*);
+ ~TestInvocation();
+
+ void invoke();
+ void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
+ WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
+
+private:
+ void dump(const char*);
+
+ WKRetainPtr<WKURLRef> m_url;
+ char* m_pathOrURL;
+
+ // Invocation state
+ bool m_gotInitialResponse;
+ bool m_gotFinalMessage;
+ bool m_error;
+};
+
+} // namespace WTR
+
+#endif // TestInvocation_h
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.pro b/WebKitTools/WebKitTestRunner/WebKitTestRunner.pro
new file mode 100644
index 0000000..677abb3
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+
+SUBDIRS = qt/WebKitTestRunner.pro \
+ InjectedBundle/qt/InjectedBundle.pro \
+
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.sln b/WebKitTools/WebKitTestRunner/WebKitTestRunner.sln
new file mode 100644
index 0000000..320a6f9
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.sln
@@ -0,0 +1,91 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitTestRunner", "win\WebKitTestRunner.vcproj", "{3B99669B-1817-443B-BCBE-835580146668}"
+ ProjectSection(ProjectDependencies) = postProject
+ {CBC3391C-F060-4BF5-A66E-81404168816B} = {CBC3391C-F060-4BF5-A66E-81404168816B}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InjectedBundleGenerated", "win\InjectedBundleGenerated.vcproj", "{4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}"
+ ProjectSection(ProjectDependencies) = postProject
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C} = {C0737398-3565-439E-A2B8-AB2BE4D5430C}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FindSafari", "..\FindSafari\FindSafari.vcproj", "{DA31DA52-6675-48D4-89E0-333A7144397C}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageDiff", "..\DumpRenderTree\win\ImageDiff.vcproj", "{59CC0547-70AC-499C-9B19-EC01C6F61137}"
+ ProjectSection(ProjectDependencies) = postProject
+ {DA31DA52-6675-48D4-89E0-333A7144397C} = {DA31DA52-6675-48D4-89E0-333A7144397C}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InjectedBundle", "win\InjectedBundle.vcproj", "{CBC3391C-F060-4BF5-A66E-81404168816B}"
+ ProjectSection(ProjectDependencies) = postProject
+ {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD} = {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestNetscapePlugin", "..\DumpRenderTree\TestNetscapePlugIn\win\TestNetscapePlugin.vcproj", "{C0737398-3565-439E-A2B8-AB2BE4D5430C}"
+ ProjectSection(ProjectDependencies) = postProject
+ {59CC0547-70AC-499C-9B19-EC01C6F61137} = {59CC0547-70AC-499C-9B19-EC01C6F61137}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug_All|Win32 = Debug_All|Win32
+ Debug_Internal|Win32 = Debug_Internal|Win32
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3B99669B-1817-443B-BCBE-835580146668}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Debug_All|Win32.Build.0 = Debug_All|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Debug_Internal|Win32.ActiveCfg = Debug_Internal|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Debug_Internal|Win32.Build.0 = Debug_Internal|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Debug|Win32.Build.0 = Debug|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Release|Win32.ActiveCfg = Release|Win32
+ {3B99669B-1817-443B-BCBE-835580146668}.Release|Win32.Build.0 = Release|Win32
+ {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Debug_All|Win32.ActiveCfg = all|Win32
+ {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Debug_All|Win32.Build.0 = all|Win32
+ {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Debug_Internal|Win32.ActiveCfg = all|Win32
+ {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Debug_Internal|Win32.Build.0 = all|Win32
+ {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Debug|Win32.ActiveCfg = all|Win32
+ {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Debug|Win32.Build.0 = all|Win32
+ {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Release|Win32.ActiveCfg = all|Win32
+ {4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}.Release|Win32.Build.0 = all|Win32
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug_All|Win32.ActiveCfg = all|Win32
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug_All|Win32.Build.0 = all|Win32
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug_Internal|Win32.ActiveCfg = all|Win32
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug_Internal|Win32.Build.0 = all|Win32
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug|Win32.ActiveCfg = all|Win32
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Debug|Win32.Build.0 = all|Win32
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Release|Win32.ActiveCfg = all|Win32
+ {DA31DA52-6675-48D4-89E0-333A7144397C}.Release|Win32.Build.0 = all|Win32
+ {59CC0547-70AC-499C-9B19-EC01C6F61137}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
+ {59CC0547-70AC-499C-9B19-EC01C6F61137}.Debug_All|Win32.Build.0 = Debug_All|Win32
+ {59CC0547-70AC-499C-9B19-EC01C6F61137}.Debug_Internal|Win32.ActiveCfg = Debug_Internal|Win32
+ {59CC0547-70AC-499C-9B19-EC01C6F61137}.Debug_Internal|Win32.Build.0 = Debug_Internal|Win32
+ {59CC0547-70AC-499C-9B19-EC01C6F61137}.Debug|Win32.ActiveCfg = Debug|Win32
+ {59CC0547-70AC-499C-9B19-EC01C6F61137}.Debug|Win32.Build.0 = Debug|Win32
+ {59CC0547-70AC-499C-9B19-EC01C6F61137}.Release|Win32.ActiveCfg = Release|Win32
+ {59CC0547-70AC-499C-9B19-EC01C6F61137}.Release|Win32.Build.0 = Release|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_All|Win32.Build.0 = Debug_All|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_Internal|Win32.ActiveCfg = Debug_Internal|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug_Internal|Win32.Build.0 = Debug_Internal|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Debug|Win32.Build.0 = Debug|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Release|Win32.ActiveCfg = Release|Win32
+ {CBC3391C-F060-4BF5-A66E-81404168816B}.Release|Win32.Build.0 = Release|Win32
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C}.Debug_All|Win32.ActiveCfg = Debug_All|Win32
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C}.Debug_All|Win32.Build.0 = Debug_All|Win32
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C}.Debug_Internal|Win32.ActiveCfg = Debug_Internal|Win32
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C}.Debug_Internal|Win32.Build.0 = Debug_Internal|Win32
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C}.Debug|Win32.ActiveCfg = Debug|Win32
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C}.Debug|Win32.Build.0 = Debug|Win32
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C}.Release|Win32.ActiveCfg = Release|Win32
+ {C0737398-3565-439E-A2B8-AB2BE4D5430C}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..a15fe41
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -0,0 +1,582 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXAggregateTarget section */
+ BC952D7711F3BF5D003398B4 /* Derived Sources */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = BC952D7D11F3BF6A003398B4 /* Build configuration list for PBXAggregateTarget "Derived Sources" */;
+ buildPhases = (
+ BC952D8211F3BF78003398B4 /* Generate Derived Sources */,
+ );
+ dependencies = (
+ );
+ name = "Derived Sources";
+ productName = "Derived Sources";
+ };
+/* End PBXAggregateTarget section */
+
+/* Begin PBXBuildFile section */
+ 6510A78211EC643800410867 /* AHEM____.TTF in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77711EC643800410867 /* AHEM____.TTF */; };
+ 6510A78311EC643800410867 /* ColorBits.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77811EC643800410867 /* ColorBits.ttf */; };
+ 6510A78411EC643800410867 /* WebKitWeightWatcher100.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77911EC643800410867 /* WebKitWeightWatcher100.ttf */; };
+ 6510A78511EC643800410867 /* WebKitWeightWatcher200.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77A11EC643800410867 /* WebKitWeightWatcher200.ttf */; };
+ 6510A78611EC643800410867 /* WebKitWeightWatcher300.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77B11EC643800410867 /* WebKitWeightWatcher300.ttf */; };
+ 6510A78711EC643800410867 /* WebKitWeightWatcher400.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77C11EC643800410867 /* WebKitWeightWatcher400.ttf */; };
+ 6510A78811EC643800410867 /* WebKitWeightWatcher500.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77D11EC643800410867 /* WebKitWeightWatcher500.ttf */; };
+ 6510A78911EC643800410867 /* WebKitWeightWatcher600.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77E11EC643800410867 /* WebKitWeightWatcher600.ttf */; };
+ 6510A78A11EC643800410867 /* WebKitWeightWatcher700.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A77F11EC643800410867 /* WebKitWeightWatcher700.ttf */; };
+ 6510A78B11EC643800410867 /* WebKitWeightWatcher800.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A78011EC643800410867 /* WebKitWeightWatcher800.ttf */; };
+ 6510A78C11EC643800410867 /* WebKitWeightWatcher900.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6510A78111EC643800410867 /* WebKitWeightWatcher900.ttf */; };
+ 65EB85A011EC67CC0034D300 /* ActivateFonts.mm in Sources */ = {isa = PBXBuildFile; fileRef = 65EB859F11EC67CC0034D300 /* ActivateFonts.mm */; };
+ BC14E4DB120E02D000826C0C /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14E4D9120E02D000826C0C /* GCController.cpp */; };
+ BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC14E4E8120E03D800826C0C /* JSGCController.cpp */; };
+ 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 */; };
+ BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8FD8C9120E527F00F3E71A /* EventSendingController.cpp */; };
+ BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */; };
+ BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952C0C11F3B965003398B4 /* JSWrapper.cpp */; };
+ BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */; };
+ BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */; };
+ BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */; };
+ BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */; };
+ BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD7D2F711921278006DB7EE /* TestInvocation.cpp */; };
+ BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; };
+ C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ BC25194111D15D94002EBC01 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BC25186111D15D54002EBC01;
+ remoteInfo = InjectedBundle;
+ };
+ BC952ED611F3C38B003398B4 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BC952D7711F3BF5D003398B4;
+ remoteInfo = "Derived Sources";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 6510A77711EC643800410867 /* AHEM____.TTF */ = {isa = PBXFileReference; lastKnownFileType = file; name = "AHEM____.TTF"; path = "fonts/AHEM____.TTF"; sourceTree = "<group>"; };
+ 6510A77811EC643800410867 /* ColorBits.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = ColorBits.ttf; path = fonts/ColorBits.ttf; sourceTree = "<group>"; };
+ 6510A77911EC643800410867 /* WebKitWeightWatcher100.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher100.ttf; path = fonts/WebKitWeightWatcher100.ttf; sourceTree = "<group>"; };
+ 6510A77A11EC643800410867 /* WebKitWeightWatcher200.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher200.ttf; path = fonts/WebKitWeightWatcher200.ttf; sourceTree = "<group>"; };
+ 6510A77B11EC643800410867 /* WebKitWeightWatcher300.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher300.ttf; path = fonts/WebKitWeightWatcher300.ttf; sourceTree = "<group>"; };
+ 6510A77C11EC643800410867 /* WebKitWeightWatcher400.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher400.ttf; path = fonts/WebKitWeightWatcher400.ttf; sourceTree = "<group>"; };
+ 6510A77D11EC643800410867 /* WebKitWeightWatcher500.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher500.ttf; path = fonts/WebKitWeightWatcher500.ttf; sourceTree = "<group>"; };
+ 6510A77E11EC643800410867 /* WebKitWeightWatcher600.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher600.ttf; path = fonts/WebKitWeightWatcher600.ttf; sourceTree = "<group>"; };
+ 6510A77F11EC643800410867 /* WebKitWeightWatcher700.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher700.ttf; path = fonts/WebKitWeightWatcher700.ttf; sourceTree = "<group>"; };
+ 6510A78011EC643800410867 /* WebKitWeightWatcher800.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher800.ttf; path = fonts/WebKitWeightWatcher800.ttf; sourceTree = "<group>"; };
+ 6510A78111EC643800410867 /* WebKitWeightWatcher900.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher900.ttf; path = fonts/WebKitWeightWatcher900.ttf; sourceTree = "<group>"; };
+ 65EB859D11EC67CC0034D300 /* ActivateFonts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActivateFonts.h; sourceTree = "<group>"; };
+ 65EB859F11EC67CC0034D300 /* ActivateFonts.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ActivateFonts.mm; sourceTree = "<group>"; };
+ 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WebKitTestRunner; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC14E4D8120E02D000826C0C /* GCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCController.h; sourceTree = "<group>"; };
+ BC14E4D9120E02D000826C0C /* GCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GCController.cpp; sourceTree = "<group>"; };
+ BC14E4E1120E032000826C0C /* GCController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GCController.idl; sourceTree = "<group>"; };
+ BC14E4E8120E03D800826C0C /* JSGCController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSGCController.cpp; path = DerivedSources/WebKitTestRunner/JSGCController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC14E4E9120E03D800826C0C /* JSGCController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSGCController.h; path = DerivedSources/WebKitTestRunner/JSGCController.h; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMain.cpp; sourceTree = "<group>"; };
+ BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebKitTestRunnerInjectedBundle.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>"; };
+ BC8FD8C8120E527F00F3E71A /* EventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSendingController.h; sourceTree = "<group>"; };
+ BC8FD8C9120E527F00F3E71A /* EventSendingController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventSendingController.cpp; sourceTree = "<group>"; };
+ BC8FD8CB120E52B000F3E71A /* EventSendingController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EventSendingController.idl; sourceTree = "<group>"; };
+ BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSEventSendingController.cpp; path = DerivedSources/WebKitTestRunner/JSEventSendingController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC8FD8D1120E545B00F3E71A /* JSEventSendingController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSEventSendingController.h; path = DerivedSources/WebKitTestRunner/JSEventSendingController.h; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC952C0B11F3B965003398B4 /* JSWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWrapper.h; sourceTree = "<group>"; };
+ BC952C0C11F3B965003398B4 /* JSWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWrapper.cpp; sourceTree = "<group>"; };
+ BC952C0E11F3B97B003398B4 /* JSWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWrappable.h; sourceTree = "<group>"; };
+ BC952EC511F3C10F003398B4 /* DerivedSources.make */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DerivedSources.make; sourceTree = "<group>"; };
+ BC952ED211F3C29F003398B4 /* LayoutTestController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LayoutTestController.idl; sourceTree = "<group>"; };
+ BC952ED311F3C318003398B4 /* CodeGeneratorTestRunner.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = CodeGeneratorTestRunner.pm; sourceTree = "<group>"; };
+ BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSLayoutTestController.cpp; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSLayoutTestController.h; path = DerivedSources/WebKitTestRunner/JSLayoutTestController.h; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC99A4841208901A007E9F08 /* StringFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringFunctions.h; sourceTree = "<group>"; };
+ BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundle.cpp; sourceTree = "<group>"; };
+ BCC997A111D3C8F60017BCA2 /* InjectedBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundle.h; sourceTree = "<group>"; };
+ BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePage.cpp; sourceTree = "<group>"; };
+ BCC997A311D3C8F60017BCA2 /* InjectedBundlePage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePage.h; sourceTree = "<group>"; };
+ BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutTestController.h; sourceTree = "<group>"; };
+ BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutTestController.cpp; 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>"; };
+ BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; };
+/* 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 = (
+ BC952EC511F3C10F003398B4 /* DerivedSources.make */,
+ BC99CBF11207642D00FDEE76 /* Shared */,
+ 08FB7795FE84155DC02AAC07 /* TestRunner */,
+ BC25183511D1571D002EBC01 /* InjectedBundle */,
+ BC793401118F7C8A005EA8E2 /* Configurations */,
+ 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
+ BC25194411D15DBE002EBC01 /* Resources */,
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
+ );
+ name = WebKitTestRunner;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 /* TestRunner */ = {
+ isa = PBXGroup;
+ children = (
+ BC7933FE118F7C74005EA8E2 /* mac */,
+ BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */,
+ BC7934DD119066EC005EA8E2 /* PlatformWebView.h */,
+ BC79342F118F7F19005EA8E2 /* TestController.h */,
+ BC793430118F7F19005EA8E2 /* TestController.cpp */,
+ BCD7D2F611921278006DB7EE /* TestInvocation.h */,
+ BCD7D2F711921278006DB7EE /* TestInvocation.cpp */,
+ );
+ name = TestRunner;
+ 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 /* WebKitTestRunnerInjectedBundle.bundle */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 65EB859E11EC67CC0034D300 /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ 65EB859F11EC67CC0034D300 /* ActivateFonts.mm */,
+ );
+ path = mac;
+ sourceTree = "<group>";
+ };
+ BC14E4E0120E02F900826C0C /* Controllers */ = {
+ isa = PBXGroup;
+ children = (
+ BC8FD8C9120E527F00F3E71A /* EventSendingController.cpp */,
+ BC8FD8C8120E527F00F3E71A /* EventSendingController.h */,
+ BC14E4D9120E02D000826C0C /* GCController.cpp */,
+ BC14E4D8120E02D000826C0C /* GCController.h */,
+ BCC9981711D3F51E0017BCA2 /* LayoutTestController.cpp */,
+ BCC9981611D3F51E0017BCA2 /* LayoutTestController.h */,
+ C0CE720A1247C93300BC0EC4 /* LayoutTestControllerMac.mm */,
+ );
+ name = Controllers;
+ sourceTree = "<group>";
+ };
+ BC25183511D1571D002EBC01 /* InjectedBundle */ = {
+ isa = PBXGroup;
+ children = (
+ BC952D3A11F3BF1F003398B4 /* Derived Sources */,
+ BC952C0A11F3B939003398B4 /* Bindings */,
+ BC14E4E0120E02F900826C0C /* Controllers */,
+ 65EB859E11EC67CC0034D300 /* mac */,
+ 65EB859D11EC67CC0034D300 /* ActivateFonts.h */,
+ BCC997A011D3C8F60017BCA2 /* InjectedBundle.cpp */,
+ BCC997A111D3C8F60017BCA2 /* InjectedBundle.h */,
+ BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */,
+ BCC997A211D3C8F60017BCA2 /* InjectedBundlePage.cpp */,
+ BCC997A311D3C8F60017BCA2 /* InjectedBundlePage.h */,
+ );
+ path = InjectedBundle;
+ sourceTree = "<group>";
+ };
+ BC25194411D15DBE002EBC01 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ BC25186311D15D54002EBC01 /* InjectedBundle-Info.plist */,
+ 6510A77711EC643800410867 /* AHEM____.TTF */,
+ 6510A77811EC643800410867 /* ColorBits.ttf */,
+ 6510A77911EC643800410867 /* WebKitWeightWatcher100.ttf */,
+ 6510A77A11EC643800410867 /* WebKitWeightWatcher200.ttf */,
+ 6510A77B11EC643800410867 /* WebKitWeightWatcher300.ttf */,
+ 6510A77C11EC643800410867 /* WebKitWeightWatcher400.ttf */,
+ 6510A77D11EC643800410867 /* WebKitWeightWatcher500.ttf */,
+ 6510A77E11EC643800410867 /* WebKitWeightWatcher600.ttf */,
+ 6510A77F11EC643800410867 /* WebKitWeightWatcher700.ttf */,
+ 6510A78011EC643800410867 /* WebKitWeightWatcher800.ttf */,
+ 6510A78111EC643800410867 /* WebKitWeightWatcher900.ttf */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ BC7933FE118F7C74005EA8E2 /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ BC7933FF118F7C84005EA8E2 /* main.mm */,
+ BC7934E711906846005EA8E2 /* PlatformWebViewMac.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>";
+ };
+ BC952C0A11F3B939003398B4 /* Bindings */ = {
+ isa = PBXGroup;
+ children = (
+ BC952ED311F3C318003398B4 /* CodeGeneratorTestRunner.pm */,
+ BC952C0E11F3B97B003398B4 /* JSWrappable.h */,
+ BC952C0C11F3B965003398B4 /* JSWrapper.cpp */,
+ BC952C0B11F3B965003398B4 /* JSWrapper.h */,
+ BC8FD8CB120E52B000F3E71A /* EventSendingController.idl */,
+ BC14E4E1120E032000826C0C /* GCController.idl */,
+ BC952ED211F3C29F003398B4 /* LayoutTestController.idl */,
+ );
+ path = Bindings;
+ sourceTree = "<group>";
+ };
+ BC952D3A11F3BF1F003398B4 /* Derived Sources */ = {
+ isa = PBXGroup;
+ children = (
+ BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */,
+ BC8FD8D1120E545B00F3E71A /* JSEventSendingController.h */,
+ BC14E4E8120E03D800826C0C /* JSGCController.cpp */,
+ BC14E4E9120E03D800826C0C /* JSGCController.h */,
+ BC952F1D11F3C652003398B4 /* JSLayoutTestController.cpp */,
+ BC952F1E11F3C652003398B4 /* JSLayoutTestController.h */,
+ );
+ name = "Derived Sources";
+ sourceTree = "<group>";
+ };
+ BC99CBF11207642D00FDEE76 /* Shared */ = {
+ isa = PBXGroup;
+ children = (
+ BC99A4841208901A007E9F08 /* StringFunctions.h */,
+ );
+ name = Shared;
+ 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 */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BC25194211D15D94002EBC01 /* PBXTargetDependency */,
+ );
+ name = WebKitTestRunner;
+ productInstallPath = "$(HOME)/bin";
+ productName = WebKitTestRunner;
+ productReference = 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */;
+ productType = "com.apple.product-type.tool";
+ };
+ BC25186111D15D54002EBC01 /* WebKitTestRunnerInjectedBundle */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "WebKitTestRunnerInjectedBundle" */;
+ buildPhases = (
+ BC25185E11D15D54002EBC01 /* Resources */,
+ BC25185F11D15D54002EBC01 /* Sources */,
+ BC25186011D15D54002EBC01 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BC952ED711F3C38B003398B4 /* PBXTargetDependency */,
+ );
+ name = WebKitTestRunnerInjectedBundle;
+ productName = InjectedBundle;
+ productReference = BC25186211D15D54002EBC01 /* WebKitTestRunnerInjectedBundle.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";
+ developmentRegion = English;
+ hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
+ mainGroup = 08FB7794FE84155DC02AAC07 /* WebKitTestRunner */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8DD76F960486AA7600D96B5E /* WebKitTestRunner */,
+ BC25186111D15D54002EBC01 /* WebKitTestRunnerInjectedBundle */,
+ BC952D7711F3BF5D003398B4 /* Derived Sources */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ BC25185E11D15D54002EBC01 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 6510A78211EC643800410867 /* AHEM____.TTF in Resources */,
+ 6510A78311EC643800410867 /* ColorBits.ttf in Resources */,
+ 6510A78411EC643800410867 /* WebKitWeightWatcher100.ttf in Resources */,
+ 6510A78511EC643800410867 /* WebKitWeightWatcher200.ttf in Resources */,
+ 6510A78611EC643800410867 /* WebKitWeightWatcher300.ttf in Resources */,
+ 6510A78711EC643800410867 /* WebKitWeightWatcher400.ttf in Resources */,
+ 6510A78811EC643800410867 /* WebKitWeightWatcher500.ttf in Resources */,
+ 6510A78911EC643800410867 /* WebKitWeightWatcher600.ttf in Resources */,
+ 6510A78A11EC643800410867 /* WebKitWeightWatcher700.ttf in Resources */,
+ 6510A78B11EC643800410867 /* WebKitWeightWatcher800.ttf in Resources */,
+ 6510A78C11EC643800410867 /* WebKitWeightWatcher900.ttf in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ BC952D8211F3BF78003398B4 /* Generate Derived Sources */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ name = "Generate Derived Sources";
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\n\nexport WebKitTestRunner=\"${SRCROOT}\"\nexport WebCoreScripts=\"${WEBCORE_PRIVATE_HEADERS_DIR}\"\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n make -f \"${WebKitTestRunner}/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.availcpu`\nfi\n";
+ };
+/* End PBXShellScriptBuildPhase 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 */,
+ BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */,
+ BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BC25185F11D15D54002EBC01 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC251A3E11D16831002EBC01 /* InjectedBundleMain.cpp in Sources */,
+ BCC997A411D3C8F60017BCA2 /* InjectedBundle.cpp in Sources */,
+ BCC997A511D3C8F60017BCA2 /* InjectedBundlePage.cpp in Sources */,
+ BCC9981811D3F51E0017BCA2 /* LayoutTestController.cpp in Sources */,
+ 65EB85A011EC67CC0034D300 /* ActivateFonts.mm in Sources */,
+ BC952C0D11F3B965003398B4 /* JSWrapper.cpp in Sources */,
+ BC952F1F11F3C652003398B4 /* JSLayoutTestController.cpp in Sources */,
+ BC14E4DB120E02D000826C0C /* GCController.cpp in Sources */,
+ BC14E4EA120E03D800826C0C /* JSGCController.cpp in Sources */,
+ BC8FD8CA120E527F00F3E71A /* EventSendingController.cpp in Sources */,
+ BC8FD8D2120E545B00F3E71A /* JSEventSendingController.cpp in Sources */,
+ C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ BC25194211D15D94002EBC01 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BC25186111D15D54002EBC01 /* WebKitTestRunnerInjectedBundle */;
+ targetProxy = BC25194111D15D94002EBC01 /* PBXContainerItemProxy */;
+ };
+ BC952ED711F3C38B003398B4 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BC952D7711F3BF5D003398B4 /* Derived Sources */;
+ targetProxy = BC952ED611F3C38B003398B4 /* 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;
+ };
+ BC952D7811F3BF5E003398B4 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ PRODUCT_NAME = "Derived Sources";
+ };
+ name = Debug;
+ };
+ BC952D7911F3BF5E003398B4 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ PRODUCT_NAME = "Derived Sources";
+ ZERO_LINK = NO;
+ };
+ 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 "WebKitTestRunnerInjectedBundle" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ BC25186411D15D55002EBC01 /* Debug */,
+ BC25186511D15D55002EBC01 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ BC952D7D11F3BF6A003398B4 /* Build configuration list for PBXAggregateTarget "Derived Sources" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ BC952D7811F3BF5E003398B4 /* Debug */,
+ BC952D7911F3BF5E003398B4 /* 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..9d508ed
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunnerPrefix.h
@@ -0,0 +1,37 @@
+/*
+ * 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
+
+#if defined(WIN32) || defined(_WIN32)
+// If we don't define these, they get defined in windef.h.
+// We want to use std::min and std::max
+#define max max
+#define min min
+#endif
+
+#include <WebKit2/WebKit2.h>
diff --git a/WebKitTools/WebKitTestRunner/fonts/AHEM____.TTF b/WebKitTools/WebKitTestRunner/fonts/AHEM____.TTF
new file mode 100644
index 0000000..ac81cb0
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/AHEM____.TTF
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/ColorBits-A.png b/WebKitTools/WebKitTestRunner/fonts/ColorBits-A.png
new file mode 100644
index 0000000..8b9319c
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/ColorBits-A.png
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/ColorBits.ttf b/WebKitTools/WebKitTestRunner/fonts/ColorBits.ttf
new file mode 100644
index 0000000..cd919e8
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/ColorBits.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests 2.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests 2.ttf
new file mode 100644
index 0000000..e732fbc
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests 2.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests.ttf
new file mode 100644
index 0000000..f9f997e
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKit Layout Tests.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher100.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher100.ttf
new file mode 100644
index 0000000..22b00de
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher100.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher200.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher200.ttf
new file mode 100644
index 0000000..1ccadba
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher200.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher300.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher300.ttf
new file mode 100644
index 0000000..ab5563d
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher300.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher400.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher400.ttf
new file mode 100644
index 0000000..56d279e
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher400.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher500.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher500.ttf
new file mode 100644
index 0000000..d827d7d
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher500.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher600.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher600.ttf
new file mode 100644
index 0000000..9141596
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher600.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher700.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher700.ttf
new file mode 100644
index 0000000..a2d0505
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher700.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher800.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher800.ttf
new file mode 100644
index 0000000..d0f354b
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher800.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher900.ttf b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher900.ttf
new file mode 100644
index 0000000..6b895ca
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/fonts/WebKitWeightWatcher900.ttf
Binary files differ
diff --git a/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm b/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm
new file mode 100644
index 0000000..6080c1f
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm
@@ -0,0 +1,83 @@
+/*
+ * 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];
+ [m_window setReleasedWhenClosed:NO];
+}
+
+void PlatformWebView::resizeTo(unsigned width, unsigned height)
+{
+ [m_view setFrame:NSMakeRect(0, 0, width, height)];
+}
+
+PlatformWebView::~PlatformWebView()
+{
+ [m_window close];
+ [m_window release];
+ [m_view release];
+}
+
+WKPageRef PlatformWebView::page()
+{
+ return [m_view pageRef];
+}
+
+void PlatformWebView::focus()
+{
+ // Implement.
+}
+
+WKRect PlatformWebView::windowFrame()
+{
+ NSRect frame = [m_window frame];
+
+ WKRect wkFrame;
+ wkFrame.origin.x = frame.origin.x;
+ wkFrame.origin.y = frame.origin.y;
+ wkFrame.size.width = frame.size.width;
+ wkFrame.size.height = frame.size.height;
+ return wkFrame;
+}
+
+void PlatformWebView::setWindowFrame(WKRect frame)
+{
+ [m_window setFrame:NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height) display:YES];
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
new file mode 100644
index 0000000..fee0070
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
@@ -0,0 +1,63 @@
+/*
+ * 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::notifyDone()
+{
+}
+
+void TestController::platformInitialize()
+{
+}
+
+void TestController::initializeInjectedBundlePath()
+{
+ NSString *nsBundlePath = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"WebKitTestRunnerInjectedBundle.bundle"];
+ m_injectedBundlePath.adopt(WKStringCreateWithCFString((CFStringRef)nsBundlePath));
+}
+
+void TestController::initializeTestPluginDirectory()
+{
+ m_testPluginDirectory.adopt(WKStringCreateWithCFString((CFStringRef)[[NSBundle mainBundle] bundlePath]));
+}
+
+void TestController::platformRunUntil(bool& done, double timeout)
+{
+ CFAbsoluteTime end = CFAbsoluteTimeGetCurrent() + timeout;
+ while (!done && CFAbsoluteTimeGetCurrent() < end)
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantPast]];
+}
+
+void TestController::platformInitializeContext()
+{
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/mac/main.mm b/WebKitTools/WebKitTestRunner/mac/main.mm
new file mode 100644
index 0000000..d2f26ab
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/mac/main.mm
@@ -0,0 +1,37 @@
+/*
+ * 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 controller(argc, argv);
+ }
+ [pool drain];
+ return 0;
+}
diff --git a/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
new file mode 100644
index 0000000..d405a0f
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged. 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "PlatformWebView.h"
+#include "qgraphicswkview.h"
+#include <QtGui>
+
+namespace WTR {
+
+class WebView : public QGraphicsView {
+public:
+ WebView(WKPageNamespaceRef);
+
+ QGraphicsWKView* wkView() const { return m_item; }
+
+ virtual ~WebView() { delete m_item; }
+
+private:
+ QGraphicsWKView* m_item;
+};
+
+WebView::WebView(WKPageNamespaceRef namespaceRef)
+ : QGraphicsView()
+ , m_item(new QGraphicsWKView(namespaceRef))
+{
+ setScene(new QGraphicsScene(this));
+ scene()->addItem(m_item);
+}
+
+PlatformWebView::PlatformWebView(WKPageNamespaceRef namespaceRef)
+ : m_view(new WebView(namespaceRef))
+ , m_window(new QMainWindow())
+{
+ m_view->setParent(m_window);
+ m_window->setCentralWidget(m_view);
+ m_window->setGeometry(0, 0, 800, 600);
+}
+
+PlatformWebView::~PlatformWebView()
+{
+ delete m_window;
+}
+
+void PlatformWebView::resizeTo(unsigned width, unsigned height)
+{
+ m_window->resize(width, height);
+}
+
+WKPageRef PlatformWebView::page()
+{
+ return m_view->wkView()->page()->pageRef();
+}
+
+void PlatformWebView::focus()
+{
+ m_view->setFocus(Qt::OtherFocusReason);
+}
+
+WKRect PlatformWebView::windowFrame()
+{
+ // Implement.
+
+ WKRect wkFrame;
+ wkFrame.origin.x = 0;
+ wkFrame.origin.y = 0;
+ wkFrame.size.width = 0;
+ wkFrame.size.height = 0;
+ return wkFrame;
+}
+
+void PlatformWebView::setWindowFrame(WKRect)
+{
+ // Implement.
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
new file mode 100644
index 0000000..ca0a00c
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/qt/TestControllerQt.cpp
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged. 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 THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "TestController.h"
+
+#include "WKStringQt.h"
+
+#include <cstdlib>
+#include <QCoreApplication>
+#include <QEventLoop>
+#include <QFileInfo>
+#include <QLibrary>
+#include <QObject>
+#include <QtGlobal>
+#include <wtf/Platform.h>
+#include <wtf/text/WTFString.h>
+
+namespace WTR {
+
+class TestControllerRunLoop : public QObject {
+ Q_OBJECT
+public:
+ static TestControllerRunLoop* instance()
+ {
+ static TestControllerRunLoop* result = new TestControllerRunLoop;
+ return result;
+ }
+
+ void start(int msec)
+ {
+ m_timerID = startTimer(msec);
+ ASSERT(m_timerID);
+ m_eventLoop.exec(QEventLoop::ExcludeUserInputEvents);
+ }
+
+ void stop()
+ {
+ killTimer(m_timerID);
+ m_eventLoop.quit();
+ }
+private:
+ TestControllerRunLoop() {}
+
+ void timerEvent(QTimerEvent*)
+ {
+ fprintf(stderr, "FAIL: TestControllerRunLoop timed out.\n");
+ stop();
+ }
+
+ QEventLoop m_eventLoop;
+ int m_timerID;
+};
+
+void TestController::notifyDone()
+{
+ TestControllerRunLoop::instance()->stop();
+}
+
+void TestController::platformInitialize()
+{
+}
+
+void TestController::platformRunUntil(bool&, double timeout)
+{
+ TestControllerRunLoop::instance()->start(static_cast<int>(timeout * 1000));
+}
+
+static bool isExistingLibrary(const QString& path)
+{
+#if OS(WINDOWS) || OS(SYMBIAN)
+ const char* librarySuffixes[] = { ".dll" };
+#elif OS(MAC_OS_X)
+ const char* librarySuffixes[] = { ".bundle", ".dylib", ".so" };
+#elif OS(UNIX)
+ const char* librarySuffixes[] = { ".so" };
+#else
+#error Library path suffix should be specified for this platform
+#endif
+ for (unsigned i = 0; i < sizeof(librarySuffixes) / sizeof(const char*); ++i) {
+ if (QLibrary::isLibrary(path + librarySuffixes[i]))
+ return true;
+ }
+
+ return false;
+}
+
+void TestController::initializeInjectedBundlePath()
+{
+ QString path = QLatin1String(getenv("WTR_INJECTEDBUNDLE_PATH"));
+ if (path.isEmpty())
+ path = QFileInfo(QCoreApplication::applicationDirPath() + "/../lib/libWTRInjectedBundle").absoluteFilePath();
+ if (!isExistingLibrary(path))
+ qFatal("Cannot find the injected bundle at %s\n", qPrintable(path));
+
+ m_injectedBundlePath = WKStringCreateWithQString(path);
+}
+
+void TestController::initializeTestPluginDirectory()
+{
+ // This is called after initializeInjectedBundlePath.
+ m_testPluginDirectory = m_injectedBundlePath;
+}
+
+void TestController::platformInitializeContext()
+{
+}
+
+#include "TestControllerQt.moc"
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro b/WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro
new file mode 100644
index 0000000..a638e65
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/qt/WebKitTestRunner.pro
@@ -0,0 +1,68 @@
+TARGET = WebKitTestRunner
+CONFIG -= app_bundle
+
+BASEDIR = $$PWD/../
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
+
+include(../../../WebKit.pri)
+
+!CONFIG(release, debug|release) {
+ OBJECTS_DIR = obj/debug
+} else { # Release
+ OBJECTS_DIR = obj/release
+}
+
+DEFINES += USE_SYSTEM_MALLOC
+
+INCLUDEPATH += \
+ $$BASEDIR \
+ $$BASEDIR/../../JavaScriptCore \
+ $$BASEDIR/../../WebKit2 \
+ $$BASEDIR/../../WebKit2/Shared \
+ $$BASEDIR/../../WebKit2/UIProcess/API/qt \
+ $$BASEDIR/../../WebKit2/UIProcess/API/cpp/qt \
+
+INCLUDEPATH += \
+ $$OUTPUT_DIR/include \
+
+
+DESTDIR = $$OUTPUT_DIR/bin
+
+unix:!mac {
+ CONFIG += link_pkgconfig
+ PKGCONFIG += fontconfig
+}
+
+QT = core gui network
+
+HEADERS = \
+ $$BASEDIR/PlatformWebView.h \
+ $$BASEDIR/StringFunctions.h \
+ $$BASEDIR/TestController.h \
+ $$BASEDIR/TestInvocation.h
+
+SOURCES = \
+ main.cpp \
+ PlatformWebViewQt.cpp \
+ TestControllerQt.cpp \
+ $$BASEDIR/TestController.cpp \
+ $$BASEDIR/TestInvocation.cpp \
+
+PREFIX_HEADER = $$BASEDIR/WebKitTestRunnerPrefix.h
+QMAKE_CXXFLAGS += "-include $$PREFIX_HEADER"
+
+linux-* {
+ # From Creator's src/rpath.pri:
+ # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
+ # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var.
+ QMAKE_RPATHDIR = \$\$ORIGIN/../lib $$QMAKE_RPATHDIR
+ MY_RPATH = $$join(QMAKE_RPATHDIR, ":")
+
+ QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${MY_RPATH}\'
+ QMAKE_RPATHDIR =
+} else {
+ QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+}
+
+include(../../../JavaScriptCore/JavaScriptCore.pri)
+addJavaScriptCoreLib(../../../JavaScriptCore)
diff --git a/WebKitTools/WebKitTestRunner/qt/main.cpp b/WebKitTools/WebKitTestRunner/qt/main.cpp
new file mode 100644
index 0000000..4312a05
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/qt/main.cpp
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged.
+ *
+ * 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 <QApplication>
+#include <QObject>
+#include <QTimer>
+
+class Launcher : public QObject {
+ Q_OBJECT
+
+public:
+ Launcher(int argc, char** argv)
+ : m_argc(argc)
+ , m_argv(argv)
+ {
+ }
+
+ ~Launcher()
+ {
+ delete m_controller;
+ }
+
+public slots:
+ void launch()
+ {
+ m_controller = new WTR::TestController(m_argc, const_cast<const char**>(m_argv));
+ QApplication::exit();
+ }
+
+private:
+ WTR::TestController* m_controller;
+ int m_argc;
+ char** m_argv;
+};
+
+int main(int argc, char** argv)
+{
+ QApplication app(argc, argv);
+ Launcher launcher(argc, argv);
+ QTimer::singleShot(0, &launcher, SLOT(launch()));
+ return app.exec();;
+}
+
+#include "main.moc"
diff --git a/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
new file mode 100644
index 0000000..7b629a1
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/win/InjectedBundle.vcproj
@@ -0,0 +1,558 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="InjectedBundle"
+ ProjectGUID="{CBC3391C-F060-4BF5-A66E-81404168816B}"
+ RootNamespace="InjectedBundle"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;..\Configurations\InjectedBundleCoreFoundation.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;..\Configurations\InjectedBundleCoreFoundation.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_All|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;..\Configurations\InjectedBundleCoreFoundation.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_Internal|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;..\Configurations\InjectedBundleCoreFoundation.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;..\Configurations\InjectedBundleCFLite.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;..\Configurations\InjectedBundleCFLite.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;..\Configurations\InjectedBundleCoreFoundation.vsprops;..\Configurations\InjectedBundleCommon.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Bindings"
+ >
+ <File
+ RelativePath="..\InjectedBundle\Bindings\CodeGeneratorTestRunner.pm"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\Bindings\JSWrappable.h"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\Bindings\JSWrapper.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\Bindings\JSWrapper.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Derived Sources"
+ >
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSEventSendingController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSEventSendingController.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSGCController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSGCController.h"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSLayoutTestController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSLayoutTestController.h"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\InjectedBundle\win\ActivateFonts.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\EventSendingController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\EventSendingController.h"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\GCController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\GCController.h"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\InjectedBundle.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\InjectedBundle.h"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\InjectedBundleMain.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\InjectedBundlePage.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\InjectedBundlePage.h"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\LayoutTestController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\LayoutTestController.h"
+ >
+ </File>
+ <File
+ RelativePath="..\InjectedBundle\win\LayoutTestControllerWin.cpp"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/WebKitTools/WebKitTestRunner/win/InjectedBundleGenerated.vcproj b/WebKitTools/WebKitTestRunner/win/InjectedBundleGenerated.vcproj
new file mode 100755
index 0000000..1148edd
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/win/InjectedBundleGenerated.vcproj
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="InjectedBundleGenerated"
+ ProjectGUID="{4343BC0B-A2E0-4B48-8277-F33CFBFA83CD}"
+ RootNamespace="InjectedBundleGenerated"
+ Keyword="MakeFileProj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="all|Win32"
+ OutputDirectory="$(WebKitOutputDir)\lib"
+ IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"
+ ConfigurationType="0"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;bash build-generated-files.sh &quot;$(WebKitOutputDir)&quot; &quot;$(WebKitLibrariesDir)&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ ReBuildCommandLine="echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;del /s /q &quot;$(WebKitOutputDir)\obj\InjectedBundle\DerivedSources&quot;&#x0D;&#x0A;set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;bash build-generated-files.sh &quot;$(WebKitOutputDir)&quot; &quot;$(WebKitLibrariesDir)&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ CleanCommandLine="del /s /q &quot;$(WebKitOutputDir)\obj\InjectedBundle\DerivedSources&quot;&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\build-generated-files.sh"
+ >
+ </File>
+ <File
+ RelativePath="..\DerivedSources.make"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp b/WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp
new file mode 100644
index 0000000..9acd236
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/win/PlatformWebViewWin.cpp
@@ -0,0 +1,98 @@
+/*
+ * 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 {
+
+static LPCWSTR hostWindowClassName = L"WTRWebViewHostWindow";
+
+static void registerWindowClass()
+{
+ static bool initialized;
+ if (initialized)
+ return;
+ initialized = true;
+
+ WNDCLASSEXW wndClass = {0};
+ wndClass.cbSize = sizeof(wndClass);
+ wndClass.style = CS_HREDRAW | CS_VREDRAW;
+ wndClass.lpfnWndProc = DefWindowProcW;
+ wndClass.hCursor = LoadCursor(0, IDC_ARROW);
+ wndClass.hInstance = GetModuleHandle(0);
+ wndClass.lpszClassName = hostWindowClassName;
+
+ RegisterClassExW(&wndClass);
+}
+
+PlatformWebView::PlatformWebView(WKPageNamespaceRef namespaceRef)
+{
+ registerWindowClass();
+
+ RECT viewRect = {0, 0, 800, 600};
+ m_window = CreateWindowExW(0, hostWindowClassName, L"WebKitTestRunner", WS_OVERLAPPEDWINDOW, 0 /*XOFFSET*/, 0 /*YOFFSET*/, viewRect.right, viewRect.bottom, 0, 0, GetModuleHandle(0), 0);
+ m_view = WKViewCreate(viewRect, namespaceRef, m_window);
+}
+
+PlatformWebView::~PlatformWebView()
+{
+ if (::IsWindow(m_window))
+ ::DestroyWindow(m_window);
+ WKRelease(m_view);
+}
+
+void PlatformWebView::resizeTo(unsigned width, unsigned height)
+{
+ ::SetWindowPos(WKViewGetWindow(m_view), 0, 0, 0, width, height, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS);
+}
+
+WKPageRef PlatformWebView::page()
+{
+ return WKViewGetPage(m_view);
+}
+
+void PlatformWebView::focus()
+{
+ ::SetFocus(::WKViewGetWindow(m_view));
+}
+
+WKRect PlatformWebView::windowFrame()
+{
+ // Implement.
+
+ WKRect wkFrame;
+ wkFrame.origin.x = 0;
+ wkFrame.origin.y = 0;
+ wkFrame.size.width = 0;
+ wkFrame.size.height = 0;
+ return wkFrame;
+}
+
+void PlatformWebView::setWindowFrame(WKRect)
+{
+ // Implement.
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
new file mode 100644
index 0000000..89e29fd
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/win/TestControllerWin.cpp
@@ -0,0 +1,155 @@
+/*
+ * 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 <fcntl.h>
+#include <io.h>
+#include <shlwapi.h>
+#include <string>
+#include <WebKit2/WKContextPrivateWin.h>
+#include <WebKit2/WKStringCF.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/Vector.h>
+
+using namespace std;
+
+namespace WTR {
+
+#if !defined(NDEBUG) && (!defined(DEBUG_INTERNAL) || defined(DEBUG_ALL))
+const LPWSTR testPluginDirectoryName = L"TestNetscapePlugin_Debug";
+const char* injectedBundleDLL = "\\InjectedBundle_debug.dll";
+#else
+const LPWSTR testPluginDirectoryName = L"TestNetscapePlugin";
+const char* injectedBundleDLL = "\\InjectedBundle.dll";
+#endif
+
+static void addQTDirToPATH()
+{
+ static LPCWSTR pathEnvironmentVariable = L"PATH";
+ static LPCWSTR quickTimeKeyName = L"Software\\Apple Computer, Inc.\\QuickTime";
+ static LPCWSTR quickTimeSysDir = L"QTSysDir";
+ static bool initialized;
+
+ if (initialized)
+ return;
+ initialized = true;
+
+ // Get the QuickTime dll directory from the registry. The key can be in either HKLM or HKCU.
+ WCHAR qtPath[MAX_PATH];
+ DWORD qtPathBufferLen = sizeof(qtPath);
+ DWORD keyType;
+ HRESULT result = ::SHGetValueW(HKEY_LOCAL_MACHINE, quickTimeKeyName, quickTimeSysDir, &keyType, (LPVOID)qtPath, &qtPathBufferLen);
+ if (result != ERROR_SUCCESS || !qtPathBufferLen || keyType != REG_SZ) {
+ qtPathBufferLen = sizeof(qtPath);
+ result = ::SHGetValueW(HKEY_CURRENT_USER, quickTimeKeyName, quickTimeSysDir, &keyType, (LPVOID)qtPath, &qtPathBufferLen);
+ if (result != ERROR_SUCCESS || !qtPathBufferLen || keyType != REG_SZ)
+ return;
+ }
+
+ // Read the current PATH.
+ DWORD pathSize = ::GetEnvironmentVariableW(pathEnvironmentVariable, 0, 0);
+ Vector<WCHAR> oldPath(pathSize);
+ if (!::GetEnvironmentVariableW(pathEnvironmentVariable, oldPath.data(), oldPath.size()))
+ return;
+
+ // And add the QuickTime dll.
+ wstring newPath;
+ newPath.append(qtPath);
+ newPath.append(L";");
+ newPath.append(oldPath.data(), oldPath.size());
+ ::SetEnvironmentVariableW(pathEnvironmentVariable, newPath.data());
+}
+
+static LONG WINAPI exceptionFilter(EXCEPTION_POINTERS*)
+{
+ fputs("#CRASHED\n", stderr);
+ fflush(stderr);
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+
+void TestController::notifyDone()
+{
+}
+
+void TestController::platformInitialize()
+{
+ ::SetUnhandledExceptionFilter(exceptionFilter);
+
+ _setmode(1, _O_BINARY);
+ _setmode(2, _O_BINARY);
+
+ // Add the QuickTime dll directory to PATH or QT 7.6 will fail to initialize on systems
+ // linked with older versions of qtmlclientlib.dll.
+ addQTDirToPATH();
+}
+
+void TestController::initializeInjectedBundlePath()
+{
+ CFStringRef exeContainerPath = CFURLCopyFileSystemPath(CFURLCreateCopyDeletingLastPathComponent(0, CFBundleCopyExecutableURL(CFBundleGetMainBundle())), kCFURLWindowsPathStyle);
+ CFMutableStringRef bundlePath = CFStringCreateMutableCopy(0, 0, exeContainerPath);
+ CFStringAppendCString(bundlePath, injectedBundleDLL, kCFStringEncodingWindowsLatin1);
+ m_injectedBundlePath.adopt(WKStringCreateWithCFString(bundlePath));
+}
+
+void TestController::initializeTestPluginDirectory()
+{
+ RetainPtr<CFURLRef> bundleURL(AdoptCF, CFBundleCopyExecutableURL(CFBundleGetMainBundle()));
+ RetainPtr<CFURLRef> bundleDirectoryURL(AdoptCF, CFURLCreateCopyDeletingLastPathComponent(0, bundleURL.get()));
+ RetainPtr<CFStringRef> testPluginDirectoryNameString(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(testPluginDirectoryName), wcslen(testPluginDirectoryName)));
+ RetainPtr<CFURLRef> testPluginDirectoryURL(AdoptCF, CFURLCreateCopyAppendingPathComponent(0, bundleDirectoryURL.get(), testPluginDirectoryNameString.get(), true));
+ RetainPtr<CFStringRef> testPluginDirectoryPath(AdoptCF, CFURLCopyFileSystemPath(testPluginDirectoryURL.get(), kCFURLWindowsPathStyle));
+ m_testPluginDirectory.adopt(WKStringCreateWithCFString(testPluginDirectoryPath.get()));
+}
+
+void TestController::platformRunUntil(bool& done, double timeout)
+{
+ DWORD end = ::GetTickCount() + timeout * 1000;
+ while (!done) {
+ DWORD now = ::GetTickCount();
+ if (now > end)
+ return;
+
+ DWORD result = ::MsgWaitForMultipleObjectsEx(0, 0, end - now, QS_ALLINPUT, 0);
+ if (result == WAIT_TIMEOUT)
+ return;
+
+ ASSERT(result == WAIT_OBJECT_0);
+ // There are messages in the queue. Process them.
+ MSG msg;
+ while (::PeekMessageW(&msg, 0, 0, 0, PM_REMOVE)) {
+ ::TranslateMessage(&msg);
+ ::DispatchMessageW(&msg);
+ }
+ }
+}
+
+void TestController::platformInitializeContext()
+{
+ // FIXME: Make DRT pass with Windows native controls. <http://webkit.org/b/25592>
+ WKContextSetShouldPaintNativeControls(m_context.get(), false);
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj b/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj
new file mode 100644
index 0000000..fe345b0
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/win/WebKitTestRunner.vcproj
@@ -0,0 +1,566 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="WebKitTestRunner"
+ ProjectGUID="{3B99669B-1817-443B-BCBE-835580146668}"
+ RootNamespace="WebKitTestRunner"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ PreprocessorDefinitions="__WIN32__;_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib shlwapi.lib"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ PreprocessorDefinitions="__WIN32__;_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib shlwapi.lib"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_Internal|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ PreprocessorDefinitions="__WIN32__;_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib shlwapi.lib"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_All|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ PreprocessorDefinitions="__WIN32__;_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib shlwapi.lib"
+ SubSystem="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ PreprocessorDefinitions="__WIN32__;_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CFLite$(LibraryConfigSuffix).lib shlwapi.lib"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_CFLite|Win32"
+ OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+ IntermediateDirectory="$(ConfigurationName)"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ PreprocessorDefinitions="__WIN32__;_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CFLite$(LibraryConfigSuffix).lib shlwapi.lib"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(ProjectDir)\..&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;"
+ PreprocessorDefinitions="__WIN32__;_CONSOLE"
+ DisableSpecificWarnings="4146"
+ ForcedIncludeFiles="WebKitTestRunnerPrefix.h"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib shlwapi.lib"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not defined ARCHIVE_BUILD (if defined PRODUCTION exit /b)&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;&#x0D;&#x0A;if not exist &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; exit /b&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreFoundation$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CFNetwork$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CFNetwork.resources&quot; &quot;$(WebKitOutputDir)\bin\CFNetwork.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CoreFoundation.resources&quot; &quot;$(WebKitOutputDir)\bin\CoreFoundation.resources&quot;&#x0D;&#x0A;xcopy /y /d /e /i &quot;$(WebKitLibrariesDir)\bin\CharacterSets&quot; &quot;$(WebKitOutputDir)\bin\CharacterSets&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\CoreGraphics$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\dnssd.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc40$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42.dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icudt42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuin42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;if exist &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\icuuc42$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxml2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\libxslt$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\pthreadVC2$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\SQLite3$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).dll&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitLibrariesDir)\bin\zlib1$(LibraryConfigSuffix).pdb&quot; &quot;$(WebKitOutputDir)\bin&quot;&#x0D;&#x0A;"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="win"
+ >
+ <File
+ RelativePath=".\main.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\PlatformWebViewWin.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\TestControllerWin.cpp"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="..\PlatformWebView.h"
+ >
+ </File>
+ <File
+ RelativePath="..\TestController.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\TestController.h"
+ >
+ </File>
+ <File
+ RelativePath="..\TestInvocation.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\TestInvocation.h"
+ >
+ </File>
+ <File
+ RelativePath="..\WebKitTestRunnerPrefix.h"
+ >
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/WebKitTools/WebKitTestRunner/win/build-generated-files.sh b/WebKitTools/WebKitTestRunner/win/build-generated-files.sh
new file mode 100644
index 0000000..8c599c1
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/win/build-generated-files.sh
@@ -0,0 +1,42 @@
+# 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.
+
+# Calls to `cygpath -ms` below are needed to remove spaces from paths, which
+# confuse GNU make. See <http://webkit.org/b/8173>.
+
+WebKitOutputDir=$(cygpath -u "$(cygpath -ms "${1}")")
+WebKitLibrariesDir=$(cygpath -u "$(cygpath -ms "${2}")")
+DerivedSources="${WebKitOutputDir}/obj/InjectedBundle/DerivedSources"
+
+export WebKitTestRunner=$(cygpath -u "$(cygpath -ms "$(realpath ..)")")
+
+if [ -e "${WebKitOutputDir}/obj/WebCore/scripts" ]; then
+ export WebCoreScripts="${WebKitOutputDir}/obj/WebCore/scripts"
+else
+ export WebCoreScripts="${WebKitLibrariesDir}/tools/scripts"
+fi
+
+mkdir -p "${DerivedSources}"
+cd "${DerivedSources}"
+
+make -f "${WebKitTestRunner}/DerivedSources.make"
diff --git a/WebKitTools/WebKitTestRunner/win/main.cpp b/WebKitTools/WebKitTestRunner/win/main.cpp
new file mode 100644
index 0000000..6ef0f66
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/win/main.cpp
@@ -0,0 +1,35 @@
+/*
+ * 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"
+
+int main(int argc, const char* argv[])
+{
+ {
+ WTR::TestController controller(argc, argv);
+ }
+
+ return 0;
+}
diff --git a/WebKitTools/WinLauncher/WinLauncher.cpp b/WebKitTools/WinLauncher/WinLauncher.cpp
index 08b7ed9..5caf230 100644
--- a/WebKitTools/WinLauncher/WinLauncher.cpp
+++ b/WebKitTools/WinLauncher/WinLauncher.cpp
@@ -150,7 +150,7 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.
- MSG msg;
+ MSG msg = {0};
HACCEL hAccelTable;
INITCOMMONCONTROLSEX InitCtrlEx;
@@ -337,10 +337,10 @@ void PrintView(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
IWebFrame* frame = 0;
+ IWebFramePrivate* framePrivate = 0;
if (FAILED(gWebView->mainFrame(&frame)))
goto exit;
- IWebFramePrivate* framePrivate = 0;
if (FAILED(frame->QueryInterface(&framePrivate)))
goto exit;
@@ -376,8 +376,6 @@ exit:
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
- PAINTSTRUCT ps;
- HDC hdc;
switch (message) {
case WM_COMMAND:
@@ -436,7 +434,6 @@ LRESULT CALLBACK MyEditProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPara
return (LRESULT)CallWindowProc((WNDPROC)DefEditProc,hDlg,message,wParam,lParam);
break;
}
- return 0;
}
diff --git a/WebKitTools/WinLauncher/WinLauncher.h b/WebKitTools/WinLauncher/WinLauncher.h
index adc2b17..a82d7b1 100644
--- a/WebKitTools/WinLauncher/WinLauncher.h
+++ b/WebKitTools/WinLauncher/WinLauncher.h
@@ -1,115 +1,119 @@
-/*
- * Copyright (C) 2006 Apple Computer, 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 COMPUTER, 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 COMPUTER, 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.
- */
-
-#pragma once
-
-#include "resource.h"
-#include <WebKit/WebKit.h>
-
-class WinLauncherWebHost : public IWebFrameLoadDelegate
-{
-public:
- WinLauncherWebHost() : m_refCount(1) {}
-
- // IUnknown
- virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
- virtual ULONG STDMETHODCALLTYPE AddRef(void);
- virtual ULONG STDMETHODCALLTYPE Release(void);
-
- // IWebFrameLoadDelegate
- virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(
- /* [in] */ IWebView* webView,
- /* [in] */ IWebFrame* /*frame*/) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame(
- /* [in] */ IWebView *webView,
- /* [in] */ IWebFrame *frame) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError(
- /* [in] */ IWebView *webView,
- /* [in] */ IWebError *error,
- /* [in] */ IWebFrame *frame) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame(
- /* [in] */ IWebView *webView,
- /* [in] */ IWebFrame *frame) { return updateAddressBar(webView); }
-
- virtual HRESULT STDMETHODCALLTYPE didReceiveTitle(
- /* [in] */ IWebView *webView,
- /* [in] */ BSTR title,
- /* [in] */ IWebFrame *frame) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE didReceiveIcon(
- /* [in] */ IWebView *webView,
- /* [in] */ OLE_HANDLE hBitmap,
- /* [in] */ IWebFrame *frame) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(
- /* [in] */ IWebView* webView,
- /* [in] */ IWebFrame* /*frame*/) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(
- /* [in] */ IWebView *webView,
- /* [in] */ IWebError *error,
- /* [in] */ IWebFrame *forFrame) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame(
- /* [in] */ IWebView *webView,
- /* [in] */ IWebFrame *frame) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL(
- /* [in] */ IWebView *webView,
- /* [in] */ BSTR url,
- /* [in] */ double delaySeconds,
- /* [in] */ DATE fireDate,
- /* [in] */ IWebFrame *frame) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame(
- /* [in] */ IWebView *webView,
- /* [in] */ IWebFrame *frame) { return S_OK; }
-
- virtual HRESULT STDMETHODCALLTYPE willCloseFrame(
- /* [in] */ IWebView *webView,
- /* [in] */ IWebFrame *frame) { return S_OK; }
-
- virtual /* [local] */ HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable(
- /* [in] */ IWebView *webView,
- /* [in] */ JSContextRef context,
- /* [in] */ JSObjectRef windowScriptObject) { return S_OK; }
-
- virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject(
- /* [in] */ IWebView *webView,
- /* [in] */ JSContextRef context,
- /* [in] */ JSObjectRef windowScriptObject,
- /* [in] */ IWebFrame *frame) { return S_OK; }
-
- // WinLauncherWebHost
-
-protected:
- HRESULT updateAddressBar(IWebView* webView);
-
-protected:
- ULONG m_refCount;
-};
+/*
+ * Copyright (C) 2006 Apple Computer, 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 COMPUTER, 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 COMPUTER, 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.
+ */
+
+#pragma once
+
+#include "resource.h"
+#include <WebKit/WebKit.h>
+
+class WinLauncherWebHost : public IWebFrameLoadDelegate
+{
+public:
+ WinLauncherWebHost() : m_refCount(1) {}
+
+ // IUnknown
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject);
+ virtual ULONG STDMETHODCALLTYPE AddRef(void);
+ virtual ULONG STDMETHODCALLTYPE Release(void);
+
+ // IWebFrameLoadDelegate
+ virtual HRESULT STDMETHODCALLTYPE didStartProvisionalLoadForFrame(
+ /* [in] */ IWebView* webView,
+ /* [in] */ IWebFrame* /*frame*/) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE didReceiveServerRedirectForProvisionalLoadForFrame(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE didFailProvisionalLoadWithError(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebError *error,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE didCommitLoadForFrame(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebFrame *frame) { return updateAddressBar(webView); }
+
+ virtual HRESULT STDMETHODCALLTYPE didReceiveTitle(
+ /* [in] */ IWebView *webView,
+ /* [in] */ BSTR title,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE didChangeIcons(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE didReceiveIcon(
+ /* [in] */ IWebView *webView,
+ /* [in] */ OLE_HANDLE hBitmap,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE didFinishLoadForFrame(
+ /* [in] */ IWebView* webView,
+ /* [in] */ IWebFrame* /*frame*/) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE didFailLoadWithError(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebError *error,
+ /* [in] */ IWebFrame *forFrame) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE didChangeLocationWithinPageForFrame(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE willPerformClientRedirectToURL(
+ /* [in] */ IWebView *webView,
+ /* [in] */ BSTR url,
+ /* [in] */ double delaySeconds,
+ /* [in] */ DATE fireDate,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE didCancelClientRedirectForFrame(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ virtual HRESULT STDMETHODCALLTYPE willCloseFrame(
+ /* [in] */ IWebView *webView,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ virtual /* [local] */ HRESULT STDMETHODCALLTYPE windowScriptObjectAvailable(
+ /* [in] */ IWebView *webView,
+ /* [in] */ JSContextRef context,
+ /* [in] */ JSObjectRef windowScriptObject) { return S_OK; }
+
+ virtual /* [local] */ HRESULT STDMETHODCALLTYPE didClearWindowObject(
+ /* [in] */ IWebView *webView,
+ /* [in] */ JSContextRef context,
+ /* [in] */ JSObjectRef windowScriptObject,
+ /* [in] */ IWebFrame *frame) { return S_OK; }
+
+ // WinLauncherWebHost
+
+protected:
+ HRESULT updateAddressBar(IWebView* webView);
+
+protected:
+ ULONG m_refCount;
+};
diff --git a/WebKitTools/WinLauncher/WinLauncher.vcproj b/WebKitTools/WinLauncher/WinLauncher.vcproj
index 4546865..2569f96 100644
--- a/WebKitTools/WinLauncher/WinLauncher.vcproj
+++ b/WebKitTools/WinLauncher/WinLauncher.vcproj
@@ -18,12 +18,11 @@
<Configuration
Name="Debug|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;.\WinLauncherCommon.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -39,10 +38,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(IntDir)\Include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
- UsePrecompiledHeader="2"
- WarningLevel="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -55,21 +50,12 @@
/>
<Tool
Name="VCLinkerTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories="&quot;$(WebKitOutputDir)\lib&quot;;&quot;$(ProjectDir)\..\..\..\&quot;"
- GenerateDebugInformation="true"
- SubSystem="2"
- TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
- TypeLibraryFile=""
- ComponentFileName=""
/>
<Tool
Name="VCXDCMakeTool"
@@ -88,19 +74,16 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\WinLauncherCommon.vsprops"
CharacterSet="1"
- WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -116,10 +99,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\Include\icu&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders&quot;;&quot;$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(IntDir)\include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_WIN32_WINNT=0x501"
- UsePrecompiledHeader="2"
- WarningLevel="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -132,24 +111,12 @@
/>
<Tool
Name="VCLinkerTool"
- LinkLibraryDependencies="false"
- AdditionalOptions="&#x0D;&#x0A;"
- AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
- LinkIncremental="1"
- AdditionalLibraryDirectories="&quot;$(WebKitOutputDir)\lib&quot;;&quot;$(ProjectDir)\..\..\..\&quot;"
- GenerateDebugInformation="true"
- SubSystem="2"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
- TypeLibraryFile=""
- ComponentFileName=""
/>
<Tool
Name="VCXDCMakeTool"
@@ -168,18 +135,16 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
/>
</Configuration>
<Configuration
Name="Debug_Internal|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;.\WinLauncherCommon.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -195,10 +160,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(IntDir)\Include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
- UsePrecompiledHeader="2"
- WarningLevel="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -211,21 +172,12 @@
/>
<Tool
Name="VCLinkerTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories="&quot;$(WebKitOutputDir)\lib&quot;;&quot;$(ProjectDir)\..\..\..\&quot;"
- GenerateDebugInformation="true"
- SubSystem="2"
- TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
- TypeLibraryFile=""
- ComponentFileName=""
/>
<Tool
Name="VCXDCMakeTool"
@@ -244,18 +196,16 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
/>
</Configuration>
<Configuration
Name="Debug_Cairo|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_wincairo.vsprops;.\WinLauncherCommon.vsprops"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -271,10 +221,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(IntDir)\Include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
- UsePrecompiledHeader="2"
- WarningLevel="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -287,21 +233,12 @@
/>
<Tool
Name="VCLinkerTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories="&quot;$(WebKitOutputDir)\lib&quot;;&quot;$(ProjectDir)\..\..\..\&quot;"
- GenerateDebugInformation="true"
- SubSystem="2"
- TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
- TypeLibraryFile=""
- ComponentFileName=""
/>
<Tool
Name="VCXDCMakeTool"
@@ -320,18 +257,78 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
/>
</Configuration>
<Configuration
Name="Debug_All|Win32"
ConfigurationType="1"
- InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_internal.vsprops;$(WebKitLibrariesDir)\tools\vsprops\debug_all.vsprops;.\WinLauncherCommon.vsprops"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ ConfigurationType="1"
+ InheritedPropertySheets="$(WebKitLibrariesDir)\tools\vsprops\common.vsprops;$(WebKitLibrariesDir)\tools\vsprops\release.vsprops;.\WinLauncherCommon.vsprops"
CharacterSet="1"
+ WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
- CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
@@ -347,10 +344,6 @@
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(IntDir)\Include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE"
- UsePrecompiledHeader="2"
- WarningLevel="1"
/>
<Tool
Name="VCManagedResourceCompilerTool"
@@ -363,21 +356,12 @@
/>
<Tool
Name="VCLinkerTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies="comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories="&quot;$(WebKitOutputDir)\lib&quot;;&quot;$(ProjectDir)\..\..\..\&quot;"
- GenerateDebugInformation="true"
- SubSystem="2"
- TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
- TypeLibraryFile=""
- ComponentFileName=""
/>
<Tool
Name="VCXDCMakeTool"
@@ -396,7 +380,6 @@
/>
<Tool
Name="VCPostBuildEventTool"
- CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
/>
</Configuration>
</Configurations>
@@ -455,6 +438,14 @@
UsePrecompiledHeader="1"
/>
</FileConfiguration>
+ <FileConfiguration
+ Name="Release_LTCG|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"
+ />
+ </FileConfiguration>
</File>
<File
RelativePath=".\WinLauncher.cpp"
diff --git a/WebKitTools/WinLauncher/WinLauncherCommon.vsprops b/WebKitTools/WinLauncher/WinLauncherCommon.vsprops
new file mode 100644
index 0000000..4f46524
--- /dev/null
+++ b/WebKitTools/WinLauncher/WinLauncherCommon.vsprops
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioPropertySheet
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="WinLauncherCommon"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(WebKitOutputDir)\include\WebKit&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\WebCore&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)&quot;;&quot;$(IntDir)\Include&quot;;&quot;$(WebKitOutputDir)\obj\WebKit\DerivedSources&quot;"
+ UsePrecompiledHeader="2"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="comdlg32.lib gdi32.lib comctl32.lib shlwapi.lib user32.lib ole32.lib oleaut32.lib WebKitGUID$(WebKitConfigSuffix).lib WebKit$(WebKitDLLConfigSuffix).lib"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if exist &quot;$(WebKitOutputDir)\buildfailed&quot; del &quot;$(WebKitOutputDir)\buildfailed&quot;"
+ />
+ <Tool
+ Name="VCPreBuildEventTool"
+ CommandLine="%SystemDrive%\cygwin\bin\which.exe bash&#x0D;&#x0A;if errorlevel 1 set PATH=%SystemDrive%\cygwin\bin;%PATH%&#x0D;&#x0A;cmd /c&#x0D;&#x0A;if exist &quot;$(WebKitOutputDir)\buildfailed&quot; grep XX$(ProjectName)XX &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;if errorlevel 1 exit 1&#x0D;&#x0A;echo XX$(ProjectName)XX &gt; &quot;$(WebKitOutputDir)\buildfailed&quot;&#x0D;&#x0A;"
+ />
+</VisualStudioPropertySheet>
diff --git a/WebKitTools/gdb/webcore.py b/WebKitTools/gdb/webcore.py
new file mode 100644
index 0000000..8dc4d8e
--- /dev/null
+++ b/WebKitTools/gdb/webcore.py
@@ -0,0 +1,32 @@
+# Copyright (C) 2010, Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# For backward compatibility.
+import webkit
+print ("webcore.py is deprecated. Please use 'import webkit' instead of "
+ "'import webcore' in your ~/.gdbinit.")
diff --git a/WebKitTools/gdb/webkit.py b/WebKitTools/gdb/webkit.py
new file mode 100644
index 0000000..95c3d9c
--- /dev/null
+++ b/WebKitTools/gdb/webkit.py
@@ -0,0 +1,304 @@
+# Copyright (C) 2010, Google Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+"""GDB support for WebKit types.
+
+Add this to your gdb by amending your ~/.gdbinit as follows:
+ python
+ import sys
+ sys.path.insert(0, "/path/to/tools/gdb/")
+ import webkit
+"""
+
+import gdb
+import re
+import struct
+
+
+def ustring_to_string(ptr, length=None):
+ """Convert a pointer to UTF-16 data into a Python Unicode string.
+
+ ptr and length are both gdb.Value objects.
+ If length is unspecified, will guess at the length."""
+ extra = ''
+ if length is None:
+ # Try to guess at the length.
+ for i in xrange(0, 2048):
+ if int((ptr + i).dereference()) == 0:
+ length = i
+ break
+ if length is None:
+ length = 256
+ extra = u' (no trailing NUL found)'
+ else:
+ length = int(length)
+
+ char_vals = [int((ptr + i).dereference()) for i in xrange(length)]
+ string = struct.pack('H' * length, *char_vals).decode('utf-16', 'replace')
+
+ return string + extra
+
+
+class StringPrinter(object):
+ "Shared code between different string-printing classes"
+ def __init__(self, val):
+ self.val = val
+
+ def display_hint(self):
+ return 'string'
+
+
+class UCharStringPrinter(StringPrinter):
+ "Print a UChar*; we must guess at the length"
+ def to_string(self):
+ return ustring_to_string(self.val)
+
+
+class WTFAtomicStringPrinter(StringPrinter):
+ "Print a WTF::AtomicString"
+ def to_string(self):
+ return self.val['m_string']
+
+
+class WTFStringPrinter(StringPrinter):
+ "Print a WTF::String"
+ def get_length(self):
+ if not self.val['m_impl']['m_ptr']:
+ return 0
+ return self.val['m_impl']['m_ptr']['m_length']
+
+ def to_string(self):
+ if self.get_length() == 0:
+ return '(null)'
+
+ return ustring_to_string(self.val['m_impl']['m_ptr']['m_data'],
+ self.get_length())
+
+
+class JSCUStringPrinter(StringPrinter):
+ "Print a JSC::UString"
+ def get_length(self):
+ if not self.val['m_impl']['m_ptr']:
+ return 0
+ return self.val['m_impl']['m_ptr']['m_length']
+
+ def to_string(self):
+ if self.get_length() == 0:
+ return ''
+
+ return ustring_to_string(self.val['m_impl']['m_ptr']['m_data'],
+ self.get_length())
+
+
+class JSCIdentifierPrinter(StringPrinter):
+ "Print a JSC::Identifier"
+ def to_string(self):
+ return JSCUStringPrinter(self.val['m_string']).to_string()
+
+
+class JSCJSStringPrinter(StringPrinter):
+ "Print a JSC::JSString"
+ def to_string(self):
+ if self.val['m_length'] == 0:
+ return ''
+
+ return JSCUStringPrinter(self.val['m_value']).to_string()
+
+
+class WebCoreQualifiedNamePrinter(StringPrinter):
+ "Print a WebCore::QualifiedName"
+
+ def __init__(self, val):
+ super(WebCoreQualifiedNamePrinter, self).__init__(val)
+ self.prefix_length = 0
+ self.length = 0
+ if self.val['m_impl']:
+ self.prefix_printer = WTFStringPrinter(
+ self.val['m_impl']['m_prefix']['m_string'])
+ self.local_name_printer = WTFStringPrinter(
+ self.val['m_impl']['m_localName']['m_string'])
+ self.prefix_length = self.prefix_printer.get_length()
+ if self.prefix_length > 0:
+ self.length = (self.prefix_length + 1 +
+ self.local_name_printer.get_length())
+ else:
+ self.length = self.local_name_printer.get_length()
+
+ def get_length(self):
+ return self.length
+
+ def to_string(self):
+ if self.get_length() == 0:
+ return "(null)"
+ else:
+ if self.prefix_length > 0:
+ return (self.prefix_printer.to_string() + ":" +
+ self.local_name_printer.to_string())
+ else:
+ return self.local_name_printer.to_string()
+
+
+class WTFVectorPrinter:
+ """Pretty Printer for a WTF::Vector.
+
+ The output of this pretty printer is similar to the output of std::vector's
+ pretty printer, which is bundled in gcc.
+
+ Example gdb session should look like:
+ (gdb) p v
+ $3 = WTF::Vector of length 7, capacity 16 = {7, 17, 27, 37, 47, 57, 67}
+ (gdb) set print elements 3
+ (gdb) p v
+ $6 = WTF::Vector of length 7, capacity 16 = {7, 17, 27...}
+ (gdb) set print array
+ (gdb) p v
+ $7 = WTF::Vector of length 7, capacity 16 = {
+ 7,
+ 17,
+ 27
+ ...
+ }
+ (gdb) set print elements 200
+ (gdb) p v
+ $8 = WTF::Vector of length 7, capacity 16 = {
+ 7,
+ 17,
+ 27,
+ 37,
+ 47,
+ 57,
+ 67
+ }
+ """
+
+ class Iterator:
+ def __init__(self, start, finish):
+ self.item = start
+ self.finish = finish
+ self.count = 0
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ if self.item == self.finish:
+ raise StopIteration
+ count = self.count
+ self.count += 1
+ element = self.item.dereference()
+ self.item += 1
+ return ('[%d]' % count, element)
+
+ def __init__(self, val):
+ self.val = val
+
+ def children(self):
+ start = self.val['m_buffer']['m_buffer']
+ return self.Iterator(start, start + self.val['m_size'])
+
+ def to_string(self):
+ return ('%s of length %d, capacity %d'
+ % ('WTF::Vector', self.val['m_size'], self.val['m_buffer']['m_capacity']))
+
+ def display_hint(self):
+ return 'array'
+
+def add_pretty_printers():
+ pretty_printers_dict = {
+ re.compile("^WTF::Vector<.*>$"): WTFVectorPrinter,
+ re.compile("^WTF::AtomicString$"): WTFAtomicStringPrinter,
+ re.compile("^WTF::String$"): WTFStringPrinter,
+ re.compile("^WebCore::QualifiedName$"): WebCoreQualifiedNamePrinter,
+ re.compile("^JSC::UString$"): JSCUStringPrinter,
+ re.compile("^JSC::Identifier$"): JSCIdentifierPrinter,
+ re.compile("^JSC::JSString$"): JSCJSStringPrinter,
+ }
+
+ def lookup_function(val):
+ """Function used to load pretty printers; will be passed to GDB."""
+ type = val.type
+ if type.code == gdb.TYPE_CODE_REF:
+ type = type.target()
+ type = type.unqualified().strip_typedefs()
+ typename = type.tag
+ if not typename:
+ return None
+ for function, pretty_printer in pretty_printers_dict.items():
+ if function.search(typename):
+ return pretty_printer(val)
+
+ if type.code == gdb.TYPE_CODE_PTR:
+ name = str(type.target().unqualified())
+ if name == 'UChar':
+ return UCharStringPrinter(val)
+ return None
+
+ gdb.pretty_printers.append(lookup_function)
+
+
+add_pretty_printers()
+
+
+class PrintPathToRootCommand(gdb.Command):
+ """Command for printing WebKit Node trees.
+
+ Usage: printpathtoroot variable_name"""
+
+ def __init__(self):
+ super(PrintPathToRootCommand, self).__init__("printpathtoroot",
+ gdb.COMMAND_SUPPORT,
+ gdb.COMPLETE_NONE)
+
+ def invoke(self, arg, from_tty):
+ element_type = gdb.lookup_type('WebCore::Element')
+ node_type = gdb.lookup_type('WebCore::Node')
+ frame = gdb.selected_frame()
+ try:
+ val = gdb.Frame.read_var(frame, arg)
+ except:
+ print "No such variable, or invalid type"
+ return
+
+ target_type = str(val.type.target().strip_typedefs())
+ if target_type == str(node_type):
+ stack = []
+ while val:
+ stack.append([val,
+ val.cast(element_type.pointer()).dereference()['m_tagName']])
+ val = val.dereference()['m_parent']
+
+ padding = ''
+ while len(stack) > 0:
+ pair = stack.pop()
+ print padding, pair[1], pair[0]
+ padding = padding + ' '
+ else:
+ print 'Sorry: I don\'t know how to deal with %s yet.' % target_type
+
+
+PrintPathToRootCommand()
diff --git a/WebKitTools/iExploder/htdocs/cssproperties.in b/WebKitTools/iExploder/htdocs/cssproperties.in
index 52ccdbe..d49eb8e 100644
--- a/WebKitTools/iExploder/htdocs/cssproperties.in
+++ b/WebKitTools/iExploder/htdocs/cssproperties.in
@@ -1,8 +1,9 @@
-# From WebKit svn r53119 (WebCore/css/CSSPropertyNames.in)
+# From WebKit svn r66165 (WebCore/css/CSSPropertyNames.in)
-webkit-animation
-webkit-animation-delay
-webkit-animation-direction
-webkit-animation-duration
+-webkit-animation-fill-mode
-webkit-animation-iteration-count
-webkit-animation-name
-webkit-animation-play-state
@@ -13,11 +14,18 @@
-webkit-background-composite
-webkit-background-origin
-webkit-background-size
--webkit-binding
+-webkit-border-end
+-webkit-border-end-color
+-webkit-border-end-style
+-webkit-border-end-width
-webkit-border-fit
-webkit-border-horizontal-spacing
-webkit-border-image
-webkit-border-radius
+-webkit-border-start
+-webkit-border-start-color
+-webkit-border-start-style
+-webkit-border-start-width
-webkit-border-vertical-spacing
-webkit-box-align
-webkit-box-direction
@@ -29,7 +37,6 @@
-webkit-box-pack
-webkit-box-reflect
-webkit-box-shadow
--webkit-box-sizing
-webkit-color-correction
-webkit-column-break-after
-webkit-column-break-before
@@ -40,15 +47,20 @@
-webkit-column-rule-color
-webkit-column-rule-style
-webkit-column-rule-width
+-webkit-column-span
-webkit-column-width
-webkit-columns
-webkit-font-size-delta
-webkit-font-smoothing
-webkit-highlight
+-webkit-hyphenate-character
+-webkit-hyphenate-locale
+-webkit-hyphens
-webkit-line-break
-webkit-line-clamp
-webkit-margin-bottom-collapse
-webkit-margin-collapse
+-webkit-margin-end
-webkit-margin-start
-webkit-margin-top-collapse
-webkit-marquee
@@ -73,6 +85,7 @@
-webkit-mask-size
-webkit-match-nearest-mail-blockquote-color
-webkit-nbsp-mode
+-webkit-padding-end
-webkit-padding-start
-webkit-perspective
-webkit-perspective-origin
@@ -142,6 +155,7 @@ border-top-style
border-top-width
border-width
bottom
+box-sizing
caption-side
clear
clip
@@ -260,6 +274,9 @@ column-span
column-width
column-width-policy
+# Removed from WebKit between r53119 and r66165
+-webkit-binding
+
# Removed from WebKit between r44660 and r53119
-webkit-border-bottom-left-radius
-webkit-border-bottom-right-radius
diff --git a/WebKitTools/iExploder/htdocs/htmlattrs.in b/WebKitTools/iExploder/htdocs/htmlattrs.in
index 2238427..0dc8116 100644
--- a/WebKitTools/iExploder/htdocs/htmlattrs.in
+++ b/WebKitTools/iExploder/htdocs/htmlattrs.in
@@ -1,4 +1,4 @@
-# From WebKit svn r53119 (WebCore/html/HTMLAttributeNames.in)
+# From WebKit svn r66165 (WebCore/html/HTMLAttributeNames.in)
abbr
accept
accept_charset
@@ -19,6 +19,8 @@ aria-dropeffect
aria-expanded
aria-flowto
aria-grabbed
+aria-haspopup
+aria-help
aria-hidden
aria-label
aria-labeledby
@@ -37,7 +39,7 @@ aria-valuemax
aria-valuemin
aria-valuenow
aria-valuetext
-autobuffer
+async
autocomplete
autofocus
autoplay
@@ -83,6 +85,7 @@ disabled
draggable
enctype
end
+event
expanded
face
focused
@@ -93,6 +96,7 @@ frameborder
headers
height
hidden
+high
href
hreflang
hspace
@@ -112,6 +116,7 @@ longdesc
loop
loopend
loopstart
+low
lowsrc
manifest
marginheight
@@ -135,6 +140,7 @@ onbeforecopy
onbeforecut
onbeforeload
onbeforepaste
+onbeforeprocess
onbeforeunload
onblur
oncanplay
@@ -157,6 +163,8 @@ onemptied
onended
onerror
onfocus
+onfocusin
+onfocusout
onhashchange
oninput
oninvalid
@@ -198,6 +206,7 @@ onstorage
onsubmit
onsuspend
ontimeupdate
+ontouchcancel
ontouchend
ontouchmove
ontouchstart
@@ -210,12 +219,14 @@ onwebkitanimationstart
onwebkitbeginfullscreen
onwebkitendfullscreen
onwebkittransitionend
+optimum
pattern
placeholder
playcount
pluginurl
poster
precision
+preload
primary
profile
progress
@@ -241,6 +252,7 @@ size
sortable
sortdirection
span
+speech
spellcheck
src
standby
@@ -265,9 +277,13 @@ version
viewsource
vlink
vspace
+webkitdirectory
width
wrap
+# Removed from WebKit between r53119 and r56558
+autobuffer
+
# Removed from WebKit between r14011 and r53119
left
pagex
diff --git a/WebKitTools/iExploder/htdocs/htmltags.in b/WebKitTools/iExploder/htdocs/htmltags.in
index b47dd9c..319d528 100644
--- a/WebKitTools/iExploder/htdocs/htmltags.in
+++ b/WebKitTools/iExploder/htdocs/htmltags.in
@@ -1,4 +1,4 @@
-# From WebKit svn r53119 (WebCore/html/HTMLTagNames.in)
+# From WebKit svn r66165 (WebCore/html/HTMLTagNames.in)
a
abbr
acronym
@@ -12,6 +12,7 @@ b
base
basefont
bdo
+bgsound
big
blockquote
body
@@ -24,12 +25,14 @@ cite
code
col
colgroup
+command
datagrid
datalist
dcell
dcol
dd
del
+details
dfn
dir
div
@@ -39,6 +42,8 @@ dt
em
embed
fieldset
+figcaption
+figure
font
footer
form
@@ -52,6 +57,7 @@ h5
h6
head
header
+hgroup
hr
html
i
@@ -70,9 +76,11 @@ li
link
listing
map
+mark
marquee
menu
meta
+meter
nav
nobr
noembed
@@ -88,6 +96,7 @@ p
param
plaintext
pre
+progress
q
rp
rt
@@ -104,6 +113,7 @@ strike
strong
style
sub
+summary
sup
table
tbody
@@ -114,6 +124,7 @@ th
thead
title
tr
+track
tt
u
ul
diff --git a/WebKitTools/pywebsocket/COPYING b/WebKitTools/pywebsocket/COPYING
deleted file mode 100644
index ab9d52d..0000000
--- a/WebKitTools/pywebsocket/COPYING
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright 2009, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/WebKitTools/pywebsocket/MANIFEST.in b/WebKitTools/pywebsocket/MANIFEST.in
deleted file mode 100644
index 1925688..0000000
--- a/WebKitTools/pywebsocket/MANIFEST.in
+++ /dev/null
@@ -1,6 +0,0 @@
-include COPYING
-include MANIFEST.in
-include README
-recursive-include example *.py
-recursive-include mod_pywebsocket *.py
-recursive-include test *.py
diff --git a/WebKitTools/pywebsocket/README b/WebKitTools/pywebsocket/README
deleted file mode 100644
index 1f9f05f..0000000
--- a/WebKitTools/pywebsocket/README
+++ /dev/null
@@ -1,6 +0,0 @@
-Install this package by:
-$ python setup.py build
-$ sudo python setup.py install
-
-Then read document by:
-$ pydoc mod_pywebsocket
diff --git a/WebKitTools/pywebsocket/example/echo_client.py b/WebKitTools/pywebsocket/example/echo_client.py
deleted file mode 100644
index 3262a6d..0000000
--- a/WebKitTools/pywebsocket/example/echo_client.py
+++ /dev/null
@@ -1,207 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Web Socket Echo client.
-
-This is an example Web Socket client that talks with echo_wsh.py.
-This may be useful for checking mod_pywebsocket installation.
-
-Note:
-This code is far from robust, e.g., we cut corners in handshake.
-"""
-
-
-import codecs
-from optparse import OptionParser
-import socket
-import sys
-
-
-_TIMEOUT_SEC = 10
-
-_DEFAULT_PORT = 80
-_DEFAULT_SECURE_PORT = 443
-_UNDEFINED_PORT = -1
-
-_UPGRADE_HEADER = 'Upgrade: WebSocket\r\n'
-_CONNECTION_HEADER = 'Connection: Upgrade\r\n'
-_EXPECTED_RESPONSE = (
- 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n' +
- _UPGRADE_HEADER +
- _CONNECTION_HEADER)
-
-_GOODBYE_MESSAGE = 'Goodbye'
-
-
-def _method_line(resource):
- return 'GET %s HTTP/1.1\r\n' % resource
-
-
-def _origin_header(origin):
- return 'Origin: %s\r\n' % origin
-
-
-class _TLSSocket(object):
- """Wrapper for a TLS connection."""
-
- def __init__(self, raw_socket):
- self._ssl = socket.ssl(raw_socket)
-
- def send(self, bytes):
- return self._ssl.write(bytes)
-
- def recv(self, size=-1):
- return self._ssl.read(size)
-
- def close(self):
- # Nothing to do.
- pass
-
-
-class EchoClient(object):
- """Web Socket echo client."""
-
- def __init__(self, options):
- self._options = options
- self._socket = None
-
- def run(self):
- """Run the client.
-
- Shake hands and then repeat sending message and receiving its echo.
- """
- self._socket = socket.socket()
- self._socket.settimeout(self._options.socket_timeout)
- try:
- self._socket.connect((self._options.server_host,
- self._options.server_port))
- if self._options.use_tls:
- self._socket = _TLSSocket(self._socket)
- self._handshake()
- for line in self._options.message.split(',') + [_GOODBYE_MESSAGE]:
- frame = '\x00' + line.encode('utf-8') + '\xff'
- self._socket.send(frame)
- if self._options.verbose:
- print 'Send: %s' % line
- received = self._socket.recv(len(frame))
- if received != frame:
- raise Exception('Incorrect echo: %r' % received)
- if self._options.verbose:
- print 'Recv: %s' % received[1:-1].decode('utf-8',
- 'replace')
- finally:
- self._socket.close()
-
- def _handshake(self):
- self._socket.send(_method_line(self._options.resource))
- self._socket.send(_UPGRADE_HEADER)
- self._socket.send(_CONNECTION_HEADER)
- self._socket.send(self._format_host_header())
- self._socket.send(_origin_header(self._options.origin))
- self._socket.send('\r\n')
-
- for expected_char in _EXPECTED_RESPONSE:
- received = self._socket.recv(1)[0]
- if expected_char != received:
- raise Exception('Handshake failure')
- # We cut corners and skip other headers.
- self._skip_headers()
-
- def _skip_headers(self):
- terminator = '\r\n\r\n'
- pos = 0
- while pos < len(terminator):
- received = self._socket.recv(1)[0]
- if received == terminator[pos]:
- pos += 1
- elif received == terminator[0]:
- pos = 1
- else:
- pos = 0
-
- def _format_host_header(self):
- host = 'Host: ' + self._options.server_host
- if ((not self._options.use_tls and
- self._options.server_port != _DEFAULT_PORT) or
- (self._options.use_tls and
- self._options.server_port != _DEFAULT_SECURE_PORT)):
- host += ':' + str(self._options.server_port)
- host += '\r\n'
- return host
-
-
-def main():
- sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
-
- parser = OptionParser()
- parser.add_option('-s', '--server_host', dest='server_host', type='string',
- default='localhost', help='server host')
- parser.add_option('-p', '--server_port', dest='server_port', type='int',
- default=_UNDEFINED_PORT, help='server port')
- parser.add_option('-o', '--origin', dest='origin', type='string',
- default='http://localhost/', help='origin')
- parser.add_option('-r', '--resource', dest='resource', type='string',
- default='/echo', help='resource path')
- parser.add_option('-m', '--message', dest='message', type='string',
- help=('comma-separated messages to send excluding "%s" '
- 'that is always sent at the end' %
- _GOODBYE_MESSAGE))
- parser.add_option('-q', '--quiet', dest='verbose', action='store_false',
- default=True, help='suppress messages')
- parser.add_option('-t', '--tls', dest='use_tls', action='store_true',
- default=False, help='use TLS (wss://)')
- parser.add_option('-k', '--socket_timeout', dest='socket_timeout',
- type='int', default=_TIMEOUT_SEC,
- help='Timeout(sec) for sockets')
-
- (options, unused_args) = parser.parse_args()
-
- # Default port number depends on whether TLS is used.
- if options.server_port == _UNDEFINED_PORT:
- if options.use_tls:
- options.server_port = _DEFAULT_SECURE_PORT
- else:
- options.server_port = _DEFAULT_PORT
-
- # optparse doesn't seem to handle non-ascii default values.
- # Set default message here.
- if not options.message:
- options.message = u'Hello,\u65e5\u672c' # "Japan" in Japanese
-
- EchoClient(options).run()
-
-
-if __name__ == '__main__':
- main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/__init__.py b/WebKitTools/pywebsocket/mod_pywebsocket/__init__.py
deleted file mode 100644
index 05e80e8..0000000
--- a/WebKitTools/pywebsocket/mod_pywebsocket/__init__.py
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Web Socket extension for Apache HTTP Server.
-
-mod_pywebsocket is a Web Socket extension for Apache HTTP Server
-intended for testing or experimental purposes. mod_python is required.
-
-Installation:
-
-0. Prepare an Apache HTTP Server for which mod_python is enabled.
-
-1. Specify the following Apache HTTP Server directives to suit your
- configuration.
-
- If mod_pywebsocket is not in the Python path, specify the following.
- <websock_lib> is the directory where mod_pywebsocket is installed.
-
- PythonPath "sys.path+['<websock_lib>']"
-
- Always specify the following. <websock_handlers> is the directory where
- user-written Web Socket handlers are placed.
-
- PythonOption mod_pywebsocket.handler_root <websock_handlers>
- PythonHeaderParserHandler mod_pywebsocket.headerparserhandler
-
- To limit the search for Web Socket handlers to a directory <scan_dir>
- under <websock_handlers>, configure as follows:
-
- PythonOption mod_pywebsocket.handler_scan <scan_dir>
-
- <scan_dir> is useful in saving scan time when <websock_handlers>
- contains many non-Web Socket handler files.
-
- Example snippet of httpd.conf:
- (mod_pywebsocket is in /websock_lib, Web Socket handlers are in
- /websock_handlers, port is 80 for ws, 443 for wss.)
-
- <IfModule python_module>
- PythonPath "sys.path+['/websock_lib']"
- PythonOption mod_pywebsocket.handler_root /websock_handlers
- PythonHeaderParserHandler mod_pywebsocket.headerparserhandler
- </IfModule>
-
-Writing Web Socket handlers:
-
-When a Web Socket request comes in, the resource name
-specified in the handshake is considered as if it is a file path under
-<websock_handlers> and the handler defined in
-<websock_handlers>/<resource_name>_wsh.py is invoked.
-
-For example, if the resource name is /example/chat, the handler defined in
-<websock_handlers>/example/chat_wsh.py is invoked.
-
-A Web Socket handler is composed of the following two functions:
-
- web_socket_do_extra_handshake(request)
- web_socket_transfer_data(request)
-
-where:
- request: mod_python request.
-
-web_socket_do_extra_handshake is called during the handshake after the
-headers are successfully parsed and Web Socket properties (ws_location,
-ws_origin, ws_protocol, and ws_resource) are added to request. A handler
-can reject the request by raising an exception.
-
-web_socket_transfer_data is called after the handshake completed
-successfully. A handler can receive/send messages from/to the client
-using request. mod_pywebsocket.msgutil module provides utilities
-for data transfer.
-
-A Web Socket handler must be thread-safe if the server (Apache or
-standalone.py) is configured to use threads.
-"""
-
-
-# vi:sts=4 sw=4 et tw=72
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/dispatch.py b/WebKitTools/pywebsocket/mod_pywebsocket/dispatch.py
deleted file mode 100644
index c52e9eb..0000000
--- a/WebKitTools/pywebsocket/mod_pywebsocket/dispatch.py
+++ /dev/null
@@ -1,231 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Dispatch Web Socket request.
-"""
-
-
-import os
-import re
-
-import util
-
-
-_SOURCE_PATH_PATTERN = re.compile(r'(?i)_wsh\.py$')
-_SOURCE_SUFFIX = '_wsh.py'
-_DO_EXTRA_HANDSHAKE_HANDLER_NAME = 'web_socket_do_extra_handshake'
-_TRANSFER_DATA_HANDLER_NAME = 'web_socket_transfer_data'
-
-
-class DispatchError(Exception):
- """Exception in dispatching Web Socket request."""
-
- pass
-
-
-def _normalize_path(path):
- """Normalize path.
-
- Args:
- path: the path to normalize.
-
- Path is converted to the absolute path.
- The input path can use either '\\' or '/' as the separator.
- The normalized path always uses '/' regardless of the platform.
- """
-
- path = path.replace('\\', os.path.sep)
- path = os.path.realpath(path)
- path = path.replace('\\', '/')
- return path
-
-
-def _path_to_resource_converter(base_dir):
- base_dir = _normalize_path(base_dir)
- base_len = len(base_dir)
- suffix_len = len(_SOURCE_SUFFIX)
- def converter(path):
- if not path.endswith(_SOURCE_SUFFIX):
- return None
- path = _normalize_path(path)
- if not path.startswith(base_dir):
- return None
- return path[base_len:-suffix_len]
- return converter
-
-
-def _source_file_paths(directory):
- """Yield Web Socket Handler source file names in the given directory."""
-
- for root, unused_dirs, files in os.walk(directory):
- for base in files:
- path = os.path.join(root, base)
- if _SOURCE_PATH_PATTERN.search(path):
- yield path
-
-
-def _source(source_str):
- """Source a handler definition string."""
-
- global_dic = {}
- try:
- exec source_str in global_dic
- except Exception:
- raise DispatchError('Error in sourcing handler:' +
- util.get_stack_trace())
- return (_extract_handler(global_dic, _DO_EXTRA_HANDSHAKE_HANDLER_NAME),
- _extract_handler(global_dic, _TRANSFER_DATA_HANDLER_NAME))
-
-
-def _extract_handler(dic, name):
- if name not in dic:
- raise DispatchError('%s is not defined.' % name)
- handler = dic[name]
- if not callable(handler):
- raise DispatchError('%s is not callable.' % name)
- return handler
-
-
-class Dispatcher(object):
- """Dispatches Web Socket requests.
-
- This class maintains a map from resource name to handlers.
- """
-
- def __init__(self, root_dir, scan_dir=None):
- """Construct an instance.
-
- Args:
- root_dir: The directory where handler definition files are
- placed.
- scan_dir: The directory where handler definition files are
- searched. scan_dir must be a directory under root_dir,
- including root_dir itself. If scan_dir is None, root_dir
- is used as scan_dir. scan_dir can be useful in saving
- scan time when root_dir contains many subdirectories.
- """
-
- self._handlers = {}
- self._source_warnings = []
- if scan_dir is None:
- scan_dir = root_dir
- if not os.path.realpath(scan_dir).startswith(
- os.path.realpath(root_dir)):
- raise DispatchError('scan_dir:%s must be a directory under '
- 'root_dir:%s.' % (scan_dir, root_dir))
- self._source_files_in_dir(root_dir, scan_dir)
-
- def add_resource_path_alias(self,
- alias_resource_path, existing_resource_path):
- """Add resource path alias.
-
- Once added, request to alias_resource_path would be handled by
- handler registered for existing_resource_path.
-
- Args:
- alias_resource_path: alias resource path
- existing_resource_path: existing resource path
- """
- try:
- handler = self._handlers[existing_resource_path]
- self._handlers[alias_resource_path] = handler
- except KeyError:
- raise DispatchError('No handler for: %r' % existing_resource_path)
-
- def source_warnings(self):
- """Return warnings in sourcing handlers."""
-
- return self._source_warnings
-
- def do_extra_handshake(self, request):
- """Do extra checking in Web Socket handshake.
-
- Select a handler based on request.uri and call its
- web_socket_do_extra_handshake function.
-
- Args:
- request: mod_python request.
- """
-
- do_extra_handshake_, unused_transfer_data = self._handler(request)
- try:
- do_extra_handshake_(request)
- except Exception, e:
- util.prepend_message_to_exception(
- '%s raised exception for %s: ' % (
- _DO_EXTRA_HANDSHAKE_HANDLER_NAME,
- request.ws_resource),
- e)
- raise
-
- def transfer_data(self, request):
- """Let a handler transfer_data with a Web Socket client.
-
- Select a handler based on request.ws_resource and call its
- web_socket_transfer_data function.
-
- Args:
- request: mod_python request.
- """
-
- unused_do_extra_handshake, transfer_data_ = self._handler(request)
- try:
- transfer_data_(request)
- except Exception, e:
- util.prepend_message_to_exception(
- '%s raised exception for %s: ' % (
- _TRANSFER_DATA_HANDLER_NAME, request.ws_resource),
- e)
- raise
-
- def _handler(self, request):
- try:
- ws_resource_path = request.ws_resource.split('?', 1)[0]
- return self._handlers[ws_resource_path]
- except KeyError:
- raise DispatchError('No handler for: %r' % request.ws_resource)
-
- def _source_files_in_dir(self, root_dir, scan_dir):
- """Source all the handler source files in the scan_dir directory.
-
- The resource path is determined relative to root_dir.
- """
-
- to_resource = _path_to_resource_converter(root_dir)
- for path in _source_file_paths(scan_dir):
- try:
- handlers = _source(open(path).read())
- except DispatchError, e:
- self._source_warnings.append('%s: %s' % (path, e))
- continue
- self._handlers[to_resource(path)] = handlers
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/handshake.py b/WebKitTools/pywebsocket/mod_pywebsocket/handshake.py
deleted file mode 100644
index b86278e..0000000
--- a/WebKitTools/pywebsocket/mod_pywebsocket/handshake.py
+++ /dev/null
@@ -1,220 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Web Socket handshaking.
-
-Note: request.connection.write/read are used in this module, even though
-mod_python document says that they should be used only in connection handlers.
-Unfortunately, we have no other options. For example, request.write/read are
-not suitable because they don't allow direct raw bytes writing/reading.
-"""
-
-
-import re
-
-import util
-
-
-_DEFAULT_WEB_SOCKET_PORT = 80
-_DEFAULT_WEB_SOCKET_SECURE_PORT = 443
-_WEB_SOCKET_SCHEME = 'ws'
-_WEB_SOCKET_SECURE_SCHEME = 'wss'
-
-_MANDATORY_HEADERS = [
- # key, expected value or None
- ['Upgrade', 'WebSocket'],
- ['Connection', 'Upgrade'],
- ['Host', None],
- ['Origin', None],
-]
-
-_FIRST_FIVE_LINES = map(re.compile, [
- r'^GET /[\S]* HTTP/1.1\r\n$',
- r'^Upgrade: WebSocket\r\n$',
- r'^Connection: Upgrade\r\n$',
- r'^Host: [\S]+\r\n$',
- r'^Origin: [\S]+\r\n$',
-])
-
-_SIXTH_AND_LATER = re.compile(
- r'^'
- r'(WebSocket-Protocol: [\x20-\x7e]+\r\n)?'
- r'(Cookie: [^\r]*\r\n)*'
- r'(Cookie2: [^\r]*\r\n)?'
- r'(Cookie: [^\r]*\r\n)*'
- r'\r\n')
-
-
-def _default_port(is_secure):
- if is_secure:
- return _DEFAULT_WEB_SOCKET_SECURE_PORT
- else:
- return _DEFAULT_WEB_SOCKET_PORT
-
-
-class HandshakeError(Exception):
- """Exception in Web Socket Handshake."""
-
- pass
-
-
-def _validate_protocol(protocol):
- """Validate WebSocket-Protocol string."""
-
- if not protocol:
- raise HandshakeError('Invalid WebSocket-Protocol: empty')
- for c in protocol:
- if not 0x20 <= ord(c) <= 0x7e:
- raise HandshakeError('Illegal character in protocol: %r' % c)
-
-
-class Handshaker(object):
- """This class performs Web Socket handshake."""
-
- def __init__(self, request, dispatcher, strict=False):
- """Construct an instance.
-
- Args:
- request: mod_python request.
- dispatcher: Dispatcher (dispatch.Dispatcher).
- strict: Strictly check handshake request. Default: False.
- If True, request.connection must provide get_memorized_lines
- method.
-
- Handshaker will add attributes such as ws_resource in performing
- handshake.
- """
-
- self._request = request
- self._dispatcher = dispatcher
- self._strict = strict
-
- def do_handshake(self):
- """Perform Web Socket Handshake."""
-
- self._check_header_lines()
- self._set_resource()
- self._set_origin()
- self._set_location()
- self._set_protocol()
- self._dispatcher.do_extra_handshake(self._request)
- self._send_handshake()
-
- def _set_resource(self):
- self._request.ws_resource = self._request.uri
-
- def _set_origin(self):
- self._request.ws_origin = self._request.headers_in['Origin']
-
- def _set_location(self):
- location_parts = []
- if self._request.is_https():
- location_parts.append(_WEB_SOCKET_SECURE_SCHEME)
- else:
- location_parts.append(_WEB_SOCKET_SCHEME)
- location_parts.append('://')
- host, port = self._parse_host_header()
- connection_port = self._request.connection.local_addr[1]
- if port != connection_port:
- raise HandshakeError('Header/connection port mismatch: %d/%d' %
- (port, connection_port))
- location_parts.append(host)
- if (port != _default_port(self._request.is_https())):
- location_parts.append(':')
- location_parts.append(str(port))
- location_parts.append(self._request.uri)
- self._request.ws_location = ''.join(location_parts)
-
- def _parse_host_header(self):
- fields = self._request.headers_in['Host'].split(':', 1)
- if len(fields) == 1:
- return fields[0], _default_port(self._request.is_https())
- try:
- return fields[0], int(fields[1])
- except ValueError, e:
- raise HandshakeError('Invalid port number format: %r' % e)
-
- def _set_protocol(self):
- protocol = self._request.headers_in.get('WebSocket-Protocol')
- if protocol is not None:
- _validate_protocol(protocol)
- self._request.ws_protocol = protocol
-
- def _send_handshake(self):
- self._request.connection.write(
- 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n')
- self._request.connection.write('Upgrade: WebSocket\r\n')
- self._request.connection.write('Connection: Upgrade\r\n')
- self._request.connection.write('WebSocket-Origin: ')
- self._request.connection.write(self._request.ws_origin)
- self._request.connection.write('\r\n')
- self._request.connection.write('WebSocket-Location: ')
- self._request.connection.write(self._request.ws_location)
- self._request.connection.write('\r\n')
- if self._request.ws_protocol:
- self._request.connection.write('WebSocket-Protocol: ')
- self._request.connection.write(self._request.ws_protocol)
- self._request.connection.write('\r\n')
- self._request.connection.write('\r\n')
-
- def _check_header_lines(self):
- for key, expected_value in _MANDATORY_HEADERS:
- actual_value = self._request.headers_in.get(key)
- if not actual_value:
- raise HandshakeError('Header %s is not defined' % key)
- if expected_value:
- if actual_value != expected_value:
- raise HandshakeError('Illegal value for header %s: %s' %
- (key, actual_value))
- if self._strict:
- try:
- lines = self._request.connection.get_memorized_lines()
- except AttributeError, e:
- util.prepend_message_to_exception(
- 'Strict handshake is specified but the connection '
- 'doesn\'t provide get_memorized_lines()', e)
- raise
- self._check_first_lines(lines)
-
- def _check_first_lines(self, lines):
- if len(lines) < len(_FIRST_FIVE_LINES):
- raise HandshakeError('Too few header lines: %d' % len(lines))
- for line, regexp in zip(lines, _FIRST_FIVE_LINES):
- if not regexp.search(line):
- raise HandshakeError('Unexpected header: %r doesn\'t match %r'
- % (line, regexp.pattern))
- sixth_and_later = ''.join(lines[5:])
- if not _SIXTH_AND_LATER.search(sixth_and_later):
- raise HandshakeError('Unexpected header: %r doesn\'t match %r'
- % (sixth_and_later,
- _SIXTH_AND_LATER.pattern))
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/headerparserhandler.py b/WebKitTools/pywebsocket/mod_pywebsocket/headerparserhandler.py
deleted file mode 100644
index 124b9f1..0000000
--- a/WebKitTools/pywebsocket/mod_pywebsocket/headerparserhandler.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""PythonHeaderParserHandler for mod_pywebsocket.
-
-Apache HTTP Server and mod_python must be configured such that this
-function is called to handle Web Socket request.
-"""
-
-
-from mod_python import apache
-
-import dispatch
-import handshake
-import util
-
-
-# PythonOption to specify the handler root directory.
-_PYOPT_HANDLER_ROOT = 'mod_pywebsocket.handler_root'
-
-# PythonOption to specify the handler scan directory.
-# This must be a directory under the root directory.
-# The default is the root directory.
-_PYOPT_HANDLER_SCAN = 'mod_pywebsocket.handler_scan'
-
-
-def _create_dispatcher():
- _HANDLER_ROOT = apache.main_server.get_options().get(
- _PYOPT_HANDLER_ROOT, None)
- if not _HANDLER_ROOT:
- raise Exception('PythonOption %s is not defined' % _PYOPT_HANDLER_ROOT,
- apache.APLOG_ERR)
- _HANDLER_SCAN = apache.main_server.get_options().get(
- _PYOPT_HANDLER_SCAN, _HANDLER_ROOT)
- dispatcher = dispatch.Dispatcher(_HANDLER_ROOT, _HANDLER_SCAN)
- for warning in dispatcher.source_warnings():
- apache.log_error('mod_pywebsocket: %s' % warning, apache.APLOG_WARNING)
- return dispatcher
-
-
-# Initialize
-_dispatcher = _create_dispatcher()
-
-
-def headerparserhandler(request):
- """Handle request.
-
- Args:
- request: mod_python request.
-
- This function is named headerparserhandler because it is the default name
- for a PythonHeaderParserHandler.
- """
-
- try:
- handshaker = handshake.Handshaker(request, _dispatcher)
- handshaker.do_handshake()
- request.log_error('mod_pywebsocket: resource: %r' % request.ws_resource,
- apache.APLOG_DEBUG)
- _dispatcher.transfer_data(request)
- except handshake.HandshakeError, e:
- # Handshake for ws/wss failed.
- # But the request can be valid http/https request.
- request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_INFO)
- return apache.DECLINED
- except dispatch.DispatchError, e:
- request.log_error('mod_pywebsocket: %s' % e, apache.APLOG_WARNING)
- return apache.DECLINED
- return apache.DONE # Return DONE such that no other handlers are invoked.
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/memorizingfile.py b/WebKitTools/pywebsocket/mod_pywebsocket/memorizingfile.py
deleted file mode 100644
index 2f8a54e..0000000
--- a/WebKitTools/pywebsocket/mod_pywebsocket/memorizingfile.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Memorizing file.
-
-A memorizing file wraps a file and memorizes lines read by readline.
-"""
-
-
-import sys
-
-
-class MemorizingFile(object):
- """MemorizingFile wraps a file and memorizes lines read by readline.
-
- Note that data read by other methods are not memorized. This behavior
- is good enough for memorizing lines SimpleHTTPServer reads before
- the control reaches WebSocketRequestHandler.
- """
- def __init__(self, file_, max_memorized_lines=sys.maxint):
- """Construct an instance.
-
- Args:
- file_: the file object to wrap.
- max_memorized_lines: the maximum number of lines to memorize.
- Only the first max_memorized_lines are memorized.
- Default: sys.maxint.
- """
- self._file = file_
- self._memorized_lines = []
- self._max_memorized_lines = max_memorized_lines
-
- def __getattribute__(self, name):
- if name in ('_file', '_memorized_lines', '_max_memorized_lines',
- 'readline', 'get_memorized_lines'):
- return object.__getattribute__(self, name)
- return self._file.__getattribute__(name)
-
- def readline(self):
- """Override file.readline and memorize the line read."""
-
- line = self._file.readline()
- if line and len(self._memorized_lines) < self._max_memorized_lines:
- self._memorized_lines.append(line)
- return line
-
- def get_memorized_lines(self):
- """Get lines memorized so far."""
- return self._memorized_lines
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/msgutil.py b/WebKitTools/pywebsocket/mod_pywebsocket/msgutil.py
deleted file mode 100644
index 90ae715..0000000
--- a/WebKitTools/pywebsocket/mod_pywebsocket/msgutil.py
+++ /dev/null
@@ -1,250 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Message related utilities.
-
-Note: request.connection.write/read are used in this module, even though
-mod_python document says that they should be used only in connection handlers.
-Unfortunately, we have no other options. For example, request.write/read are
-not suitable because they don't allow direct raw bytes writing/reading.
-"""
-
-
-import Queue
-import threading
-import util
-
-
-class MsgUtilException(Exception):
- pass
-
-
-def _read(request, length):
- bytes = request.connection.read(length)
- if not bytes:
- raise MsgUtilException(
- 'Failed to receive message from %r' %
- (request.connection.remote_addr,))
- return bytes
-
-
-def _write(request, bytes):
- try:
- request.connection.write(bytes)
- except Exception, e:
- util.prepend_message_to_exception(
- 'Failed to send message to %r: ' %
- (request.connection.remote_addr,),
- e)
- raise
-
-
-def send_message(request, message):
- """Send message.
-
- Args:
- request: mod_python request.
- message: unicode string to send.
- """
-
- _write(request, '\x00' + message.encode('utf-8') + '\xff')
-
-
-def receive_message(request):
- """Receive a Web Socket frame and return its payload as unicode string.
-
- Args:
- request: mod_python request.
- """
-
- while True:
- # Read 1 byte.
- # mp_conn.read will block if no bytes are available.
- # Timeout is controlled by TimeOut directive of Apache.
- frame_type_str = _read(request, 1)
- frame_type = ord(frame_type_str[0])
- if (frame_type & 0x80) == 0x80:
- # The payload length is specified in the frame.
- # Read and discard.
- length = _payload_length(request)
- _receive_bytes(request, length)
- else:
- # The payload is delimited with \xff.
- bytes = _read_until(request, '\xff')
- # The Web Socket protocol section 4.4 specifies that invalid
- # characters must be replaced with U+fffd REPLACEMENT CHARACTER.
- message = bytes.decode('utf-8', 'replace')
- if frame_type == 0x00:
- return message
- # Discard data of other types.
-
-
-def _payload_length(request):
- length = 0
- while True:
- b_str = _read(request, 1)
- b = ord(b_str[0])
- length = length * 128 + (b & 0x7f)
- if (b & 0x80) == 0:
- break
- return length
-
-
-def _receive_bytes(request, length):
- bytes = []
- while length > 0:
- new_bytes = _read(request, length)
- bytes.append(new_bytes)
- length -= len(new_bytes)
- return ''.join(bytes)
-
-
-def _read_until(request, delim_char):
- bytes = []
- while True:
- ch = _read(request, 1)
- if ch == delim_char:
- break
- bytes.append(ch)
- return ''.join(bytes)
-
-
-class MessageReceiver(threading.Thread):
- """This class receives messages from the client.
-
- This class provides three ways to receive messages: blocking, non-blocking,
- and via callback. Callback has the highest precedence.
-
- Note: This class should not be used with the standalone server for wss
- because pyOpenSSL used by the server raises a fatal error if the socket
- is accessed from multiple threads.
- """
- def __init__(self, request, onmessage=None):
- """Construct an instance.
-
- Args:
- request: mod_python request.
- onmessage: a function to be called when a message is received.
- May be None. If not None, the function is called on
- another thread. In that case, MessageReceiver.receive
- and MessageReceiver.receive_nowait are useless because
- they will never return any messages.
- """
- threading.Thread.__init__(self)
- self._request = request
- self._queue = Queue.Queue()
- self._onmessage = onmessage
- self._stop_requested = False
- self.setDaemon(True)
- self.start()
-
- def run(self):
- while not self._stop_requested:
- message = receive_message(self._request)
- if self._onmessage:
- self._onmessage(message)
- else:
- self._queue.put(message)
-
- def receive(self):
- """ Receive a message from the channel, blocking.
-
- Returns:
- message as a unicode string.
- """
- return self._queue.get()
-
- def receive_nowait(self):
- """ Receive a message from the channel, non-blocking.
-
- Returns:
- message as a unicode string if available. None otherwise.
- """
- try:
- message = self._queue.get_nowait()
- except Queue.Empty:
- message = None
- return message
-
- def stop(self):
- """Request to stop this instance.
-
- The instance will be stopped after receiving the next message.
- This method may not be very useful, but there is no clean way
- in Python to forcefully stop a running thread.
- """
- self._stop_requested = True
-
-
-class MessageSender(threading.Thread):
- """This class sends messages to the client.
-
- This class provides both synchronous and asynchronous ways to send
- messages.
-
- Note: This class should not be used with the standalone server for wss
- because pyOpenSSL used by the server raises a fatal error if the socket
- is accessed from multiple threads.
- """
- def __init__(self, request):
- """Construct an instance.
-
- Args:
- request: mod_python request.
- """
- threading.Thread.__init__(self)
- self._request = request
- self._queue = Queue.Queue()
- self.setDaemon(True)
- self.start()
-
- def run(self):
- while True:
- message, condition = self._queue.get()
- condition.acquire()
- send_message(self._request, message)
- condition.notify()
- condition.release()
-
- def send(self, message):
- """Send a message, blocking."""
-
- condition = threading.Condition()
- condition.acquire()
- self._queue.put((message, condition))
- condition.wait()
-
- def send_nowait(self, message):
- """Send a message, non-blocking."""
-
- self._queue.put((message, threading.Condition()))
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/mod_pywebsocket/standalone.py b/WebKitTools/pywebsocket/mod_pywebsocket/standalone.py
deleted file mode 100644
index 8628ff9..0000000
--- a/WebKitTools/pywebsocket/mod_pywebsocket/standalone.py
+++ /dev/null
@@ -1,421 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Standalone Web Socket server.
-
-Use this server to run mod_pywebsocket without Apache HTTP Server.
-
-Usage:
- python standalone.py [-p <ws_port>] [-w <websock_handlers>]
- [-s <scan_dir>]
- [-d <document_root>]
- [-m <websock_handlers_map_file>]
- ... for other options, see _main below ...
-
-<ws_port> is the port number to use for ws:// connection.
-
-<document_root> is the path to the root directory of HTML files.
-
-<websock_handlers> is the path to the root directory of Web Socket handlers.
-See __init__.py for details of <websock_handlers> and how to write Web Socket
-handlers. If this path is relative, <document_root> is used as the base.
-
-<scan_dir> is a path under the root directory. If specified, only the handlers
-under scan_dir are scanned. This is useful in saving scan time.
-
-Note:
-This server is derived from SocketServer.ThreadingMixIn. Hence a thread is
-used for each request.
-"""
-
-import BaseHTTPServer
-import CGIHTTPServer
-import SimpleHTTPServer
-import SocketServer
-import logging
-import logging.handlers
-import optparse
-import os
-import re
-import socket
-import sys
-
-_HAS_OPEN_SSL = False
-try:
- import OpenSSL.SSL
- _HAS_OPEN_SSL = True
-except ImportError:
- pass
-
-import dispatch
-import handshake
-import memorizingfile
-import util
-
-
-_LOG_LEVELS = {
- 'debug': logging.DEBUG,
- 'info': logging.INFO,
- 'warn': logging.WARN,
- 'error': logging.ERROR,
- 'critical': logging.CRITICAL};
-
-_DEFAULT_LOG_MAX_BYTES = 1024 * 256
-_DEFAULT_LOG_BACKUP_COUNT = 5
-
-_DEFAULT_REQUEST_QUEUE_SIZE = 128
-
-# 1024 is practically large enough to contain WebSocket handshake lines.
-_MAX_MEMORIZED_LINES = 1024
-
-def _print_warnings_if_any(dispatcher):
- warnings = dispatcher.source_warnings()
- if warnings:
- for warning in warnings:
- logging.warning('mod_pywebsocket: %s' % warning)
-
-
-class _StandaloneConnection(object):
- """Mimic mod_python mp_conn."""
-
- def __init__(self, request_handler):
- """Construct an instance.
-
- Args:
- request_handler: A WebSocketRequestHandler instance.
- """
- self._request_handler = request_handler
-
- def get_local_addr(self):
- """Getter to mimic mp_conn.local_addr."""
- return (self._request_handler.server.server_name,
- self._request_handler.server.server_port)
- local_addr = property(get_local_addr)
-
- def get_remote_addr(self):
- """Getter to mimic mp_conn.remote_addr.
-
- Setting the property in __init__ won't work because the request
- handler is not initialized yet there."""
- return self._request_handler.client_address
- remote_addr = property(get_remote_addr)
-
- def write(self, data):
- """Mimic mp_conn.write()."""
- return self._request_handler.wfile.write(data)
-
- def read(self, length):
- """Mimic mp_conn.read()."""
- return self._request_handler.rfile.read(length)
-
- def get_memorized_lines(self):
- """Get memorized lines."""
- return self._request_handler.rfile.get_memorized_lines()
-
-
-class _StandaloneRequest(object):
- """Mimic mod_python request."""
-
- def __init__(self, request_handler, use_tls):
- """Construct an instance.
-
- Args:
- request_handler: A WebSocketRequestHandler instance.
- """
- self._request_handler = request_handler
- self.connection = _StandaloneConnection(request_handler)
- self._use_tls = use_tls
-
- def get_uri(self):
- """Getter to mimic request.uri."""
- return self._request_handler.path
- uri = property(get_uri)
-
- def get_headers_in(self):
- """Getter to mimic request.headers_in."""
- return self._request_handler.headers
- headers_in = property(get_headers_in)
-
- def is_https(self):
- """Mimic request.is_https()."""
- return self._use_tls
-
-
-class WebSocketServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer):
- """HTTPServer specialized for Web Socket."""
-
- SocketServer.ThreadingMixIn.daemon_threads = True
-
- def __init__(self, server_address, RequestHandlerClass):
- """Override SocketServer.BaseServer.__init__."""
-
- SocketServer.BaseServer.__init__(
- self, server_address, RequestHandlerClass)
- self.socket = self._create_socket()
- self.server_bind()
- self.server_activate()
-
- def _create_socket(self):
- socket_ = socket.socket(self.address_family, self.socket_type)
- if WebSocketServer.options.use_tls:
- ctx = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD)
- ctx.use_privatekey_file(WebSocketServer.options.private_key)
- ctx.use_certificate_file(WebSocketServer.options.certificate)
- socket_ = OpenSSL.SSL.Connection(ctx, socket_)
- return socket_
-
- def handle_error(self, rquest, client_address):
- """Override SocketServer.handle_error."""
-
- logging.error(
- ('Exception in processing request from: %r' % (client_address,)) +
- '\n' + util.get_stack_trace())
- # Note: client_address is a tuple. To match it against %r, we need the
- # trailing comma.
-
-
-class WebSocketRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler):
- """CGIHTTPRequestHandler specialized for Web Socket."""
-
- def setup(self):
- """Override SocketServer.StreamRequestHandler.setup."""
-
- self.connection = self.request
- self.rfile = memorizingfile.MemorizingFile(
- socket._fileobject(self.request, 'rb', self.rbufsize),
- max_memorized_lines=_MAX_MEMORIZED_LINES)
- self.wfile = socket._fileobject(self.request, 'wb', self.wbufsize)
-
- def __init__(self, *args, **keywords):
- self._request = _StandaloneRequest(
- self, WebSocketRequestHandler.options.use_tls)
- self._dispatcher = WebSocketRequestHandler.options.dispatcher
- self._print_warnings_if_any()
- self._handshaker = handshake.Handshaker(
- self._request, self._dispatcher,
- WebSocketRequestHandler.options.strict)
- CGIHTTPServer.CGIHTTPRequestHandler.__init__(
- self, *args, **keywords)
-
- def _print_warnings_if_any(self):
- warnings = self._dispatcher.source_warnings()
- if warnings:
- for warning in warnings:
- logging.warning('mod_pywebsocket: %s' % warning)
-
- def parse_request(self):
- """Override BaseHTTPServer.BaseHTTPRequestHandler.parse_request.
-
- Return True to continue processing for HTTP(S), False otherwise.
- """
- result = CGIHTTPServer.CGIHTTPRequestHandler.parse_request(self)
- if result:
- try:
- self._handshaker.do_handshake()
- self._dispatcher.transfer_data(self._request)
- return False
- except handshake.HandshakeError, e:
- # Handshake for ws(s) failed. Assume http(s).
- logging.info('mod_pywebsocket: %s' % e)
- return True
- except dispatch.DispatchError, e:
- logging.warning('mod_pywebsocket: %s' % e)
- return False
- except Exception, e:
- logging.warning('mod_pywebsocket: %s' % e)
- logging.info('mod_pywebsocket: %s' % util.get_stack_trace())
- return False
- return result
-
- def log_request(self, code='-', size='-'):
- """Override BaseHTTPServer.log_request."""
-
- logging.info('"%s" %s %s',
- self.requestline, str(code), str(size))
-
- def log_error(self, *args):
- """Override BaseHTTPServer.log_error."""
-
- # Despite the name, this method is for warnings than for errors.
- # For example, HTTP status code is logged by this method.
- logging.warn('%s - %s' % (self.address_string(), (args[0] % args[1:])))
-
- def is_cgi(self):
- """Test whether self.path corresponds to a CGI script.
-
- Add extra check that self.path doesn't contains .."""
- if CGIHTTPServer.CGIHTTPRequestHandler.is_cgi(self):
- if '..' in self.path:
- return False
- return True
- return False
-
-
-def _configure_logging(options):
- logger = logging.getLogger()
- logger.setLevel(_LOG_LEVELS[options.log_level])
- if options.log_file:
- handler = logging.handlers.RotatingFileHandler(
- options.log_file, 'a', options.log_max, options.log_count)
- else:
- handler = logging.StreamHandler()
- formatter = logging.Formatter(
- "[%(asctime)s] [%(levelname)s] %(name)s: %(message)s")
- handler.setFormatter(formatter)
- logger.addHandler(handler)
-
-def _alias_handlers(dispatcher, websock_handlers_map_file):
- """Set aliases specified in websock_handler_map_file in dispatcher.
-
- Args:
- dispatcher: dispatch.Dispatcher instance
- websock_handler_map_file: alias map file
- """
- fp = open(websock_handlers_map_file)
- try:
- for line in fp:
- if line[0] == '#' or line.isspace():
- continue
- m = re.match('(\S+)\s+(\S+)', line)
- if not m:
- logging.warning('Wrong format in map file:' + line)
- continue
- try:
- dispatcher.add_resource_path_alias(
- m.group(1), m.group(2))
- except dispatch.DispatchError, e:
- logging.error(str(e))
- finally:
- fp.close()
-
-
-
-def _main():
- parser = optparse.OptionParser()
- parser.add_option('-p', '--port', dest='port', type='int',
- default=handshake._DEFAULT_WEB_SOCKET_PORT,
- help='port to listen to')
- parser.add_option('-w', '--websock_handlers', dest='websock_handlers',
- default='.',
- help='Web Socket handlers root directory.')
- parser.add_option('-m', '--websock_handlers_map_file',
- dest='websock_handlers_map_file',
- default=None,
- help=('Web Socket handlers map file. '
- 'Each line consists of alias_resource_path and '
- 'existing_resource_path, separated by spaces.'))
- parser.add_option('-s', '--scan_dir', dest='scan_dir',
- default=None,
- help=('Web Socket handlers scan directory. '
- 'Must be a directory under websock_handlers.'))
- parser.add_option('-d', '--document_root', dest='document_root',
- default='.',
- help='Document root directory.')
- parser.add_option('-x', '--cgi_paths', dest='cgi_paths',
- default=None,
- help=('CGI paths relative to document_root.'
- 'Comma-separated. (e.g -x /cgi,/htbin) '
- 'Files under document_root/cgi_path are handled '
- 'as CGI programs. Must be executable.'))
- parser.add_option('-t', '--tls', dest='use_tls', action='store_true',
- default=False, help='use TLS (wss://)')
- parser.add_option('-k', '--private_key', dest='private_key',
- default='', help='TLS private key file.')
- parser.add_option('-c', '--certificate', dest='certificate',
- default='', help='TLS certificate file.')
- parser.add_option('-l', '--log_file', dest='log_file',
- default='', help='Log file.')
- parser.add_option('--log_level', type='choice', dest='log_level',
- default='warn',
- choices=['debug', 'info', 'warn', 'error', 'critical'],
- help='Log level.')
- parser.add_option('--log_max', dest='log_max', type='int',
- default=_DEFAULT_LOG_MAX_BYTES,
- help='Log maximum bytes')
- parser.add_option('--log_count', dest='log_count', type='int',
- default=_DEFAULT_LOG_BACKUP_COUNT,
- help='Log backup count')
- parser.add_option('--strict', dest='strict', action='store_true',
- default=False, help='Strictly check handshake request')
- parser.add_option('-q', '--queue', dest='request_queue_size', type='int',
- default=_DEFAULT_REQUEST_QUEUE_SIZE,
- help='request queue size')
- options = parser.parse_args()[0]
-
- os.chdir(options.document_root)
-
- _configure_logging(options)
-
- SocketServer.TCPServer.request_queue_size = options.request_queue_size
- CGIHTTPServer.CGIHTTPRequestHandler.cgi_directories = []
-
- if options.cgi_paths:
- CGIHTTPServer.CGIHTTPRequestHandler.cgi_directories = \
- options.cgi_paths.split(',')
-
- if options.use_tls:
- if not _HAS_OPEN_SSL:
- logging.critical('To use TLS, install pyOpenSSL.')
- sys.exit(1)
- if not options.private_key or not options.certificate:
- logging.critical(
- 'To use TLS, specify private_key and certificate.')
- sys.exit(1)
-
- if not options.scan_dir:
- options.scan_dir = options.websock_handlers
-
- try:
- # Share a Dispatcher among request handlers to save time for
- # instantiation. Dispatcher can be shared because it is thread-safe.
- options.dispatcher = dispatch.Dispatcher(options.websock_handlers,
- options.scan_dir)
- if options.websock_handlers_map_file:
- _alias_handlers(options.dispatcher,
- options.websock_handlers_map_file)
- _print_warnings_if_any(options.dispatcher)
-
- WebSocketRequestHandler.options = options
- WebSocketServer.options = options
-
- server = WebSocketServer(('', options.port), WebSocketRequestHandler)
- server.serve_forever()
- except Exception, e:
- logging.critical(str(e))
- sys.exit(1)
-
-
-if __name__ == '__main__':
- _main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/config.py b/WebKitTools/pywebsocket/test/config.py
deleted file mode 100644
index 5aaab8c..0000000
--- a/WebKitTools/pywebsocket/test/config.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Configuration for testing.
-
-Test files should import this module before mod_pywebsocket.
-"""
-
-
-import os
-import sys
-
-
-# Add the parent directory to sys.path to enable importing mod_pywebsocket.
-sys.path += [os.path.join(os.path.split(__file__)[0], '..')]
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/mock.py b/WebKitTools/pywebsocket/test/mock.py
deleted file mode 100644
index 3b85d64..0000000
--- a/WebKitTools/pywebsocket/test/mock.py
+++ /dev/null
@@ -1,205 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Mocks for testing.
-"""
-
-
-import Queue
-import threading
-
-
-class _MockConnBase(object):
- """Base class of mocks for mod_python.apache.mp_conn.
-
- This enables tests to check what is written to a (mock) mp_conn.
- """
-
- def __init__(self):
- self._write_data = []
-
- def write(self, data):
- """Override mod_python.apache.mp_conn.write."""
-
- self._write_data.append(data)
-
- def written_data(self):
- """Get bytes written to this mock."""
-
- return ''.join(self._write_data)
-
-
-class MockConn(_MockConnBase):
- """Mock for mod_python.apache.mp_conn.
-
- This enables tests to specify what should be read from a (mock) mp_conn as
- well as to check what is written to it.
- """
-
- def __init__(self, read_data):
- """Constructs an instance.
-
- Args:
- read_data: bytes that should be returned when read* methods are
- called.
- """
-
- _MockConnBase.__init__(self)
- self._read_data = read_data
- self._read_pos = 0
-
- def readline(self):
- """Override mod_python.apache.mp_conn.readline."""
-
- if self._read_pos >= len(self._read_data):
- return ''
- end_index = self._read_data.find('\n', self._read_pos) + 1
- if not end_index:
- end_index = len(self._read_data)
- return self._read_up_to(end_index)
-
- def read(self, length):
- """Override mod_python.apache.mp_conn.read."""
-
- if self._read_pos >= len(self._read_data):
- return ''
- end_index = min(len(self._read_data), self._read_pos + length)
- return self._read_up_to(end_index)
-
- def _read_up_to(self, end_index):
- line = self._read_data[self._read_pos:end_index]
- self._read_pos = end_index
- return line
-
-
-class MockBlockingConn(_MockConnBase):
- """Blocking mock for mod_python.apache.mp_conn.
-
- This enables tests to specify what should be read from a (mock) mp_conn as
- well as to check what is written to it.
- Callers of read* methods will block if there is no bytes available.
- """
-
- def __init__(self):
- _MockConnBase.__init__(self)
- self._queue = Queue.Queue()
-
- def readline(self):
- """Override mod_python.apache.mp_conn.readline."""
- line = ''
- while True:
- c = self._queue.get()
- line += c
- if c == '\n':
- return line
-
- def read(self, length):
- """Override mod_python.apache.mp_conn.read."""
-
- data = ''
- for unused in range(length):
- data += self._queue.get()
- return data
-
- def put_bytes(self, bytes):
- """Put bytes to be read from this mock.
-
- Args:
- bytes: bytes to be read.
- """
-
- for byte in bytes:
- self._queue.put(byte)
-
-
-class MockTable(dict):
- """Mock table.
-
- This mimics mod_python mp_table. Note that only the methods used by
- tests are overridden.
- """
-
- def __init__(self, copy_from={}):
- if isinstance(copy_from, dict):
- copy_from = copy_from.items()
- for key, value in copy_from:
- self.__setitem__(key, value)
-
- def __getitem__(self, key):
- return super(MockTable, self).__getitem__(key.lower())
-
- def __setitem__(self, key, value):
- super(MockTable, self).__setitem__(key.lower(), value)
-
- def get(self, key, def_value=None):
- return super(MockTable, self).get(key.lower(), def_value)
-
-
-class MockRequest(object):
- """Mock request.
-
- This mimics mod_python request.
- """
-
- def __init__(self, uri=None, headers_in={}, connection=None,
- is_https=False):
- """Construct an instance.
-
- Arguments:
- uri: URI of the request.
- headers_in: Request headers.
- connection: Connection used for the request.
- is_https: Whether this request is over SSL.
-
- See the document of mod_python Request for details.
- """
- self.uri = uri
- self.connection = connection
- self.headers_in = MockTable(headers_in)
- # self.is_https_ needs to be accessible from tests. To avoid name
- # conflict with self.is_https(), it is named as such.
- self.is_https_ = is_https
-
- def is_https(self):
- """Return whether this request is over SSL."""
- return self.is_https_
-
-
-class MockDispatcher(object):
- """Mock for dispatch.Dispatcher."""
-
- def do_extra_handshake(self, conn_context):
- pass
-
- def transfer_data(self, conn_context):
- pass
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/test_dispatch.py b/WebKitTools/pywebsocket/test/test_dispatch.py
deleted file mode 100644
index 5403228..0000000
--- a/WebKitTools/pywebsocket/test/test_dispatch.py
+++ /dev/null
@@ -1,244 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Tests for dispatch module."""
-
-
-
-import os
-import unittest
-
-import config # This must be imported before mod_pywebsocket.
-from mod_pywebsocket import dispatch
-
-import mock
-
-
-_TEST_HANDLERS_DIR = os.path.join(
- os.path.split(__file__)[0], 'testdata', 'handlers')
-
-_TEST_HANDLERS_SUB_DIR = os.path.join(_TEST_HANDLERS_DIR, 'sub')
-
-class DispatcherTest(unittest.TestCase):
- def test_normalize_path(self):
- self.assertEqual(os.path.abspath('/a/b').replace('\\', '/'),
- dispatch._normalize_path('/a/b'))
- self.assertEqual(os.path.abspath('/a/b').replace('\\', '/'),
- dispatch._normalize_path('\\a\\b'))
- self.assertEqual(os.path.abspath('/a/b').replace('\\', '/'),
- dispatch._normalize_path('/a/c/../b'))
- self.assertEqual(os.path.abspath('abc').replace('\\', '/'),
- dispatch._normalize_path('abc'))
-
- def test_converter(self):
- converter = dispatch._path_to_resource_converter('/a/b')
- self.assertEqual('/h', converter('/a/b/h_wsh.py'))
- self.assertEqual('/c/h', converter('/a/b/c/h_wsh.py'))
- self.assertEqual(None, converter('/a/b/h.py'))
- self.assertEqual(None, converter('a/b/h_wsh.py'))
-
- converter = dispatch._path_to_resource_converter('a/b')
- self.assertEqual('/h', converter('a/b/h_wsh.py'))
-
- converter = dispatch._path_to_resource_converter('/a/b///')
- self.assertEqual('/h', converter('/a/b/h_wsh.py'))
- self.assertEqual('/h', converter('/a/b/../b/h_wsh.py'))
-
- converter = dispatch._path_to_resource_converter('/a/../a/b/../b/')
- self.assertEqual('/h', converter('/a/b/h_wsh.py'))
-
- converter = dispatch._path_to_resource_converter(r'\a\b')
- self.assertEqual('/h', converter(r'\a\b\h_wsh.py'))
- self.assertEqual('/h', converter(r'/a/b/h_wsh.py'))
-
- def test_source_file_paths(self):
- paths = list(dispatch._source_file_paths(_TEST_HANDLERS_DIR))
- paths.sort()
- self.assertEqual(7, len(paths))
- expected_paths = [
- os.path.join(_TEST_HANDLERS_DIR, 'blank_wsh.py'),
- os.path.join(_TEST_HANDLERS_DIR, 'origin_check_wsh.py'),
- os.path.join(_TEST_HANDLERS_DIR, 'sub',
- 'exception_in_transfer_wsh.py'),
- os.path.join(_TEST_HANDLERS_DIR, 'sub', 'non_callable_wsh.py'),
- os.path.join(_TEST_HANDLERS_DIR, 'sub', 'plain_wsh.py'),
- os.path.join(_TEST_HANDLERS_DIR, 'sub',
- 'wrong_handshake_sig_wsh.py'),
- os.path.join(_TEST_HANDLERS_DIR, 'sub',
- 'wrong_transfer_sig_wsh.py'),
- ]
- for expected, actual in zip(expected_paths, paths):
- self.assertEqual(expected, actual)
-
- def test_source(self):
- self.assertRaises(dispatch.DispatchError, dispatch._source, '')
- self.assertRaises(dispatch.DispatchError, dispatch._source, 'def')
- self.assertRaises(dispatch.DispatchError, dispatch._source, '1/0')
- self.failUnless(dispatch._source(
- 'def web_socket_do_extra_handshake(request):pass\n'
- 'def web_socket_transfer_data(request):pass\n'))
-
- def test_source_warnings(self):
- dispatcher = dispatch.Dispatcher(_TEST_HANDLERS_DIR, None)
- warnings = dispatcher.source_warnings()
- warnings.sort()
- expected_warnings = [
- (os.path.join(_TEST_HANDLERS_DIR, 'blank_wsh.py') +
- ': web_socket_do_extra_handshake is not defined.'),
- (os.path.join(_TEST_HANDLERS_DIR, 'sub',
- 'non_callable_wsh.py') +
- ': web_socket_do_extra_handshake is not callable.'),
- (os.path.join(_TEST_HANDLERS_DIR, 'sub',
- 'wrong_handshake_sig_wsh.py') +
- ': web_socket_do_extra_handshake is not defined.'),
- (os.path.join(_TEST_HANDLERS_DIR, 'sub',
- 'wrong_transfer_sig_wsh.py') +
- ': web_socket_transfer_data is not defined.'),
- ]
- self.assertEquals(4, len(warnings))
- for expected, actual in zip(expected_warnings, warnings):
- self.assertEquals(expected, actual)
-
- def test_do_extra_handshake(self):
- dispatcher = dispatch.Dispatcher(_TEST_HANDLERS_DIR, None)
- request = mock.MockRequest()
- request.ws_resource = '/origin_check'
- request.ws_origin = 'http://example.com'
- dispatcher.do_extra_handshake(request) # Must not raise exception.
-
- request.ws_origin = 'http://bad.example.com'
- self.assertRaises(Exception, dispatcher.do_extra_handshake, request)
-
- def test_transfer_data(self):
- dispatcher = dispatch.Dispatcher(_TEST_HANDLERS_DIR, None)
- request = mock.MockRequest(connection=mock.MockConn(''))
- request.ws_resource = '/origin_check'
- request.ws_protocol = 'p1'
-
- dispatcher.transfer_data(request)
- self.assertEqual('origin_check_wsh.py is called for /origin_check, p1',
- request.connection.written_data())
-
- request = mock.MockRequest(connection=mock.MockConn(''))
- request.ws_resource = '/sub/plain'
- request.ws_protocol = None
- dispatcher.transfer_data(request)
- self.assertEqual('sub/plain_wsh.py is called for /sub/plain, None',
- request.connection.written_data())
-
- request = mock.MockRequest(connection=mock.MockConn(''))
- request.ws_resource = '/sub/plain?'
- request.ws_protocol = None
- dispatcher.transfer_data(request)
- self.assertEqual('sub/plain_wsh.py is called for /sub/plain?, None',
- request.connection.written_data())
-
- request = mock.MockRequest(connection=mock.MockConn(''))
- request.ws_resource = '/sub/plain?q=v'
- request.ws_protocol = None
- dispatcher.transfer_data(request)
- self.assertEqual('sub/plain_wsh.py is called for /sub/plain?q=v, None',
- request.connection.written_data())
-
- def test_transfer_data_no_handler(self):
- dispatcher = dispatch.Dispatcher(_TEST_HANDLERS_DIR, None)
- for resource in ['/blank', '/sub/non_callable',
- '/sub/no_wsh_at_the_end', '/does/not/exist']:
- request = mock.MockRequest(connection=mock.MockConn(''))
- request.ws_resource = resource
- request.ws_protocol = 'p2'
- try:
- dispatcher.transfer_data(request)
- self.fail()
- except dispatch.DispatchError, e:
- self.failUnless(str(e).find('No handler') != -1)
- except Exception:
- self.fail()
-
- def test_transfer_data_handler_exception(self):
- dispatcher = dispatch.Dispatcher(_TEST_HANDLERS_DIR, None)
- request = mock.MockRequest(connection=mock.MockConn(''))
- request.ws_resource = '/sub/exception_in_transfer'
- request.ws_protocol = 'p3'
- try:
- dispatcher.transfer_data(request)
- self.fail()
- except Exception, e:
- self.failUnless(str(e).find('Intentional') != -1)
-
- def test_scan_dir(self):
- disp = dispatch.Dispatcher(_TEST_HANDLERS_DIR, None)
- self.assertEqual(3, len(disp._handlers))
- self.failUnless(disp._handlers.has_key('/origin_check'))
- self.failUnless(disp._handlers.has_key('/sub/exception_in_transfer'))
- self.failUnless(disp._handlers.has_key('/sub/plain'))
-
- def test_scan_sub_dir(self):
- disp = dispatch.Dispatcher(_TEST_HANDLERS_DIR, _TEST_HANDLERS_SUB_DIR)
- self.assertEqual(2, len(disp._handlers))
- self.failIf(disp._handlers.has_key('/origin_check'))
- self.failUnless(disp._handlers.has_key('/sub/exception_in_transfer'))
- self.failUnless(disp._handlers.has_key('/sub/plain'))
-
- def test_scan_sub_dir_as_root(self):
- disp = dispatch.Dispatcher(_TEST_HANDLERS_SUB_DIR,
- _TEST_HANDLERS_SUB_DIR)
- self.assertEqual(2, len(disp._handlers))
- self.failIf(disp._handlers.has_key('/origin_check'))
- self.failIf(disp._handlers.has_key('/sub/exception_in_transfer'))
- self.failIf(disp._handlers.has_key('/sub/plain'))
- self.failUnless(disp._handlers.has_key('/exception_in_transfer'))
- self.failUnless(disp._handlers.has_key('/plain'))
-
- def test_scan_dir_must_under_root(self):
- dispatch.Dispatcher('a/b', 'a/b/c') # OK
- dispatch.Dispatcher('a/b///', 'a/b') # OK
- self.assertRaises(dispatch.DispatchError,
- dispatch.Dispatcher, 'a/b/c', 'a/b')
-
- def test_resource_path_alias(self):
- disp = dispatch.Dispatcher(_TEST_HANDLERS_DIR, None)
- disp.add_resource_path_alias('/', '/origin_check')
- self.assertEqual(4, len(disp._handlers))
- self.failUnless(disp._handlers.has_key('/origin_check'))
- self.failUnless(disp._handlers.has_key('/sub/exception_in_transfer'))
- self.failUnless(disp._handlers.has_key('/sub/plain'))
- self.failUnless(disp._handlers.has_key('/'))
- self.assertRaises(dispatch.DispatchError,
- disp.add_resource_path_alias, '/alias', '/not-exist')
-
-
-if __name__ == '__main__':
- unittest.main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/test_handshake.py b/WebKitTools/pywebsocket/test/test_handshake.py
deleted file mode 100644
index 8bf07be..0000000
--- a/WebKitTools/pywebsocket/test/test_handshake.py
+++ /dev/null
@@ -1,513 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Tests for handshake module."""
-
-
-import unittest
-
-import config # This must be imported before mod_pywebsocket.
-from mod_pywebsocket import handshake
-
-import mock
-
-
-_GOOD_REQUEST = (
- 80,
- '/demo',
- {
- 'Upgrade':'WebSocket',
- 'Connection':'Upgrade',
- 'Host':'example.com',
- 'Origin':'http://example.com',
- 'WebSocket-Protocol':'sample',
- }
-)
-
-_GOOD_RESPONSE_DEFAULT_PORT = (
- 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n'
- 'Upgrade: WebSocket\r\n'
- 'Connection: Upgrade\r\n'
- 'WebSocket-Origin: http://example.com\r\n'
- 'WebSocket-Location: ws://example.com/demo\r\n'
- 'WebSocket-Protocol: sample\r\n'
- '\r\n')
-
-_GOOD_RESPONSE_SECURE = (
- 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n'
- 'Upgrade: WebSocket\r\n'
- 'Connection: Upgrade\r\n'
- 'WebSocket-Origin: http://example.com\r\n'
- 'WebSocket-Location: wss://example.com/demo\r\n'
- 'WebSocket-Protocol: sample\r\n'
- '\r\n')
-
-_GOOD_REQUEST_NONDEFAULT_PORT = (
- 8081,
- '/demo',
- {
- 'Upgrade':'WebSocket',
- 'Connection':'Upgrade',
- 'Host':'example.com:8081',
- 'Origin':'http://example.com',
- 'WebSocket-Protocol':'sample',
- }
-)
-
-_GOOD_RESPONSE_NONDEFAULT_PORT = (
- 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n'
- 'Upgrade: WebSocket\r\n'
- 'Connection: Upgrade\r\n'
- 'WebSocket-Origin: http://example.com\r\n'
- 'WebSocket-Location: ws://example.com:8081/demo\r\n'
- 'WebSocket-Protocol: sample\r\n'
- '\r\n')
-
-_GOOD_RESPONSE_SECURE_NONDEF = (
- 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n'
- 'Upgrade: WebSocket\r\n'
- 'Connection: Upgrade\r\n'
- 'WebSocket-Origin: http://example.com\r\n'
- 'WebSocket-Location: wss://example.com:8081/demo\r\n'
- 'WebSocket-Protocol: sample\r\n'
- '\r\n')
-
-_GOOD_REQUEST_NO_PROTOCOL = (
- 80,
- '/demo',
- {
- 'Upgrade':'WebSocket',
- 'Connection':'Upgrade',
- 'Host':'example.com',
- 'Origin':'http://example.com',
- }
-)
-
-_GOOD_RESPONSE_NO_PROTOCOL = (
- 'HTTP/1.1 101 Web Socket Protocol Handshake\r\n'
- 'Upgrade: WebSocket\r\n'
- 'Connection: Upgrade\r\n'
- 'WebSocket-Origin: http://example.com\r\n'
- 'WebSocket-Location: ws://example.com/demo\r\n'
- '\r\n')
-
-_GOOD_REQUEST_WITH_OPTIONAL_HEADERS = (
- 80,
- '/demo',
- {
- 'Upgrade':'WebSocket',
- 'Connection':'Upgrade',
- 'Host':'example.com',
- 'Origin':'http://example.com',
- 'WebSocket-Protocol':'sample',
- 'AKey':'AValue',
- 'EmptyValue':'',
- }
-)
-
-_BAD_REQUESTS = (
- ( # HTTP request
- 80,
- '/demo',
- {
- 'Host':'www.google.com',
- 'User-Agent':'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5;'
- ' en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3'
- ' GTB6 GTBA',
- 'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,'
- '*/*;q=0.8',
- 'Accept-Language':'en-us,en;q=0.5',
- 'Accept-Encoding':'gzip,deflate',
- 'Accept-Charset':'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
- 'Keep-Alive':'300',
- 'Connection':'keep-alive',
- }
- ),
- ( # Missing Upgrade
- 80,
- '/demo',
- {
- 'Connection':'Upgrade',
- 'Host':'example.com',
- 'Origin':'http://example.com',
- 'WebSocket-Protocol':'sample',
- }
- ),
- ( # Wrong Upgrade
- 80,
- '/demo',
- {
- 'Upgrade':'NonWebSocket',
- 'Connection':'Upgrade',
- 'Host':'example.com',
- 'Origin':'http://example.com',
- 'WebSocket-Protocol':'sample',
- }
- ),
- ( # Empty WebSocket-Protocol
- 80,
- '/demo',
- {
- 'Upgrade':'WebSocket',
- 'Connection':'Upgrade',
- 'Host':'example.com',
- 'Origin':'http://example.com',
- 'WebSocket-Protocol':'',
- }
- ),
- ( # Wrong port number format
- 80,
- '/demo',
- {
- 'Upgrade':'WebSocket',
- 'Connection':'Upgrade',
- 'Host':'example.com:0x50',
- 'Origin':'http://example.com',
- 'WebSocket-Protocol':'sample',
- }
- ),
- ( # Header/connection port mismatch
- 8080,
- '/demo',
- {
- 'Upgrade':'WebSocket',
- 'Connection':'Upgrade',
- 'Host':'example.com',
- 'Origin':'http://example.com',
- 'WebSocket-Protocol':'sample',
- }
- ),
- ( # Illegal WebSocket-Protocol
- 80,
- '/demo',
- {
- 'Upgrade':'WebSocket',
- 'Connection':'Upgrade',
- 'Host':'example.com',
- 'Origin':'http://example.com',
- 'WebSocket-Protocol':'illegal\x09protocol',
- }
- ),
-)
-
-_STRICTLY_GOOD_REQUESTS = (
- (
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- '\r\n',
- ),
- ( # WebSocket-Protocol
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- 'WebSocket-Protocol: sample\r\n',
- '\r\n',
- ),
- ( # WebSocket-Protocol and Cookie
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- 'WebSocket-Protocol: sample\r\n',
- 'Cookie: xyz\r\n'
- '\r\n',
- ),
- ( # Cookie
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- 'Cookie: abc/xyz\r\n'
- 'Cookie2: $Version=1\r\n'
- 'Cookie: abc\r\n'
- '\r\n',
- ),
- (
- 'GET / HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- '\r\n',
- ),
-)
-
-_NOT_STRICTLY_GOOD_REQUESTS = (
- ( # Extra space after GET
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- '\r\n',
- ),
- ( # Resource name doesn't stat with '/'
- 'GET demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- '\r\n',
- ),
- ( # No space after :
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade:WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- '\r\n',
- ),
- ( # Lower case Upgrade header
- 'GET /demo HTTP/1.1\r\n',
- 'upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- '\r\n',
- ),
- ( # Connection comes before Upgrade
- 'GET /demo HTTP/1.1\r\n',
- 'Connection: Upgrade\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- '\r\n',
- ),
- ( # Origin comes before Host
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Origin: http://example.com\r\n',
- 'Host: example.com\r\n',
- '\r\n',
- ),
- ( # Host continued to the next line
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example\r\n',
- ' .com\r\n',
- 'Origin: http://example.com\r\n',
- '\r\n',
- ),
- ( # Cookie comes before WebSocket-Protocol
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- 'Cookie: xyz\r\n'
- 'WebSocket-Protocol: sample\r\n',
- '\r\n',
- ),
- ( # Unknown header
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- 'Content-Type: text/html\r\n'
- '\r\n',
- ),
- ( # Cookie with continuation lines
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- 'Cookie: xyz\r\n',
- ' abc\r\n',
- ' defg\r\n',
- '\r\n',
- ),
- ( # Wrong-case cookie
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- 'cookie: abc/xyz\r\n'
- '\r\n',
- ),
- ( # Cookie, no space after colon
- 'GET /demo HTTP/1.1\r\n',
- 'Upgrade: WebSocket\r\n',
- 'Connection: Upgrade\r\n',
- 'Host: example.com\r\n',
- 'Origin: http://example.com\r\n',
- 'Cookie:abc/xyz\r\n'
- '\r\n',
- ),
-)
-
-
-def _create_request(request_def):
- conn = mock.MockConn('')
- conn.local_addr = ('0.0.0.0', request_def[0])
- return mock.MockRequest(
- uri=request_def[1],
- headers_in=request_def[2],
- connection=conn)
-
-
-def _create_get_memorized_lines(lines):
- def get_memorized_lines():
- return lines
- return get_memorized_lines
-
-
-def _create_requests_with_lines(request_lines_set):
- requests = []
- for lines in request_lines_set:
- request = _create_request(_GOOD_REQUEST)
- request.connection.get_memorized_lines = _create_get_memorized_lines(
- lines)
- requests.append(request)
- return requests
-
-
-class HandshakerTest(unittest.TestCase):
- def test_validate_protocol(self):
- handshake._validate_protocol('sample') # should succeed.
- handshake._validate_protocol('Sample') # should succeed.
- handshake._validate_protocol('sample\x20protocol') # should succeed.
- handshake._validate_protocol('sample\x7eprotocol') # should succeed.
- self.assertRaises(handshake.HandshakeError,
- handshake._validate_protocol,
- '')
- self.assertRaises(handshake.HandshakeError,
- handshake._validate_protocol,
- 'sample\x19protocol')
- self.assertRaises(handshake.HandshakeError,
- handshake._validate_protocol,
- 'sample\x7fprotocol')
- self.assertRaises(handshake.HandshakeError,
- handshake._validate_protocol,
- # "Japan" in Japanese
- u'\u65e5\u672c')
-
- def test_good_request_default_port(self):
- request = _create_request(_GOOD_REQUEST)
- handshaker = handshake.Handshaker(request,
- mock.MockDispatcher())
- handshaker.do_handshake()
- self.assertEqual(_GOOD_RESPONSE_DEFAULT_PORT,
- request.connection.written_data())
- self.assertEqual('/demo', request.ws_resource)
- self.assertEqual('http://example.com', request.ws_origin)
- self.assertEqual('ws://example.com/demo', request.ws_location)
- self.assertEqual('sample', request.ws_protocol)
-
- def test_good_request_secure_default_port(self):
- request = _create_request(_GOOD_REQUEST)
- request.connection.local_addr = ('0.0.0.0', 443)
- request.is_https_ = True
- handshaker = handshake.Handshaker(request,
- mock.MockDispatcher())
- handshaker.do_handshake()
- self.assertEqual(_GOOD_RESPONSE_SECURE,
- request.connection.written_data())
- self.assertEqual('sample', request.ws_protocol)
-
- def test_good_request_nondefault_port(self):
- request = _create_request(_GOOD_REQUEST_NONDEFAULT_PORT)
- handshaker = handshake.Handshaker(request,
- mock.MockDispatcher())
- handshaker.do_handshake()
- self.assertEqual(_GOOD_RESPONSE_NONDEFAULT_PORT,
- request.connection.written_data())
- self.assertEqual('sample', request.ws_protocol)
-
- def test_good_request_secure_non_default_port(self):
- request = _create_request(_GOOD_REQUEST_NONDEFAULT_PORT)
- request.is_https_ = True
- handshaker = handshake.Handshaker(request,
- mock.MockDispatcher())
- handshaker.do_handshake()
- self.assertEqual(_GOOD_RESPONSE_SECURE_NONDEF,
- request.connection.written_data())
- self.assertEqual('sample', request.ws_protocol)
-
- def test_good_request_default_no_protocol(self):
- request = _create_request(_GOOD_REQUEST_NO_PROTOCOL)
- handshaker = handshake.Handshaker(request,
- mock.MockDispatcher())
- handshaker.do_handshake()
- self.assertEqual(_GOOD_RESPONSE_NO_PROTOCOL,
- request.connection.written_data())
- self.assertEqual(None, request.ws_protocol)
-
- def test_good_request_optional_headers(self):
- request = _create_request(_GOOD_REQUEST_WITH_OPTIONAL_HEADERS)
- handshaker = handshake.Handshaker(request,
- mock.MockDispatcher())
- handshaker.do_handshake()
- self.assertEqual('AValue',
- request.headers_in['AKey'])
- self.assertEqual('',
- request.headers_in['EmptyValue'])
-
- def test_bad_requests(self):
- for request in map(_create_request, _BAD_REQUESTS):
- handshaker = handshake.Handshaker(request,
- mock.MockDispatcher())
- self.assertRaises(handshake.HandshakeError, handshaker.do_handshake)
-
- def test_strictly_good_requests(self):
- for request in _create_requests_with_lines(_STRICTLY_GOOD_REQUESTS):
- strict_handshaker = handshake.Handshaker(request,
- mock.MockDispatcher(),
- True)
- strict_handshaker.do_handshake()
-
- def test_not_strictly_good_requests(self):
- for request in _create_requests_with_lines(_NOT_STRICTLY_GOOD_REQUESTS):
- strict_handshaker = handshake.Handshaker(request,
- mock.MockDispatcher(),
- True)
- self.assertRaises(handshake.HandshakeError,
- strict_handshaker.do_handshake)
-
-
-
-if __name__ == '__main__':
- unittest.main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/test_memorizingfile.py b/WebKitTools/pywebsocket/test/test_memorizingfile.py
deleted file mode 100644
index 2de77ba..0000000
--- a/WebKitTools/pywebsocket/test/test_memorizingfile.py
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Tests for memorizingfile module."""
-
-
-import StringIO
-import unittest
-
-import config # This must be imported before mod_pywebsocket.
-from mod_pywebsocket import memorizingfile
-
-
-class UtilTest(unittest.TestCase):
- def check(self, memorizing_file, num_read, expected_list):
- for unused in range(num_read):
- memorizing_file.readline()
- actual_list = memorizing_file.get_memorized_lines()
- self.assertEqual(len(expected_list), len(actual_list))
- for expected, actual in zip(expected_list, actual_list):
- self.assertEqual(expected, actual)
-
- def test_get_memorized_lines(self):
- memorizing_file = memorizingfile.MemorizingFile(StringIO.StringIO(
- 'Hello\nWorld\nWelcome'))
- self.check(memorizing_file, 3, ['Hello\n', 'World\n', 'Welcome'])
-
- def test_get_memorized_lines_limit_memorized_lines(self):
- memorizing_file = memorizingfile.MemorizingFile(StringIO.StringIO(
- 'Hello\nWorld\nWelcome'), 2)
- self.check(memorizing_file, 3, ['Hello\n', 'World\n'])
-
- def test_get_memorized_lines_empty_file(self):
- memorizing_file = memorizingfile.MemorizingFile(StringIO.StringIO(
- ''))
- self.check(memorizing_file, 10, [])
-
-
-if __name__ == '__main__':
- unittest.main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/test_mock.py b/WebKitTools/pywebsocket/test/test_mock.py
deleted file mode 100644
index 8b137d1..0000000
--- a/WebKitTools/pywebsocket/test/test_mock.py
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Tests for mock module."""
-
-
-import Queue
-import threading
-import unittest
-
-import mock
-
-
-class MockConnTest(unittest.TestCase):
- def setUp(self):
- self._conn = mock.MockConn('ABC\r\nDEFG\r\n\r\nHIJK')
-
- def test_readline(self):
- self.assertEqual('ABC\r\n', self._conn.readline())
- self.assertEqual('DEFG\r\n', self._conn.readline())
- self.assertEqual('\r\n', self._conn.readline())
- self.assertEqual('HIJK', self._conn.readline())
- self.assertEqual('', self._conn.readline())
-
- def test_read(self):
- self.assertEqual('ABC\r\nD', self._conn.read(6))
- self.assertEqual('EFG\r\n\r\nHI', self._conn.read(9))
- self.assertEqual('JK', self._conn.read(10))
- self.assertEqual('', self._conn.read(10))
-
- def test_read_and_readline(self):
- self.assertEqual('ABC\r\nD', self._conn.read(6))
- self.assertEqual('EFG\r\n', self._conn.readline())
- self.assertEqual('\r\nHIJK', self._conn.read(9))
- self.assertEqual('', self._conn.readline())
-
- def test_write(self):
- self._conn.write('Hello\r\n')
- self._conn.write('World\r\n')
- self.assertEqual('Hello\r\nWorld\r\n', self._conn.written_data())
-
-
-class MockBlockingConnTest(unittest.TestCase):
- def test_read(self):
- class LineReader(threading.Thread):
- def __init__(self, conn, queue):
- threading.Thread.__init__(self)
- self._queue = queue
- self._conn = conn
- self.setDaemon(True)
- self.start()
- def run(self):
- while True:
- data = self._conn.readline()
- self._queue.put(data)
- conn = mock.MockBlockingConn()
- queue = Queue.Queue()
- reader = LineReader(conn, queue)
- self.failUnless(queue.empty())
- conn.put_bytes('Foo bar\r\n')
- read = queue.get()
- self.assertEqual('Foo bar\r\n', read)
-
-
-class MockTableTest(unittest.TestCase):
- def test_create_from_dict(self):
- table = mock.MockTable({'Key':'Value'})
- self.assertEqual('Value', table.get('KEY'))
- self.assertEqual('Value', table['key'])
-
- def test_create_from_list(self):
- table = mock.MockTable([('Key', 'Value')])
- self.assertEqual('Value', table.get('KEY'))
- self.assertEqual('Value', table['key'])
-
- def test_create_from_tuple(self):
- table = mock.MockTable((('Key', 'Value'),))
- self.assertEqual('Value', table.get('KEY'))
- self.assertEqual('Value', table['key'])
-
- def test_set_and_get(self):
- table = mock.MockTable()
- self.assertEqual(None, table.get('Key'))
- table['Key'] = 'Value'
- self.assertEqual('Value', table.get('Key'))
- self.assertEqual('Value', table.get('key'))
- self.assertEqual('Value', table.get('KEY'))
- self.assertEqual('Value', table['Key'])
- self.assertEqual('Value', table['key'])
- self.assertEqual('Value', table['KEY'])
-
-
-if __name__ == '__main__':
- unittest.main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/test_msgutil.py b/WebKitTools/pywebsocket/test/test_msgutil.py
deleted file mode 100644
index 16b88e0..0000000
--- a/WebKitTools/pywebsocket/test/test_msgutil.py
+++ /dev/null
@@ -1,156 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Tests for msgutil module."""
-
-
-import Queue
-import unittest
-
-import config # This must be imported before mod_pywebsocket.
-from mod_pywebsocket import msgutil
-
-import mock
-
-
-def _create_request(read_data):
- return mock.MockRequest(connection=mock.MockConn(read_data))
-
-def _create_blocking_request():
- return mock.MockRequest(connection=mock.MockBlockingConn())
-
-class MessageTest(unittest.TestCase):
- def test_send_message(self):
- request = _create_request('')
- msgutil.send_message(request, 'Hello')
- self.assertEqual('\x00Hello\xff', request.connection.written_data())
-
- def test_send_message_unicode(self):
- request = _create_request('')
- msgutil.send_message(request, u'\u65e5')
- # U+65e5 is encoded as e6,97,a5 in UTF-8
- self.assertEqual('\x00\xe6\x97\xa5\xff',
- request.connection.written_data())
-
- def test_receive_message(self):
- request = _create_request('\x00Hello\xff\x00World!\xff')
- self.assertEqual('Hello', msgutil.receive_message(request))
- self.assertEqual('World!', msgutil.receive_message(request))
-
- def test_receive_message_unicode(self):
- request = _create_request('\x00\xe6\x9c\xac\xff')
- # U+672c is encoded as e6,9c,ac in UTF-8
- self.assertEqual(u'\u672c', msgutil.receive_message(request))
-
- def test_receive_message_erroneous_unicode(self):
- # \x80 and \x81 are invalid as UTF-8.
- request = _create_request('\x00\x80\x81\xff')
- # Invalid characters should be replaced with
- # U+fffd REPLACEMENT CHARACTER
- self.assertEqual(u'\ufffd\ufffd', msgutil.receive_message(request))
-
- def test_receive_message_discard(self):
- request = _create_request('\x80\x06IGNORE\x00Hello\xff'
- '\x01DISREGARD\xff\x00World!\xff')
- self.assertEqual('Hello', msgutil.receive_message(request))
- self.assertEqual('World!', msgutil.receive_message(request))
-
- def test_payload_length(self):
- for length, bytes in ((0, '\x00'), (0x7f, '\x7f'), (0x80, '\x81\x00'),
- (0x1234, '\x80\xa4\x34')):
- self.assertEqual(length,
- msgutil._payload_length(_create_request(bytes)))
-
- def test_receive_bytes(self):
- request = _create_request('abcdefg')
- self.assertEqual('abc', msgutil._receive_bytes(request, 3))
- self.assertEqual('defg', msgutil._receive_bytes(request, 4))
-
- def test_read_until(self):
- request = _create_request('abcXdefgX')
- self.assertEqual('abc', msgutil._read_until(request, 'X'))
- self.assertEqual('defg', msgutil._read_until(request, 'X'))
-
-
-class MessageReceiverTest(unittest.TestCase):
- def test_queue(self):
- request = _create_blocking_request()
- receiver = msgutil.MessageReceiver(request)
-
- self.assertEqual(None, receiver.receive_nowait())
-
- request.connection.put_bytes('\x00Hello!\xff')
- self.assertEqual('Hello!', receiver.receive())
-
- def test_onmessage(self):
- onmessage_queue = Queue.Queue()
- def onmessage_handler(message):
- onmessage_queue.put(message)
-
- request = _create_blocking_request()
- receiver = msgutil.MessageReceiver(request, onmessage_handler)
-
- request.connection.put_bytes('\x00Hello!\xff')
- self.assertEqual('Hello!', onmessage_queue.get())
-
-
-class MessageSenderTest(unittest.TestCase):
- def test_send(self):
- request = _create_blocking_request()
- sender = msgutil.MessageSender(request)
-
- sender.send('World')
- self.assertEqual('\x00World\xff', request.connection.written_data())
-
- def test_send_nowait(self):
- # Use a queue to check the bytes written by MessageSender.
- # request.connection.written_data() cannot be used here because
- # MessageSender runs in a separate thread.
- send_queue = Queue.Queue()
- def write(bytes):
- send_queue.put(bytes)
- request = _create_blocking_request()
- request.connection.write = write
-
- sender = msgutil.MessageSender(request)
-
- sender.send_nowait('Hello')
- sender.send_nowait('World')
- self.assertEqual('\x00Hello\xff', send_queue.get())
- self.assertEqual('\x00World\xff', send_queue.get())
-
-
-if __name__ == '__main__':
- unittest.main()
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/origin_check_wsh.py b/WebKitTools/pywebsocket/test/testdata/handlers/origin_check_wsh.py
deleted file mode 100644
index 2c139fa..0000000
--- a/WebKitTools/pywebsocket/test/testdata/handlers/origin_check_wsh.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-def web_socket_do_extra_handshake(request):
- if request.ws_origin == 'http://example.com':
- return
- raise ValueError('Unacceptable origin: %r' % request.ws_origin)
-
-
-def web_socket_transfer_data(request):
- request.connection.write('origin_check_wsh.py is called for %s, %s' %
- (request.ws_resource, request.ws_protocol))
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py b/WebKitTools/pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py
deleted file mode 100644
index b982d02..0000000
--- a/WebKitTools/pywebsocket/test/testdata/handlers/sub/exception_in_transfer_wsh.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Exception in web_socket_transfer_data().
-"""
-
-
-def web_socket_do_extra_handshake(request):
- pass
-
-
-def web_socket_transfer_data(request):
- raise Exception('Intentional Exception for %s, %s' %
- (request.ws_resource, request.ws_protocol))
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py b/WebKitTools/pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py
deleted file mode 100644
index 17e7be1..0000000
--- a/WebKitTools/pywebsocket/test/testdata/handlers/sub/no_wsh_at_the_end.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Correct signatures, wrong file name.
-"""
-
-
-def web_socket_do_extra_handshake(request):
- pass
-
-
-def web_socket_transfer_data(request):
- request.connection.write(
- 'sub/no_wsh_at_the_end.py is called for %s, %s' %
- (request.ws_resource, request.ws_protocol))
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py b/WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py
deleted file mode 100644
index 6bf659b..0000000
--- a/WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_handshake_sig_wsh.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Wrong web_socket_do_extra_handshake signature.
-"""
-
-
-def no_web_socket_do_extra_handshake(request):
- pass
-
-
-def web_socket_transfer_data(request):
- request.connection.write(
- 'sub/wrong_handshake_sig_wsh.py is called for %s, %s' %
- (request.ws_resource, request.ws_protocol))
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py b/WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py
deleted file mode 100644
index e0e2e55..0000000
--- a/WebKitTools/pywebsocket/test/testdata/handlers/sub/wrong_transfer_sig_wsh.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-"""Wrong web_socket_transfer_data() signature.
-"""
-
-
-def web_socket_do_extra_handshake(request):
- pass
-
-
-def no_web_socket_transfer_data(request):
- request.connection.write(
- 'sub/wrong_transfer_sig_wsh.py is called for %s, %s' %
- (request.ws_resource, request.ws_protocol))
-
-
-# vi:sts=4 sw=4 et
diff --git a/WebKitTools/record-memory-win/record-memory-win.vcproj b/WebKitTools/record-memory-win/record-memory-win.vcproj
index 6ec3c27..d4c64e6 100644
--- a/WebKitTools/record-memory-win/record-memory-win.vcproj
+++ b/WebKitTools/record-memory-win/record-memory-win.vcproj
@@ -21,6 +21,82 @@
IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="&quot;$(VCInstallDir)\PlatformSDK\Include&quot;;&quot;$(VCInstallDir)\Include&quot;"
+ PreprocessorDefinitions="_WIN32_WINNT=0x501"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ LinkIncremental="1"
+ AdditionalLibraryDirectories="&quot;$(VCInstallDir)\PlatformSDK\Lib&quot;"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release_LTCG|Win32"
+ OutputDirectory="$(WebKitOutputDir)\bin"
+ IntermediateDirectory="$(WebKitOutputDir)\obj\$(ProjectName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
diff --git a/WebKitTools/wx/browser/browser.cpp b/WebKitTools/wx/browser/browser.cpp
index df701bb..95c39d4 100644
--- a/WebKitTools/wx/browser/browser.cpp
+++ b/WebKitTools/wx/browser/browser.cpp
@@ -61,7 +61,7 @@ bool MyApp::OnInit()
#if __WXMSW__ || __WXMAC__
settings.SetPluginsEnabled(true);
#endif
- settings.SetDatabasesEnabled(true);
+ frame->webview->SetDatabasesEnabled(true);
settings.SetEditableLinkBehavior(wxEditableLinkOnlyLiveWithShiftKey);
frame->CentreOnScreen();
frame->Show(true);
diff --git a/WebKitTools/wx/browser/wscript b/WebKitTools/wx/browser/wscript
index a2a24e0..8c22cf6 100644
--- a/WebKitTools/wx/browser/wscript
+++ b/WebKitTools/wx/browser/wscript
@@ -29,7 +29,8 @@ import sys
from settings import *
-include_paths = [os.path.join(wk_root, 'WebKit', 'wx')]
+include_paths = [os.path.join(wk_root, 'WebCore', 'bindings', 'wx'),
+ os.path.join(wk_root, 'WebKit', 'wx')]
def set_options(opt):
common_set_options(opt)
@@ -45,9 +46,9 @@ def build(bld):
includes = ' '.join(include_paths),
source = 'browser.cpp',
target = 'wxBrowser',
- uselib = 'WX CURL ICU XSLT XML WXWEBKIT ' + get_config(),
+ uselib = 'WX CURL ICU XSLT XML ' + get_config(),
libpath = [output_dir],
- uselib_local = '',
+ uselib_local = 'wxwebkit',
install_path = output_dir)
if sys.platform.startswith('darwin'):
diff --git a/WebKitTools/wx/build/settings.py b/WebKitTools/wx/build/settings.py
index d3b7b2c..cd3358c 100644
--- a/WebKitTools/wx/build/settings.py
+++ b/WebKitTools/wx/build/settings.py
@@ -60,7 +60,7 @@ common_libpaths = []
common_frameworks = []
ports = [
- 'CF',
+ 'Brew',
'Chromium',
'Gtk',
'Haiku',
@@ -90,54 +90,68 @@ jscore_dirs = [
'profiler',
'runtime',
'wtf',
+ 'wtf/text',
'wtf/unicode',
'wtf/unicode/icu',
'yarr',
]
webcore_dirs = [
- 'accessibility',
- 'bindings',
- 'bindings/js',
- 'bridge',
- 'bridge/c',
- 'bridge/jsc',
- 'css',
- 'DerivedSources',
- 'dom',
- 'dom/default',
- 'editing',
- 'history',
- 'html',
- 'html/canvas',
- 'inspector',
- 'loader',
- 'loader/appcache',
- 'loader/archive',
- 'loader/icon',
- 'notifications',
- 'page',
- 'page/animation',
- 'platform',
- 'platform/animation',
- 'platform/graphics',
- 'platform/graphics/transforms',
- 'platform/image-decoders',
- 'platform/image-decoders/bmp',
- 'platform/image-decoders/gif',
- 'platform/image-decoders/ico',
- 'platform/image-decoders/jpeg',
- 'platform/image-decoders/png',
- 'platform/mock',
- 'platform/network',
- 'platform/sql',
- 'platform/text',
- 'plugins',
- 'rendering',
- 'rendering/style',
- 'storage',
- 'websockets',
- 'xml'
+ 'WebCore/accessibility',
+ 'WebCore/bindings',
+ 'WebCore/bindings/cpp',
+ 'WebCore/bindings/generic',
+ 'WebCore/bindings/js',
+ 'WebCore/bindings/js/specialization',
+ 'WebCore/bridge',
+ 'WebCore/bridge/c',
+ 'WebCore/bridge/jsc',
+ 'WebCore/css',
+ 'WebCore/DerivedSources',
+ 'WebCore/dom',
+ 'WebCore/dom/default',
+ 'WebCore/editing',
+ 'WebCore/fileapi',
+ 'WebCore/history',
+ 'WebCore/html',
+ 'WebCore/html/canvas',
+ 'WebCore/html/parser',
+ 'WebCore/inspector',
+ 'WebCore/loader',
+ 'WebCore/loader/appcache',
+ 'WebCore/loader/archive',
+ 'WebCore/loader/icon',
+ 'WebCore/notifications',
+ 'WebCore/page',
+ 'WebCore/page/animation',
+ 'WebCore/platform',
+ 'WebCore/platform/animation',
+ 'WebCore/platform/graphics',
+ 'WebCore/platform/graphics/filters',
+ 'WebCore/platform/graphics/transforms',
+ 'WebCore/platform/image-decoders',
+ 'WebCore/platform/image-decoders/bmp',
+ 'WebCore/platform/image-decoders/gif',
+ 'WebCore/platform/image-decoders/ico',
+ 'WebCore/platform/image-decoders/jpeg',
+ 'WebCore/platform/image-decoders/png',
+ 'WebCore/platform/mock',
+ 'WebCore/platform/network',
+ 'WebCore/platform/sql',
+ 'WebCore/platform/text',
+ 'WebCore/platform/text/transcoder',
+ 'WebCore/plugins',
+ 'WebCore/rendering',
+ 'WebCore/rendering/style',
+ 'WebCore/rendering/svg',
+ 'WebCore/storage',
+ 'WebCore/svg',
+ 'WebCore/svg/animation',
+ 'WebCore/svg/graphics',
+ 'WebCore/svg/graphics/filters',
+
+ 'WebCore/websockets',
+ 'WebCore/xml'
]
config = get_config(wk_root)
@@ -160,7 +174,7 @@ def get_config():
waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL'
else:
waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL_DBG'
-
+
return waf_configname
create_hash_table = wk_root + "/JavaScriptCore/create_hash_table"
@@ -168,7 +182,10 @@ 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']
+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',
+ 'ENABLE_JIT', 'BUILDING_%s' % build_port.upper()]
msvc_version = 'msvc2008'
@@ -192,15 +209,22 @@ def common_set_options(opt):
opt.add_option('--wx-compiler-prefix', action='store', default='vc',
help='Specify a different compiler prefix (do this if you used COMPILER_PREFIX when building wx itself)')
opt.add_option('--macosx-version', action='store', default='', help="Version of OS X to build for.")
+ opt.add_option('--msvc-version', action='store', default='', help="MSVC version to use to build. Use 8 for 2005, 9 for 2008")
def common_configure(conf):
"""
Configuration used by all targets, called from the target's configure() step.
"""
- conf.env['MSVC_VERSIONS'] = ['msvc 9.0', 'msvc 8.0']
conf.env['MSVC_TARGETS'] = ['x86']
+ if Options.options.msvc_version and Options.options.msvc_version != '':
+ print "msvc version = %s" % Options.options.msvc_version
+ conf.env['MSVC_VERSIONS'] = ['msvc %s.0' % Options.options.msvc_version]
+ else:
+ print "msvc not set!"
+ conf.env['MSVC_VERSIONS'] = ['msvc 9.0', 'msvc 8.0']
+
if sys.platform.startswith('cygwin'):
print "ERROR: You must use the Win32 Python from python.org, not Cygwin Python, when building on Windows."
sys.exit(1)
@@ -226,11 +250,19 @@ def common_configure(conf):
global msvc_version
global msvclibs_dir
+ libprefix = ''
+
if building_on_win32:
- found_versions = conf.get_msvc_versions()
- if found_versions[0][0] == 'msvc 9.0':
+ libprefix = 'lib'
+
+ found = conf.get_msvc_versions()
+ found_versions = []
+ for version in found:
+ found_versions.append(version[0])
+
+ if 'msvc 9.0' in conf.env['MSVC_VERSIONS'] and 'msvc 9.0' in found_versions:
msvc_version = 'msvc2008'
- elif found_versions[0][0] == 'msvc 8.0':
+ elif 'msvc 8.0' in conf.env['MSVC_VERSIONS'] and 'msvc 8.0' in found_versions:
msvc_version = 'msvc2005'
msvclibs_dir = os.path.join(wklibs_dir, msvc_version, 'win')
@@ -275,10 +307,6 @@ def common_configure(conf):
if sys.platform.startswith('darwin'):
conf.env['LIB_ICU'] = ['icucore']
- # Apple does not ship the ICU headers with Mac OS X, so WebKit includes a copy of 3.2 headers
- conf.env.append_value('CPPPATH_JSCORE', os.path.join(jscore_dir, 'icu'))
-
- conf.env.append_value('CPPPATH_WEBCORE', os.path.join(webcore_dir, 'icu'))
conf.env.append_value('CPPPATH', wklibs_dir)
conf.env.append_value('LIBPATH', wklibs_dir)
@@ -300,7 +328,12 @@ def common_configure(conf):
sdk_version = min_version
if min_version == "10.4":
sdk_version += "u"
- conf.env.append_value('LIB', ['WebKitSystemInterfaceTiger'])
+ conf.env.append_value('LIB_WKINTERFACE', ['WebKitSystemInterfaceTiger'])
+ else:
+ # NOTE: There is a WebKitSystemInterfaceSnowLeopard, but when we use that
+ # on 10.6, we get a strange missing symbol error, and this library seems to
+ # work fine for wx's purposes.
+ conf.env.append_value('LIB_WKINTERFACE', ['WebKitSystemInterfaceLeopard'])
sdkroot = '/Developer/SDKs/MacOSX%s.sdk' % sdk_version
sdkflags = ['-arch', 'i386', '-isysroot', sdkroot]
@@ -311,15 +344,6 @@ def common_configure(conf):
conf.env.append_value('CPPPATH_SQLITE3', [os.path.join(wklibs_dir, 'WebCoreSQLite3')])
conf.env.append_value('LIB_SQLITE3', ['WebCoreSQLite3'])
- libprefix = ''
- if building_on_win32:
- libprefix = 'lib'
-
- conf.env['LIB_JSCORE'] = [libprefix + 'jscore']
- conf.env['LIB_WEBCORE'] = [libprefix + 'webcore']
- conf.env['LIB_WXWEBKIT'] = ['wxwebkit']
- conf.env['CXXDEFINES_WXWEBKIT'] = ['WXUSINGDLL_WEBKIT']
-
conf.env.append_value('CXXDEFINES', feature_defines)
if config == 'Release':
conf.env.append_value('CPPDEFINES', 'NDEBUG')
diff --git a/WebKitTools/wx/build/waf_extensions.py b/WebKitTools/wx/build/waf_extensions.py
index 6816441..f50f264 100644
--- a/WebKitTools/wx/build/waf_extensions.py
+++ b/WebKitTools/wx/build/waf_extensions.py
@@ -35,7 +35,12 @@ def exec_command(s, **kw):
if sys.platform.startswith('win') and len(' '.join(s)) > 32000:
import tempfile
(fd, filename) = tempfile.mkstemp()
- os.write(fd, ' '.join(s[1:]))
+ t = []
+ for i in s:
+ if i.find(" ") != -1:
+ i = '"%s"' % i
+ t.append(i)
+ os.write(fd, ' '.join(t[1:]))
os.close(fd)
s = [s[0], '@' + filename]
diff --git a/WebKitTools/wx/packaging/build-mac-installer.py b/WebKitTools/wx/packaging/build-mac-installer.py
index a0c1b22..5b76b0b 100644
--- a/WebKitTools/wx/packaging/build-mac-installer.py
+++ b/WebKitTools/wx/packaging/build-mac-installer.py
@@ -26,6 +26,7 @@
# Script for building Mac .pkg installer
import commands
+import datetime
import distutils.sysconfig
import glob
import optparse
@@ -48,11 +49,11 @@ wxwebkit_dir = os.path.abspath(os.path.join(wxwk_root, "WebKitBuild", get_config
wx_version = wx.__version__[:5]
py_version = sys.version[:3]
-wxwk_version = svn_revision()
+date = str(datetime.date.today())
platform = "osx"
-pkgname = "wxWebKit-%s-wx%s-py%s" % (platform, wx_version[:3], py_version)
+pkgname = "wxWebKit-%s-wx%s-py%s-%s" % (platform, wx_version[:3], py_version, date)
tempdir = "/tmp/%s" % (pkgname)
@@ -141,7 +142,7 @@ try:
pkg_args = ['--title ' + pkgname,
'--out %s.pkg' % pkgname,
- '--version ' + wxwk_version.strip(),
+ '--version ' + date.strip(),
'--id org.wxwebkit.wxwebkit',
'--domain system',
'--root-volume-only',
diff --git a/WebKitTools/wx/packaging/build-win-installer.py b/WebKitTools/wx/packaging/build-win-installer.py
index 2bb8034..ffbdd19 100644
--- a/WebKitTools/wx/packaging/build-win-installer.py
+++ b/WebKitTools/wx/packaging/build-win-installer.py
@@ -27,6 +27,7 @@
import sys, os, string
import commands
+import datetime
import glob
from subprocess import *
@@ -62,7 +63,7 @@ if __name__ == "__main__":
innoSetup = getInnoSetupPath()
os.chdir(sys.path[0])
- svnrevision = svn_revision()
+ date = str(datetime.date.today())
if not os.path.exists(innoSetup):
print "ERROR: Cannot find InnoSetup."
@@ -84,7 +85,7 @@ CopyMode: alwaysoverwrite; Source: *.py; DestDir: "{app}"
installerTemplate = open("wxWebKitInstaller.iss.in", "r").read()
- installerTemplate = installerTemplate.replace("<<VERSION>>", svnrevision)
+ installerTemplate = installerTemplate.replace("<<VERSION>>", date)
installerTemplate = installerTemplate.replace("<<ROOTDIR>>", wxwebkit_dir )
installerTemplate = installerTemplate.replace("<<PYTHONVER>>", sys.version[0:3] )
installerTemplate = installerTemplate.replace("<<FILES>>", fileList )