summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell/test_shell.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 19:19:16 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 19:19:16 +0000
commit989a9adc283220f30bed65f5254ef63684df3732 (patch)
treeb9d1ceb54771120144ef8d150e04c01c7b3ce0f8 /webkit/tools/test_shell/test_shell.cc
parent70cbae67f090da022412d43f86684a6a026847cf (diff)
downloadchromium_src-989a9adc283220f30bed65f5254ef63684df3732.zip
chromium_src-989a9adc283220f30bed65f5254ef63684df3732.tar.gz
chromium_src-989a9adc283220f30bed65f5254ef63684df3732.tar.bz2
Add test shell resources into the linux .pak file.
Add a new test_shell_resources.grd that is only used on linux and add it into test_shell.pak. Move the data pack initialization into the global init and cleanup methods. Move the old code for loading from disk into the platform specific files. Review URL: http://codereview.chromium.org/18385 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8378 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell.cc')
-rwxr-xr-xwebkit/tools/test_shell/test_shell.cc81
1 files changed, 0 insertions, 81 deletions
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index ced93a5..e76b288 100755
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -40,9 +40,6 @@
#include "SkBitmap.h"
-// Generated by GRIT
-#include "webkit_resources.h"
-
namespace {
// Default timeout in ms for file page loads when in layout test mode.
@@ -57,31 +54,6 @@ const int kTestWindowHeight = 600;
const int kSVGTestWindowWidth = 480;
const int kSVGTestWindowHeight = 360;
-// Helper method for getting the path to the test shell resources directory.
-FilePath GetResourcesFilePath() {
- FilePath path;
-#if defined(OS_MACOSX)
- // we need to know if we're bundled or not to know which path to use
- if (mac_util::AmIBundled()) {
- PathService::Get(base::DIR_EXE, &path);
- path = path.Append(FILE_PATH_LITERAL(FilePath::kParentDirectory));
- return path.Append(FILE_PATH_LITERAL("Resources"));
- } else {
- PathService::Get(base::DIR_SOURCE_ROOT, &path);
- path = path.Append(FILE_PATH_LITERAL("webkit"));
- path = path.Append(FILE_PATH_LITERAL("tools"));
- path = path.Append(FILE_PATH_LITERAL("test_shell"));
- return path.Append(FILE_PATH_LITERAL("resources"));
- }
-#else
- PathService::Get(base::DIR_SOURCE_ROOT, &path);
- path = path.Append(FILE_PATH_LITERAL("webkit"));
- path = path.Append(FILE_PATH_LITERAL("tools"));
- path = path.Append(FILE_PATH_LITERAL("test_shell"));
- return path.Append(FILE_PATH_LITERAL("resources"));
-#endif
-}
-
// URLRequestTestShellFileJob is used to serve the inspector
class URLRequestTestShellFileJob : public URLRequestFileJob {
public:
@@ -181,9 +153,7 @@ bool TestShell::CreateNewWindow(const std::wstring& startingURL,
}
void TestShell::ShutdownTestShell() {
-#if defined(OS_WIN) || defined(OS_MACOSX)
PlatformShutdown();
-#endif
SimpleResourceLoaderBridge::Shutdown();
delete window_list_;
delete TestShell::web_prefs_;
@@ -526,57 +496,6 @@ bool GetPreferredExtensionForMimeType(const std::string& mime_type,
return net::GetPreferredExtensionForMimeType(mime_type, ext);
}
-std::string GetDataResource(int resource_id) {
- switch (resource_id) {
- case IDR_BROKENIMAGE: {
- // Use webkit's broken image icon (16x16)
- static std::string broken_image_data;
- if (broken_image_data.empty()) {
- FilePath path = GetResourcesFilePath();
-#if defined(OS_WIN) || defined(OS_LINUX)
- path = path.Append(FILE_PATH_LITERAL("missingImage.gif"));
-#elif defined(OS_MACOSX)
- // In order to match WebKit's colors for the missing image, we have to
- // use a PNG. The GIF doesn't have the color range needed to correctly
- // match the TIFF they use in Safari.
- path = path.Append(FILE_PATH_LITERAL("missingImage.png"));
-#endif
- bool success = file_util::ReadFileToString(path.ToWStringHack(),
- &broken_image_data);
- if (!success) {
- LOG(FATAL) << "Failed reading: " << path.value();
- }
- }
- return broken_image_data;
- }
- case IDR_FEED_PREVIEW:
- // It is necessary to return a feed preview template that contains
- // a {{URL}} substring where the feed URL should go; see the code
- // that computes feed previews in feed_preview.cc:MakeFeedPreview.
- // This fixes issue #932714.
- return std::string("Feed preview for {{URL}}");
- case IDR_TEXTAREA_RESIZER: {
- // Use webkit's text area resizer image.
- static std::string resize_corner_data;
- if (resize_corner_data.empty()) {
- FilePath path = GetResourcesFilePath();
- path = path.Append(FILE_PATH_LITERAL("textAreaResizeCorner.png"));
- bool success = file_util::ReadFileToString(path.ToWStringHack(),
- &resize_corner_data);
- if (!success) {
- LOG(FATAL) << "Failed reading: " << path.value();
- }
- }
- return resize_corner_data;
- }
-
- default:
- break;
- }
-
- return std::string();
-}
-
GlueBitmap GetBitmapResource(int resource_id) {
return NULL;
}