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/extension_function_test_utils.h" | 5 #include "chrome/browser/extensions/extension_function_test_utils.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 base::ListValue* ParseList(const std::string& data) { | 52 base::ListValue* ParseList(const std::string& data) { |
53 std::unique_ptr<base::Value> result = base::JSONReader::Read(data); | 53 std::unique_ptr<base::Value> result = base::JSONReader::Read(data); |
54 base::ListValue* list = NULL; | 54 base::ListValue* list = NULL; |
55 result->GetAsList(&list); | 55 result->GetAsList(&list); |
56 ignore_result(result.release()); | 56 ignore_result(result.release()); |
57 return list; | 57 return list; |
58 } | 58 } |
59 | 59 |
60 base::DictionaryValue* ToDictionary(base::Value* val) { | 60 base::DictionaryValue* ToDictionary(base::Value* val) { |
61 EXPECT_TRUE(val); | 61 EXPECT_TRUE(val); |
62 EXPECT_EQ(base::Value::TYPE_DICTIONARY, val->GetType()); | 62 EXPECT_EQ(base::Value::Type::DICTIONARY, val->GetType()); |
63 return static_cast<base::DictionaryValue*>(val); | 63 return static_cast<base::DictionaryValue*>(val); |
64 } | 64 } |
65 | 65 |
66 base::ListValue* ToList(base::Value* val) { | 66 base::ListValue* ToList(base::Value* val) { |
67 EXPECT_TRUE(val); | 67 EXPECT_TRUE(val); |
68 EXPECT_EQ(base::Value::TYPE_LIST, val->GetType()); | 68 EXPECT_EQ(base::Value::Type::LIST, val->GetType()); |
69 return static_cast<base::ListValue*>(val); | 69 return static_cast<base::ListValue*>(val); |
70 } | 70 } |
71 | 71 |
72 bool HasPrivacySensitiveFields(base::DictionaryValue* val) { | 72 bool HasPrivacySensitiveFields(base::DictionaryValue* val) { |
73 std::string result; | 73 std::string result; |
74 if (val->GetString(keys::kUrlKey, &result) || | 74 if (val->GetString(keys::kUrlKey, &result) || |
75 val->GetString(keys::kTitleKey, &result) || | 75 val->GetString(keys::kTitleKey, &result) || |
76 val->GetString(keys::kFaviconUrlKey, &result)) | 76 val->GetString(keys::kFaviconUrlKey, &result)) |
77 return true; | 77 return true; |
78 return false; | 78 return false; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 new extensions::ExtensionFunctionDispatcher(browser->profile())); | 141 new extensions::ExtensionFunctionDispatcher(browser->profile())); |
142 dispatcher->set_delegate(&dispatcher_delegate); | 142 dispatcher->set_delegate(&dispatcher_delegate); |
143 // TODO(yoz): The cast is a hack; these flags should be defined in | 143 // TODO(yoz): The cast is a hack; these flags should be defined in |
144 // only one place. See crbug.com/394840. | 144 // only one place. See crbug.com/394840. |
145 return extensions::api_test_utils::RunFunction( | 145 return extensions::api_test_utils::RunFunction( |
146 function, std::move(args), browser->profile(), std::move(dispatcher), | 146 function, std::move(args), browser->profile(), std::move(dispatcher), |
147 static_cast<extensions::api_test_utils::RunFunctionFlags>(flags)); | 147 static_cast<extensions::api_test_utils::RunFunctionFlags>(flags)); |
148 } | 148 } |
149 | 149 |
150 } // namespace extension_function_test_utils | 150 } // namespace extension_function_test_utils |
OLD | NEW |