forked from WebKit/WebKit-http
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangeLog
3418 lines (2652 loc) · 155 KB
/
ChangeLog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2020-10-22 Nitzan Uziely <[email protected]>
Elements in Shadow DOM are wrongly marked as stale by the WebDriver
https://bugs.webkit.org/show_bug.cgi?id=217635
Reviewed by Brian Burg.
Changed stale checking, to check if the root node is the document element,
instead of document.contains which doesn't work for elements in Shadow DOM.
* Session.cpp:
(WebDriver::Session::elementSendKeys):
2020-10-21 Carlos Garcia Campos <[email protected]>
WebDriver: add support for wheel actions
https://bugs.webkit.org/show_bug.cgi?id=217174
Reviewed by Brian Burg.
Handle wheel actions.
* Actions.h:
* Session.cpp:
(WebDriver::automationSourceType): Handle InputSource::Type::Wheel.
(WebDriver::Session::performActions): Handle Action::Type::Wheel.
* WebDriverService.cpp:
(WebDriver::processKeyAction): Assert if Action::Subtype::Scroll.
(WebDriver::processPointerMoveAction): Move this code to a helper to be used by both pointer move and scroll actions.
(WebDriver::processPointerAction): Use processPointerMoveAction().
(WebDriver::processWheelAction): Call processPointerMoveAction() and process the scroll delta too.
(WebDriver::processInputActionSequence): Handle InputSource::Type::Wheel.
2020-10-20 Carlos Garcia Campos <[email protected]>
WebDriver: add support for right variations of virtual keys
https://bugs.webkit.org/show_bug.cgi?id=217819
Reviewed by Brian Burg.
The browser is currently receiving the virtual keys already normalized, but WebDriver expects the key code to be
the actual one, not the normalized one. We need to send the raw virtual keys to the browser and do the
normalization there, but use the raw one when synthesizing the events.
Fixes: imported/w3c/webdriver/tests/perform_actions/key_events.py::test_modifier_key_sends_correct_events[\ue009-CONTROL]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_modifier_key_sends_correct_events[\ue008-SHIFT]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_modifier_key_sends_correct_events[\ue052-R_ALT]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[CONTROL-expected5]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_ALT-expected48]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_ARROWDOWN-expected49]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_ARROWLEFT-expected50]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_ARROWRIGHT-expected51]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_ARROWUP-expected52]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_DELETE-expected54]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_END-expected55]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_HOME-expected56]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_INSERT-expected57]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_PAGEDOWN-expected59]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[R_PAGEUP-expected60]
imported/w3c/webdriver/tests/perform_actions/key_events.py::test_special_key_sends_keydown[SHIFT-expected64]
* Session.cpp:
(WebDriver::Session::virtualKeyForKey): Do not normalize the virtual keys.
2020-10-02 Carlos Garcia Campos <[email protected]>
WebDriver: add support for same site cookies
https://bugs.webkit.org/show_bug.cgi?id=217222
Reviewed by Brian Burg.
* Session.cpp:
(WebDriver::parseAutomationCookie): Parse sameSite.
(WebDriver::builtAutomationCookie): Add sameSite to cookie.
(WebDriver::serializeCookie): Serialize sameSite.
* Session.h:
* WebDriverService.cpp:
(WebDriver::deserializeCookie): Deserialize sameSite.
2020-10-02 Carlos Garcia Campos <[email protected]>
WebDriver: several issues when switching to new browser context
https://bugs.webkit.org/show_bug.cgi?id=217217
Reviewed by Brian Burg.
There are several issues to fix when switching to a browser context:
1- The spec has changed and now we should always keep the current parent browsing context.
2- The spec says we should focus the new frame after switching to a frame or parent frame, but we are just
resolving the frame and updating the handle internally.
3- We are keeping stale frame handles and ids in the automation session, they should be removed when frames
are destroyed.
4- We are clearing all frame references in the automation session when a navigation happens in any main
frame. We should only clear the frames of the page that completed the navigation.
All theses cases are covered by new tests added to imported/w3c/webdriver/tests/switch_to_parent_frame/
* Session.cpp:
(WebDriver::Session::close): Close the current parent browsing context too.
(WebDriver::Session::switchToTopLevelBrowsingContext): Initialize the current parent browsing context too.
(WebDriver::Session::switchToBrowsingContext): Resolve the parent frame handle and set the current parent browsing context.
(WebDriver::Session::go): Pass completion handler to switchToBrowsingContext().
(WebDriver::Session::back): Ditto.
(WebDriver::Session::forward): Ditto.
(WebDriver::Session::refresh): Ditto.
(WebDriver::Session::closeWindow): Close the current parent browsing context too.
(WebDriver::Session::switchToBrowsingContext): Send switchToBrowsingContext message to the browser.
(WebDriver::Session::switchToWindow): Use switchToBrowsingContext() to send the message to the browser.
(WebDriver::Session::switchToFrame): Call switchToBrowsingContext() after the child frame handle is resolved.
(WebDriver::Session::switchToParentFrame): Check current parent browsing context is still open and call
switchToBrowsingContext() to switch to the current parent browsing context.
(WebDriver::Session::waitForNavigationToComplete): Close the current parent browsing context too when the window
is closed due to the navigation.
* Session.h: Add m_currentParentBrowsingContext.
2020-10-02 Carlos Garcia Campos <[email protected]>
WebDriver: check the right browser context is open in all commands
https://bugs.webkit.org/show_bug.cgi?id=217177
Reviewed by Carlos Alberto Lopez Perez.
We currently check the top level browsing context for all commands, but the current browsing context should be
checked instead in some of them. New tests added to check this are now failing. This patch changes the way we
were handling the current browsing context, considering nullopt to be the main frame of the current top level
browsing context. Now the null string is used for that, matching what automation expects in the browser and
nullopt means the browser context is closed. That way we can check if the current browser context has been
closed.
* Session.cpp:
(WebDriver::Session::close): Also close the current browsing context.
(WebDriver::Session::switchToTopLevelBrowsingContext): Initialize the current browsing context to null string.
(WebDriver::Session::switchToBrowsingContext): Just set the given context now.
(WebDriver::Session::go): Pass null string to switchToBrowsingContext().
(WebDriver::Session::back): Ditto.
(WebDriver::Session::forward): Ditto.
(WebDriver::Session::refresh): Ditto.
(WebDriver::Session::closeWindow): Close the current browsing context too.
(WebDriver::Session::switchToFrame): If frame is null check top level browsing context is open, otherwise check
current browsing context.
(WebDriver::Session::findElements): Check current browsing context is open instead of toplevel one.
(WebDriver::Session::getActiveElement): Ditto.
(WebDriver::Session::isElementSelected): Ditto.
(WebDriver::Session::getElementText): Ditto.
(WebDriver::Session::getElementTagName): Ditto.
(WebDriver::Session::getElementRect): Ditto.
(WebDriver::Session::isElementEnabled): Ditto.
(WebDriver::Session::getElementAttribute): Ditto.
(WebDriver::Session::getElementProperty): Ditto.
(WebDriver::Session::getElementCSSValue): Ditto.
(WebDriver::Session::waitForNavigationToComplete): Ditto. Also close the current browsing context when the
window or the frame are closed to do the navigation.
(WebDriver::Session::elementClick): Check current browsing context is open instead of toplevel one.
(WebDriver::Session::elementClear): Ditto.
(WebDriver::Session::elementSendKeys): Ditto.
(WebDriver::Session::getPageSource): Ditto.
(WebDriver::Session::executeScript): Ditto.
(WebDriver::Session::getAllCookies): Ditto.
(WebDriver::Session::addCookie): Ditto.
(WebDriver::Session::deleteCookie): Ditto.
(WebDriver::Session::deleteAllCookies): Ditto.
(WebDriver::Session::performActions): Ditto.
(WebDriver::Session::takeScreenshot): Check current browsing context is open instead of toplevel one when an
element is given.
* Session.h:
2020-09-30 Basuke Suzuki <[email protected]>
[PlayStation][WinCairo] Enable WebDriver target on PlayStation and client for WinCairo
https://bugs.webkit.org/show_bug.cgi?id=216908
Reviewed by Don Olmstead.
Extend WebDriver client binary to support connection to remote device for both PlayStation
and WinCairo. We've implemented a simple web server to accept WebDriver request natively and bypass them
to RemoteInspector.
* Capabilities.h:
* HTTPServer.h:
* PlatformPlayStation.cmake: Added.
* PlatformWin.cmake:
* SessionHost.h:
(WebDriver::SessionHost::setHostAddress):
* WebDriverMain.cpp:
(main):
(dllLauncherEntryPoint):
* WebDriverService.cpp:
(WebDriver::printUsageStatement):
(WebDriver::WebDriverService::run):
(WebDriver::WebDriverService::connectToBrowser):
* WebDriverService.h:
* gtk/WebDriverServiceGtk.cpp:
(WebDriver::WebDriverService::platformInit):
* playstation/WebDriverServicePlayStation.cpp: Copied from Source\WebDriver\win\WebDriverServiceWin.cpp.
(WebDriver::WebDriverService::platformInit):
(WebDriver::WebDriverService::platformCapabilities):
(WebDriver::WebDriverService::platformCompareBrowserVersions):
(WebDriver::WebDriverService::platformValidateCapability const):
(WebDriver::WebDriverService::platformMatchCapability const):
(WebDriver::WebDriverService::platformParseCapabilities const):
(WebDriver::WebDriverService::platformSupportProxyType const):
* socket/CapabilitiesSocket.cpp: Copied from Source\WebDriver\socket\SessionHostSocket.cpp.
(WebDriver::CapabilitiesSocket::parseCapabilities):
* socket/CapabilitiesSocket.h: Copied from Source\WebDriver\socket\HTTPServerSocket.cpp.
* socket/HTTPParser.cpp: Added.
(WebDriver::HTTPParser::parse):
(WebDriver::HTTPParser::handlePhase):
(WebDriver::HTTPParser::abortProcess):
(WebDriver::HTTPParser::parseFirstLine):
(WebDriver::HTTPParser::readLine):
(WebDriver::HTTPParser::expectedBodyLength const):
* socket/HTTPParser.h: Copied from Source\WebDriver\HTTPServer.h.
(WebDriver::HTTPParser::pullMessage):
* socket/HTTPServerSocket.cpp:
(WebDriver::HTTPServer::listen):
(WebDriver::HTTPServer::disconnect):
(WebDriver::HTTPServer::doAccept):
(WebDriver::HTTPServer::didClose):
(WebDriver::HTTPRequestHandler::connect):
(WebDriver::HTTPRequestHandler::reset):
(WebDriver::HTTPRequestHandler::didReceive):
(WebDriver::HTTPRequestHandler::sendResponse):
(WebDriver::HTTPRequestHandler::packHTTPMessage const):
(WebDriver::HTTPRequestHandler::didClose):
* socket/SessionHostSocket.cpp:
(WebDriver::SessionHost::dispatchMap):
(WebDriver::SessionHost::sendWebInspectorEvent):
(WebDriver::SessionHost::connectToBrowser):
(WebDriver::SessionHost::isConnected const):
(WebDriver::SessionHost::didClose):
(WebDriver::SessionHost::parseTargetList):
(WebDriver::SessionHost::receivedSetTargetList):
(WebDriver::SessionHost::receivedSendMessageToFrontend):
(WebDriver::SessionHost::startAutomationSession):
(WebDriver::SessionHost::setTargetList):
(WebDriver::SessionHost::sendMessageToBackend):
* win/WebDriverServiceWin.cpp:
(WebDriver::WebDriverService::platformInit):
(WebDriver::WebDriverService::platformParseCapabilities const):
* wpe/WebDriverServiceWPE.cpp:
(WebDriver::WebDriverService::platformInit):
2020-09-14 Carlos Garcia Campos <[email protected]>
REGRESSION(r266885): WebDriver is broken since r266885
https://bugs.webkit.org/show_bug.cgi?id=216477
Reviewed by Devin Rousso.
There are several issues introduced in r266885, most of them related to JSValue::get methods now returning an
optional. In some cases of boolean values, the optional is checked instead of the contained bool or the logic is
inverted. JSONValue::getString() is problematic too because it doesn't use optional, when you call getString()
and null is returned it could be because the property is not present in the object or because the property is
not a string. In several cases we need to know that so we need to first get the value and then call asString(9
instead of calling getString() directly.
* Session.cpp:
(WebDriver::Session::handleUserPrompts): Check the value of isShowingJavaScriptDialog, not the optional.
(WebDriver::parseAutomationCookie): Check also the value of the session optional bool, not only the optional.
* SessionHost.cpp:
(WebDriver::SessionHost::dispatchMessage): Only set the responseObject if the object is not empty.
* WebDriverService.cpp:
(WebDriver::WebDriverService::newWindow): Unknown values of type hint are not an error.
(WebDriver::WebDriverService::deleteCookie): Fix indentation.
(WebDriver::processKeyAction): Empty key value is an error, not the opposite.
* gtk/WebDriverServiceGtk.cpp:
(WebDriver::WebDriverService::platformValidateCapability const): Only fail if optional values are wrong type,
not if they are not present.
* wpe/WebDriverServiceWPE.cpp:
(WebDriver::WebDriverService::platformValidateCapability const): Ditto.
2020-09-10 Fujii Hironori <[email protected]>
Unreviewed Debug build fix for WPE and WinCairo
https://bugs.webkit.org/show_bug.cgi?id=216302
<rdar://problem/68547649>
* Session.cpp:
(WebDriver::Session::switchToFrame): Replaced 'frameIndex' with '*frameIndex' in ASSERT expression.
2020-09-10 Devin Rousso <[email protected]>
Web Inspector: modernize generated backend protocol code
https://bugs.webkit.org/show_bug.cgi?id=216302
<rdar://problem/68547649>
Reviewed by Brian Burg.
* CommandResult.cpp:
(WebDriver::CommandResult::CommandResult):
* Session.cpp:
(WebDriver::firstWindowHandleInResult):
(WebDriver::Session::getTimeouts):
(WebDriver::Session::createTopLevelBrowsingContext):
(WebDriver::Session::handleUserPrompts):
(WebDriver::Session::reportUnexpectedAlertOpen):
(WebDriver::Session::go):
(WebDriver::Session::getCurrentURL):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::getTitle):
(WebDriver::Session::getWindowHandle):
(WebDriver::Session::closeTopLevelBrowsingContext):
(WebDriver::Session::switchToWindow):
(WebDriver::Session::getWindowHandles):
(WebDriver::Session::newWindow):
(WebDriver::Session::switchToFrame):
(WebDriver::Session::switchToParentFrame):
(WebDriver::Session::getToplevelBrowsingContextRect):
(WebDriver::Session::setWindowRect):
(WebDriver::Session::maximizeWindow):
(WebDriver::Session::minimizeWindow):
(WebDriver::Session::fullscreenWindow):
(WebDriver::Session::createElement):
(WebDriver::Session::extractElementID):
(WebDriver::Session::computeElementLayout):
(WebDriver::Session::findElements):
(WebDriver::Session::getActiveElement):
(WebDriver::Session::isElementSelected):
(WebDriver::Session::getElementText):
(WebDriver::Session::getElementTagName):
(WebDriver::Session::getElementRect):
(WebDriver::Session::isElementEnabled):
(WebDriver::Session::isElementDisplayed):
(WebDriver::Session::getElementAttribute):
(WebDriver::Session::getElementProperty):
(WebDriver::Session::getElementCSSValue):
(WebDriver::Session::waitForNavigationToComplete):
(WebDriver::Session::elementIsFileUpload):
(WebDriver::Session::parseElementIsFileUploadResult):
(WebDriver::Session::selectOptionElement):
(WebDriver::Session::elementClick):
(WebDriver::Session::elementIsEditable):
(WebDriver::Session::elementClear):
(WebDriver::Session::setInputFileUploadFiles):
(WebDriver::Session::elementSendKeys):
(WebDriver::Session::getPageSource):
(WebDriver::Session::handleScriptResult):
(WebDriver::Session::executeScript):
(WebDriver::Session::performMouseInteraction):
(WebDriver::Session::performKeyboardInteractions):
(WebDriver::builtAutomationCookie):
(WebDriver::serializeCookie):
(WebDriver::Session::getAllCookies):
(WebDriver::Session::getNamedCookie):
(WebDriver::Session::addCookie):
(WebDriver::Session::deleteCookie):
(WebDriver::Session::deleteAllCookies):
(WebDriver::Session::performActions):
(WebDriver::Session::releaseActions):
(WebDriver::Session::dismissAlert):
(WebDriver::Session::acceptAlert):
(WebDriver::Session::getAlertText):
(WebDriver::Session::sendAlertText):
(WebDriver::Session::takeScreenshot):
* SessionHost.cpp:
(WebDriver::SessionHost::dispatchMessage):
* WebDriverService.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::handleRequest):
(WebDriver::WebDriverService::sendResponse const):
(WebDriver::valueAsNumberInRange):
(WebDriver::deserializeTimeouts):
(WebDriver::deserializeProxy):
(WebDriver::WebDriverService::parseCapabilities const):
(WebDriver::WebDriverService::findSessionOrCompleteWithError):
(WebDriver::WebDriverService::validatedCapabilities const):
(WebDriver::WebDriverService::mergeCapabilities const):
(WebDriver::WebDriverService::matchCapabilities const):
(WebDriver::WebDriverService::processCapabilities const):
(WebDriver::WebDriverService::createSession):
(WebDriver::WebDriverService::deleteSession):
(WebDriver::WebDriverService::go):
(WebDriver::WebDriverService::setWindowRect):
(WebDriver::WebDriverService::closeWindow):
(WebDriver::WebDriverService::switchToWindow):
(WebDriver::WebDriverService::newWindow):
(WebDriver::WebDriverService::switchToFrame):
(WebDriver::findElementOrCompleteWithError):
(WebDriver::findStrategyAndSelectorOrCompleteWithError):
(WebDriver::WebDriverService::getElementAttribute):
(WebDriver::WebDriverService::getElementProperty):
(WebDriver::WebDriverService::getElementCSSValue):
(WebDriver::WebDriverService::elementSendKeys):
(WebDriver::findScriptAndArgumentsOrCompleteWithError):
(WebDriver::WebDriverService::getNamedCookie):
(WebDriver::deserializeCookie):
(WebDriver::WebDriverService::addCookie):
(WebDriver::WebDriverService::deleteCookie):
(WebDriver::processPauseAction):
(WebDriver::processNullAction):
(WebDriver::processKeyAction):
(WebDriver::processPointerAction):
(WebDriver::processPointerParameters):
(WebDriver::processInputActionSequence):
(WebDriver::WebDriverService::performActions):
(WebDriver::WebDriverService::sendAlertText):
* WebDriver/gtk/WebDriverServiceGtk.cpp:
(WebDriver::WebDriverService::platformMatchCapability):
(WebDriver::WebDriverService::platformValidateCapability):
(WebDriver::WebDriverService::platformParseCapabilities):
* WebDriver/win/WebDriverServiceWin.cpp:
(WebDriver::WebDriverService::platformMatchCapability):
(WebDriver::WebDriverService::platformValidateCapability):
(WebDriver::WebDriverService::platformParseCapabilities):
* WebDriver/wpe/WebDriverServiceWPE.cpp:
(WebDriver::WebDriverService::platformMatchCapability):
(WebDriver::WebDriverService::platformValidateCapability):
(WebDriver::WebDriverService::platformParseCapabilities):
`JSON` classes now use `Ref&&` wherever possible and `Optional` instead of an out parameter
for `get*`/`as*` so that values can be more easily manipulated and can be confidently known
to exist.
2020-07-15 Fujii Hironori <[email protected]>
[CMake][WebDriver] Generating WebDriverAtoms.cpp is rarely failing as "ImportError: No module named jsmin"
https://bugs.webkit.org/show_bug.cgi?id=214339
Reviewed by Don Olmstead.
There are a race condition between copying jsmin.py in
JavaScriptCore and using it in WebDriver. WebDriver target should
have a dependency to it.
* CMakeLists.txt: Added add_dependencies for WebDriver.
2020-06-26 Geoffrey Garen <[email protected]>
Initializing the main thread should initialize the main run loop
https://bugs.webkit.org/show_bug.cgi?id=213637
Reviewed by Anders Carlsson.
* WebDriverService.cpp:
(WebDriver::WebDriverService::run):
2020-06-23 Chris Dumez <[email protected]>
Remove a lot of unnecessary calls to Ref::copyRef()
https://bugs.webkit.org/show_bug.cgi?id=213533
Reviewed by Darin Adler.
Remove a lot of unnecessary calls to Ref::copyRef() now that Ref is copyable.
* Session.cpp:
(WebDriver::Session::go):
(WebDriver::Session::getCurrentURL):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::getTitle):
(WebDriver::Session::newWindow):
(WebDriver::Session::switchToFrame):
(WebDriver::Session::switchToParentFrame):
(WebDriver::Session::setWindowRect):
(WebDriver::Session::maximizeWindow):
(WebDriver::Session::minimizeWindow):
(WebDriver::Session::fullscreenWindow):
(WebDriver::Session::findElements):
(WebDriver::Session::getActiveElement):
(WebDriver::Session::isElementSelected):
(WebDriver::Session::getElementText):
(WebDriver::Session::getElementTagName):
(WebDriver::Session::getElementRect):
(WebDriver::Session::isElementEnabled):
(WebDriver::Session::isElementDisplayed):
(WebDriver::Session::getElementAttribute):
(WebDriver::Session::getElementProperty):
(WebDriver::Session::getElementCSSValue):
(WebDriver::Session::elementClick):
(WebDriver::Session::elementClear):
(WebDriver::Session::elementSendKeys):
(WebDriver::Session::getPageSource):
(WebDriver::Session::executeScript):
(WebDriver::Session::getAllCookies):
(WebDriver::Session::addCookie):
(WebDriver::Session::deleteCookie):
(WebDriver::Session::deleteAllCookies):
(WebDriver::Session::performActions):
(WebDriver::Session::takeScreenshot):
2020-06-10 Geoffrey Garen <[email protected]>
Some style improvements to main thread code
https://bugs.webkit.org/show_bug.cgi?id=213051
Reviewed by Darin Adler.
Updated for rename.
* WebDriverService.cpp:
(WebDriver::WebDriverService::run):
2020-03-19 Charlie Turner <[email protected]>
Fix many warnings with Clang 7.0 on GTK x86-64 in Debug.
https://bugs.webkit.org/show_bug.cgi?id=209146
Reviewed by Darin Adler.
* Session.cpp:
(WebDriver::Session::newWindow):
(WebDriver::Session::elementIsFileUpload):
(WebDriver::Session::elementIsEditable):
(WebDriver::Session::setInputFileUploadFiles):
2020-02-12 Carlos Alberto Lopez Perez <[email protected]>
WebDriver: return invalidSessionID exception if the WebProcess doesn't respond (crashes)
https://bugs.webkit.org/show_bug.cgi?id=207565
Reviewed by Adrian Perez de Castro.
Report InvalidSessionID if the session connection its not connected.
* WebDriverService.cpp:
(WebDriver::WebDriverService::findSessionOrCompleteWithError):
2020-01-29 Carlos Garcia Campos <[email protected]>
[GTK] WebDriver: screenshot ignores CSS transformations or WebGL content.
https://bugs.webkit.org/show_bug.cgi?id=206514
Reviewed by Carlos Alberto Lopez Perez.
* Session.cpp:
(WebDriver::Session::takeScreenshot): Always set clipToViewport to true.
* WebDriverService.cpp:
(WebDriver::WebDriverService::takeElementScreenshot): Stop pretending a GET command can have body.
2020-01-13 Carlos Garcia Campos <[email protected]>
WebDriver: pressed virtual keys not correctly handled in action sequences
https://bugs.webkit.org/show_bug.cgi?id=205997
Reviewed by Brian Burg.
We are assuming that only one virtual key can be pressed and that a key up always releases the pressed virtual
key if any. We should keep a list of pressed keys and remove them from the list when key up happens for them.
Fixes: imported/w3c/webdriver/tests/perform_actions/key_modifiers.py::test_shift_modifier_generates_capital_letters[\ue008]
imported/w3c/webdriver/tests/perform_actions/key_modifiers.py::test_shift_modifier_generates_capital_letters[\ue050]
* Session.cpp:
(WebDriver::Session::performActions):
* Session.h:
2020-01-10 Carlos Garcia Campos <[email protected]>
Automation: evaluateJavaScriptFunction should use Promises
https://bugs.webkit.org/show_bug.cgi?id=204151
Reviewed by Brian Burg.
* CommandResult.cpp:
(WebDriver::CommandResult::httpStatusCode const): Timeout errors should return 500 not 408.
* Session.cpp:
(WebDriver::Session::executeScript): Ensure the script body goes between new lines to avoid problems with
trailing comments like in function() { return foo; // Comment }.
2020-01-07 Carlos Garcia Campos <[email protected]>
WebDriver: handle no such element errors
https://bugs.webkit.org/show_bug.cgi?id=204684
Reviewed by Brian Burg.
Handle InvalidNodeIdentifier errors.
Fixes: imported/w3c/webdriver/tests/get_element_tag_name/get.py::test_element_not_found
imported/w3c/webdriver/tests/get_element_property/get.py::test_element_not_found
imported/w3c/webdriver/tests/get_element_attribute/get.py::test_element_not_found
* CommandResult.cpp:
(WebDriver::CommandResult::CommandResult):
2019-12-23 Carlos Garcia Campos <[email protected]>
WebDriver: fix handling of session timeouts for values higher than MAX_INT
https://bugs.webkit.org/show_bug.cgi?id=204114
Reviewed by Brian Burg.
Use double instead of Seconds for handling timeouts.
* Capabilities.h:
* Session.cpp:
(WebDriver::Session::getTimeouts): Handle the case of script timeout being null.
(WebDriver::Session::go):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::findElements):
(WebDriver::Session::waitForNavigationToComplete):
(WebDriver::Session::executeScript): Do not pass a timeout when it's null.
* Session.h:
(WebDriver::Session::scriptTimeout const):
(WebDriver::Session::pageLoadTimeout const):
(WebDriver::Session::implicitWaitTimeout const):
* WebDriverService.cpp:
(WebDriver::deserializeTimeouts): Add IgnoreUnknownTimeout, since we should only fail when processing
capabilities, but not when setting new timeouts. Also handle the case of script timeout being null.
(WebDriver::WebDriverService::parseCapabilities const): Pass IgnoreUnknownTimeout::No to deserializeTimeouts.
(WebDriver::WebDriverService::validatedCapabilities const): Ditto.
(WebDriver::WebDriverService::createSession): Handle the case of script timeout being null.
(WebDriver::WebDriverService::setTimeouts): Pass IgnoreUnknownTimeout::Yes to deserializeTimeouts.
2019-12-13 Jim Mason <[email protected]>
[GTK] WebKitGTK build hangs on g-ir-scanner
https://bugs.webkit.org/show_bug.cgi?id=204715
This patch fixes the static initialization order problem
introduced by Bug 204503.
The patch replaces the static data members with statics that
are constructed only upon first access (i.e., the 'construct
on first use' idiom).
Reviewed by Carlos Garcia Campos.
* SessionHost.h:
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::messageHandlers):
(WebDriver::SessionHost::connectToBrowser):
2019-12-12 Carlos Garcia Campos <[email protected]>
WebDriver: tests is_element_enabled/enabled.py::test_fieldset_disabled_descendant are failing
https://bugs.webkit.org/show_bug.cgi?id=204700
Reviewed by Carlos Alberto Lopez Perez.
Fixes: imported/w3c/webdriver/tests/is_element_enabled/enabled.py::test_fieldset_disabled_descendant[button]
imported/w3c/webdriver/tests/is_element_enabled/enabled.py::test_fieldset_disabled_descendant[input]
imported/w3c/webdriver/tests/is_element_enabled/enabled.py::test_fieldset_disabled_descendant[select]
imported/w3c/webdriver/tests/is_element_enabled/enabled.py::test_fieldset_disabled_descendant[textarea]
* CMakeLists.txt: Add ElementEnabled.js to compilation.
* Session.cpp:
(WebDriver::Session::isElementEnabled): Use ElementEnabled atom instead.
2019-12-10 Fujii Hironori <[email protected]>
[Win] Fix MSVC warning C4701: potentially uninitialized local variable 'x' used
https://bugs.webkit.org/show_bug.cgi?id=205052
Reviewed by Don Olmstead.
* Session.cpp:
(WebDriver::Session::getToplevelBrowsingContextRect):
(WebDriver::Session::computeElementLayout):
Zero-initialized local variables.
2019-12-03 Carlos Garcia Campos <[email protected]>
WebDriver: handle elements of type file in send keys command
https://bugs.webkit.org/show_bug.cgi?id=188514
Reviewed by Brian Burg.
Handle the case of inpout element being a file upload in send keys command.
* Capabilities.h: Add strictFileInteractability.
* Session.cpp:
(WebDriver::Session::elementIsFileUpload): Helper to check if the given element is a file upload and whether
it's multiple or not.
(WebDriver::Session::parseElementIsFileUploadResult): Parse the result of elementIsFileUpload().
(WebDriver::Session::elementClick): If the element is a file upload, fail with invalid argument error.
(WebDriver::Session::setInputFileUploadFiles): Send setFilesForInputFileUpload message to the browser with the
selected files.
(WebDriver::Session::elementSendKeys): If the element is a file upload, call setInputFileUploadFiles()
instead. Also handle the strictFileInteractability capability to decide whether to focus and check
interactability on the input element or not.
* Session.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::parseCapabilities const): Handle strictFileInteractability.
(WebDriver::WebDriverService::validatedCapabilities const): Ditto.
(WebDriver::WebDriverService::matchCapabilities const): Ditto.
(WebDriver::WebDriverService::createSession): Ditto.
2019-12-03 Carlos Garcia Campos <[email protected]>
WebDriver: most of the clear tests are failing
https://bugs.webkit.org/show_bug.cgi?id=180404
Reviewed by Brian Burg.
Implement the element clear command following the spec.
https://w3c.github.io/webdriver/#element-clear
* Session.cpp:
(WebDriver::Session::elementIsEditable): Helper function to check if the element is editable.
(WebDriver::Session::elementClear): Check if the element is editable and interactable before executing the clear atom.
* Session.h:
2019-11-22 Carlos Garcia Campos <[email protected]>
Unreviewed. Fix GTK/WPE debug build after r252770
Just remove the ASSERT instead, since it now always receive a newly created Ref.
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::setupConnection):
2019-11-22 Carlos Garcia Campos <[email protected]>
Unreviewed. Fix GTK/WPE debug build after r252770
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::setupConnection):
2019-11-22 Carlos Garcia Campos <[email protected]>
[GTK][WPE] RemoteInspector: use sockets instead of DBus
https://bugs.webkit.org/show_bug.cgi?id=204503
Reviewed by Žan Doberšek.
Use GSockets API instead of DBus.
* SessionHost.cpp:
(WebDriver::SessionHost::sendCommandToBackend):
* SessionHost.h:
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::~SessionHost):
(WebDriver::SessionHost::isConnected const):
(WebDriver::ConnectToBrowserAsyncData::ConnectToBrowserAsyncData):
(WebDriver::SessionHost::launchBrowser):
(WebDriver::SessionHost::connectToBrowser):
(WebDriver::SessionHost::connectionDidClose):
(WebDriver::SessionHost::setupConnection):
(WebDriver::SessionHost::startAutomationSession):
(WebDriver::SessionHost::didStartAutomationSession):
(WebDriver::SessionHost::setTargetList):
(WebDriver::SessionHost::sendMessageToBackend):
* socket/SessionHostSocket.cpp:
(WebDriver::SessionHost::sendMessageToBackend):
2019-11-13 Carlos Garcia Campos <[email protected]>
WebDriver: duration can be undefined in pause actions
https://bugs.webkit.org/show_bug.cgi?id=204152
Reviewed by Carlos Alberto Lopez Perez.
Make duration optional in pause actions.
Fixes: imported/w3c/webdriver/tests/perform_actions/validity.py::test_pause_without_duration[none]
imported/w3c/webdriver/tests/perform_actions/validity.py::test_pause_without_duration[key]
imported/w3c/webdriver/tests/perform_actions/validity.py::test_pause_without_duration[pointer]
* Session.cpp:
(WebDriver::Session::performActions):
* WebDriverService.cpp:
(WebDriver::processPauseAction):
2019-11-13 Carlos Garcia Campos <[email protected]>
WebDriver: check the frameID parameter before running switch to frame command
https://bugs.webkit.org/show_bug.cgi?id=204150
Reviewed by Carlos Alberto Lopez Perez.
We should check it's either null, a number (unsigned sort) or an object referencing a web element.
Fixes: imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_invalid_types[foo]
imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_invalid_types[True]
imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_invalid_types[value2]
imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_invalid_types[value3]
imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_out_of_bounds[-1]
imported/w3c/webdriver/tests/switch_to_frame/switch.py::test_frame_id_out_of_bounds[65536]
* Session.cpp:
(WebDriver::Session::switchToFrame): Remove the validation here. Also remove the case of being a frame name,
since that's not in the spec.
* WebDriverService.cpp:
(WebDriver::WebDriverService::switchToFrame): Check frameID type before calling Session::switchToFrame().
2019-11-12 Carlos Garcia Campos <[email protected]>
[GTK] WebDriver: implement new window command
https://bugs.webkit.org/show_bug.cgi?id=203994
Reviewed by Carlos Alberto Lopez Perez.
* Session.cpp:
(WebDriver::Session::newWindow):
* Session.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::newWindow):
* WebDriverService.h:
2019-11-11 Carlos Garcia Campos <[email protected]>
WebDriver: implement proxy support
https://bugs.webkit.org/show_bug.cgi?id=180408
Reviewed by Carlos Alberto Lopez Perez.
Handle proxy object in capabilities.
* Capabilities.h: Add Proxy struct.
* WebDriverService.cpp:
(WebDriver::deserializeProxy): Deserialize the proxy from capabilities.
(WebDriver::WebDriverService::parseCapabilities const): Get the deserialized proxy.
(WebDriver::WebDriverService::validatedCapabilities const): Ensure proxy object is valid.
(WebDriver::WebDriverService::matchCapabilities const): Check proxy type is supported by the platform.
(WebDriver::WebDriverService::createSession): Only set an empty proxy object in capabilities if we don't have a
deserialized proxy.
* WebDriverService.h:
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::buildSessionCapabilities const): Send the proxy settings to the browser.
* glib/WebDriverServiceGLib.cpp:
(WebDriver::WebDriverService::platformSupportProxyType const): Return false if proxy type is "pac".
2019-11-08 Carlos Garcia Campos <[email protected]>
WebDriver: implement get page source command
https://bugs.webkit.org/show_bug.cgi?id=180399
Reviewed by Carlos Alberto Lopez Perez.
* Session.cpp:
(WebDriver::Session::getPageSource):
* Session.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::getPageSource):
* WebDriverService.h:
2019-11-07 Carlos Garcia Campos <[email protected]>
WebDriver: correctly handle errors when focusing element before sending key events
https://bugs.webkit.org/show_bug.cgi?id=203945
Reviewed by Carlos Alberto Lopez Perez.
We are throwing an exception that is not correctly handled.
Fixes: imported/w3c/webdriver/tests/element_send_keys/interactability.py::test_not_a_focusable_element
imported/w3c/webdriver/tests/element_send_keys/interactability.py::test_display_none
imported/w3c/webdriver/tests/element_send_keys/interactability.py::test_visibility_hidden
imported/w3c/webdriver/tests/element_send_keys/interactability.py::test_hidden
imported/w3c/webdriver/tests/element_send_keys/interactability.py::test_disabled
* Session.cpp:
(WebDriver::Session::elementSendKeys): Raise ElementNotInteractable error when element is not focusable.
2019-08-18 Yusuke Suzuki <[email protected]>
[WTF] Add makeUnique<T>, which ensures T is fast-allocated, makeUnique / makeUniqueWithoutFastMallocCheck part
https://bugs.webkit.org/show_bug.cgi?id=200620
Reviewed by Geoffrey Garen.
* WebDriverService.cpp:
(WebDriver::WebDriverService::connectToBrowser):
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::launchBrowser):
(WebDriver::SessionHost::sendMessageToBackend):
2019-08-15 Yusuke Suzuki <[email protected]>
[WTF] Add makeUnique<T>, which ensures T is fast-allocated, WTF_MAKE_FAST_ALLOCATED annotation part
https://bugs.webkit.org/show_bug.cgi?id=200620
Reviewed by Geoffrey Garen.
* glib/SessionHostGlib.cpp:
2019-06-03 Carlos Garcia Campos <[email protected]>
REGRESSION(r245567): [GTK][WPE] [2.25.1] WebKitWebDriver gets installed as WebDriver
https://bugs.webkit.org/show_bug.cgi?id=198480
Reviewed by Michael Catanzaro.
We are now using the WEBKIT_EXECUTABLE macro that uses target_OUTPUT_NAME variable, but we define
taget_Process_OUTPUT_NAME.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
2019-05-31 Don Olmstead <[email protected]>
[CMake] Add WebKit::WTF target
https://bugs.webkit.org/show_bug.cgi?id=198400
Reviewed by Konstantin Tokarev.
Use the WebKit::WTF target.
* CMakeLists.txt:
2019-05-21 Don Olmstead <[email protected]>
[WinCairo] Build WebDriver
https://bugs.webkit.org/show_bug.cgi?id=198056
Reviewed by Carlos Garcia Campos.
Add the platform and source files to get WinCairo to compile a WebDriver executable.
* CMakeLists.txt:
* PlatformWin.cmake: Added.
* Session.cpp:
(WebDriver::Session::go):
(WebDriver::Session::getCurrentURL):
(WebDriver::Session::back):
(WebDriver::Session::forward):
(WebDriver::Session::refresh):
(WebDriver::Session::getTitle):
(WebDriver::Session::switchToFrame):
(WebDriver::Session::switchToParentFrame):
(WebDriver::Session::setWindowRect):
(WebDriver::Session::maximizeWindow):
(WebDriver::Session::minimizeWindow):
(WebDriver::Session::fullscreenWindow):
(WebDriver::Session::findElements):
(WebDriver::Session::getActiveElement):
(WebDriver::Session::isElementSelected):
(WebDriver::Session::getElementText):
(WebDriver::Session::getElementTagName):
(WebDriver::Session::getElementRect):
(WebDriver::Session::isElementEnabled):
(WebDriver::Session::isElementDisplayed):
(WebDriver::Session::getElementAttribute):
(WebDriver::Session::getElementProperty):
(WebDriver::Session::getElementCSSValue):
(WebDriver::Session::elementClick):
(WebDriver::Session::elementClear):
(WebDriver::Session::elementSendKeys):
(WebDriver::Session::executeScript):
(WebDriver::Session::getAllCookies):
(WebDriver::Session::addCookie):
(WebDriver::Session::deleteCookie):
(WebDriver::Session::deleteAllCookies):
(WebDriver::Session::performActions):
(WebDriver::Session::takeScreenshot):
With nested lambdas MSVC believes the this pointer is for the enclosing lambda. Use a
protectedThis in the enclosing lambda and then use protectedThis.copyRef() in the nested
lambda.
* socket/HTTPServerSocket.cpp: Added.
(WebDriver::HTTPServer::listen):
(WebDriver::HTTPServer::disconnect):
Add stubs for HTTPServer when using a raw socket.
* socket/SessionHostSocket.cpp: Added.
(WebDriver::SessionHost::~SessionHost):
(WebDriver::SessionHost::connectToBrowser):
(WebDriver::SessionHost::isConnected const):
(WebDriver::SessionHost::startAutomationSession):
(WebDriver::SessionHost::sendMessageToBackend):
Add stubs for SessionHost when using a raw socket.
* win/WebDriverServiceWin.cpp: Added.
(WebDriver::WebDriverService::platformCapabilities):
(WebDriver::WebDriverService::platformCompareBrowserVersions):
(WebDriver::WebDriverService::platformValidateCapability const):
(WebDriver::WebDriverService::platformMatchCapability const):
(WebDriver::WebDriverService::platformParseCapabilities const):
Add stubs for WebDriverService on Windows.
2019-05-17 Don Olmstead <[email protected]>
[CMake] Use builtin FindICU
https://bugs.webkit.org/show_bug.cgi?id=197934
Reviewed by Michael Catanzaro.
Remove uses of ICU_INCLUDE_DIRS and ICU_LIBRARIES.
* PlatformWPE.cmake:
2019-04-14 Don Olmstead <[email protected]>
[CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=196742
Reviewed by Konstantin Tokarev.
Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.
* CMakeLists.txt:
2019-04-05 Commit Queue <[email protected]>
Unreviewed, rolling out r243833.
https://bugs.webkit.org/show_bug.cgi?id=196645
This change breaks build of WPE and GTK ports (Requested by
annulen on #webkit).
Reverted changeset:
"[CMake][WTF] Mirror XCode header directories"