summaryrefslogtreecommitdiffstats
path: root/chrome_frame/external_tab_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome_frame/external_tab_test.cc')
-rw-r--r--chrome_frame/external_tab_test.cc43
1 files changed, 25 insertions, 18 deletions
diff --git a/chrome_frame/external_tab_test.cc b/chrome_frame/external_tab_test.cc
index 0069522..5017eb2 100644
--- a/chrome_frame/external_tab_test.cc
+++ b/chrome_frame/external_tab_test.cc
@@ -2,13 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/location.h"
-#include "base/task.h"
-#include "base/threading/thread.h"
#include "chrome_frame/external_tab.h"
// #include "base/synchronization/waitable_event.h"
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/location.h"
+#include "base/threading/thread.h"
#include "chrome/common/automation_messages.h"
#include "chrome_frame/navigation_constraints.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
@@ -16,12 +17,6 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gmock_mutant.h"
-
-
-// DISABLE_RUNNABLE_METHOD_REFCOUNT(ExternalTabProxy);
-// DISABLE_RUNNABLE_METHOD_REFCOUNT(UIDelegate);
-DISABLE_RUNNABLE_METHOD_REFCOUNT(ChromeProxyDelegate);
-
using testing::StrictMock;
using testing::_;
using testing::Invoke;
@@ -109,27 +104,39 @@ struct AsyncEventCreator {
}
void Fire_Connected(ChromeProxy* proxy, base::TimeDelta delay) {
- ipc_loop_->PostDelayedTask(FROM_HERE, NewRunnableMethod(delegate_,
- &ChromeProxyDelegate::Connected, proxy), delay.InMilliseconds());
+ ipc_loop_->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&ChromeProxyDelegate::Connected, base::Unretained(delegate_),
+ proxy),
+ delay.InMilliseconds());
}
void Fire_PeerLost(ChromeProxy* proxy,
ChromeProxyDelegate::DisconnectReason reason, base::TimeDelta delay) {
- ipc_loop_->PostDelayedTask(FROM_HERE, NewRunnableMethod(delegate_,
- &ChromeProxyDelegate::PeerLost, proxy, reason), delay.InMilliseconds());
+ ipc_loop_->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&ChromeProxyDelegate::PeerLost, base::Unretained(delegate_),
+ proxy, reason),
+ delay.InMilliseconds());
}
void Fire_Disconnected(base::TimeDelta delay) {
- ipc_loop_->PostDelayedTask(FROM_HERE, NewRunnableMethod(delegate_,
- &ChromeProxyDelegate::Disconnected), delay.InMilliseconds());
+ ipc_loop_->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&ChromeProxyDelegate::Disconnected,
+ base::Unretained(delegate_)),
+ delay.InMilliseconds());
}
void Fire_CompletedCreateTab(bool success, HWND chrome_wnd, HWND tab_window,
int tab_handle, int session_id,
base::TimeDelta delay) {
- ipc_loop_->PostDelayedTask(FROM_HERE, NewRunnableMethod(delegate_,
- &ChromeProxyDelegate::Completed_CreateTab, success, chrome_wnd,
- tab_window, tab_handle, session_id), delay.InMilliseconds());
+ ipc_loop_->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&ChromeProxyDelegate::Completed_CreateTab,
+ base::Unretained(delegate_), success, chrome_wnd, tab_window,
+ tab_handle, session_id),
+ delay.InMilliseconds());
}
private: