OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/media/router/discovery/dial/dial_device_data.h" | 5 #include "chrome/browser/media/router/discovery/dial/dial_device_data.h" |
6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
7 | 7 |
8 namespace media_router { | 8 namespace media_router { |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 EXPECT_EQ("device_a", original_3.device_id()); | 62 EXPECT_EQ("device_a", original_3.device_id()); |
63 EXPECT_EQ(GURL("http://127.0.0.2/dd-b.xml"), | 63 EXPECT_EQ(GURL("http://127.0.0.2/dd-b.xml"), |
64 original_3.device_description_url()); | 64 original_3.device_description_url()); |
65 EXPECT_EQ("label_a", original_3.label()); | 65 EXPECT_EQ("label_a", original_3.label()); |
66 EXPECT_EQ(200, original_3.max_age()); | 66 EXPECT_EQ(200, original_3.max_age()); |
67 EXPECT_EQ(base::Time::FromInternalValue(2000), original_3.response_time()); | 67 EXPECT_EQ(base::Time::FromInternalValue(2000), original_3.response_time()); |
68 EXPECT_EQ(2, original_3.config_id()); | 68 EXPECT_EQ(2, original_3.config_id()); |
69 } | 69 } |
70 | 70 |
71 TEST(DialDeviceDataTest, TestIsDeviceDescriptionUrl) { | 71 TEST(DialDeviceDataTest, TestIsDeviceDescriptionUrl) { |
72 EXPECT_TRUE(DialDeviceData::IsDeviceDescriptionUrl( | 72 EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl( |
73 GURL("http://some.device.com/dd.xml"))); | 73 GURL("http://some.device.com/dd.xml"))); |
74 EXPECT_TRUE(DialDeviceData::IsDeviceDescriptionUrl( | 74 EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl( |
75 GURL("https://some.device.com/dd.xml"))); | 75 GURL("https://some.device.com/dd.xml"))); |
76 EXPECT_TRUE(DialDeviceData::IsDeviceDescriptionUrl( | 76 EXPECT_TRUE(DialDeviceData::IsDeviceDescriptionUrl( |
77 GURL("http://192.168.1.1:1234/dd.xml"))); | 77 GURL("http://192.168.1.1:1234/dd.xml"))); |
78 EXPECT_TRUE(DialDeviceData::IsDeviceDescriptionUrl( | 78 EXPECT_TRUE(DialDeviceData::IsDeviceDescriptionUrl( |
79 GURL("https://192.168.1.1:1234/dd.xml"))); | 79 GURL("https://192.168.1.1:1234/dd.xml"))); |
80 | 80 |
81 EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL())); | 81 EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL())); |
82 EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL(std::string()))); | 82 EXPECT_FALSE(DialDeviceData::IsDeviceDescriptionUrl(GURL(std::string()))); |
83 EXPECT_FALSE( | 83 EXPECT_FALSE( |
84 DialDeviceData::IsDeviceDescriptionUrl(GURL("file://path/to/file"))); | 84 DialDeviceData::IsDeviceDescriptionUrl(GURL("file://path/to/file"))); |
85 } | 85 } |
86 | 86 |
87 } // namespace media_router | 87 } // namespace media_router |
OLD | NEW |