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

Unified Diff: chrome/browser/extensions/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: rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/cast_channel/cast_channel_api_unittest.cc
diff --git a/chrome/browser/extensions/api/cast_channel/cast_channel_api_unittest.cc b/chrome/browser/extensions/api/cast_channel/cast_channel_api_unittest.cc
deleted file mode 100644
index e736f16dd4cfe64eb57e240b93024a862b89ab38..0000000000000000000000000000000000000000
--- a/chrome/browser/extensions/api/cast_channel/cast_channel_api_unittest.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright 2014 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 "chrome/browser/extensions/api/cast_channel/cast_channel_api.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "net/base/ip_endpoint.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "url/gurl.h"
-
-namespace extensions {
-namespace api {
-namespace cast_channel {
-
-// Tests URL parsing and validation.
-TEST(CastChannelOpenFunctionTest, TestParseChannelUrl) {
- typedef CastChannelOpenFunction ccof;
- ConnectInfo connect_info;
-
- EXPECT_TRUE(ccof::ParseChannelUrl(GURL("cast://192.0.0.1:8009"),
- &connect_info));
- EXPECT_EQ(connect_info.ip_address, "192.0.0.1");
- EXPECT_EQ(connect_info.port, 8009);
- EXPECT_EQ(connect_info.auth, CHANNEL_AUTH_TYPE_SSL);
-
- EXPECT_TRUE(ccof::ParseChannelUrl(GURL("casts://192.0.0.1:12345"),
- &connect_info));
- EXPECT_EQ(connect_info.ip_address, "192.0.0.1");
- EXPECT_EQ(connect_info.port, 12345);
- EXPECT_EQ(connect_info.auth, CHANNEL_AUTH_TYPE_SSL_VERIFIED);
-
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("http://192.0.0.1:12345"),
- &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("cast:192.0.0.1:12345"),
- &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("cast://:12345"), &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("cast://192.0.0.1:abcd"),
- &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL(""), &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("foo"), &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("cast:"), &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("cast::"), &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("cast://192.0.0.1"), &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("cast://:"), &connect_info));
- EXPECT_FALSE(ccof::ParseChannelUrl(GURL("cast://192.0.0.1:"), &connect_info));
-}
-
-// Tests parsing of ConnectInfo.
-TEST(CastChannelOpenFunctionTest, TestParseConnectInfo) {
- typedef CastChannelOpenFunction ccof;
- scoped_ptr<net::IPEndPoint> ip_endpoint;
-
- // Valid ConnectInfo
- ConnectInfo connect_info;
- connect_info.ip_address = "192.0.0.1";
- connect_info.port = 8009;
- connect_info.auth = CHANNEL_AUTH_TYPE_SSL;
-
- ip_endpoint.reset(ccof::ParseConnectInfo(connect_info));
- EXPECT_TRUE(ip_endpoint.get() != NULL);
- EXPECT_EQ(ip_endpoint->ToString(), "192.0.0.1:8009");
-}
-
-} // namespace cast_channel
-} // namespace api
-} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698