本文整理汇总了C++中StringStream::error方法的典型用法代码示例。如果您正苦于以下问题:C++ StringStream::error方法的具体用法?C++ StringStream::error怎么用?C++ StringStream::error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringStream
的用法示例。
在下文中一共展示了StringStream::error方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scope
TEST_F(ReadableStreamTest, BackpressureOnEnqueueing)
{
ScriptState::Scope scope(scriptState());
ExceptionState exceptionState(ExceptionState::ConstructionContext, "property", "interface", scriptState()->context()->Global(), isolate());
auto strategy = MockStrategy::create();
Checkpoint checkpoint;
StringStream* stream = construct(strategy);
EXPECT_EQ(ReadableStream::Readable, stream->stateInternal());
{
InSequence s;
EXPECT_CALL(checkpoint, Call(0));
EXPECT_CALL(*strategy, size(String("hello"), stream)).WillOnce(Return(1));
EXPECT_CALL(*strategy, shouldApplyBackpressure(1, stream)).WillOnce(Return(false));
EXPECT_CALL(checkpoint, Call(1));
EXPECT_CALL(checkpoint, Call(2));
EXPECT_CALL(*strategy, size(String("world"), stream)).WillOnce(Return(2));
EXPECT_CALL(*strategy, shouldApplyBackpressure(3, stream)).WillOnce(Return(true));
EXPECT_CALL(checkpoint, Call(3));
}
checkpoint.Call(0);
bool result = stream->enqueue("hello");
checkpoint.Call(1);
EXPECT_TRUE(result);
checkpoint.Call(2);
result = stream->enqueue("world");
checkpoint.Call(3);
EXPECT_FALSE(result);
stream->error(DOMException::create(AbortError, "done"));
}