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

Side by Side Diff: chrome/browser/extensions/api/hotword_private/hotword_private_apitest.cc

Issue 197413002: Move extensions-related files to using //components/keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 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 | Annotate | Revision Log
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/prefs/pref_service.h" 5 #include "base/prefs/pref_service.h"
6 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h" 6 #include "chrome/browser/extensions/api/hotword_private/hotword_private_api.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_test_message_listener.h" 9 #include "chrome/browser/extensions/extension_test_message_listener.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 10 matching lines...) Expand all
21 virtual ~MockHotwordService() {} 21 virtual ~MockHotwordService() {}
22 22
23 virtual bool IsServiceAvailable() OVERRIDE { 23 virtual bool IsServiceAvailable() OVERRIDE {
24 return service_available_; 24 return service_available_;
25 } 25 }
26 26
27 void setServiceAvailable(bool available) { 27 void setServiceAvailable(bool available) {
28 service_available_ = available; 28 service_available_ = available;
29 } 29 }
30 30
31 static BrowserContextKeyedService* Build(content::BrowserContext* profile) { 31 static KeyedService* Build(content::BrowserContext* profile) {
32 return new MockHotwordService(static_cast<Profile*>(profile)); 32 return new MockHotwordService(static_cast<Profile*>(profile));
33 } 33 }
34 34
35 private: 35 private:
36 bool service_available_; 36 bool service_available_;
37 37
38 DISALLOW_COPY_AND_ASSIGN(MockHotwordService); 38 DISALLOW_COPY_AND_ASSIGN(MockHotwordService);
39 }; 39 };
40 40
41 class HotwordPrivateApiTest : public ExtensionApiTest { 41 class HotwordPrivateApiTest : public ExtensionApiTest {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 extensions::HotwordPrivateEventService::GetFactoryInstance(); 102 extensions::HotwordPrivateEventService::GetFactoryInstance();
103 ExtensionTestMessageListener listener("ready", false); 103 ExtensionTestMessageListener listener("ready", false);
104 LoadExtensionAsComponent( 104 LoadExtensionAsComponent(
105 test_data_dir_.AppendASCII("onEnabledChanged")); 105 test_data_dir_.AppendASCII("onEnabledChanged"));
106 EXPECT_TRUE(listener.WaitUntilSatisfied()); 106 EXPECT_TRUE(listener.WaitUntilSatisfied());
107 107
108 ExtensionTestMessageListener listenerNotification("notification", false); 108 ExtensionTestMessageListener listenerNotification("notification", false);
109 profile()->GetPrefs()->SetBoolean(prefs::kHotwordSearchEnabled, true); 109 profile()->GetPrefs()->SetBoolean(prefs::kHotwordSearchEnabled, true);
110 EXPECT_TRUE(listenerNotification.WaitUntilSatisfied()); 110 EXPECT_TRUE(listenerNotification.WaitUntilSatisfied());
111 } 111 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/history/history_api.h ('k') | chrome/browser/extensions/api/idle/idle_api_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698