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

Unified Diff: content/browser/media/dtls_identity_store_browsertest.cc

Issue 15969025: Generates the DTLS identity in browser process and returns it to render process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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
Index: content/browser/media/dtls_identity_store_browsertest.cc
diff --git a/content/browser/media/dtls_identity_store_browsertest.cc b/content/browser/media/dtls_identity_store_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4621d48f00588ef4dc878f20d444fd2fdfbbbcd2
--- /dev/null
+++ b/content/browser/media/dtls_identity_store_browsertest.cc
@@ -0,0 +1,54 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/command_line.h"
+#include "content/browser/renderer_host/media/dtls_identity_service_host.h"
+#include "content/browser/web_contents/web_contents_impl.h"
+#include "content/common/media/dtls_identity_messages.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/test/browser_test_utils.h"
+#include "content/shell/shell.h"
+#include "content/test/content_browser_test.h"
+#include "content/test/content_browser_test_utils.h"
+
+namespace content {
+namespace {
+
+class DummyListener : public IPC::Listener {
jam 2013/06/06 16:22:32 this isn't used
jiayl 2013/06/06 17:07:37 Done.
+ public:
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE {
+ return true;
+ }
+};
+
+class DTLSIdentityStoreBrowserTest : public ContentBrowserTest {
+ public:
+ DTLSIdentityStoreBrowserTest() {}
+ virtual ~DTLSIdentityStoreBrowserTest() {}
+
+ void CheckGetOrGenerateIdentity() {
+ int render_process_id =
+ shell()->web_contents()->GetRenderProcessHost()->GetID();
+ GURL url("http://google.com");
+ DTLSIdentityMsg_GetOrGenerate msg(url, "b", "c");
+ scoped_refptr<DTLSIdentityServiceHost> host =
+ new DTLSIdentityServiceHost(render_process_id);
+ bool ok = true;
+ host->OnMessageReceived(msg, &ok);
jam 2013/06/06 16:22:32 what is the point of this test? i.e. what failure
jiayl 2013/06/06 17:07:37 I want to check the IPC handling and DTLSIdentityS
jam 2013/06/07 00:46:49 i'm just saying if there was an error that got int
+ ASSERT_EQ(true, ok);
+ }
+};
+
+IN_PROC_BROWSER_TEST_F(DTLSIdentityStoreBrowserTest, GetOrGenerate) {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&DTLSIdentityStoreBrowserTest::CheckGetOrGenerateIdentity,
+ base::Unretained(this)));
+ NavigateToURL(shell(), GURL("about:blank"));
+}
+
+} // namespace
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698