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

Side by Side Diff: extensions/browser/api/storage/settings_test_util.cc

Issue 2965153002: Migrate Extensions code to Task Scheduler API (Closed)
Patch Set: Self review Created 3 years, 5 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 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/storage/settings_test_util.h" 5 #include "extensions/browser/api/storage/settings_test_util.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/run_loop.h"
12 #include "base/values.h" 11 #include "base/values.h"
12 #include "content/public/test/test_utils.h"
13 #include "extensions/browser/api/storage/storage_frontend.h" 13 #include "extensions/browser/api/storage/storage_frontend.h"
14 #include "extensions/browser/extension_registry.h" 14 #include "extensions/browser/extension_registry.h"
15 #include "extensions/browser/extension_system_provider.h" 15 #include "extensions/browser/extension_system_provider.h"
16 #include "extensions/browser/extensions_browser_client.h" 16 #include "extensions/browser/extensions_browser_client.h"
17 #include "extensions/common/extension.h" 17 #include "extensions/common/extension.h"
18 #include "extensions/common/permissions/permissions_data.h" 18 #include "extensions/common/permissions/permissions_data.h"
19 19
20 namespace extensions { 20 namespace extensions {
21 21
22 namespace settings_test_util { 22 namespace settings_test_util {
(...skipping 20 matching lines...) Expand all
43 static void AssignStorage(ValueStore** dst, ValueStore* src) { 43 static void AssignStorage(ValueStore** dst, ValueStore* src) {
44 *dst = src; 44 *dst = src;
45 } 45 }
46 46
47 ValueStore* GetStorage(scoped_refptr<const Extension> extension, 47 ValueStore* GetStorage(scoped_refptr<const Extension> extension,
48 settings_namespace::Namespace settings_namespace, 48 settings_namespace::Namespace settings_namespace,
49 StorageFrontend* frontend) { 49 StorageFrontend* frontend) {
50 ValueStore* storage = NULL; 50 ValueStore* storage = NULL;
51 frontend->RunWithStorage( 51 frontend->RunWithStorage(
52 extension, settings_namespace, base::Bind(&AssignStorage, &storage)); 52 extension, settings_namespace, base::Bind(&AssignStorage, &storage));
53 base::RunLoop().RunUntilIdle(); 53 content::RunAllBlockingPoolTasksUntilIdle();
54 return storage; 54 return storage;
55 } 55 }
56 56
57 ValueStore* GetStorage(scoped_refptr<const Extension> extension, 57 ValueStore* GetStorage(scoped_refptr<const Extension> extension,
58 StorageFrontend* frontend) { 58 StorageFrontend* frontend) {
59 return GetStorage(extension, settings_namespace::SYNC, frontend); 59 return GetStorage(extension, settings_namespace::SYNC, frontend);
60 } 60 }
61 61
62 scoped_refptr<const Extension> AddExtensionWithId( 62 scoped_refptr<const Extension> AddExtensionWithId(
63 content::BrowserContext* context, 63 content::BrowserContext* context,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 it != permissions_set.end(); ++it) { 119 it != permissions_set.end(); ++it) {
120 DCHECK(extension->permissions_data()->HasAPIPermission(*it)); 120 DCHECK(extension->permissions_data()->HasAPIPermission(*it));
121 } 121 }
122 122
123 return extension; 123 return extension;
124 } 124 }
125 125
126 } // namespace settings_test_util 126 } // namespace settings_test_util
127 127
128 } // namespace extensions 128 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698