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

Unified Diff: chrome/browser/mach_broker_mac_unittest.cc

Issue 501138: Mac: Create a pid->task_t mapping in the browser process. (Closed)
Patch Set: trunglify Created 11 years 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: chrome/browser/mach_broker_mac_unittest.cc
diff --git a/chrome/browser/mach_broker_mac_unittest.cc b/chrome/browser/mach_broker_mac_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..56cc2ae28f5d03f63f153dca8e0816d7562b886f
--- /dev/null
+++ b/chrome/browser/mach_broker_mac_unittest.cc
@@ -0,0 +1,24 @@
+// Copyright (c) 2009 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 "chrome/browser/mach_broker_mac.h"
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+class MachBrokerTest : public testing::Test {
+ public:
+ MachBroker broker_;
+};
+
+TEST_F(MachBrokerTest, Setter) {
+ broker_.RegisterPid(1u, MachBroker::MachInfo().SetTask(2u));
+ EXPECT_EQ(2u, broker_.TaskForPid(1));
+ EXPECT_EQ(0u, broker_.TaskForPid(2));
+}
+
+TEST_F(MachBrokerTest, Invalidate) {
+ broker_.RegisterPid(1u, MachBroker::MachInfo().SetTask(2));
+ broker_.Invalidate(1u);
+ EXPECT_EQ(0u, broker_.TaskForPid(1));
+}

Powered by Google App Engine
This is Rietveld 408576698