Bug 39680 - [Qt] Expose the editing behavior setting in DRT to test all editing code paths
Summary: [Qt] Expose the editing behavior setting in DRT to test all editing code paths
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Antonio Gomes
URL:
Keywords: Qt, QtTriaged
Depends on: 38603
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-25 10:57 PDT by Antonio Gomes
Modified: 2010-06-07 06:57 PDT (History)
4 users (show)

See Also:


Attachments
(committed with r60189, reviewed by Ojan Vafai) patch v1 (7.98 KB, patch)
2010-05-25 11:44 PDT, Antonio Gomes
no flags Details | Formatted Diff | Diff
proposed patch (1.35 KB, patch)
2010-05-28 20:04 PDT, Laszlo Gombos
eric: review-
Details | Formatted Diff | Diff
patch v2 - adding ASSERT_NOT_REACHED (1.37 KB, patch)
2010-06-01 11:24 PDT, Laszlo Gombos
eric: review-
Details | Formatted Diff | Diff
(committed with r60778, reviewed by Kenneth and Eric) patch v2.1 - adding ASSERT_NOT_REACHED (2.25 KB, patch)
2010-06-06 05:11 PDT, Antonio Gomes
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antonio Gomes 2010-05-25 10:57:11 PDT
Expose the editing behavior setting to DRT, as discussed in https://lists.webkit.org/pipermail/webkit-dev/2010-March/012118.html

It is a follow of of bug 38603, witch missed the Qt bits.

Patch coming ...
Comment 1 Antonio Gomes 2010-05-25 11:44:56 PDT
Created attachment 57034 [details]
(committed with r60189, reviewed by Ojan Vafai) patch v1
Comment 2 Antonio Gomes 2010-05-25 15:17:06 PDT
Comment on attachment 57034 [details]
(committed with r60189, reviewed by Ojan Vafai) patch v1

(From update of attachment 57034 [details])
Clearing flags on attachment: 57034

Committed r60189: <http://trac.webkit.org/changeset/60189>
Comment 3 Laszlo Gombos 2010-05-28 20:02:21 PDT
This patch introduced the following warning:

webkit/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp: In static member function âstatic void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage*, const QString&):

webkit/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp:479: warning: "coreEditingBehavior" may be used uninitialized in this function
Comment 4 Laszlo Gombos 2010-05-28 20:04:14 PDT
Created attachment 57403 [details]
proposed patch
Comment 5 Antonio Gomes 2010-05-29 20:06:10 PDT
(In reply to comment #3)
> This patch introduced the following warning:
> 
> webkit/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp: In static member function âstatic void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage*, const QString&):
> 
> webkit/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp:479: warning: "coreEditingBehavior" may be used uninitialized in this function

My bad. I saw that, and would patch it when I was on a clean tree, but good you came first :)


     else if (editingBehavior == "mac")
         coreEditingBehavior = EditingMacBehavior;
+    else
+        return;

Personally I would add an ASSERT_NOT_REACHED() as well. This shouldn't get never executed at all!

other than that, lgtm, thank you Laszlo.
Comment 6 Eric Seidel (no email) 2010-05-30 11:15:48 PDT
Comment on attachment 57403 [details]
proposed patch

Should we log in this case?
Comment 7 Eric Seidel (no email) 2010-05-30 11:16:08 PDT
Seems like programmer error to pass a non-supported value here as part of a test case.
Comment 8 Eric Seidel (no email) 2010-05-30 11:16:50 PDT
Comment on attachment 57403 [details]
proposed patch

We could even ASSERT_NOT_REACHED instead of loging.  That's probably better.

Yeah this should just ASSERT_NOT_REACHED.
Comment 9 Laszlo Gombos 2010-06-01 11:24:42 PDT
Created attachment 57572 [details]
patch v2 - adding ASSERT_NOT_REACHED
Comment 10 Eric Seidel (no email) 2010-06-01 11:33:05 PDT
Comment on attachment 57572 [details]
patch v2 - adding ASSERT_NOT_REACHED

When I add ASSERT_NOT_REACHED I often put a comment as to why it should not be reached.  In this case:

# You've hit this ASSERT either because the layout test is using an invalid string or because Qt's DumpRenderTree is missing support for that editing behavior.

You've added an unconditional return due to missing {}
Comment 11 Antonio Gomes 2010-06-06 05:11:03 PDT
Created attachment 57973 [details]
(committed with r60778, reviewed by Kenneth and Eric) patch v2.1 - adding ASSERT_NOT_REACHED 

given the long delay, I felt free to re-upload the patch adding ASSERT_NOT_REACHED() and enclosing "{...}" to the return statment.
Comment 12 Antonio Gomes 2010-06-07 06:57:24 PDT
Comment on attachment 57973 [details]
(committed with r60778, reviewed by Kenneth and Eric) patch v2.1 - adding ASSERT_NOT_REACHED 

Clearing flags on attachment: 57973

Committed r60778: <http://trac.webkit.org/changeset/60778>