Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Side by Side Diff: third_party/WebKit/Source/core/loader/resource/MockImageResourceObserver.cpp

Issue 2645953005: Add more unit tests for ImageResource's DecodeError (Closed)
Patch Set: Include path fix Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/loader/resource/MockImageResourceObserver.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/resource/MockImageResourceObserver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698