Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(832)

Unified Diff: components/dom_distiller/core/distiller_unittest.cc

Issue 504263002: Add DebugInfo to DistilledPageProto. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove-intermediate-distilledpageinfo-structs
Patch Set: merged in upstream Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
« no previous file with comments | « components/dom_distiller/core/distiller.cc ('k') | components/dom_distiller/core/proto/distilled_page.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698