diff options
author | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 20:56:12 +0000 |
---|---|---|
committer | amit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-13 20:56:12 +0000 |
commit | 642c15e020eef69301e29f2998f073d95650534d (patch) | |
tree | da88c9f040cade83011cfd0658e17c8d32b43c0c /chrome_frame | |
parent | 939e7367d5d984efe1f402c7e5135503beaebfae (diff) | |
download | chromium_src-642c15e020eef69301e29f2998f073d95650534d.zip chromium_src-642c15e020eef69301e29f2998f073d95650534d.tar.gz chromium_src-642c15e020eef69301e29f2998f073d95650534d.tar.bz2 |
Fix unit test breakage in last change.
Instead of returning E_FAIL from IStream::Read when
there is no valid cache to serve content from, confirm
tp the IStream Read contract and return S_FALSE with 0 bytes.
TBR=stoyan
TEST=MonikerPatchTest.CacheStream
Review URL: http://codereview.chromium.org/2114001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47189 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/urlmon_moniker_unittest.cc | 2 | ||||
-rw-r--r-- | chrome_frame/urlmon_bind_status_callback.cc | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/chrome_frame/test/urlmon_moniker_unittest.cc b/chrome_frame/test/urlmon_moniker_unittest.cc index 5af4eb3..1d889bf 100644 --- a/chrome_frame/test/urlmon_moniker_unittest.cc +++ b/chrome_frame/test/urlmon_moniker_unittest.cc @@ -69,7 +69,7 @@ TEST_F(MonikerPatchTest, CacheStream) { // Test 1: empty stream reads nothing CComObjectStackEx<CacheStream> cache_stream1; - EXPECT_EQ(E_PENDING, cache_stream1.Read(ret, sizeof(ret), &read)); + EXPECT_EQ(S_FALSE, cache_stream1.Read(ret, sizeof(ret), &read)); EXPECT_EQ(0, read); // Test 2: Read from initialized cache diff --git a/chrome_frame/urlmon_bind_status_callback.cc b/chrome_frame/urlmon_bind_status_callback.cc index 1f39a08..5730870 100644 --- a/chrome_frame/urlmon_bind_status_callback.cc +++ b/chrome_frame/urlmon_bind_status_callback.cc @@ -75,8 +75,10 @@ STDMETHODIMP CacheStream::Read(void* pv, ULONG cb, ULONG* read) { if (!pv || !read) return E_INVALIDARG; - if (!cache_.get()) - return E_FAIL; + if (!cache_.get()) { + *read = 0; + return S_FALSE; + } // Default to E_PENDING to signal that this is a partial data. HRESULT hr = eof_ ? S_FALSE : E_PENDING; |