| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /* | 5 /* |
| 6 * Copyright (C) 2010 Google Inc. All rights reserved. | 6 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) | 7 * Copyright (C) 2010 Pawel Hajdan (phajdan.jr@chromium.org) |
| 8 * Copyright (C) 2012 Apple Inc. All Rights Reserved. | 8 * Copyright (C) 2012 Apple Inc. All Rights Reserved. |
| 9 * | 9 * |
| 10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 bindMethod("clearAllDatabases", &TestRunner::clearAllDatabases); | 289 bindMethod("clearAllDatabases", &TestRunner::clearAllDatabases); |
| 290 bindMethod("setDatabaseQuota", &TestRunner::setDatabaseQuota); | 290 bindMethod("setDatabaseQuota", &TestRunner::setDatabaseQuota); |
| 291 bindMethod("setAlwaysAcceptCookies", &TestRunner::setAlwaysAcceptCookies); | 291 bindMethod("setAlwaysAcceptCookies", &TestRunner::setAlwaysAcceptCookies); |
| 292 bindMethod("setWindowIsKey", &TestRunner::setWindowIsKey); | 292 bindMethod("setWindowIsKey", &TestRunner::setWindowIsKey); |
| 293 bindMethod("pathToLocalResource", &TestRunner::pathToLocalResource); | 293 bindMethod("pathToLocalResource", &TestRunner::pathToLocalResource); |
| 294 bindMethod("setBackingScaleFactor", &TestRunner::setBackingScaleFactor); | 294 bindMethod("setBackingScaleFactor", &TestRunner::setBackingScaleFactor); |
| 295 bindMethod("setPOSIXLocale", &TestRunner::setPOSIXLocale); | 295 bindMethod("setPOSIXLocale", &TestRunner::setPOSIXLocale); |
| 296 bindMethod("setMIDIAccessorResult", &TestRunner::setMIDIAccessorResult); | 296 bindMethod("setMIDIAccessorResult", &TestRunner::setMIDIAccessorResult); |
| 297 bindMethod("setMIDISysExPermission", &TestRunner::setMIDISysExPermission); | 297 bindMethod("setMIDISysExPermission", &TestRunner::setMIDISysExPermission); |
| 298 bindMethod("grantWebNotificationPermission", &TestRunner::grantWebNotificati
onPermission); | 298 bindMethod("grantWebNotificationPermission", &TestRunner::grantWebNotificati
onPermission); |
| 299 bindMethod("simulateLegacyWebNotificationClick", &TestRunner::simulateLegacy
WebNotificationClick); | 299 bindMethod("simulateWebNotificationClick", &TestRunner::simulateWebNotificat
ionClick); |
| 300 bindMethod("cancelAllActiveNotifications", &TestRunner::cancelAllActiveNotif
ications); | |
| 301 bindMethod("addMockSpeechInputResult", &TestRunner::addMockSpeechInputResult
); | 300 bindMethod("addMockSpeechInputResult", &TestRunner::addMockSpeechInputResult
); |
| 302 bindMethod("setMockSpeechInputDumpRect", &TestRunner::setMockSpeechInputDump
Rect); | 301 bindMethod("setMockSpeechInputDumpRect", &TestRunner::setMockSpeechInputDump
Rect); |
| 303 bindMethod("addMockSpeechRecognitionResult", &TestRunner::addMockSpeechRecog
nitionResult); | 302 bindMethod("addMockSpeechRecognitionResult", &TestRunner::addMockSpeechRecog
nitionResult); |
| 304 bindMethod("setMockSpeechRecognitionError", &TestRunner::setMockSpeechRecogn
itionError); | 303 bindMethod("setMockSpeechRecognitionError", &TestRunner::setMockSpeechRecogn
itionError); |
| 305 bindMethod("wasMockSpeechRecognitionAborted", &TestRunner::wasMockSpeechReco
gnitionAborted); | 304 bindMethod("wasMockSpeechRecognitionAborted", &TestRunner::wasMockSpeechReco
gnitionAborted); |
| 306 bindMethod("display", &TestRunner::display); | 305 bindMethod("display", &TestRunner::display); |
| 307 bindMethod("displayInvalidatedRegion", &TestRunner::displayInvalidatedRegion
); | 306 bindMethod("displayInvalidatedRegion", &TestRunner::displayInvalidatedRegion
); |
| 308 bindMethod("isChooserShown", &TestRunner::isChooserShown); | 307 bindMethod("isChooserShown", &TestRunner::isChooserShown); |
| 309 | 308 |
| 310 // The following modify WebPageOverlays. | 309 // The following modify WebPageOverlays. |
| 311 bindMethod("addWebPageOverlay", &TestRunner::addWebPageOverlay); | 310 bindMethod("addWebPageOverlay", &TestRunner::addWebPageOverlay); |
| 312 bindMethod("removeWebPageOverlay", &TestRunner::removeWebPageOverlay); | 311 bindMethod("removeWebPageOverlay", &TestRunner::removeWebPageOverlay); |
| 313 | 312 |
| 314 // Properties. | 313 // Properties. |
| 315 bindProperty("globalFlag", &m_globalFlag); | 314 bindProperty("globalFlag", &m_globalFlag); |
| 316 bindProperty("platformName", &m_platformName); | 315 bindProperty("platformName", &m_platformName); |
| 317 bindProperty("tooltipText", &m_tooltipText); | 316 bindProperty("tooltipText", &m_tooltipText); |
| 318 bindProperty("disableNotifyDone", &m_disableNotifyDone); | 317 bindProperty("disableNotifyDone", &m_disableNotifyDone); |
| 319 | 318 |
| 320 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history | 319 // webHistoryItemCount is used by tests in LayoutTests\http\tests\history |
| 321 bindProperty("webHistoryItemCount", &m_webHistoryItemCount); | 320 bindProperty("webHistoryItemCount", &m_webHistoryItemCount); |
| 322 bindProperty("interceptPostMessage", &m_interceptPostMessage); | 321 bindProperty("interceptPostMessage", &m_interceptPostMessage); |
| 323 | 322 |
| 324 // The following are stubs. | 323 // The following are stubs. |
| 325 bindMethod("dumpDatabaseCallbacks", &TestRunner::notImplemented); | 324 bindMethod("dumpDatabaseCallbacks", &TestRunner::notImplemented); |
| 326 bindMethod("denyWebNotificationPermission", &TestRunner::notImplemented); | |
| 327 bindMethod("removeAllWebNotificationPermissions", &TestRunner::notImplemente
d); | |
| 328 bindMethod("simulateWebNotificationClick", &TestRunner::notImplemented); | |
| 329 bindMethod("setIconDatabaseEnabled", &TestRunner::notImplemented); | 325 bindMethod("setIconDatabaseEnabled", &TestRunner::notImplemented); |
| 330 bindMethod("setScrollbarPolicy", &TestRunner::notImplemented); | 326 bindMethod("setScrollbarPolicy", &TestRunner::notImplemented); |
| 331 bindMethod("clearAllApplicationCaches", &TestRunner::notImplemented); | 327 bindMethod("clearAllApplicationCaches", &TestRunner::notImplemented); |
| 332 bindMethod("clearApplicationCacheForOrigin", &TestRunner::notImplemented); | 328 bindMethod("clearApplicationCacheForOrigin", &TestRunner::notImplemented); |
| 333 bindMethod("clearBackForwardList", &TestRunner::notImplemented); | 329 bindMethod("clearBackForwardList", &TestRunner::notImplemented); |
| 334 bindMethod("keepWebHistory", &TestRunner::notImplemented); | 330 bindMethod("keepWebHistory", &TestRunner::notImplemented); |
| 335 bindMethod("setApplicationCacheOriginQuota", &TestRunner::notImplemented); | 331 bindMethod("setApplicationCacheOriginQuota", &TestRunner::notImplemented); |
| 336 bindMethod("setCallCloseOnWebViews", &TestRunner::notImplemented); | 332 bindMethod("setCallCloseOnWebViews", &TestRunner::notImplemented); |
| 337 bindMethod("setMainFrameIsFirstResponder", &TestRunner::notImplemented); | 333 bindMethod("setMainFrameIsFirstResponder", &TestRunner::notImplemented); |
| 338 bindMethod("setUseDashboardCompatibilityMode", &TestRunner::notImplemented); | 334 bindMethod("setUseDashboardCompatibilityMode", &TestRunner::notImplemented); |
| (...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1825 if (arguments.size() < 1 || !arguments[0].isString()) | 1821 if (arguments.size() < 1 || !arguments[0].isString()) |
| 1826 return; | 1822 return; |
| 1827 | 1823 |
| 1828 bool permissionGranted = true; | 1824 bool permissionGranted = true; |
| 1829 if (arguments.size() == 2 && arguments[1].isBool()) | 1825 if (arguments.size() == 2 && arguments[1].isBool()) |
| 1830 permissionGranted = arguments[1].toBoolean(); | 1826 permissionGranted = arguments[1].toBoolean(); |
| 1831 | 1827 |
| 1832 notification_presenter_->GrantPermission(arguments[0].toString(), permission
Granted); | 1828 notification_presenter_->GrantPermission(arguments[0].toString(), permission
Granted); |
| 1833 } | 1829 } |
| 1834 | 1830 |
| 1835 void TestRunner::simulateLegacyWebNotificationClick(const CppArgumentList& argum
ents, CppVariant* result) | 1831 void TestRunner::simulateWebNotificationClick(const CppArgumentList& arguments,
CppVariant* result) |
| 1836 { | 1832 { |
| 1837 if (arguments.size() != 1 || !arguments[0].isString()) { | 1833 if (arguments.size() != 1 || !arguments[0].isString()) { |
| 1838 result->set(false); | 1834 result->set(false); |
| 1839 return; | 1835 return; |
| 1840 } | 1836 } |
| 1841 result->set(notification_presenter_->SimulateClick(arguments[0].toString()))
; | 1837 result->set(notification_presenter_->SimulateClick(arguments[0].toString()))
; |
| 1842 } | 1838 } |
| 1843 | 1839 |
| 1844 void TestRunner::cancelAllActiveNotifications(const CppArgumentList& arguments,
CppVariant* result) | |
| 1845 { | |
| 1846 notification_presenter_->CancelAllActiveNotifications(); | |
| 1847 result->set(true); | |
| 1848 } | |
| 1849 | |
| 1850 void TestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppV
ariant* result) | 1840 void TestRunner::addMockSpeechInputResult(const CppArgumentList& arguments, CppV
ariant* result) |
| 1851 { | 1841 { |
| 1852 result->setNull(); | 1842 result->setNull(); |
| 1853 if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumb
er() || !arguments[2].isString()) | 1843 if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumb
er() || !arguments[2].isString()) |
| 1854 return; | 1844 return; |
| 1855 | 1845 |
| 1856 #if ENABLE_INPUT_SPEECH | 1846 #if ENABLE_INPUT_SPEECH |
| 1857 m_proxy->speechInputControllerMock()->addMockRecognitionResult(WebString::fr
omUTF8(arguments[0].toString()), arguments[1].toDouble(), WebString::fromUTF8(ar
guments[2].toString())); | 1847 m_proxy->speechInputControllerMock()->addMockRecognitionResult(WebString::fr
omUTF8(arguments[0].toString()), arguments[1].toDouble(), WebString::fromUTF8(ar
guments[2].toString())); |
| 1858 #endif | 1848 #endif |
| 1859 } | 1849 } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2119 result->setNull(); | 2109 result->setNull(); |
| 2120 } | 2110 } |
| 2121 | 2111 |
| 2122 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp
Variant* result) | 2112 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp
Variant* result) |
| 2123 { | 2113 { |
| 2124 m_pointerLockPlannedResult = PointerLockWillFailSync; | 2114 m_pointerLockPlannedResult = PointerLockWillFailSync; |
| 2125 result->setNull(); | 2115 result->setNull(); |
| 2126 } | 2116 } |
| 2127 | 2117 |
| 2128 } | 2118 } |
| OLD | NEW |