Commit 11d267d5 authored by scherkus@chromium.org's avatar scherkus@chromium.org

Report that we're no longer downloading when the resource loader has finished loading.

The end result is that we now go back to NETWORK_IDLE after the resource has loaded.

BUG=139511


Review URL: https://chromiumcodereview.appspot.com/10829155

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149879 0039d316-1c4b-4281-b951-d872f2087c98
parent 8fd386fa
...@@ -457,17 +457,16 @@ void BufferedDataSource::LoadingStateChangedCallback( ...@@ -457,17 +457,16 @@ void BufferedDataSource::LoadingStateChangedCallback(
is_downloading_data = true; is_downloading_data = true;
break; break;
case BufferedResourceLoader::kLoadingDeferred: case BufferedResourceLoader::kLoadingDeferred:
case BufferedResourceLoader::kLoadingFinished:
is_downloading_data = false; is_downloading_data = false;
break; break;
// TODO(scherkus): we don't signal network activity changes when loads // TODO(scherkus): we don't signal network activity changes when loads
// complete or fail to preserve existing behaviour when deferring is // fail to preserve existing behaviour when deferring is toggled, however
// toggled, however we considering changing DownloadingCB to also // we should consider changing DownloadingCB to also propagate loading
// propagate loading state. For example there isn't any signal today // state. For example there isn't any signal today to notify the client that
// to notify the client that loading has failed/finished (we only get // loading has failed (we only get errors on subsequent reads).
// errors on subsequent reads).
case BufferedResourceLoader::kLoadingFailed: case BufferedResourceLoader::kLoadingFailed:
case BufferedResourceLoader::kLoadingFinished:
return; return;
} }
......
...@@ -591,4 +591,24 @@ TEST_F(BufferedDataSourceTest, File_Read) { ...@@ -591,4 +591,24 @@ TEST_F(BufferedDataSourceTest, File_Read) {
Stop(); Stop();
} }
TEST_F(BufferedDataSourceTest, Http_FinishLoading) {
InitializeWith206Response();
EXPECT_TRUE(data_source_->downloading());
FinishLoading();
EXPECT_FALSE(data_source_->downloading());
Stop();
}
TEST_F(BufferedDataSourceTest, File_FinishLoading) {
InitializeWithFileResponse();
EXPECT_FALSE(data_source_->downloading());
FinishLoading();
EXPECT_FALSE(data_source_->downloading());
Stop();
}
} // namespace webkit_media } // namespace webkit_media
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment