OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |