diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-21 10:57:44 +0200 |
commit | 5ef7c8a6a70875d4430752d146bdcb069605d71d (patch) | |
tree | f6256640b6c46d7da221435803cae65326817ba2 /Tools/DumpRenderTree | |
parent | decad929f578d8db641febc8740649ca6c574638 (diff) | |
download | qtwebkit-5ef7c8a6a70875d4430752d146bdcb069605d71d.tar.gz |
Imported WebKit commit 356d83016b090995d08ad568f2d2c243aa55e831 (http://svn.webkit.org/repository/webkit/trunk@126147)
New snapshot including various build fixes for newer Qt 5
Diffstat (limited to 'Tools/DumpRenderTree')
70 files changed, 2764 insertions, 2654 deletions
diff --git a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp index f04708322..8277ce35f 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp +++ b/Tools/DumpRenderTree/DumpRenderTree.gyp/DumpRenderTree.gyp @@ -464,6 +464,13 @@ '<(PRODUCT_DIR)/lib.java/chromium_net.jar', '<(PRODUCT_DIR)/lib.java/chromium_media.jar', ], + 'conditions': [ + ['inside_chromium_build==1', { + 'ant_build_to_chromium_src': '<(ant_build_out)/../../', + }, { + 'ant_build_to_chromium_src': '<(chromium_src_dir)', + }], + ], }, # Part of the following was copied from <(chromium_src_dir)/build/apk_test.gpyi. # Not including it because gyp include doesn't support variable in path or under @@ -488,6 +495,7 @@ '"<@(input_jars_paths)"', '--output', '<(PRODUCT_DIR)/DumpRenderTree_apk', + '--strip-binary=<(android_strip)', '--ant-args', '-DANDROID_SDK=<(android_sdk)', '--ant-args', @@ -500,6 +508,8 @@ '-DANDROID_TOOLCHAIN=<(android_toolchain)', '--ant-args', '-DPRODUCT_DIR=<(ant_build_out)', + '--ant-args', + '-DCHROMIUM_SRC=<(ant_build_to_chromium_src)', '--sdk-build=<(sdk_build)', '--app_abi', '<(android_app_abi)', diff --git a/Tools/DumpRenderTree/DumpRenderTree.gypi b/Tools/DumpRenderTree/DumpRenderTree.gypi index 996c83d87..cfc478ec9 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.gypi +++ b/Tools/DumpRenderTree/DumpRenderTree.gypi @@ -6,8 +6,8 @@ 'chromium/DRTDevToolsClient.cpp', 'chromium/DRTDevToolsClient.h', 'chromium/DumpRenderTree.cpp', - 'chromium/LayoutTestController.cpp', - 'chromium/LayoutTestController.h', + 'chromium/DRTTestRunner.cpp', + 'chromium/DRTTestRunner.h', 'chromium/MockGrammarCheck.cpp', 'chromium/MockGrammarCheck.h', 'chromium/MockSpellCheck.cpp', diff --git a/Tools/DumpRenderTree/DumpRenderTree.h b/Tools/DumpRenderTree/DumpRenderTree.h index 18d8cda0e..4c6a47210 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.h +++ b/Tools/DumpRenderTree/DumpRenderTree.h @@ -55,12 +55,12 @@ std::wstring urlSuitableForTestResult(const std::wstring& url); #endif -class LayoutTestController; +class TestRunner; 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 RefPtr<LayoutTestController> gLayoutTestController; +extern RefPtr<TestRunner> gTestRunner; void dump(); void displayWebView(); diff --git a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj index b7904f6e3..c2ac67940 100644 --- a/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj +++ b/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj @@ -71,6 +71,7 @@ 515F429C15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 515F429B15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp */; }; 5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5185F69F10714A57007AA393 /* HistoryDelegate.mm */; }; 5185F6B310714E12007AA393 /* HistoryDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 5185F69E10714A57007AA393 /* HistoryDelegate.h */; }; + 51CACBD815D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51CACBD715D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp */; }; 53CBB832134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */; }; 53CBB833134E42F3001CE6A4 /* CyclicRedundancyCheck.h in Headers */ = {isa = PBXBuildFile; fileRef = 53CBB831134E42F3001CE6A4 /* CyclicRedundancyCheck.h */; }; 5DB9AC970F722C3600684641 /* AHEM____.TTF in Copy Font Files */ = {isa = PBXBuildFile; fileRef = AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */; }; @@ -105,8 +106,8 @@ AE8259F308D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; }; AE8259F408D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; }; B5A752A208AF5D1F00138E45 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A752A108AF5D1F00138E45 /* QuartzCore.framework */; }; - BC0131DA0C9772010087317D /* LayoutTestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0131D80C9772010087317D /* LayoutTestController.cpp */; }; - BC0131DB0C9772010087317D /* LayoutTestController.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0131D90C9772010087317D /* LayoutTestController.h */; }; + BC0131DA0C9772010087317D /* TestRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0131D80C9772010087317D /* TestRunner.cpp */; }; + BC0131DB0C9772010087317D /* TestRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0131D90C9772010087317D /* TestRunner.h */; }; BC0E24E00E2D9451001B6BC2 /* AccessibilityUIElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */; }; BC0E24E10E2D9451001B6BC2 /* AccessibilityUIElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */; }; BC0E26150E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */; }; @@ -116,7 +117,7 @@ BC9D90250C97472E0099A4A3 /* WorkQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9D90220C97472E0099A4A3 /* WorkQueue.h */; }; BC9D90260C97472E0099A4A3 /* WorkQueueItem.h in Headers */ = {isa = PBXBuildFile; fileRef = BC9D90230C97472E0099A4A3 /* WorkQueueItem.h */; }; BCA18B230C9B014B00114369 /* GCControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B210C9B014B00114369 /* GCControllerMac.mm */; }; - BCA18B240C9B014B00114369 /* LayoutTestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */; }; + BCA18B240C9B014B00114369 /* TestRunnerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B220C9B014B00114369 /* TestRunnerMac.mm */; }; BCA18B260C9B015C00114369 /* WorkQueueItemMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B250C9B015C00114369 /* WorkQueueItemMac.mm */; }; BCA18B310C9B01B400114369 /* ObjCController.h in Headers */ = {isa = PBXBuildFile; fileRef = BCA18B2F0C9B01B400114369 /* ObjCController.h */; }; BCA18B320C9B01B400114369 /* ObjCController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCA18B300C9B01B400114369 /* ObjCController.m */; }; @@ -283,6 +284,7 @@ 515F429B15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginScriptableObjectOverridesAllProperties.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>"; }; + 51CACBD715D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EvaluateJSWithinNPP_New.cpp; path = TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp; sourceTree = SOURCE_ROOT; }; 53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CyclicRedundancyCheck.cpp; sourceTree = "<group>"; }; 53CBB831134E42F3001CE6A4 /* CyclicRedundancyCheck.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CyclicRedundancyCheck.h; sourceTree = "<group>"; }; 5DE8AE4313A2C15800D6A37D /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -308,8 +310,8 @@ 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; 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>"; }; + BC0131D80C9772010087317D /* TestRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TestRunner.cpp; sourceTree = "<group>"; }; + BC0131D90C9772010087317D /* TestRunner.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TestRunner.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>"; }; @@ -320,7 +322,7 @@ 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>"; }; - BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = LayoutTestControllerMac.mm; path = mac/LayoutTestControllerMac.mm; sourceTree = "<group>"; }; + BCA18B220C9B014B00114369 /* TestRunnerMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = TestRunnerMac.mm; path = mac/TestRunnerMac.mm; sourceTree = "<group>"; }; BCA18B250C9B015C00114369 /* WorkQueueItemMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = WorkQueueItemMac.mm; path = mac/WorkQueueItemMac.mm; sourceTree = "<group>"; }; BCA18B2F0C9B01B400114369 /* ObjCController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = ObjCController.h; path = mac/ObjCController.h; sourceTree = "<group>"; }; BCA18B300C9B01B400114369 /* ObjCController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = ObjCController.m; path = mac/ObjCController.m; sourceTree = "<group>"; }; @@ -498,9 +500,9 @@ BCF6C64F0C98E9C000AC063E /* GCController.cpp */, 14770FE00A22ADF7009342EE /* GCController.h */, BCA18B210C9B014B00114369 /* GCControllerMac.mm */, - BC0131D80C9772010087317D /* LayoutTestController.cpp */, - BC0131D90C9772010087317D /* LayoutTestController.h */, - BCA18B220C9B014B00114369 /* LayoutTestControllerMac.mm */, + BC0131D80C9772010087317D /* TestRunner.cpp */, + BC0131D90C9772010087317D /* TestRunner.h */, + BCA18B220C9B014B00114369 /* TestRunnerMac.mm */, E1B7808511AF1643007E1BC2 /* MockGeolocationProvider.h */, E1B7808711AF1669007E1BC2 /* MockGeolocationProvider.mm */, BCA18B6D0C9B08DB00114369 /* NavigationController.h */, @@ -541,6 +543,7 @@ 1A31EB3613466AC100017372 /* mac */, 1A215A7511F26072008AD0F5 /* DocumentOpenInDestroyStream.cpp */, C0E720741281C828004EF533 /* EvaluateJSAfterRemovingPluginElement.cpp */, + 51CACBD715D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp */, 4AD6A11313C8124000EA9737 /* FormValue.cpp */, 1AFF66BB137DEA8300791696 /* GetURLNotifyWithURLThatFailsToLoad.cpp */, 1A5CC1F3137DD2EC00A5D7E7 /* GetURLWithJavaScriptURL.cpp */, @@ -713,7 +716,7 @@ BCA18B630C9B08C200114369 /* FrameLoadDelegate.h in Headers */, 14770FE20A22ADF7009342EE /* GCController.h in Headers */, BC47412A0D038A4C0072B006 /* JavaScriptThreading.h in Headers */, - BC0131DB0C9772010087317D /* LayoutTestController.h in Headers */, + BC0131DB0C9772010087317D /* TestRunner.h in Headers */, BCA18B710C9B08DB00114369 /* NavigationController.h in Headers */, BCA18B310C9B01B400114369 /* ObjCController.h in Headers */, BCA18B7D0C9B08F100114369 /* ObjCPlugin.h in Headers */, @@ -906,6 +909,7 @@ 1A66C35114576A920099A115 /* ContentsScaleFactor.cpp in Sources */, 515F429C15C07872007C8F90 /* PluginScriptableObjectOverridesAllProperties.cpp in Sources */, 5106803E15CC7B10001A8A23 /* SlowNPPNew.cpp in Sources */, + 51CACBD815D96FD000EB53A2 /* EvaluateJSWithinNPP_New.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -939,8 +943,8 @@ BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */, BCA18B230C9B014B00114369 /* GCControllerMac.mm in Sources */, BC4741410D038A570072B006 /* JavaScriptThreadingPthreads.cpp in Sources */, - BC0131DA0C9772010087317D /* LayoutTestController.cpp in Sources */, - BCA18B240C9B014B00114369 /* LayoutTestControllerMac.mm in Sources */, + BC0131DA0C9772010087317D /* TestRunner.cpp in Sources */, + BCA18B240C9B014B00114369 /* TestRunnerMac.mm in Sources */, BCA18B720C9B08DB00114369 /* NavigationController.m in Sources */, BCA18B320C9B01B400114369 /* ObjCController.m in Sources */, BCA18B7E0C9B08F100114369 /* ObjCPlugin.m in Sources */, diff --git a/Tools/DumpRenderTree/PixelDumpSupport.cpp b/Tools/DumpRenderTree/PixelDumpSupport.cpp index 1d53d589b..165291174 100644 --- a/Tools/DumpRenderTree/PixelDumpSupport.cpp +++ b/Tools/DumpRenderTree/PixelDumpSupport.cpp @@ -31,7 +31,7 @@ #include "CyclicRedundancyCheck.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <cstdio> #include <wtf/Assertions.h> #include <wtf/RefPtr.h> @@ -49,11 +49,11 @@ void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash) { RefPtr<BitmapContext> context; #if PLATFORM(MAC) - if (gLayoutTestController->isPrinting()) + if (gTestRunner->isPrinting()) context = createPagedBitmapContext(); else #endif - context = createBitmapContextFromWebView(gLayoutTestController->testOnscreen(), gLayoutTestController->testRepaint(), gLayoutTestController->testRepaintSweepHorizontally(), gLayoutTestController->dumpSelectionRect()); + context = createBitmapContextFromWebView(gTestRunner->testOnscreen(), gTestRunner->testRepaint(), gTestRunner->testRepaintSweepHorizontally(), gTestRunner->dumpSelectionRect()); ASSERT(context); // Compute the hash of the bitmap context pixels diff --git a/Tools/DumpRenderTree/StorageTrackerDelegate.h b/Tools/DumpRenderTree/StorageTrackerDelegate.h index e025a4476..73032ef59 100644 --- a/Tools/DumpRenderTree/StorageTrackerDelegate.h +++ b/Tools/DumpRenderTree/StorageTrackerDelegate.h @@ -23,15 +23,15 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -class LayoutTestController; +class TestRunner; @interface StorageTrackerDelegate : NSObject { unsigned numberOfNotificationsToLog; - LayoutTestController* controllerToNotifyDone; + TestRunner* controllerToNotifyDone; } -- (void)logNotifications:(unsigned)number controller:(LayoutTestController*)controller; +- (void)logNotifications:(unsigned)number controller:(TestRunner*)controller; - (void)originModified:(NSNotification *)notification; -- (void)setControllerToNotifyDone:(LayoutTestController*)controller; +- (void)setControllerToNotifyDone:(TestRunner*)controller; @end diff --git a/Tools/DumpRenderTree/StorageTrackerDelegate.mm b/Tools/DumpRenderTree/StorageTrackerDelegate.mm index 343880ba1..121fa1753 100644 --- a/Tools/DumpRenderTree/StorageTrackerDelegate.mm +++ b/Tools/DumpRenderTree/StorageTrackerDelegate.mm @@ -26,7 +26,7 @@ #import "config.h" #import "StorageTrackerDelegate.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebSecurityOriginPrivate.h> #import <WebKit/WebStorageManagerPrivate.h> @@ -43,7 +43,7 @@ return self; } -- (void)logNotifications:(unsigned)number controller:(LayoutTestController*)controller +- (void)logNotifications:(unsigned)number controller:(TestRunner*)controller { controllerToNotifyDone = controller; @@ -73,7 +73,7 @@ [super dealloc]; } -- (void)setControllerToNotifyDone:(LayoutTestController*)controller +- (void)setControllerToNotifyDone:(TestRunner*)controller { controllerToNotifyDone = controller; } diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp index 05f3a8c21..75631842f 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp @@ -60,23 +60,13 @@ static void pluginLogWithWindowObject(NPObject* windowObject, NPP instance, cons browser->releaseobject(consoleObject); } -// Helper function which takes in the plugin window object for logging to the console object. This function supports variable -// arguments. -static void pluginLogWithWindowObjectVariableArgs(NPObject* windowObject, NPP instance, const char* format, ...) -{ - va_list args; - va_start(args, format); - char message[2048] = "PLUGIN: "; - vsprintf(message + strlen(message), format, args); - va_end(args); - - pluginLogWithWindowObject(windowObject, instance, message); -} - void pluginLogWithArguments(NPP instance, const char* format, va_list args) { - char message[2048] = "PLUGIN: "; - vsprintf(message + strlen(message), format, args); + const size_t messageBufferSize = 2048; + char message[messageBufferSize] = "PLUGIN: "; + int messageLength = sizeof("PLUGIN: ") - 1; + messageLength += vsnprintf(message + messageLength, messageBufferSize - 1 - messageLength, format, args); + message[messageLength] = '\0'; NPObject* windowObject = 0; NPError error = browser->getvalue(instance, NPNVWindowNPObject, &windowObject); @@ -936,7 +926,7 @@ bool testDocumentOpen(NPP npp) return false; } - pluginLogWithWindowObjectVariableArgs(windowObject, npp, "DOCUMENT OPEN SUCCESS"); + pluginLogWithWindowObject(windowObject, npp, "PLUGIN: DOCUMENT OPEN SUCCESS"); notifyTestCompletion(npp, result.value.objectValue); browser->releaseobject(result.value.objectValue); browser->releaseobject(windowObject); @@ -968,7 +958,7 @@ bool testWindowOpen(NPP npp) return false; } - pluginLogWithWindowObjectVariableArgs(windowObject, npp, "WINDOW OPEN SUCCESS"); + pluginLogWithWindowObject(windowObject, npp, "PLUGIN: WINDOW OPEN SUCCESS"); notifyTestCompletion(npp, result.value.objectValue); browser->releaseobject(result.value.objectValue); browser->releaseobject(windowObject); diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp new file mode 100644 index 000000000..c066db59f --- /dev/null +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2012 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 within NPP_New when initializing asynchronously should not be able to deadlock with the WebProcess + +class EvaluteJSWithinNPP_New : public PluginTest { +public: + EvaluteJSWithinNPP_New(NPP, const string& identifier); + +private: + virtual NPError NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *); + +}; + +EvaluteJSWithinNPP_New::EvaluteJSWithinNPP_New(NPP npp, const string& identifier) + : PluginTest(npp, identifier) +{ +} + +NPError EvaluteJSWithinNPP_New::NPP_New(NPMIMEType pluginType, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData *saved) +{ + // Give the WebProcess enough time to be deadlocked waiting for the PluginProcess. + usleep(15000); + executeScript("var theLocation = window.location;"); + return NPERR_NO_ERROR; +} + +static PluginTest::Register<EvaluteJSWithinNPP_New> registrar("evalute-js-within-npp-new"); diff --git a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp index fd92bfdac..97a4cf389 100644 --- a/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp +++ b/Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp @@ -671,6 +671,11 @@ static int16_t handleEventX11(NPP instance, PluginObject* obj, XEvent* event) // FIXME: extract key code if (obj->eventLogging) pluginLog(instance, "keyUp '%c'", keyEventToChar(&event->xkey)); + if (obj->testKeyboardFocusForPlugins) { + obj->eventLogging = false; + obj->testKeyboardFocusForPlugins = FALSE; + executeScript(obj, "testRunner.notifyDone();"); + } break; case GraphicsExpose: if (obj->eventLogging) diff --git a/Tools/DumpRenderTree/LayoutTestController.cpp b/Tools/DumpRenderTree/TestRunner.cpp index 2bd2c9a09..229bf0680 100644 --- a/Tools/DumpRenderTree/LayoutTestController.cpp +++ b/Tools/DumpRenderTree/TestRunner.cpp @@ -28,7 +28,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "WorkQueue.h" #include "WorkQueueItem.h" @@ -44,7 +44,7 @@ #include <wtf/OwnArrayPtr.h> #include <wtf/RefPtr.h> -LayoutTestController::LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash) +TestRunner::TestRunner(const std::string& testPathOrURL, const std::string& expectedPixelHash) : m_disallowIncreaseForApplicationCacheQuota(false) , m_dumpApplicationCacheDelegateCallbacks(false) , m_dumpAsAudio(false) @@ -100,37 +100,37 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con { } -PassRefPtr<LayoutTestController> LayoutTestController::create(const std::string& testPathOrURL, const std::string& expectedPixelHash) +PassRefPtr<TestRunner> TestRunner::create(const std::string& testPathOrURL, const std::string& expectedPixelHash) { - return adoptRef(new LayoutTestController(testPathOrURL, expectedPixelHash)); + return adoptRef(new TestRunner(testPathOrURL, expectedPixelHash)); } // Static Functions static JSValueRef disallowIncreaseForApplicationCacheQuotaCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDisallowIncreaseForApplicationCacheQuota(true); return JSValueMakeUndefined(context); } static JSValueRef dumpApplicationCacheDelegateCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpAsPDF(true); return JSValueMakeUndefined(context); } static JSValueRef dumpAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpAsText(true); // Optional paramater, describing whether it's allowed to dump pixel results in dumpAsText mode. @@ -141,119 +141,119 @@ static JSValueRef dumpAsTextCallback(JSContextRef context, JSObjectRef function, static JSValueRef dumpBackForwardListCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpBackForwardList(true); return JSValueMakeUndefined(context); } static JSValueRef dumpChildFramesAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpChildFramesAsText(true); return JSValueMakeUndefined(context); } static JSValueRef dumpChildFrameScrollPositionsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpChildFrameScrollPositions(true); return JSValueMakeUndefined(context); } static JSValueRef dumpDatabaseCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpDatabaseCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpDOMAsWebArchiveCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpDOMAsWebArchive(true); return JSValueMakeUndefined(context); } static JSValueRef dumpEditingCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpEditingCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpFrameLoadCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpFrameLoadCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpProgressFinishedCallbackCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpProgressFinishedCallback(true); 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)); + TestRunner* controller = static_cast<TestRunner*>(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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpResourceLoadCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpResourceResponseMIMETypesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpResourceResponseMIMETypes(true); return JSValueMakeUndefined(context); } static JSValueRef dumpSelectionRectCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpSelectionRect(true); return JSValueMakeUndefined(context); } static JSValueRef dumpSourceAsWebArchiveCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpSourceAsWebArchive(true); return JSValueMakeUndefined(context); } static JSValueRef dumpStatusCallbacksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpStatusCallbacks(true); return JSValueMakeUndefined(context); } static JSValueRef dumpTitleChangesCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpTitleChanges(true); 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)); + TestRunner* controller = static_cast<TestRunner*>(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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpWillCacheResponse(true); return JSValueMakeUndefined(context); } @@ -263,7 +263,7 @@ static JSValueRef pathToLocalResourceCallback(JSContextRef context, JSObjectRef if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> localPath(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); @@ -276,7 +276,7 @@ static JSValueRef pathToLocalResourceCallback(JSContextRef context, JSObjectRef static JSValueRef removeAllVisitedLinksCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDumpVisitedLinksCallback(true); controller->removeAllVisitedLinks(); return JSValueMakeUndefined(context); @@ -284,7 +284,7 @@ static JSValueRef removeAllVisitedLinksCallback(JSContextRef context, JSObjectRe static JSValueRef repaintSweepHorizontallyCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTestRepaintSweepHorizontally(true); return JSValueMakeUndefined(context); } @@ -294,14 +294,14 @@ static JSValueRef setCallCloseOnWebViewsCallback(JSContextRef context, JSObjectR if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCallCloseOnWebViews(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } static JSValueRef setCanOpenWindowsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCanOpenWindows(true); return JSValueMakeUndefined(context); } @@ -311,7 +311,7 @@ static JSValueRef setCloseRemainingWindowsWhenCompleteCallback(JSContextRef cont if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCloseRemainingWindowsWhenComplete(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } @@ -328,7 +328,7 @@ static JSValueRef setEncodedAudioDataCallback(JSContextRef context, JSObjectRef OwnArrayPtr<char> encodedAudioDataBuffer = adoptArrayPtr(new char[maxLength + 1]); JSStringGetUTF8CString(encodedAudioData.get(), encodedAudioDataBuffer.get(), maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setEncodedAudioData(encodedAudioDataBuffer.get()); controller->setDumpAsAudio(true); @@ -337,14 +337,14 @@ static JSValueRef setEncodedAudioDataCallback(JSContextRef context, JSObjectRef static JSValueRef testOnscreenCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTestOnscreen(true); return JSValueMakeUndefined(context); } static JSValueRef testRepaintCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTestRepaint(true); return JSValueMakeUndefined(context); } @@ -358,7 +358,7 @@ static JSValueRef addDisallowedURLCallback(JSContextRef context, JSObjectRef fun JSRetainPtr<JSStringRef> url(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addDisallowedURL(url.get()); return JSValueMakeUndefined(context); @@ -383,7 +383,7 @@ static JSValueRef addURLToRedirectCallback(JSContextRef context, JSObjectRef fun OwnArrayPtr<char> destinationBuffer = adoptArrayPtr(new char[maxLength + 1]); JSStringGetUTF8CString(destination.get(), destinationBuffer.get(), maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addURLToRedirect(originBuffer.get(), destinationBuffer.get()); return JSValueMakeUndefined(context); @@ -392,7 +392,7 @@ static JSValueRef addURLToRedirectCallback(JSContextRef context, JSObjectRef fun 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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->callShouldCloseOnWebView()); } @@ -400,7 +400,7 @@ static JSValueRef callShouldCloseOnWebViewCallback(JSContextRef context, JSObjec 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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearAllApplicationCaches(); return JSValueMakeUndefined(context); @@ -414,7 +414,7 @@ static JSValueRef clearApplicationCacheForOriginCallback(JSContextRef context, J JSRetainPtr<JSStringRef> originURL(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearApplicationCacheForOrigin(originURL.get()); return JSValueMakeUndefined(context); @@ -428,21 +428,21 @@ static JSValueRef applicationCacheDiskUsageForOriginCallback(JSContextRef contex JSRetainPtr<JSStringRef> originURL(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->applicationCacheDiskUsageForOrigin(originURL.get())); } static JSValueRef originsWithApplicationCacheCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return controller->originsWithApplicationCache(context); } static JSValueRef clearAllDatabasesCallback(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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearAllDatabases(); return JSValueMakeUndefined(context); @@ -450,7 +450,7 @@ static JSValueRef clearAllDatabasesCallback(JSContextRef context, JSObjectRef fu static JSValueRef syncLocalStorageCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->syncLocalStorage(); @@ -459,7 +459,7 @@ static JSValueRef syncLocalStorageCallback(JSContextRef context, JSObjectRef fun static JSValueRef observeStorageTrackerNotificationsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount < 1) return JSValueMakeUndefined(context); @@ -475,7 +475,7 @@ static JSValueRef observeStorageTrackerNotificationsCallback(JSContextRef contex static JSValueRef deleteAllLocalStorageCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->deleteAllLocalStorage(); return JSValueMakeUndefined(context); @@ -483,7 +483,7 @@ static JSValueRef deleteAllLocalStorageCallback(JSContextRef context, JSObjectRe static JSValueRef deleteLocalStorageForOriginCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount < 1) return JSValueMakeUndefined(context); @@ -498,7 +498,7 @@ static JSValueRef deleteLocalStorageForOriginCallback(JSContextRef context, JSOb static JSValueRef localStorageDiskUsageForOriginCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount < 1) return JSValueMakeUndefined(context); @@ -511,14 +511,14 @@ static JSValueRef localStorageDiskUsageForOriginCallback(JSContextRef context, J static JSValueRef originsWithLocalStorageCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return controller->originsWithLocalStorage(context); } static JSValueRef clearBackForwardListCallback(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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearBackForwardList(); return JSValueMakeUndefined(context); @@ -527,7 +527,7 @@ static JSValueRef clearBackForwardListCallback(JSContextRef context, JSObjectRef static JSValueRef clearPersistentUserStyleSheetCallback(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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->clearPersistentUserStyleSheet(); return JSValueMakeUndefined(context); @@ -542,7 +542,7 @@ static JSValueRef decodeHostNameCallback(JSContextRef context, JSObjectRef funct JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> decodedHostName(Adopt, controller->copyDecodedHostName(name.get())); return JSValueMakeString(context, decodedHostName.get()); } @@ -550,7 +550,7 @@ static JSValueRef decodeHostNameCallback(JSContextRef context, JSObjectRef funct static JSValueRef disableImageLoadingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation, needs windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->disableImageLoading(); return JSValueMakeUndefined(context); @@ -559,7 +559,7 @@ static JSValueRef disableImageLoadingCallback(JSContextRef context, JSObjectRef static JSValueRef dispatchPendingLoadRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation, needs windows implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->dispatchPendingLoadRequests(); return JSValueMakeUndefined(context); @@ -568,7 +568,7 @@ static JSValueRef dispatchPendingLoadRequestsCallback(JSContextRef context, JSOb static JSValueRef displayCallback(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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->display(); return JSValueMakeUndefined(context); @@ -577,8 +577,8 @@ static JSValueRef displayCallback(JSContextRef context, JSObjectRef function, JS static JSValueRef displayInvalidatedRegionCallback(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)); - // LayoutTestController::display() only renders the invalidated region so + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); + // TestRunner::display() only renders the invalidated region so // we can just use that. controller->display(); @@ -594,7 +594,7 @@ static JSValueRef encodeHostNameCallback(JSContextRef context, JSObjectRef funct JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> encodedHostName(Adopt, controller->copyEncodedHostName(name.get())); return JSValueMakeString(context, encodedHostName.get()); } @@ -618,7 +618,7 @@ static JSValueRef execCommandCallback(JSContextRef context, JSObjectRef function value.adopt(JSStringCreateWithUTF8CString("")); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->execCommand(name.get(), value.get()); return JSValueMakeUndefined(context); @@ -636,13 +636,13 @@ static JSValueRef findStringCallback(JSContextRef context, JSObjectRef function, JSObjectRef options = JSValueToObject(context, arguments[1], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->findString(context, target.get(), options)); } static JSValueRef goBackCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->goBack(); return JSValueMakeUndefined(context); @@ -654,7 +654,7 @@ static JSValueRef grantDesktopNotificationPermissionCallback(JSContextRef contex if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->grantDesktopNotificationPermission(JSValueToStringCopy(context, arguments[0], NULL)); @@ -671,7 +671,7 @@ static JSValueRef isCommandEnabledCallback(JSContextRef context, JSObjectRef fun JSRetainPtr<JSStringRef> name(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->isCommandEnabled(name.get())); } @@ -686,7 +686,7 @@ static JSValueRef overridePreferenceCallback(JSContextRef context, JSObjectRef f JSRetainPtr<JSStringRef> value(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->overridePreference(key.get(), value.get()); return JSValueMakeUndefined(context); @@ -695,7 +695,7 @@ static JSValueRef overridePreferenceCallback(JSContextRef context, JSObjectRef f static JSValueRef keepWebHistoryCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->keepWebHistory(); return JSValueMakeUndefined(context); @@ -707,14 +707,14 @@ static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context return JSValueMakeUndefined(context); // Has mac implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return controller->computedStyleIncludingVisitedInfo(context, arguments[0]); } 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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeString(context, controller->layerTreeAsText().get()); } @@ -722,15 +722,15 @@ static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function, { // Has mac & windows implementation // May be able to be made platform independant by using shared WorkQueue - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->notifyDone(); return JSValueMakeUndefined(context); } static bool parsePageParameters(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, float& pageWidthInPixels, float& pageHeightInPixels) { - pageWidthInPixels = LayoutTestController::maxViewWidth; - pageHeightInPixels = LayoutTestController::maxViewHeight; + pageWidthInPixels = TestRunner::maxViewWidth; + pageHeightInPixels = TestRunner::maxViewHeight; switch (argumentCount) { case 2: pageWidthInPixels = static_cast<float>(JSValueToNumber(context, arguments[0], exception)); @@ -828,13 +828,13 @@ static JSValueRef numberOfPagesCallback(JSContextRef context, JSObjectRef functi if (!parsePageParameters(context, argumentCount, arguments, exception, pageWidthInPixels, pageHeightInPixels)) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->numberOfPages(pageWidthInPixels, pageHeightInPixels)); } static JSValueRef numberOfPendingGeolocationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->numberOfPendingGeolocationPermissionRequests()); } @@ -845,7 +845,7 @@ static JSValueRef pagePropertyCallback(JSContextRef context, JSObjectRef functio if (!parsePagePropertyParameters(context, argumentCount, arguments, exception, propertyName, pageNumber)) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSValueRef value = JSValueMakeString(context, controller->pageProperty(propertyName, pageNumber).get()); delete[] propertyName; @@ -860,7 +860,7 @@ static JSValueRef pageSizeAndMarginsInPixelsCallback(JSContextRef context, JSObj if (!parsePageNumberSizeMarings(context, argumentCount, arguments, exception, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft)) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeString(context, controller->pageSizeAndMarginsInPixels(pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).get()); } @@ -874,7 +874,7 @@ static JSValueRef queueBackNavigationCallback(JSContextRef context, JSObjectRef double howFarBackDouble = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueBackNavigation(static_cast<int>(howFarBackDouble)); return JSValueMakeUndefined(context); @@ -890,7 +890,7 @@ static JSValueRef queueForwardNavigationCallback(JSContextRef context, JSObjectR double howFarForwardDouble = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueForwardNavigation(static_cast<int>(howFarForwardDouble)); return JSValueMakeUndefined(context); @@ -913,7 +913,7 @@ static JSValueRef queueLoadCallback(JSContextRef context, JSObjectRef function, } else target.adopt(JSStringCreateWithUTF8CString("")); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueLoad(url.get(), target.get()); return JSValueMakeUndefined(context); @@ -935,7 +935,7 @@ static JSValueRef queueLoadHTMLStringCallback(JSContextRef context, JSObjectRef } else baseURL.adopt(JSStringCreateWithUTF8CString("")); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount >= 3) { JSRetainPtr<JSStringRef> unreachableURL; @@ -954,7 +954,7 @@ static JSValueRef queueReloadCallback(JSContextRef context, JSObjectRef function // Has mac & windows implementation // May be able to be made platform independant by using shared WorkQueue - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueReload(); return JSValueMakeUndefined(context); @@ -970,7 +970,7 @@ static JSValueRef queueLoadingScriptCallback(JSContextRef context, JSObjectRef f JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueLoadingScript(script.get()); return JSValueMakeUndefined(context); @@ -986,7 +986,7 @@ static JSValueRef queueNonLoadingScriptCallback(JSContextRef context, JSObjectRe JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->queueNonLoadingScript(script.get()); return JSValueMakeUndefined(context); @@ -998,7 +998,7 @@ static JSValueRef setAcceptsEditingCallback(JSContextRef context, JSObjectRef fu if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAcceptsEditing(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1010,7 +1010,7 @@ static JSValueRef setAlwaysAcceptCookiesCallback(JSContextRef context, JSObjectR if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAlwaysAcceptCookies(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1022,7 +1022,7 @@ static JSValueRef setAppCacheMaximumSizeCallback(JSContextRef context, JSObjectR if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double size = JSValueToNumber(context, arguments[0], NULL); if (!isnan(size)) @@ -1037,7 +1037,7 @@ static JSValueRef setApplicationCacheOriginQuotaCallback(JSContextRef context, J if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double size = JSValueToNumber(context, arguments[0], NULL); if (!isnan(size)) @@ -1059,7 +1059,7 @@ static JSValueRef setAuthenticationPasswordCallback(JSContextRef context, JSObje char* passwordBuffer = new char[maxLength + 1]; JSStringGetUTF8CString(password.get(), passwordBuffer, maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAuthenticationPassword(passwordBuffer); delete[] passwordBuffer; @@ -1079,7 +1079,7 @@ static JSValueRef setAuthenticationUsernameCallback(JSContextRef context, JSObje char* usernameBuffer = new char[maxLength + 1]; JSStringGetUTF8CString(username.get(), usernameBuffer, maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAuthenticationUsername(usernameBuffer); delete[] usernameBuffer; @@ -1092,7 +1092,7 @@ static JSValueRef setAuthorAndUserStylesEnabledCallback(JSContextRef context, JS if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAuthorAndUserStylesEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1103,7 +1103,7 @@ static JSValueRef setAutofilledCallback(JSContextRef context, JSObjectRef functi if (argumentCount != 2 || !arguments[0]) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAutofilled(context, arguments[0], JSValueToBoolean(context, arguments[1])); return JSValueMakeUndefined(context); @@ -1118,7 +1118,7 @@ static JSValueRef setCacheModelCallback(JSContextRef context, JSObjectRef functi int cacheModel = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCacheModel(cacheModel); return JSValueMakeUndefined(context); @@ -1134,7 +1134,7 @@ static JSValueRef setCustomPolicyDelegateCallback(JSContextRef context, JSObject if (argumentCount >= 2) permissive = JSValueToBoolean(context, arguments[1]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setCustomPolicyDelegate(JSValueToBoolean(context, arguments[0]), permissive); return JSValueMakeUndefined(context); @@ -1146,7 +1146,7 @@ static JSValueRef setDatabaseQuotaCallback(JSContextRef context, JSObjectRef fun if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double quota = JSValueToNumber(context, arguments[0], NULL); if (!isnan(quota)) @@ -1161,7 +1161,7 @@ static JSValueRef setDeferMainResourceDataLoadCallback(JSContextRef context, JSO if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDeferMainResourceDataLoad(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1172,7 +1172,7 @@ static JSValueRef setDefersLoadingCallback(JSContextRef context, JSObjectRef fun if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setDefersLoading(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1183,7 +1183,7 @@ static JSValueRef setUseDeferredFrameLoadingCallback(JSContextRef context, JSObj if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setUseDeferredFrameLoading(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1195,7 +1195,7 @@ static JSValueRef setDomainRelaxationForbiddenForURLSchemeCallback(JSContextRef if (argumentCount < 2) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); bool forbidden = JSValueToBoolean(context, arguments[0]); JSRetainPtr<JSStringRef> scheme(Adopt, JSValueToStringCopy(context, arguments[1], 0)); @@ -1219,7 +1219,7 @@ static JSValueRef setMockDeviceOrientationCallback(JSContextRef context, JSObjec double gamma = JSValueToNumber(context, arguments[5], exception); ASSERT(!*exception); - LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMockDeviceOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma); return JSValueMakeUndefined(context); @@ -1230,7 +1230,7 @@ static JSValueRef setMockGeolocationPositionCallback(JSContextRef context, JSObj if (argumentCount < 3) return JSValueMakeUndefined(context); - LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMockGeolocationPosition(JSValueToNumber(context, arguments[0], NULL), // latitude JSValueToNumber(context, arguments[1], NULL), // longitude JSValueToNumber(context, arguments[2], NULL)); // accuracy @@ -1247,7 +1247,7 @@ static JSValueRef setMockGeolocationErrorCallback(JSContextRef context, JSObject JSRetainPtr<JSStringRef> message(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = reinterpret_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = reinterpret_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMockGeolocationError(code, message.get()); return JSValueMakeUndefined(context); @@ -1266,7 +1266,7 @@ static JSValueRef addMockSpeechInputResultCallback(JSContextRef context, JSObjec JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addMockSpeechInputResult(result.get(), confidence, language.get()); return JSValueMakeUndefined(context); @@ -1279,7 +1279,7 @@ static JSValueRef setMockSpeechInputDumpRectCallback(JSContextRef context, JSObj bool dumpRect = JSValueToBoolean(context, arguments[0]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMockSpeechInputDumpRect(dumpRect); return JSValueMakeUndefined(context); @@ -1291,7 +1291,7 @@ static JSValueRef setNewWindowsCopyBackForwardListCallback(JSContextRef context, if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setNewWindowsCopyBackForwardList(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1303,7 +1303,7 @@ static JSValueRef setGeolocationPermissionCallback(JSContextRef context, JSObjec if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setGeolocationPermission(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1315,7 +1315,7 @@ static JSValueRef setHandlesAuthenticationChallengesCallback(JSContextRef contex if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setHandlesAuthenticationChallenges(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1326,7 +1326,7 @@ static JSValueRef setPOSIXLocaleCallback(JSContextRef context, JSObjectRef funct if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> locale(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); controller->setPOSIXLocale(locale.get()); @@ -1340,7 +1340,7 @@ static JSValueRef setIconDatabaseEnabledCallback(JSContextRef context, JSObjectR if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setIconDatabaseEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1352,7 +1352,7 @@ static JSValueRef setMainFrameIsFirstResponderCallback(JSContextRef context, JSO if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMainFrameIsFirstResponder(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1367,7 +1367,7 @@ static JSValueRef setPersistentUserStyleSheetLocationCallback(JSContextRef conte JSRetainPtr<JSStringRef> path(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPersistentUserStyleSheetLocation(path.get()); return JSValueMakeUndefined(context); @@ -1379,7 +1379,7 @@ static JSValueRef setPrivateBrowsingEnabledCallback(JSContextRef context, JSObje if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPrivateBrowsingEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1391,7 +1391,7 @@ static JSValueRef setJavaScriptCanAccessClipboardCallback(JSContextRef context, if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setJavaScriptCanAccessClipboard(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1403,7 +1403,7 @@ static JSValueRef setXSSAuditorEnabledCallback(JSContextRef context, JSObjectRef if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setXSSAuditorEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1415,7 +1415,7 @@ static JSValueRef setSpatialNavigationEnabledCallback(JSContextRef context, JSOb if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setSpatialNavigationEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1423,7 +1423,7 @@ static JSValueRef setSpatialNavigationEnabledCallback(JSContextRef context, JSOb static JSValueRef setPrintingCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setIsPrinting(true); return JSValueMakeUndefined(context); } @@ -1435,7 +1435,7 @@ static JSValueRef setFrameFlatteningEnabledCallback(JSContextRef context, JSObje if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setFrameFlatteningEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1447,7 +1447,7 @@ static JSValueRef setAllowUniversalAccessFromFileURLsCallback(JSContextRef conte if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAllowUniversalAccessFromFileURLs(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1459,7 +1459,7 @@ static JSValueRef setAllowFileAccessFromFileURLsCallback(JSContextRef context, J if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAllowFileAccessFromFileURLs(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1471,7 +1471,7 @@ static JSValueRef setTabKeyCyclesThroughElementsCallback(JSContextRef context, J if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTabKeyCyclesThroughElements(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1483,7 +1483,7 @@ static JSValueRef setUseDashboardCompatibilityModeCallback(JSContextRef context, if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setUseDashboardCompatibilityMode(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1495,7 +1495,7 @@ static JSValueRef setUserStyleSheetEnabledCallback(JSContextRef context, JSObjec if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setUserStyleSheetEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1510,7 +1510,7 @@ static JSValueRef setUserStyleSheetLocationCallback(JSContextRef context, JSObje JSRetainPtr<JSStringRef> path(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setUserStyleSheetLocation(path.get()); return JSValueMakeUndefined(context); @@ -1525,7 +1525,7 @@ static JSValueRef setValueForUserCallback(JSContextRef context, JSObjectRef func JSRetainPtr<JSStringRef> value(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setValueForUser(context, arguments[0], value.get()); return JSValueMakeUndefined(context); @@ -1540,7 +1540,7 @@ static JSValueRef setViewModeMediaFeatureCallback(JSContextRef context, JSObject JSRetainPtr<JSStringRef> mode(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setViewModeMediaFeature(mode.get()); return JSValueMakeUndefined(context); @@ -1559,7 +1559,7 @@ static JSValueRef setWillSendRequestClearHeaderCallback(JSContextRef context, JS OwnArrayPtr<char> headerBuffer = adoptArrayPtr(new char[maxLength + 1]); JSStringGetUTF8CString(header.get(), headerBuffer.get(), maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWillSendRequestClearHeader(headerBuffer.get()); return JSValueMakeUndefined(context); @@ -1571,7 +1571,7 @@ static JSValueRef setWillSendRequestReturnsNullCallback(JSContextRef context, JS if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWillSendRequestReturnsNull(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1583,7 +1583,7 @@ static JSValueRef setWillSendRequestReturnsNullOnRedirectCallback(JSContextRef c if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWillSendRequestReturnsNullOnRedirect(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1595,7 +1595,7 @@ static JSValueRef setWindowIsKeyCallback(JSContextRef context, JSObjectRef funct if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWindowIsKey(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1604,7 +1604,7 @@ static JSValueRef setWindowIsKeyCallback(JSContextRef context, JSObjectRef funct static JSValueRef waitUntilDoneCallback(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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWaitToDump(true); return JSValueMakeUndefined(context); @@ -1613,7 +1613,7 @@ static JSValueRef waitUntilDoneCallback(JSContextRef context, JSObjectRef functi static JSValueRef windowCountCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac implementation - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); int windows = controller->windowCount(); return JSValueMakeNumber(context, windows); } @@ -1624,7 +1624,7 @@ static JSValueRef setPopupBlockingEnabledCallback(JSContextRef context, JSObject if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPopupBlockingEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1636,7 +1636,7 @@ static JSValueRef setPluginsEnabledCallback(JSContextRef context, JSObjectRef fu if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPluginsEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1655,7 +1655,7 @@ static JSValueRef setPageVisibilityCallback(JSContextRef context, JSObjectRef fu char* visibilityBuffer = new char[maxLength + 1]; JSStringGetUTF8CString(visibility.get(), visibilityBuffer, maxLength + 1); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setPageVisibility(visibilityBuffer); delete[] visibilityBuffer; @@ -1664,7 +1664,7 @@ static JSValueRef setPageVisibilityCallback(JSContextRef context, JSObjectRef fu static JSValueRef resetPageVisibilityCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->resetPageVisibility(); return JSValueMakeUndefined(context); } @@ -1674,7 +1674,7 @@ static JSValueRef setSmartInsertDeleteEnabledCallback(JSContextRef context, JSOb if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setSmartInsertDeleteEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } @@ -1684,7 +1684,7 @@ static JSValueRef setAutomaticLinkDetectionEnabledCallback(JSContextRef context, if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAutomaticLinkDetectionEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } @@ -1694,14 +1694,14 @@ static JSValueRef setSelectTrailingWhitespaceEnabledCallback(JSContextRef contex if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setSelectTrailingWhitespaceEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } static JSValueRef setStopProvisionalFrameLoadsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setStopProvisionalFrameLoads(true); return JSValueMakeUndefined(context); } @@ -1711,28 +1711,28 @@ static JSValueRef setAsynchronousSpellCheckingEnabledCallback(JSContextRef conte if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setAsynchronousSpellCheckingEnabled(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); } static JSValueRef showWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->showWebInspector(); return JSValueMakeUndefined(context); } static JSValueRef closeWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->closeWebInspector(); return JSValueMakeUndefined(context); } static JSValueRef evaluateInWebInspectorCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double callId = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception)); @@ -1744,7 +1744,7 @@ static JSValueRef evaluateInWebInspectorCallback(JSContextRef context, JSObjectR static JSValueRef evaluateScriptInIsolatedWorldCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double worldID = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception)); @@ -1756,7 +1756,7 @@ static JSValueRef evaluateScriptInIsolatedWorldCallback(JSContextRef context, JS static JSValueRef evaluateScriptInIsolatedWorldAndReturnValueCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); double worldID = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); JSRetainPtr<JSStringRef> script(Adopt, JSValueToStringCopy(context, arguments[1], exception)); @@ -1768,7 +1768,7 @@ static JSValueRef evaluateScriptInIsolatedWorldAndReturnValueCallback(JSContextR static JSValueRef elementDoesAutoCompleteForElementWithIdCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[0], exception)); ASSERT(!*exception); @@ -1789,7 +1789,7 @@ static JSValueRef pauseAnimationAtTimeOnElementWithIdCallback(JSContextRef conte JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->pauseAnimationAtTimeOnElementWithId(animationName.get(), time, elementId.get())); } @@ -1805,7 +1805,7 @@ static JSValueRef pauseTransitionAtTimeOnElementWithIdCallback(JSContextRef cont JSRetainPtr<JSStringRef> elementId(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->pauseTransitionAtTimeOnElementWithId(propertyName.get(), time, elementId.get())); } @@ -1814,13 +1814,13 @@ static JSValueRef numberOfActiveAnimationsCallback(JSContextRef context, JSObjec if (argumentCount != 0) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->numberOfActiveAnimations()); } static JSValueRef waitForPolicyDelegateCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t, const JSValueRef[], JSValueRef*) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->waitForPolicyDelegate(); return JSValueMakeUndefined(context); } @@ -1838,7 +1838,7 @@ static JSValueRef addOriginAccessWhitelistEntryCallback(JSContextRef context, JS ASSERT(!*exception); bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains); return JSValueMakeUndefined(context); } @@ -1856,7 +1856,7 @@ static JSValueRef removeOriginAccessWhitelistEntryCallback(JSContextRef context, ASSERT(!*exception); bool allowDestinationSubdomains = JSValueToBoolean(context, arguments[3]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->removeOriginAccessWhitelistEntry(sourceOrigin.get(), destinationProtocol.get(), destinationHost.get(), allowDestinationSubdomains); return JSValueMakeUndefined(context); } @@ -1871,7 +1871,7 @@ static JSValueRef setScrollbarPolicyCallback(JSContextRef context, JSObjectRef, JSRetainPtr<JSStringRef> policy(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setScrollbarPolicy(orientation.get(), policy.get()); return JSValueMakeUndefined(context); } @@ -1886,7 +1886,7 @@ static JSValueRef addUserScriptCallback(JSContextRef context, JSObjectRef, JSObj bool runAtStart = JSValueToBoolean(context, arguments[1]); bool allFrames = JSValueToBoolean(context, arguments[2]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addUserScript(source.get(), runAtStart, allFrames); return JSValueMakeUndefined(context); } @@ -1900,7 +1900,7 @@ static JSValueRef addUserStyleSheetCallback(JSContextRef context, JSObjectRef, J ASSERT(!*exception); bool allFrames = JSValueToBoolean(context, arguments[1]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addUserStyleSheet(source.get(), allFrames); return JSValueMakeUndefined(context); } @@ -1911,7 +1911,7 @@ static JSValueRef setShouldPaintBrokenImageCallback(JSContextRef context, JSObje if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setShouldPaintBrokenImage(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1928,14 +1928,14 @@ static JSValueRef apiTestNewWindowDataLoadBaseURLCallback(JSContextRef context, JSRetainPtr<JSStringRef> baseURL(Adopt, JSValueToStringCopy(context, arguments[1], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(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)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->apiTestGoToCurrentBackForwardItem(); return JSValueMakeUndefined(context); } @@ -1946,7 +1946,7 @@ static JSValueRef setWebViewEditableCallback(JSContextRef context, JSObjectRef f if (argumentCount < 1) return JSValueMakeUndefined(context); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setWebViewEditable(JSValueToBoolean(context, arguments[0])); return JSValueMakeUndefined(context); @@ -1961,7 +1961,7 @@ static JSValueRef sendWebIntentResponseCallback(JSContextRef context, JSObjectRe } else response.adopt(JSStringCreateWithUTF8CString(0)); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->sendWebIntentResponse(response.get()); return JSValueMakeUndefined(context); @@ -1979,7 +1979,7 @@ static JSValueRef deliverWebIntentCallback(JSContextRef context, JSObjectRef fun JSRetainPtr<JSStringRef> data(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->deliverWebIntent(action.get(), type.get(), data.get()); return JSValueMakeUndefined(context); @@ -1987,14 +1987,14 @@ static JSValueRef deliverWebIntentCallback(JSContextRef context, JSObjectRef fun static JSValueRef abortModalCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->abortModal(); return JSValueMakeUndefined(context); } static JSValueRef markerTextForListItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount < 1) return JSValueMakeUndefined(context); return JSValueMakeString(context, controller->markerTextForListItem(context, arguments[0]).get()); @@ -2013,7 +2013,7 @@ static JSValueRef authenticateSessionCallback(JSContextRef context, JSObjectRef, JSRetainPtr<JSStringRef> password(Adopt, JSValueToStringCopy(context, arguments[2], exception)); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->authenticateSession(url.get(), username.get(), password.get()); return JSValueMakeUndefined(context); } @@ -2024,13 +2024,13 @@ static JSValueRef setSerializeHTTPLoadsCallback(JSContextRef context, JSObjectRe if (argumentCount == 1) serialize = JSValueToBoolean(context, arguments[0]); - LayoutTestController::setSerializeHTTPLoads(serialize); + TestRunner::setSerializeHTTPLoads(serialize); return JSValueMakeUndefined(context); } static JSValueRef setShouldStayOnPageAfterHandlingBeforeUnloadCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); if (argumentCount == 1) controller->setShouldStayOnPageAfterHandlingBeforeUnload(JSValueToBoolean(context, arguments[0])); @@ -2040,7 +2040,7 @@ static JSValueRef setShouldStayOnPageAfterHandlingBeforeUnloadCallback(JSContext static JSValueRef addChromeInputFieldCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->addChromeInputField(); // the first argument is a callback that is called once the input field has been added if (argumentCount == 1) @@ -2050,7 +2050,7 @@ static JSValueRef addChromeInputFieldCallback(JSContextRef context, JSObjectRef, static JSValueRef removeChromeInputFieldCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->removeChromeInputField(); // the first argument is a callback that is called once the input field has been added if (argumentCount == 1) @@ -2060,7 +2060,7 @@ static JSValueRef removeChromeInputFieldCallback(JSContextRef context, JSObjectR static JSValueRef focusWebViewCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->focusWebView(); // the first argument is a callback that is called once the input field has been added if (argumentCount == 1) @@ -2076,7 +2076,7 @@ static JSValueRef setBackingScaleFactorCallback(JSContextRef context, JSObjectRe double backingScaleFactor = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setBackingScaleFactor(backingScaleFactor); // The second argument is a callback that is called once the backing scale factor has been set. @@ -2093,26 +2093,26 @@ static JSValueRef preciseTimeCallback(JSContextRef context, JSObjectRef, JSObjec static JSValueRef getGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeBoolean(context, controller->globalFlag()); } static JSValueRef getWebHistoryItemCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->webHistoryItemCount()); } static JSValueRef getWorkerThreadCountCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); return JSValueMakeNumber(context, controller->workerThreadCount()); } #if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(WIN) static JSValueRef getPlatformNameCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> platformName(controller->platformName()); if (!platformName.get()) return JSValueMakeUndefined(context); @@ -2122,28 +2122,28 @@ static JSValueRef getPlatformNameCallback(JSContextRef context, JSObjectRef this static JSValueRef getTitleTextDirectionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> titleDirection(Adopt, JSStringCreateWithUTF8CString(controller->titleTextDirection().c_str())); return JSValueMakeString(context, titleDirection.get()); } static bool setGlobalFlagCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef value, JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setGlobalFlag(JSValueToBoolean(context, value)); return true; } static JSValueRef ignoreDesktopNotificationPermissionRequestsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->ignoreDesktopNotificationPermissionRequests(); return JSValueMakeUndefined(context); } static JSValueRef simulateDesktopNotificationClickCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); JSRetainPtr<JSStringRef> title(Adopt, JSValueToStringCopy(context, arguments[0], exception)); controller->simulateDesktopNotificationClick(title.get()); return JSValueMakeUndefined(context); @@ -2157,7 +2157,7 @@ static JSValueRef setMinimumTimerIntervalCallback(JSContextRef context, JSObject double minimum = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setMinimumTimerInterval(minimum); return JSValueMakeUndefined(context); @@ -2167,7 +2167,7 @@ static JSValueRef setTextDirectionCallback(JSContextRef context, JSObjectRef fun { if (argumentCount == 1) { JSRetainPtr<JSStringRef> direction(Adopt, JSValueToStringCopy(context, arguments[0], exception)); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setTextDirection(direction.get()); } @@ -2179,7 +2179,7 @@ static JSValueRef setHasCustomFullScreenBehaviorCallback(JSContextRef context, J { if (argumentCount == 1) { bool hasCustomBehavior = JSValueToBoolean(context, arguments[0]); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setHasCustomFullScreenBehavior(hasCustomBehavior); } @@ -2194,21 +2194,21 @@ static JSValueRef setStorageDatabaseIdleIntervalCallback(JSContextRef context, J double interval = JSValueToNumber(context, arguments[0], exception); ASSERT(!*exception); - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(thisObject)); controller->setStorageDatabaseIdleInterval(interval); return JSValueMakeUndefined(context); } -static void layoutTestControllerObjectFinalize(JSObjectRef object) +static void testRunnerObjectFinalize(JSObjectRef object) { - LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(object)); + TestRunner* controller = static_cast<TestRunner*>(JSObjectGetPrivate(object)); controller->deref(); } // Object Creation -void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) +void TestRunner::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception) { JSRetainPtr<JSStringRef> testRunnerStr(Adopt, JSStringCreateWithUTF8CString("testRunner")); ref(); @@ -2221,19 +2221,19 @@ void LayoutTestController::makeWindowObject(JSContextRef context, JSObjectRef wi JSObjectSetProperty(context, windowObject, testRunnerStr.get(), layoutTestContollerObject, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception); } -JSClassRef LayoutTestController::getJSClass() +JSClassRef TestRunner::getJSClass() { - static JSStaticValue* staticValues = LayoutTestController::staticValues(); - static JSStaticFunction* staticFunctions = LayoutTestController::staticFunctions(); + static JSStaticValue* staticValues = TestRunner::staticValues(); + static JSStaticFunction* staticFunctions = TestRunner::staticFunctions(); static JSClassDefinition classDefinition = { - 0, kJSClassAttributeNone, "LayoutTestController", 0, staticValues, staticFunctions, - 0, layoutTestControllerObjectFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0 + 0, kJSClassAttributeNone, "TestRunner", 0, staticValues, staticFunctions, + 0, testRunnerObjectFinalize, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; return JSClassCreate(&classDefinition); } -JSStaticValue* LayoutTestController::staticValues() +JSStaticValue* TestRunner::staticValues() { static JSStaticValue staticValues[] = { { "globalFlag", getGlobalFlagCallback, setGlobalFlagCallback, kJSPropertyAttributeNone }, @@ -2248,7 +2248,7 @@ JSStaticValue* LayoutTestController::staticValues() return staticValues; } -JSStaticFunction* LayoutTestController::staticFunctions() +JSStaticFunction* TestRunner::staticFunctions() { static JSStaticFunction staticFunctions[] = { { "abortModal", abortModalCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, @@ -2423,47 +2423,47 @@ JSStaticFunction* LayoutTestController::staticFunctions() return staticFunctions; } -void LayoutTestController::queueLoadHTMLString(JSStringRef content, JSStringRef baseURL) +void TestRunner::queueLoadHTMLString(JSStringRef content, JSStringRef baseURL) { WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL)); } -void LayoutTestController::queueLoadAlternateHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL) +void TestRunner::queueLoadAlternateHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL) { WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL, unreachableURL)); } -void LayoutTestController::queueBackNavigation(int howFarBack) +void TestRunner::queueBackNavigation(int howFarBack) { WorkQueue::shared()->queue(new BackItem(howFarBack)); } -void LayoutTestController::queueForwardNavigation(int howFarForward) +void TestRunner::queueForwardNavigation(int howFarForward) { WorkQueue::shared()->queue(new ForwardItem(howFarForward)); } -void LayoutTestController::queueLoadingScript(JSStringRef script) +void TestRunner::queueLoadingScript(JSStringRef script) { WorkQueue::shared()->queue(new LoadingScriptItem(script)); } -void LayoutTestController::queueNonLoadingScript(JSStringRef script) +void TestRunner::queueNonLoadingScript(JSStringRef script) { WorkQueue::shared()->queue(new NonLoadingScriptItem(script)); } -void LayoutTestController::queueReload() +void TestRunner::queueReload() { WorkQueue::shared()->queue(new ReloadItem); } -void LayoutTestController::grantDesktopNotificationPermission(JSStringRef origin) +void TestRunner::grantDesktopNotificationPermission(JSStringRef origin) { m_desktopNotificationAllowedOrigins.push_back(JSStringRetain(origin)); } -bool LayoutTestController::checkDesktopNotificationPermission(JSStringRef origin) +bool TestRunner::checkDesktopNotificationPermission(JSStringRef origin) { std::vector<JSStringRef>::iterator i; for (i = m_desktopNotificationAllowedOrigins.begin(); @@ -2475,12 +2475,12 @@ bool LayoutTestController::checkDesktopNotificationPermission(JSStringRef origin return false; } -void LayoutTestController::ignoreDesktopNotificationPermissionRequests() +void TestRunner::ignoreDesktopNotificationPermissionRequests() { m_areDesktopNotificationPermissionRequestsIgnored = false; } -void LayoutTestController::waitToDumpWatchdogTimerFired() +void TestRunner::waitToDumpWatchdogTimerFired() { const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; fprintf(stderr, "%s", message); @@ -2488,33 +2488,33 @@ void LayoutTestController::waitToDumpWatchdogTimerFired() notifyDone(); } -void LayoutTestController::setGeolocationPermissionCommon(bool allow) +void TestRunner::setGeolocationPermissionCommon(bool allow) { m_isGeolocationPermissionSet = true; m_geolocationPermission = allow; } -void LayoutTestController::setPOSIXLocale(JSStringRef locale) +void TestRunner::setPOSIXLocale(JSStringRef locale) { char localeBuf[32]; JSStringGetUTF8CString(locale, localeBuf, sizeof(localeBuf)); setlocale(LC_ALL, localeBuf); } -void LayoutTestController::addURLToRedirect(std::string origin, std::string destination) +void TestRunner::addURLToRedirect(std::string origin, std::string destination) { m_URLsToRedirect[origin] = destination; } -const std::string& LayoutTestController::redirectionDestinationForURL(std::string origin) +const std::string& TestRunner::redirectionDestinationForURL(std::string origin) { return m_URLsToRedirect[origin]; } -void LayoutTestController::setShouldPaintBrokenImage(bool shouldPaintBrokenImage) +void TestRunner::setShouldPaintBrokenImage(bool shouldPaintBrokenImage) { m_shouldPaintBrokenImage = shouldPaintBrokenImage; } -const unsigned LayoutTestController::maxViewWidth = 800; -const unsigned LayoutTestController::maxViewHeight = 600; +const unsigned TestRunner::maxViewWidth = 800; +const unsigned TestRunner::maxViewHeight = 600; diff --git a/Tools/DumpRenderTree/LayoutTestController.h b/Tools/DumpRenderTree/TestRunner.h index 3072c7fc9..885b1de72 100644 --- a/Tools/DumpRenderTree/LayoutTestController.h +++ b/Tools/DumpRenderTree/TestRunner.h @@ -26,8 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LayoutTestController_h -#define LayoutTestController_h +#ifndef TestRunner_h +#define TestRunner_h #include <JavaScriptCore/JSObjectRef.h> #include <JavaScriptCore/JSRetainPtr.h> @@ -38,12 +38,12 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> -class LayoutTestController : public RefCounted<LayoutTestController> { +class TestRunner : public RefCounted<TestRunner> { public: - static PassRefPtr<LayoutTestController> create(const std::string& testPathOrURL, const std::string& expectedPixelHash); - ~LayoutTestController(); + static PassRefPtr<TestRunner> create(const std::string& testPathOrURL, const std::string& expectedPixelHash); + ~TestRunner(); - void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception); + void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception); void addDisallowedURL(JSStringRef url); void addURLToRedirect(std::string origin, std::string destination); @@ -86,11 +86,11 @@ public: void queueReload(); void removeAllVisitedLinks(); void sendWebIntentResponse(JSStringRef response); - void setAcceptsEditing(bool acceptsEditing); + void setAcceptsEditing(bool); void setAllowUniversalAccessFromFileURLs(bool); void setAllowFileAccessFromFileURLs(bool); void setAppCacheMaximumSize(unsigned long long quota); - void setApplicationCacheOriginQuota(unsigned long long quota); + void setApplicationCacheOriginQuota(unsigned long long); void setAuthorAndUserStylesEnabled(bool); void setAutofilled(JSContextRef, JSValueRef nodeObject, bool autofilled); void setCacheModel(int); @@ -98,7 +98,7 @@ public: void setDatabaseQuota(unsigned long long quota); void setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme); void setDefersLoading(bool); - void setIconDatabaseEnabled(bool iconDatabaseEnabled); + void setIconDatabaseEnabled(bool); void setJavaScriptCanAccessClipboard(bool flag); void setAutomaticLinkDetectionEnabled(bool flag); void setMainFrameIsFirstResponder(bool flag); @@ -108,20 +108,20 @@ public: void addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language); void setMockSpeechInputDumpRect(bool flag); void setPersistentUserStyleSheetLocation(JSStringRef path); - void setPluginsEnabled(bool flag); - void setPopupBlockingEnabled(bool flag); - void setPrivateBrowsingEnabled(bool flag); - void setSelectTrailingWhitespaceEnabled(bool flag); - void setSmartInsertDeleteEnabled(bool flag); - void setTabKeyCyclesThroughElements(bool cycles); + void setPluginsEnabled(bool); + void setPopupBlockingEnabled(bool); + void setPrivateBrowsingEnabled(bool); + void setSelectTrailingWhitespaceEnabled(bool); + void setSmartInsertDeleteEnabled(bool); + void setTabKeyCyclesThroughElements(bool); void setUseDashboardCompatibilityMode(bool flag); void setUserStyleSheetEnabled(bool flag); void setUserStyleSheetLocation(JSStringRef path); void setValueForUser(JSContextRef, JSValueRef nodeObject, JSStringRef value); - void setViewModeMediaFeature(JSStringRef mode); + void setViewModeMediaFeature(JSStringRef); void setXSSAuditorEnabled(bool flag); - void setFrameFlatteningEnabled(bool enable); - void setSpatialNavigationEnabled(bool enable); + void setFrameFlatteningEnabled(bool); + void setSpatialNavigationEnabled(bool); void setScrollbarPolicy(JSStringRef orientation, JSStringRef policy); void startSpeechInput(JSContextRef inputElement); void setPageVisibility(const char*); @@ -244,7 +244,7 @@ public: void setTestRepaintSweepHorizontally(bool testRepaintSweepHorizontally) { m_testRepaintSweepHorizontally = testRepaintSweepHorizontally; } bool waitToDump() const { return m_waitToDump; } - void setWaitToDump(bool waitToDump); + void setWaitToDump(bool); void waitToDumpWatchdogTimerFired(); const std::set<std::string>& willSendRequestClearHeaders() const { return m_willSendRequestClearHeaders; } @@ -257,10 +257,10 @@ public: void setWillSendRequestReturnsNullOnRedirect(bool returnsNull) { m_willSendRequestReturnsNullOnRedirect = returnsNull; } bool windowIsKey() const { return m_windowIsKey; } - void setWindowIsKey(bool windowIsKey); + void setWindowIsKey(bool); bool alwaysAcceptCookies() const { return m_alwaysAcceptCookies; } - void setAlwaysAcceptCookies(bool alwaysAcceptCookies); + void setAlwaysAcceptCookies(bool); bool handlesAuthenticationChallenges() const { return m_handlesAuthenticationChallenges; } void setHandlesAuthenticationChallenges(bool handlesAuthenticationChallenges) { m_handlesAuthenticationChallenges = handlesAuthenticationChallenges; } @@ -320,13 +320,13 @@ public: void setBackingScaleFactor(double); - void setPOSIXLocale(JSStringRef locale); + void setPOSIXLocale(JSStringRef); void setWebViewEditable(bool); void abortModal(); - static void setSerializeHTTPLoads(bool serialize); + static void setSerializeHTTPLoads(bool); // The following API test functions should probably be moved to platform-specific // unit tests outside of DRT once they exist. @@ -338,7 +338,7 @@ public: JSRetainPtr<JSStringRef> layerTreeAsText() const; - JSRetainPtr<JSStringRef> markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const; + JSRetainPtr<JSStringRef> markerTextForListItem(JSContextRef, JSValueRef nodeObject) const; JSValueRef originsWithLocalStorage(JSContextRef); void deleteAllLocalStorage(); @@ -366,7 +366,7 @@ public: void setStorageDatabaseIdleInterval(double); private: - LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash); + TestRunner(const std::string& testPathOrURL, const std::string& expectedPixelHash); void setGeolocationPermissionCommon(bool allow); @@ -423,7 +423,7 @@ private: std::string m_authenticationUsername; std::string m_authenticationPassword; std::string m_testPathOrURL; - std::string m_expectedPixelHash; // empty string if no hash + std::string m_expectedPixelHash; // empty string if no hash std::string m_titleTextDirection; std::set<std::string> m_willSendRequestClearHeaders; @@ -441,4 +441,4 @@ private: static JSStaticFunction* staticFunctions(); }; -#endif // LayoutTestController_h +#endif // TestRunner_h diff --git a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp index 11f390e3b..b778771ce 100644 --- a/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/blackberry/DumpRenderTree.cpp @@ -41,7 +41,6 @@ #include "HistoryItem.h" #include "IntSize.h" #include "JSDOMBinding.h" -#include "LayoutTestController.h" #include "NotImplemented.h" #include "OwnArrayPtr.h" #include "Page.h" @@ -53,6 +52,7 @@ #include "ScriptController.h" #include "SecurityOrigin.h" #include "Settings.h" +#include "TestRunner.h" #include "TextAffinity.h" #include "Timer.h" #include "Vector.h" @@ -72,7 +72,7 @@ volatile bool testDone; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; WebCore::Frame* mainFrame = 0; WebCore::Frame* topLoadingFrame = 0; @@ -181,7 +181,7 @@ void DumpRenderTree::runTest(const String& url) mainFrame->loader()->stopForUserCancel(); resetToConsistentStateBeforeTesting(); if (shouldLogFrameLoadDelegates(url)) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); String stdoutFile = m_resultsDir + *m_currentTest + ".dump"; String stderrFile = m_resultsDir + *m_currentTest + ".stderr"; @@ -241,11 +241,11 @@ void DumpRenderTree::runRemainingTests() void DumpRenderTree::resetToConsistentStateBeforeTesting() { if (isHTTPTest(m_currentTest->utf8().data())) - gLayoutTestController = LayoutTestController::create(String(httpPrefixURL + *m_currentTest).utf8().data(), ""); + gTestRunner = TestRunner::create(String(httpPrefixURL + *m_currentTest).utf8().data(), ""); else - gLayoutTestController = LayoutTestController::create(String(kSDCLayoutTestsURI + *m_currentTest).utf8().data(), ""); + gTestRunner = TestRunner::create(String(kSDCLayoutTestsURI + *m_currentTest).utf8().data(), ""); - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); DumpRenderTreeSupport::resetGeolocationMock(m_page); @@ -361,7 +361,7 @@ String DumpRenderTree::dumpFramesAsText(WebCore::Frame* frame) s += documentElement->innerText() + "\n"; - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { WebCore::FrameTree* tree = frame->tree(); for (WebCore::Frame* child = tree->firstChild(); child; child = child->tree()->nextSibling()) s += dumpFramesAsText(child); @@ -488,17 +488,17 @@ void DumpRenderTree::dump() String resultMimeType = "text/plain"; String responseMimeType = mainFrame->loader()->documentLoader()->responseMIMEType(); - bool dumpAsText = gLayoutTestController->dumpAsText() || responseMimeType == "text/plain"; + bool dumpAsText = gTestRunner->dumpAsText() || responseMimeType == "text/plain"; String data = dumpAsText ? dumpFramesAsText(mainFrame) : renderTreeDump(); - if (gLayoutTestController->dumpBackForwardList()) + if (gTestRunner->dumpBackForwardList()) data += dumpBackForwardListForWebView(); String result = "Content-Type: " + resultMimeType + "\n" + data; dumpToFile(result); - if (m_dumpPixels && !dumpAsText && gLayoutTestController->generatePixelResults()) - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + if (m_dumpPixels && !dumpAsText && gTestRunner->generatePixelResults()) + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); String crashFile = dumpFile + ".crash"; unlink(crashFile.utf8().data()); @@ -518,7 +518,7 @@ void DumpRenderTree::setWaitToDumpWatchdog(double interval) void DumpRenderTree::waitToDumpWatchdogTimerFired(WebCore::Timer<DumpRenderTree>*) { - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); } void DumpRenderTree::processWork(WebCore::Timer<DumpRenderTree>*) @@ -526,7 +526,7 @@ void DumpRenderTree::processWork(WebCore::Timer<DumpRenderTree>*) if (topLoadingFrame) return; - if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump()) dump(); } @@ -537,7 +537,7 @@ void DumpRenderTree::locationChangeForFrame(WebCore::Frame* frame) topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue - if (gLayoutTestController->waitToDump()) + if (gTestRunner->waitToDump()) return; if (WorkQueue::shared()->count()) @@ -549,16 +549,16 @@ void DumpRenderTree::locationChangeForFrame(WebCore::Frame* frame) // FrameLoadClient delegates. void DumpRenderTree::didStartProvisionalLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didStartProvisionalLoadForFrame\n", drtFrameDescription(frame).utf8().data()); - if (!testDone && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) printf("Frame with user gesture \"%s\" - in didStartProvisionalLoadForFrame\n", WebCore::ScriptController::processingUserGesture() ? "true" : "false"); if (!topLoadingFrame && !testDone) topLoadingFrame = frame; - if (!testDone && gLayoutTestController->stopProvisionalFrameLoads()) { + if (!testDone && gTestRunner->stopProvisionalFrameLoads()) { printf("%s - stopping load in didStartProvisionalLoadForFrame callback\n", drtFrameDescription(frame).utf8().data()); frame->loader()->stopForUserCancel(); } @@ -566,15 +566,15 @@ void DumpRenderTree::didStartProvisionalLoadForFrame(WebCore::Frame* frame) void DumpRenderTree::didCommitLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didCommitLoadForFrame\n", drtFrameDescription(frame).utf8().data()); - gLayoutTestController->setWindowIsKey(true); + gTestRunner->setWindowIsKey(true); } void DumpRenderTree::didFailProvisionalLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFailProvisionalLoadWithError\n", drtFrameDescription(frame).utf8().data()); locationChangeForFrame(frame); @@ -582,7 +582,7 @@ void DumpRenderTree::didFailProvisionalLoadForFrame(WebCore::Frame* frame) void DumpRenderTree::didFailLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFailLoadWithError\n", drtFrameDescription(frame).utf8().data()); locationChangeForFrame(frame); @@ -590,7 +590,7 @@ void DumpRenderTree::didFailLoadForFrame(WebCore::Frame* frame) void DumpRenderTree::didFinishLoadForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishLoadForFrame\n", drtFrameDescription(frame).utf8().data()); if (frame == topLoadingFrame) @@ -601,7 +601,7 @@ void DumpRenderTree::didFinishLoadForFrame(WebCore::Frame* frame) void DumpRenderTree::didFinishDocumentLoadForFrame(WebCore::Frame* frame) { if (!testDone) { - if (gLayoutTestController->dumpFrameLoadCallbacks()) + if (gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishDocumentLoadForFrame\n", drtFrameDescription(frame).utf8().data()); else { unsigned pendingFrameUnloadEvents = frame->domWindow()->pendingUnloadEventListeners(); @@ -615,7 +615,7 @@ void DumpRenderTree::didClearWindowObjectInWorld(WebCore::DOMWrapperWorld*, JSGl { JSValueRef exception = 0; - gLayoutTestController->makeWindowObject(context, windowObject, &exception); + gTestRunner->makeWindowObject(context, windowObject, &exception); ASSERT(!exception); m_gcController->makeWindowObject(context, windowObject, &exception); @@ -633,17 +633,33 @@ void DumpRenderTree::didClearWindowObjectInWorld(WebCore::DOMWrapperWorld*, JSGl void DumpRenderTree::didReceiveTitleForFrame(const String& title, WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didReceiveTitle: %s\n", drtFrameDescription(frame).utf8().data(), title.utf8().data()); - if (gLayoutTestController->dumpTitleChanges()) + if (gTestRunner->dumpTitleChanges()) printf("TITLE CHANGED: %s\n", title.utf8().data()); } // ChromeClient delegates. void DumpRenderTree::addMessageToConsole(const String& message, unsigned int lineNumber, const String& sourceID) { - printf("CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.utf8().data()); + printf("CONSOLE MESSAGE: "); + if (lineNumber) + printf("line %d: ", lineNumber); + String newMessage = message; + int pos = message.find("file://"); + if (pos >= 0) { + newMessage = message.substring(0, pos); + String remaining = message.substring(pos); + String fileName; + int indexFile = remaining.reverseFind('/') + 1; + if (indexFile > 0 && indexFile < remaining.length()) + fileName = remaining.substring(indexFile); + else + fileName = "file:"; + newMessage.append(fileName); + } + printf("%s\n", newMessage.utf8().data()); } void DumpRenderTree::runJavaScriptAlert(const String& message) @@ -675,13 +691,13 @@ bool DumpRenderTree::runBeforeUnloadConfirmPanel(const String& message) void DumpRenderTree::setStatusText(const String& status) { - if (gLayoutTestController->dumpStatusCallbacks()) + if (gTestRunner->dumpStatusCallbacks()) printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", status.utf8().data()); } void DumpRenderTree::exceededDatabaseQuota(WebCore::SecurityOrigin* origin, const String& name) { - if (!testDone && gLayoutTestController->dumpDatabaseCallbacks()) + if (!testDone && gTestRunner->dumpDatabaseCallbacks()) printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", origin->protocol().utf8().data(), origin->host().utf8().data(), origin->port(), name.utf8().data()); WebCore::DatabaseTracker::tracker().setQuota(mainFrame->document()->securityOrigin(), 5 * 1024 * 1024); @@ -689,7 +705,7 @@ void DumpRenderTree::exceededDatabaseQuota(WebCore::SecurityOrigin* origin, cons bool DumpRenderTree::allowsOpeningWindow() { - return gLayoutTestController->canOpenWindows(); + return gTestRunner->canOpenWindows(); } void DumpRenderTree::windowCreated(BlackBerry::WebKit::WebPage* page) @@ -700,25 +716,25 @@ void DumpRenderTree::windowCreated(BlackBerry::WebKit::WebPage* page) // EditorClient delegates. void DumpRenderTree::didBeginEditing() { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidBeginEditing:%s\n", "WebViewDidBeginEditingNotification"); } void DumpRenderTree::didEndEditing() { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidEndEditing:%s\n", "WebViewDidEndEditingNotification"); } void DumpRenderTree::didChange() { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChange:%s\n", "WebViewDidChangeNotification"); } void DumpRenderTree::didChangeSelection() { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeSelection:%s\n", "WebViewDidChangeSelectionNotification"); } @@ -730,28 +746,28 @@ bool DumpRenderTree::findString(const String& string, WebCore::FindOptions optio bool DumpRenderTree::shouldBeginEditingInDOMRange(WebCore::Range* range) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", drtRangeDescription(range).utf8().data()); return m_acceptsEditing; } bool DumpRenderTree::shouldEndEditingInDOMRange(WebCore::Range* range) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", drtRangeDescription(range).utf8().data()); return m_acceptsEditing; } bool DumpRenderTree::shouldDeleteDOMRange(WebCore::Range* range) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", drtRangeDescription(range).utf8().data()); return m_acceptsEditing; } bool DumpRenderTree::shouldChangeSelectedDOMRangeToDOMRangeAffinityStillSelecting(WebCore::Range* fromRange, WebCore::Range* toRange, int affinity, bool stillSelecting) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", drtRangeDescription(fromRange).utf8().data(), drtRangeDescription(toRange).utf8().data(), drtAffinityDescription(static_cast<WebCore::EAffinity>(affinity)).utf8().data(), stillSelecting ? "TRUE" : "FALSE"); return m_acceptsEditing; } @@ -772,14 +788,14 @@ static const char* insertActionString(WebCore::EditorInsertAction action) bool DumpRenderTree::shouldInsertNode(WebCore::Node* node, WebCore::Range* range, int action) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", drtDumpPath(node).utf8().data(), drtRangeDescription(range).utf8().data(), insertActionString((WebCore::EditorInsertAction)action)); return m_acceptsEditing; } bool DumpRenderTree::shouldInsertText(const String& text, WebCore::Range* range, int action) { - if (!testDone && gLayoutTestController->dumpEditingCallbacks()) + if (!testDone && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", text.utf8().data(), drtRangeDescription(range).utf8().data(), insertActionString((WebCore::EditorInsertAction)action)); return m_acceptsEditing; } @@ -816,36 +832,36 @@ void DumpRenderTree::didDecidePolicyForNavigationAction(const WebCore::Navigatio printf("Policy delegate: attempt to load %s with navigation type '%s'\n", request.url().string().utf8().data(), typeDescription); // FIXME: do originating part. - gLayoutTestController->notifyDone(); + gTestRunner->notifyDone(); } void DumpRenderTree::didDispatchWillPerformClientRedirect() { - if (!testDone && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) printf("Frame with user gesture \"%s\" - in willPerformClientRedirect\n", WebCore::ScriptController::processingUserGesture() ? "true" : "false"); } void DumpRenderTree::didHandleOnloadEventsForFrame(WebCore::Frame* frame) { - if (!testDone && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!testDone && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didHandleOnloadEventsForFrame\n", drtFrameDescription(frame).utf8().data()); } void DumpRenderTree::didReceiveResponseForFrame(WebCore::Frame* frame, const WebCore::ResourceResponse& response) { - if (!testDone && gLayoutTestController->dumpResourceResponseMIMETypes()) + if (!testDone && gTestRunner->dumpResourceResponseMIMETypes()) printf("%s has MIME type %s\n", response.url().lastPathComponent().utf8().data(), response.mimeType().utf8().data()); } bool DumpRenderTree::didReceiveAuthenticationChallenge(WebCore::Credential& credential) { - if (!gLayoutTestController->handlesAuthenticationChallenges()) { + if (!gTestRunner->handlesAuthenticationChallenges()) { credential = WebCore::Credential(); printf("%s - didReceiveAuthenticationChallenge - Simulating cancelled authentication\n", drtCredentialDescription(credential).utf8().data()); return false; } - const char* user = gLayoutTestController->authenticationUsername().c_str(); - const char* password = gLayoutTestController->authenticationPassword().c_str(); + const char* user = gTestRunner->authenticationUsername().c_str(); + const char* password = gTestRunner->authenticationPassword().c_str(); credential = WebCore::Credential(user, password, WebCore::CredentialPersistenceForSession); printf("%s - didReceiveAuthenticationChallenge - Responding with %s:%s\n", drtCredentialDescription(credential).utf8().data(), user, password); return true; diff --git a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp index fd59a417e..f6395fbf0 100644 --- a/Tools/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp +++ b/Tools/DumpRenderTree/blackberry/TestRunnerBlackBerry.cpp @@ -17,7 +17,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "CString.h" #include "DatabaseTracker.h" @@ -55,53 +55,53 @@ using WebCore::toElement; using WebCore::toJS; -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { } -void LayoutTestController::addDisallowedURL(JSStringRef url) +void TestRunner::addDisallowedURL(JSStringRef url) { UNUSED_PARAM(url); notImplemented(); } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { #if ENABLE(DATABASE) WebCore::DatabaseTracker::tracker().deleteAllDatabases(); #endif } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->clearBackForwardList(true); } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { notImplemented(); } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) { UNUSED_PARAM(name); notImplemented(); return 0; } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) { UNUSED_PARAM(name); notImplemented(); return 0; } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { notImplemented(); } -void LayoutTestController::display() +void TestRunner::display() { notImplemented(); } @@ -114,7 +114,7 @@ static String jsStringRefToWebCoreString(JSStringRef str) return String::fromUTF8(strArr.get()); } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { if (!mainFrame) return; @@ -125,7 +125,7 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) mainFrame->editor()->command(nameStr).execute(valueStr); } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { if (!mainFrame) return false; @@ -135,12 +135,12 @@ bool LayoutTestController::isCommandEnabled(JSStringRef name) return mainFrame->editor()->command(nameStr).isEnabled(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { notImplemented(); } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (m_waitToDump && (!topLoadingFrame || BlackBerry::WebKit::DumpRenderTree::currentInstance()->loadFinished()) && !WorkQueue::shared()->count()) dump(); @@ -149,12 +149,12 @@ void LayoutTestController::notifyDone() waitForPolicy = false; } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef, JSStringRef url) +JSStringRef TestRunner::pathToLocalResource(JSContextRef, JSStringRef url) { return JSStringRetain(url); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { size_t urlArrSize = JSStringGetMaximumUTF8CStringSize(url); OwnArrayPtr<char> urlArr = adoptArrayPtr(new char[urlArrSize]); @@ -167,55 +167,55 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(absoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool acceptsEditing) +void TestRunner::setAcceptsEditing(bool acceptsEditing) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->setAcceptsEditing(acceptsEditing); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long quota) +void TestRunner::setAppCacheMaximumSize(unsigned long long quota) { UNUSED_PARAM(quota); notImplemented(); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool enable) +void TestRunner::setAuthorAndUserStylesEnabled(bool enable) { mainFrame->page()->settings()->setAuthorAndUserStylesEnabled(enable); } -void LayoutTestController::setCacheModel(int) +void TestRunner::setCacheModel(int) { notImplemented(); } -void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive) { UNUSED_PARAM(setDelegate); UNUSED_PARAM(permissive); notImplemented(); } -void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString*) +void TestRunner::clearApplicationCacheForOrigin(OpaqueJSString*) { // FIXME: Implement to support deleting all application caches for an origin. notImplemented(); } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef) { // FIXME: Implement to support getting disk usage in bytes for an origin. notImplemented(); return 0; } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { // FIXME: Implement to get origins that contain application caches. notImplemented(); return JSValueMakeUndefined(context); } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { if (!mainFrame) return; @@ -223,57 +223,57 @@ void LayoutTestController::setDatabaseQuota(unsigned long long quota) WebCore::DatabaseTracker::tracker().setQuota(mainFrame->document()->securityOrigin(), quota); } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { WebCore::SchemeRegistry::setDomainRelaxationForbiddenForURLScheme(forbidden, jsStringRefToWebCoreString(scheme)); } -void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) +void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled) { UNUSED_PARAM(iconDatabaseEnabled); notImplemented(); } -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) +void TestRunner::setMainFrameIsFirstResponder(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef path) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef path) { UNUSED_PARAM(path); notImplemented(); } -void LayoutTestController::setPopupBlockingEnabled(bool flag) +void TestRunner::setPopupBlockingEnabled(bool flag) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setJavaScriptOpenWindowsAutomatically(!flag); } -void LayoutTestController::setPrivateBrowsingEnabled(bool flag) +void TestRunner::setPrivateBrowsingEnabled(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setXSSAuditorEnabled(bool flag) +void TestRunner::setXSSAuditorEnabled(bool flag) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setXSSAuditorEnabled(flag); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->setSelectTrailingWhitespaceEnabled(flag); } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) +void TestRunner::setTabKeyCyclesThroughElements(bool cycles) { if (!mainFrame) return; @@ -281,51 +281,51 @@ void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) mainFrame->page()->setTabKeyCyclesThroughElements(cycles); } -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) +void TestRunner::setUseDashboardCompatibilityMode(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { UNUSED_PARAM(flag); notImplemented(); } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) +void TestRunner::setUserStyleSheetLocation(JSStringRef path) { String pathStr = jsStringRefToWebCoreString(path); BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setUserStyleSheetLocation(pathStr.utf8().data()); } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setWaitToDump(true); waitForPolicy = true; } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { SharedArray<BlackBerry::WebKit::WebPage::BackForwardEntry> backForwardList; BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->getBackForwardList(backForwardList); return backForwardList.length(); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { notImplemented(); return 0; } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) { UNUSED_PARAM(id); notImplemented(); return false; } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { UNUSED_PARAM(propertyName); UNUSED_PARAM(pageNumber); @@ -333,7 +333,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* property return 0; } -void LayoutTestController::setWaitToDump(bool waitToDump) +void TestRunner::setWaitToDump(bool waitToDump) { // Change from 30s to 35s because some test cases in multipart need 30 seconds, // refer to http/tests/multipart/resources/multipart-wait-before-boundary.php please. @@ -343,13 +343,13 @@ void LayoutTestController::setWaitToDump(bool waitToDump) BlackBerry::WebKit::DumpRenderTree::currentInstance()->setWaitToDumpWatchdog(kWaitToDumpWatchdogInterval); } -void LayoutTestController::setWindowIsKey(bool windowIsKey) +void TestRunner::setWindowIsKey(bool windowIsKey) { m_windowIsKey = windowIsKey; notImplemented(); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { if (!mainFrame) return false; @@ -373,7 +373,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return animationController->pauseAnimationAtTime(node->renderer(), name.get(), time); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { if (!mainFrame) return false; @@ -397,7 +397,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return animationController->pauseTransitionAtTime(node->renderer(), name.get(), time); } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { if (!mainFrame) return false; @@ -409,7 +409,7 @@ unsigned LayoutTestController::numberOfActiveAnimations() const return animationController->numberOfActiveAnimations(mainFrame->document()); } -unsigned int LayoutTestController::workerThreadCount() const +unsigned int TestRunner::workerThreadCount() const { #if ENABLE_WORKERS return WebCore::WorkerThread::workerThreadCount(); @@ -418,17 +418,17 @@ unsigned int LayoutTestController::workerThreadCount() const #endif } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { notImplemented(); } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setLoadsImagesAutomatically(false); } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { if (!mainFrame) return; @@ -446,41 +446,41 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value mainFrame->page()->settings()->setHyperlinkAuditingEnabled(valueStr == "true" || valueStr == "1"); } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { UNUSED_PARAM(alwaysAcceptCookies); notImplemented(); } -void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { DumpRenderTreeSupport::setMockGeolocationPosition(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), latitude, longitude, accuracy); } -void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) +void TestRunner::setMockGeolocationError(int code, JSStringRef message) { String messageStr = jsStringRefToWebCoreString(message); DumpRenderTreeSupport::setMockGeolocationError(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), code, messageStr); } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { notImplemented(); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { notImplemented(); } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { UNUSED_PARAM(callId); UNUSED_PARAM(script); notImplemented(); } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { UNUSED_PARAM(worldID); UNUSED_PARAM(globalObject); @@ -488,7 +488,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned notImplemented(); } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { UNUSED_PARAM(worldID); UNUSED_PARAM(globalObject); @@ -496,7 +496,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj notImplemented(); } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { UNUSED_PARAM(source); UNUSED_PARAM(runAtStart); @@ -504,55 +504,55 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo notImplemented(); } -void LayoutTestController::addUserStyleSheet(JSStringRef, bool) +void TestRunner::addUserStyleSheet(JSStringRef, bool) { notImplemented(); } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int, int, int, int, int, int, int) const +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int, int, int, int, int, int, int) const { notImplemented(); return 0; } -int LayoutTestController::numberOfPages(float, float) +int TestRunner::numberOfPages(float, float) { notImplemented(); return -1; } -void LayoutTestController::setScrollbarPolicy(JSStringRef, JSStringRef) +void TestRunner::setScrollbarPolicy(JSStringRef, JSStringRef) { notImplemented(); } -void LayoutTestController::setWebViewEditable(bool) +void TestRunner::setWebViewEditable(bool) { notImplemented(); } -void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password) +void TestRunner::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password) { notImplemented(); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { notImplemented(); return false; } -void LayoutTestController::setFrameFlatteningEnabled(bool enable) +void TestRunner::setFrameFlatteningEnabled(bool enable) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->settings()->setFrameFlatteningEnabled(enable); } -void LayoutTestController::setSpatialNavigationEnabled(bool enable) +void TestRunner::setSpatialNavigationEnabled(bool enable) { notImplemented(); } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { WebCore::SecurityPolicy::addOriginAccessWhitelistEntry(*WebCore::SecurityOrigin::createFromString(jsStringRefToWebCoreString(sourceOrigin)), jsStringRefToWebCoreString(destinationProtocol), @@ -560,7 +560,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi allowDestinationSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry(*WebCore::SecurityOrigin::createFromString(jsStringRefToWebCoreString(sourceOrigin)), jsStringRefToWebCoreString(destinationProtocol), @@ -568,7 +568,7 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr allowDestinationSubdomains); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { if (!mainFrame) return; @@ -576,7 +576,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) mainFrame->page()->settings()->setAllowFileAccessFromFileURLs(enabled); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { if (!mainFrame) return; @@ -584,33 +584,33 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) mainFrame->page()->settings()->setAllowUniversalAccessFromFileURLs(enabled); } -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) { notImplemented(); } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { notImplemented(); } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag) +void TestRunner::setJavaScriptCanAccessClipboard(bool flag) { BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()->setJavaScriptCanAccessClipboard(flag); } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { return DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(context, value); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { notImplemented(); return 0; } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { WebCore::Element* element = toElement(toJS(toJS(context), nodeObject)); if (!element) @@ -620,102 +620,102 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { notImplemented(); } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { notImplemented(); } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { notImplemented(); } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { notImplemented(); } -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) { notImplemented(); } -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) { notImplemented(); } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { setGeolocationPermissionCommon(allow); DumpRenderTreeSupport::setMockGeolocationPermission(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page(), allow); } -void LayoutTestController::setViewModeMediaFeature(const JSStringRef mode) +void TestRunner::setViewModeMediaFeature(const JSStringRef mode) { notImplemented(); } -void LayoutTestController::setSerializeHTTPLoads(bool) +void TestRunner::setSerializeHTTPLoads(bool) { // FIXME: Implement if needed for https://bugs.webkit.org/show_bug.cgi?id=50758. notImplemented(); } -void LayoutTestController::setMinimumTimerInterval(double) +void TestRunner::setMinimumTimerInterval(double) { notImplemented(); } -void LayoutTestController::setTextDirection(JSStringRef) +void TestRunner::setTextDirection(JSStringRef) { notImplemented(); } -void LayoutTestController::goBack() +void TestRunner::goBack() { // FIXME: implement to enable loader/navigation-while-deferring-loads.html notImplemented(); } -void LayoutTestController::setDefersLoading(bool) +void TestRunner::setDefersLoading(bool) { // FIXME: implement to enable loader/navigation-while-deferring-loads.html notImplemented(); } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { notImplemented(); return JSValueMakeUndefined(context); } -void LayoutTestController::observeStorageTrackerNotifications(unsigned) +void TestRunner::observeStorageTrackerNotifications(unsigned) { notImplemented(); } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { notImplemented(); } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { notImplemented(); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { notImplemented(); } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) { JSC::ExecState* exec = toJS(context); WebCore::Element* element = toElement(toJS(exec, nodeObject)); @@ -728,12 +728,12 @@ void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeOb inputElement->setAutofilled(autofilled); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { return DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests(BlackBerry::WebKit::DumpRenderTree::currentInstance()->page()); } -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) { WebCore::FindOptions options = 0; @@ -774,12 +774,12 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target, !(options & WebCore::Backwards), !(options & WebCore::CaseInsensitive), true /* wrap */, true /* highlightAllMatches */); } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) { // FIXME: Implement. } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) { JSC::ExecState* exec = toJS(context); WebCore::Element* element = toElement(toJS(exec, nodeObject)); @@ -792,57 +792,57 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef node inputElement->setValueForUser(jsStringRefToWebCoreString(value)); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef origin) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef origin) { // FIXME: Implement to support getting disk usage by all application caches for an origin. return 0; } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { } -void LayoutTestController::setBackingScaleFactor(double) +void TestRunner::setBackingScaleFactor(double) { } -void LayoutTestController::setMockSpeechInputDumpRect(bool) +void TestRunner::setMockSpeechInputDumpRect(bool) { } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { notImplemented(); } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { notImplemented(); } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { notImplemented(); } -void LayoutTestController::sendWebIntentResponse(JSStringRef) +void TestRunner::sendWebIntentResponse(JSStringRef) { notImplemented(); } -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) { notImplemented(); } diff --git a/Tools/DumpRenderTree/cg/ImageDiffCG.cpp b/Tools/DumpRenderTree/cg/ImageDiffCG.cpp index db3543730..7fa5110bb 100644 --- a/Tools/DumpRenderTree/cg/ImageDiffCG.cpp +++ b/Tools/DumpRenderTree/cg/ImageDiffCG.cpp @@ -214,7 +214,7 @@ int main(int argc, const char* argv[]) else if (imageSize > 0 && !baselineImage) baselineImage = createImageFromStdin(imageSize); else - fputs("error, image size must be specified.\n", stderr); + fputs("Error: image size must be specified.\n", stderr); } if (actualImage && baselineImage) { @@ -229,9 +229,17 @@ int main(int argc, const char* argv[]) difference = roundf(difference * 100.0f) / 100.0f; difference = max(difference, 0.01f); // round to 2 decimal places } - } else - fputs("error, test and reference image have different properties.\n", stderr); - + } else { + if (CGImageGetWidth(actualImage.get()) != CGImageGetWidth(baselineImage.get()) || CGImageGetHeight(actualImage.get()) != CGImageGetHeight(baselineImage.get())) + fprintf(stderr, "Error: test and reference images have different sizes. Test image is %lux%lu, reference image is %lux%lu\n", + CGImageGetWidth(actualImage.get()), CGImageGetHeight(actualImage.get()), + CGImageGetWidth(baselineImage.get()), CGImageGetHeight(baselineImage.get())); + else if (imageHasAlpha(actualImage.get()) != imageHasAlpha(baselineImage.get())) + fprintf(stderr, "Error: test and reference images differ in alpha. Test image %s alpha, reference image %s alpha.\n", + imageHasAlpha(actualImage.get()) ? "has" : "does not have", + imageHasAlpha(baselineImage.get()) ? "has" : "does not have"); + } + if (difference > 0.0f) { if (diffImage) { RetainPtr<CFMutableDataRef> imageData(AdoptCF, CFDataCreateMutable(0, 0)); diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp index 046e1ec2d..bbc9f9bc6 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.cpp +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp @@ -30,7 +30,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "DRTTestRunner.h" #include "DRTDevToolsAgent.h" #include "MockWebSpeechInputController.h" @@ -94,7 +94,7 @@ public: virtual void destroy() { } }; -LayoutTestController::LayoutTestController(TestShell* shell) +DRTTestRunner::DRTTestRunner(TestShell* shell) : m_shell(shell) , m_closeRemainingWindows(false) , m_deferMainResourceDataLoad(false) @@ -107,178 +107,178 @@ LayoutTestController::LayoutTestController(TestShell* 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 LayoutTestController). - bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag); + // by CppBoundClass, the parent to DRTTestRunner). + bindMethod("addFileToPasteboardOnDrag", &DRTTestRunner::addFileToPasteboardOnDrag); #if ENABLE(INPUT_SPEECH) - bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult); - bindMethod("setMockSpeechInputDumpRect", &LayoutTestController::setMockSpeechInputDumpRect); + bindMethod("addMockSpeechInputResult", &DRTTestRunner::addMockSpeechInputResult); + bindMethod("setMockSpeechInputDumpRect", &DRTTestRunner::setMockSpeechInputDumpRect); #endif #if ENABLE(SCRIPTED_SPEECH) - bindMethod("addMockSpeechRecognitionResult", &LayoutTestController::addMockSpeechRecognitionResult); - bindMethod("setMockSpeechRecognitionError", &LayoutTestController::setMockSpeechRecognitionError); - bindMethod("wasMockSpeechRecognitionAborted", &LayoutTestController::wasMockSpeechRecognitionAborted); + bindMethod("addMockSpeechRecognitionResult", &DRTTestRunner::addMockSpeechRecognitionResult); + bindMethod("setMockSpeechRecognitionError", &DRTTestRunner::setMockSpeechRecognitionError); + bindMethod("wasMockSpeechRecognitionAborted", &DRTTestRunner::wasMockSpeechRecognitionAborted); #endif - bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry); - bindMethod("addUserScript", &LayoutTestController::addUserScript); - bindMethod("addUserStyleSheet", &LayoutTestController::addUserStyleSheet); - bindMethod("clearAllDatabases", &LayoutTestController::clearAllDatabases); - bindMethod("closeWebInspector", &LayoutTestController::closeWebInspector); + bindMethod("addOriginAccessWhitelistEntry", &DRTTestRunner::addOriginAccessWhitelistEntry); + bindMethod("addUserScript", &DRTTestRunner::addUserScript); + bindMethod("addUserStyleSheet", &DRTTestRunner::addUserStyleSheet); + bindMethod("clearAllDatabases", &DRTTestRunner::clearAllDatabases); + bindMethod("closeWebInspector", &DRTTestRunner::closeWebInspector); #if ENABLE(POINTER_LOCK) - bindMethod("didLosePointerLock", &LayoutTestController::didLosePointerLock); + bindMethod("didLosePointerLock", &DRTTestRunner::didLosePointerLock); #endif - bindMethod("disableAutoResizeMode", &LayoutTestController::disableAutoResizeMode); - bindMethod("disableImageLoading", &LayoutTestController::disableImageLoading); - bindMethod("display", &LayoutTestController::display); - bindMethod("displayInvalidatedRegion", &LayoutTestController::displayInvalidatedRegion); - 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("dumpProgressFinishedCallback", &LayoutTestController::dumpProgressFinishedCallback); - 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("dumpPermissionClientCallbacks", &LayoutTestController::dumpPermissionClientCallbacks); - bindMethod("dumpCreateView", &LayoutTestController::dumpCreateView); - bindMethod("elementDoesAutoCompleteForElementWithId", &LayoutTestController::elementDoesAutoCompleteForElementWithId); - bindMethod("enableAutoResizeMode", &LayoutTestController::enableAutoResizeMode); - bindMethod("evaluateInWebInspector", &LayoutTestController::evaluateInWebInspector); - bindMethod("evaluateScriptInIsolatedWorld", &LayoutTestController::evaluateScriptInIsolatedWorld); - bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue); - bindMethod("setIsolatedWorldSecurityOrigin", &LayoutTestController::setIsolatedWorldSecurityOrigin); - bindMethod("execCommand", &LayoutTestController::execCommand); - bindMethod("forceRedSelectionColors", &LayoutTestController::forceRedSelectionColors); + bindMethod("disableAutoResizeMode", &DRTTestRunner::disableAutoResizeMode); + bindMethod("disableImageLoading", &DRTTestRunner::disableImageLoading); + bindMethod("display", &DRTTestRunner::display); + bindMethod("displayInvalidatedRegion", &DRTTestRunner::displayInvalidatedRegion); + bindMethod("dumpAsText", &DRTTestRunner::dumpAsText); + bindMethod("dumpBackForwardList", &DRTTestRunner::dumpBackForwardList); + bindMethod("dumpChildFramesAsText", &DRTTestRunner::dumpChildFramesAsText); + bindMethod("dumpChildFrameScrollPositions", &DRTTestRunner::dumpChildFrameScrollPositions); + bindMethod("dumpDatabaseCallbacks", &DRTTestRunner::dumpDatabaseCallbacks); + bindMethod("dumpEditingCallbacks", &DRTTestRunner::dumpEditingCallbacks); + bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks); + bindMethod("dumpProgressFinishedCallback", &DRTTestRunner::dumpProgressFinishedCallback); + bindMethod("dumpUserGestureInFrameLoadCallbacks", &DRTTestRunner::dumpUserGestureInFrameLoadCallbacks); + bindMethod("dumpResourceLoadCallbacks", &DRTTestRunner::dumpResourceLoadCallbacks); + bindMethod("dumpResourceResponseMIMETypes", &DRTTestRunner::dumpResourceResponseMIMETypes); + bindMethod("dumpSelectionRect", &DRTTestRunner::dumpSelectionRect); + bindMethod("dumpStatusCallbacks", &DRTTestRunner::dumpWindowStatusChanges); + bindMethod("dumpTitleChanges", &DRTTestRunner::dumpTitleChanges); + bindMethod("dumpPermissionClientCallbacks", &DRTTestRunner::dumpPermissionClientCallbacks); + bindMethod("dumpCreateView", &DRTTestRunner::dumpCreateView); + bindMethod("elementDoesAutoCompleteForElementWithId", &DRTTestRunner::elementDoesAutoCompleteForElementWithId); + bindMethod("enableAutoResizeMode", &DRTTestRunner::enableAutoResizeMode); + bindMethod("evaluateInWebInspector", &DRTTestRunner::evaluateInWebInspector); + bindMethod("evaluateScriptInIsolatedWorld", &DRTTestRunner::evaluateScriptInIsolatedWorld); + bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue); + bindMethod("setIsolatedWorldSecurityOrigin", &DRTTestRunner::setIsolatedWorldSecurityOrigin); + bindMethod("execCommand", &DRTTestRunner::execCommand); + bindMethod("forceRedSelectionColors", &DRTTestRunner::forceRedSelectionColors); #if ENABLE(NOTIFICATIONS) - bindMethod("grantDesktopNotificationPermission", &LayoutTestController::grantDesktopNotificationPermission); + bindMethod("grantDesktopNotificationPermission", &DRTTestRunner::grantDesktopNotificationPermission); #endif - bindMethod("findString", &LayoutTestController::findString); - bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled); - bindMethod("hasCustomPageSizeStyle", &LayoutTestController::hasCustomPageSizeStyle); - bindMethod("layerTreeAsText", &LayoutTestController::layerTreeAsText); - bindMethod("loseCompositorContext", &LayoutTestController::loseCompositorContext); - bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem); - bindMethod("notifyDone", &LayoutTestController::notifyDone); - bindMethod("numberOfActiveAnimations", &LayoutTestController::numberOfActiveAnimations); - bindMethod("numberOfPages", &LayoutTestController::numberOfPages); - bindMethod("numberOfPendingGeolocationPermissionRequests", &LayoutTestController:: numberOfPendingGeolocationPermissionRequests); - bindMethod("objCIdentityIsEqual", &LayoutTestController::objCIdentityIsEqual); - bindMethod("overridePreference", &LayoutTestController::overridePreference); - bindMethod("pageProperty", &LayoutTestController::pageProperty); - bindMethod("pageSizeAndMarginsInPixels", &LayoutTestController::pageSizeAndMarginsInPixels); - 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("resetPageVisibility", &LayoutTestController::resetPageVisibility); - bindMethod("setAcceptsEditing", &LayoutTestController::setAcceptsEditing); - bindMethod("setAllowDisplayOfInsecureContent", &LayoutTestController::setAllowDisplayOfInsecureContent); - bindMethod("setAllowFileAccessFromFileURLs", &LayoutTestController::setAllowFileAccessFromFileURLs); - bindMethod("setAllowRunningOfInsecureContent", &LayoutTestController::setAllowRunningOfInsecureContent); - bindMethod("setAllowUniversalAccessFromFileURLs", &LayoutTestController::setAllowUniversalAccessFromFileURLs); - bindMethod("setAlwaysAcceptCookies", &LayoutTestController::setAlwaysAcceptCookies); - bindMethod("setAuthorAndUserStylesEnabled", &LayoutTestController::setAuthorAndUserStylesEnabled); - bindMethod("setAutofilled", &LayoutTestController::setAutofilled); - 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("setAudioData", &LayoutTestController::setAudioData); - bindMethod("setGeolocationPermission", &LayoutTestController::setGeolocationPermission); - bindMethod("setIconDatabaseEnabled", &LayoutTestController::setIconDatabaseEnabled); - bindMethod("setJavaScriptCanAccessClipboard", &LayoutTestController::setJavaScriptCanAccessClipboard); - bindMethod("setMinimumTimerInterval", &LayoutTestController::setMinimumTimerInterval); - bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation); - bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError); - bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition); - bindMethod("setPageVisibility", &LayoutTestController::setPageVisibility); - bindMethod("setPluginsEnabled", &LayoutTestController::setPluginsEnabled); + bindMethod("findString", &DRTTestRunner::findString); + bindMethod("isCommandEnabled", &DRTTestRunner::isCommandEnabled); + bindMethod("hasCustomPageSizeStyle", &DRTTestRunner::hasCustomPageSizeStyle); + bindMethod("layerTreeAsText", &DRTTestRunner::layerTreeAsText); + bindMethod("loseCompositorContext", &DRTTestRunner::loseCompositorContext); + bindMethod("markerTextForListItem", &DRTTestRunner::markerTextForListItem); + bindMethod("notifyDone", &DRTTestRunner::notifyDone); + bindMethod("numberOfActiveAnimations", &DRTTestRunner::numberOfActiveAnimations); + bindMethod("numberOfPages", &DRTTestRunner::numberOfPages); + bindMethod("numberOfPendingGeolocationPermissionRequests", &DRTTestRunner:: numberOfPendingGeolocationPermissionRequests); + bindMethod("objCIdentityIsEqual", &DRTTestRunner::objCIdentityIsEqual); + bindMethod("overridePreference", &DRTTestRunner::overridePreference); + bindMethod("pageProperty", &DRTTestRunner::pageProperty); + bindMethod("pageSizeAndMarginsInPixels", &DRTTestRunner::pageSizeAndMarginsInPixels); + bindMethod("pathToLocalResource", &DRTTestRunner::pathToLocalResource); + bindMethod("pauseAnimationAtTimeOnElementWithId", &DRTTestRunner::pauseAnimationAtTimeOnElementWithId); + bindMethod("pauseTransitionAtTimeOnElementWithId", &DRTTestRunner::pauseTransitionAtTimeOnElementWithId); + bindMethod("queueBackNavigation", &DRTTestRunner::queueBackNavigation); + bindMethod("queueForwardNavigation", &DRTTestRunner::queueForwardNavigation); + bindMethod("queueLoadingScript", &DRTTestRunner::queueLoadingScript); + bindMethod("queueLoad", &DRTTestRunner::queueLoad); + bindMethod("queueLoadHTMLString", &DRTTestRunner::queueLoadHTMLString); + bindMethod("queueNonLoadingScript", &DRTTestRunner::queueNonLoadingScript); + bindMethod("queueReload", &DRTTestRunner::queueReload); + bindMethod("removeOriginAccessWhitelistEntry", &DRTTestRunner::removeOriginAccessWhitelistEntry); + bindMethod("repaintSweepHorizontally", &DRTTestRunner::repaintSweepHorizontally); + bindMethod("resetPageVisibility", &DRTTestRunner::resetPageVisibility); + bindMethod("setAcceptsEditing", &DRTTestRunner::setAcceptsEditing); + bindMethod("setAllowDisplayOfInsecureContent", &DRTTestRunner::setAllowDisplayOfInsecureContent); + bindMethod("setAllowFileAccessFromFileURLs", &DRTTestRunner::setAllowFileAccessFromFileURLs); + bindMethod("setAllowRunningOfInsecureContent", &DRTTestRunner::setAllowRunningOfInsecureContent); + bindMethod("setAllowUniversalAccessFromFileURLs", &DRTTestRunner::setAllowUniversalAccessFromFileURLs); + bindMethod("setAlwaysAcceptCookies", &DRTTestRunner::setAlwaysAcceptCookies); + bindMethod("setAuthorAndUserStylesEnabled", &DRTTestRunner::setAuthorAndUserStylesEnabled); + bindMethod("setAutofilled", &DRTTestRunner::setAutofilled); + bindMethod("setCanOpenWindows", &DRTTestRunner::setCanOpenWindows); + bindMethod("setCloseRemainingWindowsWhenComplete", &DRTTestRunner::setCloseRemainingWindowsWhenComplete); + bindMethod("setCustomPolicyDelegate", &DRTTestRunner::setCustomPolicyDelegate); + bindMethod("setDatabaseQuota", &DRTTestRunner::setDatabaseQuota); + bindMethod("setDeferMainResourceDataLoad", &DRTTestRunner::setDeferMainResourceDataLoad); + bindMethod("setDomainRelaxationForbiddenForURLScheme", &DRTTestRunner::setDomainRelaxationForbiddenForURLScheme); + bindMethod("setAudioData", &DRTTestRunner::setAudioData); + bindMethod("setGeolocationPermission", &DRTTestRunner::setGeolocationPermission); + bindMethod("setIconDatabaseEnabled", &DRTTestRunner::setIconDatabaseEnabled); + bindMethod("setJavaScriptCanAccessClipboard", &DRTTestRunner::setJavaScriptCanAccessClipboard); + bindMethod("setMinimumTimerInterval", &DRTTestRunner::setMinimumTimerInterval); + bindMethod("setMockDeviceOrientation", &DRTTestRunner::setMockDeviceOrientation); + bindMethod("setMockGeolocationError", &DRTTestRunner::setMockGeolocationError); + bindMethod("setMockGeolocationPosition", &DRTTestRunner::setMockGeolocationPosition); + bindMethod("setPageVisibility", &DRTTestRunner::setPageVisibility); + bindMethod("setPluginsEnabled", &DRTTestRunner::setPluginsEnabled); #if ENABLE(POINTER_LOCK) - bindMethod("setPointerLockWillFailAsynchronously", &LayoutTestController::setPointerLockWillFailAsynchronously); - bindMethod("setPointerLockWillFailSynchronously", &LayoutTestController::setPointerLockWillFailSynchronously); + bindMethod("setPointerLockWillFailAsynchronously", &DRTTestRunner::setPointerLockWillFailAsynchronously); + bindMethod("setPointerLockWillFailSynchronously", &DRTTestRunner::setPointerLockWillFailSynchronously); #endif - bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled); - bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale); - bindMethod("setPrinting", &LayoutTestController::setPrinting); - bindMethod("setScrollbarPolicy", &LayoutTestController::setScrollbarPolicy); - bindMethod("setSelectTrailingWhitespaceEnabled", &LayoutTestController::setSelectTrailingWhitespaceEnabled); - bindMethod("setTextSubpixelPositioning", &LayoutTestController::setTextSubpixelPositioning); - bindMethod("setBackingScaleFactor", &LayoutTestController::setBackingScaleFactor); - bindMethod("setSmartInsertDeleteEnabled", &LayoutTestController::setSmartInsertDeleteEnabled); - bindMethod("setStopProvisionalFrameLoads", &LayoutTestController::setStopProvisionalFrameLoads); - bindMethod("setTabKeyCyclesThroughElements", &LayoutTestController::setTabKeyCyclesThroughElements); - bindMethod("setUserStyleSheetEnabled", &LayoutTestController::setUserStyleSheetEnabled); - bindMethod("setUserStyleSheetLocation", &LayoutTestController::setUserStyleSheetLocation); - bindMethod("setValueForUser", &LayoutTestController::setValueForUser); - bindMethod("setWillSendRequestClearHeader", &LayoutTestController::setWillSendRequestClearHeader); - bindMethod("setWillSendRequestReturnsNull", &LayoutTestController::setWillSendRequestReturnsNull); - bindMethod("setWillSendRequestReturnsNullOnRedirect", &LayoutTestController::setWillSendRequestReturnsNullOnRedirect); - bindMethod("setWindowIsKey", &LayoutTestController::setWindowIsKey); - bindMethod("setXSSAuditorEnabled", &LayoutTestController::setXSSAuditorEnabled); - bindMethod("setAsynchronousSpellCheckingEnabled", &LayoutTestController::setAsynchronousSpellCheckingEnabled); - bindMethod("showWebInspector", &LayoutTestController::showWebInspector); + bindMethod("setPopupBlockingEnabled", &DRTTestRunner::setPopupBlockingEnabled); + bindMethod("setPOSIXLocale", &DRTTestRunner::setPOSIXLocale); + bindMethod("setPrinting", &DRTTestRunner::setPrinting); + bindMethod("setScrollbarPolicy", &DRTTestRunner::setScrollbarPolicy); + bindMethod("setSelectTrailingWhitespaceEnabled", &DRTTestRunner::setSelectTrailingWhitespaceEnabled); + bindMethod("setTextSubpixelPositioning", &DRTTestRunner::setTextSubpixelPositioning); + bindMethod("setBackingScaleFactor", &DRTTestRunner::setBackingScaleFactor); + bindMethod("setSmartInsertDeleteEnabled", &DRTTestRunner::setSmartInsertDeleteEnabled); + bindMethod("setStopProvisionalFrameLoads", &DRTTestRunner::setStopProvisionalFrameLoads); + bindMethod("setTabKeyCyclesThroughElements", &DRTTestRunner::setTabKeyCyclesThroughElements); + bindMethod("setUserStyleSheetEnabled", &DRTTestRunner::setUserStyleSheetEnabled); + bindMethod("setUserStyleSheetLocation", &DRTTestRunner::setUserStyleSheetLocation); + bindMethod("setValueForUser", &DRTTestRunner::setValueForUser); + bindMethod("setWillSendRequestClearHeader", &DRTTestRunner::setWillSendRequestClearHeader); + bindMethod("setWillSendRequestReturnsNull", &DRTTestRunner::setWillSendRequestReturnsNull); + bindMethod("setWillSendRequestReturnsNullOnRedirect", &DRTTestRunner::setWillSendRequestReturnsNullOnRedirect); + bindMethod("setWindowIsKey", &DRTTestRunner::setWindowIsKey); + bindMethod("setXSSAuditorEnabled", &DRTTestRunner::setXSSAuditorEnabled); + bindMethod("setAsynchronousSpellCheckingEnabled", &DRTTestRunner::setAsynchronousSpellCheckingEnabled); + bindMethod("showWebInspector", &DRTTestRunner::showWebInspector); #if ENABLE(NOTIFICATIONS) - bindMethod("simulateDesktopNotificationClick", &LayoutTestController::simulateDesktopNotificationClick); + bindMethod("simulateDesktopNotificationClick", &DRTTestRunner::simulateDesktopNotificationClick); #endif - bindMethod("startSpeechInput", &LayoutTestController::startSpeechInput); - bindMethod("testRepaint", &LayoutTestController::testRepaint); - bindMethod("waitForPolicyDelegate", &LayoutTestController::waitForPolicyDelegate); - bindMethod("waitUntilDone", &LayoutTestController::waitUntilDone); - bindMethod("windowCount", &LayoutTestController::windowCount); - bindMethod("setTextDirection", &LayoutTestController::setTextDirection); - bindMethod("setImagesAllowed", &LayoutTestController::setImagesAllowed); - bindMethod("setScriptsAllowed", &LayoutTestController::setScriptsAllowed); - bindMethod("setStorageAllowed", &LayoutTestController::setStorageAllowed); - bindMethod("setPluginsAllowed", &LayoutTestController::setPluginsAllowed); + bindMethod("startSpeechInput", &DRTTestRunner::startSpeechInput); + bindMethod("testRepaint", &DRTTestRunner::testRepaint); + bindMethod("waitForPolicyDelegate", &DRTTestRunner::waitForPolicyDelegate); + bindMethod("waitUntilDone", &DRTTestRunner::waitUntilDone); + bindMethod("windowCount", &DRTTestRunner::windowCount); + bindMethod("setTextDirection", &DRTTestRunner::setTextDirection); + bindMethod("setImagesAllowed", &DRTTestRunner::setImagesAllowed); + bindMethod("setScriptsAllowed", &DRTTestRunner::setScriptsAllowed); + bindMethod("setStorageAllowed", &DRTTestRunner::setStorageAllowed); + bindMethod("setPluginsAllowed", &DRTTestRunner::setPluginsAllowed); // The following are stubs. - bindMethod("abortModal", &LayoutTestController::abortModal); - bindMethod("accessStoredWebScriptObject", &LayoutTestController::accessStoredWebScriptObject); - bindMethod("addDisallowedURL", &LayoutTestController::addDisallowedURL); - bindMethod("applicationCacheDiskUsageForOrigin", &LayoutTestController::applicationCacheDiskUsageForOrigin); - bindMethod("callShouldCloseOnWebView", &LayoutTestController::callShouldCloseOnWebView); - bindMethod("clearAllApplicationCaches", &LayoutTestController::clearAllApplicationCaches); - bindMethod("clearApplicationCacheForOrigin", &LayoutTestController::clearApplicationCacheForOrigin); - 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); - bindMethod("deleteAllLocalStorage", &LayoutTestController::deleteAllLocalStorage); - bindMethod("localStorageDiskUsageForOrigin", &LayoutTestController::localStorageDiskUsageForOrigin); - bindMethod("originsWithLocalStorage", &LayoutTestController::originsWithLocalStorage); - bindMethod("deleteLocalStorageForOrigin", &LayoutTestController::deleteLocalStorageForOrigin); - bindMethod("observeStorageTrackerNotifications", &LayoutTestController::observeStorageTrackerNotifications); - bindMethod("syncLocalStorage", &LayoutTestController::syncLocalStorage); - bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload); - bindMethod("enableFixedLayoutMode", &LayoutTestController::enableFixedLayoutMode); - bindMethod("setFixedLayoutSize", &LayoutTestController::setFixedLayoutSize); - bindMethod("selectionAsMarkup", &LayoutTestController::selectionAsMarkup); - bindMethod("setHasCustomFullScreenBehavior", &LayoutTestController::setHasCustomFullScreenBehavior); - bindMethod("textSurroundingNode", &LayoutTestController::textSurroundingNode); + bindMethod("abortModal", &DRTTestRunner::abortModal); + bindMethod("accessStoredWebScriptObject", &DRTTestRunner::accessStoredWebScriptObject); + bindMethod("addDisallowedURL", &DRTTestRunner::addDisallowedURL); + bindMethod("applicationCacheDiskUsageForOrigin", &DRTTestRunner::applicationCacheDiskUsageForOrigin); + bindMethod("callShouldCloseOnWebView", &DRTTestRunner::callShouldCloseOnWebView); + bindMethod("clearAllApplicationCaches", &DRTTestRunner::clearAllApplicationCaches); + bindMethod("clearApplicationCacheForOrigin", &DRTTestRunner::clearApplicationCacheForOrigin); + bindMethod("clearBackForwardList", &DRTTestRunner::clearBackForwardList); + bindMethod("dumpAsWebArchive", &DRTTestRunner::dumpAsWebArchive); + bindMethod("keepWebHistory", &DRTTestRunner::keepWebHistory); + bindMethod("objCClassNameOf", &DRTTestRunner::objCClassNameOf); + bindMethod("setApplicationCacheOriginQuota", &DRTTestRunner::setApplicationCacheOriginQuota); + bindMethod("setCallCloseOnWebViews", &DRTTestRunner::setCallCloseOnWebViews); + bindMethod("setMainFrameIsFirstResponder", &DRTTestRunner::setMainFrameIsFirstResponder); + bindMethod("setPrivateBrowsingEnabled", &DRTTestRunner::setPrivateBrowsingEnabled); + bindMethod("setUseDashboardCompatibilityMode", &DRTTestRunner::setUseDashboardCompatibilityMode); + bindMethod("storeWebScriptObject", &DRTTestRunner::storeWebScriptObject); + bindMethod("deleteAllLocalStorage", &DRTTestRunner::deleteAllLocalStorage); + bindMethod("localStorageDiskUsageForOrigin", &DRTTestRunner::localStorageDiskUsageForOrigin); + bindMethod("originsWithLocalStorage", &DRTTestRunner::originsWithLocalStorage); + bindMethod("deleteLocalStorageForOrigin", &DRTTestRunner::deleteLocalStorageForOrigin); + bindMethod("observeStorageTrackerNotifications", &DRTTestRunner::observeStorageTrackerNotifications); + bindMethod("syncLocalStorage", &DRTTestRunner::syncLocalStorage); + bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload); + bindMethod("enableFixedLayoutMode", &DRTTestRunner::enableFixedLayoutMode); + bindMethod("setFixedLayoutSize", &DRTTestRunner::setFixedLayoutSize); + bindMethod("selectionAsMarkup", &DRTTestRunner::selectionAsMarkup); + bindMethod("setHasCustomFullScreenBehavior", &DRTTestRunner::setHasCustomFullScreenBehavior); + bindMethod("textSurroundingNode", &DRTTestRunner::textSurroundingNode); // The fallback method is called when an unknown method is invoked. - bindFallbackMethod(&LayoutTestController::fallbackMethod); + bindFallbackMethod(&DRTTestRunner::fallbackMethod); // Shared properties. // globalFlag is used by a number of layout tests in @@ -289,21 +289,21 @@ LayoutTestController::LayoutTestController(TestShell* shell) bindProperty("titleTextDirection", &m_titleTextDirection); bindProperty("platformName", &m_platformName); bindProperty("interceptPostMessage", &m_interceptPostMessage); - bindProperty("workerThreadCount", &LayoutTestController::workerThreadCount); - bindMethod("sendWebIntentResponse", &LayoutTestController::sendWebIntentResponse); - bindMethod("deliverWebIntent", &LayoutTestController::deliverWebIntent); + bindProperty("workerThreadCount", &DRTTestRunner::workerThreadCount); + bindMethod("sendWebIntentResponse", &DRTTestRunner::sendWebIntentResponse); + bindMethod("deliverWebIntent", &DRTTestRunner::deliverWebIntent); } -LayoutTestController::~LayoutTestController() +DRTTestRunner::~DRTTestRunner() { } -LayoutTestController::WorkQueue::~WorkQueue() +DRTTestRunner::WorkQueue::~WorkQueue() { reset(); } -void LayoutTestController::WorkQueue::processWorkSoon() +void DRTTestRunner::WorkQueue::processWorkSoon() { if (m_controller->m_shell->webViewHost()->topLoadingFrame()) return; @@ -315,7 +315,7 @@ void LayoutTestController::WorkQueue::processWorkSoon() m_controller->m_shell->testFinished(); } -void LayoutTestController::WorkQueue::processWork() +void DRTTestRunner::WorkQueue::processWork() { TestShell* shell = m_controller->m_shell; // Quit doing work once a load is in progress. @@ -330,14 +330,14 @@ void LayoutTestController::WorkQueue::processWork() shell->testFinished(); } -void LayoutTestController::WorkQueue::reset() +void DRTTestRunner::WorkQueue::reset() { m_frozen = false; while (!m_queue.isEmpty()) delete m_queue.takeFirst(); } -void LayoutTestController::WorkQueue::addWork(WorkItem* work) +void DRTTestRunner::WorkQueue::addWork(WorkItem* work) { if (m_frozen) { delete work; @@ -346,7 +346,7 @@ void LayoutTestController::WorkQueue::addWork(WorkItem* work) m_queue.append(work); } -void LayoutTestController::dumpAsText(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::dumpAsText(const CppArgumentList& arguments, CppVariant* result) { m_dumpAsText = true; m_generatePixelResults = false; @@ -358,98 +358,98 @@ void LayoutTestController::dumpAsText(const CppArgumentList& arguments, CppVaria result->setNull(); } -void LayoutTestController::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::dumpEditingCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpEditingCallbacks = true; result->setNull(); } -void LayoutTestController::dumpBackForwardList(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpBackForwardList(const CppArgumentList&, CppVariant* result) { m_dumpBackForwardList = true; result->setNull(); } -void LayoutTestController::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpFrameLoadCallbacks = true; result->setNull(); } -void LayoutTestController::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpProgressFinishedCallback(const CppArgumentList&, CppVariant* result) { m_dumpProgressFinishedCallback = true; result->setNull(); } -void LayoutTestController::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpUserGestureInFrameLoadCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpUserGestureInFrameLoadCallbacks = true; result->setNull(); } -void LayoutTestController::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpResourceLoadCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpResourceLoadCallbacks = true; result->setNull(); } -void LayoutTestController::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpResourceResponseMIMETypes(const CppArgumentList&, CppVariant* result) { m_dumpResourceResponseMIMETypes = true; result->setNull(); } -void LayoutTestController::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpChildFrameScrollPositions(const CppArgumentList&, CppVariant* result) { m_dumpChildFrameScrollPositions = true; result->setNull(); } -void LayoutTestController::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpChildFramesAsText(const CppArgumentList&, CppVariant* result) { m_dumpChildFramesAsText = true; result->setNull(); } -void LayoutTestController::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpWindowStatusChanges(const CppArgumentList&, CppVariant* result) { m_dumpWindowStatusChanges = true; result->setNull(); } -void LayoutTestController::dumpTitleChanges(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpTitleChanges(const CppArgumentList&, CppVariant* result) { m_dumpTitleChanges = true; result->setNull(); } -void LayoutTestController::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpPermissionClientCallbacks(const CppArgumentList&, CppVariant* result) { m_dumpPermissionClientCallbacks = true; result->setNull(); } -void LayoutTestController::dumpCreateView(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::dumpCreateView(const CppArgumentList&, CppVariant* result) { m_dumpCreateView = true; result->setNull(); } -void LayoutTestController::setAcceptsEditing(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::waitUntilDone(const CppArgumentList&, CppVariant* result) { if (!webkit_support::BeingDebugged()) postDelayedTask(new NotifyDoneTimedOutTask(this), m_shell->layoutTestTimeout()); @@ -457,7 +457,7 @@ void LayoutTestController::waitUntilDone(const CppArgumentList&, CppVariant* res result->setNull(); } -void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::notifyDone(const CppArgumentList&, CppVariant* result) { // Test didn't timeout. Kill the timeout timer. m_taskList.revokeAll(); @@ -466,7 +466,7 @@ void LayoutTestController::notifyDone(const CppArgumentList&, CppVariant* result result->setNull(); } -void LayoutTestController::completeNotifyDone(bool isTimeout) +void DRTTestRunner::completeNotifyDone(bool isTimeout) { if (m_waitUntilDone && !m_shell->webViewHost()->topLoadingFrame() && m_workQueue.isEmpty()) { if (isTimeout) @@ -477,7 +477,7 @@ void LayoutTestController::completeNotifyDone(bool isTimeout) m_waitUntilDone = false; } -class WorkItemBackForward : public LayoutTestController::WorkItem { +class WorkItemBackForward : public DRTTestRunner::WorkItem { public: WorkItemBackForward(int distance) : m_distance(distance) { } bool run(TestShell* shell) @@ -490,21 +490,21 @@ private: int m_distance; }; -void LayoutTestController::queueBackNavigation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::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 { +class WorkItemReload : public DRTTestRunner::WorkItem { public: bool run(TestShell* shell) { @@ -513,13 +513,13 @@ public: } }; -void LayoutTestController::queueReload(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::queueReload(const CppArgumentList&, CppVariant* result) { m_workQueue.addWork(new WorkItemReload); result->setNull(); } -class WorkItemLoadingScript : public LayoutTestController::WorkItem { +class WorkItemLoadingScript : public DRTTestRunner::WorkItem { public: WorkItemLoadingScript(const string& script) : m_script(script) { } bool run(TestShell* shell) @@ -532,7 +532,7 @@ private: string m_script; }; -class WorkItemNonLoadingScript : public LayoutTestController::WorkItem { +class WorkItemNonLoadingScript : public DRTTestRunner::WorkItem { public: WorkItemNonLoadingScript(const string& script) : m_script(script) { } bool run(TestShell* shell) @@ -545,21 +545,21 @@ private: string m_script; }; -void LayoutTestController::queueLoadingScript(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::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 { +class WorkItemLoad : public DRTTestRunner::WorkItem { public: WorkItemLoad(const WebURL& url, const WebString& target) : m_url(url) @@ -575,7 +575,7 @@ private: WebString m_target; }; -void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueLoad(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { // FIXME: Implement WebURL::resolve() and avoid GURL. @@ -591,7 +591,7 @@ void LayoutTestController::queueLoad(const CppArgumentList& arguments, CppVarian result->setNull(); } -class WorkItemLoadHTMLString : public LayoutTestController::WorkItem { +class WorkItemLoadHTMLString : public DRTTestRunner::WorkItem { public: WorkItemLoadHTMLString(const std::string& html, const WebURL& baseURL) : m_html(html) @@ -613,7 +613,7 @@ private: WebURL m_unreachableURL; }; -void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::queueLoadHTMLString(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { string html = arguments[0].toString(); @@ -628,7 +628,7 @@ void LayoutTestController::queueLoadHTMLString(const CppArgumentList& arguments, result->setNull(); } -void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::objCIdentityIsEqual(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 2) { // This is the best we can do to return an error. @@ -638,7 +638,7 @@ void LayoutTestController::objCIdentityIsEqual(const CppArgumentList& arguments, result->set(arguments[0].isEqual(arguments[1])); } -void LayoutTestController::reset() +void DRTTestRunner::reset() { if (m_shell) { m_shell->webView()->setZoomLevel(false, 0); @@ -707,7 +707,7 @@ void LayoutTestController::reset() #endif } -void LayoutTestController::locationChangeDone() +void DRTTestRunner::locationChangeDone() { m_webHistoryItemCount.set(m_shell->navigationEntryCount()); @@ -718,72 +718,72 @@ void LayoutTestController::locationChangeDone() m_workQueue.processWorkSoon(); } -void LayoutTestController::policyDelegateDone() +void DRTTestRunner::policyDelegateDone() { ASSERT(m_waitUntilDone); m_shell->testFinished(); m_waitUntilDone = false; } -void LayoutTestController::setCanOpenWindows(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setCanOpenWindows(const CppArgumentList&, CppVariant* result) { m_canOpenWindows = true; result->setNull(); } -void LayoutTestController::setTabKeyCyclesThroughElements(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::windowCount(const CppArgumentList&, CppVariant* result) { result->set(static_cast<int>(m_shell->windowCount())); } -void LayoutTestController::setCloseRemainingWindowsWhenComplete(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::setAlwaysAcceptCookies(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0) webkit_support::SetAcceptAllCookies(cppVariantToBool(arguments[0])); result->setNull(); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAsynchronousSpellCheckingEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webView()->settings()->setAsynchronousSpellCheckingEnabled(cppVariantToBool(arguments[0])); result->setNull(); } -void LayoutTestController::showWebInspector(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::showWebInspector(const CppArgumentList&, CppVariant* result) { m_shell->showDevTools(); result->setNull(); } -void LayoutTestController::closeWebInspector(const CppArgumentList& args, CppVariant* result) +void DRTTestRunner::closeWebInspector(const CppArgumentList& args, CppVariant* result) { m_shell->closeDevTools(); result->setNull(); } -void LayoutTestController::setWindowIsKey(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->userStyleSheetLocation = arguments[0].value.boolValue ? m_userStyleSheetLocation : WebURL(); @@ -792,7 +792,7 @@ void LayoutTestController::setUserStyleSheetEnabled(const CppArgumentList& argum result->setNull(); } -void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setUserStyleSheetLocation(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { m_userStyleSheetLocation = webkit_support::LocalFileToDataURL( @@ -803,7 +803,7 @@ void LayoutTestController::setUserStyleSheetLocation(const CppArgumentList& argu result->setNull(); } -void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAuthorAndUserStylesEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->authorAndUserStylesEnabled = arguments[0].value.boolValue; @@ -812,7 +812,7 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(const CppArgumentList& result->setNull(); } -void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::execCommand(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() <= 0 || !arguments[0].isString()) @@ -829,7 +829,7 @@ void LayoutTestController::execCommand(const CppArgumentList& arguments, CppVari m_shell->webView()->focusedFrame()->executeCommand(WebString::fromUTF8(command), WebString::fromUTF8(value)); } -void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::isCommandEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() <= 0 || !arguments[0].isString()) { result->setNull(); @@ -841,7 +841,7 @@ void LayoutTestController::isCommandEnabled(const CppArgumentList& arguments, Cp result->set(rv); } -void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { bool blockPopups = arguments[0].toBoolean(); @@ -851,78 +851,78 @@ void LayoutTestController::setPopupBlockingEnabled(const CppArgumentList& argume result->setNull(); } -void LayoutTestController::setImagesAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setImagesAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setImagesAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setScriptsAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setScriptsAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setScriptsAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setStorageAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setStorageAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setStorageAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setPluginsAllowed(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPluginsAllowed(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setPluginsAllowed(arguments[0].toBoolean()); result->setNull(); } -void LayoutTestController::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support application cache quotas. result->setNull(); } -void LayoutTestController::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support deleting all application cache for an origin. result->setNull(); } -void LayoutTestController::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support application cache quotas. result->setNull(); } -void LayoutTestController::originsWithApplicationCache(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::originsWithApplicationCache(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support getting origins that have application caches. result->setNull(); } -void LayoutTestController::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result) { // FIXME: Implement to support getting disk usage by all application cache for an origin. result->setNull(); } -void LayoutTestController::setScrollbarPolicy(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { bool enable = arguments[0].value.boolValue; @@ -934,14 +934,14 @@ void LayoutTestController::setCustomPolicyDelegate(const CppArgumentList& argume result->setNull(); } -void LayoutTestController::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::waitForPolicyDelegate(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->waitForPolicyDelegate(); m_waitUntilDone = true; result->setNull(); } -void LayoutTestController::setWillSendRequestClearHeader(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setWillSendRequestClearHeader(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { string header = arguments[0].toString(); @@ -951,21 +951,21 @@ void LayoutTestController::setWillSendRequestClearHeader(const CppArgumentList& result->setNull(); } -void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::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) +void DRTTestRunner::pathToLocalResource(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() <= 0 || !arguments[0].isString()) @@ -1003,33 +1003,33 @@ void LayoutTestController::pathToLocalResource(const CppArgumentList& arguments, result->set(webkit_support::RewriteLayoutTestsURL(url).spec()); } -void LayoutTestController::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::addFileToPasteboardOnDrag(const CppArgumentList&, CppVariant* result) { result->setNull(); m_shouldAddFileToPasteboard = true; } -void LayoutTestController::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setStopProvisionalFrameLoads(const CppArgumentList&, CppVariant* result) { result->setNull(); m_stopProvisionalFrameLoads = true; } -void LayoutTestController::setSmartInsertDeleteEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::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) +bool DRTTestRunner::pauseAnimationAtTimeOnElementWithId(const WebString& animationName, double time, const WebString& elementId) { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1045,7 +1045,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const WebString& return controller->pauseAnimationAtTime(element, animationName, time); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId) +bool DRTTestRunner::pauseTransitionAtTimeOnElementWithId(const WebString& propertyName, double time, const WebString& elementId) { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1061,7 +1061,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const WebString& return controller->pauseTransitionAtTime(element, propertyName, time); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebString& elementId) +bool DRTTestRunner::elementDoesAutoCompleteForElementWithId(const WebString& elementId) { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1075,7 +1075,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const WebStri return inputElement.autoComplete(); } -int LayoutTestController::numberOfActiveAnimations() +int DRTTestRunner::numberOfActiveAnimations() { WebFrame* webFrame = m_shell->webView()->mainFrame(); if (!webFrame) @@ -1088,7 +1088,7 @@ int LayoutTestController::numberOfActiveAnimations() return controller->numberOfActiveAnimations(); } -void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pauseAnimationAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) { result->set(false); if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) { @@ -1099,7 +1099,7 @@ void LayoutTestController::pauseAnimationAtTimeOnElementWithId(const CppArgument } } -void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pauseTransitionAtTimeOnElementWithId(const CppArgumentList& arguments, CppVariant* result) { result->set(false); if (arguments.size() > 2 && arguments[0].isString() && arguments[1].isNumber() && arguments[2].isString()) { @@ -1110,7 +1110,7 @@ void LayoutTestController::pauseTransitionAtTimeOnElementWithId(const CppArgumen } } -void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::elementDoesAutoCompleteForElementWithId(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 1 || !arguments[0].isString()) { result->set(false); @@ -1120,7 +1120,7 @@ void LayoutTestController::elementDoesAutoCompleteForElementWithId(const CppArgu result->set(elementDoesAutoCompleteForElementWithId(elementId)); } -void LayoutTestController::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::enableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 4) { result->set(false); @@ -1138,7 +1138,7 @@ void LayoutTestController::enableAutoResizeMode(const CppArgumentList& arguments result->set(true); } -void LayoutTestController::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::disableAutoResizeMode(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() !=2) { result->set(false); @@ -1154,31 +1154,31 @@ void LayoutTestController::disableAutoResizeMode(const CppArgumentList& argument result->set(true); } -void LayoutTestController::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::numberOfActiveAnimations(const CppArgumentList&, CppVariant* result) { result->set(numberOfActiveAnimations()); } -void LayoutTestController::disableImageLoading(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::disableImageLoading(const CppArgumentList&, CppVariant* result) { m_shell->preferences()->loadsImagesAutomatically = false; m_shell->applyPreferences(); result->setNull(); } -void LayoutTestController::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result) { // We don't use the WebKit icon database. result->setNull(); } -void LayoutTestController::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result) { result->set(m_shell->webView()->dispatchBeforeUnloadEvent()); } #if ENABLE(NOTIFICATIONS) -void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::grantDesktopNotificationPermission(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 1 || !arguments[0].isString()) { result->set(false); @@ -1190,7 +1190,7 @@ void LayoutTestController::grantDesktopNotificationPermission(const CppArgumentL result->set(true); } -void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::simulateDesktopNotificationClick(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() != 1 || !arguments[0].isString()) { result->set(false); @@ -1205,14 +1205,14 @@ void LayoutTestController::simulateDesktopNotificationClick(const CppArgumentLis } #endif -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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) +void DRTTestRunner::setDeferMainResourceDataLoad(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() == 1) m_deferMainResourceDataLoad = cppVariantToBool(arguments[0]); @@ -1222,23 +1222,23 @@ void LayoutTestController::setDeferMainResourceDataLoad(const CppArgumentList& a // Unimplemented stubs // -void LayoutTestController::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::dumpAsWebArchive(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result) { m_dumpSelectionRect = true; result->setNull(); } -void LayoutTestController::display(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::display(const CppArgumentList& arguments, CppVariant* result) { WebViewHost* host = m_shell->webViewHost(); const WebKit::WebSize& size = m_shell->webView()->size(); @@ -1249,7 +1249,7 @@ void LayoutTestController::display(const CppArgumentList& arguments, CppVariant* result->setNull(); } -void LayoutTestController::displayInvalidatedRegion(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::displayInvalidatedRegion(const CppArgumentList& arguments, CppVariant* result) { WebViewHost* host = m_shell->webViewHost(); host->paintInvalidatedRegion(); @@ -1257,59 +1257,59 @@ void LayoutTestController::displayInvalidatedRegion(const CppArgumentList& argum result->setNull(); } -void LayoutTestController::testRepaint(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::testRepaint(const CppArgumentList&, CppVariant* result) { m_testRepaint = true; result->setNull(); } -void LayoutTestController::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::repaintSweepHorizontally(const CppArgumentList&, CppVariant* result) { m_sweepHorizontally = true; result->setNull(); } -void LayoutTestController::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::keepWebHistory(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::keepWebHistory(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::storeWebScriptObject(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::accessStoredWebScriptObject(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::objCClassNameOf(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } -void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setJavaScriptCanAccessClipboard(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->javaScriptCanAccessClipboard = arguments[0].value.boolValue; @@ -1318,7 +1318,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(const CppArgumentList result->setNull(); } -void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setXSSAuditorEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->XSSAuditorEnabled = arguments[0].value.boolValue; @@ -1327,7 +1327,7 @@ void LayoutTestController::setXSSAuditorEnabled(const CppArgumentList& arguments result->setNull(); } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::evaluateScriptInIsolatedWorldAndReturnValue(const CppArgumentList& arguments, CppVariant* result) { v8::HandleScope scope; WebVector<v8::Local<v8::Value> > values; @@ -1357,7 +1357,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(const Cpp } } -void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::evaluateScriptInIsolatedWorld(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() >= 2 && arguments[0].isNumber() && arguments[1].isString()) { WebScriptSource source(cppVariantToWebString(arguments[1])); @@ -1368,7 +1368,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(const CppArgumentList& result->setNull(); } -void LayoutTestController::setIsolatedWorldSecurityOrigin(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setIsolatedWorldSecurityOrigin(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -1380,7 +1380,7 @@ void LayoutTestController::setIsolatedWorldSecurityOrigin(const CppArgumentList& WebSecurityOrigin::createFromString(cppVariantToWebString(arguments[1]))); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowUniversalAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->allowUniversalAccessFromFileURLs = arguments[0].value.boolValue; @@ -1389,7 +1389,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(const CppArgument result->setNull(); } -void LayoutTestController::setAllowDisplayOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowDisplayOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setDisplayingInsecureContentAllowed(arguments[0].toBoolean()); @@ -1397,7 +1397,7 @@ void LayoutTestController::setAllowDisplayOfInsecureContent(const CppArgumentLis result->setNull(); } -void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowFileAccessFromFileURLs(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->allowFileAccessFromFileURLs = arguments[0].value.boolValue; @@ -1406,7 +1406,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(const CppArgumentList& result->setNull(); } -void LayoutTestController::setAllowRunningOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAllowRunningOfInsecureContent(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) m_shell->webPermissions()->setRunningInsecureContentAllowed(arguments[0].value.boolValue); @@ -1416,7 +1416,7 @@ void LayoutTestController::setAllowRunningOfInsecureContent(const CppArgumentLis // 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) +bool DRTTestRunner::cppVariantToBool(const CppVariant& value) { if (value.isBool()) return value.toBoolean(); @@ -1433,7 +1433,7 @@ bool LayoutTestController::cppVariantToBool(const CppVariant& value) return false; } -int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value) +int32_t DRTTestRunner::cppVariantToInt32(const CppVariant& value) { if (value.isNumber()) return value.toInt32(); @@ -1449,7 +1449,7 @@ int32_t LayoutTestController::cppVariantToInt32(const CppVariant& value) return 0; } -WebString LayoutTestController::cppVariantToWebString(const CppVariant& value) +WebString DRTTestRunner::cppVariantToWebString(const CppVariant& value) { if (!value.isString()) { logErrorToConsole("Invalid value for preference. Expected string value."); @@ -1458,7 +1458,7 @@ WebString LayoutTestController::cppVariantToWebString(const CppVariant& value) return WebString::fromUTF8(value.toString()); } -Vector<WebString> LayoutTestController::cppVariantToWebStringArray(const CppVariant& value) +Vector<WebString> DRTTestRunner::cppVariantToWebStringArray(const CppVariant& value) { if (!value.isObject()) { logErrorToConsole("Invalid value for preference. Expected object value."); @@ -1488,7 +1488,7 @@ static void setFontMap(WebPreferences::ScriptFontFamilyMap& map, const Vector<We } } -void LayoutTestController::overridePreference(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::overridePreference(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 2 || !arguments[0].isString()) @@ -1591,13 +1591,13 @@ void LayoutTestController::overridePreference(const CppArgumentList& arguments, m_shell->applyPreferences(); } -void LayoutTestController::fallbackMethod(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::fallbackMethod(const CppArgumentList&, CppVariant* result) { - printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on LayoutTestController\n"); + printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on DRTTestRunner\n"); result->setNull(); } -void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -1616,7 +1616,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(const CppArgumentList& arguments[3].toBoolean()); } -void LayoutTestController::removeOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::removeOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -1635,20 +1635,20 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(const CppArgumentLis arguments[3].toBoolean()); } -void LayoutTestController::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::clearAllDatabases(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); webkit_support::ClearAllDatabases(); } -void LayoutTestController::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if ((arguments.size() >= 1) && arguments[0].isNumber()) webkit_support::SetDatabaseQuota(arguments[0].toInt32()); } -void LayoutTestController::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPOSIXLocale(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() == 1 && arguments[0].isString()) @@ -1715,13 +1715,13 @@ static bool parsePageNumberSizeMargins(const CppArgumentList& arguments, int arg return true; } -void LayoutTestController::setPrinting(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPrinting(const CppArgumentList& arguments, CppVariant* result) { setIsPrinting(true); result->setNull(); } -void LayoutTestController::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pageSizeAndMarginsInPixels(const CppArgumentList& arguments, CppVariant* result) { result->set(""); int pageNumber = 0; @@ -1746,7 +1746,7 @@ void LayoutTestController::pageSizeAndMarginsInPixels(const CppArgumentList& arg result->set(resultString.str()); } -void LayoutTestController::hasCustomPageSizeStyle(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::hasCustomPageSizeStyle(const CppArgumentList& arguments, CppVariant* result) { result->set(false); int pageIndex = 0; @@ -1758,7 +1758,7 @@ void LayoutTestController::hasCustomPageSizeStyle(const CppArgumentList& argumen result->set(frame->hasCustomPageSizeStyle(pageIndex)); } -void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::pageProperty(const CppArgumentList& arguments, CppVariant* result) { result->set(""); int pageNumber = 0; @@ -1775,7 +1775,7 @@ void LayoutTestController::pageProperty(const CppArgumentList& arguments, CppVar frame->printEnd(); } -void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::numberOfPages(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); int pageWidthInPixels = 0; @@ -1792,7 +1792,7 @@ void LayoutTestController::numberOfPages(const CppArgumentList& arguments, CppVa result->set(numberOfPages); } -void LayoutTestController::numberOfPendingGeolocationPermissionRequests(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::numberOfPendingGeolocationPermissionRequests(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); Vector<WebViewHost*> windowList = m_shell->windowList(); @@ -1802,14 +1802,14 @@ void LayoutTestController::numberOfPendingGeolocationPermissionRequests(const Cp result->set(numberOfRequests); } -void LayoutTestController::logErrorToConsole(const std::string& text) +void DRTTestRunner::logErrorToConsole(const std::string& text) { m_shell->webViewHost()->didAddMessageToConsole( WebConsoleMessage(WebConsoleMessage::LevelError, WebString::fromUTF8(text)), WebString(), 0); } -void LayoutTestController::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::evaluateInWebInspector(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) @@ -1817,13 +1817,13 @@ void LayoutTestController::evaluateInWebInspector(const CppArgumentList& argumen m_shell->drtDevToolsAgent()->evaluateInWebInspector(arguments[0].toInt32(), arguments[1].toString()); } -void LayoutTestController::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::forceRedSelectionColors(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); m_shell->webView()->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, 0xffc0c0c0); } -void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addUserScript(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isBool() || !arguments[2].isBool()) @@ -1834,7 +1834,7 @@ void LayoutTestController::addUserScript(const CppArgumentList& arguments, CppVa arguments[2].toBoolean() ? WebView::UserContentInjectInAllFrames : WebView::UserContentInjectInTopFrameOnly); } -void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addUserStyleSheet(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isBool()) @@ -1847,7 +1847,7 @@ void LayoutTestController::addUserStyleSheet(const CppArgumentList& arguments, C WebView::UserStyleInjectInExistingDocuments); } -void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::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()) @@ -1870,7 +1870,7 @@ void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& argum // FIXME: For greater test flexibility, we should be able to set each page's geolocation mock individually. // https://bugs.webkit.org/show_bug.cgi?id=52368 -void LayoutTestController::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -1880,7 +1880,7 @@ void LayoutTestController::setGeolocationPermission(const CppArgumentList& argum windowList[i]->geolocationClientMock()->setPermission(arguments[0].toBoolean()); } -void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 3 || !arguments[0].isNumber() || !arguments[1].isNumber() || !arguments[2].isNumber()) @@ -1890,7 +1890,7 @@ void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arg windowList[i]->geolocationClientMock()->setPosition(arguments[0].toDouble(), arguments[1].toDouble(), arguments[2].toDouble()); } -void LayoutTestController::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) @@ -1900,13 +1900,13 @@ void LayoutTestController::setMockGeolocationError(const CppArgumentList& argume windowList[i]->geolocationClientMock()->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1])); } -void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::abortModal(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); } #if ENABLE(INPUT_SPEECH) -void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumber() || !arguments[2].isString()) @@ -1916,7 +1916,7 @@ void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& argum controller->addMockRecognitionResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble(), cppVariantToWebString(arguments[2])); } -void LayoutTestController::setMockSpeechInputDumpRect(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockSpeechInputDumpRect(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -1928,7 +1928,7 @@ void LayoutTestController::setMockSpeechInputDumpRect(const CppArgumentList& arg #endif #if ENABLE(SCRIPTED_SPEECH) -void LayoutTestController::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::addMockSpeechRecognitionResult(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isNumber()) @@ -1938,7 +1938,7 @@ void LayoutTestController::addMockSpeechRecognitionResult(const CppArgumentList& recognizer->addMockResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble()); } -void LayoutTestController::setMockSpeechRecognitionError(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMockSpeechRecognitionError(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString()) @@ -1948,7 +1948,7 @@ void LayoutTestController::setMockSpeechRecognitionError(const CppArgumentList& recognizer->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1])); } -void LayoutTestController::wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::wasMockSpeechRecognitionAborted(const CppArgumentList&, CppVariant* result) { result->set(false); if (MockWebSpeechRecognizer* recognizer = m_shell->webViewHost()->mockSpeechRecognizer()) @@ -1956,7 +1956,7 @@ void LayoutTestController::wasMockSpeechRecognitionAborted(const CppArgumentList } #endif -void LayoutTestController::startSpeechInput(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::startSpeechInput(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 1) @@ -1976,12 +1976,12 @@ void LayoutTestController::startSpeechInput(const CppArgumentList& arguments, Cp input->startSpeechInput(); } -void LayoutTestController::layerTreeAsText(const CppArgumentList& args, CppVariant* result) +void DRTTestRunner::layerTreeAsText(const CppArgumentList& args, CppVariant* result) { result->set(m_shell->webView()->mainFrame()->layerTreeAsText(m_showDebugLayerTree).utf8()); } -void LayoutTestController::loseCompositorContext(const CppArgumentList& args, CppVariant*) +void DRTTestRunner::loseCompositorContext(const CppArgumentList& args, CppVariant*) { int numTimes; if (args.size() == 1 || !args[0].isNumber()) @@ -1991,7 +1991,7 @@ void LayoutTestController::loseCompositorContext(const CppArgumentList& args, Cp m_shell->webView()->loseCompositorContext(numTimes); } -void LayoutTestController::markerTextForListItem(const CppArgumentList& args, CppVariant* result) +void DRTTestRunner::markerTextForListItem(const CppArgumentList& args, CppVariant* result) { WebElement element; if (!WebBindings::getElement(args[0].value.objectValue, &element)) @@ -2000,7 +2000,7 @@ void LayoutTestController::markerTextForListItem(const CppArgumentList& args, Cp result->set(element.document().frame()->markerTextForListItem(element).utf8()); } -void LayoutTestController::findString(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::findString(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 1 || !arguments[0].isString()) return; @@ -2028,7 +2028,7 @@ void LayoutTestController::findString(const CppArgumentList& arguments, CppVaria result->set(findResult); } -void LayoutTestController::setMinimumTimerInterval(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setMinimumTimerInterval(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isNumber()) @@ -2036,7 +2036,7 @@ void LayoutTestController::setMinimumTimerInterval(const CppArgumentList& argume m_shell->webView()->settings()->setMinimumTimerInterval(arguments[0].toDouble()); } -void LayoutTestController::setAutofilled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAutofilled(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 2 || !arguments[1].isBool()) @@ -2053,7 +2053,7 @@ void LayoutTestController::setAutofilled(const CppArgumentList& arguments, CppVa input->setAutofilled(arguments[1].value.boolValue); } -void LayoutTestController::setValueForUser(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setValueForUser(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 2) @@ -2070,37 +2070,37 @@ void LayoutTestController::setValueForUser(const CppArgumentList& arguments, Cpp input->setValue(cppVariantToWebString(arguments[1]), true); } -void LayoutTestController::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*) +void DRTTestRunner::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*) { // Not Implemented } -void LayoutTestController::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*) +void DRTTestRunner::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*) { // Not Implemented } -void LayoutTestController::syncLocalStorage(const CppArgumentList&, CppVariant*) +void DRTTestRunner::syncLocalStorage(const CppArgumentList&, CppVariant*) { // Not Implemented } -void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() == 1 && arguments[0].isBool()) m_shouldStayOnPageAfterHandlingBeforeUnload = arguments[0].toBoolean(); @@ -2108,7 +2108,7 @@ void LayoutTestController::setShouldStayOnPageAfterHandlingBeforeUnload(const Cp result->setNull(); } -void LayoutTestController::enableFixedLayoutMode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::enableFixedLayoutMode(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -2117,7 +2117,7 @@ void LayoutTestController::enableFixedLayoutMode(const CppArgumentList& argument m_shell->webView()->enableFixedLayoutMode(enableFixedLayout); } -void LayoutTestController::setFixedLayoutSize(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setFixedLayoutSize(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isNumber()) @@ -2127,17 +2127,17 @@ void LayoutTestController::setFixedLayoutSize(const CppArgumentList& arguments, m_shell->webView()->setFixedLayoutSize(WebSize(width, height)); } -void LayoutTestController::selectionAsMarkup(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::selectionAsMarkup(const CppArgumentList& arguments, CppVariant* result) { result->set(m_shell->webView()->mainFrame()->selectionAsMarkup().utf8()); } -void LayoutTestController::workerThreadCount(CppVariant* result) +void DRTTestRunner::workerThreadCount(CppVariant* result) { result->set(static_cast<int>(WebWorkerInfo::dedicatedWorkerCount())); } -void LayoutTestController::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::sendWebIntentResponse(const CppArgumentList& arguments, CppVariant* result) { v8::HandleScope scope; v8::Local<v8::Context> ctx = m_shell->webView()->mainFrame()->mainWorldScriptContext(); @@ -2159,7 +2159,7 @@ void LayoutTestController::sendWebIntentResponse(const CppArgumentList& argument result->setNull(); } -void LayoutTestController::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::deliverWebIntent(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 3) return; @@ -2180,7 +2180,7 @@ void LayoutTestController::deliverWebIntent(const CppArgumentList& arguments, Cp m_shell->webView()->mainFrame()->deliverIntent(intent, 0, m_intentClient.get()); } -void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setTextSubpixelPositioning(const CppArgumentList& arguments, CppVariant* result) { #if OS(LINUX) || OS(ANDROID) // Since FontConfig doesn't provide a variable to control subpixel positioning, we'll fall back @@ -2191,10 +2191,10 @@ void LayoutTestController::setTextSubpixelPositioning(const CppArgumentList& arg result->setNull(); } -class InvokeCallbackTask : public MethodTask<LayoutTestController> { +class InvokeCallbackTask : public MethodTask<DRTTestRunner> { public: - InvokeCallbackTask(LayoutTestController* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments) - : MethodTask<LayoutTestController>(object) + InvokeCallbackTask(DRTTestRunner* object, PassOwnArrayPtr<CppVariant> callbackArguments, uint32_t numberOfArguments) + : MethodTask<DRTTestRunner>(object) , m_callbackArguments(callbackArguments) , m_numberOfArguments(numberOfArguments) { @@ -2211,7 +2211,7 @@ private: uint32_t m_numberOfArguments; }; -void LayoutTestController::setBackingScaleFactor(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setBackingScaleFactor(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isObject()) return; @@ -2225,7 +2225,7 @@ void LayoutTestController::setBackingScaleFactor(const CppArgumentList& argument postTask(new InvokeCallbackTask(this, callbackArguments.release(), 1)); } -void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPluginsEnabled(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isBool()) { m_shell->preferences()->pluginsEnabled = arguments[0].toBoolean(); @@ -2234,12 +2234,12 @@ void LayoutTestController::setPluginsEnabled(const CppArgumentList& arguments, C result->setNull(); } -void LayoutTestController::resetPageVisibility(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::resetPageVisibility(const CppArgumentList& arguments, CppVariant* result) { m_shell->webView()->setVisibilityState(WebPageVisibilityStateVisible, true); } -void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setPageVisibility(const CppArgumentList& arguments, CppVariant* result) { if (arguments.size() > 0 && arguments[0].isString()) { string newVisibility = arguments[0].toString(); @@ -2254,12 +2254,12 @@ void LayoutTestController::setPageVisibility(const CppArgumentList& arguments, C } } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void DRTTestRunner::setAutomaticLinkDetectionEnabled(bool) { // Not Implemented } -void LayoutTestController::setTextDirection(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setTextDirection(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() != 1 || !arguments[0].isString()) @@ -2280,7 +2280,7 @@ void LayoutTestController::setTextDirection(const CppArgumentList& arguments, Cp m_shell->webView()->setTextDirection(direction); } -void LayoutTestController::setAudioData(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setAudioData(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); @@ -2297,7 +2297,7 @@ void LayoutTestController::setAudioData(const CppArgumentList& arguments, CppVar setShouldDumpAsAudio(true); } -void LayoutTestController::setHasCustomFullScreenBehavior(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::setHasCustomFullScreenBehavior(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 1 || !arguments[0].isBool()) @@ -2306,26 +2306,26 @@ void LayoutTestController::setHasCustomFullScreenBehavior(const CppArgumentList& } #if ENABLE(POINTER_LOCK) -void LayoutTestController::didLosePointerLock(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::didLosePointerLock(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->didLosePointerLock(); result->setNull(); } -void LayoutTestController::setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setPointerLockWillFailAsynchronously(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->setPointerLockWillFailAsynchronously(); result->setNull(); } -void LayoutTestController::setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant* result) +void DRTTestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, CppVariant* result) { m_shell->webViewHost()->setPointerLockWillFailSynchronously(); result->setNull(); } #endif -void LayoutTestController::textSurroundingNode(const CppArgumentList& arguments, CppVariant* result) +void DRTTestRunner::textSurroundingNode(const CppArgumentList& arguments, CppVariant* result) { result->setNull(); if (arguments.size() < 4 || !arguments[0].isObject() || !arguments[1].isNumber() || !arguments[2].isNumber() || !arguments[3].isNumber()) diff --git a/Tools/DumpRenderTree/chromium/LayoutTestController.h b/Tools/DumpRenderTree/chromium/DRTTestRunner.h index 9cfd12359..e9c0171f9 100644 --- a/Tools/DumpRenderTree/chromium/LayoutTestController.h +++ b/Tools/DumpRenderTree/chromium/DRTTestRunner.h @@ -30,28 +30,28 @@ */ /* - LayoutTestController class: - Bound to a JavaScript window.layoutTestController object using the + DRTTestRunner class: + Bound to a JavaScript window.testRunner 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 +#ifndef DRTTestRunner_h +#define DRTTestRunner_h -#include "TestRunner.h" +#include "TestRunner/TestRunner.h" class TestShell; -class LayoutTestController : public TestRunner { +class DRTTestRunner : public TestRunner { public: // Builds the property and method lists needed to bind this class to a JS // object. - LayoutTestController(TestShell*); + DRTTestRunner(TestShell*); - ~LayoutTestController(); + ~DRTTestRunner(); // 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. @@ -345,7 +345,7 @@ public: void setMockGeolocationPosition(const CppArgumentList&, CppVariant*); void setMockGeolocationError(const CppArgumentList&, CppVariant*); - // Empty stub method to keep parity with object model exposed by global LayoutTestController. + // Empty stub method to keep parity with object model exposed by global DRTTestRunner. void abortModal(const CppArgumentList&, CppVariant*); // Speech input related functions. @@ -528,7 +528,7 @@ private: // queueScript. class WorkQueue { public: - WorkQueue(LayoutTestController* controller) : m_frozen(false), m_controller(controller) { } + WorkQueue(DRTTestRunner* controller) : m_frozen(false), m_controller(controller) { } virtual ~WorkQueue(); void processWorkSoon(); @@ -552,7 +552,7 @@ private: TaskList m_taskList; Deque<WorkItem*> m_queue; bool m_frozen; - LayoutTestController* m_controller; + DRTTestRunner* m_controller; }; // Support for overridePreference. @@ -563,9 +563,9 @@ private: void logErrorToConsole(const std::string&); void completeNotifyDone(bool isTimeout); - class NotifyDoneTimedOutTask: public MethodTask<LayoutTestController> { + class NotifyDoneTimedOutTask: public MethodTask<DRTTestRunner> { public: - NotifyDoneTimedOutTask(LayoutTestController* object): MethodTask<LayoutTestController>(object) { } + NotifyDoneTimedOutTask(DRTTestRunner* object): MethodTask<DRTTestRunner>(object) { } virtual void runIfValid() { m_object->completeNotifyDone(true); } }; @@ -578,7 +578,7 @@ private: // Used for test timeouts. TaskList m_taskList; - // Non-owning pointer. The LayoutTestController is owned by the host. + // Non-owning pointer. The DRTTestRunner is owned by the host. TestShell* m_shell; // If true, the test_shell will produce a plain text dump rather than a @@ -717,4 +717,4 @@ private: bool m_hasCustomFullScreenBehavior; }; -#endif // LayoutTestController_h +#endif // DRTTestRunner_h diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp index ae5502cd2..9a8bd7fd4 100644 --- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp @@ -252,7 +252,7 @@ int main(int argc, char* argv[]) shell.callJSGC(); shell.callJSGC(); - // When we finish the last test, cleanup the LayoutTestController. + // When we finish the last test, cleanup the DRTTestRunner. // It may have references to not-yet-cleaned up windows. By cleaning up // here we help purify reports. shell.resetTestController(); diff --git a/Tools/DumpRenderTree/chromium/NotificationPresenter.h b/Tools/DumpRenderTree/chromium/NotificationPresenter.h index 5fed178da..e98cc7294 100644 --- a/Tools/DumpRenderTree/chromium/NotificationPresenter.h +++ b/Tools/DumpRenderTree/chromium/NotificationPresenter.h @@ -46,10 +46,10 @@ public: explicit NotificationPresenter(TestShell*) { } virtual ~NotificationPresenter(); - // Called by the LayoutTestController to simulate a user granting permission. + // Called by the DRTTestRunner to simulate a user granting permission. void grantPermission(const WebKit::WebString& origin); - // Called by the LayoutTestController to simulate a user clicking on a notification. + // Called by the DRTTestRunner to simulate a user clicking on a notification. bool simulateClick(const WebKit::WebString& notificationIdentifier); // WebKit::WebNotificationPresenter interface diff --git a/Tools/DumpRenderTree/chromium/TestShell.cpp b/Tools/DumpRenderTree/chromium/TestShell.cpp index 29a2a3130..9abb13fac 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.cpp +++ b/Tools/DumpRenderTree/chromium/TestShell.cpp @@ -33,9 +33,8 @@ #include "DRTDevToolsAgent.h" #include "DRTDevToolsClient.h" -#include "LayoutTestController.h" +#include "DRTTestRunner.h" #include "MockWebPrerenderingSupport.h" -#include "platform/WebArrayBufferView.h" #include "WebDataSource.h" #include "WebDocument.h" #include "WebElement.h" @@ -49,6 +48,7 @@ #include "WebSettings.h" #include "WebView.h" #include "WebViewHost.h" +#include "platform/WebArrayBufferView.h" #include "skia/ext/platform_canvas.h" #include "webkit/support/webkit_support.h" #include "webkit/support/webkit_support_gfx.h" @@ -119,6 +119,7 @@ TestShell::TestShell() , m_isDisplayingModalDialog(false) { WebRuntimeFeatures::enableDataTransferItems(true); + WebRuntimeFeatures::enableDeviceMotion(false); WebRuntimeFeatures::enableGeolocation(true); WebRuntimeFeatures::enablePointerLock(true); WebRuntimeFeatures::enableIndexedDatabase(true); @@ -151,7 +152,7 @@ void TestShell::initialize() { m_webPermissions = adoptPtr(new WebPermissions(this)); m_testInterfaces = adoptPtr(new TestInterfaces()); - m_layoutTestController = adoptPtr(new LayoutTestController(this)); + m_testRunner = adoptPtr(new DRTTestRunner(this)); #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_notificationPresenter = adoptPtr(new NotificationPresenter(this)); #endif @@ -240,11 +241,11 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels) m_params = params; string testUrl = m_params.testUrl.spec(); - m_layoutTestController->setShouldGeneratePixelResults(shouldDumpPixels); + m_testRunner->setShouldGeneratePixelResults(shouldDumpPixels); if (testUrl.find("loading/") != string::npos || testUrl.find("loading\\") != string::npos) - m_layoutTestController->setShouldDumpFrameLoadCallbacks(true); + m_testRunner->setShouldDumpFrameLoadCallbacks(true); if (testUrl.find("compositing/") != string::npos || testUrl.find("compositing\\") != string::npos) { m_prefs.acceleratedCompositingForVideoEnabled = true; @@ -256,8 +257,8 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels) if (testUrl.find("/dumpAsText/") != string::npos || testUrl.find("\\dumpAsText\\") != string::npos) { - m_layoutTestController->setShouldDumpAsText(true); - m_layoutTestController->setShouldGeneratePixelResults(false); + m_testRunner->setShouldDumpAsText(true); + m_testRunner->setShouldGeneratePixelResults(false); } if (testUrl.find("/inspector/") != string::npos @@ -265,7 +266,7 @@ void TestShell::runFileTest(const TestParams& params, bool shouldDumpPixels) showDevTools(); if (m_params.debugLayerTree) - m_layoutTestController->setShowDebugLayerTree(true); + m_testRunner->setShowDebugLayerTree(true); if (m_dumpWhenFinished) m_printer.handleTestHeader(testUrl.c_str()); @@ -298,7 +299,7 @@ void TestShell::resetTestController() resetWebSettings(*webView()); m_webPermissions->reset(); m_testInterfaces->resetAll(); - m_layoutTestController->reset(); + m_testRunner->reset(); m_webViewHost->reset(); #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) m_notificationPresenter->reset(); @@ -555,14 +556,14 @@ void TestShell::dump() WebFrame* frame = m_webView->mainFrame(); if (!frame) return; - bool shouldDumpAsText = m_layoutTestController->shouldDumpAsText(); - bool shouldDumpAsAudio = m_layoutTestController->shouldDumpAsAudio(); - bool shouldGeneratePixelResults = m_layoutTestController->shouldGeneratePixelResults(); - bool shouldDumpAsPrinted = m_layoutTestController->isPrinting(); + bool shouldDumpAsText = m_testRunner->shouldDumpAsText(); + bool shouldDumpAsAudio = m_testRunner->shouldDumpAsAudio(); + bool shouldGeneratePixelResults = m_testRunner->shouldGeneratePixelResults(); + bool shouldDumpAsPrinted = m_testRunner->isPrinting(); bool dumpedAnything = false; if (shouldDumpAsAudio) { - const WebKit::WebArrayBufferView& webArrayBufferView = m_layoutTestController->audioData(); + const WebKit::WebArrayBufferView& webArrayBufferView = m_testRunner->audioData(); m_printer.handleAudio(webArrayBufferView.baseAddress(), webArrayBufferView.byteLength()); m_printer.handleAudioFooter(); m_printer.handleTestFooter(true); @@ -586,7 +587,7 @@ void TestShell::dump() } } if (shouldDumpAsText) { - bool recursive = m_layoutTestController->shouldDumpChildFramesAsText(); + bool recursive = m_testRunner->shouldDumpChildFramesAsText(); string dataUtf8 = shouldDumpAsPrinted ? dumpFramesAsPrintedText(frame, recursive) : dumpFramesAsText(frame, recursive); if (fwrite(dataUtf8.c_str(), 1, dataUtf8.size(), stdout) != dataUtf8.size()) FATAL("Short write to stdout, disk full?\n"); @@ -597,10 +598,10 @@ void TestShell::dump() if (m_params.debugRenderTree) renderTextBehavior |= WebFrame::RenderAsTextDebug; printf("%s", frame->renderTreeAsText(renderTextBehavior).utf8().data()); - bool recursive = m_layoutTestController->shouldDumpChildFrameScrollPositions(); + bool recursive = m_testRunner->shouldDumpChildFrameScrollPositions(); dumpFrameScrollPosition(frame, recursive); } - if (m_layoutTestController->shouldDumpBackForwardList()) + if (m_testRunner->shouldDumpBackForwardList()) printf("%s", dumpAllBackForwardLists().c_str()); } if (dumpedAnything && m_params.printSeparators) @@ -612,18 +613,18 @@ void TestShell::dump() // stdout. dumpedAnything = true; m_webView->layout(); - if (m_layoutTestController->testRepaint()) { + if (m_testRunner->testRepaint()) { WebSize viewSize = m_webView->size(); int width = viewSize.width; int height = viewSize.height; - if (m_layoutTestController->sweepHorizontally()) { + if (m_testRunner->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 if (m_layoutTestController->isPrinting()) + } else if (m_testRunner->isPrinting()) m_webViewHost->paintPagesWithBoundaries(); else m_webViewHost->paintInvalidatedRegion(); @@ -631,7 +632,7 @@ void TestShell::dump() // 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 (m_testRunner->shouldDumpSelectionRect()) { // If there is a selection rect - draw a red 1px border enclosing rect WebRect wr = frame->selectionBoundsRect(); if (!wr.isEmpty()) { @@ -725,8 +726,8 @@ void TestShell::bindJSObjectsToWindow(WebFrame* frame) { WebTestingSupport::injectInternalsObject(frame); m_testInterfaces->bindTo(frame); - m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("layoutTestController")); - m_layoutTestController->bindToJavascript(frame, WebString::fromUTF8("testRunner")); + m_testRunner->bindToJavascript(frame, WebString::fromUTF8("testRunner")); + m_testRunner->bindToJavascript(frame, WebString::fromUTF8("layoutTestController")); } WebViewHost* TestShell::createNewWindow(const WebKit::WebURL& url) diff --git a/Tools/DumpRenderTree/chromium/TestShell.h b/Tools/DumpRenderTree/chromium/TestShell.h index 005d374a2..405034a4e 100644 --- a/Tools/DumpRenderTree/chromium/TestShell.h +++ b/Tools/DumpRenderTree/chromium/TestShell.h @@ -32,8 +32,8 @@ #define TestShell_h #include "AccessibilityControllerChromium.h" +#include "DRTTestRunner.h" #include "GamepadController.h" -#include "LayoutTestController.h" #include "NotificationPresenter.h" #include "TestEventPrinter.h" #include "TestInterfaces.h" @@ -87,7 +87,7 @@ public: WebKit::WebView* webView() const { return m_webView; } // Returns the host for the main WebView. WebViewHost* webViewHost() const { return m_webViewHost.get(); } - LayoutTestController* layoutTestController() const { return m_layoutTestController.get(); } + DRTTestRunner* testRunner() const { return m_testRunner.get(); } EventSender* eventSender() const { return m_testInterfaces->eventSender(); } AccessibilityController* accessibilityController() const { return m_testInterfaces->accessibilityController(); } #if ENABLE(NOTIFICATIONS) @@ -113,15 +113,15 @@ public: 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(); } + bool shouldDumpFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpFrameLoadCallbacks(); } + bool shouldDumpUserGestureInFrameLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpUserGestureInFrameLoadCallbacks(); } + bool shouldDumpResourceLoadCallbacks() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceLoadCallbacks(); } + bool shouldDumpResourceResponseMIMETypes() const { return (m_testIsPreparing || m_testIsPending) && testRunner()->shouldDumpResourceResponseMIMETypes(); } void setIsLoading(bool flag) { m_isLoading = flag; } - // Called by the LayoutTestController to signal test completion. + // Called by the DRTTestRunner to signal test completion. void testFinished(); - // Called by LayoutTestController when a test hits the timeout, but does not + // Called by DRTTestRunner 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(); @@ -211,7 +211,7 @@ private: OwnPtr<DRTDevToolsAgent> m_drtDevToolsAgent; OwnPtr<DRTDevToolsClient> m_drtDevToolsClient; OwnPtr<TestInterfaces> m_testInterfaces; - OwnPtr<LayoutTestController> m_layoutTestController; + OwnPtr<DRTTestRunner> m_testRunner; #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) OwnPtr<NotificationPresenter> m_notificationPresenter; #endif diff --git a/Tools/DumpRenderTree/chromium/WebPermissions.cpp b/Tools/DumpRenderTree/chromium/WebPermissions.cpp index ee90a7b2c..2c7c9eee8 100644 --- a/Tools/DumpRenderTree/chromium/WebPermissions.cpp +++ b/Tools/DumpRenderTree/chromium/WebPermissions.cpp @@ -31,7 +31,7 @@ #include "config.h" #include "WebPermissions.h" -#include "LayoutTestController.h" +#include "DRTTestRunner.h" #include "TestShell.h" #include "platform/WebCString.h" #include "platform/WebURL.h" @@ -49,7 +49,7 @@ WebPermissions::~WebPermissions() bool WebPermissions::allowImage(WebKit::WebFrame*, bool enabledPerSettings, const WebKit::WebURL& imageURL) { bool allowed = enabledPerSettings && m_imagesAllowed; - if (layoutTestController()->shouldDumpPermissionClientCallbacks()) + if (testRunner()->shouldDumpPermissionClientCallbacks()) fprintf(stdout, "PERMISSION CLIENT: allowImage(%s): %s\n", m_shell->normalizeLayoutTestURL(imageURL.spec()).c_str(), allowed ? "true" : "false"); return allowed; } @@ -57,7 +57,7 @@ bool WebPermissions::allowImage(WebKit::WebFrame*, bool enabledPerSettings, cons bool WebPermissions::allowScriptFromSource(WebKit::WebFrame*, bool enabledPerSettings, const WebKit::WebURL& scriptURL) { bool allowed = enabledPerSettings && m_scriptsAllowed; - if (layoutTestController()->shouldDumpPermissionClientCallbacks()) + if (testRunner()->shouldDumpPermissionClientCallbacks()) fprintf(stdout, "PERMISSION CLIENT: allowScriptFromSource(%s): %s\n", m_shell->normalizeLayoutTestURL(scriptURL.spec()).c_str(), allowed ? "true" : "false"); return allowed; } @@ -126,7 +126,7 @@ void WebPermissions::reset() // Private functions ---------------------------------------------------------- -LayoutTestController* WebPermissions::layoutTestController() const +DRTTestRunner* WebPermissions::testRunner() const { - return m_shell->layoutTestController(); + return m_shell->testRunner(); } diff --git a/Tools/DumpRenderTree/chromium/WebPermissions.h b/Tools/DumpRenderTree/chromium/WebPermissions.h index 184046a0a..c625077e8 100644 --- a/Tools/DumpRenderTree/chromium/WebPermissions.h +++ b/Tools/DumpRenderTree/chromium/WebPermissions.h @@ -33,7 +33,7 @@ #include "WebPermissionClient.h" -class LayoutTestController; +class DRTTestRunner; class TestShell; class WebPermissions : public WebKit::WebPermissionClient { @@ -63,7 +63,7 @@ public: void reset(); private: - LayoutTestController* layoutTestController() const; + DRTTestRunner* testRunner() const; // Non-owning pointer. The WebPermissions instance is owned by this TestShell instance. TestShell* m_shell; diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.cpp b/Tools/DumpRenderTree/chromium/WebViewHost.cpp index 115c405ec..a67d1e304 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.cpp +++ b/Tools/DumpRenderTree/chromium/WebViewHost.cpp @@ -31,8 +31,8 @@ #include "config.h" #include "WebViewHost.h" +#include "DRTTestRunner.h" #include "EventSender.h" -#include "LayoutTestController.h" #include "MockGrammarCheck.h" #include "MockWebSpeechInputController.h" #include "MockWebSpeechRecognizer.h" @@ -251,9 +251,9 @@ static string textAffinityDescription(WebTextAffinity affinity) WebView* WebViewHost::createView(WebFrame*, const WebURLRequest& request, const WebWindowFeatures&, const WebString&, WebNavigationPolicy) { - if (!layoutTestController()->canOpenWindows()) + if (!testRunner()->canOpenWindows()) return 0; - if (layoutTestController()->shouldDumpCreateView()) + if (testRunner()->shouldDumpCreateView()) fprintf(stdout, "createView(%s)\n", URLDescription(request.url()).c_str()); return m_shell->createNewWindow(WebURL())->webView(); } @@ -319,7 +319,7 @@ void WebViewHost::didStartLoading() void WebViewHost::didStopLoading() { - if (layoutTestController()->shouldDumpProgressFinishedCallback()) + if (testRunner()->shouldDumpProgressFinishedCallback()) fputs("postProgressFinishedNotification\n", stdout); m_shell->setIsLoading(false); } @@ -329,50 +329,50 @@ void WebViewHost::didStopLoading() bool WebViewHost::shouldBeginEditing(const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldBeginEditingInDOMRange:", stdout); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldEndEditing(const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldEndEditingInDOMRange:", stdout); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldInsertNode(const WebNode& node, const WebRange& range, WebEditingAction action) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->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(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldInsertText(const WebString& text, const WebRange& range, WebEditingAction action) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:", text.utf8().data()); printRangeDescription(range); printf(" givenAction:%s\n", editingActionDescription(action).c_str()); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldChangeSelectedRange( const WebRange& fromRange, const WebRange& toRange, WebTextAffinity affinity, bool stillSelecting) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldChangeSelectedDOMRange:", stdout); printRangeDescription(fromRange); fputs(" toDOMRange:", stdout); @@ -381,27 +381,27 @@ bool WebViewHost::shouldChangeSelectedRange( textAffinityDescription(affinity).c_str(), (stillSelecting ? "TRUE" : "FALSE")); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldDeleteRange(const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { fputs("EDITING DELEGATE: shouldDeleteDOMRange:", stdout); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::shouldApplyStyle(const WebString& style, const WebRange& range) { - if (layoutTestController()->shouldDumpEditingCallbacks()) { + if (testRunner()->shouldDumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:", style.utf8().data()); printRangeDescription(range); fputs("\n", stdout); } - return layoutTestController()->acceptsEditing(); + return testRunner()->acceptsEditing(); } bool WebViewHost::isSmartInsertDeleteEnabled() @@ -416,28 +416,28 @@ bool WebViewHost::isSelectTrailingWhitespaceEnabled() void WebViewHost::didBeginEditing() { - if (!layoutTestController()->shouldDumpEditingCallbacks()) + if (!testRunner()->shouldDumpEditingCallbacks()) return; fputs("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n", stdout); } void WebViewHost::didChangeSelection(bool isEmptySelection) { - if (layoutTestController()->shouldDumpEditingCallbacks()) + if (testRunner()->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()) + if (!testRunner()->shouldDumpEditingCallbacks()) return; fputs("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n", stdout); } void WebViewHost::didEndEditing() { - if (!layoutTestController()->shouldDumpEditingCallbacks()) + if (!testRunner()->shouldDumpEditingCallbacks()) return; fputs("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n", stdout); } @@ -561,7 +561,7 @@ bool WebViewHost::runModalPromptDialog(WebFrame* frame, const WebString& message bool WebViewHost::runModalBeforeUnloadDialog(WebFrame*, const WebString& message) { printf("CONFIRM NAVIGATION: %s\n", message.utf8().data()); - return !layoutTestController()->shouldStayOnPageAfterHandlingBeforeUnload(); + return !testRunner()->shouldStayOnPageAfterHandlingBeforeUnload(); } void WebViewHost::showContextMenu(WebFrame*, const WebContextMenuData& contextMenuData) @@ -581,7 +581,7 @@ WebContextMenuData* WebViewHost::lastContextMenuData() const void WebViewHost::setStatusText(const WebString& text) { - if (!layoutTestController()->shouldDumpStatusCallbacks()) + if (!testRunner()->shouldDumpStatusCallbacks()) return; // When running tests, write to stdout. printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text.utf8().data()); @@ -590,7 +590,7 @@ void WebViewHost::setStatusText(const WebString& text) void WebViewHost::startDragging(WebFrame*, const WebDragData& data, WebDragOperationsMask mask, const WebImage&, const WebPoint&) { WebDragData mutableDragData = data; - if (layoutTestController()->shouldAddFileToPasteboard()) { + if (testRunner()->shouldAddFileToPasteboard()) { // Add a file called DRTFakeFile to the drag&drop clipboard. addDRTFakeFileToDataObject(&mutableDragData); } @@ -1055,7 +1055,7 @@ WebNavigationPolicy WebViewHost::decidePolicyForNavigation( result = WebKit::WebNavigationPolicyIgnore; if (m_policyDelegateShouldNotifyDone) - layoutTestController()->policyDelegateDone(); + testRunner()->policyDelegateDone(); return result; } @@ -1113,7 +1113,7 @@ void WebViewHost::didCancelClientRedirect(WebFrame* frame) void WebViewHost::didCreateDataSource(WebFrame*, WebDataSource* ds) { ds->setExtraData(m_pendingExtraData.leakPtr()); - if (!layoutTestController()->deferMainResourceDataLoad()) + if (!testRunner()->deferMainResourceDataLoad()) ds->setDeferMainResourceDataLoad(false); } @@ -1130,7 +1130,7 @@ void WebViewHost::didStartProvisionalLoad(WebFrame* frame) if (!m_topLoadingFrame) m_topLoadingFrame = frame; - if (layoutTestController()->stopProvisionalFrameLoads()) { + if (testRunner()->stopProvisionalFrameLoads()) { printFrameDescription(frame); fputs(" - stopping load in didStartProvisionalLoadForFrame callback\n", stdout); frame->stopLoading(); @@ -1183,11 +1183,11 @@ void WebViewHost::didReceiveTitle(WebFrame* frame, const WebString& title, WebTe printf(" - didReceiveTitle: %s\n", title8.data()); } - if (layoutTestController()->shouldDumpTitleChanges()) + if (testRunner()->shouldDumpTitleChanges()) printf("TITLE CHANGED: %s\n", title8.data()); setPageTitle(title); - layoutTestController()->setTitleTextDirection(direction); + testRunner()->setTitleTextDirection(direction); } void WebViewHost::didFinishDocumentLoad(WebFrame* frame) @@ -1281,7 +1281,7 @@ void WebViewHost::willSendRequest(WebFrame* frame, unsigned identifier, WebURLRe string requestURL = url.possibly_invalid_spec(); GURL mainDocumentURL = request.firstPartyForCookies(); - if (layoutTestController()->shouldDumpResourceLoadCallbacks()) { + if (testRunner()->shouldDumpResourceLoadCallbacks()) { printResourceDescription(identifier); printf(" - willSendRequest <NSURLRequest URL %s, main document URL %s," " http method %s> redirectResponse ", @@ -1385,9 +1385,14 @@ void WebViewHost::openFileSystem(WebFrame* frame, WebFileSystem::Type type, long webkit_support::OpenFileSystem(frame, type, size, create, callbacks); } +void WebViewHost::deleteFileSystem(WebKit::WebFrame* frame, WebKit::WebFileSystem::Type type, WebKit::WebFileSystemCallbacks* callbacks) +{ + webkit_support::DeleteFileSystem(frame, type, callbacks); +} + bool WebViewHost::willCheckAndDispatchMessageEvent(WebFrame* source, WebSecurityOrigin target, WebDOMMessageEvent event) { - if (m_shell->layoutTestController()->shouldInterceptPostMessage()) { + if (m_shell->testRunner()->shouldInterceptPostMessage()) { fputs("intercepted postMessage\n", stdout); return true; } @@ -1638,9 +1643,9 @@ bool WebViewHost::navigate(const TestNavigationEntry& entry, bool reload) // Private functions ---------------------------------------------------------- -LayoutTestController* WebViewHost::layoutTestController() const +DRTTestRunner* WebViewHost::testRunner() const { - return m_shell->layoutTestController(); + return m_shell->testRunner(); } void WebViewHost::updateAddressBar(WebView* webView) @@ -1660,7 +1665,7 @@ void WebViewHost::locationChangeDone(WebFrame* frame) if (frame != m_topLoadingFrame) return; m_topLoadingFrame = 0; - layoutTestController()->locationChangeDone(); + testRunner()->locationChangeDone(); } void WebViewHost::updateForCommittedLoad(WebFrame* frame, bool isNewNavigation) @@ -1780,7 +1785,7 @@ void WebViewHost::setAddressBarURL(const WebURL&) void WebViewHost::enterFullScreenNow() { - if (layoutTestController()->hasCustomFullScreenBehavior()) + if (testRunner()->hasCustomFullScreenBehavior()) return; webView()->willEnterFullScreen(); @@ -1789,7 +1794,7 @@ void WebViewHost::enterFullScreenNow() void WebViewHost::exitFullScreenNow() { - if (layoutTestController()->hasCustomFullScreenBehavior()) + if (testRunner()->hasCustomFullScreenBehavior()) return; webView()->willExitFullScreen(); diff --git a/Tools/DumpRenderTree/chromium/WebViewHost.h b/Tools/DumpRenderTree/chromium/WebViewHost.h index 13f2e1ec5..94ed4cd8d 100644 --- a/Tools/DumpRenderTree/chromium/WebViewHost.h +++ b/Tools/DumpRenderTree/chromium/WebViewHost.h @@ -47,7 +47,7 @@ #include <wtf/Vector.h> #include <wtf/text/WTFString.h> -class LayoutTestController; +class DRTTestRunner; class MockWebSpeechInputController; class MockWebSpeechRecognizer; class SkCanvas; @@ -264,6 +264,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, virtual void didRunInsecureContent(WebKit::WebFrame*, const WebKit::WebSecurityOrigin&, const WebKit::WebURL&); virtual void didDetectXSS(WebKit::WebFrame*, const WebKit::WebURL&, bool didBlockEntirePage); virtual void openFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, long long size, bool create, WebKit::WebFileSystemCallbacks*); + virtual void deleteFileSystem(WebKit::WebFrame*, WebKit::WebFileSystem::Type, WebKit::WebFileSystemCallbacks*); virtual bool willCheckAndDispatchMessageEvent(WebKit::WebFrame* source, WebKit::WebSecurityOrigin target, WebKit::WebDOMMessageEvent); virtual void registerIntentService(WebKit::WebFrame*, const WebKit::WebIntentServiceInfo&); virtual void dispatchIntent(WebKit::WebFrame*, const WebKit::WebIntentRequest&); @@ -277,7 +278,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient, void finishLastTextCheck(); virtual void fillSpellingSuggestionList(const WebKit::WebString& word, Vector<WebKit::WebString>* suggestions) OVERRIDE; - // Geolocation client mocks for LayoutTestController + // Geolocation client mocks for DRTTestRunner WebKit::WebGeolocationClientMock* geolocationClientMock(); // Pending task list, Note taht the method is referred from MethodTask class. @@ -302,7 +303,7 @@ private: CallbackMethodType m_callback; }; - LayoutTestController* layoutTestController() const; + DRTTestRunner* testRunner() const; // Called the title of the page changes. // Can be used to update the title of the window. diff --git a/Tools/DumpRenderTree/efl/CMakeLists.txt b/Tools/DumpRenderTree/efl/CMakeLists.txt index 067dbd32b..7d99f073f 100644 --- a/Tools/DumpRenderTree/efl/CMakeLists.txt +++ b/Tools/DumpRenderTree/efl/CMakeLists.txt @@ -2,7 +2,7 @@ SET(DumpRenderTree_SOURCES ${TOOLS_DIR}/DumpRenderTree/DumpRenderTreeCommon.cpp ${TOOLS_DIR}/DumpRenderTree/CyclicRedundancyCheck.cpp ${TOOLS_DIR}/DumpRenderTree/GCController.cpp - ${TOOLS_DIR}/DumpRenderTree/LayoutTestController.cpp + ${TOOLS_DIR}/DumpRenderTree/TestRunner.cpp ${TOOLS_DIR}/DumpRenderTree/PixelDumpSupport.cpp ${TOOLS_DIR}/DumpRenderTree/WorkQueue.cpp ${TOOLS_DIR}/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp @@ -15,7 +15,7 @@ SET(DumpRenderTree_SOURCES ${TOOLS_DIR}/DumpRenderTree/efl/FontManagement.cpp ${TOOLS_DIR}/DumpRenderTree/efl/GCControllerEfl.cpp ${TOOLS_DIR}/DumpRenderTree/efl/JSStringUtils.cpp - ${TOOLS_DIR}/DumpRenderTree/efl/LayoutTestControllerEfl.cpp + ${TOOLS_DIR}/DumpRenderTree/efl/TestRunnerEfl.cpp ${TOOLS_DIR}/DumpRenderTree/efl/PixelDumpSupportEfl.cpp ${TOOLS_DIR}/DumpRenderTree/efl/TextInputController.cpp ${TOOLS_DIR}/DumpRenderTree/efl/WorkQueueItemEfl.cpp @@ -40,8 +40,8 @@ SET(DumpRenderTree_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${SQLITE_LIBRARIES} - ${Glib_LIBRARIES} - ${LIBSOUP24_LIBRARIES} + ${GLIB_LIBRARIES} + ${LIBSOUP_LIBRARIES} ) SET(DumpRenderTree_INCLUDE_DIRECTORIES @@ -100,8 +100,8 @@ SET(DumpRenderTree_INCLUDE_DIRECTORIES ${EFLDEPS_INCLUDE_DIRS} ${EVAS_INCLUDE_DIRS} ${FONTCONFIG_INCLUDE_DIR} - ${Glib_INCLUDE_DIRS} - ${LIBSOUP24_INCLUDE_DIRS} + ${GLIB_INCLUDE_DIRS} + ${LIBSOUP_INCLUDE_DIRS} ) SET(DumpRenderTree_LINK_FLAGS @@ -109,7 +109,6 @@ SET(DumpRenderTree_LINK_FLAGS ${EDJE_LDFLAGS} ${EFLDEPS_LDFLAGS} ${EVAS_LDFLAGS} - ${LIBSOUP24_LDFLAGS} ) # FIXME: DOWNLOADED_FONTS_DIR should not hardcode the directory diff --git a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp index 0713cb60c..c1e480134 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTree.cpp @@ -31,9 +31,9 @@ #include "DumpRenderTreeView.h" #include "EventSender.h" #include "FontManagement.h" -#include "LayoutTestController.h" #include "NotImplemented.h" #include "PixelDumpSupport.h" +#include "TestRunner.h" #include "WebCoreSupport/DumpRenderTreeSupportEfl.h" #include "WebCoreTestSupport.h" #include "WorkQueue.h" @@ -62,7 +62,7 @@ Ecore_Timer* waitToDumpWatchdog = 0; extern Ewk_History_Item* prevTestBFItem; // From the top-level DumpRenderTree.h -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; volatile bool done = false; static bool dumpPixelsForCurrentTest; @@ -85,7 +85,7 @@ static String dumpFramesAsText(Evas_Object* frame) result.append("\n"); eina_stringshare_del(frameContents); - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { Eina_List* children = DumpRenderTreeSupportEfl::frameChildren(frame); void* iterator; @@ -128,7 +128,7 @@ static void dumpFrameScrollPosition(Evas_Object* frame) printf("%s", result.toString().utf8().data()); } - if (gLayoutTestController->dumpChildFrameScrollPositions()) { + if (gTestRunner->dumpChildFrameScrollPositions()) { Eina_List* children = DumpRenderTreeSupportEfl::frameChildren(frame); void* iterator; @@ -215,29 +215,29 @@ static inline bool isGlobalHistoryTest(const String& cTestPathOrURL) return cTestPathOrURL.contains("/globalhistory/"); } -static void createLayoutTestController(const String& testURL, const String& expectedPixelHash) +static void createTestRunner(const String& testURL, const String& expectedPixelHash) { - gLayoutTestController = - LayoutTestController::create(std::string(testURL.utf8().data()), + gTestRunner = + TestRunner::create(std::string(testURL.utf8().data()), std::string(expectedPixelHash.utf8().data())); topLoadingFrame = 0; done = false; - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); if (shouldLogFrameLoadDelegates(testURL)) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); - gLayoutTestController->setDeveloperExtrasEnabled(true); + gTestRunner->setDeveloperExtrasEnabled(true); if (shouldOpenWebInspector(testURL)) - gLayoutTestController->showWebInspector(); + gTestRunner->showWebInspector(); - gLayoutTestController->setDumpHistoryDelegateCallbacks(isGlobalHistoryTest(testURL)); + gTestRunner->setDumpHistoryDelegateCallbacks(isGlobalHistoryTest(testURL)); if (shouldDumpAsText(testURL)) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } } @@ -268,14 +268,14 @@ static void runTest(const char* inputLine) const String testURL = getFinalTestURL(testPathOrURL); browser->resetDefaultsToConsistentValues(); - createLayoutTestController(testURL, expectedPixelHash); + createTestRunner(testURL, expectedPixelHash); WorkQueue::shared()->clear(); WorkQueue::shared()->setFrozen(false); const bool isSVGW3CTest = testURL.contains("svg/W3C-SVG-1.1"); - const int width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth; - const int height = isSVGW3CTest ? 360 : LayoutTestController::maxViewHeight; + const int width = isSVGW3CTest ? 480 : TestRunner::maxViewWidth; + const int height = isSVGW3CTest ? 360 : TestRunner::maxViewHeight; evas_object_resize(browser->mainView(), width, height); if (prevTestBFItem) @@ -288,8 +288,8 @@ static void runTest(const char* inputLine) ecore_main_loop_begin(); - gLayoutTestController->closeWebInspector(); - gLayoutTestController->setDeveloperExtrasEnabled(false); + gTestRunner->closeWebInspector(); + gTestRunner->setDeveloperExtrasEnabled(false); browser->clearExtraViews(); @@ -298,7 +298,7 @@ static void runTest(const char* inputLine) ewk_view_uri_set(browser->mainView(), "about:blank"); - gLayoutTestController.clear(); + gTestRunner.clear(); sendPixelResultsEOF(); } @@ -320,15 +320,15 @@ static void adjustOutputTypeByMimeType(const Evas_Object* frame) { const String responseMimeType(DumpRenderTreeSupportEfl::responseMimeType(frame)); if (responseMimeType == "text/plain") { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } } static void dumpFrameContentsAsText(Evas_Object* frame) { String result; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) result = dumpFramesAsText(frame); else result = DumpRenderTreeSupportEfl::renderTreeDump(frame); @@ -338,17 +338,17 @@ static void dumpFrameContentsAsText(Evas_Object* frame) static bool shouldDumpFrameScrollPosition() { - return !gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive(); + return !gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive(); } static bool shouldDumpPixelsAndCompareWithExpected() { - return dumpPixelsForCurrentTest && gLayoutTestController->generatePixelResults() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive(); + return dumpPixelsForCurrentTest && gTestRunner->generatePixelResults() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive(); } static bool shouldDumpBackForwardList() { - return gLayoutTestController->dumpBackForwardList(); + return gTestRunner->dumpBackForwardList(); } static bool initEfl() @@ -412,7 +412,7 @@ void dump() } if (shouldDumpPixelsAndCompareWithExpected()) - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); done = true; ecore_main_loop_quit(); diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp index 0d1fa4b63..c167aca51 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeChrome.cpp @@ -34,8 +34,8 @@ #include "EventSender.h" #include "GCController.h" #include "KURL.h" -#include "LayoutTestController.h" #include "NotImplemented.h" +#include "TestRunner.h" #include "TextInputController.h" #include "WebCoreSupport/DumpRenderTreeSupportEfl.h" #include "WebCoreTestSupport.h" @@ -148,7 +148,7 @@ Evas_Object* DumpRenderTreeChrome::createWebInspectorView() Evas_Object* mainFrame = ewk_view_frame_main_get(inspectorView); evas_object_smart_callback_add(mainFrame, "load,finished", onInspectorFrameLoadFinished, 0); - evas_object_resize(inspectorView, LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight); + evas_object_resize(inspectorView, TestRunner::maxViewWidth, TestRunner::maxViewHeight); evas_object_show(inspectorView); evas_object_focus_set(inspectorView, true); @@ -418,12 +418,12 @@ void DumpRenderTreeChrome::onWindowObjectCleared(void* userData, Evas_Object*, v { Ewk_Window_Object_Cleared_Event* objectClearedInfo = static_cast<Ewk_Window_Object_Cleared_Event*>(eventInfo); JSValueRef exception = 0; - ASSERT(gLayoutTestController); + ASSERT(gTestRunner); GCController* gcController = static_cast<GCController*>(userData); ASSERT(gcController); - gLayoutTestController->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception); + gTestRunner->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception); ASSERT(!exception); gcController->makeWindowObject(objectClearedInfo->context, objectClearedInfo->windowObject, &exception); @@ -456,7 +456,7 @@ void DumpRenderTreeChrome::onLoadStarted(void*, Evas_Object* view, void* eventIn Eina_Bool DumpRenderTreeChrome::processWork(void*) { - if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump()) dump(); return ECORE_CALLBACK_CANCEL; @@ -467,7 +467,7 @@ void DumpRenderTreeChrome::topLoadingFrameLoadFinished() topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); - if (gLayoutTestController->waitToDump()) + if (gTestRunner->waitToDump()) return; if (WorkQueue::shared()->count()) @@ -478,7 +478,7 @@ void DumpRenderTreeChrome::topLoadingFrameLoadFinished() void DumpRenderTreeChrome::onStatusbarTextSet(void*, Evas_Object*, void* eventInfo) { - if (!gLayoutTestController->dumpStatusCallbacks()) + if (!gTestRunner->dumpStatusCallbacks()) return; const char* statusbarText = static_cast<const char*>(eventInfo); @@ -487,7 +487,7 @@ void DumpRenderTreeChrome::onStatusbarTextSet(void*, Evas_Object*, void* eventIn void DumpRenderTreeChrome::onFrameIconChanged(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpIconChanges()) { + if (!done && gTestRunner->dumpIconChanges()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didChangeIcons\n", frameName.utf8().data()); } @@ -497,19 +497,19 @@ void DumpRenderTreeChrome::onFrameTitleChanged(void*, Evas_Object* frame, void* { const Ewk_Text_With_Direction* titleText = static_cast<const Ewk_Text_With_Direction*>(eventInfo); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didReceiveTitle: %s\n", frameName.utf8().data(), (titleText && titleText->string) ? titleText->string : ""); } - if (!done && gLayoutTestController->dumpTitleChanges()) + if (!done && gTestRunner->dumpTitleChanges()) printf("TITLE CHANGED: %s\n", (titleText && titleText->string) ? titleText->string : ""); - if (!done && gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!done && gTestRunner->dumpHistoryDelegateCallbacks()) printf("WebView updated the title for history URL \"%s\" to \"%s\".\n", ewk_frame_uri_get(frame) , (titleText && titleText->string) ? titleText->string : ""); - gLayoutTestController->setTitleTextDirection(titleText->direction == EWK_TEXT_DIRECTION_LEFT_TO_RIGHT ? "ltr" : "rtl"); + gTestRunner->setTitleTextDirection(titleText->direction == EWK_TEXT_DIRECTION_LEFT_TO_RIGHT ? "ltr" : "rtl"); } void DumpRenderTreeChrome::onDocumentLoadFinished(void*, Evas_Object*, void* eventInfo) @@ -517,7 +517,7 @@ void DumpRenderTreeChrome::onDocumentLoadFinished(void*, Evas_Object*, void* eve const Evas_Object* frame = static_cast<Evas_Object*>(eventInfo); const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishDocumentLoadForFrame\n", frameName.utf8().data()); else if (!done) { const unsigned pendingFrameUnloadEvents = DumpRenderTreeSupportEfl::pendingUnloadEventCount(frame); @@ -530,19 +530,19 @@ void DumpRenderTreeChrome::onWillSendRequest(void*, Evas_Object*, void* eventInf { Ewk_Frame_Resource_Messages* messages = static_cast<Ewk_Frame_Resource_Messages*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - willSendRequest %s redirectResponse %s\n", m_dumpAssignedUrls.contains(messages->request->identifier) ? m_dumpAssignedUrls.get(messages->request->identifier).data() : "<unknown>", descriptionSuitableForTestResult(messages->request).data(), descriptionSuitableForTestResult(messages->redirect_response).data()); - if (!done && gLayoutTestController->willSendRequestReturnsNull()) { - // As requested by the LayoutTestController, don't perform the request. + if (!done && gTestRunner->willSendRequestReturnsNull()) { + // As requested by the TestRunner, don't perform the request. messages->request->url = 0; return; } - if (!done && gLayoutTestController->willSendRequestReturnsNullOnRedirect() && messages->redirect_response) { + if (!done && gTestRunner->willSendRequestReturnsNullOnRedirect() && messages->redirect_response) { printf("Returning null for this redirect\n"); messages->request->url = 0; return; @@ -560,7 +560,7 @@ void DumpRenderTreeChrome::onWillSendRequest(void*, Evas_Object*, void* eventInf return; } - const std::string& destination = gLayoutTestController->redirectionDestinationForURL(url.string().utf8().data()); + const std::string& destination = gTestRunner->redirectionDestinationForURL(url.string().utf8().data()); if (destination.length()) messages->request->url = strdup(destination.c_str()); } @@ -569,7 +569,7 @@ void DumpRenderTreeChrome::onWebViewOnloadEvent(void*, Evas_Object*, void* event { const Evas_Object* frame = static_cast<Evas_Object*>(eventInfo); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didHandleOnloadEventsForFrame\n", frameName.utf8().data()); } @@ -577,13 +577,13 @@ void DumpRenderTreeChrome::onWebViewOnloadEvent(void*, Evas_Object*, void* event void DumpRenderTreeChrome::onInsecureContentRun(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didRunInsecureContent\n"); } void DumpRenderTreeChrome::onInsecureContentDisplayed(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didDisplayInsecureContent\n"); } @@ -608,7 +608,7 @@ void DumpRenderTreeChrome::onFrameCreated(void*, Evas_Object*, void* eventInfo) void DumpRenderTreeChrome::onWebViewNavigatedWithData(void*, Evas_Object*, void* eventInfo) { - if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (done || !gTestRunner->dumpHistoryDelegateCallbacks()) return; ASSERT(eventInfo); @@ -631,7 +631,7 @@ void DumpRenderTreeChrome::onWebViewNavigatedWithData(void*, Evas_Object*, void* void DumpRenderTreeChrome::onWebViewServerRedirect(void*, Evas_Object*, void* eventInfo) { - if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (done || !gTestRunner->dumpHistoryDelegateCallbacks()) return; ASSERT(eventInfo); @@ -641,7 +641,7 @@ void DumpRenderTreeChrome::onWebViewServerRedirect(void*, Evas_Object*, void* ev void DumpRenderTreeChrome::onWebViewClientRedirect(void*, Evas_Object*, void* eventInfo) { - if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (done || !gTestRunner->dumpHistoryDelegateCallbacks()) return; ASSERT(eventInfo); @@ -651,7 +651,7 @@ void DumpRenderTreeChrome::onWebViewClientRedirect(void*, Evas_Object*, void* ev void DumpRenderTreeChrome::onWebViewPopulateVisitedLinks(void*, Evas_Object* ewkView, void*) { - if (done || !gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (done || !gTestRunner->dumpHistoryDelegateCallbacks()) return; printf("Asked to populate visited links for WebView \"%s\"\n", ewk_view_uri_get(ewkView)); @@ -678,7 +678,7 @@ void DumpRenderTreeChrome::onInspectorFrameLoadFinished(void*, Evas_Object*, voi void DumpRenderTreeChrome::onFrameProvisionalLoad(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didStartProvisionalLoadForFrame\n", frameName.utf8().data()); } @@ -686,7 +686,7 @@ void DumpRenderTreeChrome::onFrameProvisionalLoad(void*, Evas_Object* frame, voi if (!topLoadingFrame && !done) topLoadingFrame = frame; - if (!done && gLayoutTestController->stopProvisionalFrameLoads()) { + if (!done && gTestRunner->stopProvisionalFrameLoads()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - stopping load in didStartProvisionalLoadForFrame callback\n", frameName.utf8().data()); ewk_frame_stop(frame); @@ -697,7 +697,7 @@ void DumpRenderTreeChrome::onFrameProvisionalLoadFailed(void*, Evas_Object* fram { m_provisionalLoadFailedFrame = frame; - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didFailProvisionalLoadWithError\n", frameName.utf8().data()); } @@ -705,7 +705,7 @@ void DumpRenderTreeChrome::onFrameProvisionalLoadFailed(void*, Evas_Object* fram void DumpRenderTreeChrome::onFrameLoadCommitted(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didCommitLoadForFrame\n", frameName.utf8().data()); } @@ -721,10 +721,10 @@ void DumpRenderTreeChrome::onFrameLoadFinished(void*, Evas_Object* frame, void* if (error) return; - if (!done && gLayoutTestController->dumpProgressFinishedCallback()) + if (!done && gTestRunner->dumpProgressFinishedCallback()) printf("postProgressFinishedNotification\n"); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didFinishLoadForFrame\n", frameName.utf8().data()); } @@ -738,7 +738,7 @@ void DumpRenderTreeChrome::onFrameLoadError(void*, Evas_Object* frame, void*) // In case of provisional load error, we receive both "load,error" and "load,provisional,failed" // signals. m_provisionalLoadFailedFrame is used to avoid printing twice the load error: in // onFrameProvisionalLoadFailed() and onFrameLoadError(). - if (!done && gLayoutTestController->dumpFrameLoadCallbacks() && frame != m_provisionalLoadFailedFrame) { + if (!done && gTestRunner->dumpFrameLoadCallbacks() && frame != m_provisionalLoadFailedFrame) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didFailLoadWithError\n", frameName.utf8().data()); } @@ -752,7 +752,7 @@ void DumpRenderTreeChrome::onFrameLoadError(void*, Evas_Object* frame, void*) void DumpRenderTreeChrome::onFrameRedirectCancelled(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didCancelClientRedirectForFrame\n", frameName.utf8().data()); } @@ -760,7 +760,7 @@ void DumpRenderTreeChrome::onFrameRedirectCancelled(void*, Evas_Object* frame, v void DumpRenderTreeChrome::onFrameRedirectForProvisionalLoad(void*, Evas_Object* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - didReceiveServerRedirectForProvisionalLoadForFrame\n", frameName.utf8().data()); } @@ -770,7 +770,7 @@ void DumpRenderTreeChrome::onFrameRedirectRequested(void*, Evas_Object* frame, v { const char* url = static_cast<const char*>(eventInfo); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { const String frameName(DumpRenderTreeSupportEfl::suitableDRTFrameName(frame)); printf("%s - willPerformClientRedirectToURL: %s \n", frameName.utf8().data(), pathSuitableForTestResult(url).data()); } @@ -778,7 +778,7 @@ void DumpRenderTreeChrome::onFrameRedirectRequested(void*, Evas_Object* frame, v void DumpRenderTreeChrome::onDidDetectXSS(void*, Evas_Object* view, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didDetectXSS\n"); } @@ -786,14 +786,14 @@ void DumpRenderTreeChrome::onResponseReceived(void*, Evas_Object*, void* eventIn { Ewk_Frame_Resource_Response* response = static_cast<Ewk_Frame_Resource_Response*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { CString responseDescription(descriptionSuitableForTestResult(response)); printf("%s - didReceiveResponse %s\n", m_dumpAssignedUrls.contains(response->identifier) ? m_dumpAssignedUrls.get(response->identifier).data() : "<unknown>", responseDescription.data()); } - if (!done && gLayoutTestController->dumpResourceResponseMIMETypes()) { + if (!done && gTestRunner->dumpResourceResponseMIMETypes()) { printf("%s has MIME type %s\n", KURL(ParsedURLString, response->url).lastPathComponent().utf8().data(), response->mime_type); @@ -804,7 +804,7 @@ void DumpRenderTreeChrome::onResourceLoadFinished(void*, Evas_Object*, void* eve { unsigned long identifier = *static_cast<unsigned long*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - didFinishLoading\n", (m_dumpAssignedUrls.contains(identifier) ? m_dumpAssignedUrls.take(identifier).data() : "<unknown>")); } @@ -813,7 +813,7 @@ void DumpRenderTreeChrome::onResourceLoadFailed(void*, Evas_Object*, void* event { Ewk_Frame_Load_Error* error = static_cast<Ewk_Frame_Load_Error*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - didFailLoadingWithError: %s\n", (m_dumpAssignedUrls.contains(error->resource_identifier) ? m_dumpAssignedUrls.take(error->resource_identifier).data() : "<unknown>"), descriptionSuitableForTestResult(error).data()); @@ -823,7 +823,7 @@ void DumpRenderTreeChrome::onNewResourceRequest(void*, Evas_Object*, void* event { Ewk_Frame_Resource_Request* request = static_cast<Ewk_Frame_Resource_Request*>(eventInfo); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) m_dumpAssignedUrls.add(request->identifier, pathSuitableForTestResult(request->url)); } diff --git a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp index eb15a8409..f801c3cef 100644 --- a/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp +++ b/Tools/DumpRenderTree/efl/DumpRenderTreeView.cpp @@ -30,7 +30,7 @@ #include "DumpRenderTree.h" #include "DumpRenderTreeChrome.h" #include "DumpRenderTreeEfl.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <EWebKit.h> #include <Ecore.h> #include <Eina.h> @@ -95,7 +95,7 @@ static Eina_Bool onJavaScriptPrompt(Ewk_View_Smart_Data*, Evas_Object*, const ch static Evas_Object* onWindowCreate(Ewk_View_Smart_Data*, Eina_Bool, const Ewk_Window_Features*) { - return gLayoutTestController->canOpenWindows() ? browser->createNewWindow() : 0; + return gTestRunner->canOpenWindows() ? browser->createNewWindow() : 0; } static Eina_Bool onWindowCloseDelayed(void* data) @@ -113,7 +113,7 @@ static void onWindowClose(Ewk_View_Smart_Data* smartData) static uint64_t onExceededDatabaseQuota(Ewk_View_Smart_Data* smartData, Evas_Object* frame, const char* databaseName, uint64_t currentSize, uint64_t expectedSize) { - if (!gLayoutTestController->dumpDatabaseCallbacks()) + if (!gTestRunner->dumpDatabaseCallbacks()) return 0; Ewk_Security_Origin* origin = ewk_frame_security_origin_get(frame); @@ -129,7 +129,7 @@ static uint64_t onExceededDatabaseQuota(Ewk_View_Smart_Data* smartData, Evas_Obj static int64_t onExceededApplicationCacheQuota(Ewk_View_Smart_Data*, Ewk_Security_Origin *origin, int64_t defaultOriginQuota, int64_t totalSpaceNeeded) { - if (gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) { + if (gTestRunner->dumpApplicationCacheDelegateCallbacks()) { // For example, numbers from 30000 - 39999 will output as 30000. // Rounding up or down does not really matter for these tests. It's // sufficient to just get a range of 10000 to determine if we were @@ -142,7 +142,7 @@ static int64_t onExceededApplicationCacheQuota(Ewk_View_Smart_Data*, Ewk_Securit truncatedSpaceNeeded); } - if (gLayoutTestController->disallowIncreaseForApplicationCacheQuota()) + if (gTestRunner->disallowIncreaseForApplicationCacheQuota()) return 0; return defaultOriginQuota; @@ -187,8 +187,8 @@ static Eina_Bool onNavigationPolicyDecision(Ewk_View_Smart_Data*, Ewk_Frame_Reso printf("Policy delegate: attempt to load %s with navigation type '%s'\n", urlSuitableForTestResult(request->url).utf8().data(), navigationTypeToString(navigationType)); - if (gLayoutTestController) - gLayoutTestController->notifyDone(); + if (gTestRunner) + gTestRunner->notifyDone(); return policyDelegatePermissive; } diff --git a/Tools/DumpRenderTree/efl/EditingCallbacks.cpp b/Tools/DumpRenderTree/efl/EditingCallbacks.cpp index 896d83f7e..7a03cddd1 100644 --- a/Tools/DumpRenderTree/efl/EditingCallbacks.cpp +++ b/Tools/DumpRenderTree/efl/EditingCallbacks.cpp @@ -33,10 +33,10 @@ #include "DumpRenderTree.h" #include "EditorClientEfl.h" #include "EditorInsertAction.h" -#include "LayoutTestController.h" #include "Node.h" #include "Range.h" #include "StylePropertySet.h" +#include "TestRunner.h" #include "TextAffinity.h" #include <wtf/text/CString.h> #include <wtf/text/WTFString.h> @@ -87,7 +87,7 @@ static const char* selectionAffinityString(WebCore::EAffinity affinity) void shouldBeginEditing(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo); printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", dumpRange(range).utf8().data()); } @@ -95,7 +95,7 @@ void shouldBeginEditing(void*, Evas_Object*, void* eventInfo) void shouldEndEditing(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo); printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", dumpRange(range).utf8().data()); } @@ -103,7 +103,7 @@ void shouldEndEditing(void*, Evas_Object*, void* eventInfo) void shouldInsertNode(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { Ewk_Should_Insert_Node_Event* shouldInsertNodeEvent = static_cast<Ewk_Should_Insert_Node_Event*>(eventInfo); printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", dumpPath(shouldInsertNodeEvent->node).utf8().data(), dumpRange(shouldInsertNodeEvent->range).utf8().data(), @@ -113,7 +113,7 @@ void shouldInsertNode(void*, Evas_Object*, void* eventInfo) void shouldInsertText(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { Ewk_Should_Insert_Text_Event* shouldInsertTextEvent = static_cast<Ewk_Should_Insert_Text_Event*>(eventInfo); printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", shouldInsertTextEvent->text, dumpRange(shouldInsertTextEvent->range).utf8().data(), insertActionString(shouldInsertTextEvent->action)); @@ -122,7 +122,7 @@ void shouldInsertText(void*, Evas_Object*, void* eventInfo) void shouldDeleteRange(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { WebCore::Range* range = static_cast<WebCore::Range*>(eventInfo); printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", dumpRange(range).utf8().data()); } @@ -130,7 +130,7 @@ void shouldDeleteRange(void*, Evas_Object*, void* eventInfo) void shouldChangeSelectedRange(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { Ewk_Should_Change_Selected_Range_Event* shouldChangeSelectedRangeEvent = static_cast<Ewk_Should_Change_Selected_Range_Event*>(eventInfo); printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", dumpRange(shouldChangeSelectedRangeEvent->fromRange).utf8().data(), dumpRange(shouldChangeSelectedRangeEvent->toRange).utf8().data(), @@ -140,7 +140,7 @@ void shouldChangeSelectedRange(void*, Evas_Object*, void* eventInfo) void shouldApplyStyle(void*, Evas_Object*, void* eventInfo) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { Ewk_Should_Apply_Style_Event* shouldApplyStyleEvent = static_cast<Ewk_Should_Apply_Style_Event*>(eventInfo); printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", shouldApplyStyleEvent->style->asText().utf8().data(), dumpRange(shouldApplyStyleEvent->range).utf8().data()); @@ -149,25 +149,25 @@ void shouldApplyStyle(void*, Evas_Object*, void* eventInfo) void editingBegan(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n"); } void userChangedContents(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n"); } void editingEnded(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n"); } void selectionChanged(void*, Evas_Object*, void*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n"); } diff --git a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp index 71891dcb4..1b1dca326 100644 --- a/Tools/DumpRenderTree/efl/LayoutTestControllerEfl.cpp +++ b/Tools/DumpRenderTree/efl/TestRunnerEfl.cpp @@ -35,7 +35,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "DumpRenderTree.h" #include "DumpRenderTreeChrome.h" @@ -62,16 +62,16 @@ enum { WebCacheModelPrimaryWebBrowser = 2 }; -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { } -void LayoutTestController::addDisallowedURL(JSStringRef) +void TestRunner::addDisallowedURL(JSStringRef) { notImplemented(); } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { Ewk_History* history = ewk_view_history_get(browser->mainView()); if (!history) @@ -84,51 +84,51 @@ void LayoutTestController::clearBackForwardList() ewk_history_item_free(item); } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef) { notImplemented(); return 0; } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef) { notImplemented(); return 0; } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { // FIXME: Implement for testing fix for 6727495 notImplemented(); } -void LayoutTestController::display() +void TestRunner::display() { displayWebView(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { notImplemented(); } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { return DumpRenderTreeSupportEfl::computedStyleIncludingVisitedInfo(context, value); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { notImplemented(); return JSRetainPtr<JSStringRef>(Adopt, JSStringCreateWithUTF8CString("")); } -int LayoutTestController::numberOfPages(float pageWidth, float pageHeight) +int TestRunner::numberOfPages(float pageWidth, float pageHeight) { return DumpRenderTreeSupportEfl::numberOfPages(browser->mainFrame(), pageWidth, pageHeight); } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { const String property = DumpRenderTreeSupportEfl::pageProperty(browser->mainFrame(), propertyName, pageNumber); if (property.isEmpty()) @@ -138,7 +138,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* property return propertyValue; } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const { String pageSizeAndMargins = DumpRenderTreeSupportEfl::pageSizeAndMarginsInPixels(browser->mainFrame(), pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft); @@ -149,7 +149,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pa return returnValue; } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { const Ewk_History* history = ewk_view_history_get(browser->mainView()); if (!history) @@ -158,12 +158,12 @@ size_t LayoutTestController::webHistoryItemCount() return ewk_history_back_list_length(history) + ewk_history_forward_list_length(history); } -unsigned LayoutTestController::workerThreadCount() const +unsigned TestRunner::workerThreadCount() const { return DumpRenderTreeSupportEfl::workerThreadCount(); } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count()) dump(); @@ -171,7 +171,7 @@ void LayoutTestController::notifyDone() waitForPolicy = false; } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url) +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url) { String requestedUrl(url->characters(), url->length()); String resourceRoot; @@ -197,7 +197,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt return JSStringCreateWithUTF8CString(fullPathToUrl.utf8().data()); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { WebCore::KURL baseURL(WebCore::KURL(), String::fromUTF8(ewk_frame_uri_get(browser->mainFrame()))); WebCore::KURL absoluteURL(baseURL, WTF::String(url->ustring().impl())); @@ -208,35 +208,35 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(jsAbsoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool acceptsEditing) +void TestRunner::setAcceptsEditing(bool acceptsEditing) { ewk_view_editable_set(browser->mainView(), acceptsEditing); } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { ewk_cookies_policy_set(alwaysAcceptCookies ? EWK_COOKIE_JAR_ACCEPT_ALWAYS : EWK_COOKIE_JAR_ACCEPT_NEVER); } -void LayoutTestController::setCustomPolicyDelegate(bool enabled, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive) { policyDelegateEnabled = enabled; policyDelegatePermissive = permissive; } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setCustomPolicyDelegate(true, false); waitForPolicy = true; setWaitToDump(true); } -void LayoutTestController::setScrollbarPolicy(JSStringRef, JSStringRef) +void TestRunner::setScrollbarPolicy(JSStringRef, JSStringRef) { notImplemented(); } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) { WebCore::KURL kurl; kurl.setProtocol(String(protocol->characters(), protocol->length())); @@ -245,7 +245,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi ewk_security_policy_whitelist_origin_add(sourceOrigin->ustring().utf8().data(), kurl.string().utf8().data(), includeSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) { WebCore::KURL kurl; kurl.setProtocol(String(protocol->characters(), protocol->length())); @@ -254,17 +254,17 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr ewk_security_policy_whitelist_origin_del(sourceOrigin->ustring().utf8().data(), kurl.string().utf8().data(), includeSubdomains); } -void LayoutTestController::setMainFrameIsFirstResponder(bool) +void TestRunner::setMainFrameIsFirstResponder(bool) { notImplemented(); } -void LayoutTestController::setTabKeyCyclesThroughElements(bool) +void TestRunner::setTabKeyCyclesThroughElements(bool) { notImplemented(); } -void LayoutTestController::setUseDashboardCompatibilityMode(bool) +void TestRunner::setUseDashboardCompatibilityMode(bool) { notImplemented(); } @@ -272,13 +272,13 @@ void LayoutTestController::setUseDashboardCompatibilityMode(bool) static CString gUserStyleSheet; static bool gUserStyleSheetEnabled = true; -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { gUserStyleSheetEnabled = flag; ewk_view_setting_user_stylesheet_set(browser->mainView(), flag ? gUserStyleSheet.data() : 0); } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) +void TestRunner::setUserStyleSheetLocation(JSStringRef path) { gUserStyleSheet = path->ustring().utf8(); @@ -286,12 +286,12 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) setUserStyleSheetEnabled(true); } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) { DumpRenderTreeSupportEfl::setValueForUser(context, nodeObject, WTF::String(value->ustring().impl())); } -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) +void TestRunner::setViewModeMediaFeature(JSStringRef mode) { Evas_Object* view = browser->mainView(); if (!view) @@ -309,12 +309,12 @@ void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) ewk_view_mode_set(view, EWK_VIEW_MODE_MINIMIZED); } -void LayoutTestController::setWindowIsKey(bool) +void TestRunner::setWindowIsKey(bool) { notImplemented(); } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { DumpRenderTreeSupportEfl::setSmartInsertDeleteEnabled(browser->mainView(), flag); } @@ -322,11 +322,11 @@ void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) static Eina_Bool waitToDumpWatchdogFired(void*) { waitToDumpWatchdog = 0; - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); return ECORE_CALLBACK_CANCEL; } -void LayoutTestController::setWaitToDump(bool waitUntilDone) +void TestRunner::setWaitToDump(bool waitUntilDone) { static const double timeoutSeconds = 30; @@ -335,116 +335,116 @@ void LayoutTestController::setWaitToDump(bool waitUntilDone) waitToDumpWatchdog = ecore_timer_add(timeoutSeconds, waitToDumpWatchdogFired, 0); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { return browser->extraViews().size() + 1; // + 1 for the main view. } -void LayoutTestController::setPrivateBrowsingEnabled(bool flag) +void TestRunner::setPrivateBrowsingEnabled(bool flag) { ewk_view_setting_private_browsing_set(browser->mainView(), flag); } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag) +void TestRunner::setJavaScriptCanAccessClipboard(bool flag) { ewk_view_setting_scripts_can_access_clipboard_set(browser->mainView(), flag); } -void LayoutTestController::setXSSAuditorEnabled(bool flag) +void TestRunner::setXSSAuditorEnabled(bool flag) { ewk_view_setting_enable_xss_auditor_set(browser->mainView(), flag); } -void LayoutTestController::setFrameFlatteningEnabled(bool flag) +void TestRunner::setFrameFlatteningEnabled(bool flag) { ewk_view_setting_enable_frame_flattening_set(browser->mainView(), flag); } -void LayoutTestController::setSpatialNavigationEnabled(bool flag) +void TestRunner::setSpatialNavigationEnabled(bool flag) { ewk_view_setting_spatial_navigation_set(browser->mainView(), flag); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool) { notImplemented(); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool) +void TestRunner::setAllowFileAccessFromFileURLs(bool) { notImplemented(); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) { DumpRenderTreeSupportEfl::setAuthorAndUserStylesEnabled(browser->mainView(), flag); } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) { DumpRenderTreeSupportEfl::setAutofilled(context, nodeObject, autofilled); } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { ewk_view_setting_auto_load_images_set(browser->mainView(), EINA_FALSE); } -void LayoutTestController::setMockDeviceOrientation(bool, double, bool, double, bool, double) +void TestRunner::setMockDeviceOrientation(bool, double, bool, double, bool, double) { // FIXME: Implement for DeviceOrientation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=30335. notImplemented(); } -void LayoutTestController::setMockGeolocationPosition(double, double, double) +void TestRunner::setMockGeolocationPosition(double, double, double) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. notImplemented(); } -void LayoutTestController::setMockGeolocationError(int, JSStringRef) +void TestRunner::setMockGeolocationError(int, JSStringRef) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. notImplemented(); } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { // FIXME: Implement for Geolocation layout tests. setGeolocationPermissionCommon(allow); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { // FIXME: Implement for Geolocation layout tests. return -1; } -void LayoutTestController::addMockSpeechInputResult(JSStringRef, double, JSStringRef) +void TestRunner::addMockSpeechInputResult(JSStringRef, double, JSStringRef) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. notImplemented(); } -void LayoutTestController::setMockSpeechInputDumpRect(bool) +void TestRunner::setMockSpeechInputDumpRect(bool) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. notImplemented(); } -void LayoutTestController::startSpeechInput(JSContextRef inputElement) +void TestRunner::startSpeechInput(JSContextRef inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. notImplemented(); } -void LayoutTestController::setIconDatabaseEnabled(bool enabled) +void TestRunner::setIconDatabaseEnabled(bool enabled) { ewk_settings_icon_database_path_set(0); @@ -467,34 +467,34 @@ void LayoutTestController::setIconDatabaseEnabled(bool enabled) ewk_settings_icon_database_path_set(databasePath.utf8().data()); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { DumpRenderTreeSupportEfl::setSelectTrailingWhitespaceEnabled(browser->mainView(), flag); } -void LayoutTestController::setPopupBlockingEnabled(bool flag) +void TestRunner::setPopupBlockingEnabled(bool flag) { ewk_view_setting_scripts_can_open_windows_set(browser->mainView(), !flag); } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { ewk_view_setting_enable_plugins_set(browser->mainView(), flag); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) { const String elementId(id->ustring().impl()); const Evas_Object* mainFrame = browser->mainFrame(); return DumpRenderTreeSupportEfl::elementDoesAutoCompleteForElementWithId(mainFrame, elementId); } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { DumpRenderTreeSupportEfl::executeCoreCommandByName(browser->mainView(), name->ustring().utf8().data(), value->ustring().utf8().data()); } -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) { JSRetainPtr<JSStringRef> lengthPropertyName(Adopt, JSStringCreateWithUTF8CString("length")); JSValueRef lengthValue = JSObjectGetProperty(context, optionsArray, lengthPropertyName.get(), 0); @@ -528,12 +528,12 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target, return DumpRenderTreeSupportEfl::findString(browser->mainView(), WTF::String(target->ustring().impl()), options); } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { return DumpRenderTreeSupportEfl::isCommandEnabled(browser->mainView(), name->ustring().utf8().data()); } -void LayoutTestController::setCacheModel(int cacheModel) +void TestRunner::setCacheModel(int cacheModel) { unsigned int cacheTotalCapacity; unsigned int cacheMinDeadCapacity; @@ -574,124 +574,124 @@ void LayoutTestController::setCacheModel(int cacheModel) ewk_settings_page_cache_capacity_set(pageCacheCapacity); } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef) { notImplemented(); } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { notImplemented(); } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { ewk_settings_application_cache_clear(); } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { Ewk_Security_Origin* origin = ewk_frame_security_origin_get(browser->mainFrame()); ewk_security_origin_application_cache_quota_set(origin, quota); ewk_security_origin_free(origin); } -void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString* url) +void TestRunner::clearApplicationCacheForOrigin(OpaqueJSString* url) { Ewk_Security_Origin* origin = ewk_security_origin_new_from_string(url->ustring().utf8().data()); ewk_security_origin_application_cache_clear(origin); ewk_security_origin_free(origin); } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef) { // FIXME: Implement to support getting disk usage in bytes for an origin. notImplemented(); return 0; } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { // FIXME: Implement to get origins that contain application caches. notImplemented(); return JSValueMakeUndefined(context); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef) { notImplemented(); return 0; } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { ewk_web_database_remove_all(); } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { Ewk_Security_Origin* origin = ewk_frame_security_origin_get(browser->mainFrame()); ewk_security_origin_web_database_quota_set(origin, quota); ewk_security_origin_free(origin); } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { notImplemented(); return JSValueMakeUndefined(context); } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { notImplemented(); } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef) { notImplemented(); } -void LayoutTestController::observeStorageTrackerNotifications(unsigned) +void TestRunner::observeStorageTrackerNotifications(unsigned) { notImplemented(); } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { notImplemented(); } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { DumpRenderTreeSupportEfl::setDomainRelaxationForbiddenForURLScheme(forbidden, WTF::String(scheme->ustring().impl())); } -void LayoutTestController::goBack() +void TestRunner::goBack() { ewk_frame_back(browser->mainFrame()); } -void LayoutTestController::setDefersLoading(bool defers) +void TestRunner::setDefersLoading(bool defers) { DumpRenderTreeSupportEfl::setDefersLoading(browser->mainView(), defers); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) +void TestRunner::setAppCacheMaximumSize(unsigned long long size) { ewk_settings_application_cache_max_quota_set(size); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { return DumpRenderTreeSupportEfl::pauseAnimation(browser->mainFrame(), animationName->ustring().utf8().data(), elementId->ustring().utf8().data(), time); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { return DumpRenderTreeSupportEfl::pauseTransition(browser->mainFrame(), propertyName->ustring().utf8().data(), elementId->ustring().utf8().data(), time); } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { return DumpRenderTreeSupportEfl::activeAnimationsCount(browser->mainFrame()); } @@ -706,7 +706,7 @@ static inline int toInt(JSStringRef value) return atoi(value->ustring().utf8().data()); } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { if (equals(key, "WebKitJavaScriptEnabled")) ewk_view_setting_enable_scripts_set(browser->mainView(), toBool(value)); @@ -735,56 +735,56 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value else if (equals(key, "WebKitWebAudioEnabled")) ewk_view_setting_web_audio_set(browser->mainView(), toBool(value)); else - fprintf(stderr, "LayoutTestController::overridePreference tried to override unknown preference '%s'.\n", value->ustring().utf8().data()); + fprintf(stderr, "TestRunner::overridePreference tried to override unknown preference '%s'.\n", value->ustring().utf8().data()); } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { DumpRenderTreeSupportEfl::addUserScript(browser->mainView(), String(source->ustring().impl()), runAtStart, allFrames); } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { DumpRenderTreeSupportEfl::addUserStyleSheet(browser->mainView(), WTF::String(source->ustring().impl()), allFrames); } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { ewk_view_setting_enable_developer_extras_set(browser->mainView(), enabled); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { notImplemented(); } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { ewk_view_web_inspector_show(browser->mainView()); browser->waitInspectorLoadFinished(); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { ewk_view_web_inspector_close(browser->mainView()); } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { DumpRenderTreeSupportEfl::evaluateInWebInspector(browser->mainView(), callId, String(script->ustring().impl())); } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned, JSObjectRef, JSStringRef) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned, JSObjectRef, JSStringRef) { notImplemented(); } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld(browser->mainFrame(), worldID, globalObject, String(script->ustring().impl())); } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { Ewk_History* history = ewk_view_history_get(browser->mainView()); if (!history) @@ -793,27 +793,27 @@ void LayoutTestController::removeAllVisitedLinks() ewk_history_clear(history); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { return DumpRenderTreeSupportEfl::callShouldCloseOnWebView(browser->mainFrame()); } -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef, JSStringRef) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef, JSStringRef) { notImplemented(); } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { notImplemented(); } -void LayoutTestController::setWebViewEditable(bool) +void TestRunner::setWebViewEditable(bool) { ewk_frame_editable_set(browser->mainFrame(), EINA_TRUE); } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { String markerTextChar = DumpRenderTreeSupportEfl::markerTextForListItem(context, nodeObject); if (markerTextChar.isEmpty()) @@ -823,27 +823,27 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) { notImplemented(); } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { notImplemented(); } -void LayoutTestController::setSerializeHTTPLoads(bool serialize) +void TestRunner::setSerializeHTTPLoads(bool serialize) { DumpRenderTreeSupportEfl::setSerializeHTTPLoads(serialize); } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { ewk_view_setting_minimum_timer_interval_set(browser->mainView(), minimumTimerInterval); } -void LayoutTestController::setTextDirection(JSStringRef direction) +void TestRunner::setTextDirection(JSStringRef direction) { Ewk_Text_Direction ewkDirection; if (JSStringIsEqualToUTF8CString(direction, "auto")) @@ -853,43 +853,43 @@ void LayoutTestController::setTextDirection(JSStringRef direction) else if (JSStringIsEqualToUTF8CString(direction, "ltr")) ewkDirection = EWK_TEXT_DIRECTION_LEFT_TO_RIGHT; else { - fprintf(stderr, "LayoutTestController::setTextDirection called with unknown direction: '%s'.\n", direction->ustring().utf8().data()); + fprintf(stderr, "TestRunner::setTextDirection called with unknown direction: '%s'.\n", direction->ustring().utf8().data()); return; } ewk_view_text_direction_set(browser->mainView(), ewkDirection); } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { notImplemented(); } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { notImplemented(); } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { notImplemented(); } -void LayoutTestController::setBackingScaleFactor(double) +void TestRunner::setBackingScaleFactor(double) { notImplemented(); } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { ewk_view_visibility_state_set(browser->mainView(), EWK_PAGE_VISIBILITY_STATE_VISIBLE, true); } -void LayoutTestController::setPageVisibility(const char* visibility) +void TestRunner::setPageVisibility(const char* visibility) { String newVisibility(visibility); if (newVisibility == "visible") @@ -902,12 +902,12 @@ void LayoutTestController::setPageVisibility(const char* visibility) ewk_view_visibility_state_set(browser->mainView(), EWK_PAGE_VISIBILITY_STATE_PREVIEW, false); } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { notImplemented(); } -void LayoutTestController::sendWebIntentResponse(JSStringRef response) +void TestRunner::sendWebIntentResponse(JSStringRef response) { Ewk_Intent_Request* request = browser->currentIntentRequest(); if (!request) @@ -916,12 +916,12 @@ void LayoutTestController::sendWebIntentResponse(JSStringRef response) DumpRenderTreeSupportEfl::sendWebIntentResponse(request, response); } -void LayoutTestController::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data) +void TestRunner::deliverWebIntent(JSStringRef action, JSStringRef type, JSStringRef data) { DumpRenderTreeSupportEfl::deliverWebIntent(browser->mainFrame(), action, type, data); } -void LayoutTestController::setStorageDatabaseIdleInterval(double) +void TestRunner::setStorageDatabaseIdleInterval(double) { notImplemented(); } diff --git a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp index fae866609..75986d82e 100644 --- a/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp @@ -36,9 +36,9 @@ #include "EditingCallbacks.h" #include "EventSender.h" #include "GCController.h" -#include "LayoutTestController.h" #include "PixelDumpSupport.h" #include "SelfScrollingWebKitWebView.h" +#include "TestRunner.h" #include "TextInputController.h" #include "WebCoreSupport/DumpRenderTreeSupportGtk.h" #include "WebCoreTestSupport.h" @@ -78,7 +78,7 @@ static int dumpTree = 1; static int useTimeoutWatchdog = 1; AccessibilityController* axController = 0; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; static GCController* gcController = 0; static WebKitWebView* webView; static GtkWidget* window; @@ -140,7 +140,7 @@ void dumpFrameScrollPosition(WebKitWebFrame* frame) printf("scrolled to %ld,%ld\n", x, y); } - if (gLayoutTestController->dumpChildFrameScrollPositions()) { + if (gTestRunner->dumpChildFrameScrollPositions()) { GSList* children = DumpRenderTreeSupportGtk::getFrameChildren(frame); for (GSList* child = children; child; child = g_slist_next(child)) dumpFrameScrollPosition(static_cast<WebKitWebFrame*>(child->data)); @@ -292,7 +292,7 @@ static gchar* dumpFramesAsText(WebKitWebFrame* frame) result = g_strdup_printf("\n--------\nFrame: '%s'\n--------\n%s\n", frameName, innerText.data()); } - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { GSList* children = DumpRenderTreeSupportGtk::getFrameChildren(frame); for (GSList* child = children; child; child = g_slist_next(child)) { GOwnPtr<gchar> childData(dumpFramesAsText(static_cast<WebKitWebFrame*>(child->data))); @@ -574,12 +574,12 @@ void dump() gchar* responseMimeType = webkit_web_frame_get_response_mime_type(mainFrame); if (g_str_equal(responseMimeType, "text/plain")) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } g_free(responseMimeType); - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) result = dumpFramesAsText(mainFrame); else { // Widget resizing is done asynchronously in GTK+. We pump the main @@ -596,11 +596,11 @@ void dump() if (!result) { const char* errorMessage; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) errorMessage = "[documentElement innerText]"; - else if (gLayoutTestController->dumpDOMAsWebArchive()) + else if (gTestRunner->dumpDOMAsWebArchive()) errorMessage = "[[mainFrame DOMDocument] webArchive]"; - else if (gLayoutTestController->dumpSourceAsWebArchive()) + else if (gTestRunner->dumpSourceAsWebArchive()) errorMessage = "[[mainFrame dataSource] webArchive]"; else errorMessage = "[mainFrame renderTreeAsExternalRepresentation]"; @@ -608,10 +608,10 @@ void dump() } else { printf("%s", result); g_free(result); - if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive()) + if (!gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive()) dumpFrameScrollPosition(mainFrame); - if (gLayoutTestController->dumpBackForwardList()) + if (gTestRunner->dumpBackForwardList()) dumpBackForwardListForAllWebViews(); } @@ -624,11 +624,11 @@ void dump() } if (dumpPixelsForCurrentTest - && gLayoutTestController->generatePixelResults() - && !gLayoutTestController->dumpDOMAsWebArchive() - && !gLayoutTestController->dumpSourceAsWebArchive()) { + && gTestRunner->generatePixelResults() + && !gTestRunner->dumpDOMAsWebArchive() + && !gTestRunner->dumpSourceAsWebArchive()) { DumpRenderTreeSupportGtk::forceWebViewPaint(webView); - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); } // FIXME: call displayWebView here when we support --paint @@ -706,22 +706,22 @@ static void runTest(const string& inputLine) resetDefaultsToConsistentValues(); - gLayoutTestController = LayoutTestController::create(testURL, command.expectedPixelHash); + gTestRunner = TestRunner::create(testURL, command.expectedPixelHash); topLoadingFrame = 0; done = false; - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); if (shouldLogFrameLoadDelegates(testURL)) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); if (shouldEnableDeveloperExtras(testURL)) { - gLayoutTestController->setDeveloperExtrasEnabled(true); + gTestRunner->setDeveloperExtrasEnabled(true); if (shouldOpenWebInspector(testURL)) - gLayoutTestController->showWebInspector(); + gTestRunner->showWebInspector(); if (shouldDumpAsText(testURL)) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } } @@ -731,8 +731,8 @@ static void runTest(const string& inputLine) bool isSVGW3CTest = (testURL.find("svg/W3C-SVG-1.1") != string::npos); GtkAllocation size; size.x = size.y = 0; - size.width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth; - size.height = isSVGW3CTest ? 360 : LayoutTestController::maxViewHeight; + size.width = isSVGW3CTest ? 480 : TestRunner::maxViewWidth; + size.height = isSVGW3CTest ? 360 : TestRunner::maxViewHeight; gtk_window_resize(GTK_WINDOW(window), size.width, size.height); gtk_widget_size_allocate(container, &size); @@ -753,12 +753,12 @@ static void runTest(const string& inputLine) // If developer extras enabled Web Inspector may have been open by the test. if (shouldEnableDeveloperExtras(testURL)) { - gLayoutTestController->closeWebInspector(); - gLayoutTestController->setDeveloperExtrasEnabled(false); + gTestRunner->closeWebInspector(); + gTestRunner->setDeveloperExtrasEnabled(false); } // Also check if we still have opened webViews and free them. - if (gLayoutTestController->closeRemainingWindowsWhenComplete() || webViewList) { + if (gTestRunner->closeRemainingWindowsWhenComplete() || webViewList) { while (webViewList) { g_object_unref(WEBKIT_WEB_VIEW(webViewList->data)); webViewList = g_slist_next(webViewList); @@ -772,7 +772,7 @@ static void runTest(const string& inputLine) // A blank load seems to be necessary to reset state after certain tests. webkit_web_view_open(webView, "about:blank"); - gLayoutTestController.clear(); + gTestRunner.clear(); // terminate the (possibly empty) pixels block after all the state reset sendPixelResultsEOF(); @@ -789,7 +789,7 @@ void webViewLoadStarted(WebKitWebView* view, WebKitWebFrame* frame, void*) static gboolean processWork(void* data) { // if we finish all the commands, we're ready to dump state - if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump()) dump(); return FALSE; @@ -827,7 +827,7 @@ static void webViewLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void // so we can use it here in the DRT to provide the correct dump. if (frame != topLoadingFrame) return; - if (gLayoutTestController->dumpProgressFinishedCallback()) + if (gTestRunner->dumpProgressFinishedCallback()) printf("postProgressFinishedNotification\n"); } @@ -838,7 +838,7 @@ static gboolean webViewLoadError(WebKitWebView*, WebKitWebFrame*, gchar*, gpoint static void webViewDocumentLoadFinished(WebKitWebView* view, WebKitWebFrame* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { char* frameName = getFrameNameSuitableForTestResult(view, frame); printf("%s - didFinishDocumentLoadForFrame\n", frameName); g_free(frameName); @@ -854,7 +854,7 @@ static void webViewDocumentLoadFinished(WebKitWebView* view, WebKitWebFrame* fra static void webViewOnloadEvent(WebKitWebView* view, WebKitWebFrame* frame, void*) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { char* frameName = getFrameNameSuitableForTestResult(view, frame); printf("%s - didHandleOnloadEventsForFrame\n", frameName); g_free(frameName); @@ -871,9 +871,9 @@ static void addControllerToWindow(JSContextRef context, JSObjectRef windowObject static void webViewWindowObjectCleared(WebKitWebView* view, WebKitWebFrame* frame, JSGlobalContextRef context, JSObjectRef windowObject, gpointer data) { JSValueRef exception = 0; - ASSERT(gLayoutTestController); + ASSERT(gTestRunner); - gLayoutTestController->makeWindowObject(context, windowObject, &exception); + gTestRunner->makeWindowObject(context, windowObject, &exception); ASSERT(!exception); gcController->makeWindowObject(context, windowObject, &exception); @@ -940,7 +940,7 @@ static gboolean webViewScriptConfirm(WebKitWebView* view, WebKitWebFrame* frame, static void webViewTitleChanged(WebKitWebView* view, WebKitWebFrame* frame, const gchar* title, gpointer data) { - if (gLayoutTestController->dumpTitleChanges() && !done) + if (gTestRunner->dumpTitleChanges() && !done) printf("TITLE CHANGED: %s\n", title ? title : ""); } @@ -950,7 +950,7 @@ static bool webViewNavigationPolicyDecisionRequested(WebKitWebView* view, WebKit WebKitWebPolicyDecision* policyDecision) { // Use the default handler if we're not waiting for policy, - // i.e., LayoutTestController::waitForPolicyDelegate + // i.e., TestRunner::waitForPolicyDelegate if (!waitForPolicy) return FALSE; @@ -985,7 +985,7 @@ static bool webViewNavigationPolicyDecisionRequested(WebKitWebView* view, WebKit g_free(typeDescription); webkit_web_policy_decision_ignore(policyDecision); - gLayoutTestController->notifyDone(); + gTestRunner->notifyDone(); return TRUE; } @@ -994,7 +994,7 @@ static void webViewStatusBarTextChanged(WebKitWebView* view, const gchar* messag { // Are we doing anything wrong? One test that does not call // dumpStatusCallbacks gets true here - if (gLayoutTestController->dumpStatusCallbacks()) + if (gTestRunner->dumpStatusCallbacks()) printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", message); } @@ -1015,7 +1015,7 @@ static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, We ASSERT(database); WebKitSecurityOrigin* origin = webkit_web_database_get_security_origin(database); - if (gLayoutTestController->dumpDatabaseCallbacks()) { + if (gTestRunner->dumpDatabaseCallbacks()) { printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", webkit_security_origin_get_protocol(origin), webkit_security_origin_get_host(origin), @@ -1028,9 +1028,9 @@ static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, We static bool geolocationPolicyDecisionRequested(WebKitWebView*, WebKitWebFrame*, WebKitGeolocationPolicyDecision* decision) { - if (!gLayoutTestController->isGeolocationPermissionSet()) + if (!gTestRunner->isGeolocationPermissionSet()) return FALSE; - if (gLayoutTestController->geolocationPermission()) + if (gTestRunner->geolocationPermission()) webkit_geolocation_policy_allow(decision); else webkit_geolocation_policy_deny(decision); @@ -1070,7 +1070,7 @@ static void topLoadingFrameLoadFinished() { topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test - if (gLayoutTestController->waitToDump()) + if (gTestRunner->waitToDump()) return; if (WorkQueue::shared()->count()) @@ -1083,7 +1083,7 @@ static void webFrameLoadStatusNotified(WebKitWebFrame* frame, gpointer user_data { WebKitLoadStatus loadStatus = webkit_web_frame_get_load_status(frame); - if (gLayoutTestController->dumpFrameLoadCallbacks()) { + if (gTestRunner->dumpFrameLoadCallbacks()) { GOwnPtr<char> frameName(getFrameNameSuitableForTestResult(webkit_web_frame_get_web_view(frame), frame)); switch (loadStatus) { @@ -1126,7 +1126,8 @@ static CString pathFromSoupURI(SoupURI* uri) return CString(uriString.get()); } - GOwnPtr<gchar> pathDirname(g_path_get_basename(g_path_get_dirname(uri->path))); + GOwnPtr<gchar> parentPath(g_path_get_dirname(uri->path)); + GOwnPtr<gchar> pathDirname(g_path_get_basename(parentPath.get())); GOwnPtr<gchar> pathBasename(g_path_get_basename(uri->path)); GOwnPtr<gchar> urlPath(g_strdup_printf("%s/%s", pathDirname.get(), pathBasename.get())); return CString(urlPath.get()); @@ -1249,13 +1250,13 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF { - if (!done && gLayoutTestController->willSendRequestReturnsNull()) { - // As requested by the LayoutTestController, don't perform the request. + if (!done && gTestRunner->willSendRequestReturnsNull()) { + // As requested by the TestRunner, don't perform the request. webkit_network_request_set_uri(request, "about:blank"); return; } - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - willSendRequest %s redirectResponse %s\n", convertNetworkRequestToURLPath(request).data(), descriptionSuitableForTestResult(request).data(), @@ -1279,7 +1280,7 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF soup_uri_free(uri); if (soupMessage) { - const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders(); + const set<string>& clearHeaders = gTestRunner->willSendRequestClearHeaders(); for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) soup_message_headers_remove(soupMessage->request_headers, header->c_str()); } @@ -1288,7 +1289,7 @@ static void willSendRequestCallback(WebKitWebView* webView, WebKitWebFrame* webF static void didReceiveResponse(WebKitWebView* webView, WebKitWebFrame*, WebKitWebResource* webResource, WebKitNetworkResponse* response) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { CString responseDescription(descriptionSuitableForTestResult(response)); CString path(convertWebResourceToURLPath(webResource)); printf("%s - didReceiveResponse %s\n", path.data(), responseDescription.data()); @@ -1300,13 +1301,13 @@ static void didReceiveResponse(WebKitWebView* webView, WebKitWebFrame*, WebKitWe static void didFinishLoading(WebKitWebView* webView, WebKitWebFrame* webFrame, WebKitWebResource* webResource) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) printf("%s - didFinishLoading\n", descriptionSuitableForTestResult(webView, webFrame, webResource).data()); } static void didFailLoadingWithError(WebKitWebView* webView, WebKitWebFrame* webFrame, WebKitWebResource* webResource, GError* webError) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { CString webErrorString(descriptionSuitableForTestResult(webError, webResource)); printf("%s - didFailLoadingWithError: %s\n", descriptionSuitableForTestResult(webView, webFrame, webResource).data(), webErrorString.data()); @@ -1315,7 +1316,7 @@ static void didFailLoadingWithError(WebKitWebView* webView, WebKitWebFrame* webF static void didRunInsecureContent(WebKitWebFrame*, WebKitSecurityOrigin*, const char* url) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didRunInsecureContent\n"); } @@ -1386,11 +1387,11 @@ static WebKitWebView* createWebView() static WebKitWebView* webViewCreate(WebKitWebView* view, WebKitWebFrame* frame) { - if (!gLayoutTestController->canOpenWindows()) + if (!gTestRunner->canOpenWindows()) return 0; // Make sure that waitUntilDone has been called. - ASSERT(gLayoutTestController->waitToDump()); + ASSERT(gTestRunner->waitToDump()); WebKitWebView* newWebView = createWebView(); g_object_ref_sink(G_OBJECT(newWebView)); diff --git a/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp b/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp index c5fa009fb..4c968d9f4 100644 --- a/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp +++ b/Tools/DumpRenderTree/gtk/EditingCallbacks.cpp @@ -30,7 +30,7 @@ #include "EditingCallbacks.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <gtk/gtk.h> #include <webkit/webkit.h> #include <wtf/gobject/GOwnPtr.h> @@ -99,21 +99,21 @@ static const char* selectionAffinityString(WebKitSelectionAffinity affinity) gboolean shouldBeginEditing(WebKitWebView* webView, WebKitDOMRange* range) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", dumpRange(range).data()); return TRUE; } gboolean shouldEndEditing(WebKitWebView* webView, WebKitDOMRange* range) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", dumpRange(range).data()); return TRUE; } gboolean shouldInsertNode(WebKitWebView* webView, WebKitDOMNode* node, WebKitDOMRange* range, WebKitInsertAction action) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", dumpNodePath(node).data(), dumpRange(range).data(), insertActionString(action)); } @@ -122,7 +122,7 @@ gboolean shouldInsertNode(WebKitWebView* webView, WebKitDOMNode* node, WebKitDOM gboolean shouldInsertText(WebKitWebView* webView, const gchar* text, WebKitDOMRange* range, WebKitInsertAction action) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", text, dumpRange(range).data(), insertActionString(action)); } @@ -131,7 +131,7 @@ gboolean shouldInsertText(WebKitWebView* webView, const gchar* text, WebKitDOMRa gboolean shouldDeleteRange(WebKitWebView* webView, WebKitDOMRange* range) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", dumpRange(range).data()); return TRUE; } @@ -144,7 +144,7 @@ gboolean shouldShowDeleteInterfaceForElement(WebKitWebView* webView, WebKitDOMHT gboolean shouldChangeSelectedRange(WebKitWebView* webView, WebKitDOMRange* fromRange, WebKitDOMRange* toRange, WebKitSelectionAffinity affinity, gboolean stillSelecting) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", dumpRange(fromRange).data(), dumpRange(toRange).data(), selectionAffinityString(affinity), stillSelecting ? "TRUE" : "FALSE"); @@ -154,7 +154,7 @@ gboolean shouldChangeSelectedRange(WebKitWebView* webView, WebKitDOMRange* fromR gboolean shouldApplyStyle(WebKitWebView* webView, WebKitDOMCSSStyleDeclaration* style, WebKitDOMRange* range) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) { + if (!done && gTestRunner->dumpEditingCallbacks()) { GOwnPtr<gchar> styleText(webkit_dom_css_style_declaration_get_css_text(style)); printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", styleText.get(), dumpRange(range).data()); @@ -164,25 +164,25 @@ gboolean shouldApplyStyle(WebKitWebView* webView, WebKitDOMCSSStyleDeclaration* void editingBegan(WebKitWebView*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification\n"); } void userChangedContents(WebKitWebView*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n"); } void editingEnded(WebKitWebView*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidEndEditing:WebViewDidEndEditingNotification\n"); } void selectionChanged(WebKitWebView*) { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification\n"); } diff --git a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp index fffd92422..41575d72f 100644 --- a/Tools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp +++ b/Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp @@ -32,7 +32,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "DumpRenderTree.h" #include "WebCoreSupport/DumpRenderTreeSupportGtk.h" @@ -53,17 +53,17 @@ extern "C" { void webkit_web_inspector_execute_script(WebKitWebInspector* inspector, long callId, const gchar* script); } -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { // FIXME: implement } -void LayoutTestController::addDisallowedURL(JSStringRef url) +void TestRunner::addDisallowedURL(JSStringRef url) { // FIXME: implement } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list(webView); @@ -80,63 +80,63 @@ void LayoutTestController::clearBackForwardList() g_object_unref(item); } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) { // FIXME: implement return 0; } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) { // FIXME: implement return 0; } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { // FIXME: Implement for testing fix for 6727495 } -void LayoutTestController::display() +void TestRunner::display() { displayWebView(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { // FIXME: implement } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { return DumpRenderTreeSupportGtk::computedStyleIncludingVisitedInfo(context, value); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { // FIXME: implement JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithUTF8CString("")); return string; } -int LayoutTestController::numberOfPages(float pageWidth, float pageHeight) +int TestRunner::numberOfPages(float pageWidth, float pageHeight) { return DumpRenderTreeSupportGtk::numberOfPagesForFrame(mainFrame, pageWidth, pageHeight); } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageProperty(mainFrame, propertyName, pageNumber).data())); return propertyValue; } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const { JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithUTF8CString(DumpRenderTreeSupportGtk::pageSizeAndMarginsInPixels(mainFrame, pageNumber, width, height, marginTop, marginRight, marginBottom, marginLeft).data())); return propertyValue; } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebBackForwardList* list = webkit_web_view_get_back_forward_list(webView); @@ -150,18 +150,18 @@ size_t LayoutTestController::webHistoryItemCount() webkit_web_back_forward_list_get_forward_length(list); } -unsigned LayoutTestController::workerThreadCount() const +unsigned TestRunner::workerThreadCount() const { return DumpRenderTreeSupportGtk::workerThreadCount(); } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() const +JSRetainPtr<JSStringRef> TestRunner::platformName() const { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("gtk")); return platformName; } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count()) dump(); @@ -169,7 +169,7 @@ void LayoutTestController::notifyDone() waitForPolicy = false; } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url) +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url) { GOwnPtr<char> urlCString(JSStringCopyUTF8CString(url)); if (!g_str_has_prefix(urlCString.get(), "file:///tmp/LayoutTests/")) @@ -181,7 +181,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt return JSStringCreateWithUTF8CString(testURI.get()); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { gchar* relativeURL = JSStringCopyUTF8CString(url); SoupURI* baseURI = soup_uri_new(webkit_web_frame_get_uri(mainFrame)); @@ -203,13 +203,13 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(absoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool acceptsEditing) +void TestRunner::setAcceptsEditing(bool acceptsEditing) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); webkit_web_view_set_editable(webView, acceptsEditing); } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { SoupSession* session = webkit_get_default_session(); SoupCookieJar* jar = reinterpret_cast<SoupCookieJar*>(soup_session_get_feature(session, SOUP_TYPE_COOKIE_JAR)); @@ -233,23 +233,23 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) g_object_set(G_OBJECT(jar), SOUP_COOKIE_JAR_ACCEPT_POLICY, policy, NULL); } -void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive) { // FIXME: implement } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { waitForPolicy = true; setWaitToDump(true); } -void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) +void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) { // FIXME: implement } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) { gchar* sourceOriginGChar = JSStringCopyUTF8CString(sourceOrigin); gchar* protocolGChar = JSStringCopyUTF8CString(protocol); @@ -260,7 +260,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi g_free(hostGChar); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef protocol, JSStringRef host, bool includeSubdomains) { GOwnPtr<gchar> sourceOriginGChar(JSStringCopyUTF8CString(sourceOrigin)); GOwnPtr<gchar> protocolGChar(JSStringCopyUTF8CString(protocol)); @@ -268,19 +268,19 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr DumpRenderTreeSupportGtk::removeWhiteListAccessFromOrigin(sourceOriginGChar.get(), protocolGChar.get(), hostGChar.get(), includeSubdomains); } -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) +void TestRunner::setMainFrameIsFirstResponder(bool flag) { // FIXME: implement } -void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) +void TestRunner::setTabKeyCyclesThroughElements(bool cycles) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebSettings* settings = webkit_web_view_get_settings(webView); g_object_set(G_OBJECT(settings), "tab-key-cycles-through-elements", cycles, NULL); } -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) +void TestRunner::setUseDashboardCompatibilityMode(bool flag) { // FIXME: implement } @@ -288,7 +288,7 @@ void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) static gchar* userStyleSheet = NULL; static gboolean userStyleSheetEnabled = TRUE; -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { userStyleSheetEnabled = flag; @@ -300,7 +300,7 @@ void LayoutTestController::setUserStyleSheetEnabled(bool flag) g_object_set(G_OBJECT(settings), "user-stylesheet-uri", "", NULL); } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) +void TestRunner::setUserStyleSheetLocation(JSStringRef path) { g_free(userStyleSheet); userStyleSheet = JSStringCopyUTF8CString(path); @@ -308,12 +308,12 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) setUserStyleSheetEnabled(true); } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) { DumpRenderTreeSupportGtk::setValueForUser(context, nodeObject, value); } -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) +void TestRunner::setViewModeMediaFeature(JSStringRef mode) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -334,12 +334,12 @@ void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) g_free(viewMode); } -void LayoutTestController::setWindowIsKey(bool windowIsKey) +void TestRunner::setWindowIsKey(bool windowIsKey) { // FIXME: implement } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { DumpRenderTreeSupportGtk::setSmartInsertDeleteEnabled(webkit_web_frame_get_web_view(mainFrame), flag); } @@ -347,11 +347,11 @@ void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) static gboolean waitToDumpWatchdogFired(void*) { setWaitToDumpWatchdog(0); - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); return FALSE; } -void LayoutTestController::setWaitToDump(bool waitUntilDone) +void TestRunner::setWaitToDump(bool waitUntilDone) { static const int timeoutSeconds = 30; @@ -360,13 +360,13 @@ void LayoutTestController::setWaitToDump(bool waitUntilDone) setWaitToDumpWatchdog(g_timeout_add_seconds(timeoutSeconds, waitToDumpWatchdogFired, 0)); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { // +1 -> including the main view return g_slist_length(webViewList) + 1; } -void LayoutTestController::setPrivateBrowsingEnabled(bool flag) +void TestRunner::setPrivateBrowsingEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -375,7 +375,7 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-private-browsing", flag, NULL); } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag) +void TestRunner::setJavaScriptCanAccessClipboard(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -384,7 +384,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(bool flag) g_object_set(G_OBJECT(settings), "javascript-can-access-clipboard", flag, NULL); } -void LayoutTestController::setXSSAuditorEnabled(bool flag) +void TestRunner::setXSSAuditorEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -393,7 +393,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-xss-auditor", flag, NULL); } -void LayoutTestController::setFrameFlatteningEnabled(bool flag) +void TestRunner::setFrameFlatteningEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -402,7 +402,7 @@ void LayoutTestController::setFrameFlatteningEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-frame-flattening", flag, NULL); } -void LayoutTestController::setSpatialNavigationEnabled(bool flag) +void TestRunner::setSpatialNavigationEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -411,7 +411,7 @@ void LayoutTestController::setSpatialNavigationEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-spatial-navigation", flag, NULL); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -420,7 +420,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool flag) g_object_set(G_OBJECT(settings), "enable-universal-access-from-file-uris", flag, NULL); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool flag) +void TestRunner::setAllowFileAccessFromFileURLs(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -429,17 +429,17 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool flag) g_object_set(G_OBJECT(settings), "enable-file-access-from-file-uris", flag, NULL); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) { // FIXME: implement } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool isAutofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool isAutofilled) { DumpRenderTreeSupportGtk::setAutofilled(context, nodeObject, isAutofilled); } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -448,13 +448,13 @@ void LayoutTestController::disableImageLoading() g_object_set(G_OBJECT(settings), "auto-load-images", FALSE, NULL); } -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +void TestRunner::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) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0)); if (!view) @@ -464,7 +464,7 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo DumpRenderTreeSupportGtk::setMockGeolocationPosition(view, latitude, longitude, accuracy); } -void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) +void TestRunner::setMockGeolocationError(int code, JSStringRef message) { WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0)); if (!view) @@ -475,7 +475,7 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message DumpRenderTreeSupportGtk::setMockGeolocationError(view, code, cMessage.get()); } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { setGeolocationPermissionCommon(allow); WebKitWebView* view = WEBKIT_WEB_VIEW(g_slist_nth_data(webViewList, 0)); @@ -486,7 +486,7 @@ void LayoutTestController::setGeolocationPermission(bool allow) DumpRenderTreeSupportGtk::setMockGeolocationPermission(view, allow); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); if (!view) @@ -496,25 +496,25 @@ int LayoutTestController::numberOfPendingGeolocationPermissionRequests() return DumpRenderTreeSupportGtk::numberOfPendingGeolocationPermissionRequests(view); } -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) +void TestRunner::setMockSpeechInputDumpRect(bool flag) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::startSpeechInput(JSContextRef inputElement) +void TestRunner::startSpeechInput(JSContextRef inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setIconDatabaseEnabled(bool enabled) +void TestRunner::setIconDatabaseEnabled(bool enabled) { WebKitIconDatabase* database = webkit_get_icon_database(); if (enabled) { @@ -524,12 +524,12 @@ void LayoutTestController::setIconDatabaseEnabled(bool enabled) webkit_icon_database_set_path(database, 0); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { DumpRenderTreeSupportGtk::setSelectTrailingWhitespaceEnabled(flag); } -void LayoutTestController::setPopupBlockingEnabled(bool flag) +void TestRunner::setPopupBlockingEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -539,7 +539,7 @@ void LayoutTestController::setPopupBlockingEnabled(bool flag) } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -548,12 +548,12 @@ void LayoutTestController::setPluginsEnabled(bool flag) g_object_set(G_OBJECT(settings), "enable-plugins", flag, NULL); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) { return DumpRenderTreeSupportGtk::elementDoesAutoCompleteForElementWithId(mainFrame, id); } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -565,7 +565,7 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) g_free(cValue); } -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) { WebKitFindOptions findOptions = 0; WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); @@ -603,7 +603,7 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target, return DumpRenderTreeSupportGtk::findString(webView, targetString.get(), findOptions); } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame); ASSERT(view); @@ -614,7 +614,7 @@ bool LayoutTestController::isCommandEnabled(JSStringRef name) return result; } -void LayoutTestController::setCacheModel(int cacheModel) +void TestRunner::setCacheModel(int cacheModel) { // These constants are derived from the Mac cache model enum in Source/WebKit/mac/WebView/WebPreferences.h. switch (cacheModel) { @@ -632,110 +632,110 @@ void LayoutTestController::setCacheModel(int cacheModel) } } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL) { // FIXME: implement } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { // FIXME: implement } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { // FIXME: Implement to support application cache quotas. } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { // FIXME: Implement to support application cache quotas. } -void LayoutTestController::clearApplicationCacheForOrigin(OpaqueJSString*) +void TestRunner::clearApplicationCacheForOrigin(OpaqueJSString*) { // FIXME: Implement to support deleting all application caches for an origin. } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) { // FIXME: Implement to support getting disk usage in bytes for an origin. return 0; } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { // FIXME: Implement to get origins that contain application caches. return JSValueMakeUndefined(context); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef name) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef name) { // FIXME: implement return 0; } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { webkit_remove_all_web_databases(); } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { WebKitSecurityOrigin* origin = webkit_web_frame_get_security_origin(mainFrame); webkit_security_origin_set_web_database_quota(origin, quota); } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { // FIXME: implement return JSValueMakeUndefined(context); } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { // FIXME: implement } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef originIdentifier) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef originIdentifier) { // FIXME: implement } -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) +void TestRunner::observeStorageTrackerNotifications(unsigned number) { // FIXME: implement } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { // FIXME: implement } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { GOwnPtr<gchar> urlScheme(JSStringCopyUTF8CString(scheme)); DumpRenderTreeSupportGtk::setDomainRelaxationForbiddenForURLScheme(forbidden, urlScheme.get()); } -void LayoutTestController::goBack() +void TestRunner::goBack() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); webkit_web_view_go_back(webView); } -void LayoutTestController::setDefersLoading(bool defers) +void TestRunner::setDefersLoading(bool defers) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); DumpRenderTreeSupportGtk::setDefersLoading(webView, defers); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) +void TestRunner::setAppCacheMaximumSize(unsigned long long size) { webkit_application_cache_set_maximum_size(size); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { gchar* name = JSStringCopyUTF8CString(animationName); gchar* element = JSStringCopyUTF8CString(elementId); @@ -745,7 +745,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return returnValue; } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { gchar* name = JSStringCopyUTF8CString(propertyName); gchar* element = JSStringCopyUTF8CString(elementId); @@ -755,7 +755,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return returnValue; } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { return DumpRenderTreeSupportGtk::numberOfActiveAnimations(mainFrame); } @@ -765,7 +765,7 @@ static gboolean booleanFromValue(gchar* value) return !g_ascii_strcasecmp(value, "true") || !g_ascii_strcasecmp(value, "1"); } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { GOwnPtr<gchar> originalName(JSStringCopyUTF8CString(key)); GOwnPtr<gchar> valueAsString(JSStringCopyUTF8CString(value)); @@ -806,7 +806,7 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value DumpRenderTreeSupportGtk::setCSSRegionsEnabled(webkit_web_frame_get_web_view(mainFrame), booleanFromValue(valueAsString.get())); return; } else { - fprintf(stderr, "LayoutTestController::overridePreference tried to override " + fprintf(stderr, "TestRunner::overridePreference tried to override " "unknown preference '%s'.\n", originalName.get()); return; } @@ -827,16 +827,16 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value 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 " + fprintf(stderr, "TestRunner::overridePreference failed to override " "preference '%s'.\n", originalName.get()); } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { - printf("LayoutTestController::addUserScript not implemented.\n"); + printf("TestRunner::addUserScript not implemented.\n"); } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { GOwnPtr<gchar> sourceCode(JSStringCopyUTF8CString(source)); DumpRenderTreeSupportGtk::addUserStyleSheet(mainFrame, sourceCode.get(), allFrames); @@ -844,7 +844,7 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebSettings* webSettings = webkit_web_view_get_settings(webView); @@ -852,12 +852,12 @@ void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) g_object_set(webSettings, "enable-developer-extras", enabled, NULL); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); @@ -865,7 +865,7 @@ void LayoutTestController::showWebInspector() webkit_web_inspector_show(inspector); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); @@ -873,7 +873,7 @@ void LayoutTestController::closeWebInspector() webkit_web_inspector_close(inspector); } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); WebKitWebInspector* inspector = webkit_web_view_get_inspector(webView); @@ -883,41 +883,41 @@ void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef scrip g_free(scriptString); } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { // FIXME: Implement this. } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { // FIXME: Implement this. } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { // FIXME: Implement this. } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { return DumpRenderTreeSupportGtk::shouldClose(mainFrame); } -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) { } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { } -void LayoutTestController::setWebViewEditable(bool) +void TestRunner::setWebViewEditable(bool) { } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { CString markerTextGChar = DumpRenderTreeSupportGtk::markerTextForListItem(mainFrame, context, nodeObject); if (markerTextGChar.isNull()) @@ -927,76 +927,76 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) { } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { } -void LayoutTestController::setSerializeHTTPLoads(bool serialize) +void TestRunner::setSerializeHTTPLoads(bool serialize) { DumpRenderTreeSupportGtk::setSerializeHTTPLoads(serialize); } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { WebKitWebView* webView = webkit_web_frame_get_web_view(mainFrame); DumpRenderTreeSupportGtk::setMinimumTimerInterval(webView, minimumTimerInterval); } -void LayoutTestController::setTextDirection(JSStringRef direction) +void TestRunner::setTextDirection(JSStringRef direction) { // FIXME: Implement. } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { } -void LayoutTestController::setBackingScaleFactor(double) +void TestRunner::setBackingScaleFactor(double) { } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { // FIXME: Implement this. } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { // FIXME: Implement this. } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::sendWebIntentResponse(JSStringRef) +void TestRunner::sendWebIntentResponse(JSStringRef) { // FIXME: Implement this. } -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) { // FIXME: Implement this. } -void LayoutTestController::setStorageDatabaseIdleInterval(double) +void TestRunner::setStorageDatabaseIdleInterval(double) { // FIXME: Implement this. } diff --git a/Tools/DumpRenderTree/mac/DumpRenderTree.mm b/Tools/DumpRenderTree/mac/DumpRenderTree.mm index cbd893f85..2bd54bb70 100644 --- a/Tools/DumpRenderTree/mac/DumpRenderTree.mm +++ b/Tools/DumpRenderTree/mac/DumpRenderTree.mm @@ -40,7 +40,7 @@ #import "FrameLoadDelegate.h" #import "HistoryDelegate.h" #import "JavaScriptThreading.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import "MockGeolocationProvider.h" #import "NavigationController.h" #import "ObjCPlugin.h" @@ -118,7 +118,7 @@ static void runTest(const string& testPathOrURL); volatile bool done; NavigationController* gNavigationController = 0; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; WebFrame *mainFrame = 0; // This is the topmost frame that is loading, during a given load, or nil when no load is @@ -510,7 +510,7 @@ static void registerMockScrollbars() WebView *createWebViewAndOffscreenWindow() { - NSRect rect = NSMakeRect(0, 0, LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight); + NSRect rect = NSMakeRect(0, 0, TestRunner::maxViewWidth, TestRunner::maxViewHeight); WebView *webView = [[WebView alloc] initWithFrame:rect frameName:nil groupName:@"org.webkit.DumpRenderTree"]; [webView setUIDelegate:uiDelegate]; @@ -673,7 +673,7 @@ static void resetDefaultsToConsistentValues() [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:NSHTTPCookieAcceptPolicyOnlyFromMainDocumentDomain]; - LayoutTestController::setSerializeHTTPLoads(false); + TestRunner::setSerializeHTTPLoads(false); setlocale(LC_ALL, ""); } @@ -899,7 +899,7 @@ void dumpRenderTree(int argc, const char *argv[]) [DumpRenderTreePasteboard releaseLocalPasteboards]; - // FIXME: This should be moved onto LayoutTestController and made into a HashSet + // FIXME: This should be moved onto TestRunner and made into a HashSet if (disallowedURLs) { CFRelease(disallowedURLs); disallowedURLs = 0; @@ -924,9 +924,9 @@ static NSInteger compareHistoryItems(id item1, id item2, void *context) static NSData *dumpAudio() { - const char *encodedAudioData = gLayoutTestController->encodedAudioData().c_str(); + const char *encodedAudioData = gTestRunner->encodedAudioData().c_str(); - NSData *data = [NSData dataWithBytes:encodedAudioData length:gLayoutTestController->encodedAudioData().length()]; + NSData *data = [NSData dataWithBytes:encodedAudioData length:gTestRunner->encodedAudioData().length()]; return data; } @@ -974,7 +974,7 @@ static void dumpFrameScrollPosition(WebFrame *f) printf("scrolled to %.f,%.f\n", scrollPosition.x, scrollPosition.y); } - if (gLayoutTestController->dumpChildFrameScrollPositions()) { + if (gTestRunner->dumpChildFrameScrollPositions()) { NSArray *kids = [f childFrames]; if (kids) for (unsigned i = 0; i < [kids count]; i++) @@ -998,7 +998,7 @@ static NSString *dumpFramesAsText(WebFrame *frame) [result appendFormat:@"%@\n", [documentElement innerText]]; - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { NSArray *kids = [frame childFrames]; if (kids) { for (unsigned i = 0; i < [kids count]; i++) @@ -1078,21 +1078,21 @@ static void dumpBackForwardListForWebView(WebView *view) static void sizeWebViewForCurrentTest() { // W3C SVG tests expect to be 480x360 - bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos); + bool isSVGW3CTest = (gTestRunner->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos); if (isSVGW3CTest) [[mainFrame webView] setFrameSize:NSMakeSize(480, 360)]; else - [[mainFrame webView] setFrameSize:NSMakeSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight)]; + [[mainFrame webView] setFrameSize:NSMakeSize(TestRunner::maxViewWidth, TestRunner::maxViewHeight)]; } static const char *methodNameStringForFailedTest() { const char *errorMessage; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) errorMessage = "[documentElement innerText]"; - else if (gLayoutTestController->dumpDOMAsWebArchive()) + else if (gTestRunner->dumpDOMAsWebArchive()) errorMessage = "[[mainFrame DOMDocument] webArchive]"; - else if (gLayoutTestController->dumpSourceAsWebArchive()) + else if (gTestRunner->dumpSourceAsWebArchive()) errorMessage = "[[mainFrame dataSource] webArchive]"; else errorMessage = "[mainFrame renderTreeAsExternalRepresentation]"; @@ -1143,43 +1143,43 @@ void dump() NSString *resultMimeType = @"text/plain"; if ([[[mainFrame dataSource] _responseMIMEType] isEqualToString:@"text/plain"]) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } - if (gLayoutTestController->dumpAsAudio()) { + if (gTestRunner->dumpAsAudio()) { resultData = dumpAudio(); resultMimeType = @"audio/wav"; - } else if (gLayoutTestController->dumpAsText()) { + } else if (gTestRunner->dumpAsText()) { resultString = dumpFramesAsText(mainFrame); - } else if (gLayoutTestController->dumpAsPDF()) { + } else if (gTestRunner->dumpAsPDF()) { resultData = dumpFrameAsPDF(mainFrame); resultMimeType = @"application/pdf"; - } else if (gLayoutTestController->dumpDOMAsWebArchive()) { + } else if (gTestRunner->dumpDOMAsWebArchive()) { WebArchive *webArchive = [[mainFrame DOMDocument] webArchive]; resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data])); resultMimeType = @"application/x-webarchive"; - } else if (gLayoutTestController->dumpSourceAsWebArchive()) { + } else if (gTestRunner->dumpSourceAsWebArchive()) { WebArchive *webArchive = [[mainFrame dataSource] webArchive]; resultString = HardAutorelease(createXMLStringFromWebArchiveData((CFDataRef)[webArchive data])); resultMimeType = @"application/x-webarchive"; } else - resultString = [mainFrame renderTreeAsExternalRepresentationForPrinting:gLayoutTestController->isPrinting()]; + resultString = [mainFrame renderTreeAsExternalRepresentationForPrinting:gTestRunner->isPrinting()]; if (resultString && !resultData) resultData = [resultString dataUsingEncoding:NSUTF8StringEncoding]; printf("Content-Type: %s\n", [resultMimeType UTF8String]); - if (gLayoutTestController->dumpAsAudio()) + if (gTestRunner->dumpAsAudio()) printf("Content-Transfer-Encoding: base64\n"); if (resultData) { fwrite([resultData bytes], 1, [resultData length], stdout); - if (!gLayoutTestController->dumpAsText() && !gLayoutTestController->dumpDOMAsWebArchive() && !gLayoutTestController->dumpSourceAsWebArchive()) + if (!gTestRunner->dumpAsText() && !gTestRunner->dumpDOMAsWebArchive() && !gTestRunner->dumpSourceAsWebArchive()) dumpFrameScrollPosition(mainFrame); - if (gLayoutTestController->dumpBackForwardList()) + if (gTestRunner->dumpBackForwardList()) dumpBackForwardListForAllWindows(); } else printf("ERROR: nil result from %s", methodNameStringForFailedTest()); @@ -1195,9 +1195,9 @@ void dump() } } - if (dumpPixelsForCurrentTest && gLayoutTestController->generatePixelResults()) + if (dumpPixelsForCurrentTest && gTestRunner->generatePixelResults()) // FIXME: when isPrinting is set, dump the image with page separators. - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); puts("#EOF"); // terminate the (possibly empty) pixels block @@ -1256,10 +1256,10 @@ static void resetWebViewToConsistentStateBeforeTesting() resetDefaultsToConsistentValues(); - if (gLayoutTestController) { + if (gTestRunner) { WebCoreTestSupport::resetInternalsObject([mainFrame globalContext]); // in the case that a test using the chrome input field failed, be sure to clean up for the next test - gLayoutTestController->removeChromeInputField(); + gTestRunner->removeChromeInputField(); } [[mainFrame webView] setSmartInsertDeleteEnabled:YES]; @@ -1304,19 +1304,19 @@ static void runTest(const string& inputLine) resetWebViewToConsistentStateBeforeTesting(); - gLayoutTestController = LayoutTestController::create(testURL, command.expectedPixelHash); + gTestRunner = TestRunner::create(testURL, command.expectedPixelHash); topLoadingFrame = nil; ASSERT(!draggingInfo); // the previous test should have called eventSender.mouseUp to drop! releaseAndZero(&draggingInfo); done = NO; sizeWebViewForCurrentTest(); - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); if (disallowedURLs) CFSetRemoveAllValues(disallowedURLs); if (shouldLogFrameLoadDelegates(pathOrURL.c_str())) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); if (shouldLogHistoryDelegates(pathOrURL.c_str())) [[mainFrame webView] setHistoryDelegate:historyDelegate]; @@ -1324,12 +1324,12 @@ static void runTest(const string& inputLine) [[mainFrame webView] setHistoryDelegate:nil]; if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { - gLayoutTestController->setDeveloperExtrasEnabled(true); + gTestRunner->setDeveloperExtrasEnabled(true); if (shouldOpenWebInspector(pathOrURL.c_str())) - gLayoutTestController->showWebInspector(); + gTestRunner->showWebInspector(); if (shouldDumpAsText(pathOrURL.c_str())) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } } @@ -1364,7 +1364,7 @@ static void runTest(const string& inputLine) WorkQueue::shared()->clear(); - if (gLayoutTestController->closeRemainingWindowsWhenComplete()) { + if (gTestRunner->closeRemainingWindowsWhenComplete()) { NSArray* array = [DumpRenderTreeWindow openWindows]; unsigned count = [array count]; @@ -1384,8 +1384,8 @@ static void runTest(const string& inputLine) // If developer extras enabled Web Inspector may have been open by the test. if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { - gLayoutTestController->closeWebInspector(); - gLayoutTestController->setDeveloperExtrasEnabled(false); + gTestRunner->closeWebInspector(); + gTestRunner->setDeveloperExtrasEnabled(false); } resetWebViewToConsistentStateBeforeTesting(); @@ -1399,7 +1399,7 @@ static void runTest(const string& inputLine) ASSERT(CFArrayGetCount(openWindowsRef) == 1); ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == [[mainFrame webView] window]); - gLayoutTestController.clear(); + gTestRunner.clear(); if (ignoreWebCoreNodeLeaks) [WebCoreStatistics stopIgnoringWebCoreNodeLeaks]; diff --git a/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm b/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm index e0cdc6b6e..17a114ba0 100644 --- a/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm +++ b/Tools/DumpRenderTree/mac/DumpRenderTreeWindow.mm @@ -34,7 +34,7 @@ #import "DumpRenderTree.h" // FIXME: This file is ObjC++ only because of this include. :( -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebViewPrivate.h> #import <WebKit/WebTypesInternal.h> @@ -79,7 +79,12 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = { - (BOOL)isKeyWindow { - return gLayoutTestController ? gLayoutTestController->windowIsKey() : YES; + return gTestRunner ? gTestRunner->windowIsKey() : YES; +} + +- (BOOL)_hasKeyAppearance +{ + return [self isKeyWindow]; } - (void)keyDown:(NSEvent *)event diff --git a/Tools/DumpRenderTree/mac/EditingDelegate.mm b/Tools/DumpRenderTree/mac/EditingDelegate.mm index b1e48c5fa..d6227a72c 100644 --- a/Tools/DumpRenderTree/mac/EditingDelegate.mm +++ b/Tools/DumpRenderTree/mac/EditingDelegate.mm @@ -30,7 +30,7 @@ #import "EditingDelegate.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebKit.h> @interface DOMNode (dumpPath) @@ -74,14 +74,14 @@ - (BOOL)webView:(WebView *)webView shouldBeginEditingInDOMRange:(DOMRange *)range { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n", [[range dump] UTF8String]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldEndEditingInDOMRange:(DOMRange *)range { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n", [[range dump] UTF8String]); return acceptsEditing; } @@ -94,7 +94,7 @@ "WebViewInsertActionDropped", }; - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n", [[node dumpPath] UTF8String], [[range dump] UTF8String], insertactionstring[action]); return acceptsEditing; } @@ -107,14 +107,14 @@ "WebViewInsertActionDropped", }; - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n", [[text description] UTF8String], [[range dump] UTF8String], insertactionstring[action]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldDeleteDOMRange:(DOMRange *)range { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldDeleteDOMRange:%s\n", [[range dump] UTF8String]); return acceptsEditing; } @@ -135,52 +135,52 @@ "TRUE" }; - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n", [[currentRange dump] UTF8String], [[proposedRange dump] UTF8String], affinitystring[selectionAffinity], boolstring[flag]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldApplyStyle:(DOMCSSStyleDeclaration *)style toElementsInDOMRange:(DOMRange *)range { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n", [[style description] UTF8String], [[range dump] UTF8String]); return acceptsEditing; } - (BOOL)webView:(WebView *)webView shouldChangeTypingStyle:(DOMCSSStyleDeclaration *)currentStyle toStyle:(DOMCSSStyleDeclaration *)proposedStyle { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: shouldChangeTypingStyle:%s toStyle:%s\n", [[currentStyle description] UTF8String], [[proposedStyle description] UTF8String]); return acceptsEditing; } - (void)webViewDidBeginEditing:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidBeginEditing:%s\n", [[notification name] UTF8String]); } - (void)webViewDidChange:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChange:%s\n", [[notification name] UTF8String]); } - (void)webViewDidEndEditing:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidEndEditing:%s\n", [[notification name] UTF8String]); } - (void)webViewDidChangeTypingStyle:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeTypingStyle:%s\n", [[notification name] UTF8String]); } - (void)webViewDidChangeSelection:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpEditingCallbacks()) + if (!done && gTestRunner->dumpEditingCallbacks()) printf("EDITING DELEGATE: webViewDidChangeSelection:%s\n", [[notification name] UTF8String]); } diff --git a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm index 69c246197..88cc7c920 100644 --- a/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm +++ b/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm @@ -35,7 +35,7 @@ #import "EventSendingController.h" #import "Foundation/NSNotification.h" #import "GCController.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import "NavigationController.h" #import "ObjCController.h" #import "ObjCPlugin.h" @@ -131,7 +131,7 @@ return; // if we finish all the commands, we're ready to dump state - if (WorkQueue::shared()->processWork() && !gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !gTestRunner->waitToDump()) dump(); } @@ -145,7 +145,7 @@ if ([dataSource webFrame] == topLoadingFrame) { topLoadingFrame = nil; WorkQueue::shared()->setFrozen(true); // first complete load freezes the queue for the rest of this test - if (!gLayoutTestController->waitToDump()) { + if (!gTestRunner->waitToDump()) { if (WorkQueue::shared()->count()) [self performSelector:@selector(processWork:) withObject:nil afterDelay:0]; else @@ -156,12 +156,12 @@ - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didStartProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } - if (!done && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - in didStartProvisionalLoadForFrame", [frame _drt_printFrameUserGestureStatus]]; printf ("%s\n", [string UTF8String]); } @@ -172,13 +172,13 @@ if (!topLoadingFrame && !done) topLoadingFrame = frame; - if (!done && gLayoutTestController->stopProvisionalFrameLoads()) { + if (!done && gTestRunner->stopProvisionalFrameLoads()) { NSString *string = [NSString stringWithFormat:@"%@ - stopping load in didStartProvisionalLoadForFrame callback", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); [frame stopLoading]; } - if (!done && gLayoutTestController->useDeferredFrameLoading()) { + if (!done && gTestRunner->useDeferredFrameLoading()) { [sender setDefersCallbacks:YES]; int64_t deferredWaitTime = 5 * NSEC_PER_MSEC; dispatch_time_t when = dispatch_time(DISPATCH_TIME_NOW, deferredWaitTime); @@ -190,7 +190,7 @@ - (void)webView:(WebView *)sender didCommitLoadForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didCommitLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -198,14 +198,14 @@ ASSERT(![frame provisionalDataSource]); ASSERT([frame dataSource]); - gLayoutTestController->setWindowIsKey(true); + gTestRunner->setWindowIsKey(true); NSView *documentView = [[mainFrame frameView] documentView]; [[[mainFrame webView] window] makeFirstResponder:documentView]; } - (void)webView:(WebView *)sender didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailProvisionalLoadWithError", [frame _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } @@ -228,7 +228,7 @@ ASSERT([frame dataSource]); ASSERT(frame == [[frame dataSource] webFrame]); - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -244,7 +244,7 @@ - (void)webView:(WebView *)sender didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadWithError", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -257,7 +257,7 @@ - (void)webView:(WebView *)webView windowScriptObjectAvailable:(WebScriptObject *)windowScriptObject { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"?? - windowScriptObjectAvailable"]; printf ("%s\n", [string UTF8String]); } @@ -267,13 +267,13 @@ - (void)didClearWindowObjectInStandardWorldForFrame:(WebFrame *)frame { - // Make New-Style LayoutTestController + // Make New-Style TestRunner JSContextRef context = [frame globalContext]; JSObjectRef globalObject = JSContextGetGlobalObject(context); JSValueRef exception = 0; - ASSERT(gLayoutTestController); - gLayoutTestController->makeWindowObject(context, globalObject, &exception); + ASSERT(gTestRunner); + gTestRunner->makeWindowObject(context, globalObject, &exception); ASSERT(!exception); gcController->makeWindowObject(context, globalObject, &exception); @@ -338,18 +338,18 @@ - (void)webView:(WebView *)sender didReceiveTitle:(NSString *)title forFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveTitle: %@", [frame _drt_descriptionSuitableForTestResult], title]; printf ("%s\n", [string UTF8String]); } - if (gLayoutTestController->dumpTitleChanges()) + if (gTestRunner->dumpTitleChanges()) printf("TITLE CHANGED: %s\n", [title UTF8String]); } - (void)webView:(WebView *)sender didReceiveServerRedirectForProvisionalLoadForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveServerRedirectForProvisionalLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -357,7 +357,7 @@ - (void)webView:(WebView *)sender didChangeLocationWithinPageForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didChangeLocationWithinPageForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -365,12 +365,12 @@ - (void)webView:(WebView *)sender willPerformClientRedirectToURL:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - willPerformClientRedirectToURL: %@ ", [frame _drt_descriptionSuitableForTestResult], [URL _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } - if (!done && gLayoutTestController->dumpUserGestureInFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpUserGestureInFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - in willPerformClientRedirect", [frame _drt_printFrameUserGestureStatus]]; printf ("%s\n", [string UTF8String]); } @@ -378,7 +378,7 @@ - (void)webView:(WebView *)sender didCancelClientRedirectForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didCancelClientRedirectForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -386,7 +386,7 @@ - (void)webView:(WebView *)sender didFinishDocumentLoadForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFinishDocumentLoadForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } else if (!done) { @@ -400,7 +400,7 @@ - (void)webView:(WebView *)sender didHandleOnloadEventsForFrame:(WebFrame *)frame { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) { + if (!done && gTestRunner->dumpFrameLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didHandleOnloadEventsForFrame", [frame _drt_descriptionSuitableForTestResult]]; printf ("%s\n", [string UTF8String]); } @@ -408,25 +408,25 @@ - (void)webViewDidDisplayInsecureContent:(WebView *)sender { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf ("didDisplayInsecureContent\n"); } - (void)webView:(WebView *)sender didRunInsecureContent:(WebSecurityOrigin *)origin { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf ("didRunInsecureContent\n"); } - (void)webView:(WebView *)sender didDetectXSS:(NSURL *)insecureURL { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf ("didDetectXSS\n"); } - (void)webViewProgressFinishedNotification:(NSNotification *)notification { - if (!done && gLayoutTestController->dumpProgressFinishedCallback()) + if (!done && gTestRunner->dumpProgressFinishedCallback()) printf ("postProgressFinishedNotification\n"); } diff --git a/Tools/DumpRenderTree/mac/HistoryDelegate.mm b/Tools/DumpRenderTree/mac/HistoryDelegate.mm index cbc409327..4c703f90a 100644 --- a/Tools/DumpRenderTree/mac/HistoryDelegate.mm +++ b/Tools/DumpRenderTree/mac/HistoryDelegate.mm @@ -26,7 +26,7 @@ #import "HistoryDelegate.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebNavigationData.h> #import <WebKit/WebView.h> @@ -74,7 +74,7 @@ - (void)populateVisitedLinksForWebView:(WebView *)webView { - if (gLayoutTestController->dumpVisitedLinksCallback()) + if (gTestRunner->dumpVisitedLinksCallback()) printf("Asked to populate visited links for WebView \"%s\"\n", [[[NSURL URLWithString:[webView mainFrameURL]] _drt_descriptionSuitableForTestResult] UTF8String]); } diff --git a/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm b/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm index eaef0d523..71f739063 100644 --- a/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm +++ b/Tools/DumpRenderTree/mac/PixelDumpSupportMac.mm @@ -33,7 +33,7 @@ #include "PixelDumpSupportCG.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <CoreGraphics/CGBitmapContext.h> #include <wtf/Assertions.h> #include <wtf/RefPtr.h> @@ -184,8 +184,8 @@ PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool onscreen, bool inc PassRefPtr<BitmapContext> createPagedBitmapContext() { - int pageWidthInPixels = LayoutTestController::maxViewWidth; - int pageHeightInPixels = LayoutTestController::maxViewHeight; + int pageWidthInPixels = TestRunner::maxViewWidth; + int pageHeightInPixels = TestRunner::maxViewHeight; int numberOfPages = [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels]; size_t rowBytes = 0; void* buffer = 0; diff --git a/Tools/DumpRenderTree/mac/PolicyDelegate.h b/Tools/DumpRenderTree/mac/PolicyDelegate.h index 3b954557d..c1a7e6f25 100644 --- a/Tools/DumpRenderTree/mac/PolicyDelegate.h +++ b/Tools/DumpRenderTree/mac/PolicyDelegate.h @@ -28,14 +28,14 @@ #import <Cocoa/Cocoa.h> -class LayoutTestController; +class TestRunner; @interface PolicyDelegate : NSObject { BOOL permissiveDelegate; - LayoutTestController* controllerToNotifyDone; + TestRunner* controllerToNotifyDone; } - (void)setPermissive:(BOOL)permissive; -- (void)setControllerToNotifyDone:(LayoutTestController*)controller; +- (void)setControllerToNotifyDone:(TestRunner*)controller; @end diff --git a/Tools/DumpRenderTree/mac/PolicyDelegate.mm b/Tools/DumpRenderTree/mac/PolicyDelegate.mm index 5ad7368f3..6a0eeb9ec 100644 --- a/Tools/DumpRenderTree/mac/PolicyDelegate.mm +++ b/Tools/DumpRenderTree/mac/PolicyDelegate.mm @@ -30,7 +30,7 @@ #import "PolicyDelegate.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/DOMElement.h> #import <WebKit/WebFrame.h> #import <WebKit/WebPolicyDelegate.h> @@ -133,7 +133,7 @@ static NSString *dispositionTypeFromContentDispositionHeader(NSString *header) permissiveDelegate = permissive; } -- (void)setControllerToNotifyDone:(LayoutTestController*)controller +- (void)setControllerToNotifyDone:(TestRunner*)controller { controllerToNotifyDone = controller; } diff --git a/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm b/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm index a1e4f17a2..c5b26442c 100644 --- a/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm +++ b/Tools/DumpRenderTree/mac/ResourceLoadDelegate.mm @@ -30,7 +30,7 @@ #import "ResourceLoadDelegate.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebKit.h> #import <WebKit/WebTypesInternal.h> #import <WebKit/WebDataSourcePrivate.h> @@ -121,7 +121,7 @@ using namespace std; { ASSERT([[dataSource webFrame] dataSource] || [[dataSource webFrame] provisionalDataSource]); - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) + if (!done && gTestRunner->dumpResourceLoadCallbacks()) return [[request URL] _drt_descriptionSuitableForTestResult]; return @"<unknown>"; @@ -140,20 +140,20 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(NSURLRequest *)webView: (WebView *)wv resource:identifier willSendRequest: (NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - willSendRequest %@ redirectResponse %@", identifier, [request _drt_descriptionSuitableForTestResult], [redirectResponse _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } - if (!done && !gLayoutTestController->deferMainResourceDataLoad()) { + if (!done && !gTestRunner->deferMainResourceDataLoad()) { [dataSource _setDeferMainResourceDataLoad:false]; } - if (!done && gLayoutTestController->willSendRequestReturnsNull()) + if (!done && gTestRunner->willSendRequestReturnsNull()) return nil; - if (!done && gLayoutTestController->willSendRequestReturnsNullOnRedirect() && redirectResponse) { + if (!done && gTestRunner->willSendRequestReturnsNullOnRedirect() && redirectResponse) { printf("Returning null for this redirect\n"); return nil; } @@ -161,7 +161,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) NSURL *url = [request URL]; NSString *host = [url host]; if (host && (NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"http"] || NSOrderedSame == [[url scheme] caseInsensitiveCompare:@"https"])) { - NSString *testPathOrURL = [NSString stringWithUTF8String:gLayoutTestController->testPathOrURL().c_str()]; + NSString *testPathOrURL = [NSString stringWithUTF8String:gTestRunner->testPathOrURL().c_str()]; NSString *lowercaseTestPathOrURL = [testPathOrURL lowercaseString]; NSString *testHost = 0; if ([lowercaseTestPathOrURL hasPrefix:@"http:"] || [lowercaseTestPathOrURL hasPrefix:@"https:"]) @@ -176,13 +176,13 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) return nil; NSMutableURLRequest *newRequest = [request mutableCopy]; - const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders(); + const set<string>& clearHeaders = gTestRunner->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]; } - const std::string& destination = gLayoutTestController->redirectionDestinationForURL([[url absoluteString] UTF8String]); + const std::string& destination = gTestRunner->redirectionDestinationForURL([[url absoluteString] UTF8String]); if (destination.length()) [newRequest setURL:[NSURL URLWithString:[NSString stringWithUTF8String:destination.data()]]]; @@ -191,7 +191,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) - (void)webView:(WebView *)wv resource:(id)identifier didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource { - if (!gLayoutTestController->handlesAuthenticationChallenges()) { + if (!gTestRunner->handlesAuthenticationChallenges()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveAuthenticationChallenge - Simulating cancelled authentication sheet", identifier]; printf("%s\n", [string UTF8String]); @@ -199,10 +199,10 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) return; } - const char* user = gLayoutTestController->authenticationUsername().c_str(); + const char* user = gTestRunner->authenticationUsername().c_str(); NSString *nsUser = [NSString stringWithFormat:@"%s", user ? user : ""]; - const char* password = gLayoutTestController->authenticationPassword().c_str(); + const char* password = gTestRunner->authenticationPassword().c_str(); NSString *nsPassword = [NSString stringWithFormat:@"%s", password ? password : ""]; NSString *string = [NSString stringWithFormat:@"%@ - didReceiveAuthenticationChallenge - Responding with %@:%@", identifier, nsUser, nsPassword]; @@ -218,11 +218,11 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(void)webView: (WebView *)wv resource:identifier didReceiveResponse: (NSURLResponse *)response fromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didReceiveResponse %@", identifier, [response _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } - if (!done && gLayoutTestController->dumpResourceResponseMIMETypes()) + if (!done && gTestRunner->dumpResourceResponseMIMETypes()) printf("%s has MIME type %s\n", [[[[response URL] relativePath] lastPathComponent] UTF8String], [[response MIMEType] UTF8String]); } @@ -232,7 +232,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(void)webView: (WebView *)wv resource:identifier didFinishLoadingFromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFinishLoading", identifier]; printf("%s\n", [string UTF8String]); } @@ -240,7 +240,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(void)webView: (WebView *)wv resource:identifier didFailLoadingWithError:(NSError *)error fromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { NSString *string = [NSString stringWithFormat:@"%@ - didFailLoadingWithError: %@", identifier, [error _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } @@ -255,7 +255,7 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) -(NSCachedURLResponse *) webView: (WebView *)wv resource:(id)identifier willCacheResponse:(NSCachedURLResponse *)response fromDataSource:(WebDataSource *)dataSource { - if (!done && gLayoutTestController->dumpWillCacheResponse()) { + if (!done && gTestRunner->dumpWillCacheResponse()) { NSString *string = [NSString stringWithFormat:@"%@ - willCacheResponse: called", identifier]; printf("%s\n", [string UTF8String]); } @@ -266,11 +266,11 @@ BOOL hostIsUsedBySomeTestsToGenerateError(NSString *host) { // Only log the message when shouldPaintBrokenImage() returns NO; this avoids changing results of layout tests with failed // images, e.g., security/block-test-no-port.html. - if (!done && gLayoutTestController->dumpResourceLoadCallbacks() && !gLayoutTestController->shouldPaintBrokenImage()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks() && !gTestRunner->shouldPaintBrokenImage()) { NSString *string = [NSString stringWithFormat:@"%@ - shouldPaintBrokenImage: NO", [imageURL _drt_descriptionSuitableForTestResult]]; printf("%s\n", [string UTF8String]); } - return gLayoutTestController->shouldPaintBrokenImage(); + return gTestRunner->shouldPaintBrokenImage(); } @end diff --git a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/Tools/DumpRenderTree/mac/TestRunnerMac.mm index a32287141..1d7de85e2 100644 --- a/Tools/DumpRenderTree/mac/LayoutTestControllerMac.mm +++ b/Tools/DumpRenderTree/mac/TestRunnerMac.mm @@ -28,7 +28,7 @@ #import "config.h" #import "DumpRenderTree.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import "EditingDelegate.h" #import "MockGeolocationProvider.h" @@ -107,11 +107,11 @@ @end -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { } -void LayoutTestController::addDisallowedURL(JSStringRef url) +void TestRunner::addDisallowedURL(JSStringRef url) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); @@ -125,17 +125,17 @@ void LayoutTestController::addDisallowedURL(JSStringRef url) CFSetAddValue(disallowedURLs, [request URL]); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { return [[mainFrame webView] shouldClose]; } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { [WebApplicationCache deleteAllApplicationCaches]; } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef url) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef url) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]]; @@ -144,12 +144,12 @@ long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef u return usage; } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { [[WebStorageManager sharedWebStorageManager] syncLocalStorage]; } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef url) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef url) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:(NSString *)urlCF.get()]]; @@ -158,12 +158,12 @@ long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef url) return usage; } -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) +void TestRunner::observeStorageTrackerNotifications(unsigned number) { [storageDelegate logNotifications:number controller:this]; } -void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef url) +void TestRunner::clearApplicationCacheForOrigin(JSStringRef url) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); @@ -186,32 +186,32 @@ JSValueRef originsArrayToJS(JSContextRef context, NSArray *origins) return JSObjectMakeArray(context, count, jsOriginsArray, NULL); } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { return originsArrayToJS(context, [WebApplicationCache originsWithCache]); } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { [[WebDatabaseManager sharedWebDatabaseManager] deleteAllDatabases]; } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { [[WebStorageManager sharedWebStorageManager] deleteAllOrigins]; } -void LayoutTestController::setStorageDatabaseIdleInterval(double interval) +void TestRunner::setStorageDatabaseIdleInterval(double interval) { [WebStorageManager setStorageDatabaseIdleInterval:interval]; } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { return originsArrayToJS(context, [[WebStorageManager sharedWebStorageManager] origins]); } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, URL)); @@ -220,7 +220,7 @@ void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) [origin release]; } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { WebBackForwardList *backForwardList = [[mainFrame webView] backForwardList]; WebHistoryItem *item = [[backForwardList currentItem] retain]; @@ -235,26 +235,26 @@ void LayoutTestController::clearBackForwardList() [item release]; } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); NSString *nameNS = (NSString *)nameCF.get(); return JSStringCreateWithCFString((CFStringRef)[nameNS _web_decodeHostName]); } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); NSString *nameNS = (NSString *)nameCF.get(); return JSStringCreateWithCFString((CFStringRef)[nameNS _web_encodeHostName]); } -void LayoutTestController::display() +void TestRunner::display() { displayWebView(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { if (![WebHistory optionalSharedHistory]) { WebHistory *history = [[WebHistory alloc] init]; @@ -263,18 +263,18 @@ void LayoutTestController::keepWebHistory() } } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { return [[mainFrame webView] _computedStyleIncludingVisitedInfo:context forElement:value]; } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { JSRetainPtr<JSStringRef> string(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame _layerTreeAsText])); return string; } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject]; if (!element) @@ -284,45 +284,45 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageProperty:propertyName:pageNumber])); return propertyValue; } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +JSRetainPtr<JSStringRef> TestRunner::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) +int TestRunner::numberOfPages(float pageWidthInPixels, float pageHeightInPixels) { return [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels]; } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { return [[[mainFrame webView] UIDelegate] numberOfPendingGeolocationPermissionRequests]; } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { return [[[WebHistory optionalSharedHistory] allItems] count]; } -unsigned LayoutTestController::workerThreadCount() const +unsigned TestRunner::workerThreadCount() const { return [WebWorkersPrivate workerThreadCount]; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() const +JSRetainPtr<JSStringRef> TestRunner::platformName() const { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac")); return platformName; } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count()) dump(); @@ -362,12 +362,12 @@ static inline std::string resourceRootAbsolutePath(const std::string& testPathOr return testPathOrURL.substr(0, indexOfSeparatorAfterDirectoryName(expectedRootName, testPathOrURL)); } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef localResourceJSString) +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef localResourceJSString) { // The passed in path will be an absolute path to the resource starting // with "/tmp" or "/tmp/LayoutTests", optionally starting with the explicit file:// protocol. // /tmp maps to DUMPRENDERTREE_TEMP, and /tmp/LayoutTests maps to LOCAL_RESOURCE_ROOT. - // FIXME: This code should work on all *nix platforms and can be moved into LayoutTestController.cpp. + // FIXME: This code should work on all *nix platforms and can be moved into TestRunner.cpp. std::string expectedRootName; std::string absolutePathToResourceRoot; std::string localResourceString = stringFromJSString(localResourceJSString); @@ -393,7 +393,7 @@ JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSSt return JSStringCreateWithUTF8CString(absolutePathToLocalResource.c_str()); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { RetainPtr<CFStringRef> urlCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, url)); NSString *urlNS = (NSString *)urlCF.get(); @@ -405,12 +405,12 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(absoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool newAcceptsEditing) +void TestRunner::setAcceptsEditing(bool newAcceptsEditing) { [(EditingDelegate *)[[mainFrame webView] editingDelegate] setAcceptsEditing:newAcceptsEditing]; } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { if (alwaysAcceptCookies == m_alwaysAcceptCookies) return; @@ -420,24 +420,24 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) [WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:cookieAcceptPolicy]; } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) +void TestRunner::setAppCacheMaximumSize(unsigned long long size) { [WebApplicationCache setMaximumSize:size]; } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::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) +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) { [[[mainFrame webView] preferences] setAuthorAndUserStylesEnabled:flag]; } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) { DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject]; if (!element || ![element isKindOfClass:[DOMHTMLInputElement class]]) @@ -446,7 +446,7 @@ void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeOb [(DOMHTMLInputElement *)element _setAutofilled:autofilled]; } -void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive) { if (setDelegate) { [policyDelegate setPermissive:permissive]; @@ -455,30 +455,30 @@ void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permis [[mainFrame webView] setPolicyDelegate:nil]; } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { WebSecurityOrigin *origin = [[WebSecurityOrigin alloc] initWithURL:[NSURL URLWithString:@"file:///"]]; [[origin databaseQuotaManager] setQuota:quota]; [origin release]; } -void LayoutTestController::goBack() +void TestRunner::goBack() { [[mainFrame webView] goBack]; } -void LayoutTestController::setDefersLoading(bool defers) +void TestRunner::setDefersLoading(bool defers) { [[mainFrame webView] setDefersCallbacks:defers]; } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { RetainPtr<CFStringRef> schemeCFString(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, scheme)); [WebView _setDomainRelaxationForbidden:forbidden forURLScheme:(NSString *)schemeCFString.get()]; } -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +void TestRunner::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]; @@ -488,14 +488,14 @@ void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double [orientation release]; } -void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double 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) +void TestRunner::setMockGeolocationError(int code, JSStringRef message) { RetainPtr<CFStringRef> messageCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, message)); NSString *messageNS = (NSString *)messageCF.get(); @@ -503,31 +503,31 @@ void LayoutTestController::setMockGeolocationError(int code, JSStringRef message [[MockGeolocationProvider shared] setError:error]; } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { setGeolocationPermissionCommon(allow); [[[mainFrame webView] UIDelegate] didSetMockGeolocationPermission]; } -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) +void TestRunner::setMockSpeechInputDumpRect(bool flag) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::startSpeechInput(JSContextRef inputElement) +void TestRunner::startSpeechInput(JSContextRef inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) +void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled) { // FIXME: Workaround <rdar://problem/6480108> static WebIconDatabase *sharedWebIconDatabase = NULL; @@ -541,7 +541,7 @@ void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) [sharedWebIconDatabase setEnabled:iconDatabaseEnabled]; } -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) +void TestRunner::setMainFrameIsFirstResponder(bool flag) { NSView *documentView = [[mainFrame frameView] documentView]; @@ -549,79 +549,79 @@ void LayoutTestController::setMainFrameIsFirstResponder(bool flag) [[[mainFrame webView] window] makeFirstResponder:firstResponder]; } -void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) +void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) { [[[mainFrame webView] preferences] setPrivateBrowsingEnabled:privateBrowsingEnabled]; } -void LayoutTestController::setXSSAuditorEnabled(bool enabled) +void TestRunner::setXSSAuditorEnabled(bool enabled) { [[[mainFrame webView] preferences] setXSSAuditorEnabled:enabled]; } -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) +void TestRunner::setFrameFlatteningEnabled(bool enabled) { [[[mainFrame webView] preferences] setFrameFlatteningEnabled:enabled]; } -void LayoutTestController::setSpatialNavigationEnabled(bool enabled) +void TestRunner::setSpatialNavigationEnabled(bool enabled) { [[[mainFrame webView] preferences] setSpatialNavigationEnabled:enabled]; } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { [[[mainFrame webView] preferences] setAllowUniversalAccessFromFileURLs:enabled]; } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { [[[mainFrame webView] preferences] setAllowFileAccessFromFileURLs:enabled]; } -void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled) +void TestRunner::setPopupBlockingEnabled(bool popupBlockingEnabled) { [[[mainFrame webView] preferences] setJavaScriptCanOpenWindowsAutomatically:!popupBlockingEnabled]; } -void LayoutTestController::setPluginsEnabled(bool pluginsEnabled) +void TestRunner::setPluginsEnabled(bool pluginsEnabled) { [[[mainFrame webView] preferences] setPlugInsEnabled:pluginsEnabled]; } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) +void TestRunner::setJavaScriptCanAccessClipboard(bool enabled) { [[[mainFrame webView] preferences] setJavaScriptCanAccessClipboard:enabled]; } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool enabled) +void TestRunner::setAutomaticLinkDetectionEnabled(bool enabled) { [[mainFrame webView] setAutomaticLinkDetectionEnabled:enabled]; } -void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) +void TestRunner::setTabKeyCyclesThroughElements(bool cycles) { [[mainFrame webView] setTabKeyCyclesThroughElements:cycles]; } -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) +void TestRunner::setUseDashboardCompatibilityMode(bool flag) { [[mainFrame webView] _setDashboardBehavior:WebDashboardBehaviorUseBackwardCompatibilityMode to:flag]; } -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { [[WebPreferences standardPreferences] setUserStyleSheetEnabled:flag]; } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) +void TestRunner::setUserStyleSheetLocation(JSStringRef path) { RetainPtr<CFStringRef> pathCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, path)); NSURL *url = [NSURL URLWithString:(NSString *)pathCF.get()]; [[WebPreferences standardPreferences] setUserStyleSheetLocation:url]; } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef nodeObject, JSStringRef value) { DOMElement *element = [DOMElement _DOMElementFromJSContext:context value:nodeObject]; if (!element || ![element isKindOfClass:[DOMHTMLInputElement class]]) @@ -631,22 +631,22 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef node [(DOMHTMLInputElement *)element _setValueForUser:(NSString *)valueCF.get()]; } -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) +void TestRunner::setViewModeMediaFeature(JSStringRef mode) { // FIXME: implement } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { [[WebPreferences standardPreferences] setLoadsImagesAutomatically:NO]; } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { [[mainFrame webView] _dispatchPendingLoadRequests]; } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { RetainPtr<CFStringRef> keyCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, key)); NSString *keyNS = (NSString *)keyCF.get(); @@ -657,34 +657,34 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value [[WebPreferences standardPreferences] _setPreferenceForTestWithValue:valueNS forKey:keyNS]; } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { [WebHistory _removeAllVisitedLinks]; } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL) { RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL)); ::setPersistentUserStyleSheetLocation(urlString.get()); } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { ::setPersistentUserStyleSheetLocation(0); } -void LayoutTestController::setWindowIsKey(bool windowIsKey) +void TestRunner::setWindowIsKey(bool windowIsKey) { m_windowIsKey = windowIsKey; [[mainFrame webView] _updateActiveState]; } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { [[mainFrame webView] setSmartInsertDeleteEnabled:flag]; } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { [[mainFrame webView] setSelectTrailingWhitespaceEnabled:flag]; } @@ -693,22 +693,22 @@ static const CFTimeInterval waitToDumpWatchdogInterval = 30.0; static void waitUntilDoneWatchdogFired(CFRunLoopTimerRef timer, void* info) { - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); } -void LayoutTestController::setWaitToDump(bool waitUntilDone) +void TestRunner::setWaitToDump(bool waitUntilDone) { m_waitToDump = waitUntilDone; if (m_waitToDump && shouldSetWaitToDumpWatchdog()) setWaitToDumpWatchdog(CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + waitToDumpWatchdogInterval, 0, 0, 0, waitUntilDoneWatchdogFired, NULL)); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { return CFArrayGetCount(openWindowsRef); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef jsString) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef jsString) { RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, jsString)); NSString *idNS = (NSString *)idCF.get(); @@ -722,7 +722,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef j return false; } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); NSString *nameNS = (NSString *)nameCF.get(); @@ -733,7 +733,7 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) [[mainFrame webView] _executeCoreCommandByName:nameNS value:valueNS]; } -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) { WebFindOptions options = 0; @@ -769,12 +769,12 @@ bool LayoutTestController::findString(JSContextRef context, JSStringRef target, return [[mainFrame webView] findString:(NSString *)targetCFString.get() options:options]; } -void LayoutTestController::setCacheModel(int cacheModel) +void TestRunner::setCacheModel(int cacheModel) { [[WebPreferences standardPreferences] setCacheModel:cacheModel]; } -bool LayoutTestController::isCommandEnabled(JSStringRef name) +bool TestRunner::isCommandEnabled(JSStringRef name) { RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name)); NSString *nameNS = (NSString *)nameCF.get(); @@ -798,7 +798,7 @@ bool LayoutTestController::isCommandEnabled(JSStringRef name) return [validator validateUserInterfaceItem:target.get()]; } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, elementId)); NSString *idNS = (NSString *)idCF.get(); @@ -808,7 +808,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return [mainFrame _pauseAnimation:nameNS onNode:[[mainFrame DOMDocument] getElementById:idNS] atTime:time]; } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, elementId)); NSString *idNS = (NSString *)idCF.get(); @@ -818,19 +818,19 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return [mainFrame _pauseTransitionOfProperty:nameNS onNode:[[mainFrame DOMDocument] getElementById:idNS] atTime:time]; } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { return [mainFrame _numberOfActiveAnimations]; } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setWaitToDump(true); [policyDelegate setControllerToNotifyDone:this]; [[mainFrame webView] setPolicyDelegate:policyDelegate]; } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin)); NSString *sourceOriginNS = (NSString *)sourceOriginCF.get(); @@ -841,7 +841,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi [WebView _addOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains]; } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { RetainPtr<CFStringRef> sourceOriginCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, sourceOrigin)); NSString *sourceOriginNS = (NSString *)sourceOriginCF.get(); @@ -852,46 +852,46 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr [WebView _removeOriginAccessWhitelistEntryWithSourceOrigin:sourceOriginNS destinationProtocol:destinationProtocolNS destinationHost:destinationHostNS allowDestinationSubdomains:allowDestinationSubdomains]; } -void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) +void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) { // FIXME: implement } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::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) injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)]; } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::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 injectedFrames:(allFrames ? WebInjectInAllFrames : WebInjectInTopFrameOnly)]; } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { [[[mainFrame webView] preferences] setDeveloperExtrasEnabled:enabled]; } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool enabled) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool enabled) { [[[mainFrame webView] preferences] setAsynchronousSpellCheckingEnabled:enabled]; } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { [[[mainFrame webView] inspector] show:nil]; } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { [[[mainFrame webView] inspector] close:nil]; } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { RetainPtr<CFStringRef> scriptCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, script)); NSString *scriptNS = (NSString *)scriptCF.get(); @@ -916,12 +916,12 @@ unsigned worldIDForWorld(WebScriptWorld *world) return 0; } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { // FIXME: Implement this. } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { RetainPtr<CFStringRef> scriptCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, script)); NSString *scriptNS = (NSString *)scriptCF.get(); @@ -978,7 +978,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj @end -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; @@ -1005,13 +1005,13 @@ void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, [pool release]; } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { WebView *view = [mainFrame webView]; [view goToBackForwardItem:[[view backForwardList] currentItem]]; } -void LayoutTestController::setWebViewEditable(bool editable) +void TestRunner::setWebViewEditable(bool editable) { WebView *view = [mainFrame webView]; [view setEditable:editable]; @@ -1092,7 +1092,7 @@ static NSString *SynchronousLoaderRunLoopMode = @"DumpRenderTreeSynchronousLoade @end -void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password) +void TestRunner::authenticateSession(JSStringRef url, JSStringRef username, JSStringRef password) { // See <rdar://problem/7880699>. #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 @@ -1106,22 +1106,22 @@ void LayoutTestController::authenticateSession(JSStringRef url, JSStringRef user #endif } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { [NSApp abortModal]; } -void LayoutTestController::setSerializeHTTPLoads(bool serialize) +void TestRunner::setSerializeHTTPLoads(bool serialize) { [WebView _setLoadResourcesSerially:serialize]; } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { [[mainFrame webView] _setMinimumTimerInterval:minimumTimerInterval]; } -void LayoutTestController::setTextDirection(JSStringRef directionName) +void TestRunner::setTextDirection(JSStringRef directionName) { #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 if (JSStringIsEqualToUTF8CString(directionName, "ltr")) @@ -1133,7 +1133,7 @@ void LayoutTestController::setTextDirection(JSStringRef directionName) #endif } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { NSTextField *textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)]; textField.tag = 1; @@ -1144,7 +1144,7 @@ void LayoutTestController::addChromeInputField() [[mainFrame webView] setNextKeyView:textField]; } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { NSView* textField = [[[[mainFrame webView] window] contentView] viewWithTag:1]; if (textField) { @@ -1153,37 +1153,37 @@ void LayoutTestController::removeChromeInputField() } } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { [[[mainFrame webView] window] makeFirstResponder:[mainFrame webView]]; } -void LayoutTestController::setBackingScaleFactor(double backingScaleFactor) +void TestRunner::setBackingScaleFactor(double backingScaleFactor) { [[mainFrame webView] _setCustomBackingScaleFactor:backingScaleFactor]; } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { // FIXME: Implement. } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { // FIXME: Implement. } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { // FIXME: Implement. } -void LayoutTestController::sendWebIntentResponse(JSStringRef) +void TestRunner::sendWebIntentResponse(JSStringRef) { // FIXME: Implement. } -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) { // FIXME: Implement. } diff --git a/Tools/DumpRenderTree/mac/UIDelegate.mm b/Tools/DumpRenderTree/mac/UIDelegate.mm index 840fdc209..dddec7af1 100644 --- a/Tools/DumpRenderTree/mac/UIDelegate.mm +++ b/Tools/DumpRenderTree/mac/UIDelegate.mm @@ -32,7 +32,7 @@ #import "DumpRenderTree.h" #import "DumpRenderTreeDraggingInfo.h" #import "EventSendingController.h" -#import "LayoutTestController.h" +#import "TestRunner.h" #import <WebKit/WebApplicationCache.h> #import <WebKit/WebFramePrivate.h> #import <WebKit/WebHTMLViewPrivate.h> @@ -80,10 +80,10 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webViewRunModal:(WebView *)sender { - gLayoutTestController->setWindowIsKey(false); + gTestRunner->setWindowIsKey(false); [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalWindowWillClose:) name:NSWindowWillCloseNotification object:nil]; [NSApp runModalForWindow:[sender window]]; - gLayoutTestController->setWindowIsKey(true); + gTestRunner->setWindowIsKey(true); } - (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame @@ -111,7 +111,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; if (!done) printf("CONFIRM NAVIGATION: %s\n", [message UTF8String]); - return !gLayoutTestController->shouldStayOnPageAfterHandlingBeforeUnload(); + return !gTestRunner->shouldStayOnPageAfterHandlingBeforeUnload(); } @@ -125,25 +125,25 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webViewFocus:(WebView *)webView { - gLayoutTestController->setWindowIsKey(true); + gTestRunner->setWindowIsKey(true); } - (void)webViewUnfocus:(WebView *)webView { - gLayoutTestController->setWindowIsKey(false); + gTestRunner->setWindowIsKey(false); } - (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request { - if (!gLayoutTestController->canOpenWindows()) + if (!gTestRunner->canOpenWindows()) return nil; // Make sure that waitUntilDone has been called. - ASSERT(gLayoutTestController->waitToDump()); + ASSERT(gTestRunner->waitToDump()); WebView *webView = createWebViewAndOffscreenWindow(); - if (gLayoutTestController->newWindowsCopyBackForwardList()) + if (gTestRunner->newWindowsCopyBackForwardList()) [webView _loadBackForwardListFromOtherView:sender]; return [webView autorelease]; @@ -153,7 +153,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; { NSWindow* window = [sender window]; - if (gLayoutTestController->callCloseOnWebViews()) + if (gTestRunner->callCloseOnWebViews()) [sender close]; [window close]; @@ -161,7 +161,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)sender frame:(WebFrame *)frame exceededDatabaseQuotaForSecurityOrigin:(WebSecurityOrigin *)origin database:(NSString *)databaseIdentifier { - if (!done && gLayoutTestController->dumpDatabaseCallbacks()) { + if (!done && gTestRunner->dumpDatabaseCallbacks()) { printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%s, %s, %i} database:%s\n", [[origin protocol] UTF8String], [[origin host] UTF8String], [origin port], [databaseIdentifier UTF8String]); } @@ -172,7 +172,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)sender exceededApplicationCacheOriginQuotaForSecurityOrigin:(WebSecurityOrigin *)origin totalSpaceNeeded:(NSUInteger)totalSpaceNeeded { - if (!done && gLayoutTestController->dumpApplicationCacheDelegateCallbacks()) { + if (!done && gTestRunner->dumpApplicationCacheDelegateCallbacks()) { // For example, numbers from 30000 - 39999 will output as 30000. // Rounding up or down not really matter for these tests. It's // sufficient to just get a range of 10000 to determine if we were @@ -182,7 +182,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; [[origin protocol] UTF8String], [[origin host] UTF8String], [origin port], truncatedSpaceNeeded); } - if (gLayoutTestController->disallowIncreaseForApplicationCacheQuota()) + if (gTestRunner->disallowIncreaseForApplicationCacheQuota()) return; static const unsigned long long defaultOriginQuota = [WebApplicationCache defaultOriginQuota]; @@ -191,20 +191,20 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)sender setStatusText:(NSString *)text { - if (gLayoutTestController->dumpStatusCallbacks()) + if (gTestRunner->dumpStatusCallbacks()) printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", [text UTF8String]); } - (void)webView:(WebView *)webView decidePolicyForGeolocationRequestFromOrigin:(WebSecurityOrigin *)origin frame:(WebFrame *)frame listener:(id<WebAllowDenyPolicyListener>)listener { - if (!gLayoutTestController->isGeolocationPermissionSet()) { + if (!gTestRunner->isGeolocationPermissionSet()) { if (!m_pendingGeolocationPermissionListeners) m_pendingGeolocationPermissionListeners = [[NSMutableSet set] retain]; [m_pendingGeolocationPermissionListeners addObject:listener]; return; } - if (gLayoutTestController->geolocationPermission()) + if (gTestRunner->geolocationPermission()) [listener allow]; else [listener deny]; @@ -212,7 +212,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)didSetMockGeolocationPermission { - ASSERT(gLayoutTestController->isGeolocationPermissionSet()); + ASSERT(gTestRunner->isGeolocationPermissionSet()); if (m_pendingGeolocationPermissionListeners && !m_timer) m_timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(timerFired) userInfo:0 repeats:NO]; } @@ -227,12 +227,12 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)timerFired { - ASSERT(gLayoutTestController->isGeolocationPermissionSet()); + ASSERT(gTestRunner->isGeolocationPermissionSet()); m_timer = 0; NSEnumerator* enumerator = [m_pendingGeolocationPermissionListeners objectEnumerator]; id<WebAllowDenyPolicyListener> listener; while ((listener = [enumerator nextObject])) { - if (gLayoutTestController->geolocationPermission()) + if (gTestRunner->geolocationPermission()) [listener allow]; else [listener deny]; @@ -260,7 +260,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)webView enterFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener { - if (!gLayoutTestController->hasCustomFullScreenBehavior()) + if (!gTestRunner->hasCustomFullScreenBehavior()) [self performSelector:@selector(enterFullScreenWithListener:) withObject:listener afterDelay:0]; } @@ -272,7 +272,7 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil; - (void)webView:(WebView *)webView exitFullScreenForElement:(DOMElement*)element listener:(NSObject<WebKitFullScreenListener>*)listener { - if (!gLayoutTestController->hasCustomFullScreenBehavior()) + if (!gTestRunner->hasCustomFullScreenBehavior()) [self performSelector:@selector(exitFullScreenWithListener:) withObject:listener afterDelay:0]; } diff --git a/Tools/DumpRenderTree/qt/DumpRenderTree.pro b/Tools/DumpRenderTree/qt/DumpRenderTree.pro index 6cd068ccf..1936f644a 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTree.pro +++ b/Tools/DumpRenderTree/qt/DumpRenderTree.pro @@ -18,7 +18,8 @@ INCLUDEPATH += \ $${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport \ $${ROOT_WEBKIT_DIR}/Source/WTF -QT = core gui network testlib webkit widgets printsupport +QT = core gui network testlib webkit widgets +contains(DEFINES, HAVE_QTPRINTSUPPORT=1): QT += printsupport macx: QT += xml contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig @@ -30,7 +31,7 @@ HEADERS += \ EventSenderQt.h \ TextInputControllerQt.h \ WorkQueueItemQt.h \ - LayoutTestControllerQt.h \ + TestRunnerQt.h \ GCControllerQt.h \ QtInitializeTestFonts.h \ testplugin.h @@ -42,7 +43,7 @@ SOURCES += \ EventSenderQt.cpp \ TextInputControllerQt.cpp \ WorkQueueItemQt.cpp \ - LayoutTestControllerQt.cpp \ + TestRunnerQt.cpp \ GCControllerQt.cpp \ QtInitializeTestFonts.cpp \ testplugin.cpp \ diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp index 8f64e2750..db09ad713 100755 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.cpp @@ -36,7 +36,7 @@ #include "DumpRenderTreeSupportQt.h" #include "EventSenderQt.h" #include "GCControllerQt.h" -#include "LayoutTestControllerQt.h" +#include "TestRunnerQt.h" #include "TextInputControllerQt.h" #include "QtInitializeTestFonts.h" #include "testplugin.h" @@ -57,7 +57,7 @@ #include <QNetworkRequest> #include <QPaintDevice> #include <QPaintEngine> -#ifndef QT_NO_PRINTER +#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT) #include <QPrinter> #endif #include <QProgressBar> @@ -110,7 +110,7 @@ void NetworkAccessManager::sslErrorsEncountered(QNetworkReply* reply, const QLis #endif -#ifndef QT_NO_PRINTER +#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT) class NullPrinter : public QPrinter { public: class NullPaintEngine : public QPaintEngine { @@ -176,7 +176,7 @@ QWebInspector* WebPage::webInspector() void WebPage::resetSettings() { // After each layout test, reset the settings that may have been changed by - // layoutTestController.overridePreference() or similar. + // testRunner.overridePreference() or similar. settings()->resetFontSize(QWebSettings::DefaultFontSize); settings()->resetAttribute(QWebSettings::JavascriptCanOpenWindows); settings()->resetAttribute(QWebSettings::JavascriptEnabled); @@ -194,16 +194,16 @@ void WebPage::resetSettings() settings()->resetAttribute(QWebSettings::CSSGridLayoutEnabled); settings()->resetAttribute(QWebSettings::AcceleratedCompositingEnabled); - m_drt->layoutTestController()->setCaretBrowsingEnabled(false); - m_drt->layoutTestController()->setAuthorAndUserStylesEnabled(true); - m_drt->layoutTestController()->setFrameFlatteningEnabled(false); - m_drt->layoutTestController()->setMockScrollbarsEnabled(false); - m_drt->layoutTestController()->setSmartInsertDeleteEnabled(true); - m_drt->layoutTestController()->setSelectTrailingWhitespaceEnabled(false); - m_drt->layoutTestController()->setDefersLoading(false); + m_drt->testRunner()->setCaretBrowsingEnabled(false); + m_drt->testRunner()->setAuthorAndUserStylesEnabled(true); + m_drt->testRunner()->setFrameFlatteningEnabled(false); + m_drt->testRunner()->setMockScrollbarsEnabled(false); + m_drt->testRunner()->setSmartInsertDeleteEnabled(true); + m_drt->testRunner()->setSelectTrailingWhitespaceEnabled(false); + m_drt->testRunner()->setDefersLoading(false); // globalSettings must be reset explicitly. - m_drt->layoutTestController()->setXSSAuditorEnabled(false); + m_drt->testRunner()->setXSSAuditorEnabled(false); QWebSettings::setMaximumPagesInCache(0); // reset to default settings()->setUserStyleSheetUrl(QUrl()); // reset to default @@ -232,12 +232,12 @@ void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature) { switch (feature) { case Notifications: - if (!m_drt->layoutTestController()->ignoreReqestForPermission()) + if (!m_drt->testRunner()->ignoreReqestForPermission()) setFeaturePermission(frame, feature, PermissionGrantedByUser); break; case Geolocation: - if (m_drt->layoutTestController()->isGeolocationPermissionSet()) - if (m_drt->layoutTestController()->geolocationPermission()) + if (m_drt->testRunner()->isGeolocationPermissionSet()) + if (m_drt->testRunner()->geolocationPermission()) setFeaturePermission(frame, feature, PermissionGrantedByUser); else setFeaturePermission(frame, feature, PermissionDeniedByUser); @@ -265,9 +265,9 @@ void WebPage::permissionSet(QWebPage::Feature feature) switch (feature) { case Geolocation: { - Q_ASSERT(m_drt->layoutTestController()->isGeolocationPermissionSet()); + Q_ASSERT(m_drt->testRunner()->isGeolocationPermissionSet()); foreach (QWebFrame* frame, m_pendingGeolocationRequests) - if (m_drt->layoutTestController()->geolocationPermission()) + if (m_drt->testRunner()->geolocationPermission()) setFeaturePermission(frame, feature, PermissionGrantedByUser); else setFeaturePermission(frame, feature, PermissionDeniedByUser); @@ -330,8 +330,8 @@ bool WebPage::javaScriptPrompt(QWebFrame*, const QString& msg, const QString& de bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type) { - if (m_drt->layoutTestController()->waitForPolicy()) - m_drt->layoutTestController()->notifyDone(); + if (m_drt->testRunner()->waitForPolicy()) + m_drt->testRunner()->notifyDone(); return QWebPage::acceptNavigationRequest(frame, request, type); } @@ -339,7 +339,7 @@ bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& r bool WebPage::supportsExtension(QWebPage::Extension extension) const { if (extension == QWebPage::ErrorPageExtension) - return m_drt->layoutTestController()->shouldHandleErrorPages(); + return m_drt->testRunner()->shouldHandleErrorPages(); return false; } @@ -424,7 +424,7 @@ DumpRenderTree::DumpRenderTree() DumpRenderTreeSupportQt::webPageSetGroupName(m_page, "org.webkit.qt.DumpRenderTree"); m_mainView->setContextMenuPolicy(Qt::NoContextMenu); - m_mainView->resize(QSize(LayoutTestController::maxViewWidth, LayoutTestController::maxViewHeight)); + m_mainView->resize(QSize(TestRunner::maxViewWidth, TestRunner::maxViewHeight)); // clean up cache by resetting quota. qint64 quota = webPage()->settings()->offlineWebApplicationCacheQuota(); @@ -432,7 +432,7 @@ DumpRenderTree::DumpRenderTree() // create our controllers. This has to be done before connectFrame, // as it exports there to the JavaScript DOM window. - m_controller = new LayoutTestController(this); + m_controller = new TestRunner(this); connect(m_controller, SIGNAL(showPage()), this, SLOT(showPage())); connect(m_controller, SIGNAL(hidePage()), this, SLOT(hidePage())); @@ -500,7 +500,7 @@ static void clearHistory(QWebPage* page) void DumpRenderTree::dryRunPrint(QWebFrame* frame) { -#ifndef QT_NO_PRINTER +#if !defined(QT_NO_PRINTER) && HAVE(QTPRINTSUPPORT) NullPrinter printer; frame->print(&printer); #endif @@ -509,7 +509,7 @@ void DumpRenderTree::dryRunPrint(QWebFrame* frame) void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url) { // reset so that any current loads are stopped - // NOTE: that this has to be done before the layoutTestController is + // NOTE: that this has to be done before the testRunner is // reset or we get timeouts for some tests. m_page->blockSignals(true); m_page->triggerAction(QWebPage::Stop); @@ -519,7 +519,7 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url) for (int i = 0; i < knownOrigins.size(); ++i) knownOrigins[i].setDatabaseQuota(databaseDefaultQuota); - // reset the layoutTestController at this point, so that we under no + // reset the testRunner at this point, so that we under no // circumstance dump (stop the waitUntilDone timer) during the reset // of the DRT. m_controller->reset(); @@ -563,7 +563,7 @@ void DumpRenderTree::resetToConsistentStateBeforeTesting(const QUrl& url) QLocale::setDefault(QLocale::c()); - layoutTestController()->setDeveloperExtrasEnabled(true); + testRunner()->setDeveloperExtrasEnabled(true); #ifndef Q_OS_WINCE setlocale(LC_ALL, ""); #endif @@ -599,21 +599,21 @@ void DumpRenderTree::open(const QUrl& url) resetToConsistentStateBeforeTesting(url); if (isWebInspectorTest(m_page->mainFrame()->url())) - layoutTestController()->closeWebInspector(); + testRunner()->closeWebInspector(); if (isWebInspectorTest(url)) - layoutTestController()->showWebInspector(); + testRunner()->showWebInspector(); if (isDumpAsTextTest(url)) - layoutTestController()->dumpAsText(); + testRunner()->dumpAsText(); if (isGlobalHistoryTest(url)) - layoutTestController()->dumpHistoryCallbacks(); + testRunner()->dumpHistoryCallbacks(); // W3C SVG tests expect to be 480x360 bool isW3CTest = url.toString().contains("svg/W3C-SVG-1.1"); - int width = isW3CTest ? 480 : LayoutTestController::maxViewWidth; - int height = isW3CTest ? 360 : LayoutTestController::maxViewHeight; + int width = isW3CTest ? 480 : TestRunner::maxViewWidth; + int height = isW3CTest ? 360 : TestRunner::maxViewHeight; m_mainView->resize(QSize(width, height)); m_page->setPreferredContentsSize(QSize()); m_page->setViewportSize(QSize(width, height)); @@ -876,7 +876,7 @@ QString DumpRenderTree::dumpBackForwardList(QWebPage* page) return result; } -static const char *methodNameStringForFailedTest(LayoutTestController *controller) +static const char *methodNameStringForFailedTest(TestRunner *controller) { const char *errorMessage; if (controller->shouldDumpAsText()) @@ -1010,7 +1010,7 @@ void DumpRenderTree::connectFrame(QWebFrame *frame) { connect(frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(initJSObjects())); connect(frame, SIGNAL(provisionalLoad()), - layoutTestController(), SLOT(provisionalLoad())); + testRunner(), SLOT(provisionalLoad())); } void DumpRenderTree::dumpDatabaseQuota(QWebFrame* frame, const QString& dbName) diff --git a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h index a9cf3cd73..710f17343 100644 --- a/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h +++ b/Tools/DumpRenderTree/qt/DumpRenderTreeQt.h @@ -55,7 +55,7 @@ QT_END_NAMESPACE class QWebFrame; -class LayoutTestController; +class TestRunner; class DumpRenderTreeSupportQt; class EventSender; class TextInputController; @@ -85,7 +85,7 @@ public: void closeRemainingWindows(); void resetToConsistentStateBeforeTesting(const QUrl&); - LayoutTestController *layoutTestController() const { return m_controller; } + TestRunner *testRunner() const { return m_controller; } EventSender *eventSender() const { return m_eventSender; } TextInputController *textInputController() const { return m_textInputController; } QString persistentStoragePath() const { return m_persistentStoragePath; } @@ -138,7 +138,7 @@ private: QString dumpFramesAsText(QWebFrame* frame); QString dumpBackForwardList(QWebPage* page); QString dumpFrameScrollPosition(QWebFrame* frame); - LayoutTestController *m_controller; + TestRunner *m_controller; bool m_dumpPixelsForCurrentTest; QString m_expectedHash; @@ -168,7 +168,7 @@ class NetworkAccessManager : public QNetworkAccessManager { public: NetworkAccessManager(QObject* parent); -private slots: +private Q_SLOTS: #ifndef QT_NO_OPENSSL void sslErrorsEncountered(QNetworkReply*, const QList<QSslError>&); #endif @@ -198,7 +198,7 @@ public: void permissionSet(QWebPage::Feature feature); -public slots: +public Q_SLOTS: bool shouldInterruptJavaScript() { return false; } void requestPermission(QWebFrame* frame, QWebPage::Feature feature); void cancelPermission(QWebFrame* frame, QWebPage::Feature feature); @@ -207,7 +207,7 @@ protected: bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type); bool isTextOutputEnabled() { return m_drt->isTextOutputEnabled(); } -private slots: +private Q_SLOTS: void setViewGeometry(const QRect&); private: diff --git a/Tools/DumpRenderTree/qt/EventSenderQt.h b/Tools/DumpRenderTree/qt/EventSenderQt.h index 4ec6f92bb..1c4db0208 100644 --- a/Tools/DumpRenderTree/qt/EventSenderQt.h +++ b/Tools/DumpRenderTree/qt/EventSenderQt.h @@ -54,7 +54,7 @@ public: virtual bool eventFilter(QObject* watched, QEvent* event); void resetClickCount() { m_clickCount = 0; } -public slots: +public Q_SLOTS: void mouseDown(int button = 0, const QStringList& modifiers = QStringList()); void mouseUp(int button = 0); void mouseMoveTo(int x, int y); diff --git a/Tools/DumpRenderTree/qt/GCControllerQt.h b/Tools/DumpRenderTree/qt/GCControllerQt.h index d3c83b9fe..bcc9f2347 100644 --- a/Tools/DumpRenderTree/qt/GCControllerQt.h +++ b/Tools/DumpRenderTree/qt/GCControllerQt.h @@ -40,7 +40,7 @@ class GCController : public QObject public: GCController(QWebPage* parent); -public slots: +public Q_SLOTS: void collect() const; void collectOnAlternateThread(bool waitUntilDone) const; unsigned int getJSObjectCount() const; diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp index 44d6da6a9..f35fe2614 100644 --- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.cpp +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.cpp @@ -27,10 +27,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" -#include "LayoutTestControllerQt.h" -#include "DumpRenderTreeSupportQt.h" +#include "TestRunnerQt.h" #include "DumpRenderTreeQt.h" +#include "DumpRenderTreeSupportQt.h" #include "WorkQueue.h" #include "WorkQueueItemQt.h" #include <QCoreApplication> @@ -38,7 +38,7 @@ #include <QLocale> #include <qwebsettings.h> -LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt) +TestRunner::TestRunner(WebCore::DumpRenderTree* drt) : QObject() , m_drt(drt) , m_shouldTimeout(true) @@ -48,7 +48,7 @@ LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt) DumpRenderTreeSupportQt::dumpNotification(true); } -void LayoutTestController::reset() +void TestRunner::reset() { m_hasDumped = false; m_loadFinished = false; @@ -99,7 +99,7 @@ void LayoutTestController::reset() emit hidePage(); } -void LayoutTestController::processWork() +void TestRunner::processWork() { // qDebug() << ">>>processWork"; @@ -111,7 +111,7 @@ void LayoutTestController::processWork() } // Called on loadFinished on WebPage -void LayoutTestController::maybeDump(bool /*success*/) +void TestRunner::maybeDump(bool /*success*/) { // This can happen on any of the http/tests/security/window-events-*.html tests, where the test opens @@ -142,7 +142,7 @@ void LayoutTestController::maybeDump(bool /*success*/) } } -void LayoutTestController::waitUntilDone() +void TestRunner::waitUntilDone() { //qDebug() << ">>>>waitForDone"; m_waitForDone = true; @@ -153,12 +153,12 @@ void LayoutTestController::waitUntilDone() m_timeoutTimer.start(m_timeout, this); } -void LayoutTestController::setViewModeMediaFeature(const QString& mode) +void TestRunner::setViewModeMediaFeature(const QString& mode) { m_drt->webPage()->setProperty("_q_viewMode", mode); } -int LayoutTestController::webHistoryItemCount() +int TestRunner::webHistoryItemCount() { if (!m_webHistory) return -1; @@ -168,12 +168,12 @@ int LayoutTestController::webHistoryItemCount() return m_webHistory->count() - 1; } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { m_webHistory = m_drt->webPage()->history(); } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { qDebug() << ">>>>notifyDone"; @@ -197,49 +197,49 @@ void LayoutTestController::notifyDone() m_waitForPolicy = false; } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { return m_drt->windowCount(); } -void LayoutTestController::grantDesktopNotificationPermission(const QString& origin) +void TestRunner::grantDesktopNotificationPermission(const QString& origin) { QWebFrame* frame = m_drt->webPage()->mainFrame(); m_drt->webPage()->setFeaturePermission(frame, QWebPage::Notifications, QWebPage::PermissionGrantedByUser); m_desktopNotificationAllowedOrigins.append(origin); } -void LayoutTestController::ignoreDesktopNotificationPermissionRequests() +void TestRunner::ignoreDesktopNotificationPermissionRequests() { m_ignoreDesktopNotification = true; } -bool LayoutTestController::checkDesktopNotificationPermission(const QString& origin) +bool TestRunner::checkDesktopNotificationPermission(const QString& origin) { return !m_ignoreDesktopNotification && m_desktopNotificationAllowedOrigins.contains(origin); } -void LayoutTestController::simulateDesktopNotificationClick(const QString& title) +void TestRunner::simulateDesktopNotificationClick(const QString& title) { DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title); } -void LayoutTestController::display() +void TestRunner::display() { emit showPage(); } -void LayoutTestController::displayInvalidatedRegion() +void TestRunner::displayInvalidatedRegion() { display(); } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { m_drt->webPage()->history()->clear(); } -QString LayoutTestController::pathToLocalResource(const QString& url) +QString TestRunner::pathToLocalResource(const QString& url) { QString localTmpUrl(QLatin1String("file:///tmp/LayoutTests")); @@ -256,82 +256,82 @@ QString LayoutTestController::pathToLocalResource(const QString& url) return url; } -void LayoutTestController::dumpEditingCallbacks() +void TestRunner::dumpEditingCallbacks() { qDebug() << ">>>dumpEditingCallbacks"; DumpRenderTreeSupportQt::dumpEditingCallbacks(true); } -void LayoutTestController::dumpFrameLoadCallbacks() +void TestRunner::dumpFrameLoadCallbacks() { DumpRenderTreeSupportQt::dumpFrameLoader(true); } -void LayoutTestController::dumpProgressFinishedCallback() +void TestRunner::dumpProgressFinishedCallback() { DumpRenderTreeSupportQt::dumpProgressFinishedCallback(true); } -void LayoutTestController::dumpUserGestureInFrameLoadCallbacks() +void TestRunner::dumpUserGestureInFrameLoadCallbacks() { DumpRenderTreeSupportQt::dumpUserGestureInFrameLoader(true); } -void LayoutTestController::dumpResourceLoadCallbacks() +void TestRunner::dumpResourceLoadCallbacks() { DumpRenderTreeSupportQt::dumpResourceLoadCallbacks(true); } -void LayoutTestController::dumpResourceResponseMIMETypes() +void TestRunner::dumpResourceResponseMIMETypes() { DumpRenderTreeSupportQt::dumpResourceResponseMIMETypes(true); } -void LayoutTestController::dumpWillCacheResponse() +void TestRunner::dumpWillCacheResponse() { DumpRenderTreeSupportQt::dumpWillCacheResponseCallbacks(true); } -void LayoutTestController::dumpHistoryCallbacks() +void TestRunner::dumpHistoryCallbacks() { DumpRenderTreeSupportQt::dumpHistoryCallbacks(true); } -void LayoutTestController::setWillSendRequestReturnsNullOnRedirect(bool enabled) +void TestRunner::setWillSendRequestReturnsNullOnRedirect(bool enabled) { DumpRenderTreeSupportQt::setWillSendRequestReturnsNullOnRedirect(enabled); } -void LayoutTestController::setWillSendRequestReturnsNull(bool enabled) +void TestRunner::setWillSendRequestReturnsNull(bool enabled) { DumpRenderTreeSupportQt::setWillSendRequestReturnsNull(enabled); } -void LayoutTestController::setWillSendRequestClearHeader(const QStringList& headers) +void TestRunner::setWillSendRequestClearHeader(const QStringList& headers) { DumpRenderTreeSupportQt::setWillSendRequestClearHeaders(headers); } -void LayoutTestController::setDeferMainResourceDataLoad(bool defer) +void TestRunner::setDeferMainResourceDataLoad(bool defer) { DumpRenderTreeSupportQt::setDeferMainResourceDataLoad(defer); } -void LayoutTestController::queueBackNavigation(int howFarBackward) +void TestRunner::queueBackNavigation(int howFarBackward) { //qDebug() << ">>>queueBackNavigation" << howFarBackward; for (int i = 0; i != howFarBackward; ++i) WorkQueue::shared()->queue(new BackItem(1, m_drt->webPage())); } -void LayoutTestController::queueForwardNavigation(int howFarForward) +void TestRunner::queueForwardNavigation(int howFarForward) { //qDebug() << ">>>queueForwardNavigation" << howFarForward; 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) +void TestRunner::queueLoad(const QString& url, const QString& target) { //qDebug() << ">>>queueLoad" << url << target; QUrl mainResourceUrl = m_drt->webPage()->mainFrame()->url(); @@ -339,7 +339,7 @@ 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, const QString& failingURL) +void TestRunner::queueLoadHTMLString(const QString& content, const QString& baseURL, const QString& failingURL) { if (failingURL.isEmpty()) WorkQueue::shared()->queue(new LoadHTMLStringItem(content, baseURL, m_drt->webPage())); @@ -347,32 +347,32 @@ void LayoutTestController::queueLoadHTMLString(const QString& content, const QSt WorkQueue::shared()->queue(new LoadAlternateHTMLStringItem(content, baseURL, failingURL, m_drt->webPage())); } -void LayoutTestController::queueReload() +void TestRunner::queueReload() { //qDebug() << ">>>queueReload"; WorkQueue::shared()->queue(new ReloadItem(m_drt->webPage())); } -void LayoutTestController::queueLoadingScript(const QString& script) +void TestRunner::queueLoadingScript(const QString& script) { //qDebug() << ">>>queueLoadingScript" << script; WorkQueue::shared()->queue(new LoadingScriptItem(script, m_drt->webPage())); } -void LayoutTestController::queueNonLoadingScript(const QString& script) +void TestRunner::queueNonLoadingScript(const QString& script) { //qDebug() << ">>>queueNonLoadingScript" << script; WorkQueue::shared()->queue(new NonLoadingScriptItem(script, m_drt->webPage())); } -void LayoutTestController::provisionalLoad() +void TestRunner::provisionalLoad() { QWebFrame* frame = qobject_cast<QWebFrame*>(sender()); if (!m_topLoadingFrame && !m_hasDumped) m_topLoadingFrame = frame; } -void LayoutTestController::timerEvent(QTimerEvent *ev) +void TestRunner::timerEvent(QTimerEvent *ev) { if (ev->timerId() == m_timeoutTimer.timerId()) { const char* message = "FAIL: Timed out waiting for notifyDone to be called\n"; @@ -383,144 +383,144 @@ void LayoutTestController::timerEvent(QTimerEvent *ev) QObject::timerEvent(ev); } -QString LayoutTestController::encodeHostName(const QString& host) +QString TestRunner::encodeHostName(const QString& host) { QString encoded = QString::fromLatin1(QUrl::toAce(host + QLatin1String(".no"))); encoded.truncate(encoded.length() - 3); // strip .no return encoded; } -QString LayoutTestController::decodeHostName(const QString& host) +QString TestRunner::decodeHostName(const QString& host) { QString decoded = QUrl::fromAce(host.toLatin1() + QByteArray(".no")); decoded.truncate(decoded.length() - 3); return decoded; } -void LayoutTestController::setMediaType(const QString& type) +void TestRunner::setMediaType(const QString& type) { DumpRenderTreeSupportQt::setMediaType(m_drt->webPage()->mainFrame(), type); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { DumpRenderTreeSupportQt::webInspectorClose(m_drt->webPage()); m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, false); } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, enabled); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { m_drt->webPage()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); DumpRenderTreeSupportQt::webInspectorShow(m_drt->webPage()); } -void LayoutTestController::evaluateInWebInspector(long callId, const QString& script) +void TestRunner::evaluateInWebInspector(long callId, const QString& script) { DumpRenderTreeSupportQt::webInspectorExecuteScript(m_drt->webPage(), callId, script); } -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) +void TestRunner::setFrameFlatteningEnabled(bool enabled) { DumpRenderTreeSupportQt::setFrameFlatteningEnabled(m_drt->webPage(), enabled); } -void LayoutTestController::setMockScrollbarsEnabled(bool enabled) +void TestRunner::setMockScrollbarsEnabled(bool enabled) { DumpRenderTreeSupportQt::setMockScrollbarsEnabled(m_drt->webPage(), enabled); } -void LayoutTestController::goBack() +void TestRunner::goBack() { DumpRenderTreeSupportQt::goBack(m_drt->webPage()); } -void LayoutTestController::setDefersLoading(bool flag) +void TestRunner::setDefersLoading(bool flag) { DumpRenderTreeSupportQt::setDefersLoading(m_drt->webPage(), flag); } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, enabled); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { m_drt->webPage()->settings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, enabled); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long quota) +void TestRunner::setAppCacheMaximumSize(unsigned long long quota) { m_drt->webPage()->settings()->setOfflineWebApplicationCacheQuota(quota); } -void LayoutTestController::setAutofilled(const QWebElement& element, bool isAutofilled) +void TestRunner::setAutofilled(const QWebElement& element, bool isAutofilled) { return DumpRenderTreeSupportQt::setAutofilled(element, isAutofilled); } -void LayoutTestController::setValueForUser(const QWebElement& element, const QString& value) +void TestRunner::setValueForUser(const QWebElement& element, const QString& value) { DumpRenderTreeSupportQt::setValueForUser(element, value); } -void LayoutTestController::setFixedContentsSize(int width, int height) +void TestRunner::setFixedContentsSize(int width, int height) { m_topLoadingFrame->page()->setPreferredContentsSize(QSize(width, height)); } -void LayoutTestController::setPrivateBrowsingEnabled(bool enable) +void TestRunner::setPrivateBrowsingEnabled(bool enable) { m_drt->webPage()->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, enable); } -void LayoutTestController::setSpatialNavigationEnabled(bool enable) +void TestRunner::setSpatialNavigationEnabled(bool enable) { m_drt->webPage()->settings()->setAttribute(QWebSettings::SpatialNavigationEnabled, enable); } -void LayoutTestController::setPopupBlockingEnabled(bool enable) +void TestRunner::setPopupBlockingEnabled(bool enable) { m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, !enable); } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { // FIXME: Implement } -void LayoutTestController::setPOSIXLocale(const QString& locale) +void TestRunner::setPOSIXLocale(const QString& locale) { QLocale qlocale(locale); QLocale::setDefault(qlocale); } -void LayoutTestController::setWindowIsKey(bool isKey) +void TestRunner::setWindowIsKey(bool isKey) { m_drt->switchFocus(isKey); } -void LayoutTestController::setMainFrameIsFirstResponder(bool isFirst) +void TestRunner::setMainFrameIsFirstResponder(bool isFirst) { //FIXME: only need this for the moment: https://bugs.webkit.org/show_bug.cgi?id=32990 } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enable) +void TestRunner::setJavaScriptCanAccessClipboard(bool enable) { m_drt->webPage()->settings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, enable); } -void LayoutTestController::setXSSAuditorEnabled(bool enable) +void TestRunner::setXSSAuditorEnabled(bool enable) { // 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. @@ -530,7 +530,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool enable) m_drt->webPage()->settings()->setAttribute(QWebSettings::XSSAuditingEnabled, enable); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& animationName, +bool TestRunner::pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId) { @@ -539,7 +539,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(const QString& an return DumpRenderTreeSupportQt::pauseAnimation(frame, animationName, time, elementId); } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& propertyName, +bool TestRunner::pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId) { @@ -548,59 +548,59 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(const QString& p return DumpRenderTreeSupportQt::pauseTransitionOfProperty(frame, propertyName, time, elementId); } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { QWebFrame* frame = m_drt->webPage()->mainFrame(); Q_ASSERT(frame); return DumpRenderTreeSupportQt::numberOfActiveAnimations(frame); } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { m_drt->webPage()->settings()->setAttribute(QWebSettings::AutoLoadImages, false); } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { // FIXME: Implement for testing fix for 6727495 } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { DumpRenderTreeSupportQt::clearAllApplicationCaches(); } -void LayoutTestController::clearApplicationCacheForOrigin(const QString& url) +void TestRunner::clearApplicationCacheForOrigin(const QString& url) { // FIXME: Implement to support deleting all application caches for an origin. } -long long LayoutTestController::localStorageDiskUsageForOrigin(const QString& originIdentifier) +long long TestRunner::localStorageDiskUsageForOrigin(const QString& originIdentifier) { // FIXME: Implement to support getting disk usage in bytes for an origin. return 0; } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { if (!m_topLoadingFrame) return; m_topLoadingFrame->securityOrigin().setApplicationCacheQuota(quota); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(const QString& origin) +long long TestRunner::applicationCacheDiskUsageForOrigin(const QString& origin) { // FIXME: Implement to support getting disk usage by all application caches for an origin. return 0; } -QStringList LayoutTestController::originsWithApplicationCache() +QStringList TestRunner::originsWithApplicationCache() { // FIXME: Implement to get origins that have application caches. return QStringList(); } -void LayoutTestController::setCacheModel(int model) +void TestRunner::setCacheModel(int model) { // qwebsetting doesn't have matched setting yet : // WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER @@ -610,41 +610,41 @@ void LayoutTestController::setCacheModel(int model) // FIXME: Implement. } -void LayoutTestController::setDatabaseQuota(int size) +void TestRunner::setDatabaseQuota(int size) { if (!m_topLoadingFrame) return; m_topLoadingFrame->securityOrigin().setDatabaseQuota(size); } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { QWebDatabase::removeAllDatabases(); } -void LayoutTestController::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) { DumpRenderTreeSupportQt::whiteListAccessFromOrigin(sourceOrigin, destinationProtocol, destinationHost, allowDestinationSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains) +void TestRunner::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) +void TestRunner::setCustomPolicyDelegate(bool enabled, bool permissive) { DumpRenderTreeSupportQt::setCustomPolicyDelegate(enabled, permissive); } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { setCustomPolicyDelegate(true); m_waitForPolicy = true; waitUntilDone(); } -void LayoutTestController::overridePreference(const QString& name, const QVariant& value) +void TestRunner::overridePreference(const QString& name, const QVariant& value) { QWebSettings* settings = m_topLoadingFrame->page()->settings(); @@ -673,11 +673,11 @@ void LayoutTestController::overridePreference(const QString& name, const QVarian else if (name == "WebKitAcceleratedCompositingEnabled") settings->setAttribute(QWebSettings::AcceleratedCompositingEnabled, value.toBool()); else - printf("ERROR: LayoutTestController::overridePreference() does not support the '%s' preference\n", + printf("ERROR: TestRunner::overridePreference() does not support the '%s' preference\n", name.toLatin1().data()); } -void LayoutTestController::setUserStyleSheetLocation(const QString& url) +void TestRunner::setUserStyleSheetLocation(const QString& url) { QByteArray urlData = pathToLocalResource(url).toLatin1(); m_userStyleSheetLocation = QUrl::fromEncoded(urlData, QUrl::StrictMode); @@ -686,17 +686,17 @@ void LayoutTestController::setUserStyleSheetLocation(const QString& url) setUserStyleSheetEnabled(true); } -void LayoutTestController::setCaretBrowsingEnabled(bool value) +void TestRunner::setCaretBrowsingEnabled(bool value) { DumpRenderTreeSupportQt::setCaretBrowsingEnabled(m_drt->webPage(), value); } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool value) +void TestRunner::setAuthorAndUserStylesEnabled(bool value) { DumpRenderTreeSupportQt::setAuthorAndUserStylesEnabled(m_drt->webPage(), value); } -void LayoutTestController::setUserStyleSheetEnabled(bool enabled) +void TestRunner::setUserStyleSheetEnabled(bool enabled) { m_userStyleSheetEnabled = enabled; @@ -706,27 +706,27 @@ void LayoutTestController::setUserStyleSheetEnabled(bool enabled) m_drt->webPage()->settings()->setUserStyleSheetUrl(QUrl()); } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme) { DumpRenderTreeSupportQt::setDomainRelaxationForbiddenForURLScheme(forbidden, scheme); } -int LayoutTestController::workerThreadCount() +int TestRunner::workerThreadCount() { return DumpRenderTreeSupportQt::workerThreadCount(); } -int LayoutTestController::numberOfPages(float width, float height) +int TestRunner::numberOfPages(float width, float height) { return DumpRenderTreeSupportQt::numberOfPages(m_drt->webPage()->mainFrame(), width, height); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { return DumpRenderTreeSupportQt::shouldClose(m_drt->webPage()->mainFrame()); } -void LayoutTestController::setScrollbarPolicy(const QString& orientation, const QString& policy) +void TestRunner::setScrollbarPolicy(const QString& orientation, const QString& policy) { Qt::Orientation o; Qt::ScrollBarPolicy p; @@ -750,52 +750,52 @@ void LayoutTestController::setScrollbarPolicy(const QString& orientation, const m_drt->webPage()->mainFrame()->setScrollBarPolicy(o, p); } -void LayoutTestController::setSmartInsertDeleteEnabled(bool enable) +void TestRunner::setSmartInsertDeleteEnabled(bool enable) { DumpRenderTreeSupportQt::setSmartInsertDeleteEnabled(m_drt->webPage(), enable); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool enable) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool enable) { DumpRenderTreeSupportQt::setSelectTrailingWhitespaceEnabled(m_drt->webPage(), enable); } -void LayoutTestController::execCommand(const QString& name, const QString& value) +void TestRunner::execCommand(const QString& name, const QString& value) { DumpRenderTreeSupportQt::executeCoreCommandByName(m_drt->webPage(), name, value); } -bool LayoutTestController::isCommandEnabled(const QString& name) const +bool TestRunner::isCommandEnabled(const QString& name) const { return DumpRenderTreeSupportQt::isCommandEnabled(m_drt->webPage(), name); } -bool LayoutTestController::findString(const QString& string, const QStringList& optionArray) +bool TestRunner::findString(const QString& string, const QStringList& optionArray) { return DumpRenderTreeSupportQt::findString(m_drt->webPage(), string, optionArray); } -QString LayoutTestController::markerTextForListItem(const QWebElement& listItem) +QString TestRunner::markerTextForListItem(const QWebElement& listItem) { return DumpRenderTreeSupportQt::markerTextForListItem(listItem); } -QVariantMap LayoutTestController::computedStyleIncludingVisitedInfo(const QWebElement& element) const +QVariantMap TestRunner::computedStyleIncludingVisitedInfo(const QWebElement& element) const { return DumpRenderTreeSupportQt::computedStyleIncludingVisitedInfo(element); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(const QString& elementId) +bool TestRunner::elementDoesAutoCompleteForElementWithId(const QString& elementId) { return DumpRenderTreeSupportQt::elementDoesAutoCompleteForElementWithId(m_drt->webPage()->mainFrame(), elementId); } -void LayoutTestController::authenticateSession(const QString&, const QString&, const QString&) +void TestRunner::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) +void TestRunner::setIconDatabaseEnabled(bool enable) { if (enable && !m_drt->persistentStoragePath().isEmpty()) QWebSettings::setIconDatabasePath(m_drt->persistentStoragePath()); @@ -803,14 +803,14 @@ void LayoutTestController::setIconDatabaseEnabled(bool enable) QWebSettings::setIconDatabasePath(QString()); } -void LayoutTestController::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +void TestRunner::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) { QList<WebCore::WebPage*> pages = m_drt->getAllPages(); foreach (WebCore::WebPage* page, pages) DumpRenderTreeSupportQt::setMockDeviceOrientation(page, canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma); } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { setGeolocationPermissionCommon(allow); QList<WebCore::WebPage*> pages = m_drt->getAllPages(); @@ -818,7 +818,7 @@ void LayoutTestController::setGeolocationPermission(bool allow) DumpRenderTreeSupportQt::setMockGeolocationPermission(page, allow); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { int pendingPermissionCount = 0; QList<WebCore::WebPage*> pages = m_drt->getAllPages(); @@ -828,133 +828,133 @@ int LayoutTestController::numberOfPendingGeolocationPermissionRequests() return pendingPermissionCount; } -void LayoutTestController::setGeolocationPermissionCommon(bool allow) +void TestRunner::setGeolocationPermissionCommon(bool allow) { m_isGeolocationPermissionSet = true; m_geolocationPermission = allow; } -void LayoutTestController::setMockGeolocationError(int code, const QString& message) +void TestRunner::setMockGeolocationError(int code, const QString& message) { QList<WebCore::WebPage*> pages = m_drt->getAllPages(); foreach (WebCore::WebPage* page, pages) DumpRenderTreeSupportQt::setMockGeolocationError(page, code, message); } -void LayoutTestController::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { QList<WebCore::WebPage*> pages = m_drt->getAllPages(); foreach (WebCore::WebPage* page, pages) DumpRenderTreeSupportQt::setMockGeolocationPosition(page, latitude, longitude, accuracy); } -void LayoutTestController::addMockSpeechInputResult(const QString& result, double confidence, const QString& language) +void TestRunner::addMockSpeechInputResult(const QString& result, double confidence, const QString& language) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) +void TestRunner::setMockSpeechInputDumpRect(bool flag) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::startSpeechInput(const QString& inputElement) +void TestRunner::startSpeechInput(const QString& inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(int worldID, const QString& script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(int worldID, const QString& script) { // FIXME: Implement. } -void LayoutTestController::evaluateScriptInIsolatedWorld(int worldID, const QString& script) +void TestRunner::evaluateScriptInIsolatedWorld(int worldID, const QString& script) { DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(m_drt->webPage()->mainFrame(), worldID, script); } -QString LayoutTestController::pageSizeAndMarginsInPixels(int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) +QString TestRunner::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) +QString TestRunner::pageProperty(const QString& propertyName, int pageNumber) { return DumpRenderTreeSupportQt::pageProperty(m_drt->webPage()->mainFrame(), propertyName, pageNumber); } -void LayoutTestController::addUserStyleSheet(const QString& sourceCode) +void TestRunner::addUserStyleSheet(const QString& sourceCode) { DumpRenderTreeSupportQt::addUserStyleSheet(m_drt->webPage(), sourceCode); } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { QWebHistory* history = m_drt->webPage()->history(); history->clear(); DumpRenderTreeSupportQt::dumpVisitedLinksCallbacks(true); } -void LayoutTestController::addURLToRedirect(const QString& origin, const QString& destination) +void TestRunner::addURLToRedirect(const QString& origin, const QString& destination) { DumpRenderTreeSupportQt::addURLToRedirect(origin, destination); } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { DumpRenderTreeSupportQt::setMinimumTimerInterval(m_drt->webPage(), minimumTimerInterval); } -void LayoutTestController::originsWithLocalStorage() +void TestRunner::originsWithLocalStorage() { // FIXME: Implement. } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { // FIXME: Implement. } -void LayoutTestController::deleteLocalStorageForOrigin(const QString& originIdentifier) +void TestRunner::deleteLocalStorageForOrigin(const QString& originIdentifier) { // FIXME: Implement. } -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) +void TestRunner::observeStorageTrackerNotifications(unsigned number) { // FIXME: Implement. } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { // FIXME: Implement. } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { // FIXME: Implement this. } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { // FIXME: Implement this. } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { // FIXME: Implement this. } -QString LayoutTestController::layerTreeAsText() +QString TestRunner::layerTreeAsText() { return DumpRenderTreeSupportQt::layerTreeAsText(m_drt->webPage()->mainFrame()); } -void LayoutTestController::setTextDirection(const QString& directionName) +void TestRunner::setTextDirection(const QString& directionName) { if (directionName == "auto") m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionDefault); @@ -964,7 +964,7 @@ void LayoutTestController::setTextDirection(const QString& directionName) m_drt->webPage()->triggerAction(QWebPage::SetTextDirectionLeftToRight); } -void LayoutTestController::setAlwaysAcceptCookies(bool accept) +void TestRunner::setAlwaysAcceptCookies(bool accept) { QWebSettings* globalSettings = QWebSettings::globalSettings(); if (accept) @@ -975,7 +975,7 @@ void LayoutTestController::setAlwaysAcceptCookies(bool accept) } } -void LayoutTestController::setAlwaysBlockCookies(bool block) +void TestRunner::setAlwaysBlockCookies(bool block) { QWebSettings* globalSettings = QWebSettings::globalSettings(); if (block) @@ -984,5 +984,5 @@ void LayoutTestController::setAlwaysBlockCookies(bool block) globalSettings->setThirdPartyCookiePolicy(QWebSettings::AlwaysAllowThirdPartyCookies); } -const unsigned LayoutTestController::maxViewWidth = 800; -const unsigned LayoutTestController::maxViewHeight = 600; +const unsigned TestRunner::maxViewWidth = 800; +const unsigned TestRunner::maxViewHeight = 600; diff --git a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h b/Tools/DumpRenderTree/qt/TestRunnerQt.h index 6626f8471..52d512ca0 100644 --- a/Tools/DumpRenderTree/qt/LayoutTestControllerQt.h +++ b/Tools/DumpRenderTree/qt/TestRunnerQt.h @@ -27,17 +27,17 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef LayoutTestControllerQt_h -#define LayoutTestControllerQt_h +#ifndef TestRunnerQt_h +#define TestRunnerQt_h #include <QBasicTimer> #include <QObject> #include <QSize> #include <QString> -#include <QtDebug> #include <QTimer> #include <QTimerEvent> #include <QVariant> +#include <QtDebug> #include <qwebdatabase.h> #include <qwebelement.h> @@ -49,15 +49,16 @@ class QWebFrame; class DumpRenderTreeSupportQt; namespace WebCore { - class DumpRenderTree; +class DumpRenderTree; } -class LayoutTestController : public QObject { + +class TestRunner : public QObject { Q_OBJECT Q_PROPERTY(int webHistoryItemCount READ webHistoryItemCount) Q_PROPERTY(int workerThreadCount READ workerThreadCount) Q_PROPERTY(bool globalFlag READ globalFlag WRITE setGlobalFlag) public: - LayoutTestController(WebCore::DumpRenderTree* drt); + TestRunner(WebCore::DumpRenderTree*); bool shouldDisallowIncreaseForApplicationCacheQuota() const { return m_disallowIncreaseForApplicationCacheQuota; } bool shouldDumpAsText() const { return m_textDump; } @@ -86,14 +87,14 @@ public: protected: void timerEvent(QTimerEvent*); -signals: +Q_SIGNALS: void done(); void showPage(); void hidePage(); void geolocationPermissionSet(); -public slots: +public Q_SLOTS: void maybeDump(bool ok); void disallowIncreaseForApplicationCacheQuota() { m_disallowIncreaseForApplicationCacheQuota = true; } void dumpAsText() { m_textDump = true; } @@ -131,7 +132,7 @@ public slots: void queueLoadingScript(const QString& script); void queueNonLoadingScript(const QString& script); void provisionalLoad(); - void setCloseRemainingWindowsWhenComplete(bool = false) {} + void setCloseRemainingWindowsWhenComplete(bool = false) { } int windowCount(); void grantDesktopNotificationPermission(const QString& origin); void ignoreDesktopNotificationPermissionRequests(); @@ -144,41 +145,41 @@ public slots: void dumpTitleChanges() { m_dumpTitleChanges = true; } QString encodeHostName(const QString& host); QString decodeHostName(const QString& host); - void dumpSelectionRect() const {} + void dumpSelectionRect() const { } void setDeveloperExtrasEnabled(bool); void setAsynchronousSpellCheckingEnabled(bool); void showWebInspector(); void closeWebInspector(); void evaluateInWebInspector(long callId, const QString& script); void removeAllVisitedLinks(); - void setMediaType(const QString& type); - void setFrameFlatteningEnabled(bool enable); - void setMockScrollbarsEnabled(bool enable); + void setMediaType(const QString&); + void setFrameFlatteningEnabled(bool); + void setMockScrollbarsEnabled(bool); void setAllowUniversalAccessFromFileURLs(bool enable); void setAllowFileAccessFromFileURLs(bool enable); void setAppCacheMaximumSize(unsigned long long quota); void setAutofilled(const QWebElement&, bool enable); void setValueForUser(const QWebElement&, const QString& value); void setFixedContentsSize(int width, int height); - void setPrivateBrowsingEnabled(bool enable); - void setSpatialNavigationEnabled(bool enabled); + void setPrivateBrowsingEnabled(bool); + void setSpatialNavigationEnabled(bool); void setPluginsEnabled(bool flag); - void setPopupBlockingEnabled(bool enable); + void setPopupBlockingEnabled(bool); void setPOSIXLocale(const QString& locale); void resetLoadFinished() { m_loadFinished = false; } - void setWindowIsKey(bool isKey); - void setMainFrameIsFirstResponder(bool isFirst); + void setWindowIsKey(bool); + void setMainFrameIsFirstResponder(bool); void setDeferMainResourceDataLoad(bool); void setJavaScriptCanAccessClipboard(bool enable); - void setXSSAuditorEnabled(bool enable); - void setCaretBrowsingEnabled(bool enable); + void setXSSAuditorEnabled(bool); + void setCaretBrowsingEnabled(bool); void setAuthorAndUserStylesEnabled(bool); void setViewModeMediaFeature(const QString& mode); - void setSmartInsertDeleteEnabled(bool enable); - void setSelectTrailingWhitespaceEnabled(bool enable); + void setSmartInsertDeleteEnabled(bool); + void setSelectTrailingWhitespaceEnabled(bool); void execCommand(const QString& name, const QString& value = QString()); bool isCommandEnabled(const QString& name) const; - bool findString(const QString& string, const QStringList& optionArray); + bool findString(const QString&, const QStringList& optionArray); bool pauseAnimationAtTimeOnElementWithId(const QString& animationName, double time, const QString& elementId); bool pauseTransitionAtTimeOnElementWithId(const QString& propertyName, double time, const QString& elementId); @@ -194,32 +195,32 @@ public slots: void clearAllApplicationCaches(); void clearApplicationCacheForOrigin(const QString& url); - void setApplicationCacheOriginQuota(unsigned long long quota); + void setApplicationCacheOriginQuota(unsigned long long); QStringList originsWithApplicationCache(); long long applicationCacheDiskUsageForOrigin(const QString&); void setCacheModel(int); void setDatabaseQuota(int size); void clearAllDatabases(); - void setIconDatabaseEnabled(bool enable); + void setIconDatabaseEnabled(bool); void setCustomPolicyDelegate(bool enabled, bool permissive = false); void waitForPolicyDelegate(); void overridePreference(const QString& name, const QVariant& value); void setUserStyleSheetLocation(const QString& url); - void setUserStyleSheetEnabled(bool enabled); + void setUserStyleSheetEnabled(bool); void setDomainRelaxationForbiddenForURLScheme(bool forbidden, const QString& scheme); int workerThreadCount(); 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() {} + 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 addDisallowedURL(const QString&) { } void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma); @@ -239,8 +240,8 @@ public slots: void setAutomaticLinkDetectionEnabled(bool); - // Empty stub method to keep parity with object model exposed by global LayoutTestController. - void abortModal() {} + // Empty stub method to keep parity with object model exposed by global TestRunner. + void abortModal() { } void addURLToRedirect(const QString& origin, const QString& destination); @@ -251,7 +252,7 @@ public slots: void setScrollbarPolicy(const QString& orientation, const QString& policy); QString markerTextForListItem(const QWebElement& listItem); - QVariantMap computedStyleIncludingVisitedInfo(const QWebElement& element) const; + QVariantMap computedStyleIncludingVisitedInfo(const QWebElement&) 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); @@ -277,7 +278,7 @@ public slots: void setAlwaysAcceptCookies(bool); void setAlwaysBlockCookies(bool); -private slots: +private Q_SLOTS: void processWork(); private: @@ -317,4 +318,4 @@ private: int m_timeout; }; -#endif // LayoutTestControllerQt_h +#endif // TestRunnerQt_h diff --git a/Tools/DumpRenderTree/qt/TextInputControllerQt.h b/Tools/DumpRenderTree/qt/TextInputControllerQt.h index 572abfd7c..294027340 100644 --- a/Tools/DumpRenderTree/qt/TextInputControllerQt.h +++ b/Tools/DumpRenderTree/qt/TextInputControllerQt.h @@ -40,7 +40,7 @@ class TextInputController : public QObject { public: TextInputController(QWebPage* parent); -public slots: +public Q_SLOTS: void doCommand(const QString& command); void setMarkedText(const QString& string, int start, int end); // bool hasMarkedText(); diff --git a/Tools/DumpRenderTree/qt/main.cpp b/Tools/DumpRenderTree/qt/main.cpp index 410ac7c35..0d37ee819 100644 --- a/Tools/DumpRenderTree/qt/main.cpp +++ b/Tools/DumpRenderTree/qt/main.cpp @@ -119,6 +119,7 @@ int main(int argc, char* argv[]) QApplication::setGraphicsSystem("raster"); QApplication::setStyle(new QWindowsStyle); + QApplication::setDesktopSettingsAware(false); QApplication app(argc, argv); app.setQuitOnLastWindowClosed(false); diff --git a/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp b/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp index 830afd3c4..a7bfc6d44 100644 --- a/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp +++ b/Tools/DumpRenderTree/win/DRTDesktopNotificationPresenter.cpp @@ -32,7 +32,7 @@ #include "DRTDesktopNotificationPresenter.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <JavaScriptCore/JSStringRef.h> #include <JavaScriptCore/JSStringRefBSTR.h> #include <WebCore/NotificationClient.h> @@ -125,7 +125,7 @@ HRESULT STDMETHODCALLTYPE DRTDesktopNotificationPresenter::checkNotificationPerm { #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) JSStringRef jsOrigin = JSStringCreateWithBSTR(origin); - bool allowed = ::gLayoutTestController->checkDesktopNotificationPermission(jsOrigin); + bool allowed = ::gTestRunner->checkDesktopNotificationPermission(jsOrigin); if (allowed) *result = WebCore::NotificationClient::PermissionAllowed; diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.cpp b/Tools/DumpRenderTree/win/DumpRenderTree.cpp index 312430d56..ad1726dc9 100644 --- a/Tools/DumpRenderTree/win/DumpRenderTree.cpp +++ b/Tools/DumpRenderTree/win/DumpRenderTree.cpp @@ -32,10 +32,10 @@ #include "EditingDelegate.h" #include "FrameLoadDelegate.h" #include "HistoryDelegate.h" -#include "LayoutTestController.h" #include "PixelDumpSupport.h" #include "PolicyDelegate.h" #include "ResourceLoadDelegate.h" +#include "TestRunner.h" #include "UIDelegate.h" #include "WebCoreTestSupport.h" #include "WorkQueueItem.h" @@ -105,7 +105,7 @@ COMPtr<HistoryDelegate> sharedHistoryDelegate; IWebFrame* frame; HWND webViewWindow; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; UINT_PTR waitToDumpWatchdog = 0; @@ -424,7 +424,7 @@ void dumpFrameScrollPosition(IWebFrame* frame) printf("scrolled to %.f,%.f\n", (double)scrollPosition.cx, (double)scrollPosition.cy); } - if (::gLayoutTestController->dumpChildFrameScrollPositions()) { + if (::gTestRunner->dumpChildFrameScrollPositions()) { COMPtr<IEnumVARIANT> enumKids; if (FAILED(frame->childFrames(&enumKids))) return; @@ -481,7 +481,7 @@ static wstring dumpFramesAsText(IWebFrame* frame) SysFreeString(innerText); - if (::gLayoutTestController->dumpChildFramesAsText()) { + if (::gTestRunner->dumpChildFramesAsText()) { COMPtr<IEnumVARIANT> enumKids; if (FAILED(frame->childFrames(&enumKids))) return L""; @@ -713,8 +713,8 @@ void dump() if (SUCCEEDED(dataSource->response(&response)) && response) { BSTR mimeType; if (SUCCEEDED(response->MIMEType(&mimeType)) && !_tcscmp(mimeType, TEXT("text/plain"))) { - ::gLayoutTestController->setDumpAsText(true); - ::gLayoutTestController->setGeneratePixelResults(false); + ::gTestRunner->setDumpAsText(true); + ::gTestRunner->setGeneratePixelResults(false); } SysFreeString(mimeType); } @@ -726,18 +726,18 @@ void dump() ::InvalidateRect(webViewWindow, 0, TRUE); ::SendMessage(webViewWindow, WM_PAINT, 0, 0); - if (::gLayoutTestController->dumpAsText()) { + if (::gTestRunner->dumpAsText()) { wstring result = dumpFramesAsText(frame); resultString = SysAllocStringLen(result.data(), result.size()); } else { COMPtr<IWebFramePrivate> framePrivate; if (FAILED(frame->QueryInterface(&framePrivate))) goto fail; - framePrivate->renderTreeAsExternalRepresentation(gLayoutTestController->isPrinting(), &resultString); + framePrivate->renderTreeAsExternalRepresentation(gTestRunner->isPrinting(), &resultString); } if (!resultString) - printf("ERROR: nil result from %s", ::gLayoutTestController->dumpAsText() ? "IDOMElement::innerText" : "IFrameViewPrivate::renderTreeAsExternalRepresentation"); + printf("ERROR: nil result from %s", ::gTestRunner->dumpAsText() ? "IDOMElement::innerText" : "IFrameViewPrivate::renderTreeAsExternalRepresentation"); else { unsigned stringLength = SysStringLen(resultString); int bufferSize = ::WideCharToMultiByte(CP_UTF8, 0, resultString, stringLength, 0, 0, 0, 0); @@ -745,10 +745,10 @@ void dump() ::WideCharToMultiByte(CP_UTF8, 0, resultString, stringLength, buffer, bufferSize + 1, 0, 0); fwrite(buffer, 1, bufferSize, stdout); free(buffer); - if (!::gLayoutTestController->dumpAsText()) + if (!::gTestRunner->dumpAsText()) dumpFrameScrollPosition(frame); } - if (::gLayoutTestController->dumpBackForwardList()) + if (::gTestRunner->dumpBackForwardList()) dumpBackForwardListForAllWindows(); } @@ -760,10 +760,10 @@ void dump() } if (dumpPixelsForCurrentTest - && gLayoutTestController->generatePixelResults() - && !gLayoutTestController->dumpDOMAsWebArchive() - && !gLayoutTestController->dumpSourceAsWebArchive()) - dumpWebViewAsPixelsAndCompareWithExpected(gLayoutTestController->expectedPixelHash()); + && gTestRunner->generatePixelResults() + && !gTestRunner->dumpDOMAsWebArchive() + && !gTestRunner->dumpSourceAsWebArchive()) + dumpWebViewAsPixelsAndCompareWithExpected(gTestRunner->expectedPixelHash()); printf("#EOF\n"); // terminate the (possibly empty) pixels block fflush(stdout); @@ -893,7 +893,7 @@ static void resetWebViewToConsistentStateBeforeTesting() if (SUCCEEDED(webView->preferences(&preferences))) resetDefaultsToConsistentValues(preferences.get()); - if (gLayoutTestController) { + if (gTestRunner) { JSGlobalContextRef context = frame->globalContext(); WebCoreTestSupport::resetInternalsObject(context); } @@ -934,15 +934,15 @@ static void resetWebViewToConsistentStateBeforeTesting() static void sizeWebViewForCurrentTest() { - bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg\\W3C-SVG-1.1") != string::npos); + bool isSVGW3CTest = (gTestRunner->testPathOrURL().find("svg\\W3C-SVG-1.1") != string::npos); unsigned width; unsigned height; if (isSVGW3CTest) { width = 480; height = 360; } else { - width = LayoutTestController::maxViewWidth; - height = LayoutTestController::maxViewHeight; + width = TestRunner::maxViewWidth; + height = TestRunner::maxViewHeight; } ::SetWindowPos(webViewWindow, 0, 0, 0, width, height, SWP_NOMOVE); @@ -977,22 +977,22 @@ static void runTest(const string& inputLine) CFRelease(url); - ::gLayoutTestController = LayoutTestController::create(pathOrURL, command.expectedPixelHash); + ::gTestRunner = TestRunner::create(pathOrURL, command.expectedPixelHash); done = false; topLoadingFrame = 0; sizeWebViewForCurrentTest(); - gLayoutTestController->setIconDatabaseEnabled(false); + gTestRunner->setIconDatabaseEnabled(false); if (shouldLogFrameLoadDelegates(pathOrURL.c_str())) - gLayoutTestController->setDumpFrameLoadCallbacks(true); + gTestRunner->setDumpFrameLoadCallbacks(true); COMPtr<IWebView> webView; if (SUCCEEDED(frame->webView(&webView))) { COMPtr<IWebViewPrivate> viewPrivate; if (SUCCEEDED(webView->QueryInterface(&viewPrivate))) { if (shouldLogHistoryDelegates(pathOrURL.c_str())) { - gLayoutTestController->setDumpHistoryDelegateCallbacks(true); + gTestRunner->setDumpHistoryDelegateCallbacks(true); viewPrivate->setHistoryDelegate(sharedHistoryDelegate.get()); } else viewPrivate->setHistoryDelegate(0); @@ -1005,13 +1005,13 @@ static void runTest(const string& inputLine) resetWebViewToConsistentStateBeforeTesting(); if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { - gLayoutTestController->setDeveloperExtrasEnabled(true); + gTestRunner->setDeveloperExtrasEnabled(true); if (shouldOpenWebInspector(pathOrURL.c_str())) - gLayoutTestController->showWebInspector(); + gTestRunner->showWebInspector(); } if (shouldDumpAsText(pathOrURL.c_str())) { - gLayoutTestController->setDumpAsText(true); - gLayoutTestController->setGeneratePixelResults(false); + gTestRunner->setDumpAsText(true); + gTestRunner->setGeneratePixelResults(false); } prevTestBFItem = 0; @@ -1049,15 +1049,15 @@ static void runTest(const string& inputLine) } if (shouldEnableDeveloperExtras(pathOrURL.c_str())) { - gLayoutTestController->closeWebInspector(); - gLayoutTestController->setDeveloperExtrasEnabled(false); + gTestRunner->closeWebInspector(); + gTestRunner->setDeveloperExtrasEnabled(false); } resetWebViewToConsistentStateBeforeTesting(); frame->stopLoading(); - if (::gLayoutTestController->closeRemainingWindowsWhenComplete()) { + if (::gTestRunner->closeRemainingWindowsWhenComplete()) { Vector<HWND> windows = openWindows(); unsigned size = windows.size(); for (unsigned i = 0; i < size; i++) { @@ -1073,7 +1073,7 @@ static void runTest(const string& inputLine) exit: SysFreeString(urlBStr); - ::gLayoutTestController.clear(); + ::gTestRunner.clear(); return; } @@ -1197,8 +1197,8 @@ WindowToWebViewMap& windowToWebViewMap() IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow) { - unsigned maxViewWidth = LayoutTestController::maxViewWidth; - unsigned maxViewHeight = LayoutTestController::maxViewHeight; + unsigned maxViewWidth = TestRunner::maxViewWidth; + unsigned maxViewHeight = TestRunner::maxViewHeight; HWND hostWindow = CreateWindowEx(WS_EX_TOOLWINDOW, kDumpRenderTreeClassName, TEXT("DumpRenderTree"), WS_POPUP, -maxViewWidth, -maxViewHeight, maxViewWidth, maxViewHeight, 0, 0, GetModuleHandle(0), 0); diff --git a/Tools/DumpRenderTree/win/DumpRenderTree.vcproj b/Tools/DumpRenderTree/win/DumpRenderTree.vcproj index 7e242a1cd..cde6d5b0b 100644 --- a/Tools/DumpRenderTree/win/DumpRenderTree.vcproj +++ b/Tools/DumpRenderTree/win/DumpRenderTree.vcproj @@ -438,15 +438,15 @@ > </File> <File - RelativePath="..\LayoutTestController.cpp" + RelativePath="..\TestRunner.cpp" > </File> <File - RelativePath="..\LayoutTestController.h" + RelativePath="..\TestRunner.h" > </File> <File - RelativePath=".\LayoutTestControllerWin.cpp" + RelativePath=".\TestRunnerWin.cpp" > </File> <File diff --git a/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj b/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj index 72050b14b..de8a1db62 100644 --- a/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj +++ b/Tools/DumpRenderTree/win/DumpRenderTreeLauncher.vcproj @@ -50,6 +50,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -111,6 +112,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -172,6 +174,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -233,6 +236,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -295,6 +299,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" @@ -356,6 +361,7 @@ /> <Tool Name="VCLinkerTool" + AdditionalOptions="/SAFESEH" /> <Tool Name="VCALinkTool" diff --git a/Tools/DumpRenderTree/win/EditingDelegate.cpp b/Tools/DumpRenderTree/win/EditingDelegate.cpp index d08db1430..0975c54d4 100644 --- a/Tools/DumpRenderTree/win/EditingDelegate.cpp +++ b/Tools/DumpRenderTree/win/EditingDelegate.cpp @@ -30,7 +30,7 @@ #include "EditingDelegate.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <WebCore/COMPtr.h> #include <wtf/Assertions.h> #include <wtf/Platform.h> @@ -128,7 +128,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldBeginEditingInDOMRange( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldBeginEditingInDOMRange:%s\n"), dump(range)); *result = m_acceptsEditing; @@ -145,7 +145,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldEndEditingInDOMRange( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldEndEditingInDOMRange:%s\n"), dump(range)); *result = m_acceptsEditing; @@ -164,7 +164,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldInsertNode( TEXT("WebViewInsertActionDropped"), }; - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldInsertNode:%s replacingDOMRange:%s givenAction:%s\n"), dumpPath(node), dump(range), insertactionstring[action]); return S_OK; @@ -188,7 +188,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldInsertText( TEXT("WebViewInsertActionDropped"), }; - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldInsertText:%s replacingDOMRange:%s givenAction:%s\n"), text ? text : TEXT(""), dump(range), insertactionstring[action]); *result = m_acceptsEditing; @@ -205,7 +205,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldDeleteDOMRange( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldDeleteDOMRange:%s\n"), dump(range)); *result = m_acceptsEditing; @@ -234,7 +234,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldChangeSelectedDOMRange( TEXT("TRUE") }; - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldChangeSelectedDOMRange:%s toDOMRange:%s affinity:%s stillSelecting:%s\n"), dump(currentRange), dump(proposedRange), affinitystring[selectionAffinity], boolstring[stillSelecting]); *result = m_acceptsEditing; @@ -252,7 +252,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldApplyStyle( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldApplyStyle:%s toElementsInDOMRange:%s\n"), TEXT("'style description'")/*[[style description] UTF8String]*/, dump(range)); *result = m_acceptsEditing; @@ -270,7 +270,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::shouldChangeTypingStyle( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: shouldChangeTypingStyle:%s toStyle:%s\n"), TEXT("'currentStyle description'"), TEXT("'proposedStyle description'")); *result = m_acceptsEditing; @@ -287,7 +287,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::doPlatformCommand( return E_POINTER; } - if (::gLayoutTestController->dumpEditingCallbacks() && !done) + if (::gTestRunner->dumpEditingCallbacks() && !done) _tprintf(TEXT("EDITING DELEGATE: doPlatformCommand:%s\n"), command ? command : TEXT("")); *result = m_acceptsEditing; @@ -297,7 +297,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::doPlatformCommand( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidBeginEditing( /* [in] */ IWebNotification* notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidBeginEditing:%s\n"), name ? name : TEXT("")); @@ -309,7 +309,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidBeginEditing( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChange( /* [in] */ IWebNotification *notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidBeginEditing:%s\n"), name ? name : TEXT("")); @@ -321,7 +321,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChange( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidEndEditing( /* [in] */ IWebNotification *notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidEndEditing:%s\n"), name ? name : TEXT("")); @@ -333,7 +333,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidEndEditing( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeTypingStyle( /* [in] */ IWebNotification *notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidChangeTypingStyle:%s\n"), name ? name : TEXT("")); @@ -345,7 +345,7 @@ HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeTypingStyle( HRESULT STDMETHODCALLTYPE EditingDelegate::webViewDidChangeSelection( /* [in] */ IWebNotification *notification) { - if (::gLayoutTestController->dumpEditingCallbacks() && !done) { + if (::gTestRunner->dumpEditingCallbacks() && !done) { BSTR name; notification->name(&name); _tprintf(TEXT("EDITING DELEGATE: webViewDidChangeSelection:%s\n"), name ? name : TEXT("")); diff --git a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp index dcf5da18c..28d1317a6 100644 --- a/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp +++ b/Tools/DumpRenderTree/win/FrameLoadDelegate.cpp @@ -34,7 +34,7 @@ #include "DumpRenderTree.h" #include "EventSender.h" #include "GCController.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "TextInputController.h" #include "WebCoreTestSupport.h" #include "WorkQueueItem.h" @@ -122,7 +122,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didStartProvisionalLoadForFrame( /* [in] */ IWebView* webView, /* [in] */ IWebFrame* frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didStartProvisionalLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); // Make sure we only set this once per test. If it gets cleared, and then set again, we might @@ -137,7 +137,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didReceiveServerRedirectForProvisio /* [in] */ IWebView *webView, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didReceiveServerRedirectForProvisionalLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); return S_OK; @@ -148,7 +148,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFailProvisionalLoadWithError( /* [in] */ IWebError *error, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFailProvisionalLoadWithError\n", descriptionSuitableForTestResult(frame).c_str()); locationChangeDone(error, frame); @@ -159,7 +159,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didCommitLoadForFrame( /* [in] */ IWebView *webView, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didCommitLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); COMPtr<IWebViewPrivate> webViewPrivate; @@ -176,10 +176,10 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didReceiveTitle( /* [in] */ BSTR title, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didReceiveTitle: %S\n", descriptionSuitableForTestResult(frame).c_str(), title); - if (::gLayoutTestController->dumpTitleChanges() && !done) + if (::gTestRunner->dumpTitleChanges() && !done) printf("TITLE CHANGED: %S\n", title ? title : L""); return S_OK; } @@ -188,7 +188,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didChangeIcons( /* [in] */ IWebView* webView, /* [in] */ IWebFrame* frame) { - if (!done && gLayoutTestController->dumpIconChanges()) + if (!done && gTestRunner->dumpIconChanges()) printf("%s - didChangeIcons\n", descriptionSuitableForTestResult(frame).c_str()); return S_OK; @@ -201,7 +201,7 @@ void FrameLoadDelegate::processWork() return; // if we finish all the commands, we're ready to dump state - if (WorkQueue::shared()->processWork() && !::gLayoutTestController->waitToDump()) + if (WorkQueue::shared()->processWork() && !::gTestRunner->waitToDump()) dump(); } @@ -240,7 +240,7 @@ void FrameLoadDelegate::locationChangeDone(IWebError*, IWebFrame* frame) topLoadingFrame = 0; WorkQueue::shared()->setFrozen(true); - if (::gLayoutTestController->waitToDump()) + if (::gTestRunner->waitToDump()) return; if (WorkQueue::shared()->count()) { @@ -257,7 +257,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFinishLoadForFrame( /* [in] */ IWebView* webView, /* [in] */ IWebFrame* frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); locationChangeDone(0, frame); @@ -269,7 +269,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFailLoadWithError( /* [in] */ IWebError* error, /* [in] */ IWebFrame* frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFailLoadWithError\n", descriptionSuitableForTestResult(frame).c_str()); locationChangeDone(error, frame); @@ -283,7 +283,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::willPerformClientRedirectToURL( /* [in] */ DATE fireDate, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - willPerformClientRedirectToURL: %S \n", descriptionSuitableForTestResult(frame).c_str(), urlSuitableForTestResult(std::wstring(url, ::SysStringLen(url))).c_str()); @@ -294,7 +294,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didCancelClientRedirectForFrame( /* [in] */ IWebView *webView, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didCancelClientRedirectForFrame\n", descriptionSuitableForTestResult(frame).c_str()); return S_OK; @@ -360,7 +360,7 @@ void FrameLoadDelegate::didClearWindowObjectForFrameInStandardWorld(IWebFrame* f JSValueRef exception = 0; - ::gLayoutTestController->makeWindowObject(context, windowObject, &exception); + ::gTestRunner->makeWindowObject(context, windowObject, &exception); ASSERT(!exception); m_gcController->makeWindowObject(context, windowObject, &exception); @@ -384,7 +384,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFinishDocumentLoadForFrame( /* [in] */ IWebView *sender, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didFinishDocumentLoadForFrame\n", descriptionSuitableForTestResult(frame).c_str()); if (!done) { @@ -408,7 +408,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didHandleOnloadEventsForFrame( /* [in] */ IWebView *sender, /* [in] */ IWebFrame *frame) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("%s - didHandleOnloadEventsForFrame\n", descriptionSuitableForTestResult(frame).c_str()); @@ -425,7 +425,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didFirstVisuallyNonEmptyLayoutInFra HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didDisplayInsecureContent( /* [in] */ IWebView *sender) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didDisplayInsecureContent\n"); return S_OK; @@ -435,7 +435,7 @@ HRESULT STDMETHODCALLTYPE FrameLoadDelegate::didRunInsecureContent( /* [in] */ IWebView *sender, /* [in] */ IWebSecurityOrigin *origin) { - if (!done && gLayoutTestController->dumpFrameLoadCallbacks()) + if (!done && gTestRunner->dumpFrameLoadCallbacks()) printf("didRunInsecureContent\n"); return S_OK; diff --git a/Tools/DumpRenderTree/win/HistoryDelegate.cpp b/Tools/DumpRenderTree/win/HistoryDelegate.cpp index 8a41facfc..ab92b0928 100644 --- a/Tools/DumpRenderTree/win/HistoryDelegate.cpp +++ b/Tools/DumpRenderTree/win/HistoryDelegate.cpp @@ -28,7 +28,7 @@ #include "DumpRenderTree.h" #include "DumpRenderTreeWin.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <string> #include <WebKit/WebKit.h> @@ -80,7 +80,7 @@ ULONG HistoryDelegate::Release(void) // IWebHistoryDelegate HRESULT HistoryDelegate::didNavigateWithNavigationData(IWebView* webView, IWebNavigationData* navigationData, IWebFrame* webFrame) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; BSTR urlBSTR; @@ -151,7 +151,7 @@ HRESULT HistoryDelegate::didNavigateWithNavigationData(IWebView* webView, IWebNa HRESULT HistoryDelegate::didPerformClientRedirectFromURL(IWebView*, BSTR sourceURL, BSTR destinationURL, IWebFrame*) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; wstring source; @@ -168,7 +168,7 @@ HRESULT HistoryDelegate::didPerformClientRedirectFromURL(IWebView*, BSTR sourceU HRESULT HistoryDelegate::didPerformServerRedirectFromURL(IWebView* webView, BSTR sourceURL, BSTR destinationURL, IWebFrame* webFrame) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; wstring source; @@ -185,7 +185,7 @@ HRESULT HistoryDelegate::didPerformServerRedirectFromURL(IWebView* webView, BSTR HRESULT HistoryDelegate::updateHistoryTitle(IWebView* webView, BSTR titleBSTR, BSTR urlBSTR) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; wstring url; @@ -202,7 +202,7 @@ HRESULT HistoryDelegate::updateHistoryTitle(IWebView* webView, BSTR titleBSTR, B HRESULT HistoryDelegate::populateVisitedLinksForWebView(IWebView* webView) { - if (!gLayoutTestController->dumpHistoryDelegateCallbacks()) + if (!gTestRunner->dumpHistoryDelegateCallbacks()) return S_OK; BSTR urlBSTR; @@ -214,7 +214,7 @@ HRESULT HistoryDelegate::populateVisitedLinksForWebView(IWebView* webView) url = urlSuitableForTestResult(wstringFromBSTR(urlBSTR)); SysFreeString(urlBSTR); - if (gLayoutTestController->dumpVisitedLinksCallback()) + if (gTestRunner->dumpVisitedLinksCallback()) printf("Asked to populate visited links for WebView \"%S\"\n", url.c_str()); return S_OK; diff --git a/Tools/DumpRenderTree/win/PolicyDelegate.cpp b/Tools/DumpRenderTree/win/PolicyDelegate.cpp index 7d87c4539..5d7177e53 100644 --- a/Tools/DumpRenderTree/win/PolicyDelegate.cpp +++ b/Tools/DumpRenderTree/win/PolicyDelegate.cpp @@ -30,7 +30,7 @@ #include "PolicyDelegate.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <string> using std::wstring; diff --git a/Tools/DumpRenderTree/win/PolicyDelegate.h b/Tools/DumpRenderTree/win/PolicyDelegate.h index c808dc9c4..b6036fead 100644 --- a/Tools/DumpRenderTree/win/PolicyDelegate.h +++ b/Tools/DumpRenderTree/win/PolicyDelegate.h @@ -31,7 +31,7 @@ #include <WebKit/WebKit.h> -class LayoutTestController; +class TestRunner; class PolicyDelegate : public IWebPolicyDelegate { public: @@ -71,12 +71,12 @@ public: // PolicyDelegate void setPermissive(bool permissive) { m_permissiveDelegate = permissive; } - void setControllerToNotifyDone(LayoutTestController* controller) { m_controllerToNotifyDone = controller; } + void setControllerToNotifyDone(TestRunner* controller) { m_controllerToNotifyDone = controller; } private: ULONG m_refCount; bool m_permissiveDelegate; - LayoutTestController* m_controllerToNotifyDone; + TestRunner* m_controllerToNotifyDone; }; #endif // PolicyDelegate_h diff --git a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp index 26b722a4e..90b9ae0fc 100644 --- a/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp +++ b/Tools/DumpRenderTree/win/ResourceLoadDelegate.cpp @@ -30,7 +30,7 @@ #include "ResourceLoadDelegate.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include <WebKit/WebKitCOMAPI.h> #include <comutil.h> #include <sstream> @@ -209,7 +209,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::identifierForInitialRequest( /* [in] */ IWebDataSource* dataSource, /* [in] */ unsigned long identifier) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { BSTR urlStr; if (FAILED(request->URL(&urlStr))) return E_FAIL; @@ -238,26 +238,26 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest( /* [in] */ IWebDataSource* dataSource, /* [retval][out] */ IWebURLRequest **newRequest) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { printf("%S - willSendRequest %S redirectResponse %S\n", descriptionSuitableForTestResult(identifier).c_str(), descriptionSuitableForTestResult(request).c_str(), descriptionSuitableForTestResult(redirectResponse).c_str()); } - if (!done && !gLayoutTestController->deferMainResourceDataLoad()) { + if (!done && !gTestRunner->deferMainResourceDataLoad()) { COMPtr<IWebDataSourcePrivate> dataSourcePrivate(Query, dataSource); if (!dataSourcePrivate) return E_FAIL; dataSourcePrivate->setDeferMainResourceDataLoad(FALSE); } - if (!done && gLayoutTestController->willSendRequestReturnsNull()) { + if (!done && gTestRunner->willSendRequestReturnsNull()) { *newRequest = 0; return S_OK; } - if (!done && gLayoutTestController->willSendRequestReturnsNullOnRedirect() && redirectResponse) { + if (!done && gTestRunner->willSendRequestReturnsNullOnRedirect() && redirectResponse) { printf("Returning null for this redirect\n"); *newRequest = 0; return S_OK; @@ -265,7 +265,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::willSendRequest( IWebMutableURLRequest* requestCopy = 0; request->mutableCopy(&requestCopy); - const set<string>& clearHeaders = gLayoutTestController->willSendRequestClearHeaders(); + const set<string>& clearHeaders = gTestRunner->willSendRequestClearHeaders(); for (set<string>::const_iterator header = clearHeaders.begin(); header != clearHeaders.end(); ++header) { BSTR bstrHeader = BSTRFromString(*header); requestCopy->setValue(0, bstrHeader); @@ -286,14 +286,14 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didReceiveAuthenticationChalleng if (!challenge || FAILED(challenge->sender(&sender))) return E_FAIL; - if (!gLayoutTestController->handlesAuthenticationChallenges()) { + if (!gTestRunner->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(); + const char* user = gTestRunner->authenticationUsername().c_str(); + const char* password = gTestRunner->authenticationPassword().c_str(); printf("%S - didReceiveAuthenticationChallenge - Responding with %s:%s\n", descriptionSuitableForTestResult(identifier).c_str(), user, password); @@ -312,12 +312,12 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didReceiveResponse( /* [in] */ IWebURLResponse* response, /* [in] */ IWebDataSource* dataSource) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { printf("%S - didReceiveResponse %S\n", descriptionSuitableForTestResult(identifier).c_str(), descriptionSuitableForTestResult(response).c_str()); } - if (!done && gLayoutTestController->dumpResourceResponseMIMETypes()) { + if (!done && gTestRunner->dumpResourceResponseMIMETypes()) { BSTR mimeTypeBSTR; if (FAILED(response->MIMEType(&mimeTypeBSTR))) E_FAIL; @@ -344,7 +344,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFinishLoadingFromDataSource( /* [in] */ unsigned long identifier, /* [in] */ IWebDataSource* dataSource) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { printf("%S - didFinishLoading\n", descriptionSuitableForTestResult(identifier).c_str()); } @@ -360,7 +360,7 @@ HRESULT STDMETHODCALLTYPE ResourceLoadDelegate::didFailLoadingWithError( /* [in] */ IWebError* error, /* [in] */ IWebDataSource* dataSource) { - if (!done && gLayoutTestController->dumpResourceLoadCallbacks()) { + if (!done && gTestRunner->dumpResourceLoadCallbacks()) { printf("%S - didFailLoadingWithError: %S\n", descriptionSuitableForTestResult(identifier).c_str(), descriptionSuitableForTestResult(error, identifier).c_str()); diff --git a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/Tools/DumpRenderTree/win/TestRunnerWin.cpp index ffc3d26dc..a2c15e30d 100644 --- a/Tools/DumpRenderTree/win/LayoutTestControllerWin.cpp +++ b/Tools/DumpRenderTree/win/TestRunnerWin.cpp @@ -27,7 +27,7 @@ */ #include "config.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "DumpRenderTree.h" #include "EditingDelegate.h" @@ -42,8 +42,8 @@ #include <WebKit/WebKit.h> #include <WebKit/WebKitCOMAPI.h> #include <comutil.h> -#include <shlwapi.h> #include <shlguid.h> +#include <shlwapi.h> #include <shobjidl.h> #include <string> #include <wtf/Assertions.h> @@ -56,7 +56,7 @@ using std::wstring; static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath); -LayoutTestController::~LayoutTestController() +TestRunner::~TestRunner() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -79,12 +79,12 @@ LayoutTestController::~LayoutTestController() editingDelegate->setAcceptsEditing(TRUE); } -void LayoutTestController::addDisallowedURL(JSStringRef url) +void TestRunner::addDisallowedURL(JSStringRef url) { // FIXME: Implement! } -void LayoutTestController::clearBackForwardList() +void TestRunner::clearBackForwardList() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -110,7 +110,7 @@ void LayoutTestController::clearBackForwardList() backForwardList->goToItem(item.get()); } -bool LayoutTestController::callShouldCloseOnWebView() +bool TestRunner::callShouldCloseOnWebView() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -125,19 +125,19 @@ bool LayoutTestController::callShouldCloseOnWebView() return result; } -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) { // FIXME: Implement! return 0; } -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) { // FIXME: Implement! return 0; } -void LayoutTestController::disableImageLoading() +void TestRunner::disableImageLoading() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -150,17 +150,17 @@ void LayoutTestController::disableImageLoading() preferences->setLoadsImagesAutomatically(FALSE); } -void LayoutTestController::dispatchPendingLoadRequests() +void TestRunner::dispatchPendingLoadRequests() { // FIXME: Implement for testing fix for 6727495 } -void LayoutTestController::display() +void TestRunner::display() { displayWebView(); } -void LayoutTestController::keepWebHistory() +void TestRunner::keepWebHistory() { COMPtr<IWebHistory> history; if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast<void**>(&history)))) @@ -173,13 +173,13 @@ void LayoutTestController::keepWebHistory() history->setOptionalSharedHistory(sharedHistory.get()); } -JSValueRef LayoutTestController::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef context, JSValueRef value) { // FIXME: Implement this. return JSValueMakeUndefined(context); } -JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -194,7 +194,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::layerTreeAsText() const return textValueJS; } -JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -221,7 +221,7 @@ JSRetainPtr<JSStringRef> LayoutTestController::markerTextForListItem(JSContextRe return markerText; } -void LayoutTestController::waitForPolicyDelegate() +void TestRunner::waitForPolicyDelegate() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -232,7 +232,7 @@ void LayoutTestController::waitForPolicyDelegate() webView->setPolicyDelegate(policyDelegate); } -size_t LayoutTestController::webHistoryItemCount() +size_t TestRunner::webHistoryItemCount() { COMPtr<IWebHistory> history; if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast<void**>(&history)))) @@ -253,7 +253,7 @@ size_t LayoutTestController::webHistoryItemCount() return count; } -unsigned LayoutTestController::workerThreadCount() const +unsigned TestRunner::workerThreadCount() const { COMPtr<IWebWorkersPrivate> workers; if (FAILED(WebKitCreateInstance(CLSID_WebWorkersPrivate, 0, __uuidof(workers), reinterpret_cast<void**>(&workers)))) @@ -264,13 +264,13 @@ unsigned LayoutTestController::workerThreadCount() const return count; } -JSRetainPtr<JSStringRef> LayoutTestController::platformName() const +JSRetainPtr<JSStringRef> TestRunner::platformName() const { JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("win")); return platformName; } -void LayoutTestController::notifyDone() +void TestRunner::notifyDone() { // Same as on mac. This can be shared. if (m_waitToDump && !topLoadingFrame && !WorkQueue::shared()->count()) @@ -278,7 +278,7 @@ void LayoutTestController::notifyDone() m_waitToDump = false; } -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url) +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url) { wstring input(JSStringGetCharactersPtr(url), JSStringGetLength(url)); @@ -301,7 +301,7 @@ static wstring jsStringRefToWString(JSStringRef jsStr) return buffer.data(); } -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) { COMPtr<IWebDataSource> dataSource; if (FAILED(frame->dataSource(&dataSource))) @@ -329,7 +329,7 @@ void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) WorkQueue::shared()->queue(new LoadItem(jsAbsoluteURL.get(), target)); } -void LayoutTestController::setAcceptsEditing(bool acceptsEditing) +void TestRunner::setAcceptsEditing(bool acceptsEditing) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -347,7 +347,7 @@ void LayoutTestController::setAcceptsEditing(bool acceptsEditing) editingDelegate->setAcceptsEditing(acceptsEditing); } -void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) { if (alwaysAcceptCookies == m_alwaysAcceptCookies) return; @@ -357,7 +357,7 @@ void LayoutTestController::setAlwaysAcceptCookies(bool alwaysAcceptCookies) m_alwaysAcceptCookies = alwaysAcceptCookies; } -void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -374,7 +374,7 @@ void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) prefsPrivate->setAuthorAndUserStylesEnabled(flag); } -void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) +void TestRunner::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -395,7 +395,7 @@ void LayoutTestController::setAutofilled(JSContextRef context, JSValueRef nodeOb autofillElement->setAutofilled(autofilled); } -void LayoutTestController::setCustomPolicyDelegate(bool setDelegate, bool permissive) +void TestRunner::setCustomPolicyDelegate(bool setDelegate, bool permissive) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -408,55 +408,55 @@ 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) +void TestRunner::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) +void TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. } -void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) +void TestRunner::setMockGeolocationError(int code, JSStringRef message) { // FIXME: Implement for Geolocation layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=28264. } -void LayoutTestController::setGeolocationPermission(bool allow) +void TestRunner::setGeolocationPermission(bool allow) { // FIXME: Implement for Geolocation layout tests. setGeolocationPermissionCommon(allow); } -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() +int TestRunner::numberOfPendingGeolocationPermissionRequests() { // FIXME: Implement for Geolocation layout tests. return -1; } -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) +void TestRunner::setMockSpeechInputDumpRect(bool flag) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::startSpeechInput(JSContextRef inputElement) +void TestRunner::startSpeechInput(JSContextRef inputElement) { // FIXME: Implement for speech input layout tests. // See https://bugs.webkit.org/show_bug.cgi?id=39485. } -void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) +void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled) { // See also <rdar://problem/6480108> COMPtr<IWebIconDatabase> iconDatabase; @@ -469,12 +469,12 @@ void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) iconDatabase->setEnabled(iconDatabaseEnabled); } -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) +void TestRunner::setMainFrameIsFirstResponder(bool flag) { // FIXME: Implement! } -void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) +void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -487,7 +487,7 @@ void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled preferences->setPrivateBrowsingEnabled(privateBrowsingEnabled); } -void LayoutTestController::setXSSAuditorEnabled(bool enabled) +void TestRunner::setXSSAuditorEnabled(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -504,7 +504,7 @@ void LayoutTestController::setXSSAuditorEnabled(bool enabled) prefsPrivate->setXSSAuditorEnabled(enabled); } -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) +void TestRunner::setFrameFlatteningEnabled(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -521,12 +521,12 @@ void LayoutTestController::setFrameFlatteningEnabled(bool enabled) prefsPrivate->setFrameFlatteningEnabled(enabled); } -void LayoutTestController::setSpatialNavigationEnabled(bool enabled) +void TestRunner::setSpatialNavigationEnabled(bool enabled) { // FIXME: Implement for SpatialNavigation layout tests. } -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -543,7 +543,7 @@ void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) prefsPrivate->setAllowUniversalAccessFromFileURLs(enabled); } -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -560,7 +560,7 @@ void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) prefsPrivate->setAllowFileAccessFromFileURLs(enabled); } -void LayoutTestController::setPopupBlockingEnabled(bool enabled) +void TestRunner::setPopupBlockingEnabled(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -573,12 +573,12 @@ void LayoutTestController::setPopupBlockingEnabled(bool enabled) preferences->setJavaScriptCanOpenWindowsAutomatically(!enabled); } -void LayoutTestController::setPluginsEnabled(bool flag) +void TestRunner::setPluginsEnabled(bool flag) { // FIXME: Implement } -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) +void TestRunner::setJavaScriptCanAccessClipboard(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -595,7 +595,7 @@ void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) prefsPrivate->setJavaScriptCanAccessClipboard(enabled); } -void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle) +void TestRunner::setTabKeyCyclesThroughElements(bool shouldCycle) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -608,12 +608,12 @@ void LayoutTestController::setTabKeyCyclesThroughElements(bool shouldCycle) viewPrivate->setTabKeyCyclesThroughElements(shouldCycle ? TRUE : FALSE); } -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) +void TestRunner::setUseDashboardCompatibilityMode(bool flag) { // FIXME: Implement! } -void LayoutTestController::setUserStyleSheetEnabled(bool flag) +void TestRunner::setUserStyleSheetEnabled(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -623,7 +623,7 @@ void LayoutTestController::setUserStyleSheetEnabled(bool flag) if (FAILED(webView->preferences(&preferences))) return; - preferences->setUserStyleSheetEnabled(flag); + preferences->setUserStyleSheetEnabled(flag); } bool appendComponentToPath(wstring& path, const wstring& component) @@ -681,7 +681,7 @@ static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath) { wstring fileProtocol = L"file://"; bool isFileProtocol = cygwinPath.find(fileProtocol) != string::npos; - if (cygwinPath[isFileProtocol ? 7 : 0] != '/') // ensure path is absolute + if (cygwinPath[isFileProtocol ? 7 : 0] != '/') // ensure path is absolute return false; // Get the Root path. @@ -733,7 +733,7 @@ static bool resolveCygwinPath(const wstring& cygwinPath, wstring& windowsPath) return true; } -void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL) +void TestRunner::setUserStyleSheetLocation(JSStringRef jsURL) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -777,7 +777,7 @@ void LayoutTestController::setUserStyleSheetLocation(JSStringRef jsURL) SysFreeString(resultPathBSTR); } -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) +void TestRunner::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -800,23 +800,23 @@ void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef elem domInputElement->setValueForUser(valueBSTR); } -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) +void TestRunner::setViewModeMediaFeature(JSStringRef mode) { // FIXME: implement } -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL) { RetainPtr<CFStringRef> urlString(AdoptCF, JSStringCopyCFString(0, jsURL)); ::setPersistentUserStyleSheetLocation(urlString.get()); } -void LayoutTestController::clearPersistentUserStyleSheet() +void TestRunner::clearPersistentUserStyleSheet() { ::setPersistentUserStyleSheetLocation(0); } -void LayoutTestController::setWindowIsKey(bool flag) +void TestRunner::setWindowIsKey(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -833,7 +833,7 @@ void LayoutTestController::setWindowIsKey(bool flag) ::SendMessage(webViewWindow, flag ? WM_SETFOCUS : WM_KILLFOCUS, (WPARAM)::GetDesktopWindow(), 0); } -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) +void TestRunner::setSmartInsertDeleteEnabled(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -846,7 +846,7 @@ void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) viewEditing->setSmartInsertDeleteEnabled(flag ? TRUE : FALSE); } -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -863,22 +863,22 @@ static const CFTimeInterval waitToDumpWatchdogInterval = 30.0; static void CALLBACK waitUntilDoneWatchdogFired(HWND, UINT, UINT_PTR, DWORD) { - gLayoutTestController->waitToDumpWatchdogTimerFired(); + gTestRunner->waitToDumpWatchdogTimerFired(); } -void LayoutTestController::setWaitToDump(bool waitUntilDone) +void TestRunner::setWaitToDump(bool waitUntilDone) { m_waitToDump = waitUntilDone; if (m_waitToDump && !waitToDumpWatchdog) waitToDumpWatchdog = SetTimer(0, 0, waitToDumpWatchdogInterval * 1000, waitUntilDoneWatchdogFired); } -int LayoutTestController::windowCount() +int TestRunner::windowCount() { return openWindows().size(); } -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) { COMPtr<IDOMDocument> document; if (FAILED(frame->DOMDocument(&document))) @@ -904,7 +904,7 @@ bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef i return autoCompletes; } -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) +void TestRunner::execCommand(JSStringRef name, JSStringRef value) { wstring wName = jsStringRefToWString(name); wstring wValue = jsStringRefToWString(value); @@ -925,51 +925,51 @@ void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) SysFreeString(valueBSTR); } -bool LayoutTestController::findString(JSContextRef /* context */, JSStringRef /* target */, JSObjectRef /* optionsArray */) +bool TestRunner::findString(JSContextRef /* context */, JSStringRef /* target */, JSObjectRef /* optionsArray */) { // FIXME: Implement return false; } -void LayoutTestController::setCacheModel(int) +void TestRunner::setCacheModel(int) { // FIXME: Implement } -bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/) +bool TestRunner::isCommandEnabled(JSStringRef /*name*/) { - printf("ERROR: LayoutTestController::isCommandEnabled() not implemented\n"); + printf("ERROR: TestRunner::isCommandEnabled() not implemented\n"); return false; } -void LayoutTestController::clearAllApplicationCaches() +void TestRunner::clearAllApplicationCaches() { // FIXME: Implement to support application cache quotas. } -void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef origin) +void TestRunner::clearApplicationCacheForOrigin(JSStringRef origin) { // FIXME: Implement to support deleting all application cache for an origin. } -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) { // FIXME: Implement to support application cache quotas. } -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) { // FIXME: Implement to get origins that have application caches. return JSValueMakeUndefined(context); } -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef name) +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef name) { // FIXME: Implement to get disk usage by all application caches for an origin. return 0; } -void LayoutTestController::clearAllDatabases() +void TestRunner::clearAllDatabases() { COMPtr<IWebDatabaseManager> databaseManager; COMPtr<IWebDatabaseManager> tmpDatabaseManager; @@ -981,7 +981,7 @@ void LayoutTestController::clearAllDatabases() databaseManager->deleteAllDatabases(); } -void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value) +void TestRunner::overridePreference(JSStringRef key, JSStringRef value) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1002,7 +1002,7 @@ void LayoutTestController::overridePreference(JSStringRef key, JSStringRef value SysFreeString(valueBSTR); } -void LayoutTestController::setDatabaseQuota(unsigned long long quota) +void TestRunner::setDatabaseQuota(unsigned long long quota) { COMPtr<IWebDatabaseManager> databaseManager; COMPtr<IWebDatabaseManager> tmpDatabaseManager; @@ -1015,17 +1015,17 @@ void LayoutTestController::setDatabaseQuota(unsigned long long quota) databaseManager->setQuota(TEXT("file:///"), quota); } -void LayoutTestController::goBack() +void TestRunner::goBack() { // FIXME: implement to enable loader/navigation-while-deferring-loads.html } -void LayoutTestController::setDefersLoading(bool) +void TestRunner::setDefersLoading(bool) { // FIXME: implement to enable loader/navigation-while-deferring-loads.html } -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool forbidden, JSStringRef scheme) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1036,12 +1036,12 @@ void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool forbidd SysFreeString(schemeBSTR); } -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) +void TestRunner::setAppCacheMaximumSize(unsigned long long size) { - printf("ERROR: LayoutTestController::setAppCacheMaximumSize() not implemented\n"); + printf("ERROR: TestRunner::setAppCacheMaximumSize() not implemented\n"); } -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) { COMPtr<IDOMDocument> document; if (FAILED(frame->DOMDocument(&document))) @@ -1066,7 +1066,7 @@ bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef anima return SUCCEEDED(hr) && wasRunning; } -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) { COMPtr<IDOMDocument> document; if (FAILED(frame->DOMDocument(&document))) @@ -1091,7 +1091,7 @@ bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef prop return SUCCEEDED(hr) && wasRunning; } -unsigned LayoutTestController::numberOfActiveAnimations() const +unsigned TestRunner::numberOfActiveAnimations() const { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -1110,7 +1110,7 @@ static _bstr_t bstrT(JSStringRef jsString) return _bstr_t(JSStringCopyBSTR(jsString), false); } -void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1119,7 +1119,7 @@ void LayoutTestController::addOriginAccessWhitelistEntry(JSStringRef sourceOrigi webView->addOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains); } -void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1128,12 +1128,12 @@ void LayoutTestController::removeOriginAccessWhitelistEntry(JSStringRef sourceOr webView->removeOriginAccessWhitelistEntry(bstrT(sourceOrigin).GetBSTR(), bstrT(destinationProtocol).GetBSTR(), bstrT(destinationHost).GetBSTR(), allowDestinationSubdomains); } -void LayoutTestController::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) +void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) { // FIXME: implement } -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1147,7 +1147,7 @@ void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bo } -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) { COMPtr<IWebViewPrivate> webView; if (FAILED(WebKitCreateInstance(__uuidof(WebView), 0, __uuidof(webView), reinterpret_cast<void**>(&webView)))) @@ -1160,7 +1160,7 @@ void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) webView->addUserStyleSheetToGroup(_bstr_t(L"org.webkit.DumpRenderTree").GetBSTR(), world.get(), bstrT(source).GetBSTR(), 0, 0, 0, 0, 0); } -void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) +void TestRunner::setDeveloperExtrasEnabled(bool enabled) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1177,12 +1177,12 @@ void LayoutTestController::setDeveloperExtrasEnabled(bool enabled) prefsPrivate->setDeveloperExtrasEnabled(enabled); } -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::showWebInspector() +void TestRunner::showWebInspector() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1197,7 +1197,7 @@ void LayoutTestController::showWebInspector() inspector->show(); } -void LayoutTestController::closeWebInspector() +void TestRunner::closeWebInspector() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1214,7 +1214,7 @@ void LayoutTestController::closeWebInspector() inspector->close(); } -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1253,12 +1253,12 @@ unsigned worldIDForWorld(IWebScriptWorld* world) return 0; } -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { // FIXME: Implement this. } -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -1283,7 +1283,7 @@ void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObj SysFreeString(result); } -void LayoutTestController::removeAllVisitedLinks() +void TestRunner::removeAllVisitedLinks() { COMPtr<IWebHistory> history; if (FAILED(WebKitCreateInstance(CLSID_WebHistory, 0, __uuidof(history), reinterpret_cast<void**>(&history)))) @@ -1300,7 +1300,7 @@ void LayoutTestController::removeAllVisitedLinks() sharedHistoryPrivate->removeAllVisitedLinks(); } -int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels) +int TestRunner::numberOfPages(float pageWidthInPixels, float pageHeightInPixels) { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -1312,24 +1312,24 @@ int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeigh return pageNumber; } -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const { // FIXME: Implement this. return JSRetainPtr<JSStringRef>(); } -void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) { } -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const { // FIXME: implement return JSRetainPtr<JSStringRef>(); } -void LayoutTestController::apiTestGoToCurrentBackForwardItem() +void TestRunner::apiTestGoToCurrentBackForwardItem() { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1347,56 +1347,56 @@ void LayoutTestController::apiTestGoToCurrentBackForwardItem() webView->goToBackForwardItem(item.get(), &success); } -void LayoutTestController::setWebViewEditable(bool) +void TestRunner::setWebViewEditable(bool) { } -void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) { } -void LayoutTestController::abortModal() +void TestRunner::abortModal() { } -void LayoutTestController::setSerializeHTTPLoads(bool) +void TestRunner::setSerializeHTTPLoads(bool) { // FIXME: Implement. } -void LayoutTestController::syncLocalStorage() +void TestRunner::syncLocalStorage() { // FIXME: Implement. } -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) +void TestRunner::observeStorageTrackerNotifications(unsigned number) { // FIXME: Implement. } -void LayoutTestController::deleteAllLocalStorage() +void TestRunner::deleteAllLocalStorage() { // FIXME: Implement. } -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) { // FIXME: Implement. return JSValueMakeUndefined(context); } -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) { // FIXME: Implement to support getting local storage disk usage for an origin. return 0; } -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) +void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) { // FIXME: Implement. } -void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) +void TestRunner::setMinimumTimerInterval(double minimumTimerInterval) { COMPtr<IWebView> webView; if (FAILED(frame->webView(&webView))) @@ -1409,7 +1409,7 @@ void LayoutTestController::setMinimumTimerInterval(double minimumTimerInterval) viewPrivate->setMinimumTimerInterval(minimumTimerInterval); } -void LayoutTestController::setTextDirection(JSStringRef direction) +void TestRunner::setTextDirection(JSStringRef direction) { COMPtr<IWebFramePrivate> framePrivate(Query, frame); if (!framePrivate) @@ -1418,53 +1418,53 @@ void LayoutTestController::setTextDirection(JSStringRef direction) framePrivate->setTextDirection(bstrT(direction).GetBSTR()); } -void LayoutTestController::addChromeInputField() +void TestRunner::addChromeInputField() { } -void LayoutTestController::removeChromeInputField() +void TestRunner::removeChromeInputField() { } -void LayoutTestController::focusWebView() +void TestRunner::focusWebView() { } -void LayoutTestController::setBackingScaleFactor(double) +void TestRunner::setBackingScaleFactor(double) { } -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) { // FIXME: Implement. } -void LayoutTestController::resetPageVisibility() +void TestRunner::resetPageVisibility() { // FIXME: Implement this. } -void LayoutTestController::setPageVisibility(const char*) +void TestRunner::setPageVisibility(const char*) { // FIXME: Implement this. } -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) +void TestRunner::setAutomaticLinkDetectionEnabled(bool) { // FIXME: Implement this. } -void LayoutTestController::sendWebIntentResponse(JSStringRef) +void TestRunner::sendWebIntentResponse(JSStringRef) { // FIXME: Implement this. } -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) { // FIXME: Implement this. } -void LayoutTestController::setStorageDatabaseIdleInterval(double) +void TestRunner::setStorageDatabaseIdleInterval(double) { // FIXME: Implement this. } diff --git a/Tools/DumpRenderTree/win/UIDelegate.cpp b/Tools/DumpRenderTree/win/UIDelegate.cpp index 6eb880c2c..fd6a8f842 100644 --- a/Tools/DumpRenderTree/win/UIDelegate.cpp +++ b/Tools/DumpRenderTree/win/UIDelegate.cpp @@ -32,9 +32,8 @@ #include "DumpRenderTree.h" #include "DraggingInfo.h" #include "EventSender.h" -#include "LayoutTestController.h" #include "DRTDesktopNotificationPresenter.h" - +#include "TestRunner.h" #include <WebCore/COMPtr.h> #include <wtf/Assertions.h> #include <wtf/PassOwnPtr.h> @@ -472,7 +471,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::runBeforeUnloadConfirmPanelWithMessage( if (!result) return E_POINTER; printf("CONFIRM NAVIGATION: %S\n", message ? message : L""); - *result = !gLayoutTestController->shouldStayOnPageAfterHandlingBeforeUnload(); + *result = !gTestRunner->shouldStayOnPageAfterHandlingBeforeUnload(); return S_OK; } @@ -537,7 +536,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::createWebViewWithRequest( /* [in] */ IWebURLRequest *request, /* [retval][out] */ IWebView **newWebView) { - if (!::gLayoutTestController->canOpenWindows()) + if (!::gTestRunner->canOpenWindows()) return E_FAIL; *newWebView = createWebViewAndOffscreenWindow(); return S_OK; @@ -588,7 +587,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::exceededDatabaseQuota( origin->host(&host); origin->port(&port); - if (!done && gLayoutTestController->dumpDatabaseCallbacks()) + if (!done && gTestRunner->dumpDatabaseCallbacks()) printf("UI DELEGATE DATABASE CALLBACK: exceededDatabaseQuotaForSecurityOrigin:{%S, %S, %i} database:%S\n", protocol, host, port, databaseIdentifier); SysFreeString(protocol); @@ -633,7 +632,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::webViewDidInvalidate( HRESULT STDMETHODCALLTYPE UIDelegate::setStatusText(IWebView*, BSTR text) { - if (gLayoutTestController->dumpStatusCallbacks()) + if (gTestRunner->dumpStatusCallbacks()) printf("UI DELEGATE STATUS CALLBACK: setStatusText:%s\n", text ? toUTF8(text).c_str() : ""); return S_OK; } diff --git a/Tools/DumpRenderTree/wscript b/Tools/DumpRenderTree/wscript index b32929450..b1a0356fa 100644 --- a/Tools/DumpRenderTree/wscript +++ b/Tools/DumpRenderTree/wscript @@ -41,10 +41,10 @@ include_paths = [ ] sources = [ 'DumpRenderTreeCommon.cpp', - 'LayoutTestController.cpp', + 'TestRunner.cpp', 'WorkQueue.cpp', 'wx/DumpRenderTreeWx.cpp', - 'wx/LayoutTestControllerWx.cpp', + 'wx/TestRunnerWx.cpp', 'wx/WorkQueueItemWx.cpp' ] diff --git a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp index 45b852d88..0f8788504 100644 --- a/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp +++ b/Tools/DumpRenderTree/wx/DumpRenderTreeWx.cpp @@ -29,7 +29,7 @@ #include "config.h" #include "DumpRenderTree.h" -#include "LayoutTestController.h" +#include "TestRunner.h" #include "WorkQueue.h" #include "WorkQueueItem.h" @@ -59,7 +59,7 @@ using namespace WebKit; FILE* logOutput; -RefPtr<LayoutTestController> gLayoutTestController; +RefPtr<TestRunner> gTestRunner; static WebView* webView; static wxTimer* idleTimer; @@ -95,7 +95,7 @@ public: if (event.GetState() == WEBVIEW_LOAD_ONLOAD_HANDLED) { done = true; - if (!gLayoutTestController->waitToDump() || notified) { + if (!gTestRunner->waitToDump() || notified) { dump(); } } @@ -128,14 +128,14 @@ public: void OnReceivedTitleEvent(WebViewReceivedTitleEvent& event) { - if (gLayoutTestController->dumpTitleChanges() && !done) + if (gTestRunner->dumpTitleChanges() && !done) wxFprintf(stdout, "TITLE CHANGED: %S\n", event.GetTitle()); } void OnWindowObjectClearedEvent(WebViewWindowObjectClearedEvent& event) { JSValueRef exception = 0; - gLayoutTestController->makeWindowObject(event.GetJSContext(), event.GetWindowObject(), &exception); + gTestRunner->makeWindowObject(event.GetJSContext(), event.GetWindowObject(), &exception); } private: @@ -155,7 +155,7 @@ LayoutWebViewEventHandler* eventHandler = 0; static wxString dumpFramesAsText(WebFrame* frame) { // TODO: implement this. leaving this here so we don't forget this case. - if (gLayoutTestController->dumpChildFramesAsText()) { + if (gTestRunner->dumpChildFramesAsText()) { } return frame->GetInnerText(); @@ -166,15 +166,15 @@ void dump() if (!done) return; - if (gLayoutTestController->waitToDump() && !notified) + if (gTestRunner->waitToDump() && !notified) return; if (dumpTree) { const char* result = 0; - bool dumpAsText = gLayoutTestController->dumpAsText(); + bool dumpAsText = gTestRunner->dumpAsText(); wxString str; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) str = dumpFramesAsText(webView->GetMainFrame()); else str = webView->GetMainFrame()->GetExternalRepresentation(); @@ -182,7 +182,7 @@ void dump() result = str.ToUTF8(); if (!result) { const char* errorMessage; - if (gLayoutTestController->dumpAsText()) + if (gTestRunner->dumpAsText()) errorMessage = "WebFrame::GetInnerText"; else errorMessage = "WebFrame::GetExternalRepresentation"; @@ -191,7 +191,7 @@ void dump() printf("%s\n", result); } - if (gLayoutTestController->dumpBackForwardList()) { + if (gTestRunner->dumpBackForwardList()) { // FIXME: not implemented } @@ -204,9 +204,9 @@ void dump() } if (dumpPixelsForCurrentTest - && gLayoutTestController->generatePixelResults() - && !gLayoutTestController->dumpDOMAsWebArchive() - && !gLayoutTestController->dumpSourceAsWebArchive()) { + && gTestRunner->generatePixelResults() + && !gTestRunner->dumpDOMAsWebArchive() + && !gTestRunner->dumpSourceAsWebArchive()) { // FIXME: Add support for dumping pixels fflush(stdout); } @@ -215,7 +215,7 @@ void dump() fflush(stdout); fflush(stderr); - gLayoutTestController.clear(); + gTestRunner.clear(); } static void runTest(const wxString inputLine) @@ -232,8 +232,8 @@ static void runTest(const wxString inputLine) if (http == string::npos) pathOrURL.insert(0, "file://"); - gLayoutTestController = LayoutTestController::create(pathOrURL, command.expectedPixelHash); - if (!gLayoutTestController) { + gTestRunner = TestRunner::create(pathOrURL, command.expectedPixelHash); + if (!gTestRunner) { wxTheApp->ExitMainLoop(); } diff --git a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp deleted file mode 100644 index fef8f4b09..000000000 --- a/Tools/DumpRenderTree/wx/LayoutTestControllerWx.cpp +++ /dev/null @@ -1,640 +0,0 @@ -/* - * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com> - * - * 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 "LayoutTestController.h" - -#include "DumpRenderTree.h" -#include "WorkQueue.h" -#include "WorkQueueItem.h" -#include <JavaScriptCore/JSRetainPtr.h> -#include <JavaScriptCore/JSStringRef.h> - -#include <stdio.h> - - - -LayoutTestController::~LayoutTestController() -{ - // FIXME: implement -} - -void LayoutTestController::addDisallowedURL(JSStringRef url) -{ - // FIXME: implement -} - -void LayoutTestController::clearBackForwardList() -{ -} - -JSStringRef LayoutTestController::copyDecodedHostName(JSStringRef name) -{ - // FIXME: implement - return 0; -} - -JSStringRef LayoutTestController::copyEncodedHostName(JSStringRef name) -{ - // FIXME: implement - return 0; -} - -void LayoutTestController::dispatchPendingLoadRequests() -{ - // FIXME: Implement for testing fix for 6727495 -} - -void LayoutTestController::display() -{ -} - -void LayoutTestController::keepWebHistory() -{ - // FIXME: implement -} - -void LayoutTestController::notifyDone() -{ - if (m_waitToDump && !WorkQueue::shared()->count()) - notifyDoneFired(); - m_waitToDump = false; -} - -JSStringRef LayoutTestController::pathToLocalResource(JSContextRef context, JSStringRef url) -{ - // Function introduced in r28690. This may need special-casing on Windows. - return JSStringRetain(url); // Do nothing on Unix. -} - -void LayoutTestController::queueLoad(JSStringRef url, JSStringRef target) -{ - // FIXME: We need to resolve relative URLs here - WorkQueue::shared()->queue(new LoadItem(url, target)); -} - -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). -} - -void LayoutTestController::setCustomPolicyDelegate(bool, bool) -{ - // FIXME: implement -} - -void LayoutTestController::setMainFrameIsFirstResponder(bool flag) -{ - // FIXME: implement -} - -void LayoutTestController::setTabKeyCyclesThroughElements(bool cycles) -{ - // FIXME: implement -} - -void LayoutTestController::setUseDashboardCompatibilityMode(bool flag) -{ - // FIXME: implement -} - -void LayoutTestController::setUserStyleSheetEnabled(bool flag) -{ -} - -void LayoutTestController::setUserStyleSheetLocation(JSStringRef path) -{ -} - -void LayoutTestController::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) -{ - // FIXME: implement -} - -void LayoutTestController::setViewModeMediaFeature(JSStringRef mode) -{ - // FIXME: implement -} - -void LayoutTestController::setWindowIsKey(bool windowIsKey) -{ - // FIXME: implement -} - -void LayoutTestController::setSmartInsertDeleteEnabled(bool flag) -{ - // FIXME: implement -} - -void LayoutTestController::setWaitToDump(bool waitUntilDone) -{ - static const int timeoutSeconds = 10; - - m_waitToDump = waitUntilDone; -} - -int LayoutTestController::windowCount() -{ - // FIXME: implement - return 1; -} - -void LayoutTestController::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) -{ - // FIXME: implement -} - -void LayoutTestController::setJavaScriptCanAccessClipboard(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setXSSAuditorEnabled(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setFrameFlatteningEnabled(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setAllowUniversalAccessFromFileURLs(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setAllowFileAccessFromFileURLs(bool enabled) -{ - // FIXME: implement -} - -void LayoutTestController::setAuthorAndUserStylesEnabled(bool flag) -{ - // FIXME: implement -} - -void LayoutTestController::setAutofilled(JSContextRef, JSValueRef element, bool isAutofilled) -{ - // FIXME: implement -} - -void LayoutTestController::setPopupBlockingEnabled(bool popupBlockingEnabled) -{ - // FIXME: implement -} - -void LayoutTestController::setPluginsEnabled(bool flag) -{ - // FIXME: Implement -} - -bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id) -{ - // FIXME: implement - return false; -} - -void LayoutTestController::execCommand(JSStringRef name, JSStringRef value) -{ - // FIXME: implement -} - -void LayoutTestController::setPersistentUserStyleSheetLocation(JSStringRef jsURL) -{ - // FIXME: implement -} - -void LayoutTestController::clearPersistentUserStyleSheet() -{ - // FIXME: implement -} - -void LayoutTestController::clearAllApplicationCaches() -{ - // FIXME: Implement to support application cache quotas. -} - -void LayoutTestController::clearApplicationCacheForOrigin(JSStringRef url) -{ - // FIXME: Implement to support deleting all application cache for an origin. -} - -long long LayoutTestController::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) -{ - // FIXME: Implement to support getting disk usage in bytes for an origin. - return 0; -} - -void LayoutTestController::setApplicationCacheOriginQuota(unsigned long long quota) -{ - // FIXME: Implement to support application cache quotas. -} - -long long LayoutTestController::applicationCacheDiskUsageForOrigin(JSStringRef origin) -{ - // FIXME: Implement to support getting disk usage by all application caches for an origin. - return 0; -} - - -JSValueRef LayoutTestController::originsWithApplicationCache(JSContextRef context) -{ - // FIXME: Implement to get origins that have application caches. - return 0; -} - -void LayoutTestController::clearAllDatabases() -{ - // FIXME: implement -} - -void LayoutTestController::setDatabaseQuota(unsigned long long quota) -{ - // FIXME: implement -} - -void LayoutTestController::goBack() -{ - // FIXME: implement to enable loader/navigation-while-deferring-loads.html -} - -void LayoutTestController::setDefersLoading(bool) -{ - // FIXME: implement to enable loader/navigation-while-deferring-loads.html -} - -void LayoutTestController::setDomainRelaxationForbiddenForURLScheme(bool, JSStringRef) -{ - // FIXME: implement -} - -void LayoutTestController::setAppCacheMaximumSize(unsigned long long size) -{ - // FIXME: implement -} - -unsigned LayoutTestController::numberOfActiveAnimations() const -{ - // FIXME: implement - return 0; -} - -unsigned LayoutTestController::workerThreadCount() const -{ - // FIXME: implement - return 0; -} - -void LayoutTestController::setSelectTrailingWhitespaceEnabled(bool flag) -{ - // FIXME: implement -} - -bool LayoutTestController::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) -{ - // FIXME: implement - 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. - // See https://bugs.webkit.org/show_bug.cgi?id=28264. -} - -void LayoutTestController::setMockGeolocationError(int code, JSStringRef message) -{ - // FIXME: Implement for Geolocation layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=28264. -} - -void LayoutTestController::setGeolocationPermission(bool allow) -{ - // FIXME: Implement for Geolocation layout tests. - setGeolocationPermissionCommon(allow); -} - -int LayoutTestController::numberOfPendingGeolocationPermissionRequests() -{ - // FIXME: Implement for Geolocation layout tests. - return -1; -} - -void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) -{ - // FIXME: Implement for speech input layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=39485. -} - -void LayoutTestController::setMockSpeechInputDumpRect(bool flag) -{ - // FIXME: Implement for speech input layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=39485. -} - -void LayoutTestController::startSpeechInput(JSContextRef inputElement) -{ - // FIXME: Implement for speech input layout tests. - // See https://bugs.webkit.org/show_bug.cgi?id=39485. -} - -void LayoutTestController::setIconDatabaseEnabled(bool iconDatabaseEnabled) -{ - // FIXME: implement -} - -bool LayoutTestController::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) -{ - // FIXME: implement - return false; -} - -void LayoutTestController::setCacheModel(int) -{ - // FIXME: implement -} - -bool LayoutTestController::isCommandEnabled(JSStringRef /*name*/) -{ - // FIXME: implement - return false; -} - -size_t LayoutTestController::webHistoryItemCount() -{ - // FIXME: implement - return 0; -} - -void LayoutTestController::waitForPolicyDelegate() -{ - // FIXME: Implement this. -} - -void LayoutTestController::overridePreference(JSStringRef /* key */, JSStringRef /* value */) -{ - // FIXME: implement -} - -void LayoutTestController::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) -{ - printf("LayoutTestController::addUserScript not implemented.\n"); -} - -void LayoutTestController::addUserStyleSheet(JSStringRef source, bool allFrames) -{ - printf("LayoutTestController::addUserStyleSheet not implemented.\n"); -} - -void LayoutTestController::showWebInspector() -{ - // FIXME: Implement this. -} - -void LayoutTestController::closeWebInspector() -{ - // FIXME: Implement this. -} - -void LayoutTestController::evaluateInWebInspector(long callId, JSStringRef script) -{ - // FIXME: Implement this. -} - -void LayoutTestController::removeAllVisitedLinks() -{ - // FIXME: Implement this. -} - -void LayoutTestController::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) -{ - -} - -void LayoutTestController::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) -{ - -} - -void LayoutTestController::disableImageLoading() -{ - -} - -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 -} - -int LayoutTestController::numberOfPages(float, float) -{ - // FIXME: implement - return -1; -} - -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; -} - -void LayoutTestController::authenticateSession(JSStringRef, JSStringRef, JSStringRef) -{ -} - -void LayoutTestController::abortModal() -{ -} - -JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const -{ - // FIXME: Implement - return 0; -} - -JSRetainPtr<JSStringRef> LayoutTestController::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const -{ - // FIXME: Implement - return 0; -} - -void LayoutTestController::setAsynchronousSpellCheckingEnabled(bool) -{ - // FIXME: Implement this. -} - -bool LayoutTestController::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) -{ - // FIXME: Implement - return false; -} - -void LayoutTestController::setSerializeHTTPLoads(bool) -{ - // FIXME: Implement. -} - -void LayoutTestController::setMinimumTimerInterval(double interval) { - -} - -void LayoutTestController::syncLocalStorage() -{ - // FIXME: Implement. -} - -void LayoutTestController::observeStorageTrackerNotifications(unsigned number) -{ - // FIXME: Implement. -} - -void LayoutTestController::deleteAllLocalStorage() -{ - // FIXME: Implement. -} - -JSValueRef LayoutTestController::originsWithLocalStorage(JSContextRef context) -{ - // FIXME: Implement. - return 0; -} - -void LayoutTestController::deleteLocalStorageForOrigin(JSStringRef URL) -{ - // FIXME: Implement. -} - -void LayoutTestController::setTextDirection(JSStringRef direction) -{ - // FIXME: Implement. -} - -void LayoutTestController::addChromeInputField() -{ -} - -void LayoutTestController::removeChromeInputField() -{ -} - -void LayoutTestController::focusWebView() -{ -} - -void LayoutTestController::setBackingScaleFactor(double) -{ -} - -void LayoutTestController::simulateDesktopNotificationClick(JSStringRef title) -{ - // FIXME: Implement. -} - -void LayoutTestController::resetPageVisibility() -{ - // FIXME: Implement this. -} - -void LayoutTestController::setPageVisibility(const char*) -{ - // FIXME: Implement this. -} - -void LayoutTestController::setAutomaticLinkDetectionEnabled(bool) -{ - // FIXME: Implement this. -} - -void LayoutTestController::sendWebIntentResponse(JSStringRef) -{ - // FIXME: Implement this. -} - -void LayoutTestController::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) -{ - // FIXME: Implement this. -} - -void LayoutTestController::setStorageDatabaseIdleInterval(double) -{ - // FIXME: Implement this. -} diff --git a/Tools/DumpRenderTree/wx/TestRunnerWx.cpp b/Tools/DumpRenderTree/wx/TestRunnerWx.cpp new file mode 100644 index 000000000..ee09cb0cc --- /dev/null +++ b/Tools/DumpRenderTree/wx/TestRunnerWx.cpp @@ -0,0 +1,641 @@ +/* + * Copyright (C) 2008 Kevin Ollivier <kevino@theolliviers.com> + * + * 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 "TestRunner.h" + +#include "DumpRenderTree.h" +#include "WorkQueue.h" +#include "WorkQueueItem.h" +#include <JavaScriptCore/JSRetainPtr.h> +#include <JavaScriptCore/JSStringRef.h> + +#include <stdio.h> + + + +TestRunner::~TestRunner() +{ + // FIXME: implement +} + +void TestRunner::addDisallowedURL(JSStringRef url) +{ + // FIXME: implement +} + +void TestRunner::clearBackForwardList() +{ +} + +JSStringRef TestRunner::copyDecodedHostName(JSStringRef name) +{ + // FIXME: implement + return 0; +} + +JSStringRef TestRunner::copyEncodedHostName(JSStringRef name) +{ + // FIXME: implement + return 0; +} + +void TestRunner::dispatchPendingLoadRequests() +{ + // FIXME: Implement for testing fix for 6727495 +} + +void TestRunner::display() +{ +} + +void TestRunner::keepWebHistory() +{ + // FIXME: implement +} + +void TestRunner::notifyDone() +{ + if (m_waitToDump && !WorkQueue::shared()->count()) + notifyDoneFired(); + m_waitToDump = false; +} + +JSStringRef TestRunner::pathToLocalResource(JSContextRef context, JSStringRef url) +{ + // Function introduced in r28690. This may need special-casing on Windows. + return JSStringRetain(url); // Do nothing on Unix. +} + +void TestRunner::queueLoad(JSStringRef url, JSStringRef target) +{ + // FIXME: We need to resolve relative URLs here + WorkQueue::shared()->queue(new LoadItem(url, target)); +} + +void TestRunner::setAcceptsEditing(bool acceptsEditing) +{ +} + +void TestRunner::setAlwaysAcceptCookies(bool alwaysAcceptCookies) +{ + // FIXME: Implement this (and restore the default value before running each test in DumpRenderTree.cpp). +} + +void TestRunner::setCustomPolicyDelegate(bool, bool) +{ + // FIXME: implement +} + +void TestRunner::setMainFrameIsFirstResponder(bool flag) +{ + // FIXME: implement +} + +void TestRunner::setTabKeyCyclesThroughElements(bool cycles) +{ + // FIXME: implement +} + +void TestRunner::setUseDashboardCompatibilityMode(bool flag) +{ + // FIXME: implement +} + +void TestRunner::setUserStyleSheetEnabled(bool flag) +{ +} + +void TestRunner::setUserStyleSheetLocation(JSStringRef path) +{ +} + +void TestRunner::setValueForUser(JSContextRef context, JSValueRef element, JSStringRef value) +{ + // FIXME: implement +} + +void TestRunner::setViewModeMediaFeature(JSStringRef mode) +{ + // FIXME: implement +} + +void TestRunner::setWindowIsKey(bool windowIsKey) +{ + // FIXME: implement +} + +void TestRunner::setSmartInsertDeleteEnabled(bool flag) +{ + // FIXME: implement +} + +void TestRunner::setWaitToDump(bool waitUntilDone) +{ + static const int timeoutSeconds = 10; + + m_waitToDump = waitUntilDone; +} + +int TestRunner::windowCount() +{ + // FIXME: implement + return 1; +} + +void TestRunner::setPrivateBrowsingEnabled(bool privateBrowsingEnabled) +{ + // FIXME: implement +} + +void TestRunner::setJavaScriptCanAccessClipboard(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setXSSAuditorEnabled(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setFrameFlatteningEnabled(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setAllowUniversalAccessFromFileURLs(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setAllowFileAccessFromFileURLs(bool enabled) +{ + // FIXME: implement +} + +void TestRunner::setAuthorAndUserStylesEnabled(bool flag) +{ + // FIXME: implement +} + +void TestRunner::setAutofilled(JSContextRef, JSValueRef element, bool isAutofilled) +{ + // FIXME: implement +} + +void TestRunner::setPopupBlockingEnabled(bool popupBlockingEnabled) +{ + // FIXME: implement +} + +void TestRunner::setPluginsEnabled(bool flag) +{ + // FIXME: Implement +} + +bool TestRunner::elementDoesAutoCompleteForElementWithId(JSStringRef id) +{ + // FIXME: implement + return false; +} + +void TestRunner::execCommand(JSStringRef name, JSStringRef value) +{ + // FIXME: implement +} + +void TestRunner::setPersistentUserStyleSheetLocation(JSStringRef jsURL) +{ + // FIXME: implement +} + +void TestRunner::clearPersistentUserStyleSheet() +{ + // FIXME: implement +} + +void TestRunner::clearAllApplicationCaches() +{ + // FIXME: Implement to support application cache quotas. +} + +void TestRunner::clearApplicationCacheForOrigin(JSStringRef url) +{ + // FIXME: Implement to support deleting all application cache for an origin. +} + +long long TestRunner::localStorageDiskUsageForOrigin(JSStringRef originIdentifier) +{ + // FIXME: Implement to support getting disk usage in bytes for an origin. + return 0; +} + +void TestRunner::setApplicationCacheOriginQuota(unsigned long long quota) +{ + // FIXME: Implement to support application cache quotas. +} + +long long TestRunner::applicationCacheDiskUsageForOrigin(JSStringRef origin) +{ + // FIXME: Implement to support getting disk usage by all application caches for an origin. + return 0; +} + + +JSValueRef TestRunner::originsWithApplicationCache(JSContextRef context) +{ + // FIXME: Implement to get origins that have application caches. + return 0; +} + +void TestRunner::clearAllDatabases() +{ + // FIXME: implement +} + +void TestRunner::setDatabaseQuota(unsigned long long quota) +{ + // FIXME: implement +} + +void TestRunner::goBack() +{ + // FIXME: implement to enable loader/navigation-while-deferring-loads.html +} + +void TestRunner::setDefersLoading(bool) +{ + // FIXME: implement to enable loader/navigation-while-deferring-loads.html +} + +void TestRunner::setDomainRelaxationForbiddenForURLScheme(bool, JSStringRef) +{ + // FIXME: implement +} + +void TestRunner::setAppCacheMaximumSize(unsigned long long size) +{ + // FIXME: implement +} + +unsigned TestRunner::numberOfActiveAnimations() const +{ + // FIXME: implement + return 0; +} + +unsigned TestRunner::workerThreadCount() const +{ + // FIXME: implement + return 0; +} + +void TestRunner::setSelectTrailingWhitespaceEnabled(bool flag) +{ + // FIXME: implement +} + +bool TestRunner::pauseTransitionAtTimeOnElementWithId(JSStringRef propertyName, double time, JSStringRef elementId) +{ + // FIXME: implement + return false; +} + +void TestRunner::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 TestRunner::setMockGeolocationPosition(double latitude, double longitude, double accuracy) +{ + // FIXME: Implement for Geolocation layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=28264. +} + +void TestRunner::setMockGeolocationError(int code, JSStringRef message) +{ + // FIXME: Implement for Geolocation layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=28264. +} + +void TestRunner::setGeolocationPermission(bool allow) +{ + // FIXME: Implement for Geolocation layout tests. + setGeolocationPermissionCommon(allow); +} + +int TestRunner::numberOfPendingGeolocationPermissionRequests() +{ + // FIXME: Implement for Geolocation layout tests. + return -1; +} + +void TestRunner::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) +{ + // FIXME: Implement for speech input layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=39485. +} + +void TestRunner::setMockSpeechInputDumpRect(bool flag) +{ + // FIXME: Implement for speech input layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=39485. +} + +void TestRunner::startSpeechInput(JSContextRef inputElement) +{ + // FIXME: Implement for speech input layout tests. + // See https://bugs.webkit.org/show_bug.cgi?id=39485. +} + +void TestRunner::setIconDatabaseEnabled(bool iconDatabaseEnabled) +{ + // FIXME: implement +} + +bool TestRunner::pauseAnimationAtTimeOnElementWithId(JSStringRef animationName, double time, JSStringRef elementId) +{ + // FIXME: implement + return false; +} + +void TestRunner::setCacheModel(int) +{ + // FIXME: implement +} + +bool TestRunner::isCommandEnabled(JSStringRef /*name*/) +{ + // FIXME: implement + return false; +} + +size_t TestRunner::webHistoryItemCount() +{ + // FIXME: implement + return 0; +} + +void TestRunner::waitForPolicyDelegate() +{ + // FIXME: Implement this. +} + +void TestRunner::overridePreference(JSStringRef /* key */, JSStringRef /* value */) +{ + // FIXME: implement +} + +void TestRunner::addUserScript(JSStringRef source, bool runAtStart, bool allFrames) +{ + printf("TestRunner::addUserScript not implemented.\n"); +} + +void TestRunner::addUserStyleSheet(JSStringRef source, bool allFrames) +{ + printf("TestRunner::addUserStyleSheet not implemented.\n"); +} + +void TestRunner::showWebInspector() +{ + // FIXME: Implement this. +} + +void TestRunner::closeWebInspector() +{ + // FIXME: Implement this. +} + +void TestRunner::evaluateInWebInspector(long callId, JSStringRef script) +{ + // FIXME: Implement this. +} + +void TestRunner::removeAllVisitedLinks() +{ + // FIXME: Implement this. +} + +void TestRunner::evaluateScriptInIsolatedWorldAndReturnValue(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +{ + +} + +void TestRunner::evaluateScriptInIsolatedWorld(unsigned worldID, JSObjectRef globalObject, JSStringRef script) +{ + +} + +void TestRunner::disableImageLoading() +{ + +} + +void TestRunner::addOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +{ + // FIXME: implement +} + +void TestRunner::removeOriginAccessWhitelistEntry(JSStringRef sourceOrigin, JSStringRef destinationProtocol, JSStringRef destinationHost, bool allowDestinationSubdomains) +{ + // FIXME: implement +} + +void TestRunner::setScrollbarPolicy(JSStringRef orientation, JSStringRef policy) +{ + // FIXME: implement +} + +int TestRunner::numberOfPages(float, float) +{ + // FIXME: implement + return -1; +} + +void TestRunner::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL) +{ + +} + +void TestRunner::apiTestGoToCurrentBackForwardItem() +{ + +} + +void TestRunner::setSpatialNavigationEnabled(bool) +{ + +} + +void TestRunner::setWebViewEditable(bool) +{ +} + +bool TestRunner::callShouldCloseOnWebView() +{ + return false; +} + +JSRetainPtr<JSStringRef> TestRunner::layerTreeAsText() const +{ + return 0; +} + +JSRetainPtr<JSStringRef> TestRunner::markerTextForListItem(JSContextRef context, JSValueRef nodeObject) const +{ + return 0; +} + +JSValueRef TestRunner::computedStyleIncludingVisitedInfo(JSContextRef, JSValueRef) +{ + return 0; +} + +void TestRunner::authenticateSession(JSStringRef, JSStringRef, JSStringRef) +{ +} + +void TestRunner::abortModal() +{ +} + +JSRetainPtr<JSStringRef> TestRunner::pageProperty(const char* propertyName, int pageNumber) const +{ + // FIXME: Implement + return 0; +} + +JSRetainPtr<JSStringRef> TestRunner::pageSizeAndMarginsInPixels(int pageNumber, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft) const +{ + // FIXME: Implement + return 0; +} + +void TestRunner::setAsynchronousSpellCheckingEnabled(bool) +{ + // FIXME: Implement this. +} + +bool TestRunner::findString(JSContextRef context, JSStringRef target, JSObjectRef optionsArray) +{ + // FIXME: Implement + return false; +} + +void TestRunner::setSerializeHTTPLoads(bool) +{ + // FIXME: Implement. +} + +void TestRunner::setMinimumTimerInterval(double interval) +{ + +} + +void TestRunner::syncLocalStorage() +{ + // FIXME: Implement. +} + +void TestRunner::observeStorageTrackerNotifications(unsigned number) +{ + // FIXME: Implement. +} + +void TestRunner::deleteAllLocalStorage() +{ + // FIXME: Implement. +} + +JSValueRef TestRunner::originsWithLocalStorage(JSContextRef context) +{ + // FIXME: Implement. + return 0; +} + +void TestRunner::deleteLocalStorageForOrigin(JSStringRef URL) +{ + // FIXME: Implement. +} + +void TestRunner::setTextDirection(JSStringRef direction) +{ + // FIXME: Implement. +} + +void TestRunner::addChromeInputField() +{ +} + +void TestRunner::removeChromeInputField() +{ +} + +void TestRunner::focusWebView() +{ +} + +void TestRunner::setBackingScaleFactor(double) +{ +} + +void TestRunner::simulateDesktopNotificationClick(JSStringRef title) +{ + // FIXME: Implement. +} + +void TestRunner::resetPageVisibility() +{ + // FIXME: Implement this. +} + +void TestRunner::setPageVisibility(const char*) +{ + // FIXME: Implement this. +} + +void TestRunner::setAutomaticLinkDetectionEnabled(bool) +{ + // FIXME: Implement this. +} + +void TestRunner::sendWebIntentResponse(JSStringRef) +{ + // FIXME: Implement this. +} + +void TestRunner::deliverWebIntent(JSStringRef, JSStringRef, JSStringRef) +{ + // FIXME: Implement this. +} + +void TestRunner::setStorageDatabaseIdleInterval(double) +{ + // FIXME: Implement this. +} |