| Index: chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
|
| diff --git a/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc b/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
|
| index efe87a842c48a67e866ba2289069df584dc0b83c..3ba2c56c42f0def539ba0fa83b8c88cfef718840 100644
|
| --- a/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
|
| +++ b/chrome/browser/android/offline_pages/background_loader_offliner_unittest.cc
|
| @@ -147,14 +147,13 @@ class BackgroundLoaderOfflinerTest : public testing::Test {
|
| const base::HistogramTester& histograms() const { return histogram_tester_; }
|
| int64_t progress() { return progress_; }
|
|
|
| + void PumpLoop() { base::RunLoop().RunUntilIdle(); }
|
| +
|
| void CompleteLoading() {
|
| - // For some reason, setting loading to True will call DidStopLoading
|
| - // on the observers.
|
| - offliner()->web_contents_tester()->TestSetIsLoading(true);
|
| + offliner()->DocumentOnLoadCompletedInMainFrame();
|
| + PumpLoop();
|
| }
|
|
|
| - void PumpLoop() { base::RunLoop().RunUntilIdle(); }
|
| -
|
| private:
|
| void OnCompletion(const SavePageRequest& request,
|
| Offliner::RequestStatus status);
|
| @@ -433,7 +432,7 @@ TEST_F(BackgroundLoaderOfflinerTest, FailsOnErrorPage) {
|
| "OfflinePages.Background.BackgroundLoadingFailedCode.async_loading",
|
| 105, // ERR_NAME_NOT_RESOLVED
|
| 1);
|
| - offliner()->DidStopLoading();
|
| + CompleteLoading();
|
| PumpLoop();
|
|
|
| EXPECT_TRUE(completion_callback_called());
|
| @@ -457,7 +456,7 @@ TEST_F(BackgroundLoaderOfflinerTest, NoNextOnInternetDisconnected) {
|
| offliner()->DidFinishNavigation(handle.get());
|
| // NavigationHandle is always destroyed after finishing navigation.
|
| handle.reset();
|
| - offliner()->DidStopLoading();
|
| + CompleteLoading();
|
| PumpLoop();
|
|
|
| EXPECT_TRUE(completion_callback_called());
|
| @@ -473,7 +472,7 @@ TEST_F(BackgroundLoaderOfflinerTest, OnlySavesOnceOnMultipleLoads) {
|
| // First load
|
| CompleteLoading();
|
| // Second load
|
| - offliner()->DidStopLoading();
|
| + CompleteLoading();
|
| PumpLoop();
|
| model()->CompleteSavingAsSuccess();
|
| PumpLoop();
|
|
|