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

Side by Side Diff: ppapi/tests/test_websocket.cc

Issue 12096099: PPAPI: Fix WebSocket Var ref leak receiving binary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/tests/test_case.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/tests/test_websocket.h" 5 #include "ppapi/tests/test_websocket.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 } 457 }
458 458
459 std::string TestWebSocket::TestValidConnect() { 459 std::string TestWebSocket::TestValidConnect() {
460 int32_t result; 460 int32_t result;
461 PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &result, ""); 461 PP_Resource ws = Connect(GetFullURL(kEchoServerURL), &result, "");
462 ASSERT_TRUE(ws); 462 ASSERT_TRUE(ws);
463 ASSERT_EQ(PP_OK, result); 463 ASSERT_EQ(PP_OK, result);
464 PP_Var extensions = websocket_interface_->GetExtensions(ws); 464 PP_Var extensions = websocket_interface_->GetExtensions(ws);
465 ASSERT_TRUE(AreEqualWithString(extensions, "")); 465 ASSERT_TRUE(AreEqualWithString(extensions, ""));
466 core_interface_->ReleaseResource(ws); 466 core_interface_->ReleaseResource(ws);
467 ReleaseVar(extensions);
dmichael (off chromium) 2013/01/31 22:53:41 ^^^ This is unrelated, but required to make the te
467 468
468 PASS(); 469 PASS();
469 } 470 }
470 471
471 std::string TestWebSocket::TestInvalidClose() { 472 std::string TestWebSocket::TestInvalidClose() {
472 PP_Var reason = CreateVarString("close for test"); 473 PP_Var reason = CreateVarString("close for test");
473 TestCompletionCallback callback(instance_->pp_instance(), callback_type()); 474 TestCompletionCallback callback(instance_->pp_instance(), callback_type());
474 TestCompletionCallback async_callback(instance_->pp_instance(), PP_REQUIRED); 475 TestCompletionCallback async_callback(instance_->pp_instance(), PP_REQUIRED);
475 476
476 // Close before connect. 477 // Close before connect.
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1504 size_t last_event = events_on_closed - 1; 1505 size_t last_event = events_on_closed - 1;
1505 for (uint32_t i = 1; i < last_event; ++i) { 1506 for (uint32_t i = 1; i < last_event; ++i) {
1506 ASSERT_EQ(WebSocketEvent::EVENT_MESSAGE, events[i].event_type); 1507 ASSERT_EQ(WebSocketEvent::EVENT_MESSAGE, events[i].event_type);
1507 ASSERT_TRUE(AreEqualWithString(events[i].var.pp_var(), message)); 1508 ASSERT_TRUE(AreEqualWithString(events[i].var.pp_var(), message));
1508 } 1509 }
1509 ASSERT_EQ(WebSocketEvent::EVENT_CLOSE, events[last_event].event_type); 1510 ASSERT_EQ(WebSocketEvent::EVENT_CLOSE, events[last_event].event_type);
1510 ASSERT_TRUE(events[last_event].was_clean); 1511 ASSERT_TRUE(events[last_event].was_clean);
1511 1512
1512 PASS(); 1513 PASS();
1513 } 1514 }
OLDNEW
« no previous file with comments | « ppapi/tests/test_case.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698