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

Side by Side Diff: chrome/browser/search/hotword_service_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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/test/test_simple_task_runner.h" 9 #include "base/test/test_simple_task_runner.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 ExtensionService* extension_service() { return service_; } 104 ExtensionService* extension_service() { return service_; }
105 105
106 private: 106 private:
107 ExtensionService* service_; 107 ExtensionService* service_;
108 int uninstall_count_; 108 int uninstall_count_;
109 std::string extension_id_; 109 std::string extension_id_;
110 }; 110 };
111 111
112 KeyedService* BuildMockHotwordService(content::BrowserContext* context) { 112 scoped_ptr<KeyedService> BuildMockHotwordService(
113 return new MockHotwordService(static_cast<Profile*>(context)); 113 content::BrowserContext* context) {
114 return make_scoped_ptr(
115 new MockHotwordService(static_cast<Profile*>(context)));
114 } 116 }
115 117
116 } // namespace 118 } // namespace
117 119
118 class HotwordServiceTest : 120 class HotwordServiceTest :
119 public extensions::ExtensionServiceTestBase, 121 public extensions::ExtensionServiceTestBase,
120 public ::testing::WithParamInterface<const char*> { 122 public ::testing::WithParamInterface<const char*> {
121 protected: 123 protected:
122 HotwordServiceTest() {} 124 HotwordServiceTest() {}
123 virtual ~HotwordServiceTest() {} 125 virtual ~HotwordServiceTest() {}
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 EXPECT_EQ(1, audio_history_handler->GetAudioHistoryCalls()); 501 EXPECT_EQ(1, audio_history_handler->GetAudioHistoryCalls());
500 // We expect the next check for audio history to be in the queue. 502 // We expect the next check for audio history to be in the queue.
501 EXPECT_EQ(base::TimeDelta::FromDays(1), 503 EXPECT_EQ(base::TimeDelta::FromDays(1),
502 test_task_runner->NextPendingTaskDelay()); 504 test_task_runner->NextPendingTaskDelay());
503 EXPECT_TRUE(test_task_runner->HasPendingTask()); 505 EXPECT_TRUE(test_task_runner->HasPendingTask());
504 test_task_runner->RunPendingTasks(); 506 test_task_runner->RunPendingTasks();
505 EXPECT_EQ(2, audio_history_handler->GetAudioHistoryCalls()); 507 EXPECT_EQ(2, audio_history_handler->GetAudioHistoryCalls());
506 EXPECT_TRUE(test_task_runner->HasPendingTask()); 508 EXPECT_TRUE(test_task_runner->HasPendingTask());
507 test_task_runner->ClearPendingTasks(); 509 test_task_runner->ClearPendingTasks();
508 } 510 }
OLDNEW
« no previous file with comments | « chrome/browser/search/hotword_installer_browsertest.cc ('k') | chrome/browser/search_engines/template_url_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698