OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/loader/resource/MockImageResourceObserver.h" | 5 #include "core/loader/resource/MockImageResourceObserver.h" |
6 | 6 |
7 #include "core/loader/resource/ImageResource.h" | 7 #include "core/loader/resource/ImageResource.h" |
8 #include "core/loader/resource/ImageResourceContent.h" | 8 #include "core/loader/resource/ImageResourceContent.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 m_imageWidthOnLastImageChanged = | 37 m_imageWidthOnLastImageChanged = |
38 m_content->hasImage() ? m_content->getImage()->width() : 0; | 38 m_content->hasImage() ? m_content->getImage()->width() : 0; |
39 } | 39 } |
40 | 40 |
41 void MockImageResourceObserver::imageNotifyFinished( | 41 void MockImageResourceObserver::imageNotifyFinished( |
42 ImageResourceContent* image) { | 42 ImageResourceContent* image) { |
43 ASSERT_EQ(0, m_imageNotifyFinishedCount); | 43 ASSERT_EQ(0, m_imageNotifyFinishedCount); |
44 m_imageNotifyFinishedCount++; | 44 m_imageNotifyFinishedCount++; |
45 m_imageWidthOnImageNotifyFinished = | 45 m_imageWidthOnImageNotifyFinished = |
46 m_content->hasImage() ? m_content->getImage()->width() : 0; | 46 m_content->hasImage() ? m_content->getImage()->width() : 0; |
| 47 m_statusOnImageNotifyFinished = m_content->getStatus(); |
47 } | 48 } |
48 | 49 |
49 bool MockImageResourceObserver::imageNotifyFinishedCalled() const { | 50 bool MockImageResourceObserver::imageNotifyFinishedCalled() const { |
50 DCHECK_LE(m_imageNotifyFinishedCount, 1); | 51 DCHECK_LE(m_imageNotifyFinishedCount, 1); |
51 return m_imageNotifyFinishedCount; | 52 return m_imageNotifyFinishedCount; |
52 } | 53 } |
53 | 54 |
54 } // namespace blink | 55 } // namespace blink |
OLD | NEW |