Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: webkit/tools/test_shell/test_shell_mac.mm

Issue 200054: Hook up WebFrameClient, replacing many WebViewDelegate methods.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | webkit/tools/test_shell/test_shell_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(&params);
- 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,
« no previous file with comments | « webkit/tools/test_shell/test_shell_gtk.cc ('k') | webkit/tools/test_shell/test_shell_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698