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

Side by Side Diff: third_party/WebKit/Source/core/page/NetworkStateNotifierTest.cpp

Issue 2110363002: Rename SameThreadClosure to Closure (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@TRV_ExplicitWTFBind
Patch Set: Add WTF:: to Closure Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014, Google Inc. All rights reserved. 2 * Copyright (c) 2014, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 double observedMaxBandwidth() const 73 double observedMaxBandwidth() const
74 { 74 {
75 return m_observedMaxBandwidthMbps; 75 return m_observedMaxBandwidthMbps;
76 } 76 }
77 77
78 int callbackCount() const 78 int callbackCount() const
79 { 79 {
80 return m_callbackCount; 80 return m_callbackCount;
81 } 81 }
82 82
83 void setNotificationCallback(std::unique_ptr<SameThreadClosure> closure) 83 void setNotificationCallback(std::unique_ptr<WTF::Closure> closure)
84 { 84 {
85 m_closure = std::move(closure); 85 m_closure = std::move(closure);
86 } 86 }
87 87
88 private: 88 private:
89 std::unique_ptr<SameThreadClosure> m_closure; 89 std::unique_ptr<WTF::Closure> m_closure;
90 WebConnectionType m_observedType; 90 WebConnectionType m_observedType;
91 double m_observedMaxBandwidthMbps; 91 double m_observedMaxBandwidthMbps;
92 int m_callbackCount; 92 int m_callbackCount;
93 }; 93 };
94 94
95 class NetworkStateNotifierTest : public ::testing::Test { 95 class NetworkStateNotifierTest : public ::testing::Test {
96 public: 96 public:
97 NetworkStateNotifierTest() 97 NetworkStateNotifierTest()
98 : m_document(Document::create()) 98 : m_document(Document::create())
99 , m_document2(Document::create()) 99 , m_document2(Document::create())
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 EXPECT_EQ(observer.callbackCount(), 0); 363 EXPECT_EQ(observer.callbackCount(), 0);
364 364
365 notifier.setWebConnection(WebConnectionTypeEthernet, kEthernetMaxBandwidthMb ps); 365 notifier.setWebConnection(WebConnectionTypeEthernet, kEthernetMaxBandwidthMb ps);
366 testing::runPendingTasks(); 366 testing::runPendingTasks();
367 EXPECT_EQ(observer.callbackCount(), 1); 367 EXPECT_EQ(observer.callbackCount(), 1);
368 EXPECT_EQ(observer.observedType(), WebConnectionTypeEthernet); 368 EXPECT_EQ(observer.observedType(), WebConnectionTypeEthernet);
369 EXPECT_EQ(observer.observedMaxBandwidth(), kEthernetMaxBandwidthMbps); 369 EXPECT_EQ(observer.observedMaxBandwidth(), kEthernetMaxBandwidthMbps);
370 } 370 }
371 371
372 } // namespace blink 372 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698