| OLD | NEW |
| 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 { | 582 { |
| 583 DOMDragEventWaiter drop_waiter("drop", right_frame()); | 583 DOMDragEventWaiter drop_waiter("drop", right_frame()); |
| 584 ASSERT_TRUE(SimulateDropInRightFrame()); | 584 ASSERT_TRUE(SimulateDropInRightFrame()); |
| 585 | 585 |
| 586 std::string drop_event; | 586 std::string drop_event; |
| 587 ASSERT_TRUE(drop_waiter.WaitForNextMatchingEvent(&drop_event)); | 587 ASSERT_TRUE(drop_waiter.WaitForNextMatchingEvent(&drop_event)); |
| 588 EXPECT_THAT(drop_event, expected_dom_event_data.Matches()); | 588 EXPECT_THAT(drop_event, expected_dom_event_data.Matches()); |
| 589 } | 589 } |
| 590 } | 590 } |
| 591 | 591 |
| 592 // The test is disabled on Ozone because of trouble with mouse simulation | 592 IN_PROC_BROWSER_TEST_F(DragAndDropBrowserTest, DragStartInFrame) { |
| 593 // during the test - see https://crbug.com/665042. | |
| 594 #if defined(USE_OZONE) | |
| 595 #define MAYBE_DragStartInFrame DISABLED_DragStartInFrame | |
| 596 #else | |
| 597 #define MAYBE_DragStartInFrame DragStartInFrame | |
| 598 #endif | |
| 599 IN_PROC_BROWSER_TEST_F(DragAndDropBrowserTest, MAYBE_DragStartInFrame) { | |
| 600 std::string frame_site = "b.com"; | 593 std::string frame_site = "b.com"; |
| 601 ASSERT_TRUE(NavigateToTestPage("a.com")); | 594 ASSERT_TRUE(NavigateToTestPage("a.com")); |
| 602 ASSERT_TRUE(NavigateLeftFrame(frame_site, "image_source.html")); | 595 ASSERT_TRUE(NavigateLeftFrame(frame_site, "image_source.html")); |
| 603 | 596 |
| 604 // Setup test expectations. | 597 // Setup test expectations. |
| 605 // (dragstart event handler in image_source.html is asking for "copy" only). | 598 // (dragstart event handler in image_source.html is asking for "copy" only). |
| 606 DOMDragEventVerifier expected_dom_event_data; | 599 DOMDragEventVerifier expected_dom_event_data; |
| 607 expected_dom_event_data.set_expected_drop_effect("none"); | 600 expected_dom_event_data.set_expected_drop_effect("none"); |
| 608 expected_dom_event_data.set_expected_effect_allowed("copy"); | 601 expected_dom_event_data.set_expected_effect_allowed("copy"); |
| 609 expected_dom_event_data.set_expected_mime_types( | 602 expected_dom_event_data.set_expected_mime_types( |
| (...skipping 30 matching lines...) Expand all Loading... |
| 640 EXPECT_EQ(expected_location_of_drag_start_in_left_frame(), | 633 EXPECT_EQ(expected_location_of_drag_start_in_left_frame(), |
| 641 location_inside_web_contents); | 634 location_inside_web_contents); |
| 642 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, operation); | 635 EXPECT_EQ(ui::DragDropTypes::DRAG_COPY, operation); |
| 643 } | 636 } |
| 644 | 637 |
| 645 // Try to leave everything in a clean state. | 638 // Try to leave everything in a clean state. |
| 646 SimulateMouseUp(); | 639 SimulateMouseUp(); |
| 647 } | 640 } |
| 648 | 641 |
| 649 } // namespace chrome | 642 } // namespace chrome |
| OLD | NEW |