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

Unified Diff: Source/core/page/ContextMenuControllerTest.cpp

Issue 786753003: Implement type=radio and radiogroup attribute for menuitem. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebaselined Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLMenuItemElement.idl ('k') | Source/core/page/CustomContextMenuProvider.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/ContextMenuControllerTest.cpp
diff --git a/Source/core/page/ContextMenuControllerTest.cpp b/Source/core/page/ContextMenuControllerTest.cpp
index d941e0e19e7c037d50db088eff6916cce5ae7967..b4cfc2adce77464684bffba94ceda414d5e06f42 100644
--- a/Source/core/page/ContextMenuControllerTest.cpp
+++ b/Source/core/page/ContextMenuControllerTest.cpp
@@ -54,6 +54,17 @@ TEST_F(ContextMenuControllerTest, TestCustomMenu)
"<menuitem id=\"item7\" type=\"checkbox\" checked label=\"Item7\""
"onclick='if (document.getElementById(\"item7\").hasAttribute(\"checked\"))"
"document.title = \"Title 7 checked\"; else document.title = \"Title 7 not checked\";'>"
+ "<menuitem id=\"item8\" type=\"radio\" radiogroup=\"group\" label=\"Item8\""
+ "onclick='if (document.getElementById(\"item8\").hasAttribute(\"checked\"))"
+ "document.title = \"Title 8 checked\"; else if (document.getElementById(\"item9\").hasAttribute(\"checked\"))"
+ "document.title = \"Title 8 not checked and Title 9 checked\";'>"
+ "<menuitem id=\"item9\" type=\"radio\" radiogroup=\"group\" checked label=\"Item9\""
+ "onclick='if (document.getElementById(\"item9\").hasAttribute(\"checked\"))"
+ "document.title = \"Title 9 checked\"; else document.title = \"Title 9 not checked\";'>"
+ "<menuitem id=\"item10\" type=\"radio\" radiogroup=\"group\" label=\"Item10\""
+ "onclick='if (document.getElementById(\"item10\").hasAttribute(\"checked\"))"
+ "document.title = \"Title 10 checked\"; else if (document.getElementById(\"item8\").hasAttribute(\"checked\"))"
+ "document.title = \"Title 10 not checked and Title 8 checked\";'>"
"</menu>"
"</button>");
@@ -71,8 +82,11 @@ TEST_F(ContextMenuControllerTest, TestCustomMenu)
// Item 5
// Item 6
// *Item 7
+ // Item 8
+ // *Item 9
+ // Item 10
const Vector<ContextMenuItem>& items = document().page()->contextMenuController().contextMenu()->items();
- EXPECT_EQ(5u, items.size());
+ EXPECT_EQ(8u, items.size());
EXPECT_EQ(ActionType, items[0].type());
EXPECT_STREQ("Item1", items[0].title().utf8().data());
document().page()->contextMenuController().contextMenuItemSelected(&items[0]);
@@ -88,6 +102,10 @@ TEST_F(ContextMenuControllerTest, TestCustomMenu)
EXPECT_STREQ("Title 7 checked", document().title().utf8().data());
document().page()->contextMenuController().contextMenuItemSelected(&items[4]);
EXPECT_STREQ("Title 7 not checked", document().title().utf8().data());
+ document().page()->contextMenuController().contextMenuItemSelected(&items[5]);
+ EXPECT_STREQ("Title 8 not checked and Title 9 checked", document().title().utf8().data());
+ document().page()->contextMenuController().contextMenuItemSelected(&items[7]);
+ EXPECT_STREQ("Title 10 not checked and Title 8 checked", document().title().utf8().data());
}
}
« no previous file with comments | « Source/core/html/HTMLMenuItemElement.idl ('k') | Source/core/page/CustomContextMenuProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698