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

Side by Side Diff: chrome/browser/safe_browsing/incident_reporting/tracked_preference_incident_unittest.cc

Issue 1551503002: Convert Pass()→std::move() in //chrome (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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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/safe_browsing/incident_reporting/tracked_preference_inc ident.h" 5 #include "chrome/browser/safe_browsing/incident_reporting/tracked_preference_inc ident.h"
6 6
7 #include <utility>
8
7 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
8 #include "chrome/common/safe_browsing/csd.pb.h" 10 #include "chrome/common/safe_browsing/csd.pb.h"
9 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
10 12
11 namespace safe_browsing { 13 namespace safe_browsing {
12 14
13 namespace { 15 namespace {
14 16
15 scoped_ptr<Incident> MakeIncident(bool changed, bool is_personal) { 17 scoped_ptr<Incident> MakeIncident(bool changed, bool is_personal) {
16 scoped_ptr<ClientIncidentReport_IncidentData_TrackedPreferenceIncident> 18 scoped_ptr<ClientIncidentReport_IncidentData_TrackedPreferenceIncident>
17 incident(new ClientIncidentReport_IncidentData_TrackedPreferenceIncident); 19 incident(new ClientIncidentReport_IncidentData_TrackedPreferenceIncident);
18 20
19 incident->set_path("foo"); 21 incident->set_path("foo");
20 incident->set_atomic_value("bar"); 22 incident->set_atomic_value("bar");
21 incident->set_value_state( 23 incident->set_value_state(
22 changed 24 changed
23 ? ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueSta te_CHANGED 25 ? ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueSta te_CHANGED
24 : ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueSta te_CLEARED); 26 : ClientIncidentReport_IncidentData_TrackedPreferenceIncident_ValueSta te_CLEARED);
25 return make_scoped_ptr( 27 return make_scoped_ptr(
26 new TrackedPreferenceIncident(incident.Pass(), is_personal)); 28 new TrackedPreferenceIncident(std::move(incident), is_personal));
27 } 29 }
28 30
29 } // namespace 31 } // namespace
30 32
31 TEST(TrackedPreferenceIncident, GetType) { 33 TEST(TrackedPreferenceIncident, GetType) {
32 ASSERT_EQ(IncidentType::TRACKED_PREFERENCE, 34 ASSERT_EQ(IncidentType::TRACKED_PREFERENCE,
33 MakeIncident(false, false)->GetType()); 35 MakeIncident(false, false)->GetType());
34 } 36 }
35 37
36 // Tests that GetKey returns the preference path. 38 // Tests that GetKey returns the preference path.
(...skipping 18 matching lines...) Expand all
55 scoped_ptr<ClientIncidentReport_IncidentData> impersonal( 57 scoped_ptr<ClientIncidentReport_IncidentData> impersonal(
56 MakeIncident(false, false)->TakePayload()); 58 MakeIncident(false, false)->TakePayload());
57 ASSERT_TRUE(impersonal->tracked_preference().has_atomic_value()); 59 ASSERT_TRUE(impersonal->tracked_preference().has_atomic_value());
58 60
59 scoped_ptr<ClientIncidentReport_IncidentData> personal( 61 scoped_ptr<ClientIncidentReport_IncidentData> personal(
60 MakeIncident(false, true)->TakePayload()); 62 MakeIncident(false, true)->TakePayload());
61 ASSERT_FALSE(personal->tracked_preference().has_atomic_value()); 63 ASSERT_FALSE(personal->tracked_preference().has_atomic_value());
62 } 64 }
63 65
64 } // namespace safe_browsing 66 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698