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 #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" |
11 #include "base/debug/debug_on_start_win.h" | 11 #include "base/debug/debug_on_start_win.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/md5.h" | 14 #include "base/md5.h" |
15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
16 #include "base/metrics/stats_table.h" | 16 #include "base/metrics/stats_table.h" |
17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
21 #include "googleurl/src/url_util.h" | 21 #include "googleurl/src/url_util.h" |
22 #include "grit/webkit_strings.h" | 22 #include "grit/webkit_strings.h" |
23 #include "net/base/mime_util.h" | 23 #include "net/base/mime_util.h" |
24 #include "net/base/net_util.h" | 24 #include "net/base/net_util.h" |
| 25 #include "net/url_request/url_request.h" |
25 #include "net/url_request/url_request_file_job.h" | 26 #include "net/url_request/url_request_file_job.h" |
26 #include "net/url_request/url_request_filter.h" | 27 #include "net/url_request/url_request_filter.h" |
27 #include "skia/ext/bitmap_platform_device.h" | 28 #include "skia/ext/bitmap_platform_device.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
29 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationC
lientMock.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDeviceOrientationC
lientMock.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationClientM
ock.h" | 33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebGeolocationClientM
ock.h" |
33 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
34 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 35 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const int kTestWindowHeight = 600; | 76 const int kTestWindowHeight = 600; |
76 | 77 |
77 // The W3C SVG layout tests use a different size than the other layout | 78 // The W3C SVG layout tests use a different size than the other layout |
78 // tests. | 79 // tests. |
79 const int kSVGTestWindowWidth = 480; | 80 const int kSVGTestWindowWidth = 480; |
80 const int kSVGTestWindowHeight = 360; | 81 const int kSVGTestWindowHeight = 360; |
81 | 82 |
82 // URLRequestTestShellFileJob is used to serve the inspector | 83 // URLRequestTestShellFileJob is used to serve the inspector |
83 class URLRequestTestShellFileJob : public net::URLRequestFileJob { | 84 class URLRequestTestShellFileJob : public net::URLRequestFileJob { |
84 public: | 85 public: |
85 static net::URLRequestJob* InspectorFactory(net::URLRequest* request, | 86 static net::URLRequestJob* InspectorFactory( |
86 const std::string& scheme) { | 87 net::URLRequest* request, |
| 88 net::NetworkDelegate* network_delegate, |
| 89 const std::string& scheme) { |
87 FilePath path; | 90 FilePath path; |
88 PathService::Get(base::DIR_EXE, &path); | 91 PathService::Get(base::DIR_EXE, &path); |
89 path = path.AppendASCII("resources"); | 92 path = path.AppendASCII("resources"); |
90 path = path.AppendASCII("inspector"); | 93 path = path.AppendASCII("inspector"); |
91 path = path.AppendASCII(request->url().path().substr(1)); | 94 path = path.AppendASCII(request->url().path().substr(1)); |
92 return new URLRequestTestShellFileJob(request, path); | 95 return new URLRequestTestShellFileJob(request, network_delegate, path); |
93 } | 96 } |
94 | 97 |
95 private: | 98 private: |
96 URLRequestTestShellFileJob(net::URLRequest* request, const FilePath& path) | 99 URLRequestTestShellFileJob(net::URLRequest* request, |
97 : net::URLRequestFileJob(request, | 100 net::NetworkDelegate* network_delegate, |
98 path, | 101 const FilePath& path) |
99 request->context()->network_delegate()) { | 102 : net::URLRequestFileJob(request, network_delegate, path) { |
100 } | 103 } |
101 virtual ~URLRequestTestShellFileJob() { } | 104 virtual ~URLRequestTestShellFileJob() { } |
102 | 105 |
103 DISALLOW_COPY_AND_ASSIGN(URLRequestTestShellFileJob); | 106 DISALLOW_COPY_AND_ASSIGN(URLRequestTestShellFileJob); |
104 }; | 107 }; |
105 | 108 |
106 | 109 |
107 } // namespace | 110 } // namespace |
108 | 111 |
109 // Initialize static member variable | 112 // Initialize static member variable |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 return device_orientation_client_mock_.get(); | 616 return device_orientation_client_mock_.get(); |
614 } | 617 } |
615 | 618 |
616 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { | 619 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { |
617 if (!geolocation_client_mock_.get()) { | 620 if (!geolocation_client_mock_.get()) { |
618 geolocation_client_mock_.reset( | 621 geolocation_client_mock_.reset( |
619 WebKit::WebGeolocationClientMock::create()); | 622 WebKit::WebGeolocationClientMock::create()); |
620 } | 623 } |
621 return geolocation_client_mock_.get(); | 624 return geolocation_client_mock_.get(); |
622 } | 625 } |
OLD | NEW |