summaryrefslogtreecommitdiffstats
path: root/webkit/glue/multipart_response_delegate_unittest.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 07:04:46 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 07:04:46 +0000
commit7db7581ccba3b06045295e7c3ca8a79703892fbb (patch)
treebffca8721023268c881e1d95adbff23b7d4970ef /webkit/glue/multipart_response_delegate_unittest.cc
parentf0eb3d567ad9a7e98504e0a5981fa7f0ff6d4a18 (diff)
downloadchromium_src-7db7581ccba3b06045295e7c3ca8a79703892fbb.zip
chromium_src-7db7581ccba3b06045295e7c3ca8a79703892fbb.tar.gz
chromium_src-7db7581ccba3b06045295e7c3ca8a79703892fbb.tar.bz2
More removal of config.h and glue_util.h dependencies.
I killed the #if ENABLE(WORKERS) defines in favor of always compiling that code because it is harmless to compile it when the underlying WebCore implementation is not compiled, thanks to the WebKit API. R=yaar BUG=none TEST=none Review URL: http://codereview.chromium.org/404023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/multipart_response_delegate_unittest.cc')
-rw-r--r--webkit/glue/multipart_response_delegate_unittest.cc26
1 files changed, 9 insertions, 17 deletions
diff --git a/webkit/glue/multipart_response_delegate_unittest.cc b/webkit/glue/multipart_response_delegate_unittest.cc
index 846f323..27a3629 100644
--- a/webkit/glue/multipart_response_delegate_unittest.cc
+++ b/webkit/glue/multipart_response_delegate_unittest.cc
@@ -9,7 +9,6 @@
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h"
-#include "webkit/glue/glue_util.h"
#include "webkit/glue/multipart_response_delegate.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -82,6 +81,10 @@ class MockWebURLLoaderClient : public WebURLLoaderClient {
response_.reset();
}
+ string GetResponseHeader(const char* name) const {
+ return string(response_.httpHeaderField(WebString::fromUTF8(name)).utf8());
+ }
+
int received_response_, received_data_;
string data_;
WebURLResponse response_;
@@ -160,18 +163,10 @@ TEST(MultipartResponseTest, Functions) {
delegate_tester.data().assign(test_header);
EXPECT_TRUE(delegate_tester.ParseHeaders());
EXPECT_TRUE(delegate_tester.data().length() == 0);
- EXPECT_EQ(string("image/png"),
- webkit_glue::WebStringToStdString(
- client.response_.httpHeaderField(
- WebString::fromUTF8("Content-Type"))));
- EXPECT_EQ(string("10"),
- webkit_glue::WebStringToStdString(
- client.response_.httpHeaderField(
- WebString::fromUTF8("content-length"))));
+ EXPECT_EQ(string("image/png"), client.GetResponseHeader("Content-Type"));
+ EXPECT_EQ(string("10"), client.GetResponseHeader("content-length"));
// This header is passed from the original request.
- EXPECT_EQ(string("Bar"),
- webkit_glue::WebStringToStdString(
- client.response_.httpHeaderField(WebString::fromUTF8("foo"))));
+ EXPECT_EQ(string("Bar"), client.GetResponseHeader("foo"));
// Make sure we parse the right mime-type if a charset is provided.
client.Reset();
@@ -180,12 +175,9 @@ TEST(MultipartResponseTest, Functions) {
EXPECT_TRUE(delegate_tester.ParseHeaders());
EXPECT_TRUE(delegate_tester.data().length() == 0);
EXPECT_EQ(string("text/html; charset=utf-8"),
- webkit_glue::WebStringToStdString(
- client.response_.httpHeaderField(
- WebString::fromUTF8("Content-Type"))));
+ client.GetResponseHeader("Content-Type"));
EXPECT_EQ(string("utf-8"),
- webkit_glue::WebStringToStdString(
- client.response_.textEncodingName()));
+ string(client.response_.textEncodingName().utf8()));
// FindBoundary tests
struct {