| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 #include "net/dns/mock_host_resolver.h" | 59 #include "net/dns/mock_host_resolver.h" |
| 60 #include "net/test/embedded_test_server/embedded_test_server.h" | 60 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 61 #include "testing/gtest/include/gtest/gtest.h" | 61 #include "testing/gtest/include/gtest/gtest.h" |
| 62 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" | 62 #include "third_party/WebKit/public/platform/WebInsecureRequestPolicy.h" |
| 63 #include "third_party/WebKit/public/web/WebInputEvent.h" | 63 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 64 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 64 #include "third_party/WebKit/public/web/WebSandboxFlags.h" |
| 65 #include "ui/display/display_switches.h" | 65 #include "ui/display/display_switches.h" |
| 66 #include "ui/display/screen.h" | 66 #include "ui/display/screen.h" |
| 67 #include "ui/events/event.h" | 67 #include "ui/events/event.h" |
| 68 #include "ui/events/event_utils.h" | 68 #include "ui/events/event_utils.h" |
| 69 #include "ui/events/latency_info.h" |
| 69 #include "ui/gfx/geometry/point.h" | 70 #include "ui/gfx/geometry/point.h" |
| 70 | 71 |
| 71 #if defined(USE_AURA) | 72 #if defined(USE_AURA) |
| 72 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 73 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 73 #endif | 74 #endif |
| 74 | 75 |
| 75 #if defined(OS_MACOSX) | 76 #if defined(OS_MACOSX) |
| 76 #include "ui/base/test/scoped_preferred_scroller_style_mac.h" | 77 #include "ui/base/test/scoped_preferred_scroller_style_mac.h" |
| 77 #endif | 78 #endif |
| 78 | 79 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 251 |
| 251 // Target input event to child frame. | 252 // Target input event to child frame. |
| 252 blink::WebMouseEvent child_event; | 253 blink::WebMouseEvent child_event; |
| 253 child_event.type = blink::WebInputEvent::MouseDown; | 254 child_event.type = blink::WebInputEvent::MouseDown; |
| 254 child_event.button = blink::WebPointerProperties::Button::Left; | 255 child_event.button = blink::WebPointerProperties::Button::Left; |
| 255 child_event.x = 75; | 256 child_event.x = 75; |
| 256 child_event.y = 75; | 257 child_event.y = 75; |
| 257 child_event.clickCount = 1; | 258 child_event.clickCount = 1; |
| 258 main_frame_monitor.ResetEventReceived(); | 259 main_frame_monitor.ResetEventReceived(); |
| 259 child_frame_monitor.ResetEventReceived(); | 260 child_frame_monitor.ResetEventReceived(); |
| 260 router->RouteMouseEvent(root_view, &child_event); | 261 router->RouteMouseEvent(root_view, &child_event, ui::LatencyInfo()); |
| 261 | 262 |
| 262 EXPECT_TRUE(child_frame_monitor.EventWasReceived()); | 263 EXPECT_TRUE(child_frame_monitor.EventWasReceived()); |
| 263 EXPECT_EQ(23, child_frame_monitor.event().x); | 264 EXPECT_EQ(23, child_frame_monitor.event().x); |
| 264 EXPECT_EQ(23, child_frame_monitor.event().y); | 265 EXPECT_EQ(23, child_frame_monitor.event().y); |
| 265 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); | 266 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); |
| 266 | 267 |
| 267 child_frame_monitor.ResetEventReceived(); | 268 child_frame_monitor.ResetEventReceived(); |
| 268 main_frame_monitor.ResetEventReceived(); | 269 main_frame_monitor.ResetEventReceived(); |
| 269 | 270 |
| 270 // Target input event to main frame. | 271 // Target input event to main frame. |
| 271 blink::WebMouseEvent main_event; | 272 blink::WebMouseEvent main_event; |
| 272 main_event.type = blink::WebInputEvent::MouseDown; | 273 main_event.type = blink::WebInputEvent::MouseDown; |
| 273 main_event.button = blink::WebPointerProperties::Button::Left; | 274 main_event.button = blink::WebPointerProperties::Button::Left; |
| 274 main_event.x = 1; | 275 main_event.x = 1; |
| 275 main_event.y = 1; | 276 main_event.y = 1; |
| 276 main_event.clickCount = 1; | 277 main_event.clickCount = 1; |
| 277 // Ladies and gentlemen, THIS is the main_event! | 278 // Ladies and gentlemen, THIS is the main_event! |
| 278 router->RouteMouseEvent(root_view, &main_event); | 279 router->RouteMouseEvent(root_view, &main_event, ui::LatencyInfo()); |
| 279 | 280 |
| 280 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); | 281 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); |
| 281 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); | 282 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); |
| 282 EXPECT_EQ(1, main_frame_monitor.event().x); | 283 EXPECT_EQ(1, main_frame_monitor.event().x); |
| 283 EXPECT_EQ(1, main_frame_monitor.event().y); | 284 EXPECT_EQ(1, main_frame_monitor.event().y); |
| 284 } | 285 } |
| 285 | 286 |
| 286 class RedirectNotificationObserver : public NotificationObserver { | 287 class RedirectNotificationObserver : public NotificationObserver { |
| 287 public: | 288 public: |
| 288 // Register to listen for notifications of the given type from either a | 289 // Register to listen for notifications of the given type from either a |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 | 1238 |
| 1238 // Target input event to nested frame. | 1239 // Target input event to nested frame. |
| 1239 blink::WebMouseEvent nested_event; | 1240 blink::WebMouseEvent nested_event; |
| 1240 nested_event.type = blink::WebInputEvent::MouseDown; | 1241 nested_event.type = blink::WebInputEvent::MouseDown; |
| 1241 nested_event.button = blink::WebPointerProperties::Button::Left; | 1242 nested_event.button = blink::WebPointerProperties::Button::Left; |
| 1242 nested_event.x = 125; | 1243 nested_event.x = 125; |
| 1243 nested_event.y = 125; | 1244 nested_event.y = 125; |
| 1244 nested_event.clickCount = 1; | 1245 nested_event.clickCount = 1; |
| 1245 nested_frame_monitor.ResetEventReceived(); | 1246 nested_frame_monitor.ResetEventReceived(); |
| 1246 main_frame_monitor.ResetEventReceived(); | 1247 main_frame_monitor.ResetEventReceived(); |
| 1247 router->RouteMouseEvent(root_view, &nested_event); | 1248 router->RouteMouseEvent(root_view, &nested_event, ui::LatencyInfo()); |
| 1248 | 1249 |
| 1249 EXPECT_TRUE(nested_frame_monitor.EventWasReceived()); | 1250 EXPECT_TRUE(nested_frame_monitor.EventWasReceived()); |
| 1250 EXPECT_EQ(21, nested_frame_monitor.event().x); | 1251 EXPECT_EQ(21, nested_frame_monitor.event().x); |
| 1251 EXPECT_EQ(21, nested_frame_monitor.event().y); | 1252 EXPECT_EQ(21, nested_frame_monitor.event().y); |
| 1252 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); | 1253 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); |
| 1253 } | 1254 } |
| 1254 | 1255 |
| 1255 // This test tests that browser process hittesting ignores frames with | 1256 // This test tests that browser process hittesting ignores frames with |
| 1256 // pointer-events: none. | 1257 // pointer-events: none. |
| 1257 #if defined(OS_ANDROID) | 1258 #if defined(OS_ANDROID) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 | 1303 |
| 1303 // Target input event to child frame. | 1304 // Target input event to child frame. |
| 1304 blink::WebMouseEvent child_event; | 1305 blink::WebMouseEvent child_event; |
| 1305 child_event.type = blink::WebInputEvent::MouseDown; | 1306 child_event.type = blink::WebInputEvent::MouseDown; |
| 1306 child_event.button = blink::WebPointerProperties::Button::Left; | 1307 child_event.button = blink::WebPointerProperties::Button::Left; |
| 1307 child_event.x = 75; | 1308 child_event.x = 75; |
| 1308 child_event.y = 75; | 1309 child_event.y = 75; |
| 1309 child_event.clickCount = 1; | 1310 child_event.clickCount = 1; |
| 1310 main_frame_monitor.ResetEventReceived(); | 1311 main_frame_monitor.ResetEventReceived(); |
| 1311 child_frame_monitor.ResetEventReceived(); | 1312 child_frame_monitor.ResetEventReceived(); |
| 1312 router->RouteMouseEvent(root_view, &child_event); | 1313 router->RouteMouseEvent(root_view, &child_event, ui::LatencyInfo()); |
| 1313 | 1314 |
| 1314 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); | 1315 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); |
| 1315 EXPECT_EQ(75, main_frame_monitor.event().x); | 1316 EXPECT_EQ(75, main_frame_monitor.event().x); |
| 1316 EXPECT_EQ(75, main_frame_monitor.event().y); | 1317 EXPECT_EQ(75, main_frame_monitor.event().y); |
| 1317 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); | 1318 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); |
| 1318 } | 1319 } |
| 1319 | 1320 |
| 1320 // This test verifies that MouseEnter and MouseLeave events fire correctly | 1321 // This test verifies that MouseEnter and MouseLeave events fire correctly |
| 1321 // when the mouse cursor moves between processes. | 1322 // when the mouse cursor moves between processes. |
| 1322 #if defined(OS_ANDROID) | 1323 #if defined(OS_ANDROID) |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 gfx::Point point_in_b_frame(313, 147); | 1388 gfx::Point point_in_b_frame(313, 147); |
| 1388 gfx::Point point_in_d_frame(471, 207); | 1389 gfx::Point point_in_d_frame(471, 207); |
| 1389 | 1390 |
| 1390 blink::WebMouseEvent mouse_event; | 1391 blink::WebMouseEvent mouse_event; |
| 1391 mouse_event.type = blink::WebInputEvent::MouseMove; | 1392 mouse_event.type = blink::WebInputEvent::MouseMove; |
| 1392 mouse_event.x = point_in_a_frame.x(); | 1393 mouse_event.x = point_in_a_frame.x(); |
| 1393 mouse_event.y = point_in_a_frame.y(); | 1394 mouse_event.y = point_in_a_frame.y(); |
| 1394 | 1395 |
| 1395 // Send an initial MouseMove to the root view, which shouldn't affect the | 1396 // Send an initial MouseMove to the root view, which shouldn't affect the |
| 1396 // other renderers. | 1397 // other renderers. |
| 1397 web_contents()->GetInputEventRouter()->RouteMouseEvent(rwhv_a, &mouse_event); | 1398 web_contents()->GetInputEventRouter()->RouteMouseEvent(rwhv_a, &mouse_event, |
| 1399 ui::LatencyInfo()); |
| 1398 EXPECT_TRUE(a_frame_monitor.EventWasReceived()); | 1400 EXPECT_TRUE(a_frame_monitor.EventWasReceived()); |
| 1399 a_frame_monitor.ResetEventReceived(); | 1401 a_frame_monitor.ResetEventReceived(); |
| 1400 EXPECT_FALSE(b_frame_monitor.EventWasReceived()); | 1402 EXPECT_FALSE(b_frame_monitor.EventWasReceived()); |
| 1401 EXPECT_FALSE(c_frame_monitor.EventWasReceived()); | 1403 EXPECT_FALSE(c_frame_monitor.EventWasReceived()); |
| 1402 EXPECT_FALSE(d_frame_monitor.EventWasReceived()); | 1404 EXPECT_FALSE(d_frame_monitor.EventWasReceived()); |
| 1403 | 1405 |
| 1404 // Next send a MouseMove to B frame, which shouldn't affect C or D but | 1406 // Next send a MouseMove to B frame, which shouldn't affect C or D but |
| 1405 // A should receive a MouseMove event. | 1407 // A should receive a MouseMove event. |
| 1406 mouse_event.x = point_in_b_frame.x(); | 1408 mouse_event.x = point_in_b_frame.x(); |
| 1407 mouse_event.y = point_in_b_frame.y(); | 1409 mouse_event.y = point_in_b_frame.y(); |
| 1408 web_contents()->GetInputEventRouter()->RouteMouseEvent(rwhv_a, &mouse_event); | 1410 web_contents()->GetInputEventRouter()->RouteMouseEvent(rwhv_a, &mouse_event, |
| 1411 ui::LatencyInfo()); |
| 1409 EXPECT_TRUE(a_frame_monitor.EventWasReceived()); | 1412 EXPECT_TRUE(a_frame_monitor.EventWasReceived()); |
| 1410 EXPECT_EQ(a_frame_monitor.event().type, blink::WebInputEvent::MouseMove); | 1413 EXPECT_EQ(a_frame_monitor.event().type, blink::WebInputEvent::MouseMove); |
| 1411 a_frame_monitor.ResetEventReceived(); | 1414 a_frame_monitor.ResetEventReceived(); |
| 1412 EXPECT_TRUE(b_frame_monitor.EventWasReceived()); | 1415 EXPECT_TRUE(b_frame_monitor.EventWasReceived()); |
| 1413 b_frame_monitor.ResetEventReceived(); | 1416 b_frame_monitor.ResetEventReceived(); |
| 1414 EXPECT_FALSE(c_frame_monitor.EventWasReceived()); | 1417 EXPECT_FALSE(c_frame_monitor.EventWasReceived()); |
| 1415 EXPECT_FALSE(d_frame_monitor.EventWasReceived()); | 1418 EXPECT_FALSE(d_frame_monitor.EventWasReceived()); |
| 1416 | 1419 |
| 1417 // Next send a MouseMove to D frame, which should have side effects in every | 1420 // Next send a MouseMove to D frame, which should have side effects in every |
| 1418 // other RenderWidgetHostView. | 1421 // other RenderWidgetHostView. |
| 1419 mouse_event.x = point_in_d_frame.x(); | 1422 mouse_event.x = point_in_d_frame.x(); |
| 1420 mouse_event.y = point_in_d_frame.y(); | 1423 mouse_event.y = point_in_d_frame.y(); |
| 1421 web_contents()->GetInputEventRouter()->RouteMouseEvent(rwhv_a, &mouse_event); | 1424 web_contents()->GetInputEventRouter()->RouteMouseEvent(rwhv_a, &mouse_event, |
| 1425 ui::LatencyInfo()); |
| 1422 EXPECT_TRUE(a_frame_monitor.EventWasReceived()); | 1426 EXPECT_TRUE(a_frame_monitor.EventWasReceived()); |
| 1423 EXPECT_EQ(a_frame_monitor.event().type, blink::WebInputEvent::MouseMove); | 1427 EXPECT_EQ(a_frame_monitor.event().type, blink::WebInputEvent::MouseMove); |
| 1424 EXPECT_TRUE(b_frame_monitor.EventWasReceived()); | 1428 EXPECT_TRUE(b_frame_monitor.EventWasReceived()); |
| 1425 EXPECT_EQ(b_frame_monitor.event().type, blink::WebInputEvent::MouseLeave); | 1429 EXPECT_EQ(b_frame_monitor.event().type, blink::WebInputEvent::MouseLeave); |
| 1426 EXPECT_TRUE(c_frame_monitor.EventWasReceived()); | 1430 EXPECT_TRUE(c_frame_monitor.EventWasReceived()); |
| 1427 EXPECT_EQ(c_frame_monitor.event().type, blink::WebInputEvent::MouseMove); | 1431 EXPECT_EQ(c_frame_monitor.event().type, blink::WebInputEvent::MouseMove); |
| 1428 EXPECT_TRUE(d_frame_monitor.EventWasReceived()); | 1432 EXPECT_TRUE(d_frame_monitor.EventWasReceived()); |
| 1429 } | 1433 } |
| 1430 | 1434 |
| 1431 // Verify that mouse capture works on a RenderWidgetHostView level, so that | 1435 // Verify that mouse capture works on a RenderWidgetHostView level, so that |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 | 1478 |
| 1475 // Target MouseDown to child frame. | 1479 // Target MouseDown to child frame. |
| 1476 blink::WebMouseEvent mouse_event; | 1480 blink::WebMouseEvent mouse_event; |
| 1477 mouse_event.type = blink::WebInputEvent::MouseDown; | 1481 mouse_event.type = blink::WebInputEvent::MouseDown; |
| 1478 mouse_event.button = blink::WebPointerProperties::Button::Left; | 1482 mouse_event.button = blink::WebPointerProperties::Button::Left; |
| 1479 mouse_event.x = 75; | 1483 mouse_event.x = 75; |
| 1480 mouse_event.y = 75; | 1484 mouse_event.y = 75; |
| 1481 mouse_event.clickCount = 1; | 1485 mouse_event.clickCount = 1; |
| 1482 main_frame_monitor.ResetEventReceived(); | 1486 main_frame_monitor.ResetEventReceived(); |
| 1483 child_frame_monitor.ResetEventReceived(); | 1487 child_frame_monitor.ResetEventReceived(); |
| 1484 router->RouteMouseEvent(root_view, &mouse_event); | 1488 router->RouteMouseEvent(root_view, &mouse_event, ui::LatencyInfo()); |
| 1485 | 1489 |
| 1486 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); | 1490 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); |
| 1487 EXPECT_TRUE(child_frame_monitor.EventWasReceived()); | 1491 EXPECT_TRUE(child_frame_monitor.EventWasReceived()); |
| 1488 | 1492 |
| 1489 // Target MouseMove to main frame. This should still be routed to the | 1493 // Target MouseMove to main frame. This should still be routed to the |
| 1490 // child frame because it is now capturing mouse input. | 1494 // child frame because it is now capturing mouse input. |
| 1491 mouse_event.type = blink::WebInputEvent::MouseMove; | 1495 mouse_event.type = blink::WebInputEvent::MouseMove; |
| 1492 mouse_event.modifiers = blink::WebInputEvent::LeftButtonDown; | 1496 mouse_event.modifiers = blink::WebInputEvent::LeftButtonDown; |
| 1493 mouse_event.x = 1; | 1497 mouse_event.x = 1; |
| 1494 mouse_event.y = 1; | 1498 mouse_event.y = 1; |
| 1495 // Note that this event is sent twice, with the monitors cleared after | 1499 // Note that this event is sent twice, with the monitors cleared after |
| 1496 // the first time, because the first MouseMove to the child frame | 1500 // the first time, because the first MouseMove to the child frame |
| 1497 // causes a MouseMove to be sent to the main frame also, which we | 1501 // causes a MouseMove to be sent to the main frame also, which we |
| 1498 // need to ignore. | 1502 // need to ignore. |
| 1499 router->RouteMouseEvent(root_view, &mouse_event); | 1503 router->RouteMouseEvent(root_view, &mouse_event, ui::LatencyInfo()); |
| 1500 main_frame_monitor.ResetEventReceived(); | 1504 main_frame_monitor.ResetEventReceived(); |
| 1501 child_frame_monitor.ResetEventReceived(); | 1505 child_frame_monitor.ResetEventReceived(); |
| 1502 mouse_event.x = 1; | 1506 mouse_event.x = 1; |
| 1503 mouse_event.y = 2; | 1507 mouse_event.y = 2; |
| 1504 router->RouteMouseEvent(root_view, &mouse_event); | 1508 router->RouteMouseEvent(root_view, &mouse_event, ui::LatencyInfo()); |
| 1505 | 1509 |
| 1506 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); | 1510 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); |
| 1507 EXPECT_TRUE(child_frame_monitor.EventWasReceived()); | 1511 EXPECT_TRUE(child_frame_monitor.EventWasReceived()); |
| 1508 | 1512 |
| 1509 // A MouseUp to the child frame should cancel the mouse capture. | 1513 // A MouseUp to the child frame should cancel the mouse capture. |
| 1510 mouse_event.type = blink::WebInputEvent::MouseUp; | 1514 mouse_event.type = blink::WebInputEvent::MouseUp; |
| 1511 mouse_event.modifiers = 0; | 1515 mouse_event.modifiers = 0; |
| 1512 mouse_event.x = 75; | 1516 mouse_event.x = 75; |
| 1513 mouse_event.y = 75; | 1517 mouse_event.y = 75; |
| 1514 main_frame_monitor.ResetEventReceived(); | 1518 main_frame_monitor.ResetEventReceived(); |
| 1515 child_frame_monitor.ResetEventReceived(); | 1519 child_frame_monitor.ResetEventReceived(); |
| 1516 router->RouteMouseEvent(root_view, &mouse_event); | 1520 router->RouteMouseEvent(root_view, &mouse_event, ui::LatencyInfo()); |
| 1517 | 1521 |
| 1518 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); | 1522 EXPECT_FALSE(main_frame_monitor.EventWasReceived()); |
| 1519 EXPECT_TRUE(child_frame_monitor.EventWasReceived()); | 1523 EXPECT_TRUE(child_frame_monitor.EventWasReceived()); |
| 1520 | 1524 |
| 1521 // Subsequent MouseMove events targeted to the main frame should be routed | 1525 // Subsequent MouseMove events targeted to the main frame should be routed |
| 1522 // to that frame. | 1526 // to that frame. |
| 1523 mouse_event.type = blink::WebInputEvent::MouseMove; | 1527 mouse_event.type = blink::WebInputEvent::MouseMove; |
| 1524 mouse_event.x = 1; | 1528 mouse_event.x = 1; |
| 1525 mouse_event.y = 3; | 1529 mouse_event.y = 3; |
| 1526 // Sending the MouseMove twice for the same reason as above. | 1530 // Sending the MouseMove twice for the same reason as above. |
| 1527 router->RouteMouseEvent(root_view, &mouse_event); | 1531 router->RouteMouseEvent(root_view, &mouse_event, ui::LatencyInfo()); |
| 1528 main_frame_monitor.ResetEventReceived(); | 1532 main_frame_monitor.ResetEventReceived(); |
| 1529 child_frame_monitor.ResetEventReceived(); | 1533 child_frame_monitor.ResetEventReceived(); |
| 1530 mouse_event.x = 1; | 1534 mouse_event.x = 1; |
| 1531 mouse_event.y = 4; | 1535 mouse_event.y = 4; |
| 1532 router->RouteMouseEvent(root_view, &mouse_event); | 1536 router->RouteMouseEvent(root_view, &mouse_event, ui::LatencyInfo()); |
| 1533 | 1537 |
| 1534 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); | 1538 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); |
| 1535 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); | 1539 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); |
| 1536 | 1540 |
| 1537 // Target MouseDown to the main frame to cause it to capture input. | 1541 // Target MouseDown to the main frame to cause it to capture input. |
| 1538 mouse_event.type = blink::WebInputEvent::MouseDown; | 1542 mouse_event.type = blink::WebInputEvent::MouseDown; |
| 1539 mouse_event.x = 1; | 1543 mouse_event.x = 1; |
| 1540 mouse_event.y = 1; | 1544 mouse_event.y = 1; |
| 1541 main_frame_monitor.ResetEventReceived(); | 1545 main_frame_monitor.ResetEventReceived(); |
| 1542 child_frame_monitor.ResetEventReceived(); | 1546 child_frame_monitor.ResetEventReceived(); |
| 1543 router->RouteMouseEvent(root_view, &mouse_event); | 1547 router->RouteMouseEvent(root_view, &mouse_event, ui::LatencyInfo()); |
| 1544 | 1548 |
| 1545 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); | 1549 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); |
| 1546 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); | 1550 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); |
| 1547 | 1551 |
| 1548 // Sending a MouseMove to the child frame should still result in the main | 1552 // Sending a MouseMove to the child frame should still result in the main |
| 1549 // frame receiving the event. | 1553 // frame receiving the event. |
| 1550 mouse_event.type = blink::WebInputEvent::MouseMove; | 1554 mouse_event.type = blink::WebInputEvent::MouseMove; |
| 1551 mouse_event.modifiers = blink::WebInputEvent::LeftButtonDown; | 1555 mouse_event.modifiers = blink::WebInputEvent::LeftButtonDown; |
| 1552 mouse_event.x = 75; | 1556 mouse_event.x = 75; |
| 1553 mouse_event.y = 75; | 1557 mouse_event.y = 75; |
| 1554 main_frame_monitor.ResetEventReceived(); | 1558 main_frame_monitor.ResetEventReceived(); |
| 1555 child_frame_monitor.ResetEventReceived(); | 1559 child_frame_monitor.ResetEventReceived(); |
| 1556 router->RouteMouseEvent(root_view, &mouse_event); | 1560 router->RouteMouseEvent(root_view, &mouse_event, ui::LatencyInfo()); |
| 1557 | 1561 |
| 1558 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); | 1562 EXPECT_TRUE(main_frame_monitor.EventWasReceived()); |
| 1559 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); | 1563 EXPECT_FALSE(child_frame_monitor.EventWasReceived()); |
| 1560 } | 1564 } |
| 1561 | 1565 |
| 1562 // Tests OOPIF rendering by checking that the RWH of the iframe generates | 1566 // Tests OOPIF rendering by checking that the RWH of the iframe generates |
| 1563 // OnSwapCompositorFrame message. | 1567 // OnSwapCompositorFrame message. |
| 1564 #if defined(OS_ANDROID) | 1568 #if defined(OS_ANDROID) |
| 1565 // http://crbug.com/471850 | 1569 // http://crbug.com/471850 |
| 1566 #define MAYBE_CompositorFrameSwapped DISABLED_CompositorFrameSwapped | 1570 #define MAYBE_CompositorFrameSwapped DISABLED_CompositorFrameSwapped |
| (...skipping 3605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5172 // Send a MouseMove to the subframe. The frame contains text, and moving the | 5176 // Send a MouseMove to the subframe. The frame contains text, and moving the |
| 5173 // mouse over it should cause the renderer to send a mouse cursor update. | 5177 // mouse over it should cause the renderer to send a mouse cursor update. |
| 5174 blink::WebMouseEvent mouse_event; | 5178 blink::WebMouseEvent mouse_event; |
| 5175 mouse_event.type = blink::WebInputEvent::MouseMove; | 5179 mouse_event.type = blink::WebInputEvent::MouseMove; |
| 5176 mouse_event.x = 60; | 5180 mouse_event.x = 60; |
| 5177 mouse_event.y = 60; | 5181 mouse_event.y = 60; |
| 5178 RenderWidgetHost* rwh_child = | 5182 RenderWidgetHost* rwh_child = |
| 5179 root->child_at(0)->current_frame_host()->GetRenderWidgetHost(); | 5183 root->child_at(0)->current_frame_host()->GetRenderWidgetHost(); |
| 5180 RenderWidgetHostViewBase* root_view = static_cast<RenderWidgetHostViewBase*>( | 5184 RenderWidgetHostViewBase* root_view = static_cast<RenderWidgetHostViewBase*>( |
| 5181 root->current_frame_host()->GetRenderWidgetHost()->GetView()); | 5185 root->current_frame_host()->GetRenderWidgetHost()->GetView()); |
| 5182 web_contents()->GetInputEventRouter()->RouteMouseEvent(root_view, | 5186 web_contents()->GetInputEventRouter()->RouteMouseEvent( |
| 5183 &mouse_event); | 5187 root_view, &mouse_event, ui::LatencyInfo()); |
| 5184 | 5188 |
| 5185 // CursorMessageFilter::Wait() implicitly tests whether we receive a | 5189 // CursorMessageFilter::Wait() implicitly tests whether we receive a |
| 5186 // ViewHostMsg_SetCursor message from the renderer process, because it does | 5190 // ViewHostMsg_SetCursor message from the renderer process, because it does |
| 5187 // does not return otherwise. | 5191 // does not return otherwise. |
| 5188 filter->Wait(); | 5192 filter->Wait(); |
| 5189 EXPECT_EQ(filter->last_set_cursor_routing_id(), rwh_child->GetRoutingID()); | 5193 EXPECT_EQ(filter->last_set_cursor_routing_id(), rwh_child->GetRoutingID()); |
| 5190 } | 5194 } |
| 5191 #endif | 5195 #endif |
| 5192 | 5196 |
| 5193 // Tests that we are using the correct RenderFrameProxy when navigating an | 5197 // Tests that we are using the correct RenderFrameProxy when navigating an |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5698 | 5702 |
| 5699 gfx::Point point(75, 75); | 5703 gfx::Point point(75, 75); |
| 5700 | 5704 |
| 5701 // Target right-click event to child frame. | 5705 // Target right-click event to child frame. |
| 5702 blink::WebMouseEvent click_event; | 5706 blink::WebMouseEvent click_event; |
| 5703 click_event.type = blink::WebInputEvent::MouseDown; | 5707 click_event.type = blink::WebInputEvent::MouseDown; |
| 5704 click_event.button = blink::WebPointerProperties::Button::Right; | 5708 click_event.button = blink::WebPointerProperties::Button::Right; |
| 5705 click_event.x = point.x(); | 5709 click_event.x = point.x(); |
| 5706 click_event.y = point.y(); | 5710 click_event.y = point.y(); |
| 5707 click_event.clickCount = 1; | 5711 click_event.clickCount = 1; |
| 5708 router->RouteMouseEvent(root_view, &click_event); | 5712 router->RouteMouseEvent(root_view, &click_event, ui::LatencyInfo()); |
| 5709 | 5713 |
| 5710 // We also need a MouseUp event, needed by Windows. | 5714 // We also need a MouseUp event, needed by Windows. |
| 5711 click_event.type = blink::WebInputEvent::MouseUp; | 5715 click_event.type = blink::WebInputEvent::MouseUp; |
| 5712 click_event.x = point.x(); | 5716 click_event.x = point.x(); |
| 5713 click_event.y = point.y(); | 5717 click_event.y = point.y(); |
| 5714 router->RouteMouseEvent(root_view, &click_event); | 5718 router->RouteMouseEvent(root_view, &click_event, ui::LatencyInfo()); |
| 5715 | 5719 |
| 5716 context_menu_delegate.Wait(); | 5720 context_menu_delegate.Wait(); |
| 5717 | 5721 |
| 5718 ContextMenuParams params = context_menu_delegate.getParams(); | 5722 ContextMenuParams params = context_menu_delegate.getParams(); |
| 5719 | 5723 |
| 5720 EXPECT_EQ(point.x(), params.x); | 5724 EXPECT_EQ(point.x(), params.x); |
| 5721 EXPECT_EQ(point.y(), params.y); | 5725 EXPECT_EQ(point.y(), params.y); |
| 5722 } | 5726 } |
| 5723 | 5727 |
| 5724 // Test that a mouse right-click to an out-of-process iframe causes a context | 5728 // Test that a mouse right-click to an out-of-process iframe causes a context |
| (...skipping 2574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8299 " Site A ------------ proxies for B C\n" | 8303 " Site A ------------ proxies for B C\n" |
| 8300 " +--Site B ------- proxies for A C\n" | 8304 " +--Site B ------- proxies for A C\n" |
| 8301 " +--Site C -- proxies for A B\n" | 8305 " +--Site C -- proxies for A B\n" |
| 8302 "Where A = http://a.com/\n" | 8306 "Where A = http://a.com/\n" |
| 8303 " B = http://b.com/\n" | 8307 " B = http://b.com/\n" |
| 8304 " C = http://c.com/", | 8308 " C = http://c.com/", |
| 8305 DepictFrameTree(root)); | 8309 DepictFrameTree(root)); |
| 8306 } | 8310 } |
| 8307 | 8311 |
| 8308 } // namespace content | 8312 } // namespace content |
| OLD | NEW |