HttpTest: use BReferenceable APIs for the BUrlContext.
This commit is contained in:
@@ -37,10 +37,11 @@ void
|
|||||||
HttpTest::GetTest()
|
HttpTest::GetTest()
|
||||||
{
|
{
|
||||||
BUrl testUrl(fBaseUrl, "/user-agent");
|
BUrl testUrl(fBaseUrl, "/user-agent");
|
||||||
BUrlContext c;
|
BUrlContext* c = new BUrlContext();
|
||||||
|
c->AcquireReference();
|
||||||
BHttpRequest t(testUrl);
|
BHttpRequest t(testUrl);
|
||||||
|
|
||||||
t.SetContext(&c);
|
t.SetContext(c);
|
||||||
|
|
||||||
CPPUNIT_ASSERT(t.Run());
|
CPPUNIT_ASSERT(t.Run());
|
||||||
|
|
||||||
@@ -56,8 +57,10 @@ HttpTest::GetTest()
|
|||||||
r.Headers().CountHeaders());
|
r.Headers().CountHeaders());
|
||||||
CPPUNIT_ASSERT_EQUAL(42, r.Length());
|
CPPUNIT_ASSERT_EQUAL(42, r.Length());
|
||||||
// Fixed size as we know the response format.
|
// Fixed size as we know the response format.
|
||||||
CPPUNIT_ASSERT(!c.GetCookieJar().GetIterator().HasNext());
|
CPPUNIT_ASSERT(!c->GetCookieJar().GetIterator().HasNext());
|
||||||
// This page should not set cookies
|
// This page should not set cookies
|
||||||
|
|
||||||
|
c->ReleaseReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user