| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 const char kPrefix[] = "file:///tmp/LayoutTests/"; | 302 const char kPrefix[] = "file:///tmp/LayoutTests/"; |
| 303 const int kPrefixLen = arraysize(kPrefix) - 1; | 303 const int kPrefixLen = arraysize(kPrefix) - 1; |
| 304 | 304 |
| 305 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen)) | 305 if (utf8_url.compare(0, kPrefixLen, kPrefix, kPrefixLen)) |
| 306 return WebURL(GURL(utf8_url)); | 306 return WebURL(GURL(utf8_url)); |
| 307 | 307 |
| 308 base::FilePath replace_path = | 308 base::FilePath replace_path = |
| 309 ShellRenderProcessObserver::GetInstance()->webkit_source_dir().Append( | 309 ShellRenderProcessObserver::GetInstance()->webkit_source_dir().Append( |
| 310 FILE_PATH_LITERAL("LayoutTests/")); | 310 FILE_PATH_LITERAL("LayoutTests/")); |
| 311 #if defined(OS_WIN) | 311 #if defined(OS_WIN) |
| 312 std::string utf8_path = WideToUTF8(replace_path.value()); | 312 std::string utf8_path = base::WideToUTF8(replace_path.value()); |
| 313 #else | 313 #else |
| 314 std::string utf8_path = | 314 std::string utf8_path = |
| 315 WideToUTF8(base::SysNativeMBToWide(replace_path.value())); | 315 base::WideToUTF8(base::SysNativeMBToWide(replace_path.value())); |
| 316 #endif | 316 #endif |
| 317 std::string new_url = | 317 std::string new_url = |
| 318 std::string("file://") + utf8_path + utf8_url.substr(kPrefixLen); | 318 std::string("file://") + utf8_path + utf8_url.substr(kPrefixLen); |
| 319 return WebURL(GURL(new_url)); | 319 return WebURL(GURL(new_url)); |
| 320 } | 320 } |
| 321 | 321 |
| 322 WebTestRunner::WebPreferences* WebKitTestRunner::preferences() { | 322 WebTestRunner::WebPreferences* WebKitTestRunner::preferences() { |
| 323 return &prefs_; | 323 return &prefs_; |
| 324 } | 324 } |
| 325 | 325 |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 WebURLRequest(GURL(kAboutBlankURL))); | 694 WebURLRequest(GURL(kAboutBlankURL))); |
| 695 Send(new ShellViewHostMsg_ResetDone(routing_id())); | 695 Send(new ShellViewHostMsg_ResetDone(routing_id())); |
| 696 } | 696 } |
| 697 | 697 |
| 698 void WebKitTestRunner::OnNotifyDone() { | 698 void WebKitTestRunner::OnNotifyDone() { |
| 699 render_view()->GetWebView()->mainFrame()->executeScript( | 699 render_view()->GetWebView()->mainFrame()->executeScript( |
| 700 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); | 700 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); |
| 701 } | 701 } |
| 702 | 702 |
| 703 } // namespace content | 703 } // namespace content |
| OLD | NEW |