summaryrefslogtreecommitdiffstats
path: root/media/base/mock_task.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-05 17:56:39 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-05 17:56:39 +0000
commit3339229822e7af543067d5267d3b9795bd6e4485 (patch)
tree76d893bdea7b1895303aad3c265cbb0946c5154f /media/base/mock_task.cc
parent8cb02edc531a8334b2bd48087a91b4cbdf40c2d7 (diff)
downloadchromium_src-3339229822e7af543067d5267d3b9795bd6e4485.zip
chromium_src-3339229822e7af543067d5267d3b9795bd6e4485.tar.gz
chromium_src-3339229822e7af543067d5267d3b9795bd6e4485.tar.bz2
Move lots of GMock stuff out of line.
Nico did some treemapping of our build time on Mac, and (surprise!) gmock unittests dominated. Gmock works with several large, heavy templates, and previous patches that out of line the ctors/dtors have significantly sped up compilation (e.g.GLMock) and have reduced thrashing. Nico says I should plug this again: http://www.chromium.org/developers/coding-style/cpp-dos-and-donts BUG=none TEST=none Review URL: http://codereview.chromium.org/6056008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/mock_task.cc')
-rw-r--r--media/base/mock_task.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/media/base/mock_task.cc b/media/base/mock_task.cc
new file mode 100644
index 0000000..f9f8823
--- /dev/null
+++ b/media/base/mock_task.cc
@@ -0,0 +1,22 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/base/mock_task.h"
+
+namespace media {
+
+TaskMocker::TaskMocker()
+ : outstanding_tasks_(0) {
+}
+
+TaskMocker::~TaskMocker() {
+ CHECK(outstanding_tasks_ == 0)
+ << "If outstanding_tasks_ is not zero, tasks have been leaked.";
+}
+
+Task* TaskMocker::CreateTask() {
+ return new CountingTask(this);
+}
+
+} // namespace media