| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 WebTreeScopeType, | 246 WebTreeScopeType, |
| 247 const WebString& name, | 247 const WebString& name, |
| 248 const WebString& uniqueName, | 248 const WebString& uniqueName, |
| 249 WebSandboxFlags, | 249 WebSandboxFlags, |
| 250 const WebFrameOwnerProperties&) override; | 250 const WebFrameOwnerProperties&) override; |
| 251 void didStartLoading(bool) override; | 251 void didStartLoading(bool) override; |
| 252 void didStopLoading() override; | 252 void didStopLoading() override; |
| 253 | 253 |
| 254 bool isLoading() { return m_loadsInProgress > 0; } | 254 bool isLoading() { return m_loadsInProgress > 0; } |
| 255 | 255 |
| 256 // Tests can override the virtual method below to mock the interface provider. |
| 257 virtual blink::InterfaceProvider* interfaceProvider() { return nullptr; } |
| 258 |
| 256 private: | 259 private: |
| 257 int m_loadsInProgress = 0; | 260 int m_loadsInProgress = 0; |
| 258 }; | 261 }; |
| 259 | 262 |
| 260 // Minimal implementation of WebRemoteFrameClient needed for unit tests that | 263 // Minimal implementation of WebRemoteFrameClient needed for unit tests that |
| 261 // load remote frames. Tests that load frames and need further specialization | 264 // load remote frames. Tests that load frames and need further specialization |
| 262 // of WebFrameClient behavior should subclass this. | 265 // of WebFrameClient behavior should subclass this. |
| 263 class TestWebRemoteFrameClient : public WebRemoteFrameClient { | 266 class TestWebRemoteFrameClient : public WebRemoteFrameClient { |
| 264 public: | 267 public: |
| 265 TestWebRemoteFrameClient(); | 268 TestWebRemoteFrameClient(); |
| 266 | 269 |
| 267 WebRemoteFrameImpl* frame() const { return m_frame; } | 270 WebRemoteFrameImpl* frame() const { return m_frame; } |
| 268 | 271 |
| 269 // WebRemoteFrameClient overrides: | 272 // WebRemoteFrameClient overrides: |
| 270 void frameDetached(DetachType) override; | 273 void frameDetached(DetachType) override; |
| 271 void forwardPostMessage(WebLocalFrame* sourceFrame, | 274 void forwardPostMessage(WebLocalFrame* sourceFrame, |
| 272 WebRemoteFrame* targetFrame, | 275 WebRemoteFrame* targetFrame, |
| 273 WebSecurityOrigin targetOrigin, | 276 WebSecurityOrigin targetOrigin, |
| 274 WebDOMMessageEvent) override {} | 277 WebDOMMessageEvent) override {} |
| 275 | 278 |
| 276 private: | 279 private: |
| 277 Persistent<WebRemoteFrameImpl> const m_frame; | 280 Persistent<WebRemoteFrameImpl> const m_frame; |
| 278 }; | 281 }; |
| 279 | 282 |
| 280 } // namespace FrameTestHelpers | 283 } // namespace FrameTestHelpers |
| 281 } // namespace blink | 284 } // namespace blink |
| 282 | 285 |
| 283 #endif // FrameTestHelpers_h | 286 #endif // FrameTestHelpers_h |
| OLD | NEW |