summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-11 01:29:39 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-11 01:29:39 +0000
commit7258924d59592745795ec1c12eafb20a30625826 (patch)
tree5227f23676d7deb43d461bcca617a13ab41a15ed
parent178f127ef64fb51620cee821156d7258c8719f01 (diff)
downloadchromium_src-7258924d59592745795ec1c12eafb20a30625826.zip
chromium_src-7258924d59592745795ec1c12eafb20a30625826.tar.gz
chromium_src-7258924d59592745795ec1c12eafb20a30625826.tar.bz2
Unittest gardening on MacOS X:
- base/gfx/rect_unittest.cc had a typo - base/waitable_event_watcher_unittest.cc enabled - chrome/common/pref_member_unittest.cc enabled - chrome/common/json_value_serializer_unittest.cc had a Windows-only bit which currently works fine on Mac. - These worked once an anonymous namespace was cleared up: chrome/browser/history/query_parser_unittest.cc chrome/browser/history/url_database_unittest.cc chrome/common/json_value_serializer_unittest.cc Some required minor editting to remove anonymous namespaces for test classes. Review URL: http://codereview.chromium.org/20241 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9539 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/base.xcodeproj/project.pbxproj4
-rw-r--r--base/gfx/rect_unittest.cc2
-rw-r--r--chrome/browser/history/query_parser_unittest.cc4
-rw-r--r--chrome/browser/history/url_database_unittest.cc4
-rw-r--r--chrome/chrome.xcodeproj/project.pbxproj6
-rw-r--r--chrome/common/json_value_serializer_unittest.cc47
6 files changed, 34 insertions, 33 deletions
diff --git a/base/base.xcodeproj/project.pbxproj b/base/base.xcodeproj/project.pbxproj
index c3c6f86..f00553d 100644
--- a/base/base.xcodeproj/project.pbxproj
+++ b/base/base.xcodeproj/project.pbxproj
@@ -189,6 +189,7 @@
BA739A020E5E3242009842A7 /* tracked_objects_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA739A000E5E3242009842A7 /* tracked_objects_unittest.cc */; };
BA739A030E5E3242009842A7 /* timer_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA739A010E5E3242009842A7 /* timer_unittest.cc */; };
BA73AA330E5F614B00A20026 /* condition_variable_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = BA73AA320E5F614B00A20026 /* condition_variable_unittest.cc */; };
+ CA8132D40F423AF50096C1DC /* waitable_event_watcher_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = CA8132D30F423AF50096C1DC /* waitable_event_watcher_unittest.cc */; };
E45062A60E40A9BE0025A81A /* base_switches.cc in Sources */ = {isa = PBXBuildFile; fileRef = 825402CB0D92D1390006B936 /* base_switches.cc */; };
E46C47280F1FA06D00B393B8 /* system_monitor_posix.cc in Sources */ = {isa = PBXBuildFile; fileRef = E46C47270F1FA06D00B393B8 /* system_monitor_posix.cc */; };
E48A05F70E3F61B300172919 /* command_line.cc in Sources */ = {isa = PBXBuildFile; fileRef = E4A133490E37A41D00110AA2 /* command_line.cc */; };
@@ -668,6 +669,7 @@
BA739A010E5E3242009842A7 /* timer_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = timer_unittest.cc; sourceTree = "<group>"; };
BA73AA320E5F614B00A20026 /* condition_variable_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = condition_variable_unittest.cc; sourceTree = "<group>"; };
BA73AA420E5F62F400A20026 /* spin_wait.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = spin_wait.h; sourceTree = "<group>"; };
+ CA8132D30F423AF50096C1DC /* waitable_event_watcher_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = waitable_event_watcher_unittest.cc; sourceTree = "<group>"; };
E45629E40E27C058005E4685 /* rect_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rect_unittest.cc; sourceTree = "<group>"; };
E4562A200E27C8C1005E4685 /* png_codec_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = png_codec_unittest.cc; sourceTree = "<group>"; };
E4562A2A0E27CA2F005E4685 /* libpng.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libpng.xcodeproj; path = third_party/libpng/libpng.xcodeproj; sourceTree = "<group>"; };
@@ -1113,6 +1115,7 @@
B290BFCBD30E45A63758BFC7 /* waitable_event_posix.cc */,
9301C03A0E54C839001EF103 /* waitable_event_unittest.cc */,
38246046390EAED65BB7C380 /* waitable_event_watcher_posix.cc */,
+ CA8132D30F423AF50096C1DC /* waitable_event_watcher_unittest.cc */,
820EB5030E3A61A1009668FC /* watchdog.cc */,
820EB5040E3A61A1009668FC /* watchdog.h */,
4D4C5B5D0EF1B7C1002CA805 /* watchdog_unittest.cc */,
@@ -1578,6 +1581,7 @@
7B78D3A30E54FE0100609465 /* values_unittest.cc in Sources */,
F330B11E050A9158CB16C98E /* version_unittest.cc in Sources */,
7B78D3A40E54FE0100609465 /* waitable_event_unittest.cc in Sources */,
+ CA8132D40F423AF50096C1DC /* waitable_event_watcher_unittest.cc in Sources */,
4D4C5B5E0EF1B7C1002CA805 /* watchdog_unittest.cc in Sources */,
7B78D3A50E54FE0100609465 /* word_iterator_unittest.cc in Sources */,
7BF1658E0E663B4A00AA999E /* worker_pool_unittest.cc in Sources */,
diff --git a/base/gfx/rect_unittest.cc b/base/gfx/rect_unittest.cc
index 40a7a77..fdcf1c7 100644
--- a/base/gfx/rect_unittest.cc
+++ b/base/gfx/rect_unittest.cc
@@ -213,7 +213,7 @@ TEST(RectTest, AdjustToFit) {
}
}
-TEST(RectText, Subtract) {
+TEST(RectTest, Subtract) {
// Matching
EXPECT_TRUE(
gfx::Rect(10, 10, 20, 20).Subtract(
diff --git a/chrome/browser/history/query_parser_unittest.cc b/chrome/browser/history/query_parser_unittest.cc
index 25d4f4e..6d425e91 100644
--- a/chrome/browser/history/query_parser_unittest.cc
+++ b/chrome/browser/history/query_parser_unittest.cc
@@ -7,8 +7,6 @@
#include "chrome/common/scoped_vector.h"
#include "testing/gtest/include/gtest/gtest.h"
-namespace {
-
class QueryParserTest : public testing::Test {
public:
struct TestData {
@@ -22,8 +20,6 @@ class QueryParserTest : public testing::Test {
QueryParser query_parser_;
};
-}; // namespace
-
// Test helper: Convert a user query string to a SQLite query string.
std::wstring QueryParserTest::QueryToString(const std::wstring& query) {
std::wstring sqlite_query;
diff --git a/chrome/browser/history/url_database_unittest.cc b/chrome/browser/history/url_database_unittest.cc
index 9520fa7..a33829a 100644
--- a/chrome/browser/history/url_database_unittest.cc
+++ b/chrome/browser/history/url_database_unittest.cc
@@ -28,6 +28,8 @@ bool IsURLRowEqual(const URLRow& a,
a.last_visit() - b.last_visit() <= TimeDelta::FromSeconds(1) &&
a.hidden() == b.hidden();
}
+
+} // namespace
class URLDatabaseTest : public testing::Test,
public URLDatabase {
@@ -70,8 +72,6 @@ class URLDatabaseTest : public testing::Test,
SqliteStatementCache* statement_cache_;
};
-} // namespace
-
// Test add and query for the URL table in the HistoryDatabase
TEST_F(URLDatabaseTest, AddURL) {
// first, add two URLs
diff --git a/chrome/chrome.xcodeproj/project.pbxproj b/chrome/chrome.xcodeproj/project.pbxproj
index bfafa48..7c80e3a 100644
--- a/chrome/chrome.xcodeproj/project.pbxproj
+++ b/chrome/chrome.xcodeproj/project.pbxproj
@@ -328,6 +328,9 @@
BA60A6800F3CB09F005A6703 /* protocol_manager_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFAD70E9D49DE009A6919 /* protocol_manager_unittest.cc */; };
BAA609ED0F3BCAA800783510 /* protocol_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFAD50E9D49DE009A6919 /* protocol_manager.cc */; };
BADB8B710F3A35AC00989B26 /* resource_dispatcher_host.cc in Sources */ = {isa = PBXBuildFile; fileRef = BADB8B6D0F3A356000989B26 /* resource_dispatcher_host.cc */; };
+ CA81330E0F423C4D0096C1DC /* query_parser_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFA020E9D48F7009A6919 /* query_parser_unittest.cc */; };
+ CA8133120F423C710096C1DC /* url_database_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFA150E9D48F7009A6919 /* url_database_unittest.cc */; };
+ CA81331D0F423DB40096C1DC /* pref_member_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBE70E9D4C9F009A6919 /* pref_member_unittest.cc */; };
DDB41CECE38B852000F30D9F /* browsing_data_remover.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF84E0E9D4839009A6919 /* browsing_data_remover.cc */; };
E40CC5E30F2E348900708647 /* history_contents_provider.cc in Sources */ = {isa = PBXBuildFile; fileRef = E40CC5E10F2E348900708647 /* history_contents_provider.cc */; };
E40CC5EE0F2E34C100708647 /* base_history_model.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF82B0E9D4839009A6919 /* base_history_model.cc */; };
@@ -5302,10 +5305,12 @@
E45077620F15405C003BE099 /* notification_service_unittest.cc in Sources */,
4D7BFB580E9D4C43009A6919 /* page_range_unittest.cc in Sources */,
4D7BFB5F0E9D4C46009A6919 /* page_setup_unittest.cc in Sources */,
+ CA81331D0F423DB40096C1DC /* pref_member_unittest.cc in Sources */,
8268477E0F2F69C8009F6555 /* profile_manager_unittest.cc in Sources */,
B562E2FC0F05845100FB1A4F /* property_bag_unittest.cc in Sources */,
BA60A6800F3CB09F005A6703 /* protocol_manager_unittest.cc in Sources */,
4D7BFB780E9D4C5A009A6919 /* protocol_parser_unittest.cc in Sources */,
+ CA81330E0F423C4D0096C1DC /* query_parser_unittest.cc in Sources */,
3380A9D60F2FC8F6004EF74F /* render_dns_master.cc in Sources */,
8268533B0F30AE13009F6555 /* render_process.cc in Sources */,
3380A9C00F2FC61E004EF74F /* render_process_unittest.cc in Sources */,
@@ -5326,6 +5331,7 @@
4D7BFB3E0E9D4C2F009A6919 /* text_database_unittest.cc in Sources */,
4D7BFB610E9D4C4B009A6919 /* units_unittest.cc in Sources */,
A572828F0F31156100384E1B /* unzip_unittest.cc in Sources */,
+ CA8133120F423C710096C1DC /* url_database_unittest.cc in Sources */,
8570EB3F140C07ABF1957F12 /* url_pattern_unittest.cc in Sources */,
A0EB956531B9DB1E40DAE980 /* user_script_unittest.cc in Sources */,
B502DA280F098056005BE90C /* visit_database_unittest.cc in Sources */,
diff --git a/chrome/common/json_value_serializer_unittest.cc b/chrome/common/json_value_serializer_unittest.cc
index 30f6320..1fc9e97 100644
--- a/chrome/common/json_value_serializer_unittest.cc
+++ b/chrome/common/json_value_serializer_unittest.cc
@@ -221,31 +221,27 @@ TEST(JSONValueSerializerTest, JSONReaderComments) {
ASSERT_FALSE(root.get());
}
-namespace {
- class JSONFileValueSerializerTest : public testing::Test {
- protected:
- virtual void SetUp() {
- // Name a subdirectory of the temp directory.
- ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_dir_));
- file_util::AppendToPath(&test_dir_, L"JSONFileValueSerializerTest");
-
- // Create a fresh, empty copy of this directory.
- file_util::Delete(test_dir_, true);
- file_util::CreateDirectory(test_dir_);
- }
- virtual void TearDown() {
- // Clean up test directory
- ASSERT_TRUE(file_util::Delete(test_dir_, false));
- ASSERT_FALSE(file_util::PathExists(test_dir_));
- }
-
- // the path to temporary directory used to contain the test operations
- std::wstring test_dir_;
- };
-} // anonymous namespace
-
-// TODO(port): Enable these when PathService::Get with DIR_TEST_DATA is ported.
-#if defined(OS_WIN)
+class JSONFileValueSerializerTest : public testing::Test {
+protected:
+ virtual void SetUp() {
+ // Name a subdirectory of the temp directory.
+ ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_dir_));
+ file_util::AppendToPath(&test_dir_, L"JSONFileValueSerializerTest");
+
+ // Create a fresh, empty copy of this directory.
+ file_util::Delete(test_dir_, true);
+ file_util::CreateDirectory(test_dir_);
+ }
+ virtual void TearDown() {
+ // Clean up test directory
+ ASSERT_TRUE(file_util::Delete(test_dir_, false));
+ ASSERT_FALSE(file_util::PathExists(test_dir_));
+ }
+
+ // the path to temporary directory used to contain the test operations
+ std::wstring test_dir_;
+};
+
TEST_F(JSONFileValueSerializerTest, Roundtrip) {
std::wstring original_file_path;
ASSERT_TRUE(
@@ -332,4 +328,3 @@ TEST_F(JSONFileValueSerializerTest, NoWhitespace) {
root.reset(serializer.Deserialize(NULL));
ASSERT_TRUE(root.get());
}
-#endif // defined(OS_WIN)