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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <tuple> | 7 #include <tuple> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1402 | 1402 |
1403 TEST_F(RenderViewImplTest, ContextMenu) { | 1403 TEST_F(RenderViewImplTest, ContextMenu) { |
1404 LoadHTML("<div>Page A</div>"); | 1404 LoadHTML("<div>Page A</div>"); |
1405 | 1405 |
1406 // Create a right click in the center of the iframe. (I'm hoping this will | 1406 // Create a right click in the center of the iframe. (I'm hoping this will |
1407 // make this a bit more robust in case of some other formatting or other bug.) | 1407 // make this a bit more robust in case of some other formatting or other bug.) |
1408 WebMouseEvent mouse_event(WebInputEvent::MouseDown, | 1408 WebMouseEvent mouse_event(WebInputEvent::MouseDown, |
1409 WebInputEvent::NoModifiers, | 1409 WebInputEvent::NoModifiers, |
1410 ui::EventTimeStampToSeconds(ui::EventTimeForNow())); | 1410 ui::EventTimeStampToSeconds(ui::EventTimeForNow())); |
1411 mouse_event.button = WebMouseEvent::Button::Right; | 1411 mouse_event.button = WebMouseEvent::Button::Right; |
1412 mouse_event.x = 250; | 1412 mouse_event.setPositionInWidget(250, 250); |
1413 mouse_event.y = 250; | 1413 mouse_event.setPositionInScreen(250, 250); |
1414 mouse_event.globalX = 250; | |
1415 mouse_event.globalY = 250; | |
1416 | 1414 |
1417 SendWebMouseEvent(mouse_event); | 1415 SendWebMouseEvent(mouse_event); |
1418 | 1416 |
1419 // Now simulate the corresponding up event which should display the menu | 1417 // Now simulate the corresponding up event which should display the menu |
1420 mouse_event.setType(WebInputEvent::MouseUp); | 1418 mouse_event.setType(WebInputEvent::MouseUp); |
1421 SendWebMouseEvent(mouse_event); | 1419 SendWebMouseEvent(mouse_event); |
1422 | 1420 |
1423 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( | 1421 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( |
1424 FrameHostMsg_ContextMenu::ID)); | 1422 FrameHostMsg_ContextMenu::ID)); |
1425 } | 1423 } |
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2593 ExpectPauseAndResume(3); | 2591 ExpectPauseAndResume(3); |
2594 blink::WebScriptSource source2( | 2592 blink::WebScriptSource source2( |
2595 WebString::fromUTF8("function func2() { func1(); }; func2();")); | 2593 WebString::fromUTF8("function func2() { func1(); }; func2();")); |
2596 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1); | 2594 frame()->GetWebFrame()->executeScriptInIsolatedWorld(17, &source2, 1); |
2597 | 2595 |
2598 EXPECT_FALSE(IsPaused()); | 2596 EXPECT_FALSE(IsPaused()); |
2599 Detach(); | 2597 Detach(); |
2600 } | 2598 } |
2601 | 2599 |
2602 } // namespace content | 2600 } // namespace content |
OLD | NEW |