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/kill.h" | 10 #include "base/process/kill.h" |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 EXPECT_TRUE(web_contents != NULL); | 591 EXPECT_TRUE(web_contents != NULL); |
592 } | 592 } |
593 | 593 |
594 WebContentsDestroyedWatcher::~WebContentsDestroyedWatcher() { | 594 WebContentsDestroyedWatcher::~WebContentsDestroyedWatcher() { |
595 } | 595 } |
596 | 596 |
597 void WebContentsDestroyedWatcher::Wait() { | 597 void WebContentsDestroyedWatcher::Wait() { |
598 message_loop_runner_->Run(); | 598 message_loop_runner_->Run(); |
599 } | 599 } |
600 | 600 |
601 void WebContentsDestroyedWatcher::WebContentsDestroyed( | 601 void WebContentsDestroyedWatcher::WebContentsDestroyed() { |
602 WebContents* web_contents) { | |
603 message_loop_runner_->Quit(); | 602 message_loop_runner_->Quit(); |
604 } | 603 } |
605 | 604 |
606 RenderProcessHostWatcher::RenderProcessHostWatcher( | 605 RenderProcessHostWatcher::RenderProcessHostWatcher( |
607 RenderProcessHost* render_process_host, WatchType type) | 606 RenderProcessHost* render_process_host, WatchType type) |
608 : render_process_host_(render_process_host), | 607 : render_process_host_(render_process_host), |
609 type_(type), | 608 type_(type), |
610 message_loop_runner_(new MessageLoopRunner) { | 609 message_loop_runner_(new MessageLoopRunner) { |
611 render_process_host_->AddObserver(this); | 610 render_process_host_->AddObserver(this); |
612 } | 611 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 672 } |
674 // The queue should not be empty, unless we were quit because of a timeout. | 673 // The queue should not be empty, unless we were quit because of a timeout. |
675 if (message_queue_.empty()) | 674 if (message_queue_.empty()) |
676 return false; | 675 return false; |
677 *message = message_queue_.front(); | 676 *message = message_queue_.front(); |
678 message_queue_.pop(); | 677 message_queue_.pop(); |
679 return true; | 678 return true; |
680 } | 679 } |
681 | 680 |
682 } // namespace content | 681 } // namespace content |
OLD | NEW |