| 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..56bb13e0a62a817f4c59030122e1dd78ad16e523
|
| --- /dev/null
|
| +++ b/content/browser/media/dtls_identity_store_browsertest.cc
|
| @@ -0,0 +1,56 @@
|
| +// 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/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 DTLSIdentityServiceHostForTest : public DTLSIdentityServiceHost {
|
| + protected:
|
| + virtual ~DTLSIdentityServiceHostForTest() {}
|
| +
|
| + private:
|
| + virtual void OnComplete(const std::string& certificate,
|
| + const std::string& private_key) OVERRIDE {
|
| + ASSERT_NE("", certificate);
|
| + ASSERT_NE("", private_key);
|
| + }
|
| +};
|
| +
|
| +class DTLSIdentityStoreBrowserTest : public ContentBrowserTest {
|
| + public:
|
| + DTLSIdentityStoreBrowserTest() {}
|
| + virtual ~DTLSIdentityStoreBrowserTest() {}
|
| +
|
| + void CheckRequestIdentity() {
|
| + GURL url("http://google.com");
|
| + DTLSIdentityMsg_RequestIdentity msg(url, "b", "c");
|
| + scoped_refptr<DTLSIdentityServiceHostForTest> host =
|
| + new DTLSIdentityServiceHostForTest();
|
| + bool ok = true;
|
| + host->OnMessageReceived(msg, &ok);
|
| + ASSERT_EQ(true, ok);
|
| + }
|
| +};
|
| +
|
| +IN_PROC_BROWSER_TEST_F(DTLSIdentityStoreBrowserTest, RequestIdentity) {
|
| + content::BrowserThread::PostTask(
|
| + content::BrowserThread::IO,
|
| + FROM_HERE,
|
| + base::Bind(&DTLSIdentityStoreBrowserTest::CheckRequestIdentity,
|
| + base::Unretained(this)));
|
| + NavigateToURL(shell(), GURL("about:blank"));
|
| +}
|
| +
|
| +} // namespace
|
| +} // namespace content
|
|
|