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

Side by Side Diff: chrome/browser/ui/views/drag_and_drop_interactive_uitest.cc

Issue 2655463015: Correctly set dragLeave and dragEnd coords for OOPIF drag and drop (Closed)
Patch Set: Added checks for null RWH on drag end Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/test_runner/event_sender.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <initializer_list> 6 #include <initializer_list>
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 { 927 {
928 DOMDragEventWaiter dragleave_event_waiter("dragleave", left_frame()); 928 DOMDragEventWaiter dragleave_event_waiter("dragleave", left_frame());
929 DOMDragEventWaiter dragenter_event_waiter("dragenter", right_frame()); 929 DOMDragEventWaiter dragenter_event_waiter("dragenter", right_frame());
930 state->left_frame_events_counter->Reset(); 930 state->left_frame_events_counter->Reset();
931 state->right_frame_events_counter->Reset(); 931 state->right_frame_events_counter->Reset();
932 ASSERT_TRUE(SimulateMouseMoveToRightFrame()); 932 ASSERT_TRUE(SimulateMouseMoveToRightFrame());
933 933
934 { // Verify dragleave DOM event. 934 { // Verify dragleave DOM event.
935 std::string dragleave_event; 935 std::string dragleave_event;
936 936
937 // TODO(paulmeyer): https://crbug.com/669695: Need to unify coordinates 937 state->expected_dom_event_data.set_expected_client_position("(355, 150)");
938 // passed to dragend when OOPIFs are present or not. 938 state->expected_dom_event_data.set_expected_page_position("(355, 150)");
939 state->expected_dom_event_data.set_expected_client_position(
940 "<no expectation>");
941 state->expected_dom_event_data.set_expected_page_position(
942 "<no expectation>");
943 939
944 EXPECT_TRUE( 940 EXPECT_TRUE(
945 dragleave_event_waiter.WaitForNextMatchingEvent(&dragleave_event)); 941 dragleave_event_waiter.WaitForNextMatchingEvent(&dragleave_event));
946 EXPECT_THAT(dragleave_event, state->expected_dom_event_data.Matches()); 942 EXPECT_THAT(dragleave_event, state->expected_dom_event_data.Matches());
947 } 943 }
948 944
949 { // Verify dragenter DOM event. 945 { // Verify dragenter DOM event.
950 std::string dragenter_event; 946 std::string dragenter_event;
951 947
952 // Update expected event coordinates after SimulateMouseMoveToRightFrame 948 // Update expected event coordinates after SimulateMouseMoveToRightFrame
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 EXPECT_THAT(drop_event, state->expected_dom_event_data.Matches()); 1014 EXPECT_THAT(drop_event, state->expected_dom_event_data.Matches());
1019 } 1015 }
1020 1016
1021 // Verify dragend DOM event. 1017 // Verify dragend DOM event.
1022 { 1018 {
1023 // TODO(lukasza): Figure out why the drop event sees different values of 1019 // TODO(lukasza): Figure out why the drop event sees different values of
1024 // DataTransfer.dropEffect and DataTransfer.types properties. 1020 // DataTransfer.dropEffect and DataTransfer.types properties.
1025 state->expected_dom_event_data.set_expected_drop_effect("copy"); 1021 state->expected_dom_event_data.set_expected_drop_effect("copy");
1026 state->expected_dom_event_data.set_expected_mime_types(""); 1022 state->expected_dom_event_data.set_expected_mime_types("");
1027 1023
1028 // TODO(paulmeyer): https://crbug.com/669695: Need to unify coordinates 1024 // TODO: https://crbug.com/686136: dragEnd coordinates for non-OOPIF
1029 // passed to dragend when OOPIFs are present or not. 1025 // scenarios are currently broken.
1030 state->expected_dom_event_data.set_expected_client_position( 1026 state->expected_dom_event_data.set_expected_client_position(
1031 "<no expectation>"); 1027 "<no expectation>");
1032 state->expected_dom_event_data.set_expected_page_position( 1028 state->expected_dom_event_data.set_expected_page_position(
1033 "<no expectation>"); 1029 "<no expectation>");
1034 1030
1035 std::string dragend_event; 1031 std::string dragend_event;
1036 EXPECT_TRUE( 1032 EXPECT_TRUE(
1037 state->dragend_event_waiter->WaitForNextMatchingEvent(&dragend_event)); 1033 state->dragend_event_waiter->WaitForNextMatchingEvent(&dragend_event));
1038 state->dragend_event_waiter.reset(); 1034 state->dragend_event_waiter.reset();
1039 EXPECT_THAT(dragend_event, state->expected_dom_event_data.Matches()); 1035 EXPECT_THAT(dragend_event, state->expected_dom_event_data.Matches());
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 // of a drag operation, and cross-site drags should be allowed across a 1280 // of a drag operation, and cross-site drags should be allowed across a
1285 // navigation. 1281 // navigation.
1286 1282
1287 INSTANTIATE_TEST_CASE_P( 1283 INSTANTIATE_TEST_CASE_P(
1288 SameSiteSubframe, DragAndDropBrowserTest, ::testing::Values(false)); 1284 SameSiteSubframe, DragAndDropBrowserTest, ::testing::Values(false));
1289 1285
1290 INSTANTIATE_TEST_CASE_P( 1286 INSTANTIATE_TEST_CASE_P(
1291 CrossSiteSubframe, DragAndDropBrowserTest, ::testing::Values(true)); 1287 CrossSiteSubframe, DragAndDropBrowserTest, ::testing::Values(true));
1292 1288
1293 } // namespace chrome 1289 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/event_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698