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

Side by Side Diff: chrome/browser/mach_broker_mac_unittest.cc

Issue 466088: Revert 34146 - A place to store the pid>mach_port_t mapping.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/mach_broker_mac.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 class MachBrokerTest : public testing::Test {
10 public:
11 MachBroker broker_;
12 };
13
14 TEST_F(MachBrokerTest, Setter) {
15 broker_.RegisterPid(1u, MachBroker::MachInfo().SetTask(2u).SetHost(3u));
16
17 EXPECT_EQ(2u, broker_.MachTaskForPid(1));
18 EXPECT_EQ(3u, broker_.MachHostForPid(1));
19
20 EXPECT_EQ(0u, broker_.MachTaskForPid(2));
21 EXPECT_EQ(0u, broker_.MachHostForPid(3));
22 }
23
24 TEST_F(MachBrokerTest, Invalidate) {
25 broker_.RegisterPid(1u, MachBroker::MachInfo().SetTask(2).SetHost(3));
26 broker_.Invalidate(1u);
27 EXPECT_EQ(0u, broker_.MachTaskForPid(1));
28 EXPECT_EQ(0u, broker_.MachHostForPid(1));
29 }
OLDNEW
« no previous file with comments | « chrome/browser/mach_broker_mac.cc ('k') | chrome/browser/renderer_host/browser_render_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698