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

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

Issue 1165913002: [Cleanup] Used scoped pointers in KeyedServiceFactory's SetTestingFactory functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finish renaming profile -> context Created 5 years, 6 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 void TearDown() override { 53 void TearDown() override {
54 frontend_.reset(); 54 frontend_.reset();
55 // Execute any pending deletion tasks. 55 // Execute any pending deletion tasks.
56 message_loop_.RunUntilIdle(); 56 message_loop_.RunUntilIdle();
57 ExtensionsTest::TearDown(); 57 ExtensionsTest::TearDown();
58 } 58 }
59 59
60 protected: 60 protected:
61 void ResetFrontend() { 61 void ResetFrontend() {
62 storage_factory_->Reset(new LeveldbSettingsStorageFactory()); 62 storage_factory_->Reset(new LeveldbSettingsStorageFactory());
63 frontend_.reset( 63 frontend_ = StorageFrontend::CreateForTesting(storage_factory_,
64 StorageFrontend::CreateForTesting(storage_factory_, browser_context())); 64 browser_context()).Pass();
65 } 65 }
66 66
67 base::ScopedTempDir temp_dir_; 67 base::ScopedTempDir temp_dir_;
68 scoped_ptr<StorageFrontend> frontend_; 68 scoped_ptr<StorageFrontend> frontend_;
69 scoped_refptr<util::ScopedSettingsStorageFactory> storage_factory_; 69 scoped_refptr<util::ScopedSettingsStorageFactory> storage_factory_;
70 70
71 private: 71 private:
72 base::MessageLoop message_loop_; 72 base::MessageLoop message_loop_;
73 content::TestBrowserThread ui_thread_; 73 content::TestBrowserThread ui_thread_;
74 content::TestBrowserThread file_thread_; 74 content::TestBrowserThread file_thread_;
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 // Local storage should run out after ~5MB. 211 // Local storage should run out after ~5MB.
212 scoped_ptr<base::Value> megabyte = util::CreateMegabyte(); 212 scoped_ptr<base::Value> megabyte = util::CreateMegabyte();
213 for (int i = 0; i < 5; ++i) { 213 for (int i = 0; i < 5; ++i) {
214 local_storage->Set(DEFAULTS, base::StringPrintf("%d", i), *megabyte); 214 local_storage->Set(DEFAULTS, base::StringPrintf("%d", i), *megabyte);
215 } 215 }
216 216
217 EXPECT_TRUE(local_storage->Set(DEFAULTS, "WillError", *megabyte)->HasError()); 217 EXPECT_TRUE(local_storage->Set(DEFAULTS, "WillError", *megabyte)->HasError());
218 } 218 }
219 219
220 } // namespace extensions 220 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/storage_frontend.cc ('k') | extensions/browser/extension_prefs_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698