OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #undef LOG | 5 #undef LOG |
6 | 6 |
7 #include "webkit/tools/test_shell/test_shell.h" | 7 #include "webkit/tools/test_shell/test_shell.h" |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" | 39 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" |
40 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 40 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
41 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 41 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
42 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 42 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
43 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" | 43 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" |
44 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 44 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
45 #include "webkit/glue/glue_serialize.h" | 45 #include "webkit/glue/glue_serialize.h" |
46 #include "webkit/glue/webkit_glue.h" | 46 #include "webkit/glue/webkit_glue.h" |
47 #include "webkit/glue/webpreferences.h" | 47 #include "webkit/glue/webpreferences.h" |
48 #include "webkit/tools/test_shell/accessibility_controller.h" | 48 #include "webkit/tools/test_shell/accessibility_controller.h" |
| 49 #include "webkit/tools/test_shell/notification_presenter.h" |
49 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 50 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
50 #include "webkit/tools/test_shell/test_navigation_controller.h" | 51 #include "webkit/tools/test_shell/test_navigation_controller.h" |
51 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" | 52 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" |
52 #include "webkit/tools/test_shell/test_shell_devtools_client.h" | 53 #include "webkit/tools/test_shell/test_shell_devtools_client.h" |
53 #include "webkit/tools/test_shell/test_shell_switches.h" | 54 #include "webkit/tools/test_shell/test_shell_switches.h" |
54 #include "webkit/tools/test_shell/test_webview_delegate.h" | 55 #include "webkit/tools/test_shell/test_webview_delegate.h" |
55 | 56 |
56 using WebKit::WebCanvas; | 57 using WebKit::WebCanvas; |
57 using WebKit::WebFrame; | 58 using WebKit::WebFrame; |
58 using WebKit::WebNavigationPolicy; | 59 using WebKit::WebNavigationPolicy; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 allow_scripts_(true), | 128 allow_scripts_(true), |
128 dump_stats_table_on_exit_(false) { | 129 dump_stats_table_on_exit_(false) { |
129 accessibility_controller_.reset(new AccessibilityController(this)); | 130 accessibility_controller_.reset(new AccessibilityController(this)); |
130 delegate_.reset(new TestWebViewDelegate(this)); | 131 delegate_.reset(new TestWebViewDelegate(this)); |
131 popup_delegate_.reset(new TestWebViewDelegate(this)); | 132 popup_delegate_.reset(new TestWebViewDelegate(this)); |
132 layout_test_controller_.reset(new LayoutTestController(this)); | 133 layout_test_controller_.reset(new LayoutTestController(this)); |
133 event_sending_controller_.reset(new EventSendingController(this)); | 134 event_sending_controller_.reset(new EventSendingController(this)); |
134 plain_text_controller_.reset(new PlainTextController(this)); | 135 plain_text_controller_.reset(new PlainTextController(this)); |
135 text_input_controller_.reset(new TextInputController(this)); | 136 text_input_controller_.reset(new TextInputController(this)); |
136 navigation_controller_.reset(new TestNavigationController(this)); | 137 navigation_controller_.reset(new TestNavigationController(this)); |
| 138 notification_presenter_.reset(new TestNotificationPresenter(this)); |
137 | 139 |
138 URLRequestFilter* filter = URLRequestFilter::GetInstance(); | 140 URLRequestFilter* filter = URLRequestFilter::GetInstance(); |
139 filter->AddHostnameHandler("test-shell-resource", "inspector", | 141 filter->AddHostnameHandler("test-shell-resource", "inspector", |
140 &URLRequestTestShellFileJob::InspectorFactory); | 142 &URLRequestTestShellFileJob::InspectorFactory); |
141 url_util::AddStandardScheme("test-shell-resource"); | 143 url_util::AddStandardScheme("test-shell-resource"); |
142 } | 144 } |
143 | 145 |
144 TestShell::~TestShell() { | 146 TestShell::~TestShell() { |
145 delegate_->RevokeDragDrop(); | 147 delegate_->RevokeDragDrop(); |
146 | 148 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 } | 618 } |
617 | 619 |
618 void TestShell::SizeToDefault() { | 620 void TestShell::SizeToDefault() { |
619 SizeTo(kTestWindowWidth, kTestWindowHeight); | 621 SizeTo(kTestWindowWidth, kTestWindowHeight); |
620 } | 622 } |
621 | 623 |
622 void TestShell::ResetTestController() { | 624 void TestShell::ResetTestController() { |
623 accessibility_controller_->Reset(); | 625 accessibility_controller_->Reset(); |
624 layout_test_controller_->Reset(); | 626 layout_test_controller_->Reset(); |
625 event_sending_controller_->Reset(); | 627 event_sending_controller_->Reset(); |
| 628 notification_presenter_->Reset(); |
626 delegate_->Reset(); | 629 delegate_->Reset(); |
627 } | 630 } |
628 | 631 |
629 void TestShell::LoadFile(const FilePath& file) { | 632 void TestShell::LoadFile(const FilePath& file) { |
630 LoadURLForFrame(net::FilePathToFileURL(file), std::wstring()); | 633 LoadURLForFrame(net::FilePathToFileURL(file), std::wstring()); |
631 } | 634 } |
632 | 635 |
633 void TestShell::LoadURL(const GURL& url) { | 636 void TestShell::LoadURL(const GURL& url) { |
634 // Used as a sentinal for run_webkit_tests.py to know when to start reading | 637 // Used as a sentinal for run_webkit_tests.py to know when to start reading |
635 // test output for this test and so we know we're not getting out of sync. | 638 // test output for this test and so we know we're not getting out of sync. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 | 802 |
800 void SetCacheMode(bool enabled) { | 803 void SetCacheMode(bool enabled) { |
801 // Used in benchmarking, Ignored for test_shell. | 804 // Used in benchmarking, Ignored for test_shell. |
802 } | 805 } |
803 | 806 |
804 std::string GetProductVersion() { | 807 std::string GetProductVersion() { |
805 return std::string("Chrome/0.0.0.0"); | 808 return std::string("Chrome/0.0.0.0"); |
806 } | 809 } |
807 | 810 |
808 } // namespace webkit_glue | 811 } // namespace webkit_glue |
OLD | NEW |