OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 std::string GetReadableArticleString( | 136 std::string GetReadableArticleString( |
137 const DistilledArticleProto& article_proto) { | 137 const DistilledArticleProto& article_proto) { |
138 std::stringstream output; | 138 std::stringstream output; |
139 output << "Article Title: " << article_proto.title() << std::endl; | 139 output << "Article Title: " << article_proto.title() << std::endl; |
140 output << "# of pages: " << article_proto.pages_size() << std::endl; | 140 output << "# of pages: " << article_proto.pages_size() << std::endl; |
141 for (int i = 0; i < article_proto.pages_size(); ++i) { | 141 for (int i = 0; i < article_proto.pages_size(); ++i) { |
142 const DistilledPageProto& page = article_proto.pages(i); | 142 const DistilledPageProto& page = article_proto.pages(i); |
143 output << "Page " << i << std::endl; | 143 output << "Page " << i << std::endl; |
144 output << "URL: " << page.url() << std::endl; | 144 output << "URL: " << page.url() << std::endl; |
145 output << "Content: " << page.html() << std::endl; | 145 output << "Content: " << page.html() << std::endl; |
| 146 if (page.has_debug_info() && page.debug_info().has_log()) |
| 147 output << "Log: " << page.debug_info().log() << std::endl; |
146 } | 148 } |
147 return output.str(); | 149 return output.str(); |
148 } | 150 } |
149 | 151 |
150 } // namespace | 152 } // namespace |
151 | 153 |
152 class ContentExtractionRequest : public ViewRequestDelegate { | 154 class ContentExtractionRequest : public ViewRequestDelegate { |
153 public: | 155 public: |
154 void Start(DomDistillerService* service, const gfx::Size& render_view_size, | 156 void Start(DomDistillerService* service, const gfx::Size& render_view_size, |
155 base::Closure finished_callback) { | 157 base::Closure finished_callback) { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 std::string output_data_; | 331 std::string output_data_; |
330 scoped_ptr<google::protobuf::io::StringOutputStream> protobuf_output_stream_; | 332 scoped_ptr<google::protobuf::io::StringOutputStream> protobuf_output_stream_; |
331 }; | 333 }; |
332 | 334 |
333 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { | 335 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { |
334 Start(); | 336 Start(); |
335 base::RunLoop().Run(); | 337 base::RunLoop().Run(); |
336 } | 338 } |
337 | 339 |
338 } // namespace dom_distiller | 340 } // namespace dom_distiller |
OLD | NEW |