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

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

Issue 211493008: Make DistillerPageWebContentsTest a real test that uses the distiller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/page_distiller.cc
diff --git a/components/dom_distiller/core/page_distiller.cc b/components/dom_distiller/core/page_distiller.cc
index db941ab011fc04c6dd4dcf2c8e938c0f244f3231..308e35841863cbed0b77067f65360798ba5ad37c 100644
--- a/components/dom_distiller/core/page_distiller.cc
+++ b/components/dom_distiller/core/page_distiller.cc
@@ -63,6 +63,7 @@ void PageDistiller::OnExecuteJavaScriptDone(const GURL& page_url,
scoped_ptr<DistilledPageInfo> page_info(new DistilledPageInfo());
std::string result;
const base::ListValue* result_list = NULL;
+ bool found_content = false;
if (!value->GetAsList(&result_list)) {
base::MessageLoop::current()->PostTask(
FROM_HERE,
@@ -83,6 +84,7 @@ void PageDistiller::OnExecuteJavaScriptDone(const GURL& page_url,
break;
case 1:
page_info->html = item;
+ found_content = true;
break;
case 2:
page_info->next_page_url = item;
@@ -91,12 +93,16 @@ void PageDistiller::OnExecuteJavaScriptDone(const GURL& page_url,
page_info->prev_page_url = item;
break;
default:
- page_info->image_urls.push_back(item);
+ if (GURL(item).is_valid()) {
+ page_info->image_urls.push_back(item);
+ }
}
}
base::MessageLoop::current()->PostTask(
FROM_HERE,
- base::Bind(page_distiller_callback_, base::Passed(&page_info), true));
+ base::Bind(page_distiller_callback_,
+ base::Passed(&page_info),
+ found_content));
}
}
« no previous file with comments | « components/dom_distiller/core/javascript/domdistiller.js ('k') | components/test/data/dom_distiller/simple_article.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698