chromium/third_party/blink/renderer/modules/eventsource/event_source_parser_test.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "third_party/blink/renderer/modules/eventsource/event_source_parser.h"

#include <string.h>

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/modules/eventsource/event_source.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "third_party/blink/renderer/platform/wtf/text/character_names.h"

namespace blink {

namespace {

struct EventOrReconnectionTimeSetting {};

class Client : public GarbageCollected<Client>,
               public EventSourceParser::Client {};

class StoppingClient : public GarbageCollected<StoppingClient>,
                       public EventSourceParser::Client {};

class EventSourceParserTest : public testing::Test {};

TEST_F(EventSourceParserTest, EmptyMessageEventShouldNotBeDispatched) {}

TEST_F(EventSourceParserTest, DispatchSimpleMessageEvent) {}

TEST_F(EventSourceParserTest, ConstructWithLastEventId) {}

TEST_F(EventSourceParserTest, DispatchMessageEventWithLastEventId) {}

TEST_F(EventSourceParserTest, LastEventIdCanBeUpdatedEvenWhenDataIsEmpty) {}

TEST_F(EventSourceParserTest, DispatchMessageEventWithCustomEventType) {}

TEST_F(EventSourceParserTest, RetryTakesEffectEvenWhenNotDispatching) {}

TEST_F(EventSourceParserTest, EventTypeShouldBeReset) {}

TEST_F(EventSourceParserTest, DataShouldBeReset) {}

TEST_F(EventSourceParserTest, LastEventIdShouldNotBeReset) {}

TEST_F(EventSourceParserTest, VariousNewLinesShouldBeAllowed) {}

TEST_F(EventSourceParserTest, RetryWithEmptyValueShouldRestoreDefaultValue) {}

TEST_F(EventSourceParserTest, NonDigitRetryShouldBeIgnored) {}

TEST_F(EventSourceParserTest, UnrecognizedFieldShouldBeIgnored) {}

TEST_F(EventSourceParserTest, CommentShouldBeIgnored) {}

TEST_F(EventSourceParserTest, BOMShouldBeIgnored) {}

TEST_F(EventSourceParserTest, BOMShouldBeIgnored_OneByOne) {}

TEST_F(EventSourceParserTest, ColonlessLineShouldBeTreatedAsNameOnlyField) {}

TEST_F(EventSourceParserTest, AtMostOneLeadingSpaceCanBeSkipped) {}

TEST_F(EventSourceParserTest, DataShouldAccumulate) {}

TEST_F(EventSourceParserTest, EventShouldNotAccumulate) {}

TEST_F(EventSourceParserTest, FeedDataOneByOne) {}

TEST_F(EventSourceParserTest, InvalidUTF8Sequence) {}

TEST(EventSourceParserStoppingTest, StopWhileParsing) {}

TEST_F(EventSourceParserTest, IgnoreIdHavingNullCharacter) {}

}  // namespace

}  // namespace blink