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

Unified Diff: content/test/test_render_frame_host.cc

Issue 2050803002: Better way to implement FrameConnectedBluetoothDevicesTest Base URL: https://chromium.googlesource.com/chromium/src.git@patch_ortuno
Patch Set: Created 4 years, 6 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/test/test_render_frame_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/test_render_frame_host.cc
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index 8a21ccfd4ec6d2020c0bfc048a6af225b41b030e..88fd540ffc609c87b76451fe143d06e7338f056a 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -20,7 +20,9 @@
#include "content/test/browser_side_navigation_test_utils.h"
#include "content/test/test_navigation_url_loader.h"
#include "content/test/test_render_view_host.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
#include "net/base/load_flags.h"
+#include "third_party/WebKit/public/platform/modules/bluetooth/web_bluetooth.mojom.h"
#include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
#include "third_party/WebKit/public/web/WebSandboxFlags.h"
#include "third_party/WebKit/public/web/WebTreeScopeType.h"
@@ -428,6 +430,19 @@ void TestRenderFrameHost::PrepareForCommitWithServerRedirect(
url_loader->CallOnResponseStarted(response, MakeEmptyStream(), nullptr);
}
+WebBluetoothServiceImpl*
+TestRenderFrameHost::CreateWebBluetoothServiceForTesting() {
+ // TODO(nick): Right now I'm leaking the WebBluetoothServicePtr, because I
+ // don't know the lifetime implications. We should either free it here or
+ // return it to the caller. In fact, it may be desireable to return it to the
+ // caller anyway (as a pair<ServicePtr, WebBluetoothServiceImpl> ?)
+ auto service_ptr = new blink::mojom::WebBluetoothServicePtr();
+ WebBluetoothServiceImpl* service =
+ RenderFrameHostImpl::CreateWebBluetoothService(
+ mojo::GetProxy(service_ptr)); // TODO(nick): Don't leak service_ptr.
+ return service;
+}
+
int32_t TestRenderFrameHost::ComputeNextPageID() {
const NavigationEntryImpl* entry = static_cast<NavigationEntryImpl*>(
frame_tree_node()->navigator()->GetController()->GetPendingEntry());
« no previous file with comments | « content/test/test_render_frame_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698