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

Unified Diff: Source/modules/websockets/DOMWebSocketTest.cpp

Issue 871013007: Use enum BinaryType for WebSocket.binaryType, instead of DOMString (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « Source/modules/websockets/DOMWebSocket.cpp ('k') | Source/modules/websockets/WebSocket.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/DOMWebSocketTest.cpp
diff --git a/Source/modules/websockets/DOMWebSocketTest.cpp b/Source/modules/websockets/DOMWebSocketTest.cpp
index e21e5a823cd8b34ab90b2f0b4b415790664b1af0..75ac744c470b18ed8156770722a06d6f6ed3fccd 100644
--- a/Source/modules/websockets/DOMWebSocketTest.cpp
+++ b/Source/modules/websockets/DOMWebSocketTest.cpp
@@ -666,23 +666,28 @@ TEST_F(DOMWebSocketTest, binaryType)
{
EXPECT_EQ("blob", m_websocket->binaryType());
- m_websocket->setBinaryType("hoge");
-
- EXPECT_EQ("blob", m_websocket->binaryType());
-
m_websocket->setBinaryType("arraybuffer");
EXPECT_EQ("arraybuffer", m_websocket->binaryType());
- m_websocket->setBinaryType("fuga");
-
- EXPECT_EQ("arraybuffer", m_websocket->binaryType());
-
m_websocket->setBinaryType("blob");
EXPECT_EQ("blob", m_websocket->binaryType());
}
+class DOMWebSocketDeathTest : public DOMWebSocketTestBase, public ::testing::Test {
+public:
+};
+
+TEST_F(DOMWebSocketDeathTest, binaryType)
+{
+ m_websocket->setBinaryType("arraybuffer");
+
+ EXPECT_EQ("arraybuffer", m_websocket->binaryType());
+ EXPECT_DEATH(m_websocket->setBinaryType("hoge"), "");
+ EXPECT_EQ("arraybuffer", m_websocket->binaryType());
+}
+
// FIXME: We should add tests for suspend / resume.
class DOMWebSocketValidClosingTest : public DOMWebSocketTestBase, public ::testing::TestWithParam<unsigned short> {
« no previous file with comments | « Source/modules/websockets/DOMWebSocket.cpp ('k') | Source/modules/websockets/WebSocket.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698