| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/html/HTMLIFrameElementAllow.h" | 5 #include "core/html/HTMLIFrameElementAllow.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/html/HTMLIFrameElement.h" | 8 #include "core/html/HTMLIFrameElement.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 11 |
| 12 using testing::UnorderedElementsAre; | 12 using ::testing::UnorderedElementsAre; |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 TEST(HTMLIFrameElementAllowTest, ParseAllowedFeatureNamesValid) { | 16 TEST(HTMLIFrameElementAllowTest, ParseAllowedFeatureNamesValid) { |
| 17 Document* document = Document::Create(); | 17 Document* document = Document::Create(); |
| 18 HTMLIFrameElement* iframe = HTMLIFrameElement::Create(*document); | 18 HTMLIFrameElement* iframe = HTMLIFrameElement::Create(*document); |
| 19 HTMLIFrameElementAllow* allow = | 19 HTMLIFrameElementAllow* allow = |
| 20 static_cast<HTMLIFrameElementAllow*>(iframe->allow()); | 20 static_cast<HTMLIFrameElementAllow*>(iframe->allow()); |
| 21 String error_message; | 21 String error_message; |
| 22 Vector<WebFeaturePolicyFeature> result; | 22 Vector<WebFeaturePolicyFeature> result; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 EXPECT_EQ("'invalid1', 'invalid2' are invalid feature names.", error_message); | 56 EXPECT_EQ("'invalid1', 'invalid2' are invalid feature names.", error_message); |
| 57 | 57 |
| 58 allow->setValue("fullscreen invalid payment fullscreen"); | 58 allow->setValue("fullscreen invalid payment fullscreen"); |
| 59 result = allow->ParseAllowedFeatureNames(error_message); | 59 result = allow->ParseAllowedFeatureNames(error_message); |
| 60 EXPECT_EQ("'invalid' is an invalid feature name.", error_message); | 60 EXPECT_EQ("'invalid' is an invalid feature name.", error_message); |
| 61 EXPECT_THAT(result, UnorderedElementsAre(WebFeaturePolicyFeature::kFullscreen, | 61 EXPECT_THAT(result, UnorderedElementsAre(WebFeaturePolicyFeature::kFullscreen, |
| 62 WebFeaturePolicyFeature::kPayment)); | 62 WebFeaturePolicyFeature::kPayment)); |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace blink | 65 } // namespace blink |
| OLD | NEW |