summaryrefslogtreecommitdiffstats
path: root/chrome/common/chrome_plugin_unittest.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-24 02:39:54 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-24 02:39:54 +0000
commite993abfe81feaa374d476828a44942d296bdcc78 (patch)
tree201fffef0ba93ce41afaf2bd6e61e05b61c04028 /chrome/common/chrome_plugin_unittest.cc
parent0afe80d755b899c188313629ea3f45f0fe5be981 (diff)
downloadchromium_src-e993abfe81feaa374d476828a44942d296bdcc78.zip
chromium_src-e993abfe81feaa374d476828a44942d296bdcc78.tar.gz
chromium_src-e993abfe81feaa374d476828a44942d296bdcc78.tar.bz2
revert r8603
Review URL: http://codereview.chromium.org/18576 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/chrome_plugin_unittest.cc')
-rw-r--r--chrome/common/chrome_plugin_unittest.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/chrome/common/chrome_plugin_unittest.cc b/chrome/common/chrome_plugin_unittest.cc
index d7c581f..bf901b3 100644
--- a/chrome/common/chrome_plugin_unittest.cc
+++ b/chrome/common/chrome_plugin_unittest.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/profile.h"
#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/test/chrome_plugin/test_chrome_plugin.h"
-#include "net/base/io_buffer.h"
#include "net/url_request/url_request_test_job.h"
#include "net/url_request/url_request_unittest.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -20,13 +19,11 @@ namespace {
const wchar_t kDocRoot[] = L"chrome/test/data";
const char kPluginFilename[] = "test_chrome_plugin.dll";
-const int kResponseBufferSize = 4096;
class ChromePluginTest : public testing::Test, public URLRequest::Delegate {
public:
ChromePluginTest()
: request_(NULL),
- response_buffer_(new net::IOBuffer(kResponseBufferSize)),
plugin_(NULL),
expected_payload_(NULL),
request_context_(new TestURLRequestContext()) {
@@ -78,7 +75,7 @@ class ChromePluginTest : public testing::Test, public URLRequest::Delegate {
// Note: we use URLRequest (instead of URLFetcher) because this allows the
// request to be intercepted.
scoped_ptr<URLRequest> request_;
- scoped_refptr<net::IOBuffer> response_buffer_;
+ char response_buffer_[4096];
std::string response_data_;
ChromePluginLib* plugin_;
@@ -158,7 +155,7 @@ void ChromePluginTest::OnResponseStarted(URLRequest* request) {
int bytes_read = 0;
if (request_->status().is_success())
- request_->Read(response_buffer_, kResponseBufferSize, &bytes_read);
+ request_->Read(response_buffer_, sizeof(response_buffer_), &bytes_read);
OnReadCompleted(request_.get(), bytes_read);
}
@@ -168,8 +165,9 @@ void ChromePluginTest::OnReadCompleted(URLRequest* request, int bytes_read) {
do {
if (!request_->status().is_success() || bytes_read <= 0)
break;
- response_data_.append(response_buffer_->data(), bytes_read);
- } while (request_->Read(response_buffer_, kResponseBufferSize, &bytes_read));
+ response_data_.append(response_buffer_, bytes_read);
+ } while (request_->Read(response_buffer_, sizeof(response_buffer_),
+ &bytes_read));
if (!request_->status().is_io_pending()) {
OnURLRequestComplete();