Lines Matching defs:lock
32 // Tests basic functionality and verifies that the lock file is deleted after
39 scoped_ptr<FirefoxProfileLock> lock;
40 EXPECT_EQ(static_cast<FirefoxProfileLock*>(NULL), lock.get());
42 lock.reset(new FirefoxProfileLock(test_path));
43 EXPECT_TRUE(lock->HasAcquired());
45 lock->Unlock();
46 EXPECT_FALSE(lock->HasAcquired());
48 // In the posix code, we don't delete the file when releasing the lock.
52 lock->Lock();
53 EXPECT_TRUE(lock->HasAcquired());
55 lock->Lock();
56 EXPECT_TRUE(lock->HasAcquired());
57 lock->Unlock();
58 EXPECT_FALSE(lock->HasAcquired());
59 // In the posix code, we don't delete the file when releasing the lock.
65 // If for some reason the lock file is left behind by the previous owner, we
66 // should still be able to lock it, at least in the Windows implementation.
72 // Create the orphaned lock file.
78 scoped_ptr<FirefoxProfileLock> lock;
79 EXPECT_EQ(static_cast<FirefoxProfileLock*>(NULL), lock.get());
80 lock.reset(new FirefoxProfileLock(test_path));
81 EXPECT_TRUE(lock->HasAcquired());
82 lock->Unlock();
83 EXPECT_FALSE(lock->HasAcquired());
87 // lock.
89 // Tests two locks contending for the same lock file.