chromium/third_party/blink/renderer/core/permissions_policy/document_policy_parser_test.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/permissions_policy/document_policy_parser.h"

#include <vector>

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/permissions_policy/document_policy.h"
#include "third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom-blink.h"

namespace blink {

constexpr const mojom::blink::DocumentPolicyFeature kDefault =;
constexpr const mojom::blink::DocumentPolicyFeature kBoolFeature =;
constexpr const mojom::blink::DocumentPolicyFeature kDoubleFeature =;

// This is the test version of |PolicyParserMessageBuffer::Message| as
// WTF::String cannot be statically allocated.
struct MessageForTest {};

struct ParseTestCase {};

class DocumentPolicyParserTest
    : public ::testing::TestWithParam<ParseTestCase> {};

const ParseTestCase DocumentPolicyParserTest::kCases[] =;

const std::pair<DocumentPolicyFeatureState, std::string>
    kPolicySerializationTestCases[] =;

const DocumentPolicyFeatureState kParsedPolicies[] =;

// Serialize and then Parse the result of serialization should cancel each
// other out, i.e. d == Parse(Serialize(d)).
// The other way s == Serialize(Parse(s)) is not always true because structured
// header allows some optional white spaces in its parsing targets and floating
// point numbers will be rounded, e.g. value=1 will be parsed to
// PolicyValue::CreateDecDouble(1.0) and get serialized to value=1.0.
TEST_F(DocumentPolicyParserTest, SerializeAndParse) {}

TEST_F(DocumentPolicyParserTest, SerializeResultShouldMatch) {}

INSTANTIATE_TEST_SUITE_P();

TEST_P(DocumentPolicyParserTest, ParseResultShouldMatch) {}

}  // namespace blink