summaryrefslogtreecommitdiffstats
path: root/webkit/tools/test_shell
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/tools/test_shell')
-rw-r--r--webkit/tools/test_shell/SConscript25
-rw-r--r--webkit/tools/test_shell/gtk/test_shell.cc16
-rw-r--r--webkit/tools/test_shell/image_decoder_unittest.cc29
-rw-r--r--webkit/tools/test_shell/image_decoder_unittest.h12
4 files changed, 35 insertions, 47 deletions
diff --git a/webkit/tools/test_shell/SConscript b/webkit/tools/test_shell/SConscript
index 105da41..23ba6020 100644
--- a/webkit/tools/test_shell/SConscript
+++ b/webkit/tools/test_shell/SConscript
@@ -93,7 +93,9 @@ elif env['PLATFORM'] in ('posix', 'darwin'):
)
input_files = [
+ 'simple_resource_loader_bridge.cc',
'test_navigation_controller.cc',
+ 'test_shell_request_context.cc',
'test_shell_switches.cc',
]
if env['PLATFORM'] == 'win32':
@@ -103,9 +105,7 @@ if env['PLATFORM'] == 'win32':
'drop_delegate.cc',
'event_sending_controller.cc',
'layout_test_controller.cc',
- 'simple_resource_loader_bridge.cc',
'test_shell.cc',
- 'test_shell_request_context.cc',
'test_webview_delegate.cc',
'text_input_controller.cc',
'webview_host.cc',
@@ -150,13 +150,21 @@ if env['PLATFORM'] == 'win32':
env.Depends(test_shell, '$V8_DIR/vc80.pdb')
test_files = [
- 'run_all_tests.cc',
+ 'image_decoder_unittest.cc',
+ 'run_all_tests.cc',
+ '$WEBKIT_DIR/glue/autocomplete_input_listener_unittest.cc',
+ '$WEBKIT_DIR/glue/cpp_variant_unittest.cc',
+ '$WEBKIT_DIR/glue/glue_serialize_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',
+ '$WEBKIT_DIR/port/platform/GKURL_unittest.cpp',
+ '$V8_DIR/snapshot-empty$OBJSUFFIX',
]
if env['PLATFORM'] == 'win32':
# TODO(port): put portable files in above test_files declaration.
test_files.extend([
- 'image_decoder_unittest.cc',
'keyboard_unittest.cc',
'layout_test_controller_unittest.cc',
'node_leak_test.cc',
@@ -164,30 +172,21 @@ if env['PLATFORM'] == 'win32':
'run_all_tests.cc',
'test_shell_test.cc',
'text_input_controller_unittest.cc',
- '$WEBKIT_DIR/glue/autocomplete_input_listener_unittest.cc',
'$WEBKIT_DIR/glue/bookmarklet_unittest.cc',
'$WEBKIT_DIR/glue/context_menu_unittest.cc',
'$WEBKIT_DIR/glue/cpp_bound_class_unittest.cc',
- '$WEBKIT_DIR/glue/cpp_variant_unittest.cc',
'$WEBKIT_DIR/glue/dom_operations_unittest.cc',
'$WEBKIT_DIR/glue/dom_serializer_unittest.cc',
- '$WEBKIT_DIR/glue/glue_serialize_unittest.cc',
'$WEBKIT_DIR/glue/iframe_redirect_unittest.cc',
'$WEBKIT_DIR/glue/mimetype_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',
'$WEBKIT_DIR/glue/resource_fetcher_unittest.cc',
# Commented out until a regression is fixed and this file is restored.
#'$WEBKIT_DIR/glue/stringimpl_unittest.cc',
'$WEBKIT_DIR/glue/webframe_unittest.cc',
'$WEBKIT_DIR/glue/webplugin_impl_unittest.cc',
- '$WEBKIT_DIR/port/platform/GKURL_unittest.cpp',
'$WEBKIT_DIR/port/platform/image-decoders/bmp/BMPImageDecoder_unittest.cpp',
'$WEBKIT_DIR/port/platform/image-decoders/ico/ICOImageDecoder_unittest.cpp',
'$WEBKIT_DIR/port/platform/image-decoders/xbm/XBMImageDecoder_unittest.cpp',
-
- '$V8_DIR/snapshot-empty$OBJSUFFIX',
])
test_shell_tests = env.ChromeTestProgram('test_shell_tests',
diff --git a/webkit/tools/test_shell/gtk/test_shell.cc b/webkit/tools/test_shell/gtk/test_shell.cc
index fcb5d1b..8276220 100644
--- a/webkit/tools/test_shell/gtk/test_shell.cc
+++ b/webkit/tools/test_shell/gtk/test_shell.cc
@@ -192,20 +192,4 @@ std::wstring GetWebKitLocale() {
return L"en-US";
}
-// The following cookie functions shouldn't live here, but do for now in order
-// to get things linking
-
-std::string GetCookies(const GURL &url, const GURL &policy_url) {
- return "";
-}
-
-void SetCookie(const GURL &url, const GURL &policy_url, const std::string &cookie) {
-}
-
-
-ResourceLoaderBridge *
-ResourceLoaderBridge::Create(WebFrame*, std::string const &, GURL const&, GURL const&, GURL const&, std::string const&, int, int, ResourceType::Type, bool) {
- return NULL;
-}
-
} // namespace webkit_glue
diff --git a/webkit/tools/test_shell/image_decoder_unittest.cc b/webkit/tools/test_shell/image_decoder_unittest.cc
index d8df2e0..a0fbabd 100644
--- a/webkit/tools/test_shell/image_decoder_unittest.cc
+++ b/webkit/tools/test_shell/image_decoder_unittest.cc
@@ -4,15 +4,14 @@
#include "config.h"
-#include <windows.h>
+#include "webkit/tools/test_shell/image_decoder_unittest.h"
#include "base/file_util.h"
#include "base/md5.h"
#include "base/path_service.h"
-#include "base/scoped_handle.h"
#include "base/scoped_ptr.h"
+#include "base/string_util.h"
#include "base/time.h"
-#include "webkit/tools/test_shell/image_decoder_unittest.h"
using base::Time;
@@ -44,9 +43,7 @@ void SaveMD5Sum(const std::wstring& path, WebCore::RGBA32Buffer* buffer) {
&digest);
// Write sum to disk.
- DWORD bytes_written;
- ASSERT_TRUE(WriteFile(handle, &digest, sizeof digest, &bytes_written,
- NULL));
+ int bytes_written = file_util::WriteFile(path, &digest, sizeof digest);
ASSERT_EQ(sizeof digest, bytes_written);
}
#else
@@ -89,19 +86,21 @@ void ImageDecoderTest::SetUp() {
}
std::vector<std::wstring> ImageDecoderTest::GetImageFiles() const {
- std::wstring find_string(data_dir_);
- file_util::AppendToPath(&find_string, L"*." + format_);
- WIN32_FIND_DATA find_data;
- ScopedFindFileHandle handle(FindFirstFile(find_string.c_str(),
- &find_data));
- EXPECT_TRUE(handle.IsValid());
+ std::wstring pattern = L"*." + format_;
+
+ file_util::FileEnumerator enumerator(data_dir_, false,
+ file_util::FileEnumerator::FILES);
std::vector<std::wstring> image_files;
- do {
+ std::wstring next_file_name;
+ while ((next_file_name = enumerator.Next()) != L"") {
+ if (!MatchPattern(next_file_name, pattern)) {
+ continue;
+ }
std::wstring image_path = data_dir_;
- file_util::AppendToPath(&image_path, find_data.cFileName);
+ file_util::AppendToPath(&image_path, next_file_name);
image_files.push_back(image_path);
- } while (FindNextFile(handle, &find_data));
+ }
return image_files;
}
diff --git a/webkit/tools/test_shell/image_decoder_unittest.h b/webkit/tools/test_shell/image_decoder_unittest.h
index 3786b0a..52b72a6 100644
--- a/webkit/tools/test_shell/image_decoder_unittest.h
+++ b/webkit/tools/test_shell/image_decoder_unittest.h
@@ -2,14 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include <vector>
+#ifndef WEBKIT_TOOLS_TEST_SHELL_IMAGE_DECODER_UNITTEST_H_
+#define WEBKIT_TOOLS_TEST_SHELL_IMAGE_DECODER_UNITTEST_H_
-#include "base/basictypes.h"
-#include "testing/gtest/include/gtest/gtest.h"
+#include <vector>
#include "Vector.h"
#include "ImageDecoder.h"
+#undef LOG
+
+#include "base/basictypes.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
// If CALCULATE_MD5_SUMS is not defined, then this test decodes a handful of
// image files and compares their MD5 sums to the stored sums on disk.
//
@@ -77,3 +82,4 @@ class ImageDecoderTest : public testing::Test {
DISALLOW_EVIL_CONSTRUCTORS(ImageDecoderTest);
};
+#endif // WEBKIT_TOOLS_TEST_SHELL_IMAGE_DECODER_UNITTEST_H_