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