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

Side by Side Diff: Source/web/tests/FrameTestHelpers.h

Issue 1230533002: Fix virtual/override/final usage in Source/web/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/FakeWebPlugin.h ('k') | Source/web/tests/FrameTestHelpers.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 WebViewImpl* m_webView; 97 WebViewImpl* m_webView;
98 SettingOverrider* m_settingOverrider; 98 SettingOverrider* m_settingOverrider;
99 }; 99 };
100 100
101 // Minimal implementation of WebFrameClient needed for unit tests that load fram es. Tests that load 101 // Minimal implementation of WebFrameClient needed for unit tests that load fram es. Tests that load
102 // frames and need further specialization of WebFrameClient behavior should subc lass this. 102 // frames and need further specialization of WebFrameClient behavior should subc lass this.
103 class TestWebFrameClient : public WebFrameClient { 103 class TestWebFrameClient : public WebFrameClient {
104 public: 104 public:
105 TestWebFrameClient(); 105 TestWebFrameClient();
106 106
107 virtual WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const WebString& frameName, WebSandboxFlags) override; 107 WebFrame* createChildFrame(WebLocalFrame* parent, WebTreeScopeType, const We bString& frameName, WebSandboxFlags) override;
108 virtual void frameDetached(WebFrame*, DetachType) override; 108 void frameDetached(WebFrame*, DetachType) override;
109 virtual void didStartLoading(bool) override; 109 void didStartLoading(bool) override;
110 virtual void didStopLoading() override; 110 void didStopLoading() override;
111 111
112 bool isLoading() { return m_loadsInProgress > 0; } 112 bool isLoading() { return m_loadsInProgress > 0; }
113 void waitForLoadToComplete(); 113 void waitForLoadToComplete();
114 114
115 private: 115 private:
116 int m_loadsInProgress; 116 int m_loadsInProgress;
117 }; 117 };
118 118
119 // Minimal implementation of WebRemoteFrameClient needed for unit tests that loa d remote frames. Tests that load 119 // Minimal implementation of WebRemoteFrameClient needed for unit tests that loa d remote frames. Tests that load
120 // frames and need further specialization of WebFrameClient behavior should subc lass this. 120 // frames and need further specialization of WebFrameClient behavior should subc lass this.
(...skipping 11 matching lines...) Expand all
132 WebSecurityOrigin targetOrigin, 132 WebSecurityOrigin targetOrigin,
133 WebDOMMessageEvent) override { } 133 WebDOMMessageEvent) override { }
134 134
135 private: 135 private:
136 WebRemoteFrame* const m_frame; 136 WebRemoteFrame* const m_frame;
137 }; 137 };
138 138
139 class TestWebViewClient : public WebViewClient { 139 class TestWebViewClient : public WebViewClient {
140 public: 140 public:
141 virtual ~TestWebViewClient() { } 141 virtual ~TestWebViewClient() { }
142 virtual void initializeLayerTreeView() override; 142 void initializeLayerTreeView() override;
143 virtual WebLayerTreeView* layerTreeView() override { return m_layerTreeView. get(); } 143 WebLayerTreeView* layerTreeView() override { return m_layerTreeView.get(); }
144 144
145 private: 145 private:
146 OwnPtr<WebLayerTreeView> m_layerTreeView; 146 OwnPtr<WebLayerTreeView> m_layerTreeView;
147 }; 147 };
148 148
149 class UseMockScrollbarSettings { 149 class UseMockScrollbarSettings {
150 public: 150 public:
151 UseMockScrollbarSettings() 151 UseMockScrollbarSettings()
152 { 152 {
153 Settings::setMockScrollbarsEnabled(true); 153 Settings::setMockScrollbarsEnabled(true);
154 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true); 154 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(true);
155 EXPECT_TRUE(ScrollbarTheme::theme()->usesOverlayScrollbars()); 155 EXPECT_TRUE(ScrollbarTheme::theme()->usesOverlayScrollbars());
156 } 156 }
157 157
158 ~UseMockScrollbarSettings() 158 ~UseMockScrollbarSettings()
159 { 159 {
160 Settings::setMockScrollbarsEnabled(false); 160 Settings::setMockScrollbarsEnabled(false);
161 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false); 161 RuntimeEnabledFeatures::setOverlayScrollbarsEnabled(false);
162 } 162 }
163 }; 163 };
164 164
165 } // namespace FrameTestHelpers 165 } // namespace FrameTestHelpers
166 } // namespace blink 166 } // namespace blink
167 167
168 #endif // FrameTestHelpers_h 168 #endif // FrameTestHelpers_h
OLDNEW
« no previous file with comments | « Source/web/tests/FakeWebPlugin.h ('k') | Source/web/tests/FrameTestHelpers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698