| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 MOCK_CONST_METHOD0(ready_state, cast_channel::ReadyState()); | 89 MOCK_CONST_METHOD0(ready_state, cast_channel::ReadyState()); |
| 90 MOCK_CONST_METHOD0(error_state, cast_channel::ChannelError()); | 90 MOCK_CONST_METHOD0(error_state, cast_channel::ChannelError()); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace | 93 } // namespace |
| 94 | 94 |
| 95 class CastChannelAPITest : public ExtensionApiTest { | 95 class CastChannelAPITest : public ExtensionApiTest { |
| 96 public: | 96 public: |
| 97 CastChannelAPITest() {} | 97 CastChannelAPITest() {} |
| 98 | 98 |
| 99 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 99 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 100 ExtensionApiTest::SetUpCommandLine(command_line); | 100 ExtensionApiTest::SetUpCommandLine(command_line); |
| 101 command_line->AppendSwitchASCII( | 101 command_line->AppendSwitchASCII( |
| 102 extensions::switches::kWhitelistedExtensionID, | 102 extensions::switches::kWhitelistedExtensionID, |
| 103 kTestExtensionId); | 103 kTestExtensionId); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void SetUpMockCastSocket() { | 106 void SetUpMockCastSocket() { |
| 107 extensions::CastChannelAPI* api = GetApi(); | 107 extensions::CastChannelAPI* api = GetApi(); |
| 108 net::IPAddressNumber ip_number; | 108 net::IPAddressNumber ip_number; |
| 109 net::ParseIPLiteralToNumber("192.168.1.1", &ip_number); | 109 net::ParseIPLiteralToNumber("192.168.1.1", &ip_number); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 cast_channel_send_function.get(), | 389 cast_channel_send_function.get(), |
| 390 "[{\"channelId\": 1, \"url\": \"cast://127.0.0.1:8009\", " | 390 "[{\"channelId\": 1, \"url\": \"cast://127.0.0.1:8009\", " |
| 391 "\"connectInfo\": " | 391 "\"connectInfo\": " |
| 392 "{\"ipAddress\": \"127.0.0.1\", \"port\": 8009, " | 392 "{\"ipAddress\": \"127.0.0.1\", \"port\": 8009, " |
| 393 "\"auth\": \"ssl\"}, \"readyState\": \"open\"}, " | 393 "\"auth\": \"ssl\"}, \"readyState\": \"open\"}, " |
| 394 "{\"namespace_\": \"foo\", \"sourceId\": \"src\", " | 394 "{\"namespace_\": \"foo\", \"sourceId\": \"src\", " |
| 395 "\"destinationId\": \"\", \"data\": \"data\"}]", | 395 "\"destinationId\": \"\", \"data\": \"data\"}]", |
| 396 browser()); | 396 browser()); |
| 397 EXPECT_EQ(error, "message_info.destination_id is required"); | 397 EXPECT_EQ(error, "message_info.destination_id is required"); |
| 398 } | 398 } |
| OLD | NEW |