| Index: components/dom_distiller/core/task_tracker_unittest.cc
|
| diff --git a/components/dom_distiller/core/task_tracker_unittest.cc b/components/dom_distiller/core/task_tracker_unittest.cc
|
| index aeb1e95bb56e39de774db9b940ff05a7636865fc..0f2a4b7a01123712b3fb55e3ccf3dec9257eaad2 100644
|
| --- a/components/dom_distiller/core/task_tracker_unittest.cc
|
| +++ b/components/dom_distiller/core/task_tracker_unittest.cc
|
| @@ -159,6 +159,31 @@ TEST_F(DomDistillerTaskTrackerTest, TestViewerNotifiedOnDistillationComplete) {
|
| EXPECT_FALSE(cancel_callback.Cancelled());
|
| }
|
|
|
| +TEST_F(DomDistillerTaskTrackerTest, TestDistillerFails) {
|
| + MockDistillerFactory distiller_factory;
|
| + FakeDistiller* distiller = new FakeDistiller(false);
|
| + EXPECT_CALL(distiller_factory, CreateDistillerImpl())
|
| + .WillOnce(Return(distiller));
|
| +
|
| + TestCancelCallback cancel_callback;
|
| + TaskTracker task_tracker(
|
| + GetDefaultEntry(), cancel_callback.GetCallback(), NULL);
|
| +
|
| + FakeViewRequestDelegate viewer_delegate;
|
| + scoped_ptr<ViewerHandle> handle(task_tracker.AddViewer(&viewer_delegate));
|
| + base::RunLoop().RunUntilIdle();
|
| +
|
| + EXPECT_CALL(viewer_delegate, OnArticleReady(_));
|
| +
|
| + task_tracker.StartDistiller(&distiller_factory,
|
| + scoped_ptr<DistillerPage>().Pass());
|
| + distiller->RunDistillerCallback(
|
| + scoped_ptr<DistilledArticleProto>(new DistilledArticleProto));
|
| + base::RunLoop().RunUntilIdle();
|
| +
|
| + EXPECT_FALSE(cancel_callback.Cancelled());
|
| +}
|
| +
|
| TEST_F(DomDistillerTaskTrackerTest,
|
| TestSaveCallbackCalledOnDistillationComplete) {
|
| MockDistillerFactory distiller_factory;
|
|
|