RESOLVED FIXED Bug 39433
editingBehavior settings needs to be set back to a reasonable default between tests
https://bugs.webkit.org/show_bug.cgi?id=39433
Summary editingBehavior settings needs to be set back to a reasonable default between...
Martin Robinson
Reported 2010-05-20 10:52:21 PDT
The actual setting depends on the platform.
Attachments
Patch (4.28 KB, patch)
2010-05-20 10:54 PDT, Martin Robinson
no flags
Patch (3.25 KB, patch)
2010-05-20 11:24 PDT, Martin Robinson
no flags
Reset Mac and Windows to platform default between tests (2.50 KB, patch)
2010-05-20 13:11 PDT, Martin Robinson
no flags
(committed with r60158, reviewed by eseidel, tkent) Reset Gtk and Chromium to platform default between tests (3.01 KB, patch)
2010-05-24 21:47 PDT, Antonio Gomes
no flags
Martin Robinson
Comment 1 2010-05-20 10:54:28 PDT
Martin Robinson
Comment 2 2010-05-20 11:18:14 PDT
Comment on attachment 56608 [details] Patch via IRC: (10:57:24 AM) ojan: mrobinson: i'd rather see a shared method in Settings (10:57:53 AM) ojan: mrobinson: that way, if a port changes which editing behavior they use ona platform, they only change it in one place (11:01:09 AM) ojan: mrobinson: so, i'm thinking...add Settings::resetEditingBehavior and move the logic from the Settings constructor into that method. then call the method instead of setEditingBehavior. (11:05:48 AM) ojan: so, i'm just staying to move those 7 lines of code into Settings::resetEditingBehavior and instead call that method from the constructor
Martin Robinson
Comment 3 2010-05-20 11:24:14 PDT
Martin Robinson
Comment 4 2010-05-20 12:01:35 PDT
Reverted tests causing failures until this can be sorted out properly: http://trac.webkit.org/changeset/59852
Martin Robinson
Comment 5 2010-05-20 12:32:22 PDT
Martin Robinson
Comment 7 2010-05-20 13:11:31 PDT
Created attachment 56624 [details] Reset Mac and Windows to platform default between tests
Eric Seidel (no email)
Comment 8 2010-05-20 13:16:56 PDT
Comment on attachment 56624 [details] Reset Mac and Windows to platform default between tests LGTM!
Martin Robinson
Comment 9 2010-05-20 13:21:11 PDT
Alexey Proskuryakov
Comment 10 2010-05-20 17:08:12 PDT
> Committed r59861: <http://trac.webkit.org/changeset/59861> Sounds like this should be closed. + editingBehavior settings needs to be set back to a reasonable default between tests FWIW, I'd expect "reasonable default" to be the same on all platforms. What's the value in making it different?
Martin Robinson
Comment 11 2010-05-20 17:12:55 PDT
This is required because many tests still exist which expect different behavior on different platforms (detected via user agent). At some point, if they are all rewritten, we can probably set some behavior to be the default in DRT. This still needs to be fixed for Chromium and GTK+.
Alexey Proskuryakov
Comment 12 2010-05-20 17:24:33 PDT
How many tests like that are there? What we basically need is make two or three copies of each, and set different behaviors in those.
Antonio Gomes
Comment 13 2010-05-24 19:08:03 PDT
(In reply to comment #12) > How many tests like that are there? What we basically need is make two or three copies of each, and set different behaviors in those. ~14 tests in /editing. $ grep -nHR navigator.userAgent.search LayoutTests/editing/ - LayoutTests/editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js - LayoutTests/editing/selection/script-tests/click-in-margins-inside-editable-div.js - LayoutTests/editing/selection/script-tests/shift-click.js - LayoutTests/editing/selection/extend-selection-after-double-click.html - LayoutTests/editing/selection/extend-after-mouse-selection.html - LayoutTests/editing/selection/move-begin-end.html - LayoutTests/editing/selection/5195166-1.html - LayoutTests/editing/input/option-page-up-down.html - LayoutTests/editing/undo/undo-deleteWord.html - LayoutTests/editing/deleting/delete-by-word-001.html - LayoutTests/editing/deleting/delete-by-word-002.html
Antonio Gomes
Comment 14 2010-05-24 21:47:39 PDT
Created attachment 56970 [details] (committed with r60158, reviewed by eseidel, tkent) Reset Gtk and Chromium to platform default between tests according to comment 11, it seems needed
Kent Tamura
Comment 15 2010-05-24 22:01:13 PDT
Comment on attachment 56970 [details] (committed with r60158, reviewed by eseidel, tkent) Reset Gtk and Chromium to platform default between tests Chromium part looks OK.
Eric Seidel (no email)
Comment 16 2010-05-24 22:02:27 PDT
Comment on attachment 56970 [details] (committed with r60158, reviewed by eseidel, tkent) Reset Gtk and Chromium to platform default between tests Looks OK to me. Why doesn't this affect tests? Can we write a test this would affect?
WebKit Review Bot
Comment 17 2010-05-24 22:02:46 PDT
Antonio Gomes
Comment 18 2010-05-24 22:14:41 PDT
(In reply to comment #17) > Attachment 56970 [details] did not build on chromium: > Build output: http://webkit-commit-queue.appspot.com/results/2315575 s/EditingBehaviorWindows/EditingBehaviorWin/g , will fix before land. (In reply to comment #16) > (From update of attachment 56970 [details]) > Looks OK to me. Why doesn't this affect tests? Can we write a test this would affect? @Eric: it will affect tests, for example as soon as https://bugs.webkit.org/attachment.cgi?id=56608 re-lands and all tests cited in comment #12 got changed to use the setEditingBehaviour API of LayoutTestController instead of the user agent string
Antonio Gomes
Comment 19 2010-05-25 06:16:57 PDT
Comment on attachment 56970 [details] (committed with r60158, reviewed by eseidel, tkent) Reset Gtk and Chromium to platform default between tests Clearing flags on attachment: 56970 Committed r59861: <http://trac.webkit.org/changeset/59861>
Antonio Gomes
Comment 20 2010-05-25 06:18:52 PDT
Comment on attachment 56970 [details] (committed with r60158, reviewed by eseidel, tkent) Reset Gtk and Chromium to platform default between tests err: Committed r60158: <http://trac.webkit.org/changeset/60158>
WebKit Review Bot
Comment 21 2010-05-25 06:51:10 PDT
http://trac.webkit.org/changeset/60158 might have broken GTK Linux 32-bit Release The following changes are on the blame list: http://trac.webkit.org/changeset/60158 http://trac.webkit.org/changeset/60159
Ojan Vafai
Comment 22 2010-05-25 09:12:01 PDT
(In reply to comment #10) > + editingBehavior settings needs to be set back to a reasonable default between tests > > FWIW, I'd expect "reasonable default" to be the same on all platforms. What's the value in making it different? For non-DRT, the code in Settings.cpp currently has a different default for Mac and everyone else. So, DRT should, at reset the value to that default. I wouldn't want DRT always defaulting to EditingMacBehavior because then we lose test coverage. For example, if someone accidentally modifies the EditingWinBehavior behavior, then only the tests that call setEditingBehavior would actually test that. I think it's unfortunate that we have setEditingBehavior calls littered throughout the code though. I'd prefer that we had Settings::resetEditingBehavior or Settings::defaultEditingBehavior so that we have the logic of which editing behavior to use in one place. Eric pushed back on this on #webkit saying that this would be different than all other DRT setters. I don't have enough experience hacking on DRT to say. (In reply to comment #12) > How many tests like that are there? What we basically need is make two or three copies of each, and set different behaviors in those. Now that we've exposed setEditingBehavior, we can modify those tests to test both EditingMacBehavior and EditingWinBehavior. There's no need for them to have platform specific expectations now.
Alexey Proskuryakov
Comment 23 2010-05-25 09:33:44 PDT
> I wouldn't want DRT always defaulting to EditingMacBehavior because then we lose test coverage. I disagree with that. We need reproducible results more than we need accidental testing - running tests on Mac should be as close to running them on other platforms as possible.
Antonio Gomes
Comment 24 2010-05-25 12:58:27 PDT
I think now that Gtk, Mac, Win, Chromium and soon Qt (see bug 39680) are in, we can revert back r59852 and r59857, and gradually adjust other call sites (see comment #13) to use the new setEditingBehavior. ... and a some point close this bug as FIXED
Ojan Vafai
Comment 25 2010-05-25 13:10:50 PDT
(In reply to comment #23) > > I wouldn't want DRT always defaulting to EditingMacBehavior because then we lose test coverage. > > I disagree with that. We need reproducible results more than we need accidental testing - running tests on Mac should be as close to running them on other platforms as possible. If a test fails on Windows because of the editing behavior, then one of two things should happen: 1. There's a bug when using EditingWinBehavior and that should be fixed. 2. The test unintentionally is testing platform-specific behavior and the test should be fixed to test both EditingMacBehavior and EditingWinBehavior. As long as the above happens, running tests from a Mac is fairly close to running them on other platforms. A given commit might cause a failure on a non-mac port, but the fix will mean broader test coverage. We have bots specifically to ensure that the port-specific code is tested. I don't see why it makes sense for platform-specific code to not get the same testing.
Antonio Gomes
Comment 26 2010-06-08 13:29:07 PDT
(In reply to comment #24) > I think now that Gtk, Mac, Win, Chromium and soon Qt (see bug 39680) are in, we can revert back r59852 and r59857, and gradually adjust other call sites (see comment #13) to use the new setEditingBehavior. @Martin, plans to re-land these two backed out revisions? they should be safe to go now.
Antonio Gomes
Comment 27 2010-06-08 13:43:54 PDT
(In reply to comment #25) > (In reply to comment #23) > > > I wouldn't want DRT always defaulting to EditingMacBehavior because then we lose test coverage. If all platform specific editing tests are going through all code paths possible then it would make sense to default DRT generally to the same editing behavior type (being it "mac" or not). However the condition is not what happens currentl, and due to that I also agree that as tests are today, having them all sharing the same default would lose coverage. That is indeed something that could change in the future though, and I could have a look at that. For example, if we had at least one layout test for each of the platform specific editing behaviors, and each test were going through all code paths, then we would be safe to default all DRTs to the same value.
Martin Robinson
Comment 28 2010-06-08 13:49:09 PDT
Antonio Gomes
Comment 29 2010-10-12 05:55:29 PDT
Yesterday, I started converting all tests relying on platform specific (for now, Mac x Win) behavior to run with the LayoutTestController::setEditingBehavior machinery. I've fixed the following ones so far: - bug 47468: editing/selection/extend-after-mouse-selection.html - bug 47471: editing/selection/script-tests/click-in-margins-inside-editable-div.js - bug 47472: editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js It basically means that instead of having mac, win and qt expected results, we now have only one cross platform expected result file, since all platform behaviors are being tested. I will continue this work along the week. As a side note, it would be good to turn tests like editing/deleting/delete-by-word-001.html and editing/deleting/delete-by-word-002.html to not dump the render tree, but dump as text. I will try this as well. > (In reply to comment #12) > > How many tests like that are there? What we basically need is make two or three copies of each, and set different behaviors in those. > > ~14 tests in /editing. > > $ grep -nHR navigator.userAgent.search LayoutTests/editing/ > - LayoutTests/editing/selection/script-tests/click-in-padding-with-multiple-line-boxes.js > - LayoutTests/editing/selection/script-tests/click-in-margins-inside-editable-div.js > - LayoutTests/editing/selection/script-tests/shift-click.js > - LayoutTests/editing/selection/extend-selection-after-double-click.html > - LayoutTests/editing/selection/extend-after-mouse-selection.html > - LayoutTests/editing/selection/move-begin-end.html > - LayoutTests/editing/selection/5195166-1.html > - LayoutTests/editing/input/option-page-up-down.html > - LayoutTests/editing/undo/undo-deleteWord.html > - LayoutTests/editing/deleting/delete-by-word-001.html > - LayoutTests/editing/deleting/delete-by-word-002.html
Antonio Gomes
Comment 30 2010-10-22 07:22:57 PDT
> As a side note, it would be good to turn tests like editing/deleting/delete-by-word-001.html and editing/deleting/delete-by-word-002.html to not dump the render tree, but dump as text. I will try this as well. Filed bug 48130 and bug 48131 about these two.
Note You need to log in before you can comment on or make changes to this bug.