| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 public: | 46 public: |
| 47 MockResourceClient() {} | 47 MockResourceClient() {} |
| 48 explicit MockResourceClient(Resource*); | 48 explicit MockResourceClient(Resource*); |
| 49 ~MockResourceClient() override; | 49 ~MockResourceClient() override; |
| 50 | 50 |
| 51 void notifyFinished(Resource*) override; | 51 void notifyFinished(Resource*) override; |
| 52 String debugName() const override { return "MockResourceClient"; } | 52 String debugName() const override { return "MockResourceClient"; } |
| 53 virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } | 53 virtual bool notifyFinishedCalled() const { return m_notifyFinishedCalled; } |
| 54 | 54 |
| 55 size_t encodedSizeOnNotifyFinished() const { |
| 56 return m_encodedSizeOnNotifyFinished; |
| 57 } |
| 58 |
| 55 virtual void removeAsClient(); | 59 virtual void removeAsClient(); |
| 56 virtual void dispose(); | 60 virtual void dispose(); |
| 57 | 61 |
| 58 DECLARE_TRACE(); | 62 DECLARE_TRACE(); |
| 59 | 63 |
| 60 protected: | 64 protected: |
| 61 Member<Resource> m_resource; | 65 Member<Resource> m_resource; |
| 62 bool m_notifyFinishedCalled; | 66 bool m_notifyFinishedCalled; |
| 67 size_t m_encodedSizeOnNotifyFinished; |
| 63 }; | 68 }; |
| 64 | 69 |
| 65 class MockImageResourceClient final : public MockResourceClient, | 70 class MockImageResourceClient final : public MockResourceClient, |
| 66 public ImageResourceObserver { | 71 public ImageResourceObserver { |
| 67 public: | 72 public: |
| 68 explicit MockImageResourceClient(ImageResource*); | 73 explicit MockImageResourceClient(ImageResource*); |
| 69 ~MockImageResourceClient() override; | 74 ~MockImageResourceClient() override; |
| 70 | 75 |
| 71 void imageNotifyFinished(ImageResource*) override; | 76 void imageNotifyFinished(ImageResource*) override; |
| 72 void imageChanged(ImageResource*, const IntRect*) override; | 77 void imageChanged(ImageResource*, const IntRect*) override; |
| 73 | 78 |
| 74 String debugName() const override { return "MockImageResourceClient"; } | 79 String debugName() const override { return "MockImageResourceClient"; } |
| 75 | 80 |
| 76 bool notifyFinishedCalled() const override; | 81 bool notifyFinishedCalled() const override; |
| 77 | 82 |
| 78 void removeAsClient() override; | 83 void removeAsClient() override; |
| 79 void dispose() override; | 84 void dispose() override; |
| 80 | 85 |
| 81 int imageChangedCount() const { return m_imageChangedCount; } | 86 int imageChangedCount() const { return m_imageChangedCount; } |
| 82 | 87 |
| 88 size_t encodedSizeOnLastImageChanged() const { |
| 89 return m_encodedSizeOnLastImageChanged; |
| 90 } |
| 91 size_t encodedSizeOnImageNotifyFinished() const { |
| 92 return m_encodedSizeOnImageNotifyFinished; |
| 93 } |
| 94 |
| 83 private: | 95 private: |
| 84 int m_imageChangedCount; | 96 int m_imageChangedCount; |
| 97 size_t m_encodedSizeOnLastImageChanged; |
| 85 int m_imageNotifyFinishedCount; | 98 int m_imageNotifyFinishedCount; |
| 99 size_t m_encodedSizeOnImageNotifyFinished; |
| 86 }; | 100 }; |
| 87 | 101 |
| 88 } // namespace blink | 102 } // namespace blink |
| 89 | 103 |
| 90 #endif // MockResourceClients_h | 104 #endif // MockResourceClients_h |
| OLD | NEW |