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>2008-11-20 22:05:19 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-20 22:05:19 +0000
commit63357da39cd6d80467cdb90bb46c7933ab8609bc (patch)
treec3d813fb9b85787db134b3ca3d8a27de2ced2699 /webkit/tools/test_shell/test_shell.cc
parent7904e6470657223a24a72b7c728fc45d15580e78 (diff)
downloadchromium_src-63357da39cd6d80467cdb90bb46c7933ab8609bc.zip
chromium_src-63357da39cd6d80467cdb90bb46c7933ab8609bc.tar.gz
chromium_src-63357da39cd6d80467cdb90bb46c7933ab8609bc.tar.bz2
Make the editor deletion UI work in layout test mode and
rebase 2 tests that use it. The only difference is font size. BUG=http://b/1124435 Review URL: http://codereview.chromium.org/11536 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/test_shell/test_shell.cc')
-rw-r--r--webkit/tools/test_shell/test_shell.cc49
1 files changed, 37 insertions, 12 deletions
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index 9d236a6..02d268c 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -442,32 +442,57 @@ bool GetPreferredExtensionForMimeType(const std::string& mime_type,
}
std::string GetDataResource(int resource_id) {
- if (resource_id == IDR_BROKENIMAGE) {
+ switch (resource_id) {
+ case IDR_BROKENIMAGE: {
// Use webkit's broken image icon (16x16)
static std::string broken_image_data;
if (broken_image_data.empty()) {
- std::wstring path;
+ FilePath path;
PathService::Get(base::DIR_SOURCE_ROOT, &path);
- file_util::AppendToPath(&path, L"webkit");
- file_util::AppendToPath(&path, L"tools");
- file_util::AppendToPath(&path, L"test_shell");
- file_util::AppendToPath(&path, L"resources");
- file_util::AppendToPath(&path, L"missingImage.gif");
- bool success = file_util::ReadFileToString(path, &broken_image_data);
+ path = path.Append(FILE_PATH_LITERAL("webkit"));
+ path = path.Append(FILE_PATH_LITERAL("tools"));
+ path = path.Append(FILE_PATH_LITERAL("test_shell"));
+ path = path.Append(FILE_PATH_LITERAL("resources"));
+ path = path.Append(FILE_PATH_LITERAL("missingImage.gif"));
+ bool success = file_util::ReadFileToString(path.ToWStringHack(),
+ &broken_image_data);
if (!success) {
- LOG(FATAL) << "Failed reading: " << path;
+ LOG(FATAL) << "Failed reading: " << path.value();
}
}
return broken_image_data;
- } else if (resource_id == IDR_FEED_PREVIEW) {
+ }
+ 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}}");
- } else {
- return std::string();
+ case IDR_EDITOR_DELETE_BUTTON:{
+ // Use webkit's delete button image.
+ static std::string delete_button_data;
+ if (delete_button_data.empty()) {
+ FilePath path;
+ 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"));
+ path = path.Append(FILE_PATH_LITERAL("resources"));
+ path = path.Append(FILE_PATH_LITERAL("deleteButton.png"));
+ bool success = file_util::ReadFileToString(path.ToWStringHack(),
+ &delete_button_data);
+ if (!success) {
+ LOG(FATAL) << "Failed reading: " << path.value();
+ }
+ }
+ return delete_button_data;
}
+
+ default:
+ break;
+ }
+
+ return std::string();
}
GlueBitmap GetBitmapResource(int resource_id) {