diff options
author | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-03 19:49:35 +0000 |
---|---|---|
committer | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-03 19:49:35 +0000 |
commit | 91240c947358b33cc19c0923a06d116ab36737dd (patch) | |
tree | 7897c99ad9b41d7735c7a42e0ea75fe6f76760b3 /o3d/serializer | |
parent | 2e25a9f4152a90a179ad37206bff79e1198379d7 (diff) | |
download | chromium_src-91240c947358b33cc19c0923a06d116ab36737dd.zip chromium_src-91240c947358b33cc19c0923a06d116ab36737dd.tar.gz chromium_src-91240c947358b33cc19c0923a06d116ab36737dd.tar.bz2 |
Asynchronous tick now uses NPN_PluginAsyncCall.URL streaming callbacks are now also asynchronous.Implemented NPN_PluginAsyncCall for IE.Allowed WM_PAINT handler to be reentered because it no longer calls into the browser (except to schedule an asynchronous tick if none is pending).Fixed a bug where the EventManager would crash if an event callback called cleanUp on the client.Cleanup destroys all the packs. Doing this in NPP_Destroy seems to make Chrome timeout and fail to load the next page.Tar and GZ decoding happens on a new thread.
Review URL: http://codereview.chromium.org/155733
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22305 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/serializer')
-rw-r--r-- | o3d/serializer/cross/serializer_test.cc | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/o3d/serializer/cross/serializer_test.cc b/o3d/serializer/cross/serializer_test.cc index 4ab5abe..aa19465 100644 --- a/o3d/serializer/cross/serializer_test.cc +++ b/o3d/serializer/cross/serializer_test.cc @@ -68,12 +68,16 @@ struct AddFileRecord { class MockArchiveGenerator : public IArchiveGenerator { public: - virtual void AddFile(const String& file_name, + MockArchiveGenerator() : closed_(false), success_(false) { + } + + virtual bool AddFile(const String& file_name, size_t file_size) { AddFileRecord record; record.file_name_ = file_name; record.file_size_ = file_size; add_file_records_.push_back(record); + return true; } virtual int AddFileBytes(MemoryReadStream* stream, size_t numBytes) { @@ -85,7 +89,14 @@ class MockArchiveGenerator : public IArchiveGenerator { return 0; } + virtual void Close(bool success) { + closed_ = true; + success_ = success; + } + vector<AddFileRecord> add_file_records_; + bool closed_; + bool success_; }; class SerializerTest : public testing::Test { @@ -323,9 +334,10 @@ TEST_F(SerializerTest, ShouldSerializeCurveKeysToSingleBinaryFile) { serializer_.SerializePack(pack_); EXPECT_EQ(1, archive_generator_.add_file_records_.size()); const AddFileRecord& record = archive_generator_.add_file_records_[0]; - EXPECT_EQ("curve-keys.bin", record.file_name_); + EXPECT_FALSE(archive_generator_.closed_); + // Test that the data matches what we get if we call SerializeCurve directly // The file should contain the concatenated contents of both curves MemoryBuffer<uint8> contents1; @@ -414,6 +426,8 @@ TEST_F(SerializerTest, SerializesAllIndexBufferBinaryToSingleFileInArchive) { const AddFileRecord& record = archive_generator_.add_file_records_[0]; EXPECT_EQ("index-buffers.bin", record.file_name_); + EXPECT_FALSE(archive_generator_.closed_); + // Test that the data matches what we get if we call SerializeBuffer directly // The file should contain the concatenated contents of both buffers MemoryBuffer<uint8> contents1; @@ -743,6 +757,8 @@ TEST_F(SerializerTest, ShouldSerializeSkinToSingleBinaryFile) { const AddFileRecord& record = archive_generator_.add_file_records_[0]; EXPECT_EQ("skins.bin", record.file_name_); + EXPECT_FALSE(archive_generator_.closed_); + // Test that the data matches what we get if we call SerializeSkin directly // The file should contain the concatenated contents of both skins MemoryBuffer<uint8> contents1; @@ -1043,6 +1059,8 @@ TEST_F(SerializerTest, SerializesAllVertexBufferBinaryToSingleFileInArchive) { const AddFileRecord& record = archive_generator_.add_file_records_[0]; EXPECT_EQ("vertex-buffers.bin", record.file_name_); + EXPECT_FALSE(archive_generator_.closed_); + // Test that the data matches what we get if we call SerializeBuffer directly // The file should contain the concatenated contents of both buffers MemoryBuffer<uint8> contents1; |