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

Unified Diff: util/mac/service_management_test.mm

Issue 1451793002: Add RandomString() and its test, and use it everywhere it makes sense (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Fix tpyo Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/scoped_temp_dir_win.cc ('k') | util/mach/child_port_handshake.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mac/service_management_test.mm
diff --git a/util/mac/service_management_test.mm b/util/mac/service_management_test.mm
index 9f08b5752b3df9181deb738e5da63b4911860457..cdfd082356a2ebb837b8cc367c5e7a553422f07c 100644
--- a/util/mac/service_management_test.mm
+++ b/util/mac/service_management_test.mm
@@ -24,9 +24,9 @@
#include "base/mac/scoped_cftyperef.h"
#include "base/strings/stringprintf.h"
#include "base/strings/sys_string_conversions.h"
-#include "base/rand_util.h"
#include "gtest/gtest.h"
#include "util/misc/clock.h"
+#include "util/misc/random_string.h"
#include "util/posix/process_info.h"
#include "util/stdlib/objc.h"
@@ -108,10 +108,7 @@ void ExpectProcessIsNotRunning(pid_t pid, std::string& last_arg) {
TEST(ServiceManagement, SubmitRemoveJob) {
@autoreleasepool {
- std::string cookie;
- for (int index = 0; index < 16; ++index) {
- cookie.append(1, base::RandInt('A', 'Z'));
- }
+ const std::string cookie = RandomString();
std::string shell_script =
base::StringPrintf("sleep 10; echo %s", cookie.c_str());
« no previous file with comments | « test/scoped_temp_dir_win.cc ('k') | util/mach/child_port_handshake.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698