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 16 matching lines...) Expand all Loading... |
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 "public/platform/WebURLRequest.h" | 34 #include "public/platform/WebURLRequest.h" |
35 #include "public/web/WebFrameClient.h" | 35 #include "public/web/WebFrameClient.h" |
36 #include "public/web/WebHistoryItem.h" | 36 #include "public/web/WebHistoryItem.h" |
| 37 #include "public/web/WebRemoteFrameClient.h" |
37 #include "public/web/WebViewClient.h" | 38 #include "public/web/WebViewClient.h" |
38 #include "web/WebViewImpl.h" | 39 #include "web/WebViewImpl.h" |
39 #include "wtf/PassOwnPtr.h" | 40 #include "wtf/PassOwnPtr.h" |
40 #include <string> | 41 #include <string> |
41 | 42 |
42 namespace blink { | 43 namespace blink { |
43 | 44 |
44 class WebLocalFrameImpl; | 45 class WebLocalFrameImpl; |
45 class WebSettings; | 46 class WebSettings; |
46 | 47 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 virtual void frameDetached(WebFrame*) OVERRIDE; | 102 virtual void frameDetached(WebFrame*) OVERRIDE; |
102 virtual void didStartLoading(bool) OVERRIDE; | 103 virtual void didStartLoading(bool) OVERRIDE; |
103 virtual void didStopLoading() OVERRIDE; | 104 virtual void didStopLoading() OVERRIDE; |
104 | 105 |
105 bool isLoading() { return m_loadsInProgress > 0; } | 106 bool isLoading() { return m_loadsInProgress > 0; } |
106 | 107 |
107 private: | 108 private: |
108 int m_loadsInProgress; | 109 int m_loadsInProgress; |
109 }; | 110 }; |
110 | 111 |
| 112 // Minimal implementation of WebRemoteFrameClient needed for unit tests that loa
d remote frames. Tests that load |
| 113 // frames and need further specialization of WebFrameClient behavior should subc
lass this. |
| 114 class TestWebRemoteFrameClient : public WebRemoteFrameClient { |
| 115 public: |
| 116 // Notifies the embedder that a postMessage was issued to a remote frame. |
| 117 virtual void postMessageEvent( |
| 118 WebLocalFrame* sourceFrame, |
| 119 WebRemoteFrame* targetFrame, |
| 120 WebSecurityOrigin targetOrigin, |
| 121 WebDOMMessageEvent) { } |
| 122 }; |
| 123 |
111 class TestWebViewClient : public WebViewClient { | 124 class TestWebViewClient : public WebViewClient { |
112 public: | 125 public: |
113 virtual ~TestWebViewClient() { } | 126 virtual ~TestWebViewClient() { } |
114 virtual void initializeLayerTreeView() OVERRIDE; | 127 virtual void initializeLayerTreeView() OVERRIDE; |
115 virtual WebLayerTreeView* layerTreeView() OVERRIDE { return m_layerTreeView.
get(); } | 128 virtual WebLayerTreeView* layerTreeView() OVERRIDE { return m_layerTreeView.
get(); } |
116 | 129 |
117 private: | 130 private: |
118 OwnPtr<WebLayerTreeView> m_layerTreeView; | 131 OwnPtr<WebLayerTreeView> m_layerTreeView; |
119 }; | 132 }; |
120 | 133 |
121 } // namespace FrameTestHelpers | 134 } // namespace FrameTestHelpers |
122 } // namespace blink | 135 } // namespace blink |
123 | 136 |
124 #endif // FrameTestHelpers_h | 137 #endif // FrameTestHelpers_h |
OLD | NEW |