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

Side by Side Diff: chrome/browser/chromeos/policy/system_log_uploader_unittest.cc

Issue 1610123003: Added anonymizer to SystemLogUploader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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 "chrome/browser/chromeos/policy/system_log_uploader.h" 5 #include "chrome/browser/chromeos/policy/system_log_uploader.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/test/test_simple_task_runner.h" 10 #include "base/test/test_simple_task_runner.h"
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 task_runner_->RunPendingTasks(); 279 task_runner_->RunPendingTasks();
280 280
281 RunPendingUploadTaskAndCheckNext( 281 RunPendingUploadTaskAndCheckNext(
282 uploader, base::TimeDelta::FromMilliseconds( 282 uploader, base::TimeDelta::FromMilliseconds(
283 SystemLogUploader::kDefaultUploadDelayMs)); 283 SystemLogUploader::kDefaultUploadDelayMs));
284 RunPendingUploadTaskAndCheckNext( 284 RunPendingUploadTaskAndCheckNext(
285 uploader, base::TimeDelta::FromMilliseconds( 285 uploader, base::TimeDelta::FromMilliseconds(
286 SystemLogUploader::kDefaultUploadDelayMs)); 286 SystemLogUploader::kDefaultUploadDelayMs));
287 } 287 }
288 288
289 // Test RemovePII function.
290 TEST_F(SystemLogUploaderTest, TestPII) {
Thiemo Nagel 2016/01/21 16:54:35 I'd prefer to keep that test to prove that the alg
Polina Bondarenko 2016/01/21 17:40:06 Done.
291 std::string data =
292 "aaaaaaaaSSID=123aaaaaaaaaaa\n" // SSID.
293 "aaaaaaaahttp://tets.comaaaaaaa\n" // URL.
294 "aaaaaemail@example.comaaa\n" // Email address.
295 "example@@1234\n" // No PII, it is not valid email address.
296 "255.255.355.255\n" // No PII, it is not valid IP address format.
297 "aaaa123.123.45.4aaa\n" // IP address.
298 "11:11;11::11\n" // IP address.
299 "11::11\n" // IP address.
300 "11:11:abcdef:0:0:0:0:0"; // No PII, it is not valid IP address format.
301
302 std::string result =
303 "example@@1234\n"
304 "255.255.355.255\n"
305 "11:11:abcdef:0:0:0:0:0\n";
306
307 EXPECT_EQ(result, SystemLogUploader::RemoveSensitiveData(data));
308 }
309
310 } // namespace policy 289 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698