chromium/third_party/blink/renderer/core/css/parser/css_parser_token_stream_test.cc

// Copyright 2017 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/css/parser/css_parser_token_stream.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_save_point.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"

namespace blink {

namespace {

TEST(CSSParserTokenStreamTest, EmptyStream) {}

TEST(CSSParserTokenStreamTest, PeekThenConsume) {}

TEST(CSSParserTokenStreamTest, ConsumeThenPeek) {}

TEST(CSSParserTokenStreamTest, ConsumeMultipleTokens) {}

TEST(CSSParserTokenStreamTest, UncheckedPeekAndConsumeAfterPeek) {}

TEST(CSSParserTokenStreamTest, UncheckedPeekAndConsumeAfterAtEnd) {}

TEST(CSSParserTokenStreamTest, UncheckedConsumeComponentValue) {}

TEST(CSSParserTokenStreamTest, ConsumeWhitespace) {}

TEST(CSSParserTokenStreamTest, ConsumeIncludingWhitespace) {}

TEST(CSSParserTokenStreamTest, RangesDoNotGetInvalidatedWhenConsuming) {}

TEST(CSSParserTokenStreamTest, BlockErrorRecoveryConsumesRestOfBlock) {}

TEST(CSSParserTokenStreamTest, BlockErrorRecoveryOnSuccess) {}

TEST(CSSParserTokenStreamTest, BlockErrorRecoveryConsumeComponentValue) {}

TEST(CSSParserTokenStreamTest, OffsetAfterPeek) {}

TEST(CSSParserTokenStreamTest, OffsetAfterConsumes) {}

TEST(CSSParserTokenStreamTest, LookAheadOffset) {}

TEST(CSSParserTokenStreamTest, ConsumeUntilPeekedTypeOffset) {}

TEST(CSSParserTokenStreamTest, ConsumeUntilPeekedTypeOffsetEndOfFile) {}

TEST(CSSParserTokenStreamTest, ConsumeUntilPeekedTypeOffsetEndOfBlock) {}

TEST(CSSParserTokenStreamTest, ConsumeUntilPeekedTypeIsEmpty) {}

TEST(CSSParserTokenStreamTest, ConsumeComponentValueEOF) {}

TEST(CSSParserTokenStreamTest, ConsumeComponentValueToken) {}

TEST(CSSParserTokenStreamTest, ConsumeComponentValueWhitespace) {}

TEST(CSSParserTokenStreamTest, ConsumeComponentValueTrailingWhitespace) {}

TEST(CSSParserTokenStreamTest, ConsumeComponentValueBlock) {}

TEST(CSSParserTokenStreamTest, ConsumeComponentValueMultiBlock) {}

TEST(CSSParserTokenStreamTest, ConsumeComponentValueFunction) {}

TEST(CSSParserTokenStreamTest, Boundary) {}

TEST(CSSParserTokenStreamTest, MultipleBoundaries) {}

TEST(CSSParserTokenStreamTest, IneffectiveBoundary) {}

TEST(CSSParserTokenStreamTest, BoundaryBlockGuard) {}

TEST(CSSParserTokenStreamTest, BoundaryRestoringBlockGuard) {}

TEST(CSSParserTokenStreamTest, SavePointRestoreWithoutLookahead) {}

namespace {

Vector<CSSParserToken, 32> TokenizeAll(String string) {}

// See struct RestartData.
std::pair<wtf_size_t, wtf_size_t> ParseRestart(String restart) {}

// Consume all tokens in `stream`, and store them in `tokens`,
// restarting (once) at the token with offset `restart_offset`
// to the offset specified by `restart_target`.
void TokenizeInto(CSSParserTokenStream& stream,
                  wtf_size_t restart_target,
                  wtf_size_t restart_offset,
                  Vector<CSSParserToken, 32>& tokens) {}

}  // namespace

struct RestartData {};

RestartData restart_data[] =;

class RestartTest : public testing::Test,
                    public testing::WithParamInterface<RestartData> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(RestartTest, All) {}

// Same as RestartTest, except performs all restarts during a boundary.
class BoundaryRestartTest : public testing::Test,
                            public testing::WithParamInterface<RestartData> {};

INSTANTIATE_TEST_SUITE_P();

TEST_P(BoundaryRestartTest, All) {}

class NullRestartTest : public testing::Test,
                        public testing::WithParamInterface<RestartData> {};

INSTANTIATE_TEST_SUITE_P();

// Ignores RestartData.restart, and instead tests restarting to and from
// the same offset, i.e. "restarting" to the offset we're already on.
TEST_P(NullRestartTest, All) {}

class TestStream {};

// The following various Test* classes only exist to accept
// a TestStream instead of a CSSParserTokenStream.

class TestRestoringBlockGuard {};

class TestBlockGuard {};

class TestBoundary {};

class RestoringBlockGuardTest : public testing::Test {};

TEST_F(RestoringBlockGuardTest, Restore) {}

TEST_F(RestoringBlockGuardTest, NestedRestore) {}

TEST_F(RestoringBlockGuardTest, Release) {}

TEST_F(RestoringBlockGuardTest, ReleaseEOF) {}

TEST_F(RestoringBlockGuardTest, NestedRelease) {}

TEST_F(RestoringBlockGuardTest, ReleaseImmediate) {}

TEST_F(RestoringBlockGuardTest, BlockStack) {}

TEST_F(RestoringBlockGuardTest, RestoreDuringBoundary) {}

}  // namespace

}  // namespace blink