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

Side by Side Diff: chrome/browser/extensions/api/image_writer_private/operation_manager_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h"
6 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h" 7 #include "chrome/browser/extensions/api/image_writer_private/error_messages.h"
7 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h " 8 #include "chrome/browser/extensions/api/image_writer_private/operation_manager.h "
8 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h" 9 #include "chrome/browser/extensions/api/image_writer_private/test_utils.h"
9 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/extension_system_factory.h" 11 #include "chrome/browser/extensions/extension_system_factory.h"
11 #include "chrome/browser/extensions/test_extension_system.h" 12 #include "chrome/browser/extensions/test_extension_system.h"
12 #include "chrome/test/base/testing_profile.h" 13 #include "chrome/test/base/testing_profile.h"
13 #include "extensions/browser/event_router.h" 14 #include "extensions/browser/event_router.h"
14 #include "extensions/browser/event_router_factory.h" 15 #include "extensions/browser/event_router_factory.h"
15 16
(...skipping 12 matching lines...) Expand all
28 public: 29 public:
29 explicit FakeEventRouter(Profile* profile) : EventRouter(profile, NULL) {} 30 explicit FakeEventRouter(Profile* profile) : EventRouter(profile, NULL) {}
30 31
31 void DispatchEventToExtension(const std::string& extension_id, 32 void DispatchEventToExtension(const std::string& extension_id,
32 scoped_ptr<extensions::Event> event) override { 33 scoped_ptr<extensions::Event> event) override {
33 // Do nothing with the event as no tests currently care. 34 // Do nothing with the event as no tests currently care.
34 } 35 }
35 }; 36 };
36 37
37 // FakeEventRouter factory function 38 // FakeEventRouter factory function
38 KeyedService* FakeEventRouterFactoryFunction(content::BrowserContext* context) { 39 scoped_ptr<KeyedService> FakeEventRouterFactoryFunction(
39 return new FakeEventRouter(static_cast<Profile*>(context)); 40 content::BrowserContext* context) {
41 return make_scoped_ptr(new FakeEventRouter(static_cast<Profile*>(context)));
40 } 42 }
41 43
42 namespace { 44 namespace {
43 45
44 class ImageWriterOperationManagerTest : public ImageWriterUnitTestBase { 46 class ImageWriterOperationManagerTest : public ImageWriterUnitTestBase {
45 public: 47 public:
46 void StartCallback(bool success, const std::string& error) { 48 void StartCallback(bool success, const std::string& error) {
47 started_ = true; 49 started_ = true;
48 start_success_ = success; 50 start_success_ = success;
49 start_error_ = error; 51 start_error_ = error;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 EXPECT_TRUE(cancelled_); 135 EXPECT_TRUE(cancelled_);
134 EXPECT_TRUE(cancel_success_); 136 EXPECT_TRUE(cancel_success_);
135 EXPECT_EQ("", cancel_error_); 137 EXPECT_EQ("", cancel_error_);
136 138
137 base::RunLoop().RunUntilIdle(); 139 base::RunLoop().RunUntilIdle();
138 } 140 }
139 141
140 } // namespace 142 } // namespace
141 } // namespace image_writer 143 } // namespace image_writer
142 } // namespace extensions 144 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698