summaryrefslogtreecommitdiffstats
path: root/base/thread_unittest.cc
diff options
context:
space:
mode:
authorralphl@chromium.org <ralphl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 17:21:23 +0000
committerralphl@chromium.org <ralphl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 17:21:23 +0000
commitb026f4aeb159244e47d3b55c5faad7bb3247fd55 (patch)
treeefda81548664ea009160ded8588904185b384ca4 /base/thread_unittest.cc
parentabc659b6d95cf197c2b96a544351a667e8b96f95 (diff)
downloadchromium_src-b026f4aeb159244e47d3b55c5faad7bb3247fd55.zip
chromium_src-b026f4aeb159244e47d3b55c5faad7bb3247fd55.tar.gz
chromium_src-b026f4aeb159244e47d3b55c5faad7bb3247fd55.tar.bz2
Implementation of Pipeline and FilterHost interfaces. This is a large change, but all of the objects are interrelated.
I am also checking in a basic unit test that creates pipeline, and the data source hangs during initialization. The test sleeps one second and then stops the pipeline. Andrew has already done a first pass on this, and the code has come largely from our working experimental branch. Review URL: http://codereview.chromium.org/18546 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8805 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/thread_unittest.cc')
-rw-r--r--base/thread_unittest.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/thread_unittest.cc b/base/thread_unittest.cc
index f741951..f72c9c4 100644
--- a/base/thread_unittest.cc
+++ b/base/thread_unittest.cc
@@ -57,16 +57,22 @@ TEST_F(ThreadTest, Restart) {
Thread a("Restart");
a.Stop();
EXPECT_FALSE(a.message_loop());
+ EXPECT_FALSE(a.IsRunning());
EXPECT_TRUE(a.Start());
EXPECT_TRUE(a.message_loop());
+ EXPECT_TRUE(a.IsRunning());
a.Stop();
EXPECT_FALSE(a.message_loop());
+ EXPECT_FALSE(a.IsRunning());
EXPECT_TRUE(a.Start());
EXPECT_TRUE(a.message_loop());
+ EXPECT_TRUE(a.IsRunning());
a.Stop();
EXPECT_FALSE(a.message_loop());
+ EXPECT_FALSE(a.IsRunning());
a.Stop();
EXPECT_FALSE(a.message_loop());
+ EXPECT_FALSE(a.IsRunning());
}
TEST_F(ThreadTest, StartWithOptions_StackSize) {
@@ -77,6 +83,7 @@ TEST_F(ThreadTest, StartWithOptions_StackSize) {
options.stack_size = 12*1024;
EXPECT_TRUE(a.StartWithOptions(options));
EXPECT_TRUE(a.message_loop());
+ EXPECT_TRUE(a.IsRunning());
bool was_invoked = false;
a.message_loop()->PostTask(FROM_HERE, new ToggleValue(&was_invoked));
@@ -110,10 +117,12 @@ TEST_F(ThreadTest, StopSoon) {
Thread a("StopSoon");
EXPECT_TRUE(a.Start());
EXPECT_TRUE(a.message_loop());
+ EXPECT_TRUE(a.IsRunning());
a.StopSoon();
a.StopSoon();
a.Stop();
EXPECT_FALSE(a.message_loop());
+ EXPECT_FALSE(a.IsRunning());
}
TEST_F(ThreadTest, ThreadName) {