Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: chrome/browser/extensions/extension_function_test_utils.cc

Issue 789643004: Move chrome.alarms API from chrome/ to extensions/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review comments. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 EXPECT_EQ(base::Value::TYPE_DICTIONARY, val->GetType()); 63 EXPECT_EQ(base::Value::TYPE_DICTIONARY, val->GetType());
64 return static_cast<base::DictionaryValue*>(val); 64 return static_cast<base::DictionaryValue*>(val);
65 } 65 }
66 66
67 base::ListValue* ToList(base::Value* val) { 67 base::ListValue* ToList(base::Value* val) {
68 EXPECT_TRUE(val); 68 EXPECT_TRUE(val);
69 EXPECT_EQ(base::Value::TYPE_LIST, val->GetType()); 69 EXPECT_EQ(base::Value::TYPE_LIST, val->GetType());
70 return static_cast<base::ListValue*>(val); 70 return static_cast<base::ListValue*>(val);
71 } 71 }
72 72
73 scoped_refptr<Extension> CreateEmptyExtensionWithLocation(
74 Manifest::Location location) {
75 scoped_ptr<base::DictionaryValue> test_extension_value(
76 extensions::api_test_utils::ParseDictionary(
77 "{\"name\": \"Test\", \"version\": \"1.0\"}"));
78 return extensions::api_test_utils::CreateExtension(
79 location, test_extension_value.get(), std::string());
80 }
81
82 bool HasPrivacySensitiveFields(base::DictionaryValue* val) { 73 bool HasPrivacySensitiveFields(base::DictionaryValue* val) {
83 std::string result; 74 std::string result;
84 if (val->GetString(keys::kUrlKey, &result) || 75 if (val->GetString(keys::kUrlKey, &result) ||
85 val->GetString(keys::kTitleKey, &result) || 76 val->GetString(keys::kTitleKey, &result) ||
86 val->GetString(keys::kFaviconUrlKey, &result)) 77 val->GetString(keys::kFaviconUrlKey, &result))
87 return true; 78 return true;
88 return false; 79 return false;
89 } 80 }
90 81
91 std::string RunFunctionAndReturnError(UIThreadExtensionFunction* function, 82 std::string RunFunctionAndReturnError(UIThreadExtensionFunction* function,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // only one place. See crbug.com/394840. 182 // only one place. See crbug.com/394840.
192 return extensions::api_test_utils::RunFunction( 183 return extensions::api_test_utils::RunFunction(
193 function, 184 function,
194 args.Pass(), 185 args.Pass(),
195 browser->profile(), 186 browser->profile(),
196 dispatcher.Pass(), 187 dispatcher.Pass(),
197 static_cast<extensions::api_test_utils::RunFunctionFlags>(flags)); 188 static_cast<extensions::api_test_utils::RunFunctionFlags>(flags));
198 } 189 }
199 190
200 } // namespace extension_function_test_utils 191 } // namespace extension_function_test_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698