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

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

Issue 2011763006: Add an iframe permissions= attribute for implementing permission delegation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@permission-delegation-1-flag
Patch Set: Blink-side Created 4 years, 6 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
new file mode 100644
index 0000000000000000000000000000000000000000..2f8bf21410218febad52c5e4113829067f496811
--- /dev/null
+++ b/third_party/WebKit/Source/core/html/HTMLIFrameElementTest.cpp
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/html/HTMLIFrameElement.h"
+
+#include "core/dom/Document.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace blink {
+
+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).
+ iframe->permissions()->setValue("midi");
+ EXPECT_EQ("midi", iframe->getAttribute(HTMLNames::permissionsAttr));
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698