summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
authorpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 20:04:09 +0000
committerpinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-10 20:04:09 +0000
commita03c3ab2b239f5617b70956f6af1f2ea6682d26f (patch)
tree006dd1a0e2b894116510f30bcc195d9d6490d50e /webkit/glue
parentf08e7583ec3d6e9ee79585c03b16ad3a70de2b02 (diff)
downloadchromium_src-a03c3ab2b239f5617b70956f6af1f2ea6682d26f.zip
chromium_src-a03c3ab2b239f5617b70956f6af1f2ea6682d26f.tar.gz
chromium_src-a03c3ab2b239f5617b70956f6af1f2ea6682d26f.tar.bz2
make a target for test_shell_tests on mac and tweak tests to build there. Include a few more files to be built in glue upon which they depend.
Review URL: http://codereview.chromium.org/13712 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/bookmarklet_unittest.cc3
-rw-r--r--webkit/glue/cpp_binding_example.cc2
-rw-r--r--webkit/glue/cpp_bound_class_unittest.cc3
-rw-r--r--webkit/glue/dom_operations_unittest.cc3
-rw-r--r--webkit/glue/dom_serializer_unittest.cc4
-rw-r--r--webkit/glue/entity_map.cc2
-rw-r--r--webkit/glue/password_autocomplete_listener_unittest.cc3
-rw-r--r--webkit/glue/resource_fetcher_unittest.cc22
8 files changed, 31 insertions, 11 deletions
diff --git a/webkit/glue/bookmarklet_unittest.cc b/webkit/glue/bookmarklet_unittest.cc
index 89d1129..7aed7f0 100644
--- a/webkit/glue/bookmarklet_unittest.cc
+++ b/webkit/glue/bookmarklet_unittest.cc
@@ -24,8 +24,6 @@ class BookmarkletTest : public TestShellTest {
}
};
-}
-
TEST_F(BookmarkletTest, Redirect) {
test_shell_->LoadURL(L"javascript:location.href='data:text/plain,SUCCESS'");
test_shell_->WaitTestFinished();
@@ -64,3 +62,4 @@ TEST_F(BookmarkletTest, DocumentWrite) {
EXPECT_EQ(L"hello world", text);
}
+} // namespace
diff --git a/webkit/glue/cpp_binding_example.cc b/webkit/glue/cpp_binding_example.cc
index aabd3c1..551e404 100644
--- a/webkit/glue/cpp_binding_example.cc
+++ b/webkit/glue/cpp_binding_example.cc
@@ -5,6 +5,8 @@
// This file contains the definition for CppBindingExample, a usage example
// that is not actually used anywhere. See cpp_binding_example.h.
+#include "config.h"
+
#include "cpp_binding_example.h"
CppBindingExample::CppBindingExample() {
diff --git a/webkit/glue/cpp_bound_class_unittest.cc b/webkit/glue/cpp_bound_class_unittest.cc
index 73b118f2..b080478 100644
--- a/webkit/glue/cpp_bound_class_unittest.cc
+++ b/webkit/glue/cpp_bound_class_unittest.cc
@@ -140,8 +140,6 @@ protected:
}
};
-} // namespace
-
// Ensures that the example object has been bound to JS.
TEST_F(CppBoundClassTest, ObjectExists) {
std::string js = BuildJSCondition("typeof window.example", "'object'");
@@ -241,3 +239,4 @@ TEST_F(CppBoundClassWithFallbackMethodTest,
CheckJavaScriptSuccess(js);
}
+} // namespace
diff --git a/webkit/glue/dom_operations_unittest.cc b/webkit/glue/dom_operations_unittest.cc
index 2ef4418..e960375 100644
--- a/webkit/glue/dom_operations_unittest.cc
+++ b/webkit/glue/dom_operations_unittest.cc
@@ -34,8 +34,6 @@ class DomOperationsTests : public TestShellTest {
}
};
-} // namespace
-
void DomOperationsTests::GetSavableResourceLinksForPage(
const std::wstring& page_file_path,
@@ -181,3 +179,4 @@ TEST_F(DomOperationsTests, ParseIconSizes) {
}
}
+} // namespace
diff --git a/webkit/glue/dom_serializer_unittest.cc b/webkit/glue/dom_serializer_unittest.cc
index d4f73bc..4950fdf 100644
--- a/webkit/glue/dom_serializer_unittest.cc
+++ b/webkit/glue/dom_serializer_unittest.cc
@@ -234,8 +234,6 @@ bool IsMetaElement(const WebCore::Node* node, WebCore::String* charset_info) {
return true;
}
-} // namespace
-
// If original contents have document type, the serialized contents also have
// document type.
TEST_F(DomSerializerTests, SerialzeHTMLDOMWithDocType) {
@@ -682,3 +680,5 @@ TEST_F(DomSerializerTests, SerialzeHTMLDOMWithBaseTag) {
WideToUTF8(webkit_glue::StringToStdWString(doc->baseURL())));
ASSERT_EQ(new_base_url, path_dir_url);
}
+
+} // namespace
diff --git a/webkit/glue/entity_map.cc b/webkit/glue/entity_map.cc
index 6c780ec..6ed6c82 100644
--- a/webkit/glue/entity_map.cc
+++ b/webkit/glue/entity_map.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "config.h"
+
#include "webkit/glue/entity_map.h"
#include "base/hash_tables.h"
diff --git a/webkit/glue/password_autocomplete_listener_unittest.cc b/webkit/glue/password_autocomplete_listener_unittest.cc
index e4b4e79..8e58c11 100644
--- a/webkit/glue/password_autocomplete_listener_unittest.cc
+++ b/webkit/glue/password_autocomplete_listener_unittest.cc
@@ -117,7 +117,6 @@ class PasswordManagerAutocompleteTests : public testing::Test {
std::wstring password2_;
PasswordFormDomManager::FillData data_;
};
-} // namespace
TEST_F(PasswordManagerAutocompleteTests, OnBlur) {
TestHTMLInputDelegate* username_delegate = new TestHTMLInputDelegate();
@@ -242,3 +241,5 @@ TEST_F(PasswordManagerAutocompleteTests, TestWaitUsername) {
EXPECT_EQ(empty, username_delegate->value());
EXPECT_EQ(password1_, password_delegate->value());
}
+
+} // namespace
diff --git a/webkit/glue/resource_fetcher_unittest.cc b/webkit/glue/resource_fetcher_unittest.cc
index cad4bbc..d996f3b 100644
--- a/webkit/glue/resource_fetcher_unittest.cc
+++ b/webkit/glue/resource_fetcher_unittest.cc
@@ -79,6 +79,15 @@ class FetcherDelegate : public ResourceFetcher::Delegate {
&FetcherDelegate::TimerCallback);
#elif defined(OS_LINUX)
timer_id_ = g_timeout_add(interval, &FetcherDelegate::TimerCallback, NULL);
+#elif defined(OS_MACOSX)
+ // CFAbsoluteTime is in seconds and |interval| is in ms, so make sure we
+ // keep the units correct.
+ CFTimeInterval interval_in_seconds = static_cast<double>(interval) / 1000.0;
+ CFAbsoluteTime fire_date =
+ CFAbsoluteTimeGetCurrent() + interval_in_seconds;
+ timer_id_ = CFRunLoopTimerCreate(NULL, fire_date, interval_in_seconds, 0,
+ 0, FetcherDelegate::TimerCallback, NULL);
+ CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer_id_, kCFRunLoopCommonModes);
#endif
}
@@ -87,6 +96,10 @@ class FetcherDelegate : public ResourceFetcher::Delegate {
::KillTimer(NULL, timer_id_);
#elif defined(OS_LINUX)
g_source_remove(timer_id_);
+#elif defined(OS_MACOSX)
+ CFRunLoopRemoveTimer(CFRunLoopGetCurrent(), timer_id_,
+ kCFRunLoopCommonModes);
+ CFRelease(timer_id_);
#endif
}
@@ -101,6 +114,10 @@ class FetcherDelegate : public ResourceFetcher::Delegate {
instance_->TimerFired();
return true;
}
+#elif defined(OS_MACOSX)
+ static void TimerCallback(CFRunLoopTimerRef timer, void* info) {
+ instance_->TimerFired();
+ }
#endif
void TimerFired() {
@@ -123,6 +140,8 @@ class FetcherDelegate : public ResourceFetcher::Delegate {
UINT_PTR timer_id_;
#elif defined(OS_LINUX)
guint timer_id_;
+#elif defined(OS_MACOSX)
+ CFRunLoopTimerRef timer_id_;
#endif
bool completed_;
int time_elapsed_ms_;
@@ -132,8 +151,6 @@ class FetcherDelegate : public ResourceFetcher::Delegate {
FetcherDelegate* FetcherDelegate::instance_ = NULL;
-} // namespace
-
// Test a fetch from the test server.
TEST_F(ResourceFetcherTests, ResourceFetcherDownload) {
UnittestTestServer server;
@@ -215,3 +232,4 @@ TEST_F(ResourceFetcherTests, ResourceFetcherTimeout) {
EXPECT_TRUE(delegate->time_elapsed_ms() < kMaxWaitTimeMs);
}
+} // namespace