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

Unified Diff: third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp

Issue 2680083002: Initial Implementation of Iframe Attribute for Feature Policy (Part 1) (Closed)
Patch Set: Codereview: nit Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp
index 2651ecb15fc222ea76df288f677cf198de81671c..765ef853669fc0ba9c16f815ff4761dfcf631bec 100644
--- a/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp
@@ -9,7 +9,7 @@
namespace blink {
-// Test setting via the Element attribute (HTML codepath).
+// Test setting permission via the Element attribute (HTML codepath).
TEST(HTMLIFrameElementTest, SetPermissionsAttribute) {
Document* document = Document::create();
HTMLIFrameElement* iframe = HTMLIFrameElement::create(*document);
@@ -20,7 +20,7 @@ TEST(HTMLIFrameElementTest, SetPermissionsAttribute) {
EXPECT_EQ("geolocation notifications", iframe->permissions()->value());
}
-// Test setting via the DOMTokenList (JS codepath).
+// Test setting permission via the DOMTokenList (JS codepath).
TEST(HTMLIFrameElementTest, SetPermissionsAttributeJS) {
Document* document = Document::create();
HTMLIFrameElement* iframe = HTMLIFrameElement::create(*document);
@@ -29,4 +29,24 @@ TEST(HTMLIFrameElementTest, SetPermissionsAttributeJS) {
EXPECT_EQ("midi", iframe->getAttribute(HTMLNames::permissionsAttr));
}
+// Test setting feature policy via the Element attribute (HTML codepath).
+TEST(HTMLIFrameElementTest, SetAllowAttribute) {
+ Document* document = Document::create();
+ HTMLIFrameElement* iframe = HTMLIFrameElement::create(*document);
+
+ iframe->setAttribute(HTMLNames::allowAttr, "fullscreen");
+ EXPECT_EQ("fullscreen", iframe->allow()->value());
+ iframe->setAttribute(HTMLNames::allowAttr, "fullscreen vibrate");
+ EXPECT_EQ("fullscreen vibrate", iframe->allow()->value());
+}
+
+// Test setting feature policy via the DOMTokenList (JS codepath).
+TEST(HTMLIFrameElementTest, SetAllowAttributeJS) {
+ Document* document = Document::create();
+ HTMLIFrameElement* iframe = HTMLIFrameElement::create(*document);
+
+ iframe->allow()->setValue("fullscreen");
+ EXPECT_EQ("fullscreen", iframe->getAttribute(HTMLNames::allowAttr));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698