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

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

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/DOMWebSocketTest.cpp
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp
index ceb472591a0ce686892641c6bc0031291cb75d9b..b344c42b21b12208c9799b5bb102db13174dde46 100644
--- a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp
+++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp
@@ -598,16 +598,16 @@
TEST_F(DOMWebSocketTest, sendArrayBufferWhenConnecting)
{
- DOMArrayBufferView* view = DOMUint8Array::create(8);
- {
- InSequence s;
- EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
- }
- m_websocket->connect("ws://example.com/", Vector<String>(), m_exceptionState);
-
- EXPECT_FALSE(m_exceptionState.hadException());
-
- m_websocket->send(view->buffer(), m_exceptionState);
+ RefPtr<DOMArrayBufferView> view = DOMUint8Array::create(8);
+ {
+ InSequence s;
+ EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
+ }
+ m_websocket->connect("ws://example.com/", Vector<String>(), m_exceptionState);
+
+ EXPECT_FALSE(m_exceptionState.hadException());
+
+ m_websocket->send(view->buffer().get(), m_exceptionState);
EXPECT_TRUE(m_exceptionState.hadException());
EXPECT_EQ(InvalidStateError, m_exceptionState.code());
@@ -617,7 +617,7 @@
TEST_F(DOMWebSocketTest, sendArrayBufferWhenClosing)
{
- DOMArrayBufferView* view = DOMUint8Array::create(8);
+ RefPtr<DOMArrayBufferView> view = DOMUint8Array::create(8);
{
InSequence s;
EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
@@ -630,7 +630,7 @@
m_websocket->close(m_exceptionState);
EXPECT_FALSE(m_exceptionState.hadException());
- m_websocket->send(view->buffer(), m_exceptionState);
+ m_websocket->send(view->buffer().get(), m_exceptionState);
EXPECT_FALSE(m_exceptionState.hadException());
EXPECT_EQ(DOMWebSocket::CLOSING, m_websocket->readyState());
@@ -639,7 +639,7 @@
TEST_F(DOMWebSocketTest, sendArrayBufferWhenClosed)
{
Checkpoint checkpoint;
- DOMArrayBufferView* view = DOMUint8Array::create(8);
+ RefPtr<DOMArrayBufferView> view = DOMUint8Array::create(8);
{
InSequence s;
EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
@@ -653,7 +653,7 @@
m_websocket->didClose(WebSocketChannelClient::ClosingHandshakeIncomplete, 1006, "");
checkpoint.Call(1);
- m_websocket->send(view->buffer(), m_exceptionState);
+ m_websocket->send(view->buffer().get(), m_exceptionState);
EXPECT_FALSE(m_exceptionState.hadException());
EXPECT_EQ(DOMWebSocket::CLOSED, m_websocket->readyState());
@@ -661,7 +661,7 @@
TEST_F(DOMWebSocketTest, sendArrayBufferSuccess)
{
- DOMArrayBufferView* view = DOMUint8Array::create(8);
+ RefPtr<DOMArrayBufferView> view = DOMUint8Array::create(8);
{
InSequence s;
EXPECT_CALL(channel(), connect(KURL(KURL(), "ws://example.com/"), String())).WillOnce(Return(true));
@@ -672,7 +672,7 @@
EXPECT_FALSE(m_exceptionState.hadException());
m_websocket->didConnect("", "");
- m_websocket->send(view->buffer(), m_exceptionState);
+ m_websocket->send(view->buffer().get(), m_exceptionState);
EXPECT_FALSE(m_exceptionState.hadException());
EXPECT_EQ(DOMWebSocket::OPEN, m_websocket->readyState());

Powered by Google App Engine
This is Rietveld 408576698