| 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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 if (resource.find("/tmp/") == 0) { | 474 if (resource.find("/tmp/") == 0) { |
| 475 // We want a temp file. | 475 // We want a temp file. |
| 476 GURL base_url = net::FilePathToFileURL(test_config_.temp_path); | 476 GURL base_url = net::FilePathToFileURL(test_config_.temp_path); |
| 477 return base_url.Resolve(resource.substr(strlen("/tmp/"))).spec(); | 477 return base_url.Resolve(resource.substr(strlen("/tmp/"))).spec(); |
| 478 } | 478 } |
| 479 #endif | 479 #endif |
| 480 | 480 |
| 481 // Some layout tests use file://// which we resolve as a UNC path. Normalize | 481 // Some layout tests use file://// which we resolve as a UNC path. Normalize |
| 482 // them to just file:///. | 482 // them to just file:///. |
| 483 std::string result = resource; | 483 std::string result = resource; |
| 484 while (StringToLowerASCII(result).find("file:////") == 0) { | 484 while (base::StringToLowerASCII(result).find("file:////") == 0) { |
| 485 result = result.substr(0, strlen("file:///")) + | 485 result = result.substr(0, strlen("file:///")) + |
| 486 result.substr(strlen("file:////")); | 486 result.substr(strlen("file:////")); |
| 487 } | 487 } |
| 488 return rewriteLayoutTestsURL(result).spec(); | 488 return rewriteLayoutTestsURL(result).spec(); |
| 489 } | 489 } |
| 490 | 490 |
| 491 void WebKitTestRunner::setLocale(const std::string& locale) { | 491 void WebKitTestRunner::setLocale(const std::string& locale) { |
| 492 setlocale(LC_ALL, locale.c_str()); | 492 setlocale(LC_ALL, locale.c_str()); |
| 493 } | 493 } |
| 494 | 494 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 | 742 |
| 743 leak_detector_->TryLeakDetection(main_frame); | 743 leak_detector_->TryLeakDetection(main_frame); |
| 744 } | 744 } |
| 745 | 745 |
| 746 void WebKitTestRunner::ReportLeakDetectionResult( | 746 void WebKitTestRunner::ReportLeakDetectionResult( |
| 747 const LeakDetectionResult& report) { | 747 const LeakDetectionResult& report) { |
| 748 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); | 748 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); |
| 749 } | 749 } |
| 750 | 750 |
| 751 } // namespace content | 751 } // namespace content |
| OLD | NEW |