OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <deque> | 5 #include <deque> |
6 | 6 |
7 #include "content/browser/child_process_security_policy_impl.h" | 7 #include "content/browser/child_process_security_policy_impl.h" |
8 #include "content/browser/media/webrtc_identity_store.h" | 8 #include "content/browser/media/webrtc_identity_store.h" |
9 #include "content/browser/renderer_host/media/webrtc_identity_service_host.h" | 9 #include "content/browser/renderer_host/media/webrtc_identity_service_host.h" |
10 #include "content/common/media/webrtc_identity_messages.h" | 10 #include "content/common/media/webrtc_identity_messages.h" |
11 #include "content/public/test/test_browser_thread_bundle.h" | 11 #include "content/public/test/test_browser_thread_bundle.h" |
12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 static const char FAKE_ORIGIN[] = "http://fake.com"; | 20 const char FAKE_ORIGIN[] = "http://fake.com"; |
21 static const char FAKE_IDENTITY_NAME[] = "fake identity"; | 21 const char FAKE_IDENTITY_NAME[] = "fake identity"; |
22 static const char FAKE_COMMON_NAME[] = "fake common name"; | 22 const char FAKE_COMMON_NAME[] = "fake common name"; |
23 static const char FAKE_CERTIFICATE[] = "fake cert"; | 23 const char FAKE_CERTIFICATE[] = "fake cert"; |
24 static const char FAKE_PRIVATE_KEY[] = "fake private key"; | 24 const char FAKE_PRIVATE_KEY[] = "fake private key"; |
25 static const int FAKE_ERROR = 100; | 25 const int FAKE_RENDERER_ID = 10; |
26 static const int FAKE_RENDERER_ID = 10; | |
27 | 26 |
28 class MockWebRTCIdentityStore : public WebRTCIdentityStore { | 27 class MockWebRTCIdentityStore : public WebRTCIdentityStore { |
29 public: | 28 public: |
30 MockWebRTCIdentityStore() : WebRTCIdentityStore(base::FilePath(), NULL) {} | 29 MockWebRTCIdentityStore() : WebRTCIdentityStore(base::FilePath(), NULL) {} |
31 | 30 |
32 virtual base::Closure RequestIdentity( | 31 virtual base::Closure RequestIdentity( |
33 const GURL& origin, | 32 const GURL& origin, |
34 const std::string& identity_name, | 33 const std::string& identity_name, |
35 const std::string& common_name, | 34 const std::string& common_name, |
36 const CompletionCallback& callback) OVERRIDE { | 35 const CompletionCallback& callback) OVERRIDE { |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 TEST_F(WebRTCIdentityServiceHostTest, TestOriginAccessDenied) { | 177 TEST_F(WebRTCIdentityServiceHostTest, TestOriginAccessDenied) { |
179 ChildProcessSecurityPolicyImpl* policy = | 178 ChildProcessSecurityPolicyImpl* policy = |
180 ChildProcessSecurityPolicyImpl::GetInstance(); | 179 ChildProcessSecurityPolicyImpl::GetInstance(); |
181 policy->Remove(FAKE_RENDERER_ID); | 180 policy->Remove(FAKE_RENDERER_ID); |
182 | 181 |
183 SendRequestToHost(); | 182 SendRequestToHost(); |
184 VerifyRequestFailedMessage(net::ERR_ACCESS_DENIED); | 183 VerifyRequestFailedMessage(net::ERR_ACCESS_DENIED); |
185 } | 184 } |
186 | 185 |
187 } // namespace content | 186 } // namespace content |
OLD | NEW |