diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 21:41:06 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 21:41:06 +0000 |
commit | ea6e6cf0f3aa1e0ec2ea9ddbbebbb272e9bbc019 (patch) | |
tree | 12b2ccd788a66bff01b816bf7c792e349f21920d /webkit | |
parent | e6da7c850491960c5fe7dcf737db19d49c00784d (diff) | |
download | chromium_src-ea6e6cf0f3aa1e0ec2ea9ddbbebbb272e9bbc019.zip chromium_src-ea6e6cf0f3aa1e0ec2ea9ddbbebbb272e9bbc019.tar.gz chromium_src-ea6e6cf0f3aa1e0ec2ea9ddbbebbb272e9bbc019.tar.bz2 |
Prepend protocol on file URLs in test shell gtk.
Review URL: http://codereview.chromium.org/9624
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/tools/test_shell/SConscript | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell_gtk.cc | 27 |
2 files changed, 19 insertions, 10 deletions
diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript index 02b4cb5..3b608552 100644 --- a/webkit/tools/test_shell/SConscript +++ b/webkit/tools/test_shell/SConscript @@ -164,6 +164,7 @@ test_files = [ '$WEBKIT_DIR/glue/cpp_bound_class_unittest.cc', '$WEBKIT_DIR/glue/cpp_variant_unittest.cc', '$WEBKIT_DIR/glue/glue_serialize_unittest.cc', + '$WEBKIT_DIR/glue/iframe_redirect_unittest.cc', '$WEBKIT_DIR/glue/multipart_response_delegate_unittest.cc', '$WEBKIT_DIR/glue/password_autocomplete_listener_unittest.cc', '$WEBKIT_DIR/glue/regular_expression_unittest.cc', @@ -179,7 +180,6 @@ if env['PLATFORM'] == 'win32': '$WEBKIT_DIR/glue/context_menu_unittest.cc', '$WEBKIT_DIR/glue/dom_operations_unittest.cc', '$WEBKIT_DIR/glue/dom_serializer_unittest.cc', - '$WEBKIT_DIR/glue/iframe_redirect_unittest.cc', '$WEBKIT_DIR/glue/mimetype_unittest.cc', '$WEBKIT_DIR/glue/resource_fetcher_unittest.cc', # Commented out until a regression is fixed and this file is restored. diff --git a/webkit/tools/test_shell/test_shell_gtk.cc b/webkit/tools/test_shell/test_shell_gtk.cc index 2fb2d2c..ee3c6ed 100644 --- a/webkit/tools/test_shell/test_shell_gtk.cc +++ b/webkit/tools/test_shell/test_shell_gtk.cc @@ -15,6 +15,7 @@ #include "base/path_service.h" #include "base/string_util.h" #include "net/base/mime_util.h" +#include "net/base/net_util.h" #include "webkit/glue/plugins/plugin_list.h" #include "webkit/glue/resource_loader_bridge.h" #include "webkit/glue/webdatasource.h" @@ -335,18 +336,26 @@ void TestShell::ResizeSubViews() { void TestShell::LoadURLForFrame(const wchar_t* url, const wchar_t* frame_name) { - if (!url) - return; + if (!url) + return; + + std::wstring frame_string; + if (frame_name) + frame_string = frame_name; - std::wstring frame_string; - if (frame_name) - frame_string = frame_name; + LOG(INFO) << "Loading " << WideToUTF8(url) << " in frame '" + << WideToUTF8(frame_string) << "'"; - LOG(INFO) << "Loading " << WideToUTF8(url) << " in frame '" - << WideToUTF8(frame_string) << "'"; + GURL gurl; + // PathExists will reject any string with no leading '/' + // as well as empty strings. + if (file_util::PathExists(url)) + gurl = net::FilePathToFileURL(url); + else + gurl = GURL(WideToUTF8(url)); - navigation_controller_->LoadEntry(new TestNavigationEntry( - -1, GURL(WideToUTF8(url)), std::wstring(), frame_string)); + navigation_controller_->LoadEntry(new TestNavigationEntry( + -1, gurl, std::wstring(), frame_string)); } static void WriteTextToFile(const std::wstring& data, |