Changeset 72591 in webkit
- Timestamp:
- Nov 23, 2010 2:01:52 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 40 edited
- 8 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r72590 r72591 1 2010-11-18 Satish Sampath <satish@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 For speech input event, send an event object containing all the recognition results and metadata. 6 https://bugs.webkit.org/show_bug.cgi?id=49736 7 8 * fast/speech/input-onspeechchange-event-expected.txt: Added. 9 * fast/speech/input-onspeechchange-event.html: New test to check multiple results. 10 * fast/speech/input-text-language-tag.html: Updated with new method signature. 11 * fast/speech/input-text-speechbutton.html: Ditto. 12 * fast/speech/speech-button-ignore-generated-events.html: Ditto. 13 1 14 2010-11-22 Alexey Proskuryakov <ap@apple.com> 2 15 -
trunk/LayoutTests/fast/speech/input-onspeechchange-event.html
r72590 r72591 9 9 <div id="console"></div> 10 10 <script type="text/javascript"> 11 description('Tests for speech button clickwith <input type="text" speech>.');11 description('Tests for the onspeechchange event with <input type="text" speech>.'); 12 12 13 function onWebkitSpeechChange() { 14 shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon'); 15 setTimeout(function() { 16 var input = document.getElementById('speechInput'); 17 input.dir = 'rtl'; 18 input.value = ''; 19 input.onwebkitspeechchange = function() { 20 shouldBeEqualToString('document.getElementById("speechInput").value', 21 'Pictures of the moon'); 22 finishJSTest(); 23 }; 24 25 var x = input.offsetLeft + 4; 26 var y = input.offsetTop + input.offsetHeight / 2; 27 eventSender.mouseMoveTo(x, y); 28 eventSender.mouseDown(); 29 eventSender.mouseUp(); 30 }, 50); 13 function onSpeechChange() { 14 shouldBeEqualToString('document.getElementById("speechInput").value', 'Green eggs and ham'); 15 shouldEvaluateTo('window.event.results.length', 3); 16 shouldBeEqualToString('window.event.results[0].utterance', 'Green eggs and ham'); 17 shouldEvaluateTo('window.event.results[0].confidence', 0.8); 18 shouldBeEqualToString('window.event.results[1].utterance', 'Green x and ham'); 19 shouldEvaluateTo('window.event.results[1].confidence', 0.5); 20 shouldBeEqualToString('window.event.results[2].utterance', '3 x and am'); 21 shouldEvaluateTo('window.event.results[2].confidence', 0.2); 22 finishJSTest(); 31 23 } 32 24 33 25 function run() { 34 26 if (window.layoutTestController && window.eventSender) { 35 layoutTestController.setMockSpeechInputResult('Pictures of the moon', ''); 27 layoutTestController.addMockSpeechInputResult('Green eggs and ham', 0.8, ''); 28 layoutTestController.addMockSpeechInputResult('Green x and ham', 0.5, ''); 29 layoutTestController.addMockSpeechInputResult('3 x and am', 0.2, ''); 36 30 37 31 // Clicking the speech button should fill in mock speech-recognized text. … … 50 44 </script> 51 45 <script src="../js/resources/js-test-post.js"></script> 52 <input id='speechInput' x-webkit-speech onwebkitspeechchange="on WebkitSpeechChange()">46 <input id='speechInput' x-webkit-speech onwebkitspeechchange="onSpeechChange()"> 53 47 </body> 54 48 </html> -
trunk/LayoutTests/fast/speech/input-text-language-tag.html
r70863 r72591 39 39 function run() { 40 40 if (window.layoutTestController && window.eventSender) { 41 layoutTestController. setMockSpeechInputResult('Pictures of the moon', 'en-GB');42 layoutTestController. setMockSpeechInputResult('月の写真', 'ja');41 layoutTestController.addMockSpeechInputResult('Pictures of the moon', 1.0, 'en-GB'); 42 layoutTestController.addMockSpeechInputResult('月の写真', 1.0, 'ja'); 43 43 speechButtonClick('speechInputNone'); 44 44 } -
trunk/LayoutTests/fast/speech/input-text-speechbutton.html
r70863 r72591 33 33 function run() { 34 34 if (window.layoutTestController && window.eventSender) { 35 layoutTestController. setMockSpeechInputResult('Pictures of the moon', '');35 layoutTestController.addMockSpeechInputResult('Pictures of the moon', 1.0, ''); 36 36 37 37 // Clicking the speech button should fill in mock speech-recognized text. -
trunk/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
r70863 r72591 50 50 if (window.layoutTestController && window.eventSender) { 51 51 // Running in DRT, test the eventSender case. 52 layoutTestController. setMockSpeechInputResult('Pictures of the moon', '');52 layoutTestController.addMockSpeechInputResult('Pictures of the moon', 1.0, ''); 53 53 document.getElementById('speechInput').onwebkitspeechchange = function() { 54 54 shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon'); -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r72565 r72591 3209 3209 BUGWK4989 WIN LINUX : fast/css/font-face-data-uri.html = TEXT 3210 3210 3211 // Remove these once the Chromium side has caught on with multiple speech input results. 3212 BUG49736 : fast/speech/input-onspeechchange-event.html = TEXT 3213 BUG49736 : fast/speech/input-text-language-tag.html = TEXT 3214 BUG49736 : fast/speech/input-text-speechbutton.html = TEXT 3215 BUG49736 : fast/speech/speech-button-ignore-generated-events.html = TEXT -
trunk/WebCore/CMakeLists.txt
r72590 r72591 331 331 page/PositionError.idl 332 332 page/Screen.idl 333 page/SpeechInputEvent.idl 334 page/SpeechInputResult.idl 335 page/SpeechInputResultList.idl 333 336 page/WebKitPoint.idl 334 337 page/WorkerNavigator.idl -
trunk/WebCore/ChangeLog
r72590 r72591 1 2010-11-18 Satish Sampath <satish@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 For speech input event, send an event object containing all the recognition results and metadata. 6 https://bugs.webkit.org/show_bug.cgi?id=49736 7 8 Currently the speech input event 'onwebkitspeechchange' receives no parameters. WebCore already 9 has the full list of recognition results and populates only the top result into the input field 10 automatically. In this patch we pass a SpeechInputEvent object to the event handler, and the JS 11 code can access the full list of results via "event.results.length", "results[i].utterance" and 12 "results[i].confidence". Also updated mock object with appropriate methods to test multiple results. 13 14 Test: fast/speech/input-onspeechchange-event.html 15 16 * CMakeLists.txt: 17 * GNUmakefile.am: 18 * WebCore.gypi: 19 * WebCore.pri: 20 * WebCore.pro: 21 * WebCore.xcodeproj/project.pbxproj: 22 * bindings/js/JSEventCustom.cpp: 23 (WebCore::toJS): Added new event 24 * bindings/v8/custom/V8EventCustom.cpp: 25 (WebCore::toV8): Added new event 26 * dom/Event.cpp: 27 (WebCore::Event::isSpeechInputEvent): 28 * dom/Event.h: 29 * html/HTMLInputElement.cpp: 30 * html/HTMLInputElement.h: 31 * page/SpeechInputEvent.h: New file implementing SpeechInputEvent.idl 32 (WebCore::SpeechInputEvent::~SpeechInputEvent): 33 (WebCore::SpeechInputEvent::create): 34 (WebCore::SpeechInputEvent::isSpeechInputEvent): 35 (WebCore::SpeechInputEvent::results): 36 (WebCore::SpeechInputEvent::SpeechInputEvent): 37 * page/SpeechInputEvent.idl: New file defining SpeechInputEvent object 38 * page/SpeechInputListener.h: 39 * page/SpeechInputResult.cpp: 40 (WebCore::SpeechInputResult::create): 41 * page/SpeechInputResult.h: 42 * page/SpeechInputResult.idl: New file defining a single SpeechInputResult object 43 * page/SpeechInputResultList.h: New file implementing SpeechInputResultList.idl 44 (WebCore::SpeechInputResultList::create): 45 (WebCore::SpeechInputResultList::length): 46 (WebCore::SpeechInputResultList::item): 47 (WebCore::SpeechInputResultList::SpeechInputResultList): 48 * page/SpeechInputResultList.idl: New file defining a list of SpeechInputResult objects 49 * platform/mock/SpeechInputClientMock.cpp: 50 (WebCore::SpeechInputClientMock::addRecognitionResult): Renamed method and added one parameter. 51 (WebCore::SpeechInputClientMock::clearResults): 52 (WebCore::SpeechInputClientMock::timerFired): 53 * platform/mock/SpeechInputClientMock.h: 54 * rendering/TextControlInnerElements.cpp: 55 (WebCore::InputFieldSpeechButtonElement::setRecognitionResult): Pass new event object to handler. 56 1 57 2010-11-22 Alexey Proskuryakov <ap@apple.com> 2 58 -
trunk/WebCore/DerivedSources.make
r72552 r72591 305 305 ScriptProfile \ 306 306 ScriptProfileNode \ 307 SpeechInputEvent \ 308 SpeechInputResult \ 309 SpeechInputResultList \ 307 310 SQLError \ 308 311 SQLException \ -
trunk/WebCore/GNUmakefile.am
r72590 r72591 498 498 DerivedSources/WebCore/JSSharedWorker.cpp \ 499 499 DerivedSources/WebCore/JSSharedWorker.h \ 500 DerivedSources/WebCore/JSSpeechInputEvent.cpp \ 501 DerivedSources/WebCore/JSSpeechInputEvent.h \ 502 DerivedSources/WebCore/JSSpeechInputResult.cpp \ 503 DerivedSources/WebCore/JSSpeechInputResult.h \ 504 DerivedSources/WebCore/JSSpeechInputResultList.cpp \ 505 DerivedSources/WebCore/JSSpeechInputResultList.h \ 500 506 DerivedSources/WebCore/JSStyleMedia.cpp \ 501 507 DerivedSources/WebCore/JSStyleMedia.h \ … … 2172 2178 WebCore/page/SpatialNavigation.h \ 2173 2179 WebCore/page/SpeechInputClient.h \ 2180 WebCore/page/SpeechInputEvent.cpp \ 2181 WebCore/page/SpeechInputEvent.h \ 2174 2182 WebCore/page/SpeechInput.cpp \ 2175 2183 WebCore/page/SpeechInput.h \ … … 2177 2185 WebCore/page/SpeechInputResult.cpp \ 2178 2186 WebCore/page/SpeechInputResult.h \ 2187 WebCore/page/SpeechInputResultList.cpp \ 2188 WebCore/page/SpeechInputResultList.h \ 2179 2189 WebCore/page/SuspendableTimer.cpp \ 2180 2190 WebCore/page/SuspendableTimer.h \ -
trunk/WebCore/WebCore.gypi
r72590 r72591 252 252 'page/PositionError.idl', 253 253 'page/Screen.idl', 254 'page/SpeechInputEvent.idl', 255 'page/SpeechInputResult.idl', 256 'page/SpeechInputResultList.idl', 254 257 'page/WebKitPoint.idl', 255 258 'page/WorkerNavigator.idl', … … 2304 2307 'page/SpeechInput.h', 2305 2308 'page/SpeechInputClient.h', 2309 'page/SpeechInputEvent.cpp', 2310 'page/SpeechInputEvent.h', 2306 2311 'page/SpeechInputListener.h', 2307 2312 'page/SpeechInputResult.cpp', 2308 2313 'page/SpeechInputResult.h', 2314 'page/SpeechInputResultList.cpp', 2315 'page/SpeechInputResultList.h', 2309 2316 'page/SuspendableTimer.cpp', 2310 2317 'page/SuspendableTimer.h', -
trunk/WebCore/WebCore.pri
r72552 r72591 313 313 page/PositionError.idl \ 314 314 page/Screen.idl \ 315 page/SpeechInputEvent.idl \ 316 page/SpeechInputResult.idl \ 317 page/SpeechInputResultList.idl \ 315 318 page/WebKitPoint.idl \ 316 319 page/WorkerNavigator.idl \ -
trunk/WebCore/WebCore.pro
r72590 r72591 2026 2026 page/SpeechInput.h \ 2027 2027 page/SpeechInputClient.h \ 2028 page/SpeechInputEvent.h \ 2028 2029 page/SpeechInputListener.h \ 2029 2030 page/SpeechInputResult.h \ 2031 page/SpeechInputResultList.h \ 2030 2032 page/WindowFeatures.h \ 2031 2033 page/WorkerNavigator.h \ … … 3150 3152 SOURCES += \ 3151 3153 page/SpeechInput.cpp \ 3154 page/SpeechInputEvent.cpp \ 3152 3155 page/SpeechInputResult.cpp \ 3156 page/SpeechInputResultList.cpp \ 3153 3157 rendering/RenderInputSpeech.cpp 3154 3158 } -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r72590 r72591 1513 1513 754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */; }; 1514 1514 754133AA102E00F400075D00 /* InspectorTimelineAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */; }; 1515 75415AFD12958D5E003AD669 /* SpeechInputEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415AF812958D5E003AD669 /* SpeechInputEvent.h */; }; 1516 75415B0012958D5E003AD669 /* SpeechInputResultList.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415AFB12958D5E003AD669 /* SpeechInputResultList.h */; }; 1517 75415C28129A9920003AD669 /* SpeechInputEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415C26129A9920003AD669 /* SpeechInputEvent.cpp */; }; 1518 75415C29129A9920003AD669 /* SpeechInputResultList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415C27129A9920003AD669 /* SpeechInputResultList.cpp */; }; 1519 75415D55129AB2D2003AD669 /* JSSpeechInputEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415D4F129AB2D2003AD669 /* JSSpeechInputEvent.cpp */; }; 1520 75415D56129AB2D2003AD669 /* JSSpeechInputEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415D50129AB2D2003AD669 /* JSSpeechInputEvent.h */; }; 1521 75415D57129AB2D2003AD669 /* JSSpeechInputResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415D51129AB2D2003AD669 /* JSSpeechInputResult.cpp */; }; 1522 75415D58129AB2D2003AD669 /* JSSpeechInputResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415D52129AB2D2003AD669 /* JSSpeechInputResult.h */; }; 1523 75415D59129AB2D2003AD669 /* JSSpeechInputResultList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75415D53129AB2D2003AD669 /* JSSpeechInputResultList.cpp */; }; 1524 75415D5A129AB2D2003AD669 /* JSSpeechInputResultList.h in Headers */ = {isa = PBXBuildFile; fileRef = 75415D54129AB2D2003AD669 /* JSSpeechInputResultList.h */; }; 1515 1525 7553CFE8108F473F00EA281E /* TimelineRecordFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */; }; 1516 1526 7553CFE9108F473F00EA281E /* TimelineRecordFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */; }; … … 7671 7681 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTimelineAgent.h; sourceTree = "<group>"; }; 7672 7682 754133A9102E00F400075D00 /* InspectorTimelineAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTimelineAgent.cpp; sourceTree = "<group>"; }; 7683 75415AF812958D5E003AD669 /* SpeechInputEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputEvent.h; sourceTree = "<group>"; }; 7684 75415AF912958D5E003AD669 /* SpeechInputEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SpeechInputEvent.idl; sourceTree = "<group>"; }; 7685 75415AFA12958D5E003AD669 /* SpeechInputResult.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SpeechInputResult.idl; sourceTree = "<group>"; }; 7686 75415AFB12958D5E003AD669 /* SpeechInputResultList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpeechInputResultList.h; sourceTree = "<group>"; }; 7687 75415AFC12958D5E003AD669 /* SpeechInputResultList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SpeechInputResultList.idl; sourceTree = "<group>"; }; 7688 75415C26129A9920003AD669 /* SpeechInputEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInputEvent.cpp; sourceTree = "<group>"; }; 7689 75415C27129A9920003AD669 /* SpeechInputResultList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpeechInputResultList.cpp; sourceTree = "<group>"; }; 7690 75415D4F129AB2D2003AD669 /* JSSpeechInputEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSpeechInputEvent.cpp; sourceTree = "<group>"; }; 7691 75415D50129AB2D2003AD669 /* JSSpeechInputEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSpeechInputEvent.h; sourceTree = "<group>"; }; 7692 75415D51129AB2D2003AD669 /* JSSpeechInputResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSpeechInputResult.cpp; sourceTree = "<group>"; }; 7693 75415D52129AB2D2003AD669 /* JSSpeechInputResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSpeechInputResult.h; sourceTree = "<group>"; }; 7694 75415D53129AB2D2003AD669 /* JSSpeechInputResultList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSpeechInputResultList.cpp; sourceTree = "<group>"; }; 7695 75415D54129AB2D2003AD669 /* JSSpeechInputResultList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSpeechInputResultList.h; sourceTree = "<group>"; }; 7673 7696 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimelineRecordFactory.h; sourceTree = "<group>"; }; 7674 7697 7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimelineRecordFactory.cpp; sourceTree = "<group>"; }; … … 13341 13364 7578F90911DDF26900D933C5 /* SpeechInput.h */, 13342 13365 7578F90A11DDF26900D933C5 /* SpeechInputClient.h */, 13366 75415C26129A9920003AD669 /* SpeechInputEvent.cpp */, 13367 75415AF812958D5E003AD669 /* SpeechInputEvent.h */, 13368 75415AF912958D5E003AD669 /* SpeechInputEvent.idl */, 13343 13369 7578F91E11E4E32800D933C5 /* SpeechInputListener.h */, 13344 13370 758978EA127090D60076D5A9 /* SpeechInputResult.cpp */, 13345 13371 758978EB127090D60076D5A9 /* SpeechInputResult.h */, 13372 75415AFA12958D5E003AD669 /* SpeechInputResult.idl */, 13373 75415C27129A9920003AD669 /* SpeechInputResultList.cpp */, 13374 75415AFB12958D5E003AD669 /* SpeechInputResultList.h */, 13375 75415AFC12958D5E003AD669 /* SpeechInputResultList.idl */, 13346 13376 62C1217A11AB9E76003C462C /* SuspendableTimer.cpp */, 13347 13377 62C1217B11AB9E77003C462C /* SuspendableTimer.h */, … … 15895 15925 E4B423850CBFB73C00AF2ECE /* JSProgressEvent.cpp */, 15896 15926 E4B423860CBFB73C00AF2ECE /* JSProgressEvent.h */, 15927 75415D4F129AB2D2003AD669 /* JSSpeechInputEvent.cpp */, 15928 75415D50129AB2D2003AD669 /* JSSpeechInputEvent.h */, 15929 75415D51129AB2D2003AD669 /* JSSpeechInputResult.cpp */, 15930 75415D52129AB2D2003AD669 /* JSSpeechInputResult.h */, 15931 75415D53129AB2D2003AD669 /* JSSpeechInputResultList.cpp */, 15932 75415D54129AB2D2003AD669 /* JSSpeechInputResultList.h */, 15897 15933 65DF31EF09D1CC60000BE325 /* JSText.cpp */, 15898 15934 65DF31F009D1CC60000BE325 /* JSText.h */, … … 21352 21388 D3A94A47122DC40F00A37BBC /* JSMediaQueryList.h in Headers */, 21353 21389 D3AA10F4123A98AA0092152B /* MediaQueryMatcher.h in Headers */, 21390 75415AFD12958D5E003AD669 /* SpeechInputEvent.h in Headers */, 21391 75415B0012958D5E003AD669 /* SpeechInputResultList.h in Headers */, 21392 75415D56129AB2D2003AD669 /* JSSpeechInputEvent.h in Headers */, 21393 75415D58129AB2D2003AD669 /* JSSpeechInputResult.h in Headers */, 21394 75415D5A129AB2D2003AD669 /* JSSpeechInputResultList.h in Headers */, 21354 21395 ); 21355 21396 runOnlyForDeploymentPostprocessing = 0; … … 23921 23962 D3AA10F3123A98AA0092152B /* MediaQueryMatcher.cpp in Sources */, 23922 23963 D340629B1253BC8C009E4259 /* MediaQueryListListener.cpp in Sources */, 23964 75415C28129A9920003AD669 /* SpeechInputEvent.cpp in Sources */, 23965 75415C29129A9920003AD669 /* SpeechInputResultList.cpp in Sources */, 23966 75415D55129AB2D2003AD669 /* JSSpeechInputEvent.cpp in Sources */, 23967 75415D57129AB2D2003AD669 /* JSSpeechInputResult.cpp in Sources */, 23968 75415D59129AB2D2003AD669 /* JSSpeechInputResultList.cpp in Sources */, 23923 23969 ); 23924 23970 runOnlyForDeploymentPostprocessing = 0; -
trunk/WebCore/bindings/js/JSEventCustom.cpp
r72048 r72591 52 52 #include "JSPopStateEvent.h" 53 53 #include "JSProgressEvent.h" 54 #include "JSSpeechInputEvent.h" 54 55 #include "JSTextEvent.h" 55 56 #include "JSUIEvent.h" … … 69 70 #include "PopStateEvent.h" 70 71 #include "ProgressEvent.h" 72 #include "SpeechInputEvent.h" 71 73 #include "TextEvent.h" 72 74 #include "UIEvent.h" … … 194 196 wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, AudioProcessingEvent, event); 195 197 #endif 198 #if ENABLE(INPUT_SPEECH) 199 else if (event->isSpeechInputEvent()) 200 wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, SpeechInputEvent, event); 201 #endif 196 202 else 197 203 wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, Event, event); -
trunk/WebCore/bindings/v8/custom/V8EventCustom.cpp
r72048 r72591 56 56 #include "V8ProgressEvent.h" 57 57 #include "V8Proxy.h" 58 #include "V8SpeechInputEvent.h" 58 59 #include "V8StorageEvent.h" 59 60 #include "V8TextEvent.h" … … 173 174 return toV8(static_cast<AudioProcessingEvent*>(impl)); 174 175 #endif 176 #if ENABLE(INPUT_SPEECH) 177 if (impl->isSpeechInputEvent()) 178 return toV8(static_cast<SpeechInputEvent*>(impl)); 179 #endif 175 180 if (impl->isCustomEvent()) 176 181 return toV8(static_cast<CustomEvent*>(impl)); -
trunk/WebCore/dom/Event.cpp
r72048 r72591 237 237 #endif 238 238 239 #if ENABLE(INPUT_SPEECH) 240 bool Event::isSpeechInputEvent() const 241 { 242 return false; 243 } 244 #endif 245 239 246 bool Event::fromUserGesture() 240 247 { -
trunk/WebCore/dom/Event.h
r72048 r72591 143 143 virtual bool isDeviceOrientationEvent() const; 144 144 #endif 145 #if ENABLE(INPUT_SPEECH) 146 virtual bool isSpeechInputEvent() const; 147 #endif 145 148 bool fromUserGesture(); 146 149 -
trunk/WebCore/html/HTMLInputElement.cpp
r72377 r72591 1938 1938 } 1939 1939 1940 void HTMLInputElement::dispatchWebkitSpeechChangeEvent()1941 {1942 ASSERT(isSpeechEnabled());1943 dispatchEvent(Event::create(eventNames().webkitspeechchangeEvent, true, false));1944 }1945 1940 #endif 1946 1941 -
trunk/WebCore/html/HTMLInputElement.h
r72363 r72591 109 109 #if ENABLE(INPUT_SPEECH) 110 110 virtual bool isSpeechEnabled() const; 111 void dispatchWebkitSpeechChangeEvent();112 111 #endif 113 112 -
trunk/WebCore/page/SpeechInputEvent.cpp
r72590 r72591 29 29 */ 30 30 31 #i fndef WebSpeechInputControllerMock_h32 # define WebSpeechInputControllerMock_h31 #include "config.h" 32 #include "SpeechInputEvent.h" 33 33 34 #i nclude "WebSpeechInputController.h"34 #if ENABLE(INPUT_SPEECH) 35 35 36 namespace Web Kit{36 namespace WebCore { 37 37 38 class WebString; 39 class WebSpeechInputListener; 38 PassRefPtr<SpeechInputEvent> SpeechInputEvent::create(const AtomicString& eventType, const SpeechInputResultArray& results) 39 { 40 return adoptRef(new SpeechInputEvent(eventType, results)); 41 } 40 42 41 class WebSpeechInputControllerMock : public WebSpeechInputController { 42 public: 43 WEBKIT_API static WebSpeechInputControllerMock* create( 44 WebSpeechInputListener* listener); 45 virtual ~WebSpeechInputControllerMock() { } 43 SpeechInputEvent::~SpeechInputEvent() { 44 } 46 45 47 virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0; 46 SpeechInputEvent::SpeechInputEvent(const AtomicString& eventType, const SpeechInputResultArray& results) 47 : Event(eventType, true, false) // Can bubble, not cancelable 48 , m_results(SpeechInputResultList::create(results)) 49 { 50 } 48 51 49 virtual void clearResults() = 0; 50 }; 52 } // namespace WebCore 51 53 52 } // namespace WebKit 53 54 #endif 54 #endif // ENABLE(INPUT_SPEECH) -
trunk/WebCore/page/SpeechInputEvent.h
r72590 r72591 24 24 */ 25 25 26 #ifndef SpeechInput Result_h27 #define SpeechInput Result_h26 #ifndef SpeechInputEvent_h 27 #define SpeechInputEvent_h 28 28 29 29 #if ENABLE(INPUT_SPEECH) 30 30 31 #include "PlatformString.h" 31 #include "Event.h" 32 #include "SpeechInputResultList.h" 33 32 34 #include <wtf/PassRefPtr.h> 33 35 #include <wtf/RefCounted.h> 36 #include <wtf/Vector.h> 34 37 35 38 namespace WebCore { 36 39 37 // This class holds one speech recognition result including the text and other related 38 // fields, as received from the embedder. 39 class SpeechInputResult : public RefCounted<SpeechInputResult> { 40 class SpeechInputEvent : public Event { 40 41 public: 41 static PassRefPtr<SpeechInputResult> create(const String& utterance, double confidence); 42 static PassRefPtr<SpeechInputEvent> create(const AtomicString& eventType, const SpeechInputResultArray& results); 43 ~SpeechInputEvent(); 42 44 43 double confidence() const; 44 const String& utterance() const; 45 virtual bool isSpeechInputEvent() const { return true; } 46 47 SpeechInputResultList* results() const { return m_results.get(); } 45 48 46 49 private: 47 SpeechInput Result(const String& utterance, double confidence);50 SpeechInputEvent(const AtomicString& eventType, const SpeechInputResultArray& results); 48 51 49 String m_utterance; 50 double m_confidence; 52 RefPtr<SpeechInputResultList> m_results; 51 53 }; 52 54 … … 55 57 #endif // ENABLE(INPUT_SPEECH) 56 58 57 #endif // SpeechInput Result_h59 #endif // SpeechInputEvent_h -
trunk/WebCore/page/SpeechInputEvent.idl
r72590 r72591 24 24 */ 25 25 26 #include "config.h" 27 #include "SpeechInputResult.h" 26 module core { 28 27 29 #if ENABLE(INPUT_SPEECH) 28 interface [ 29 Conditional=INPUT_SPEECH 30 ] SpeechInputEvent : Event { 31 readonly attribute SpeechInputResultList results; 32 }; 30 33 31 namespace WebCore {32 33 PassRefPtr<SpeechInputResult> SpeechInputResult::create(const String& utterance, double confidence)34 {35 return adoptRef(new SpeechInputResult(utterance, confidence));36 34 } 37 38 SpeechInputResult::SpeechInputResult(const String& utterance, double confidence)39 : m_utterance(utterance)40 , m_confidence(confidence)41 {42 }43 44 double SpeechInputResult::confidence() const45 {46 return m_confidence;47 }48 49 const String& SpeechInputResult::utterance() const50 {51 return m_utterance;52 }53 54 } // namespace WebCore55 56 #endif // ENABLE(INPUT_SPEECH) -
trunk/WebCore/page/SpeechInputListener.h
r70490 r72591 39 39 namespace WebCore { 40 40 41 typedef Vector<RefPtr<SpeechInputResult> > SpeechInputResultArray;42 43 41 // Interface to be implemented by the element which invokes SpeechInput. 44 42 class SpeechInputListener { -
trunk/WebCore/page/SpeechInputResult.cpp
r70490 r72591 36 36 } 37 37 38 PassRefPtr<SpeechInputResult> SpeechInputResult::create(const SpeechInputResult& source) 39 { 40 return adoptRef(new SpeechInputResult(source.m_utterance, source.m_confidence)); 41 } 42 38 43 SpeechInputResult::SpeechInputResult(const String& utterance, double confidence) 39 44 : m_utterance(utterance) -
trunk/WebCore/page/SpeechInputResult.h
r70490 r72591 39 39 class SpeechInputResult : public RefCounted<SpeechInputResult> { 40 40 public: 41 static PassRefPtr<SpeechInputResult> create(const SpeechInputResult& source); 41 42 static PassRefPtr<SpeechInputResult> create(const String& utterance, double confidence); 42 43 … … 51 52 }; 52 53 54 typedef Vector<RefPtr<SpeechInputResult> > SpeechInputResultArray; 55 53 56 } // namespace WebCore 54 57 -
trunk/WebCore/page/SpeechInputResult.idl
r72590 r72591 24 24 */ 25 25 26 #include "config.h" 27 #include "SpeechInputResult.h" 26 module core { 28 27 29 #if ENABLE(INPUT_SPEECH) 28 interface [ 29 Conditional=INPUT_SPEECH 30 ] SpeechInputResult { 31 readonly attribute DOMString utterance; 32 readonly attribute float confidence; 33 }; 30 34 31 namespace WebCore {32 33 PassRefPtr<SpeechInputResult> SpeechInputResult::create(const String& utterance, double confidence)34 {35 return adoptRef(new SpeechInputResult(utterance, confidence));36 35 } 37 38 SpeechInputResult::SpeechInputResult(const String& utterance, double confidence)39 : m_utterance(utterance)40 , m_confidence(confidence)41 {42 }43 44 double SpeechInputResult::confidence() const45 {46 return m_confidence;47 }48 49 const String& SpeechInputResult::utterance() const50 {51 return m_utterance;52 }53 54 } // namespace WebCore55 56 #endif // ENABLE(INPUT_SPEECH) -
trunk/WebCore/page/SpeechInputResultList.cpp
r72590 r72591 29 29 */ 30 30 31 #i fndef WebSpeechInputControllerMock_h32 # define WebSpeechInputControllerMock_h31 #include "config.h" 32 #include "SpeechInputResultList.h" 33 33 34 #i nclude "WebSpeechInputController.h"34 #if ENABLE(INPUT_SPEECH) 35 35 36 namespace Web Kit{36 namespace WebCore { 37 37 38 class WebString; 39 class WebSpeechInputListener; 38 PassRefPtr<SpeechInputResultList> SpeechInputResultList::create(const SpeechInputResultArray& results) 39 { 40 return adoptRef(new SpeechInputResultList(results)); 41 } 40 42 41 class WebSpeechInputControllerMock : public WebSpeechInputController { 42 public: 43 WEBKIT_API static WebSpeechInputControllerMock* create( 44 WebSpeechInputListener* listener); 45 virtual ~WebSpeechInputControllerMock() { } 43 SpeechInputResult* SpeechInputResultList::item(unsigned index) 44 { 45 return index >= m_results.size() ? 0 : m_results[index].get(); 46 } 46 47 47 virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0; 48 SpeechInputResultList::SpeechInputResultList(const SpeechInputResultArray& results) 49 : m_results(results) // Takes a copy of the array of RefPtrs. 50 { 51 } 48 52 49 virtual void clearResults() = 0; 50 }; 53 } // namespace WebCore 51 54 52 } // namespace WebKit 53 54 #endif 55 #endif // ENABLE(INPUT_SPEECH) -
trunk/WebCore/page/SpeechInputResultList.h
r72590 r72591 24 24 */ 25 25 26 #ifndef SpeechInputResult _h27 #define SpeechInputResult _h26 #ifndef SpeechInputResultList_h 27 #define SpeechInputResultList_h 28 28 29 29 #if ENABLE(INPUT_SPEECH) 30 30 31 #include "PlatformString.h" 31 #include "SpeechInputResult.h" 32 32 33 #include <wtf/PassRefPtr.h> 33 34 #include <wtf/RefCounted.h> 35 #include <wtf/Vector.h> 34 36 35 37 namespace WebCore { 36 38 37 // This class holds one speech recognition result including the text and other related 38 // fields, as received from the embedder. 39 class SpeechInputResult : public RefCounted<SpeechInputResult> { 39 class SpeechInputResultList : public RefCounted<SpeechInputResultList> { 40 40 public: 41 static PassRefPtr<SpeechInputResult > create(const String& utterance, double confidence);41 static PassRefPtr<SpeechInputResultList> create(const SpeechInputResultArray& results); 42 42 43 double confidence() const; 44 const String& utterance() const; 43 // Methods from the IDL. 44 size_t length() { return m_results.size(); } 45 SpeechInputResult* item(unsigned index); 45 46 46 47 private: 47 SpeechInputResult (const String& utterance, double confidence);48 SpeechInputResultList(const SpeechInputResultArray& results); 48 49 49 String m_utterance; 50 double m_confidence; 50 SpeechInputResultArray m_results; 51 51 }; 52 52 … … 55 55 #endif // ENABLE(INPUT_SPEECH) 56 56 57 #endif // SpeechInputResult _h57 #endif // SpeechInputResultList_h -
trunk/WebCore/page/SpeechInputResultList.idl
r72590 r72591 24 24 */ 25 25 26 #include "config.h" 27 #include "SpeechInputResult.h" 26 module core { 28 27 29 #if ENABLE(INPUT_SPEECH) 28 interface [ 29 HasIndexGetter, 30 Conditional=INPUT_SPEECH 31 ] SpeechInputResultList { 32 readonly attribute unsigned long length; 33 SpeechInputResult item(in [IsIndex] unsigned long index); 34 }; 30 35 31 namespace WebCore {32 33 PassRefPtr<SpeechInputResult> SpeechInputResult::create(const String& utterance, double confidence)34 {35 return adoptRef(new SpeechInputResult(utterance, confidence));36 36 } 37 38 SpeechInputResult::SpeechInputResult(const String& utterance, double confidence)39 : m_utterance(utterance)40 , m_confidence(confidence)41 {42 }43 44 double SpeechInputResult::confidence() const45 {46 return m_confidence;47 }48 49 const String& SpeechInputResult::utterance() const50 {51 return m_utterance;52 }53 54 } // namespace WebCore55 56 #endif // ENABLE(INPUT_SPEECH) -
trunk/WebCore/platform/mock/SpeechInputClientMock.cpp
r72206 r72591 82 82 } 83 83 84 void SpeechInputClientMock:: setRecognitionResult(const String& result, const AtomicString& language)84 void SpeechInputClientMock::addRecognitionResult(const String& result, double confidence, const AtomicString& language) 85 85 { 86 86 if (language.isEmpty()) 87 m_resultForEmptyLanguage = result; 88 else 89 m_recognitionResult.set(language, result); 87 m_resultsForEmptyLanguage.append(SpeechInputResult::create(result, confidence)); 88 else { 89 if (!m_recognitionResults.contains(language)) 90 m_recognitionResults.set(language, SpeechInputResultArray()); 91 m_recognitionResults.find(language)->second.append(SpeechInputResult::create(result, confidence)); 92 } 90 93 } 91 94 92 95 void SpeechInputClientMock::clearResults() 93 96 { 94 m_result ForEmptyLanguage = String();95 m_recognitionResult .clear();97 m_resultsForEmptyLanguage.clear(); 98 m_recognitionResults.clear(); 96 99 } 97 100 … … 103 106 m_timer.startOneShot(0); 104 107 } else { 105 SpeechInputResultArray results;106 108 bool noResultsFound = false; 107 109 108 110 // Empty language case must be handled separately to avoid problems with HashMap and empty keys. 109 111 if (m_language.isEmpty()) { 110 if (!m_result ForEmptyLanguage.isNull())111 results.append(SpeechInputResult::create(m_resultForEmptyLanguage, 1.0));112 if (!m_resultsForEmptyLanguage.isEmpty()) 113 m_listener->setRecognitionResult(m_requestId, m_resultsForEmptyLanguage); 112 114 else 113 115 noResultsFound = true; 114 116 } else { 115 if (m_recognitionResult .contains(m_language))116 results.append(SpeechInputResult::create(m_recognitionResult.get(m_language), 1.0));117 if (m_recognitionResults.contains(m_language)) 118 m_listener->setRecognitionResult(m_requestId, m_recognitionResults.get(m_language)); 117 119 else 118 120 noResultsFound = true; … … 125 127 error.append(m_language); 126 128 error.append("'"); 129 SpeechInputResultArray results; 127 130 results.append(SpeechInputResult::create(error, 1.0)); 131 m_listener->setRecognitionResult(m_requestId, results); 128 132 } 129 133 130 m_listener->setRecognitionResult(m_requestId, results);131 134 m_listener->didCompleteRecognition(m_requestId); 132 135 m_requestId = 0; -
trunk/WebCore/platform/mock/SpeechInputClientMock.h
r72206 r72591 34 34 #include "PlatformString.h" 35 35 #include "SpeechInputClient.h" 36 #include "SpeechInputResult.h" 36 37 #include "Timer.h" 37 38 #include <wtf/HashMap.h> … … 49 50 SpeechInputClientMock(); 50 51 51 void setRecognitionResult(const String& result, const AtomicString& language);52 void addRecognitionResult(const String& result, double confidence, const AtomicString& language); 52 53 void clearResults(); 53 54 … … 66 67 int m_requestId; 67 68 68 HashMap<String, S tring> m_recognitionResult;69 HashMap<String, SpeechInputResultArray> m_recognitionResults; 69 70 AtomicString m_language; 70 S tring m_resultForEmptyLanguage;71 SpeechInputResultArray m_resultsForEmptyLanguage; 71 72 }; 72 73 -
trunk/WebCore/rendering/TextControlInnerElements.cpp
r72052 r72591 42 42 #include "ScrollbarTheme.h" 43 43 #include "SpeechInput.h" 44 #include "SpeechInputEvent.h" 44 45 45 46 namespace WebCore { … … 479 480 RefPtr<HTMLInputElement> holdRef(input); 480 481 input->setValue(results.isEmpty() ? "" : results[0]->utterance()); 481 input->dispatch WebkitSpeechChangeEvent();482 input->dispatchEvent(SpeechInputEvent::create(eventNames().webkitspeechchangeEvent, results)); 482 483 renderer()->repaint(); 483 484 } -
trunk/WebKit/chromium/ChangeLog
r72587 r72591 1 2010-11-18 Satish Sampath <satish@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 For speech input event, send an event object containing all the recognition results and metadata. 6 https://bugs.webkit.org/show_bug.cgi?id=49736 7 8 Updated mock object's method to new signature. 9 10 * public/WebSpeechInputControllerMock.h: 11 * src/WebSpeechInputControllerMockImpl.cpp: 12 (WebKit::WebSpeechInputControllerMockImpl::addMockRecognitionResult): 13 * src/WebSpeechInputControllerMockImpl.h: 14 1 15 2010-11-22 Alexey Marinichev <amarinichev@chromium.org> 2 16 -
trunk/WebKit/chromium/public/WebSpeechInputControllerMock.h
r72206 r72591 45 45 virtual ~WebSpeechInputControllerMock() { } 46 46 47 virtual void setMockRecognitionResult(const WebString& result, const WebString& language) = 0;47 virtual void addMockRecognitionResult(const WebString& result, double confidence, const WebString& language) = 0; 48 48 49 49 virtual void clearResults() = 0; -
trunk/WebKit/chromium/src/WebSpeechInputControllerMockImpl.cpp
r72206 r72591 56 56 } 57 57 58 void WebSpeechInputControllerMockImpl:: setMockRecognitionResult(const WebString& result, const WebString &language)58 void WebSpeechInputControllerMockImpl::addMockRecognitionResult(const WebString& result, double confidence, const WebString &language) 59 59 { 60 m_webcoreMock-> setRecognitionResult(result, language);60 m_webcoreMock->addRecognitionResult(result, confidence, language); 61 61 } 62 62 -
trunk/WebKit/chromium/src/WebSpeechInputControllerMockImpl.h
r72206 r72591 63 63 64 64 // WebSpeechInputControllerMock methods. 65 void setMockRecognitionResult(const WebString& result, const WebString& language);65 void addMockRecognitionResult(const WebString& result, double confidence, const WebString& language); 66 66 void clearResults(); 67 67 -
trunk/WebKitTools/ChangeLog
r72576 r72591 1 2010-11-18 Satish Sampath <satish@chromium.org> 2 3 Reviewed by Jeremy Orlow. 4 5 For speech input event, send an event object containing all the recognition results and metadata. 6 https://bugs.webkit.org/show_bug.cgi?id=49736 7 8 Updated DRT by renaming the mock result method on all platforms to the new signature. 9 10 * DumpRenderTree/LayoutTestController.cpp: 11 (addMockSpeechInputResultCallback): 12 (LayoutTestController::staticFunctions): 13 * DumpRenderTree/LayoutTestController.h: 14 * DumpRenderTree/chromium/LayoutTestController.cpp: 15 (LayoutTestController::LayoutTestController): 16 (LayoutTestController::addMockSpeechInputResult): 17 * DumpRenderTree/chromium/LayoutTestController.h: 18 * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp: 19 (LayoutTestController::addMockSpeechInputResult): 20 * DumpRenderTree/mac/LayoutTestControllerMac.mm: 21 (LayoutTestController::addMockSpeechInputResult): 22 * DumpRenderTree/qt/LayoutTestControllerQt.cpp: 23 (LayoutTestController::addMockSpeechInputResult): 24 * DumpRenderTree/qt/LayoutTestControllerQt.h: 25 * DumpRenderTree/win/LayoutTestControllerWin.cpp: 26 (LayoutTestController::addMockSpeechInputResult): 27 * DumpRenderTree/wx/LayoutTestControllerWx.cpp: 28 (LayoutTestController::addMockSpeechInputResult): 29 1 30 2010-11-22 Dirk Pranke <dpranke@chromium.org> 2 31 -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.cpp
r72441 r72591 1077 1077 } 1078 1078 1079 static JSValueRef setMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)1080 { 1081 if (argumentCount < 2)1079 static JSValueRef addMockSpeechInputResultCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) 1080 { 1081 if (argumentCount < 3) 1082 1082 return JSValueMakeUndefined(context); 1083 1083 … … 1085 1085 ASSERT(!*exception); 1086 1086 1087 JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[1], exception)); 1088 ASSERT(!*exception); 1089 1090 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 1091 controller->setMockSpeechInputResult(result.get(), language.get()); 1087 double confidence = JSValueToNumber(context, arguments[1], exception); 1088 1089 JSRetainPtr<JSStringRef> language(Adopt, JSValueToStringCopy(context, arguments[2], exception)); 1090 ASSERT(!*exception); 1091 1092 LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject)); 1093 controller->addMockSpeechInputResult(result.get(), confidence, language.get()); 1092 1094 1093 1095 return JSValueMakeUndefined(context); … … 1974 1976 { "setMockGeolocationError", setMockGeolocationErrorCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1975 1977 { "setMockGeolocationPosition", setMockGeolocationPositionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1976 { " setMockSpeechInputResult", setMockSpeechInputResultCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },1978 { "addMockSpeechInputResult", addMockSpeechInputResultCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1977 1979 { "setNewWindowsCopyBackForwardList", setNewWindowsCopyBackForwardListCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, 1978 1980 { "setPOSIXLocale", setPOSIXLocaleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -
trunk/WebKitTools/DumpRenderTree/LayoutTestController.h
r70863 r72591 95 95 void setMockGeolocationError(int code, JSStringRef message); 96 96 void setMockGeolocationPosition(double latitude, double longitude, double accuracy); 97 void setMockSpeechInputResult(JSStringRef result, JSStringRef language);97 void addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language); 98 98 void setPersistentUserStyleSheetLocation(JSStringRef path); 99 99 void setPluginsEnabled(bool flag); -
trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
r72441 r72591 151 151 bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError); 152 152 bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition); 153 bindMethod(" setMockSpeechInputResult", &LayoutTestController::setMockSpeechInputResult);153 bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult); 154 154 bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled); 155 155 bindMethod("setPOSIXLocale", &LayoutTestController::setPOSIXLocale); … … 1538 1538 } 1539 1539 1540 void LayoutTestController:: setMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result)1541 { 1542 result->setNull(); 1543 if (arguments.size() < 2 || !arguments[0].isString() || !arguments[1].isString())1544 return; 1545 1546 m_shell->webViewHost()->speechInputControllerMock()-> setMockRecognitionResult(cppVariantToWebString(arguments[0]), cppVariantToWebString(arguments[1]));1540 void LayoutTestController::addMockSpeechInputResult(const CppArgumentList& arguments, CppVariant* result) 1541 { 1542 result->setNull(); 1543 if (arguments.size() < 3 || !arguments[0].isString() || !arguments[1].isNumber() || !arguments[2].isString()) 1544 return; 1545 1546 m_shell->webViewHost()->speechInputControllerMock()->addMockRecognitionResult(cppVariantToWebString(arguments[0]), arguments[1].toDouble(), cppVariantToWebString(arguments[2])); 1547 1547 } 1548 1548 -
trunk/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
r72071 r72591 327 327 328 328 // Speech input related functions. 329 void setMockSpeechInputResult(const CppArgumentList&, CppVariant*);329 void addMockSpeechInputResult(const CppArgumentList&, CppVariant*); 330 330 331 331 void layerTreeAsText(const CppArgumentList& args, CppVariant* result); -
trunk/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
r71888 r72591 501 501 } 502 502 503 void LayoutTestController:: setMockSpeechInputResult(JSStringRef result, JSStringRef language)503 void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) 504 504 { 505 505 // FIXME: Implement for speech input layout tests. -
trunk/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
r72211 r72591 374 374 } 375 375 376 void LayoutTestController:: setMockSpeechInputResult(JSStringRef result, JSStringRef language)376 void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) 377 377 { 378 378 // FIXME: Implement for speech input layout tests. -
trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
r72101 r72591 769 769 } 770 770 771 void LayoutTestController:: setMockSpeechInputResult(const QString& result, const QString& language)771 void LayoutTestController::addMockSpeechInputResult(const QString& result, double confidence, const QString& language) 772 772 { 773 773 // FIXME: Implement for speech input layout tests. -
trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
r72098 r72591 219 219 bool geolocationPermission() const { return m_geolocationPermission; } 220 220 221 void setMockSpeechInputResult(const QString& result, const QString& language);221 void addMockSpeechInputResult(const QString& result, double confidence, const QString& language); 222 222 223 223 // Empty stub method to keep parity with object model exposed by global LayoutTestController. -
trunk/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
r72311 r72591 412 412 } 413 413 414 void LayoutTestController:: setMockSpeechInputResult(JSStringRef result, JSStringRef language)414 void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) 415 415 { 416 416 // FIXME: Implement for speech input layout tests. -
trunk/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
r70863 r72591 321 321 } 322 322 323 void LayoutTestController:: setMockSpeechInputResult(JSStringRef result, JSStringRef language)323 void LayoutTestController::addMockSpeechInputResult(JSStringRef result, double confidence, JSStringRef language) 324 324 { 325 325 // FIXME: Implement for speech input layout tests.
Note: See TracChangeset
for help on using the changeset viewer.