| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // 7. At this point, all parsing, resource loads, and layout should be finished. | 73 // 7. At this point, all parsing, resource loads, and layout should be finished. |
| 74 TestWebFrameClient* testClientForFrame(WebFrame* frame) | 74 TestWebFrameClient* testClientForFrame(WebFrame* frame) |
| 75 { | 75 { |
| 76 return static_cast<TestWebFrameClient*>(toWebLocalFrameImpl(frame)->client()
); | 76 return static_cast<TestWebFrameClient*>(toWebLocalFrameImpl(frame)->client()
); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void runServeAsyncRequestsTask(TestWebFrameClient* client) | 79 void runServeAsyncRequestsTask(TestWebFrameClient* client) |
| 80 { | 80 { |
| 81 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); | 81 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); |
| 82 if (client->isLoading()) | 82 if (client->isLoading()) |
| 83 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK
_FROM_HERE, bind(&runServeAsyncRequestsTask, client)); | 83 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK
_FROM_HERE, bind(&runServeAsyncRequestsTask, unretained(client))); |
| 84 else | 84 else |
| 85 testing::exitRunLoop(); | 85 testing::exitRunLoop(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 TestWebFrameClient* defaultWebFrameClient() | 88 TestWebFrameClient* defaultWebFrameClient() |
| 89 { | 89 { |
| 90 DEFINE_STATIC_LOCAL(TestWebFrameClient, client, ()); | 90 DEFINE_STATIC_LOCAL(TestWebFrameClient, client, ()); |
| 91 return &client; | 91 return &client; |
| 92 } | 92 } |
| 93 | 93 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 141 } |
| 142 | 142 |
| 143 void reloadFrameIgnoringCache(WebFrame* frame) | 143 void reloadFrameIgnoringCache(WebFrame* frame) |
| 144 { | 144 { |
| 145 frame->reload(WebFrameLoadType::ReloadBypassingCache); | 145 frame->reload(WebFrameLoadType::ReloadBypassingCache); |
| 146 pumpPendingRequestsForFrameToLoad(frame); | 146 pumpPendingRequestsForFrameToLoad(frame); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void pumpPendingRequestsForFrameToLoad(WebFrame* frame) | 149 void pumpPendingRequestsForFrameToLoad(WebFrame* frame) |
| 150 { | 150 { |
| 151 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FRO
M_HERE, bind(&runServeAsyncRequestsTask, testClientForFrame(frame))); | 151 Platform::current()->currentThread()->getWebTaskRunner()->postTask(BLINK_FRO
M_HERE, bind(&runServeAsyncRequestsTask, unretained(testClientForFrame(frame))))
; |
| 152 testing::enterRunLoop(); | 152 testing::enterRunLoop(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 WebMouseEvent createMouseEvent(WebInputEvent::Type type, WebMouseEvent::Button b
utton, const IntPoint& point, int modifiers) | 155 WebMouseEvent createMouseEvent(WebInputEvent::Type type, WebMouseEvent::Button b
utton, const IntPoint& point, int modifiers) |
| 156 { | 156 { |
| 157 WebMouseEvent result; | 157 WebMouseEvent result; |
| 158 result.type = type; | 158 result.type = type; |
| 159 result.x = result.windowX = result.globalX = point.x(); | 159 result.x = result.windowX = result.globalX = point.x(); |
| 160 result.y = result.windowX = result.globalX = point.y(); | 160 result.y = result.windowX = result.globalX = point.y(); |
| 161 result.modifiers = modifiers; | 161 result.modifiers = modifiers; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 m_frame->close(); | 302 m_frame->close(); |
| 303 } | 303 } |
| 304 | 304 |
| 305 void TestWebViewClient::initializeLayerTreeView() | 305 void TestWebViewClient::initializeLayerTreeView() |
| 306 { | 306 { |
| 307 m_layerTreeView = adoptPtr(new WebLayerTreeViewImplForTesting); | 307 m_layerTreeView = adoptPtr(new WebLayerTreeViewImplForTesting); |
| 308 } | 308 } |
| 309 | 309 |
| 310 } // namespace FrameTestHelpers | 310 } // namespace FrameTestHelpers |
| 311 } // namespace blink | 311 } // namespace blink |
| OLD | NEW |