OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |