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

Side by Side Diff: extensions/renderer/mojo/stash_client_unittest.cc

Issue 1899083003: Convert //extensions/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <vector> 5 #include <vector>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "extensions/browser/mojo/stash_backend.h" 8 #include "extensions/browser/mojo/stash_backend.h"
9 #include "extensions/common/mojo/stash.mojom.h" 9 #include "extensions/common/mojo/stash.mojom.h"
10 #include "extensions/renderer/api_test_base.h" 10 #include "extensions/renderer/api_test_base.h"
(...skipping 13 matching lines...) Expand all
24 ApiTestBase::SetUp(); 24 ApiTestBase::SetUp();
25 stash_backend_.reset(new StashBackend(base::Closure())); 25 stash_backend_.reset(new StashBackend(base::Closure()));
26 PrepareEnvironment(api_test_env()); 26 PrepareEnvironment(api_test_env());
27 } 27 }
28 28
29 void PrepareEnvironment(ApiTestEnvironment* env) { 29 void PrepareEnvironment(ApiTestEnvironment* env) {
30 env->service_provider()->AddService(base::Bind( 30 env->service_provider()->AddService(base::Bind(
31 &StashBackend::BindToRequest, base::Unretained(stash_backend_.get()))); 31 &StashBackend::BindToRequest, base::Unretained(stash_backend_.get())));
32 } 32 }
33 33
34 scoped_ptr<StashBackend> stash_backend_; 34 std::unique_ptr<StashBackend> stash_backend_;
35 35
36 private: 36 private:
37 DISALLOW_COPY_AND_ASSIGN(StashClientTest); 37 DISALLOW_COPY_AND_ASSIGN(StashClientTest);
38 }; 38 };
39 39
40 // https://crbug.com/599898 40 // https://crbug.com/599898
41 #if defined(LEAK_SANITIZER) 41 #if defined(LEAK_SANITIZER)
42 #define MAYBE_StashAndRestore DISABLED_StashAndRestore 42 #define MAYBE_StashAndRestore DISABLED_StashAndRestore
43 #else 43 #else
44 #define MAYBE_StashAndRestore StashAndRestore 44 #define MAYBE_StashAndRestore StashAndRestore
45 #endif 45 #endif
46 // Test that stashing and restoring work correctly. 46 // Test that stashing and restoring work correctly.
47 TEST_F(StashClientTest, MAYBE_StashAndRestore) { 47 TEST_F(StashClientTest, MAYBE_StashAndRestore) {
48 ASSERT_NO_FATAL_FAILURE(RunTest("stash_client_unittest.js", "testStash")); 48 ASSERT_NO_FATAL_FAILURE(RunTest("stash_client_unittest.js", "testStash"));
49 scoped_ptr<ModuleSystemTestEnvironment> restore_test_env(CreateEnvironment()); 49 std::unique_ptr<ModuleSystemTestEnvironment> restore_test_env(
50 CreateEnvironment());
50 ApiTestEnvironment restore_environment(restore_test_env.get()); 51 ApiTestEnvironment restore_environment(restore_test_env.get());
51 PrepareEnvironment(&restore_environment); 52 PrepareEnvironment(&restore_environment);
52 restore_environment.RunTest("stash_client_unittest.js", "testRetrieve"); 53 restore_environment.RunTest("stash_client_unittest.js", "testRetrieve");
53 } 54 }
54 55
55 } // namespace extensions 56 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/module_system_unittest.cc ('k') | extensions/renderer/programmatic_script_injector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698