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

Side by Side Diff: third_party/WebKit/Source/core/page/ContextMenuControllerTest.cpp

Issue 2344693002: Support WebPointerProperties in MouseEvent (Closed)
Patch Set: fixed osx build Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "core/page/ContextMenuController.h" 5 #include "core/page/ContextMenuController.h"
6 6
7 #include "core/clipboard/DataTransfer.h" 7 #include "core/clipboard/DataTransfer.h"
8 #include "core/events/MouseEvent.h" 8 #include "core/events/MouseEvent.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 "<menuitem id=\"item10\" type=\"radio\" radiogroup=\"group\" label=\"Ite m10\"" 63 "<menuitem id=\"item10\" type=\"radio\" radiogroup=\"group\" label=\"Ite m10\""
64 "onclick='if (document.getElementById(\"item10\").hasAttribute(\"checked \"))" 64 "onclick='if (document.getElementById(\"item10\").hasAttribute(\"checked \"))"
65 "document.title = \"Title 10 checked\"; else if (document.getElementById (\"item8\").hasAttribute(\"checked\"))" 65 "document.title = \"Title 10 checked\"; else if (document.getElementById (\"item8\").hasAttribute(\"checked\"))"
66 "document.title = \"Title 10 not checked and Title 8 checked\";'>" 66 "document.title = \"Title 10 not checked and Title 8 checked\";'>"
67 "</menu>" 67 "</menu>"
68 "</button>"); 68 "</button>");
69 69
70 // Create right button click event and pass it to context menu controller. 70 // Create right button click event and pass it to context menu controller.
71 Event* event = MouseEvent::create(EventTypeNames::click, false, false, 71 Event* event = MouseEvent::create(EventTypeNames::click, false, false,
72 document().domWindow(), 50, 50, 0, 0, 0, 0, 0, PlatformEvent::NoModifier s, 1, 0, nullptr, 0, 72 document().domWindow(), 50, 50, 0, 0, 0, 0, 0, PlatformEvent::NoModifier s, 1, 0, nullptr, 0,
73 PlatformMouseEvent::RealOrIndistinguishable, String()); 73 PlatformMouseEvent::RealOrIndistinguishable, String(), nullptr);
74 document().getElementById("button_id")->focus(); 74 document().getElementById("button_id")->focus();
75 event->setTarget(document().getElementById("button_id")); 75 event->setTarget(document().getElementById("button_id"));
76 document().page()->contextMenuController().handleContextMenuEvent(event); 76 document().page()->contextMenuController().handleContextMenuEvent(event);
77 77
78 // Item 1 78 // Item 1
79 // Item 2 79 // Item 2
80 // Item 3 80 // Item 3
81 // Submenu > Item 4 81 // Submenu > Item 4
82 // Item 5 82 // Item 5
83 // Item 6 83 // Item 6
(...skipping 18 matching lines...) Expand all
102 EXPECT_STREQ("Title 7 checked", document().title().utf8().data()); 102 EXPECT_STREQ("Title 7 checked", document().title().utf8().data());
103 document().page()->contextMenuController().contextMenuItemSelected(&items[4] ); 103 document().page()->contextMenuController().contextMenuItemSelected(&items[4] );
104 EXPECT_STREQ("Title 7 not checked", document().title().utf8().data()); 104 EXPECT_STREQ("Title 7 not checked", document().title().utf8().data());
105 document().page()->contextMenuController().contextMenuItemSelected(&items[5] ); 105 document().page()->contextMenuController().contextMenuItemSelected(&items[5] );
106 EXPECT_STREQ("Title 8 not checked and Title 9 checked", document().title().u tf8().data()); 106 EXPECT_STREQ("Title 8 not checked and Title 9 checked", document().title().u tf8().data());
107 document().page()->contextMenuController().contextMenuItemSelected(&items[7] ); 107 document().page()->contextMenuController().contextMenuItemSelected(&items[7] );
108 EXPECT_STREQ("Title 10 not checked and Title 8 checked", document().title(). utf8().data()); 108 EXPECT_STREQ("Title 10 not checked and Title 8 checked", document().title(). utf8().data());
109 } 109 }
110 110
111 } // namespace blink 111 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/WheelEvent.cpp ('k') | third_party/WebKit/Source/platform/PlatformEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698