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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 const NotificationSource& source, | 51 const NotificationSource& source, |
52 const NotificationDetails& details) OVERRIDE { | 52 const NotificationDetails& details) OVERRIDE { |
53 DCHECK(type == NOTIFICATION_DOM_OPERATION_RESPONSE); | 53 DCHECK(type == NOTIFICATION_DOM_OPERATION_RESPONSE); |
54 Details<DomOperationNotificationDetails> dom_op_details(details); | 54 Details<DomOperationNotificationDetails> dom_op_details(details); |
55 response_ = dom_op_details->json; | 55 response_ = dom_op_details->json; |
56 did_respond_ = true; | 56 did_respond_ = true; |
57 message_loop_runner_->Quit(); | 57 message_loop_runner_->Quit(); |
58 } | 58 } |
59 | 59 |
60 // Overridden from WebContentsObserver: | 60 // Overridden from WebContentsObserver: |
61 virtual void RenderViewGone(base::TerminationStatus status) OVERRIDE { | 61 virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE { |
62 message_loop_runner_->Quit(); | 62 message_loop_runner_->Quit(); |
63 } | 63 } |
64 | 64 |
65 bool WaitAndGetResponse(std::string* response) WARN_UNUSED_RESULT { | 65 bool WaitAndGetResponse(std::string* response) WARN_UNUSED_RESULT { |
66 message_loop_runner_->Run(); | 66 message_loop_runner_->Run(); |
67 *response = response_; | 67 *response = response_; |
68 return did_respond_; | 68 return did_respond_; |
69 } | 69 } |
70 | 70 |
71 private: | 71 private: |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 // The queue should not be empty, unless we were quit because of a timeout. | 504 // The queue should not be empty, unless we were quit because of a timeout. |
505 if (message_queue_.empty()) | 505 if (message_queue_.empty()) |
506 return false; | 506 return false; |
507 if (message) | 507 if (message) |
508 *message = message_queue_.front(); | 508 *message = message_queue_.front(); |
509 message_queue_.pop(); | 509 message_queue_.pop(); |
510 return true; | 510 return true; |
511 } | 511 } |
512 | 512 |
513 } // namespace content | 513 } // namespace content |
OLD | NEW |