Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1115)

Unified Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 1351393002: Make getBluetoothManualChooserEvents() asynchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Go back to the callback interface. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/renderer/layout_test/blink_test_runner.cc
diff --git a/content/shell/renderer/layout_test/blink_test_runner.cc b/content/shell/renderer/layout_test/blink_test_runner.cc
index bc52f3ebc3d0ec46fddee042430c975c924227d5..2233563cca55e359145d1822a985d36a1c964fef 100644
--- a/content/shell/renderer/layout_test/blink_test_runner.cc
+++ b/content/shell/renderer/layout_test/blink_test_runner.cc
@@ -484,12 +484,13 @@ void BlinkTestRunner::SetBluetoothMockDataSet(const std::string& name) {
void BlinkTestRunner::SetBluetoothManualChooser() {
Send(new ShellViewHostMsg_SetBluetoothManualChooser(routing_id(), true));
}
-std::vector<std::string> BlinkTestRunner::GetBluetoothManualChooserEvents() {
- std::vector<std::string> result;
- Send(new ShellViewHostMsg_GetBluetoothManualChooserEvents(routing_id(),
- &result));
- return result;
+
+void BlinkTestRunner::GetBluetoothManualChooserEvents(
+ const base::Callback<void(const std::vector<std::string>&)>& callback) {
+ get_bluetooth_events_callbacks_.push_back(callback);
+ Send(new ShellViewHostMsg_GetBluetoothManualChooserEvents(routing_id()));
}
+
void BlinkTestRunner::SendBluetoothManualChooserEvent(
const std::string& event,
const std::string& argument) {
@@ -732,6 +733,8 @@ bool BlinkTestRunner::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(ShellViewMsg_Reset, OnReset)
IPC_MESSAGE_HANDLER(ShellViewMsg_NotifyDone, OnNotifyDone)
IPC_MESSAGE_HANDLER(ShellViewMsg_TryLeakDetection, OnTryLeakDetection)
+ IPC_MESSAGE_HANDLER(ShellViewMsg_ReplyBluetoothManualChooserEvents,
+ OnReplyBluetoothManualChooserEvents)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -911,6 +914,15 @@ void BlinkTestRunner::OnTryLeakDetection() {
leak_detector_->TryLeakDetection(main_frame);
}
+void BlinkTestRunner::OnReplyBluetoothManualChooserEvents(
+ const std::vector<std::string>& events) {
+ DCHECK(!get_bluetooth_events_callbacks_.empty());
+ base::Callback<void(const std::vector<std::string>&)> callback =
+ get_bluetooth_events_callbacks_.front();
+ get_bluetooth_events_callbacks_.pop_front();
+ callback.Run(events);
+}
+
void BlinkTestRunner::ReportLeakDetectionResult(
const LeakDetectionResult& report) {
Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698