Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) | 3 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) |
| 4 * Copyright (C) 2012 Apple Inc. All Rights Reserved. | 4 * Copyright (C) 2012 Apple Inc. All Rights Reserved. |
| 5 * | 5 * |
| 6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
| 7 * modification, are permitted provided that the following conditions are | 7 * modification, are permitted provided that the following conditions are |
| 8 * met: | 8 * met: |
| 9 * | 9 * |
| 10 * * Redistributions of source code must retain the above copyright | 10 * * Redistributions of source code must retain the above copyright |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 bindMethod("setBackingScaleFactor", &TestRunner::setBackingScaleFactor); | 276 bindMethod("setBackingScaleFactor", &TestRunner::setBackingScaleFactor); |
| 277 bindMethod("setPOSIXLocale", &TestRunner::setPOSIXLocale); | 277 bindMethod("setPOSIXLocale", &TestRunner::setPOSIXLocale); |
| 278 bindMethod("numberOfPendingGeolocationPermissionRequests", &TestRunner:: num berOfPendingGeolocationPermissionRequests); | 278 bindMethod("numberOfPendingGeolocationPermissionRequests", &TestRunner:: num berOfPendingGeolocationPermissionRequests); |
| 279 bindMethod("setGeolocationPermission", &TestRunner::setGeolocationPermission ); | 279 bindMethod("setGeolocationPermission", &TestRunner::setGeolocationPermission ); |
| 280 bindMethod("setMockGeolocationPositionUnavailableError", &TestRunner::setMoc kGeolocationPositionUnavailableError); | 280 bindMethod("setMockGeolocationPositionUnavailableError", &TestRunner::setMoc kGeolocationPositionUnavailableError); |
| 281 bindMethod("setMockGeolocationPosition", &TestRunner::setMockGeolocationPosi tion); | 281 bindMethod("setMockGeolocationPosition", &TestRunner::setMockGeolocationPosi tion); |
| 282 bindMethod("setMIDISysExPermission", &TestRunner::setMIDISysExPermission); | 282 bindMethod("setMIDISysExPermission", &TestRunner::setMIDISysExPermission); |
| 283 #if ENABLE_NOTIFICATIONS | 283 #if ENABLE_NOTIFICATIONS |
| 284 bindMethod("grantWebNotificationPermission", &TestRunner::grantWebNotificati onPermission); | 284 bindMethod("grantWebNotificationPermission", &TestRunner::grantWebNotificati onPermission); |
| 285 bindMethod("simulateLegacyWebNotificationClick", &TestRunner::simulateLegacy WebNotificationClick); | 285 bindMethod("simulateLegacyWebNotificationClick", &TestRunner::simulateLegacy WebNotificationClick); |
| 286 bindMethod("removeAllWebNotificationPermissions", &TestRunner::removeAllWebN otificationPermissions); | |
| 286 #endif | 287 #endif |
| 287 bindMethod("addMockSpeechInputResult", &TestRunner::addMockSpeechInputResult ); | 288 bindMethod("addMockSpeechInputResult", &TestRunner::addMockSpeechInputResult ); |
| 288 bindMethod("setMockSpeechInputDumpRect", &TestRunner::setMockSpeechInputDump Rect); | 289 bindMethod("setMockSpeechInputDumpRect", &TestRunner::setMockSpeechInputDump Rect); |
| 289 bindMethod("addMockSpeechRecognitionResult", &TestRunner::addMockSpeechRecog nitionResult); | 290 bindMethod("addMockSpeechRecognitionResult", &TestRunner::addMockSpeechRecog nitionResult); |
| 290 bindMethod("setMockSpeechRecognitionError", &TestRunner::setMockSpeechRecogn itionError); | 291 bindMethod("setMockSpeechRecognitionError", &TestRunner::setMockSpeechRecogn itionError); |
| 291 bindMethod("wasMockSpeechRecognitionAborted", &TestRunner::wasMockSpeechReco gnitionAborted); | 292 bindMethod("wasMockSpeechRecognitionAborted", &TestRunner::wasMockSpeechReco gnitionAborted); |
| 292 bindMethod("display", &TestRunner::display); | 293 bindMethod("display", &TestRunner::display); |
| 293 bindMethod("displayInvalidatedRegion", &TestRunner::displayInvalidatedRegion ); | 294 bindMethod("displayInvalidatedRegion", &TestRunner::displayInvalidatedRegion ); |
| 294 bindMethod("isChooserShown", &TestRunner::isChooserShown); | 295 bindMethod("isChooserShown", &TestRunner::isChooserShown); |
| 295 | 296 |
| 296 // The following modify WebPageOverlays. | 297 // The following modify WebPageOverlays. |
| 297 bindMethod("addWebPageOverlay", &TestRunner::addWebPageOverlay); | 298 bindMethod("addWebPageOverlay", &TestRunner::addWebPageOverlay); |
| 298 bindMethod("removeWebPageOverlay", &TestRunner::removeWebPageOverlay); | 299 bindMethod("removeWebPageOverlay", &TestRunner::removeWebPageOverlay); |
| 299 | 300 |
| 300 // Properties. | 301 // Properties. |
| 301 bindProperty("globalFlag", &m_globalFlag); | 302 bindProperty("globalFlag", &m_globalFlag); |
| 302 bindProperty("titleTextDirection", &m_titleTextDirection); | 303 bindProperty("titleTextDirection", &m_titleTextDirection); |
| 303 bindProperty("platformName", &m_platformName); | 304 bindProperty("platformName", &m_platformName); |
| 304 bindProperty("tooltipText", &m_tooltipText); | 305 bindProperty("tooltipText", &m_tooltipText); |
| 305 bindProperty("disableNotifyDone", &m_disableNotifyDone); | 306 bindProperty("disableNotifyDone", &m_disableNotifyDone); |
| 306 | 307 |
| 307 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history | 308 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history |
| 308 bindProperty("webHistoryItemCount", &m_webHistoryItemCount); | 309 bindProperty("webHistoryItemCount", &m_webHistoryItemCount); |
| 309 bindProperty("interceptPostMessage", &m_interceptPostMessage); | 310 bindProperty("interceptPostMessage", &m_interceptPostMessage); |
| 310 | 311 |
| 311 // The following are stubs. | 312 // The following are stubs. |
| 312 bindMethod("dumpDatabaseCallbacks", &TestRunner::notImplemented); | 313 bindMethod("dumpDatabaseCallbacks", &TestRunner::notImplemented); |
| 313 bindMethod("denyWebNotificationPermission", &TestRunner::notImplemented); | 314 bindMethod("denyWebNotificationPermission", &TestRunner::notImplemented); |
| 314 bindMethod("removeAllWebNotificationPermissions", &TestRunner::notImplemente d); | |
| 315 bindMethod("simulateWebNotificationClick", &TestRunner::notImplemented); | 315 bindMethod("simulateWebNotificationClick", &TestRunner::notImplemented); |
| 316 bindMethod("setIconDatabaseEnabled", &TestRunner::notImplemented); | 316 bindMethod("setIconDatabaseEnabled", &TestRunner::notImplemented); |
| 317 bindMethod("setScrollbarPolicy", &TestRunner::notImplemented); | 317 bindMethod("setScrollbarPolicy", &TestRunner::notImplemented); |
| 318 bindMethod("clearAllApplicationCaches", &TestRunner::notImplemented); | 318 bindMethod("clearAllApplicationCaches", &TestRunner::notImplemented); |
| 319 bindMethod("clearApplicationCacheForOrigin", &TestRunner::notImplemented); | 319 bindMethod("clearApplicationCacheForOrigin", &TestRunner::notImplemented); |
| 320 bindMethod("clearBackForwardList", &TestRunner::notImplemented); | 320 bindMethod("clearBackForwardList", &TestRunner::notImplemented); |
| 321 bindMethod("keepWebHistory", &TestRunner::notImplemented); | 321 bindMethod("keepWebHistory", &TestRunner::notImplemented); |
| 322 bindMethod("setApplicationCacheOriginQuota", &TestRunner::notImplemented); | 322 bindMethod("setApplicationCacheOriginQuota", &TestRunner::notImplemented); |
| 323 bindMethod("setCallCloseOnWebViews", &TestRunner::notImplemented); | 323 bindMethod("setCallCloseOnWebViews", &TestRunner::notImplemented); |
| 324 bindMethod("setMainFrameIsFirstResponder", &TestRunner::notImplemented); | 324 bindMethod("setMainFrameIsFirstResponder", &TestRunner::notImplemented); |
| (...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1851 } | 1851 } |
| 1852 | 1852 |
| 1853 void TestRunner::simulateLegacyWebNotificationClick(const CppArgumentList& argum ents, CppVariant* result) | 1853 void TestRunner::simulateLegacyWebNotificationClick(const CppArgumentList& argum ents, CppVariant* result) |
| 1854 { | 1854 { |
| 1855 if (arguments.size() != 1 || !arguments[0].isString()) { | 1855 if (arguments.size() != 1 || !arguments[0].isString()) { |
| 1856 result->set(false); | 1856 result->set(false); |
| 1857 return; | 1857 return; |
| 1858 } | 1858 } |
| 1859 result->set(m_notificationPresenter->simulateClick(WebString::fromUTF8(argum ents[0].toString()))); | 1859 result->set(m_notificationPresenter->simulateClick(WebString::fromUTF8(argum ents[0].toString()))); |
| 1860 } | 1860 } |
| 1861 void TestRunner::removeAllWebNotificationPermissions(const CppArgumentList& argu ments, CppVariant* result) | |
| 1862 { | |
| 1863 m_notificationPresenter->removeAllWebNotificationPermissions(); | |
|
jochen (gone - plz use gerrit)
2013/08/21 08:48:15
why not do this in TestRunner::reset automatically
| |
| 1864 result->setNull(); | |
| 1865 } | |
| 1861 #endif | 1866 #endif |
| 1862 | 1867 |
| 1863 void TestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppV ariant* result) | 1868 void TestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppV ariant* result) |
| 1864 { | 1869 { |
| 1865 result->setNull(); | 1870 result->setNull(); |
| 1866 if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumb er() || !arguments[2].isString()) | 1871 if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumb er() || !arguments[2].isString()) |
| 1867 return; | 1872 return; |
| 1868 | 1873 |
| 1869 #if ENABLE_INPUT_SPEECH | 1874 #if ENABLE_INPUT_SPEECH |
| 1870 m_proxy->speechInputControllerMock()->addMockRecognitionResult(WebString::fr omUTF8(arguments[0].toString()), arguments[1].toDouble(), WebString::fromUTF8(ar guments[2].toString())); | 1875 m_proxy->speechInputControllerMock()->addMockRecognitionResult(WebString::fr omUTF8(arguments[0].toString()), arguments[1].toDouble(), WebString::fromUTF8(ar guments[2].toString())); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2128 result->setNull(); | 2133 result->setNull(); |
| 2129 } | 2134 } |
| 2130 | 2135 |
| 2131 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result) | 2136 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp Variant* result) |
| 2132 { | 2137 { |
| 2133 m_pointerLockPlannedResult = PointerLockWillFailSync; | 2138 m_pointerLockPlannedResult = PointerLockWillFailSync; |
| 2134 result->setNull(); | 2139 result->setNull(); |
| 2135 } | 2140 } |
| 2136 | 2141 |
| 2137 } | 2142 } |
| OLD | NEW |