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

Unified Diff: components/dom_distiller/core/javascript/domdistiller.js

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/javascript/domdistiller.js
diff --git a/components/dom_distiller/core/javascript/domdistiller.js b/components/dom_distiller/core/javascript/domdistiller.js
index eb5d4c5926a2942012de6ca150f3716c62d8e0db..ce0ebd821f5abee76ae77855f1684484e4d29b7e 100644
--- a/components/dom_distiller/core/javascript/domdistiller.js
+++ b/components/dom_distiller/core/javascript/domdistiller.js
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// TODO(cjhopman): remove dependency on readability.
-
// These includes will be processed at build time by grit.
<include src="../../../../third_party/dom_distiller_js/js/domdistiller.js"/>
@@ -13,12 +11,16 @@
// element is the previous page link.
(function() {
var result = new Array(4);
- result[0] = com.dom_distiller.DocumentTitleGetter.getDocumentTitle(
- document.title, document.documentElement);
- result[1] = com.dom_distiller.ContentExtractor.extractContent();
- result[2] = com.dom_distiller.PagingLinksFinder.findNext(
- document.documentElement);
- // TODO(shashishekhar): Add actual previous page link here.
- result[3] = '';
+ try {
+ result[0] = com.dom_distiller.DocumentTitleGetter.getDocumentTitle(
+ document.title, document.documentElement);
+ result[1] = com.dom_distiller.ContentExtractor.extractContent();
+ result[2] = com.dom_distiller.PagingLinksFinder.findNext(
+ document.documentElement);
+ // TODO(shashishekhar): Add actual previous page link here.
+ result[3] = '';
+ } catch (e) {
+ window.console.log("Error during distillation: " + e);
+ }
return result;
})()

Powered by Google App Engine
This is Rietveld 408576698