summaryrefslogtreecommitdiff
path: root/chromium/net/nqe/network_id_unittest.cc
blob: aeb7f52b93bac16afdf29aa347595e631de940b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/nqe/network_id.h"

#include <string>

#include "base/strings/string_number_conversions.h"
#include "net/base/network_change_notifier.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace net::nqe::internal {

namespace {

TEST(NetworkIDTest, TestSerialize) {
  nqe::internal::NetworkID network_id(NetworkChangeNotifier::CONNECTION_2G,
                                      "test1", 2);
  std::string serialized = network_id.ToString();
  EXPECT_EQ(network_id, NetworkID::FromString(serialized));
}

}  // namespace

}  // namespace net::nqe::internal