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

Side by Side Diff: util/mac/service_management_test.mm

Issue 635883002: Don’t use using directives (“using namespace”) in tests (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: 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/mac/process_types_test.cc ('k') | util/mach/exc_client_variants_test.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 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 12 matching lines...) Expand all
23 #include "base/mac/foundation_util.h" 23 #include "base/mac/foundation_util.h"
24 #include "base/mac/scoped_cftyperef.h" 24 #include "base/mac/scoped_cftyperef.h"
25 #include "base/strings/stringprintf.h" 25 #include "base/strings/stringprintf.h"
26 #include "base/strings/sys_string_conversions.h" 26 #include "base/strings/sys_string_conversions.h"
27 #include "base/rand_util.h" 27 #include "base/rand_util.h"
28 #include "gtest/gtest.h" 28 #include "gtest/gtest.h"
29 #include "util/misc/clock.h" 29 #include "util/misc/clock.h"
30 #include "util/posix/process_util.h" 30 #include "util/posix/process_util.h"
31 #include "util/stdlib/objc.h" 31 #include "util/stdlib/objc.h"
32 32
33 namespace crashpad {
34 namespace test {
33 namespace { 35 namespace {
34 36
35 using namespace crashpad;
36
37 // Ensures that the process with the specified PID is running, identifying it by 37 // Ensures that the process with the specified PID is running, identifying it by
38 // requiring that its argv[argc - 1] compare equal to last_arg. 38 // requiring that its argv[argc - 1] compare equal to last_arg.
39 void ExpectProcessIsRunning(pid_t pid, std::string& last_arg) { 39 void ExpectProcessIsRunning(pid_t pid, std::string& last_arg) {
40 // The process may not have called exec yet, so loop with a small delay while 40 // The process may not have called exec yet, so loop with a small delay while
41 // looking for the cookie. 41 // looking for the cookie.
42 int outer_tries = 10; 42 int outer_tries = 10;
43 std::vector<std::string> job_argv; 43 std::vector<std::string> job_argv;
44 while (outer_tries--) { 44 while (outer_tries--) {
45 // If the process is in the middle of calling exec, ProcessArgumentsForPID 45 // If the process is in the middle of calling exec, ProcessArgumentsForPID
46 // may fail. Loop with a small retry delay while waiting for the expected 46 // may fail. Loop with a small retry delay while waiting for the expected
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 149
150 // Now that the job is unloaded, a subsequent attempt to unload it should be 150 // Now that the job is unloaded, a subsequent attempt to unload it should be
151 // an error. 151 // an error.
152 EXPECT_FALSE(ServiceManagementRemoveJob(kJobLabel, false)); 152 EXPECT_FALSE(ServiceManagementRemoveJob(kJobLabel, false));
153 153
154 ExpectProcessIsNotRunning(job_pid, shell_script); 154 ExpectProcessIsNotRunning(job_pid, shell_script);
155 } 155 }
156 } 156 }
157 157
158 } // namespace 158 } // namespace
159 } // namespace test
160 } // namespace crashpad
OLDNEW
« no previous file with comments | « util/mac/process_types_test.cc ('k') | util/mach/exc_client_variants_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698