1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/task_management/task_management_browsertest_util.h"
7 #include "base/stl_util.h"
9 namespace task_management
{
11 MockWebContentsTaskManager::MockWebContentsTaskManager()
16 MockWebContentsTaskManager::~MockWebContentsTaskManager() {
19 void MockWebContentsTaskManager::TaskAdded(Task
* task
) {
21 DCHECK(!ContainsValue(tasks_
, task
));
22 tasks_
.push_back(task
);
25 void MockWebContentsTaskManager::TaskRemoved(Task
* task
) {
27 DCHECK(ContainsValue(tasks_
, task
));
28 tasks_
.erase(std::find(tasks_
.begin(), tasks_
.end(), task
));
31 void MockWebContentsTaskManager::StartObserving() {
32 provider_
.SetObserver(this);
35 void MockWebContentsTaskManager::StopObserving() {
36 provider_
.ClearObserver();
39 } // namespace task_management