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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 bindMethod("callShouldCloseOnWebView", &TestRunner::callShouldCloseOnWebView
); | 185 bindMethod("callShouldCloseOnWebView", &TestRunner::callShouldCloseOnWebView
); |
186 bindMethod("setDomainRelaxationForbiddenForURLScheme", &TestRunner::setDomai
nRelaxationForbiddenForURLScheme); | 186 bindMethod("setDomainRelaxationForbiddenForURLScheme", &TestRunner::setDomai
nRelaxationForbiddenForURLScheme); |
187 bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &TestRunner::evalu
ateScriptInIsolatedWorldAndReturnValue); | 187 bindMethod("evaluateScriptInIsolatedWorldAndReturnValue", &TestRunner::evalu
ateScriptInIsolatedWorldAndReturnValue); |
188 bindMethod("evaluateScriptInIsolatedWorld", &TestRunner::evaluateScriptInIso
latedWorld); | 188 bindMethod("evaluateScriptInIsolatedWorld", &TestRunner::evaluateScriptInIso
latedWorld); |
189 bindMethod("setIsolatedWorldSecurityOrigin", &TestRunner::setIsolatedWorldSe
curityOrigin); | 189 bindMethod("setIsolatedWorldSecurityOrigin", &TestRunner::setIsolatedWorldSe
curityOrigin); |
190 bindMethod("setIsolatedWorldContentSecurityPolicy", &TestRunner::setIsolated
WorldContentSecurityPolicy); | 190 bindMethod("setIsolatedWorldContentSecurityPolicy", &TestRunner::setIsolated
WorldContentSecurityPolicy); |
191 bindMethod("addOriginAccessWhitelistEntry", &TestRunner::addOriginAccessWhit
elistEntry); | 191 bindMethod("addOriginAccessWhitelistEntry", &TestRunner::addOriginAccessWhit
elistEntry); |
192 bindMethod("removeOriginAccessWhitelistEntry", &TestRunner::removeOriginAcce
ssWhitelistEntry); | 192 bindMethod("removeOriginAccessWhitelistEntry", &TestRunner::removeOriginAcce
ssWhitelistEntry); |
193 bindMethod("hasCustomPageSizeStyle", &TestRunner::hasCustomPageSizeStyle); | 193 bindMethod("hasCustomPageSizeStyle", &TestRunner::hasCustomPageSizeStyle); |
194 bindMethod("forceRedSelectionColors", &TestRunner::forceRedSelectionColors); | 194 bindMethod("forceRedSelectionColors", &TestRunner::forceRedSelectionColors); |
195 bindMethod("addUserStyleSheet", &TestRunner::addUserStyleSheet); | 195 bindMethod("injectStyleSheet", &TestRunner::injectStyleSheet); |
196 bindMethod("startSpeechInput", &TestRunner::startSpeechInput); | 196 bindMethod("startSpeechInput", &TestRunner::startSpeechInput); |
197 bindMethod("findString", &TestRunner::findString); | 197 bindMethod("findString", &TestRunner::findString); |
198 bindMethod("setValueForUser", &TestRunner::setValueForUser); | 198 bindMethod("setValueForUser", &TestRunner::setValueForUser); |
199 bindMethod("selectionAsMarkup", &TestRunner::selectionAsMarkup); | 199 bindMethod("selectionAsMarkup", &TestRunner::selectionAsMarkup); |
200 bindMethod("setTextSubpixelPositioning", &TestRunner::setTextSubpixelPositio
ning); | 200 bindMethod("setTextSubpixelPositioning", &TestRunner::setTextSubpixelPositio
ning); |
201 bindMethod("setPageVisibility", &TestRunner::setPageVisibility); | 201 bindMethod("setPageVisibility", &TestRunner::setPageVisibility); |
202 bindMethod("setTextDirection", &TestRunner::setTextDirection); | 202 bindMethod("setTextDirection", &TestRunner::setTextDirection); |
203 bindMethod("textSurroundingNode", &TestRunner::textSurroundingNode); | 203 bindMethod("textSurroundingNode", &TestRunner::textSurroundingNode); |
204 bindMethod("useUnfortunateSynchronousResizeMode", &TestRunner::useUnfortunat
eSynchronousResizeMode); | 204 bindMethod("useUnfortunateSynchronousResizeMode", &TestRunner::useUnfortunat
eSynchronousResizeMode); |
205 bindMethod("disableAutoResizeMode", &TestRunner::disableAutoResizeMode); | 205 bindMethod("disableAutoResizeMode", &TestRunner::disableAutoResizeMode); |
206 bindMethod("enableAutoResizeMode", &TestRunner::enableAutoResizeMode); | 206 bindMethod("enableAutoResizeMode", &TestRunner::enableAutoResizeMode); |
207 bindMethod("setMockDeviceMotion", &TestRunner::setMockDeviceMotion); | 207 bindMethod("setMockDeviceMotion", &TestRunner::setMockDeviceMotion); |
208 bindMethod("setMockDeviceOrientation", &TestRunner::setMockDeviceOrientation
); | 208 bindMethod("setMockDeviceOrientation", &TestRunner::setMockDeviceOrientation
); |
209 bindMethod("didAcquirePointerLock", &TestRunner::didAcquirePointerLock); | 209 bindMethod("didAcquirePointerLock", &TestRunner::didAcquirePointerLock); |
210 bindMethod("didLosePointerLock", &TestRunner::didLosePointerLock); | 210 bindMethod("didLosePointerLock", &TestRunner::didLosePointerLock); |
211 bindMethod("didNotAcquirePointerLock", &TestRunner::didNotAcquirePointerLock
); | 211 bindMethod("didNotAcquirePointerLock", &TestRunner::didNotAcquirePointerLock
); |
212 bindMethod("setPointerLockWillRespondAsynchronously", &TestRunner::setPointe
rLockWillRespondAsynchronously); | 212 bindMethod("setPointerLockWillRespondAsynchronously", &TestRunner::setPointe
rLockWillRespondAsynchronously); |
213 bindMethod("setPointerLockWillFailSynchronously", &TestRunner::setPointerLoc
kWillFailSynchronously); | 213 bindMethod("setPointerLockWillFailSynchronously", &TestRunner::setPointerLoc
kWillFailSynchronously); |
214 | 214 |
215 // The following modify WebPreferences. | 215 // The following modify WebPreferences. |
216 bindMethod("setUserStyleSheetEnabled", &TestRunner::setUserStyleSheetEnabled
); | |
217 bindMethod("setUserStyleSheetLocation", &TestRunner::setUserStyleSheetLocati
on); | |
218 bindMethod("setPopupBlockingEnabled", &TestRunner::setPopupBlockingEnabled); | 216 bindMethod("setPopupBlockingEnabled", &TestRunner::setPopupBlockingEnabled); |
219 bindMethod("setJavaScriptCanAccessClipboard", &TestRunner::setJavaScriptCanA
ccessClipboard); | 217 bindMethod("setJavaScriptCanAccessClipboard", &TestRunner::setJavaScriptCanA
ccessClipboard); |
220 bindMethod("setXSSAuditorEnabled", &TestRunner::setXSSAuditorEnabled); | 218 bindMethod("setXSSAuditorEnabled", &TestRunner::setXSSAuditorEnabled); |
221 bindMethod("setAllowUniversalAccessFromFileURLs", &TestRunner::setAllowUnive
rsalAccessFromFileURLs); | 219 bindMethod("setAllowUniversalAccessFromFileURLs", &TestRunner::setAllowUnive
rsalAccessFromFileURLs); |
222 bindMethod("setAllowFileAccessFromFileURLs", &TestRunner::setAllowFileAccess
FromFileURLs); | 220 bindMethod("setAllowFileAccessFromFileURLs", &TestRunner::setAllowFileAccess
FromFileURLs); |
223 bindMethod("overridePreference", &TestRunner::overridePreference); | 221 bindMethod("overridePreference", &TestRunner::overridePreference); |
224 bindMethod("setPluginsEnabled", &TestRunner::setPluginsEnabled); | 222 bindMethod("setPluginsEnabled", &TestRunner::setPluginsEnabled); |
225 | 223 |
226 // The following modify the state of the TestRunner. | 224 // The following modify the state of the TestRunner. |
227 bindMethod("dumpEditingCallbacks", &TestRunner::dumpEditingCallbacks); | 225 bindMethod("dumpEditingCallbacks", &TestRunner::dumpEditingCallbacks); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 | 422 |
425 m_httpHeadersToClear.clear(); | 423 m_httpHeadersToClear.clear(); |
426 | 424 |
427 m_globalFlag.set(false); | 425 m_globalFlag.set(false); |
428 m_webHistoryItemCount.set(0); | 426 m_webHistoryItemCount.set(0); |
429 m_interceptPostMessage.set(false); | 427 m_interceptPostMessage.set(false); |
430 m_platformName.set("chromium"); | 428 m_platformName.set("chromium"); |
431 m_tooltipText.set(""); | 429 m_tooltipText.set(""); |
432 m_disableNotifyDone.set(false); | 430 m_disableNotifyDone.set(false); |
433 | 431 |
434 m_userStyleSheetLocation = WebURL(); | |
435 | |
436 m_webPermissions->reset(); | 432 m_webPermissions->reset(); |
437 | 433 |
438 m_notificationPresenter->reset(); | 434 m_notificationPresenter->reset(); |
439 | 435 |
440 m_pointerLocked = false; | 436 m_pointerLocked = false; |
441 m_pointerLockPlannedResult = PointerLockWillSucceed; | 437 m_pointerLockPlannedResult = PointerLockWillSucceed; |
442 | 438 |
443 m_taskList.revokeAll(); | 439 m_taskList.revokeAll(); |
444 m_workQueue.reset(); | 440 m_workQueue.reset(); |
445 | 441 |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 return; | 1287 return; |
1292 result->set(frame->hasCustomPageSizeStyle(pageIndex)); | 1288 result->set(frame->hasCustomPageSizeStyle(pageIndex)); |
1293 } | 1289 } |
1294 | 1290 |
1295 void TestRunner::forceRedSelectionColors(const CppArgumentList& arguments, CppVa
riant* result) | 1291 void TestRunner::forceRedSelectionColors(const CppArgumentList& arguments, CppVa
riant* result) |
1296 { | 1292 { |
1297 result->setNull(); | 1293 result->setNull(); |
1298 m_webView->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, 0xffc0c0c0
); | 1294 m_webView->setSelectionColors(0xffee0000, 0xff00ee00, 0xff000000, 0xffc0c0c0
); |
1299 } | 1295 } |
1300 | 1296 |
1301 void TestRunner::addUserStyleSheet(const CppArgumentList& arguments, CppVariant*
result) | 1297 void TestRunner::injectStyleSheet(const CppArgumentList& arguments, CppVariant*
result) |
1302 { | 1298 { |
1303 result->setNull(); | 1299 result->setNull(); |
1304 if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isBool
()) | 1300 if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isBool
()) |
1305 return; | 1301 return; |
1306 WebView::injectStyleSheet( | 1302 WebView::injectStyleSheet( |
1307 cppVariantToWebString(arguments[0]), WebVector<WebString>(), | 1303 cppVariantToWebString(arguments[0]), WebVector<WebString>(), |
1308 arguments[1].toBoolean() ? WebView::InjectStyleInAllFrames : WebView::In
jectStyleInTopFrameOnly); | 1304 arguments[1].toBoolean() ? WebView::InjectStyleInAllFrames : WebView::In
jectStyleInTopFrameOnly); |
1309 } | 1305 } |
1310 | 1306 |
1311 void TestRunner::startSpeechInput(const CppArgumentList& arguments, CppVariant*
result) | 1307 void TestRunner::startSpeechInput(const CppArgumentList& arguments, CppVariant*
result) |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1572 orientation.hasGamma = arguments[4].toBoolean(); | 1568 orientation.hasGamma = arguments[4].toBoolean(); |
1573 orientation.gamma = arguments[5].toDouble(); | 1569 orientation.gamma = arguments[5].toDouble(); |
1574 | 1570 |
1575 // absolute | 1571 // absolute |
1576 orientation.hasAbsolute = arguments[6].toBoolean(); | 1572 orientation.hasAbsolute = arguments[6].toBoolean(); |
1577 orientation.absolute = arguments[7].toBoolean(); | 1573 orientation.absolute = arguments[7].toBoolean(); |
1578 | 1574 |
1579 m_delegate->setDeviceOrientationData(orientation); | 1575 m_delegate->setDeviceOrientationData(orientation); |
1580 } | 1576 } |
1581 | 1577 |
1582 void TestRunner::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppV
ariant* result) | |
1583 { | |
1584 if (arguments.size() > 0 && arguments[0].isBool()) { | |
1585 m_delegate->preferences()->userStyleSheetLocation = arguments[0].value.b
oolValue ? m_userStyleSheetLocation : WebURL(); | |
1586 m_delegate->applyPreferences(); | |
1587 } | |
1588 result->setNull(); | |
1589 } | |
1590 | |
1591 void TestRunner::setUserStyleSheetLocation(const CppArgumentList& arguments, Cpp
Variant* result) | |
1592 { | |
1593 if (arguments.size() > 0 && arguments[0].isString()) { | |
1594 m_userStyleSheetLocation = m_delegate->localFileToDataURL(m_delegate->re
writeLayoutTestsURL(arguments[0].toString())); | |
1595 m_delegate->preferences()->userStyleSheetLocation = m_userStyleSheetLoca
tion; | |
1596 m_delegate->applyPreferences(); | |
1597 } | |
1598 result->setNull(); | |
1599 } | |
1600 | |
1601 void TestRunner::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVa
riant* result) | 1578 void TestRunner::setPopupBlockingEnabled(const CppArgumentList& arguments, CppVa
riant* result) |
1602 { | 1579 { |
1603 if (arguments.size() > 0 && arguments[0].isBool()) { | 1580 if (arguments.size() > 0 && arguments[0].isBool()) { |
1604 bool blockPopups = arguments[0].toBoolean(); | 1581 bool blockPopups = arguments[0].toBoolean(); |
1605 m_delegate->preferences()->javaScriptCanOpenWindowsAutomatically = !bloc
kPopups; | 1582 m_delegate->preferences()->javaScriptCanOpenWindowsAutomatically = !bloc
kPopups; |
1606 m_delegate->applyPreferences(); | 1583 m_delegate->applyPreferences(); |
1607 } | 1584 } |
1608 result->setNull(); | 1585 result->setNull(); |
1609 } | 1586 } |
1610 | 1587 |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2145 result->setNull(); | 2122 result->setNull(); |
2146 } | 2123 } |
2147 | 2124 |
2148 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp
Variant* result) | 2125 void TestRunner::setPointerLockWillFailSynchronously(const CppArgumentList&, Cpp
Variant* result) |
2149 { | 2126 { |
2150 m_pointerLockPlannedResult = PointerLockWillFailSync; | 2127 m_pointerLockPlannedResult = PointerLockWillFailSync; |
2151 result->setNull(); | 2128 result->setNull(); |
2152 } | 2129 } |
2153 | 2130 |
2154 } | 2131 } |
OLD | NEW |