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

Side by Side Diff: components/browser_watcher/watcher_metrics_provider_win_unittest.cc

Issue 1546143002: Switch to standard integer types in components/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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 "components/browser_watcher/watcher_metrics_provider_win.h" 5 #include "components/browser_watcher/watcher_metrics_provider_win.h"
6 6
7 #include <stddef.h>
8 #include <stdint.h>
9
7 #include <cstdlib> 10 #include <cstdlib>
8 11
9 #include "base/process/process_handle.h" 12 #include "base/process/process_handle.h"
10 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
11 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
12 #include "base/test/histogram_tester.h" 15 #include "base/test/histogram_tester.h"
13 #include "base/test/test_reg_util_win.h" 16 #include "base/test/test_reg_util_win.h"
14 #include "base/test/test_simple_task_runner.h" 17 #include "base/test/test_simple_task_runner.h"
15 #include "base/win/registry.h" 18 #include "base/win/registry.h"
16 #include "components/browser_watcher/exit_funnel_win.h" 19 #include "components/browser_watcher/exit_funnel_win.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // Write the exit code to registry. 55 // Write the exit code to registry.
53 LONG result = key.WriteValue(key_name.c_str(), exit_code); 56 LONG result = key.WriteValue(key_name.c_str(), exit_code);
54 ASSERT_EQ(result, ERROR_SUCCESS); 57 ASSERT_EQ(result, ERROR_SUCCESS);
55 } 58 }
56 59
57 size_t ExitCodeRegistryPathValueCount() { 60 size_t ExitCodeRegistryPathValueCount() {
58 base::win::RegKey key(HKEY_CURRENT_USER, kRegistryPath, KEY_READ); 61 base::win::RegKey key(HKEY_CURRENT_USER, kRegistryPath, KEY_READ);
59 return key.GetValueCount(); 62 return key.GetValueCount();
60 } 63 }
61 64
62 void AddExitFunnelEvent(int pid, const base::char16* name, int64 value) { 65 void AddExitFunnelEvent(int pid, const base::char16* name, int64_t value) {
63 base::string16 key_name = 66 base::string16 key_name =
64 base::StringPrintf(L"%ls\\%d-%d", kRegistryPath, pid, pid); 67 base::StringPrintf(L"%ls\\%d-%d", kRegistryPath, pid, pid);
65 68
66 base::win::RegKey key(HKEY_CURRENT_USER, key_name.c_str(), KEY_WRITE); 69 base::win::RegKey key(HKEY_CURRENT_USER, key_name.c_str(), KEY_WRITE);
67 ASSERT_EQ(key.WriteValue(name, &value, sizeof(value), REG_QWORD), 70 ASSERT_EQ(key.WriteValue(name, &value, sizeof(value), REG_QWORD),
68 ERROR_SUCCESS); 71 ERROR_SUCCESS);
69 } 72 }
70 73
71 protected: 74 protected:
72 registry_util::RegistryOverrideManager override_manager_; 75 registry_util::RegistryOverrideManager override_manager_;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 provider.OnRecordingDisabled(); 198 provider.OnRecordingDisabled();
196 // Flush the task(s). 199 // Flush the task(s).
197 test_task_runner_->RunPendingTasks(); 200 test_task_runner_->RunPendingTasks();
198 } 201 }
199 202
200 // We expect only 100 of the funnels have been scrubbed. 203 // We expect only 100 of the funnels have been scrubbed.
201 EXPECT_EQ(100u, it.SubkeyCount()); 204 EXPECT_EQ(100u, it.SubkeyCount());
202 } 205 }
203 206
204 } // namespace browser_watcher 207 } // namespace browser_watcher
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698