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

Unified Diff: ppapi/tests/test_transport.cc

Issue 8764004: Add DEPS include rules so we don't accidentally use base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove rules to include self where possible Created 9 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 | « ppapi/tests/test_transport.h ('k') | ppapi/tests/test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/test_transport.cc
diff --git a/ppapi/tests/test_transport.cc b/ppapi/tests/test_transport.cc
index 5826f35586e1af05f1697b64982ed2efbd43ebea..311cf9de8cf7e425db28c06caab9486b8f94d7d1 100644
--- a/ppapi/tests/test_transport.cc
+++ b/ppapi/tests/test_transport.cc
@@ -40,7 +40,7 @@ class StreamReader {
pp::CompletionCallback done_callback)
: expected_size_(expected_size),
done_callback_(done_callback),
- ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)),
+ PP_ALLOW_THIS_IN_INITIALIZER_LIST(callback_factory_(this)),
transport_(transport),
received_size_(0) {
Read();
@@ -96,6 +96,11 @@ class StreamReader {
} // namespace
+TestTransport::~TestTransport() {
+ delete transport1_;
+ delete transport2_;
+}
+
bool TestTransport::Init() {
transport_interface_ = reinterpret_cast<PPB_Transport_Dev const*>(
pp::Module::Get()->GetBrowserInterface(PPB_TRANSPORT_DEV_INTERFACE));
@@ -113,11 +118,11 @@ void TestTransport::RunTests(const std::string& filter) {
}
std::string TestTransport::InitTargets(PP_TransportType type) {
- transport1_.reset(new pp::Transport_Dev(instance_, kTestChannelName, type));
- transport2_.reset(new pp::Transport_Dev(instance_, kTestChannelName, type));
+ transport1_ = new pp::Transport_Dev(instance_, kTestChannelName, type);
+ transport2_ = new pp::Transport_Dev(instance_, kTestChannelName, type);
- ASSERT_TRUE(transport1_.get() != NULL);
- ASSERT_TRUE(transport2_.get() != NULL);
+ ASSERT_NE(NULL, transport1_);
+ ASSERT_NE(NULL, transport2_);
PASS();
}
@@ -155,8 +160,10 @@ std::string TestTransport::Connect() {
}
std::string TestTransport::Clean() {
- transport1_.reset();
- transport2_.reset();
+ delete transport1_;
+ transport1_ = NULL;
+ delete transport2_;
+ transport2_ = NULL;
PASS();
}
@@ -241,8 +248,7 @@ std::string TestTransport::TestSendDataUdp() {
const int kUdpWaitTimeMs = 1000; // 1 second.
TestCompletionCallback done_cb(instance_->pp_instance());
- StreamReader reader(transport1_.get(), kSendBufferSize * kNumPackets,
- done_cb);
+ StreamReader reader(transport1_, kSendBufferSize * kNumPackets, done_cb);
std::map<int, std::vector<char> > sent_packets;
for (int i = 0; i < kNumPackets; ++i) {
@@ -293,8 +299,7 @@ std::string TestTransport::TestSendDataTcp() {
const int kTcpSendSize = 100000;
TestCompletionCallback done_cb(instance_->pp_instance());
- StreamReader reader(transport1_.get(), kTcpSendSize,
- done_cb);
+ StreamReader reader(transport1_, kTcpSendSize, done_cb);
std::vector<char> send_buffer(kTcpSendSize);
for (size_t j = 0; j < send_buffer.size(); ++j) {
« no previous file with comments | « ppapi/tests/test_transport.h ('k') | ppapi/tests/test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698