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

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

Issue 2814153002: Move feature policy vibrate tests to correct directory (Closed)
Patch Set: Update test expect Created 3 years, 8 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/HTMLIFrameElementAllow.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLIFrameElementAllow.cpp b/third_party/WebKit/Source/core/html/HTMLIFrameElementAllow.cpp
index 52cc909bea0c62481cec0dd2282935b82b828e5a..90b0a50ce6bd7ed7b68d91b78be4864d66827f4b 100644
--- a/third_party/WebKit/Source/core/html/HTMLIFrameElementAllow.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLIFrameElementAllow.cpp
@@ -32,15 +32,15 @@ HTMLIFrameElementAllow::ParseAllowedFeatureNames(
const SpaceSplitString& tokens = this->Tokens();
// Collects a list of valid feature names.
+ const FeatureNameMap& feature_name_map = GetDefaultFeatureNameMap();
for (size_t i = 0; i < tokens.size(); ++i) {
- WebFeaturePolicyFeature feature = GetWebFeaturePolicyFeature(tokens[i]);
- if (feature == WebFeaturePolicyFeature::kNotFound) {
+ if (!feature_name_map.Contains(tokens[i])) {
token_errors.Append(token_errors.IsEmpty() ? "'" : ", '");
token_errors.Append(tokens[i]);
token_errors.Append("'");
++num_token_errors;
} else {
- feature_names.push_back(feature);
+ feature_names.push_back(feature_name_map.at(tokens[i]));
}
}
@@ -60,8 +60,7 @@ HTMLIFrameElementAllow::ParseAllowedFeatureNames(
bool HTMLIFrameElementAllow::ValidateTokenValue(const AtomicString& token_value,
ExceptionState&) const {
- return GetWebFeaturePolicyFeature(token_value.GetString()) !=
- WebFeaturePolicyFeature::kNotFound;
+ return GetDefaultFeatureNameMap().Contains(token_value.GetString());
}
void HTMLIFrameElementAllow::ValueWasSet() {

Powered by Google App Engine
This is Rietveld 408576698