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

Unified Diff: net/websockets/websocket_channel_test.cc

Issue 66013003: Remove the word "factory" from WebSocketChannel (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comment fixes by tyoshino. Created 7 years, 1 month 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
« no previous file with comments | « net/websockets/websocket_channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_channel_test.cc
diff --git a/net/websockets/websocket_channel_test.cc b/net/websockets/websocket_channel_test.cc
index 083d99bc177eccca7b602fff7f7585b1269b6222..a279f4f77282b55dce16757467e15a0866060f18 100644
--- a/net/websockets/websocket_channel_test.cc
+++ b/net/websockets/websocket_channel_test.cc
@@ -649,8 +649,8 @@ class MockWebSocketStream : public WebSocketStream {
MOCK_METHOD0(AsWebSocketStream, WebSocketStream*());
};
-struct ArgumentCopyingWebSocketStreamFactory {
- scoped_ptr<WebSocketStreamRequest> Factory(
+struct ArgumentCopyingWebSocketStreamCreator {
+ scoped_ptr<WebSocketStreamRequest> Create(
const GURL& socket_url,
const std::vector<std::string>& requested_subprotocols,
const GURL& origin,
@@ -695,15 +695,15 @@ class WebSocketChannelTest : public ::testing::Test {
connect_data_.socket_url,
connect_data_.requested_subprotocols,
connect_data_.origin,
- base::Bind(&ArgumentCopyingWebSocketStreamFactory::Factory,
- base::Unretained(&connect_data_.factory)));
+ base::Bind(&ArgumentCopyingWebSocketStreamCreator::Create,
+ base::Unretained(&connect_data_.creator)));
}
// Same as CreateChannelAndConnect(), but calls the on_success callback as
// well. This method is virtual so that subclasses can also set the stream.
virtual void CreateChannelAndConnectSuccessfully() {
CreateChannelAndConnect();
- connect_data_.factory.connect_delegate->OnSuccess(stream_.Pass());
+ connect_data_.creator.connect_delegate->OnSuccess(stream_.Pass());
}
// Returns a WebSocketEventInterface to be passed to the WebSocketChannel.
@@ -737,8 +737,8 @@ class WebSocketChannelTest : public ::testing::Test {
// Origin of the request
GURL origin;
- // A fake WebSocketStreamFactory that just records its arguments.
- ArgumentCopyingWebSocketStreamFactory factory;
+ // A fake WebSocketStreamCreator that just records its arguments.
+ ArgumentCopyingWebSocketStreamCreator creator;
};
ConnectData connect_data_;
@@ -875,16 +875,16 @@ class WebSocketChannelStreamTest : public WebSocketChannelTest {
scoped_ptr<MockWebSocketStream> mock_stream_;
};
-// Simple test that everything that should be passed to the factory function is
-// passed to the factory function.
-TEST_F(WebSocketChannelTest, EverythingIsPassedToTheFactoryFunction) {
+// Simple test that everything that should be passed to the creator function is
+// passed to the creator function.
+TEST_F(WebSocketChannelTest, EverythingIsPassedToTheCreatorFunction) {
connect_data_.socket_url = GURL("ws://example.com/test");
connect_data_.origin = GURL("http://example.com/test");
connect_data_.requested_subprotocols.push_back("Sinbad");
CreateChannelAndConnect();
- const ArgumentCopyingWebSocketStreamFactory& actual = connect_data_.factory;
+ const ArgumentCopyingWebSocketStreamCreator& actual = connect_data_.creator;
EXPECT_EQ(&connect_data_.url_request_context, actual.url_request_context);
@@ -902,7 +902,7 @@ TEST_F(WebSocketChannelTest, EverythingIsPassedToTheFactoryFunction) {
TEST_F(WebSocketChannelDeletingTest, OnAddChannelResponseFail) {
CreateChannelAndConnect();
EXPECT_TRUE(channel_);
- connect_data_.factory.connect_delegate->OnFailure(
+ connect_data_.creator.connect_delegate->OnFailure(
kWebSocketErrorNoStatusReceived);
EXPECT_EQ(NULL, channel_.get());
}
@@ -1098,7 +1098,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, ConnectSuccessReported) {
CreateChannelAndConnect();
- connect_data_.factory.connect_delegate->OnSuccess(stream_.Pass());
+ connect_data_.creator.connect_delegate->OnSuccess(stream_.Pass());
}
TEST_F(WebSocketChannelEventInterfaceTest, ConnectFailureReported) {
@@ -1107,7 +1107,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, ConnectFailureReported) {
CreateChannelAndConnect();
- connect_data_.factory.connect_delegate->OnFailure(
+ connect_data_.creator.connect_delegate->OnFailure(
kWebSocketErrorNoStatusReceived);
}
@@ -1117,7 +1117,7 @@ TEST_F(WebSocketChannelEventInterfaceTest, ProtocolPassed) {
CreateChannelAndConnect();
- connect_data_.factory.connect_delegate->OnSuccess(
+ connect_data_.creator.connect_delegate->OnSuccess(
scoped_ptr<WebSocketStream>(new FakeWebSocketStream("Bob", "")));
}
@@ -2131,7 +2131,7 @@ class WebSocketChannelStreamTimeoutTest : public WebSocketChannelStreamTest {
CreateChannelAndConnect();
channel_->SetClosingHandshakeTimeoutForTesting(
TimeDelta::FromMilliseconds(kVeryTinyTimeoutMillis));
- connect_data_.factory.connect_delegate->OnSuccess(stream_.Pass());
+ connect_data_.creator.connect_delegate->OnSuccess(stream_.Pass());
}
};
« no previous file with comments | « net/websockets/websocket_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698