| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef SimWebViewClient_h | 5 #ifndef SimWebViewClient_h |
| 6 #define SimWebViewClient_h | 6 #define SimWebViewClient_h |
| 7 | 7 |
| 8 #include "web/tests/FrameTestHelpers.h" | 8 #include "web/tests/FrameTestHelpers.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class WebLayerTreeView; | 12 class WebLayerTreeView; |
| 13 | 13 |
| 14 class SimWebViewClient final : public FrameTestHelpers::TestWebViewClient { | 14 class SimWebViewClient final : public FrameTestHelpers::TestWebViewClient { |
| 15 public: | 15 public: |
| 16 explicit SimWebViewClient(WebLayerTreeView&); | 16 explicit SimWebViewClient(WebLayerTreeView&); |
| 17 | 17 |
| 18 WebLayerTreeView* layerTreeView() override { return m_layerTreeView; } | 18 WebLayerTreeView* layerTreeView() override { return m_layerTreeView; } |
| 19 void didUpdateLayout() override { m_hadFirstLayout = true; } |
| 20 |
| 21 bool hadFirstLayout() const { return m_hadFirstLayout; } |
| 19 | 22 |
| 20 int visuallyNonEmptyLayoutCount() const { return m_visuallyNonEmptyLayoutCou
nt; } | 23 int visuallyNonEmptyLayoutCount() const { return m_visuallyNonEmptyLayoutCou
nt; } |
| 21 int finishedParsingLayoutCount() const { return m_finishedParsingLayoutCount
; } | 24 int finishedParsingLayoutCount() const { return m_finishedParsingLayoutCount
; } |
| 22 int finishedLoadingLayoutCount() const { return m_finishedLoadingLayoutCount
; } | 25 int finishedLoadingLayoutCount() const { return m_finishedLoadingLayoutCount
; } |
| 23 | 26 |
| 24 private: | 27 private: |
| 25 // WebWidgetClient overrides. | 28 // WebWidgetClient overrides. |
| 26 void didMeaningfulLayout(WebMeaningfulLayout) override; | 29 void didMeaningfulLayout(WebMeaningfulLayout) override; |
| 27 | 30 |
| 28 int m_visuallyNonEmptyLayoutCount; | 31 int m_visuallyNonEmptyLayoutCount; |
| 29 int m_finishedParsingLayoutCount; | 32 int m_finishedParsingLayoutCount; |
| 30 int m_finishedLoadingLayoutCount; | 33 int m_finishedLoadingLayoutCount; |
| 31 | 34 |
| 32 WebLayerTreeView* m_layerTreeView; | 35 WebLayerTreeView* m_layerTreeView; |
| 36 bool m_hadFirstLayout = false; |
| 33 }; | 37 }; |
| 34 | 38 |
| 35 } // namespace blink | 39 } // namespace blink |
| 36 | 40 |
| 37 #endif | 41 #endif |
| OLD | NEW |