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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLFrameElementTest.cpp

Issue 2923563003: Move container policy logic to frame owner classes. (Closed)
Patch Set: Addressing nits Created 3 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/html/HTMLFrameElement.h"
6
7 #include "core/dom/Document.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace blink {
11
12 class HTMLFrameElementTest : public ::testing::Test {};
13
14 // Test that the correct container policy is constructed on a frame element.
15 // Frame elements do not have any container-policy related attributes, but the
16 // fullscreen feature should be unconditionally disabled.
17 TEST_F(HTMLFrameElementTest, DefaultContainerPolicy) {
18 Document* document = Document::Create();
19 KURL document_url = KURL(KURL(), "http://example.com");
20 document->SetURL(document_url);
21 document->UpdateSecurityOrigin(SecurityOrigin::Create(document_url));
22
23 HTMLFrameElement* frame_element = HTMLFrameElement::Create(*document);
24
25 frame_element->setAttribute(HTMLNames::srcAttr, "http://example.net/");
26 frame_element->UpdateContainerPolicyForTests();
27
28 const WebParsedFeaturePolicy& container_policy =
29 frame_element->ContainerPolicy();
30 EXPECT_EQ(1UL, container_policy.size());
31 // Fullscreen should be disabled in this frame
32 EXPECT_EQ(WebFeaturePolicyFeature::kFullscreen, container_policy[0].feature);
33 EXPECT_FALSE(container_policy[0].matches_all_origins);
34 EXPECT_EQ(0UL, container_policy[0].origins.size());
35 }
36
37 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698