OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_function_test_utils.h" | 9 #include "chrome/browser/extensions/extension_function_test_utils.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 ACTION_P2(InvokeDelegateOnError, api_test, api) { | 64 ACTION_P2(InvokeDelegateOnError, api_test, api) { |
65 api_test->CallOnError(api); | 65 api_test->CallOnError(api); |
66 } | 66 } |
67 | 67 |
68 class MockCastSocket : public CastSocket { | 68 class MockCastSocket : public CastSocket { |
69 public: | 69 public: |
70 explicit MockCastSocket(CastSocket::Delegate* delegate, | 70 explicit MockCastSocket(CastSocket::Delegate* delegate, |
71 net::IPEndPoint ip_endpoint, | 71 net::IPEndPoint ip_endpoint, |
72 net::NetLog* net_log, | 72 net::NetLog* net_log, |
73 Logger* logger) | 73 const scoped_refptr<Logger>& logger) |
74 : CastSocket(kTestExtensionId, | 74 : CastSocket(kTestExtensionId, |
75 ip_endpoint, | 75 ip_endpoint, |
76 cast_channel::CHANNEL_AUTH_TYPE_SSL, | 76 cast_channel::CHANNEL_AUTH_TYPE_SSL, |
77 delegate, | 77 delegate, |
78 net_log, | 78 net_log, |
79 base::TimeDelta::FromMilliseconds(kTimeoutMs), | 79 base::TimeDelta::FromMilliseconds(kTimeoutMs), |
80 logger) {} | 80 logger) {} |
81 virtual ~MockCastSocket() {} | 81 virtual ~MockCastSocket() {} |
82 | 82 |
83 MOCK_METHOD1(Connect, void(const net::CompletionCallback& callback)); | 83 MOCK_METHOD1(Connect, void(const net::CompletionCallback& callback)); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 cast_channel_send_function.get(), | 385 cast_channel_send_function.get(), |
386 "[{\"channelId\": 1, \"url\": \"cast://127.0.0.1:8009\", " | 386 "[{\"channelId\": 1, \"url\": \"cast://127.0.0.1:8009\", " |
387 "\"connectInfo\": " | 387 "\"connectInfo\": " |
388 "{\"ipAddress\": \"127.0.0.1\", \"port\": 8009, " | 388 "{\"ipAddress\": \"127.0.0.1\", \"port\": 8009, " |
389 "\"auth\": \"ssl\"}, \"readyState\": \"open\"}, " | 389 "\"auth\": \"ssl\"}, \"readyState\": \"open\"}, " |
390 "{\"namespace_\": \"foo\", \"sourceId\": \"src\", " | 390 "{\"namespace_\": \"foo\", \"sourceId\": \"src\", " |
391 "\"destinationId\": \"\", \"data\": \"data\"}]", | 391 "\"destinationId\": \"\", \"data\": \"data\"}]", |
392 browser()); | 392 browser()); |
393 EXPECT_EQ(error, "message_info.destination_id is required"); | 393 EXPECT_EQ(error, "message_info.destination_id is required"); |
394 } | 394 } |
OLD | NEW |