OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef FrameTestHelpers_h | 31 #ifndef FrameTestHelpers_h |
32 #define FrameTestHelpers_h | 32 #define FrameTestHelpers_h |
33 | 33 |
| 34 #include "core/frame/Settings.h" |
| 35 #include "platform/scroll/ScrollbarTheme.h" |
34 #include "public/platform/WebURLRequest.h" | 36 #include "public/platform/WebURLRequest.h" |
35 #include "public/web/WebFrameClient.h" | 37 #include "public/web/WebFrameClient.h" |
36 #include "public/web/WebHistoryItem.h" | 38 #include "public/web/WebHistoryItem.h" |
37 #include "public/web/WebRemoteFrameClient.h" | 39 #include "public/web/WebRemoteFrameClient.h" |
38 #include "public/web/WebViewClient.h" | 40 #include "public/web/WebViewClient.h" |
39 #include "web/WebViewImpl.h" | 41 #include "web/WebViewImpl.h" |
40 #include "wtf/PassOwnPtr.h" | 42 #include "wtf/PassOwnPtr.h" |
| 43 #include <gmock/gmock.h> |
| 44 #include <gtest/gtest.h> |
41 #include <string> | 45 #include <string> |
42 | 46 |
43 namespace blink { | 47 namespace blink { |
44 | 48 |
45 class WebLocalFrameImpl; | 49 class WebLocalFrameImpl; |
46 class WebSettings; | 50 class WebSettings; |
47 | 51 |
48 namespace FrameTestHelpers { | 52 namespace FrameTestHelpers { |
49 | 53 |
50 class TestWebFrameClient; | 54 class TestWebFrameClient; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 class TestWebViewClient : public WebViewClient { | 129 class TestWebViewClient : public WebViewClient { |
126 public: | 130 public: |
127 virtual ~TestWebViewClient() { } | 131 virtual ~TestWebViewClient() { } |
128 virtual void initializeLayerTreeView() override; | 132 virtual void initializeLayerTreeView() override; |
129 virtual WebLayerTreeView* layerTreeView() override { return m_layerTreeView.
get(); } | 133 virtual WebLayerTreeView* layerTreeView() override { return m_layerTreeView.
get(); } |
130 | 134 |
131 private: | 135 private: |
132 OwnPtr<WebLayerTreeView> m_layerTreeView; | 136 OwnPtr<WebLayerTreeView> m_layerTreeView; |
133 }; | 137 }; |
134 | 138 |
| 139 class UseMockScrollbarSettings { |
| 140 public: |
| 141 UseMockScrollbarSettings() |
| 142 { |
| 143 Settings::setMockScrollbarsEnabled(true); |
| 144 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true); |
| 145 EXPECT_TRUE(ScrollbarTheme::theme()->usesOverlayScrollbars()); |
| 146 } |
| 147 |
| 148 ~UseMockScrollbarSettings() |
| 149 { |
| 150 Settings::setMockScrollbarsEnabled(false); |
| 151 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false); |
| 152 } |
| 153 }; |
| 154 |
135 } // namespace FrameTestHelpers | 155 } // namespace FrameTestHelpers |
136 } // namespace blink | 156 } // namespace blink |
137 | 157 |
138 #endif // FrameTestHelpers_h | 158 #endif // FrameTestHelpers_h |
OLD | NEW |