summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 22:46:31 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-27 22:46:31 +0000
commitdca5cbb44a2665ce7248d99fae0007ed344734cf (patch)
treee77968d2f3f085d9cab529b1b68f54d4508850a0
parent7b44dee2620540809ccda43ab3041a5908d775e1 (diff)
downloadchromium_src-dca5cbb44a2665ce7248d99fae0007ed344734cf.zip
chromium_src-dca5cbb44a2665ce7248d99fae0007ed344734cf.tar.gz
chromium_src-dca5cbb44a2665ce7248d99fae0007ed344734cf.tar.bz2
Port a few test_shell_tests. Now it runs 45 of them.
I removed some files from test_files because scons complains (warns) when a file is both in test_files and input_files. So the files removed from test_files also exist in input_files and at some pointed will be ported anyway. I also made some linking stubs. BUG=3674 Review URL: http://codereview.chromium.org/7974 Patch from Paweł Hajdan jr <phajdan.jr@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4031 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/base_lib.scons1
-rw-r--r--net/base/x509_certificate_nss.cc10
-rw-r--r--webkit/glue/autocomplete_input_listener_unittest.cc6
-rw-r--r--webkit/glue/cpp_variant_unittest.cc15
-rw-r--r--webkit/glue/glue_serialize_unittest.cc9
-rw-r--r--webkit/glue/multipart_response_delegate_unittest.cc9
-rw-r--r--webkit/glue/password_autocomplete_listener_unittest.cc12
-rw-r--r--webkit/port/platform/GKURL_unittest.cpp28
-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
12 files changed, 89 insertions, 83 deletions
diff --git a/base/base_lib.scons b/base/base_lib.scons
index 3019e02..6bedfdb 100644
--- a/base/base_lib.scons
+++ b/base/base_lib.scons
@@ -178,6 +178,7 @@ if env['PLATFORM'] == 'posix':
'base_paths_linux.cc',
'clipboard_linux.cc',
'file_util_linux.cc',
+ 'file_version_info_linux.cc',
'hmac_nss.cc',
'message_pump_glib.cc',
'nss_init.cc',
diff --git a/net/base/x509_certificate_nss.cc b/net/base/x509_certificate_nss.cc
index 3906ae1..6dc837f9 100644
--- a/net/base/x509_certificate_nss.cc
+++ b/net/base/x509_certificate_nss.cc
@@ -16,6 +16,16 @@ X509Certificate::~X509Certificate() {
X509Certificate::Cache::GetInstance()->Remove(this);
}
+// static
+X509Certificate* X509Certificate::CreateFromPickle(const Pickle& pickle,
+ void** pickle_iter) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+void X509Certificate::Persist(Pickle* pickle) {
+ NOTIMPLEMENTED();
+}
} // namespace net
diff --git a/webkit/glue/autocomplete_input_listener_unittest.cc b/webkit/glue/autocomplete_input_listener_unittest.cc
index 3223a38..47b9ac5 100644
--- a/webkit/glue/autocomplete_input_listener_unittest.cc
+++ b/webkit/glue/autocomplete_input_listener_unittest.cc
@@ -76,9 +76,9 @@ class TestAutocompleteEditDelegate : public AutocompleteEditDelegate {
class TestAutocompleteInputListener : public AutocompleteInputListener {
public:
TestAutocompleteInputListener(AutocompleteEditDelegate* d)
- : blurred_(false),
- did_request_inline_autocomplete_(false),
- AutocompleteInputListener(d) {
+ : AutocompleteInputListener(d),
+ blurred_(false),
+ did_request_inline_autocomplete_(false) {
}
void ResetTestState() {
diff --git a/webkit/glue/cpp_variant_unittest.cc b/webkit/glue/cpp_variant_unittest.cc
index bb3ecc8..8933b85 100644
--- a/webkit/glue/cpp_variant_unittest.cc
+++ b/webkit/glue/cpp_variant_unittest.cc
@@ -53,7 +53,7 @@ int g_deallocate_call_count = 0;
void CheckObject(const NPVariant& actual) {
EXPECT_EQ(NPVariantType_Object, actual.type);
EXPECT_TRUE(actual.value.objectValue);
- EXPECT_EQ(1, actual.value.objectValue->referenceCount);
+ EXPECT_EQ(1U, actual.value.objectValue->referenceCount);
EXPECT_EQ(1, g_allocate_call_count);
EXPECT_EQ(0, g_deallocate_call_count);
}
@@ -117,10 +117,10 @@ TEST(CppVariantTest, CopyConstructorIncrementsRefCount) {
NPObject *object = MakeVoidObject();
source.Set(object);
// 2 references so far.
- EXPECT_EQ(2, source.value.objectValue->referenceCount);
+ EXPECT_EQ(2U, source.value.objectValue->referenceCount);
CppVariant dest = source;
- EXPECT_EQ(3, dest.value.objectValue->referenceCount);
+ EXPECT_EQ(3U, dest.value.objectValue->referenceCount);
EXPECT_EQ(1, g_allocate_call_count);
NPN_ReleaseObject(object);
source.SetNull();
@@ -147,11 +147,11 @@ TEST(CppVariantTest, AssignmentIncrementsRefCount) {
NPObject *object = MakeVoidObject();
source.Set(object);
// 2 references so far.
- EXPECT_EQ(2, source.value.objectValue->referenceCount);
+ EXPECT_EQ(2U, source.value.objectValue->referenceCount);
CppVariant dest;
dest = source;
- EXPECT_EQ(3, dest.value.objectValue->referenceCount);
+ EXPECT_EQ(3U, dest.value.objectValue->referenceCount);
EXPECT_EQ(1, g_allocate_call_count);
NPN_ReleaseObject(object);
@@ -300,7 +300,6 @@ TEST(CppVariantTest, SetsSimpleTypesAndValues) {
CheckString("std test string", cpp);
// NPString
- const char *ascii_str = "test NPString";
NPString np_ascii_str = { "test NPString",
static_cast<uint32_t>(strlen("test NPString")) };
cpp.Set(np_ascii_str);
@@ -336,9 +335,9 @@ TEST(CppVariantTest, FreeDataReleasesObject) {
CppVariant cpp;
NPObject* object = MakeVoidObject();
cpp.Set(object);
- EXPECT_EQ(2, object->referenceCount);
+ EXPECT_EQ(2U, object->referenceCount);
cpp.FreeData();
- EXPECT_EQ(1, object->referenceCount);
+ EXPECT_EQ(1U, object->referenceCount);
EXPECT_EQ(0, g_deallocate_call_count);
cpp.Set(object);
diff --git a/webkit/glue/glue_serialize_unittest.cc b/webkit/glue/glue_serialize_unittest.cc
index a117d14..15664ea 100644
--- a/webkit/glue/glue_serialize_unittest.cc
+++ b/webkit/glue/glue_serialize_unittest.cc
@@ -5,10 +5,7 @@
#include "config.h"
#include <string>
-#include "webkit/glue/glue_serialize.h"
-#include "testing/gtest/include/gtest/gtest.h"
#include "base/compiler_specific.h"
-#include "base/pickle.h"
MSVC_PUSH_WARNING_LEVEL(0);
#include "CString.h"
@@ -18,6 +15,12 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "ResourceRequest.h"
MSVC_POP_WARNING();
+#undef LOG
+
+#include "base/pickle.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/glue/glue_serialize.h"
+
using namespace std;
using namespace WebCore;
using namespace webkit_glue;
diff --git a/webkit/glue/multipart_response_delegate_unittest.cc b/webkit/glue/multipart_response_delegate_unittest.cc
index 325b8ad..93bfcb2 100644
--- a/webkit/glue/multipart_response_delegate_unittest.cc
+++ b/webkit/glue/multipart_response_delegate_unittest.cc
@@ -13,7 +13,6 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "ResourceResponse.h"
#include "ResourceHandle.h"
#include "ResourceHandleClient.h"
-#include "String.h"
MSVC_POP_WARNING();
#include "base/basictypes.h"
@@ -89,7 +88,7 @@ TEST(MultipartResponseTest, Functions) {
{ "Line\rLine", 4, 1 },
{ "Line\r\rLine", 4, 1 },
};
- for (int i = 0; i < arraysize(line_tests); ++i) {
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(line_tests); ++i) {
EXPECT_EQ(line_tests[i].expected,
delegate.PushOverLine(line_tests[i].input,
line_tests[i].position));
@@ -111,7 +110,7 @@ TEST(MultipartResponseTest, Functions) {
{ "Foo: bar\r\nBaz:\n", false, 0, "Foo: bar\r\nBaz:\n" },
{ "\r\n", true, 1, "" },
};
- for (int i = 0; i < arraysize(header_tests); ++i) {
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(header_tests); ++i) {
client.Reset();
delegate.data_.assign(header_tests[i].data);
EXPECT_EQ(header_tests[i].rv,
@@ -154,7 +153,7 @@ TEST(MultipartResponseTest, Functions) {
{ "foo", "bound", string::npos },
{ "bound", "--boundbound", 0 },
};
- for (int i = 0; i < arraysize(boundary_tests); ++i) {
+ for (size_t i = 0; i < ARRAYSIZE_UNSAFE(boundary_tests); ++i) {
delegate.boundary_.assign(boundary_tests[i].boundary);
delegate.data_.assign(boundary_tests[i].data);
EXPECT_EQ(boundary_tests[i].position,
@@ -425,7 +424,7 @@ TEST(MultipartResponseTest, MultipartByteRangeParsingTest) {
result = MultipartResponseDelegate::ReadMultipartBoundary(
response3, &multipart_boundary);
EXPECT_EQ(result, false);
- EXPECT_EQ(multipart_boundary.length(), 0);
+ EXPECT_EQ(multipart_boundary.length(), 0U);
}
TEST(MultipartResponseTest, MultipartContentRangesTest) {
diff --git a/webkit/glue/password_autocomplete_listener_unittest.cc b/webkit/glue/password_autocomplete_listener_unittest.cc
index 072cdff..53623d1 100644
--- a/webkit/glue/password_autocomplete_listener_unittest.cc
+++ b/webkit/glue/password_autocomplete_listener_unittest.cc
@@ -35,12 +35,12 @@ using webkit_glue::HTMLInputDelegate;
class TestHTMLInputDelegate : public HTMLInputDelegate {
public:
- TestHTMLInputDelegate() : did_call_on_finish_(false),
+ TestHTMLInputDelegate() : HTMLInputDelegate(NULL),
+ did_call_on_finish_(false),
did_set_value_(false),
did_set_selection_(false),
selection_start_(0),
- selection_end_(0),
- HTMLInputDelegate(NULL) {
+ selection_end_(0) {
}
// Override those methods we implicitly invoke in the tests.
@@ -163,7 +163,7 @@ TEST_F(PasswordManagerAutocompleteTests, OnInlineAutocompleteNeeded) {
EXPECT_EQ(username1_, username_delegate->GetValue());
EXPECT_EQ(password1_, password_delegate->GetValue());
// And the selection should have been set to 'lice', the last 4 letters.
- EXPECT_EQ(1, username_delegate->selection_start());
+ EXPECT_EQ(1U, username_delegate->selection_start());
EXPECT_EQ(username1_.length(), username_delegate->selection_end());
// And both fields should have observed OnFinishedAutocompleting.
EXPECT_TRUE(username_delegate->did_call_on_finish());
@@ -175,7 +175,7 @@ TEST_F(PasswordManagerAutocompleteTests, OnInlineAutocompleteNeeded) {
// different start value.
EXPECT_EQ(username1_, username_delegate->GetValue());
EXPECT_EQ(password1_, password_delegate->GetValue());
- EXPECT_EQ(2, username_delegate->selection_start());
+ EXPECT_EQ(2U, username_delegate->selection_start());
EXPECT_EQ(username1_.length(), username_delegate->selection_end());
// Now lets say the user goes astray from the stored username and types
@@ -202,7 +202,7 @@ TEST_F(PasswordManagerAutocompleteTests, OnInlineAutocompleteNeeded) {
// The username and password fields should match the 'bob' entry.
EXPECT_EQ(username2_, username_delegate->GetValue());
EXPECT_EQ(password2_, password_delegate->GetValue());
- EXPECT_EQ(1, username_delegate->selection_start());
+ EXPECT_EQ(1U, username_delegate->selection_start());
EXPECT_EQ(username2_.length(), username_delegate->selection_end());
// The End.
diff --git a/webkit/port/platform/GKURL_unittest.cpp b/webkit/port/platform/GKURL_unittest.cpp
index 46c91e8..4286d0a 100644
--- a/webkit/port/platform/GKURL_unittest.cpp
+++ b/webkit/port/platform/GKURL_unittest.cpp
@@ -32,12 +32,11 @@
#include "config.h"
-#include "base/basictypes.h"
-#include "base/string_util.h"
+#include "base/compiler_specific.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/glue/glue_util.h"
-#pragma warning(push, 0)
+MSVC_PUSH_WARNING_LEVEL(0);
// This is because we have multiple headers called "CString.h" and KURL.cpp
// can grab the wrong one.
@@ -62,7 +61,12 @@
#include "KURL.h"
#include "GKURL.cpp"
-#pragma warning(pop)
+MSVC_POP_WARNING();
+
+#undef LOG
+#include "base/basictypes.h"
+#include "base/string16.h"
+#include "base/string_util.h"
namespace {
@@ -101,7 +105,7 @@ TEST(GKURL, SameGetters) {
"javascript:hello!//world",
};
- for (int i = 0; i < arraysize(cases); i++) {
+ for (size_t i = 0; i < arraysize(cases); i++) {
// UTF-8
WebCore::WebKitKURL kurl(cases[i]);
WebCore::GoogleKURL gurl(cases[i]);
@@ -157,7 +161,7 @@ TEST(GKURL, DifferentGetters) {
{"http://www.google.com/foo/blah?bar=baz#\xce\xb1\xce\xb2", "http", "www.google.com", 0, "", NULL, "/foo/blah/", "blah", "?bar=baz", "\xce\xb1\xce\xb2"}
};
- for (int i = 0; i < arraysize(cases); i++) {
+ for (size_t i = 0; i < arraysize(cases); i++) {
WebCore::GoogleKURL gurl(cases[i].url);
EXPECT_EQ(cases[i].protocol, gurl.protocol());
@@ -217,7 +221,7 @@ TEST(GKURL, Setters) {
{"https://me:pass@google.com:88/a?f#b", "http", "goo.com", 92, "", "", "/", NULL, NULL, ""},
};
- for (int i = 0; i < arraysize(cases); i++) {
+ for (size_t i = 0; i < arraysize(cases); i++) {
WebCore::GoogleKURL gurl(cases[i].url);
WebCore::WebKitKURL kurl(cases[i].url);
@@ -272,7 +276,7 @@ TEST(GKURL, Decode) {
"%e4%bd%a0%e5%a5%bd",
};
- for (int i = 0; i < arraysize(decode_cases); i++) {
+ for (size_t i = 0; i < arraysize(decode_cases); i++) {
WebCore::String input(decode_cases[i]);
WebCore::String webkit = WebCore::WebKitKURL::decodeURLEscapeSequences(input);
WebCore::String google = WebCore::GoogleKURL::decodeURLEscapeSequences(input);
@@ -286,16 +290,18 @@ TEST(GKURL, Decode) {
// Test the error behavior for invalid UTF-8 (we differ from WebKit here).
WebCore::String invalid = WebCore::GoogleKURL::decodeURLEscapeSequences(
"%e4%a0%e5%a5%bd");
+ char16 invalid_expected_helper[4] = { 0x00e4, 0x00a0, 0x597d, 0 };
WebCore::String invalid_expected(
- reinterpret_cast<const ::UChar*>(L"\x00e4\x00a0\x597d"),
+ reinterpret_cast<const ::UChar*>(invalid_expected_helper),
3);
EXPECT_EQ(invalid_expected, invalid);
}
TEST(GKURL, Encode) {
// Also test that it gets converted to UTF-8 properly.
+ char16 wide_input_helper[3] = { 0x4f60, 0x597d, 0 };
WebCore::String wide_input(
- reinterpret_cast<const ::UChar*>(L"\x4f60\x597d"), 2);
+ reinterpret_cast<const ::UChar*>(wide_input_helper), 2);
WebCore::String wide_reference("\xe4\xbd\xa0\xe5\xa5\xbd", 6);
WebCore::String wide_output =
WebCore::GoogleKURL::encodeWithURLEscapeSequences(wide_input);
@@ -581,4 +587,4 @@ TEST(GKURL, Offsets) {
EXPECT_TRUE(kurl3.pathStart() == gurl3.pathStart());
EXPECT_TRUE(kurl3.pathEnd() == gurl3.pathEnd());
EXPECT_TRUE(kurl3.pathAfterLastSlash() == gurl3.pathAfterLastSlash());
-} \ No newline at end of file
+}
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_