| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/public/test/browser_test_utils.h" | 5 #include "content/public/test/browser_test_utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <tuple> | 8 #include <tuple> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 } | 1320 } |
| 1321 | 1321 |
| 1322 bool DOMMessageQueue::WaitForMessage(std::string* message) { | 1322 bool DOMMessageQueue::WaitForMessage(std::string* message) { |
| 1323 DCHECK(message); | 1323 DCHECK(message); |
| 1324 if (message_queue_.empty()) { | 1324 if (message_queue_.empty()) { |
| 1325 // This will be quit when a new message comes in. | 1325 // This will be quit when a new message comes in. |
| 1326 message_loop_runner_ = | 1326 message_loop_runner_ = |
| 1327 new MessageLoopRunner(MessageLoopRunner::QuitMode::IMMEDIATE); | 1327 new MessageLoopRunner(MessageLoopRunner::QuitMode::IMMEDIATE); |
| 1328 message_loop_runner_->Run(); | 1328 message_loop_runner_->Run(); |
| 1329 } | 1329 } |
| 1330 // The queue should not be empty, unless we were quit because of a timeout. | 1330 return PopMessage(message); |
| 1331 } |
| 1332 |
| 1333 bool DOMMessageQueue::PopMessage(std::string* message) { |
| 1334 DCHECK(message); |
| 1331 if (message_queue_.empty()) | 1335 if (message_queue_.empty()) |
| 1332 return false; | 1336 return false; |
| 1333 *message = message_queue_.front(); | 1337 *message = message_queue_.front(); |
| 1334 message_queue_.pop(); | 1338 message_queue_.pop(); |
| 1335 return true; | 1339 return true; |
| 1336 } | 1340 } |
| 1337 | 1341 |
| 1338 class WebContentsAddedObserver::RenderViewCreatedObserver | 1342 class WebContentsAddedObserver::RenderViewCreatedObserver |
| 1339 : public WebContentsObserver { | 1343 : public WebContentsObserver { |
| 1340 public: | 1344 public: |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1837 IPC::IpcSecurityTestUtil::PwnMessageReceived( | 1841 IPC::IpcSecurityTestUtil::PwnMessageReceived( |
| 1838 process->GetChannel(), | 1842 process->GetChannel(), |
| 1839 FileSystemHostMsg_Write(request_id, file_path, blob_uuid, position)); | 1843 FileSystemHostMsg_Write(request_id, file_path, blob_uuid, position)); |
| 1840 | 1844 |
| 1841 // If this started an async operation, wait for it to complete. | 1845 // If this started an async operation, wait for it to complete. |
| 1842 if (waiter.did_start_update()) | 1846 if (waiter.did_start_update()) |
| 1843 waiter.WaitForEndUpdate(); | 1847 waiter.WaitForEndUpdate(); |
| 1844 } | 1848 } |
| 1845 | 1849 |
| 1846 } // namespace content | 1850 } // namespace content |
| OLD | NEW |