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
3 // found in the LICENSE file.
5 #include "testing/gtest/include/gtest/gtest.h"
6 #include "url/deprecated_serialized_origin.h"
12 // Each test examines the DeprecatedSerializedOrigin is constructed correctly
13 // without violating DCHECKs.
14 TEST(DeprecatedSerializedOriginTest
, constructEmpty
) {
15 DeprecatedSerializedOrigin origin
;
16 EXPECT_EQ("null", origin
.string());
19 TEST(DeprecatedSerializedOriginTest
, constructNull
) {
20 DeprecatedSerializedOrigin
origin("null");
21 EXPECT_EQ("null", origin
.string());
24 TEST(DeprecatedSerializedOriginTest
, constructValid
) {
25 DeprecatedSerializedOrigin
origin("http://example.com:8080");
26 EXPECT_EQ("http://example.com:8080", origin
.string());
29 TEST(DeprecatedSerializedOriginTest
, constructValidFile
) {
30 DeprecatedSerializedOrigin
origin("file://");
31 EXPECT_EQ("file://", origin
.string());
34 TEST(DeprecatedSerializedOriginTest
, constructValidWithoutPort
) {
35 DeprecatedSerializedOrigin
origin("wss://example2.com");
36 EXPECT_EQ("wss://example2.com", origin
.string());