forked from apple/swift-nio-http2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multiplexer tests for payload-based stream channels (apple#225)
Motivation: As part of apple#214 we added a stream channel which deals with `HTTP2Frame.FramePayload` as well as the relevant entry points in `HTTP2StreamMultiplexer` to create these streams. We didn't add a corresponding set of tests. Modifications: - Duplicate `HTTP2StreamMultiplexerTests` - Refactor to make use of new stream creation function and new inbound stream initializer - Fix up a couple of bugs in `HTTP2StreamMultiplexer`: - activate pending streams on `channelActive` - deactivate pending streams on `channelInactive` - change stream writability for pending streams on `channelWritabilityChanged` - add implementation for `childChannelClosed(channelID:)` Result: - Tests for payload-based stream creation via `HTTP2StreamMultiplexer`
- Loading branch information
Showing
5 changed files
with
1,840 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
Tests/NIOHTTP2Tests/HTTP2FramePayloadStreamMultiplexerTests+XCTest.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the SwiftNIO open source project | ||
// | ||
// Copyright (c) 2017-2018 Apple Inc. and the SwiftNIO project authors | ||
// Licensed under Apache License v2.0 | ||
// | ||
// See LICENSE.txt for license information | ||
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// HTTP2FramePayloadStreamMultiplexerTests+XCTest.swift | ||
// | ||
import XCTest | ||
|
||
/// | ||
/// NOTE: This file was generated by generate_linux_tests.rb | ||
/// | ||
/// Do NOT edit this file directly as it will be regenerated automatically when needed. | ||
/// | ||
|
||
extension HTTP2FramePayloadStreamMultiplexerTests { | ||
|
||
@available(*, deprecated, message: "not actually deprecated. Just deprecated to allow deprecated tests (which test deprecated functionality) without warnings") | ||
static var allTests : [(String, (HTTP2FramePayloadStreamMultiplexerTests) -> () throws -> Void)] { | ||
return [ | ||
("testMultiplexerIgnoresFramesOnStream0", testMultiplexerIgnoresFramesOnStream0), | ||
("testHeadersFramesCreateNewChannels", testHeadersFramesCreateNewChannels), | ||
("testChannelsCloseThemselvesWhenToldTo", testChannelsCloseThemselvesWhenToldTo), | ||
("testChannelsCloseAfterResetStreamFrameFirstThenEvent", testChannelsCloseAfterResetStreamFrameFirstThenEvent), | ||
("testChannelsCloseAfterGoawayFrameFirstThenEvent", testChannelsCloseAfterGoawayFrameFirstThenEvent), | ||
("testFramesForUnknownStreamsAreReported", testFramesForUnknownStreamsAreReported), | ||
("testFramesForClosedStreamsAreReported", testFramesForClosedStreamsAreReported), | ||
("testClosingIdleChannels", testClosingIdleChannels), | ||
("testClosingActiveChannels", testClosingActiveChannels), | ||
("testClosePromiseIsSatisfiedWithTheEvent", testClosePromiseIsSatisfiedWithTheEvent), | ||
("testMultipleClosePromisesAreSatisfied", testMultipleClosePromisesAreSatisfied), | ||
("testClosePromiseFailsWithError", testClosePromiseFailsWithError), | ||
("testFramesAreNotDeliveredUntilStreamIsSetUp", testFramesAreNotDeliveredUntilStreamIsSetUp), | ||
("testFramesAreNotDeliveredIfSetUpFails", testFramesAreNotDeliveredIfSetUpFails), | ||
("testFlushingOneChannelDoesntFlushThemAll", testFlushingOneChannelDoesntFlushThemAll), | ||
("testUnflushedWritesFailOnClose", testUnflushedWritesFailOnClose), | ||
("testUnflushedWritesFailOnError", testUnflushedWritesFailOnError), | ||
("testWritesFailOnClosedStreamChannels", testWritesFailOnClosedStreamChannels), | ||
("testReadPullsInAllFrames", testReadPullsInAllFrames), | ||
("testReadIsPerChannel", testReadIsPerChannel), | ||
("testReadWillCauseAutomaticFrameDelivery", testReadWillCauseAutomaticFrameDelivery), | ||
("testReadWithNoPendingDataCausesReadOnParentChannel", testReadWithNoPendingDataCausesReadOnParentChannel), | ||
("testHandlersAreRemovedOnClosure", testHandlersAreRemovedOnClosure), | ||
("testHandlersAreRemovedOnClosureWithError", testHandlersAreRemovedOnClosureWithError), | ||
("testCreatingOutboundChannel", testCreatingOutboundChannel), | ||
("testCreatingOutboundChannelClient", testCreatingOutboundChannelClient), | ||
("testWritesOnCreatedChannelAreDelayed", testWritesOnCreatedChannelAreDelayed), | ||
("testWritesAreCancelledOnFailingInitializer", testWritesAreCancelledOnFailingInitializer), | ||
("testFailingInitializerDoesNotWrite", testFailingInitializerDoesNotWrite), | ||
("testCreatedChildChannelDoesNotActivateEarly", testCreatedChildChannelDoesNotActivateEarly), | ||
("testCreatedChildChannelActivatesIfParentIsActive", testCreatedChildChannelActivatesIfParentIsActive), | ||
("testInitiatedChildChannelActivates", testInitiatedChildChannelActivates), | ||
("testMultiplexerIgnoresPriorityFrames", testMultiplexerIgnoresPriorityFrames), | ||
("testMultiplexerForwardsActiveToParent", testMultiplexerForwardsActiveToParent), | ||
("testCreatedChildChannelCanBeClosedImmediately", testCreatedChildChannelCanBeClosedImmediately), | ||
("testCreatedChildChannelCanBeClosedBeforeWritingHeaders", testCreatedChildChannelCanBeClosedBeforeWritingHeaders), | ||
("testCreatedChildChannelCanBeClosedImmediatelyWhenBaseIsActive", testCreatedChildChannelCanBeClosedImmediatelyWhenBaseIsActive), | ||
("testCreatedChildChannelCanBeClosedBeforeWritingHeadersWhenBaseIsActive", testCreatedChildChannelCanBeClosedBeforeWritingHeadersWhenBaseIsActive), | ||
("testMultiplexerCoalescesFlushCallsDuringChannelRead", testMultiplexerCoalescesFlushCallsDuringChannelRead), | ||
("testMultiplexerDoesntFireReadCompleteForEachFrame", testMultiplexerDoesntFireReadCompleteForEachFrame), | ||
("testMultiplexerCorrectlyTellsAllStreamsAboutReadComplete", testMultiplexerCorrectlyTellsAllStreamsAboutReadComplete), | ||
("testMultiplexerModifiesStreamChannelWritabilityBasedOnFixedSizeTokens", testMultiplexerModifiesStreamChannelWritabilityBasedOnFixedSizeTokens), | ||
("testMultiplexerModifiesStreamChannelWritabilityBasedOnParentChannelWritability", testMultiplexerModifiesStreamChannelWritabilityBasedOnParentChannelWritability), | ||
("testMultiplexerModifiesStreamChannelWritabilityBasedOnFixedSizeTokensAndChannelWritability", testMultiplexerModifiesStreamChannelWritabilityBasedOnFixedSizeTokensAndChannelWritability), | ||
("testStreamChannelToleratesFailingInitializer", testStreamChannelToleratesFailingInitializer), | ||
("testInboundChannelWindowSizeIsCustomisable", testInboundChannelWindowSizeIsCustomisable), | ||
] | ||
} | ||
} | ||
|
Oops, something went wrong.