Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "base/command_line.h" | |
| 6 #include "content/browser/renderer_host/media/dtls_identity_service_host.h" | |
| 7 #include "content/browser/web_contents/web_contents_impl.h" | |
| 8 #include "content/common/media/dtls_identity_messages.h" | |
| 9 #include "content/public/browser/browser_thread.h" | |
| 10 #include "content/public/browser/render_process_host.h" | |
| 11 #include "content/public/test/browser_test_utils.h" | |
| 12 #include "content/shell/shell.h" | |
| 13 #include "content/test/content_browser_test.h" | |
| 14 #include "content/test/content_browser_test_utils.h" | |
| 15 | |
| 16 namespace content { | |
| 17 namespace { | |
| 18 | |
| 19 class DummyListener : public IPC::Listener { | |
|
jam
2013/06/06 16:22:32
this isn't used
jiayl
2013/06/06 17:07:37
Done.
| |
| 20 public: | |
| 21 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { | |
| 22 return true; | |
| 23 } | |
| 24 }; | |
| 25 | |
| 26 class DTLSIdentityStoreBrowserTest : public ContentBrowserTest { | |
| 27 public: | |
| 28 DTLSIdentityStoreBrowserTest() {} | |
| 29 virtual ~DTLSIdentityStoreBrowserTest() {} | |
| 30 | |
| 31 void CheckGetOrGenerateIdentity() { | |
| 32 int render_process_id = | |
| 33 shell()->web_contents()->GetRenderProcessHost()->GetID(); | |
| 34 GURL url("http://google.com"); | |
| 35 DTLSIdentityMsg_GetOrGenerate msg(url, "b", "c"); | |
| 36 scoped_refptr<DTLSIdentityServiceHost> host = | |
| 37 new DTLSIdentityServiceHost(render_process_id); | |
| 38 bool ok = true; | |
| 39 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
| |
| 40 ASSERT_EQ(true, ok); | |
| 41 } | |
| 42 }; | |
| 43 | |
| 44 IN_PROC_BROWSER_TEST_F(DTLSIdentityStoreBrowserTest, GetOrGenerate) { | |
| 45 content::BrowserThread::PostTask( | |
| 46 content::BrowserThread::IO, | |
| 47 FROM_HERE, | |
| 48 base::Bind(&DTLSIdentityStoreBrowserTest::CheckGetOrGenerateIdentity, | |
| 49 base::Unretained(this))); | |
| 50 NavigateToURL(shell(), GURL("about:blank")); | |
| 51 } | |
| 52 | |
| 53 } // namespace | |
| 54 } // namespace content | |
| OLD | NEW |