Changeset 135008 in webkit
- Timestamp:
- Nov 16, 2012, 3:05:33 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r135006 r135008 1 2012-11-16 Jochen Eisinger <jochen@chromium.org> 2 3 [chromium] move stubs from DRTTestRunner to TestRunner 4 https://bugs.webkit.org/show_bug.cgi?id=102489 5 6 Reviewed by Adam Barth. 7 8 This is part of moving all methods from DRTTestRunner to TestRunner. 9 Instead of keeping one stub per method, I'm using a shared stub to 10 clean up the code. 11 12 * DumpRenderTree/chromium/DRTTestRunner.cpp: 13 (DRTTestRunner::DRTTestRunner): 14 * DumpRenderTree/chromium/DRTTestRunner.h: 15 (DRTTestRunner): 16 * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp: 17 (WebTestRunner::TestRunner::TestRunner): 18 (WebTestRunner): 19 (WebTestRunner::TestRunner::fallbackMethod): 20 (WebTestRunner::TestRunner::notImplemented): 21 * DumpRenderTree/chromium/TestRunner/src/TestRunner.h: 22 (WebTestRunner): 23 (TestRunner): 24 (WebTestRunner::TestRunner::setDelegate): 25 * DumpRenderTree/chromium/TestShell.cpp: 26 (TestShell::createMainWindow): 27 (TestShell::~TestShell): 28 1 29 2012-11-16 Jochen Eisinger <jochen@chromium.org> 2 30 -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp
r134967 r135008 138 138 bindMethod("dumpChildFramesAsText", &DRTTestRunner::dumpChildFramesAsText); 139 139 bindMethod("dumpChildFrameScrollPositions", &DRTTestRunner::dumpChildFrameScrollPositions); 140 bindMethod("dumpDatabaseCallbacks", &DRTTestRunner::dumpDatabaseCallbacks);141 140 bindMethod("dumpEditingCallbacks", &DRTTestRunner::dumpEditingCallbacks); 142 141 bindMethod("dumpFrameLoadCallbacks", &DRTTestRunner::dumpFrameLoadCallbacks); … … 161 160 #if ENABLE(NOTIFICATIONS) 162 161 bindMethod("grantWebNotificationPermission", &DRTTestRunner::grantWebNotificationPermission); 163 bindMethod("denyWebNotificationPermission", &DRTTestRunner::denyWebNotificationPermission);164 bindMethod("removeAllWebNotificationPermissions", &DRTTestRunner::removeAllWebNotificationPermissions);165 bindMethod("simulateWebNotificationClick", &DRTTestRunner::simulateWebNotificationClick);166 162 #endif 167 163 bindMethod("findString", &DRTTestRunner::findString); … … 202 198 bindMethod("setAudioData", &DRTTestRunner::setAudioData); 203 199 bindMethod("setGeolocationPermission", &DRTTestRunner::setGeolocationPermission); 204 bindMethod("setIconDatabaseEnabled", &DRTTestRunner::setIconDatabaseEnabled);205 200 bindMethod("setJavaScriptCanAccessClipboard", &DRTTestRunner::setJavaScriptCanAccessClipboard); 206 201 bindMethod("setMinimumTimerInterval", &DRTTestRunner::setMinimumTimerInterval); … … 217 212 bindMethod("setPOSIXLocale", &DRTTestRunner::setPOSIXLocale); 218 213 bindMethod("setPrinting", &DRTTestRunner::setPrinting); 219 bindMethod("setScrollbarPolicy", &DRTTestRunner::setScrollbarPolicy);220 214 bindMethod("setSelectTrailingWhitespaceEnabled", &DRTTestRunner::setSelectTrailingWhitespaceEnabled); 221 215 bindMethod("setTextSubpixelPositioning", &DRTTestRunner::setTextSubpixelPositioning); … … 248 242 bindMethod("setPluginsAllowed", &DRTTestRunner::setPluginsAllowed); 249 243 250 // The following are stubs.251 244 bindMethod("abortModal", &DRTTestRunner::abortModal); 252 bindMethod("addDisallowedURL", &DRTTestRunner::addDisallowedURL);253 bindMethod("applicationCacheDiskUsageForOrigin", &DRTTestRunner::applicationCacheDiskUsageForOrigin);254 245 bindMethod("callShouldCloseOnWebView", &DRTTestRunner::callShouldCloseOnWebView); 255 bindMethod("clearAllApplicationCaches", &DRTTestRunner::clearAllApplicationCaches);256 bindMethod("clearApplicationCacheForOrigin", &DRTTestRunner::clearApplicationCacheForOrigin);257 bindMethod("clearBackForwardList", &DRTTestRunner::clearBackForwardList);258 bindMethod("keepWebHistory", &DRTTestRunner::keepWebHistory);259 bindMethod("setApplicationCacheOriginQuota", &DRTTestRunner::setApplicationCacheOriginQuota);260 bindMethod("setCallCloseOnWebViews", &DRTTestRunner::setCallCloseOnWebViews);261 bindMethod("setMainFrameIsFirstResponder", &DRTTestRunner::setMainFrameIsFirstResponder);262 bindMethod("setPrivateBrowsingEnabled", &DRTTestRunner::setPrivateBrowsingEnabled);263 bindMethod("setUseDashboardCompatibilityMode", &DRTTestRunner::setUseDashboardCompatibilityMode);264 bindMethod("deleteAllLocalStorage", &DRTTestRunner::deleteAllLocalStorage);265 bindMethod("localStorageDiskUsageForOrigin", &DRTTestRunner::localStorageDiskUsageForOrigin);266 bindMethod("originsWithLocalStorage", &DRTTestRunner::originsWithLocalStorage);267 bindMethod("deleteLocalStorageForOrigin", &DRTTestRunner::deleteLocalStorageForOrigin);268 bindMethod("observeStorageTrackerNotifications", &DRTTestRunner::observeStorageTrackerNotifications);269 bindMethod("syncLocalStorage", &DRTTestRunner::syncLocalStorage);270 246 bindMethod("setShouldStayOnPageAfterHandlingBeforeUnload", &DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload); 271 247 bindMethod("enableFixedLayoutMode", &DRTTestRunner::enableFixedLayoutMode); … … 273 249 bindMethod("selectionAsMarkup", &DRTTestRunner::selectionAsMarkup); 274 250 bindMethod("textSurroundingNode", &DRTTestRunner::textSurroundingNode); 275 276 // The fallback method is called when an unknown method is invoked.277 bindFallbackMethod(&DRTTestRunner::fallbackMethod);278 251 279 252 // Shared properties. … … 352 325 m_generatePixelResults = arguments[0].value.boolValue; 353 326 354 result->setNull();355 }356 357 void DRTTestRunner::dumpDatabaseCallbacks(const CppArgumentList&, CppVariant* result)358 {359 // Do nothing; we don't use this flag anywhere for now360 327 result->setNull(); 361 328 } … … 856 823 } 857 824 858 void DRTTestRunner::setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant* result)859 {860 // We have no need to support Dashboard Compatibility Mode (mac-only)861 result->setNull();862 }863 864 void DRTTestRunner::clearAllApplicationCaches(const CppArgumentList&, CppVariant* result)865 {866 // FIXME: Implement to support application cache quotas.867 result->setNull();868 }869 870 void DRTTestRunner::clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant* result)871 {872 // FIXME: Implement to support deleting all application cache for an origin.873 result->setNull();874 }875 876 void DRTTestRunner::setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant* result)877 {878 // FIXME: Implement to support application cache quotas.879 result->setNull();880 }881 882 void DRTTestRunner::originsWithApplicationCache(const CppArgumentList&, CppVariant* result)883 {884 // FIXME: Implement to support getting origins that have application caches.885 result->setNull();886 }887 888 void DRTTestRunner::applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant* result)889 {890 // FIXME: Implement to support getting disk usage by all application cache for an origin.891 result->setNull();892 }893 894 void DRTTestRunner::setScrollbarPolicy(const CppArgumentList&, CppVariant* result)895 {896 // FIXME: implement.897 // Currently only has a non-null implementation on QT.898 result->setNull();899 }900 901 825 void DRTTestRunner::setCustomPolicyDelegate(const CppArgumentList& arguments, CppVariant* result) 902 826 { … … 1130 1054 } 1131 1055 1132 void DRTTestRunner::setIconDatabaseEnabled(const CppArgumentList&, CppVariant* result)1133 {1134 // We don't use the WebKit icon database.1135 result->setNull();1136 }1137 1138 1056 void DRTTestRunner::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result) 1139 1057 { … … 1152 1070 #endif 1153 1071 result->set(true); 1154 }1155 1156 void DRTTestRunner::denyWebNotificationPermission(const CppArgumentList& arguments, CppVariant* result)1157 {1158 // FIXME: Implement.1159 result->setNull();1160 }1161 1162 void DRTTestRunner::removeAllWebNotificationPermissions(const CppArgumentList& arguments, CppVariant* result)1163 {1164 // FIXME: Implement.1165 result->setNull();1166 }1167 1168 void DRTTestRunner::simulateWebNotificationClick(const CppArgumentList& arguments, CppVariant* result)1169 {1170 // FIXME: Implement.1171 result->setNull();1172 1072 } 1173 1073 … … 1200 1100 } 1201 1101 1202 //1203 // Unimplemented stubs1204 //1205 1206 void DRTTestRunner::setMainFrameIsFirstResponder(const CppArgumentList& arguments, CppVariant* result)1207 {1208 result->setNull();1209 }1210 1211 1102 void DRTTestRunner::dumpSelectionRect(const CppArgumentList& arguments, CppVariant* result) 1212 1103 { … … 1243 1134 { 1244 1135 m_sweepHorizontally = true; 1245 result->setNull();1246 }1247 1248 void DRTTestRunner::clearBackForwardList(const CppArgumentList& arguments, CppVariant* result)1249 {1250 result->setNull();1251 }1252 1253 void DRTTestRunner::keepWebHistory(const CppArgumentList& arguments, CppVariant* result)1254 {1255 result->setNull();1256 }1257 1258 void DRTTestRunner::addDisallowedURL(const CppArgumentList& arguments, CppVariant* result)1259 {1260 result->setNull();1261 }1262 1263 void DRTTestRunner::setCallCloseOnWebViews(const CppArgumentList& arguments, CppVariant* result)1264 {1265 result->setNull();1266 }1267 1268 void DRTTestRunner::setPrivateBrowsingEnabled(const CppArgumentList& arguments, CppVariant* result)1269 {1270 1136 result->setNull(); 1271 1137 } … … 1568 1434 } 1569 1435 1570 void DRTTestRunner::fallbackMethod(const CppArgumentList&, CppVariant* result)1571 {1572 printf("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on DRTTestRunner\n");1573 result->setNull();1574 }1575 1576 1436 void DRTTestRunner::addOriginAccessWhitelistEntry(const CppArgumentList& arguments, CppVariant* result) 1577 1437 { … … 1949 1809 } 1950 1810 1951 void DRTTestRunner::deleteAllLocalStorage(const CppArgumentList& arguments, CppVariant*)1952 {1953 // Not Implemented1954 }1955 1956 void DRTTestRunner::localStorageDiskUsageForOrigin(const CppArgumentList& arguments, CppVariant*)1957 {1958 // Not Implemented1959 }1960 1961 void DRTTestRunner::originsWithLocalStorage(const CppArgumentList& arguments, CppVariant*)1962 {1963 // Not Implemented1964 }1965 1966 void DRTTestRunner::deleteLocalStorageForOrigin(const CppArgumentList& arguments, CppVariant*)1967 {1968 // Not Implemented1969 }1970 1971 void DRTTestRunner::observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*)1972 {1973 // Not Implemented1974 }1975 1976 void DRTTestRunner::syncLocalStorage(const CppArgumentList&, CppVariant*)1977 {1978 // Not Implemented1979 }1980 1981 1811 void DRTTestRunner::setShouldStayOnPageAfterHandlingBeforeUnload(const CppArgumentList& arguments, CppVariant* result) 1982 1812 { -
trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h
r134967 r135008 80 80 void dumpAsText(const CppArgumentList&, CppVariant*); 81 81 82 // This function should set a flag that tells the test_shell to print a line83 // of descriptive text for each database command. It should take no84 // arguments, and ignore any that may be present. However, at the moment, we85 // don't have any DB function that prints messages, so for now this function86 // doesn't do anything.87 void dumpDatabaseCallbacks(const CppArgumentList&, CppVariant*);88 89 82 // This function sets a flag that tells the test_shell to print a line of 90 83 // descriptive text for each editing command. It takes no arguments, and … … 185 178 void setAuthorAndUserStylesEnabled(const CppArgumentList&, CppVariant*); 186 179 187 // Puts Webkit in "dashboard compatibility mode", which is used in obscure188 // Mac-only circumstances. It's not really necessary, and will most likely189 // never be used by Chrome, but some layout tests depend on its presence.190 void setUseDashboardCompatibilityMode(const CppArgumentList&, CppVariant*);191 192 void setScrollbarPolicy(const CppArgumentList&, CppVariant*);193 194 180 // Causes navigation actions just printout the intended navigation instead 195 181 // of taking you to the page. This is used for cases like mailto, where you … … 237 223 void disableAutoResizeMode(const CppArgumentList&, CppVariant*); 238 224 void numberOfActiveAnimations(const CppArgumentList&, CppVariant*); 239 void setIconDatabaseEnabled(const CppArgumentList&, CppVariant*);240 225 void dumpSelectionRect(const CppArgumentList&, CppVariant*); 241 226 … … 243 228 // Grants permission for desktop notifications to an origin 244 229 void grantWebNotificationPermission(const CppArgumentList&, CppVariant*); 245 void denyWebNotificationPermission(const CppArgumentList&, CppVariant*);246 void removeAllWebNotificationPermissions(const CppArgumentList&, CppVariant*);247 void simulateWebNotificationClick(const CppArgumentList&, CppVariant*);248 230 // Simulates a click on a desktop notification. 249 231 void simulateLegacyWebNotificationClick(const CppArgumentList&, CppVariant*); … … 257 239 const WebKit::WebArrayBufferView& audioData() const { return m_audioData; } 258 240 259 // The following are only stubs.260 // FIXME: Implement any of these that are needed to pass the layout tests.261 241 void dumpTitleChanges(const CppArgumentList&, CppVariant*); 262 void setMainFrameIsFirstResponder(const CppArgumentList&, CppVariant*);263 242 void display(const CppArgumentList&, CppVariant*); 264 243 void displayInvalidatedRegion(const CppArgumentList&, CppVariant*); 265 244 void testRepaint(const CppArgumentList&, CppVariant*); 266 245 void repaintSweepHorizontally(const CppArgumentList&, CppVariant*); 267 void clearBackForwardList(const CppArgumentList&, CppVariant*);268 void keepWebHistory(const CppArgumentList&, CppVariant*);269 void addDisallowedURL(const CppArgumentList&, CppVariant*);270 246 void callShouldCloseOnWebView(const CppArgumentList&, CppVariant*); 271 void setCallCloseOnWebViews(const CppArgumentList&, CppVariant*);272 void setPrivateBrowsingEnabled(const CppArgumentList&, CppVariant*);273 247 274 248 void setJavaScriptCanAccessClipboard(const CppArgumentList&, CppVariant*); … … 285 259 void setIsolatedWorldContentSecurityPolicy(const CppArgumentList&, CppVariant*); 286 260 287 // The fallback method is called when a nonexistent method is called on288 // the layout test controller object.289 // It is usefull to catch typos in the JavaScript code (a few layout tests290 // do have typos in them) and it allows the script to continue running in291 // that case (as the Mac does).292 void fallbackMethod(const CppArgumentList&, CppVariant*);293 294 261 // Allows layout tests to manage origins' whitelisting. 295 262 void addOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*); 296 263 void removeOriginAccessWhitelistEntry(const CppArgumentList&, CppVariant*); 297 298 // Clears all application caches.299 void clearAllApplicationCaches(const CppArgumentList&, CppVariant*);300 // Clears an application cache for an origin.301 void clearApplicationCacheForOrigin(const CppArgumentList&, CppVariant*);302 // Returns origins that have application caches.303 void originsWithApplicationCache(const CppArgumentList&, CppVariant*);304 // Sets the application cache quota for the localhost origin.305 void setApplicationCacheOriginQuota(const CppArgumentList&, CppVariant*);306 // Returns disk usage by all application caches for an origin.307 void applicationCacheDiskUsageForOrigin(const CppArgumentList&, CppVariant*);308 264 309 265 // Clears all databases. … … 373 329 // Forwards the setValueForUser() call to the element. 374 330 void setValueForUser(const CppArgumentList&, CppVariant*); 375 376 // LocalStorage origin-related377 void deleteAllLocalStorage(const CppArgumentList&, CppVariant*);378 void originsWithLocalStorage(const CppArgumentList&, CppVariant*);379 void deleteLocalStorageForOrigin(const CppArgumentList&, CppVariant*);380 void localStorageDiskUsageForOrigin(const CppArgumentList&, CppVariant*);381 void observeStorageTrackerNotifications(const CppArgumentList&, CppVariant*);382 void syncLocalStorage(const CppArgumentList&, CppVariant*);383 331 384 332 // WebPermissionClient related. -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp
r134203 r135008 33 33 #include "TestRunner.h" 34 34 35 #include "WebTestDelegate.h" 36 35 37 namespace WebTestRunner { 36 38 37 39 TestRunner::TestRunner() 40 : m_delegate(0) 38 41 { 42 // The following are stubs. 43 bindMethod("dumpDatabaseCallbacks", &TestRunner::notImplemented); 44 #if ENABLE(NOTIFICATIONS) 45 bindMethod("denyWebNotificationPermission", &TestRunner::notImplemented); 46 bindMethod("removeAllWebNotificationPermissions", &TestRunner::notImplemented); 47 bindMethod("simulateWebNotificationClick", &TestRunner::notImplemented); 48 #endif 49 bindMethod("setIconDatabaseEnabled", &TestRunner::notImplemented); 50 bindMethod("setScrollbarPolicy", &TestRunner::notImplemented); 51 bindMethod("clearAllApplicationCaches", &TestRunner::notImplemented); 52 bindMethod("clearApplicationCacheForOrigin", &TestRunner::notImplemented); 53 bindMethod("clearBackForwardList", &TestRunner::notImplemented); 54 bindMethod("keepWebHistory", &TestRunner::notImplemented); 55 bindMethod("setApplicationCacheOriginQuota", &TestRunner::notImplemented); 56 bindMethod("setCallCloseOnWebViews", &TestRunner::notImplemented); 57 bindMethod("setMainFrameIsFirstResponder", &TestRunner::notImplemented); 58 bindMethod("setPrivateBrowsingEnabled", &TestRunner::notImplemented); 59 bindMethod("setUseDashboardCompatibilityMode", &TestRunner::notImplemented); 60 bindMethod("deleteAllLocalStorage", &TestRunner::notImplemented); 61 bindMethod("localStorageDiskUsageForOrigin", &TestRunner::notImplemented); 62 bindMethod("originsWithLocalStorage", &TestRunner::notImplemented); 63 bindMethod("deleteLocalStorageForOrigin", &TestRunner::notImplemented); 64 bindMethod("observeStorageTrackerNotifications", &TestRunner::notImplemented); 65 bindMethod("syncLocalStorage", &TestRunner::notImplemented); 66 bindMethod("addDisallowedURL", &TestRunner::notImplemented); 67 bindMethod("applicationCacheDiskUsageForOrigin", &TestRunner::notImplemented); 68 69 // The fallback method is called when an unknown method is invoked. 70 bindFallbackMethod(&TestRunner::fallbackMethod); 71 } 72 73 void TestRunner::fallbackMethod(const CppArgumentList&, CppVariant* result) 74 { 75 m_delegate->printMessage("CONSOLE MESSAGE: JavaScript ERROR: unknown method called on TestRunner\n"); 76 result->setNull(); 77 } 78 79 void TestRunner::notImplemented(const CppArgumentList&, CppVariant* result) 80 { 81 result->setNull(); 39 82 } 40 83 -
trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h
r134203 r135008 37 37 namespace WebTestRunner { 38 38 39 class WebTestDelegate; 40 39 41 class TestRunner : public CppBoundClass { 40 42 public: 41 43 TestRunner(); 44 45 // FIXME: once DRTTestRunner is moved entirely to this class, change this 46 // method to take a TestDelegate* instead. 47 void setDelegate(WebTestDelegate* delegate) { m_delegate = delegate; } 48 49 private: 50 // The fallback method is called when a nonexistent method is called on 51 // the layout test controller object. 52 // It is usefull to catch typos in the JavaScript code (a few layout tests 53 // do have typos in them) and it allows the script to continue running in 54 // that case (as the Mac does). 55 void fallbackMethod(const CppArgumentList&, CppVariant*); 56 57 // Stub for not implemented methods. 58 void notImplemented(const CppArgumentList&, CppVariant*); 59 60 WebTestDelegate* m_delegate; 42 61 }; 43 62 -
trunk/Tools/DumpRenderTree/chromium/TestShell.cpp
r134850 r135008 186 186 m_testInterfaces->setDelegate(m_webViewHost.get()); 187 187 m_testInterfaces->setWebView(m_webView); 188 m_testRunner->setDelegate(m_webViewHost.get()); 188 189 m_drtDevToolsAgent->setWebView(m_webView); 189 190 } … … 193 194 m_testInterfaces->setDelegate(0); 194 195 m_testInterfaces->setWebView(0); 196 m_testRunner->setDelegate(0); 195 197 m_drtDevToolsAgent->setWebView(0); 196 198 }
Note:
See TracChangeset
for help on using the changeset viewer.