Index: webkit/tools/test_shell/test_shell_mac.mm |
=================================================================== |
--- webkit/tools/test_shell/test_shell_mac.mm (revision 25715) |
+++ webkit/tools/test_shell/test_shell_mac.mm (working copy) |
@@ -225,7 +225,7 @@ |
return button; |
} |
-bool TestShell::Initialize(const std::wstring& startingURL) { |
+bool TestShell::Initialize(const GURL& starting_url) { |
// Perform application initialization: |
// send message to app controller? need to work this out |
@@ -313,12 +313,10 @@ |
[m_mainWnd makeKeyAndOrderFront: nil]; |
// Load our initial content. |
- if (!startingURL.empty()) |
- LoadURL(startingURL.c_str()); |
+ if (starting_url.is_valid()) |
+ LoadURL(starting_url); |
- bool bIsSVGTest = startingURL.find(L"W3C-SVG-1.1") != std::wstring::npos; |
- |
- if (bIsSVGTest) { |
+ if (IsSVGTestURL(starting_url)) { |
SizeTo(kSVGTestWindowWidth, kSVGTestWindowHeight); |
} else { |
SizeToDefault(); |
@@ -536,8 +534,7 @@ |
shell->test_is_preparing_ = true; |
shell->set_test_params(¶ms); |
- std::wstring wstr = UTF8ToWide(params.test_url.c_str()); |
- shell->LoadURL(wstr.c_str()); |
+ shell->LoadURL(GURL(params.test_url)); |
shell->test_is_preparing_ = false; |
shell->WaitTestFinished(); |
@@ -546,16 +543,12 @@ |
return true; |
} |
-void TestShell::LoadURLForFrame(const wchar_t* url, |
- const wchar_t* frame_name) { |
- if (!url) |
+void TestShell::LoadURLForFrame(const GURL& url, |
+ const std::wstring& frame_name) { |
+ if (!url.is_valid()) |
return; |
- std::string url8 = WideToUTF8(url); |
- |
- bool bIsSVGTest = strstr(url8.c_str(), "W3C-SVG-1.1") > 0; |
- |
- if (bIsSVGTest) { |
+ if (IsSVGTestURL(url)) { |
SizeTo(kSVGTestWindowWidth, kSVGTestWindowHeight); |
} else { |
// only resize back to the default when running tests |
@@ -563,18 +556,8 @@ |
SizeToDefault(); |
} |
- std::string urlString(url8); |
- struct stat stat_buf; |
- if (!urlString.empty() && stat(url8.c_str(), &stat_buf) == 0) { |
- urlString.insert(0, "file://"); |
- } |
- |
- std::wstring frame_string; |
- if (frame_name) |
- frame_string = frame_name; |
- |
- navigation_controller_->LoadEntry(new TestNavigationEntry( |
- -1, GURL(urlString), std::wstring(), frame_string)); |
+ navigation_controller_->LoadEntry( |
+ new TestNavigationEntry(-1, url, std::wstring(), frame_name)); |
} |
bool TestShell::PromptForSaveFile(const wchar_t* prompt_title, |