diff options
author | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 09:25:45 +0000 |
---|---|---|
committer | toyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-31 09:25:45 +0000 |
commit | b6b90fed5146f71f39757249b00bfa3b9f40ac02 (patch) | |
tree | a4bb50304e9603399cb88def533deb9bed06658f /ppapi/tests | |
parent | 9d890b7e2e2eb291863f984e2ed3e50141d20cc8 (diff) | |
download | chromium_src-b6b90fed5146f71f39757249b00bfa3b9f40ac02.zip chromium_src-b6b90fed5146f71f39757249b00bfa3b9f40ac02.tar.gz chromium_src-b6b90fed5146f71f39757249b00bfa3b9f40ac02.tar.bz2 |
WebSocket Pepper API: allow to close connection without code and reason
- define PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED to close without status code
- omit reason for WebKit API explicitly when code is not specified
BUG=none
TEST=browser_tests --gtest_filter'PPAPI*WebSocket_*Close'
Review URL: https://chromiumcodereview.appspot.com/10332138
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/tests')
-rw-r--r-- | ppapi/tests/test_websocket.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ppapi/tests/test_websocket.cc b/ppapi/tests/test_websocket.cc index 3092655..d3b189a 100644 --- a/ppapi/tests/test_websocket.cc +++ b/ppapi/tests/test_websocket.cc @@ -553,6 +553,16 @@ std::string TestWebSocket::TestValidClose() { ASSERT_EQ(PP_OK, callback.result()); core_interface_->ReleaseResource(ws); + // Close without code and reason. + ws = Connect(GetFullURL(kEchoServerURL), &result, ""); + ASSERT_TRUE(ws); + ASSERT_EQ(PP_OK, result); + callback.WaitForResult(websocket_interface_->Close( + ws, PP_WEBSOCKETSTATUSCODE_NOT_SPECIFIED, reason, + callback.GetCallback().pp_completion_callback())); + ASSERT_EQ(PP_OK, callback.result()); + core_interface_->ReleaseResource(ws); + // Close with PP_VARTYPE_UNDEFINED. ws = Connect(GetFullURL(kEchoServerURL), &result, ""); ASSERT_TRUE(ws); |