Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: extensions/browser/api/cast_channel/cast_channel_api_unittest.cc

Issue 395333003: Extensions: Move cast_channel and hid APIs to extensions/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win/mac Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/extensions/api/cast_channel/cast_channel_api.h" 5 #include "extensions/browser/api/cast_channel/cast_channel_api.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "net/base/ip_endpoint.h" 8 #include "net/base/ip_endpoint.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 namespace api { 13 namespace core_api {
14 namespace cast_channel { 14 namespace cast_channel {
15 15
16 // Tests URL parsing and validation. 16 // Tests URL parsing and validation.
17 TEST(CastChannelOpenFunctionTest, TestParseChannelUrl) { 17 TEST(CastChannelOpenFunctionTest, TestParseChannelUrl) {
18 typedef CastChannelOpenFunction ccof; 18 typedef CastChannelOpenFunction ccof;
19 ConnectInfo connect_info; 19 ConnectInfo connect_info;
20 20
21 EXPECT_TRUE(ccof::ParseChannelUrl(GURL("cast://192.0.0.1:8009"), 21 EXPECT_TRUE(ccof::ParseChannelUrl(GURL("cast://192.0.0.1:8009"),
22 &connect_info)); 22 &connect_info));
23 EXPECT_EQ(connect_info.ip_address, "192.0.0.1"); 23 EXPECT_EQ(connect_info.ip_address, "192.0.0.1");
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Invalid auth 80 // Invalid auth
81 ConnectInfo invalid_auth_connect_info; 81 ConnectInfo invalid_auth_connect_info;
82 invalid_auth_connect_info.ip_address = "192.0.0.1"; 82 invalid_auth_connect_info.ip_address = "192.0.0.1";
83 invalid_auth_connect_info.port = 8009; 83 invalid_auth_connect_info.port = 8009;
84 invalid_auth_connect_info.auth = CHANNEL_AUTH_TYPE_NONE; 84 invalid_auth_connect_info.auth = CHANNEL_AUTH_TYPE_NONE;
85 ip_endpoint.reset(ccof::ParseConnectInfo(invalid_auth_connect_info)); 85 ip_endpoint.reset(ccof::ParseConnectInfo(invalid_auth_connect_info));
86 EXPECT_TRUE(ip_endpoint.get() == NULL); 86 EXPECT_TRUE(ip_endpoint.get() == NULL);
87 } 87 }
88 88
89 } // namespace cast_channel 89 } // namespace cast_channel
90 } // namespace api 90 } // namespace core_api
91 } // namespace extensions 91 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698