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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 private: | 91 private: |
92 TestWebFrameClient* const m_client; | 92 TestWebFrameClient* const m_client; |
93 }; | 93 }; |
94 | 94 |
95 void pumpPendingRequests(WebFrame* frame) | 95 void pumpPendingRequests(WebFrame* frame) |
96 { | 96 { |
97 Platform::current()->currentThread()->postTask(FROM_HERE, new ServeAsyncRequ
estsTask(testClientForFrame(frame))); | 97 Platform::current()->currentThread()->postTask(FROM_HERE, new ServeAsyncRequ
estsTask(testClientForFrame(frame))); |
98 Platform::current()->unitTestSupport()->enterRunLoop(); | 98 Platform::current()->unitTestSupport()->enterRunLoop(); |
99 } | 99 } |
100 | 100 |
101 class LoadTask : public WebThread::Task { | |
102 public: | |
103 LoadTask(WebFrame* frame, const WebURLRequest& request) | |
104 : m_frame(frame) | |
105 , m_request(request) | |
106 { | |
107 } | |
108 | |
109 void run() override | |
110 { | |
111 m_frame->loadRequest(m_request); | |
112 } | |
113 | |
114 private: | |
115 WebFrame* const m_frame; | |
116 const WebURLRequest m_request; | |
117 }; | |
118 | |
119 class LoadHTMLStringTask : public WebThread::Task { | 101 class LoadHTMLStringTask : public WebThread::Task { |
120 public: | 102 public: |
121 LoadHTMLStringTask(WebFrame* frame, const std::string& html, const WebURL& b
aseURL) | 103 LoadHTMLStringTask(WebFrame* frame, const std::string& html, const WebURL& b
aseURL) |
122 : m_frame(frame) | 104 : m_frame(frame) |
123 , m_html(html) | 105 , m_html(html) |
124 , m_baseURL(baseURL) | 106 , m_baseURL(baseURL) |
125 { | 107 { |
126 } | 108 } |
127 | 109 |
128 void run() override | 110 void run() override |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 m_frame->parent()->removeChild(m_frame); | 319 m_frame->parent()->removeChild(m_frame); |
338 m_frame->close(); | 320 m_frame->close(); |
339 } | 321 } |
340 | 322 |
341 void TestWebViewClient::initializeLayerTreeView() | 323 void TestWebViewClient::initializeLayerTreeView() |
342 { | 324 { |
343 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLay
erTreeViewForTesting()); | 325 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLay
erTreeViewForTesting()); |
344 ASSERT(m_layerTreeView); | 326 ASSERT(m_layerTreeView); |
345 } | 327 } |
346 | 328 |
| 329 LoadTask::LoadTask(WebFrame* frame, const WebURLRequest& request) |
| 330 : m_frame(frame) |
| 331 , m_request(request) |
| 332 { |
| 333 } |
| 334 |
| 335 void LoadTask::run() |
| 336 { |
| 337 m_frame->loadRequest(m_request); |
| 338 } |
| 339 |
347 } // namespace FrameTestHelpers | 340 } // namespace FrameTestHelpers |
348 } // namespace blink | 341 } // namespace blink |
OLD | NEW |