| OLD | NEW |
| 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/extension_data_collect
ion.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/extension_data_collect
ion.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 .Set("update_url", update_url) | 94 .Set("update_url", update_url) |
| 95 .Build()) | 95 .Build()) |
| 96 .Build(); | 96 .Build(); |
| 97 | 97 |
| 98 // Install the extension on the faked extension service. | 98 // Install the extension on the faked extension service. |
| 99 extension_service_->AddExtension(extension.get()); | 99 extension_service_->AddExtension(extension.get()); |
| 100 | 100 |
| 101 extension_prefs_->UpdateExtensionPref( | 101 extension_prefs_->UpdateExtensionPref( |
| 102 extension_id, "install_time", new base::StringValue(base::Int64ToString( | 102 extension_id, "install_time", new base::StringValue(base::Int64ToString( |
| 103 install_time.ToInternalValue()))); | 103 install_time.ToInternalValue()))); |
| 104 extension_prefs_->UpdateExtensionPref( | 104 extension_prefs_->UpdateExtensionPref(extension_id, "state", |
| 105 extension_id, "state", new base::FundamentalValue(state_value)); | 105 new base::Value(state_value)); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void ExtensionTestingProfile::SetInstallSignature( | 108 void ExtensionTestingProfile::SetInstallSignature( |
| 109 extensions::InstallSignature signature) { | 109 extensions::InstallSignature signature) { |
| 110 base::DictionaryValue signature_dict; | 110 base::DictionaryValue signature_dict; |
| 111 signature.ToValue(&signature_dict); | 111 signature.ToValue(&signature_dict); |
| 112 extension_prefs_->SetInstallSignature(&signature_dict); | 112 extension_prefs_->SetInstallSignature(&signature_dict); |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace | 115 } // namespace |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 305 |
| 306 ASSERT_TRUE(data.has_last_installed_extension()); | 306 ASSERT_TRUE(data.has_last_installed_extension()); |
| 307 ClientIncidentReport_ExtensionData_ExtensionInfo extension_info = | 307 ClientIncidentReport_ExtensionData_ExtensionInfo extension_info = |
| 308 data.last_installed_extension(); | 308 data.last_installed_extension(); |
| 309 | 309 |
| 310 ASSERT_EQ(extension_info.id(), extension_id); | 310 ASSERT_EQ(extension_info.id(), extension_id); |
| 311 ASSERT_EQ(extension_info.name(), extension_name); | 311 ASSERT_EQ(extension_info.name(), extension_name); |
| 312 } | 312 } |
| 313 | 313 |
| 314 } // namespace safe_browsing | 314 } // namespace safe_browsing |
| OLD | NEW |