| 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 "base/auto_reset.h" | 5 #include "base/auto_reset.h" |
| 6 #include "base/callback.h" | 6 #include "base/callback.h" |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 GetCommonDataDir().AppendASCII("common_injected.js")); | 157 GetCommonDataDir().AppendASCII("common_injected.js")); |
| 158 base::FilePath inject_js_path( | 158 base::FilePath inject_js_path( |
| 159 temp_dir.path().AppendASCII(extension_name) | 159 temp_dir.path().AppendASCII(extension_name) |
| 160 .AppendASCII("common_injected.js")); | 160 .AppendASCII("common_injected.js")); |
| 161 if (!base::CopyFile(common_js_path, inject_js_path)) | 161 if (!base::CopyFile(common_js_path, inject_js_path)) |
| 162 return false; | 162 return false; |
| 163 | 163 |
| 164 const char* custom_arg = NULL; | 164 const char* custom_arg = NULL; |
| 165 std::string json_string; | 165 std::string json_string; |
| 166 if (!custom_arg_value.empty()) { | 166 if (!custom_arg_value.empty()) { |
| 167 base::JSONWriter::Write(&custom_arg_value, &json_string); | 167 base::JSONWriter::Write(custom_arg_value, &json_string); |
| 168 custom_arg = json_string.c_str(); | 168 custom_arg = json_string.c_str(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 base::AutoReset<base::FilePath> reset(&test_data_dir_, temp_dir.path()); | 171 base::AutoReset<base::FilePath> reset(&test_data_dir_, temp_dir.path()); |
| 172 bool result = RunPlatformAppTestWithArg(extension_name, custom_arg); | 172 bool result = RunPlatformAppTestWithArg(extension_name, custom_arg); |
| 173 content::RunAllPendingInMessageLoop(); // avoid race on exit in registry. | 173 content::RunAllPendingInMessageLoop(); // avoid race on exit in registry. |
| 174 return result; | 174 return result; |
| 175 } | 175 } |
| 176 | 176 |
| 177 void AttachFakeDevice() { | 177 void AttachFakeDevice() { |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 | 671 |
| 672 base::ListValue custom_args; | 672 base::ListValue custom_args; |
| 673 #if defined(USE_PROPRIETARY_CODECS) | 673 #if defined(USE_PROPRIETARY_CODECS) |
| 674 custom_args.AppendBoolean(true); | 674 custom_args.AppendBoolean(true); |
| 675 #else | 675 #else |
| 676 custom_args.AppendBoolean(false); | 676 custom_args.AppendBoolean(false); |
| 677 #endif | 677 #endif |
| 678 ASSERT_TRUE(RunMediaGalleriesTestWithArg("media_metadata", custom_args)) | 678 ASSERT_TRUE(RunMediaGalleriesTestWithArg("media_metadata", custom_args)) |
| 679 << message_; | 679 << message_; |
| 680 } | 680 } |
| OLD | NEW |