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

Issue 2453693003: Browser tests for OOPIF support for drag-n-drop. (Closed)

Created:
4 years, 1 month ago by Łukasz Anforowicz
Modified:
4 years, 1 month ago
Reviewers:
ncarter (slow), alexmos
CC:
chromium-reviews, jam, darin-cc_chromium.org, dcheng, site-isolation-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Initial browser tests for OOPIF support for drag-n-drop. This CL adds a single test - dragging and dropping a piece of text from outside of the browser into a cross-site frame. The test expectedly fails for now in --site-per-process mode (the CL adds an exception in site-per-process.content_browsertests.filter). DOMMessageQueue =============== The new test verifies whether appropriate javascript events have fired. This is done by DOMMessageQueue, which has been tweaked slightly to target only a specified WebContents and detect renderer crashes. The modified DOMMessageQueue makes the old DOMOperationObserver obsolete, so the CL deletes the old class and switches its users to use DOMMessageQueue instead. DomAutomationController::SendMsg was refusing to serialize and send javascript objects. This restriction has been lifted (any object type can be sent, as long as it can be serialized to JSON). Simulation of drag-and-drop =========================== The CL introduces a DragAndDropSimulator that helps with simulating drag-and-drop events for WebContents. The simulator supports only the minimum functionality required to enable the first OOPIF test: - Currently the simulator only supports drag-enter (dragging something from outside the browser into WebContenst) and drop events. - Currently the simulator only works when WebContents is built on top of aura UI abstraction/platform. Test pages ========== The CL provides a main test page (content/test/data/drag_and_drop/page.html) which enables: - Easy locating of subframes (which are positioned at fixed coordinates). - Easy replacing of subframe contents, which are specified by URL query. - This helps with testing various drag-and-drop scenarios (e.g. using different subframes for testing drop with drop_target.html OR for testing drag-start with image_source.html). - This also helps exercise various OOPIF scenarios (e.g. using subframes that are same-site or cross-site). BUG=647249 Committed: https://crrev.com/f1cf6923ce29e2995e7deefa654d299fd5512d28 Cr-Commit-Position: refs/heads/master@{#429472}

Patch Set 1 #

Patch Set 2 : First test is almost test complete (and doesn't work at all... :-P). #

Patch Set 3 : Simulating drag from outside into the browser works. #

Patch Set 4 : Some progress on dom event verification, but doesn't work yet... #

Patch Set 5 : CL (with a first test) seems ready for final testing and review. #

Patch Set 6 : Rebasing... #

Patch Set 7 : Giving up and going back to using notifications. #

Total comments: 10

Patch Set 8 : Using DOMMessageQueue instead of DOMAutomationWaiter. #

Patch Set 9 : Removing a DCHECK - apparently WebContents::FromRenderFrameHost can return null. #

Total comments: 6

Patch Set 10 : Addressed CR feedback from nick@. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+534 lines, -54 lines) Patch
A content/browser/web_contents/drag_and_drop_browsertest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +324 lines, -0 lines 0 comments Download
M content/public/test/browser_test_utils.h View 1 2 3 4 5 6 7 8 9 2 chunks +10 lines, -1 line 0 comments Download
M content/public/test/browser_test_utils.cc View 1 2 3 4 5 6 7 8 5 chunks +29 lines, -49 lines 0 comments Download
M content/renderer/dom_automation_controller.cc View 1 2 3 4 5 6 1 chunk +3 lines, -4 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
A content/test/data/drag_and_drop/drop_target.html View 1 2 3 4 1 chunk +44 lines, -0 lines 0 comments Download
A content/test/data/drag_and_drop/event_monitoring.js View 1 2 3 4 5 6 7 1 chunk +37 lines, -0 lines 0 comments Download
A content/test/data/drag_and_drop/image_source.html View 1 2 3 4 5 6 7 1 chunk +34 lines, -0 lines 0 comments Download
A content/test/data/drag_and_drop/page.html View 1 2 3 4 1 chunk +46 lines, -0 lines 0 comments Download
M testing/buildbot/filters/site-per-process.content_browsertests.filter View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 40 (30 generated)
ncarter (slow)
https://codereview.chromium.org/2453693003/diff/120001/content/browser/web_contents/drag_and_drop_browsertest.cc File content/browser/web_contents/drag_and_drop_browsertest.cc (right): https://codereview.chromium.org/2453693003/diff/120001/content/browser/web_contents/drag_and_drop_browsertest.cc#newcode162 content/browser/web_contents/drag_and_drop_browsertest.cc:162: class DOMDragEventWaiter : public DOMAutomationWaiter { I think this ...
4 years, 1 month ago (2016-11-01 19:50:53 UTC) #16
Łukasz Anforowicz
Thanks Nick. I've replaced DOMAutomationWaiter with DOMMessageQueue - I think the CL should be ready ...
4 years, 1 month ago (2016-11-01 23:43:42 UTC) #23
alexmos
Drive-by thought: I haven't looked at the test in detail, so not entirely sure how ...
4 years, 1 month ago (2016-11-02 17:44:18 UTC) #28
ncarter (slow)
lgtm https://codereview.chromium.org/2453693003/diff/160001/content/browser/web_contents/drag_and_drop_browsertest.cc File content/browser/web_contents/drag_and_drop_browsertest.cc (right): https://codereview.chromium.org/2453693003/diff/160001/content/browser/web_contents/drag_and_drop_browsertest.cc#newcode69 content/browser/web_contents/drag_and_drop_browsertest.cc:69: DragAndDropSimulator(WebContents* web_contents) explicit https://codereview.chromium.org/2453693003/diff/160001/content/browser/web_contents/drag_and_drop_browsertest.cc#newcode270 content/browser/web_contents/drag_and_drop_browsertest.cc:270: RenderFrameHost* GetFrameByName(const std::string& ...
4 years, 1 month ago (2016-11-02 19:11:45 UTC) #29
Łukasz Anforowicz
Thanks for reviewing. On 2016/11/02 17:44:18, alexmos wrote: > Drive-by thought: I haven't looked at ...
4 years, 1 month ago (2016-11-02 21:03:33 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2453693003/180001
4 years, 1 month ago (2016-11-02 21:06:06 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/173013)
4 years, 1 month ago (2016-11-02 23:24:39 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2453693003/180001
4 years, 1 month ago (2016-11-02 23:32:54 UTC) #37
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 1 month ago (2016-11-03 00:22:39 UTC) #38
commit-bot: I haz the power
4 years, 1 month ago (2016-11-03 00:25:26 UTC) #40
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/f1cf6923ce29e2995e7deefa654d299fd5512d28
Cr-Commit-Position: refs/heads/master@{#429472}

Powered by Google App Engine
This is Rietveld 408576698