summaryrefslogtreecommitdiff
path: root/chromium/net/quic/platform/api/quic_singleton_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/quic/platform/api/quic_singleton_test.cc')
-rw-r--r--chromium/net/quic/platform/api/quic_singleton_test.cc32
1 files changed, 32 insertions, 0 deletions
diff --git a/chromium/net/quic/platform/api/quic_singleton_test.cc b/chromium/net/quic/platform/api/quic_singleton_test.cc
new file mode 100644
index 00000000000..e6a2ec5e628
--- /dev/null
+++ b/chromium/net/quic/platform/api/quic_singleton_test.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2018 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 "net/quic/platform/api/quic_singleton.h"
+
+#include "net/quic/platform/api/quic_test.h"
+
+namespace net {
+namespace test {
+namespace {
+
+class Foo {
+ public:
+ static Foo* GetInstance() { return net::QuicSingleton<Foo>::get(); }
+
+ private:
+ Foo() = default;
+ friend net::QuicSingletonFriend<Foo>;
+};
+
+class QuicSingletonTest : public QuicTest {};
+
+TEST_F(QuicSingletonTest, Get) {
+ Foo* f1 = Foo::GetInstance();
+ Foo* f2 = Foo::GetInstance();
+ EXPECT_EQ(f1, f2);
+}
+
+} // namespace
+} // namespace test
+} // namespace net