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

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

Issue 2154493002: FrameTestHelpers: support Settings-parameterized tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@rls-enable
Patch Set: Elminate unnecessary #include. Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include <memory> 47 #include <memory>
48 #include <string> 48 #include <string>
49 49
50 namespace blink { 50 namespace blink {
51 51
52 class WebFrame; 52 class WebFrame;
53 class WebFrameWidget; 53 class WebFrameWidget;
54 class WebLocalFrame; 54 class WebLocalFrame;
55 class WebRemoteFrame; 55 class WebRemoteFrame;
56 class WebRemoteFrameImpl; 56 class WebRemoteFrameImpl;
57 class WebSettings;
57 enum class WebCachePolicy; 58 enum class WebCachePolicy;
58 59
59 namespace FrameTestHelpers { 60 namespace FrameTestHelpers {
60 61
61 class TestWebFrameClient; 62 class TestWebFrameClient;
62 class TestWebWidgetClient; 63 class TestWebWidgetClient;
63 class TestWebViewClient; 64 class TestWebViewClient;
64 65
65 // Loads a url into the specified WebFrame for testing purposes. Pumps any 66 // Loads a url into the specified WebFrame for testing purposes. Pumps any
66 // pending resource requests, as well as waiting for the threaded parser to 67 // pending resource requests, as well as waiting for the threaded parser to
(...skipping 12 matching lines...) Expand all
79 void pumpPendingRequestsForFrameToLoad(WebFrame*); 80 void pumpPendingRequestsForFrameToLoad(WebFrame*);
80 81
81 WebMouseEvent createMouseEvent(WebInputEvent::Type, WebMouseEvent::Button, const IntPoint&, int modifiers); 82 WebMouseEvent createMouseEvent(WebInputEvent::Type, WebMouseEvent::Button, const IntPoint&, int modifiers);
82 83
83 // Calls WebRemoteFrame::createLocalChild, but with some arguments prefilled 84 // Calls WebRemoteFrame::createLocalChild, but with some arguments prefilled
84 // with default test values (i.e. with a default |client| or |properties| and/or 85 // with default test values (i.e. with a default |client| or |properties| and/or
85 // with a precalculated |uniqueName|). 86 // with a precalculated |uniqueName|).
86 WebLocalFrame* createLocalChild(WebRemoteFrame* parent, const WebString& name = WebString(), WebFrameClient* = nullptr, WebWidgetClient* = nullptr, WebFrame* pr eviousSibling = nullptr, const WebFrameOwnerProperties& = WebFrameOwnerPropertie s()); 87 WebLocalFrame* createLocalChild(WebRemoteFrame* parent, const WebString& name = WebString(), WebFrameClient* = nullptr, WebWidgetClient* = nullptr, WebFrame* pr eviousSibling = nullptr, const WebFrameOwnerProperties& = WebFrameOwnerPropertie s());
87 WebRemoteFrame* createRemoteChild(WebRemoteFrame* parent, WebRemoteFrameClient*, const WebString& name = WebString()); 88 WebRemoteFrame* createRemoteChild(WebRemoteFrame* parent, WebRemoteFrameClient*, const WebString& name = WebString());
88 89
90 // Helpers for unit tests with parameterized WebSettings overrides.
91 typedef void (*SettingOverrideFunction)(WebSettings*);
92 void DefaultSettingOverride(WebSettings*);
93 void RootLayerScrollsSettingOverride(WebSettings*);
89 class SettingOverrider { 94 class SettingOverrider {
90 public: 95 public:
91 virtual void overrideSettings(WebSettings*) = 0; 96 virtual void overrideSettings(WebSettings*) = 0;
92 }; 97 };
93 98
94 // Forces to use mocked overlay scrollbars instead of the default native theme s crollbars to avoid 99 // Forces to use mocked overlay scrollbars instead of the default native theme s crollbars to avoid
95 // crash in Chromium code when it tries to load UI resources that are not availa ble when running 100 // crash in Chromium code when it tries to load UI resources that are not availa ble when running
96 // blink unit tests, and to ensure consistent layout regardless of differences b etween scrollbar themes. 101 // blink unit tests, and to ensure consistent layout regardless of differences b etween scrollbar themes.
97 // WebViewHelper includes this, so this is only needed if a test doesn't use Web ViewHelper or the test 102 // WebViewHelper includes this, so this is only needed if a test doesn't use Web ViewHelper or the test
98 // needs a bigger scope of mock scrollbar settings than the scope of WebViewHelp er. 103 // needs a bigger scope of mock scrollbar settings than the scope of WebViewHelp er.
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 WebDOMMessageEvent) override { } 241 WebDOMMessageEvent) override { }
237 242
238 private: 243 private:
239 Persistent<WebRemoteFrameImpl> const m_frame; 244 Persistent<WebRemoteFrameImpl> const m_frame;
240 }; 245 };
241 246
242 } // namespace FrameTestHelpers 247 } // namespace FrameTestHelpers
243 } // namespace blink 248 } // namespace blink
244 249
245 #endif // FrameTestHelpers_h 250 #endif // FrameTestHelpers_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698