Index: components/dom_distiller/core/distiller_unittest.cc |
diff --git a/components/dom_distiller/core/distiller_unittest.cc b/components/dom_distiller/core/distiller_unittest.cc |
index e6e7797b58de6fc7b72d9ff00d72ad5c8023d0d2..e57510997c2080216e233f19821c60c0abb2a207 100644 |
--- a/components/dom_distiller/core/distiller_unittest.cc |
+++ b/components/dom_distiller/core/distiller_unittest.cc |
@@ -45,6 +45,7 @@ const size_t kTotalImages = 2; |
const char* kImageURLs[kTotalImages] = {"http://a.com/img1.jpg", |
"http://a.com/img2.jpg"}; |
const char* kImageData[kTotalImages] = {"abcde", "12345"}; |
+const char kDebugLog[] = "Debug Log"; |
const string GetImageName(int page_num, int image_num) { |
return base::IntToString(page_num) + "_" + base::IntToString(image_num); |
@@ -341,6 +342,20 @@ TEST_F(DistillerTest, DistillPage) { |
EXPECT_EQ(kURL, first_page.url()); |
} |
+TEST_F(DistillerTest, DistillPageWithDebugInfo) { |
+ base::MessageLoopForUI loop; |
+ DomDistillerResult dd_result; |
+ dd_result.mutable_debug_info()->set_log(kDebugLog); |
+ scoped_ptr<base::Value> result = |
+ dom_distiller::proto::json::DomDistillerResult::WriteToValue(dd_result); |
+ distiller_.reset( |
+ new DistillerImpl(url_fetcher_factory_, DomDistillerOptions())); |
+ DistillPage(kURL, CreateMockDistillerPage(result.get(), GURL(kURL)).Pass()); |
+ base::MessageLoop::current()->RunUntilIdle(); |
+ const DistilledPageProto& first_page = article_proto_->pages(0); |
+ EXPECT_EQ(kDebugLog, first_page.debug_info().log()); |
+} |
+ |
TEST_F(DistillerTest, DistillPageWithImages) { |
base::MessageLoopForUI loop; |
vector<int> image_indices; |