Chromium Code Reviews
DescriptionTest 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. #
Messages
Total messages: 27 (10 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||