summaryrefslogtreecommitdiffstats
path: root/content/shell
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-15 17:27:46 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-15 17:27:46 +0000
commit59a11431bd657f21803240794da5e798a2b8266e (patch)
treeb781d360f5c713a101d4e94e644a925fabab119f /content/shell
parenta9727940f8a5dbd0c470b0178fc6a9f19d417c5a (diff)
downloadchromium_src-59a11431bd657f21803240794da5e798a2b8266e.zip
chromium_src-59a11431bd657f21803240794da5e798a2b8266e.tar.gz
chromium_src-59a11431bd657f21803240794da5e798a2b8266e.tar.bz2
Reland r161839 - [content shell] don't use webkit_support functions to manipulate URLs
In single-process mode, WebKit isn't yet initialized before we start a renderer, so we can't pass around WebURLs BUG=111316 TEST=content_shell --dump-render-tree --single-process doesn't crash Review URL: https://codereview.chromium.org/11137015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161879 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell')
-rw-r--r--content/shell/shell_browser_main.cc20
1 files changed, 17 insertions, 3 deletions
diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc
index a19005d..499b9b3 100644
--- a/content/shell/shell_browser_main.cc
+++ b/content/shell/shell_browser_main.cc
@@ -7,12 +7,16 @@
#include <iostream>
#include "base/command_line.h"
+#include "base/file_path.h"
+#include "base/file_util.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/sys_string_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/shell/shell_switches.h"
#include "content/shell/webkit_test_runner_host.h"
+#include "net/base/net_util.h"
#include "webkit/support/webkit_support.h"
namespace {
@@ -40,11 +44,21 @@ GURL GetURLForLayoutTest(const char* test_name,
}
if (expected_pixel_hash)
*expected_pixel_hash = pixel_hash;
- GURL test_url = webkit_support::CreateURLForPathOrURL(path_or_url);
- {
+ GURL test_url(path_or_url);
+ if (!(test_url.is_valid() && test_url.has_scheme())) {
+#if defined(OS_WIN)
+ std::wstring wide_path_or_url =
+ base::SysNativeMBToWide(path_or_url);
+ test_url = net::FilePathToFileURL(FilePath(wide_path_or_url));
+#else
+ test_url = net::FilePathToFileURL(FilePath(path_or_url));
+#endif
+ }
+ FilePath local_path;
+ if (net::FileURLToFilePath(test_url, &local_path)) {
// We're outside of the message loop here, and this is a test.
base::ThreadRestrictions::ScopedAllowIO allow_io;
- webkit_support::SetCurrentDirectoryForFileURL(test_url);
+ file_util::SetCurrentDirectory(local_path.DirName());
}
return test_url;
}