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 26 matching lines...) Expand all Loading... |
37 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" | 37 #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" |
38 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" | 38 #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" |
39 #include "third_party/WebKit/WebKit/chromium/public/WebScriptController.h" | 39 #include "third_party/WebKit/WebKit/chromium/public/WebScriptController.h" |
40 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" | 40 #include "third_party/WebKit/WebKit/chromium/public/WebRect.h" |
41 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" | 41 #include "third_party/WebKit/WebKit/chromium/public/WebSize.h" |
42 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" | 42 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
43 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" | 43 #include "third_party/WebKit/WebKit/chromium/public/WebURL.h" |
44 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" | 44 #include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h" |
45 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" | 45 #include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h" |
46 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" | 46 #include "third_party/WebKit/WebKit/chromium/public/WebView.h" |
47 #include "webkit/blob/blob_storage_controller.h" | |
48 #include "webkit/blob/blob_url_request_job.h" | |
49 #include "webkit/glue/glue_serialize.h" | 47 #include "webkit/glue/glue_serialize.h" |
50 #include "webkit/glue/webkit_glue.h" | 48 #include "webkit/glue/webkit_glue.h" |
51 #include "webkit/glue/webpreferences.h" | 49 #include "webkit/glue/webpreferences.h" |
52 #include "webkit/tools/test_shell/accessibility_controller.h" | 50 #include "webkit/tools/test_shell/accessibility_controller.h" |
53 #include "webkit/tools/test_shell/notification_presenter.h" | 51 #include "webkit/tools/test_shell/notification_presenter.h" |
54 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 52 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
55 #include "webkit/tools/test_shell/test_navigation_controller.h" | 53 #include "webkit/tools/test_shell/test_navigation_controller.h" |
56 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" | 54 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" |
57 #include "webkit/tools/test_shell/test_shell_devtools_client.h" | 55 #include "webkit/tools/test_shell/test_shell_devtools_client.h" |
58 #include "webkit/tools/test_shell/test_shell_request_context.h" | 56 #include "webkit/tools/test_shell/test_shell_request_context.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 95 |
98 private: | 96 private: |
99 URLRequestTestShellFileJob(URLRequest* request, const FilePath& path) | 97 URLRequestTestShellFileJob(URLRequest* request, const FilePath& path) |
100 : URLRequestFileJob(request, path) { | 98 : URLRequestFileJob(request, path) { |
101 } | 99 } |
102 virtual ~URLRequestTestShellFileJob() { } | 100 virtual ~URLRequestTestShellFileJob() { } |
103 | 101 |
104 DISALLOW_COPY_AND_ASSIGN(URLRequestTestShellFileJob); | 102 DISALLOW_COPY_AND_ASSIGN(URLRequestTestShellFileJob); |
105 }; | 103 }; |
106 | 104 |
107 URLRequestJob* BlobURLRequestJobFactory(URLRequest* request, | |
108 const std::string& scheme) { | |
109 webkit_blob::BlobStorageController* blob_storage_controller = | |
110 static_cast<TestShellRequestContext*>(request->context())-> | |
111 blob_storage_controller(); | |
112 return new webkit_blob::BlobURLRequestJob( | |
113 request, | |
114 blob_storage_controller->GetBlobDataFromUrl(request->url()), | |
115 NULL); | |
116 } | |
117 | 105 |
118 } // namespace | 106 } // namespace |
119 | 107 |
120 // Initialize static member variable | 108 // Initialize static member variable |
121 WindowList* TestShell::window_list_; | 109 WindowList* TestShell::window_list_; |
122 WebPreferences* TestShell::web_prefs_ = NULL; | 110 WebPreferences* TestShell::web_prefs_ = NULL; |
123 bool TestShell::developer_extras_enabled_ = false; | 111 bool TestShell::developer_extras_enabled_ = false; |
124 bool TestShell::layout_test_mode_ = false; | 112 bool TestShell::layout_test_mode_ = false; |
125 bool TestShell::allow_external_pages_ = false; | 113 bool TestShell::allow_external_pages_ = false; |
126 int TestShell::file_test_timeout_ms_ = kDefaultFileTestTimeoutMillisecs; | 114 int TestShell::file_test_timeout_ms_ = kDefaultFileTestTimeoutMillisecs; |
(...skipping 24 matching lines...) Expand all Loading... |
151 plain_text_controller_.reset(new PlainTextController(this)); | 139 plain_text_controller_.reset(new PlainTextController(this)); |
152 text_input_controller_.reset(new TextInputController(this)); | 140 text_input_controller_.reset(new TextInputController(this)); |
153 navigation_controller_.reset(new TestNavigationController(this)); | 141 navigation_controller_.reset(new TestNavigationController(this)); |
154 notification_presenter_.reset(new TestNotificationPresenter(this)); | 142 notification_presenter_.reset(new TestNotificationPresenter(this)); |
155 | 143 |
156 URLRequestFilter* filter = URLRequestFilter::GetInstance(); | 144 URLRequestFilter* filter = URLRequestFilter::GetInstance(); |
157 filter->AddHostnameHandler("test-shell-resource", "inspector", | 145 filter->AddHostnameHandler("test-shell-resource", "inspector", |
158 &URLRequestTestShellFileJob::InspectorFactory); | 146 &URLRequestTestShellFileJob::InspectorFactory); |
159 url_util::AddStandardScheme("test-shell-resource"); | 147 url_util::AddStandardScheme("test-shell-resource"); |
160 | 148 |
161 URLRequest::RegisterProtocolFactory("blob", &BlobURLRequestJobFactory); | |
162 | |
163 if (!file_system_root_.CreateUniqueTempDir()) { | 149 if (!file_system_root_.CreateUniqueTempDir()) { |
164 LOG(WARNING) << "Failed to create a temp dir for the filesystem." | 150 LOG(WARNING) << "Failed to create a temp dir for the filesystem." |
165 "FileSystem feature will be disabled."; | 151 "FileSystem feature will be disabled."; |
166 DCHECK(file_system_root_.path().empty()); | 152 DCHECK(file_system_root_.path().empty()); |
167 } | 153 } |
168 } | 154 } |
169 | 155 |
170 TestShell::~TestShell() { | 156 TestShell::~TestShell() { |
171 delegate_->RevokeDragDrop(); | 157 delegate_->RevokeDragDrop(); |
172 | 158 |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 return -1; | 837 return -1; |
852 } | 838 } |
853 | 839 |
854 bool GetFontTable(int fd, uint32_t table, uint8_t* output, | 840 bool GetFontTable(int fd, uint32_t table, uint8_t* output, |
855 size_t* output_length) { | 841 size_t* output_length) { |
856 return false; | 842 return false; |
857 } | 843 } |
858 #endif | 844 #endif |
859 | 845 |
860 } // namespace webkit_glue | 846 } // namespace webkit_glue |
OLD | NEW |