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

Unified Diff: components/test_runner/event_sender.cc

Issue 1718463002: Gracefully handle nested eventSender.beginDragWithFiles() attempts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/test_runner/event_sender.cc
diff --git a/components/test_runner/event_sender.cc b/components/test_runner/event_sender.cc
index 4a9b09bb3cd902afd92a02cc4b72c5c85a989c32..78f926e949bee40a9d493d2d345bb196d1c2aa60 100644
--- a/components/test_runner/event_sender.cc
+++ b/components/test_runner/event_sender.cc
@@ -1845,6 +1845,16 @@ void EventSender::LeapForward(int milliseconds) {
}
void EventSender::BeginDragWithFiles(const std::vector<std::string>& files) {
+ if (!current_drag_data_.isNull()) {
+ // Nested dragging not supported, fuzzer code a likely culprit.
+ // Cancel the current drag operation and throw an error.
+ KeyDown("escape", 0, DOMKeyLocationStandard);
+ v8::Isolate* isolate = blink::mainThreadIsolate();
+ isolate->ThrowException(v8::Exception::Error(
+ gin::StringToV8(isolate,
+ "Nested beginDragWithFiles() not supported.")));
+ return;
+ }
current_drag_data_.initialize();
WebVector<WebString> absolute_filenames(files.size());
for (size_t i = 0; i < files.size(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698