summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 21:51:53 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-22 21:51:53 +0000
commitdd94f2f28165c2f2a72c82c0872255d881d5d052 (patch)
treee0b5679888473048ba575a957721fa218a8e31f6 /chrome/browser
parent203bfc2f0a2e72b7103067e1c898848d6d1799e5 (diff)
downloadchromium_src-dd94f2f28165c2f2a72c82c0872255d881d5d052.zip
chromium_src-dd94f2f28165c2f2a72c82c0872255d881d5d052.tar.gz
chromium_src-dd94f2f28165c2f2a72c82c0872255d881d5d052.tar.bz2
Run user_script_master_unittest.cc on Mac.
Removed anonymous namespace, Mac's gcc won't allow friend to reach into anonymous namespaces. Noticed that UserScriptMasterTest.NoScripts hanged it DirectoryWatcher was not implemented. Added a timeout event so that now it fails slowly. Then I disabled that test for non-Windows. Other tests pass, lets get those in the system! Review URL: http://codereview.chromium.org/88075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/extensions/user_script_master_unittest.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/extensions/user_script_master_unittest.cc b/chrome/browser/extensions/user_script_master_unittest.cc
index b9945bd..8413847 100644
--- a/chrome/browser/extensions/user_script_master_unittest.cc
+++ b/chrome/browser/extensions/user_script_master_unittest.cc
@@ -14,8 +14,6 @@
#include "chrome/common/notification_service.h"
#include "testing/gtest/include/gtest/gtest.h"
-namespace {
-
// Test bringing up a master on a specific directory, putting a script
// in there, etc.
@@ -72,8 +70,6 @@ class UserScriptMasterTest : public testing::Test,
base::SharedMemory* shared_memory_;
};
-} // namespace
-
// Test that we *don't* get spurious notifications.
TEST_F(UserScriptMasterTest, NoScripts) {
// Set shared_memory_ to something non-NULL, so we can check it became NULL.
@@ -90,6 +86,9 @@ TEST_F(UserScriptMasterTest, NoScripts) {
ASSERT_EQ(NULL, shared_memory_);
}
+// TODO(shess): Disabled on Mac and Linux because of missing
+// DirectoryWatcher.
+#if defined(OS_WIN)
// Test that we get notified about new scripts after they're added.
TEST_F(UserScriptMasterTest, NewScripts) {
scoped_refptr<UserScriptMaster> master(
@@ -101,10 +100,15 @@ TEST_F(UserScriptMasterTest, NewScripts) {
size_t written = file_util::WriteFile(path, content, sizeof(content));
ASSERT_EQ(written, sizeof(content));
+ // Post a delayed task so that we fail rather than hanging if things
+ // don't work.
+ message_loop_.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, 5000);
+
message_loop_.Run();
ASSERT_TRUE(shared_memory_ != NULL);
}
+#endif
// Test that we get notified about scripts if they're already in the test dir.
TEST_F(UserScriptMasterTest, ExistingScripts) {