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

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

Issue 11273049: Revert 164120 - content/browser: Move more files into the content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « content/browser/mach_broker_mac.cc ('k') | content/browser/media_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/mach_broker_mac.h" 5 #include "content/browser/mach_broker_mac.h"
6 6
7 #include "base/synchronization/lock.h" 7 #include "base/synchronization/lock.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace content {
11
12 class MachBrokerTest : public testing::Test { 10 class MachBrokerTest : public testing::Test {
13 public: 11 public:
14 // Helper function to acquire/release locks and call |PlaceholderForPid()|. 12 // Helper function to acquire/release locks and call |PlaceholderForPid()|.
15 void AddPlaceholderForPid(base::ProcessHandle pid) { 13 void AddPlaceholderForPid(base::ProcessHandle pid) {
16 base::AutoLock lock(broker_.GetLock()); 14 base::AutoLock lock(broker_.GetLock());
17 broker_.AddPlaceholderForPid(pid); 15 broker_.AddPlaceholderForPid(pid);
18 } 16 }
19 17
20 // Helper function to acquire/release locks and call |FinalizePid()|. 18 // Helper function to acquire/release locks and call |FinalizePid()|.
21 void FinalizePid(base::ProcessHandle pid, 19 void FinalizePid(base::ProcessHandle pid,
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 EXPECT_EQ(100u, broker_.TaskForPid(1)); 51 EXPECT_EQ(100u, broker_.TaskForPid(1));
54 broker_.InvalidatePid(1u); 52 broker_.InvalidatePid(1u);
55 EXPECT_EQ(0u, broker_.TaskForPid(1)); 53 EXPECT_EQ(0u, broker_.TaskForPid(1));
56 } 54 }
57 55
58 TEST_F(MachBrokerTest, FinalizeUnknownPid) { 56 TEST_F(MachBrokerTest, FinalizeUnknownPid) {
59 // Finalizing an entry for an unknown pid should not add it to the map. 57 // Finalizing an entry for an unknown pid should not add it to the map.
60 FinalizePid(1u, MachBroker::MachInfo().SetTask(100u)); 58 FinalizePid(1u, MachBroker::MachInfo().SetTask(100u));
61 EXPECT_EQ(0u, broker_.TaskForPid(1u)); 59 EXPECT_EQ(0u, broker_.TaskForPid(1u));
62 } 60 }
63
64 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/mach_broker_mac.cc ('k') | content/browser/media_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698