| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 extension_function_test_utils::NONE; | 489 extension_function_test_utils::NONE; |
| 490 } | 490 } |
| 491 | 491 |
| 492 // extension_function_test_utils::RunFunction*() only uses browser for its | 492 // extension_function_test_utils::RunFunction*() only uses browser for its |
| 493 // profile(), so pass it the on-record browser so that it always uses the | 493 // profile(), so pass it the on-record browser so that it always uses the |
| 494 // on-record profile to match real-life behavior. | 494 // on-record profile to match real-life behavior. |
| 495 | 495 |
| 496 base::Value* RunFunctionAndReturnResult(UIThreadExtensionFunction* function, | 496 base::Value* RunFunctionAndReturnResult(UIThreadExtensionFunction* function, |
| 497 const std::string& args) { | 497 const std::string& args) { |
| 498 SetUpExtensionFunction(function); | 498 SetUpExtensionFunction(function); |
| 499 return extension_function_test_utils::RunFunctionAndReturnResult( | 499 return extension_function_test_utils::RunFunctionAndReturnSingleResult( |
| 500 function, args, browser(), GetFlags()); | 500 function, args, browser(), GetFlags()); |
| 501 } | 501 } |
| 502 | 502 |
| 503 std::string RunFunctionAndReturnError(UIThreadExtensionFunction* function, | 503 std::string RunFunctionAndReturnError(UIThreadExtensionFunction* function, |
| 504 const std::string& args) { | 504 const std::string& args) { |
| 505 SetUpExtensionFunction(function); | 505 SetUpExtensionFunction(function); |
| 506 return extension_function_test_utils::RunFunctionAndReturnError( | 506 return extension_function_test_utils::RunFunctionAndReturnError( |
| 507 function, args, browser(), GetFlags()); | 507 function, args, browser(), GetFlags()); |
| 508 } | 508 } |
| 509 | 509 |
| (...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2151 " \"state\": {" | 2151 " \"state\": {" |
| 2152 " \"previous\": \"in_progress\"," | 2152 " \"previous\": \"in_progress\"," |
| 2153 " \"current\": \"complete\"}}]", | 2153 " \"current\": \"complete\"}}]", |
| 2154 result_id, | 2154 result_id, |
| 2155 GetFilename("on_record.txt.crdownload").c_str(), | 2155 GetFilename("on_record.txt.crdownload").c_str(), |
| 2156 GetFilename("on_record.txt").c_str()))); | 2156 GetFilename("on_record.txt").c_str()))); |
| 2157 std::string disk_data; | 2157 std::string disk_data; |
| 2158 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data)); | 2158 EXPECT_TRUE(file_util::ReadFileToString(item->GetFullPath(), &disk_data)); |
| 2159 EXPECT_STREQ(kPayloadData, disk_data.c_str()); | 2159 EXPECT_STREQ(kPayloadData, disk_data.c_str()); |
| 2160 } | 2160 } |
| OLD | NEW |