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.
6 #include "core/fetch/MockImageResourceClient.h"
8 #include "core/fetch/ImageResource.h"
9 #include "core/fetch/ResourcePtr.h"
11 #include <gtest/gtest.h>
15 MockImageResourceClient::MockImageResourceClient(const ResourcePtr
<Resource
>& resource
)
16 : m_resource(resource
.get())
17 , m_imageChangedCount(0)
18 , m_notifyFinishedCalled(false)
20 m_resource
->addClient(this);
23 MockImageResourceClient::~MockImageResourceClient()
26 m_resource
->removeClient(this);
29 void MockImageResourceClient::notifyFinished(Resource
*)
31 ASSERT_FALSE(m_notifyFinishedCalled
);
32 m_notifyFinishedCalled
= true;
35 void MockImageResourceClient::removeAsClient()
37 m_resource
->removeClient(this);