| 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/layout_test/blink_test_runner.h" | 5 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <clocale> | 10 #include <clocale> |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // Tests in web-platform-tests use absolute path links such as | 206 // Tests in web-platform-tests use absolute path links such as |
| 207 // <script src="/resources/testharness.js">. | 207 // <script src="/resources/testharness.js">. |
| 208 // Because we load the tests as local files, such links don't work. | 208 // Because we load the tests as local files, such links don't work. |
| 209 // This function fixes this issue by rewriting file: URLs which were produced | 209 // This function fixes this issue by rewriting file: URLs which were produced |
| 210 // from such links so that they point actual files in wpt/. | 210 // from such links so that they point actual files in wpt/. |
| 211 WebURL RewriteAbsolutePathInWPT(const std::string& utf8_url) { | 211 WebURL RewriteAbsolutePathInWPT(const std::string& utf8_url) { |
| 212 const char kFileScheme[] = "file:///"; | 212 const char kFileScheme[] = "file:///"; |
| 213 const int kFileSchemeLen = arraysize(kFileScheme) - 1; | 213 const int kFileSchemeLen = arraysize(kFileScheme) - 1; |
| 214 if (utf8_url.compare(0, kFileSchemeLen, kFileScheme, kFileSchemeLen) != 0) | 214 if (utf8_url.compare(0, kFileSchemeLen, kFileScheme, kFileSchemeLen) != 0) |
| 215 return WebURL(); | 215 return WebURL(); |
| 216 if (utf8_url.find("/LayoutTests/") != std::string::npos) |
| 217 return WebURL(); |
| 216 #if defined(OS_WIN) | 218 #if defined(OS_WIN) |
| 217 // +3 for a drive letter, :, and /. | 219 // +3 for a drive letter, :, and /. |
| 218 const int kFileSchemeAndDriveLen = kFileSchemeLen + 3; | 220 const int kFileSchemeAndDriveLen = kFileSchemeLen + 3; |
| 219 if (utf8_url.size() <= kFileSchemeAndDriveLen) | 221 if (utf8_url.size() <= kFileSchemeAndDriveLen) |
| 220 return WebURL(); | 222 return WebURL(); |
| 221 std::string path = utf8_url.substr(kFileSchemeAndDriveLen); | 223 std::string path = utf8_url.substr(kFileSchemeAndDriveLen); |
| 222 #else | 224 #else |
| 223 std::string path = utf8_url.substr(kFileSchemeLen); | 225 std::string path = utf8_url.substr(kFileSchemeLen); |
| 224 #endif | 226 #endif |
| 225 // LayoutTests use file: URLs in various ways. | 227 // LayoutTests use file: URLs in various ways. |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 get_bluetooth_events_callbacks_.pop_front(); | 1001 get_bluetooth_events_callbacks_.pop_front(); |
| 1000 callback.Run(events); | 1002 callback.Run(events); |
| 1001 } | 1003 } |
| 1002 | 1004 |
| 1003 void BlinkTestRunner::ReportLeakDetectionResult( | 1005 void BlinkTestRunner::ReportLeakDetectionResult( |
| 1004 const LeakDetectionResult& report) { | 1006 const LeakDetectionResult& report) { |
| 1005 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 1007 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
| 1006 } | 1008 } |
| 1007 | 1009 |
| 1008 } // namespace content | 1010 } // namespace content |
| OLD | NEW |