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 "content/shell/renderer/test_runner/web_test_proxy.h" | 5 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
6 | 6 |
7 #include <cctype> | 7 #include <cctype> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "content/shell/renderer/test_runner/MockColorChooser.h" | 12 #include "content/shell/renderer/test_runner/MockColorChooser.h" |
13 #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h" | 13 #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h" |
14 #include "content/shell/renderer/test_runner/SpellCheckClient.h" | 14 #include "content/shell/renderer/test_runner/SpellCheckClient.h" |
15 #include "content/shell/renderer/test_runner/TestCommon.h" | 15 #include "content/shell/renderer/test_runner/TestCommon.h" |
16 #include "content/shell/renderer/test_runner/TestInterfaces.h" | 16 #include "content/shell/renderer/test_runner/TestInterfaces.h" |
17 #include "content/shell/renderer/test_runner/TestPlugin.h" | 17 #include "content/shell/renderer/test_runner/TestPlugin.h" |
18 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 18 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
19 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 19 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
20 #include "content/shell/renderer/test_runner/WebTestRunner.h" | |
21 #include "content/shell/renderer/test_runner/WebUserMediaClientMock.h" | 20 #include "content/shell/renderer/test_runner/WebUserMediaClientMock.h" |
22 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 21 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
23 #include "content/shell/renderer/test_runner/event_sender.h" | 22 #include "content/shell/renderer/test_runner/event_sender.h" |
24 #include "content/shell/renderer/test_runner/test_runner.h" | 23 #include "content/shell/renderer/test_runner/test_runner.h" |
| 24 #include "content/shell/renderer/test_runner/web_test_runner.h" |
25 // FIXME: Including platform_canvas.h here is a layering violation. | 25 // FIXME: Including platform_canvas.h here is a layering violation. |
26 #include "skia/ext/platform_canvas.h" | 26 #include "skia/ext/platform_canvas.h" |
27 #include "third_party/WebKit/public/platform/WebCString.h" | 27 #include "third_party/WebKit/public/platform/WebCString.h" |
28 #include "third_party/WebKit/public/platform/WebURLError.h" | 28 #include "third_party/WebKit/public/platform/WebURLError.h" |
29 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 29 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
30 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 30 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
31 #include "third_party/WebKit/public/web/WebAXEnums.h" | 31 #include "third_party/WebKit/public/web/WebAXEnums.h" |
32 #include "third_party/WebKit/public/web/WebAXObject.h" | 32 #include "third_party/WebKit/public/web/WebAXObject.h" |
33 #include "third_party/WebKit/public/web/WebCachedURLRequest.h" | 33 #include "third_party/WebKit/public/web/WebCachedURLRequest.h" |
34 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 34 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 test_interfaces_->testRunner()->shouldDumpChildFrameScrollPositions(); | 376 test_interfaces_->testRunner()->shouldDumpChildFrameScrollPositions(); |
377 WebFrame::RenderAsTextControls renderTextBehavior = | 377 WebFrame::RenderAsTextControls renderTextBehavior = |
378 WebFrame::RenderAsTextNormal; | 378 WebFrame::RenderAsTextNormal; |
379 if (shouldDumpAsPrinted) | 379 if (shouldDumpAsPrinted) |
380 renderTextBehavior |= WebFrame::RenderAsTextPrinting; | 380 renderTextBehavior |= WebFrame::RenderAsTextPrinting; |
381 if (debugRenderTree) renderTextBehavior |= WebFrame::RenderAsTextDebug; | 381 if (debugRenderTree) renderTextBehavior |= WebFrame::RenderAsTextDebug; |
382 dataUtf8 = frame->renderTreeAsText(renderTextBehavior).utf8(); | 382 dataUtf8 = frame->renderTreeAsText(renderTextBehavior).utf8(); |
383 dataUtf8 += dumpFrameScrollPosition(frame, recursive); | 383 dataUtf8 += dumpFrameScrollPosition(frame, recursive); |
384 } | 384 } |
385 | 385 |
386 if (test_interfaces_->testRunner()->shouldDumpBackForwardList()) | 386 if (test_interfaces_->testRunner()->ShouldDumpBackForwardList()) |
387 dataUtf8 += dumpAllBackForwardLists(test_interfaces_, delegate_); | 387 dataUtf8 += dumpAllBackForwardLists(test_interfaces_, delegate_); |
388 | 388 |
389 return dataUtf8; | 389 return dataUtf8; |
390 } | 390 } |
391 | 391 |
392 void WebTestProxyBase::DrawSelectionRect(SkCanvas* canvas) { | 392 void WebTestProxyBase::DrawSelectionRect(SkCanvas* canvas) { |
393 // See if we need to draw the selection bounds rect. Selection bounds | 393 // See if we need to draw the selection bounds rect. Selection bounds |
394 // rect is the rect enclosing the (possibly transformed) selection. | 394 // rect is the rect enclosing the (possibly transformed) selection. |
395 // The rect should be drawn after everything is laid out and painted. | 395 // The rect should be drawn after everything is laid out and painted. |
396 if (!test_interfaces_->testRunner()->shouldDumpSelectionRect()) return; | 396 if (!test_interfaces_->testRunner()->shouldDumpSelectionRect()) return; |
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 } | 1107 } |
1108 } | 1108 } |
1109 | 1109 |
1110 void WebTestProxyBase::ResetInputMethod() { | 1110 void WebTestProxyBase::ResetInputMethod() { |
1111 // If a composition text exists, then we need to let the browser process | 1111 // If a composition text exists, then we need to let the browser process |
1112 // to cancel the input method's ongoing composition session. | 1112 // to cancel the input method's ongoing composition session. |
1113 if (web_widget_) web_widget_->confirmComposition(); | 1113 if (web_widget_) web_widget_->confirmComposition(); |
1114 } | 1114 } |
1115 | 1115 |
1116 } // namespace content | 1116 } // namespace content |
OLD | NEW |