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

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: Cleanup 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
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 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 { 921 {
922 DOMDragEventWaiter dragleave_event_waiter("dragleave", left_frame()); 922 DOMDragEventWaiter dragleave_event_waiter("dragleave", left_frame());
923 DOMDragEventWaiter dragenter_event_waiter("dragenter", right_frame()); 923 DOMDragEventWaiter dragenter_event_waiter("dragenter", right_frame());
924 state->left_frame_events_counter->Reset(); 924 state->left_frame_events_counter->Reset();
925 state->right_frame_events_counter->Reset(); 925 state->right_frame_events_counter->Reset();
926 ASSERT_TRUE(SimulateMouseMoveToRightFrame()); 926 ASSERT_TRUE(SimulateMouseMoveToRightFrame());
927 927
928 { // Verify dragleave DOM event. 928 { // Verify dragleave DOM event.
929 std::string dragleave_event; 929 std::string dragleave_event;
930 930
931 // TODO(paulmeyer): https://crbug.com/669695: Need to unify coordinates 931 state->expected_dom_event_data.set_expected_client_position("(355, 150)");
932 // passed to dragend when OOPIFs are present or not. 932 state->expected_dom_event_data.set_expected_page_position("(355, 150)");
933 state->expected_dom_event_data.set_expected_client_position(
934 "<no expectation>");
935 state->expected_dom_event_data.set_expected_page_position(
936 "<no expectation>");
937 933
938 EXPECT_TRUE( 934 EXPECT_TRUE(
939 dragleave_event_waiter.WaitForNextMatchingEvent(&dragleave_event)); 935 dragleave_event_waiter.WaitForNextMatchingEvent(&dragleave_event));
940 EXPECT_THAT(dragleave_event, state->expected_dom_event_data.Matches()); 936 EXPECT_THAT(dragleave_event, state->expected_dom_event_data.Matches());
941 } 937 }
942 938
943 { // Verify dragenter DOM event. 939 { // Verify dragenter DOM event.
944 std::string dragenter_event; 940 std::string dragenter_event;
945 941
946 // Update expected event coordinates after SimulateMouseMoveToRightFrame 942 // Update expected event coordinates after SimulateMouseMoveToRightFrame
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1012 EXPECT_THAT(drop_event, state->expected_dom_event_data.Matches()); 1008 EXPECT_THAT(drop_event, state->expected_dom_event_data.Matches());
1013 } 1009 }
1014 1010
1015 // Verify dragend DOM event. 1011 // Verify dragend DOM event.
1016 { 1012 {
1017 // TODO(lukasza): Figure out why the drop event sees different values of 1013 // TODO(lukasza): Figure out why the drop event sees different values of
1018 // DataTransfer.dropEffect and DataTransfer.types properties. 1014 // DataTransfer.dropEffect and DataTransfer.types properties.
1019 state->expected_dom_event_data.set_expected_drop_effect("copy"); 1015 state->expected_dom_event_data.set_expected_drop_effect("copy");
1020 state->expected_dom_event_data.set_expected_mime_types(""); 1016 state->expected_dom_event_data.set_expected_mime_types("");
1021 1017
1022 // TODO(paulmeyer): https://crbug.com/669695: Need to unify coordinates 1018 // TODO: https://crbug.com/686136: dragEnd coordinates for non-OOPIF
1023 // passed to dragend when OOPIFs are present or not. 1019 // scenarios are currently broken.
1024 state->expected_dom_event_data.set_expected_client_position( 1020 state->expected_dom_event_data.set_expected_client_position(
1025 "<no expectation>"); 1021 "<no expectation>");
1026 state->expected_dom_event_data.set_expected_page_position( 1022 state->expected_dom_event_data.set_expected_page_position(
1027 "<no expectation>"); 1023 "<no expectation>");
1028 1024
1029 std::string dragend_event; 1025 std::string dragend_event;
1030 EXPECT_TRUE( 1026 EXPECT_TRUE(
1031 state->dragend_event_waiter->WaitForNextMatchingEvent(&dragend_event)); 1027 state->dragend_event_waiter->WaitForNextMatchingEvent(&dragend_event));
1032 state->dragend_event_waiter.reset(); 1028 state->dragend_event_waiter.reset();
1033 EXPECT_THAT(dragend_event, state->expected_dom_event_data.Matches()); 1029 EXPECT_THAT(dragend_event, state->expected_dom_event_data.Matches());
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 // of a drag operation, and cross-site drags should be allowed across a 1158 // of a drag operation, and cross-site drags should be allowed across a
1163 // navigation. 1159 // navigation.
1164 1160
1165 INSTANTIATE_TEST_CASE_P( 1161 INSTANTIATE_TEST_CASE_P(
1166 SameSiteSubframe, DragAndDropBrowserTest, ::testing::Values(false)); 1162 SameSiteSubframe, DragAndDropBrowserTest, ::testing::Values(false));
1167 1163
1168 INSTANTIATE_TEST_CASE_P( 1164 INSTANTIATE_TEST_CASE_P(
1169 CrossSiteSubframe, DragAndDropBrowserTest, ::testing::Values(true)); 1165 CrossSiteSubframe, DragAndDropBrowserTest, ::testing::Values(true));
1170 1166
1171 } // namespace chrome 1167 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/event_sender.cc » ('j') | content/browser/web_contents/web_contents_view_aura.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698