diff options
author | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 05:10:48 +0000 |
---|---|---|
committer | hamaji@chromium.org <hamaji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 05:10:48 +0000 |
commit | 94128148b2ba757e212ae34007d44f3912a2f3d2 (patch) | |
tree | 9d4310495e83a4ba568daf1cffcf580ebea1c76b /base/message_loop_unittest.cc | |
parent | 913cedfc4c6b3024e983528f7078fba7de61cb1a (diff) | |
download | chromium_src-94128148b2ba757e212ae34007d44f3912a2f3d2.zip chromium_src-94128148b2ba757e212ae34007d44f3912a2f3d2.tar.gz chromium_src-94128148b2ba757e212ae34007d44f3912a2f3d2.tar.bz2 |
Rebaseline tests whose expectations were changed by r55714.
The patch removed extra paddings inside buttons.
http://trac.webkit.org/changeset/55714
BUG=1437
TEST=none
Review URL: http://codereview.chromium.org/789003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49225 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/message_loop_unittest.cc')
-rw-r--r-- | base/message_loop_unittest.cc | 81 |
1 files changed, 8 insertions, 73 deletions
diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc index 0fa35f3..44d545f 100644 --- a/base/message_loop_unittest.cc +++ b/base/message_loop_unittest.cc @@ -2,12 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "base/eintr_wrapper.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/platform_thread.h" #include "base/ref_counted.h" -#include "base/task.h" #include "base/thread.h" #include "testing/gtest/include/gtest/gtest.h" @@ -1457,70 +1455,6 @@ TEST(MessageLoopTest, NonNestableDelayedInNestedLoop) { RunTest_NonNestableInNestedLoop(MessageLoop::TYPE_IO, true); } -class DummyTask : public Task { - public: - DummyTask(int num_tasks) : num_tasks_(num_tasks) {} - - virtual void Run() { - if (num_tasks_ > 1) { - MessageLoop::current()->PostTask( - FROM_HERE, - new DummyTask(num_tasks_ - 1)); - } else { - MessageLoop::current()->Quit(); - } - } - - private: - const int num_tasks_; -}; - -class DummyTaskObserver : public MessageLoop::TaskObserver { - public: - DummyTaskObserver(int num_tasks) - : num_tasks_started_(0), - num_tasks_processed_(0), - num_tasks_(num_tasks) {} - - virtual ~DummyTaskObserver() {} - - virtual void WillProcessTask(base::TimeTicks /* birth_time */) { - num_tasks_started_++; - EXPECT_LE(num_tasks_started_, num_tasks_); - EXPECT_EQ(num_tasks_started_, num_tasks_processed_ + 1); - } - - virtual void DidProcessTask() { - num_tasks_processed_++; - EXPECT_LE(num_tasks_started_, num_tasks_); - EXPECT_EQ(num_tasks_started_, num_tasks_processed_); - } - - int num_tasks_started() const { return num_tasks_started_; } - int num_tasks_processed() const { return num_tasks_processed_; } - - private: - int num_tasks_started_; - int num_tasks_processed_; - const int num_tasks_; - - DISALLOW_COPY_AND_ASSIGN(DummyTaskObserver); -}; - -TEST(MessageLoopTest, TaskObserver) { - const int kNumTasks = 6; - DummyTaskObserver observer(kNumTasks); - - MessageLoop loop; - loop.AddTaskObserver(&observer); - loop.PostTask(FROM_HERE, new DummyTask(kNumTasks)); - loop.Run(); - loop.RemoveTaskObserver(&observer); - - EXPECT_EQ(kNumTasks, observer.num_tasks_started()); - EXPECT_EQ(kNumTasks, observer.num_tasks_processed()); -} - #if defined(OS_WIN) TEST(MessageLoopTest, Dispatcher) { // This test requires a UI loop @@ -1545,7 +1479,8 @@ TEST(MessageLoopTest, WaitForIO) { namespace { -class QuitDelegate : public base::MessagePumpLibevent::Watcher { +class QuitDelegate : public + base::MessagePumpLibevent::Watcher { public: virtual void OnFileCanWriteWithoutBlocking(int fd) { MessageLoop::current()->Quit(); @@ -1555,6 +1490,8 @@ class QuitDelegate : public base::MessagePumpLibevent::Watcher { } }; +} // namespace + TEST(MessageLoopTest, FileDescriptorWatcherOutlivesMessageLoop) { // Simulate a MessageLoop that dies before an FileDescriptorWatcher. // This could happen when people use the Singleton pattern or atexit. @@ -1580,8 +1517,8 @@ TEST(MessageLoopTest, FileDescriptorWatcherOutlivesMessageLoop) { // and don't run the message loop, just destroy it. } } - HANDLE_EINTR(close(pipefds[0])); - HANDLE_EINTR(close(pipefds[1])); + close(pipefds[0]); + close(pipefds[1]); } TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) { @@ -1603,10 +1540,8 @@ TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) { controller.StopWatchingFileDescriptor(); } } - HANDLE_EINTR(close(pipefds[0])); - HANDLE_EINTR(close(pipefds[1])); + close(pipefds[0]); + close(pipefds[1]); } -} // namespace - #endif // defined(OS_POSIX) |