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

Side by Side Diff: util/mach/scoped_task_suspend_test.cc

Issue 654933002: Use exactly one of final, override, and virtual (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: git grep -E '^ {3,}.*override[ Created 6 years, 2 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
« no previous file with comments | « util/mach/mach_message_server_test.cc ('k') | util/test/mac/mach_multiprocess.h » ('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 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 class ScopedTaskSuspendTest final : public MachMultiprocess { 45 class ScopedTaskSuspendTest final : public MachMultiprocess {
46 public: 46 public:
47 ScopedTaskSuspendTest() : MachMultiprocess() {} 47 ScopedTaskSuspendTest() : MachMultiprocess() {}
48 ~ScopedTaskSuspendTest() {} 48 ~ScopedTaskSuspendTest() {}
49 49
50 private: 50 private:
51 // MachMultiprocess: 51 // MachMultiprocess:
52 52
53 virtual void MachMultiprocessParent() override { 53 void MachMultiprocessParent() override {
54 task_t child_task = ChildTask(); 54 task_t child_task = ChildTask();
55 55
56 EXPECT_EQ(0, SuspendCount(child_task)); 56 EXPECT_EQ(0, SuspendCount(child_task));
57 57
58 { 58 {
59 ScopedTaskSuspend suspend(child_task); 59 ScopedTaskSuspend suspend(child_task);
60 EXPECT_EQ(1, SuspendCount(child_task)); 60 EXPECT_EQ(1, SuspendCount(child_task));
61 61
62 { 62 {
63 ScopedTaskSuspend suspend_again(child_task); 63 ScopedTaskSuspend suspend_again(child_task);
64 EXPECT_EQ(2, SuspendCount(child_task)); 64 EXPECT_EQ(2, SuspendCount(child_task));
65 } 65 }
66 66
67 EXPECT_EQ(1, SuspendCount(child_task)); 67 EXPECT_EQ(1, SuspendCount(child_task));
68 } 68 }
69 69
70 EXPECT_EQ(0, SuspendCount(child_task)); 70 EXPECT_EQ(0, SuspendCount(child_task));
71 } 71 }
72 72
73 virtual void MachMultiprocessChild() override { 73 void MachMultiprocessChild() override {
74 CheckedReadFDAtEOF(ReadPipeFD()); 74 CheckedReadFDAtEOF(ReadPipeFD());
75 } 75 }
76 76
77 DISALLOW_COPY_AND_ASSIGN(ScopedTaskSuspendTest); 77 DISALLOW_COPY_AND_ASSIGN(ScopedTaskSuspendTest);
78 }; 78 };
79 79
80 TEST(ScopedTaskSuspend, ScopedTaskSuspend) { 80 TEST(ScopedTaskSuspend, ScopedTaskSuspend) {
81 ScopedTaskSuspendTest scoped_task_suspend_test; 81 ScopedTaskSuspendTest scoped_task_suspend_test;
82 scoped_task_suspend_test.Run(); 82 scoped_task_suspend_test.Run();
83 } 83 }
84 84
85 } // namespace 85 } // namespace
86 } // namespace test 86 } // namespace test
87 } // namespace crashpad 87 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/mach/mach_message_server_test.cc ('k') | util/test/mac/mach_multiprocess.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698