| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/api/record/record_api.h" | 5 #include "chrome/browser/extensions/api/record/record_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 if (!scoped_temp_user_data_dir_.Delete()) | 181 if (!scoped_temp_user_data_dir_.Delete()) |
| 182 NOTREACHED(); | 182 NOTREACHED(); |
| 183 InProcessBrowserTest::TearDown(); | 183 InProcessBrowserTest::TearDown(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 // Override to delete temporary files created during execution. | 186 // Override to delete temporary files created during execution. |
| 187 virtual void CleanUpOnMainThread() OVERRIDE { | 187 virtual void CleanUpOnMainThread() OVERRIDE { |
| 188 InProcessBrowserTest::CleanUpOnMainThread(); | 188 InProcessBrowserTest::CleanUpOnMainThread(); |
| 189 for (std::vector<base::FilePath>::const_iterator it = temp_files_.begin(); | 189 for (std::vector<base::FilePath>::const_iterator it = temp_files_.begin(); |
| 190 it != temp_files_.end(); ++it) { | 190 it != temp_files_.end(); ++it) { |
| 191 if (!base::Delete(*it, false)) | 191 if (!base::DeleteFile(*it, false)) |
| 192 NOTREACHED(); | 192 NOTREACHED(); |
| 193 } | 193 } |
| 194 } | 194 } |
| 195 | 195 |
| 196 // Override SetUpCommandline to specify a dummy user_data_dir, which | 196 // Override SetUpCommandline to specify a dummy user_data_dir, which |
| 197 // should be replaced. Clear record-mode, playback-mode, visit-urls, | 197 // should be replaced. Clear record-mode, playback-mode, visit-urls, |
| 198 // record-stats, and load-extension. | 198 // record-stats, and load-extension. |
| 199 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 199 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 200 std::vector<std::string> remove_switches; | 200 std::vector<std::string> remove_switches; |
| 201 | 201 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 // Check for return value with proper stats. | 345 // Check for return value with proper stats. |
| 346 EXPECT_EQ(kTestStatistics, utils::GetString(result.get(), kStatsKey)); | 346 EXPECT_EQ(kTestStatistics, utils::GetString(result.get(), kStatsKey)); |
| 347 | 347 |
| 348 base::ListValue* errors = NULL; | 348 base::ListValue* errors = NULL; |
| 349 EXPECT_TRUE(result->GetList(kErrorsKey, &errors)); | 349 EXPECT_TRUE(result->GetList(kErrorsKey, &errors)); |
| 350 EXPECT_TRUE(VerifyURLHandling(errors, strategy)); | 350 EXPECT_TRUE(VerifyURLHandling(errors, strategy)); |
| 351 } | 351 } |
| 352 | 352 |
| 353 } // namespace extensions | 353 } // namespace extensions |
| OLD | NEW |