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

Issue 1989103007: Test for form submission targeting remote frame. (Closed)

Created:
4 years, 7 months ago by Łukasz Anforowicz
Modified:
4 years, 6 months ago
CC:
alexmos, blink-reviews, chromium-reviews, jochen+watch_chromium.org, Mike West, mlamouri+watch-test-runner_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Test for form submission targeting remote frame. Description of the new form-targets-cross-site-frame.html test. =============================================================== The test verifies that a form with target="crossSiteFrame" works fine (especially in presence of out-of-process-iframes, aka OOPIFs, aka blink::RemoteFrames which are present in --site-per-process mode). The test finishes successfully, if form-target.pl ends up calling testRunner.notifyDone() after main frame calls testRuner.waitUntilDone and submits the form. Expected test output helps verify that the correct HTTP method was used and that test field's value from the form was propagated correctly. Required test harness fix (under components/test_runner) ======================================================== Context ------- Before https://crrev.com/1852603002 (which I landed about a month ago): - Cancellation of TestRunner's callbacks was using WebTaskList, instead of reusing base::WeakPtr to cancel callbacks. - TestRunner::NotifyDone would cancel pending callbacks, before completing notifyDone processing. After https://crrev.com/1852603002: - WebTaskList was removed and replaced with using base::WeakPtr (yay!) - TestRunner::NotifyDone was modified to call weak_factory_.InvalidateWeakPtrs() instead of task_list_.RevokeAll(). This has led to the problem below. Problem ------- Calling weak_factory_.InvalidateWeakPtrs() from TestRunner::NotifyDone would cancel pending callbacks (as before), but invalidated weak pointers are also used for other things - i.e. as a link between TestRunnerBindings and TestRunner instance. This meant that https://crrev.com/1852603002 accidentally changed the semantics of testRunner.notifyDone(). Before https://crrev.com/1852603002 TestRunnerBindings would continue to work after a call to testRunner.notifyDone(). Keeping these bindings working is important, because testRunner.notifyDone() might *not* finish the test when 1) testRunner.waitUntilDone() was not called yet, or 2) there are pending work items in TestRunner::WorkQueue or 3) we are still tracking and waiting to finish loading of TestRunner::top_loading_frame_. In particular, the first notifyDone() call in the new form-targets-cross-site-frame.html test would not finish the test, because of (1). Fix --- It turns out that we can simply remove the call to InvalidateWeakPtrs from TestRunner::NotifyDone. This is okay because: - InvalidateWeakPtrs will still be called in TestRunner::Reset (which is called between tests), so we still will insulate one test from another. - Calling InvalidateWeakPtrs from TestRunner::NotifyDone cancels *pending* callbacks, but new callbacks created between TestRunner::NotifyDone and TestRunner::Reset would still be allowed to run. Therefore the call to InvalidateWeakPtrs doesn't robustly accomplish its original purpose. Since after the fix TestRunner::NotifyDone simply forwards the call to TestRunner::CompleteNotifyDone, these 2 methods can be merged together. BUG=585284 Committed: https://crrev.com/af6f5247c144b187499b231d13e326add0963089 Cr-Commit-Position: refs/heads/master@{#396920}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Test comments + cleaning up the code a bit. #

Total comments: 2

Patch Set 3 : Removing unnecessary logging statements. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -9 lines) Patch
M components/test_runner/test_runner.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M components/test_runner/test_runner.cc View 1 2 chunks +1 line, -8 lines 0 comments Download
M third_party/WebKit/LayoutTests/FlagExpectations/site-per-process View 1 chunk +3 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/navigation/form-targets-cross-site-frame.html View 1 2 1 chunk +39 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/navigation/form-targets-cross-site-frame-expected.txt View 1 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (10 generated)
Łukasz Anforowicz
Dirk, could you please take a look at the change I am making in components/test_runner/test_runner.cc? ...
4 years, 7 months ago (2016-05-19 23:01:16 UTC) #2
Łukasz Anforowicz
<adding jochen@ and mkwst@ to CC, in case they want to take a look later ...
4 years, 7 months ago (2016-05-19 23:12:55 UTC) #3
Dirk Pranke
I'm out of my depth on this one. What you wrote sounds plausible, but it's ...
4 years, 7 months ago (2016-05-20 01:13:29 UTC) #5
haraken
On 2016/05/20 01:13:29, Dirk Pranke wrote: > I'm out of my depth on this one. ...
4 years, 7 months ago (2016-05-20 01:52:04 UTC) #6
dcheng
Can you update the CL description with why NotifyDone() shouldn't cancel pending tasks? i.e. how ...
4 years, 7 months ago (2016-05-20 07:08:17 UTC) #8
Łukasz Anforowicz
Hmmm... I guess I'll just wait until Jochen comes back :-) (unless the expanded CL ...
4 years, 7 months ago (2016-05-20 17:01:32 UTC) #11
Łukasz Anforowicz
Alex, can you please take a look at the new test?
4 years, 7 months ago (2016-05-20 17:03:11 UTC) #13
dcheng
Thanks! Based on your updated description, can we just use a different WeakPtrFactory for the ...
4 years, 7 months ago (2016-05-20 17:13:11 UTC) #14
Łukasz Anforowicz
On 2016/05/20 17:13:11, dcheng wrote: > Thanks! Based on your updated description, can we just ...
4 years, 7 months ago (2016-05-20 17:30:32 UTC) #15
dcheng
On 2016/05/20 at 17:30:32, lukasza wrote: > On 2016/05/20 17:13:11, dcheng wrote: > > Thanks! ...
4 years, 7 months ago (2016-05-20 17:36:55 UTC) #16
Łukasz Anforowicz
On 2016/05/20 17:36:55, dcheng wrote: > On 2016/05/20 at 17:30:32, lukasza wrote: > > On ...
4 years, 7 months ago (2016-05-20 18:03:14 UTC) #17
alexmos
While we're waiting for the rest of this to get reviewed, I took a look ...
4 years, 7 months ago (2016-05-25 17:59:43 UTC) #18
Łukasz Anforowicz
Jochen, could you please take a look when you are back? (no rush, this can ...
4 years, 7 months ago (2016-05-25 21:31:45 UTC) #20
jochen (gone - plz use gerrit)
there used to be a timeout timer, but it was flaky. Instead, the python harness ...
4 years, 6 months ago (2016-05-30 13:52:16 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1989103007/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1989103007/40001
4 years, 6 months ago (2016-05-31 15:50:32 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 6 months ago (2016-05-31 20:38:32 UTC) #25
commit-bot: I haz the power
4 years, 6 months ago (2016-05-31 20:45:31 UTC) #27
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/af6f5247c144b187499b231d13e326add0963089
Cr-Commit-Position: refs/heads/master@{#396920}

Powered by Google App Engine
This is Rietveld 408576698