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

Unified Diff: base/message_loop/message_pump_mac_unittest.cc

Issue 2709813003: [Mac] Reduce timer CPU use in MessagePumpCFRunLoopBase. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: base/message_loop/message_pump_mac_unittest.cc
diff --git a/base/message_loop/message_pump_mac_unittest.cc b/base/message_loop/message_pump_mac_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b369ab401fa454db0be98e5f479f956770abec3e
--- /dev/null
+++ b/base/message_loop/message_pump_mac_unittest.cc
@@ -0,0 +1,25 @@
+// Copyright 2017 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 "base/message_loop/message_pump_mac.h"
+
+#include "base/macros.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace base {
+
+class TestMessagePumpCFRunLoopBase {
+ public:
+ MessagePumpCFRunLoop message_pump;
+
+ bool CanInvalidateTimers() { return message_pump.can_invalidate_timers_; }
+};
+
+TEST(MessagePumpMacTest, TestCanInvalidateTimers) {
+ TestMessagePumpCFRunLoopBase message_pump_test;
+
+ // Catch if the use of private API ever starts failing.
Mark Mentovai 2017/02/21 17:41:22 whether
shrike 2017/02/22 00:57:52 Done.
+ EXPECT_TRUE(message_pump_test.CanInvalidateTimers());
+}
+} // namespace base
« base/message_loop/message_pump_mac.mm ('K') | « base/message_loop/message_pump_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698