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

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

Issue 2191443002: Ensure the permissions DOMTokenList is initialized before access (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Ensure the permissions DOMTokenList is initialized before access Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2f8bf21410218febad52c5e4113829067f496811..a79701c63b3805819eb4799e2bdffb34d17e961c 100644
--- a/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp
@@ -9,18 +9,24 @@
namespace blink {
+// Test setting via the Element attribute (HTML codepath).
TEST(HTMLIFrameElementTest, SetPermissionsAttribute)
{
Document* document = Document::create();
HTMLIFrameElement* iframe = HTMLIFrameElement::create(*document);
- // Test setting via the Element attribute (HTML codepath).
iframe->setAttribute(HTMLNames::permissionsAttr, "geolocation");
EXPECT_EQ("geolocation", iframe->permissions()->value());
iframe->setAttribute(HTMLNames::permissionsAttr, "geolocation notifications");
EXPECT_EQ("geolocation notifications", iframe->permissions()->value());
+}
+
+// Test setting via the DOMTokenList (JS codepath).
+TEST(HTMLIFrameElementTest, SetPermissionsAttributeJS)
+{
+ Document* document = Document::create();
+ HTMLIFrameElement* iframe = HTMLIFrameElement::create(*document);
- // Test setting via the DOMTokenList (JS codepath).
iframe->permissions()->setValue("midi");
EXPECT_EQ("midi", iframe->getAttribute(HTMLNames::permissionsAttr));
}
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLIFrameElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698