diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-13 15:05:36 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-14 10:33:47 +0000 |
commit | e684a3455bcc29a6e3e66a004e352dea4e1141e7 (patch) | |
tree | d55b4003bde34d7d05f558f02cfd82b2a66a7aac /chromium/third_party/blink/renderer/core/html/forms/file_input_type_test.cc | |
parent | 2b94bfe47ccb6c08047959d1c26e392919550e86 (diff) | |
download | qtwebengine-chromium-e684a3455bcc29a6e3e66a004e352dea4e1141e7.tar.gz |
BASELINE: Update Chromium to 72.0.3626.110 and Ninja to 1.9.0
Change-Id: Ic57220b00ecc929a893c91f5cc552f5d3e99e922
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/core/html/forms/file_input_type_test.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/core/html/forms/file_input_type_test.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/chromium/third_party/blink/renderer/core/html/forms/file_input_type_test.cc b/chromium/third_party/blink/renderer/core/html/forms/file_input_type_test.cc index bb3d71d4004..47afb404da6 100644 --- a/chromium/third_party/blink/renderer/core/html/forms/file_input_type_test.cc +++ b/chromium/third_party/blink/renderer/core/html/forms/file_input_type_test.cc @@ -9,6 +9,7 @@ #include "third_party/blink/renderer/core/dom/document.h" #include "third_party/blink/renderer/core/fileapi/file_list.h" #include "third_party/blink/renderer/core/html/forms/html_input_element.h" +#include "third_party/blink/renderer/core/html/forms/mock_file_chooser.h" #include "third_party/blink/renderer/core/html_names.h" #include "third_party/blink/renderer/core/loader/empty_clients.h" #include "third_party/blink/renderer/core/page/drag_data.h" @@ -22,12 +23,6 @@ namespace { class WebKitDirectoryChromeClient : public EmptyChromeClient { public: - void EnumerateChosenDirectory(FileChooser* chooser) override { - chooser->AddRef(); // Do same as ChromeClientImpl - static_cast<WebFileChooserCompletion*>(chooser)->DidChooseFile( - WebVector<WebString>()); - } - void RegisterPopupOpeningObserver(PopupOpeningObserver*) override { NOTREACHED() << "RegisterPopupOpeningObserver should not be called."; } @@ -50,7 +45,7 @@ TEST(FileInputTypeTest, createFileList) { files.push_back(CreateFileChooserFileInfoFileSystem( url, base::Time::FromJsTime(1.0 * kMsPerDay + 3), 64)); - FileList* list = FileInputType::CreateFileList(files, false); + FileList* list = FileInputType::CreateFileList(files, base::FilePath()); ASSERT_TRUE(list); ASSERT_EQ(2u, list->length()); @@ -117,7 +112,7 @@ TEST(FileInputTypeTest, setFilesFromPaths) { EXPECT_EQ(String("/native/path1"), file_input->Files()->item(0)->GetPath()); // Try to upload multiple files with multipleAttr - input->SetBooleanAttribute(HTMLNames::multipleAttr, true); + input->SetBooleanAttribute(html_names::kMultipleAttr, true); paths.clear(); paths.push_back("/native/real/path1"); paths.push_back("/native/real/path2"); @@ -140,10 +135,16 @@ TEST(FileInputTypeTest, DropTouchesNoPopupOpeningObserver) { doc.body()->SetInnerHTMLFromString("<input type=file webkitdirectory>"); auto& input = *ToHTMLInputElement(doc.body()->firstChild()); + base::RunLoop run_loop; + MockFileChooser chooser(&doc.GetFrame()->GetInterfaceProvider(), + run_loop.QuitClosure()); DragData drag_data(DataObject::Create(), FloatPoint(), FloatPoint(), kDragOperationCopy); drag_data.PlatformData()->Add(File::Create("/foo/bar")); input.ReceiveDroppedFiles(&drag_data); + run_loop.Run(); + + chooser.ResponseOnOpenFileChooser(FileChooserFileInfoList()); // The test passes if WebKitDirectoryChromeClient:: // UnregisterPopupOpeningObserver() was not called. |