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/renderer/webkit_test_runner.h" | 5 #include "content/shell/renderer/webkit_test_runner.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <clocale> | 8 #include <clocale> |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "content/shell/common/shell_messages.h" | 29 #include "content/shell/common/shell_messages.h" |
30 #include "content/shell/common/shell_switches.h" | 30 #include "content/shell/common/shell_switches.h" |
31 #include "content/shell/common/webkit_test_helpers.h" | 31 #include "content/shell/common/webkit_test_helpers.h" |
32 #include "content/shell/renderer/gc_controller.h" | 32 #include "content/shell/renderer/gc_controller.h" |
33 #include "content/shell/renderer/leak_detector.h" | 33 #include "content/shell/renderer/leak_detector.h" |
34 #include "content/shell/renderer/shell_render_process_observer.h" | 34 #include "content/shell/renderer/shell_render_process_observer.h" |
35 #include "content/shell/renderer/test_runner/WebTask.h" | 35 #include "content/shell/renderer/test_runner/WebTask.h" |
36 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 36 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
37 #include "content/shell/renderer/test_runner/WebTestProxy.h" | 37 #include "content/shell/renderer/test_runner/WebTestProxy.h" |
38 #include "content/shell/renderer/test_runner/WebTestRunner.h" | 38 #include "content/shell/renderer/test_runner/WebTestRunner.h" |
| 39 #include "content/shell/renderer/test_runner/text_input_controller.h" |
39 #include "net/base/net_errors.h" | 40 #include "net/base/net_errors.h" |
40 #include "net/base/net_util.h" | 41 #include "net/base/net_util.h" |
41 #include "skia/ext/platform_canvas.h" | 42 #include "skia/ext/platform_canvas.h" |
42 #include "third_party/WebKit/public/platform/Platform.h" | 43 #include "third_party/WebKit/public/platform/Platform.h" |
43 #include "third_party/WebKit/public/platform/WebCString.h" | 44 #include "third_party/WebKit/public/platform/WebCString.h" |
44 #include "third_party/WebKit/public/platform/WebPoint.h" | 45 #include "third_party/WebKit/public/platform/WebPoint.h" |
45 #include "third_party/WebKit/public/platform/WebRect.h" | 46 #include "third_party/WebKit/public/platform/WebRect.h" |
46 #include "third_party/WebKit/public/platform/WebSize.h" | 47 #include "third_party/WebKit/public/platform/WebSize.h" |
47 #include "third_party/WebKit/public/platform/WebString.h" | 48 #include "third_party/WebKit/public/platform/WebString.h" |
48 #include "third_party/WebKit/public/platform/WebURL.h" | 49 #include "third_party/WebKit/public/platform/WebURL.h" |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 PageStateToHistoryItem(session_histories_[pos][entry]); | 549 PageStateToHistoryItem(session_histories_[pos][entry]); |
549 } | 550 } |
550 history->swap(result); | 551 history->swap(result); |
551 } | 552 } |
552 | 553 |
553 // RenderViewObserver -------------------------------------------------------- | 554 // RenderViewObserver -------------------------------------------------------- |
554 | 555 |
555 void WebKitTestRunner::DidClearWindowObject(WebFrame* frame, int world_id) { | 556 void WebKitTestRunner::DidClearWindowObject(WebFrame* frame, int world_id) { |
556 WebTestingSupport::injectInternalsObject(frame); | 557 WebTestingSupport::injectInternalsObject(frame); |
557 ShellRenderProcessObserver::GetInstance()->test_interfaces()->bindTo(frame); | 558 ShellRenderProcessObserver::GetInstance()->test_interfaces()->bindTo(frame); |
558 if (world_id == 0) | 559 if (world_id == 0) { |
559 GCController::Install(frame); | 560 GCController::Install(frame); |
| 561 WebTestRunner::TextInputController::Install(frame); |
| 562 } |
560 } | 563 } |
561 | 564 |
562 bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) { | 565 bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) { |
563 bool handled = true; | 566 bool handled = true; |
564 IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message) | 567 IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message) |
565 IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, | 568 IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, |
566 OnSetTestConfiguration) | 569 OnSetTestConfiguration) |
567 IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory) | 570 IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory) |
568 IPC_MESSAGE_HANDLER(ShellViewMsg_Reset, OnReset) | 571 IPC_MESSAGE_HANDLER(ShellViewMsg_Reset, OnReset) |
569 IPC_MESSAGE_HANDLER(ShellViewMsg_NotifyDone, OnNotifyDone) | 572 IPC_MESSAGE_HANDLER(ShellViewMsg_NotifyDone, OnNotifyDone) |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); | 726 WebFrame* main_frame = render_view()->GetWebView()->mainFrame(); |
724 DCHECK_EQ(GURL(kAboutBlankURL), GURL(main_frame->document().url())); | 727 DCHECK_EQ(GURL(kAboutBlankURL), GURL(main_frame->document().url())); |
725 DCHECK(!main_frame->isLoading()); | 728 DCHECK(!main_frame->isLoading()); |
726 | 729 |
727 LeakDetectionResult result = leak_detector_->TryLeakDetection( | 730 LeakDetectionResult result = leak_detector_->TryLeakDetection( |
728 render_view()->GetWebView()->mainFrame()); | 731 render_view()->GetWebView()->mainFrame()); |
729 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), result)); | 732 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), result)); |
730 } | 733 } |
731 | 734 |
732 } // namespace content | 735 } // namespace content |
OLD | NEW |