Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Unified Diff: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
index 1a5fafe7881be3052b5c992d7adcae1b6aecd958..f2448f01a894c4e807e0fd4aaaac77c0fbeeabf9 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannelTest.cpp
@@ -127,8 +127,9 @@ class DocumentWebSocketChannelTest : public ::testing::Test {
{
InSequence s;
EXPECT_CALL(*handle(), initialize(_));
- EXPECT_CALL(*handle(), connect(KURL(KURL(), "ws://localhost/"), _, _, _,
- _, handleClient()));
+ EXPECT_CALL(
+ *handle(),
+ connect(KURL(KURL(), "ws://localhost/"), _, _, _, _, handleClient()));
EXPECT_CALL(*handle(), flowControl(65536));
EXPECT_CALL(*channelClient(), didConnect(String("a"), String("b")));
}
@@ -208,12 +209,15 @@ TEST_F(DocumentWebSocketChannelTest, sendText) {
connect();
{
InSequence s;
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeText,
- MemEq("foo", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeText,
- MemEq("bar", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeText,
- MemEq("baz", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeText, MemEq("foo", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeText, MemEq("bar", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeText, MemEq("baz", 3), 3));
}
handleClient()->didReceiveFlowControl(handle(), 16);
@@ -231,21 +235,27 @@ TEST_F(DocumentWebSocketChannelTest, sendTextContinuation) {
Checkpoint checkpoint;
{
InSequence s;
- EXPECT_CALL(*handle(), send(false, WebSocketHandle::MessageTypeText,
- MemEq("0123456789abcdef", 16), 16));
+ EXPECT_CALL(*handle(),
+ send(false, WebSocketHandle::MessageTypeText,
+ MemEq("0123456789abcdef", 16), 16));
EXPECT_CALL(checkpoint, Call(1));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeContinuation,
- MemEq("g", 1), 1));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeText,
- MemEq("hijk", 4), 4));
- EXPECT_CALL(*handle(), send(false, WebSocketHandle::MessageTypeText,
- MemEq("lmnopqrstuv", 11), 11));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeContinuation, MemEq("g", 1), 1));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeText, MemEq("hijk", 4), 4));
+ EXPECT_CALL(*handle(),
+ send(false, WebSocketHandle::MessageTypeText,
+ MemEq("lmnopqrstuv", 11), 11));
EXPECT_CALL(checkpoint, Call(2));
- EXPECT_CALL(*handle(), send(false, WebSocketHandle::MessageTypeContinuation,
- MemEq("wxyzABCDEFGHIJKL", 16), 16));
+ EXPECT_CALL(*handle(),
+ send(false, WebSocketHandle::MessageTypeContinuation,
+ MemEq("wxyzABCDEFGHIJKL", 16), 16));
EXPECT_CALL(checkpoint, Call(3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeContinuation,
- MemEq("MNOPQRSTUVWXYZ", 14), 14));
+ EXPECT_CALL(*handle(),
+ send(true, WebSocketHandle::MessageTypeContinuation,
+ MemEq("MNOPQRSTUVWXYZ", 14), 14));
}
handleClient()->didReceiveFlowControl(handle(), 16);
@@ -268,8 +278,9 @@ TEST_F(DocumentWebSocketChannelTest, sendBinaryInVector) {
connect();
{
InSequence s;
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("foo", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("foo", 3), 3));
}
handleClient()->didReceiveFlowControl(handle(), 16);
@@ -286,14 +297,18 @@ TEST_F(DocumentWebSocketChannelTest, sendBinaryInVectorWithNullBytes) {
connect();
{
InSequence s;
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("\0ar", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("b\0z", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("qu\0", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("\0\0\0", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("\0ar", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("b\0z", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("qu\0", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("\0\0\0", 3), 3));
}
handleClient()->didReceiveFlowControl(handle(), 16);
@@ -325,8 +340,9 @@ TEST_F(DocumentWebSocketChannelTest, sendBinaryInVectorWithNullBytes) {
TEST_F(DocumentWebSocketChannelTest, sendBinaryInVectorNonLatin1UTF8) {
connect();
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("\xe7\x8b\x90", 3), 3));
+ EXPECT_CALL(*handle(),
+ send(true, WebSocketHandle::MessageTypeBinary,
+ MemEq("\xe7\x8b\x90", 3), 3));
handleClient()->didReceiveFlowControl(handle(), 16);
EXPECT_CALL(*channelClient(), didConsumeBufferedAmount(_)).Times(AnyNumber());
@@ -340,8 +356,9 @@ TEST_F(DocumentWebSocketChannelTest, sendBinaryInVectorNonLatin1UTF8) {
TEST_F(DocumentWebSocketChannelTest, sendBinaryInVectorNonUTF8) {
connect();
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("\x80\xff\xe7", 3), 3));
+ EXPECT_CALL(*handle(),
+ send(true, WebSocketHandle::MessageTypeBinary,
+ MemEq("\x80\xff\xe7", 3), 3));
handleClient()->didReceiveFlowControl(handle(), 16);
EXPECT_CALL(*channelClient(), didConsumeBufferedAmount(_)).Times(AnyNumber());
@@ -359,14 +376,16 @@ TEST_F(DocumentWebSocketChannelTest,
Checkpoint checkpoint;
{
InSequence s;
- EXPECT_CALL(*handle(), send(false, WebSocketHandle::MessageTypeBinary,
- MemEq("\xe7\x8b\x90\xe7\x8b\x90\xe7\x8b\x90\xe7"
- "\x8b\x90\xe7\x8b\x90\xe7",
- 16),
- 16));
+ EXPECT_CALL(*handle(),
+ send(false, WebSocketHandle::MessageTypeBinary,
+ MemEq("\xe7\x8b\x90\xe7\x8b\x90\xe7\x8b\x90\xe7"
+ "\x8b\x90\xe7\x8b\x90\xe7",
+ 16),
+ 16));
EXPECT_CALL(checkpoint, Call(1));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeContinuation,
- MemEq("\x8b\x90", 2), 2));
+ EXPECT_CALL(*handle(),
+ send(true, WebSocketHandle::MessageTypeContinuation,
+ MemEq("\x8b\x90", 2), 2));
}
handleClient()->didReceiveFlowControl(handle(), 16);
@@ -389,8 +408,9 @@ TEST_F(DocumentWebSocketChannelTest, sendBinaryInArrayBuffer) {
connect();
{
InSequence s;
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("foo", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("foo", 3), 3));
}
handleClient()->didReceiveFlowControl(handle(), 16);
@@ -406,14 +426,18 @@ TEST_F(DocumentWebSocketChannelTest, sendBinaryInArrayBufferPartial) {
connect();
{
InSequence s;
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("foo", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("bar", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("baz", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("a", 1), 1));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("foo", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("bar", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("baz", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("a", 1), 1));
}
handleClient()->didReceiveFlowControl(handle(), 16);
@@ -433,14 +457,18 @@ TEST_F(DocumentWebSocketChannelTest, sendBinaryInArrayBufferWithNullBytes) {
connect();
{
InSequence s;
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("\0ar", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("b\0z", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("qu\0", 3), 3));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("\0\0\0", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("\0ar", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("b\0z", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("qu\0", 3), 3));
+ EXPECT_CALL(
+ *handle(),
+ send(true, WebSocketHandle::MessageTypeBinary, MemEq("\0\0\0", 3), 3));
}
handleClient()->didReceiveFlowControl(handle(), 16);
@@ -468,8 +496,9 @@ TEST_F(DocumentWebSocketChannelTest, sendBinaryInArrayBufferWithNullBytes) {
TEST_F(DocumentWebSocketChannelTest, sendBinaryInArrayBufferNonLatin1UTF8) {
connect();
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("\xe7\x8b\x90", 3), 3));
+ EXPECT_CALL(*handle(),
+ send(true, WebSocketHandle::MessageTypeBinary,
+ MemEq("\xe7\x8b\x90", 3), 3));
handleClient()->didReceiveFlowControl(handle(), 16);
EXPECT_CALL(*channelClient(), didConsumeBufferedAmount(_)).Times(AnyNumber());
@@ -482,8 +511,9 @@ TEST_F(DocumentWebSocketChannelTest, sendBinaryInArrayBufferNonLatin1UTF8) {
TEST_F(DocumentWebSocketChannelTest, sendBinaryInArrayBufferNonUTF8) {
connect();
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeBinary,
- MemEq("\x80\xff\xe7", 3), 3));
+ EXPECT_CALL(*handle(),
+ send(true, WebSocketHandle::MessageTypeBinary,
+ MemEq("\x80\xff\xe7", 3), 3));
handleClient()->didReceiveFlowControl(handle(), 16);
EXPECT_CALL(*channelClient(), didConsumeBufferedAmount(_)).Times(AnyNumber());
@@ -500,14 +530,16 @@ TEST_F(DocumentWebSocketChannelTest,
Checkpoint checkpoint;
{
InSequence s;
- EXPECT_CALL(*handle(), send(false, WebSocketHandle::MessageTypeBinary,
- MemEq("\xe7\x8b\x90\xe7\x8b\x90\xe7\x8b\x90\xe7"
- "\x8b\x90\xe7\x8b\x90\xe7",
- 16),
- 16));
+ EXPECT_CALL(*handle(),
+ send(false, WebSocketHandle::MessageTypeBinary,
+ MemEq("\xe7\x8b\x90\xe7\x8b\x90\xe7\x8b\x90\xe7"
+ "\x8b\x90\xe7\x8b\x90\xe7",
+ 16),
+ 16));
EXPECT_CALL(checkpoint, Call(1));
- EXPECT_CALL(*handle(), send(true, WebSocketHandle::MessageTypeContinuation,
- MemEq("\x8b\x90", 2), 2));
+ EXPECT_CALL(*handle(),
+ send(true, WebSocketHandle::MessageTypeContinuation,
+ MemEq("\x8b\x90", 2), 2));
}
handleClient()->didReceiveFlowControl(handle(), 16);
@@ -684,8 +716,9 @@ TEST_F(DocumentWebSocketChannelTest, closeFromBrowser) {
EXPECT_CALL(*channelClient(), didStartClosingHandshake());
EXPECT_CALL(checkpoint, Call(1));
- EXPECT_CALL(*handle(), close(WebSocketChannel::CloseEventCodeNormalClosure,
- String("close reason")));
+ EXPECT_CALL(*handle(),
+ close(WebSocketChannel::CloseEventCodeNormalClosure,
+ String("close reason")));
EXPECT_CALL(checkpoint, Call(2));
EXPECT_CALL(*channelClient(),
@@ -716,8 +749,9 @@ TEST_F(DocumentWebSocketChannelTest, closeFromWebSocket) {
{
InSequence s;
- EXPECT_CALL(*handle(), close(WebSocketChannel::CloseEventCodeNormalClosure,
- String("close reason")));
+ EXPECT_CALL(*handle(),
+ close(WebSocketChannel::CloseEventCodeNormalClosure,
+ String("close reason")));
EXPECT_CALL(checkpoint, Call(1));
EXPECT_CALL(*channelClient(),

Powered by Google App Engine
This is Rietveld 408576698