Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Issue 26654011: Fixing TestRunner::findString() so as to fix findString.html editing (Closed)

Created:
7 years, 2 months ago by arpitab_
Modified:
7 years, 2 months ago
Reviewers:
tkent
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Fixing TestRunner::findString() so as to fix findString.html editing testcase. We need to call frame's stopFinding() API after the find() call. Also, false should be passed for the |clearSelection| in parameter. This helps set focus and selection on the found/matched range, if any. The reason why editing/text-iterator/findString.html was failing earlier was because selection was not being set on the matched range. Thus selection.baseOffset and selection.extentOffset would both return zero. Also, additional find options i.e. "StartInSelection", "AtWordStarts" and "TreatMedialCapitalAsWordStart" are now being handled by the TestRunner and have been added to WebFindOptions as well. Handling these lead to a small change in behavior of LayoutTests/editing/ text-iterator/findString-restarts-at-last-position.html testcase. The first case within this: shouldBeTrue('testRunner.findString("first_", [])'); moves the selection to "first_". The next case: shouldBeTrue('testRunner.findString("first_step", [])'); was earlier returning true since we were not handling "StartInSelection" find option. With the implementation of this option, if we wish for the next find operation to begin from the start of the current active selection ("find_" in this case) we should set this option explicitly. Otherwise, if no option is passed, findNext is considered as set and we start the next find operation from after the current active selection. Thus the aforementioned case of finding "find_step" would return false. To fix this, I am now passing the "StartInSelection" option to the findString() call. Also, in the testcase: LayoutTests/editing/text-iterator/findString.html for the test: testFindString("webkit.org", "org", ["AtWordStarts"], [[]]); we are currently matching the behavior for: testFindString("webkit.org", "org", ["AtWordStarts", "TreatMedialCapitalAsWordStart"], [[7, 10], []]); and hence I have changed the case to expect a return selection range of [7, 10]. This is the only change made in findString.html. BUG=64773 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=160033

Patch Set 1 #

Total comments: 8

Patch Set 2 : Fixing all failures in the testcase #

Total comments: 1

Patch Set 3 : Handling StartInSelection, AtWordStarts and TreatMedialCapitalAsWordStart find options #

Patch Set 4 : Fixing missed out cases #

Total comments: 3

Patch Set 5 : Fixing default initializations #

Unified diffs Side-by-side diffs Delta from patch set Stats (+100 lines, -80 lines) Patch
M LayoutTests/editing/text-iterator/findString.html View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/editing/text-iterator/findString-expected.txt View 1 2 1 chunk +74 lines, -74 lines 0 comments Download
M LayoutTests/editing/text-iterator/findString-restarts-at-last-position.html View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M LayoutTests/editing/text-iterator/findString-restarts-at-last-position-expected.txt View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M Source/testing/runner/TestRunner.cpp View 1 2 3 4 2 chunks +8 lines, -1 line 0 comments Download
M Source/web/WebFrameImpl.cpp View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M public/web/WebFindOptions.h View 1 2 3 4 1 chunk +10 lines, -1 line 0 comments Download

Messages

Total messages: 14 (0 generated)
arpitab_
7 years, 2 months ago (2013-10-15 09:38:00 UTC) #1
tkent
https://codereview.chromium.org/26654011/diff/1/LayoutTests/editing/text-iterator/findString-expected.txt File LayoutTests/editing/text-iterator/findString-expected.txt (right): https://codereview.chromium.org/26654011/diff/1/LayoutTests/editing/text-iterator/findString-expected.txt#newcode49 LayoutTests/editing/text-iterator/findString-expected.txt:49: FAIL: Expected a match at but got a match ...
7 years, 2 months ago (2013-10-16 01:02:29 UTC) #2
arpitab_
https://codereview.chromium.org/26654011/diff/1/LayoutTests/editing/text-iterator/findString-expected.txt File LayoutTests/editing/text-iterator/findString-expected.txt (right): https://codereview.chromium.org/26654011/diff/1/LayoutTests/editing/text-iterator/findString-expected.txt#newcode49 LayoutTests/editing/text-iterator/findString-expected.txt:49: FAIL: Expected a match at but got a match ...
7 years, 2 months ago (2013-10-16 06:04:52 UTC) #3
arpitab_
On 2013/10/16 06:04:52, arpitab_ wrote: > https://codereview.chromium.org/26654011/diff/1/LayoutTests/editing/text-iterator/findString-expected.txt > File LayoutTests/editing/text-iterator/findString-expected.txt (right): > > https://codereview.chromium.org/26654011/diff/1/LayoutTests/editing/text-iterator/findString-expected.txt#newcode49 > ...
7 years, 2 months ago (2013-10-16 06:07:20 UTC) #4
arpitab_
Both the failing testcases: css3/filters/effect-reference-hw.html and virtual/stable/webexposed/nonstable-css-properties.html are not related to the change made in ...
7 years, 2 months ago (2013-10-16 09:59:51 UTC) #5
tkent
https://codereview.chromium.org/26654011/diff/7001/LayoutTests/editing/text-iterator/findString.html File LayoutTests/editing/text-iterator/findString.html (right): https://codereview.chromium.org/26654011/diff/7001/LayoutTests/editing/text-iterator/findString.html#newcode48 LayoutTests/editing/text-iterator/findString.html:48: testFindString("insurmountable mountain", "mount", ["AtWordStarts"], [[5, 10], [15, 20]]); This ...
7 years, 2 months ago (2013-10-17 03:42:24 UTC) #6
arpitab_
On 2013/10/17 03:42:24, tkent wrote: > https://codereview.chromium.org/26654011/diff/7001/LayoutTests/editing/text-iterator/findString.html > File LayoutTests/editing/text-iterator/findString.html (right): > > https://codereview.chromium.org/26654011/diff/7001/LayoutTests/editing/text-iterator/findString.html#newcode48 > ...
7 years, 2 months ago (2013-10-17 10:58:56 UTC) #7
arpitab_
Hi tkent! Have uploaded another patch which now handles all the remaining find options i.e. ...
7 years, 2 months ago (2013-10-17 15:17:56 UTC) #8
tkent
https://codereview.chromium.org/26654011/diff/26001/LayoutTests/editing/text-iterator/findString-restarts-at-last-position.html File LayoutTests/editing/text-iterator/findString-restarts-at-last-position.html (right): https://codereview.chromium.org/26654011/diff/26001/LayoutTests/editing/text-iterator/findString-restarts-at-last-position.html#newcode25 LayoutTests/editing/text-iterator/findString-restarts-at-last-position.html:25: shouldBeTrue('testRunner.findString("first_step", ["StartInSelection"])'); Please explain why we need this change ...
7 years, 2 months ago (2013-10-17 23:31:29 UTC) #9
arpitab_
On 2013/10/17 23:31:29, tkent wrote: > https://codereview.chromium.org/26654011/diff/26001/LayoutTests/editing/text-iterator/findString-restarts-at-last-position.html > File LayoutTests/editing/text-iterator/findString-restarts-at-last-position.html > (right): > > https://codereview.chromium.org/26654011/diff/26001/LayoutTests/editing/text-iterator/findString-restarts-at-last-position.html#newcode25 ...
7 years, 2 months ago (2013-10-18 05:39:36 UTC) #10
arpitab_
7 years, 2 months ago (2013-10-18 06:06:21 UTC) #11
tkent
lgtm
7 years, 2 months ago (2013-10-20 23:05:24 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/a.bah@samsung.com/26654011/41001
7 years, 2 months ago (2013-10-20 23:05:36 UTC) #13
commit-bot: I haz the power
7 years, 2 months ago (2013-10-20 23:11:20 UTC) #14
Message was sent while issue was closed.
Change committed as 160033

Powered by Google App Engine
This is Rietveld 408576698