summaryrefslogtreecommitdiffstats
path: root/components/dom_distiller/core/fake_distiller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'components/dom_distiller/core/fake_distiller.cc')
-rw-r--r--components/dom_distiller/core/fake_distiller.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/components/dom_distiller/core/fake_distiller.cc b/components/dom_distiller/core/fake_distiller.cc
index 027d297..93659b3 100644
--- a/components/dom_distiller/core/fake_distiller.cc
+++ b/components/dom_distiller/core/fake_distiller.cc
@@ -4,6 +4,10 @@
#include "components/dom_distiller/core/fake_distiller.h"
+#include "base/bind.h"
+#include "base/message_loop/message_loop.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
namespace dom_distiller {
namespace test {
@@ -16,5 +20,20 @@ FakeDistiller::FakeDistiller() {
FakeDistiller::~FakeDistiller() { Die(); }
+void FakeDistiller::RunDistillerCallback(scoped_ptr<DistilledPageProto> proto) {
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&FakeDistiller::RunDistillerCallbackInternal,
+ base::Unretained(this),
+ base::Passed(&proto)));
+}
+
+void FakeDistiller::RunDistillerCallbackInternal(
+ scoped_ptr<DistilledPageProto> proto) {
+ EXPECT_FALSE(callback_.is_null());
+ callback_.Run(proto.Pass());
+ callback_.Reset();
+}
+
} // namespace test
} // namespace dom_distiller