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

Side by Side Diff: content/shell/webkit_test_controller.cc

Issue 11586008: [content shell] if the document is plain text, dump it as text (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/shell/webkit_test_controller.h" 5 #include "content/shell/webkit_test_controller.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 DCHECK(CalledOnValidThread()); 267 DCHECK(CalledOnValidThread());
268 main_window_ = NULL; 268 main_window_ = NULL;
269 printer_->AddErrorMessage("FAIL: main window was destroyed"); 269 printer_->AddErrorMessage("FAIL: main window was destroyed");
270 } 270 }
271 271
272 void WebKitTestController::CaptureDump() { 272 void WebKitTestController::CaptureDump() {
273 if (captured_dump_ || !main_window_ || !printer_->in_text_block()) 273 if (captured_dump_ || !main_window_ || !printer_->in_text_block())
274 return; 274 return;
275 captured_dump_ = true; 275 captured_dump_ = true;
276 276
277 if (main_window_->web_contents()->GetContentsMimeType() == "text/plain") {
278 dump_as_text_ = true;
279 enable_pixel_dumping_ = false;
280 }
281
277 RenderViewHost* render_view_host = 282 RenderViewHost* render_view_host =
278 main_window_->web_contents()->GetRenderViewHost(); 283 main_window_->web_contents()->GetRenderViewHost();
279 284
280 render_view_host->Send(new ShellViewMsg_CaptureTextDump( 285 render_view_host->Send(new ShellViewMsg_CaptureTextDump(
281 render_view_host->GetRoutingID(), 286 render_view_host->GetRoutingID(),
282 dump_as_text_, 287 dump_as_text_,
283 is_printing_, 288 is_printing_,
284 dump_child_frames_)); 289 dump_child_frames_));
285 if (!dump_as_text_ && enable_pixel_dumping_) { 290 if (!dump_as_text_ && enable_pixel_dumping_) {
286 render_view_host->Send(new ShellViewMsg_CaptureImageDump( 291 render_view_host->Send(new ShellViewMsg_CaptureImageDump(
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 433
429 void WebKitTestController::OnNotImplemented( 434 void WebKitTestController::OnNotImplemented(
430 const std::string& object_name, 435 const std::string& object_name,
431 const std::string& property_name) { 436 const std::string& property_name) {
432 printer_->AddErrorMessage( 437 printer_->AddErrorMessage(
433 std::string("FAIL: NOT IMPLEMENTED: ") + 438 std::string("FAIL: NOT IMPLEMENTED: ") +
434 object_name + "." + property_name); 439 object_name + "." + property_name);
435 } 440 }
436 441
437 } // namespace content 442 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698