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

Side by Side Diff: third_party/WebKit/Source/web/tests/WebViewTest.cpp

Issue 2485693003: Drag-and-drop: DragEnter, DragOver, DragLeave, DragDrop (Closed)
Patch Set: Rebased. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1785 matching lines...) Expand 10 before | Expand all | Expand 10 after
1796 dragData.initialize(); 1796 dragData.initialize();
1797 1797
1798 WebDragData::Item item; 1798 WebDragData::Item item;
1799 item.storageType = WebDragData::Item::StorageTypeString; 1799 item.storageType = WebDragData::Item::StorageTypeString;
1800 item.stringType = "text/uri-list"; 1800 item.stringType = "text/uri-list";
1801 item.stringData = WebString::fromUTF8(url); 1801 item.stringData = WebString::fromUTF8(url);
1802 dragData.addItem(item); 1802 dragData.addItem(item);
1803 1803
1804 const WebPoint clientPoint(0, 0); 1804 const WebPoint clientPoint(0, 0);
1805 const WebPoint screenPoint(0, 0); 1805 const WebPoint screenPoint(0, 0);
1806 webView->dragTargetDragEnter(dragData, clientPoint, screenPoint, 1806 ASSERT_TRUE(webView->widget()->isWebFrameWidget());
1807 WebDragOperationCopy, 0); 1807 WebFrameWidget* widget = static_cast<WebFrameWidget*>(webView->widget());
dcheng 2016/11/09 20:23:16 Is it possible to just go through the main frame's
paulmeyer 2016/11/09 23:19:11 Yes, done.
1808 webView->dragTargetDrop(dragData, clientPoint, screenPoint, 0); 1808 widget->dragTargetDragEnter(dragData, clientPoint, screenPoint,
1809 WebDragOperationCopy, 0);
1810 widget->dragTargetDrop(dragData, clientPoint, screenPoint, 0);
1809 FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webView->mainFrame()); 1811 FrameTestHelpers::pumpPendingRequestsForFrameToLoad(webView->mainFrame());
1810 } 1812 }
1811 1813
1812 TEST_P(WebViewTest, DragDropURL) { 1814 TEST_P(WebViewTest, DragDropURL) {
1813 URLTestHelpers::registerMockedURLFromBaseURL( 1815 URLTestHelpers::registerMockedURLFromBaseURL(
1814 WebString::fromUTF8(m_baseURL.c_str()), "foo.html"); 1816 WebString::fromUTF8(m_baseURL.c_str()), "foo.html");
1815 URLTestHelpers::registerMockedURLFromBaseURL( 1817 URLTestHelpers::registerMockedURLFromBaseURL(
1816 WebString::fromUTF8(m_baseURL.c_str()), "bar.html"); 1818 WebString::fromUTF8(m_baseURL.c_str()), "bar.html");
1817 1819
1818 const std::string fooUrl = m_baseURL + "foo.html"; 1820 const std::string fooUrl = m_baseURL + "foo.html";
(...skipping 2438 matching lines...) Expand 10 before | Expand all | Expand 10 after
4257 .translate(50, 55) 4259 .translate(50, 55)
4258 .scale(1. / 2.f); 4260 .scale(1. / 2.f);
4259 EXPECT_EQ(expectedMatrix, 4261 EXPECT_EQ(expectedMatrix,
4260 webViewImpl->getDeviceEmulationTransformForTesting()); 4262 webViewImpl->getDeviceEmulationTransformForTesting());
4261 // visibleContentRect doesn't change. 4263 // visibleContentRect doesn't change.
4262 EXPECT_EQ(IntRect(50, 55, 50, 75), 4264 EXPECT_EQ(IntRect(50, 55, 50, 75),
4263 *devToolsEmulator->visibleContentRectForPainting()); 4265 *devToolsEmulator->visibleContentRectForPainting());
4264 } 4266 }
4265 4267
4266 } // namespace blink 4268 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.cpp ('k') | third_party/WebKit/public/web/WebFrameWidget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698