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