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

Side by Side Diff: extensions/browser/api_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: Rebased Created 5 years, 10 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
« no previous file with comments | « extensions/browser/api_test_utils.h ('k') | extensions/browser/api_unittest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/api_test_utils.h" 5 #include "extensions/browser/api_test_utils.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "components/crx_file/id_util.h" 10 #include "components/crx_file/id_util.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 EXPECT_TRUE(error.empty()) << "Could not parse test extension " << error; 128 EXPECT_TRUE(error.empty()) << "Could not parse test extension " << error;
129 return extension; 129 return extension;
130 } 130 }
131 131
132 scoped_refptr<Extension> CreateExtension( 132 scoped_refptr<Extension> CreateExtension(
133 base::DictionaryValue* test_extension_value) { 133 base::DictionaryValue* test_extension_value) {
134 return CreateExtension(Manifest::INTERNAL, test_extension_value, 134 return CreateExtension(Manifest::INTERNAL, test_extension_value,
135 std::string()); 135 std::string());
136 } 136 }
137 137
138 scoped_refptr<Extension> CreateEmptyExtensionWithLocation(
139 Manifest::Location location) {
140 scoped_ptr<base::DictionaryValue> test_extension_value(
141 ParseDictionary("{\"name\": \"Test\", \"version\": \"1.0\"}"));
142 return CreateExtension(location, test_extension_value.get(), std::string());
143 }
144
138 base::Value* RunFunctionWithDelegateAndReturnSingleResult( 145 base::Value* RunFunctionWithDelegateAndReturnSingleResult(
139 UIThreadExtensionFunction* function, 146 UIThreadExtensionFunction* function,
140 const std::string& args, 147 const std::string& args,
141 content::BrowserContext* context, 148 content::BrowserContext* context,
142 scoped_ptr<extensions::ExtensionFunctionDispatcher> dispatcher) { 149 scoped_ptr<extensions::ExtensionFunctionDispatcher> dispatcher) {
143 return RunFunctionWithDelegateAndReturnSingleResult( 150 return RunFunctionWithDelegateAndReturnSingleResult(
144 function, args, context, dispatcher.Pass(), NONE); 151 function, args, context, dispatcher.Pass(), NONE);
145 } 152 }
146 153
147 base::Value* RunFunctionWithDelegateAndReturnSingleResult( 154 base::Value* RunFunctionWithDelegateAndReturnSingleResult(
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 response_delegate.set_should_post_quit(true); 255 response_delegate.set_should_post_quit(true);
249 content::RunMessageLoop(); 256 content::RunMessageLoop();
250 } 257 }
251 258
252 EXPECT_TRUE(response_delegate.HasResponse()); 259 EXPECT_TRUE(response_delegate.HasResponse());
253 return response_delegate.GetResponse(); 260 return response_delegate.GetResponse();
254 } 261 }
255 262
256 } // namespace api_test_utils 263 } // namespace api_test_utils
257 } // namespace extensions 264 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api_test_utils.h ('k') | extensions/browser/api_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698