| Index: components/offline_pages/downloads/download_ui_adapter_unittest.cc
|
| diff --git a/components/offline_pages/downloads/download_ui_adapter_unittest.cc b/components/offline_pages/downloads/download_ui_adapter_unittest.cc
|
| index a8a6152232ec40dce2b43e776e521198685cc1fd..1484ca9fd37aac9fabbe1f5b718d90fa602837e3 100644
|
| --- a/components/offline_pages/downloads/download_ui_adapter_unittest.cc
|
| +++ b/components/offline_pages/downloads/download_ui_adapter_unittest.cc
|
| @@ -281,4 +281,17 @@ TEST_F(DownloadUIAdapterTest, ItemUpdated) {
|
| EXPECT_EQ(0UL, updated_guids.size());
|
| }
|
|
|
| +TEST_F(DownloadUIAdapterTest, NoHangingLoad) {
|
| + EXPECT_NE(nullptr, model->adapter);
|
| + EXPECT_FALSE(items_loaded);
|
| + // Removal of last observer causes cache unload of not-yet-loaded cache.
|
| + model->adapter->RemoveObserver(this);
|
| + // This will complete async fetch of items, but...
|
| + PumpLoop();
|
| + // items should not be loaded when there is no observers!
|
| + EXPECT_FALSE(items_loaded);
|
| + // This should not crash.
|
| + model->adapter->AddObserver(this);
|
| +}
|
| +
|
| } // namespace offline_pages
|
|
|