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

Side by Side Diff: content/browser/service_worker/service_worker_process_manager_unittest.cc

Issue 2256173002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace a WrapUnique() nested inside a MakeUnique() Created 4 years, 3 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 "content/browser/service_worker/service_worker_process_manager.h" 5 #include "content/browser/service_worker/service_worker_process_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 pattern_ = GURL("http://www.example.com/"); 48 pattern_ = GURL("http://www.example.com/");
49 script_url_ = GURL("http://www.example.com/sw.js"); 49 script_url_ = GURL("http://www.example.com/sw.js");
50 } 50 }
51 51
52 void TearDown() override { 52 void TearDown() override {
53 process_manager_->Shutdown(); 53 process_manager_->Shutdown();
54 process_manager_.reset(); 54 process_manager_.reset();
55 } 55 }
56 56
57 std::unique_ptr<MockRenderProcessHost> CreateRenderProcessHost() { 57 std::unique_ptr<MockRenderProcessHost> CreateRenderProcessHost() {
58 return base::WrapUnique(new MockRenderProcessHost(browser_context_.get())); 58 return base::MakeUnique<MockRenderProcessHost>(browser_context_.get());
59 } 59 }
60 60
61 protected: 61 protected:
62 std::unique_ptr<TestBrowserContext> browser_context_; 62 std::unique_ptr<TestBrowserContext> browser_context_;
63 std::unique_ptr<ServiceWorkerProcessManager> process_manager_; 63 std::unique_ptr<ServiceWorkerProcessManager> process_manager_;
64 GURL pattern_; 64 GURL pattern_;
65 GURL script_url_; 65 GURL script_url_;
66 66
67 private: 67 private:
68 content::TestBrowserThreadBundle thread_bundle_; 68 content::TestBrowserThreadBundle thread_bundle_;
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 run_loop.Run(); 247 run_loop.Run();
248 248
249 // Allocating a process in shutdown should abort. 249 // Allocating a process in shutdown should abort.
250 EXPECT_EQ(SERVICE_WORKER_ERROR_ABORT, status); 250 EXPECT_EQ(SERVICE_WORKER_ERROR_ABORT, status);
251 EXPECT_EQ(ChildProcessHost::kInvalidUniqueID, process_id); 251 EXPECT_EQ(ChildProcessHost::kInvalidUniqueID, process_id);
252 EXPECT_FALSE(is_new_process); 252 EXPECT_FALSE(is_new_process);
253 EXPECT_TRUE(process_manager_->instance_info_.empty()); 253 EXPECT_TRUE(process_manager_->instance_info_.empty());
254 } 254 }
255 255
256 } // namespace content 256 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698