From 32688d45753f9c67d22ab762468108f82432ec2c Mon Sep 17 00:00:00 2001 From: "tkent@chromium.org" Date: Fri, 30 Aug 2013 03:36:28 +0000 Subject: REGRESSION: Dropping on file input doesn't work if files are dopped on button text. This is a regression by r152700 or r153212. DragController assumed a shadow button in input[type=file] didn't have any child nodes. * asFileInput: Support a case that the specified node is a Text node in a button. Simplify the implementation. * elementUnderMouse: Support a case that innerNode is a Text node child of a ShadowRoot parent. BUG=280617 TEST=automated Review URL: https://chromiumcodereview.appspot.com/23538005 git-svn-id: svn://svn.chromium.org/blink/trunk@156952 bbb929c8-8fbe-4397-9dbb-9b2b20218538 --- .../fast/forms/file/file-input-change-event-expected.txt | 3 +++ .../LayoutTests/fast/forms/file/file-input-change-event.html | 12 ++++++++++++ 2 files changed, 15 insertions(+) (limited to 'third_party/WebKit/LayoutTests/fast') diff --git a/third_party/WebKit/LayoutTests/fast/forms/file/file-input-change-event-expected.txt b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-change-event-expected.txt index 6d03df6..aff2c22 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/file/file-input-change-event-expected.txt +++ b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-change-event-expected.txt @@ -13,6 +13,9 @@ PASS singleFileInput.value is "C:\\fakepath\\bar.txt" PASS changeDispatched is false PASS singleFileInput.value is "C:\\fakepath\\foo.txt" PASS changeDispatched is true +PASS singleFileInput.value is "C:\\fakepath\\baz.png" +PASS changeDispatched is true + Test that the 'change' event is triggered on a multiple file form when a selected file is changed: PASS multipleFilesInput.value is "C:\\fakepath\\foo.txt" PASS changeDispatched is true diff --git a/third_party/WebKit/LayoutTests/fast/forms/file/file-input-change-event.html b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-change-event.html index 89a80d9..fab3c8a 100644 --- a/third_party/WebKit/LayoutTests/fast/forms/file/file-input-change-event.html +++ b/third_party/WebKit/LayoutTests/fast/forms/file/file-input-change-event.html @@ -33,6 +33,11 @@ if (window.testRunner) { shouldBeEqualToString("singleFileInput.value", "C:\\fakepath\\foo.txt"); shouldBe("changeDispatched", "true"); + dragFilesOntoButtonInsideFileInput(singleFileInput, ["baz.png"]); + shouldBeEqualToString("singleFileInput.value", "C:\\fakepath\\baz.png"); + shouldBe("changeDispatched", "true"); + + debug(""); debug("Test that the 'change' event is triggered on a multiple file form when a selected file is changed:"); dragFilesOntoInput(multipleFilesInput, ["foo.txt"]); shouldBeEqualToString("multipleFilesInput.value", "C:\\fakepath\\foo.txt"); @@ -100,6 +105,13 @@ function dragFilesOntoInput(input, files) { moveMouseToCenterOfElement(input); eventSender.mouseUp(); } + +function dragFilesOntoButtonInsideFileInput(input, files) { + changeDispatched = false; + eventSender.beginDragWithFiles(files); + eventSender.mouseMoveTo(input.offsetLeft + 10, input.offsetTop + input.offsetHeight / 2); + eventSender.mouseUp(); +} -- cgit v1.1