| 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/state_store.h" | 5 #include "chrome/browser/safe_browsing/incident_reporting/state_store.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 TestingProfile::TestingFactories()); | 117 TestingProfile::TestingFactories()); |
| 118 } | 118 } |
| 119 | 119 |
| 120 static const char kProfileName_[]; | 120 static const char kProfileName_[]; |
| 121 static const TestData kTestData_[]; | 121 static const TestData kTestData_[]; |
| 122 TestingProfile* profile_; | 122 TestingProfile* profile_; |
| 123 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; | 123 scoped_refptr<base::TestSimpleTaskRunner> task_runner_; |
| 124 | 124 |
| 125 private: | 125 private: |
| 126 base::FilePath GetPrefsPath() { | 126 base::FilePath GetPrefsPath() { |
| 127 return temp_dir_.path().AppendASCII("prefs"); | 127 return temp_dir_.GetPath().AppendASCII("prefs"); |
| 128 } | 128 } |
| 129 | 129 |
| 130 extensions::QuotaService::ScopedDisablePurgeForTesting | 130 extensions::QuotaService::ScopedDisablePurgeForTesting |
| 131 disable_purge_for_testing_; | 131 disable_purge_for_testing_; |
| 132 base::ScopedTempDir temp_dir_; | 132 base::ScopedTempDir temp_dir_; |
| 133 base::ThreadTaskRunnerHandle thread_task_runner_handle_; | 133 base::ThreadTaskRunnerHandle thread_task_runner_handle_; |
| 134 TestingProfileManager profile_manager_; | 134 TestingProfileManager profile_manager_; |
| 135 | 135 |
| 136 DISALLOW_COPY_AND_ASSIGN(StateStoreTest); | 136 DISALLOW_COPY_AND_ASSIGN(StateStoreTest); |
| 137 }; | 137 }; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // Verify that the state survived. | 273 // Verify that the state survived. |
| 274 ASSERT_TRUE(state_store.HasBeenReported(data.type, data.key, data.digest)); | 274 ASSERT_TRUE(state_store.HasBeenReported(data.type, data.key, data.digest)); |
| 275 #else | 275 #else |
| 276 // Verify that the state did not survive. | 276 // Verify that the state did not survive. |
| 277 ASSERT_FALSE(state_store.HasBeenReported(data.type, data.key, data.digest)); | 277 ASSERT_FALSE(state_store.HasBeenReported(data.type, data.key, data.digest)); |
| 278 #endif | 278 #endif |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 } // namespace safe_browsing | 282 } // namespace safe_browsing |
| OLD | NEW |