| 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 10 matching lines...) Expand all Loading... |
| 21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
| 22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 23 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
| 24 #include "content/public/common/url_constants.h" | 24 #include "content/public/common/url_constants.h" |
| 25 #include "content/public/renderer/history_item_serialization.h" | 25 #include "content/public/renderer/history_item_serialization.h" |
| 26 #include "content/public/renderer/render_view.h" | 26 #include "content/public/renderer/render_view.h" |
| 27 #include "content/public/renderer/render_view_visitor.h" | 27 #include "content/public/renderer/render_view_visitor.h" |
| 28 #include "content/public/test/layouttest_support.h" | 28 #include "content/public/test/layouttest_support.h" |
| 29 #include "content/shell/common/shell_messages.h" | 29 #include "content/shell/common/shell_messages.h" |
| 30 #include "content/shell/common/webkit_test_helpers.h" | 30 #include "content/shell/common/webkit_test_helpers.h" |
| 31 #include "content/shell/renderer/gc_controller.h" |
| 31 #include "content/shell/renderer/shell_render_process_observer.h" | 32 #include "content/shell/renderer/shell_render_process_observer.h" |
| 32 #include "content/shell/renderer/test_runner/WebTask.h" | 33 #include "content/shell/renderer/test_runner/WebTask.h" |
| 33 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 34 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
| 34 #include "content/shell/renderer/test_runner/WebTestProxy.h" | 35 #include "content/shell/renderer/test_runner/WebTestProxy.h" |
| 35 #include "content/shell/renderer/test_runner/WebTestRunner.h" | 36 #include "content/shell/renderer/test_runner/WebTestRunner.h" |
| 36 #include "net/base/net_errors.h" | 37 #include "net/base/net_errors.h" |
| 37 #include "net/base/net_util.h" | 38 #include "net/base/net_util.h" |
| 38 #include "skia/ext/platform_canvas.h" | 39 #include "skia/ext/platform_canvas.h" |
| 39 #include "third_party/WebKit/public/platform/Platform.h" | 40 #include "third_party/WebKit/public/platform/Platform.h" |
| 40 #include "third_party/WebKit/public/platform/WebCString.h" | 41 #include "third_party/WebKit/public/platform/WebCString.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 PageStateToHistoryItem(session_histories_[pos][entry]); | 539 PageStateToHistoryItem(session_histories_[pos][entry]); |
| 539 } | 540 } |
| 540 history->swap(result); | 541 history->swap(result); |
| 541 } | 542 } |
| 542 | 543 |
| 543 // RenderViewObserver -------------------------------------------------------- | 544 // RenderViewObserver -------------------------------------------------------- |
| 544 | 545 |
| 545 void WebKitTestRunner::DidClearWindowObject(WebFrame* frame, int world_id) { | 546 void WebKitTestRunner::DidClearWindowObject(WebFrame* frame, int world_id) { |
| 546 WebTestingSupport::injectInternalsObject(frame); | 547 WebTestingSupport::injectInternalsObject(frame); |
| 547 ShellRenderProcessObserver::GetInstance()->test_interfaces()->bindTo(frame); | 548 ShellRenderProcessObserver::GetInstance()->test_interfaces()->bindTo(frame); |
| 549 if (world_id == 0) |
| 550 GCController::Install(frame); |
| 548 } | 551 } |
| 549 | 552 |
| 550 bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) { | 553 bool WebKitTestRunner::OnMessageReceived(const IPC::Message& message) { |
| 551 bool handled = true; | 554 bool handled = true; |
| 552 IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message) | 555 IPC_BEGIN_MESSAGE_MAP(WebKitTestRunner, message) |
| 553 IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, | 556 IPC_MESSAGE_HANDLER(ShellViewMsg_SetTestConfiguration, |
| 554 OnSetTestConfiguration) | 557 OnSetTestConfiguration) |
| 555 IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory) | 558 IPC_MESSAGE_HANDLER(ShellViewMsg_SessionHistory, OnSessionHistory) |
| 556 IPC_MESSAGE_HANDLER(ShellViewMsg_Reset, OnReset) | 559 IPC_MESSAGE_HANDLER(ShellViewMsg_Reset, OnReset) |
| 557 IPC_MESSAGE_HANDLER(ShellViewMsg_NotifyDone, OnNotifyDone) | 560 IPC_MESSAGE_HANDLER(ShellViewMsg_NotifyDone, OnNotifyDone) |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 WebURLRequest(GURL(kAboutBlankURL))); | 697 WebURLRequest(GURL(kAboutBlankURL))); |
| 695 Send(new ShellViewHostMsg_ResetDone(routing_id())); | 698 Send(new ShellViewHostMsg_ResetDone(routing_id())); |
| 696 } | 699 } |
| 697 | 700 |
| 698 void WebKitTestRunner::OnNotifyDone() { | 701 void WebKitTestRunner::OnNotifyDone() { |
| 699 render_view()->GetWebView()->mainFrame()->executeScript( | 702 render_view()->GetWebView()->mainFrame()->executeScript( |
| 700 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); | 703 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); |
| 701 } | 704 } |
| 702 | 705 |
| 703 } // namespace content | 706 } // namespace content |
| OLD | NEW |