| Index: components/offline_pages/offline_page_model.cc
|
| diff --git a/components/offline_pages/offline_page_model.cc b/components/offline_pages/offline_page_model.cc
|
| index 7f4b60c139732de21e127b328f02147cd22f4c43..4808c3b89eacb8f4d4e336aa8a93558b4153b92b 100644
|
| --- a/components/offline_pages/offline_page_model.cc
|
| +++ b/components/offline_pages/offline_page_model.cc
|
| @@ -284,7 +284,14 @@ void OfflinePageModel::ClearAll(const base::Closure& callback) {
|
| }
|
|
|
| bool OfflinePageModel::HasOfflinePages() const {
|
| - DCHECK(is_loaded_);
|
| + // Since offline pages feature is enabled by default,
|
| + // NetErrorTabHelper::SetHasOfflinePages might call this before the model is
|
| + // fully loaded. To address this, we need to switch to asynchonous model
|
| + // (crbug.com/589526). But for now, we just bail out to work around the test
|
| + // issue.
|
| + if (!is_loaded_)
|
| + return false;
|
| +
|
| // Check that at least one page is not marked for deletion. Because we have
|
| // pages marked for deletion, we cannot simply invert result of |empty()|.
|
| for (const auto& id_page_pair : offline_pages_) {
|
|
|