Enable ChromeFrame net tests. These tests regressed with the change in the chunked upload
code in net to move the formatting of individual chunks to the http network stack. This caused the URLRequestTestHTTP.TestPostChunkedDataBeforeStart test to hang in ChromeFrame. Fix is to ensure that the individual chunks are properly formatted while marshaling them over IPC. BUG=none TEST=chrome frame net tests should pass. Review URL: http://codereview.chromium.org/6626035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77002 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@ -378,7 +378,20 @@ struct ParamTraits<net::UploadData::Element> {
|
||||
break;
|
||||
}
|
||||
case net::UploadData::TYPE_CHUNK: {
|
||||
m->WriteData(&p.bytes()[0], static_cast<int>(p.bytes().size()));
|
||||
std::string chunk_length = StringPrintf("%X\r\n", p.bytes().size());
|
||||
std::vector<char> bytes;
|
||||
bytes.insert(bytes.end(), chunk_length.data(),
|
||||
chunk_length.data() + chunk_length.length());
|
||||
const char* data = &p.bytes()[0];
|
||||
bytes.insert(bytes.end(), data, data + p.bytes().size());
|
||||
const char* crlf = "\r\n";
|
||||
bytes.insert(bytes.end(), crlf, crlf + strlen(crlf));
|
||||
if (p.is_last_chunk()) {
|
||||
const char* end_of_data = "0\r\n\r\n";
|
||||
bytes.insert(bytes.end(), end_of_data,
|
||||
end_of_data + strlen(end_of_data));
|
||||
}
|
||||
m->WriteData(&bytes[0], static_cast<int>(bytes.size()));
|
||||
// If this element is part of a chunk upload then send over information
|
||||
// indicating if this is the last chunk.
|
||||
WriteParam(m, p.is_last_chunk());
|
||||
|
@ -505,10 +505,7 @@ int main(int argc, char** argv) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
// TODO(tommi): Stuff be broke. Needs a fixin'.
|
||||
#if 0
|
||||
// This is awkward: the TestSuite derived CFUrlRequestUnittestRunner contains
|
||||
// the instance of the AtExitManager that RegisterPathProvider() and others
|
||||
// below require. So we have to instantiate this first.
|
||||
@ -527,5 +524,4 @@ int main(int argc, char** argv) {
|
||||
PluginService::EnableChromePlugins(false);
|
||||
test_suite.RunMainUIThread();
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user